Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Commit

Permalink
Merge branch 'bugfix/28'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Youngblood committed Mar 25, 2013
2 parents 19cf978 + b8c6e4b commit 39286d8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 308 deletions.
47 changes: 0 additions & 47 deletions src/BjyProfiler/Db/Adapter/Driver/IbmDb2/ProfilingStatement.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/BjyProfiler/Db/Adapter/Driver/Mysqli/ProfilingStatement.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/BjyProfiler/Db/Adapter/Driver/Oci8/ProfilingStatement.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/BjyProfiler/Db/Adapter/Driver/Pdo/ProfilingStatement.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/BjyProfiler/Db/Adapter/Driver/Pgsql/ProfilingStatement.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/BjyProfiler/Db/Adapter/Driver/Sqlsrv/ProfilingStatement.php

This file was deleted.

21 changes: 9 additions & 12 deletions src/BjyProfiler/Db/Adapter/ProfilingAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use BjyProfiler\Db\Profiler\Profiler;
use Zend\Db\Adapter\Adapter;
use Zend\Db\Adapter\Driver as ZdbDriver;
use Zend\Db\Adapter\Profiler\ProfilerInterface;

class ProfilingAdapter extends Adapter
Expand All @@ -21,7 +22,6 @@ public function getProfiler()
return $this->profiler;
}


public function injectProfilingStatementPrototype(array $options = array())
{
$profiler = $this->getProfiler();
Expand All @@ -34,33 +34,30 @@ public function injectProfilingStatementPrototype(array $options = array())
$driverName = get_class($driver);
switch ($driverName) {
case 'Zend\Db\Adapter\Driver\IbmDb2\IbmDb2':
$statementPrototype = new Driver\IbmDb2\ProfilingStatement();
$statementPrototype = new ZdbDriver\IbmDb2\Statement();
break;
case 'Zend\Db\Adapter\Driver\Mysqli\Mysqli':
$defaults = array('buffer_results' => false);
$options = array_intersect_key(array_merge($defaults, $options), $defaults);

$statementPrototype = new Driver\Mysqli\ProfilingStatement($options['buffer_results']);
$statementPrototype = new ZdbDriver\Mysqli\Statement($options['buffer_results']);
break;
case 'Zend\Db\Adapter\Driver\Oci8\Oci8':
$statementPrototype = new Driver\Oci8\ProfilingStatement();
$statementPrototype = new ZdbDriver\Oci8\Statement();
break;
case 'Zend\Db\Adapter\Driver\Sqlsrv\Sqlsrv':
$statementPrototype = new Driver\Sqlsrv\ProfilingStatement();
$statementPrototype = new ZdbDriver\Sqlsrv\Statement();
break;
case 'Zend\Db\Adapter\Driver\Pgsql\Pgsql':
$statementPrototype = new Driver\Pgsql\ProfilingStatement();
$statementPrototype = new ZdbDriver\Pgsql\Statement();
break;
case 'Zend\Db\Adapter\Driver\Pdo\Pdo':
default:
$statementPrototype = new Driver\Pdo\ProfilingStatement();
}

if(isset($statementPrototype)) {
$statementPrototype->setProfiler($this->getProfiler());
$driver->registerStatementPrototype($statementPrototype);
$statementPrototype = new ZdbDriver\Pdo\Statement();
}

$statementPrototype->setProfiler($this->getProfiler());
$driver->registerStatementPrototype($statementPrototype);
}
}
}
Expand Down
Loading

0 comments on commit 39286d8

Please sign in to comment.