X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=doc%2FDatastore-hacks.html;h=15da09d4bf3d1be64fd67568a39cc721dadc0d05;hb=fb6c8f770a07e38d5250ca4d6717445002e7bfb3;hp=e3adee1990b9b3de056604cb3788de7583564a55;hpb=6335a0fc0ce0c2f962333f0b4d6baac1671df901;p=github%2Fshaarli%2FShaarli.git diff --git a/doc/Datastore-hacks.html b/doc/Datastore-hacks.html index e3adee19..15da09d4 100644 --- a/doc/Datastore-hacks.html +++ b/doc/Datastore-hacks.html @@ -4,45 +4,69 @@ - Shaarli - Datastore hacks + Shaarli – Datastore hacks - +

Datastore hacks

Decode datastore content

To display the array representing the data saved in data/datastore.php, use the following snippet:

-
$data = "tZNdb9MwFIb... <Commented content inside datastore.php>";
+
$data = "tZNdb9MwFIb... <Commented content inside datastore.php>";
 $out = unserialize(gzinflate(base64_decode($data)));
 echo "<pre>"; // Pretty printing is love, pretty printing is life
 print_r($out);
 echo "</pre>";
-exit;
+exit;

This will output the internal representation of the datastore, "unobfuscated" (if this can really be considered obfuscation).

+

Alternatively, you can transform to JSON format (and pretty-print if you have jq installed):

+
php -r 'print(json_encode(unserialize(gzinflate(base64_decode(preg_replace("!.*/\* (.+) \*/.*!", "$1", file_get_contents("data/datastore.php")))))));' | jq .