本文整理汇总了PHP中Piwik\Plugin\Manager::getPluginsDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::getPluginsDirectory方法的具体用法?PHP Manager::getPluginsDirectory怎么用?PHP Manager::getPluginsDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Plugin\Manager
的用法示例。
在下文中一共展示了Manager::getPluginsDirectory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addPluginConfigs
private function addPluginConfigs(ContainerBuilder $builder)
{
$plugins = Manager::getInstance()->getActivatedPluginsFromConfig();
foreach ($plugins as $plugin) {
$baseDir = Manager::getPluginsDirectory() . $plugin;
$file = $baseDir . '/config/config.php';
if (file_exists($file)) {
$builder->addDefinitions($file);
}
$environmentFile = $baseDir . '/config/' . $this->environment . '.php';
if (file_exists($environmentFile)) {
$builder->addDefinitions($environmentFile);
}
}
}
示例2: loadPluginInfoJson
private function loadPluginInfoJson()
{
$path = \Piwik\Plugin\Manager::getPluginsDirectory() . $this->pluginName . '/' . self::PLUGIN_JSON_FILENAME;
return $this->loadJsonMetadata($path);
}
示例3: test_DirectoriesInPluginsFolder_areKnown
/**
* Check that directories in plugins/ folder are specifically either enabled or disabled.
*
* This fails when a new folder is added to plugins/* and forgot to enable or mark as disabled in Manager.php.
*
* @group Core
*/
public function test_DirectoriesInPluginsFolder_areKnown()
{
$pluginsBundledWithPiwik = \Piwik\Config::getInstance()->getFromGlobalConfig('Plugins');
$pluginsBundledWithPiwik = $pluginsBundledWithPiwik['Plugins'];
$magicPlugins = 42;
$this->assertTrue(count($pluginsBundledWithPiwik) > $magicPlugins);
$plugins = _glob(\Piwik\Plugin\Manager::getPluginsDirectory() . '*', GLOB_ONLYDIR);
$count = 1;
foreach ($plugins as $pluginPath) {
$pluginName = basename($pluginPath);
$addedToGit = $this->isPathAddedToGit($pluginPath);
if (!$addedToGit) {
// if not added to git, then it is not part of the release checklist.
continue;
}
$manager = \Piwik\Plugin\Manager::getInstance();
$isGitSubmodule = $manager->isPluginOfficialAndNotBundledWithCore($pluginName);
$disabled = in_array($pluginName, $manager->getCorePluginsDisabledByDefault()) || $isGitSubmodule;
$enabled = in_array($pluginName, $pluginsBundledWithPiwik);
$this->assertTrue($enabled + $disabled === 1, "Plugin {$pluginName} should be either enabled (in global.ini.php) or disabled (in Piwik\\Plugin\\Manager).\n It is currently (enabled=" . (int) $enabled . ", disabled=" . (int) $disabled . ")");
$count++;
}
$this->assertTrue($count > $magicPlugins);
}
示例4: addPluginConfigs
private function addPluginConfigs(ContainerBuilder $builder)
{
$plugins = $this->pluginList->getActivatedPlugins();
foreach ($plugins as $plugin) {
$baseDir = Manager::getPluginsDirectory() . $plugin;
$file = $baseDir . '/config/config.php';
if (file_exists($file)) {
$builder->addDefinitions($file);
}
}
}
示例5: getPathToPluginFolder
/**
* @return string
*/
private function getPathToPluginFolder()
{
return \Piwik\Plugin\Manager::getPluginsDirectory() . $this->pluginName;
}