diff --git a/ahoy.drupal.yml b/ahoy.drupal.yml index ede547584880db89ca48e151fa5742079b9f9a54..c6828709628072af06c78249e1843684800a8f64 100644 --- a/ahoy.drupal.yml +++ b/ahoy.drupal.yml @@ -6,11 +6,29 @@ commands: echo "DRUPAL_LIVE=1" >>.env env -i $(cat .env | xargs) >.env composer lakedrops:config --no-interaction - usage: Turn live mode on - ATTENTION - you should run drush cr afterwards + drush cr + usage: Turn live mode on. dev: cmd: | DRUPAL_LIVE=0 echo "DRUPAL_LIVE=0" >>.env env -i $(cat .env | xargs) >.env composer lakedrops:config --no-interaction - usage: Turn live mode off - ATTENTION - you should run drush cr afterwards + drush cr + usage: Turn live mode off. + rcon: + cmd: | + RENDERER_CONFIG_DEBUG=1 + echo "RENDERER_CONFIG_DEBUG=1" >>.env + env -i $(cat .env | xargs) >.env + composer lakedrops:config --no-interaction + drush cr + usage: Turn on renderer config debug mode + rcoff: + cmd: | + RENDERER_CONFIG_DEBUG=0 + echo "RENDERER_CONFIG_DEBUG=0" >>.env + env -i $(cat .env | xargs) >.env + composer lakedrops:config --no-interaction + drush cr + usage: Turn off renderer config debug mode diff --git a/composer.json b/composer.json index 74a4aeab1dae15b9826fa6c3b8edffb3be417c93..f7847900d24b56e9d713b72e15dc02a4bf9ef6d7 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,8 @@ "require": { "php": ">=8.1", "composer-plugin-api": "^2", - "lakedrops/composer-json-utils": "^2.4||dev-develop" + "lakedrops/composer-json-utils": "^2.4||dev-develop", + "mxr576/ddqg-composer-audit": "^1.0" }, "require-dev": { "composer/composer": "^2", @@ -55,6 +56,7 @@ "dealerdirect/phpcodesniffer-composer-installer": true, "drupal/core-composer-scaffold": false, "lakedrops/*": false, + "mxr576/ddqg-composer-audit": false, "php-http/discovery": false, "phpstan/extension-installer": true } diff --git a/src/Handler.php b/src/Handler.php index 5fcad4d323a938d6ffeeffcfe36b4d9ce05cfcf1..1df307df3afd43dec51021a97db6a372bc34e4ea 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -59,6 +59,10 @@ class Handler extends BaseHandler { 'domain' => str_replace(['.', '-'], ['\\.', '\\-'], 'www.example.com'), 'aliases' => [], 'live' => (getenv('LAKEDROPS_BUILD_NG') === 'yes') || !empty($this->env->receiveGlobal('DRUPAL_LIVE', 'Live mode', '0')), + 'renderer_config' => [ + 'debug' => $this->env->receiveGlobal('RENDERER_CONFIG_DEBUG', '', '0'), + ], + 'file_assets_path' => FALSE, ]; } diff --git a/templates/services.yml.twig b/templates/services.yml.twig index 50f58553baa4cd0d62e273956996ddeba2df85f2..1144d2af55e3e850e66c2ebdedbfc31cbe5fc78b 100644 --- a/templates/services.yml.twig +++ b/templates/services.yml.twig @@ -14,6 +14,7 @@ parameters: max-age: 0 contexts: ['session', 'user'] tags: [] + debug: {{ renderer_config.debug ? 'true' : 'false' }} http.response.debug_cacheability_headers: false factory.keyvalue: {} diff --git a/templates/settings.php.twig b/templates/settings.php.twig index 10d6e91c05177e7703a9107efb396559f4d4956f..efb64be2f62a09282dec6044b9b34ea248c13a5d 100644 --- a/templates/settings.php.twig +++ b/templates/settings.php.twig @@ -1,8 +1,8 @@ <?php -$databases = array ( - 'default' => array ( - 'default' => array ( +$databases = [ + 'default' => [ + 'default' => [ 'driver' => '{{ db.driver }}', 'namespace' => '{{ db.namespace }}', 'database' => '{{ db.host }}', @@ -13,9 +13,9 @@ $databases = array ( 'prefix' => '{{ db.prefix }}', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_general_ci', - ), - ), -); + ], + ], +]; {% if drupal8 %} $config_directories['sync'] = 'sites/default/files/config/sync'; @@ -27,10 +27,13 @@ $settings['container_yamls'][] = __DIR__ . '/services.yml'; $settings['file_public_path'] = 'sites/default/files'; $settings['file_private_path'] = 'sites/default/private'; $settings['file_temp_path'] = '/tmp'; +{% if file_assets_path %} +$settings['file_assets_path'] = '{{ file_assets_path }}'; +{% endif %} $settings['hash_salt'] = '{{ hash }}'; -$settings['trusted_host_patterns'] = array( +$settings['trusted_host_patterns'] = [ '^{{ domain }}$', -); +]; if (file_exists(__DIR__ . '/settings.local.php')) { include __DIR__ . '/settings.local.php';