Re: Opinion about the using $GLOBALS directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

Thanks for joining the conversation. It seems there where no real technical 
dead end for using $GLOBALS directly. 
Using $GLOBALS directly very similar to coding standarts. It just up to you.

Also I try explain my enviroment a liddle bit.

First of all my function declarationgs gonna like this

// Set Shorcut Variables
$arrConf   = &$GLOBALS['_LIVE']['_CONF'];
$arrStat   = &$GLOBALS['_LIVE']['_STAT'];
$arrDomSet = &$GLOBALS['_LIVE']['_DOMN'][$GLOBALS['_LIVE']['_STAT']['curDom']]
['settings'];
$arrLang   = &$GLOBALS['_LIVE']['_LANG'][$arrStat['language']];
$rootDir   = &$arrConf['rootDir'];
$webDir    = &$arrConf['webDir'];
$arrDb     = &$arrConf['_DB'];
$arrDbg    = &$GLOBALS['_LIVE']['_DEBG'];


It grows and grows. And  some times in small functions, function declarations 
become larger than the function actual code.

Most of those GLOBALS usage are read only (like configuration variables, or 
stored language keys) or need to update anywhere in the system.

And unde one condition it may become problem.

If 3rd party users develop some code under my enviroment and if there where 
some change about GLOBALS['name'] or PHP core developers may change GLOBALS 
to GLB (or someting like that) there may problem to update 3rd party code.

To prevent this, putting some variable translation functions for 3rd party 
developers was good idea.

Other than this for my point of view it was very useful.

Thank you very much all of you.

Sancar

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux