Files
FreshRSS/cli/db-optimize.php
Alexis Degrugillier 1694264e2c Modify shebang to be more portable (#3038)
The new shebang is a portable way to find the php interpreter. It works
on Mac, GNU/Linux and BSD.
2020-06-06 19:04:21 +02:00

23 lines
477 B
PHP
Executable File

#!/usr/bin/env 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");
}
$username = cliInitUser($options['user']);
echo 'FreshRSS optimizing database for user “', $username, "”…\n";
$databaseDAO = FreshRSS_Factory::createDatabaseDAO($username);
$ok = $databaseDAO->optimize();
done($ok);