From 6a6467089299c31aa0a8d70234bf6b1fd2c7b0aa Mon Sep 17 00:00:00 2001 From: DanielSeifert Date: Thu, 7 Nov 2013 10:44:27 +0000 Subject: [PATCH] refresh precheck --- setup+doku/d3precheck.php | 721 ++++++++++++++++++++++++-------------- 1 file changed, 463 insertions(+), 258 deletions(-) diff --git a/setup+doku/d3precheck.php b/setup+doku/d3precheck.php index 46e3f9d..31151fc 100644 --- a/setup+doku/d3precheck.php +++ b/setup+doku/d3precheck.php @@ -1,359 +1,548 @@ + * @link http://www.oxidmodule.com + * @version 2.0 + */ + +/** + * Alle Anforderungen sind über $this->_aCheck konfigurierbar. Manche Anforderungen haben dazu noch weitergehende + * Informationen. Die Struktur dieser Requirementbeschreibungen: + * + * array( + * 'blExec' => 1, // obligatorisch: 0 = keine Prüfung, 1 = Püfung wird ausgeführt + * 'aParams' => array(...), // optional, Inhalt ist von jeweiliger Prüfung abhängig + * ) + * + * "Desc1": Diese Struktur kann allein eine Bedingung beschreiben. Wenn mehrere dieser Bedingungen + * nötig sind (z.B. bei unterschiedlichen Bibliotheksanforderungen), kann diese Struktur als + * Arrayelemente auch mehrfach genannt werden (kaskadierbar). Grundsätzlich sind alle Requirements + * kaskadierbar, jedoch ergibt dies nicht bei allen Sinn. :) Eine Kaskadierung sieht so aus: + * + * array( + * array( + * 'blExec' => 1, + * ... + * ), + * array( + * 'blExec' => 1, + * ... + * ) + * ) + * + * Unbedingt zu vermeiden sind Änderungen in der Scriptlogik, da diese bei Updates nur schwer zu übernehmen sind. + */ class requcheck { - protected $_db = FALSE; + protected $_db = false; + public $dbHost; + public $dbUser; + public $dbPwd; + public $dbName; protected $_sModName = 'D³ GeoIP'; - protected $_sModVersion = '3.0.0.0'; - protected $_aCheck = array - ( - 'hasMinPhpVersion' => array('blExec' => 0, - 'aParams' => array( - '5.2.0' - ) + protected $_sModVersion = '3.0.0.X'; + + protected $_aCheck = array( + // kleinste erlaubte PHP-Version + 'hasMinPhpVersion' => array( + 'blExec' => 0, + 'aParams' => array( + '5.2.0' + ) ), - 'hasMaxPhpVersion' => array('blExec' => 0, - 'aParams' => array( - '5.3.30' - ) + // größte erlaubte PHP-Version + 'hasMaxPhpVersion' => array( + 'blExec' => 1, + 'aParams' => array( + '5.4.99' + ) ), - 'hasPhp52or53' => array('blExec' => 1), + // PHP-Version zwischen 5.2 und 5.4 + 'hasPhp52to54' => array('blExec' => 1), + // PHP-Version ist 5.2 'hasPhp52' => array('blExec' => 0), + // PHP-Version ist 5.3 'hasPhp53' => array('blExec' => 0), + // PHP-Version ist 5.4 + 'hasPhp54' => array('blExec' => 0), + // benötigt Zend Optimizer (PHP 5.2) bzw. Zend Guard Loader (> PHP 5.2) 'hasZendLoaderOptimizer' => array('blExec' => 1), + // benötigt IonCubeLoader 'hasIonCubeLoader' => array('blExec' => 0), - 'hasExtension_1' => array('blExec' => 0, - 'aParams' => array( - 'curl' - ) + // benötigt PHP-Extension (kaskadierbar (siehe "Desc1")) + 'hasExtension' => array( + array( + 'blExec' => 0, + 'aParams' => array( + 'curl' + ), + ), + array( + 'blExec' => 0, + 'aParams' => array( + 'soap' + ), + ), ), - 'hasExtension_2' => array('blExec' => 0, - 'aParams' => array( - 'soap' - ) + // minimal benötigte Shopversion (editionsgetrennt) + 'hasMinShopVersion' => array( + 'blExec' => 1, + 'aParams' => array( + 'PE' => '4.7.0', + 'CE' => '4.7.0', + 'EE' => '5.0.0' + ), ), - 'hasMinShopVersion' => array('blExec' => 1, - 'aParams' => array( - 'PE' => '4.7.0', - 'CE' => '4.7.0', - 'EE' => '5.0.0' - ) + // maximal verwendbare Shopversion (editionsgetrennt) + 'hasMaxShopVersion' => array( + 'blExec' => 0, + 'aParams' => array( + 'PE' => '4.7.0', + 'CE' => '4.7.0', + 'EE' => '5.0.0' + ), ), - 'hasMaxShopVersion' => array('blExec' => 0, - 'aParams' => array( - 'PE' => '4.7.0', - 'CE' => '4.7.0', - 'EE' => '5.0.0' - ) - ), - 'isShopEdition' => array('blExec' => 1, - 'aParams' => array( - array( - 'PE', - 'EE', - 'CE', - ) - ) - ), - 'hasMinModCfgRevision' => array('blExec' => 0, - 'aParams' => array( - 'd3_extsearch', - '510' - ) - ), - 'hasMaxModCfgRevision' => array('blExec' => 0, - 'aParams' => array( - 'd3_extsearch', - '510' - ) + // verfügbar für diese Shopeditionen + 'isShopEdition' => array( + 'blExec' => 1, + 'aParams' => array( + array( + 'PE', + 'EE', + 'CE', + ), + ), ), + // benötigt Modul-Connector 'hasModCfg' => array('blExec' => 1), + // benötigt mindestens diese Erweiterungen / Version lt. d3_cfg_mod (kaskadierbar (siehe "Desc1")) + 'hasMinModCfgVersion' => array( + array( + 'blExec' => 1, + 'aParams' => array( + 'd3modcfg_lib', + 'Modul-Connector', + '3.9.0.0', + ), + ), + array( + 'blExec' => 1, + 'aParams' => array( + 'd3install_lib', + 'Installationsautomatik', + '2.4.0.0', + ), + ), + ), + // verwendbar bis zu diesen Erweiterungen / Version lt. d3_cfg_mod (kaskadierbar (siehe "Desc1")) + 'hasMaxModCfgVersion' => array( + array( + 'blExec' => 0, + 'aParams' => array( + 'd3modcfg_lib', + 'Modul-Connector', + '3.9.0.5' + ), + ), + ), ); - protected $_blGlobalResult = TRUE; + + protected $_blGlobalResult = true; public function startCheck() { $this->getHTMLHeader(); - foreach ($this->_aCheck as $sCheckType => $aConf) - if ($aConf['blExec']) - { - $this->displayCheck($sCheckType); - } + $this->_runThroughChecks($this->_aCheck); $this->getHTMLFooter(); } - public function displayCheck($sCheckType) + /** + * traversable requirement check + * + * @param $aCheckList + * @param string $sForceCheckType + */ + protected function _runThroughChecks($aCheckList, $sForceCheckType = '') { - $sGenCheckType = preg_replace("@(\_[0-9]$)@", "", $sCheckType); - $sPart = str_replace($sGenCheckType, '', $sCheckType); - - if (method_exists($this, $sGenCheckType) && call_user_func(array($this, $sGenCheckType), $sPart)) - { - echo"
" . $this->translate($sCheckType) . "
"; - } - elseif (method_exists($this, $sGenCheckType)) - { - echo"
" . $this->translate($sCheckType) . "
"; - } - else - { - echo"
" . $this->translate($sCheckType) . " (" . - $this->translate('RequNotCheckable') . ")
"; + foreach ($aCheckList as $sCheckType => $aConf) { + if (array_key_exists('blExec', $aConf)) { + if ($aConf['blExec']) { + if (strlen($sForceCheckType)) { + $sCheckType = $sForceCheckType; + } + $this->displayCheck($sCheckType, $aConf); + } + } else { + $this->_runThroughChecks($aConf, $sCheckType); + } } } + /** + * @param $sCheckType + * @param $aConfiguration + */ + public function displayCheck($sCheckType, $aConfiguration) + { + $sGenCheckType = preg_replace("@(\_[0-9]$)@", "", $sCheckType); + + if (method_exists($this, $sGenCheckType) && call_user_func(array($this, $sGenCheckType), $aConfiguration)) { + echo "
" . $this->translate($sCheckType, $aConfiguration) . "
"; + } elseif (method_exists($this, $sGenCheckType)) { + echo "
" . $this->translate($sCheckType, $aConfiguration) . "
"; + } else { + echo "
" . $this->translate($sCheckType, $aConfiguration) . " (" . $this->translate( + 'RequNotCheckable' + ) . ")
"; + } + } + + /** + * @return bool + */ public function hasMinPhpVersion() { $aArgs = func_get_args(); - if (version_compare(phpversion(), $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'][0], '>=')) - { - return TRUE; + + if (version_compare(phpversion(), $aArgs[0]['aParams'][0], '>=')) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } - public function hasPhp52or53() + /** + * @return bool + */ + public function hasPhp52to54() { - if ((version_compare(phpversion(), '5.2.0', '>=')) && (version_compare(phpversion(), '5.3.900', '<'))) - { - return TRUE; + if ((version_compare(phpversion(), '5.2.0', '>=')) && (version_compare(phpversion(), '5.4.900', '<'))) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function hasPhp52() { - if ((version_compare(phpversion(), '5.2.0', '>=')) && (version_compare(phpversion(), '5.2.900', '<'))) - { - return TRUE; + if ((version_compare(phpversion(), '5.2.0', '>=')) && (version_compare(phpversion(), '5.2.900', '<'))) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function hasPhp53() { - if ((version_compare(phpversion(), '5.3.0', '>=')) && (version_compare(phpversion(), '5.3.999', '<'))) - { - return TRUE; + if ((version_compare(phpversion(), '5.3.0', '>=')) && (version_compare(phpversion(), '5.3.999', '<'))) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ + public function hasPhp54() + { + if ((version_compare(phpversion(), '5.4.0', '>=')) && (version_compare(phpversion(), '5.4.999', '<'))) { + return true; + } + + $this->_blGlobalResult = false; + + return false; + } + + /** + * @return bool + */ public function hasMaxPhpVersion() { - if (version_compare(phpversion(), $this->_aCheck[__FUNCTION__]['aParams'][0], '<=')) - { - return TRUE; + $aArgs = func_get_args(); + + if (version_compare(phpversion(), $aArgs[0]['aParams'][0], '<=')) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function hasExtension() { $aArgs = func_get_args(); - //$sGenCheckType = preg_replace("@(\_[0-9]$)@", "", $sCheckType); - if (extension_loaded($this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'][0])) - { - return TRUE; + if (extension_loaded($aArgs[0]['aParams'][0])) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function hasMinShopVersion() { - if ($this->_getDb()) - { + if ($this->_getDb()) { $aArgs = func_get_args(); - $sSelect = "SELECT oxversion FROM oxshops WHERE 1 ORDER BY oxversion ASC LIMIT 1"; + $sField = 'oxversion'; + $sSelect = "SELECT " . $sField . " FROM oxshops WHERE 1 ORDER BY oxversion ASC LIMIT 1"; $rResult = mysql_query($sSelect, $this->_getDb()); $oResult = mysql_fetch_object($rResult); $oEditionResult = $this->_getShopEdition(); $sEdition = strtoupper($oEditionResult->oxedition); - $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'] = - $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'][$sEdition]; + $aArgs[0]['aParams'] = $aArgs[0]['aParams'][$sEdition]; - if (version_compare($oResult->oxversion, $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'], '>=')) - { - return TRUE; + if (version_compare($oResult->oxversion, $aArgs[0]['aParams'], '>=')) { + return true; } } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function isShopEdition() { - if ($this->_getDb()) - { + if ($this->_getDb()) { $aArgs = func_get_args(); $oResult = $this->_getShopEdition(); - if (in_array(strtoupper($oResult->oxedition), $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'][0])) - { - $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'][0] = strtoupper($oResult->oxedition); - return TRUE; + if (in_array(strtoupper($oResult->oxedition), $aArgs[0]['aParams'][0])) { + $aArgs[0]['aParams'][0] = strtoupper($oResult->oxedition); + + return true; } } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool|object|stdClass + */ protected function _getShopEdition() { - if ($this->_getDb()) - { - $sSelect = "SELECT oxedition FROM oxshops WHERE 1 LIMIT 1"; + if ($this->_getDb()) { + $sField = 'oxedition'; + $sSelect = "SELECT " . $sField . " FROM oxshops WHERE 1 LIMIT 1"; $rResult = mysql_query($sSelect, $this->_getDb()); $oResult = mysql_fetch_object($rResult); return $oResult; } - return FALSE; + return false; } + /** + * @return bool + */ public function hasMaxShopVersion() { - if ($this->_getDb()) - { + if ($this->_getDb()) { $aArgs = func_get_args(); - $sSelect = "SELECT oxversion FROM oxshops WHERE 1 ORDER BY oxversion DESC LIMIT 1"; + $sField = 'oxversion'; + $sSelect = "SELECT " . $sField . " FROM oxshops WHERE 1 ORDER BY oxversion DESC LIMIT 1"; $rResult = mysql_query($sSelect, $this->_getDb()); $oResult = mysql_fetch_object($rResult); $oEditionResult = $this->_getShopEdition(); $sEdition = strtoupper($oEditionResult->oxedition); - $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'] = - $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'][$sEdition]; + $aArgs[0]['aParams'] = $aArgs[0]['aParams'][$sEdition]; - if (version_compare($oResult->oxversion, $this->_aCheck[__FUNCTION__ . $aArgs[0]]['aParams'], '<=')) - { - return TRUE; + if (version_compare($oResult->oxversion, $aArgs[0]['aParams'], '<=')) { + return true; } } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function hasModCfg() { - if ($this->_getDb()) - { + if ($this->_getDb()) { $oResult = new stdClass(); - $sSelect = "SELECT 1 as result FROM d3_cfg_mod WHERE oxmodid = 'd3modcfg_lib' LIMIT 1"; + $sModId = 'd3modcfg_lib'; + $sSelect = "SELECT 1 as result FROM d3_cfg_mod WHERE oxmodid = '" . $sModId . "' LIMIT 1"; $rResult = mysql_query($sSelect, $this->_getDb()); - if (is_resource($rResult)) - { + if (is_resource($rResult)) { $oResult = mysql_fetch_object($rResult); - } - if ($oResult->result) - { - return TRUE; + if ($oResult->result) { + return true; + } } } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } - public function hasMinModCfgRevision() + /** + * @return bool + */ + public function hasMinModCfgVersion() { - if ($this->_getDb()) - { - $sSelect = "SELECT oxrevision FROM d3_cfg_mod WHERE oxmodid = '" . $this->_aCheck[__FUNCTION__]['aParams'][0] . - "' ORDER BY oxrevision ASC LIMIT 1"; - $rResult = mysql_query($sSelect, $this->_getDb()); - $oResult = mysql_fetch_object($rResult); + if ($this->_getDb()) { + $aArgs = func_get_args(); + $sSelect = "SELECT IF (INET_ATON(oxversion) >= INET_ATON('".$aArgs[0]['aParams'][2]."'), 1, 0) AS result + FROM d3_cfg_mod WHERE + oxmodid = '" . $aArgs[0]['aParams'][0] . "' AND + oxversion != 'basic' + ORDER BY oxversion ASC LIMIT 1"; - if (version_compare($oResult->oxrevision, $this->_aCheck[__FUNCTION__]['aParams'][1], '>=')) + $rResult = mysql_query($sSelect, $this->_getDb()); + $aResult = mysql_fetch_assoc($rResult); + + if (!(int) $aResult['result']) { - return TRUE; + $this->_blGlobalResult = false; } + + return (int) $aResult['result']; } - return FALSE; + $this->_blGlobalResult = false; + + return false; } - public function hasMaxModCfgRevision() + /** + * @return bool + */ + public function hasMaxModCfgVersion() { - if ($this->_getDb()) - { - $sSelect = "SELECT oxrevision FROM d3_cfg_mod WHERE oxmodid = '" . $this->_aCheck[__FUNCTION__]['aParams'][0] . - "' ORDER BY oxrevision ASC LIMIT 1"; - $rResult = mysql_query($sSelect, $this->_getDb()); - $oResult = mysql_fetch_object($rResult); + if ($this->_getDb()) { + $aArgs = func_get_args(); + $sSelect = "SELECT + IF (INET_ATON(oxversion) <= INET_ATON('".$aArgs[0]['aParams'][2]."'), 1, 0) AS result + FROM d3_cfg_mod WHERE + oxmodid = '" . $aArgs[0]['aParams'][0] . "' AND + oxversion != 'basic' + ORDER BY oxversion ASC LIMIT 1"; - if (version_compare($oResult->oxrevision, $this->_aCheck[__FUNCTION__]['aParams'][1], '<=')) + $rResult = mysql_query($sSelect, $this->_getDb()); + $aResult = mysql_fetch_assoc($rResult); + + if (!(int) $aResult['result']) { - return TRUE; + $this->_blGlobalResult = false; } + + return (int) $aResult['result']; } - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function hasZendLoaderOptimizer() { - if (version_compare(phpversion(), '5.2.0', '>=') && version_compare(phpversion(), '5.2.900', '<') && - function_exists('zend_optimizer_version') - ) - { - return TRUE; - } - elseif (version_compare(phpversion(), '5.3.0', '>=') && version_compare(phpversion(), '5.3.900', '<') && - function_exists('zend_loader_version') - ) - { - return TRUE; + if (version_compare(phpversion(), '5.2.0', '>=') && version_compare( + phpversion(), + '5.2.900', + '<' + ) && function_exists('zend_optimizer_version') + ) { + return true; + } elseif (version_compare(phpversion(), '5.3.0', '>=') && version_compare( + phpversion(), + '5.4.900', + '<' + ) && function_exists('zend_loader_version') + ) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } + /** + * @return bool + */ public function hasIonCubeLoader() { - if (function_exists('ioncube_loader_version')) - { - return TRUE; + if (function_exists('ioncube_loader_version')) { + return true; } - $this->_blGlobalResult = FALSE; - return FALSE; + $this->_blGlobalResult = false; + + return false; } - public function translate($sIdent) + /** + * @param $sIdent + * @param array $aConfiguration + * + * @return mixed|string + */ + public function translate($sIdent, $aConfiguration = array()) { $sGenIdent = preg_replace("@(\_[0-9]$)@", "", $sIdent); $aTransl = array( @@ -365,19 +554,20 @@ class requcheck 'RequNotCheckable' => 'Bedingung nicht prüfbar', 'hasMinPhpVersion' => 'mindestens PHP Version %s', 'hasMaxPhpVersion' => 'maximal PHP Version %s', - 'hasPhp52or53' => 'Server verwendet PHP 5.2 oder 5.3', + 'hasPhp52to54' => 'Server verwendet PHP 5.2, 5.3 oder 5.4', 'hasPhp52' => 'Server verwendet PHP 5.2', 'hasPhp53' => 'Server verwendet PHP 5.3', + 'hasPhp54' => 'Server verwendet PHP 5.4', 'hasSoap' => 'SOAP-Erweiterung verfügbar', 'hasCurl' => 'Curl-Erweiterung verfügbar', 'hasExtension' => '%s-Erweiterung verfügbar', 'hasMinShopVersion' => 'mindestens Shop Version %s', 'hasMaxShopVersion' => 'maximal Shop Version %s', - 'hasMinModCfgRevision' => 'ModCfg-Eintrag "%s" mit mindestens Revision %s', - 'hasMaxModCfgRevision' => 'ModCfg-Eintrag "%s" mit maximal Revision %s', + 'hasMinModCfgVersion' => 'ModCfg-Eintrag "%s" (%s) mit mindestens Version %s', + 'hasMaxModCfgVersion' => 'ModCfg-Eintrag "%s" (%s) mit maximal Version %s', 'hasModCfg' => 'Modul-Connector installiert', 'isShopEdition' => 'ist Shopedition %s', - 'hasZendLoaderOptimizer' => 'Zend Optimizer (PHP 5.2) oder Zend Guard Loader (PHP 5.3) installiert', + 'hasZendLoaderOptimizer' => 'Zend Optimizer (PHP 5.2) oder Zend Guard Loader (PHP 5.3, 5.4) installiert **', 'hasIonCubeLoader' => 'ionCube loader installiert', 'globalSuccess' => 'Die Prüfung war erfolgreich. Sie können das Modul installieren.*

', 'globalNotSuccess' => 'Die Prüfung war nicht erfolgreich. Bitte kontrollieren Sie die rot markierten Bedingungen.

', @@ -385,6 +575,8 @@ class requcheck 'deleteFile2' => '?fnc=deleteme">hier, um diese Datei zu löschen.', 'showPhpInfo' => 'PHPinfo anzeigen', 'dependentoffurther' => '* abhängig von ungeprüften Voraussetzungen', + 'oneandonedescription' => '** geprüft wurde das Ausführungsverzeichnis, providerabhängig müssen Unterverzeichnisse separat geprüft werden (z.B. bei 1&1)', + 'or' => ' oder ', ), 'en' => array( 'RequCheck' => 'Requirement check', @@ -394,17 +586,20 @@ class requcheck 'RequNotCheckable' => 'condition isn\'t checkable', 'hasMinPhpVersion' => 'at least PHP version %s', 'hasMaxPhpVersion' => 'not more than PHP version %s', - 'hasPhp52or53' => 'server use PHP 5.2 or 5.3', + 'hasPhp52to54' => 'server use PHP 5.2, 5.3 or 5.4', 'hasPhp52' => 'server use PHP 5.2', 'hasPhp53' => 'server use PHP 5.3', + 'hasPhp54' => 'server use PHP 5.4', 'hasSoap' => 'SOAP extension available', 'hasCurl' => 'curl extension available', 'hasExtension' => '%s extension is available', 'hasMinShopVersion' => 'at least shop version %s', 'hasMaxShopVersion' => 'not more than shop version %s', + 'hasMinModCfgVersion' => 'ModCfg item "%s" (%s) has at least version %s', + 'hasMaxModCfgVersion' => 'ModCfg item "%s" (%s) has not more than version %s', 'hasModCfg' => 'Module Connector installed', 'isShopEdition' => 'shop edition is %s', - 'hasZendLoaderOptimizer' => 'Zend Optimizer (PHP 5.2) or Zend Guard Loader (PHP 5.3) installed', + 'hasZendLoaderOptimizer' => 'Zend Optimizer (PHP 5.2) or Zend Guard Loader (PHP 5.3, 5.4) installed **', 'hasIonCubeLoader' => 'ionCube loader installed', 'globalSuccess' => 'The test was successful. Your server is ready for installing the module.*

', 'globalNotSuccess' => 'The test wasn\'t successfull. Please check the red marked conditions.

', @@ -412,55 +607,55 @@ class requcheck 'deleteFile2' => '?fnc=deleteme">here, to delete this file.', 'showPhpInfo' => 'show PHPinfo', 'dependentoffurther' => '* dependent of further unchecked conditions', + 'oneandonedescription' => '** this check use execution directory only, provider dependend subdirectories have to check separately (e.g. at 1&1)', + 'or' => ' or ', ), ); - if (isset($this->_aCheck[$sIdent]['aParams']) && is_array($this->_aCheck[$sIdent]['aParams'])) - { - array_walk($this->_aCheck[$sIdent]['aParams'], array($this, 'aTos'), $sIdent); + if (isset($aConfiguration['aParams']) && is_array($aConfiguration['aParams'])) { + array_walk($aConfiguration['aParams'], array($this, 'aTos'), $sIdent); } - if ($sTranslation = $aTransl[$this->_getLang()][$sGenIdent]) - { - if (isset($this->_aCheck[$sIdent]['aParams'])) - { - return vsprintf($sTranslation, $this->_aCheck[$sIdent]['aParams']); - } - else - { + if (($sTranslation = $aTransl[$this->_getLang()][$sGenIdent])) { + if (isset($aConfiguration['aParams'])) { + return vsprintf($sTranslation, $aConfiguration['aParams']); + } else { return $sTranslation; } - } - else - { + } else { return $sGenIdent; } } + /** + * @param $mParam + */ protected function aTos(&$mParam) { - if (is_array($mParam)) - { - $mParam = implode(', ', $mParam); + if (is_array($mParam)) { + $mParam = implode($this->translate('or'), $mParam); } } + /** + * @return string + */ protected function _getLang() { - if (isset($_REQUEST['lang'])) - { + if (isset($_REQUEST['lang'])) { return strtolower($_REQUEST['lang']); } return 'de'; } + /** + * @return bool|resource + */ protected function _getDb() { - if (!$this->_db) - { - if (file_exists('config.inc.php')) - { + if (!$this->_db) { + if (file_exists('config.inc.php')) { require_once('config.inc.php'); $this->_db = mysql_connect($this->dbHost, $this->dbUser, $this->dbPwd); mysql_select_db($this->dbName, $this->_db); @@ -470,13 +665,27 @@ class requcheck return $this->_db; } + /** + * @param $version + * @param int $iUnsetPart + * + * @return string + */ public function versionToInt($version, $iUnsetPart = 0) { $match = explode('.', $version); - return sprintf('%d%03d%03d%03d', intval($match[0] !== NULL ? $match[0] : $iUnsetPart), intval( - $match[1] !== NULL ? $match[1] : $iUnsetPart), intval($match[2] !== NULL ? $match[2] : $iUnsetPart), intval( - $match[3] !== NULL ? $match[3] : $iUnsetPart)); + return sprintf( + '%d%03d%03d%03d', + intval($match[0] !== null ? $match[0] : $iUnsetPart), + intval( + $match[1] !== null ? $match[1] : $iUnsetPart + ), + intval($match[2] !== null ? $match[2] : $iUnsetPart), + intval( + $match[3] !== null ? $match[3] : $iUnsetPart + ) + ); } public function getHTMLHeader() @@ -496,7 +705,7 @@ class requcheck