本文整理汇总了PHP中Piwik\Plugin\Manager::isPluginBundledWithCore方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::isPluginBundledWithCore方法的具体用法?PHP Manager::isPluginBundledWithCore怎么用?PHP Manager::isPluginBundledWithCore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Plugin\Manager
的用法示例。
在下文中一共展示了Manager::isPluginBundledWithCore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCoreAndSupportedPlugins
public function getCoreAndSupportedPlugins()
{
$settings = new \Piwik\Application\Kernel\GlobalSettingsProvider();
$pluginList = new \Piwik\Application\Kernel\PluginList($settings);
$pluginManager = new PluginManager($pluginList);
$disabledPlugins = $pluginList->getCorePluginsDisabledByDefault();
$disabledPlugins[] = 'LoginHttpAuth';
$disabledPlugins[] = 'ExampleVisualization';
$disabledPlugins = array_diff($disabledPlugins, array('DBStats', 'ExampleUI', 'ExampleCommand', 'ExampleSettingsPlugin'));
$plugins = array_filter($pluginManager->readPluginsDirectory(), function ($pluginName) use($disabledPlugins, $pluginManager) {
if (in_array($pluginName, $disabledPlugins)) {
return false;
}
return $pluginManager->isPluginBundledWithCore($pluginName) || $pluginManager->isPluginOfficialAndNotBundledWithCore($pluginName);
});
sort($plugins);
return $plugins;
}
示例2: checkUpdates
/**
* @param \Piwik\Plugin[] $plugins
* @return array|mixed
*/
public function checkUpdates($plugins)
{
$params = array();
foreach ($plugins as $plugin) {
$pluginName = $plugin->getPluginName();
if (!$this->pluginManager->isPluginBundledWithCore($pluginName)) {
$params[] = array('name' => $plugin->getPluginName(), 'version' => $plugin->getVersion());
}
}
if (empty($params)) {
return array();
}
$params = array('plugins' => $params);
$hasUpdates = $this->fetch('plugins/checkUpdates', array('plugins' => json_encode($params)));
if (empty($hasUpdates)) {
return array();
}
return $hasUpdates;
}
示例3: getPluginsInfo
protected function getPluginsInfo($themesOnly = false)
{
$plugins = $this->pluginManager->loadAllPluginsAndGetTheirInfo();
foreach ($plugins as $pluginName => &$plugin) {
$plugin['isCorePlugin'] = $this->pluginManager->isPluginBundledWithCore($pluginName);
if (!empty($plugin['info']['description'])) {
$plugin['info']['description'] = $this->translator->translate($plugin['info']['description']);
}
if (!isset($plugin['info'])) {
$suffix = $this->translator->translate('CorePluginsAdmin_PluginNotWorkingAlternative');
// If the plugin has been renamed, we do not show message to ask user to update plugin
list($pluginNameRenamed, $methodName) = Request::getRenamedModuleAndAction($pluginName, 'index');
if ($pluginName != $pluginNameRenamed) {
$suffix = "You may uninstall the plugin or manually delete the files in piwik/plugins/{$pluginName}/";
}
$description = '<strong>' . $this->translator->translate('CorePluginsAdmin_PluginNotCompatibleWith', array($pluginName, self::getPiwikVersion())) . '</strong><br/>' . $suffix;
$plugin['info'] = array('description' => $description, 'version' => $this->translator->translate('General_Unknown'), 'theme' => false);
}
}
$pluginsFiltered = $this->keepPluginsOrThemes($themesOnly, $plugins);
return $pluginsFiltered;
}