mult1mate\crontab\TaskLoader::getControllersList PHP Method

getControllersList() protected static method

Returns names of all php files in directories
protected static getControllersList ( array $paths, $namespaces_list ) : array
$paths array
$namespaces_list
return array
    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;
    }