Changed setting from a database value to be stored as a constant in the config.php

This commit is contained in:
Kordian Bruck 2015-08-02 18:20:38 +02:00
parent 2c3fd54774
commit 6e10b01d4a
7 changed files with 9 additions and 13 deletions

View File

@ -31,6 +31,8 @@ defined('AUTO_UPDATE_DOWNLOAD_DIRECTORY') or define('AUTO_UPDATE_DOWNLOAD_DIRECT
defined('AUTO_UPDATE_ARCHIVE_DIRECTORY') or define('AUTO_UPDATE_ARCHIVE_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'archive'); defined('AUTO_UPDATE_ARCHIVE_DIRECTORY') or define('AUTO_UPDATE_ARCHIVE_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'archive');
defined('AUTO_UPDATE_BACKUP_DIRECTORY') or define('AUTO_UPDATE_BACKUP_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'backup'); defined('AUTO_UPDATE_BACKUP_DIRECTORY') or define('AUTO_UPDATE_BACKUP_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'backup');
defined('SUBSCRIPTION_CONCURRENT_REQUESTS') or define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5);
defined('RULES_DIRECTORY') or define('RULES_DIRECTORY', ROOT_DIRECTORY.DIRECTORY_SEPARATOR.'rules'); defined('RULES_DIRECTORY') or define('RULES_DIRECTORY', ROOT_DIRECTORY.DIRECTORY_SEPARATOR.'rules');
defined('ENABLE_HSTS') or define('ENABLE_HSTS', true); defined('ENABLE_HSTS') or define('ENABLE_HSTS', true);

View File

@ -35,3 +35,6 @@ define('PROXY_PASSWORD', '');
// ENABLE_AUTO_UPDATE => default is true (enable Miniflux update from the user interface) // ENABLE_AUTO_UPDATE => default is true (enable Miniflux update from the user interface)
define('ENABLE_AUTO_UPDATE', true); define('ENABLE_AUTO_UPDATE', true);
// SUBSCRIPTION_CONCURRENT_REQUESTS => number of concurrent feeds to refresh at once - reduce this number on systems with limited processing power
define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5);

View File

@ -122,8 +122,7 @@ Router\get_action('feeds', function() {
'nb_unread_items' => $nb_unread_items, 'nb_unread_items' => $nb_unread_items,
'nb_failed_feeds' => Model\Feed\count_failed_feeds(), 'nb_failed_feeds' => Model\Feed\count_failed_feeds(),
'menu' => 'feeds', 'menu' => 'feeds',
'title' => t('Subscriptions'), 'title' => t('Subscriptions')
'frontend_concurrent_requests' => Model\Config\get('frontend_concurrent_requests')
))); )));
}); });

View File

@ -303,7 +303,6 @@ function validate_modification(array $values)
new Validators\Integer('nocontent', t('Must be an integer')), new Validators\Integer('nocontent', t('Must be an integer')),
new Validators\Integer('favicons', t('Must be an integer')), new Validators\Integer('favicons', t('Must be an integer')),
new Validators\Integer('original_marks_read', t('Must be an integer')), new Validators\Integer('original_marks_read', t('Must be an integer')),
new Validators\Integer('frontend_concurrent_requests', t('Must be an integer')),
); );
if (ENABLE_AUTO_UPDATE) { if (ENABLE_AUTO_UPDATE) {

View File

@ -5,12 +5,7 @@ namespace Schema;
use PDO; use PDO;
use Model\Config; use Model\Config;
const VERSION = 41; const VERSION = 40;
function version_41($pdo)
{
$pdo->exec('INSERT INTO settings ("key", "value") VALUES ("frontend_concurrent_requests", 5)');
}
function version_40($pdo) function version_40($pdo)
{ {

View File

@ -75,9 +75,7 @@
<?= Helper\form_checkbox('original_marks_read', t('Original link marks article as read'), 1, isset($values['original_marks_read']) && $values['original_marks_read'] == 1) ?><br/> <?= Helper\form_checkbox('original_marks_read', t('Original link marks article as read'), 1, isset($values['original_marks_read']) && $values['original_marks_read'] == 1) ?><br/>
<?= Helper\form_checkbox('nocontent', t('Do not fetch the content of articles'), 1, isset($values['nocontent']) && $values['nocontent'] == 1) ?><br/> <?= Helper\form_checkbox('nocontent', t('Do not fetch the content of articles'), 1, isset($values['nocontent']) && $values['nocontent'] == 1) ?><br/>
<?= Helper\form_checkbox('favicons', t('Download favicons'), 1, isset($values['favicons']) && $values['favicons'] == 1) ?><br/> <?= Helper\form_checkbox('favicons', t('Download favicons'), 1, isset($values['favicons']) && $values['favicons'] == 1) ?><br/>
>
<?= Helper\form_label(t('Number of feeds to update at once on the subscription page'), 'frontend_concurrent_requests') ?>
<?= Helper\form_number('frontend_concurrent_requests', $values, $errors, array('min="1"')) ?><br/>
</div> </div>
<div class="form-actions"> <div class="form-actions">

View File

@ -6,7 +6,7 @@
<li class="active"><a href="?action=feeds"><?= t('feeds') ?></a></li> <li class="active"><a href="?action=feeds"><?= t('feeds') ?></a></li>
<li><a href="?action=import"><?= t('import') ?></a></li> <li><a href="?action=import"><?= t('import') ?></a></li>
<li><a href="?action=export"><?= t('export') ?></a></li> <li><a href="?action=export"><?= t('export') ?></a></li>
<li><a href="?action=refresh-all" data-action="refresh-all" data-concurrent-requests="<?=$frontend_concurrent_requests?>"><?= t('refresh all') ?></a></li> <li><a href="?action=refresh-all" data-action="refresh-all" data-concurrent-requests="<?=SUBSCRIPTION_CONCURRENT_REQUESTS?>"><?= t('refresh all') ?></a></li>
</ul> </ul>
</nav> </nav>
</div> </div>