X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=doc%2FDatastore-hacks.html;h=886394027198418c233a9c3f64669008f3ebbd5b;hb=7329118e9cfb41e4db0d898183304fcb0b204f7b;hp=0bf2a49373edbfbaf7327d644ea0b8746e2e54a0;hpb=bb91a8c6e8649d482a552b64c6a0c8e65c6becd7;p=github%2Fshaarli%2FShaarli.git diff --git a/doc/Datastore-hacks.html b/doc/Datastore-hacks.html index 0bf2a493..88639402 100644 --- a/doc/Datastore-hacks.html +++ b/doc/Datastore-hacks.html @@ -4,31 +4,49 @@ - Shaarli - Datastore hacks + Shaarli – Datastore hacks - +
@@ -39,18 +57,25 @@ code > span.er { color: #ff0000; font-weight: bold; }
  • Download
  • Server requirements
  • Server configuration
  • +
  • Server security
  • +
  • Shaarli installation
  • Shaarli configuration
  • +
  • Plugins
  • +
  • Docker
  • Usage
  • How To
  • @@ -62,6 +87,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
  • Directory structure
  • 3rd party libraries
  • Plugin System
  • +
  • Release Shaarli
  • Security
  • Static analysis
  • Theming
  • @@ -78,17 +104,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 .