From aeb6c4f48d88362c601a86401a94fc36878cdeed Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Fri, 16 Feb 2024 02:28:13 +0100 Subject: [PATCH] Tweaked symfony framework support --- config/frameworks/10-symfony.sh | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/config/frameworks/10-symfony.sh b/config/frameworks/10-symfony.sh index 17a5cde..5f33c8e 100644 --- a/config/frameworks/10-symfony.sh +++ b/config/frameworks/10-symfony.sh @@ -20,9 +20,11 @@ if [ -f /application/.symfony-preinit ]; then sh /application/.symfony-preinit fi -# Call on composer -echo " -> Installing dependencies using composer..." -/usr/bin/composer install --no-dev --no-cache --optimize-autoloader --no-progress -q || exit 0 +# Call on composer if no vendor dir +if [ ! -d /application/vendor ]; then + echo " -> Installing dependencies using composer..." + /usr/bin/composer install --no-dev --no-cache --optimize-autoloader --no-progress -q || exit 0 +fi # Call post-init script if [ -f /application/.symfony-init ]; then @@ -33,27 +35,10 @@ fi echo " -> Setting up directories..." test -d /application/var/cache/prod || ( mkdir -p /application/var/cache/prod && chmod a+rwx /application/var/cache/prod ) -# Do some variant-specific setup -case "$VARIANT" in - "vanilla") - echo " -> Compiling .env for prodution..." - composer symfony:dump-env prod -q - echo " -> Clearing cache..." - bin/console cache:clear --env=prod -q - ;; - "bolt") - echo " -> Setting up BoltCMS directories..." - # we get a warning about this - chmod a+rwx /application/config - # we don't want to get errors from these - chmod -R a+rwx /application/var - chmod -R a+rwx /application/var/data - chmod -R a+rwx /application/var/cache - chmod -R a+rwx /application/var/cache/prod - chmod -R a+rwx /application/var/log - ;; -esac - +echo " -> Compiling .env for prodution..." +composer symfony:dump-env prod -q +echo " -> Clearing cache..." +bin/console cache:clear --env=prod -q echo " -> Testing environment..." if ! bin/console about -q; then