Vendor lock

This commit is contained in:
2023-06-16 02:08:47 +00:00
parent 7933e70e90
commit 3351b92dd6
4099 changed files with 345789 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?php
require dirname(__DIR__).'/vendor/autoload.php';
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use Zeuxisoo\Whoops\Slim\WhoopsMiddleware;
// Instance
$app = AppFactory::create();
// Middleware
$app->add(new WhoopsMiddleware());
// Route parser
$routeParser = $app->getRouteCollector()->getRouteParser();
// Routes
$app->get('/', function (Request $request, Response $response, $args) use ($routeParser) {
$response->getBody()->write(file_get_contents('template/index.php'));
return $response;
});
$app->get('/url-path-not-exists', function(Request $request, Response $response, $args) use ($routeParser) {
return $routeParser->urlFor('hello');
});
// Run
$app->run();

View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Slim Whoops Examples</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<style type="text/css">
.part {
margin-top: 20px;
margin-bottom: 30px;
}
</style>
<body>
<div class="container">
<h3>Examples</h3>
<hr>
<div class="part">
<h5>Usage</h5>
<table class="table table-striped">
<thead>
<tr>
<th width="30%">File / Path</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/url-path-not-exists">/url-path-not-exists</a>
</td>
<td>Basic middleware usage</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>