Skip to content

Commit

Permalink
#1416 Simplifier configuration historique sur le parameters.yml/confi…
Browse files Browse the repository at this point in the history
…g.yml (#1421)

* #1416 bdd

* !1416 divers

* !1416 mails

* !1416 afup

* !1416 rib et rib_ce

* !1416 planete

* !1416 site

* !1416 git & sympa

* !1416 bureau

* !1416 nettoyage final

* Corrige le RIB de PROD

Co-authored-by: Adrien Gallou <[email protected]>

* Corrige la date du changement du RIB

---------

Co-authored-by: Adrien Gallou <[email protected]>
  • Loading branch information
stakovicz and agallou authored Feb 12, 2024
1 parent ff5055c commit ec400fd
Show file tree
Hide file tree
Showing 45 changed files with 210 additions and 644 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-
- name: CS fixer prerequisites
run: make configs/application/config.php
- name: Parameters file
run: make app/config/parameters.yml

- name: Composer install
run: composer install --no-scripts
Expand Down Expand Up @@ -97,9 +97,6 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-
- name: Prerequisites
run: make configs/application/config.php

- name: Composer install
run: composer install --no-scripts --ignore-platform-req=php

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ deps.lock
/htdocs/cache
/tmp/
node_modules
/configs/application/config.php
/tests/simpletest
/tests/unitaires/config.php

Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ assets:
watch:
./node_modules/.bin/webpack --progress --colors --watch

configs/application/config.php:
cp configs/application/config.php.dist-docker configs/application/config.php

app/config/parameters.yml:
cp app/config/parameters.yml.dist-docker app/config/parameters.yml

Expand All @@ -62,7 +59,7 @@ init-db:
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --rm cliphp make db-migrations
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --rm cliphp make db-seed

config: configs/application/config.php app/config/parameters.yml
config: app/config/parameters.yml
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --no-deps --rm cliphp make vendors
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --no-deps --rm cliphp make assets

Expand Down Expand Up @@ -99,7 +96,7 @@ hooks: .git/hooks/pre-commit .git/hooks/post-checkout

reset-db:
echo 'DROP DATABASE IF EXISTS web' | $(DOCKER_COMPOSE_BIN) run -T --rm db /opt/mysql_no_db
echo 'CREATE DATABASE web' | $(DOCKER_COMPOSE_BIN) -T --rm db /opt/mysql_no_db
echo 'CREATE DATABASE web' | $(DOCKER_COMPOSE_BIN) run -T --rm db /opt/mysql_no_db

db-migrations:
php bin/phinx migrate
Expand Down
3 changes: 0 additions & 3 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,6 @@ parameters:
niveau: 'ROLE_ADMIN'
icon: "tag"
elements:
configuration:
nom: 'Configuration du site'
niveau: 'ROLE_ADMIN'
membre_administrateur:
nom: 'Administrateurs du site'
niveau: 'ROLE_ADMIN'
Expand Down
8 changes: 8 additions & 0 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ parameters:
github_authenticator: "AppBundle\\Security\\TestGithubAuthenticator"
slack_url: null

smtp_host: "mailcatcher"
smtp_tls: 0
smtp_username: ""
smtp_password: ""
smtp_port: 1025
mailer_force_recipients: []
mailer_bcc: []

services:
AppBundle\Offices\OfficeFinder:
class: AppBundle\Offices\NullOfficeFinder
Expand Down
15 changes: 13 additions & 2 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ parameters:
database_name: symfony
database_user: root
database_password: ~

slack_url: ""
# You should uncomment this if you want use pdo_sqlite
# database_path: "%kernel.root_dir%/data.db3"

# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
Expand All @@ -23,6 +23,9 @@ parameters:

home_algolia_enabled: false

# Slack url for notifications
slack_url: 'http://yolo'

twitter_oauth_access_token: ""
twitter_oauth_access_token_secret: ""
twitter_consumer_key: ""
Expand Down Expand Up @@ -69,3 +72,11 @@ parameters:
paybox_identifiant: "110647233"

blog_api_key: 123456

smtp_host: "mailcatcher"
smtp_tls: 0
smtp_username: ""
smtp_password: ""
smtp_port: 1025
mailer_force_recipients: []
mailer_bcc: []
8 changes: 8 additions & 0 deletions app/config/parameters.yml.dist-docker
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,11 @@ parameters:
paybox_identifiant: "110647233"

blog_api_key: 123456

smtp_host: "mailcatcher"
smtp_tls: 0
smtp_username: ""
smtp_password: ""
smtp_port: 1025
mailer_force_recipients: []
mailer_bcc: []
2 changes: 1 addition & 1 deletion app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ services:
arguments: ['@AppBundle\Mailchimp\Mailchimp', '@AppBundle\Association\Model\Repository\UserRepository', "%mailchimp_members_list%"]

Afup\Site\Utils\Configuration:
arguments: ['%kernel.project_dir%/configs/application/config.php']
autowire: true

AppBundle\Email\Mailer\Mailer:
autowire: true
Expand Down
62 changes: 0 additions & 62 deletions configs/application/config-test.php

This file was deleted.

62 changes: 0 additions & 62 deletions configs/application/config.php.dist

This file was deleted.

62 changes: 0 additions & 62 deletions configs/application/config.php.dist-docker

This file was deleted.

55 changes: 0 additions & 55 deletions htdocs/include/prepend.inc.php
Original file line number Diff line number Diff line change
@@ -1,55 +0,0 @@
<?php

// Initialisation
ob_start();

// Inclusion de l'autoload de composer
require_once dirname(__FILE__) . '/../../vendor/autoload.php';

require_once dirname(__FILE__).'/../../sources/Afup/fonctions.php';

// Configuration
$conf = new \Afup\Site\Utils\Configuration(dirname(__FILE__).'/../../configs/application/config.php');
$GLOBALS['AFUP_CONF'] = $conf;
error_reporting($conf->obtenir('divers|niveau_erreur'));
ini_set('display_errors', $conf->obtenir('divers|afficher_erreurs'));
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(__FILE__).'/../../dependencies/PEAR/' . PATH_SEPARATOR . dirname(__FILE__).'/../../dependencies/');
header('Content-type: text/html; charset=UTF-8');

// On détermine sur quel sous-site on est
$serveur = "";
$url = $_SERVER['REQUEST_URI'];
if (strrpos($url, '?') !== false) {
$position = strrpos($url, '?');
$url = substr($url, 0, $position);
}
$position = strrpos($url, '/');
$url = substr($_SERVER['REQUEST_URI'], 0, $position);
$parties = explode('/', $url);
$sous_site = array_pop($parties);
if (empty($sous_site) and strpos($_SERVER['HTTP_HOST'], "planete") !== false) {
$sous_site = "planete";
$serveur = "https://afup.org";
}

// Initialisation de Smarty
$smarty = new Smarty;
$smarty->template_dir = array(dirname(__FILE__).'/../../htdocs/templates/' . $sous_site . '/',
dirname(__FILE__).'/../../htdocs/templates/commun/');
$smarty->compile_dir = dirname(__FILE__).'/../../htdocs/cache/templates';
$smarty->compile_id = $sous_site;
$smarty->use_sub_dirs = true;
$smarty->compile_check = true;
$smarty->php_handling = SMARTY_PHP_ALLOW;
$smarty->assign('url_base', 'http://' . $_SERVER['HTTP_HOST'] . '/');
$smarty->assign('chemin_template', $serveur.$conf->obtenir('web|path').'templates/' . $sous_site . '/');
$smarty->assign('chemin_javascript', $serveur.$conf->obtenir('web|path').'javascript/');

// Initialisation de la couche d'abstraction de la base de données
$bdd = new \Afup\Site\Utils\Base_De_Donnees($conf->obtenir('bdd|hote'),
$conf->obtenir('bdd|base'),
$conf->obtenir('bdd|utilisateur'),
$conf->obtenir('bdd|mot_de_passe'));
$bdd->executer("SET NAMES 'utf8'");

require_once(dirname(__FILE__) . '/../../sources/Afup/Bootstrap/commonStart.php');
Loading

0 comments on commit ec400fd

Please sign in to comment.