[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 inclu

[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 the

[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 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

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; //r

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 i

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 ma

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

[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 easie

[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 gl

[PHP] Re: includes question

2002-07-05 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.

[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 Founde