52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
|
|
<?php
|
||
|
|
require __DIR__ . '/../vendor/autoload.php';
|
||
|
|
|
||
|
|
use App\HelloWorld;
|
||
|
|
use Monolog\Logger;
|
||
|
|
use Monolog\Handler\StreamHandler;
|
||
|
|
|
||
|
|
// Logger initialisieren
|
||
|
|
$log = new Logger('app');
|
||
|
|
$log->pushHandler(new StreamHandler('php://stdout', Logger::INFO));
|
||
|
|
|
||
|
|
$log->info('Anwendung gestartet');
|
||
|
|
|
||
|
|
// HelloWorld-Klasse verwenden
|
||
|
|
$hello = new HelloWorld();
|
||
|
|
$message = $hello->getMessage();
|
||
|
|
|
||
|
|
?>
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title>Docker PHP Demo</title>
|
||
|
|
<style>
|
||
|
|
body { font-family: Arial, sans-serif; margin: 40px; line-height: 1.6; }
|
||
|
|
.container { max-width: 800px; margin: 0 auto; }
|
||
|
|
.status { padding: 10px; margin: 10px 0; border-radius: 4px; }
|
||
|
|
.success { background-color: #d4edda; color: #155724; }
|
||
|
|
.error { background-color: #f8d7da; color: #721c24; }
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="container">
|
||
|
|
<h1>PHP Docker Demo</h1>
|
||
|
|
<p>Dies ist eine einfache PHP-Anwendung für Docker-Demo.</p>
|
||
|
|
|
||
|
|
<h2>Status</h2>
|
||
|
|
<div class="status success">
|
||
|
|
<p><?php echo $message; ?></p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<h2>PHP Info</h2>
|
||
|
|
<p>PHP Version: <?php echo phpversion(); ?></p>
|
||
|
|
<p>Loaded Extensions:</p>
|
||
|
|
<ul>
|
||
|
|
<?php foreach(get_loaded_extensions() as $ext): ?>
|
||
|
|
<li><?php echo $ext; ?></li>
|
||
|
|
<?php endforeach; ?>
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|