Skip to content

Commit

Permalink
afup#1416 divers
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz committed Jan 7, 2024
1 parent 82d4e55 commit e5185eb
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 84 deletions.
2 changes: 0 additions & 2 deletions configs/application/config-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
$configuration['bdd']['mot_de_passe']='afup';
$configuration['web']['path']='/';

$configuration['divers']['niveau_erreur']='32767';
$configuration['divers']['afficher_erreurs']='1';
$configuration['mails']['serveur_smtp']='mailcatcher';
$configuration['mails']['email_expediteur']='[email protected]';
$configuration['mails']['nom_expediteur']='Bureau AFUP';
Expand Down
2 changes: 0 additions & 2 deletions configs/application/config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ $configuration['bdd']['utilisateur']='afup_dev';
$configuration['bdd']['mot_de_passe']='p455w0rd';
$configuration['web']['path']='http://.dev/';

$configuration['divers']['niveau_erreur']='6143';
$configuration['divers']['afficher_erreurs']='1';
$configuration['mails']['serveur_smtp']='';
$configuration['mails']['email_expediteur']='[email protected]';
$configuration['mails']['nom_expediteur']='Bureau AFUP';
Expand Down
2 changes: 0 additions & 2 deletions configs/application/config.php.dist-docker
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ $configuration['bdd']['utilisateur']='afup';
$configuration['bdd']['mot_de_passe']='afup';
$configuration['web']['path']='/';

$configuration['divers']['niveau_erreur']='6143';
$configuration['divers']['afficher_erreurs']='1';
$configuration['mails']['serveur_smtp']='mailcatcher';
$configuration['mails']['email_expediteur']='[email protected]';
$configuration['mails']['nom_expediteur']='Bureau AFUP';
Expand Down
57 changes: 0 additions & 57 deletions htdocs/include/prepend.inc.php

This file was deleted.

7 changes: 0 additions & 7 deletions htdocs/pages/administration/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@
$formulaire->addElement('header' , '' , 'Planète PHP FR');
$formulaire->addElement('textarea', 'planete|pertinence' , 'Critère de pertinence', array('cols' => 42, 'rows' => 7));

$formulaire->addElement('header' , '' , 'Divers');
$formulaire->addElement('select' , 'divers|niveau_erreur' , 'Niveau erreur' , array(E_ALL => 'Toutes',
E_NOTICE => 'Informations',
E_WARNING => 'Avertissements',
0 => 'Aucune'));
$formulaire->addElement('advcheckbox', 'divers|afficher_erreurs', 'Afficher erreurs', null, null, array(0, 1));

$formulaire->addElement('header', 'boutons' , '');
$formulaire->addElement('submit', 'soumettre', 'Enregistrer');

Expand Down
12 changes: 8 additions & 4 deletions sources/Afup/Bootstrap/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@
session_start();
}

// mise à jour des paramètrage PHP en fonction de la configuration

ini_set('error_reporting', $GLOBALS['AFUP_CONF']->obtenir('divers|niveau_erreur'));
ini_set('display_errors', $GLOBALS['AFUP_CONF']->obtenir('divers|afficher_erreurs'));
// mise à jour des paramétrages PHP en fonction de la configuration
if ($_ENV['SYMFONY_ENV'] === 'dev') {
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
} else {
ini_set('error_reporting', E_ALL ^ E_WARNING);
ini_set('display_errors', 0);
}
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(__FILE__).'/../../../dependencies/PEAR/');

header('Content-type: text/html; charset=UTF-8');
Expand Down
9 changes: 2 additions & 7 deletions sources/Afup/Bootstrap/_Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// racine de l'application (pas du document root !)

use Afup\Site\Utils\Base_De_Donnees;
use Afup\Site\Corporate\_Site_Base_De_Donnees;
use Afup\Site\Utils\Configuration;

$root = realpath(dirname(__FILE__) . '/../../..');
Expand Down Expand Up @@ -67,12 +67,7 @@

// initialisation de la couche d'abstraction de la base de données

$bdd = new Base_De_Donnees(
$conf->obtenir('bdd|hote'),
$conf->obtenir('bdd|base'),
$conf->obtenir('bdd|utilisateur'),
$conf->obtenir('bdd|mot_de_passe')
);
$bdd = new _Site_Base_De_Donnees();

// mets la connexion db dans une 'clé de registre' accessible à tout moment

Expand Down
4 changes: 1 addition & 3 deletions sources/Afup/Utils/SymfonyKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public function __construct(Request $request = null)
$env = 'prod';
$debug = false;

$configuration = $this->getLegacyConfig();

if ($configuration['divers']['afficher_erreurs']) {
if ($_ENV['SYMFONY_ENV'] === 'dev') {
Debug::enable(E_WARNING);
$debug = true;
$env = 'dev';
Expand Down

0 comments on commit e5185eb

Please sign in to comment.