1 | <?php |
||
21 | class Scanner |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Hook class instance |
||
26 | * @var \gplcart\core\Hook $hook |
||
27 | */ |
||
28 | protected $hook; |
||
29 | |||
30 | /** |
||
31 | * Module class instance |
||
32 | * @var \gplcart\core\Module $module |
||
33 | */ |
||
34 | protected $module; |
||
35 | |||
36 | /** |
||
37 | * @param Hook $hook |
||
38 | * @param Module $module |
||
39 | */ |
||
40 | public function __construct(Hook $hook, Module $module) |
||
45 | |||
46 | /** |
||
47 | * Returns an array of scanned files or counts them |
||
48 | * @param string $directory |
||
49 | * @param array $options |
||
50 | * @return array|integer |
||
51 | */ |
||
52 | public function scan($directory, array $options = array()) |
||
88 | |||
89 | /** |
||
90 | * Sorts an array of files |
||
91 | * @param array $files |
||
92 | * @param string $sort |
||
93 | * @param string $order |
||
94 | */ |
||
95 | protected function sort(array &$files, $sort, $order) |
||
107 | |||
108 | /** |
||
109 | * Returns an array of supported filters |
||
110 | * @return array |
||
111 | */ |
||
112 | public function getFilters() |
||
124 | |||
125 | /** |
||
126 | * Returns an array of file sorters |
||
127 | * @return array |
||
128 | */ |
||
129 | public function getSorters() |
||
141 | |||
142 | /** |
||
143 | * Returns a string with initial path to scan files |
||
144 | * @param bool|null|string $absolute |
||
145 | * @return string |
||
146 | */ |
||
147 | public function getInitialPath($absolute = false) |
||
152 | |||
153 | } |
||
154 |
If you suppress an error, we recommend checking for the error condition explicitly: