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


PHP Reflector::getDatabase方法代码示例

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


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

示例1: getTags

 /**
  * Compiles and returns the tags.
  *
  * @return array
  */
 public function getTags()
 {
     // Get affected database and tables, add prefixes
     $database = $this->prefix($this->reflector->getDatabase(), self::PREFIX_DATABASE);
     // Get affected tables, don't add prefixes yes
     $tables = $this->reflector->getTables();
     // If rows should not be considered, we don't have to differ between specific and unspecific queries
     // We can simply prefix all tables with the database and return them
     if ($this->considerRows === false) {
         return $this->prefix($tables, $database);
     }
     // Get affected rows as multidimensional array per table
     $rows = $this->reflector->getRows();
     // Create the table tags with corresponding prefix
     // Depending on whether the queries are specific or not
     $tags = $this->getTableTags($tables, $rows);
     // Then we loop trough all these tags and add a tag for each row
     // Consisting of the prefixed table and the row with prefix
     foreach ($tables as $table) {
         if (!isset($rows[$table])) {
             continue;
         }
         $tablePrefix = $this->prefix($table, self::PREFIX_TABLE_SPECIFIC);
         $rowPrefix = $this->prefix(self::PREFIX_ROW, $tablePrefix);
         $tags = array_merge($tags, $this->prefix($rows[$table], $rowPrefix));
     }
     return $this->prefix($tags, $database);
 }
开发者ID:spiritix,项目名称:lada-cache,代码行数:33,代码来源:Tagger.php

示例2: getHash

 /**
  * Returns the hash.
  *
  * @return string
  */
 public function getHash()
 {
     // Never remove the database from the identifier
     // Most SQL queries do not include the target database
     $identifier = $this->reflector->getDatabase() . $this->reflector->getSql() . serialize($this->reflector->getParameters());
     return md5($identifier);
 }
开发者ID:spiritix,项目名称:lada-cache,代码行数:12,代码来源:Hasher.php


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