Example #1
0
 /**
  * Builds a response for an exception
  * @param \Exception $exception
  * @return \PHPixie\HTTP\Responses\Response
  */
 public function process($exception)
 {
     $templateName = $this->configData->getRequired('template');
     $trace = $this->debug->exceptionTrace($exception);
     $body = $this->template->render($templateName, array('exception' => $exception, 'trace' => $trace, 'logger' => $this->debug->logger()));
     return $this->http->responses()->response($body, array(), 500);
 }
Example #2
0
 /**
  * @covers ::<protected>
  * @runInSeparateProcess
  */
 public function testNotBuiltException()
 {
     $this->assertException(function () {
         \PHPixie\Debug::dump(5);
     }, '\\PHPixie\\Debug\\Exception');
 }
Example #3
0
 public function c()
 {
     Debug::trace();
 }
Example #4
0
 public function a($string, $num)
 {
     //Note how the trace
     //Will contain function parameters
     Debug::logTrace();
 }
Example #5
0
<?php

require_once 'vendor/autoload.php';
use PHPixie\Debug;
$debug = new Debug();
//Passing 'true' here will enable printing logs
//automatically after the end of script execution.
//This is very useful if your code relies
//on exit() calls
$debug->registerHandlers(true);
Debug::log("test");
echo "Logged messages will be printed now";
Example #6
0
 /**
  * Debug component logger
  * @return \PHPixie\Debug\Logger
  */
 public function logger()
 {
     return $this->debug->logger();
 }