summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-22 22:35:27 +0300
committerAndrew Dolgov <[email protected]>2021-02-22 22:35:27 +0300
commit211f699aa0c4211e4ee8a02446d51b9811d0c28c (patch)
tree1335af2487e9668d24db1dace41bdf46f1c10763 /include/functions.php
parent383f4ca04af8c7a1ff4f8be5a488f6799e0e0d37 (diff)
migrate the rest into Config::
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php50
1 files changed, 1 insertions, 49 deletions
diff --git a/include/functions.php b/include/functions.php
index 526c6058a..59c824e43 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -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") {