blob: 92fe9bf9a28608ae18dc055de8eaf655c3e6c29c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
|