News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Vidyut Luther's Blog:
Where do you "define" your environment/global settings?
January 20, 2006 @ 06:44:36

From Vidyut Luther today, there's this new post that asks the question "Where do you 'define' your environment/global settings?"

I was wondering how people handled this situation themselves. I'm personally trying to decide whether my constants be in the class files, or a global configuration file. Right now I have a global.conf.php which contains things like (MySQL login info, include paths, table names).

So, my question is: Is it better to have one big configuration file, or should some things be defined on top of the individual classes ? (CONTACTS_TABLE.. is a clear example). I see pros and cons for both approaches.

He lists out pros and cons for the "one file approach" versus the "multiple specific definitions" method, for example:

  • simple editing vs. easier to manage
  • a single large file vs. multiple small files
  • high memory usage on every page vs. lower memory consumption from loading only what's needed
0 comments voice your opinion now!
define global settings multiple file single large small define global settings multiple file single large small


blog comments powered by Disqus

Similar Posts

Mauricio Cuenca's Blog: Two (or more) Zend Framework projects on a shared host

Brian Moon's Blog: Using ini files for PHP application settings

Ask Apache Blog: A better way to use PDF files online

Mattias Geniar's Blog: php_value vs php_admin_value and the use of php_flag explained

Chris Hartjes' Blog: Handling Multiple Environments In Your PHP Application


Community Events





Don't see your event here?
Let us know!


podcast configure community release threedevsandamaybe opinion framework introduction laravel unittest language symfony2 interview code series list testing refactor developer install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework