本文整理汇总了PHP中DevblocksPlatform::getExtensionRegistry方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::getExtensionRegistry方法的具体用法?PHP DevblocksPlatform::getExtensionRegistry怎么用?PHP DevblocksPlatform::getExtensionRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevblocksPlatform
的用法示例。
在下文中一共展示了DevblocksPlatform::getExtensionRegistry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExtension
/**
* Returns the manifest of a given extension ID.
*
* @static
* @param string $extension_id
* @param boolean $as_instance
* @return DevblocksExtensionManifest
*/
static function getExtension($extension_id, $as_instance = false, $ignore_acl = false)
{
$result = null;
$extensions = DevblocksPlatform::getExtensionRegistry($ignore_acl);
if (is_array($extensions)) {
foreach ($extensions as $extension) {
/* @var $extension DevblocksExtensionManifest */
if ($extension->id == $extension_id) {
$result = $extension;
break;
}
}
}
if ($as_instance && !is_null($result)) {
return $result->createInstance();
}
return $result;
}
示例2: getExtensionPoints
static function getExtensionPoints()
{
$cache = self::getCacheService();
if (false !== ($points = $cache->load(self::CACHE_POINTS))) {
return $points;
}
$extensions = DevblocksPlatform::getExtensionRegistry();
foreach ($extensions as $extension) {
/* @var $extension DevblocksExtensionManifest */
$point = $extension->point;
if (!isset($points[$point])) {
$p = new DevblocksExtensionPoint();
$p->id = $point;
$points[$point] = $p;
}
$points[$point]->extensions[$extension->id] = $extension;
}
$cache->save($points, self::CACHE_POINTS);
return $points;
}
示例3: getAll
static function getAll()
{
$extensions = DevblocksPlatform::getExtensionRegistry(true);
$cache = DevblocksPlatform::getCacheService();
if (null == ($params = $cache->load(self::_CACHE_ALL))) {
$db = DevblocksPlatform::getDatabaseService();
$prefix = APP_DB_PREFIX != '' ? APP_DB_PREFIX . '_' : '';
// [TODO] Cleanup
$params = array();
// Add manifest params as our initial params
foreach ($extensions as $extension) {
/* @var $extension DevblocksExtensionManifest */
$params[$extension->id] = $extension->params;
}
// Now load the DB params on top of them
$sql = sprintf("SELECT extension_id, property, value " . "FROM %sproperty_store ", $prefix);
$results = $db->GetArray($sql);
foreach ($results as $row) {
$params[$row['extension_id']][$row['property']] = $row['value'];
}
$cache->save($params, self::_CACHE_ALL);
}
return $params;
}