1 | <?php |
||
11 | class ForcedRename extends AbstractPlugin |
||
12 | { |
||
13 | /** |
||
14 | * @inheritdoc |
||
15 | */ |
||
16 | 210 | public function getMethod() |
|
20 | |||
21 | /** |
||
22 | * Renames a file. |
||
23 | * |
||
24 | * @param string $path path to file |
||
25 | * @param string $newpath new path |
||
26 | * |
||
27 | * @return bool |
||
28 | * |
||
29 | * @throws \League\Flysystem\FileNotFoundException |
||
30 | * @throws \Twistor\Flysystem\Exception\DirectoryExistsException |
||
31 | * @throws \Twistor\Flysystem\Exception\DirectoryNotEmptyException |
||
32 | * @throws \Twistor\Flysystem\Exception\NotADirectoryException |
||
33 | */ |
||
34 | 39 | public function handle($path, $newpath) |
|
51 | |||
52 | /** |
||
53 | * Checks that a rename is valid. |
||
54 | * |
||
55 | * @param string $source |
||
56 | * @param string $dest |
||
57 | * |
||
58 | * @return bool |
||
59 | * |
||
60 | * @throws \League\Flysystem\FileNotFoundException |
||
61 | * @throws \Twistor\Flysystem\Exception\DirectoryExistsException |
||
62 | * @throws \Twistor\Flysystem\Exception\DirectoryNotEmptyException |
||
63 | * @throws \Twistor\Flysystem\Exception\NotADirectoryException |
||
64 | */ |
||
65 | 39 | protected function isValidRename($source, $dest) |
|
85 | |||
86 | /** |
||
87 | * Compares the file/dir for the source and dest. |
||
88 | * |
||
89 | * @param string $source |
||
90 | * @param string $dest |
||
91 | * |
||
92 | * @return bool |
||
93 | * |
||
94 | * @throws \Twistor\Flysystem\Exception\DirectoryExistsException |
||
95 | * @throws \Twistor\Flysystem\Exception\DirectoryNotEmptyException |
||
96 | * @throws \Twistor\Flysystem\Exception\NotADirectoryException |
||
97 | */ |
||
98 | 27 | protected function compareTypes($source, $dest) |
|
130 | } |
||
131 |