Rôles, tableau de bord et tests unitaires
This commit is contained in:
parent
f508a2fcb5
commit
1799035236
51 changed files with 4350 additions and 0 deletions
62
public/.htaccess
Normal file
62
public/.htaccess
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# For a symfony application to work properly, you MUST store this .htaccess in
|
||||
# the same directory as your front controller, index.php, in a standard symfony
|
||||
# web application is under the "public" project subdirectory.
|
||||
|
||||
# Use the front controller as index file.
|
||||
DirectoryIndex index.php
|
||||
|
||||
# Uncomment the following line if you install assets as symlinks or if you
|
||||
# experience problems related to symlinks when compiling LESS/Sass/CoffeScript.
|
||||
# Options +FollowSymlinks
|
||||
|
||||
# Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve
|
||||
# to the front controller "/index.php" but be rewritten to "/index.php/index".
|
||||
<IfModule mod_negotiation.c>
|
||||
Options -MultiViews
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
|
||||
# This RewriteRule is used to dynamically discover the RewriteBase path.
|
||||
# See https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule
|
||||
# Here we will compare the stripped per-dir path *relative to the filesystem
|
||||
# path where the .htaccess file is read from* with the URI of the request.
|
||||
#
|
||||
# If a match is found, the prefix path is stored into an ENV var that is later
|
||||
# used to properly prefix the URI of the front controller index.php.
|
||||
# This is what makes it possible to host a Symfony application under a subpath,
|
||||
# such as example.com/subpath
|
||||
|
||||
# The convoluted rewrite condition means:
|
||||
# 1. Matches the entire URI in the RewriteRule and backreference it using $0
|
||||
# 2. Strips the request uri the per-directory path and use it as REQUEST_URI.
|
||||
# This is documented in https://bit.ly/3zDm3SI ("What is matched?")
|
||||
# 3. Evaluates the RewriteCond. Assuming that your DocumentRoot is /var/www/html,
|
||||
# that this .htaccess is in the /var/www/html/public directory and your request URI
|
||||
# is /public/hello/world, the following happens:
|
||||
#
|
||||
# * strips per-dir prefix: /var/www/html/public/hello/world -> hello/world
|
||||
# * matches the pattern '.*' with the string 'hello/world' (the second capture group in the PCRE pattern)
|
||||
# * matches the pattern '/.+/ with the string '/public' (the first capture group in the PCRE pattern)
|
||||
# * RewriteCond: input='/public/hello/world::hello/world' pattern='^(/.+)/(.*)::\\2$' => matched
|
||||
#
|
||||
# 4. Execute the RewriteRule:
|
||||
# * The %1 in the RewriteRule flag E=BASE:%1 refers to the first capture group captured in the RewriteCond ^(/.+)/(.*)
|
||||
# * sets the ENV variable BASE to '/public'
|
||||
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
|
||||
RewriteRule .* - [E=BASE:%1]
|
||||
|
||||
# Sets the HTTP_AUTHORIZATION header removed by Apache
|
||||
RewriteCond %{HTTP:Authorization} .+
|
||||
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
|
||||
|
||||
# Removes the /index.php/ part from a URL, if present
|
||||
RewriteCond %{ENV:REDIRECT_STATUS} =""
|
||||
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
|
||||
|
||||
# If the requested filename exists, simply serve it.
|
||||
# Otherwise rewrite all other queries to the front controller.
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ %{ENV:BASE}/index.php [L]
|
||||
</IfModule>
|
||||
9
public/index.php
Normal file
9
public/index.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
use App\Kernel;
|
||||
|
||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||
|
||||
return static function (array $context) {
|
||||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue