- Added a new phpinfo menu item:

This commit is contained in:
Dave M. 2023-10-31 16:12:26 +00:00
parent 64b9a779de
commit e898c6a23e
8 changed files with 60 additions and 23 deletions

View File

@ -0,0 +1,10 @@
{
"title" : "Debugging -- LEAN",
"page-title": "Debugging",
"logs": {
"breadcrumb": "Logs"
},
"phpinfo": {
"breadcrumb": "phpinfo()"
}
}

View File

@ -21,6 +21,13 @@
"label": "Caching"
},
"debugging": {
"label": "Debugging",
"logs": "Logs",
"phpinfo": "PhpInfo"
},
"request": {
"label": "Request",
"routes": "Routes"

View File

@ -2,6 +2,9 @@
"title" : "Debugging -- LEAN",
"page-title": "Déboguage",
"logs": {
"breadcrumb": "Logs"
"breadcrumb": "Journaux d'événements"
},
"phpinfo": {
"breadcrumb": "phpinfo()"
}
}

View File

@ -22,7 +22,8 @@
"debugging": {
"label": "Déboguage",
"logs": "Logs"
"logs": "Journaux d'événements",
"phpinfo": "PhpInfo"
},
"request": {

View File

@ -31,4 +31,15 @@ class Debugging extends Console {
return $this->renderView("lean-console/page/debugging/logs", get_defined_vars());
}
#[Route(route: "/debugging/phpinfo", name: "lean.console:debugging-phpinfo")]
public function phpinfo(ServerRequestInterface $request, array $arguments) : ResponseInterface
{
ob_start() ;
phpinfo() ;
$phpinfo = ob_get_contents() ;
ob_end_clean() ;
return $this->renderView("lean-console/page/debugging/phpinfo", get_defined_vars());
}
}

View File

@ -1,20 +0,0 @@
<?php
namespace Lean\Console\Controller;
use Psr\Http\Message\{ ResponseInterface, ServerRequestInterface };
use Notes\Tell\Attribute\Language, Notes\Route\Attribute\Method\Route;
use \Lean\Console\Lib;
class Dev {
use Lib\ConsoleControllerTrait;
#[Route(route: "/phpinfo", name: "lean.dev:phpinfo")]
public function home(ServerRequestInterface $request, array $arguments) : ResponseInterface
{
phpinfo();
die();
}
}

View File

@ -33,4 +33,7 @@
<ul>
<li><a href="{% route 'lean.console:debugging-logs' %}">{% lang "lean.nav.debugging.logs" %}</a></li>
</ul>
<ul>
<li><a href="{% route 'lean.console:debugging-phpinfo' %}">{% lang "lean.nav.debugging.phpinfo" %}</a></li>
</ul>
</nav>

View File

@ -0,0 +1,22 @@
{% extends "lean-console/base/layout" %}
{% language.set "lean.debugging" %}
{% title _("title") %}
{% section "header" %}
<div class="page-title">{% _ "page-title" %}</div>
{% endsection %}
{% section "breadcrumb-items" %}
<li class="breadcrumb-item">{% _ 'phpinfo.breadcrumb' %}</li>
{% endsection %}
{% section "content" %}
<section>
<iframe src="data:text/html;base64,{{ base64_encode($phpinfo) }}" style="width:100%; height: calc(100vh - 112px - 8vh)">
</iframe>
</section>
{% endsection %}