public function dump($inputDirectory, $outputDirectory, $dumpVendorModules = true)
    {
        $modulesList = [];

        //extracts list of modules from module directory
        $directoryIterator = new \DirectoryIterator($inputDirectory);
        foreach ($directoryIterator as $moduleDir) {
            if ($moduleDir->isDot()) {
                continue;
            }

            $moduleSettingsFile = $moduleDir->getPathname()
                                        . DIRECTORY_SEPARATOR
                                        . self::MODULE_SETTINGS_FILE;
            if (!file_exists($moduleSettingsFile)) {
                continue;
            }
            $modulesList[$moduleDir->getBasename()] = [
                'className' =>  $moduleDir->getBasename()
                                        . '\\'
                                        . pathinfo(self::MODULE_SETTINGS_FILE, PATHINFO_FILENAME),
                'path'  =>  $moduleSettingsFile
            ];
        }

        if ($dumpVendorModules) {
            $this->dumpModulesFromVendor($modulesList);
        }

        //saves generated array to php source file
        FileWriter::writeObject(
            $outputDirectory . self::MODULE_STATIC_FILE,
            $modulesList,
            true
        );

        return $modulesList;
    }
public function dump($inputDirectory, $outputDirectory, $dumpVendorModules = true)
    {
        $modulesList = [];

        //extracts list of modules from module directory
        $directoryIterator = new \DirectoryIterator($inputDirectory);
        foreach ($directoryIterator as $moduleDir) {
            if ($moduleDir->isDot()) {
                continue;
            }

            $moduleSettingsFile = $moduleDir->getPathname()
                                        . DIRECTORY_SEPARATOR
                                        . self::MODULE_SETTINGS_FILE;
            if (!file_exists($moduleSettingsFile)) {
                continue;
            }
            $modulesList[$moduleDir->getBasename()] = [
                'className' =>  $moduleDir->getBasename()
                                        . '\\'
                                        . pathinfo(self::MODULE_SETTINGS_FILE, PATHINFO_FILENAME),
                'path'  =>  $moduleSettingsFile
            ];
        }

        if ($dumpVendorModules) {
            $this->dumpModulesFromVendor($modulesList);
        }

        //saves generated array to php source file
        FileWriter::writeObject(
            $outputDirectory . self::MODULE_STATIC_FILE,
            $modulesList,
            true
        );

        return $modulesList;
    }
public function dump ( $ inputDirectory , $ outputDirectory , $ dumpVendorModules = true ) { $ modulesList = [ ] ; //extracts list of modules from module directory $ directoryIterator = new \ DirectoryIterator ( $ inputDirectory ) ; foreach ( $ directoryIterator as $ moduleDir ) { if ( $ moduleDir -> isDot ( ) ) { continue ; } $ moduleSettingsFile = $ moduleDir -> getPathname ( ) . DIRECTORY_SEPARATOR . self :: MODULE_SETTINGS_FILE ; if ( ! file_exists ( $ moduleSettingsFile ) ) { continue ; } $ modulesList [ $ moduleDir -> getBasename ( ) ] = [ 'className' => $ moduleDir -> getBasename ( ) . '\\' . pathinfo ( self :: MODULE_SETTINGS_FILE , PATHINFO_FILENAME ) , 'path' => $ moduleSettingsFile ] ; } if ( $ dumpVendorModules ) { $ this -> dumpModulesFromVendor ( $ modulesList ) ; } //saves generated array to php source file FileWriter :: writeObject ( $ outputDirectory . self :: MODULE_STATIC_FILE , $ modulesList , true ) ; return $ modulesList ; }
Generates list of modules into source file

@param string $inputDirectory
@param string $outputDirectory
@param bool $dumpVendorModules
@return array
Generates list of modules into source file