Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prometheusio_exporter
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
prometheusio_exporter
Commits
ef7634dd
Commit
ef7634dd
authored
3 years ago
by
Giuseppe Rota
Browse files
Options
Downloads
Patches
Plain Diff
Added checks to prevent installing this module when webprofiler is present
parent
1686c30f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+5
-0
5 additions, 0 deletions
CHANGELOG.md
prometheusio_exporter.install
+21
-0
21 additions, 0 deletions
prometheusio_exporter.install
prometheusio_exporter.module
+19
-0
19 additions, 0 deletions
prometheusio_exporter.module
with
45 additions
and
0 deletions
CHANGELOG.md
+
5
−
0
View file @
ef7634dd
...
...
@@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.0-rc3] - 2021-09-16
### Added
-
A bunch of explicit dev deps to make both drupalci odd pipelines work and local
`composer run tests`
.
-
Checks to prevent installing this module when webprofiler is present.
Webprofiler changes without discrimination the cache backend classes even is
a bin
`->`
backend association is forced in the settings.php.
Webprofiler's cache backend class does not have pcb's
`deleteAllPermanent`
method.
## [1.0-rc2] - 2021-08-20
...
...
This diff is collapsed.
Click to expand it.
prometheusio_exporter.install
0 → 100644
+
21
−
0
View file @
ef7634dd
<?php
/**
* @file
* This is the Prometheus Exporter module for exporting metrics.
*/
/**
* Implements hook_requirements().
*/
function
prometheusio_exporter_requirements
(
$phase
)
{
$requirements
=
[];
if
(
$phase
===
'install'
&&
\Drupal
::
service
(
'module_handler'
)
->
moduleExists
(
'webprofiler'
))
{
$requirements
[
'prometheusio_exporter_incompatible_with_webprofiler'
]
=
[
'title'
=>
t
(
'PrometheusIO exporter incompatible with webprofiler.'
),
'description'
=>
t
(
'PrometheusIO exporter is incompatible with webprofiler, please uninstall webprofiler first.'
),
'severity'
=>
REQUIREMENT_ERROR
,
];
}
return
$requirements
;
}
This diff is collapsed.
Click to expand it.
prometheusio_exporter.module
+
19
−
0
View file @
ef7634dd
...
...
@@ -40,3 +40,22 @@ function prometheusio_exporter_modules_installed($modules, $is_syncing) {
$collector_manager
->
syncPluginConfig
();
}
}
/**
* Implements hook_module_preinstall().
*
* Launch an exception if webprofiler is present.
* The hook_requirements in .install is enough for web based module
* installation but not enough for (all versions of) drush.
* See https://github.com/drush-ops/drush/pull/4337 .
*/
function
prometheusio_exporter_module_preinstall
()
{
if
(
\Drupal
::
service
(
'module_handler'
)
->
moduleExists
(
'webprofiler'
))
{
$extension_config
=
\Drupal
::
configFactory
()
->
getEditable
(
'core.extension'
);
$modules
=
$extension_config
->
get
(
'module'
);
unset
(
$modules
[
'prometheusio_exporter'
]);
$extension_config
->
set
(
'module'
,
$modules
)
->
save
(
TRUE
);
drupal_flush_all_caches
();
throw
new
\Exception
(
'Prometheus.io Exporter is incompatible with webprofiler, please uninstall webprofiler first.'
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment