diff options
| author | 2016-10-23 13:37:48 +0200 | |
|---|---|---|
| committer | 2016-10-23 13:37:48 +0200 | |
| commit | fcb9280fc87c159539f5832ab35f174cd515654e (patch) | |
| tree | 8fa0879f001c9cbc6120d2b0bbff364358871851 /cli/export-zip-for-user.php | |
| parent | 6d42acf5fd7906168c9e547c3d0ce675b8fd6fd2 (diff) | |
CLI export
ZIP export, OPML export.
Corrected height of feeds select in Pafat theme.
https://github.com/FreshRSS/FreshRSS/pull/1338
https://github.com/FreshRSS/FreshRSS/issues/1039
https://github.com/FreshRSS/FreshRSS/issues/1277
Diffstat (limited to 'cli/export-zip-for-user.php')
| -rw-r--r-- | cli/export-zip-for-user.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cli/export-zip-for-user.php b/cli/export-zip-for-user.php new file mode 100644 index 000000000..f8d24238b --- /dev/null +++ b/cli/export-zip-for-user.php @@ -0,0 +1,30 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('', array( + 'user:', + 'max-feed-entries:', + )); + +if (empty($options['user'])) { + fail('Usage: ' . basename(__FILE__) . " --user username --max-feed-entries 100 > /path/to/file.zip'"); +} + +$username = cliInitUser($options['user']); + +fwrite(STDERR, 'FreshRSS exporting ZIP for user “' . $username . "”…\n"); + +$importController = new FreshRSS_importExport_Controller(); + +$ok = false; +try { + $ok = $importController->exportFile(true, true, true, + empty($options['max-feed-entries']) ? 100 : intval($options['max-feed-entries']), + $username); +} catch (FreshRSS_ZipMissing_Exception $zme) { + fail('FreshRSS error: Lacking php-zip extension!'); +} +invalidateHttpCache($username); + +done($ok); |
