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


PHP fCore::getDebug方法代码示例

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


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

示例1: run

 /**
  * Runs a single statement and times it, removes any old unbuffered queries before starting
  * 
  * @param  string|fStatement $statement    The SQL statement or prepared statement to execute
  * @param  string            $result_type  The type of result object to return, fResult or fUnbufferedResult
  * @return fResult|fUnbufferedResult  The result for the query
  */
 private function run($statement, $result_type = NULL, $params = array())
 {
     if ($this->unbuffered_result) {
         $this->unbuffered_result->__destruct();
         $this->unbuffered_result = NULL;
     }
     $start_time = microtime(TRUE);
     if (is_object($statement)) {
         $sql = $statement->getSQL();
     } else {
         $sql = $statement;
     }
     if (!($result = $this->handleTransactionQueries($sql, $result_type))) {
         if ($result_type) {
             $result = new $result_type($this, $this->type == 'mssql' ? $this->schema_info['character_set'] : NULL);
             $result->setSQL($sql);
             if ($result_type == 'fResult') {
                 $this->performQuery($statement, $result, $params);
             } else {
                 $this->performUnbufferedQuery($statement, $result, $params);
             }
         } else {
             $this->perform($statement, $params);
         }
     }
     // Write some debugging info
     $query_time = microtime(TRUE) - $start_time;
     $this->query_time += $query_time;
     if (fCore::getDebug($this->debug)) {
         fCore::debug(self::compose('Query time was %1$s seconds for:%2$s', $query_time, "\n" . $sql), $this->debug);
     }
     if ($this->hook_callbacks['run']) {
         foreach ($this->hook_callbacks['run'] as $callback) {
             $callback_params = array($this, is_object($statement) ? array($statement, $params) : $sql, $query_time, $result);
             call_user_func_array($callback, $callback_params);
         }
     }
     if ($result_type) {
         return $result;
     }
 }
开发者ID:JhunCabas,项目名称:material-management,代码行数:48,代码来源:fDatabase.php

示例2: run

 /**
  * Runs a single statement and times it, removes any old unbuffered queries before starting
  * 
  * @param  string|fStatement $statement    The SQL statement or prepared statement to execute
  * @param  string            $result_type  The type of result object to return, fResult or fUnbufferedResult
  * @return fResult|fUnbufferedResult  The result for the query
  */
 private function run($statement, $result_type = NULL, $params = array())
 {
     if ($this->unbuffered_result) {
         $this->unbuffered_result->__destruct();
         $this->unbuffered_result = NULL;
     }
     $start_time = microtime(TRUE);
     if (is_object($statement)) {
         $sql = $statement->getSQL();
     } else {
         $sql = $statement;
     }
     if (!($result = $this->handleTransactionQueries($sql, $result_type))) {
         if ($result_type) {
             $result = new $result_type($this, $this->type == 'mssql' ? $this->schema_info['character_set'] : NULL);
             $result->setSQL($sql);
             if ($result_type == 'fResult') {
                 $this->performQuery($statement, $result, $params);
             } else {
                 $this->performUnbufferedQuery($statement, $result, $params);
             }
         } else {
             $this->perform($statement, $params);
         }
     }
     // Write some debugging info
     $query_time = microtime(TRUE) - $start_time;
     $this->query_time += $query_time;
     if (fCore::getDebug($this->debug)) {
         fCore::debug(self::compose('Query time was %1$s seconds for:%2$s', $query_time, "\n" . $sql), $this->debug);
     }
     if ($this->slow_query_threshold && $query_time > $this->slow_query_threshold) {
         trigger_error(self::compose('The following query took %1$s milliseconds, which is above the slow query threshold of %2$s:%3$s', $query_time, $this->slow_query_threshold, "\n" . $sql), E_USER_WARNING);
     }
     if ($result_type) {
         return $result;
     }
 }
开发者ID:philip,项目名称:flourish,代码行数:45,代码来源:fDatabase.php

示例3: write

 /**
  * Sends commands to the IMAP or POP3 server
  * 
  * @param  string  $command   The command to send
  * @param  integer $expected  The number of lines or regex expected for a POP3 command
  * @return array  The response from the server
  */
 private function write($command, $expected = NULL)
 {
     if (!$this->connection) {
         throw new fProgrammerException('Unable to send data since the connection has already been closed');
     }
     if ($this->type == 'imap') {
         $identifier = 'a' . str_pad($this->command_num++, 4, '0', STR_PAD_LEFT);
         $command = $identifier . ' ' . $command;
     }
     if (substr($command, -2) != "\r\n") {
         $command .= "\r\n";
     }
     if (fCore::getDebug($this->debug)) {
         fCore::debug("Sending:\n" . trim($command), $this->debug);
     }
     $res = fwrite($this->connection, $command);
     if ($res === FALSE) {
         throw new fConnectivityException('Unable to write data to %1$s server %2$s on port %3$s', strtoupper($this->type), $this->host, $this->port);
     }
     if ($this->type == 'imap') {
         return $this->read('#^' . $identifier . '#');
     } elseif ($this->type == 'pop3') {
         return $this->read($expected);
     }
 }
开发者ID:philip,项目名称:flourish,代码行数:32,代码来源:fMailbox.php

示例4: write

 /**
  * Sends raw text/commands to the SMTP server
  * 
  * @param  string         $data    The data or commands to send
  * @param  integer|string $expect  The expected number of lines of response or a regex of the last line
  * @return array  The response from the server
  */
 private function write($data, $expect)
 {
     if (!$this->connection) {
         throw new fProgrammerException('Unable to send data since the connection has already been closed');
     }
     if (substr($data, -2) != "\r\n") {
         $data .= "\r\n";
     }
     if (fCore::getDebug($this->debug)) {
         fCore::debug("Sending:\n" . trim($data), $this->debug);
     }
     $res = fwrite($this->connection, $data);
     if ($res === FALSE || $res === 0) {
         throw new fConnectivityException('Unable to write data to SMTP server %1$s on port %2$s', $this->host, $this->port);
     }
     $response = $this->read($expect);
     return $response;
 }
开发者ID:mrjwc,项目名称:printmaster,代码行数:25,代码来源:fSMTP.php


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