8
0
GoogleServices/setup+doku/Precheck/d3precheck.php

1442 Zeilen
54 KiB
PHP

2013-02-21 14:59:26 +01:00
<?php
2014-05-02 09:50:17 +02:00
class requConfig
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
public $sModName = 'D<> GoogleAnalytics';
2013-11-07 11:48:25 +01:00
2014-05-02 10:17:27 +02:00
public $sModId = 'd3_googleanalytics';
2013-02-21 14:59:26 +01:00
2014-07-04 11:03:19 +02:00
public $sModVersion = '3.1.0.2';
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
/********************** check configuration section ************************/
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
public $aCheck = array(
2013-11-07 11:48:25 +01:00
// kleinste erlaubte PHP-Version
'hasMinPhpVersion' => array(
'blExec' => 0,
'aParams' => array(
2014-05-02 10:17:27 +02:00
'version' => '5.2.0'
2013-11-07 11:48:25 +01:00
)
2013-02-21 14:59:26 +01:00
),
2014-05-02 10:17:27 +02:00
2013-11-07 11:48:25 +01:00
// gr<67><72>te erlaubte PHP-Version
'hasMaxPhpVersion' => array(
2014-05-02 10:17:27 +02:00
'blExec' => 0,
'aParams' => array(
'version' => '5.4.200'
)
),
// PHP-Version zwischen 'from' und 'to'
'hasFromToPhpVersion' => array(
2013-11-07 11:48:25 +01:00
'blExec' => 1,
'aParams' => array(
2014-05-02 10:17:27 +02:00
'from' => '5.2.0',
'to' => '5.4.200',
2013-11-07 11:48:25 +01:00
)
2013-02-21 14:59:26 +01:00
),
2014-05-02 10:17:27 +02:00
2013-11-07 11:48:25 +01:00
// ben<65>tigt Zend Optimizer (PHP 5.2) bzw. Zend Guard Loader (> PHP 5.2)
2014-05-02 10:17:27 +02:00
'hasZendLoaderOptimizer' => array(
'blExec' => 1,
),
2013-11-07 11:48:25 +01:00
// ben<65>tigt IonCubeLoader
2014-05-02 10:17:27 +02:00
'hasIonCubeLoader' => array(
'blExec' => 0,
2013-02-21 14:59:26 +01:00
),
2014-05-02 10:17:27 +02:00
// minimal ben<65>tigte Shopversion (editionsgetrennt), wird (sofern m<>glich) Remote aktualisiert
2013-11-07 11:48:25 +01:00
'hasMinShopVersion' => array(
'blExec' => 1,
'aParams' => array(
'PE' => '4.7.0',
'CE' => '4.7.0',
'EE' => '5.0.0'
),
2013-02-21 14:59:26 +01:00
),
2014-05-02 10:17:27 +02:00
// maximal verwendbare Shopversion (editionsgetrennt), wird (sofern m<>glich) Remote aktualisiert
2013-11-07 11:48:25 +01:00
'hasMaxShopVersion' => array(
2014-05-02 10:17:27 +02:00
'blExec' => 1,
2013-11-07 11:48:25 +01:00
'aParams' => array(
2014-05-05 22:22:51 +02:00
'PE' => '4.8.5',
'CE' => '4.8.5',
'EE' => '5.1.5'
2013-11-07 11:48:25 +01:00
),
2013-02-21 14:59:26 +01:00
),
2014-05-02 10:17:27 +02:00
// verf<72>gbar f<>r diese Shopeditionen, wird (sofern m<>glich) Remote aktualisiert
2013-11-07 11:48:25 +01:00
'isShopEdition' => array(
'blExec' => 1,
'aParams' => array(
array(
'PE',
'EE',
'CE',
),
),
2013-02-21 14:59:26 +01:00
),
2014-05-02 10:17:27 +02:00
// ben<65>tigt Modul-Connector
2013-11-07 11:48:25 +01:00
'hasModCfg' => array('blExec' => 1),
2014-05-02 10:17:27 +02:00
2013-11-07 11:48:25 +01:00
// ben<65>tigt mindestens diese Erweiterungen / Version lt. d3_cfg_mod (kaskadierbar (siehe "Desc1"))
'hasMinModCfgVersion' => array(
array(
'blExec' => 1,
'aParams' => array(
2014-05-02 10:17:27 +02:00
'id' => 'd3modcfg_lib',
'name' => 'Modul-Connector',
'version' => '4.0.0.0',
2013-11-07 11:48:25 +01:00
),
),
2013-02-21 14:59:26 +01:00
),
2014-05-02 10:17:27 +02:00
2013-11-07 11:48:25 +01:00
// verwendbar bis zu diesen Erweiterungen / Version lt. d3_cfg_mod (kaskadierbar (siehe "Desc1"))
'hasMaxModCfgVersion' => array(
array(
'blExec' => 0,
'aParams' => array(
2014-05-02 10:17:27 +02:00
'id' => 'd3modcfg_lib',
'name' => 'Modul-Connector',
'version' => '3.9.0.5',
2013-11-07 11:48:25 +01:00
),
),
2013-02-21 14:59:26 +01:00
),
);
2014-05-02 09:50:17 +02:00
}
2014-05-02 10:17:27 +02:00
/********* don't change content from here **********************/
2014-05-02 09:50:17 +02:00
date_default_timezone_set('Europe/Berlin');
2014-05-02 10:17:27 +02:00
/**
* Class requcheck
*/
2014-05-02 09:50:17 +02:00
class requCheck
{
public $sVersion = '4.1';
protected $_db = false;
public $dbHost;
public $dbUser;
public $dbPwd;
public $dbName;
/** @var requConfig */
public $oConfig;
/** @var requLayout */
public $oLayout;
protected $_sInFolderFileName = 'd3precheckinfolder.php';
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
/********************** functional section ************************/
public $blGlobalResult = true;
/**
*
*/
public function __construct()
{
$this->oConfig = new requConfig();
$this->oLayout = new requLayout($this, $this->oConfig);
$this->oRemote = new requRemote();
}
/**
* @param string $sName
2014-05-02 10:17:27 +02:00
* @param array $aArguments
2014-05-02 09:50:17 +02:00
*/
2014-05-02 10:17:27 +02:00
public function __call($sName, $aArguments)
2014-05-02 09:50:17 +02:00
{
$this->oLayout->{$sName}($aArguments);
}
2013-02-21 14:59:26 +01:00
public function startCheck()
{
2014-05-02 09:50:17 +02:00
$this->oLayout->getHTMLHeader();
2013-02-21 14:59:26 +01:00
2014-05-02 10:17:27 +02:00
$oCheckTransformation = new requTransformation($this);
2014-05-02 09:50:17 +02:00
$this->oConfig->aCheck = $oCheckTransformation->transformCheckList($this->oConfig->aCheck);
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
$this->_runThroughChecks($this->oConfig->aCheck);
$this->oLayout->getHTMLFooter();
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
* traversable requirement check
*
* @param $aCheckList
* @param string $sForceCheckType
*/
protected function _runThroughChecks($aCheckList, $sForceCheckType = '')
{
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);
}
}
}
/**
2014-05-02 09:50:17 +02:00
* @param $sMethodName
* @param null $aArguments
*
* @return array
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function checkInSubDirs($sMethodName, $aArguments = null)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$sFolder = '.';
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
$aCheckScripts = $this->_walkThroughDirs($sFolder);
$aReturn = $this->_checkScripts($aCheckScripts, $sMethodName, $aArguments);
return $aReturn;
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sFolder
*
* @return array
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
protected function _walkThroughDirs($sFolder)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$aIgnoreDirItems = array('.', '..');
2014-05-02 10:17:27 +02:00
$aCheckScripts = array();
2014-05-02 09:50:17 +02:00
/** @var SplFileInfo $oFileInfo */
foreach (new RecursiveDirectoryIterator($sFolder) AS $oFileInfo) {
if (!in_array($oFileInfo->getFileName(), $aIgnoreDirItems) && $oFileInfo->isDir()) {
$aCheckScripts = array_merge($aCheckScripts, $this->_walkThroughDirs($oFileInfo->getRealPath()));
} elseif ($oFileInfo->isFile()) {
if (strtolower($oFileInfo->getFilename()) == $this->_sInFolderFileName) {
$aCheckScripts[] = str_replace('\\', '/', $oFileInfo->getRealPath());
}
}
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
return $aCheckScripts;
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $aScriptList
* @param $sMethodName
* @param $aArguments
*
* @return array
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
protected function _checkScripts($aScriptList, $sMethodName, $aArguments)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$aReturn = array();
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
foreach ($aScriptList as $sScriptPath) {
2014-05-02 10:17:27 +02:00
$sUrl = $this->_getFolderCheckUrl(
2014-05-02 09:50:17 +02:00
$sScriptPath,
$sMethodName,
$aArguments
);
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
$aReturn[$this->getBasePath($sScriptPath)] = unserialize(file_get_contents($sUrl));
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
return $aReturn;
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sScriptPath
* @param $sMethodName
* @param $aArguments
*
* @return string
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
protected function _getFolderCheckUrl($sScriptPath, $sMethodName, $aArguments)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$sBaseDir = str_replace(
array(basename($_SERVER['SCRIPT_FILENAME']), '\\'),
array('', '/'),
realpath($_SERVER['SCRIPT_FILENAME'])
);
$sUrlAdd = str_replace($sBaseDir, '', $sScriptPath);
$sBaseUrl = 'http://' . $_SERVER['HTTP_HOST'] . str_replace(
basename($_SERVER['SCRIPT_NAME']),
'',
$_SERVER['SCRIPT_NAME']
);
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
$sUrl = $sBaseUrl . $sUrlAdd . '?fnc=' . $sMethodName . '&params=' . urlencode(serialize($aArguments));
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
return $sUrl;
2013-11-07 11:48:25 +01:00
}
/**
2014-05-02 09:50:17 +02:00
* @param null $sFolder
*
* @return mixed
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function getBasePath($sFolder = null)
2013-11-07 11:48:25 +01:00
{
2014-05-02 09:50:17 +02:00
if (!$sFolder) {
$sFolder = $_SERVER['SCRIPT_FILENAME'];
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
$sScriptFileName = str_replace('\\', '/', realpath($_SERVER['SCRIPT_FILENAME']));
$sSearch = substr(str_replace(basename($sScriptFileName), '', $sScriptFileName), 0, -1);
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
$sFolder = str_replace('\\', '/', realpath($sFolder));
return str_replace(array(basename($sFolder), $sSearch), '', $sFolder);
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $aResult
*
2013-11-07 11:48:25 +01:00
* @return bool
*/
2014-05-02 09:50:17 +02:00
protected function _hasFalseInResult($aResult)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
if (is_array($aResult)) {
foreach ($aResult as $blResult) {
if (!$blResult) {
$this->blGlobalResult = false;
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
return true;
}
}
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
return false;
} else {
if (!$aResult) {
$this->blGlobalResult = false;
}
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
return !$aResult;
}
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/********************** conversion function section ************************/
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $mParam
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function aTos(&$mParam)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
if (is_array($mParam)) {
$mParam = implode($this->oLayout->translate('or'), $mParam);
2013-02-21 14:59:26 +01:00
}
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @return string
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function getLang()
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
if (isset($_REQUEST['lang'])) {
return strtolower($_REQUEST['lang']);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
return 'de';
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @return bool|resource
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function getDb()
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
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);
2013-02-21 14:59:26 +01:00
}
}
2014-05-02 09:50:17 +02:00
return $this->_db;
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $version
* @param int $iUnsetPart
*
* @return string
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function versionToInt($version, $iUnsetPart = 0)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$match = explode('.', $version);
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
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
)
);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/********************** layout function section ************************/
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
public function deleteme()
{
$sFolder = '.';
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
$this->_checkDelFilesInDir($sFolder);
$this->_delFile($_SERVER['SCRIPT_FILENAME']);
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
if (is_file($_SERVER['SCRIPT_FILENAME'])) {
exit($this->oLayout->translate('unableDeleteFile'));
} else {
exit($this->oLayout->translate('goodBye'));
2013-02-21 14:59:26 +01:00
}
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sFolder
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
protected function _checkDelFilesInDir($sFolder)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$aIgnoreDirItems = array('.', '..');
/** @var SplFileInfo $oFileInfo */
foreach (new RecursiveDirectoryIterator($sFolder) as $oFileInfo) {
if (!in_array($oFileInfo->getFileName(), $aIgnoreDirItems) && $oFileInfo->isDir()) {
$this->_checkDelFilesInDir($oFileInfo->getRealPath());
} elseif ($oFileInfo->isFile()) {
if (strtolower($oFileInfo->getFilename()) == $this->_sInFolderFileName) {
$this->_delFile(str_replace('\\', '/', $oFileInfo->getRealPath()));
2013-11-07 11:48:25 +01:00
}
2013-02-21 14:59:26 +01:00
}
}
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sPath
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
protected function _delFile($sPath)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
unlink($sPath);
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sCheckType
* @param $aConfiguration
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function displayCheck($sCheckType, &$aConfiguration)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$sGenCheckType = preg_replace("@(\_[0-9]$)@", "", $sCheckType);
2014-05-02 10:17:27 +02:00
$oTests = new requTests($this, $this->oConfig, $this->getDb(), $this->oRemote);
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
if (method_exists($oTests, $sGenCheckType)) {
2014-05-02 10:17:27 +02:00
$aResult = $oTests->{$sGenCheckType}($aConfiguration);
2014-05-02 09:50:17 +02:00
$sElementId = (md5($sGenCheckType . serialize($aConfiguration)));
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
if ($this->_hasFalseInResult($aResult)) {
$this->oLayout->getNoSuccessItem($aResult, $sElementId, $sCheckType, $aConfiguration);
} else {
$this->oLayout->getSuccessItem($aResult, $sElementId, $sCheckType, $aConfiguration);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
} else {
$this->oLayout->getUncheckableItem($sCheckType, $aConfiguration);
$this->blGlobalResult = false;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
}
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
public function showinfo()
{
phpinfo();
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
}
/**
* Class requLayout
*/
class requLayout
{
public $oBase;
2014-05-02 10:17:27 +02:00
2014-05-02 09:50:17 +02:00
public $oConfig;
2013-02-21 14:59:26 +01:00
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param requCheck $oBase
* @param requConfig $oConfig
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function __construct(requCheck $oBase, requConfig $oConfig)
2013-02-21 14:59:26 +01:00
{
2014-05-02 10:17:27 +02:00
$this->oBase = $oBase;
2014-05-02 09:50:17 +02:00
$this->oConfig = $oConfig;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
public function getHTMLHeader()
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$sScriptName = $_SERVER['SCRIPT_NAME'];
$sTranslRequCheck = $this->translate('RequCheck');
$sModName = $this->oConfig->sModName;
$sModVersion = $this->oConfig->sModVersion;
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
echo <<< EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>
$sTranslRequCheck "$sModName" $sModVersion
</title>
<style type="text/css">
<!--
body {background: #FFF url($sScriptName?fnc=getGifBg) repeat-x; font: 13px Trebuchet MS,Tahoma,Verdana,Arial,Helvetica,sans-serif;}
.btn_1 {background: url($sScriptName?fnc=getPngButton) no-repeat scroll right 0; height: 22px; padding: 0 3px 0 0; float: left; margin-bottom: 10px;}
.btn_2 {background: url($sScriptName?fnc=getPngButton) no-repeat; height: 22px; color: white; font-weight: bold; line-height: 1; display: block; padding: 4px 5px 0px; text-decoration: none; font-family: Verdana; font-size: 12px;}
#logo {position: absolute; top: 10px; right: 30px;}
.box_warning { text-align: center; background-color: DarkRed; border: 1px solid black; color: white; font-weight: normal; padding: 1px;}
.box_ok { text-align: center; background-color: DarkGreen; border: 1px solid black; color: white; font-weight: normal; padding: 1px;}
.box_warning a, .box_ok a {font-weight: bold; color: white;}
.squ_bullet {float: left; height: 10px; width: 10px; border: 1px solid black; margin: 0 5px 0 50px; display: inline-block;}
.squ_toggle {font-size: 15px; line-height: 0.5; cursor: pointer; float: left; height: 10px; width: 9px; padding-left: 1px; border: 1px solid black; margin: 0 5px 0 3px; display: inline-block;}
-->
</style>
</head>
<body>
<a href="http://www.oxidmodule.com/"><img id="logo" src="$sScriptName?fnc=getPngLogo"></a>
<a href="$sScriptName?lang=de"><img src="$sScriptName?fnc=getGifDe"></a> <a href="$sScriptName?lang=en"><img src="$sScriptName?fnc=getGifEn"></a>
EOT;
echo "<h3>" . $this->translate('RequCheck') . ' "' . $this->oConfig->sModName . ' ' . $sModVersion . '"</h3>';
echo '<p>' . $this->translate('ExecNotice') . '</p>' . PHP_EOL;
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
return;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
public function getHTMLFooter()
{
$sScriptName = $_SERVER['SCRIPT_NAME'];
$sTranslShopPhpInfo = $this->translate('showPhpInfo');
$sTranslDependent = $this->translate('dependentoffurther');
if ($this->oBase->blGlobalResult) {
echo '<p class="box_ok"><b>' . $this->translate('globalSuccess') . '</b>' .
$this->translate('deleteFile1') . $sScriptName . $this->translate('deleteFile2') . '</p>';
} else {
echo '<p class="box_warning"><b>' . $this->translate('globalNotSuccess') . '</b>' .
$this->translate('deleteFile1') . $sScriptName . $this->translate('deleteFile2') . '</p>';
}
echo <<< EOT
<sub>$sTranslDependent</sub><br>
<p>
<span class="btn_1">
<a href="#" class="btn_2" onClick="document.getElementById('phpinfo').style.display = document.getElementById('phpinfo').style.display == 'none' ? 'block' : 'none';">$sTranslShopPhpInfo</a>
</span>
</p>
<iframe id="phpinfo" src="$sScriptName?fnc=showinfo" style="display:none; width: 100%; height: 700px;"></iframe>
</body>
</html>
EOT;
return;
}
/**
* @param $aResult
* @param $sElementId
* @param $sCheckType
* @param $aConfiguration
*/
public function getNoSuccessItem($aResult, $sElementId, $sCheckType, $aConfiguration)
{
echo "<div class='squ_bullet' style='background-color: red;' title='" . $this->translate('RequNotSucc') .
"'></div>" . $this->_addToggleScript($aResult, $sElementId) .
$this->translate($sCheckType, $aConfiguration) . "<br>" . PHP_EOL;
$this->getSubDirItems($aResult, $sElementId);
}
/**
* @param $aResult
* @param $sElementId
* @param $sCheckType
* @param $aConfiguration
*/
public function getSuccessItem($aResult, $sElementId, $sCheckType, $aConfiguration)
{
echo "<div class='squ_bullet' style='background-color: green;' title='" .
$this->translate('RequSucc') . "'></div>" .
$this->_addToggleScript($aResult, $sElementId) .
$this->translate($sCheckType, $aConfiguration) . "<br>" . PHP_EOL;
$this->getSubDirItems($aResult, $sElementId);
}
/**
* @param $sCheckType
* @param $aConfiguration
*/
public function getUncheckableItem($sCheckType, $aConfiguration)
{
echo "<div class='squ_bullet' style='background-color: orange;' title='" .
$this->translate('RequNotCheckable') . "'></div>" .
$this->translate($sCheckType, $aConfiguration) . " (" . $this->translate('RequNotCheckable') . ")<br>";
}
/**
* @param $aResult
* @param $sElementId
*/
public function getSubDirItems($aResult, $sElementId)
{
if (is_array($aResult) && count($aResult)) {
echo "<div style='margin-left: 20px; display: none;' id='" . $sElementId . "'>";
foreach ($aResult as $sPath => $blResult) {
if (!$blResult) {
echo "<div class='squ_bullet' style='background-color: red;' title='" .
$this->translate('RequNotSucc') . "'></div>" . $sPath . "<br>";
} else {
echo "<div class='squ_bullet' style='background-color: green;' title='" .
$this->translate('RequSucc') . "'></div>" . $sPath . "<br>";
}
}
echo "</div>" . PHP_EOL;
}
}
/**
* @param $aResult
* @param $sElementId
*
* @return string
*/
protected function _addToggleScript($aResult, $sElementId)
{
if (is_array($aResult) && count($aResult)) {
2014-05-02 10:17:27 +02:00
$sScript =
"<div class='squ_toggle' title='"
. $this->translate(
2014-05-02 09:50:17 +02:00
'toggleswitch'
2014-05-02 10:17:27 +02:00
)
. "' onClick='document.getElementById(\""
. $sElementId
. "\").style.display = document.getElementById(\""
. $sElementId
. "\").style.display == \"none\" ? \"block\" : \"none\"; this.innerHTML = document.getElementById(\""
. $sElementId
. "\").style.display == \"none\" ? \"+\" : \"&minus;\";'>+</div>";
2014-05-02 09:50:17 +02:00
} else {
$sScript = "";
}
return $sScript;
}
/**
2013-11-07 11:48:25 +01:00
* @param $sIdent
* @param array $aConfiguration
*
* @return mixed|string
*/
public function translate($sIdent, $aConfiguration = array())
2013-02-21 14:59:26 +01:00
{
2014-05-02 10:17:27 +02:00
$sGenIdent = preg_replace("@(\_[0-9]$)@", "", $sIdent);
2014-05-02 09:50:17 +02:00
$oTranslations = new requTranslations();
2014-05-02 10:17:27 +02:00
$aTransl = $oTranslations->getTranslations();
2014-05-02 09:50:17 +02:00
if (isset($aConfiguration['aParams']) && is_array($aConfiguration['aParams'])) {
array_walk($aConfiguration['aParams'], array($this->oBase, 'aTos'), $sIdent);
}
if (($sTranslation = $aTransl[$this->oBase->getLang()][$sGenIdent])) {
if (isset($aConfiguration['aParams'])) {
return vsprintf($sTranslation, $aConfiguration['aParams']);
} else {
return $sTranslation;
}
} else {
return $sGenIdent;
}
}
public function getPngButton()
{
2014-05-02 10:17:27 +02:00
$sImg =
"iVBORw0KGgoAAAANSUhEUgAABDgAAAAWCAYAAAAl+SzaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABMpJREFUeNrs3Y1O4zgUhuFY4hbb2ZthRjtczOz0Ght7cZwfQ5u2E4K0a55XiNDUXyWcT+ZwfGyHw+HQvZI6AACAT+J0OgW9AAAAtnA8Hh/JWYSnbkxuvAYeeg0AAAAAAPynuJevOB6P+ZKe6sYvLy96DgAA7M7z87NOAAAAm7iVq8gxRs5p5CTH03Tz758/uzAUc7x+Hy4pf71ex9fDj2leyxLG1vnNELpmdJPqo21a7afy+/MIj/AIj7zVhS/seWPD4zoAAIAtxJhW44+cy/jx/ftw/2kRxDEQSd0Uraah/RKVlLfK+/kDS0T7eieGZnTdA33QfeF+CpFHeIRHeORSF1Lw3I0Nd3UAAACbEhwprscfadnma05wpL7v8v0Sh4QiLimREqWEt7mSmK9xnLlrSBe6fdq02k9D1oxHeIRHeORCFz13Y8NtHQAAwNYER+zX44+q3Zzg6GOcbw6haqhmXG5MvuQPiw3q9mrTaj/xCI/wCI9c13juxoY/0wEAANxNcPTxbvzxLsHRd7mEo8y+pJIFCWEupy2XMTcSxjKQUMqSl1mb/79urzbN9hOP8AiP8MgV3Zf2vLHhIR0AAMBWcr5iNf6o4owlwdGPCY68hiUsZbRh2DGsWkz7/mUaVl83oxu3R/xwm1b7KfEIj/AIj1zRDfc9d2PDTR0AAMA2hgqOtfijWqOybDKaExzj6pVpzWyYG04zdGn5vByohVC924ou7NSm3X7iER7hER55r/P3w9jw6NgAAADwp+SCjPX442oFR5URWeaY5pKPsmNpmI+SnctN5zKRVnR7tWm1nwKP8AiP8MiKznM3NqzrAAAANic4zuf1+ONaBce576dQZAhMplPepvWzYdn6vSoBCUNJSCkPaUS3V5tm+4lHeIRHeORS97U9b2x4RAcAALA5wZEPRVmJP1K4ckxsPJ/H9SzjOvpuEc11INP805gtWQ6Ka0gXdmrTaD8NGTMe4REe4ZFrOs/d2HBLBwAAsJHzuV+PP6qJlKqCI3ZdvaZliVGm3MiYKZm3EJuvXera0aW0T5tG+2kKYHmER3iER2pdU8/Pc/+0sQEAAGALec/Q9fjjSgVH358v/zFZJNXy6ukYuFQqREZBK7q0U5tm+4lHeIRHeOSqLnnuxoa7YwMAAMAWzvF8M/64THDEOB+xEsYIJlV7d5R1tdNGHsMnlvW2I63opirrj7Zptp86HuERHuGRS92X9ryx4cGxAQAAYBv5mNi1+OP6HhzDMbEVad5JrKoxrdbfzlFa155urzYt9lPgER7hER658bt47saGVR0AAMA28ikqj8QfVQVH3705ceU1KEm5qmM+0y7N8crwOqY5a5Ja0sWd2jTaTykmHuERHuGRS52/H8aGuzoAAIBtxCGIWok/riU4Yl8EZVOwEpSUG9X62XmRS1w+oV5z24RurzaN9tO0QR6P8AiP8MgbnedubLitAwAA2EqfExo34o+LBMevX7+6b9/+KkFItYZlmI0tP1XBS3UE3LhNeju6vdq02k8dj/AIj/DIhW48W8NzNzbcHBsAAAC2MGypsRJ//P7n9/J/yOFwGO6fTie9BgAAPgvrVAAAwFZuzpgcj8fh+jQGHGm6AQAAsDcmUgAAwFYezFeEfwUYAAoCUXB0RZrTAAAAAElFTkSuQmCC";
2014-05-02 09:50:17 +02:00
header("Content-type: image/png");
echo base64_decode($sImg);
exit;
}
public function getPngLogo()
{
2014-05-02 10:17:27 +02:00
$sImg =
"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
2014-05-02 09:50:17 +02:00
header("Content-type: image/png");
echo base64_decode($sImg);
exit;
}
public function getGifBg()
{
2014-05-02 10:17:27 +02:00
$sImg =
"R0lGODlhCgAyANUAANHo+pfK85rM8/X6/vb6/v///5jL85bJ8+Hv/KbS9dzt+87m+qTR9fH4/er1/b7e+MTh+P3+/63V9u/3/dfq+rnc97fa96DP9Nns+53N9LLY9tTp+sHg+Mzl+cfi+OPx/Pv9/7DX9p/O9Oz2/bTZ9uXy/KLQ9Pj7/ujz/bzd9/7+//r8//P5/snj+ZvM897u+6nT9avU9qvU9QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAKADIAAAbFwINwSAwYj0iDcskUOJ9Ql3RKzVivWJF2y714v2CTeExmmM/ohHrNhrnf8Jh8PpdJ7vh8aM/va/6AgSSDhIUWh4iJFYuMjSmPkJEPk5SVHJeYmRCbnJ0en6ChLaOkpR2nqKkLq6ytAK+wsRuztLUUt7i5GLu8vQq/wMEvw8TFCMfIyR/LzM0lz9DRKNPU1Q7X2Nkj29zdE9/g4Q3j5OUs5+jpA+vs7QTv8PEn8/T1K/f4+SD7/P0R/wADqhhIsGCBgwgTBgEAOw==";
2014-05-02 09:50:17 +02:00
header("Content-type: image/Gif");
echo base64_decode($sImg);
exit;
}
public function getGifDe()
{
2014-05-02 10:17:27 +02:00
$sImg =
"R0lGODlhEgANAIQZAAAAABAFBhEGBhIGBhQHBxUHCCYNDZQqH5QrI9c4M+M4M9w9M+g/MuNDM/BFM99tI+t3H+CyDerIB+zIBuzKBurLCPfcAPfgAPjlAP///////////////////////////ywAAAAAEgANAAAFVaARCGRpmoExAGzrvsBAwHRLFHVdIEfv/8ADouEoGo9IR2PBaDqfUMYioahar1hF4gHper9gyKOCKZvPaExFcmm73/CLZGKp2+94yyRCmfj/gIAUESEAOw==";
2014-05-02 09:50:17 +02:00
header("Content-type: image/Gif");
echo base64_decode($sImg);
exit;
}
public function getGifEn()
{
2014-05-02 10:17:27 +02:00
$sImg =
"R0lGODlhEgANAOfRANzd6P9LQP7//93e6ba32v8HB/J4ef//+/85Of8fFVddwP8aFq+13P8aFPr////f3f8XE/n//62s3fQuLAIDj6ys3uHZ5P8uLOjp793f6dbX6uvBxsyasurCx/9fXcadtS88r+Da5EZHr+Hi7A0NlUVGqcjR9MKaunh5x/8REQAAkv9IP/9BPnh6wi4/td3c5uLl7P8PD7vO9aGSw7bM9uDh6UpLsf8hFv/f3PPx9/Dx9DFCuMDE4cHF4/sAANPU3ufp8JSDvuVocf8ODvz8+/xRTPQgG+PM0ZSWzs/R476+4ujp8v8/PurO0uPZ3//u5fQCAOPj6nFxxf8UE8rM4P/w5YGM18PH4/79/ExUuP3//4CAxqmo3KaZxv7+/RcstO3v89XW6fS8waOj2snM7Nra7Ccon+no9v03OFJZvuK2xBEipP89Ov8dE+be4u3u8/w3OOVocv8sKv8EBOjo9+/u+Kap15SFvgwRlba327uXteHh7tvc5yo3q9XX5SQ4uU5MrtjW5qaVxvDS2f8DA+Tj6vr6/j1FtVlgvL+euvHw9v+rqe7u+XKJ1ebn7p2x7CUmnvb2+dPW8P8cEc/P4efn8/38/5Ws66mYx/ccGNfY5vh0d927zSUlov96ev88OgAAjmmA09rb5v+xsPF5eMnR8i0upuuAgvEyLx0rq97f6cunwEBIuO/Aw/9/fuTm6vn5+vTEyM7P5rq63BESlf+Fgv8fF8SWsOfp7+2rrvX1+La23RgmqLe43PPV2vdydhcnqIWQ2BEgoube4wASn82atOHj6uTT2f97etKjuf9dWsSduZyb08fJ4fn5+/z8/f+ZAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ywAAAAAEgANAAAI/gB/YHCkig+AAVGGuSmUAYCoEbpgGXsFY8kWM7T6JEI14QMIEpBaVNIBRBOSOtEqmAK27EabYqk6jYl2hpksKnjSmIgmqdEqWw2ShSITrZQCFXb8IDpkRdGBCLGmpBDj4ECOYKyyXHFyyoCQX8hceShQQFktT5viGCDV5AgUaHDjypXrI9exIgHYwEHA5MIcQnJYIEDzKcCKVi+63BE0CMeTUTGGLKrywBemIDMCJVnz5ZIWATI4LYCghoaAaI/+EGNAqQQXQ4xQuDiRYBKHHVLoWJIAaFaNZkSU2KAgTI+RTLd4gRKxC0uZPQPAvAnTiwCPEB02WOiRh4CGZ15wAgUEADs=";
2014-05-02 09:50:17 +02:00
header("Content-type: image/Gif");
echo base64_decode($sImg);
exit;
}
}
/**
* Class requTranslations
*/
class requTranslations
{
/**
* @return array
*/
public function getTranslations()
{
return array(
2013-02-21 14:59:26 +01:00
'de' => array(
'RequCheck' => 'Mindestanforderungspr<70>fung',
2014-05-02 10:17:27 +02:00
'ExecNotice' =>
'F<>hren Sie diese Pr<50>fung immer aus dem Stammverzeichnis Ihres Shops aus. ' .
2014-05-02 09:50:17 +02:00
'Nur dann k<>nnen die Pr<50>fungen erfolgreich durchgef<65>hrt werden.',
2013-02-21 14:59:26 +01:00
'RequSucc' => 'Bedingung erf<72>llt',
'RequNotSucc' => 'Bedingung nicht erf<72>llt',
'RequNotCheckable' => 'Bedingung nicht pr<70>fbar',
'hasMinPhpVersion' => 'mindestens PHP Version %s',
'hasMaxPhpVersion' => 'maximal PHP Version %s',
2014-05-02 09:50:17 +02:00
'hasFromToPhpVersion' => 'Server verwendet PHP Version zwischen %s und %s',
2013-02-21 14:59:26 +01:00
'hasSoap' => 'SOAP-Erweiterung verf<72>gbar',
'hasCurl' => 'Curl-Erweiterung verf<72>gbar',
'hasExtension' => '%s-Erweiterung verf<72>gbar',
'hasMinShopVersion' => 'mindestens Shop Version %s',
'hasMaxShopVersion' => 'maximal Shop Version %s',
2013-11-07 11:48:25 +01:00
'hasMinModCfgVersion' => 'ModCfg-Eintrag "%s" (%s) mit mindestens Version %s',
'hasMaxModCfgVersion' => 'ModCfg-Eintrag "%s" (%s) mit maximal Version %s',
2014-05-02 10:17:27 +02:00
'hasModCfg' => '<a href="http://www.oxidmodule.com/Connector" target="Connector">Modul-' .
2014-05-02 09:50:17 +02:00
'Connector</a> installiert',
2013-02-21 14:59:26 +01:00
'isShopEdition' => 'ist Shopedition %s',
2014-05-02 10:17:27 +02:00
'hasZendLoaderOptimizer' => 'Zend Optimizer (PHP 5.2) oder Zend Guard Loader (PHP 5.3, 5.4) ' .
2014-05-02 09:50:17 +02:00
'installiert',
2013-02-21 14:59:26 +01:00
'hasIonCubeLoader' => 'ionCube loader installiert',
'globalSuccess' => 'Die Pr<50>fung war erfolgreich. Sie k<>nnen das Modul installieren.*<br><br>',
2014-05-02 10:17:27 +02:00
'globalNotSuccess' => 'Die Pr<50>fung war nicht erfolgreich. Bitte kontrollieren Sie die rot ' .
2014-05-02 09:50:17 +02:00
'markierten Bedingungen.<br><br>',
2014-05-02 10:17:27 +02:00
'deleteFile1' => 'L<>schen Sie diese Datei nach der Verwendung bitte unbedingt wieder von ' .
2014-05-02 09:50:17 +02:00
'Ihrem Server! Klicken Sie <a href="',
2013-02-21 14:59:26 +01:00
'deleteFile2' => '?fnc=deleteme">hier</a>, um diese Datei zu l<>schen.',
'showPhpInfo' => 'PHPinfo anzeigen',
'dependentoffurther' => '* abh<62>ngig von ungepr<70>ften Voraussetzungen',
2014-05-02 10:17:27 +02:00
'oneandonedescription' => '** gepr<70>ft wurde das Ausf<73>hrungsverzeichnis, providerabh<62>ngig m<>ssen ' .
2014-05-02 09:50:17 +02:00
'Unterverzeichnisse separat gepr<70>ft werden (z.B. bei 1&1)',
2013-11-07 11:48:25 +01:00
'or' => ' oder ',
2014-05-02 09:50:17 +02:00
'toggleswitch' => 'Klick f<>r Details zur Pr<50>fung',
'unableDeleteFile' => 'Datei konnte nicht gel<65>scht werden. Bitte l<>schen Sie diese manuell.',
'goodBye' => 'Auf Wiedersehen.',
2013-02-21 14:59:26 +01:00
),
'en' => array(
'RequCheck' => 'Requirement check',
2014-05-02 10:17:27 +02:00
'ExecNotice' => 'Execute this check script in the root directory of your shop. In this ' .
2014-05-02 09:50:17 +02:00
'case only checks can executed succesfully.',
2013-02-21 14:59:26 +01:00
'RequSucc' => 'condition is fulfilled',
'RequNotSucc' => 'condition isn\'t fulfilled',
'RequNotCheckable' => 'condition isn\'t checkable',
'hasMinPhpVersion' => 'at least PHP version %s',
'hasMaxPhpVersion' => 'not more than PHP version %s',
2014-05-02 09:50:17 +02:00
'hasFromToPhpVersion' => 'server use PHP version between %s and %s',
2013-02-21 14:59:26 +01:00
'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',
2013-11-07 11:48:25 +01:00
'hasMinModCfgVersion' => 'ModCfg item "%s" (%s) has at least version %s',
'hasMaxModCfgVersion' => 'ModCfg item "%s" (%s) has not more than version %s',
2014-05-02 10:17:27 +02:00
'hasModCfg' => '<a href="http://www.oxidmodule.com/Connector" target="Connector">Module ' .
2014-05-02 09:50:17 +02:00
'Connector</a> installed',
2013-02-21 14:59:26 +01:00
'isShopEdition' => 'shop edition is %s',
2014-05-02 09:50:17 +02:00
'hasZendLoaderOptimizer' => 'Zend Optimizer (PHP 5.2) or Zend Guard Loader (PHP 5.3, 5.4) installed',
2013-02-21 14:59:26 +01:00
'hasIonCubeLoader' => 'ionCube loader installed',
2014-05-02 10:17:27 +02:00
'globalSuccess' => 'The test was successful. Your server is ready for installing the ' .
2014-05-02 09:50:17 +02:00
'module.*<br><br>',
2014-05-02 10:17:27 +02:00
'globalNotSuccess' => 'The test wasn\'t successfull. Please check the red marked ' .
2014-05-02 09:50:17 +02:00
'conditions.<br><br>',
2013-02-21 14:59:26 +01:00
'deleteFile1' => 'Please delete this file after use on your server! Click <a href="',
'deleteFile2' => '?fnc=deleteme">here</a>, to delete this file.',
'showPhpInfo' => 'show PHPinfo',
'dependentoffurther' => '* dependent of further unchecked conditions',
2014-05-02 10:17:27 +02:00
'oneandonedescription' => '** this check use execution directory only, provider dependend ' .
2014-05-02 09:50:17 +02:00
'subdirectories have to check separately (e.g. at 1&1)',
2013-11-07 11:48:25 +01:00
'or' => ' or ',
2014-05-02 09:50:17 +02:00
'toggleswitch' => 'click for details',
'unableDeleteFile' => 'Unable to delete file. Please delete it manually.',
'goodBye' => 'Good Bye.',
2013-02-21 14:59:26 +01:00
),
);
2014-05-02 09:50:17 +02:00
}
}
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
/**
* Class requRemote
*/
class requRemote
{
public $blUseRemote = true;
2014-05-02 10:46:51 +02:00
public $oModuleData = array();
2014-05-02 09:50:17 +02:00
/**
* @param $sModId
* @param $sModVersion
* @param $sShopEdition
*
* @return bool|array
*/
public function getShopEdition($sModId, $sModVersion, $sShopEdition)
{
$sUrl = "moduleversion/";
$sUrl .= 'modid/' . urlencode($sModId) . '/';
$sUrl .= 'forcemodversion/' . urlencode($sModVersion) . '/';
$sUrl .= 'edition/' . urlencode($sShopEdition) . '/';
/** @var stdClass $oModuleData */
$oModuleData = $this->_getRemoteServerData($sUrl);
if ($oModuleData->status == 'OK' && isset($oModuleData->moduleversion->compatible_release)) {
return explode(',', $oModuleData->moduleversion->compatible_release->shopedition);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
return false;
}
/**
* @param $sModId
* @param $sModVersion
* @param $sShopEdition
*
* @return bool|string
*/
public function getMinShopVersion($sModId, $sModVersion, $sShopEdition)
{
$sUrl = "moduleversion/";
$sUrl .= 'modid/' . urlencode($sModId) . '/';
$sUrl .= 'forcemodversion/' . urlencode($sModVersion) . '/';
$sUrl .= 'edition/' . urlencode($sShopEdition) . '/';
/** @var stdClass $oModuleData */
$oModuleData = $this->_getRemoteServerData($sUrl);
if ($oModuleData->status == 'OK' && isset($oModuleData->moduleversion->compatible_release)) {
return $this->shortenVersion($oModuleData->moduleversion->compatible_release->fromshopversion);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
return false;
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sModId
* @param $sModVersion
* @param $sShopEdition
*
* @return bool|string
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function getMaxShopVersion($sModId, $sModVersion, $sShopEdition)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$sUrl = "moduleversion/";
$sUrl .= 'modid/' . urlencode($sModId) . '/';
$sUrl .= 'forcemodversion/' . urlencode($sModVersion) . '/';
$sUrl .= 'edition/' . urlencode($sShopEdition) . '/';
/** @var stdClass $oModuleData */
$oModuleData = $this->_getRemoteServerData($sUrl);
if ($oModuleData->status == 'OK' && isset($oModuleData->moduleversion->compatible_release)) {
return $this->shortenVersion($oModuleData->moduleversion->compatible_release->toshopversion);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
return false;
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sUrl
*
2014-05-02 10:46:51 +02:00
* @return stdClass
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
protected function _getRemoteServerData($sUrl)
2013-02-21 14:59:26 +01:00
{
2014-05-02 10:46:51 +02:00
if (isset($this->oModuleData[$sUrl])) {
return $this->oModuleData[$sUrl];
2013-02-21 14:59:26 +01:00
}
2014-05-02 10:46:51 +02:00
$oFailureData = new stdClass();
$oFailureData->status = 'NOK';
2014-05-02 09:50:17 +02:00
2014-05-02 10:46:51 +02:00
if (false === $this->blUseRemote) {
return $oFailureData;
}
$sHost = "http://update.oxidmodule.com";
$sData = $this->curlConnect($sHost . '/serialized/' . $sUrl);
$oData = unserialize($sData);
2014-05-02 09:50:17 +02:00
2014-05-02 10:46:51 +02:00
if (false == $oData) {
return $oFailureData;
2014-05-02 09:50:17 +02:00
}
2014-05-02 10:46:51 +02:00
$this->oModuleData[$sUrl] = $oData;
2014-05-02 09:50:17 +02:00
2014-05-02 10:46:51 +02:00
return $this->oModuleData[$sUrl];
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sFilePath
*
* @return string
2013-11-07 11:48:25 +01:00
*/
2014-05-02 09:50:17 +02:00
public function curlConnect($sFilePath)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$sContent = '';
2014-05-02 10:17:27 +02:00
if (extension_loaded('curl')
&& function_exists('curl_init')
&& function_exists('curl_exec')
&& $ch = curl_init()
2014-05-02 09:50:17 +02:00
) {
$sCurl_URL = preg_replace('@^((http|https)://)@', '', $sFilePath);
curl_setopt($ch, CURLOPT_URL, $sCurl_URL);
if ($_SERVER['HTTP_USER_AGENT']) {
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($ch, CURLOPT_POST, 0);
$sContent = curl_exec($ch);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
return $sContent;
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
/**
2014-05-02 09:50:17 +02:00
* @param $sVersion
2013-11-07 11:48:25 +01:00
*
* @return string
*/
2014-05-02 09:50:17 +02:00
public function shortenVersion($sVersion)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$aVersion = explode('.', $sVersion);
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
unset($aVersion[3]);
return implode('.', $aVersion);
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
}
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
/**
* Class requTests
* contains test functions
*/
class requTests
{
public $oBase;
2014-05-02 10:17:27 +02:00
2014-05-02 09:50:17 +02:00
public $oDb;
2014-05-02 10:17:27 +02:00
2014-05-02 09:50:17 +02:00
public $oConfig;
2014-05-02 10:17:27 +02:00
2014-05-02 09:50:17 +02:00
public $blGlobalResult = false;
/**
* @param requCheck $oCheckInstance
* @param requConfig $oConfig
* @param $oDb
* @param requRemote $oRemote
*/
public function __construct(requCheck $oCheckInstance, requConfig $oConfig, $oDb, requRemote $oRemote)
2013-02-21 14:59:26 +01:00
{
2014-05-02 10:17:27 +02:00
$this->oBase = $oCheckInstance;
2014-05-02 09:50:17 +02:00
$this->oConfig = $oConfig;
2014-05-02 10:17:27 +02:00
$this->oDb = $oDb;
2014-05-02 09:50:17 +02:00
$this->oRemote = $oRemote;
}
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
/**
* @return requCheck
*/
public function getBase()
{
return $this->oBase;
}
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
public function getDb()
{
return $this->oDb;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @return string
*/
public function getBasePath()
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
return $this->getBase()->getBasePath();
}
2013-11-07 11:48:25 +01:00
2014-05-02 09:50:17 +02:00
/**
* @param bool $blResult
*/
public function setGlobalResult($blResult)
{
$this->getBase()->blGlobalResult = $blResult;
}
/**
* @param $sMethodName
* @param null $aArguments
*
* @return array
*/
public function checkInSubDirs($sMethodName, $aArguments = null)
{
return $this->getBase()->checkInSubDirs($sMethodName, $aArguments);
}
/**
* @param $aConfiguration
*
* @return array
*/
public function hasMinPhpVersion(&$aConfiguration)
{
$aResult[$this->getBasePath()] = false;
if (version_compare(phpversion(), $aConfiguration['aParams']['version'], '>=')) {
$aResult[$this->getBasePath()] = true;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
$aResult = array_merge($aResult, $this->checkInSubDirs(__FUNCTION__, $aConfiguration['aParams']));
2013-02-21 14:59:26 +01:00
2014-05-02 09:50:17 +02:00
return $aResult;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @param $aConfiguration
*
* @return array
*/
public function hasFromToPhpVersion(&$aConfiguration)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$aResult[$this->getBasePath()] = false;
2013-02-21 14:59:26 +01:00
2014-05-02 10:17:27 +02:00
if ((version_compare(phpversion(), $aConfiguration['aParams']['from'], '>='))
&& (version_compare(phpversion(), $aConfiguration['aParams']['to'], '<'))
2014-05-02 09:50:17 +02:00
) {
$aResult[$this->getBasePath()] = true;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
$aResult = array_merge($aResult, $this->checkInSubDirs(__FUNCTION__, $aConfiguration['aParams']));
return $aResult;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @param $aConfiguration
*
* @return array
*/
public function hasMaxPhpVersion(&$aConfiguration)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$aResult[$this->getBasePath()] = false;
if (version_compare(phpversion(), $aConfiguration['aParams']['version'], '<=')) {
$aResult[$this->getBasePath()] = true;
}
$aResult = array_merge($aResult, $this->checkInSubDirs(__FUNCTION__, $aConfiguration['aParams']));
return $aResult;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @param $aConfiguration
*
* @return array
*/
public function hasExtension(&$aConfiguration)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
$aResult[$this->getBasePath()] = false;
if (extension_loaded($aConfiguration['aParams']['type'])) {
$aResult[$this->getBasePath()] = true;
}
$aResult = array_merge($aResult, $this->checkInSubDirs(__FUNCTION__, $aConfiguration['aParams']));
return $aResult;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @param $aConfiguration
*
* @return bool
*/
public function hasMinShopVersion(&$aConfiguration)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
if ($this->getDb()) {
$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);
$mMinRemoteVersion = $this->oRemote->getMinShopVersion(
$this->oConfig->sModId,
$this->oConfig->sModVersion,
$sEdition
);
if ($mMinRemoteVersion) {
$aConfiguration['aParams'] = array('version' => $mMinRemoteVersion);
} else {
$aConfiguration['aParams'] = array('version' => $aConfiguration['aParams'][$sEdition]);
}
if (version_compare($oResult->oxversion, $aConfiguration['aParams']['version'], '>=')) {
return true;
}
}
return false;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @param $aConfiguration
*
* @return bool
*/
public function hasMaxShopVersion(&$aConfiguration)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
if ($this->getDb()) {
$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);
$mMaxRemoteVersion = $this->oRemote->getMaxShopVersion(
$this->oConfig->sModId,
$this->oConfig->sModVersion,
$sEdition
);
if ($mMaxRemoteVersion) {
$aConfiguration['aParams'] = array('version' => $mMaxRemoteVersion);
} else {
$aConfiguration['aParams'] = array('version' => $aConfiguration['aParams'][$sEdition]);
}
if (version_compare($oResult->oxversion, $aConfiguration['aParams']['version'], '<=')) {
return true;
}
}
return false;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @param $aConfiguration
*
* @return bool
*/
public function isShopEdition(&$aConfiguration)
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
if ($this->getDb()) {
$oResult = $this->_getShopEdition();
$mRemoteShopEditions = $this->oRemote->getShopEdition(
$this->oConfig->sModId,
$this->oConfig->sModVersion,
$oResult->oxedition
);
if (is_array($mRemoteShopEditions)) {
$aConfiguration['aParams'][0] = $mRemoteShopEditions;
}
if (in_array(strtoupper($oResult->oxedition), $aConfiguration['aParams'][0])) {
$aConfiguration['aParams'][0] = strtoupper($oResult->oxedition);
2014-05-02 10:17:27 +02:00
2014-05-02 09:50:17 +02:00
return true;
}
}
return false;
2013-02-21 14:59:26 +01:00
}
2014-05-02 09:50:17 +02:00
/**
* @return bool|object|stdClass
*/
protected function _getShopEdition()
2013-02-21 14:59:26 +01:00
{
2014-05-02 09:50:17 +02:00
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 bool
*/
public function hasModCfg()
{
if ($this->getDb()) {
$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)) {
$oResult = mysql_fetch_object($rResult);
if ($oResult->result) {
return true;
}
}
}
return false;
}
/**
* @param $aConfiguration
*
* @return bool|int
*/
public function hasMinModCfgVersion(&$aConfiguration)
{
if ($this->getDb()) {
2014-05-02 10:17:27 +02:00
$sSelect =
"SELECT IF " .
"(INET_ATON(oxversion) >= INET_ATON('"
. $aConfiguration['aParams']['version']
. "'), 1, 0) AS result "
.
"FROM d3_cfg_mod "
.
2014-05-02 09:50:17 +02:00
"WHERE
oxmodid = '" . $aConfiguration['aParams']['id'] . "' AND
oxversion != 'basic'
ORDER BY oxversion ASC LIMIT 1";
$rResult = mysql_query($sSelect, $this->getDb());
$aResult = mysql_fetch_assoc($rResult);
if (!(int)$aResult['result']) {
$this->setGlobalResult(false);
}
return (int)$aResult['result'];
}
$this->setGlobalResult(false);
return false;
}
/**
* @param $aConfiguration
*
* @return bool|int
*/
public function hasMaxModCfgVersion(&$aConfiguration)
{
if ($this->getDb()) {
$sSelect = "SELECT
IF (INET_ATON(oxversion) <= INET_ATON('" . $aConfiguration['aParams']['version'] . "'), 1, 0) AS result
FROM d3_cfg_mod WHERE
oxmodid = '" . $aConfiguration['aParams']['id'] . "' AND
oxversion != 'basic'
ORDER BY oxversion ASC LIMIT 1";
$rResult = mysql_query($sSelect, $this->getDb());
$aResult = mysql_fetch_assoc($rResult);
if (!(int)$aResult['result']) {
$this->setGlobalResult(false);
}
return (int)$aResult['result'];
}
$this->setGlobalResult(false);
return false;
}
/**
* @return array
*/
public function hasZendLoaderOptimizer()
{
$aResult = array($this->getBasePath() => false);
2014-05-02 10:17:27 +02:00
if ((version_compare(phpversion(), '5.2.0', '>=')
&& version_compare(phpversion(), '5.2.900', '<')
&& function_exists('zend_optimizer_version')
)
|| (
version_compare(phpversion(), '5.3.0', '>=')
&& version_compare(phpversion(), '5.4.900', '<')
&& function_exists('zend_loader_version')
2014-05-02 09:50:17 +02:00
)
) {
$aResult[$this->getBasePath()] = true;
}
$aResult = array_merge($aResult, $this->checkInSubDirs(__FUNCTION__));
return $aResult;
}
/**
* @return array
*/
public function hasIonCubeLoader()
{
$aResult = array($this->getBasePath() => false);
if (function_exists('ioncube_loader_version')) {
$aResult[$this->getBasePath()] = true;
}
$aResult = array_merge($aResult, $this->checkInSubDirs(__FUNCTION__));
return $aResult;
2013-02-21 14:59:26 +01:00
}
}
2014-05-02 09:50:17 +02:00
/**
* Class requTransformation
*/
class requTransformation
{
public $oCheck;
/**
* @param requCheck $oCheck
*/
public function __construct(requCheck $oCheck)
{
$this->oCheck = $oCheck;
}
/**
* @param $aCheckList
*/
public function transformCheckList($aCheckList)
{
$this->_removeDeprecatedLibs($aCheckList['hasMinModCfgVersion']);
$this->_removeDeprecatedLibs($aCheckList['hasMaxModCfgVersion']);
return $aCheckList;
}
/**
* @param array $aCheck
*/
protected function _removeDeprecatedLibs(&$aCheck)
{
2014-05-02 10:17:27 +02:00
$blDelOldLibs = false;
2014-05-02 09:50:17 +02:00
$sCheckVersion = 0;
if (is_array($aCheck)) {
2014-05-02 10:17:27 +02:00
$sSelect = "SELECT oxversion as result " .
"FROM d3_cfg_mod " .
2014-05-02 09:50:17 +02:00
"WHERE oxmodid = 'd3modcfg_lib' LIMIT 1";
$rResult = mysql_query($sSelect, $this->oCheck->getDb());
if (is_resource($rResult)) {
$oResult = mysql_fetch_object($rResult);
if ($oResult->result) {
$sCheckVersion = $oResult->result;
}
}
foreach ($aCheck as $aModCfgCheck) {
2014-05-02 10:17:27 +02:00
if (isset($aModCfgCheck['aParams']['id'])
&& strtolower($aModCfgCheck['aParams']['id']) == 'd3modcfg_lib'
&& version_compare($sCheckVersion, '4.0.0.0', '>=')
2014-05-02 09:50:17 +02:00
) {
$blDelOldLibs = true;
}
}
reset($aCheck);
if ($blDelOldLibs) {
$aOldLibs = array('d3install_lib', 'd3log_lib', 'd3clrtmp_lib');
foreach ($aCheck as $sKey => $aModCfgCheck) {
2014-05-02 10:17:27 +02:00
if (isset($aModCfgCheck['aParams']['id'])
&& in_array(strtolower($aModCfgCheck['aParams']['id']), $aOldLibs)
2014-05-02 09:50:17 +02:00
) {
unset($aCheck[$sKey]);
}
}
}
}
}
}
/**
* @param $mVar
*/
2013-11-07 11:48:25 +01:00
function dumpvar($mVar)
2013-02-21 14:59:26 +01:00
{
2013-11-07 11:48:25 +01:00
echo "<pre>";
print_r($mVar);
echo "</pre>";
2013-02-21 14:59:26 +01:00
}
2013-11-07 11:48:25 +01:00
$oRequCheck = new requcheck;
if (isset($_REQUEST['fnc']) && $_REQUEST['fnc']) {
$oRequCheck->{$_REQUEST['fnc']}();
} else {
2013-02-21 14:59:26 +01:00
$oRequCheck->startCheck();
2014-05-02 09:50:17 +02:00
}