allow non-modular projects to use custom Config.php
authorAlan Knowles <alan@roojs.com>
Mon, 25 Jan 2021 06:17:38 +0000 (14:17 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 25 Jan 2021 06:17:38 +0000 (14:17 +0800)
Benchmark/Timer.php
HTML/FlexyFramework.php

index 3d7d053..bcf7562 100644 (file)
@@ -96,7 +96,7 @@ class Benchmark_Timer extends PEAR
      *
      * @access public
      */
-    function Benchmark_Timer($auto = false) 
+    function __construct($auto = false) 
     {
         $this->auto = $auto;
 
index c1a23e4..c02aba9 100755 (executable)
@@ -208,20 +208,21 @@ RewriteRule ^(.+)$ /web.hpasite/index.local.php [L,NC,E=URL:$1]
      */
     function loadModuleConfig($cfg)
     {
-        if (empty($cfg['enable'])) {
-            return $cfg;
-        }
+         
         $proj = $cfg['project'];
         $rootDir = realpath(dirname($_SERVER["SCRIPT_FILENAME"]));
+        
         $cls = $proj.'_Config';
-        if (file_exists($rootDir . '/'.str_replace('_','/', $cls). '.php')) {
+         if (file_exists($rootDir . '/'.str_replace('_','/', $cls). '.php')) {
             require_once str_replace('_','/', $cls). '.php';
             $c = new $cls();
             if (method_exists($c,'init')) {
                 $cfg = $c->init($this,$cfg);
             }
         }
-        
+        if (empty($cfg['enable'])) {
+            return $cfg;
+        }
         foreach(explode(',',$cfg['enable']) as $m) {
             $cls = $proj.'_'. $m . '_Config';