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