Class mpGlobals

Description

Implements interfaces:

Globals array ($GLOBALS) manager class. Provides another way to access (reading/writing) to globals array.

Number of access deepness to the array structure depends on extended class 'mpArrayManager'. This is by default up to 4 levels, e. g. $arr['one']['two']['three']['four'].

The whole purpose of this class is to replace usage of superglobal $GLOBALS and the global declaration of variables (global $foobar;) within functions.

  • author: Murat Purc <murat@purc.de>
  • see: http://www.php.net/manual/en/language.variables.scope.php Usage: <code> // example globals content $GLOBALS['key']['subkey']['anotherkey'] = 123; // example access (assuming that access delemiter is /) $glob = mpGlobals::getInstance(); echo $glob->get('key/subkey/anotherkey'); // example for setting the content $glob->set('key/subkey/anotherkey', 321); </code>

Located in /contenido/classes/mp/class.mpglobals.php (line 48)

mpArrayManager
   |
   --mpGlobals
Method Summary
 mpGlobals __construct ()
Variables
Methods
static getInstance (line 62)

Returns a instance of mpGlobals (singleton implementation)

  • access: public
mpGlobals getInstance ()
Constructor __construct (line 53)

Constructor, stores the reference to $GLOBALS into member variable _aData.

  • access: private
mpGlobals __construct ()

Inherited Methods

Inherited From mpArrayManager

 mpArrayManager::exists()
 mpArrayManager::get()
 mpArrayManager::set()
 mpArrayManager::_getSections()

Documentation generated on Sun, 08 Feb 2009 22:00:47 +0100 by phpDocumentor 1.4.1