| 1 | <?php |
||
| 2 | |||
| 3 | namespace LeKoala\DebugBar; |
||
| 4 | |||
| 5 | use DebugBar\OpenHandler; |
||
| 6 | use SilverStripe\Control\Controller; |
||
| 7 | use SilverStripe\Control\HTTPRequest; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * A open handler controller for DebugBar |
||
| 11 | * |
||
| 12 | * @author Koala |
||
| 13 | */ |
||
| 14 | class DebugBarController extends Controller |
||
| 15 | { |
||
| 16 | public function index(HTTPRequest $request) |
||
|
0 ignored issues
–
show
|
|||
| 17 | { |
||
| 18 | if (!DebugBar::config()->get('enable_storage')) { |
||
| 19 | return $this->httpError(404, 'Storage not enabled'); |
||
| 20 | } |
||
| 21 | $debugbar = DebugBar::getDebugBar(); |
||
| 22 | if (!$debugbar) { |
||
|
0 ignored issues
–
show
|
|||
| 23 | return $this->httpError(404, 'DebugBar not enabled'); |
||
| 24 | } |
||
| 25 | $openHandler = new OpenHandler($debugbar); |
||
| 26 | $openHandler->handle(); |
||
| 27 | exit(); // Handle will echo and set headers |
||
|
0 ignored issues
–
show
|
|||
| 28 | } |
||
| 29 | } |
||
| 30 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.