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


PHP Piwik\Plugin类代码示例

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


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

示例1: getVersion

 private function getVersion($component)
 {
     if ($component === 'core') {
         return Version::VERSION;
     }
     $pluginManager = Plugin\Manager::getInstance();
     if ($pluginManager->isPluginLoaded($component)) {
         $plugin = $pluginManager->getLoadedPlugin($component);
     } else {
         $plugin = new Plugin($component);
     }
     return $plugin->getVersion();
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:13,代码来源:GenerateUpdate.php

示例2: getJavaScriptFiles

 public function getJavaScriptFiles()
 {
     if ($this->themeName == \Piwik\Plugin\Manager::DEFAULT_THEME) {
         return false;
     }
     $info = $this->theme->getInformation();
     if (empty($info['javascript'])) {
         return false;
     }
     $jsFiles = $info['javascript'];
     if (!is_array($jsFiles)) {
         $jsFiles = array($jsFiles);
     }
     foreach ($jsFiles as &$jsFile) {
         $jsFile = 'plugins/' . $this->theme->getPluginName() . '/' . $jsFile;
     }
     return $jsFiles;
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:18,代码来源:Theme.php

示例3: getLoggingClassName

 /**
  * Returns the name of the plugin/class that triggered the log.
  *
  * @return string
  */
 private function getLoggingClassName()
 {
     $backtrace = $this->getBacktrace();
     $name = Plugin::getPluginNameFromBacktrace($backtrace);
     // if we can't determine the plugin, use the name of the calling class
     if ($name == false) {
         $name = $this->getClassNameThatIsLogging($backtrace);
     }
     return $name;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:15,代码来源:ClassNameProcessor.php

示例4: installPluginIfNecessary

 /**
  * Install a plugin, if necessary
  *
  * @param Plugin $plugin
  */
 private function installPluginIfNecessary(Plugin $plugin)
 {
     $pluginName = $plugin->getPluginName();
     $saveConfig = false;
     // is the plugin already installed or is it the first time we activate it?
     $pluginsInstalled = $this->getInstalledPluginsName();
     if (!$this->isPluginInstalled($pluginName)) {
         $this->executePluginInstall($plugin);
         $pluginsInstalled[] = $pluginName;
         $this->updatePluginsInstalledConfig($pluginsInstalled);
         $updater = new Updater();
         $updater->markComponentSuccessfullyUpdated($plugin->getPluginName(), $plugin->getVersion());
         $saveConfig = true;
     }
     if ($saveConfig) {
         PiwikConfig::getInstance()->forceSave();
     }
 }
开发者ID:962464,项目名称:piwik,代码行数:23,代码来源:Manager.php

示例5: isTrackerPlugin

 public function isTrackerPlugin(Plugin $plugin)
 {
     $hooks = $plugin->getListHooksRegistered();
     $hookNames = array_keys($hooks);
     foreach ($hookNames as $name) {
         if (strpos($name, self::TRACKER_EVENT_PREFIX) === 0) {
             return true;
         }
         if ($name === 'Request.initAuthenticationObject') {
             return true;
         }
     }
     return false;
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:14,代码来源:Manager.php

示例6: loadAllPlugins

 public static function loadAllPlugins($testEnvironment = null, $testCaseClass = false, $extraPluginsToLoad = array())
 {
     if (empty($testEnvironment)) {
         $testEnvironment = new Piwik_TestingEnvironment();
     }
     DbHelper::createTables();
     $pluginsManager = \Piwik\Plugin\Manager::getInstance();
     $plugins = $testEnvironment->getCoreAndSupportedPlugins();
     // make sure the plugin that executed this method is included in the plugins to load
     $extraPlugins = array_merge($extraPluginsToLoad, array(\Piwik\Plugin::getPluginNameFromBacktrace(debug_backtrace()), \Piwik\Plugin::getPluginNameFromNamespace($testCaseClass), \Piwik\Plugin::getPluginNameFromNamespace(get_called_class())));
     foreach ($extraPlugins as $pluginName) {
         if (empty($pluginName)) {
             continue;
         }
         if (in_array($pluginName, $plugins)) {
             continue;
         }
         $plugins[] = $pluginName;
         if ($testEnvironment) {
             $testEnvironment->pluginsToLoad = array_merge($testEnvironment->pluginsToLoad ?: array(), array($pluginName));
         }
     }
     Log::debug("Plugins to load during tests: " . implode(', ', $plugins));
     $pluginsManager->loadPlugins($plugins);
 }
开发者ID:igorclark,项目名称:piwik,代码行数:25,代码来源:Fixture.php

示例7: getDbName

 public function getDbName()
 {
     if ($this->dbName !== false) {
         return $this->dbName;
     }
     if ($this->persistFixtureData) {
         $klass = new ReflectionClass($this);
         $id = Plugin::getPluginNameFromNamespace($klass->getNamespaceName()) . "_" . $klass->getShortName();
         return $id;
     }
     return self::getConfig()->database_tests['dbname'];
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:12,代码来源:Fixture.php

示例8: getThemeName

 public function getThemeName()
 {
     return $this->plugin->getPluginName();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:4,代码来源:ThemeMock.php

示例9: getCustomThemeLoader

 /**
  * create template loader for a custom theme
  * @param \Piwik\Plugin $theme
  * @return \Twig_Loader_Filesystem
  */
 protected function getCustomThemeLoader(Plugin $theme)
 {
     if (!file_exists(sprintf("%s/plugins/%s/templates/", PIWIK_INCLUDE_PATH, $theme->getPluginName()))) {
         return false;
     }
     $themeLoader = new Twig_Loader_Filesystem(array(sprintf("%s/plugins/%s/templates/", PIWIK_INCLUDE_PATH, $theme->getPluginName())));
     return $themeLoader;
 }
开发者ID:TensorWrenchOSS,项目名称:piwik,代码行数:13,代码来源:Twig.php

示例10: isTrackerPlugin

 protected function isTrackerPlugin(Plugin $plugin)
 {
     $hooks = $plugin->getListHooksRegistered();
     $hookNames = array_keys($hooks);
     foreach ($hookNames as $name) {
         if (strpos($name, self::TRACKER_EVENT_PREFIX) === 0) {
             return true;
         }
     }
     return false;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:11,代码来源:Manager.php

示例11: createThemeFromPlugin

 /**
  * @param Plugin $plugin
  */
 private function createThemeFromPlugin($plugin)
 {
     $this->theme = $plugin;
     $this->themeName = $plugin->getPluginName();
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:8,代码来源:Theme.php

示例12: getLocationProviders

 /**
  * Get all lo that are defined by the given plugin.
  *
  * @param Plugin $plugin
  * @return LocationProvider[]
  */
 protected static function getLocationProviders(Plugin $plugin)
 {
     $locationProviders = $plugin->findMultipleComponents('LocationProvider', 'Piwik\\Plugins\\UserCountry\\LocationProvider');
     $instances = [];
     foreach ($locationProviders as $locationProvider) {
         $instances[] = new $locationProvider();
     }
     return $instances;
 }
开发者ID:piwik,项目名称:piwik,代码行数:15,代码来源:LocationProvider.php

示例13: isTrackerPlugin

 public function isTrackerPlugin(Plugin $plugin)
 {
     if (!$this->isPluginInstalled($plugin->getPluginName())) {
         return false;
     }
     if ($plugin->isTrackerPlugin()) {
         return true;
     }
     $dimensions = VisitDimension::getDimensions($plugin);
     if (!empty($dimensions)) {
         return true;
     }
     $dimensions = ActionDimension::getDimensions($plugin);
     if (!empty($dimensions)) {
         return true;
     }
     $hooks = $plugin->getListHooksRegistered();
     $hookNames = array_keys($hooks);
     foreach ($hookNames as $name) {
         if (strpos($name, self::TRACKER_EVENT_PREFIX) === 0) {
             return true;
         }
         if ($name === 'Request.initAuthenticationObject') {
             return true;
         }
     }
     $dimensions = ConversionDimension::getDimensions($plugin);
     if (!empty($dimensions)) {
         return true;
     }
     return false;
 }
开发者ID:mgou-net,项目名称:piwik,代码行数:32,代码来源:Manager.php

示例14: getInformation

 public function getInformation()
 {
     $info = parent::getInformation();
     $info['author'] = 'Piwik PRO';
     $info['author_homepage'] = 'http://piwik.pro';
     return $info;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:7,代码来源:MultiSites.php

示例15: getInformation

 public function getInformation()
 {
     $suffix = ' Note: Requires the Transitions plugin enabled.';
     $info = parent::getInformation();
     $info['description'] .= ' ' . $suffix;
     return $info;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:7,代码来源:Overlay.php


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