This topic is locked

does it matter where I 'include' files?

10/27/2006 10:03:28 AM
PHPRunner General questions
T
thesofa author

I have a few custon functions I need to use in one project. At the moment I am including them manually by adding the lines

include("ldap/ldap_ban_variables.php");

include("ldap/ldap_ban_functions.php");



I would like to avoid having to add these 2 lines in all the time, does it affect the running of the programme if I place these 2 files in a different folder, or canI just add them to the main variables and functions files?

Will it slow things down if they are in the main functions?

Alexey admin 10/30/2006

Hi,
there is no universal answer to your question. Try to include them somewhere and browse your pages.

If your pages would work fine during the test they will work the same way all the time.
There wouldn't be a significant impact on site's performance if you include your files in any common file.

D
Dale 10/30/2006

Hi thesofa,
BIG NOTE: This is for ver3.0, I have not attempted 3.1 yet.
I have a couple of include files to support my modals and a third party menu system I use.
I simply added the includes at the top of each template under the ...functions.php and ...variables.php that are at the top of each and every page. You would need to edit the templates of add, list, edit, view etc etc. You only need the includes on the files that will need to call the functions. By making the changes in the templates, when you generate, everything is done for you.
If you can, just copy your files ldap_ban_variables.php and ldap_ban_functions.php into the existing include folder. Insert the modified includes as below.
include("ldap_ban_variables.php");

include("ldap_ban_functions.php");
This works for me, and I have not run into any complications. Knock on wood.
Just a suggestion.