本文整理匯總了PHP中SearchEngine::searchTypeData方法的典型用法代碼示例。如果您正苦於以下問題:PHP SearchEngine::searchTypeData方法的具體用法?PHP SearchEngine::searchTypeData怎麽用?PHP SearchEngine::searchTypeData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SearchEngine
的用法示例。
在下文中一共展示了SearchEngine::searchTypeData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadSearchTypeObjects
/**
* Loads the search type objects.
*/
public static function loadSearchTypeObjects()
{
if (self::$searchTypeObjects !== null) {
return;
}
// get cache
WCF::getCache()->addResource('searchableMessageTypes-' . PACKAGE_ID, WCF_DIR . 'cache/cache.searchableMessageTypes-' . PACKAGE_ID . '.php', WCF_DIR . 'lib/system/cache/CacheBuilderSearchableMessageType.class.php');
self::$searchTypeData = WCF::getCache()->get('searchableMessageTypes-' . PACKAGE_ID);
// get objects
self::$searchTypeObjects = array();
foreach (self::$searchTypeData as $type) {
// calculate class path
$path = '';
if (empty($type['packageDir'])) {
$path = WCF_DIR;
} else {
$path = FileUtil::getRealPath(WCF_DIR . $type['packageDir']);
}
// include class file
if (!file_exists($path . $type['classPath'])) {
throw new SystemException("unable to find class file '" . $path . $type['classPath'] . "'", 11000);
}
require_once $path . $type['classPath'];
// create instance
$className = StringUtil::getClassName($type['classPath']);
if (!class_exists($className)) {
throw new SystemException("unable to find class '" . $className . "'", 11001);
}
self::$searchTypeObjects[$type['typeName']] = new $className();
}
}