kernel update

This commit is contained in:
2024-12-18 12:46:57 +03:00
parent 653e0bc983
commit 4ff9fa9ad3
56 changed files with 1023 additions and 84 deletions

View File

@ -2,7 +2,9 @@
namespace kernel\console\controllers;
use kernel\App;
use kernel\console\ConsoleController;
use kernel\helpers\Debug;
class MainController extends ConsoleController
{
@ -12,4 +14,25 @@ class MainController extends ConsoleController
$this->out->r("Привет", "green");
}
public function actionHelp(): void
{
$routs = App::$collector->getData()->getStaticRoutes();
foreach ($routs as $rout => $data){
$additionalInfo = $data['GET'][3];
if (isset($additionalInfo['description']) and $additionalInfo['type'] === "console"){
$this->out->inLine($rout . " - ", "green");
$this->out->inLine($additionalInfo['description'], 'yellow');
$this->out->r("");
if (isset($additionalInfo['params'])){
foreach ($additionalInfo['params'] as $key => $param){
$this->out->inLine($key . " - ", "green");
$this->out->inLine($param, 'yellow');
$this->out->r("");
}
}
$this->out->r("");
}
}
}
}