Skip to content

Instantly share code, notes, and snippets.

@michelv
Last active December 8, 2018 21:31
Show Gist options
  • Save michelv/dd4244d67e804b5d204c8a828efe306c to your computer and use it in GitHub Desktop.
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
#!/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