Mage_Core_Model_App
in package
Application model
Application should have: areas, store, locale, translator, design package
Table of Contents
Constants
- ABSOLUTE_MIN_PASSWORD_LENGTH : mixed = 7
- The absolute minimum of password length for all types of passwords
- ADMIN_STORE_ID : mixed = 0
- Admin store Id
- DEFAULT_ERROR_HANDLER : mixed = 'mageCoreErrorHandler'
- DISTRO_LOCALE_CODE : mixed = 'en_US'
- DISTRO_STORE_CODE : mixed = 'default'
- Default store code (for install)
- DISTRO_STORE_ID : mixed = 1
- Default store Id (for install)
- XML_PATH_IGNORE_DEV_MODE : mixed = 'global/skip_process_modules_updates_ignore_dev...
- if this node set to true, we will ignore Developer Mode for applying updates
- XML_PATH_INSTALL_DATE : mixed = 'global/install/date'
- XML_PATH_SKIP_PROCESS_MODULES_UPDATES : mixed = 'global/skip_process_modules_updates'
Properties
- $_areas : array<string|int, mixed>
- Application loaded areas array
- $_cache : Mage_Core_Model_Cache
- Cache object
- $_config : Mage_Core_Model_Config
- Application configuration object
- $_currentStore : string
- Default store code
- $_design : Mage_Core_Model_Design_Package
- Application design package object
- $_events : array<string|int, mixed>
- Events cache
- $_frontController : Mage_Core_Controller_Varien_Front
- Application front controller
- $_groups : array<string|int, Mage_Core_Model_Store_Group>
- Groups cache
- $_isCacheLocked : null|bool
- Cache locked flag
- $_isInstalled : null|bool
- Flag for Maho installation status
- $_isSingleStore : bool
- is a single store mode
- $_isSingleStoreAllowed : bool
- $_layout : Mage_Core_Model_Layout
- Application layout object
- $_locale : Mage_Core_Model_Locale
- Application location object
- $_request : Mage_Core_Controller_Request_Http|null
- Request object
- $_response : Mage_Core_Controller_Response_Http|null
- Response object
- $_store : Mage_Core_Model_Store|null
- Application store object
- $_stores : array<string|int, Mage_Core_Model_Store>
- Stores cache
- $_translator : Mage_Core_Model_Translate
- Application translate object
- $_updateMode : bool
- Update process run flag
- $_useCache : array<string|int, mixed>
- Use Cache
- $_useSessionInUrl : bool
- Use session in URL flag
- $_useSessionVar : bool
- Use session var instead of SID for session in URL
- $_website : Mage_Core_Model_Website|null
- Application website object
- $_websites : array<string|int, Mage_Core_Model_Website>
- Websites cache
Methods
- __construct() : mixed
- addEventArea() : $this
- baseInit() : $this
- Common logic for all run types
- cleanAllSessions() : mixed
- Deletes all session files
- cleanCache() : $this
- Cleaning cache
- clearWebsiteCache() : mixed
- Unset website by id from app cache
- dispatchEvent() : $this
- Dispatch event to observers
- getAnyStoreView() : Mage_Core_Model_Store|void
- Get either default or any store view
- getArea() : Mage_Core_Model_App_Area
- Retrieve application area
- getBaseCurrencyCode() : string
- Retrieve application base currency code
- getCache() : Mage_Core_Model_Cache
- getCacheInstance() : Mage_Core_Model_Cache
- getConfig() : Mage_Core_Model_Config
- Retrieve configuration object
- getCookie() : Mage_Core_Model_Cookie
- Retrieve cookie object
- getDefaultStoreView() : Mage_Core_Model_Store|null
- Retrieve default store for default group and website
- getDistroLocaleCode() : string
- getFrontController() : Mage_Core_Controller_Varien_Front
- Retrieve front controller object
- getGroup() : Mage_Core_Model_Store_Group
- Retrieve application store group object
- getGroups() : array<string|int, Mage_Core_Model_Store_Group>
- Prepare array of store groups can be filtered to contain default store group or not by $withDefault flag depending on flag $codeKey array keys can be group id or group code
- getHelper() : Mage_Core_Helper_Abstract
- Retrieve helper object
- getIsCacheLocked() : bool
- Get is cache locked
- getLayout() : Mage_Core_Model_Layout
- Retrieve layout object
- getLocale() : Mage_Core_Model_Locale
- Retrieve application locale object
- getRequest() : Mage_Core_Controller_Request_Http
- Retrieve request object
- getResponse() : Mage_Core_Controller_Response_Http
- Retrieve response object
- getStore() : Mage_Core_Model_Store|null
- Retrieve application store object
- getStores() : array<string|int, Mage_Core_Model_Store>
- Retrieve stores array
- getTranslator() : Mage_Core_Model_Translate
- Retrieve translate object
- getUpdateMode() : bool
- getUseSessionInUrl() : bool
- Retrieve use session in URL flag
- getUseSessionVar() : bool
- Retrieve use flag session var instead of SID for URL
- getWebsite() : Mage_Core_Model_Website
- Retrieve application website object
- getWebsites() : array<string|int, Mage_Core_Model_Website>
- init() : $this
- Initialize application without request processing
- initSpecified() : $this
- Run light version of application with specified modules support
- isCurrentlySecure() : bool
- isSingleStoreMode() : bool
- Is single Store mode (only one store without default)
- loadArea() : $this
- Loading application area
- loadAreaPart() : $this
- Loading part of area data
- loadCache() : mixed
- Loading cache data
- reinitStores() : mixed
- removeCache() : $this
- Remove cache
- run() : $this
- Run application. Run process responsible for request processing and sending response.
- saveCache() : $this
- Saving cache data
- saveUseCache() : $this
- Save cache usage settings
- setCurrentStore() : $this
- Set current default store
- setErrorHandler() : $this
- Redeclare custom error handler
- setIsSingleStoreModeAllowed() : $this
- Allow or disallow single store mode
- setRequest() : $this
- Request setter
- setResponse() : $this
- Response setter
- setUpdateMode() : mixed
- setUseSessionInUrl() : $this
- Set Use session in URL flag
- setUseSessionVar() : $this
- Set use session var instead of SID for URL
- testCache() : bool
- Test cache record availability
- throwStoreException() : never
- useCache() : false|array<string|int, mixed>
- Check whether to use cache for specific component
- _applyCompiledReplaces() : void
- _callObserverMethod() : $this
- Performs non-existent observer method calls protection
- _checkCookieStore() : $this
- Check cookie store
- _checkGetStore() : $this
- Check get store
- _getDefaultStore() : Mage_Core_Model_Store
- _getObserverModulePosition() : int
- _getStoreByGroup() : string|null
- Retrieve store code or null by store group
- _getStoreByWebsite() : string|null
- Retrieve store code or null by website
- _initBaseConfig() : $this
- Initialize base system configuration (local.xml and config.xml files).
- _initCache() : $this
- Initialize application cache instance
- _initCurrentStore() : $this
- Initialize currently ran store
- _initEnvironment() : $this
- Initialize PHP environment
- _initFrontController() : $this
- Initialize application front controller
- _initModules() : $this
- Initialize active modules configuration and data
- _initRequest() : $this
- Init request object
- _initStores() : mixed
- Init store, group and website collections
- _shouldSkipProcessModulesUpdates() : bool
- Check whether modules updates processing should be skipped
Constants
ABSOLUTE_MIN_PASSWORD_LENGTH
The absolute minimum of password length for all types of passwords
public
mixed
ABSOLUTE_MIN_PASSWORD_LENGTH
= 7
With changing this value also need to change:
- in
js/validation.jsdeclarationsvar minLength = 7;in two places; - in
app/code/core/Mage/Customer/etc/system.xmlcomments for fieldsmin_password_lengthandmin_admin_password_length<comment>Please enter a number 7 or greater in this field.</comment>; - in
app/code/core/Mage/Customer/etc/config.xmlvalue<min_password_length>7</min_password_length>and, maybe, value<min_admin_password_length>14</min_admin_password_length>(if the absolute minimum of password length is higher then this value); - maybe, the value of deprecated
const MIN_PASSWORD_LENGTHinapp/code/core/Mage/Admin/Model/User.php, (if the absolute minimum of password length is higher then this value).
ADMIN_STORE_ID
Admin store Id
public
mixed
ADMIN_STORE_ID
= 0
DEFAULT_ERROR_HANDLER
public
mixed
DEFAULT_ERROR_HANDLER
= 'mageCoreErrorHandler'
DISTRO_LOCALE_CODE
public
mixed
DISTRO_LOCALE_CODE
= 'en_US'
DISTRO_STORE_CODE
Default store code (for install)
public
mixed
DISTRO_STORE_CODE
= 'default'
DISTRO_STORE_ID
Default store Id (for install)
public
mixed
DISTRO_STORE_ID
= 1
XML_PATH_IGNORE_DEV_MODE
if this node set to true, we will ignore Developer Mode for applying updates
public
mixed
XML_PATH_IGNORE_DEV_MODE
= 'global/skip_process_modules_updates_ignore_dev_mode'
XML_PATH_INSTALL_DATE
public
mixed
XML_PATH_INSTALL_DATE
= 'global/install/date'
XML_PATH_SKIP_PROCESS_MODULES_UPDATES
public
mixed
XML_PATH_SKIP_PROCESS_MODULES_UPDATES
= 'global/skip_process_modules_updates'
Properties
$_areas
Application loaded areas array
protected
array<string|int, mixed>
$_areas
= []
$_cache
Cache object
protected
Mage_Core_Model_Cache
$_cache
$_config
Application configuration object
protected
Mage_Core_Model_Config
$_config
$_currentStore
Default store code
protected
string
$_currentStore
$_design
Application design package object
protected
Mage_Core_Model_Design_Package
$_design
$_events
Events cache
protected
array<string|int, mixed>
$_events
= []
$_frontController
Application front controller
protected
Mage_Core_Controller_Varien_Front
$_frontController
$_groups
Groups cache
protected
array<string|int, Mage_Core_Model_Store_Group>
$_groups
= []
$_isCacheLocked
Cache locked flag
protected
null|bool
$_isCacheLocked
= \null
$_isInstalled
Flag for Maho installation status
protected
null|bool
$_isInstalled
= \null
$_isSingleStore
is a single store mode
protected
bool
$_isSingleStore
$_isSingleStoreAllowed
protected
bool
$_isSingleStoreAllowed
= \true
$_layout
Application layout object
protected
Mage_Core_Model_Layout
$_layout
$_locale
Application location object
protected
Mage_Core_Model_Locale
$_locale
$_request
Request object
protected
Mage_Core_Controller_Request_Http|null
$_request
$_response
Response object
protected
Mage_Core_Controller_Response_Http|null
$_response
$_store
Application store object
protected
Mage_Core_Model_Store|null
$_store
$_stores
Stores cache
protected
array<string|int, Mage_Core_Model_Store>
$_stores
= []
$_translator
Application translate object
protected
Mage_Core_Model_Translate
$_translator
$_updateMode
Update process run flag
protected
bool
$_updateMode
= \false
$_useCache
Use Cache
protected
array<string|int, mixed>
$_useCache
$_useSessionInUrl
Use session in URL flag
protected
bool
$_useSessionInUrl
= \true
Tags
$_useSessionVar
Use session var instead of SID for session in URL
protected
bool
$_useSessionVar
= \false
$_website
Application website object
protected
Mage_Core_Model_Website|null
$_website
$_websites
Websites cache
protected
array<string|int, Mage_Core_Model_Website>
$_websites
= []
Methods
__construct()
public
__construct() : mixed
addEventArea()
public
addEventArea(string $area) : $this
Parameters
- $area : string
Return values
$thisbaseInit()
Common logic for all run types
public
baseInit(string|array<string|int, mixed> $options) : $this
Parameters
- $options : string|array<string|int, mixed>
Return values
$thiscleanAllSessions()
Deletes all session files
public
cleanAllSessions() : mixed
cleanCache()
Cleaning cache
public
cleanCache([array<string|int, mixed> $tags = [] ]) : $this
Parameters
- $tags : array<string|int, mixed> = []
Return values
$thisclearWebsiteCache()
Unset website by id from app cache
public
clearWebsiteCache([null|bool|int|string|Mage_Core_Model_Website $id = null ]) : mixed
Parameters
- $id : null|bool|int|string|Mage_Core_Model_Website = null
dispatchEvent()
Dispatch event to observers
public
dispatchEvent(string $eventName, array<string|int, mixed> $args) : $this
Parameters
- $eventName : string
- $args : array<string|int, mixed>
Tags
Return values
$thisgetAnyStoreView()
Get either default or any store view
public
getAnyStoreView() : Mage_Core_Model_Store|void
Return values
Mage_Core_Model_Store|voidgetArea()
Retrieve application area
public
getArea(string $code) : Mage_Core_Model_App_Area
Parameters
- $code : string
Return values
Mage_Core_Model_App_AreagetBaseCurrencyCode()
Retrieve application base currency code
public
getBaseCurrencyCode() : string
Return values
stringgetCache()
public
getCache() : Mage_Core_Model_Cache
Return values
Mage_Core_Model_CachegetCacheInstance()
public
getCacheInstance() : Mage_Core_Model_Cache
since 25.5, use getCache()
Return values
Mage_Core_Model_CachegetConfig()
Retrieve configuration object
public
getConfig() : Mage_Core_Model_Config
Return values
Mage_Core_Model_ConfiggetCookie()
Retrieve cookie object
public
getCookie() : Mage_Core_Model_Cookie
Return values
Mage_Core_Model_CookiegetDefaultStoreView()
Retrieve default store for default group and website
public
getDefaultStoreView() : Mage_Core_Model_Store|null
Return values
Mage_Core_Model_Store|nullgetDistroLocaleCode()
public
getDistroLocaleCode() : string
Return values
stringgetFrontController()
Retrieve front controller object
public
getFrontController() : Mage_Core_Controller_Varien_Front
Return values
Mage_Core_Controller_Varien_FrontgetGroup()
Retrieve application store group object
public
getGroup([null|Mage_Core_Model_Store_Group|int|string $id = null ]) : Mage_Core_Model_Store_Group
Parameters
- $id : null|Mage_Core_Model_Store_Group|int|string = null
Return values
Mage_Core_Model_Store_GroupgetGroups()
Prepare array of store groups can be filtered to contain default store group or not by $withDefault flag depending on flag $codeKey array keys can be group id or group code
public
getGroups([bool $withDefault = false ][, bool $codeKey = false ]) : array<string|int, Mage_Core_Model_Store_Group>
Parameters
- $withDefault : bool = false
- $codeKey : bool = false
Return values
array<string|int, Mage_Core_Model_Store_Group>getHelper()
Retrieve helper object
public
getHelper(string $name) : Mage_Core_Helper_Abstract
Parameters
- $name : string
Return values
Mage_Core_Helper_AbstractgetIsCacheLocked()
Get is cache locked
public
getIsCacheLocked() : bool
Return values
boolgetLayout()
Retrieve layout object
public
getLayout() : Mage_Core_Model_Layout
Return values
Mage_Core_Model_LayoutgetLocale()
Retrieve application locale object
public
getLocale() : Mage_Core_Model_Locale
Return values
Mage_Core_Model_LocalegetRequest()
Retrieve request object
public
getRequest() : Mage_Core_Controller_Request_Http
Return values
Mage_Core_Controller_Request_HttpgetResponse()
Retrieve response object
public
getResponse() : Mage_Core_Controller_Response_Http
Return values
Mage_Core_Controller_Response_HttpgetStore()
Retrieve application store object
public
getStore([null|string|bool|int|Mage_Core_Model_Store $id = null ]) : Mage_Core_Model_Store|null
Parameters
- $id : null|string|bool|int|Mage_Core_Model_Store = null
Tags
Return values
Mage_Core_Model_Store|nullgetStores()
Retrieve stores array
public
getStores([bool $withDefault = false ][, bool $codeKey = false ]) : array<string|int, Mage_Core_Model_Store>
Parameters
- $withDefault : bool = false
- $codeKey : bool = false
Return values
array<string|int, Mage_Core_Model_Store>getTranslator()
Retrieve translate object
public
getTranslator() : Mage_Core_Model_Translate
Return values
Mage_Core_Model_TranslategetUpdateMode()
public
getUpdateMode() : bool
Return values
boolgetUseSessionInUrl()
Retrieve use session in URL flag
public
getUseSessionInUrl() : bool
Return values
boolgetUseSessionVar()
Retrieve use flag session var instead of SID for URL
public
getUseSessionVar() : bool
Return values
boolgetWebsite()
Retrieve application website object
public
getWebsite([null|Mage_Core_Model_Website|true|int|string $id = null ]) : Mage_Core_Model_Website
Parameters
- $id : null|Mage_Core_Model_Website|true|int|string = null
Return values
Mage_Core_Model_WebsitegetWebsites()
public
getWebsites([bool $withDefault = false ][, bool $codeKey = false ]) : array<string|int, Mage_Core_Model_Website>
Parameters
- $withDefault : bool = false
- $codeKey : bool = false
Return values
array<string|int, Mage_Core_Model_Website>init()
Initialize application without request processing
public
init(string|array<string|int, mixed> $code[, string $type = null ][, string|array<string|int, mixed> $options = [] ]) : $this
Parameters
- $code : string|array<string|int, mixed>
- $type : string = null
- $options : string|array<string|int, mixed> = []
Return values
$thisinitSpecified()
Run light version of application with specified modules support
public
initSpecified(string|array<string|int, mixed> $scopeCode[, string $scopeType = null ][, string|array<string|int, mixed> $options = [] ][, string|array<string|int, mixed> $modules = [] ]) : $this
Parameters
- $scopeCode : string|array<string|int, mixed>
- $scopeType : string = null
- $options : string|array<string|int, mixed> = []
- $modules : string|array<string|int, mixed> = []
Tags
Return values
$thisisCurrentlySecure()
public
isCurrentlySecure() : bool
Return values
boolisSingleStoreMode()
Is single Store mode (only one store without default)
public
isSingleStoreMode() : bool
Return values
boolloadArea()
Loading application area
public
loadArea(string $code) : $this
Parameters
- $code : string
Return values
$thisloadAreaPart()
Loading part of area data
public
loadAreaPart(string $area, string $part) : $this
Parameters
- $area : string
- $part : string
Return values
$thisloadCache()
Loading cache data
public
loadCache(string $id) : mixed
Parameters
- $id : string
reinitStores()
public
reinitStores() : mixed
removeCache()
Remove cache
public
removeCache(string $id) : $this
Parameters
- $id : string
Return values
$thisrun()
Run application. Run process responsible for request processing and sending response.
public
run(array<string|int, mixed> $params) : $this
List of supported parameters: scope_code - code of default scope (website/store_group/store code) scope_type - type of default scope (website/group/store) options - configuration options
Parameters
- $params : array<string|int, mixed>
-
application run parameters
Return values
$thissaveCache()
Saving cache data
public
saveCache(mixed $data, string $id[, array<string|int, mixed> $tags = [] ][, null|false|int $lifeTime = false ]) : $this
Parameters
- $data : mixed
- $id : string
- $tags : array<string|int, mixed> = []
- $lifeTime : null|false|int = false
Return values
$thissaveUseCache()
Save cache usage settings
public
saveUseCache(array<string|int, mixed> $data) : $this
Parameters
- $data : array<string|int, mixed>
Return values
$thissetCurrentStore()
Set current default store
public
setCurrentStore(null|string|bool|int|Mage_Core_Model_Store $store) : $this
Parameters
- $store : null|string|bool|int|Mage_Core_Model_Store
Return values
$thissetErrorHandler()
Redeclare custom error handler
public
setErrorHandler(callable|null $handler) : $this
Parameters
- $handler : callable|null
Return values
$thissetIsSingleStoreModeAllowed()
Allow or disallow single store mode
public
setIsSingleStoreModeAllowed(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetRequest()
Request setter
public
setRequest(Mage_Core_Controller_Request_Http $request) : $this
Parameters
- $request : Mage_Core_Controller_Request_Http
Return values
$thissetResponse()
Response setter
public
setResponse(Mage_Core_Controller_Response_Http $response) : $this
Parameters
- $response : Mage_Core_Controller_Response_Http
Return values
$thissetUpdateMode()
public
setUpdateMode(bool $value) : mixed
Parameters
- $value : bool
setUseSessionInUrl()
Set Use session in URL flag
public
setUseSessionInUrl([bool $flag = true ]) : $this
Parameters
- $flag : bool = true
Return values
$thissetUseSessionVar()
Set use session var instead of SID for URL
public
setUseSessionVar(bool $var) : $this
Parameters
- $var : bool
Return values
$thistestCache()
Test cache record availability
public
testCache(string $id) : bool
Parameters
- $id : string
Return values
boolthrowStoreException()
public
throwStoreException([string $text = '' ]) : never
Parameters
- $text : string = ''
Tags
Return values
neveruseCache()
Check whether to use cache for specific component
public
useCache([null|string $type = null ]) : false|array<string|int, mixed>
Parameters
- $type : null|string = null
Return values
false|array<string|int, mixed>_applyCompiledReplaces()
protected
_applyCompiledReplaces(string $area, string $eventName, array<string|int, mixed> &$observers) : void
Parameters
- $area : string
- $eventName : string
- $observers : array<string|int, mixed>
_callObserverMethod()
Performs non-existent observer method calls protection
protected
_callObserverMethod(object $object, string $method, Observer $observer[, string $observerName = 'undefined' ]) : $this
Parameters
- $object : object
- $method : string
- $observer : Observer
- $observerName : string = 'undefined'
Tags
Return values
$this_checkCookieStore()
Check cookie store
protected
_checkCookieStore(string $type) : $this
Parameters
- $type : string
Return values
$this_checkGetStore()
Check get store
protected
_checkGetStore(string $type) : $this
Parameters
- $type : string
Return values
$this_getDefaultStore()
protected
_getDefaultStore() : Mage_Core_Model_Store
Return values
Mage_Core_Model_Store_getObserverModulePosition()
protected
_getObserverModulePosition(array<string|int, mixed> $observer) : int
Parameters
- $observer : array<string|int, mixed>
Return values
int_getStoreByGroup()
Retrieve store code or null by store group
protected
_getStoreByGroup(int $group) : string|null
Parameters
- $group : int
Return values
string|null_getStoreByWebsite()
Retrieve store code or null by website
protected
_getStoreByWebsite(int|string $website) : string|null
Parameters
- $website : int|string
Return values
string|null_initBaseConfig()
Initialize base system configuration (local.xml and config.xml files).
protected
_initBaseConfig() : $this
Base configuration provide ability initialize DB connection and cache backend
Return values
$this_initCache()
Initialize application cache instance
protected
_initCache([array<string|int, mixed> $cacheInitOptions = [] ]) : $this
Parameters
- $cacheInitOptions : array<string|int, mixed> = []
Return values
$this_initCurrentStore()
Initialize currently ran store
protected
_initCurrentStore(string $scopeCode, string $scopeType) : $this
Parameters
- $scopeCode : string
-
code of default scope (website/store_group/store code)
- $scopeType : string
-
type of default scope (website/group/store)
Return values
$this_initEnvironment()
Initialize PHP environment
protected
_initEnvironment() : $this
Return values
$this_initFrontController()
Initialize application front controller
protected
_initFrontController() : $this
Return values
$this_initModules()
Initialize active modules configuration and data
protected
_initModules() : $this
Return values
$this_initRequest()
Init request object
protected
_initRequest() : $this
Return values
$this_initStores()
Init store, group and website collections
protected
_initStores() : mixed
_shouldSkipProcessModulesUpdates()
Check whether modules updates processing should be skipped
protected
_shouldSkipProcessModulesUpdates() : bool