make xorg.globals.inc.php be platal/globals.inc.php ===> run make again !
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Sun, 17 Apr 2005 15:26:12 +0000 (15:26 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:32 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-547

Makefile
include/.arch-inventory [deleted file]
include/platal/.arch-inventory [new file with mode: 0644]
include/platal/globals.inc.php.in [moved from include/xorg.globals.inc.php.in with 69% similarity]
include/xorg.inc.php
include/xorg/globals.inc.php [new file with mode: 0644]

index 1248fd6..f618347 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ dist: clean pkg-dist
 bzdist: clean pkg-bzdist
 
 clean:
-       rm -rf locale include/xorg.globals.inc.php
+       rm -rf include/platal/globals.inc.php
        rm -f htdocs/banana/banana.css htdocs/valid.html include/banana htdocs/banana/img htdocs/banana/xface.php
 
 %: %.in Makefile
@@ -43,7 +43,7 @@ devel: build templates_c htdocs/valid.html
 ################################################################################
 # diogenes package targets
 
-pkg-build: include/xorg.globals.inc.php
+pkg-build: include/platal/globals.inc.php
 
 $(PKG_DIST): pkg-build
        mkdir $(PKG_DIST)
diff --git a/include/.arch-inventory b/include/.arch-inventory
deleted file mode 100644 (file)
index a69f64c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-precious ^(xorg.globals.inc.php)$
diff --git a/include/platal/.arch-inventory b/include/platal/.arch-inventory
new file mode 100644 (file)
index 0000000..cbd87cd
--- /dev/null
@@ -0,0 +1 @@
+precious ^(globals.inc.php)$
similarity index 69%
rename from include/xorg.globals.inc.php.in
rename to include/platal/globals.inc.php.in
index cde232b..2d17fd0 100644 (file)
@@ -35,10 +35,10 @@ class CoreConfig
 
 // {{{ class XorgGlobals
 
-class XorgGlobals extends DiogenesCoreGlobals
+class PlatalGlobals extends DiogenesCoreGlobals
 {
     var $page    = 'XorgPage';
-    var $session = 'XorgSession';
+    var $session;
     var $menu;
     var $hook;
 
@@ -66,43 +66,9 @@ class XorgGlobals extends DiogenesCoreGlobals
     var $spoolroot = '/var/spool/xorg';
     var $root      = null;
 
-    function init()
+    function PlatalGlobals($sess)
     {
-        global $globals;
-        require_once('xorg/hook.inc.php');
-        require_once('xorg/menu.inc.php');
-
-        $globals       = new XorgGlobals;
-        $globals->core = new CoreConfig;
-        $globals->root = dirname(dirname(__FILE__));
-        $globals->hook = new XOrgHook();
-        $globals->menu = new XOrgMenu();
-
-        $globals->hook->config(null);
-
-        $array = parse_ini_file($globals->root.'/configs/platal.conf', true);
-        if (!is_array($array)) {
-            return;
-        }
-
-        foreach ($array as $cat=>$conf) {
-            $c = strtolower($cat);
-            foreach ($conf as $key=>$val) {
-                if ($c == 'core' && isset($globals->$key)) {
-                    $globals->$key=$val;
-                } else {
-                    $globals->$c->$key = $val;
-                }
-            }
-        }
-        
-        $globals->hook->menu(null);
-
-        $globals->dbconnect();
-        if ($globals->debug & 1) {
-            $globals->db->trace_on();
-        }
-        $globals->xdb =& new XOrgDB;
+        $this->session = $sess;
     }
 }
 
index 6375c82..c4a1d36 100644 (file)
@@ -20,7 +20,7 @@
  ***************************************************************************/
 
 require_once('platal.inc.php');
-require_once('xorg.globals.inc.php');
+require_once('xorg/globals.inc.php');
 require_once('xorg/session.inc.php');
 XorgGlobals::init();
 XorgSession::init();
diff --git a/include/xorg/globals.inc.php b/include/xorg/globals.inc.php
new file mode 100644 (file)
index 0000000..322b8ef
--- /dev/null
@@ -0,0 +1,76 @@
+<?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                *
+ ***************************************************************************/
+
+require_once('platal/globals.inc.php');
+
+// {{{ class XorgGlobals
+
+class XorgGlobals extends PlatalGlobals
+{
+    function XorgGlobals()
+    {
+        $this->PlatalGlobals('XorgSession');
+    }
+
+    function init()
+    {
+        global $globals;
+        require_once('xorg/hook.inc.php');
+        require_once('xorg/menu.inc.php');
+
+        $globals       = new XorgGlobals;
+        $globals->core = new CoreConfig;
+        $globals->root = dirname(dirname(dirname(__FILE__)));
+        $globals->hook = new XOrgHook();
+        $globals->menu = new XOrgMenu();
+
+        $globals->hook->config(null);
+
+        $array = parse_ini_file($globals->root.'/configs/platal.conf', true);
+        if (!is_array($array)) {
+            return;
+        }
+
+        foreach ($array as $cat=>$conf) {
+            $c = strtolower($cat);
+            foreach ($conf as $key=>$val) {
+                if ($c == 'core' && isset($globals->$key)) {
+                    $globals->$key=$val;
+                } else {
+                    $globals->$c->$key = $val;
+                }
+            }
+        }
+        
+        $globals->hook->menu(null);
+
+        $globals->dbconnect();
+        if ($globals->debug & 1) {
+            $globals->db->trace_on();
+        }
+        $globals->xdb =& new XOrgDB;
+    }
+}
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>