Files
FreshRSS/cli/db-optimize.php
Alexandre Alapetite f632a34626 CLI optimize database (#1663)
CLI optimize database https://github.com/FreshRSS/FreshRSS/issues/1583
And VACUUM in SQLite https://github.com/FreshRSS/FreshRSS/issues/918
Add VACUUM for PostgreSQL (Not tested yet)
2017-10-12 20:11:06 +02:00

21 lines
408 B
PHP
Executable File

#!/usr/bin/php
<?php
require('_cli.php');
$options = getopt('', array(
'user:',
));
if (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);