Ejemplo n.º 1
0
<?php

use Phidias\Utilities\Debugger;
use Phidias\Api\Environment;
$request = Environment::getServerRequest();
if (!$request) {
    return;
}
$debugId = $request->getHeaderLine("X-Phidias-Debug");
if ($debugId) {
    Debugger::enable();
    register_shutdown_function(function () use($debugId) {
        $tmpFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . md5($debugId) . '.debug.json';
        file_put_contents($tmpFile, Debugger::toJson());
    });
}
Ejemplo n.º 2
0
 /**
  * Obtain the current request from the environment, execute it and relay the response
  *
  */
 public static function run()
 {
     $request = Environment::getServerRequest();
     $response = self::execute($request);
     Environment::sendResponse($response);
 }