John W. Holmes wrote:


I'd prefer the text file. It's easier to open that and change values plus they don't have to worry about PHP syntax as much. Haven't tried, but you should be able to import them as private variables for your class...



Thanks for the advice John. OK, so extending this a bit: all of the objects are singletons. Would it be better to have one ini file per class, or combine class settings into one "master" ini file?


By the way, if any else is interested you *can* import these values as private variables. Probably the easiest way might be like this:

<?php

class usesIniFile {

  private $_iniFile = 'path/to/file.ini';
  private $_secretProps = array();

  function __construct($args) {
    // do stuff with $args
    $this->_secretProps = parse_ini_file();
  }

}

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to