1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 18:35:57 +00:00

migrate the rest into Config::

This commit is contained in:
Andrew Dolgov
2021-02-22 22:35:27 +03:00
parent 383f4ca04a
commit 211f699aa0
24 changed files with 187 additions and 208 deletions

View File

@@ -5,12 +5,6 @@
define('LABEL_BASE_INDEX', -1024);
define('PLUGIN_FEED_BASE_INDEX', -128);
define('COOKIE_LIFETIME_LONG', 86400*365);
// this CSS file is included for everyone (if it exists in themes.local)
// on login, registration, and main (index and prefs) pages
define('LOCAL_OVERRIDE_STYLESHEET', '.local-overrides.css');
$fetch_last_error = false;
$fetch_last_error_code = false;
$fetch_last_content_type = false;
@@ -37,49 +31,7 @@
ini_set('display_errors', "false");
ini_set('display_startup_errors', "false");
require_once 'config.php';
/* Some tunables you can override in config.php using define(): */
if (!defined('FEED_FETCH_TIMEOUT')) define('FEED_FETCH_TIMEOUT', 45);
// How may seconds to wait for response when requesting feed from a site
if (!defined('FEED_FETCH_NO_CACHE_TIMEOUT')) define('FEED_FETCH_NO_CACHE_TIMEOUT', 15);
// How may seconds to wait for response when requesting feed from a
// site when that feed wasn't cached before
if (!defined('FILE_FETCH_TIMEOUT')) define('FILE_FETCH_TIMEOUT', 45);
// Default timeout when fetching files from remote sites
if (!defined('FILE_FETCH_CONNECT_TIMEOUT')) define('FILE_FETCH_CONNECT_TIMEOUT', 15);
// How many seconds to wait for initial response from website when
// fetching files from remote sites
if (!defined('DAEMON_UPDATE_LOGIN_LIMIT')) define('DAEMON_UPDATE_LOGIN_LIMIT', 30);
// stop updating feeds if users haven't logged in for X days
if (!defined('DAEMON_FEED_LIMIT')) define('DAEMON_FEED_LIMIT', 500);
// feed limit for one update batch
if (!defined('DAEMON_SLEEP_INTERVAL')) define('DAEMON_SLEEP_INTERVAL', 120);
// default sleep interval between feed updates (sec)
if (!defined('MAX_CACHE_FILE_SIZE')) define('MAX_CACHE_FILE_SIZE', 64*1024*1024);
// do not cache files larger than that (bytes)
if (!defined('MAX_DOWNLOAD_FILE_SIZE')) define('MAX_DOWNLOAD_FILE_SIZE', 16*1024*1024);
// do not download general files larger than that (bytes)
if (!defined('MAX_FAVICON_FILE_SIZE')) define('MAX_FAVICON_FILE_SIZE', 1*1024*1024);
// do not download favicon files larger than that (bytes)
if (!defined('CACHE_MAX_DAYS')) define('CACHE_MAX_DAYS', 7);
// max age in days for various automatically cached (temporary) files
if (!defined('MAX_CONDITIONAL_INTERVAL')) define('MAX_CONDITIONAL_INTERVAL', 3600*12);
// max interval between forced unconditional updates for servers
// not complying with http if-modified-since (seconds)
// if (!defined('MAX_FETCH_REQUESTS_PER_HOST')) define('MAX_FETCH_REQUESTS_PER_HOST', 25);
// a maximum amount of allowed HTTP requests per destination host
// during a single update (i.e. within PHP process lifetime)
// this is used to not cause excessive load on the origin server on
// e.g. feed subscription when all articles are being processes
// (not implemented)
if (!defined('DAEMON_UNSUCCESSFUL_DAYS_LIMIT')) define('DAEMON_UNSUCCESSFUL_DAYS_LIMIT', 30);
// automatically disable updates for feeds which failed to
// update for this amount of days; 0 disables
/* tunables end here */
require_once "config.php";
require_once "autoload.php";
if (Config::get(Config::DB_TYPE) == "pgsql") {