new kernel, ms bearer

This commit is contained in:
2024-10-23 16:16:47 +03:00
parent 5285acae12
commit 2470c5dba8
62 changed files with 892 additions and 105 deletions

View File

@ -0,0 +1,25 @@
<?php
namespace kernel\console\controllers;
use kernel\console\ConsoleController;
use kernel\services\TokenService;
use Random\RandomException;
class SecureController extends ConsoleController
{
/**
* @throws RandomException
*/
public function actionCreateSecretKey(): void
{
$envFile = \EnvEditor\EnvFile::loadFrom(ROOT_DIR . "/.env");
$envFile->setValue("SECRET_KEY", TokenService::random_bytes(15));
$envFile->saveTo(ROOT_DIR . "/.env");
$this->out->r("Secret key successfully created.", "green");
}
}