1 | <?php |
||
19 | class Base extends Handler |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Config class instance |
||
24 | * @var \gplcart\core\Config $config |
||
25 | */ |
||
26 | protected $config; |
||
27 | |||
28 | /** |
||
29 | * Translation UI model class instance |
||
30 | * @var \gplcart\core\models\Translation $translation |
||
31 | */ |
||
32 | protected $translation; |
||
33 | |||
34 | /** |
||
35 | * Command model class instance |
||
36 | * @var \gplcart\modules\file_manager\models\Command $command |
||
37 | */ |
||
38 | protected $command; |
||
39 | |||
40 | /** |
||
41 | * Scanner model class instance |
||
42 | * @var \gplcart\modules\file_manager\models\Scanner $scanner |
||
43 | */ |
||
44 | protected $scanner; |
||
45 | |||
46 | /** |
||
47 | * Constructor |
||
48 | */ |
||
49 | public function __construct() |
||
56 | |||
57 | /** |
||
58 | * Sets a property |
||
59 | * @param string $name |
||
60 | * @param mixed $value |
||
61 | */ |
||
62 | public function setProperty($name, $value) |
||
66 | |||
67 | /** |
||
68 | * Returns a total number of scanned files |
||
69 | * @param string $directory |
||
70 | * @param array $options |
||
71 | * @return integer |
||
72 | */ |
||
73 | protected function getTotal($directory, array $options = array()) |
||
78 | |||
79 | /** |
||
80 | * Returns an array of scanned files |
||
81 | * @param string $directory |
||
82 | * @param array $options |
||
83 | * @return array |
||
84 | */ |
||
85 | protected function getFiles($directory, array $options = array()) |
||
89 | |||
90 | /** |
||
91 | * Returns a normalized relative path for the file |
||
92 | * @param string $file |
||
93 | * @return string |
||
94 | */ |
||
95 | protected function getRelativeFilePath($file) |
||
99 | |||
100 | /** |
||
101 | * Returns a relative file path or initial directory |
||
102 | * @param null|string $path |
||
103 | * @return string |
||
104 | */ |
||
105 | protected function getRelativePath($path = null) |
||
113 | |||
114 | /** |
||
115 | * Returns a relative directory path for the file |
||
116 | * @param string $file |
||
117 | * @return string |
||
118 | */ |
||
119 | protected function getRelativeDirectory($file) |
||
123 | |||
124 | /** |
||
125 | * Moves a file to a new destination |
||
126 | * @param string $src |
||
127 | * @param string $dest |
||
128 | * @param int $errors |
||
129 | * @param int $success |
||
130 | * @return bool |
||
131 | */ |
||
132 | protected function move($src, $dest, &$errors = 0, &$success = 0) |
||
142 | |||
143 | /** |
||
144 | * Copy a file / directory |
||
145 | * @param string $src |
||
146 | * @param string $dest |
||
147 | * @param int $errors |
||
148 | * @param int $success |
||
149 | * @return boolean |
||
150 | */ |
||
151 | protected function copy($src, $dest, &$errors = 0, &$success = 0) |
||
189 | |||
190 | /** |
||
191 | * Whether the current file is the initial file manager path |
||
192 | * @param \SplFileInfo $file |
||
193 | * @return bool |
||
194 | */ |
||
195 | protected function isInitialPath($file) |
||
201 | |||
202 | } |
||
203 |