Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
EdeMeijer committed Sep 1, 2014
1 parent 3b1acb6 commit 7e4e578
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# serialize-debugger

A tool for debugging failing or dangerous PHP serialize() calls
A tool for debugging failing or dangerous PHP serialize() calls.

# Motivation

Debugging issues with PHP's `serialize()` method can be a tedious task, because it doesn't give much information when it
encounters errors. This is best demonstrated with an example:
Expand Down Expand Up @@ -45,4 +47,41 @@ Closure - ERROR
{root}[foo]->invalidProp
```

Much better, now we know exactly where the offending closure is located in the problematic data structure.
Much better, now we know exactly where the offending closure is located in the problematic data structure.

# Requirements

serialize-debugger is only supported on PHP 5.4.0 and up.

# Installation

Using composer, add to your composer.json:
```
"edemeijer/serialize-debugger": ">=0.1.1"
```
Then run `composer.phar update`
#API
Basic usage:
```php
// There are two static convenience methods in the main debugger class:
// Outputting errors and warnings in plain text format
Debugger::debugPlaintext($data);

// Outputting errors and warnings in HTML format
Debugger::debugHTML($data);

// Both methods provide an optional second boolean parameter for verbose output
// This will output not only errors and warnings, but the paths to every element
// in the data set
Debugger::debugPlainText($data, true);
```
Without using the static convenience methods:
```php
$debugger = new Debugger();
$formatter = new PlainTextFormatter();
$result = $debugger->getDebugResult($data, $verbose);
echo $formatter->format($result);
```

# License
MIT - See LICENSE file.

0 comments on commit 7e4e578

Please sign in to comment.