diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-01-16 03:26:34 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2020-01-16 03:26:34 +0300 |
commit | 7c059ecb5e433dec3538398c8413c45cd68a0c0b (patch) | |
tree | 026af3bafbd20f69b1aca757151c1d51a3bdfcd6 /plugins | |
parent | 8e2db8e1206e6778f3198558b05c25d655fc99e6 (diff) |
Removes some methods deprecated for Matomo 4 (#15386)
* Removes deprecated Plugin.getListHooksRegistered and uses Plugin.registerEvents instead
* Removes deprecated method Piwik\Piwik::doAsSuperUser
* Remove deprecated SettingsPiwik::isPiwikInstalled and use SettingsPiwik::isMatomoInstalled instead
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CorePluginsAdmin/Controller.php | 3 | ||||
-rw-r--r-- | plugins/CustomPiwikJs/CustomPiwikJs.php | 2 | ||||
-rw-r--r-- | plugins/Diagnostics/Diagnostic/DbMaxPacket.php | 2 | ||||
-rw-r--r-- | plugins/ExampleTheme/ExampleTheme.php | 2 | ||||
-rw-r--r-- | plugins/Installation/Controller.php | 2 | ||||
-rw-r--r-- | plugins/Installation/Installation.php | 2 | ||||
-rw-r--r-- | plugins/Intl/Intl.php | 2 | ||||
-rw-r--r-- | plugins/LanguagesManager/Menu.php | 2 | ||||
-rw-r--r-- | plugins/Login/config/test.php | 4 | ||||
-rw-r--r-- | plugins/TwoFactorAuth/TwoFactorAuth.php | 2 | ||||
-rw-r--r-- | plugins/TwoFactorAuth/Validator.php | 4 | ||||
-rw-r--r-- | plugins/TwoFactorAuth/config/test.php | 6 |
12 files changed, 17 insertions, 16 deletions
diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index 4d8c4a0e16..9d5db72985 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\CorePluginsAdmin; use Exception; +use Piwik\Access; use Piwik\API\Request; use Piwik\Common; use Piwik\Container\StaticContainer; @@ -483,7 +484,7 @@ class Controller extends Plugin\ControllerAdmin public function deactivate($redirectAfter = true) { if($this->isAllowedToTroubleshootAsSuperUser()) { - Piwik::doAsSuperUser(function() use ($redirectAfter) { + Access::doAsSuperUser(function() use ($redirectAfter) { $this->doDeactivatePlugin($redirectAfter); }); } else { diff --git a/plugins/CustomPiwikJs/CustomPiwikJs.php b/plugins/CustomPiwikJs/CustomPiwikJs.php index 1dcb0c4c65..1be7831212 100644 --- a/plugins/CustomPiwikJs/CustomPiwikJs.php +++ b/plugins/CustomPiwikJs/CustomPiwikJs.php @@ -14,7 +14,7 @@ use Piwik\Plugin; class CustomPiwikJs extends Plugin { - public function getListHooksRegistered() + public function registerEvents() { return array( 'CoreUpdater.update.end' => 'updateTracker', diff --git a/plugins/Diagnostics/Diagnostic/DbMaxPacket.php b/plugins/Diagnostics/Diagnostic/DbMaxPacket.php index 91745db88d..a771ba564d 100644 --- a/plugins/Diagnostics/Diagnostic/DbMaxPacket.php +++ b/plugins/Diagnostics/Diagnostic/DbMaxPacket.php @@ -27,7 +27,7 @@ class DbMaxPacket implements Diagnostic public function execute() { - if (!SettingsPiwik::isPiwikInstalled()) { + if (!SettingsPiwik::isMatomoInstalled()) { return array(); // only possible to perform check once we have DB connection } diff --git a/plugins/ExampleTheme/ExampleTheme.php b/plugins/ExampleTheme/ExampleTheme.php index a391f0daca..e39c69b955 100644 --- a/plugins/ExampleTheme/ExampleTheme.php +++ b/plugins/ExampleTheme/ExampleTheme.php @@ -13,7 +13,7 @@ use Piwik\Plugin; class ExampleTheme extends Plugin { - public function getListHooksRegistered() + public function registerEvents() { return [ 'Theme.configureThemeVariables' => 'configureThemeVariables', diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index 0392f96b5e..27ba28e91a 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -619,7 +619,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin private function checkPiwikIsNotInstalled($possibleErrorMessage = null) { - if (!SettingsPiwik::isPiwikInstalled()) { + if (!SettingsPiwik::isMatomoInstalled()) { return; } diff --git a/plugins/Installation/Installation.php b/plugins/Installation/Installation.php index 5bd24575a4..a889d81037 100644 --- a/plugins/Installation/Installation.php +++ b/plugins/Installation/Installation.php @@ -64,7 +64,7 @@ class Installation extends \Piwik\Plugin { $general = Config::getInstance()->General; - if (!SettingsPiwik::isPiwikInstalled() && !$general['enable_installer']) { + if (!SettingsPiwik::isMatomoInstalled() && !$general['enable_installer']) { throw new NotYetInstalledException('Matomo is not set up yet'); } diff --git a/plugins/Intl/Intl.php b/plugins/Intl/Intl.php index 8f44e8d06a..5d14304b5f 100644 --- a/plugins/Intl/Intl.php +++ b/plugins/Intl/Intl.php @@ -10,7 +10,7 @@ namespace Piwik\Plugins\Intl; class Intl extends \Piwik\Plugin { - public function getListHooksRegistered() + public function registerEvents() { return [ 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', diff --git a/plugins/LanguagesManager/Menu.php b/plugins/LanguagesManager/Menu.php index a5707b0a08..f3a2e8449a 100644 --- a/plugins/LanguagesManager/Menu.php +++ b/plugins/LanguagesManager/Menu.php @@ -18,7 +18,7 @@ class Menu extends \Piwik\Plugin\Menu { public function configureTopMenu(MenuTop $menu) { - if (Piwik::isUserIsAnonymous() || !SettingsPiwik::isPiwikInstalled()) { + if (Piwik::isUserIsAnonymous() || !SettingsPiwik::isMatomoInstalled()) { $langManager = new LanguagesManager(); $menu->addHtml('LanguageSelector', $langManager->getLanguagesSelector(), true, $order = 30, false); } diff --git a/plugins/Login/config/test.php b/plugins/Login/config/test.php index cf83aaabdb..30717d24d5 100644 --- a/plugins/Login/config/test.php +++ b/plugins/Login/config/test.php @@ -6,7 +6,7 @@ return array( \Piwik\Access::doAsSuperUser(function () use ($settings, $c) { if ($c->get('test.vars.bruteForceBlockIps')) { $settings->blacklistedBruteForceIps->setValue(array('10.2.3.4')); - } elseif (\Piwik\SettingsPiwik::isPiwikInstalled()) { + } elseif (\Piwik\SettingsPiwik::isMatomoInstalled()) { $settings->blacklistedBruteForceIps->setValue(array()); } }); @@ -26,7 +26,7 @@ return array( // we block this IP $detection->addFailedAttempt(\Piwik\IP::getIpFromHeader()); } - } elseif (\Piwik\SettingsPiwik::isPiwikInstalled()) { + } elseif (\Piwik\SettingsPiwik::isMatomoInstalled()) { // prevent tests from blocking other tests $detection->deleteAll(); } diff --git a/plugins/TwoFactorAuth/TwoFactorAuth.php b/plugins/TwoFactorAuth/TwoFactorAuth.php index fe1c3f465f..9b86925b36 100644 --- a/plugins/TwoFactorAuth/TwoFactorAuth.php +++ b/plugins/TwoFactorAuth/TwoFactorAuth.php @@ -109,7 +109,7 @@ class TwoFactorAuth extends \Piwik\Plugin public function onApiGetTokenAuth($returnedValue, $params) { - if (!SettingsPiwik::isPiwikInstalled()) { + if (!SettingsPiwik::isMatomoInstalled()) { return; } diff --git a/plugins/TwoFactorAuth/Validator.php b/plugins/TwoFactorAuth/Validator.php index 77b4bb2714..382ad5f99c 100644 --- a/plugins/TwoFactorAuth/Validator.php +++ b/plugins/TwoFactorAuth/Validator.php @@ -34,7 +34,7 @@ class Validator return false; } - if (!SettingsPiwik::isPiwikInstalled()) { + if (!SettingsPiwik::isMatomoInstalled()) { return false; } @@ -45,7 +45,7 @@ class Validator { Piwik::checkUserIsNotAnonymous(); - if (!SettingsPiwik::isPiwikInstalled()) { + if (!SettingsPiwik::isMatomoInstalled()) { throw new NotYetInstalledException('Matomo is not set up yet'); } } diff --git a/plugins/TwoFactorAuth/config/test.php b/plugins/TwoFactorAuth/config/test.php index 7023790fe4..617eb132cd 100644 --- a/plugins/TwoFactorAuth/config/test.php +++ b/plugins/TwoFactorAuth/config/test.php @@ -6,7 +6,7 @@ return array( 'Piwik\Plugins\TwoFactorAuth\TwoFactorAuthentication' => DI\decorate(function ($previous) { /** @var Piwik\Plugins\TwoFactorAuth\TwoFactorAuthentication $previous */ - if (!\Piwik\SettingsPiwik::isPiwikInstalled()) { + if (!\Piwik\SettingsPiwik::isMatomoInstalled()) { return $previous; } @@ -30,7 +30,7 @@ return array( 'Piwik\Plugins\TwoFactorAuth\Dao\RecoveryCodeDao' => DI\decorate(function ($previous) { /** @var Piwik\Plugins\TwoFactorAuth\Dao\RecoveryCodeDao $previous */ - if (!\Piwik\SettingsPiwik::isPiwikInstalled()) { + if (!\Piwik\SettingsPiwik::isMatomoInstalled()) { return $previous; } @@ -47,7 +47,7 @@ return array( }), 'Piwik\Plugins\TwoFactorAuth\SystemSettings' => DI\decorate(function ($previous) { /** @var Piwik\Plugins\TwoFactorAuth\SystemSettings $previous */ - if (!\Piwik\SettingsPiwik::isPiwikInstalled()) { + if (!\Piwik\SettingsPiwik::isMatomoInstalled()) { return $previous; } |