当前位置: 首页>>代码示例>>PHP>>正文


PHP POD::queryAllWithCache方法代码示例

本文整理汇总了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;
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:10,代码来源:POD.php

示例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;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:36,代码来源:blog.category.php

示例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;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:18,代码来源:common.plugin.php

示例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;
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:9,代码来源:POD.Core.php


注:本文中的POD::queryAllWithCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。