On Jun 28, 3:49 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
...
> It's easy to build an interface to allow the user to change the site
> settings, and I have a function for storing this
> back:http://bin.cakephp.org/view/565388190
...
Mmmmm. PizzaCake :-)
Doh! I missed the obvious solution of using the configure class.
Instead, here's my half-baked solution: I had found a neat function in
the Cake core for the ACL component (function
readConfigFile($fileName) ) that reads configs from a Windows-style
ini file (in this example, app/config/client/client.ini.php):
;<?php die() ?>
[Client]
sitename = PizzaCake
help_url = http://simpsons1/help
; this is a commented line.
[More Settings]
key = value
I copied that function "readConfigFile" into bootstrap.php, and added
a call to it against my config file, which places the resulting array
into the $GLOBALS array.
in app/config/bootstrap.php:
$GLOBALS['CONFIG'] = readConfigFile(CONFIGS . 'client' . DS .
'client.ini.php');
function readConfigFile($fileName) {
...
}
Now anywhere in the app I can access $GLOBALS['CONFIG']['Client']
['sitename']
Maybe that's helpful to someone who needs to read from a Windows-style
ini file. I'll refactor mine to do it the Cake way.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---