1 | <?php |
||
19 | class Command extends Handler |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Scanner model class instance |
||
24 | * @var \gplcart\modules\file_manager\models\Scanner $scanner |
||
25 | */ |
||
26 | protected $scanner; |
||
27 | |||
28 | /** |
||
29 | * Translation UI model class instance |
||
30 | * @var \gplcart\core\models\Translation $translation |
||
31 | */ |
||
32 | protected $translation; |
||
33 | |||
34 | /** |
||
35 | * Constructor |
||
36 | */ |
||
37 | public function __construct() |
||
42 | |||
43 | /** |
||
44 | * Sets a property |
||
45 | * @param string $name |
||
46 | * @param mixed $value |
||
47 | */ |
||
48 | public function setProperty($name, $value) |
||
52 | |||
53 | /** |
||
54 | * Returns a total number of scanned files |
||
55 | * @param string $directory |
||
56 | * @param array $options |
||
57 | * @return integer |
||
58 | */ |
||
59 | protected function getTotal($directory, array $options = array()) |
||
64 | |||
65 | /** |
||
66 | * Returns an array of scanned files |
||
67 | * @param string $directory |
||
68 | * @param array $options |
||
69 | * @return array |
||
70 | */ |
||
71 | protected function getFiles($directory, array $options = array()) |
||
75 | |||
76 | /** |
||
77 | * Returns a normalized relative path for the file |
||
78 | * @param string $file |
||
79 | * @return string |
||
80 | */ |
||
81 | protected function getRelativeFilePath($file) |
||
85 | |||
86 | /** |
||
87 | * Returns a relative file path or initial directory |
||
88 | * @param null|string $path |
||
89 | * @return string |
||
90 | */ |
||
91 | protected function getRelativePath($path = null) |
||
99 | |||
100 | /** |
||
101 | * Returns a relative directory path for the file |
||
102 | * @param string $file |
||
103 | * @return string |
||
104 | */ |
||
105 | protected function getRelativeDirectory($file) |
||
109 | |||
110 | /** |
||
111 | * Moves a file to a new destination |
||
112 | * @param string $src |
||
113 | * @param string $dest |
||
114 | * @param int $errors |
||
115 | * @param int $success |
||
116 | * @return bool |
||
117 | */ |
||
118 | protected function move($src, $dest, &$errors = 0, &$success = 0) |
||
128 | |||
129 | /** |
||
130 | * Copy a file / directory |
||
131 | * @param string $src |
||
132 | * @param string $dest |
||
133 | * @param int $errors |
||
134 | * @param int $success |
||
135 | * @return boolean |
||
136 | */ |
||
137 | protected function copy($src, $dest, &$errors = 0, &$success = 0) |
||
178 | |||
179 | /** |
||
180 | * Whether the current file is the initial file manager path |
||
181 | * @param \SplFileInfo $file |
||
182 | * @return bool |
||
183 | */ |
||
184 | protected function isInitialPath($file) |
||
191 | |||
192 | } |
||
193 |