the entry point config (static and local) combined with $localConfigIni
public getConfigIni ( ) : Jelix\IniFile\MultiIniModifier | ||
return | Jelix\IniFile\MultiIniModifier |
/** * get the object which is responsible to install the component. this * object should implement AbstractInstaller. * * @param EntryPoint $ep the entry point * @param boolean $installWholeApp true if the installation is done during app installation * @return ModuleInstaller the installer, or null if there isn't any installer * or false if the installer is useless for the given parameter */ function getInstaller(EntryPoint $ep, $installWholeApp) { $this->_setAccess($ep->getConfigIni()); // false means that there isn't an installer for the module if ($this->moduleInstaller === false) { return null; } $epId = $ep->getEpId(); if ($this->moduleInstaller === null) { if (!file_exists($this->moduleInfos->getPath() . 'install/install.php') || $this->moduleStatuses[$epId]->skipInstaller) { $this->moduleInstaller = false; return null; } require_once $this->moduleInfos->getPath() . 'install/install.php'; $cname = $this->moduleInfos->name . 'ModuleInstaller'; if (!class_exists($cname)) { throw new Exception("module.installer.class.not.found", array($cname, $this->name)); } $this->moduleInstaller = new $cname($this->moduleInfos->name, $this->moduleInfos->name, $this->moduleInfos->getPath(), $this->moduleInfos->version, $installWholeApp); } $this->moduleInstaller->setParameters($this->moduleStatuses[$epId]->parameters); if ($ep->getLocalConfigIni()) { $sparam = $ep->getLocalConfigIni()->getValue($this->moduleInfos->name . '.installparam', 'modules'); } else { $sparam = $ep->getConfigIni()->getValue($this->moduleInfos->name . '.installparam', 'modules'); } if ($sparam === null) { $sparam = ''; } $sp = $this->moduleStatuses[$epId]->serializeParameters(); if ($sparam != $sp) { $ep->getConfigIni()->setValue($this->moduleInfos->name . '.installparam', $sp, 'modules'); } $this->moduleInstaller->setEntryPoint($ep, $this->moduleStatuses[$epId]->dbProfile, $this->installerContexts); return $this->moduleInstaller; }
protected function _setAccess(EntryPoint $ep) { $config = $ep->getConfigIni(); $access = $config->getValue($this->moduleInfos->name . '.access', 'modules'); $action = $this->getInstallAction($ep->getEpId()); if ($action == Resolver::ACTION_INSTALL) { if ($access == 0 || $access == null) { $config->setValue($this->moduleInfos->name . '.access', 2, 'modules'); $config->save(); } else { if ($access == 3) { $config->setValue($this->moduleInfos->name . '.access', 1, 'modules'); $config->save(); } } } else { if ($action == Resolver::ACTION_REMOVE) { $config->setValue($this->moduleInfos->name . '.access', 0, 'modules'); $config->save(); } } }
/** * the entry point config combined with $localConfigIni * @return \Jelix\IniFile\MultiIniModifier * @since 1.7 */ public function getConfigIni() { return $this->entryPoint->getConfigIni(); }