dev-master
9999999-dev https://github.com/Qafoo/ser-prettyPretty print serialized PHP data
MIT
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Pretty print serialized PHP data
ser-pretty prints serialized PHP in the style of var_dump() without
sourcing the required classes., (*2)
$ src/bin/ser-pretty test.txt
class stdClass (1) {
private $bar =>
int(223)
}
Download ser-pretty as a PHAR
or require qafoo/ser-pretty via composer., (*3)
It happens often that you have serialized PHP data lying around, e.g. from caching, session data or transmitting it through a queue. If you want to inspect this data for debugging purposes you typically write a tiny script that loads your classes (which are needed for de-serialization), get the data and display a var dump., (*4)
ser-pretty deprecates the script-step by simply rendering a var_dump() outut
from serialized data, without needing to source the class source., (*5)
ser-pretty comes with a very simple PHP CLI script, that reads serialized data from STDIN or a given file and prints the formatted output to STDOUT. Just call:, (*6)
$ ser-pretty.phar dumped_data.txt
This even works for Doctrine annotation cache files since ser-pretty 0.2.0., (*7)
You can also pipe serialized data from another script to it:, (*8)
$ some_script.php | ser-pretty.phar
You can also use ser-pretty as a library to integrate pretty printing of serialized PHP data into your debugging/monitoring/… tools. Just look into the CLI script to see what it does., (*9)
Parser parses serialized into a very simple ASTWriter turns an AST into a string representationser-pretty ships with a var_dump() style writer, the SimpleTextWriter which
you can use out of the box. You can implement your own writer by deriving the
Writer class., (*10)
Just include ser-pretty in your project via composer using or download the latest PHAR., (*11)
Pretty print serialized PHP data
MIT