本文整理匯總了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;
}