本文整理汇总了PHP中Piwik\Plugin\Manager::getLoadedPlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::getLoadedPlugins方法的具体用法?PHP Manager::getLoadedPlugins怎么用?PHP Manager::getLoadedPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Plugin\Manager
的用法示例。
在下文中一共展示了Manager::getLoadedPlugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertOnlyTrackerPluginsAreLoaded
private function assertOnlyTrackerPluginsAreLoaded($expectedPluginNamesLoaded)
{
// should currently load between 10 and 25 plugins
$this->assertLessThan(25, count($this->manager->getLoadedPlugins()));
$this->assertGreaterThan(10, count($this->manager->getLoadedPlugins()));
// we need to make sure it actually only loaded the correct ones
$this->assertEquals($expectedPluginNamesLoaded, array_keys($this->manager->getLoadedPlugins()));
}
示例2: getPluginsHavingUpdate
/**
* @param bool $themesOnly
* @return array
*/
public function getPluginsHavingUpdate()
{
$this->pluginManager->loadAllPluginsAndGetTheirInfo();
$loadedPlugins = $this->pluginManager->getLoadedPlugins();
try {
$pluginsHavingUpdate = $this->marketplaceClient->getInfoOfPluginsHavingUpdate($loadedPlugins);
} catch (\Exception $e) {
$pluginsHavingUpdate = array();
}
foreach ($pluginsHavingUpdate as $key => $updatePlugin) {
foreach ($loadedPlugins as $loadedPlugin) {
if (!empty($updatePlugin['name']) && $loadedPlugin->getPluginName() == $updatePlugin['name']) {
$updatePlugin['currentVersion'] = $loadedPlugin->getVersion();
$updatePlugin['isActivated'] = $this->pluginManager->isPluginActivated($updatePlugin['name']);
$pluginsHavingUpdate[$key] = $this->addMissingRequirements($updatePlugin);
break;
}
}
}
// remove plugins that have updates but for some reason are not loaded
foreach ($pluginsHavingUpdate as $key => $updatePlugin) {
if (empty($updatePlugin['currentVersion'])) {
unset($pluginsHavingUpdate[$key]);
}
}
return $pluginsHavingUpdate;
}