From: Florent Bruneau Date: Sat, 3 Nov 2007 14:37:24 +0000 (+0100) Subject: Bootstrap useful dynamic variable when needed. X-Git-Tag: xorg/0.9.16~225 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e6705972767604b0e8dbf9962ccc1790332eb2b9;p=platal.git Bootstrap useful dynamic variable when needed. Signed-off-by: Florent Bruneau --- diff --git a/include/globals.inc.php.in b/include/globals.inc.php.in index b511006..ffa6883 100644 --- a/include/globals.inc.php.in +++ b/include/globals.inc.php.in @@ -87,7 +87,9 @@ class PlatalGlobals { $this->read_ini_file($this->spoolroot.'/configs/platal.ini'); $this->read_ini_file($this->spoolroot.'/configs/platal.conf'); - $this->read_ini_file($this->spoolroot.'/spool/conf/platal.dynamic.conf'); + if (file_exists($this->spoolroot.'/spool/conf/platal.dynamic.conf')) { + $this->read_ini_file($this->spoolroot.'/spool/conf/platal.dynamic.conf'); + } } /** Writes an ini file separated in categories @@ -121,7 +123,11 @@ class PlatalGlobals public function change_dynamic_config($conf, $category = 'Core') { $dynamicfile = $this->spoolroot.'/spool/conf/platal.dynamic.conf'; - $array = parse_ini_file($dynamicfile, true); + if (file_exists($dynamicfile)) { + $array = parse_ini_file($dynamicfile, true); + } else { + $array = null; + } if (!is_array($array)) { // dynamic conf is empty $array = array($category => $conf); diff --git a/include/xorg.inc.php b/include/xorg.inc.php index e0ca4bb..a5e8a32 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -23,6 +23,9 @@ require_once('platal.inc.php'); require_once('globals.inc.php'); require_once('xorg/session.inc.php'); $globals = new PlatalGlobals('XorgSession'); +if (!isset($globals->core->NbIns) || $globals->core->NbIns == 0) { + update_NbIns(); +} // {{{ class XorgPage