Esempio n. 1
0
 public static function VHandleShutdown()
 {
     static $s_aFatalErrors = array(E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR);
     $error = error_get_last();
     if (null !== $error && in_array($error['type'], $s_aFatalErrors)) {
         Ko_Web_Event::Trigger('ko.error', 'error', $error['type'], $error['message'], $error['file'], $error['line'], array());
         Ko_Web_Event::Trigger('ko.error', '500', $error['type'], $error['message'], $error['file'], $error['line'], array());
     }
     Ko_Web_Event::Trigger('ko.error', 'shutdown');
 }
Esempio n. 2
0
<?php

/**
 * Bootstrap
 *
 * @package ko/Web
 * @author zhangchu
 */
if (!defined('KO_WEB_BOOTSTRAP')) {
    define('KO_WEB_BOOTSTRAP', 1);
    Ko_Tool_Xhprof::VStart();
    Ko_Web_Event::Trigger('ko.bootstrap', 'before');
    Ko_Web_Config::VLoad();
    Ko_Web_Event::Trigger('ko.config', 'after');
    Ko_Web_Error::VHandle();
    Ko_Web_Rewrite::VHandle();
    Ko_Web_Event::Trigger('ko.dispatch', 'before');
    if (Ko_Web_Route::IDispatch($phpFilename)) {
        Ko_Web_Event::Trigger('ko.dispatch', '404');
    } else {
        if ('' !== $phpFilename) {
            $cwd = getcwd();
            chdir(dirname($phpFilename));
            require_once $phpFilename;
            chdir($cwd);
        }
    }
}
Esempio n. 3
0
File: DB.php Progetto: AllenLyu/ko
 private function _iDelete($vHintId, $aKey, $oOption, $bNoCache)
 {
     $oOption = $this->_vBuildOption($oOption, $vHintId, $aKey);
     $iRet = $this->_oGetSqlAgent()->iDelete($this->_sTable, $this->_iGetHintId($vHintId), $oOption);
     if (0 != $iRet && !$bNoCache) {
         $this->_vDelCache($vHintId, $aKey);
         $aKey[$this->_sSplitField] = $vHintId;
         $indexData = $this->aGetIndexValue($aKey);
         Ko_Web_Event::Trigger('ko.db', 'delete', $this->_sTable, $indexData);
     }
     return $iRet;
 }