Beispiel #1
0
 /**
  * Register a new SQL call (debug only)
  *
  * @param Statement $statement
  * @param mixed $pretime
  */
 public static function sqlHit(Statement $statement, $pretime)
 {
     if (!Core::isDebugMode()) {
         return;
     }
     $time = Core::getDebugTime() - $pretime;
     $sql = $statement->printSQL();
     $values = $statement->getCriteria() instanceof Criteria ? $statement->getCriteria()->getValues() : array();
     $trace = self::getRelevantDebugBacktraceElement();
     self::$_sqlhits[] = array('sql' => $sql, 'values' => implode(', ', $values), 'time' => $time, 'filename' => $trace['file'], 'line' => $trace['line'], 'function' => $trace['function'], 'class' => isset($trace['class']) ? $trace['class'] : 'unknown', 'type' => isset($trace['type']) ? $trace['type'] : 'unknown', 'arguments' => $trace['args']);
     self::$_sqltiming += $time;
 }
Beispiel #2
0
    ?>
</span>
            <div class="sql"><?php 
    geshi_highlight($details['sql'], 'sql');
    ?>
</div>
        </li>
    <?php 
}
?>
    </ol>
</li>
<li id="log_objectpopulation">
    <h1>ORM object population</h1>
    <?php 
if (!\b2db\Core::isDebugMode()) {
    ?>
        <div>Database debugging disabled</div>
    <?php 
}
?>
    <ol>
    <?php 
foreach ($db_summary['objectpopulation'] as $cc => $details) {
    ?>
        <li>
            <?php 
    $file_details = explode(DS, $details['filename']);
    $filename = array_pop($file_details);
    $classname = isset($details['class']) ? $details['class'] : 'unknown';
    $type = isset($details['type']) ? $details['type'] : 'unknown';