Skip to content

Commit 8f0cc28

Browse files
authored
Merge pull request #10 from nickygerritsen/addcall
Always add call when ClientCallPanel exists
2 parents 573c2b3 + 27198b2 commit 8f0cc28

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/Network/Http/Client.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
namespace DebugHttp\Network\Http;
33

4-
use Cake\Core\Configure;
54
use DebugHttp\Panel\ClientCallPanel;
65
use DebugKit\DebugTimer;
76

@@ -31,7 +30,7 @@ protected function _doRequest($method, $url, $data, $options)
3130

3231
$time = microtime();
3332
$timerKey = 'debug_http.call.' . $url . '.' . $time;
34-
if (Configure::read('debug')) {
33+
if (class_exists(ClientCallPanel::class) && class_exists(DebugTimer::class)) {
3534
DebugTimer::start($timerKey, $method . ' ' . $url);
3635
}
3736

@@ -41,7 +40,7 @@ protected function _doRequest($method, $url, $data, $options)
4140
$response = new Response(['body' => $exception->getMessage(), 'type' => 'text/plain']);
4241
}
4342

44-
if (Configure::read('debug')) {
43+
if (class_exists(ClientCallPanel::class) && class_exists(DebugTimer::class)) {
4544
DebugTimer::stop($timerKey);
4645
ClientCallPanel::addCall($request, $response, DebugTimer::elapsedTime($timerKey));
4746
}

0 commit comments

Comments
 (0)