Documentation

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:

  1. in js/validation.js declarations var minLength = 7; in two places;
  2. in app/code/core/Mage/Customer/etc/system.xml comments for fields min_password_length and min_admin_password_length <comment>Please enter a number 7 or greater in this field.</comment>;
  3. in app/code/core/Mage/Customer/etc/config.xml value <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);
  4. maybe, the value of deprecated const MIN_PASSWORD_LENGTH in app/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 = []

$_currentStore

Default store code

protected string $_currentStore

$_events

Events cache

protected array<string|int, mixed> $_events = []

$_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

$_updateMode

Update process run flag

protected bool $_updateMode = \false

$_useCache

Use Cache

protected array<string|int, mixed> $_useCache

$_useSessionVar

Use session var instead of SID for session in URL

protected bool $_useSessionVar = \false

Methods

__construct()

public __construct() : mixed

addEventArea()

public addEventArea(string $area) : $this
Parameters
$area : string
Return values
$this

baseInit()

Common logic for all run types

public baseInit(string|array<string|int, mixed> $options) : $this
Parameters
$options : string|array<string|int, mixed>
Return values
$this

cleanAllSessions()

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
$this

dispatchEvent()

Dispatch event to observers

public dispatchEvent(string $eventName, array<string|int, mixed> $args) : $this
Parameters
$eventName : string
$args : array<string|int, mixed>
Tags
throws
Mage_Core_Exception
Return values
$this

getBaseCurrencyCode()

Retrieve application base currency code

public getBaseCurrencyCode() : string
Return values
string

getDistroLocaleCode()

public getDistroLocaleCode() : string
Return values
string

getGroups()

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>

getIsCacheLocked()

Get is cache locked

public getIsCacheLocked() : bool
Return values
bool

getStores()

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>

getUpdateMode()

public getUpdateMode() : bool
Return values
bool

getUseSessionInUrl()

Retrieve use session in URL flag

public getUseSessionInUrl() : bool
Return values
bool

getUseSessionVar()

Retrieve use flag session var instead of SID for URL

public getUseSessionVar() : bool
Return values
bool

getWebsites()

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
$this

initSpecified()

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
see
Mage_Core_Model_App::run()
Return values
$this

isCurrentlySecure()

public isCurrentlySecure() : bool
Return values
bool

isSingleStoreMode()

Is single Store mode (only one store without default)

public isSingleStoreMode() : bool
Return values
bool

loadArea()

Loading application area

public loadArea(string $code) : $this
Parameters
$code : string
Return values
$this

loadAreaPart()

Loading part of area data

public loadAreaPart(string $area, string $part) : $this
Parameters
$area : string
$part : string
Return values
$this

loadCache()

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
$this

run()

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
$this

saveCache()

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
$this

saveUseCache()

Save cache usage settings

public saveUseCache(array<string|int, mixed> $data) : $this
Parameters
$data : array<string|int, mixed>
Return values
$this

setErrorHandler()

Redeclare custom error handler

public setErrorHandler(callable|null $handler) : $this
Parameters
$handler : callable|null
Return values
$this

setIsSingleStoreModeAllowed()

Allow or disallow single store mode

public setIsSingleStoreModeAllowed(bool $value) : $this
Parameters
$value : bool
Return values
$this

setUpdateMode()

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
$this

setUseSessionVar()

Set use session var instead of SID for URL

public setUseSessionVar(bool $var) : $this
Parameters
$var : bool
Return values
$this

testCache()

Test cache record availability

public testCache(string $id) : bool
Parameters
$id : string
Return values
bool

throwStoreException()

public throwStoreException([string $text = '' ]) : never
Parameters
$text : string = ''
Tags
throws
Mage_Core_Model_Store_Exception
Return values
never

useCache()

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
throws
Mage_Core_Exception
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

_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
Return values
bool
On this page

Search results