X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=doc%2FDatastore-hacks.html;h=15da09d4bf3d1be64fd67568a39cc721dadc0d05;hb=209aa96e7e32d810db30d2eb437cef2280c5cad6;hp=4677ae9100f9b9391cf0452453e4e6599327e8f4;hpb=992af0b9d77cb4fbac2c37ef8d5896042d67a2a3;p=github%2Fshaarli%2FShaarli.git diff --git a/doc/Datastore-hacks.html b/doc/Datastore-hacks.html index 4677ae91..15da09d4 100644 --- a/doc/Datastore-hacks.html +++ b/doc/Datastore-hacks.html @@ -4,45 +4,69 @@ -
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 .
Changing the timestamp for a link
- Look for
<input type="hidden" name="lf_linkdate" value="{$link.linkdate}">
in tpl/editlink.tpl
(line 14)
-- Remove
type="hidden"
from this line
+- Replace
type="hidden"
with type="text"
from this line
- A new date/time field becomes available in the edit/new link dialog.
- You can set the timestamp manually by entering it in the format
YYYMMDD_HHMMS
.