Re: Conf: argue !
"Wim Niemans ri" <[email protected]>
| Newsgroups | gmane.comp.lib.binarycloud.devel |
|---|---|
| Organization | Pb Solo |
| Message-ID | <421A78BC.2530.D9CC6D@localhost> |
On 21 Feb 2005 at 23:47, Jean-Christophe Michel wrote: > Wim Niemans ri wrote: > > 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 ? You're right. I mistaked on Exception using Debug. Point withdrawn. > > 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. I do agree totally. What about $WORKSPACE applications? > > 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 :-) Not complete. 'smarty' is a domain. > > 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' ? Conf_values tend to live over releases. If you run release 2.0, than you would not use values of 3.0. However, that oldish config of 1.0 must be used. > > > 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. That's exactly what it is, execpt the dumping every 5-10 minutes. When accessing files. that's done in a (disposable) child, since the domain is avalable *after* reading and parsing. For every domain so detected, a separate child is created to store the array. This guarantees that you can't erroneous mix config_values over domains. It's fully transparant, and comparable to a Node tree. > > 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. /auth/perm/allperms_roles => array( (string) '' ) /auth/perm/implicit_roles => array( (string) 'roles.Anonymous') /smarty/options/plugins_dir => array( (BC_PATH_BASE . '/smarty/libs/plugins'), (BC_PATH_BASE . '/smarty-plugins') Do I see an array there? Cheers, wim niemans