This commit is contained in:
thinkphp
2016-08-03 12:25:09 +08:00
parent b385c999ef
commit 246cfd59f3

View File

@@ -13,7 +13,6 @@ namespace think\console\command\optimize;
use think\console\command\Command; use think\console\command\Command;
use think\console\Input; use think\console\Input;
use think\console\Output; use think\console\Output;
use think\Route;
class Route extends Command class Route extends Command
{ {
@@ -37,8 +36,8 @@ class Route extends Command
protected function buildRouteCache() protected function buildRouteCache()
{ {
$config = include CONF_PATH . 'route' . CONF_EXT; $config = include CONF_PATH . 'route' . CONF_EXT;
Route::import($config); \think\Route::import($config);
$rules = Route::rules(true); $rules = \think\Route::rules(true);
array_walk_recursive($rules, [$this, 'buildClosure']); array_walk_recursive($rules, [$this, 'buildClosure']);
$content = '<?php ' . PHP_EOL . 'return '; $content = '<?php ' . PHP_EOL . 'return ';
$content .= var_export($rules, true) . ';'; $content .= var_export($rules, true) . ';';