Commit 3f77333a authored by Alex Ne's avatar Alex Ne

Набросок трейсера

parent 2161b02d
<?php
namespace X\ETrace;
class Error extends TItem
{
/**
* @param string $message
* @param int $code [= 0]
* @param string $file [= false]
* @param int $line [= false]
* @param array $context [= []]
*/
public function __construct($message, $code = 0, $file = false, $line = false, $context = [])
{
parent::__construct("error", $message, $code, $file, $line, $context);
}
}
?>
\ No newline at end of file
<?php
namespace X\ETrace;
/**
*
*/
class TItem extends \Exception
{
/**
* @var mixed
*/
protected $Trace;
/**
* @var mixed
*/
protected $context;
/**
* @param enum $type paranoid | trace | system | fatal | error | notification
* @param string $message
* @param int $code [= 0]
* @param string $file [= false]
* @param int $line [= false]
* @param array $context [= []]
*/
public function __construct($type, $message, $code = 0, $file = false, $line = false, $context = [])
{
parent::__construct($message, $code);
if ( ! ($file === false))
{
$this->file = $file;
}
if ( ! ($line === false))
{
$this->line = $line;
}
$this->context = $context;
$this->Trace = $this->getTrace();
}
public function Save()
{
# code...
}
}
?>
\ No newline at end of file
<?php
require_once "TItem.php";
require_once "Error.php";
//throw new ErrorException("Error Processing Request", 1);
$ddd = new X\ETrace\Error("Error Processing Request", 1);
throw $ddd;
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment