示例#1
0
文件: RudraX.php 项目: rudraks/boot
 public static function invoke($_conf = array())
 {
     try {
         Browser::time("invoked");
         $global_config = array_merge(array('CONTROLLER' => 'web.php', 'DEFAULT_DB' => 'DB1', 'CONSOLE_FUN' => 'console.log', 'RX_MODE_DEBUG' => FALSE, 'PROJECT_ROOT_DIR' => "./"), $_conf);
         // Loads all the Constants
         define('PROJECT_ROOT_DIR', $global_config['PROJECT_ROOT_DIR']);
         define('PROJECT_ID', md5(PROJECT_ROOT_DIR . $global_config['CONTROLLER']));
         FileUtil::$PROJECT_ROOT_DIR = PROJECT_ROOT_DIR;
         include_once 'constants.php';
         ob_start();
         session_start();
         Config::load(PROJECT_ROOT_DIR . "app/meta/project.properties", PROJECT_ROOT_DIR . "config/project.properties", $global_config);
         // Initialze Rudrax
         self::init();
         Browser::time("After Init");
         $config = Config::getSection("GLOBAL");
         $db_connect = false;
         Browser::time("Before DB Connect");
         /**
          * NOTE:- NO need to connect DB automatically, it should be connecte donly when required;
          */
         // if (isset ( $config ["DEFAULT_DB"] )) {
         // $RDb = self::getDB ( $config ["DEFAULT_DB"] );
         // $db_connect = true;
         // }
         Browser::time("Before-First Reload");
         // Define Custom Request Plugs
         if (FIRST_RELOAD) {
             ClassUtil::scan();
         }
         self::findAndExecuteController();
         self::invokeController();
         return null;
         Browser::time("Before Saving");
         Config::save();
         Browser::time("Invoked:Ends");
     } catch (Exception $e) {
         print_line($e->getMessage());
         print_line($e->getTraceAsString());
     }
 }
示例#2
0
文件: RudraX.php 项目: rudraks/core
 public static function invoke($_conf = array())
 {
     Browser::time("invoked");
     $global_config = array_merge(array('CONTROLLER' => 'web.php', 'DEFAULT_DB' => 'DB1', 'CONSOLE_FUN' => 'console.log', 'RX_MODE_DEBUG' => FALSE, 'PROJECT_ROOT_DIR' => "../"), $_conf);
     // Loads all the Constants
     define('PROJECT_ROOT_DIR', $global_config['PROJECT_ROOT_DIR']);
     define('PROJECT_ID', md5(PROJECT_ROOT_DIR . $global_config['CONTROLLER']));
     FileUtil::$PROJECT_ROOT_DIR = PROJECT_ROOT_DIR;
     include_once 'constants.php';
     ob_start();
     session_start();
     Config::load(PROJECT_ROOT_DIR . "app/meta/project.properties", PROJECT_ROOT_DIR . "config/project.properties", $global_config);
     // Initialze Rudrax
     self::init();
     Browser::time("After Init");
     $config = Config::getSection("GLOBAL");
     $db_connect = false;
     Browser::time("Before DB Connect");
     /**
      * NOTE:- NO need to connect DB automatically, it should be connecte donly when required;
      */
     // if (isset ( $config ["DEFAULT_DB"] )) {
     // $RDb = self::getDB ( $config ["DEFAULT_DB"] );
     // $db_connect = true;
     // }
     Browser::time("Before-First Reload");
     // Define Custom Request Plugs
     if (FIRST_RELOAD) {
         ClassUtil::scan();
     }
     self::findAndExecuteController();
     self::invokeController();
     DBService::close();
     Browser::time("Before Saving");
     Config::save();
     Browser::time("After Saving");
     $clientConfig = Config::get("CLIENT_CONST");
     /*
      * $RX_ENCRYPT_PATH is applicable only if either MINFY or MERGE, this variable ise used by .htaccess file
      */
     $RX_ENCRYPT_PATH = !RX_MODE_DEBUG && ($clientConfig["RX_JS_MIN"] || $clientConfig["RX_JS_MERGE"]);
     Browser::header(RX_MODE_DEBUG . "." . $clientConfig["RX_JS_MIN"] . "." . $clientConfig["RX_JS_MERGE"]);
     if ($RX_ENCRYPT_PATH) {
         setcookie('RX-ENCRYPT-PATH', "TRUE", 0, "/");
         define("RX_ENCRYPT_PATH", true);
     } else {
         removecookie('RX-ENCRYPT-PATH');
         define("RX_ENCRYPT_PATH", false);
     }
     Browser::time("Invoked:Ends");
 }