本文整理汇总了PHP中POD::queryAllWithCache方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::queryAllWithCache方法的具体用法?PHP POD::queryAllWithCache怎么用?PHP POD::queryAllWithCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POD
的用法示例。
在下文中一共展示了POD::queryAllWithCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: queryAllWithDBCache
public static function queryAllWithDBCache($query, $prefix = null, $type = 'both', $count = -1)
{
$cache = queryCache::getInstance();
$cache->reset($query, $prefix);
if (!$cache->load()) {
$cache->contents = POD::queryAllWithCache($query, $type, $count);
$cache->update();
}
return $cache->contents;
}
示例2: getCategories
function getCategories($blogid, $format = 'tree')
{
global $database;
global $__gCacheCategoryTree, $__gCacheCategoryRaw;
if ($format == 'tree' && !empty($__gCacheCategoryTree)) {
return $__gCacheCategoryTree;
} else {
if ($format == 'raw' && !empty($__gCacheCategoryRaw)) {
return $__gCacheCategoryRaw;
}
}
$rows = POD::queryAllWithCache("SELECT *\n\t\t\tFROM {$database['prefix']}Categories\n\t\t\tWHERE blogid = {$blogid}\n\t\t\t\tAND id >= 0\n\t\t\tORDER BY parent, priority");
$categories = array();
if (empty($rows)) {
$rows = array();
}
if ($format == 'raw') {
foreach ($rows as $category) {
$categories[$category['id']] = $category;
}
$__gCacheCategoryRaw = $categories;
return $categories;
}
foreach ($rows as $category) {
if ($category['parent'] == null) {
$category['children'] = array();
$categories[$category['id']] = $category;
} else {
if (isset($categories[$category['parent']])) {
array_push($categories[$category['parent']]['children'], $category);
}
}
}
$__gCacheCategoryTree = $categories;
return $categories;
}
示例3: getCurrentSetting
function getCurrentSetting($name)
{
global $database, $activePlugins;
global $pluginSetting;
if (!in_array($name, $activePlugins)) {
return false;
}
if (empty($pluginSetting)) {
$settings = POD::queryAllWithCache("SELECT name, settings \n\t\t\t\tFROM {$database['prefix']}Plugins \n\t\t\t\tWHERE blogid = " . getBlogId(), MYSQL_NUM);
foreach ($settings as $k => $v) {
$pluginSetting[$v[0]] = $v[1];
}
}
if (isset($pluginSetting[$name])) {
return $pluginSetting[$name];
}
return null;
}
示例4: queryAllWithDBCache
function queryAllWithDBCache($query, $prefix = null, $type = MYSQL_BOTH, $count = -1)
{
$cache = new queryCache($query, $prefix);
if (!$cache->load()) {
$cache->contents = POD::queryAllWithCache($query, $type, $count);
$cache->update();
}
return $cache->contents;
}