Made zm.conf options available site-side

This commit is contained in:
Kyle Johnson 2013-05-17 09:02:34 -04:00
parent 9628aff358
commit ae5a3d716c
1 changed files with 7 additions and 1 deletions

View File

@ -47,7 +47,13 @@ class AppController extends Controller {
$configFile = "/usr/local/etc/zm.conf";
$localConfigFile = basename($configFile);
$lines = file($configFile);
foreach ($lines as $linenum => $line) {
if ( preg_match( '/^\s*([^=\s]+)\s*=\s*(.+?)\s*$/', $line, $matches )) {
Configure::write($matches[1], $matches[2]);
}
}
$options = $this->Config->find('list', array('fields' => array('Name', 'Value')));
foreach ($options as $key => $value) {
Configure::write($key, $value);