修正一些存在的警告错误

This commit is contained in:
thinkphp
2016-02-02 15:15:44 +08:00
parent 78718c7739
commit 8ec6835dca
12 changed files with 30 additions and 22 deletions

View File

@@ -20,7 +20,7 @@ class Sae
];
// 实例化并传入参数
public function __construct($config = [])
public function __construct(array $config = [])
{
$this->config = array_merge($this->config, $config);
}
@@ -31,7 +31,7 @@ class Sae
* @param array $log 日志信息
* @return void
*/
public function save($log = [])
public function save(array $log = [])
{
static $is_debug = null;
$now = date($this->config['log_time_format']);
@@ -60,9 +60,9 @@ class Sae
$logstr = "[{$now}] {$_SERVER['SERVER_ADDR']} {$_SERVER['REMOTE_ADDR']} {$_SERVER['REQUEST_URI']}\r\n{$info}\r\n";
if (is_null($is_debug)) {
$appSettings=[];
preg_replace_callback('@(\w+)\=([^;]*)@', function($match)use(&$appSettings){
$appSettings[$match['1']]=$match['2'];
$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;
}