Last active
December 8, 2018 21:31
-
-
Save michelv/dd4244d67e804b5d204c8a828efe306c to your computer and use it in GitHub Desktop.
igdump : a command line utility to unserialize and dump igbinary-serialized PHP data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
if (isset($argv[1]) && ($argv[1] == '--help' || $argv[1] == '-h')) { | |
echo sprintf( | |
"Usage: \n [igbinary-serialized data] | %s\n", | |
basename(__FILE__) | |
); | |
exit(); | |
} | |
if (file_exists('vendor/autoload.php')) { | |
require('vendor/autoload.php'); | |
} | |
$data = igbinary_unserialize(stream_get_contents(STDIN)); | |
if (function_exists('dump')) { | |
dump($data); | |
} else { | |
var_export($data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment