Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #1146

Merged
merged 2 commits into from
Feb 28, 2025
Merged

Dev #1146

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions resources/views/config.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
abort_if(Gate::denies('configure'), 403, '403 Forbidden');

// Activer l'affichage des erreurs pour le débogage
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// Fonction pour obtenir les informations PHP
function getPhpInfo() {
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();

$phpinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $phpinfo);
return $phpinfo;
}

// Fonction pour obtenir les informations sur les extensions chargées
function getLoadedExtensions() {
$extensions = get_loaded_extensions();
return implode(', ', $extensions);
}

// Fonction pour obtenir les informations sur Xdebug
function getXdebugInfo() {
if (function_exists('xdebug_info')) {
return xdebug_info();
} else {
return "Xdebug n'est pas installé ou activé.";
}
}

?>
<html>
<body>
<h1>Informations de Débogage du Serveur et de Laravel</h1>

<h2>Informations PHP</h2>
<div><?php echo getPhpInfo(); ?></div>

<h2>Extensions Chargées</h2>
<pre><?php echo getLoadedExtensions(); ?></pre>

<h2>Informations Xdebug</h2>
<pre><?php echo getXdebugInfo(); ?></pre>
</body>
</html>
56 changes: 56 additions & 0 deletions resources/views/test.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
@extends('layouts.test')
@section('content')
<div class="card">
<div class="card-body">

Fuseau horaire : {{ config('app.timezone') }}<br>
Langue : {{ config('app.locale') }}<br>

panel.date_format = {{ config('panel.date_format') }} <br>
panel.time_format = {{ config('panel.time_format') }}

<hr>


<?php
// Activer l'affichage des erreurs pour le débogage
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);


use Carbon\Carbon;

// Fonction pour tester le parsing de date
function testDateParsing($dateString) {
try {
$date = Carbon::parse($dateString);
echo "Date parsée avec succès : " . $date->toDateTimeString() . "<br>";
} catch (Exception $e) {
echo "Erreur lors du parsing de la date : " . $e->getMessage() . "<br>";
}
}

// Exemple de chaînes de date à tester
$dateStrings = [
'2023-10-05',
'05-10-2023',
'2023-10-05 14:30:00',
'date invalide',
];

foreach ($dateStrings as $dateString) {
echo "Test de la chaîne de date : " . htmlspecialchars($dateString) . "<br>";
testDateParsing($dateString);
echo "<hr>";
}

?>

</div>
</div>
@endsection

@section('scripts')
@parent
@endsection
6 changes: 6 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@
Route::get('doc/about', function () {
return view('doc/about');
});

// Configuration page
Route::get('config', function () {
return view('config');
});

});

// Profile
Expand Down