- Fixes made mostly for PHP 8.5

This commit is contained in:
Dave M. 2026-07-14 15:45:38 +00:00
parent 0471c0ab83
commit 6d8763a22c
7 changed files with 16 additions and 22 deletions

View File

@ -26,7 +26,7 @@ return [
'ulmus' => [
'entities' => [
'Lean\\Console\\Entity\\Firewall' => implode(DIRECTORY_SEPARATOR, [ $path , "src", "Entity", "Firewall" ]),
Lean\Console\Entity\Firewall::class => implode(DIRECTORY_SEPARATOR, [ $path , "src", "Entity", "Firewall" ]),
],
],
@ -44,7 +44,7 @@ return [
],
'routes' => ! getenv('DEBUG') ? [] : [
'Lean\\Console\\Controller' => implode(DIRECTORY_SEPARATOR, [ $path, "src", "Controller", "" ]),
Lean\Console\Controller::class => implode(DIRECTORY_SEPARATOR, [ $path, "src", "Controller", "" ]),
],
],

View File

@ -2,7 +2,8 @@
"title" : "Debugging -- LEAN",
"page-title": "Déboguage",
"logs": {
"breadcrumb": "Journaux d'événements"
"breadcrumb": "Journaux d'événements",
"line": "Lines number: "
},
"phpinfo": {
"breadcrumb": "phpinfo()"

View File

@ -19,9 +19,9 @@ use Lean\Console\{Lib, };
#[color:gray, bg: black]║ ║[#]
#[color:gray, bg: black]╚═════════════════════════╝[#]
Try #[color:gray, bg: black]'lean console --help'[#] for more information.
Try #[color:gray, bg: black]'cli lean-console --help'[#] for more information.
CLI
, command: 'console')]
, command: 'lean-console')]
#[Option(switch: ['-h', '--help'], description: "Display help for the given command. When no command is given display help for the list command")]
#[Option(switch: ['-q', '--quiet'], description: "Do not output any message")]
#[Option(switch: ['-n', '--no-interaction'], description: "Run script without user interaction")]

View File

@ -20,9 +20,9 @@ use Lean\Console\{Lib, };
#[color:gray, bg: black]║ STORAGE ║[#]
#[color:gray, bg: black]╚═════════════════════════╝[#]
Try #[color:gray, bg: black]'lean console storage --help'[#] for more information.
Try #[color:gray, bg: black]'cli lean-console storage --help'[#] for more information.
CLI
, command: 'console storage')]
, command: 'lean-console storage')]
#[Option(switch: ['-h', '--help'], description: "Display help for the given command. When no command is given display help for the list command")]
#[Option(switch: ['-q', '--quiet'], description: "Do not output any message")]
#[Option(switch: ['-n', '--no-interaction'], description: "Run script without user interaction")]

View File

@ -2,12 +2,11 @@
namespace Lean\Console\Controller;
use League\Route\Router;
use Picea\{FileFetcher, Picea, Caching\Opcache, Extension\UrlExtension, Ui\Method\FormHandler};
use Picea\{Ui\Method\FormHandler};
use Lean\File;
use Psr\Http\Message\{ ResponseInterface, ServerRequestInterface };
use Lean\Console\{ Form, Lib };
use Notes\Tell\Attribute\Language, Notes\Route\Attribute\Method\Route;
use Notes\Route\Attribute\Method\Route;
class Debugging extends Console {
use Lib\ConsoleControllerTrait;
@ -17,7 +16,7 @@ class Debugging extends Console {
{
$list = [];
new FormHandler($request, new Form\Debugging\Logs(), $this->pushContext(new Lib\FormContext($request, "debugging.logs")));
# new FormHandler($request, new Form\Debugging\Logs(), $this->pushContext(new Lib\FormContext($request, "debugging.logs")));
$path = getenv('LOGS_PATH');
@ -25,9 +24,9 @@ class Debugging extends Console {
$default = basename(ini_get('error_log'));
$open = end($files);
$open = File::sanitizeFilePath($request->getQueryParams()['logfile'] ?? end($files));
$content = File::tail($path . DIRECTORY_SEPARATOR . $open, 100);
$content = File::tail($path . DIRECTORY_SEPARATOR . $open, $request->getQueryParams()['line'] ?? 100);
return $this->renderView("lean-console/page/debugging/logs", get_defined_vars());
}

View File

@ -24,18 +24,11 @@ trait ConsoleControllerTrait
#[Inject]
protected ContainerInterface $container;
#[Ignore]
public function __construct(? Picea\Picea $picea, Session $session, ContainerInterface $container) {
$this->picea = $picea;
$this->session = $session;
$this->container = $container;
}
#[Ignore]
public function version() : string
{
$version = iterator_to_array(
(new Form\Update\Git(getenv('PROJECT_PATH')))->run("/usr/bin/git describe --tags")
new Form\Update\Git(getenv('PROJECT_PATH'))->run("/usr/bin/git describe --tags")
);
# dump($version);

View File

@ -10,7 +10,8 @@
<h2>{{ $path }}</h2>
{% ui:form.get current_url() %}
{% ui:select 'logfile', array_combine($files, $files), get('file') ?? $open %}
<small>{% _ 'logs.line' %} {% ui:text 'line', get('line') ?? 100, [ 'onchange' => "this.closest('form').submit()" ] %}</small>
{% ui:select 'logfile', array_combine($files, $files), get('file') ?? $open, [ 'onchange' => "this.closest('form').submit()" ] %}
{% ui:endform %}
</header>