改名
This commit is contained in:
@@ -18,6 +18,9 @@ use Snowflake\Exception\ConfigException;
|
|||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
use Swoole\Coroutine;
|
use Swoole\Coroutine;
|
||||||
|
|
||||||
|
defined('ROUTER_TREE') or define('ROUTER_TREE', 1);
|
||||||
|
defined('ROUTER_HASH') or define('ROUTER_HASH', 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Router
|
* Class Router
|
||||||
* @package Snowflake\Snowflake\Route
|
* @package Snowflake\Snowflake\Route
|
||||||
@@ -68,7 +71,7 @@ class Router extends Application implements RouterInterface
|
|||||||
if (!isset($this->nodes[$method])) {
|
if (!isset($this->nodes[$method])) {
|
||||||
$this->nodes[$method] = [];
|
$this->nodes[$method] = [];
|
||||||
}
|
}
|
||||||
if ($this->useTree) {
|
if (Config::get('router') == ROUTER_TREE) {
|
||||||
return $this->tree($path, $handler, $method);
|
return $this->tree($path, $handler, $method);
|
||||||
} else {
|
} else {
|
||||||
return $this->hash($path, $handler, $method);
|
return $this->hash($path, $handler, $method);
|
||||||
|
|||||||
Reference in New Issue
Block a user