Re: Conf: argue !
Jean-Christophe Michel <jc.michel-/aRvmaKoZxNWk0Htik3J/[email protected]>
| Newsgroups | gmane.comp.lib.binarycloud.devel |
|---|---|
| Message-ID | <[email protected]> |
Wim Niemans ri wrote: > 1. There is only the choice between Conf: loading files or Conf: using > SQLite. > Background: Conf: doesn't know which db to use. That is 'configured' with > DataSources configuration. Egg and chicken. Let's have a line in build.properties or in htdocs/binarycloud.php to specify the db. In my opinion we can have SQL _and_ xml to be able to load package default confs easily. > 2. It's funny to throw Exceptions, since you can't debug them. > Background: Exception uses Debug uses Conf: Explain more please. Exceptions don't use Debug, eh ? > 3. A complete path might be prefixed with (optional); > 3.1. 'file://' => which means a file > 3.2. 'db://' => which means the db > 3.3. 'conf://' => a special hardcoded conf::file, necessary for essentials Not sure we need this if we are sure to use SQLite. > 4. There is a rule for detecting a filePath in the treePath: > 4.1. if it ends with .php or .ini or .xml => a file is requested > 4.2. if it starts with 'file://' => a file is requested Or like unix paths: if it ends with / its a domain else it's a file :-) > 5. There is a variable 'version' which can be overloaded. > It means: skip conf_values with version higher than "version". > Version is initially '2.0'. I would have said 'lower' ? > The new conf: Class is Singleton, and creates children, if necessary. > The structure is such that you can't overload config_values: you must use > the method set(path,value). > 6.1. A child for accessing conf::files, created only if necessary; there > is a child for .php, .xml, .ini and for .db > 6.3. A child for caching (in memory) conf_values of a complete domain. > 6.4. Any access to Conf: takes care for caching the complete domain > mentioned in the treePath (files). > 6.5. Conf: may be 'configured' for caching: complete (db) or preLoad > (files). Seems too complicated to me. Simply keep a copy in memory of the loaded values is enough, i think. Or maybe reduce cpu+db overhead by caching in a php file (var_dump) all conf files every 5 or 10 mins. > 7. All values are stored in the db as Strings (mysql type text). > Arrays are stored as ....... please suggest; choices: > 7.1 valid php code > 7.2 exported format > 7.3 var_dumped format > 7.4 serialized (manual doesn't like that) > 7.5 syntax to be defined ? Arrays are not stored. Arrays are the result of retrieving a domain. :p -- Jean-Christophe Michel