|
-
Jul 27th, 2007, 06:09 AM
#1
Thread Starter
Frenzied Member
Include files
Generally in the past I would have one settings file that would hold all my PHP stuff, connection settings, functions, global variables etc.
Is it best to have one long file like i have been doing, or seperate for connection, vars, functions etc?
Thanks
-
Jul 27th, 2007, 10:13 AM
#2
Re: Include files
separate. What my work tends to do is we have 1 document for connection, 1 for config (user id, password, ip, etc), and then one file for each purpose of the application.
Having things in different files allows easier re-usability.
-
Jul 27th, 2007, 02:07 PM
#3
Thread Starter
Frenzied Member
-
Jul 27th, 2007, 04:29 PM
#4
Hyperactive Member
Re: Include files
I tend to keep mine in one file, normally config.php, and have them in different variables that are easy to understand and add too should you need to, rather than having to trawl through other files updating them.
PHP Code:
$database['server'] = "localhost";
$page['main_name'] = "whatever site";
$email['from_address'] = "[email protected]";
Maybe that's just me.
» Twitter: @rudi_visser : Website: www.rudiv.se «
If Apple fixes security flaws, they are heralded as proactive. If Microsoft fixes a security flaw, they finally got around to fixing their buggy OS.
-
Jul 29th, 2007, 07:28 AM
#5
Re: Include files
I use an ini file. parse_ini_file()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|