增加接口类 规范驱动扩展

This commit is contained in:
thinkphp
2016-05-05 07:39:05 +08:00
parent 3774e3451a
commit 7a8bb3b54f
33 changed files with 237 additions and 64 deletions

View File

@@ -13,7 +13,7 @@ namespace think\log\driver;
/**
* 本地化调试输出到文件
*/
class File
class File implements LogInterface
{
protected $config = [
'time_format' => ' c ',

View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
namespace think\log\driver;
interface LogInterface
{
/**
* 日志写入接口
* @access public
* @param array $log 日志信息
* @return bool
*/
public function save(array $log = []);
}

View File

@@ -13,7 +13,7 @@ namespace think\log\driver;
/**
* 调试输出到SAE
*/
class Sae
class Sae implements LogInterface
{
protected $config = [
'log_time_format' => ' c ',

View File

@@ -5,7 +5,7 @@
*/
namespace think\log\driver;
class Socket
class Socket implements LogInterface
{
public $port = 1116; //SocketLog 服务的http的端口号

View File

@@ -13,7 +13,7 @@ namespace think\log\driver;
/**
* 模拟测试输出
*/
class Test
class Test implements LogInterface
{
/**
* 日志写入接口

View File

@@ -16,7 +16,7 @@ use think\Debug;
/**
* 页面Trace调试
*/
class Trace
class Trace implements LogInterface
{
protected $config = [
'trace_file' => '',