mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-18 10:17:57 -05:00
Filenames were created with the username of the current user. However, when we export the files with the CLI, the current user is "_". This commit makes the username always required in the `exportFile` method so we make sure to always manipulate a real value. Consequently, the filenames can be formatted correctly. Obviously, this has absolutely no impacts since the CLI doesn't consider the HTTP headers. It just makes things a bit more clear. It's a first step to remove the concept of "default user".
27 lines
598 B
PHP
Executable File
27 lines
598 B
PHP
Executable File
#!/usr/bin/php
|
|
<?php
|
|
require(__DIR__ . '/_cli.php');
|
|
|
|
$params = array(
|
|
'user:',
|
|
);
|
|
|
|
$options = getopt('', $params);
|
|
|
|
if (!validateOptions($argv, $params) || empty($options['user'])) {
|
|
fail('Usage: ' . basename(__FILE__) . " --user username > /path/to/file.opml.xml");
|
|
}
|
|
|
|
$username = cliInitUser($options['user']);
|
|
|
|
fwrite(STDERR, 'FreshRSS exporting OPML for user “' . $username . "”…\n");
|
|
|
|
$importController = new FreshRSS_importExport_Controller();
|
|
|
|
$ok = false;
|
|
$ok = $importController->exportFile($username, true, false, false, array(), 0);
|
|
|
|
invalidateHttpCache($username);
|
|
|
|
done($ok);
|