Child pages
  • cRegistry
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Access point / Container for global data

CONTENIDO used to use a huge amount of global variables. This, for sure, is not the best approach of handling data that has to be generally available in every corner of the code. As PHP is going to banish these beloved variables in a future version, we had to develop another solution. This brought us to the idea to build a registry holding all this data. In order to allow a smooth migration the registry already offers an easy read access to this data although the data itself is still global. This will change in a future version of CONTENIDO.

The registries heart is the protected method _fetchGlobalVariable() which provides access to global data and allows to define a default value if the requested data does not exist. All other getters are build ontop of this method. A rough overview of the data that can be accessed through the registry:

globalmethoddetails
contenidogetBackendSessionId 
belanggetBackendLanguage 
editisBackendEditModedefault false
langgetLanguageIddefault load_lang
clientgetClientIddefaut load_client
idartgetArticleIddefault 0
idartlanggetArticleLanguageIddefault 0
idcatgetCategoryIddefault 0
idcatlanggetCategoryLanguageIddefault 0
idcatartgetCategoryArticleIddefault 0
sessgetSession 
authgetAuth 
permgetPerm 
cfggetConfig 
tabgetDbTableNamesfdg
_cecRegistrygetCecRegistry 

Convenience methods

Furthermore the registry is flavoured with some convenience methods to ease the development of modules and plugins.

 

  • No labels