Created
November 27, 2016 07:39
-
-
Save shtrom/658b50af2529f44b26c8736b4261111d to your computer and use it in GitHub Desktop.
Export Wallabag 1.9 (and maybe other 1.x) library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Export Wallabag 1.9 (and maybe other 1.x) library. | |
* | |
* Olivier Mehani <shtrom+wallabag@ssji.net>, 2016 | |
* MIT license (same as Wallabag itself) | |
* | |
* Particularly useful in * case the normal export process dies with a message | |
* such as | |
* | |
* PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 74558957 bytes) in /srv/www/wallabag/inc/poche/Tools.class.php on line 231 | |
* | |
* Usage: place script in the root directory of your Wallabag installation, then run | |
* | |
* php -d memory_limit=256M wallabag19-export.php USERID | |
* | |
* Increase the memory limit if you still get fatal errors. | |
*/ | |
require_once 'inc/poche/global.inc.php'; | |
$p = new Poche(); | |
if (count($argv) < 2) { | |
error_log("usage: php -d memory_limit=xxxM {$argv[0]} USERID", 0); | |
die(1); | |
} else { | |
$userid = $argv[1]; | |
$entries = $p->store->retrieveAllWithTags($userid); | |
echo $p->tpl->render('export.twig', array( | |
'export' => Tools::renderJson($entries), | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@wallabag: FYI