82df35a59b
This is a major change for the next release of Miniflux. - There is now only one database that can supports multiple users - There is no automated schema migration for this release - A migration procedure is available in the ChangeLog file
32 lines
750 B
PHP
32 lines
750 B
PHP
<?php
|
|
|
|
use Pheanstalk\Pheanstalk;
|
|
use Miniflux\Model;
|
|
|
|
require __DIR__.'/app/common.php';
|
|
|
|
if (php_sapi_name() !== 'cli') {
|
|
die('This script can run only from the command line.'.PHP_EOL);
|
|
}
|
|
|
|
$options = getopt('', array(
|
|
'limit::',
|
|
));
|
|
|
|
$limit = get_cli_option('limit', $options);
|
|
$connection = new Pheanstalk(BEANSTALKD_HOST);
|
|
|
|
foreach (Model\User\get_all_users() as $user) {
|
|
foreach (Model\Feed\get_feed_ids($user['id'], $limit) as $feed_id) {
|
|
$payload = serialize(array(
|
|
'feed_id' => $feed_id,
|
|
'user_id' => $user['id'],
|
|
));
|
|
|
|
$connection
|
|
->useTube(BEANSTALKD_QUEUE)
|
|
->put($payload, Pheanstalk::DEFAULT_PRIORITY, Pheanstalk::DEFAULT_DELAY, BEANSTALKD_TTL);
|
|
}
|
|
}
|
|
|