Add project files
This commit is contained in:
51
00_vortrags-files/public/index.php
Normal file
51
00_vortrags-files/public/index.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user