/** * Every Time Admin starts we perform these checks * returns some messages if there is something to display * * @return string */ protected function _doStartUpChecks() { // #661 $aMessage = array(); // check if system reguirements are ok $oSysReq = new oxSysRequirements(); if (!$oSysReq->getSysReqStatus()) { $aMessage['warning'] = oxLang::getInstance()->translateString('NAVIGATION_SYSREQ_MESSAGE'); $aMessage['warning'] .= '<a href="?cl=sysreq&stoken=' . $this->getSession()->getSessionChallengeToken() . '" target="basefrm">'; $aMessage['warning'] .= oxLang::getInstance()->translateString('NAVIGATION_SYSREQ_MESSAGE2') . '</a>'; } // version check if ($this->getConfig()->getConfigParam('blCheckForUpdates')) { if ($sVersionNotice = $this->_checkVersion()) { $aMessage['message'] .= $sVersionNotice; } } // check if setup dir is deleted if (file_exists($this->getConfig()->getConfigParam('sShopDir') . '/setup/index.php')) { $aMessage['warning'] .= (!empty($aMessage['warning']) ? "<br>" : '') . oxLang::getInstance()->translateString('SETUP_DIRNOTDELETED_WARNING'); } // check if updateApp dir is deleted or empty $sUpdateDir = $this->getConfig()->getConfigParam('sShopDir') . '/updateApp/'; if (file_exists($sUpdateDir) && !(count(glob("{$sUpdateDir}/*")) === 0)) { $aMessage['warning'] .= (!empty($aMessage['warning']) ? "<br>" : '') . oxLang::getInstance()->translateString('UPDATEAPP_DIRNOTDELETED_WARNING'); } // check if config file is writable $sConfPath = $this->getConfig()->getConfigParam('sShopDir') . "/config.inc.php"; if (!is_readable($sConfPath) || is_writable($sConfPath)) { $aMessage['warning'] .= (!empty($aMessage['warning']) ? "<br>" : '') . oxLang::getInstance()->translateString('SETUP_CONFIGPERMISSIONS_WARNING'); } return $aMessage; }
/** * Returns hint URL * * @param string $sIdent Module ident * * @return string */ public function getReqInfoUrl($sIdent) { $oSysReq = new oxSysRequirements(); $sUrl = $oSysReq->getReqInfoUrl($sIdent); return $sUrl; }
/** * Performs main system diagnostic. * Shop and module details, database health, php parameters, server information * * @return array */ protected function _runBasicDiagnostics() { $aViewData = array(); $oDiagnostics = oxNew('oxDiagnostics'); $oDiagnostics->setShopLink(oxRegistry::getConfig()->getConfigParam('sShopURL')); $oDiagnostics->setEdition(oxRegistry::getConfig()->getFullEdition()); $oDiagnostics->setVersion(oxRegistry::getConfig()->getVersion()); $oDiagnostics->setRevision(oxRegistry::getConfig()->getRevision()); /** * Shop */ if ($this->getParam('runAnalysis')) { $aViewData['runAnalysis'] = true; $aViewData['aShopDetails'] = $oDiagnostics->getShopDetails(); } /** * Modules */ if ($this->getParam('oxdiag_frm_modules')) { $sModulesDir = $this->getConfig()->getModulesDir(); $oModuleList = oxNew('oxModuleList'); $aModules = $oModuleList->getModulesFromDir($sModulesDir); $aViewData['oxdiag_frm_modules'] = true; $aViewData['mylist'] = $aModules; } /** * Health */ if ($this->getParam('oxdiag_frm_health')) { $oSysReq = new oxSysRequirements(); $aViewData['oxdiag_frm_health'] = true; $aViewData['aInfo'] = $oSysReq->getSystemInfo(); $aViewData['aCollations'] = $oSysReq->checkCollation(); } /** * PHP info * Fetches a hand full of php configuration parameters and collects their values. */ if ($this->getParam('oxdiag_frm_php')) { $aViewData['oxdiag_frm_php'] = true; $aViewData['aPhpConfigparams'] = $oDiagnostics->getPhpSelection(); $aViewData['sPhpDecoder'] = $oDiagnostics->getPhpDecoder(); } /** * Server info */ if ($this->getParam('oxdiag_frm_server')) { $aViewData['isExecAllowed'] = $oDiagnostics->isExecAllowed(); $aViewData['oxdiag_frm_server'] = true; $aViewData['aServerInfo'] = $oDiagnostics->getServerInfo(); } if ($this->getParam('oxdiag_frm_chkvers')) { $aViewData['oxdiag_frm_chkvers'] = true; } return $aViewData; }