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


PHP Debugger::query方法代码示例

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


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

示例1: execute

 function execute($sql)
 {
     if (!$this->write_connection()) {
         throw new Exception("Write connection not established");
         return false;
     }
     //echo "<br> " . $sql . "<br>";
     $start = microtime(true);
     $result = $this->write->query($sql);
     $end = microtime(true);
     $database_name = $this->write_settings['server'] . " (" . $this->write_settings["host"];
     if (isset($this->write_settings["port"])) {
         $database_name .= ":" . $this->write_settings["port"];
     }
     $database_name .= ")";
     if (!$result && $this->write->errno == 1205) {
         error_log("Database::execute() failed with error 1205, retrying in 3 seconds.");
         sleep(3);
         $this->result = $this->write->query($sql);
     }
     Debugger::query($sql, $end - $start, $database_name);
     if (!$result) {
         $error = new MySqliError($this->write->errno, $this->write->error, $sql);
         if (count($this->errors) > self::$MAX_ERRORS) {
             array_shift($this->errors);
         }
         $this->errors[] = $error;
         return false;
     }
     return $result;
 }
开发者ID:htmlgraphic,项目名称:HTMLgraphic-MVC,代码行数:31,代码来源:Database.class.inc.php

示例2: write

 function write($keyspace, $key, $column_family, $data, $consistency)
 {
     try {
         Loader::load("vendor", "phpcassa/columnfamily.php");
         $columnFamily = new columnFamily($this->connection($keyspace), $column_family);
         //echo "use phpcassa!\n";
         //exit;
         if (Config::isLive() || Config::isStaging()) {
             return $columnFamily->insert($key, $data, null, null, $consistency);
         }
         $time = $this->microsecond_timestamp();
         $cassandra_mutations = array();
         foreach ($data as $key => $value) {
             $cassandra_mutations[$key][$column_family][] = new cassandra_Mutation(array("column_or_supercolumn" => new cassandra_ColumnOrSuperColumn(array("column" => new cassandra_Column(array("name" => $key, "value" => $value, "timestamp" => $time))))));
         }
         //Debugger::log("set keyspace $keyspace");
         $this->set_keyspace($keyspace);
         $start = microtime(true);
         $this->get_client()->batch_mutate($cassandra_mutations, $this->consistency());
         $end = microtime(true);
         if (json_encode($cassandra_mutations) == null) {
             print_r($cassandra_mutations);
             exit;
         }
         //error_log("Thrift::batch_mutate(".json_encode($cassandra_mutations).") " . "(".$this->host .":".$this->settings["port"].")");
         Debugger::query("Thrift::batch_mutate(" . json_encode($cassandra_mutations) . ")", $end - $start, $keyspace . "(" . $this->settings["ip"] . ":" . $this->settings["port"] . ")");
         return true;
     } catch (Exception $e) {
         $info = isset($e->why) ? $e->why : get_class($e);
         throw new Exception("Database connection is not available: {$info} {$this->host}");
         return false;
     }
 }
开发者ID:htmlgraphic,项目名称:HTMLgraphic-MVC,代码行数:33,代码来源:CassandraConnection.class.inc.php

示例3: set

 static function set($key, $value, $ttl = 0)
 {
     if (self::isAvailable()) {
         $start = microtime();
         $start = explode(" ", $start);
         $start = $start[1] + $start[0];
         self::getInstance()->cache->set($key, $value, 0, $ttl);
         $end = microtime();
         $end = explode(" ", $end);
         $end = $end[1] + $end[0];
         $database_name = "MEMCACHE";
         Debugger::query("***MemCache SET: {$key}***", $end - $start, __CLASS__);
     } else {
         error_log("MEMCACHE IS UNAVAILABLE. PLEASE CALL MemCache::isAvailable() before using!!!!");
     }
 }
开发者ID:htmlgraphic,项目名称:HTMLgraphic-MVC,代码行数:16,代码来源:HGMemCache.class.inc.php


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