mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-21 11:47:53 -05:00
For uniformity, and to avoid having PHP searching in include_path. http://php.net/manual/function.include.php https://github.com/FreshRSS/FreshRSS/pull/1715 https://github.com/FreshRSS/FreshRSS/pull/1711#issuecomment-350581350
31 lines
768 B
PHP
Executable File
31 lines
768 B
PHP
Executable File
#!/usr/bin/php
|
|
<?php
|
|
require(__DIR__ . '/_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);
|