diff --git a/CHANGELOG.md b/CHANGELOG.md index 264f1c2..6e99a01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # nystudio107/craft Change Log +## 2.5.9 - 2022.05.02 +### Fixed +* Clean up initial check for `composer.lock` or `vendor/autoload.php` to ensure the first-time install is done + +### Changed +* Changed `bootstrap.php` to allow `.env`-set environment variables override existing injected environment variables ([#82](https://github.com/craftcms/craft/issues/82)) + ## 2.5.8 - 2022.04.13 ### Fixed * Changed the hostname from `mysql` to `mariadb` in the `composer_install.sh` and `run_queue.sh` scripts, since we're using MariaDB diff --git a/cms/bootstrap.php b/cms/bootstrap.php index 2502887..d57d6da 100644 --- a/cms/bootstrap.php +++ b/cms/bootstrap.php @@ -12,7 +12,7 @@ // Load dotenv? if (class_exists('Dotenv\Dotenv')) { - Dotenv\Dotenv::createUnsafeImmutable(CRAFT_BASE_PATH)->safeLoad(); + Dotenv\Dotenv::createUnsafeMutable(CRAFT_BASE_PATH)->safeLoad(); } // Define additional PHP constants diff --git a/docker-config/php-prod-craft/composer_install.sh b/docker-config/php-prod-craft/composer_install.sh index 0d6045c..2ebfa1f 100755 --- a/docker-config/php-prod-craft/composer_install.sh +++ b/docker-config/php-prod-craft/composer_install.sh @@ -13,9 +13,9 @@ # Ensure permissions on directories Craft needs to write to chown -R www-data:www-data /var/www/project/cms/storage chown -R www-data:www-data /var/www/project/cms/web/cpresources -# Check for `composer.lock` & `vendor/` +# Check for `composer.lock` & `vendor/autoload.php` cd /var/www/project/cms -if [ ! -f "composer.lock" ] || [ ! -d "vendor" ]; then +if [ ! -f "composer.lock" ] || [ ! -f "vendor/autoload.php" ]; then su-exec www-data composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction # Wait until the MySQL db container responds echo "### Waiting for MySQL database" diff --git a/docker-config/php-prod-craft/run_queue.sh b/docker-config/php-prod-craft/run_queue.sh index 57eebf3..5318cdd 100755 --- a/docker-config/php-prod-craft/run_queue.sh +++ b/docker-config/php-prod-craft/run_queue.sh @@ -19,9 +19,9 @@ until eval "mysql -h mariadb -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select do sleep 1 done -# Wait until the `composer install` is done by looking for the `vendor/autoload.php` file +# Wait until the `composer install` is done by looking for the `vendor/autoload.php` and `composer.lock` files echo "### Waiting for vendor/autoload.php" -while [ ! -f vendor/autoload.php ] || [ ! -f composer.lock ] +while [ ! -f "vendor/autoload.php" ] || [ ! -f "composer.lock" ] do sleep 1 done