update v1.0.7.9 R.C.
This is a Release Candidate. We are still testing.
This commit is contained in:
59
vendor/barryvdh/laravel-debugbar/src/Controllers/OpenHandlerController.php
vendored
Normal file
59
vendor/barryvdh/laravel-debugbar/src/Controllers/OpenHandlerController.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php namespace Barryvdh\Debugbar\Controllers;
|
||||
|
||||
use Barryvdh\Debugbar\Support\Clockwork\Converter;
|
||||
use DebugBar\OpenHandler;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class OpenHandlerController extends BaseController
|
||||
{
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$debugbar = $this->debugbar;
|
||||
|
||||
if (!$debugbar->isEnabled()) {
|
||||
$this->app->abort('500', 'Debugbar is not enabled');
|
||||
}
|
||||
|
||||
$openHandler = new OpenHandler($debugbar);
|
||||
|
||||
$data = $openHandler->handle(null, false, false);
|
||||
|
||||
return new Response(
|
||||
$data, 200, array(
|
||||
'Content-Type' => 'application/json'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Clockwork output
|
||||
*
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \DebugBar\DebugBarException
|
||||
*/
|
||||
public function clockwork($id)
|
||||
{
|
||||
$request = [
|
||||
'op' => 'get',
|
||||
'id' => $id,
|
||||
];
|
||||
|
||||
$debugbar = $this->debugbar;
|
||||
|
||||
if (!$debugbar->isEnabled()) {
|
||||
$this->app->abort('500', 'Debugbar is not enabled');
|
||||
}
|
||||
|
||||
$openHandler = new OpenHandler($debugbar);
|
||||
|
||||
$data = $openHandler->handle($request, false, false);
|
||||
|
||||
// Convert to Clockwork
|
||||
$converter = new Converter();
|
||||
$output = $converter->convert(json_decode($data, true));
|
||||
|
||||
return response()->json($output);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user