src/TaskLoader.php
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;
    }
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;
    }
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 ; }
Returns names of all php files in directories
@param array $paths
@param $namespaces_list
@return array
@throws TaskManagerException
Returns names of all php files in directories