protected static function getControllersList($paths, $namespaces_list)
{
$controllers = array();
foreach ($paths as $p_index => $p) {
if (!file_exists($p)) {
throw new TaskManagerException('folder ' . $p . ' does not exist');
}
$files = scandir($p);
foreach ($files as $f) {
if (preg_match('/^([A-Z]\\w+)\\.php$/', $f, $match)) {
$namespace = isset($namespaces_list[$p_index]) ? $namespaces_list[$p_index] : '';
$controllers[] = $namespace . $match[1];
}
}
}
return $controllers;
}