Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed May 30, 2013
2 parents db30514 + 118c25b commit cab45e8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 58 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
debuger
=======
Debuger
=======

Обработчик ошибок и вывод дампа переменных

61 changes: 27 additions & 34 deletions debuger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,34 @@
* @version 0.2
*/

//if(!isset($_SERVER["SCRIPT_NAME"]) || strpos($_SERVER["SCRIPT_NAME"], 'main.php')!==false) {

error_reporting(E_ALL);
error_reporting(E_ALL);
include_once 'Debug/Processor.php';

include_once 'Debug/Processor.php';
Debug_Processor::getInstance(array(
'errors' => array('Database', 'Error'/*, 'Silent'*/),
'plugins' => array('Array', 'Object', 'Image'),
'view' => (PHP_SAPI != 'cli') ? 'Html' : 'Cli',
'trace_exclude' => array(
array('class' => 'Cms_Profiler_Adapter_Page', 'function' => 'errorHandler'),
)
));

Debug_Processor::getInstance(
array(
'errors' => array('Database', 'Error'/*, 'Silent'*/),
'plugins' => array('Array', 'Object', 'Image'),
'view' => isset($_SERVER['SERVER_PROTOCOL']) ? 'Html' : 'Cli',
'trace_exclude' => array(
array('class'=>'Cms_Profiler_Adapter_Page', 'function'=>'errorHandler'),
)
)
);

/**
* Функция вывода отладочной информации
*
* @param mixed $arg Иследуемая переменная
* @param boolean $return Возврат результата
* @param boolean $stop Прекращение исполнения
*/
function p($arg=null, $return=false, $stop=false) {
$debugger = Debug_Processor::getInstance();
if($return) {
return $debugger->dump($arg);
} else {
if ($stop) {
die ($debugger->dump($arg));
} else {
print $debugger->dump($arg);
}
}
return '';
/**
* Функция вывода отладочной информации
*
* @param mixed $arg Иследуемая переменная
* @param boolean $return Возврат результата
* @param boolean $stop Прекращение исполнения
*/
function p($arg = null, $return = false, $stop = false) {
$dump = Debug_Processor::getInstance()->dump($arg);
if ($return) {
return $dump;
} elseif ($stop) {
exit($dump);
} else {
print $dump;
}
//}
return '';
}
38 changes: 16 additions & 22 deletions test.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

include 'debugger.php';

//include '../lib/debuger/_init.php';

interface bar {}
interface bar2 {}
Expand All @@ -20,12 +19,12 @@ class foo2 {}
class foo3 extends foo2 {}

final class foo extends foo3 implements bar, bar2 {
private $a=null;
private $a = null;
protected $b = 0;
public $c = '';

public function __construct() {}
public function test($a,$b,array$c=array()) {
public function test($a, $b, array $c = array()) {
return self::bar($c);
}
private static function bar($e){
Expand Down Expand Up @@ -53,22 +52,17 @@ function aaaa() {
$obj = new foo();
$obj->test('Привет', 2, array(null));

/*
p(
array(
'boolean' => true,
'integer' => 999,
'float' => pi(),
'string' => 'test',
'array' => array(0,null=>null,'d'=>1, 'tag'=>"<b>test</b>", 'tag'=>"<b>test</b>", 'cli'=>"\x1b[41m\n\t\r"),
'object' => new foo(),
'resource' => imagecreatetruecolor(14 , 14),
'null' => null,
'ar' => array(0,1,2,'asda','',null,pi(),false,true,array(array(array(array(array(array(array(array(array()))))))))),
)
);
*/



print "\n";
p(array(
'boolean' => true,
'integer' => 999,
'float' => pi(),
'string' => 'test',
'array' => array(0,null=>null,'d'=>1, 'tag'=>"<b>test</b>", 'tag'=>"<b>test</b>", 'cli'=>"\x1b[41m\n\t\r"),
'object' => new foo(),
'resource' => imagecreatetruecolor(14 , 14),
'null' => null,
'ar' => array(0,1,2,'asda','',null,pi(),false,true,array(array(array(array(array(array(array(array(array()))))))))),
));


print "\n";

0 comments on commit cab45e8

Please sign in to comment.