完善SAE模式

This commit is contained in:
upfy@qq.com
2015-12-25 23:18:52 +08:00
parent 736a451a44
commit 589f4c5353
2 changed files with 47 additions and 16 deletions

View File

@@ -60,7 +60,10 @@ class Sae
$logstr = "[{$now}] {$_SERVER['SERVER_ADDR']} {$_SERVER['REMOTE_ADDR']} {$_SERVER['REQUEST_URI']}\r\n{$info}\r\n";
if (is_null($is_debug)) {
preg_replace('@(\w+)\=([^;]*)@e', '$appSettings[\'\\1\']="\\2";', $_SERVER['HTTP_APPCOOKIE']);
$appSettings=[];
preg_replace_callback('@(\w+)\=([^;]*)@', function($match)use(&$appSettings){
$appSettings[$match['1']]=$match['2'];
}, $_SERVER['HTTP_APPCOOKIE']);
$is_debug = in_array($_SERVER['HTTP_APPVERSION'], explode(',', $appSettings['debug'])) ? true : false;
}
if ($is_debug) {