diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d73d14e6..0deead04f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,9 +66,12 @@ jobs: restore-keys: | ${{ runner.os }}-composer- - - name: CS fixer prerequisites + - name: CS fixer prerequisites config run: make configs/application/config.php + - name: CS fixer prerequisites parameters + run: make app/config/parameters.yml + - name: Composer install run: composer install --no-scripts diff --git a/configs/application/config-test.php b/configs/application/config-test.php index 54b0ce7d5..501f009c5 100644 --- a/configs/application/config-test.php +++ b/configs/application/config-test.php @@ -1,8 +1,4 @@ setDefaults($defaults); -$formulaire->addElement('header', '' , 'Base de données'); -$formulaire->addElement('text' , 'bdd|hote' , 'Hote' , array('size' => 30)); -$formulaire->addElement('text' , 'bdd|base' , 'Base' , array('size' => 30)); -$formulaire->addElement('text' , 'bdd|utilisateur' , 'Utilisateur' , array('size' => 30)); -$formulaire->addElement('text' , 'bdd|mot_de_passe', 'Mot de passe' , array('size' => 30)); - $formulaire->addElement('header' , '' , 'Mails'); $formulaire->addElement('text' , 'mails|email_expediteur' , 'Email expediteur' , array('size' => 30)); $formulaire->addElement('text' , 'mails|nom_expediteur' , 'Nom expediteur' , array('size' => 30)); @@ -48,10 +42,6 @@ $formulaire->addElement('header', 'boutons' , ''); $formulaire->addElement('submit', 'soumettre', 'Enregistrer'); -$formulaire->addRule('bdd|hote' , 'Hote manquant' , 'required'); -$formulaire->addRule('bdd|base' , 'Base manquante' , 'required'); -$formulaire->addRule('bdd|utilisateur', 'Utilisateur manquant', 'required'); - if ($formulaire->validate()) { $valeurs = $formulaire->exportValues(); $conf->importer($valeurs); diff --git a/sources/Afup/Forum/AppelConferencier.php b/sources/Afup/Forum/AppelConferencier.php index c4b930535..5ded8a6d3 100644 --- a/sources/Afup/Forum/AppelConferencier.php +++ b/sources/Afup/Forum/AppelConferencier.php @@ -2,12 +2,7 @@ namespace Afup\Site\Forum; -use Afup\Site\Utils\Configuration; -use Afup\Site\Utils\Mailing; -use AppBundle\Email\Mailer\MailUser; -use AppBundle\Email\Mailer\Message; use AppBundle\Event\Model\Talk; -use Symfony\Component\Translation\Translator; class AppelConferencier { diff --git a/sources/Afup/Utils/Configuration.php b/sources/Afup/Utils/Configuration.php index 47fe94b57..606fd894f 100644 --- a/sources/Afup/Utils/Configuration.php +++ b/sources/Afup/Utils/Configuration.php @@ -1,6 +1,9 @@ _chemin_fichier = $chemin_fichier; $this->_valeurs = include($this->_chemin_fichier); + + $parametersFile = dirname(__FILE__).'/../../../app/config/parameters.yml'; + if (is_file($parametersFile)) { + $parameters = Yaml::parseFile($parametersFile)['parameters']; + + $this->_valeurs['bdd']['hote'] = $parameters['database_host']; + $this->_valeurs['bdd']['base'] = $parameters['database_name']; + $this->_valeurs['bdd']['utilisateur'] = $parameters['database_user']; + $this->_valeurs['bdd']['mot_de_passe'] = $parameters['database_password']; + } } /**