38 Special ringtonesSocial Distortion ringtonesBonnie Tyler ringtonesSantana ringtones

I would say configuration

I would say configuration through arrays is a rather good idea. During implementation of my application I've discovered standard PHP .ini parse function doesn't preserve variable values in a strict fashion:

ini_variable = true

results in value of $config->section->ini_variable to be === 1. This is certainly not what I want: for me 'true' means PHP true, 'false' PHP false, and '1' PHP 1 (or '1'). It really starts to matter when your code uses strict (===) comparisons (which, personally, I consider good PHP programming practice). So, I have written my own INI parsing method, and now I make a call:

$config = new Zend_Config(Argasek_Config_Ini::read($thisdir.'/cfg/whatever.ini'));

and convert array returned by ::read into object. Nice and clean.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <codeblock> <blockquote> <h1> <h2> <h3> <h4> <h5> <img>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Use the special tag [adsense:format:group:channel] or [adsense:flexiblock:location] to display Google AdSense ads.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.