X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=doc%2FDatastore-hacks.html;h=6273fae077f968e790dc720b1ed540e2d21c52d1;hb=62a5ba083d5137feaef9f4293c401521bad603b0;hp=4677ae9100f9b9391cf0452453e4e6599327e8f4;hpb=992af0b9d77cb4fbac2c37ef8d5896042d67a2a3;p=github%2Fshaarli%2FShaarli.git diff --git a/doc/Datastore-hacks.html b/doc/Datastore-hacks.html index 4677ae91..6273fae0 100644 --- a/doc/Datastore-hacks.html +++ b/doc/Datastore-hacks.html @@ -4,31 +4,49 @@ - Shaarli - Datastore hacks + Shaarli – Datastore hacks - +
@@ -36,21 +54,31 @@ code > span.er { color: #ff0000; font-weight: bold; }
  • Home
  • Installation
  • +
  • Docker
  • +
  • Plugin list
  • Usage
  • How To
  • Troubleshooting
  • Development @@ -60,6 +88,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
  • Directory structure
  • 3rd party libraries
  • Plugin System
  • +
  • Release Shaarli
  • Security
  • Static analysis
  • Theming
  • @@ -76,17 +105,19 @@ code > span.er { color: #ff0000; font-weight: bold; }

    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 .