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


PHP Misc::key方法代码示例

本文整理汇总了PHP中Misc::key方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::key方法的具体用法?PHP Misc::key怎么用?PHP Misc::key使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Misc的用法示例。


在下文中一共展示了Misc::key方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse

 function parse()
 {
     if (!$this->_is_parsed) {
         $cache_data = false;
         $cache_key = Misc::key('Q:', $this->selector);
         $cache = Cache::factory();
         if (!Config::get('debug.Q_nocache', FALSE)) {
             $cache_data = $cache->get($cache_key);
         }
         if (false === $cache_data) {
             $query = $this->parse_selector();
             $cache_data = array('name' => $query->name, 'SQL' => $query->SQL, 'count_SQL' => $query->count_SQL, 'sum_SQL' => $query->sum_SQL);
             if ($cache) {
                 $cache->set($cache_key, $cache_data);
             }
         }
         $this->SQL = $cache_data['SQL'];
         $this->count_SQL = $cache_data['count_SQL'];
         $this->sum_SQL = $cache_data['sum_SQL'];
         $this->_is_parsed = TRUE;
         $this->name = $cache_data['name'];
     }
 }
开发者ID:pihizi,项目名称:qf,代码行数:23,代码来源:q.php

示例2: connected_with

 function connected_with($object, $type = '', $approved_only = FALSE)
 {
     $name1 = $this->_name;
     $name2 = $object->_name;
     $id1 = $this->id;
     $id2 = $object->id;
     if (strcmp($name1, $name2) < 0) {
         $type = self::counterpart($type);
         list($name1, $name2) = array($name2, $name1);
         list($id1, $id2) = array($id2, $id1);
     }
     $db = self::db($name1);
     $key = Misc::key($db->name(), $name1, $id1, $name2, $id2, $type);
     if (isset(self::$conn_cache[$key])) {
         return $approved_only ? self::$conn_cache[$key] : isset(self::$conn_cache[$key]);
     }
     $table = self::RELA_PREFIX . $name1 . '_' . $name2;
     self::$conn_cache[$key] = $db->value('SELECT `approved` FROM `%s` WHERE `id1`=%d AND `id2`=%d AND `type`="%s"', $table, $id1, $id2, $type);
     return $approved_only ? self::$conn_cache[$key] : isset(self::$conn_cache[$key]);
 }
开发者ID:pihizi,项目名称:qf,代码行数:20,代码来源:orm.php

示例3: cache_content

 static function cache_content($f)
 {
     $files = array_unique(explode(' ', $f));
     $content = '';
     foreach ($files as $file) {
         $file = trim($file);
         list($category, $file) = explode(':', $file, 2);
         if (!$file) {
             $file = $category;
             $category = NULL;
         }
         if (!$file) {
             continue;
         }
         $path = Core::file_exists(PRIVATE_BASE . 'css/' . $file . '.css', $category);
         if ($path) {
             $content .= CSS::format(@file_get_contents($path));
         }
     }
     $url_base = preg_replace('/[^\\/]*$/', '', $_SERVER['SCRIPT_NAME']);
     $content = preg_replace('/\\burl\\s*\\(\\s*(["\'])?\\s*([^:]+?)\\s*\\1?\\s*\\)/', 'url(' . $url_base . '\\2)', $content);
     $css_file = Misc::key('css', $f) . '.css';
     Cache::cache_content($css_file, $content);
     return $content;
 }
开发者ID:pihizi,项目名称:qf,代码行数:25,代码来源:css.php

示例4: cache_content

 static function cache_content($f)
 {
     $files = array_unique(explode(' ', $f));
     $content = '';
     foreach ($files as $file) {
         $file = trim($file);
         list($category, $file) = explode(':', $file, 2);
         if (!$file) {
             $file = $category;
             $category = NULL;
         }
         if (!$file) {
             continue;
         }
         $path = Core::file_exists(PRIVATE_BASE . 'js/' . $file . '.js', $category);
         if ($path) {
             $content .= self::format(@file_get_contents($path));
         }
     }
     $js_file = Misc::key('js', $f) . '.js';
     Cache::cache_content($js_file, $content);
     return $content;
 }
开发者ID:pihizi,项目名称:qf,代码行数:23,代码来源:js.php


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