Repository navigation
fix(config): read env settings reliably, add a README and a CI - #36
Merged
Merged
Conversation
DISABLE_WP_CRON=false and WP_POST_REVISIONS=false were defined as the string 'false', which is truthy and disabled the cron. Missing DB_HOST, DB_CHARSET, DB_PREFIX or APP_DEBUG raised warnings, APP_DEBUG=1 meant no debug, WP_SITEURL had no default for the web/wp layout, and the database credentials are now required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Renovate locks on PHP 8.2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ke the CI lint fail on errors WP_POST_REVISIONS=1 was read as the boolean true (unlimited revisions). A silent wp_ default for a missing DB_PREFIX could point an existing site to other tables. find -exec ignored the exit code of php -l. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
Étape 6a de la feuille de route : corriger le boilerplate et lui donner un README et une CI.
config/application.phpavait plusieurs défauts :DISABLE_WP_CRON=falseetWP_POST_REVISIONS=falseétaient définis avec la chaîne'false', une valeur vraie : le cron était désactivé ;DB_HOST,DB_CHARSET,DB_PREFIXouAPP_DEBUGabsente provoquait des warnings ;APP_DEBUG=1était lu comme faux ;WP_SITEURLn'avait pas de valeur par défaut, alors que WordPress est installé dansweb/wp.Changements
config/application.phpDISABLE_WP_CRON,APP_DEBUG) comprennenttrue/false/1/0/on/off.WP_POST_REVISIONSacceptetrue,falseou un nombre, converti en entier.WP_SITEURLvautWP_HOME/wppar défaut, et la valeur du.envreste prioritaire.DB_NAME,DB_USER,DB_PASSWORDetDB_PREFIXsont obligatoires, avec une erreur explicite. Un mot de passe vide reste accepté.Fichiers du dépôt
.env.example:WP_HOMEavec son schéma,WP_SITEURL=${WP_HOME}/wp,DB_CHARSET=utf8mb4.bin/console: exécutable, avec un commentaire exact.load.phpcorrigé.config:recommended, et lock régénéré sous PHP 8.2..github/est exclu de l'archive Composer : il n'est pas copié dans les projets créés.DB_PREFIX,DB_NAME,DB_USERetDB_PASSWORDdoivent être définis. SansDB_PREFIX, le site utilisait auparavant des tables sans préfixe, et risquait de basculer en silence vers d'autres tables.DISABLE_WP_CRON=falseréactive bien le cron.APP_DEBUG=1,onouyesactiventWP_DEBUG.DB_HOST=ouDB_CHARSET=vide n'est plus remplacé par la valeur par défaut.WP_SITEURLvautWP_HOME/wps'il n'est pas défini.Vérification
.github/tests/application-config.php: 15 cas, chacun dans un processus PHP séparé avec son propre.env. Tous échouaient ou manquaient avant la correction. Ils passent tous sur PHP 8.2, 8.3 et 8.4.find -execrenvoyait 0).application.php: tous les scripts de vérification passent, etDISABLE_WP_CRONvautbool(false).🤖 Generated with Claude Code