OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Core\SystemRequirements Class Reference
+ Collaboration diagram for OxidEsales\EshopCommunity\Core\SystemRequirements:

Public Member Functions

 __construct ()
 
 __call ($sMethod, $aArgs)
 
 getConfig ()
 
 isAdmin ()
 
 getRequiredModules ()
 
 checkCurl ()
 
 checkMbString ()
 
 checkServerPermissions ($sPath=null, $iMinPerm=777)
 
 checkModRewrite ()
 
 checkAllowUrlFopen ()
 
 checkFsockopen ()
 
 checkPhpVersion ()
 
 getPhpVersion ()
 
 checkRequestUri ()
 
 checkPhpXml ()
 
 checkJSon ()
 
 checkIConv ()
 
 checkTokenizer ()
 
 checkBcMath ()
 
 checkOpenSsl ()
 
 checkSoap ()
 
 checkMysqlConnect ()
 
 checkMysqlVersion ($installedVersion=null)
 
 checkGdInfo ()
 
 checkIniSet ()
 
 checkMemoryLimit ($sMemLimit=null)
 
 checkCollation ()
 
 checkDatabaseCluster ()
 
 checkUnicodeSupport ()
 
 checkFileUploads ()
 
 getSysReqStatus ()
 
 getSystemInfo ()
 
 getModuleInfo ($sModule=null)
 
 getReqInfoUrl ($sIdent)
 
 getMissingTemplateBlocks ()
 
 checkSessionAutostart ()
 

Static Public Member Functions

static filter ($systemRequirementsInfo, $filterFunction)
 
static canSetupContinue ($systemRequirementsInfo)
 
static iterateThroughSystemRequirementsInfo ($systemRequirementsInfo)
 

Public Attributes

const MODULE_STATUS_UNABLE_TO_DETECT = -1
 
const MODULE_STATUS_BLOCKS_SETUP = 0
 
const MODULE_STATUS_FITS_MINIMUM_REQUIREMENTS = 1
 
const MODULE_STATUS_OK = 2
 
const MODULE_GROUP_ID_SERVER_CONFIG = 'server_config'
 
const MODULE_ID_MOD_REWRITE = 'mod_rewrite'
 
const MODULE_ID_MYSQL_VERSION = 'mysql_version'
 

Protected Member Functions

 _getShopHostInfoFromConfig ()
 
 _getShopSSLHostInfoFromConfig ()
 
 _getShopHostInfoFromServerVars ()
 
 _getShopHostInfo ()
 
 _getShopSSLHostInfo ()
 
 _checkModRewrite ($aHostInfo)
 
 _getAdditionalCheck ()
 
 _getBytes ($sBytes)
 
 _checkTemplateBlock ($sTemplate, $sBlockName)
 
 fetchBlockRecords ()
 
 _getMinimumMemoryLimit ()
 
 _getRecommendMemoryLimit ()
 

Protected Attributes

 $_aRequiredModules = null
 
 $_blSysReqStatus = null
 
 $_aException = ['OXDELIVERY' => 'OXDELTYPE', 'OXSELECTLIST' => 'OXIDENT']
 
 $_aColumns
 
 $_sReqInfoUrl = "https://oxidforge.org/en/system-requirements"
 
 $_aInfoMap
 

Detailed Description

System requirements class.

Constructor & Destructor Documentation

◆ __construct()

OxidEsales\EshopCommunity\Core\SystemRequirements::__construct ( )

Class constructor. The constructor is defined in order to be possible to call parent::__construct() in modules.

Returns
null;

Member Function Documentation

◆ __call()

OxidEsales\EshopCommunity\Core\SystemRequirements::__call (   $sMethod,
  $aArgs 
)

Only used for convenience in UNIT tests by doing so we avoid writing extended classes for testing protected or private methods

Parameters
string$sMethodMethods name
array$aArgsArgument array
Exceptions
SystemComponentExceptionThrows an exception if the called method does not exist or is not accessible in current class
Returns
string

◆ _checkModRewrite()

OxidEsales\EshopCommunity\Core\SystemRequirements::_checkModRewrite (   $aHostInfo)
protected

Checks if mod_rewrite extension is loaded. Checks for one address.

Parameters
array$aHostInfohost info to open socket
Returns
integer

◆ _checkTemplateBlock()

OxidEsales\EshopCommunity\Core\SystemRequirements::_checkTemplateBlock (   $sTemplate,
  $sBlockName 
)
protected

check if given template contains the given block

Parameters
string$sTemplatetemplate file name
string$sBlockNameblock name
See also
getMissingTemplateBlocks
Returns
bool

◆ _getAdditionalCheck()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getAdditionalCheck ( )
protected

Additional sql: do not check collation for \OxidEsales\Eshop\Core\SystemRequirements::$_aException columns

Returns
string

◆ _getBytes()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getBytes (   $sBytes)
protected

Parses and calculates given string form byte size value

Parameters
string$sBytesstring form byte value (64M, 32K etc)
Returns
int

◆ _getMinimumMemoryLimit()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getMinimumMemoryLimit ( )
protected

Return minimum memory limit by edition.

Returns
string

◆ _getRecommendMemoryLimit()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getRecommendMemoryLimit ( )
protected

Return recommend memory limit by edition.

Returns
string

◆ _getShopHostInfo()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getShopHostInfo ( )
protected

returns host, port, current script, ssl information as assotiative array, false on error

Returns
array

◆ _getShopHostInfoFromConfig()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getShopHostInfoFromConfig ( )
protected

returns host, port, base dir, ssl information as assotiative array, false on error takes this info from eShop config.inc.php (via oxConfig class)

Returns
array

◆ _getShopHostInfoFromServerVars()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getShopHostInfoFromServerVars ( )
protected

returns host, port, base dir, ssl information as assotiative array, false on error takes this info from _SERVER variable

Returns
array

◆ _getShopSSLHostInfo()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getShopSSLHostInfo ( )
protected

returns host, port, current script, ssl information as assotiative array, false on error Takes ssl address from config so important only in admin.

Returns
array

◆ _getShopSSLHostInfoFromConfig()

OxidEsales\EshopCommunity\Core\SystemRequirements::_getShopSSLHostInfoFromConfig ( )
protected

returns host, port, base dir, ssl information as assotiative array, false on error takes this info from eShop config.inc.php (via oxConfig class)

Returns
array

◆ canSetupContinue()

static OxidEsales\EshopCommunity\Core\SystemRequirements::canSetupContinue (   $systemRequirementsInfo)
static

Returns true if given module state is acceptable for setup process to continue.

Parameters
array$systemRequirementsInfo
Returns
bool

◆ checkAllowUrlFopen()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkAllowUrlFopen ( )

Checks if activated allow_url_fopen and fsockopen on port 80 possible

Returns
integer

◆ checkBcMath()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkBcMath ( )

Checks if bcmath extension is loaded

Returns
integer

◆ checkCollation()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkCollation ( )

Checks tables and columns (\OxidEsales\Eshop\Core\SystemRequirements::$_aColumns) collation

Returns
array

◆ checkCurl()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkCurl ( )

Checks if curl extension is loaded

Returns
integer

◆ checkDatabaseCluster()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkDatabaseCluster ( )

Checks if database cluster is installed

Returns
integer

◆ checkFileUploads()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkFileUploads ( )

Checks if php_admin_flag file_uploads is ON

Returns
integer

◆ checkFsockopen()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkFsockopen ( )

Check if fsockopen on port 80 possible

Returns
integer

◆ checkGdInfo()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkGdInfo ( )

Checks if GDlib extension is loaded

Returns
integer

◆ checkIConv()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkIConv ( )

Checks if iconv extension is loaded

Returns
integer

◆ checkIniSet()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkIniSet ( )

Checks if ini set is allowed

Returns
integer

◆ checkJSon()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkJSon ( )

Checks if JSON extension is loaded

Returns
integer

◆ checkMbString()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkMbString ( )

Checks if mbstring extension is loaded

Returns
integer

◆ checkMemoryLimit()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkMemoryLimit (   $sMemLimit = null)

Checks memory limit.

Parameters
string$sMemLimitmemory limit to compare with requirements
Returns
integer

◆ checkModRewrite()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkModRewrite ( )

Checks if mod_rewrite extension is loaded. Checks for all address.

Returns
integer

◆ checkMysqlConnect()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkMysqlConnect ( )

Checks if mysql5 extension is loaded.

Returns
integer

◆ checkMysqlVersion()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkMysqlVersion (   $installedVersion = null)

Checks if current mysql version matches requirements

Parameters
string$installedVersionMySQL version
Returns
int

◆ checkOpenSsl()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkOpenSsl ( )

Checks if openssl extension is loaded

Returns
integer

◆ checkPhpVersion()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkPhpVersion ( )

Checks supported PHP versions.

Returns
integer

◆ checkPhpXml()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkPhpXml ( )

Check if DOM extension is loaded

Returns
integer

◆ checkRequestUri()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkRequestUri ( )

Checks if apache server variables REQUEST_URI or SCRIPT_URI are set

Returns
integer

◆ checkServerPermissions()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkServerPermissions (   $sPath = null,
  $iMinPerm = 777 
)

Checks if permissions on servers are correctly setup

Parameters
string$sPathcheck path [optional]
int$iMinPermmin permission level, default 777 [optional]
Returns
int

◆ checkSessionAutostart()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkSessionAutostart ( )

Check if correct AutoStart setting.

Returns
bool

◆ checkSoap()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkSoap ( )

Checks if SOAP extension is loaded

Returns
integer

◆ checkTokenizer()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkTokenizer ( )

Checks if tokenizer extension is loaded

Returns
integer

◆ checkUnicodeSupport()

OxidEsales\EshopCommunity\Core\SystemRequirements::checkUnicodeSupport ( )

Checks if PCRE unicode support is turned off/on. Should be on.

Returns
integer

◆ fetchBlockRecords()

OxidEsales\EshopCommunity\Core\SystemRequirements::fetchBlockRecords ( )
protected

Fetch the active template blocks for the active shop and the active theme.

Returns
ResultSetInterface The active template blocks for the active shop and the active theme.

◆ filter()

static OxidEsales\EshopCommunity\Core\SystemRequirements::filter (   $systemRequirementsInfo,
  $filterFunction 
)
static

Apply given filter function to all iterations of SystemRequirementInfo array.

Parameters
array$systemRequirementsInfo
\Closure$filterFunctionFilter function used for the update of actual values; Function will receive the same arguments as provided from iterateThroughSystemRequirementsInfo method.
Returns
array An array which is in the same format as the main input argument but with updated data.

◆ getConfig()

OxidEsales\EshopCommunity\Core\SystemRequirements::getConfig ( )

Returns config instance

Returns
\oxConfig

◆ getMissingTemplateBlocks()

OxidEsales\EshopCommunity\Core\SystemRequirements::getMissingTemplateBlocks ( )

returns array of missing template block files:

  1. checks db for registered blocks
  2. checks each block if it exists in currently used theme templates returned array components are of form array(module name, block name, template file) only active (oxactive==1) blocks are checked
Returns
array

◆ getModuleInfo()

OxidEsales\EshopCommunity\Core\SystemRequirements::getModuleInfo (   $sModule = null)

Returns passed module state

Parameters
string$sModulemodule name to check
Returns
integer $iModStat

◆ getPhpVersion()

OxidEsales\EshopCommunity\Core\SystemRequirements::getPhpVersion ( )

Gets PHP version.

Returns
float|string

◆ getReqInfoUrl()

OxidEsales\EshopCommunity\Core\SystemRequirements::getReqInfoUrl (   $sIdent)

Returns or prints url for info about missing web service configuration

Parameters
string$sIdentModule identifier
Returns
mixed

◆ getRequiredModules()

OxidEsales\EshopCommunity\Core\SystemRequirements::getRequiredModules ( )

Sets system required modules

Returns
array

◆ getSysReqStatus()

OxidEsales\EshopCommunity\Core\SystemRequirements::getSysReqStatus ( )

Checks system requirements status

Returns
bool

◆ getSystemInfo()

OxidEsales\EshopCommunity\Core\SystemRequirements::getSystemInfo ( )

Runs through modules array and checks if current system fits requirements. Returns array with module info: array( $sGroup, $sModuleName, $sModuleState ): $sGroup - group of module $sModuleName - name of checked module $sModuleState - module state: -1 - unable to datect, should not block 0 - missing, blocks setup 1 - fits min requirements 2 - exists required or better

Returns
array $aSysInfo

◆ isAdmin()

OxidEsales\EshopCommunity\Core\SystemRequirements::isAdmin ( )

Possibility to mock isAdmin() function as we do not extend oxsuperconfig.

Returns
bool

◆ iterateThroughSystemRequirementsInfo()

static OxidEsales\EshopCommunity\Core\SystemRequirements::iterateThroughSystemRequirementsInfo (   $systemRequirementsInfo)
static

Iterates through given SystemRequirementsInfo returning three items:

  • GroupId
  • ModuleId
  • ModuleState
Parameters
array$systemRequirementsInfo
Returns
\Generator Iterator which yields [group_id, module_id, module_state].

Member Data Documentation

◆ $_aColumns

OxidEsales\EshopCommunity\Core\SystemRequirements::$_aColumns
protected

◆ $_aException

OxidEsales\EshopCommunity\Core\SystemRequirements::$_aException = ['OXDELIVERY' => 'OXDELTYPE', 'OXSELECTLIST' => 'OXIDENT']
protected

◆ $_aInfoMap

OxidEsales\EshopCommunity\Core\SystemRequirements::$_aInfoMap
protected
Initial value:
= [
"php_version" => "PHP_version_at_least_7.0",
"php_xml" => "DOM",
"open_ssl" => "OpenSSL",
"soap" => "SOAP",
"j_son" => "JSON",
"i_conv" => "ICONV",
"tokenizer" => "Tokenizer",
"mysql_connect" => "MySQL_client_connector_for_MySQL_5",
"gd_info" => "GDlib_v2_.5Bv1.5D_incl._JPEG_support",
"mb_string" => "mbstring",
"bc_math" => "BCMath",
"allow_url_fopen" => "allow_url_fopen_or_fsockopen_to_port_80",
"request_uri" => "REQUEST_URI_set",
"ini_set" => "ini_set_allowed",
"memory_limit" => "PHP_Memory_limit_.28min._32MB.2C_60MB_recommended.29",
"unicode_support" => "UTF-8_support",
"file_uploads" => "file_uploads_on",
"mod_rewrite" => "apache_mod_rewrite_module",
"server_permissions" => "Files_.26_Folder_Permission_Setup",
"zend_optimizer" => "Zend_Optimizer",
"session_autostart" => "session.auto_start_must_be_off",
"mysql_version" => "Not_recommended_MySQL_versions",
]

◆ $_aRequiredModules

OxidEsales\EshopCommunity\Core\SystemRequirements::$_aRequiredModules = null
protected

◆ $_blSysReqStatus

OxidEsales\EshopCommunity\Core\SystemRequirements::$_blSysReqStatus = null
protected

◆ $_sReqInfoUrl

OxidEsales\EshopCommunity\Core\SystemRequirements::$_sReqInfoUrl = "https://oxidforge.org/en/system-requirements"
protected

◆ MODULE_GROUP_ID_SERVER_CONFIG

const OxidEsales\EshopCommunity\Core\SystemRequirements::MODULE_GROUP_ID_SERVER_CONFIG = 'server_config'

◆ MODULE_ID_MOD_REWRITE

const OxidEsales\EshopCommunity\Core\SystemRequirements::MODULE_ID_MOD_REWRITE = 'mod_rewrite'

◆ MODULE_ID_MYSQL_VERSION

const OxidEsales\EshopCommunity\Core\SystemRequirements::MODULE_ID_MYSQL_VERSION = 'mysql_version'

◆ MODULE_STATUS_BLOCKS_SETUP

const OxidEsales\EshopCommunity\Core\SystemRequirements::MODULE_STATUS_BLOCKS_SETUP = 0

◆ MODULE_STATUS_FITS_MINIMUM_REQUIREMENTS

const OxidEsales\EshopCommunity\Core\SystemRequirements::MODULE_STATUS_FITS_MINIMUM_REQUIREMENTS = 1

◆ MODULE_STATUS_OK

const OxidEsales\EshopCommunity\Core\SystemRequirements::MODULE_STATUS_OK = 2

◆ MODULE_STATUS_UNABLE_TO_DETECT

const OxidEsales\EshopCommunity\Core\SystemRequirements::MODULE_STATUS_UNABLE_TO_DETECT = -1

The documentation for this class was generated from the following file: