/
App.php
37 lines (30 loc) · 988 Bytes
/
App.php
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
<?php namespace houdunwang\framework;
/*--------------------------------------------------------------------------
| Software: [HDPHP framework]
| Site: www.hdphp.com
|--------------------------------------------------------------------------
| Author: 向军 <2300071698@qq.com>
| WeChat: houdunwangxj
| Copyright (c) 2012-2019, www.houdunwang.com. All Rights Reserved.
|-------------------------------------------------------------------------*/
use houdunwang\framework\build\Base;
class App
{
protected static $link;
public function __call($method, $params)
{
return call_user_func_array([self::single(), $method], $params);
}
//生成单例对象
public static function single()
{
if (!self::$link) {
self::$link = new Base();
}
return self::$link;
}
public static function __callStatic($name, $arguments)
{
return call_user_func_array([static::single(), $name], $arguments);
}
}