Class Mage_Core_Model_Config

Description

Core configuration class

Located in /Core/Model/Config.php (line 35)

Varien_Simplexml_Config
   |
   --Mage_Core_Model_Config_Base
      |
      --Mage_Core_Model_Config
Class Constant Summary
CACHE_TAG = 'CONFIG'
Variable Summary
Method Summary
Mage_Core_Model_Config addAllowedModules (strung|array $module)
Mage_Core_Model_Config __construct ([mixed $sourceData = null])
void createDirIfNotExists ( $dir)
Mage_Core_Model_Config deleteConfig (string $path, [string $scope = 'default'], [int $scopeId = 0])
string determineOmittedNamespace (string $name, [bool $asFullModuleName = false])
string getBaseDir ([string $type = 'base'])
string getBlockClassName (string $blockType)
Zend_Cache_Frontend_File getCache ()
Mage_Core_Model_Config_Element getEventConfig (string $area, string $eventName)
null|array getFieldset (string $name, [string $root = 'global'])
string getGroupedClassName (string $groupType, string $classId, [string $groupRootNode = null])
string getHelperClassName ( $helperName, string $name)
string getModelClassName (sting $modelClass)
Mage_Core_Model_Abstract getModelInstance ([string $modelClass = ''], [array|object  $constructArguments = array()])
Varien_Simplexml_Object getModuleConfig ([string $moduleName = ''])
string getModuleDir (string $type, string $moduleName)
object getModuleSetup ([string|Varien_Simplexml_Object $module = ''])
Mage_Core_Model_Config_Element getNode ([string $path = null], [string $scope = ''], [string $scopeCode = null])
void getNodeClassInstance ( $path)
array getPathVars ([array|string $args = null])
Varien_Simplexml_Object getResourceConfig (string $name)
Varien_Simplexml_Element getResourceConnectionConfig (string $name)
Mage_Core_Store_Mysql4_Config getResourceModel ()
string|false getResourceModelClassName (string $modelClass)
object getResourceModelInstance ([string $modelClass = ''], [array $constructArguments = array()])
Varien_Simplexml_Object getResourceTypeConfig (string $type)
array getStoresConfigByPath (string $path, [array $allowValues = array()], [ $useAsKey = 'id'])
string getTablePrefix ()
string getTempVarDir ()
string getVarDir ([string $path = null], [string $type = 'var'])
Mage_Core_Model_Config init ([ $options = array()])
boolean loadEventObservers (string $area)
Mage_Core_Model_Config_Base loadModulesConfiguration (string $fileName, [null|Mage_Core_Model_Config_Base $mergeToObject = null], [ $mergeModel = null])
Mage_Core_Model_Config reinit ([array $options = array()])
Mage_Core_Model_Config saveCache ([array $tags = array()])
Mage_Core_Store_Config saveConfig (string $path, string $value, [string $scope = 'default'], [int $scopeId = 0])
bool shouldUrlBeSecure (string $url)
void substDistroServerVars ( $data)
string _getCacheLockId ()
string|false _getResourceModelFactoryClassName (string $modelClass)
bool _isAllowedModule (string $moduleName)
string _loadCache (string $id)
Mage_Core_Model_Config _loadDeclaredModules ([null $mergeConfig = null])
Varien_Simplexml_Element _loadSectionCache (string $sectionName)
Mage_Core_Model_Config _saveCache (string $data, string $id, [array $tags = array()], [false|int $lifetime = false])
Mage_Core_Model_Config _saveSectionCache (string $idPrefix, string $sectionName, Varien_Simplexml_Element $source, [int $recursionLevel = 0], [ $tags = array()])
array _sortModuleDepends (array $modules)
Variables
bool $_allowCacheForInit = true (line 140)

Flach which allow using cache for config initialization

  • access: protected
array $_allowedModules = array() (line 190)

Modules allowed to load If empty - all modules are allowed

  • access: protected
mixed $_baseDirCache = array() (line 168)

Depricated properties

  • deprecated:
  • access: protected
unknown_type $_blockClassNameCache = array() (line 90)

Storage for generated block class names

  • access: protected
array $_cacheLoadedSections = array() (line 69)

Loaded Configuration by cached sections

  • access: protected
array $_cachePartsForSave = array() (line 147)

Property used during cache save process

  • access: protected
array $_cacheSections = array(
'admin' => 0,
'adminhtml' => 0,
'crontab' => 0,
'install' => 0,
'stores' => 1,
'websites' => 0
)
(line 55)

Instructions for spitting config cache

array( $sectionName => $recursionLevel ) Recursion level provide availability cache subnodes separatly

  • access: protected
bool $_canUseLocalModules = null (line 176)

Flag which allow to use modules from local code pool

  • access: protected
array $_classNameCache = array() (line 83)

Storage for generated class names

  • access: protected
mixed $_customEtcDir = null (line 169)
  • access: protected
array $_dirExists = array() (line 133)

Flag cache for existing or already created directories

  • access: protected
array $_distroServerVars (line 104)

System environment server variables

  • access: protected
array $_eventAreas (line 126)

Configuration for events by area

  • access: protected
bool $_isLocalConfigLoaded = false (line 161)

Flag which identify what local configuration is loaded

  • access: protected
Mage_Core_Model_Config_Options $_options (line 76)

Configuration options

  • access: protected
Mage_Core_Model_Config_Base $_prototype (line 154)

Empty configuration object for loading and megring configuration parts

  • access: protected
Mage_Core_Model_Mysql4_Config $_resourceModel (line 119)

Resource model Used for operations with DB

  • access: protected
array $_secureUrlCache = array() (line 97)

Storage of validated secure urls

  • access: protected
array $_substServerVars (line 111)

Array which is using for replace placeholders of server variables

  • access: protected
bool $_useCache = false (line 44)

Flag which allow use cache logic

  • access: protected
Methods
addAllowedModules (line 696)

Add module(s) to allowed list

  • access: public
Mage_Core_Model_Config addAllowedModules (strung|array $module)
  • strung|array $module
Constructor __construct (line 197)

Class construct

  • access: public
Mage_Core_Model_Config __construct ([mixed $sourceData = null])
  • mixed $sourceData

Redefinition of:
Mage_Core_Model_Config_Base::__construct()
Constructor
cleanCache (line 575)

Configuration cache clean process

  • access: public
Mage_Core_Model_Config cleanCache ()
createDirIfNotExists (line 1046)
  • access: public
void createDirIfNotExists ( $dir)
  • $dir
deleteConfig (line 1451)

Delete config value from DB

  • access: public
Mage_Core_Model_Config deleteConfig (string $path, [string $scope = 'default'], [int $scopeId = 0])
  • string $path
  • string $scope
  • int $scopeId
determineOmittedNamespace (line 846)

Determine whether provided name begins from any available modules, according to namespaces priority If matched, returns as the matched module "factory" name or a fully qualified module name

  • access: public
string determineOmittedNamespace (string $name, [bool $asFullModuleName = false])
  • string $name
  • bool $asFullModuleName
getBaseDir (line 1025)

Get base filesystem directory. depends on $type

If $moduleName is specified retrieves specific value for the module.

  • deprecated: in favor of Mage_Core_Model_Config_Options
  • todo: get global dir config
  • access: public
string getBaseDir ([string $type = 'base'])
  • string $type
getBlockClassName (line 1200)

Retrieve block class name

  • access: public
string getBlockClassName (string $blockType)
  • string $blockType
getCache (line 421)

Retrieve cache object

  • access: public
Zend_Cache_Frontend_File getCache ()
getDistroServerVars (line 931)

Get default server variables values

  • access: public
array getDistroServerVars ()
getEventConfig (line 1417)

Get events configuration

  • access: public
Mage_Core_Model_Config_Element getEventConfig (string $area, string $eventName)
  • string $area: event area
  • string $eventName: event name
getFieldset (line 1466)

Get fieldset from configuration

  • access: public
null|array getFieldset (string $name, [string $root = 'global'])
  • string $name: fieldset name
  • string $root: fieldset area, could be 'admin'
getGroupedClassName (line 1158)

Retrieve class name by class group

  • access: public
string getGroupedClassName (string $groupType, string $classId, [string $groupRootNode = null])
  • string $groupType: currently supported model, block, helper
  • string $classId: slash separated class identifier, ex. group/class
  • string $groupRootNode: optional config path for group config
getHelperClassName (line 1214)

Retrieve helper class name

  • access: public
string getHelperClassName ( $helperName, string $name)
  • string $name
  • $helperName
getModelClassName (line 1228)

Retrieve modele class name

  • access: public
string getModelClassName (sting $modelClass)
  • sting $modelClass
getModelInstance (line 1249)

Get model class instance.

Example: $config->getModelInstance('catalog/product')

Will instantiate Mage_Catalog_Model_Mysql4_Product

  • access: public
Mage_Core_Model_Abstract getModelInstance ([string $modelClass = ''], [array|object  $constructArguments = array()])
  • string $modelClass
  • array|object $constructArguments
getModuleConfig (line 980)

Get module config node

Varien_Simplexml_Object getModuleConfig ([string $moduleName = ''])
  • string $moduleName
getModuleDir (line 1058)

Get module directory by directory type

  • access: public
string getModuleDir (string $type, string $moduleName)
  • string $type
  • string $moduleName
getModuleSetup (line 998)

Get module setup class instance.

Defaults to Mage_Core_Setup

object getModuleSetup ([string|Varien_Simplexml_Object $module = ''])
  • string|Varien_Simplexml_Object $module
getNode (line 614)

Returns node found by the $path and scope info

  • access: public
Mage_Core_Model_Config_Element getNode ([string $path = null], [string $scope = ''], [string $scopeCode = null])
  • string $path
  • string $scope
  • string $scopeCode
getNodeClassInstance (line 1263)
  • access: public
void getNodeClassInstance ( $path)
  • $path
getOptions (line 224)

Get configuration options object

  • access: public
getPathVars (line 1140)

Get standard path variables.

To be used in blocks, templates, etc.

  • access: public
array getPathVars ([array|string $args = null])
  • array|string $args: Module name if string
getResourceConfig (line 1296)

Get resource configuration for resource name

  • access: public
Varien_Simplexml_Object getResourceConfig (string $name)
  • string $name
getResourceConnectionConfig (line 1307)

Get connection configuration

  • access: public
Varien_Simplexml_Element getResourceConnectionConfig (string $name)
  • string $name
getResourceModel (line 211)

Get config resource model

  • access: public
Mage_Core_Store_Mysql4_Config getResourceModel ()
getResourceModelClassName (line 1514)

Get a resource model class name

  • access: public
string|false getResourceModelClassName (string $modelClass)
  • string $modelClass
getResourceModelInstance (line 1281)

Get resource model object by alias

  • access: public
object getResourceModelInstance ([string $modelClass = ''], [array $constructArguments = array()])
  • string $modelClass
  • array $constructArguments
getResourceTypeConfig (line 1329)

Retrieve resource type configuration for resource name

  • access: public
Varien_Simplexml_Object getResourceTypeConfig (string $type)
  • string $type
getSectionNode (line 586)

Get node value from cached section data

  • access: public
Mage_Core_Model_Config getSectionNode (array $path)
  • array $path
getStoresConfigByPath (line 1345)

Retrieve store Ids for $path with checking

if empty $allowValues then retrieve all stores values

return array($storeId=>$pathValue)

  • access: public
array getStoresConfigByPath (string $path, [array $allowValues = array()], [ $useAsKey = 'id'])
  • string $path
  • array $allowValues
  • $useAsKey
getTablePrefix (line 1405)

Get DB table names prefix

  • access: public
string getTablePrefix ()
getTempVarDir (line 921)

Retrieve temporary directory path

  • access: public
string getTempVarDir ()
getVarDir (line 1037)

Get temporary data directory name

  • access: public
string getVarDir ([string $path = null], [string $type = 'var'])
  • string $path
  • string $type
init (line 248)

Initialization of core configuration

  • access: public
Mage_Core_Model_Config init ([ $options = array()])
  • $options
isLocalConfigLoaded (line 337)

Check if local configuration (DB connection, etc) is loaded

  • access: public
bool isLocalConfigLoaded ()
loadBase (line 270)

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

  • access: public
loadDb (line 347)

Load config data from DB

  • access: public
loadEventObservers (line 1091)

Load event observers for an area (front, admin)

  • access: public
boolean loadEventObservers (string $area)
  • string $area
loadModules (line 312)

Load modules configuration

  • access: public
Mage_Core_Model_Config loadModules ()
loadModulesCache (line 291)

Load cached modules configuration

  • access: public
bool loadModulesCache ()
loadModulesConfiguration (line 890)

Iterate all active modules "etc" folders and combine data from specidied xml file name to one object

  • access: public
Mage_Core_Model_Config_Base loadModulesConfiguration (string $fileName, [null|Mage_Core_Model_Config_Base $mergeToObject = null], [ $mergeModel = null])
reinit (line 364)

Reinitialize configuration

  • access: public
Mage_Core_Model_Config reinit ([array $options = array()])
  • array $options
removeCache (line 564)

Remove configuration cache

  • access: public
Mage_Core_Model_Config removeCache ()
saveCache (line 442)

Save configuration cache

  • access: public
Mage_Core_Model_Config saveCache ([array $tags = array()])
  • array $tags: cache tags
saveConfig (line 1435)

Save config value to DB

  • access: public
Mage_Core_Store_Config saveConfig (string $path, string $value, [string $scope = 'default'], [int $scopeId = 0])
  • string $path
  • string $value
  • string $scope
  • int $scopeId
setOptions (line 235)

Set configuration options

  • access: public
Mage_Core_Model_Config setOptions (array $options)
  • array $options
shouldUrlBeSecure (line 1384)

Check security requirements for url

  • access: public
bool shouldUrlBeSecure (string $url)
  • string $url
substDistroServerVars (line 964)
  • access: public
void substDistroServerVars ( $data)
  • $data
_canUseCacheForInit (line 410)

Check if cache can be used for config initialization

  • access: protected
bool _canUseCacheForInit ()
_canUseLocalModules (line 379)

Check local modules enable/disable flag If local modules are disbled remove local modules path from include dirs

return true if local modules enabled and false if disabled

  • access: protected
bool _canUseLocalModules ()
_getCacheLockId (line 431)

Get lock flag cache identifier

  • access: protected
string _getCacheLockId ()
_getDeclaredModuleFiles (line 653)

Retrive Declared Module file list

  • access: protected
array _getDeclaredModuleFiles ()
_getResourceModelFactoryClassName (line 1481)

Get factory class name for for a resource

  • access: protected
string|false _getResourceModelFactoryClassName (string $modelClass)
  • string $modelClass
_isAllowedModule (line 715)

Define if module is allowed

  • access: protected
bool _isAllowedModule (string $moduleName)
  • string $moduleName
_loadCache (line 529)

Load cached data by identifier

  • access: protected
string _loadCache (string $id)
  • string $id
_loadDeclaredModules (line 730)

Load declared modules configuration

  • access: protected
Mage_Core_Model_Config _loadDeclaredModules ([null $mergeConfig = null])
  • null $mergeConfig: depricated
_loadSectionCache (line 505)

Load config section cached data

  • access: protected
Varien_Simplexml_Element _loadSectionCache (string $sectionName)
  • string $sectionName
_removeCache (line 554)

Clear cache data by id

  • access: protected
Mage_Core_Model_Config _removeCache (string $id)
  • string $id
_saveCache (line 543)

Save cache data

  • access: protected
Mage_Core_Model_Config _saveCache (string $data, string $id, [array $tags = array()], [false|int $lifetime = false])
  • string $data
  • string $id
  • array $tags
  • false|int $lifetime
_saveSectionCache (line 485)

Save cache of specified

  • access: protected
Mage_Core_Model_Config _saveSectionCache (string $idPrefix, string $sectionName, Varien_Simplexml_Element $source, [int $recursionLevel = 0], [ $tags = array()])
  • string $idPrefix: cache id prefix
  • string $sectionName
  • Varien_Simplexml_Element $source
  • int $recursionLevel
  • $tags
_sortModuleDepends (line 798)

Sort modules and check depends

  • access: protected
array _sortModuleDepends (array $modules)
  • array $modules

Inherited Methods

Inherited From Mage_Core_Model_Config_Base

Mage_Core_Model_Config_Base::__construct()
Class Constants
CACHE_TAG = 'CONFIG' (line 37)

Documentation generated on Fri, 11 Feb 2011 16:59:18 +0200 by phpDocumentor 1.4.3