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