News Feed
Sections




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

Gonzalo Ayuso's Blog:
Using PHP classes to store configuration data
January 10, 2011 @ 11:57:39

Gonzalo Ayuso has a new post to his blog today looking at how he uses PHP classes to store configuration information for easier retrieval.

In my last projects I'm using something I think is useful and it's not a common practice in our PHP projects. That's is the usage of a plain PHP's class for the application's configuration. Let me explain it. Normally we use ini file for configuration. [...] There are many standard options. Why I prefer a different one then? I like plain PHP classes because the IDE helps me with autocompletion. The usage is quite simple.

His example uses a standard class to store the configuration values, one that can be loaded into a project and lets you call the configuration values statically. He gives two examples of how this is helpful in a standard IDE with autocompletion.

0 comments voice your opinion now!
class configuration data ini xml yaml parseinifile


blog comments powered by Disqus

Similar Posts

Jim Plush\'s Blog: New AJAX/PHP framework - My-BIC is LIGHT and TASTY!

PHPied.com: SAP container for PEAR::Auth

DevShed: Throwing Basic Exceptions When Auto Loading Classes in PHP 5

ThinkPHP Blog: Spooky Action at not so much Distance

Elated.com: Object-Oriented PHP: Autoloading, Serializing, and Querying Objects


Community Events





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


voicesoftheelephpant podcast opinion conference language interview framework introduction tool library security community release series symfony version composer laravel package list

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