Skip to content
Snippets Groups Projects
Unverified Commit f8e54476 authored by Eugene Bocharov's avatar Eugene Bocharov Committed by Giuseppe Rota
Browse files

Issue #3254698 by Eugene Bocharov: RuntimeException "Please configure the...

Issue #3254698 by Eugene Bocharov: RuntimeException "Please configure the drupal prometheusio_bin cache" on drush updb
parent f907966f
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,10 @@
"name": "drupal/prometheusio_exporter",
"description": "A Prometheus exporter for Drupal",
"type": "drupal-module",
"keywords": ["Drupal", "Prometheus"],
"keywords": [
"Drupal",
"Prometheus"
],
"homepage": "http://drupal.org/project/prometheusio_exporter",
"license": "GPL-2.0-or-later",
"support": {
......@@ -17,13 +20,7 @@
"*": "dist"
},
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
"allow-plugins": true,
},
"repositories": [
{
......@@ -66,16 +63,28 @@
"theseer/tokenizer": "^1.2.1"
},
"replace": {
"drupal/prometheus_exporter": "*"
"drupal/prometheus_exporter": "*"
},
"extra": {
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/{$name}": ["type:drupal-module"],
"web/profiles/{$name}": ["type:drupal-profile"],
"web/themes/{$name}": ["type:drupal-theme"],
"drush/{$name}": ["type:drupal-drush"]
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library"
],
"web/modules/{$name}": [
"type:drupal-module"
],
"web/profiles/{$name}": [
"type:drupal-profile"
],
"web/themes/{$name}": [
"type:drupal-theme"
],
"drush/{$name}": [
"type:drupal-drush"
]
},
"drupal-scaffold": {
"locations": {
......@@ -89,21 +98,21 @@
}
},
"scripts": {
"post-install-cmd": "@post-update-cmd",
"post-update-cmd": [
"@populate-web-modules-project"
],
"populate-web-modules-project": [
"rm -rf web/modules/project && mkdir -p web/modules/project",
"cp -r bin/ config/ modules/ src/ tests/ composer.* prometheusio_exporter.* web/modules/project/"
],
"phpqa": [
"@populate-web-modules-project",
"docker run --rm -it -v `pwd`:/app/drupal -v /tmp/reports:/app/reports ghcr.io/sparkfabrik/drupal-qa:latest vendor/bin/phpqa --analyzedDirs /app/drupal/web/modules/project --tools=phpmetrics,phploc,phpcs:0,php-cs-fixer,phpmd:0,pdepend,phpcpd,phpstan,phpunit,security-checker:0,parallel-lint:0"
],
"tests": [
"@populate-web-modules-project",
"docker run --rm -it -v `pwd`:/app/drupal -v /tmp/reports:/app/reports ghcr.io/sparkfabrik/drupal-qa:latest php ./drupal/web/core/scripts/run-tests.sh --php /usr/local/bin/php --sqlite /tmp/some.sql --dburl sqlite://localhost//tmp/some.sql --verbose --color --directory modules/project/"
]
"post-install-cmd": "@post-update-cmd",
"post-update-cmd": [
"@populate-web-modules-project"
],
"populate-web-modules-project": [
"rm -rf web/modules/project && mkdir -p web/modules/project",
"cp -r bin/ config/ modules/ src/ tests/ composer.* prometheusio_exporter.* web/modules/project/"
],
"phpqa": [
"@populate-web-modules-project",
"docker run --rm -it -v `pwd`:/app/drupal -v /tmp/reports:/app/reports ghcr.io/sparkfabrik/drupal-qa:latest vendor/bin/phpqa --analyzedDirs /app/drupal/web/modules/project --tools=phpmetrics,phploc,phpcs:0,php-cs-fixer,phpmd:0,pdepend,phpcpd,phpstan,phpunit,security-checker:0,parallel-lint:0"
],
"tests": [
"@populate-web-modules-project",
"docker run --rm -it -v `pwd`:/app/drupal -v /tmp/reports:/app/reports ghcr.io/sparkfabrik/drupal-qa:latest php ./drupal/web/core/scripts/run-tests.sh --php /usr/local/bin/php --sqlite /tmp/some.sql --dburl sqlite://localhost//tmp/some.sql --verbose --color --directory modules/project/"
]
}
}
......@@ -10,6 +10,7 @@ use Drupal\prometheusio_exporter\BaseMetricsSourceInterface;
use Prometheus\Collector;
use Prometheus\Storage\InMemory;
use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Update\UpdateBackend;
/**
* Alternative promphp storage class based on drupal cache.
......@@ -30,7 +31,7 @@ class DrupalCache extends InMemory implements RelatesSourceToMetricsInterface {
$backendIsPermanent = ($cacheBackend instanceof PermanentDatabaseBackend)
|| ($cacheBackend instanceof PermanentMemcacheBackend)
|| ($cacheBackend instanceof PermanentRedisBackend);
if (!$backendIsPermanent && !InstallerKernel::installationAttempted()) {
if (!$backendIsPermanent && !InstallerKernel::installationAttempted() && !$cacheBackend instanceof UpdateBackend) {
throw new \RuntimeException(<<<EOD
Please configure the drupal prometheusio_bin cache bin to use either
- cache.backend.permanent_database
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment