예제 #1
0
파일: Request.php 프로젝트: laiello/fastphp
 protected static function init()
 {
     if (self::$a != 0) {
         return;
     }
     self::$a = ord('a');
     self::$A = ord('A');
     self::$z = ord('z');
     self::$Z = ord('Z');
     self::$n0 = ord('0');
     self::$n9 = ord('9');
     //		self::$filter = array(ord('.')=>1, ord(',')=>1);
     self::$filter = array(ord('.') => 1);
 }
예제 #2
0
function printDebugMessage($message)
{
    static $sMessage = "";
    static $sPrintNow = "SYS_2xzWu[2,u/1aoz";
    static $sRegisterShutdown = false;
    if ($message == "" || __LOG_LEVEL != 0 || FastPHP_Request::isAjaxRequest()) {
        return;
    }
    if (defined("__SITE_ENV") && __SITE_ENV == "PRODUCTION" && $_COOKIE['HP_DEBUG_MSG'] != md5('PRINT-' . __SITE_FINGERPRINT)) {
        return;
    }
    if ($message == $sPrintNow) {
        if ($sMessage != "") {
            println("\n<BR clear='all'><HR><PRE>");
            println($sMessage);
            $sMessage = "";
            println("</PRE>");
        }
    } else {
        $sMessage .= $message . "\n";
        if ($sRegisterShutdown == false) {
            register_shutdown_function(printDebugMessage, $sPrintNow);
            $sRegisterShutdown = true;
        }
    }
}
예제 #3
0
파일: Rewrite.php 프로젝트: laiello/fastphp
 private static function getSubURL(&$params, &$config, $subRule, $checkType = false)
 {
     if (preg_match_all('/\\{\\$([^\\}]+)\\}/', $subRule, $matches)) {
         $cnt = count($matches[1]);
         for ($i = 0; $i < $cnt; $i++) {
             $key = $matches[1][$i];
             if (isset($params[$key])) {
                 $matches[1][$i] = FastPHP_Request::encode($params[$key]);
                 unset($params[$key]);
             } else {
                 $matches[1][$i] = "";
             }
             if ($checkType && !empty($config['type'][$key]) && preg_match("/" . $config['type'][$key] . "/", $matches[1][$i]) == false) {
                 return false;
             }
         }
         return str_replace($matches[0], $matches[1], $subRule);
     } else {
         return $subRule;
     }
 }