Change config var names, fusion config, remove prefix in url routing
This commit is contained in:
parent
3e65bf1fcf
commit
24d3336d00
|
@ -1,4 +1,3 @@
|
|||
config/config.php
|
||||
config/conf.php
|
||||
.idea
|
||||
/public/uploads
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
<?php
|
||||
return [
|
||||
'gmarche.prefix' => '/news'
|
||||
];
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
$host = '';
|
||||
$username = '';
|
||||
$password = '';
|
||||
$database_name = '';
|
||||
$db_server = '';
|
||||
$db_username = '';
|
||||
$db_password = '';
|
||||
$db_name = '';
|
||||
$g1_node = 'https://duniter-g1.p2p.legal';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
include 'conf.php';
|
||||
|
||||
use App\Framework\Twig\UrlExtension;
|
||||
use Framework\Middleware\CsrfMiddleware;
|
||||
|
@ -15,10 +16,10 @@ use Framework\Twig\{
|
|||
|
||||
return [
|
||||
'env' => \DI\env('ENV', 'production'),
|
||||
'database.host' => '',
|
||||
'database.username' => '',
|
||||
'database.password' => '',
|
||||
'database.name' => '',
|
||||
'database.host' => "$db_server",
|
||||
'database.username' => "$db_username",
|
||||
'database.password' => "$db_password",
|
||||
'database.name' => "$db_name",
|
||||
'views.path' => dirname(__DIR__) . '/views',
|
||||
'twig.extensions' => [
|
||||
\DI\get(RouterTwigExtension::class),
|
|
@ -4,7 +4,7 @@ ini_set('display_errors', 0);
|
|||
if ($_POST['produit']!== '' && $_POST['vendeur']!== null && $_POST['quantite']>0 && $_POST['prix']>=0) {
|
||||
// Connexion à la base de données
|
||||
include '../../config/conf.php';
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Récupération des informations du formulaire
|
||||
$params = array();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
// Connexion à la base de données
|
||||
include '../../config/conf.php';
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Récupération des informations du formulaire
|
||||
$params = array();
|
||||
|
|
|
@ -4,7 +4,7 @@ include '../../config/conf.php';
|
|||
|
||||
try {
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
if (isset($_POST['nom_connecte']) && isset($_POST['mdp']) != "") {
|
||||
|
||||
$params["username"] = $_POST['nom_connecte'];
|
||||
|
|
|
@ -4,7 +4,7 @@ include '../../config/conf.php';
|
|||
if($_POST['id'] !== null)
|
||||
{
|
||||
// Connexion à la base de données
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
$params['product_id'] = $_POST['id'];
|
||||
$filename = $_POST['nom_image'];
|
||||
|
|
|
@ -4,7 +4,7 @@ include '../../config/conf.php';
|
|||
if($_POST['id_r'] !== null)
|
||||
{
|
||||
// Connexion à la base de données
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
$params['souhait_id'] = $_POST['id_r'];
|
||||
$filename = $_POST['nom_image'];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
try {
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
if (isset($_POST['id']) && isset($_POST['id']) != "") {
|
||||
|
||||
$product_id = $_POST['id'];
|
||||
|
|
|
@ -4,7 +4,7 @@ include '../../config/conf.php';
|
|||
|
||||
try {
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
if (isset($_POST['id_r']) && isset($_POST['id_r']) != "") {
|
||||
|
||||
$souhait_id = $_POST['id_r'];
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
include '../../config/conf.php';
|
||||
$antenne_slug = $_GET['antenne_slug'];
|
||||
$nom_connecte = $_GET['nom_connecte'];
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Affichage des intitulés de colonnes
|
||||
$data = '<table class="table table-bordered table-striped">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
include '../../config/conf.php';
|
||||
$antenne_slug = $_GET['antenne_slug'];
|
||||
$nom_connecte = $_GET['nom_connecte'];
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
// Affichage des intitulés de colonnes
|
||||
$data = '<table class="table table-bordered table-striped">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
include '../../config/conf.php';
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
if(isset($_POST))
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
include '../../config/conf.php';
|
||||
|
||||
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
|
||||
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
|
||||
|
||||
if(isset($_POST))
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ class TrailingSlashMiddleware {
|
|||
public function __invoke(ServerRequestInterface $request, callable $next)
|
||||
{
|
||||
$uri = $request->getUri()->getPath();
|
||||
if (!empty($uri) && $uri[-1] === "/") {
|
||||
if (!empty($uri) && $uri[-1] === "/" && $uri !== "/") {
|
||||
return (new \GuzzleHttp\Psr7\Response())
|
||||
->withStatus(301)
|
||||
->withHeader('Location', substr($uri, 0, -1));
|
||||
|
|
|
@ -5,5 +5,5 @@ use function \Di\object;
|
|||
use function \Di\get;
|
||||
/* Chemin */
|
||||
return [
|
||||
'gmarche.prefix' => '/france'
|
||||
'gmarche.prefix' => '/'
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue