Skip to content

Commit

Permalink
remove force_proxy and pdo support
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Jul 27, 2023
1 parent 9408b3b commit 829dd41
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ LeKoala\DebugBar\DebugBar:
| `enable_storage` | bool | Store all previous request in the temp folder (enabled by default) |
| `auto_debug` | bool| Automatically collect debug and debug_request data (disabled by default) |
| `ajax` | bool | Automatically inject data in XHR requests (disabled by default, since this makes the Chrome request inspector very slow due to the large amount of header data) |
| `force_proxy` | bool | Always use the database proxy instead of built in PDO collector (enabled by default) |
| `check_local_ip` | bool | Do not display the DebugBar if not using a local ip (enabled by default) |
| `find_source` | bool | Trace which file generates a database query (enabled by default) |
| `enabled_in_admin` | bool | enable DebugBar in the CMS (enabled by default) |
Expand Down
1 change: 0 additions & 1 deletion _config/debugbar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ LeKoala\DebugBar\DebugBar:
auto_debug: false
ajax: false
max_header_length: 2048
force_proxy: true
check_local_ip: true
find_source: true
enabled_in_admin: true
Expand Down
14 changes: 1 addition & 13 deletions code/DebugBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,7 @@ public static function initDebugBar()
}

if (self::config()->db_collector) {
$connector = DB::get_connector();
if (!self::config()->get('force_proxy') && $connector instanceof PDOConnector) {
// Use a little bit of magic to replace the pdo instance
$refObject = new ReflectionObject($connector);
$refProperty = $refObject->getProperty('pdoConnection');
$refProperty->setAccessible(true);
$traceablePdo = new TraceablePDO($refProperty->getValue($connector));
$refProperty->setValue($connector, $traceablePdo);

$debugbar->addCollector(new PDOCollector($traceablePdo));
} else {
$debugbar->addCollector(new DatabaseCollector);
}
$debugbar->addCollector(new DatabaseCollector);
}

// Add message collector last so other collectors can send messages to the console using it
Expand Down

0 comments on commit 829dd41

Please sign in to comment.