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