helpers.php
815 Bytes
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
<?php
/**
* Created by PhpStorm.
* User: Hanson
* Date: 2016/12/29
* Time: 0:10
*/
use Hanson\Robot\Core\Server;
use Hanson\Robot\Core\Myself;
use Hanson\Robot\Core\Http;
if (! function_exists('server')) {
/**
* Get the available container instance.
*
* @param array $config
* @return Server
*/
function server($config = [])
{
return Server::getInstance($config);
}
}
if (! function_exists('myself')) {
/**
* Get the available container instance.
*
* @return Myself
*/
function myself()
{
return Myself::getInstance();
}
}
if (! function_exists('http')) {
/**
* Get the available container instance.
*
* @return Http
*/
function http()
{
return Http::getInstance();
}
}