Skip to content

Commit

Permalink
Fix command route:list error
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Jan 10, 2022
1 parent c0f3407 commit c35ecec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.2",
"workerman/webman-framework": "^1.2.1",
"monolog/monolog": "^2.0"
},
"suggest": {
Expand Down
9 changes: 0 additions & 9 deletions start.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,7 @@
$worker->onWorkerStart = function ($worker) {
require_once base_path() . '/support/bootstrap.php';
$app = new App($worker, Container::instance(), Log::channel('default'), app_path(), public_path());
Route::load(config_path());
Middleware::load(config('middleware', []));
foreach (config('plugin', []) as $firm => $projects) {
foreach ($projects as $name => $project) {
Middleware::load($project['middleware'] ?? []);
}
}
Middleware::load(['__static__' => config('static.middleware', [])]);
Http::requestClass(Request::class);

$worker->onMessage = [$app, 'onMessage'];
};

Expand Down
17 changes: 17 additions & 0 deletions support/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
*/

use Dotenv\Dotenv;
use support\Container;
use Webman\Config;
use Webman\Route;
use Webman\Middleware;

$worker = $worker ?? null;

Expand Down Expand Up @@ -49,6 +52,19 @@
include_once $file;
}

$container = Container::instance();
Route::container($container);
Middleware::container($container);

Route::load(config_path());
Middleware::load(config('middleware', []));
foreach (config('plugin', []) as $firm => $projects) {
foreach ($projects as $name => $project) {
Middleware::load($project['middleware'] ?? []);
}
}
Middleware::load(['__static__' => config('static.middleware', [])]);

foreach (config('bootstrap', []) as $class_name) {
/** @var \Webman\Bootstrap $class_name */
$class_name::start($worker);
Expand All @@ -62,3 +78,4 @@
}
}
}

0 comments on commit c35ecec

Please sign in to comment.