Afficher un message
Vieux 23/06/2008, 17h14   #6
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: question on avoiding abuse of global

hellbringer wrote:
> lazy schrieb:
>> hi,
>> I have some constants defined in a php script say config.php.
>> I want to use the variables there defined in other scripts.
>> couple of questions regd that:
>>
>> 1. Is there an alternative to including config.php and declaring the
>> variables that will be used as global. This seems very inefficient.
>>
>> 2.Moreover these variables are constants, is there a way to make the
>> variables unmodifiable in config.php so that scripts that use them ,
>> dont overrite them. Is there a php construct which can delare a
>> variable as constant.

>
> Use a singleton pattern.
>


And how does that solve his problem? How is he going to get the
singleton if he doesn't include the file containing the singleton -
which negates the whole purpose of his question?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
 
Page generated in 0,05774 seconds with 9 queries