/** * Get install section forom /etc/dist.conf.php config file * Returns empyt array if can't read dist.conf.php * * @return array install section of config file */ public static function getConfig() { if (!isset(self::$installConfig)) { $config = @parse_ini_file(MAX_PATH . '/etc/dist.conf.php', true); if (is_array($config) && array_key_exists('install', $config)) { self::$installConfig = $config['install']; } else { return array(); // empty settings on fail } } return self::$installConfig; }
public function initModel() { parent::initModel(); $oStatus = $this->getInstallStatus(); if ($oStatus->isRecovery()) { $pageTitle = $this->oTranslation->translate('InstallStatusRecovery', array(OA_VERSION)); } else { if ($oStatus->isInstall()) { $pageTitle = $this->oTranslation->translate('InstallStatusInstall', array(OA_VERSION)); } else { if ($oStatus->isUpgrade()) { $pageTitle = $this->oTranslation->translate('InstallStatusUpgrade', array(OA_VERSION)); } else { if ($oStatus->isUpToDate()) { $pageTitle = $this->oTranslation->translate('InstallStatusUpToDate', array(OA_VERSION)); } } } } $this->setModelProperty('pageHeader', new OA_Admin_UI_Model_PageHeaderModel($pageTitle)); $aConfig = OX_Upgrade_InstallConfig::getConfig(); }
function testGetConfig() { $result = OX_Upgrade_InstallConfig::getConfig(); $config = @parse_ini_file(MAX_PATH . '/etc/dist.conf.php', true); $this->assertEqual($result, $config['install']); }