protected function _readModuleInfo($config, $allModuleInfo, $path, &$installation, $section)
{
$moduleInfo = new \Jelix\Core\Infos\ModuleInfos($path);
if (!$moduleInfo->exists()) {
return null;
}
$f = $moduleInfo->name;
if ($config->disableInstallers) {
$installation[$section][$f . '.installed'] = 1;
} else {
if (!isset($installation[$section][$f . '.installed'])) {
$installation[$section][$f . '.installed'] = 0;
}
}
if ($f == 'jelix') {
$config->modules['jelix.access'] = 2;
// the jelix module should always be public
} else {
if ($config->enableAllModules) {
if ($config->disableInstallers || $installation[$section][$f . '.installed'] || $allModuleInfo) {
$config->modules[$f . '.access'] = 2;
} else {
$config->modules[$f . '.access'] = 0;
}
} else {
if (!isset($config->modules[$f . '.access'])) {
// no given access in defaultconfig and ep config
$config->modules[$f . '.access'] = 0;
} else {
if ($config->modules[$f . '.access'] == 0) {
// we want to activate the module if it is not activated
// for the entry point, but is declared activated
// in the default config file. In this case, it means
// that it is activated for an other entry point,
// and then we want the possibility to retrieve its
// urls, at least
if (isset($this->commonConfig->modules[$f . '.access']) && $this->commonConfig->modules[$f . '.access'] > 0) {
$config->modules[$f . '.access'] = 3;
}
} else {
if (!$installation[$section][$f . '.installed']) {
// module is not installed.
// outside installation mode, we force the access to 0
// so the module is unusable until it is installed
if (!$allModuleInfo) {
$config->modules[$f . '.access'] = 0;
}
}
}
}
}
}
if (!$config->modules[$f . '.access']) {
return null;
}
if (!isset($installation[$section][$f . '.dbprofile'])) {
$config->modules[$f . '.dbprofile'] = 'default';
} else {
$config->modules[$f . '.dbprofile'] = $installation[$section][$f . '.dbprofile'];
}
if ($allModuleInfo) {
if (!isset($installation[$section][$f . '.version'])) {
$installation[$section][$f . '.version'] = '';
}
if (!isset($installation[$section][$f . '.dataversion'])) {
$installation[$section][$f . '.dataversion'] = '';
}
if (!isset($installation['__modules_data'][$f . '.contexts'])) {
$installation['__modules_data'][$f . '.contexts'] = '';
}
$config->modules[$f . '.version'] = $installation[$section][$f . '.version'];
$config->modules[$f . '.dataversion'] = $installation[$section][$f . '.dataversion'];
$config->modules[$f . '.installed'] = $installation[$section][$f . '.installed'];
$config->_allModulesPathList[$f] = $path;
}
if ($config->modules[$f . '.access'] == 3) {
$config->_externalModulesPathList[$f] = $path;
} elseif ($config->modules[$f . '.access']) {
$config->_modulesPathList[$f] = $path;
}
return $moduleInfo;
}