--- /dev/null
+platal.conf
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: xorg.globals.inc.php.in,v 1.3 2004-11-22 10:42:52 x2000habouzit Exp $
+ $Id: xorg.globals.inc.php.in,v 1.4 2004-11-22 21:40:47 x2000habouzit Exp $
***************************************************************************/
require_once("diogenes.core.globals.inc.php");
/** recherche */
var $public_max_search_results = 25;
var $search_results_per_page = 20;
+
+ function XorgGlobals() {
+ $ini = dirname(dirname(__FILE__)).'/configs/platal.conf';
+ $array = parse_ini_file($ini, true);
+ if (!is_array($array)) {
+ return;
+ }
+
+ foreach ($array as $cat=>$conf) {
+ $c = strtolower($cat);
+ foreach ($conf as $key=>$val) {
+ if ($c == 'global') {
+ global $$key;
+ $$key = $val;
+ } elseif ($c == 'core') {
+ $this->$key=$val;
+ } else {
+ $this->$c->$key = $val;
+ }
+ }
+ }
+
+ session_start();
+
+ $this->dbconnect();
+ if ($this->debug) {
+ $this->db->trace_on();
+ }
+ }
}
// }}}
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: xorg.inc.php,v 1.2 2004-11-22 20:05:10 x2000habouzit Exp $
+ $Id: xorg.inc.php,v 1.3 2004-11-22 21:40:47 x2000habouzit Exp $
***************************************************************************/
function microtime_float()
require_once("xorg/session.inc.php");
$globals = new XorgGlobals;
-require_once("xorg.config.inc.php");
// }}}
// {{{ Build Menu, TODO: move that into appropriates hooks
$globals->menu->addPublicEntry(XOM_INFOS, 20, 'FAQ', 'docs/faq.php');
// }}}
-// {{{ start session + database connection
-
-session_start();
-
-// connect to database
-$globals->dbconnect();
-if ($globals->debug) {
- $globals->db->trace_on();
-}
-
-//}}}
-
// {{{ function _new_page()
function _new_page($type, $tpl_name, $tpl_head, $min_auth, $admin=false)
--- /dev/null
+; {{{ [Core]
+
+[Core]
+
+debug = true
+dbuser = "***"
+dbpwd = "***"
+
+; base url of the site, WITHOUT LEADING /
+baseurl = "http://dev.m4x.org/~x2000habouzit";
+root = "/home/x2000habouzit/dev/public/";
+spoolroot = "/home/x2000habouzit/dev/public/";
+
+econfiance = "***";
+
+; }}}
+; {{{ [Global]
+
+[Global]
+
+news_server = "localhost"
+news_port = 119
+news_auth_pass = "***"
+news_web_user = "***"
+news_web_pass = "***"
+
+; }}}
+; vim:set syntax=dosini:
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************
- $Id: xorg.config.inc.php,v 1.1 2004-11-22 06:49:07 x2000habouzit Exp $
- ***************************************************************************/
-
-// {{{ BDD
-
-/** BDD overrides */
-#$globals->dbhost='djali.polytechnique.org';
-$globals->debug = true;
-$globals->dbuser = '***';
-$globals->dbpwd = '***';
-// }}}
-// {{{ Paths
-
-/* URL de la racine pour les mails contenant des URL (pas de slash final!) */
-$globals->baseurl = "http://dev.m4x.org/~x2000habouzit";
-$globals->root = "/home/x2000habouzit/dev/public/";
-$globals->spoolroot = "/home/x2000habouzit/dev/public/";
-
-// }}}
-// {{{ Extra
-
-# JPF
-$globals->econfiance = '***';
-
-/* les parametres pour se connecter au serveur NNTP */
-if (!isset($news_server)) $news_server="localhost";
-if (!isset($news_port)) $news_port=119;
-if (!isset($news_auth_pass)) $news_auth_pass="***";
-$news_web_user = '***';
-$news_web_pass = '***';
-
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>