改名
This commit is contained in:
@@ -10,40 +10,4 @@ use Swoole\Coroutine;
|
|||||||
abstract class BaseContext
|
abstract class BaseContext
|
||||||
{
|
{
|
||||||
protected static $pool = [];
|
protected static $pool = [];
|
||||||
|
|
||||||
static function get($key)
|
|
||||||
{
|
|
||||||
$cid = Coroutine::getuid();
|
|
||||||
if ($cid < 0)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if(isset(self::$pool[$cid][$key])){
|
|
||||||
return self::$pool[$cid][$key];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function put($key, $item)
|
|
||||||
{
|
|
||||||
$cid = Coroutine::getuid();
|
|
||||||
if ($cid > 0)
|
|
||||||
{
|
|
||||||
self::$pool[$cid][$key] = $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static function delete($key = null)
|
|
||||||
{
|
|
||||||
$cid = Coroutine::getuid();
|
|
||||||
if ($cid > 0)
|
|
||||||
{
|
|
||||||
if($key){
|
|
||||||
unset(self::$pool[$cid][$key]);
|
|
||||||
}else{
|
|
||||||
unset(self::$pool[$cid]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Dispatch
|
|||||||
} else {
|
} else {
|
||||||
$controller = $this->handler;
|
$controller = $this->handler;
|
||||||
}
|
}
|
||||||
$controller->request = Context::get('request');
|
$controller->request = Context::getContext('request');
|
||||||
$controller->headers = $controller->request->headers;
|
$controller->headers = $controller->request->headers;
|
||||||
$controller->input = $controller->request->params;
|
$controller->input = $controller->request->params;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user