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

Public Member Functions

 __construct ()
 
 start ($controllerKey=null, $function=null, $parameters=null, $viewsChain=null)
 
 getTotalTime ()
 

Protected Member Functions

 _getStartController ()
 
 _getFrontendStartController ()
 
 getStartControllerKey ()
 
 resolveControllerClass ($controllerKey)
 
 getFrontendStartControllerKey ()
 
 _process ($class, $function, $parameters=null, $viewsChain=null)
 
 _executeMaintenanceTasks ()
 
 executeAction ($view, $functionName)
 
 formOutput ($view)
 
 sendAdditionalHeaders ($view)
 
 _initializeViewObject ($class, $function, $parameters=null, $viewsChain=null)
 
 onViewCreation ($view)
 
 _canExecuteFunction ($view, $function)
 
 _getFormattedErrors ($controllerName)
 
 _render ($view)
 
 _getOutputManager ()
 
 _getErrors ($currentControllerName)
 
 _runOnce ()
 
 _getErrorReportingLevel ()
 
 _isDebugMode ()
 
 _startMonitor ()
 
 _stopMonitor ($isCallForCache=false, $isCached=false, $viewId=null, $viewData=[], $view=null)
 
 stopMonitoring ($view)
 
 formMonitorMessage ($view)
 
 _handleSystemException ($exception)
 
 handleRoutingException ($exception)
 
 _handleCookieException ($exception)
 
 handleDatabaseException (\OxidEsales\Eshop\Core\Exception\DatabaseException $exception)
 
 _handleBaseException ($exception)
 
 logException (\Exception $exception)
 
 reportDatabaseConnectionException (DatabaseConnectionException $exception)
 
 messageWasSentWithinThreshold ()
 
 sendOfflineWarning (\OxidEsales\Eshop\Core\Exception\StandardException $exception)
 
 getControllerClass ($controllerKey)
 

Protected Attributes

 $_blHandlerSet = null
 
 $_blMainTasksExecuted = null
 
 $_dTimeStart = null
 
 $_dTimeEnd = null
 
 $_aErrors = null
 
 $_aAllErrors = null
 
 $_aControllerErrors = null
 
 $_oOutput = null
 
 $_oCache = null
 
 $offlineWarningTimestampFile
 

Detailed Description

Main shop actions controller. Processes user actions, logs them (if needed), controls output, redirects according to processed methods logic. This class is initialized from index.php

Constructor & Destructor Documentation

◆ __construct()

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

ShopControl constructor.

Member Function Documentation

◆ _canExecuteFunction()

OxidEsales\EshopCommunity\Core\ShopControl::_canExecuteFunction (   $view,
  $function 
)
protected

Check if method can be executed.

Parameters
FrontendController$viewView object to check if its method can be executed.
string$functionMethod to check if it can be executed.
Returns
bool

◆ _executeMaintenanceTasks()

OxidEsales\EshopCommunity\Core\ShopControl::_executeMaintenanceTasks ( )
protected

Executes regular maintenance functions..

Returns
null

◆ _getErrorReportingLevel()

OxidEsales\EshopCommunity\Core\ShopControl::_getErrorReportingLevel ( )
protected

Returns error reporting level. Returns disabled error logging if server is misconfigured #2015 E_NONE replaced with 0.

Returns
int

◆ _getErrors()

OxidEsales\EshopCommunity\Core\ShopControl::_getErrors (   $currentControllerName)
protected

Return page errors array.

Parameters
string$currentControllerNameClass name
Returns
array

◆ _getFormattedErrors()

OxidEsales\EshopCommunity\Core\ShopControl::_getFormattedErrors (   $controllerName)
protected

Format error messages from _getErrors and return as array.

Parameters
string$controllerNamea class name
Returns
array

◆ _getFrontendStartController()

OxidEsales\EshopCommunity\Core\ShopControl::_getFrontendStartController ( )
protected
Deprecated:
since v6.0 (2017-02-03). Use ShopControl::getFrontendStartControllerKey() instead.

Returns which controller should be loaded at shop start. Check whether we have to display mall start screen or not.

Returns
string

◆ _getOutputManager()

OxidEsales\EshopCommunity\Core\ShopControl::_getOutputManager ( )
protected

Return output handler.

Returns
oxOutput

◆ _getStartController()

OxidEsales\EshopCommunity\Core\ShopControl::_getStartController ( )
protected
Deprecated:
since v6.0 (2017-02-03). Use ShopControl::getStartControllerKey() instead.

Returns controller class which should be loaded.

Returns
string

◆ _handleBaseException()

OxidEsales\EshopCommunity\Core\ShopControl::_handleBaseException (   $exception)
protected

Handling other not caught exceptions.

Parameters
\OxidEsales\Eshop\Core\Exception\StandardException$exception

◆ _handleCookieException()

OxidEsales\EshopCommunity\Core\ShopControl::_handleCookieException (   $exception)
protected

Redirect to start page, in debug mode shows error message.

Parameters
\OxidEsales\Eshop\Core\Exception\StandardException$exceptionException

◆ _handleSystemException()

OxidEsales\EshopCommunity\Core\ShopControl::_handleSystemException (   $exception)
protected

Shows exceptionError page. possible reason: class does not exist etc. --> just redirect to start page.

Parameters
\OxidEsales\Eshop\Core\Exception\StandardException$exception

◆ _initializeViewObject()

OxidEsales\EshopCommunity\Core\ShopControl::_initializeViewObject (   $class,
  $function,
  $parameters = null,
  $viewsChain = null 
)
protected

Initialize and return view object.

Parameters
string$classView class
string$functionFunction name
array$parametersParameters array
array$viewsChainArray of views names that should be initialized also
Returns
FrontendController

◆ _isDebugMode()

OxidEsales\EshopCommunity\Core\ShopControl::_isDebugMode ( )
protected

Checks if shop is in debug mode.

Returns
bool

◆ _process()

OxidEsales\EshopCommunity\Core\ShopControl::_process (   $class,
  $function,
  $parameters = null,
  $viewsChain = null 
)
protected

Initiates object (object::init()), executes passed function (\OxidEsales\Eshop\Core\ShopControl::executeFunction(), if method returns some string - will redirect page and will call another function according to returned parameters), renders object (object::render()). Performs output processing \OxidEsales\Eshop\Core\Output::ProcessViewArray(). Passes template variables to template engine witch generates output. Output is additionally processed (\OxidEsales\Eshop\Core\Output::Process()), fixed links according search engines optimization rules (configurable in Admin area). Finally echoes the output.

Parameters
string$classClass name
string$functionName of function
array$parametersParameters array
array$viewsChainArray of views names that should be initialized also

◆ _render()

OxidEsales\EshopCommunity\Core\ShopControl::_render (   $view)
protected

Render BaseController object.

Parameters
FrontendController$viewview object to render
Returns
string

◆ _runOnce()

OxidEsales\EshopCommunity\Core\ShopControl::_runOnce ( )
protected

This function is only executed one time here we perform checks if we only need once per session.

◆ _startMonitor()

OxidEsales\EshopCommunity\Core\ShopControl::_startMonitor ( )
protected

Starts resource monitor.

◆ _stopMonitor()

OxidEsales\EshopCommunity\Core\ShopControl::_stopMonitor (   $isCallForCache = false,
  $isCached = false,
  $viewId = null,
  $viewData = [],
  $view = null 
)
protected

Stops resource monitor, summarizes and outputs values.

Deprecated:
on b-dev (2015-10-01); Use self::stopMonitoring() instead.
Parameters
bool$isCallForCacheIs content cache
bool$isCachedIs content cached
string$viewIdView ID
array$viewDataView data
FrontendController$viewView object

◆ executeAction()

OxidEsales\EshopCommunity\Core\ShopControl::executeAction (   $view,
  $functionName 
)
protected

Executes provided function on view object. If this function can not be executed (is protected or so), oxSystemComponentException exception is thrown.

Parameters
FrontendController$view
string$functionName
Exceptions
oxSystemComponentException

◆ formMonitorMessage()

OxidEsales\EshopCommunity\Core\ShopControl::formMonitorMessage (   $view)
protected

Forms message for displaying monitoring information on the bottom of the page.

Parameters
FrontendController$view
Returns
string

◆ formOutput()

OxidEsales\EshopCommunity\Core\ShopControl::formOutput (   $view)
protected

Forms output from view object.

Parameters
FrontendController$view
Returns
string

◆ getControllerClass()

OxidEsales\EshopCommunity\Core\ShopControl::getControllerClass (   $controllerKey)
protected

Get controller class from key. Fallback is to use key as class if no match can be found.

Parameters
string$controllerKey
Returns
string

◆ getFrontendStartControllerKey()

OxidEsales\EshopCommunity\Core\ShopControl::getFrontendStartControllerKey ( )
protected

Returns id of controller that should be loaded at shop start. Check whether we have to display mall start screen or not.

Returns
string

◆ getStartControllerKey()

OxidEsales\EshopCommunity\Core\ShopControl::getStartControllerKey ( )
protected

Returns class id of controller which should be loaded. When in doubt returns default start controller class.

Returns
string

◆ getTotalTime()

OxidEsales\EshopCommunity\Core\ShopControl::getTotalTime ( )

Returns the difference between stored profiler end time and start time. Works only after _stopMonitor() is called, otherwise returns 0.

Returns
double

◆ handleDatabaseException()

OxidEsales\EshopCommunity\Core\ShopControl::handleDatabaseException ( \OxidEsales\Eshop\Core\Exception\DatabaseException  $exception)
protected

Handle database exceptions There is still space for improving this as a similar exception handling for database exceptions may be done in \OxidEsales\EshopCommunity\Core\Config::init() and the current method may not be executed

Parameters
\OxidEsales\Eshop\Core\Exception\DatabaseException$exceptionException to handle

◆ handleRoutingException()

OxidEsales\EshopCommunity\Core\ShopControl::handleRoutingException (   $exception)
protected

Handle routing exception, which is thrown, if the class name for the requested controller id could not be resolved.

Parameters
RoutingException$exception

◆ logException()

OxidEsales\EshopCommunity\Core\ShopControl::logException ( \Exception  $exception)
protected

Log an exception.

This method forms part of the exception handling process. Any further exceptions must be caught.

Parameters
\Exception$exception

◆ messageWasSentWithinThreshold()

OxidEsales\EshopCommunity\Core\ShopControl::messageWasSentWithinThreshold ( )
protected

Return true, if a message was already sent within a given threshold.

This method forms part of the exception handling process. Any further exceptions must be caught.

Returns
bool

◆ onViewCreation()

OxidEsales\EshopCommunity\Core\ShopControl::onViewCreation (   $view)
protected

Event for any actions during view creation.

Parameters
FrontendController$view

◆ reportDatabaseConnectionException()

OxidEsales\EshopCommunity\Core\ShopControl::reportDatabaseConnectionException ( DatabaseConnectionException  $exception)
protected

Notify the shop owner about database connection problems.

This method forms part of the exception handling process. Any further exceptions must be caught.

Parameters
DatabaseConnectionException$exceptionDatabase connection exception to report
Returns
null

◆ resolveControllerClass()

OxidEsales\EshopCommunity\Core\ShopControl::resolveControllerClass (   $controllerKey)
protected

Returns class id of controller which should be loaded. When in doubt returns default start controller class.

Parameters
string$controllerKeyController id
Exceptions
RoutingException
Returns
string

◆ sendAdditionalHeaders()

OxidEsales\EshopCommunity\Core\ShopControl::sendAdditionalHeaders (   $view)
protected

Method for sending any additional headers on every page requests.

Parameters
FrontendController$view

◆ sendOfflineWarning()

OxidEsales\EshopCommunity\Core\ShopControl::sendOfflineWarning ( \OxidEsales\Eshop\Core\Exception\StandardException  $exception)
protected

Send an offline warning to the shop owner. Currently an email is sent to the email address configured as 'sAdminEmail' in the eShop config file.

This method forms part of the exception handling process. Any further exceptions must be caught.

Parameters
StandardException$exception
Returns
bool Returns true, if the email was sent.

◆ start()

OxidEsales\EshopCommunity\Core\ShopControl::start (   $controllerKey = null,
  $function = null,
  $parameters = null,
  $viewsChain = null 
)

Main shop manager, that sets shop status, executes configuration methods. Executes \OxidEsales\Eshop\Core\ShopControl::_runOnce(), if needed sets default class (according to admin or regular activities). Additionally its possible to pass class name, function name and parameters array to view, which will be executed.

Parameters
string$controllerKeyKey of the controller class to be processed
string$functionFunction name
array$parametersParameters array
array$viewsChainArray of views names that should be initialized also

◆ stopMonitoring()

OxidEsales\EshopCommunity\Core\ShopControl::stopMonitoring (   $view)
protected

Stops resource monitor, summarizes and outputs values.

Parameters
FrontendController$viewView object

Member Data Documentation

◆ $_aAllErrors

OxidEsales\EshopCommunity\Core\ShopControl::$_aAllErrors = null
protected

◆ $_aControllerErrors

OxidEsales\EshopCommunity\Core\ShopControl::$_aControllerErrors = null
protected

◆ $_aErrors

OxidEsales\EshopCommunity\Core\ShopControl::$_aErrors = null
protected

◆ $_blHandlerSet

OxidEsales\EshopCommunity\Core\ShopControl::$_blHandlerSet = null
protected

◆ $_blMainTasksExecuted

OxidEsales\EshopCommunity\Core\ShopControl::$_blMainTasksExecuted = null
protected

◆ $_dTimeEnd

OxidEsales\EshopCommunity\Core\ShopControl::$_dTimeEnd = null
protected

◆ $_dTimeStart

OxidEsales\EshopCommunity\Core\ShopControl::$_dTimeStart = null
protected

◆ $_oCache

OxidEsales\EshopCommunity\Core\ShopControl::$_oCache = null
protected

◆ $_oOutput

OxidEsales\EshopCommunity\Core\ShopControl::$_oOutput = null
protected

◆ $offlineWarningTimestampFile

OxidEsales\EshopCommunity\Core\ShopControl::$offlineWarningTimestampFile
protected

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