Re: Re: cvs: pear /LiveUser/Perm Simple.php /LiveUser/Perm/Storage

From: Date: Wed, 15 Dec 2004 21:15:22 +0000
Subject: Re: Re: cvs: pear /LiveUser/Perm Simple.php /LiveUser/Perm/Storage
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35089@lists.php.net to get a copy of this message
On Wed, 15 Dec 2004 21:17:43 +0100, Lukas Smith <lsmith@php.net> wrote: > Lukas Smith wrote: > > Lukas Smith wrote: > > > >> Lukas Smith wrote: > >> > >>> lsmith Sun Dec 12 16:25:56 2004 EDT > >>> > >>> Modified files: /pear/LiveUser/Perm Simple.php > >>> /pear/LiveUser/Perm/Storage SQL.php Log: > >>> - added new default for config arrays inside static methods so we > >>> can fetch them from the admin classes) > >> > >> > >> > >> In LiveUser we have several rather large configuration arrays, that > >> essentially cover the entire db schema. Since we need those arrays in > >> the client as well as the admin classes I have placed them inside > >> static methods of the client. See the code in CVS or the latest > >> commits for details. > >> > >> Now the question is shouldnt I better place them inside a separate > >> script and just place them inside the super global ..? > >> > >> $GLOBALS[_LiveUser]['tables'] = array( > >> .. > >> ); > >> > >> That way I dont need to call a static method to get the array both > >> inside the client and inside the admin. Inside the admin I would also > >> get around including a few lines of code (however in practice its > >> likely that these lines of code will be included already anyways). > > > > > > in an effort to entice a few more replies: > > Arnaud told me in IRC he prefers the super global. > > > > hmm maybe i need to make the content of the thread more flameable .. it > > seems such content gets much more attention .. ;-) > > ok appearently nobody cares > so i guess i will go with the super global variant. > > *sigh* *grumble* so much for the community experience > OK, here's my take (sorry for the late late late reply :-| ). The global is much faster. The method call is more extendible, but takes more memory and processing power. For anything that might be extended (like the links and columns for DB_DataObject) having it in a method is nice as it's easy to customize per-object. If this code won't be extended / customized (or not customized per object) then the global is best. -- Justin Patrin

« previous php.pear.dev (#35089) next »