Extends
lithium\core\StaticObjectSource
public static function find($type, $options = array()) {
if (!empty($options['channel'])) {
$path = static::path($options['channel']);
if (!is_dir($path)) {
return array();
}
return array_values(array_filter(scandir($path), function ($file) {
return $file[0] != '.';
}));
}
$directory = new DirectoryIterator(static::$path);
$results = array();
foreach ($directory as $dir) {
$name = $dir->getFilename();
if ($dir->isDot() || !$dir->isDir()) {
continue;
}
$results[] = $name;
}
return $results;
}