Add sort_name to pluser.
[platal.git] / classes / plglobals.php
index 35369b4..3482155 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -103,12 +103,13 @@ class PlGlobals
     public $baseurl_http;
 
     /** paths */
+    public $coreroot;
     public $spoolroot;
 
     /** Localization configuration.
      */
-    public $locale;
-    public $timezone;
+    public $locale = 'fr_FR.UTF-8';
+    public $timezone = 'Europe/Paris';
 
     /** Cookie configuration.
      */
@@ -122,19 +123,23 @@ class PlGlobals
     public $static_cache_duration = 604800;
     public $dynamic_cache_duration = 3600;
 
-    /** You must give a list of file to load.
+    /** You should give a list of file to load if you don't want the default configuration.
      * The filenames given are relatives to the config path of your plat/al installation.
      */
-    public function __construct(array $files)
+    public function __construct(array $files = null)
     {
-        $this->spoolroot = dirname(dirname(dirname(__FILE__)));
+        $this->coreroot = dirname(dirname(__FILE__));
+        $this->spoolroot = dirname($this->coreroot);
 
-        $this->readConfig($files);
+        if (!is_null($files)) {
+            $this->readConfig($files);
+        }
         if (isset($_SERVER) && isset($_SERVER['SERVER_NAME'])) {
             $base = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
             $this->baseurl      = @trim($base    .$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');
             $this->baseurl_http = @trim('http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');
         }
+        assert_options(ASSERT_ACTIVE, $this->debug != 0);
 
         $this->setLocale();
     }
@@ -281,5 +286,5 @@ class PlGlobals
     }
 }
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>