コード例 #1
0
 /**
  * Get the component controller.
  *
  * @param string $componentName The name of the component.
  * @return Component The component object if found. NULL if not found.
  */
 public static function getComponent($componentName)
 {
     $component = null;
     $componentClass = ucfirst($componentName) . "_Component";
     $componentPath = DKY_PATH_COM . "/" . $componentName . "/" . ucfirst($componentName) . ".php";
     if (file_exists($componentPath) && (include_once $componentPath)) {
         $component = new $componentClass();
     } else {
         DKY_Log::e("Component not found.");
     }
     return $component;
 }
コード例 #2
0
 public static function run()
 {
     // TODO: Filters.. exceptions..?
     if ($_SERVER["REQUEST_URI"] == "/favicon.ico") {
         DKY_HTTP::redirect("/www/favicon.ico");
     }
     DKY_Config::initialize();
     DKY_DB::initialize(array("host" => DKY_Config::get("db_host"), "database" => DKY_Config::get("db_database"), "username" => DKY_Config::get("db_username"), "password" => DKY_Config::get("db_password")));
     DKY_Log::initialize(array("path" => DKY_Config::get("log_path")));
     DKY_Log::i("REQUEST: " . $_SERVER["REQUEST_URI"]);
     DKY_SessionHandler::startSession();
     DKY_SessionHandler::cachePermissions();
     //$strLogTail = "<div style='font:10px sans-serif;height:100px;overflow:auto;'>" . implode("<br />", DKY_Log::tail(20)) . "</div>";
     //DKY_Output::raiseMessage($strLogTail, DKY_MSG_INFO);
     DKY_RequestHandler::process();
 }
コード例 #3
0
ファイル: Log.php プロジェクト: nicholas-robson/php-webapp
 public static function _errorHandler($errno, $errstr, $errfile, $errline, $errcontext)
 {
     DKY_Log::l($errfile . " " . $errstr . " (line " . $errline . ")", DKY_LOG_ERROR);
 }