src/Classes/Module.php
public static function getModulesByFile($file = 'Module.php')
    {
        $modules = Module::getModules();
        $source = app_path('Modules' . DIRECTORY_SEPARATOR . '{author}' . DIRECTORY_SEPARATOR . '{module}' . DIRECTORY_SEPARATOR . $file);
        $files = [];
        if ($modules && count($modules))
            foreach ($modules as $author => $subModules)
            {
                foreach ($subModules as $module)
                {
                    $data = ['{author}' => $module['author'], '{module}' => $module['name']];
                    $real_source = str_replace(array_keys($data), array_values($data), $source);
                    if (\File::exists($real_source))
                    {
                        $files[] = [
                            'author' => $author,
                            'module' => $module,
                            'name' => $author . DIRECTORY_SEPARATOR . $module['name'],
                            'installed' => isset($module['installed']),
                        ];
                    }
                }
            }
        return $files;
    }
public static function getModulesByFile($file = 'Module.php')
    {
        $modules = Module::getModules();
        $source = app_path('Modules' . DIRECTORY_SEPARATOR . '{author}' . DIRECTORY_SEPARATOR . '{module}' . DIRECTORY_SEPARATOR . $file);
        $files = [];
        if ($modules && count($modules))
            foreach ($modules as $author => $subModules)
            {
                foreach ($subModules as $module)
                {
                    $data = ['{author}' => $module['author'], '{module}' => $module['name']];
                    $real_source = str_replace(array_keys($data), array_values($data), $source);
                    if (\File::exists($real_source))
                    {
                        $files[] = [
                            'author' => $author,
                            'module' => $module,
                            'name' => $author . DIRECTORY_SEPARATOR . $module['name'],
                            'installed' => isset($module['installed']),
                        ];
                    }
                }
            }
        return $files;
    }
public static function getModulesByFile ( $ file = 'Module.php' ) { $ modules = Module :: getModules ( ) ; $ source = app_path ( 'Modules' . DIRECTORY_SEPARATOR . '{author}' . DIRECTORY_SEPARATOR . '{module}' . DIRECTORY_SEPARATOR . $ file ) ; $ files = [ ] ; if ( $ modules && count ( $ modules ) ) foreach ( $ modules as $ author => $ subModules ) { foreach ( $ subModules as $ module ) { $ data = [ '{author}' => $ module [ 'author' ] , '{module}' => $ module [ 'name' ] ] ; $ real_source = str_replace ( array_keys ( $ data ) , array_values ( $ data ) , $ source ) ; if ( \ File :: exists ( $ real_source ) ) { $ files [ ] = [ 'author' => $ author , 'module' => $ module , 'name' => $ author . DIRECTORY_SEPARATOR . $ module [ 'name' ] , 'installed' => isset ( $ module [ 'installed' ] ) , ] ; } } } return $ files ; }
Get name of all modules that exists
@param string $file that must be exits
@return array
Get name of all modules that exists