2015-08-31 16:30:02 +02:00
|
|
|
<?php
|
|
|
|
|
2015-10-24 03:22:14 +02:00
|
|
|
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
|
2015-08-31 16:30:02 +02:00
|
|
|
|
2015-10-24 03:22:14 +02:00
|
|
|
use Poniverse\Ponyfm\Http\Controllers\Controller;
|
|
|
|
use Poniverse\Ponyfm\ProfileRequest;
|
2015-09-20 10:47:24 +02:00
|
|
|
use Cache;
|
|
|
|
use Config;
|
|
|
|
use Response;
|
2015-08-31 16:30:02 +02:00
|
|
|
|
|
|
|
class ProfilerController extends Controller
|
|
|
|
{
|
|
|
|
public function getRequest($id)
|
|
|
|
{
|
|
|
|
if (!Config::get('app.debug')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$key = 'profiler-request-' . $id;
|
|
|
|
$request = Cache::get($key);
|
|
|
|
if (!$request) {
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
Cache::forget($key);
|
|
|
|
|
|
|
|
return Response::json(['request' => ProfileRequest::load($request)->toArray()], 200);
|
|
|
|
}
|
2015-09-20 10:47:24 +02:00
|
|
|
}
|