Commit graph

212 commits

Author SHA1 Message Date
Alexander A. Klimov
844af8c17a Deprecate Module#provideHook() and Hook methods in favor of Hook\Essentials ones 2026-04-13 11:35:04 +02:00
Eric Lippmann
662de28f85 License source files as GPL-3.0-or-later
Add SPDX license headers and mark source files as GPL-3.0-or-later to
preserve the option to relicense under later GPL versions.
2026-03-26 17:49:26 +01:00
Eric Lippmann
eb378ca0dc
Replace incubator module with icinga-php-legacy library (#5484)
The `icinga-php-legacy` library is the successor to the standalone
`icingaweb2-module-incubator` module. Modules such as director and
vspheredb that still declare `incubator` as a dependency should load
without a separate incubator installation once `icinga-php-legacy` is
present.

`Module::getRequiredLibraries` now maps an `incubator` module
requirement to an `icinga-php-legacy` library requirement when that
library is available, and `getRequiredModules` drops `incubator` from
the list so the dependency check does not fail. `Manager::loadModule`
skips calling `register()` for the incubator module under the same
condition, folding that guard into the existing `ipl`/`reactbundle`
exclusion to avoid a double-registration.

https://github.com/Icinga/icinga-php-legacy replaces
https://github.com/Icinga/icingaweb2-module-incubator.
2026-03-26 17:23:38 +01:00
Bastian Lederer
ea0ce32bc9 Change implicit nullable type declaration to explicit
Since PHP 8.4 implicitly nullable parameter types are deprecated.

Normalize scoped PHPDoc for nullable-parameter updates: use `?Type` instead of
`Type|null`, remove column alignment, and indent continuation lines with 2
spaces.

Co-authored-by: "Eric Lippmann <eric.lippmann@icinga.com>"
2026-03-10 16:40:27 +01:00
raviks789
1c0480d484 Module: Use correct name case for Web::getFrontController() method 2023-08-23 10:53:13 +02:00
Alexander A. Klimov
6de4bd6e7e Explicitly add Module#configdir as (non-dynamic) property
W/o this the login page, if on PHP 8.2, says:

Deprecated: Creation of dynamic property Icinga\Application\Modules\Module::$configdir is deprecated in /usr/share/icingaweb2/library/Icinga/Application/Modules/Module.php on line 264

This breaks modules (if any) which use the property and not the getter.
2023-08-23 10:53:13 +02:00
Sukhwinder Dhillon
f0f2835708 Module: Don't pass null as param to class_exists() 2022-07-05 15:42:15 +02:00
Sukhwinder Dhillon
55d23a531f Module: Remove deprecated method registerHook() 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon
c0d247613d Manager: Ensure enableModule dir has correct permission when created 2022-06-13 11:44:40 +02:00
Johannes Meyer
d78bb02b41 Module: Parse requirements in metadata correctly 2022-02-04 16:17:54 +01:00
Johannes Meyer
57e8e41089 Manager: Parse version suffixes with decimals correctly 2022-02-04 16:17:54 +01:00
Johannes Meyer
ffaf6e5f04 Remove module asset support 2022-02-04 15:57:15 +01:00
Sukhwinder Dhillon
2c01f38dec Add icingadb as OR dependecy
Add only if the given module supports icingadb and has monitoring as a requirement
2021-11-10 09:33:48 +01:00
Johannes Meyer
889c0a749c Module: Report ipl and reactbundle as library requirements
This way modules with the legacy requirement definition
can still be enabled without the modules in place.
2021-06-28 10:55:45 +02:00
Johannes Meyer
6a0da10473 Manager: Don't register the ipl and reactbundle module
Both are superseded by their respective library. This
way we make sure there are no competing auto loaders.
2021-06-22 12:50:59 +02:00
Johannes Meyer
4e3811cc84 Module: Allow / and - in module/library dependency names 2021-06-01 09:14:28 +02:00
Johannes Meyer
2e5abbc832 Use ipl-i18n's Translation trait where applicable 2021-05-28 14:03:36 +02:00
Johannes Meyer
8137f1546f Module: Register locales using ipl-i18n 2021-05-28 14:03:36 +02:00
Johannes Meyer
a33317aeab Module: Don't emit warnings for module assets
resolves #4286
2020-12-01 09:44:56 +01:00
Johannes Meyer
6956ec4450 Manager/Libraries: Don't try to compare versions if any version is sufficient 2020-11-24 15:31:11 +01:00
Johannes Meyer
be99703a67 Module: Deprecate asset support 2020-11-18 13:21:34 +01:00
Johannes Meyer
a370a99fb4 cli: Allow to ignore module dependencies with module enable --force 2020-11-18 13:21:34 +01:00
Johannes Meyer
28c7c41b55 Manager: Don't enable modules which have unmet dependencies 2020-11-18 13:21:33 +01:00
Johannes Meyer
aba8c4a8ba Manager: Add method hasUnmetDependencies($name) 2020-11-18 13:21:33 +01:00
Johannes Meyer
baaf663db3 Module: Introduce new metadata field Requires
This is the successor of `Depends` and allows to
define dependencies for libraries and modules:

`Requires: <lib-name>[ (<ver>)][, <lib-name>[ (<ver>)]] ...`

or

```
Requires:
  Libraries: <name>[ (<ver>)][, <name>[ (<ver>)]] ...
  Modules: <name>[ (<ver>)][, <name>[ (<ver>)]] ...
```
2020-11-18 13:21:33 +01:00
Johannes Meyer
99b620983a Manager: Add method has($name, $version = null) 2020-11-18 13:21:33 +01:00
Johannes Meyer
19e4eb6e1e Module: Add missing getter for property jsdir 2020-11-18 13:21:33 +01:00
Eric Lippmann
49eb245580 CLI: Also register assets
Because assets are not registered in the CLI context,
CLI actions cannot access the full style sheet.
This is necessary for Icinga Reporting though in order to send PDF reports.
2020-06-04 07:31:02 +02:00
Eric Lippmann
e11feb81f5 Don't fail with an exception if module.info is flawed 2020-03-12 14:26:15 +01:00
Johannes Meyer
5352e72d1f
Merge pull request #3946 from Icinga/fix/wrong-dashlet-order-3931
Fix wrong dashlet order
2019-09-26 14:34:13 +02:00
Johannes Meyer
d699191629
Let modules provide css/js assets to be used by other modules (#3961) 2019-09-25 09:53:53 +02:00
Johannes Meyer
d4dc282ac8 DashboardContainer: Allow to define a priority for dashlets
refs #3931
2019-09-09 14:43:28 +02:00
Johannes Meyer
4fdfb190ad Navigation/DashboardPane: Properly register dashlets as children
refs #3542
2019-07-18 08:33:35 +02:00
Loei Petrus Marogi
617f1b35b3 Add possibility to let hooks always run
refs #3772
2019-07-11 13:36:33 +02:00
Bas Couwenberg
075eb17005 Use continue <N> in case statements to fix ErrorException with PHP 7.3.
```
Fatal error: Uncaught ErrorException: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
```
2018-11-23 18:34:56 +01:00
lippserd
c1497cf1c5
Merge pull request #3143 from Icinga/bugfix/inactive-module-config-tabs-2977
Hide inactive modules' config tabs
2018-01-16 09:18:49 +01:00
Alexander A. Klimov
a5e75554ad Don't require module.less
refs #3149
2017-12-15 11:58:54 +01:00
Alexander A. Klimov
6cdad7c5c1 Hide inactive modules' config tabs
refs #2977
2017-11-24 13:40:03 +01:00
Thomas Gelf
6e382093f4 Modules, Bootstrap: play nice with PHARs
fixes #3113
2017-11-21 14:15:41 +01:00
Alexander A. Klimov
cbfbb3a162 Handle enabled, but deleted modules properly
refs #2811
2017-11-08 09:48:58 +01:00
Johannes Meyer
181e2ef05c Swag: Fix swag (aka a whole bunch of code style issues..) 2017-01-27 14:48:59 +01:00
Eric Lippmann
326574ba54 Fix deprecation notes for Module::registerHook() 2017-01-17 12:30:14 +01:00
Eric Lippmann
39a5b3f64a Refuse to enable modules prefixed w/ icingaweb2-module-
fixes #10870
2016-11-16 16:21:35 +01:00
Eric Lippmann
1cdef234a1 Revert "Module: Drop deprecated method registerHook and arg $key of method provideHook"
This reverts commit f1a1f41192.

It makes absolutely sense to remove depcreated code, but this removal introduces too many problems while not being really necessary.
Some of our modules and modules written by others still rely on the deprecated code. A upgrade of Icinga Web 2 would break many running systems out there.
Before removing this code we should upgrade our modules and notify the authors of other modules about the deprecation.
Further, we should maintain something like a deprecation info file because nobody reads @deprecated tags.
All of the above will not protect us from systems where modules aren't up to date. We also have to implement a mechanism where it is still possible to disable faulty modules.
2016-11-16 16:17:42 +01:00
Johannes Meyer
f1a1f41192 Module: Drop deprecated method registerHook and arg $key of method provideHook 2016-11-11 16:15:59 +01:00
Alexander A. Klimov
1cd2cfbdc9 Revert "Make hooks respect module permissions"
This reverts commit 4d2e6d2d87.
2016-11-11 11:14:23 +01:00
Alexander A. Klimov
4d2e6d2d87 Make hooks respect module permissions
refs #12396
2016-10-20 18:28:19 +02:00
Johannes Meyer
7ed3acbbd8 Module: Check a menu item's permission and don't overwrite its label
This allows now totally different values for an item's name and label
and fixes the bug that permissions declared in the configuration.php
were not evaluated for menu items.

fixes #11431
2016-09-26 11:01:26 +02:00
Eric Lippmann
54b43efb33 Fix exception if module.info contains newlines that are not part of the module's description
fixes #11831
2016-06-06 16:21:10 +02:00
Alexander A. Klimov
1bbb7a3118 Manager::detectEnabledModules(): shorten error message 2016-02-25 17:34:03 +01:00