-
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
-
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.
-
Re: Include files
-
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.
-
Re: Include files
I use an ini file. parse_ini_file()