本文整理汇总了PHP中ExtensionManager::getPluginConfigs方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManager::getPluginConfigs方法的具体用法?PHP ExtensionManager::getPluginConfigs怎么用?PHP ExtensionManager::getPluginConfigs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtensionManager
的用法示例。
在下文中一共展示了ExtensionManager::getPluginConfigs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBrickDirectories
/**
* @param null $customPath
* @return array|mixed
*/
public static function getBrickDirectories($customPath = null)
{
$cacheKey = "brick_directories";
if ($customPath) {
$cacheKey .= "_" . crc32($customPath);
}
$areas = array();
try {
$areas = \Zend_Registry::get($cacheKey);
} catch (\Exception $e) {
if ($customPath) {
$areaRepositories = array($customPath);
} else {
$areaRepositories = array(PIMCORE_WEBSITE_PATH . "/views/areas", PIMCORE_WEBSITE_VAR . "/areas");
}
// include area repositories from active plugins
$configs = ExtensionManager::getPluginConfigs();
foreach ($configs as $config) {
$className = $config["plugin"]["pluginClassName"];
if (!empty($className)) {
$isEnabled = ExtensionManager::isEnabled("plugin", $config["plugin"]["pluginName"]);
$areaDir = PIMCORE_PLUGINS_PATH . "/" . $config["plugin"]["pluginName"] . "/views/areas";
if ($isEnabled && file_exists($areaDir)) {
$areaRepositories[] = $areaDir;
}
}
}
// get directories
foreach ($areaRepositories as $respository) {
if (is_dir($respository) && is_readable($respository)) {
$blockDirs = scandir($respository);
foreach ($blockDirs as $blockDir) {
if (is_dir($respository . "/" . $blockDir)) {
if (is_file($respository . "/" . $blockDir . "/area.xml")) {
$areas[$blockDir] = $respository . "/" . $blockDir;
}
}
}
}
}
\Zend_Registry::set($cacheKey, $areas);
}
return $areas;
}