Gateway.php
995 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace tinymeng\code\Connector;
use tinymeng\tools\Strings;
/**
* Class Name: Gateway
* @author Tinymeng <666@majiameng.com>
* @date: 2019/9/27 11:46
* @package tinymeng\code\Connector
*/
abstract class Gateway implements GatewayInterface
{
/**
* 配置参数
* @var array
*/
protected $config;
/**
* 是否开启debug
* @var bool
*/
protected $debug = false;
/**
* Gateway constructor.
* @param null $config
* @throws \Exception
*/
public function __construct($config = [])
{
//默认参数
$_config = [
'debug'=>false
];
$this->config = $config;
// $this->config = array_replace_recursive($_config,$config);
}
/**
* Function Name: 开启debug
* @param boolean $debug
* @author Tinymeng <666@majiameng.com>
* @date: 2019/9/26 10:44
*/
public function setDebug($debug){
$this->debug = $debug;
}
}