This commit is contained in:
2020-08-31 01:27:08 +08:00
parent d6d4027b0d
commit e4f01d9499
119 changed files with 12232 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
<?php
namespace HttpServer\Route;
use Exception;
use HttpServer\Application;
/**
* Class TcpListen
* @package BeReborn\Route
*/
class Handler extends Application
{
/** @var Router */
protected $router;
/**
* Listen constructor.
* @throws Exception
*/
public function __construct()
{
$this->router = \BeReborn::$app->getRouter();
parent::__construct([]);
}
/**
* @param $config
* @param $handler
*/
public function group($config, $handler)
{
$this->router->group($config, $handler, $this);
}
/**
* @param $route
* @param $handler
* @return Handler
*/
public function handler($route, $handler)
{
return $this->router->addRoute($route, $handler, 'receive');
}
}