scratch – Diff between revs 115 and 117
?pathlinks?
Rev 115 | Rev 117 | |||
---|---|---|---|---|
Line 274... | Line 274... | |||
274 | if (!$overwrite && $this->isReadable($target)) { |
274 | if (!$overwrite && $this->isReadable($target)) { |
|
275 | throw new IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); |
275 | throw new IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); |
|
276 | } |
276 | } |
|
Line 277... | Line 277... | |||
277 | |
277 | |
|
- | 278 | if (true !== @rename($origin, $target)) { |
||
- | 279 | if (is_dir($origin)) { |
||
- | 280 | // See https://bugs.php.net/bug.php?id=54097 & http://php.net/manual/en/function.rename.php#113943 |
||
- | 281 | $this->mirror($origin, $target, null, array('override' => $overwrite, 'delete' => $overwrite)); |
||
- | 282 | $this->remove($origin); |
||
- | 283 | |
||
- | 284 | return; |
||
278 | if (true !== @rename($origin, $target)) { |
285 | } |
|
279 | throw new IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target), 0, null, $target); |
286 | throw new IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target), 0, null, $target); |
|
280 | } |
287 | } |
|
Line 281... | Line 288... | |||
281 | } |
288 | } |