[PHP] Re: Includes eating up my time

2007-07-31 Thread Emil Ivanov
Consider using the __autoload() function in php. (also the SPL autoloading features). It's a way to tell php to load a file when it cannot find a definition for a CLASS (only for classes). I don't know how you have set-uped your project, but in mine the only place in the project where I use

[PHP] Re: includes and classes

2004-04-22 Thread Justin Patrin
Jason Barnett wrote: Dubreuilmedia wrote: Hi I was wondering about includes and classes. I have a class in which depending on a member variable, i should load the proper include, which is really the proper config file for that moment. How does a member variable control this? E.g. you set

[PHP] Re: includes and classes

2004-04-21 Thread Jason Barnett
Dubreuilmedia wrote: Hi I was wondering about includes and classes. I have a class in which depending on a member variable, i should load the proper include, which is really the proper config file for that moment. How does a member variable control this? E.g. you set the member variable in the

RE: [PHP] Re: Includes vs. Functions

2002-07-18 Thread Jay Blanchard
[snip] Chris, thanks for describing your method. The reason I really dislike Functions in PHP is because you have to pass every variable needed by a function, even if that variable is global in the main script, which is a pain in the ass when a function needs a long string of variables. It makes

Re: [PHP] Re: Includes vs. Functions

2002-07-18 Thread Rick Widmer
At 09:20 PM 7/17/02 -0500, Michael Sims wrote: $superglobals = array(var1, var2, var3, var4, var5, ...); Now inside the function you can do this: function somefunction ($somevar) { global $superglobals; foreach($superglobals as $varname) { global $$varname; //resolves to $var1,

Re: [PHP] Re: Includes vs. Functions

2002-07-18 Thread Michael Sims
On Thu, 18 Jul 2002 08:40:08 -0600, you wrote: See below... At 09:20 PM 7/17/02 -0500, Michael Sims wrote: $superglobals = array(var1, var2, var3, var4, var5, ...); Now inside the function you can do this: function somefunction ($somevar) { global $superglobals; foreach($superglobals

[PHP] Re: Includes vs. Functions

2002-07-17 Thread Chris Crane
I am not sure about efficiency, myself and I often ask this without much if anything at all for a response. However, I am the opposite of you, in that I prefer to create a library file containing all the functions. To make developing the page in something like Dreamweaver or Frontpage easier, I

[PHP] Re: Includes vs. Functions

2002-07-17 Thread Monty
Chris, thanks for describing your method. The reason I really dislike Functions in PHP is because you have to pass every variable needed by a function, even if that variable is global in the main script, which is a pain in the ass when a function needs a long string of variables. It makes it

Re: [PHP] Re: Includes vs. Functions

2002-07-17 Thread Michael Sims
On Wed, 17 Jul 2002 17:46:25 -0400, you wrote: Chris, thanks for describing your method. The reason I really dislike Functions in PHP is because you have to pass every variable needed by a function, even if that variable is global in the main script, which is a pain in the ass when a function

RE: [PHP] Re: Includes vs. Functions

2002-07-17 Thread Martin Towell
Chris, thanks for describing your method. The reason I really dislike Functions in PHP is because you have to pass every variable needed by a function, even if that variable is global in the main script, which is a pain in the ass when a function needs a long string of variables. It makes it

[PHP] Re: includes question

2002-07-06 Thread Richard Lynch
what is the path of the includes directory in a windows dist of PHP (current version)? is that where all the dlls are? No. The DLLs are in your extensions_path (or something like that). Your include_path is where *YOUR* PHP files can be placed so you can use them in multiple scripts. The

[PHP] Re: Includes

2002-04-05 Thread Maxim Maletsky
we still use include(); setup.php has something like: if(file_exists($page) and ...more...controls..) include_once $page; then the $page.php is where you have a part of your site. You can pass $page as the GET variable: setup.php?page=page.php and so on Maxim Maletsky