Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql {
- public function query($sql, $bind = array()) {
- Profiler_Console::logQuery($sql);
- $explain = null;
- $result = parent::query($sql, $bind);
- if (substr($sql, 0, 3) == 'SEL') {
- $stmt = parent::query('EXPLAIN ' . $sql, $bind);
- $explain = $stmt->fetchAll();
- if (count($explain)) {
- $explain = $explain[0];
- } else {
- $explain = null;
- }
- }
- Profiler_Console::logQuery($sql, $explain);
- return $result;
- }
- }
Add Comment
Please, Sign In to add comment