当前位置: 首页>>代码示例>>PHP>>正文


PHP Manager::isPluginActivated方法代码示例

本文整理汇总了PHP中Piwik\Plugin\Manager::isPluginActivated方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::isPluginActivated方法的具体用法?PHP Manager::isPluginActivated怎么用?PHP Manager::isPluginActivated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Plugin\Manager的用法示例。


在下文中一共展示了Manager::isPluginActivated方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_deactivatePlugin

 public function test_deactivatePlugin()
 {
     $this->assertFalse($this->manager->isPluginActivated('ExampleTheme'));
     $this->manager->activatePlugin('ExampleTheme');
     $this->assertTrue($this->manager->isPluginActivated('ExampleTheme'));
     $this->manager->deactivatePlugin('ExampleTheme');
     $this->assertFalse($this->manager->isPluginActivated('ExampleTheme'));
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:8,代码来源:ManagerTest.php

示例2: arePiwikProAdsEnabled

 /**
  * Returns true if it is ok to show some Piwik PRO advertising in the Piwik UI.
  * @return bool
  */
 public function arePiwikProAdsEnabled()
 {
     if ($this->pluginManager->isPluginActivated('EnterpriseAdmin') || $this->pluginManager->isPluginActivated('LoginAdmin') || $this->pluginManager->isPluginActivated('CloudAdmin') || $this->pluginManager->isPluginActivated('WhiteLabel')) {
         return false;
     }
     $showAds = $this->config->General['piwik_pro_ads_enabled'];
     return !empty($showAds);
 }
开发者ID:aassou,项目名称:AnnahdaWebsiteCanvas,代码行数:12,代码来源:Advertising.php

示例3: isPluginActivated

 private function isPluginActivated($pluginName)
 {
     if (in_array($pluginName, $this->activatedPluginNames)) {
         return true;
     }
     return $this->pluginManager->isPluginActivated($pluginName);
 }
开发者ID:piwik,项目名称:piwik,代码行数:7,代码来源:Plugins.php

示例4: uploadPlugin

 public function uploadPlugin()
 {
     static::dieIfPluginsAdminIsDisabled();
     Piwik::checkUserHasSuperUserAccess();
     $nonce = Common::getRequestVar('nonce', null, 'string');
     if (!Nonce::verifyNonce(MarketplaceController::INSTALL_NONCE, $nonce)) {
         throw new \Exception($this->translator->translate('General_ExceptionNonceMismatch'));
     }
     Nonce::discardNonce(MarketplaceController::INSTALL_NONCE);
     if (empty($_FILES['pluginZip'])) {
         throw new \Exception('You did not specify a ZIP file.');
     }
     if (!empty($_FILES['pluginZip']['error'])) {
         throw new \Exception('Something went wrong during the plugin file upload. Please try again.');
     }
     $file = $_FILES['pluginZip']['tmp_name'];
     if (!file_exists($file)) {
         throw new \Exception('Something went wrong during the plugin file upload. Please try again.');
     }
     $view = $this->configureView('@CorePluginsAdmin/uploadPlugin');
     $pluginMetadata = $this->pluginInstaller->installOrUpdatePluginFromFile($file);
     $view->nonce = Nonce::getNonce(static::ACTIVATE_NONCE);
     $view->plugin = array('name' => $pluginMetadata->name, 'version' => $pluginMetadata->version, 'isTheme' => !empty($pluginMetadata->theme), 'isActivated' => $this->pluginManager->isPluginActivated($pluginMetadata->name));
     return $view->render();
 }
开发者ID:piwik,项目名称:piwik,代码行数:25,代码来源:Controller.php

示例5: canPluginBeInstalled

 private function canPluginBeInstalled($plugin)
 {
     if (empty($plugin['isDownloadable'])) {
         return false;
     }
     $pluginName = $plugin['name'];
     $isAlreadyInstalled = $this->pluginManager->isPluginInstalled($pluginName) || $this->pluginManager->isPluginLoaded($pluginName) || $this->pluginManager->isPluginActivated($pluginName);
     return !$isAlreadyInstalled;
 }
开发者ID:piwik,项目名称:piwik,代码行数:9,代码来源:Controller.php

示例6: getLoadedAndActivated

 private function getLoadedAndActivated($pluginName)
 {
     if (!$this->pluginManager->isPluginLoaded($pluginName)) {
         return;
     }
     try {
         if (!$this->pluginManager->isPluginActivated($pluginName)) {
             return;
         }
         $plugin = $this->pluginManager->getLoadedPlugin($pluginName);
     } catch (\Exception $e) {
         // we are not allowed to use possible settings from this plugin, plugin is not active
         return;
     }
     return $plugin;
 }
开发者ID:piwik,项目名称:piwik,代码行数:16,代码来源:SettingsProvider.php

示例7: factory

 /**
  * Get the widget defined by the given module and action.
  *
  * @param string $module Aka plugin name, eg 'CoreHome'
  * @param string $action An action eg 'renderMe'
  * @return Widget|null
  * @throws \Exception Throws an exception if the widget is not enabled.
  */
 public function factory($module, $action)
 {
     if (empty($module) || empty($action)) {
         return;
     }
     try {
         if (!$this->pluginManager->isPluginActivated($module)) {
             return;
         }
         $plugin = $this->pluginManager->getLoadedPlugin($module);
     } catch (\Exception $e) {
         // we are not allowed to use possible widgets, plugin is not active
         return;
     }
     /** @var Widget[] $widgetContainer */
     $widgets = $plugin->findMultipleComponents('Widgets', 'Piwik\\Widget\\Widget');
     foreach ($widgets as $widgetClass) {
         $config = $this->getWidgetConfigForClassName($widgetClass);
         if ($config->getAction() === $action) {
             $config->checkIsEnabled();
             return StaticContainer::get($widgetClass);
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:32,代码来源:WidgetsProvider.php

示例8: exec

 public function exec()
 {
     if (!$this->pluginManager->isPluginActivated($this->pluginName)) {
         $this->pluginManager->activatePlugin($this->pluginName);
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:6,代码来源:Activate.php

示例9: isPluginActivated

 protected function isPluginActivated($pluginName)
 {
     return $this->pluginManager->isPluginActivated($pluginName);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:4,代码来源:PluginTrackerFiles.php

示例10: makeSiteSearchCategory

 private function makeSiteSearchCategory(Plugin\Manager $pluginManager)
 {
     return $this->makeProperty('sitesearch_category_parameters', $default = array(), FieldConfig::TYPE_ARRAY, function (FieldConfig $field) use($pluginManager) {
         $field->title = Piwik::translate('SitesManager_SearchCategoryLabel');
         $field->uiControl = FieldConfig::UI_CONTROL_TEXT;
         $field->inlineHelp = Piwik::translate('Goals_Optional') . '<br /><br />' . Piwik::translate('SitesManager_SearchCategoryParametersDesc');
         $hasCustomVars = (int) $pluginManager->isPluginActivated('CustomVariables');
         $field->condition = $hasCustomVars . ' && sitesearch && !use_default_site_search_params';
     });
 }
开发者ID:piwik,项目名称:piwik,代码行数:10,代码来源:MeasurableSettings.php


注:本文中的Piwik\Plugin\Manager::isPluginActivated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。