Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.2
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ default: help
CURRENT_UID ?= $(shell id -u)
DOCKER_UP_OPTIONS ?= --detach
DOCKER_COMPOSE_BIN ?= docker compose
SYMFONY_BIN := $(shell command -v symfony 2>/dev/null)
PHP_HOST = $(if $(SYMFONY_BIN),$(SYMFONY_BIN) php,php)
COMPOSER_HOST = $(if $(SYMFONY_BIN),$(SYMFONY_BIN) composer,composer)

# Exécutables
DOCKER_COMP = CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN)
Expand Down Expand Up @@ -163,7 +166,7 @@ compose.override.yml:
vendors: vendor node_modules

vendor: composer.lock
composer install --no-scripts
$(COMPOSER_HOST) install --no-scripts

node_modules:
npm install --legacy-peer-deps
Expand Down Expand Up @@ -192,10 +195,10 @@ reset-db:
echo 'CREATE DATABASE web' | $(DOCKER_COMPOSE_BIN) run -T --rm db /opt/mysql_no_db

db-migrations:
php bin/phinx migrate
$(PHP_HOST) bin/phinx migrate

db-seed:
php bin/phinx seed:run
$(PHP_HOST) bin/phinx seed:run

clean-test-deprecated-log:
rm -f var/logs/test.deprecations.log
Expand All @@ -204,4 +207,4 @@ var/logs/test.deprecations_grouped.log:
cat var/logs/test.deprecations.log | cut -d "]" -f 2 | awk '{$$1=$$1};1' | sort | uniq -c | sort -nr > var/logs/test.deprecations_grouped.log

var/cache/dev/AppKernelDevDebugContainer.xml:
php bin/console cache:warmup --env=dev
$(PHP_HOST) bin/console cache:warmup --env=dev
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Code source pour le site [afup.org](https://afup.org).

Retrouvez la documentation pour le setup de l'environnement de dev dans la [documentation dédiée](./doc/dev-setup.md).

### PHP local via Symfony CLI

- Un fichier `.php-version` existe à la racine avec `8.2` pour que la Symfony CLI sélectionne PHP 8.2 localement. Ce fichier devra être mis à jour lors des bump de la version de PHP.
- Le Makefile détecte automatiquement `symfony` : s'il est présent, les commandes locales passent par `symfony php` et `symfony composer`; sinon il conserve `php` et `composer` du système.
- Les commandes Docker restent inchangées (le PHP du conteneur est utilisé).

## Contribution

Toute contribution est la bienvenue, vous trouverez les informations dans le fichier [CONTRIBUTING.md](./CONTRIBUTING.md).
Expand Down
Loading