Class Mage_Core_Model_App

Description

Application model

Application should have: areas, store, locale, translator, design package

Located in /Core/Model/App.php (line 36)


	
			
Class Constant Summary
CACHE_TAG = 'MAGE'
DEFAULT_ERROR_HANDLER = 'mageCoreErrorHandler'
DISTRO_LOCALE_CODE = 'en_US'
DISTRO_STORE_CODE = 'default'
XML_PATH_INSTALL_DATE = 'global/install/date'
Variable Summary
Method Summary
Mage_Core_Model_App __construct ()
void addEventArea ( $area)
Mage_Core_Model_App baseInit (string|array $options)
Mage_Core_Model_App cleanCache ([array $tags = array()])
void dispatchEvent ( $eventName,  $args)
Zend_Cache_Core getCache ()
array getGroups ([bool $withDefault = false], [bool $codeKey = false])
Zend_Controller_Response_Http getResponse ()
Mage_Core_Model_Store getStore ([ $id = null])
array getStores ([bool $withDefault = false], [bool $codeKey = false])
void getUpdateMode ()
void getWebsites ([ $withDefault = false], [ $codeKey = false])
Mage_Core_Model_App init (string|array $code, [string $type = null], [string|array $options = array()])
Mage_Core_Model_App initSpecified (string|array $scopeCode, [string $scopeType = null], [string|array $options = array()], [string|array $modules = array()])
bool isInstalled ()
Mage_Core_Model_App loadArea (string $code)
Mage_Core_Model_App loadAreaPart (string $area, string $part)
mixed loadCache (string $id)
string prepareCacheId (string $id)
void reinitStores ()
Mage_Core_Model_App run (array $params)
Mage_Core_Model_App saveCache (mixed $data, string $id, [array $tags = array()], [ $lifeTime = false])
void setUpdateMode ( $value)
Mage_Core_Model_App setUseSessionInUrl ([bool $flag = true])
boolean useCache ([ $type = null])
void _callObserverMethod (object $object, string $method, Varien_Event_Observer $observer)
string _getCacheId ([string $id = null])
array _getCacheTags ([array $tags = array()], string $id)
string|null _getStoreByGroup (int $group)
string|null _getStoreByWebsite (int|string $website)
unknown_type _initCurrentStore (string $scopeCode, string $scopeType)
void _initStores ()
Variables
array $_areas = array() (line 73)

Application loaded areas array

  • access: protected
Zend_Cache_Core $_cache (line 136)

Cache object

  • access: protected
Mage_Core_Model_Config $_config (line 122)

Application configuration object

  • access: protected
string $_currentStore (line 183)

Default store code

  • access: protected
Mage_Core_Model_Design_Package $_design (line 108)

Application design package object

  • access: protected
array $_events = array() (line 205)

Events cache

  • access: protected
Mage_Core_Controller_Varien_Front $_frontController (line 129)

Application front controller

  • access: protected
array $_groups = array() (line 157)

Groups cache

  • access: protected
mixed $_isCacheLocked = null (line 229)
  • access: protected
bool $_isSingleStore (line 171)

is a single store mode

  • access: protected
bool $_isSingleStoreAllowed = true (line 176)
  • access: protected
Mage_Core_Model_Layout $_layout (line 115)

Application layout object

  • access: protected
Mage_Core_Model_Locale $_locale (line 94)

Application location object

  • access: protected
Zend_Controller_Request_Http $_request (line 190)

Request object

  • access: protected
Zend_Controller_Response_Http $_response (line 197)

Response object

  • access: protected
Mage_Core_Model_Store $_store (line 80)

Application store object

  • access: protected
array $_stores = array() (line 164)

Stores cache

  • access: protected
Mage_Core_Model_Translate $_translator (line 101)

Application translate object

  • access: protected
bool $_updateMode = false (line 212)

Update process run flag

  • access: protected
array $_useCache (line 143)

Use Cache

  • access: protected
bool $_useSessionInUrl = true (line 220)

Use session in URL flag

bool $_useSessionVar = false (line 227)

Use session var instead of SID for session in URL

  • access: protected
Mage_Core_Model_Website $_website (line 87)

Application website object

  • access: protected
array $_websites = array() (line 150)

Websites cache

  • access: protected
Methods
Constructor __construct (line 234)

Constructor

  • access: public
Mage_Core_Model_App __construct ()
addEventArea (line 1193)
  • access: public
void addEventArea ( $area)
  • $area
baseInit (line 274)

Common logic for all run types

  • access: public
Mage_Core_Model_App baseInit (string|array $options)
  • string|array $options
cleanAllSessions (line 1156)

Deletes all session files

  • access: public
void cleanAllSessions ()
cleanCache (line 1123)

Cleaning cache

  • access: public
Mage_Core_Model_App cleanCache ([array $tags = array()])
  • array $tags
dispatchEvent (line 1201)
  • access: public
void dispatchEvent ( $eventName,  $args)
  • $eventName
  • $args
getAnyStoreView (line 1314)

Get either default or any store view

  • access: public
Mage_Core_Model_Store getAnyStoreView ()
getArea (line 754)

Retrieve application area

  • access: public
Mage_Core_Model_App_Area getArea (string $code)
  • string $code
getBaseCurrencyCode (line 1024)

Retrieve application base currency code

  • access: public
string getBaseCurrencyCode ()
getCache (line 1072)

Retrieve cache object

  • access: public
Zend_Cache_Core getCache ()
getCacheInstance (line 1059)

Get core cache model

  • access: public
Mage_Core_Model_Cache getCacheInstance ()
getConfig (line 1035)

Retrieve configuration object

  • access: public
Mage_Core_Model_Config getConfig ()
getCookie (line 463)

Retrieve cookie object

  • access: public
Mage_Core_Model_Cookie getCookie ()
getDefaultStoreView (line 867)

Retrieve default store for default group and website

  • access: public
Mage_Core_Model_Store getDefaultStoreView ()
getDistroLocaleCode (line 880)
  • access: public
void getDistroLocaleCode ()
getFrontController (line 1045)

Retrieve front controller object

  • access: public
Mage_Core_Controller_Varien_Front getFrontController ()
getGroup (line 945)

Retrieve application store group object

  • access: public
Mage_Core_Model_Store_Group getGroup ([ $id = null])
  • $id
getGroups (line 1368)

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

  • access: public
array getGroups ([bool $withDefault = false], [bool $codeKey = false])
  • bool $withDefault
  • bool $codeKey
getHelper (line 1014)

Retrieve helper object

  • access: public
Mage_Core_Helper_Abstract getHelper (string $name)
  • string $name
getLayout (line 983)

Retrive layout object

  • access: public
Mage_Core_Model_Layout getLayout ()
getLocale (line 970)

Retrieve application locale object

  • access: public
Mage_Core_Model_Locale getLocale ()
getRequest (line 1170)

Retrieve request object

  • access: public
getResponse (line 1183)

Retrieve response object

  • access: public
Zend_Controller_Response_Http getResponse ()
getSafeStore (line 811)

Retrieve application store object without Store_Exception

  • access: public
Mage_Core_Model_Store getSafeStore ([string|int|Mage_Core_Model_Store $id = null])
getStore (line 767)

Retrieve application store object

  • access: public
Mage_Core_Model_Store getStore ([ $id = null])
  • $id
getStores (line 834)

Retrieve stores array

  • access: public
array getStores ([bool $withDefault = false], [bool $codeKey = false])
  • bool $withDefault
  • bool $codeKey
getTranslator (line 1000)

Retrieve translate object

  • access: public
Mage_Core_Model_Translate getTranslator ()
getUpdateMode (line 1277)
  • access: public
void getUpdateMode ()
getUseCacheFilename (line 1424)

Get file name with cache configuration settings

  • deprecated: after 1.4.0.0-alpha3, functionality implemented in Mage_Core_Model_Cache
  • access: public
string getUseCacheFilename ()
getUseSessionInUrl (line 1342)

Retrieve use session in URL flag

  • access: public
bool getUseSessionInUrl ()
getUseSessionVar (line 1304)

Retrieve use flag session var instead of SID for URL

  • access: public
bool getUseSessionVar ()
getWebsite (line 890)

Retrieve application website object

  • access: public
Mage_Core_Model_Website getWebsite ([ $id = null])
  • $id
getWebsites (line 920)
  • access: public
void getWebsites ([ $withDefault = false], [ $codeKey = false])
  • $withDefault
  • $codeKey
init (line 246)

Initialize application without request processing

  • access: public
Mage_Core_Model_App init (string|array $code, [string $type = null], [string|array $options = array()])
  • string|array $code
  • string $type
  • string|array $options
initSpecified (line 298)

Run light version of application with specified modules support

  • see: Mage_Core_Model_App->run()
  • access: public
Mage_Core_Model_App initSpecified (string|array $scopeCode, [string $scopeType = null], [string|array $options = array()], [string|array $modules = array()])
  • string|array $scopeCode
  • string $scopeType
  • string|array $options
  • string|array $modules
isInstalled (line 1397)

Retrieve application installation flag

  • deprecated: since 1.2
  • access: public
bool isInstalled ()
isSingleStoreMode (line 642)

Is single Store mode (only one store without default)

  • access: public
bool isSingleStoreMode ()
loadArea (line 729)

Loading application area

  • access: public
Mage_Core_Model_App loadArea (string $code)
  • string $code
loadAreaPart (line 742)

Loding part of area data

  • access: public
Mage_Core_Model_App loadAreaPart (string $area, string $part)
  • string $area
  • string $part
loadCache (line 1086)

Loading cache data

  • access: public
mixed loadCache (string $id)
  • string $id
prepareCacheId (line 1451)

Prepare identifier which can be used as cache id or cache tag

  • deprecated: after 1.4.0.0-alpha3, functionality implemented in Mage_Core_Model_Cache
  • access: public
string prepareCacheId (string $id)
  • string $id
reinitStores (line 553)
  • access: public
void reinitStores ()
removeCache (line 1111)

Remove cache

  • access: public
Mage_Core_Model_App removeCache (string $id)
  • string $id
run (line 321)

Run application. Run process responsible for request processing and sending response.

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

  • access: public
Mage_Core_Model_App run (array $params)
  • array $params: application run parameters
saveCache (line 1099)

Saving cache data

  • access: public
Mage_Core_Model_App saveCache (mixed $data, string $id, [array $tags = array()], [ $lifeTime = false])
  • mixed $data
  • string $id
  • array $tags
  • $lifeTime
saveUseCache (line 1146)

Save cache usage settings

  • access: public
Mage_Core_Model_App saveUseCache (array $data)
  • array $data
setCurrentStore (line 690)

Set current default store

  • access: public
Mage_Core_Model_App setCurrentStore (string $store)
  • string $store
setErrorHandler (line 717)

Redeclare custom error handler

  • access: public
Mage_Core_Model_App setErrorHandler (string $handler)
  • string $handler
setIsSingleStoreModeAllowed (line 1353)

Allow or disallow single store mode

  • access: public
Mage_Core_Model_App setIsSingleStoreModeAllowed (bool $value)
  • bool $value
setUpdateMode (line 1272)
  • access: public
void setUpdateMode ( $value)
  • $value
setUseSessionInUrl (line 1331)

Set Use session in URL flag

  • access: public
Mage_Core_Model_App setUseSessionInUrl ([bool $flag = true])
  • bool $flag
setUseSessionVar (line 1293)

Set use session var instead of SID for URL

  • access: public
Mage_Core_Model_App setUseSessionVar (bool $var)
  • bool $var
throwStoreException (line 1282)
  • access: public
void throwStoreException ()
useCache (line 1135)

Check whether to use cache for specific component

  • access: public
boolean useCache ([ $type = null])
  • $type
_callObserverMethod (line 1262)

Added not existin observers methods calls protection

  • access: protected
void _callObserverMethod (object $object, string $method, Varien_Event_Observer $observer)
  • object $object
  • string $method
  • Varien_Event_Observer $observer
_checkCookieStore (line 528)

Check cookie store

  • access: protected
Mage_Core_Model_App _checkCookieStore (string $type)
  • string $type
_checkGetStore (line 473)

Check get store

  • access: protected
Mage_Core_Model_App _checkGetStore ( $type)
  • $type
_getCacheId (line 1436)

Generate cache id with application specific data

  • deprecated: after 1.4.0.0-alpha3, functionality implemented in Mage_Core_Model_Cache
  • access: protected
string _getCacheId ([string $id = null])
  • string $id
_getCacheTags (line 1410)

Generate cache tags from cache id

  • deprecated: after 1.4.0.0-alpha3, functionality implemented in Mage_Core_Model_Cache
  • access: protected
array _getCacheTags ([array $tags = array()], string $id)
  • string $id
  • array $tags
_getDefaultStore (line 852)
  • access: protected
void _getDefaultStore ()
_getStoreByGroup (line 656)

Retrive store code or null by store group

  • access: protected
string|null _getStoreByGroup (int $group)
  • int $group
_getStoreByWebsite (line 673)

Retrive store code or null by website

  • access: protected
string|null _getStoreByWebsite (int|string $website)
  • int|string $website
_initBaseConfig (line 363)

Initialize base system configuration (local.xml and config.xml files).

Base configuration provide ability initialize DB connection and cache backend

  • access: protected
Mage_Core_Model_App _initBaseConfig ()
_initCache (line 376)

Initialize application cache instance

  • access: protected
Mage_Core_Model_App _initCache ()
_initCurrentStore (line 426)

Initialize currently ran store

  • access: protected
unknown_type _initCurrentStore (string $scopeCode, string $scopeType)
  • string $scopeCode: code of default scope (website/store_group/store code)
  • string $scopeType: type of default scope (website/group/store)
_initEnvironment (line 350)

Initialize PHP environment

  • access: protected
Mage_Core_Model_App _initEnvironment ()
_initFrontController (line 701)

Initialize application front controller

  • access: protected
Mage_Core_Model_App _initFrontController ()
_initModules (line 393)

Initialize active modules configuration and data

  • access: protected
Mage_Core_Model_App _initModules ()
_initRequest (line 413)

Init request object

  • access: protected
Mage_Core_Model_App _initRequest ()
_initStores (line 562)

Init store, group and website collections

  • access: protected
void _initStores ()
Class Constants
ADMIN_STORE_ID = 0 (line 66)

Admin store Id

CACHE_TAG = 'MAGE' (line 49)

Cache tag for all cache data exclude config cache

DEFAULT_ERROR_HANDLER = 'mageCoreErrorHandler' (line 41)
DISTRO_LOCALE_CODE = 'en_US' (line 43)
DISTRO_STORE_CODE = 'default' (line 60)

Default store code (for install)

DISTRO_STORE_ID = 1 (line 54)

Default store Id (for install)

XML_PATH_INSTALL_DATE = 'global/install/date' (line 39)

Documentation generated on Fri, 11 Feb 2011 16:56:38 +0200 by phpDocumentor 1.4.3