Jelix\Core\AppInstance::declareModulesDir PHP Method

declareModulesDir() public method

Declare a list of modules.
public declareModulesDir ( string | array $basePath, $modules = null )
$basePath string | array the directory path containing modules that can be used
    public function declareModulesDir($basePath, $modules = null)
    {
        $this->_allModulesPath = null;
        $this->_allPluginsPath = null;
        if (is_array($basePath)) {
            foreach ($basePath as $path) {
                $p = realpath($path);
                if ($p == '') {
                    throw new \Exception('Given modules dir ' . $path . 'does not exists');
                }
                $this->_modulesDirPath[rtrim($p, '/')] = null;
            }
        } else {
            $p = realpath($basePath);
            if ($p == '') {
                throw new \Exception('Given modules dir ' . $basePath . 'does not exists');
            }
            $this->_modulesDirPath[rtrim($p, '/')] = $modules;
        }
    }