Permalink
Browse files

Merge pull request #1 from voxpelli/master

Improved formatting of deseralized data
  • Loading branch information...
2 parents a212aed + b7eefbc commit 8691dc473a926f6b63fe78a70fa01d8657a590d2 @mattlangtree mattlangtree committed Sep 4, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 Deserialize php.spBundle/command.plist
@@ -11,7 +11,17 @@
<pre>
<?php
- print_r( unserialize(fgets(STDIN)));
+function goFormatVarExport($string) {
+ return preg_replace(array(
+ '/=>\s+array\(/im',
+ '/array\(\s+\)/im',
+ ), array(
+ '=> array(',
+ 'array()',
+ ), str_replace('array (', 'array(', $string));
+}
+
+print_r(goFormatVarExport(var_export(unserialize(fgets(STDIN)), TRUE)));
?>
&lt;/pre&gt;</string>
<key>contact</key>

0 comments on commit 8691dc4

Please sign in to comment.