31 protected $_aException = array(
'OXDELIVERY' =>
'OXDELTYPE',
'OXSELECTLIST' =>
'OXIDENT');
100 "php_version" =>
"PHP_version_at_least_5.3.25",
101 "lib_xml2" =>
"LIB_XML2",
103 "open_ssl" =>
"OpenSSL",
107 "tokenizer" =>
"Tokenizer",
108 "mysql_connect" =>
"MySQL_client_connector_for_MySQL_5",
109 "gd_info" =>
"GDlib_v2_.5Bv1.5D_incl._JPEG_support",
110 "mb_string" =>
"mbstring",
111 "bc_math" =>
"BCMath",
112 "allow_url_fopen" =>
"allow_url_fopen_or_fsockopen_to_port_80",
113 "php4_compat" =>
"Zend_compatibility_mode_must_be_off",
114 "request_uri" =>
"REQUEST_URI_set",
115 "ini_set" =>
"ini_set_allowed",
116 "register_globals" =>
"register_globals_must_be_off",
117 "memory_limit" =>
"PHP_Memory_limit_.28min._14MB.2C_30MB_recommended.29",
118 "unicode_support" =>
"UTF-8_support",
119 "file_uploads" =>
"file_uploads_on",
120 "mod_rewrite" =>
"apache_mod_rewrite_module",
121 "server_permissions" =>
"Files_.26_Folder_Permission_Setup",
122 "zend_optimizer" =>
"Zend_Optimizer",
123 "bug53632" =>
"Not_recommended_PHP_versions",
124 "session_autostart" =>
"session.auto_start_must_be_off",
125 "magic_quotes_gpc" =>
"magic_quotes_must_be_off"
162 if (defined(
'OXID_PHP_UNIT')) {
163 if (substr($sMethod, 0, 4) ==
"UNIT") {
164 $sMethod = str_replace(
"UNIT",
"_", $sMethod);
166 if (method_exists($this, $sMethod)) {
167 return call_user_func_array(array(& $this, $sMethod), $aArgs);
172 "Function '$sMethod' does not exist or is not accessible! (" . get_class($this) .
")" . PHP_EOL
203 if ($this->_aRequiredModules == null) {
204 $aRequiredPHPExtensions = array(
220 $aRequiredPHPConfigs = array(
233 $aRequiredServerConfigs = array(
235 'server_permissions',
241 $aRequiredServerConfigs[] =
'mysql_version';
243 $this->_aRequiredModules = array_fill_keys($aRequiredPHPExtensions,
'php_extennsions') +
244 array_fill_keys($aRequiredPHPConfigs,
'php_config') +
245 array_fill_keys($aRequiredServerConfigs,
'server_config');
282 return extension_loaded(
'curl') ? 2 : 1;
292 return extension_loaded(
'mbstring') ? 2 : 1;
308 $sPath = $sPath ? $sPath : getShopBasePath();
311 $sFullPath = $sPath .
"config.inc.php";
312 if (!is_readable($sFullPath) ||
313 ($this->
isAdmin() && is_writable($sFullPath)) ||
314 (!$this->
isAdmin() && !is_writable($sFullPath))
319 $sTmp =
"$sPath/tmp{$sVerPrefix}/";
320 if (class_exists(
'oxConfig')) {
321 $sCfgTmp = $this->
getConfig()->getConfigParam(
'sCompileDir');
322 if (strpos($sCfgTmp,
'<sCompileDir_') ===
false) {
327 $aPathsToCheck = array(
328 $sPath .
"out/pictures{$sVerPrefix}/promo/",
329 $sPath .
"out/pictures{$sVerPrefix}/master/",
330 $sPath .
"out/pictures{$sVerPrefix}/generated/",
331 $sPath .
"out/pictures{$sVerPrefix}/media/",
332 $sPath .
"out/media/",
337 $sPathToCheck = reset($aPathsToCheck);
338 while ($sPathToCheck) {
340 if (!file_exists($sPathToCheck)) {
345 if (is_dir($sPathToCheck)) {
347 $aSubF = glob($sPathToCheck .
"*", GLOB_ONLYDIR);
348 if (is_array($aSubF)) {
349 foreach ($aSubF as $sNewFolder) {
350 $aPathsToCheck[] = $sNewFolder .
"/";
357 if (!is_readable($sPathToCheck) || !is_writable($sPathToCheck)) {
362 $sPathToCheck = next($aPathsToCheck);
376 $sShopURL = $this->
getConfig()->getConfigParam(
'sShopURL');
377 if (preg_match(
'#^(https?://)?([^/:]+)(:([0-9]+))?(/.*)?$#i', $sShopURL, $m)) {
379 $iPort = (int) $m[4];
380 $blSsl = (strtolower($m[1]) ==
'https://');
382 $iPort = $blSsl ? 443 : 80;
384 $sScript = rtrim($m[5],
'/') .
'/';
405 $sSSLShopURL = $this->
getConfig()->getConfigParam(
'sSSLShopURL');
406 if (preg_match(
'#^(https?://)?([^/:]+)(:([0-9]+))?(/.*)?$#i', $sSSLShopURL, $m)) {
408 $iPort = (int) $m[4];
409 $blSsl = (strtolower($m[1]) ==
'https://');
411 $iPort = $blSsl ? 443 : 80;
413 $sScript = rtrim($m[5],
'/') .
'/';
435 $sScript = $_SERVER[
'SCRIPT_NAME'];
436 $iPort = (int) $_SERVER[
'SERVER_PORT'];
437 $blSsl = (isset($_SERVER[
'HTTPS']) && ($_SERVER[
'HTTPS'] ==
'on'));
439 $iPort = $blSsl ? 443 : 80;
441 $sScript = rtrim(dirname(dirname($sScript)),
'/') .
'/';
444 'host' => $_SERVER[
'HTTP_HOST'],
494 if (0 != $iModStat && $aSSLHostInfo) {
498 if (0 == $iSSLModStat) {
500 } elseif (1 == $iSSLModStat || 1 == $iModStat) {
504 return min($iModStat, $iSSLModStat);
520 $sHostname = ($aHostInfo[
'ssl'] ?
'ssl://' :
'') . $aHostInfo[
'host'];
521 if ($rFp = @fsockopen($sHostname, $aHostInfo[
'port'], $iErrNo, $sErrStr, 10)) {
522 $sReq =
"POST {$aHostInfo['dir']}oxseo.php?mod_rewrite_module_is=off HTTP/1.1\r\n";
523 $sReq .=
"Host: {$aHostInfo['host']}\r\n";
524 $sReq .=
"User-Agent: OXID eShop setup\r\n";
525 $sReq .=
"Content-Type: application/x-www-form-urlencoded\r\n";
526 $sReq .=
"Content-Length: 0\r\n";
527 $sReq .=
"Connection: close\r\n\r\n";
531 while (!feof($rFp)) {
532 $sOut .= fgets($rFp, 100);
536 $iModStat = (strpos($sOut,
'mod_rewrite_on') !==
false) ? 2 : 0;
538 if (function_exists(
'apache_get_modules')) {
540 $iModStat = in_array(
'mod_rewrite', apache_get_modules()) ? 1 : 0;
556 $iModStat = @ini_get(
'allow_url_fopen');
557 $iModStat = ($iModStat && strcasecmp(
'1', $iModStat)) ? 2 : 1;
558 if ($iModStat == 1) {
561 if ($oRes = @fsockopen(
'www.example.com', 80, $iErrNo, $sErrStr, 10)) {
566 $iModStat = (!$iModStat) ? 1 : $iModStat;
579 $sZendStatus = (strtolower((
string) @ini_get(
'zend.ze1_compatibility_mode')));
581 return in_array($sZendStatus, array(
'on',
'1')) ? 0 : 2;
595 if (version_compare($sPhpVersion,
'5.3',
'<')) {
597 } elseif (version_compare($sPhpVersion,
'5.3.0',
'>=') && version_compare($sPhpVersion,
'5.3.25',
'<')) {
599 } elseif (version_compare($sPhpVersion,
'5.3.25',
'>=')) {
625 return (isset($_SERVER[
'REQUEST_URI']) || isset($_SERVER[
'SCRIPT_URI'])) ? 2 : 0;
635 return class_exists(
'DOMDocument') ? 2 : 0;
645 return class_exists(
'DOMDocument') ? 2 : 0;
655 return extension_loaded(
'json') ? 2 : 0;
665 return extension_loaded(
'iconv') ? 2 : 0;
675 return extension_loaded(
'tokenizer') ? 2 : 0;
685 return extension_loaded(
'bcmath') ? 2 : 1;
695 return extension_loaded(
'openssl') ? 2 : 1;
705 return extension_loaded(
'soap') ? 2 : 1;
716 $iModStat = (extension_loaded(
'mysql') || extension_loaded(
'mysqli') || extension_loaded(
'pdo_mysql')) ? 2 : 0;
720 $sClientVersion = mysql_get_client_info();
721 if (version_compare($sClientVersion,
'5',
'<')) {
723 if (version_compare($sClientVersion,
'4',
'<')) {
726 } elseif (version_compare($sClientVersion,
'5.0.36',
'>=') &&
727 version_compare($sClientVersion,
'5.0.38',
'<')
731 } elseif (version_compare($sClientVersion,
'5.0.40',
'>') &&
732 version_compare($sClientVersion,
'5.0.42',
'<')
737 if (strpos($sClientVersion,
'mysqlnd') !==
false) {
755 if ($sVersion === null) {
756 $aRez =
oxDb::getDb()->getAll(
"SHOW VARIABLES LIKE 'version'");
757 foreach ($aRez as $aRecord) {
758 $sVersion = $aRecord[1];
764 if (version_compare($sVersion,
'5.0.3',
'>=') && version_compare($sVersion,
'5.0.37',
'<>')) {
778 $iModStat = extension_loaded(
'gd') ? 1 : 0;
779 $iModStat = function_exists(
'imagecreatetruecolor') ? 2 : $iModStat;
780 $iModStat = function_exists(
'imagecreatefromjpeg') ? $iModStat : 0;
792 return (@ini_set(
'session.name',
'sid') !==
false) ? 2 : 0;
802 $sGlobStatus = (strtolower((
string) @ini_get(
'register_globals')));
804 return in_array($sGlobStatus, array(
'on',
'1')) ? 0 : 2;
814 if (function_exists(
'get_magic_quotes_gpc')) {
815 return get_magic_quotes_gpc() ? 0 : 2;
830 if ($sMemLimit === null) {
831 $sMemLimit = @ini_get(
'memory_limit');
838 $iMemLimit = $this->
_getBytes($sMemLimit);
840 if($iMemLimit ===
'-1') {
845 $iModStat = ($iMemLimit >= $this->
_getBytes($sDefLimit)) ? 1 : 0;
846 $iModStat = $iModStat ? (($iMemLimit >= $this->
_getBytes($sRecLimit)) ? 2 : $iModStat) : $iModStat;
864 foreach ($this->_aException as $sTable => $sColumn) {
865 $sSelect .=
'and ( TABLE_NAME != "' . $sTable .
'" and COLUMN_NAME != "' . $sColumn .
'" ) ';
880 $aCollations = array();
882 $sSelect =
'select TABLE_NAME, COLUMN_NAME, COLLATION_NAME from INFORMATION_SCHEMA.columns
883 where TABLE_NAME not like "oxv\_%" and table_schema = "' .
$myConfig->getConfigParam(
'dbName') .
'"
884 and COLUMN_NAME in ("' . implode(
'", "', $this->_aColumns) .
'") ' . $this->
_getAdditionalCheck() .
885 'ORDER BY TABLE_NAME, COLUMN_NAME DESC;';
887 foreach ($aRez as $aRetTable) {
889 $sCollation = $aRetTable[2];
891 if ($aRetTable[2] && $sCollation != $aRetTable[2]) {
892 $aCollations[$aRetTable[0]][$aRetTable[1]] = $aRetTable[2];
897 if ($this->_blSysReqStatus === null) {
898 $this->_blSysReqStatus =
true;
900 if (count($aCollations) > 0) {
901 $this->_blSysReqStatus =
false;
924 return (@preg_match(
'/\pL/u',
'a') == 1) ? 2 : 1;
935 $sFileUploads = @ini_get(
'file_uploads');
936 if ($sFileUploads !==
false) {
937 if ($sFileUploads && ($sFileUploads ==
'1' || strtolower($sFileUploads) ==
'on')) {
954 if ($this->_blSysReqStatus == null) {
955 $this->_blSysReqStatus =
true;
981 $this->_blSysReqStatus =
true;
982 foreach ($aRequiredModules as $sModule => $sGroup) {
983 if (isset($aSysInfo[$sGroup]) && !$aSysInfo[$sGroup]) {
984 $aSysInfo[$sGroup] = array();
987 $aSysInfo[$sGroup][$sModule] = $iModuleState;
988 $this->_blSysReqStatus = $this->_blSysReqStatus && ( bool ) abs($iModuleState);
1005 $sCheckFunction =
"check" . str_replace(
" ",
"", ucwords(str_replace(
"_",
" ", $sModule)));
1006 $iModStat = $this->$sCheckFunction();
1025 if (isset($aInfoMap[$sIdent])) {
1026 $sUrl .=
"#" . $aInfoMap[$sIdent];
1041 $sBytes = trim($sBytes);
1042 $sLast = strtolower($sBytes[strlen($sBytes) - 1]);
1072 $sTplFile = $this->
getConfig()->getTemplatePath($sTemplate,
false);
1073 if (!$sTplFile || !file_exists($sTplFile)) {
1075 $sTplFile = $this->
getConfig()->getTemplatePath($sTemplate,
true);
1076 if (!$sTplFile || !file_exists($sTplFile)) {
1081 $sFile = file_get_contents($sTplFile);
1082 $sBlockNameQuoted = preg_quote($sBlockName,
'/');
1084 return (
bool) preg_match(
'/\[\{\s*block\s+name\s*=\s*([\'"])' . $sBlockNameQuoted .
'\1\s*\}\]/is', $sFile);
1102 $sShpIdParam = $oDb->quote($oConfig->getShopId());
1103 $sSql =
"select * from oxtplblocks where oxactive=1 and oxshopid=$sShpIdParam";
1104 $rs = $oDb->execute($sSql);
1108 if ($rs !=
false && $rs->recordCount() > 0) {
1111 if (isset($aCache[$rs->fields[
'OXTEMPLATE']]) &&
1112 isset($aCache[$rs->fields[
'OXTEMPLATE']][$rs->fields[
'OXBLOCKNAME']])
1114 $blStatus = $aCache[$rs->fields[
'OXTEMPLATE']][$rs->fields[
'OXBLOCKNAME']];
1116 $blStatus = $this->
_checkTemplateBlock($rs->fields[
'OXTEMPLATE'], $rs->fields[
'OXBLOCKNAME']);
1118 $aCache[$rs->fields[
'OXTEMPLATE']][$rs->fields[
'OXBLOCKNAME']] = $blStatus;
1123 'module' => $rs->fields[
'OXMODULE'],
1124 'block' => $rs->fields[
'OXBLOCKNAME'],
1125 'template' => $rs->fields[
'OXTEMPLATE'],
1142 $sStatus = (strtolower((
string) @ini_get(
'session.auto_start')));
1144 return in_array($sStatus, array(
'on',
'1')) ? 0 : 2;