/**
* Define a constant if not already defined
- *
- * @param string $name The constant name.
- * @param mixed $value The constant value.
- * @access public
- * @return boolean True if defined successfully or not.
*/
function define_default($name, $value) {
defined($name) or define($name, $value);
}
- ///// Some defaults that you can override in config.php //////
+ /* Some tunables you can override in config.php using define(): */
define_default('FEED_FETCH_TIMEOUT', 45);
// How may seconds to wait for response when requesting feed from a site
define_default('FILE_FETCH_CONNECT_TIMEOUT', 15);
// How many seconds to wait for initial response from website when
// fetching files from remote sites
-
- // feed updating stuff
define_default('DAEMON_UPDATE_LOGIN_LIMIT', 30);
+ // stop updating feeds if users haven't logged in for X days
define_default('DAEMON_FEED_LIMIT', 500);
+ // feed limit for one update batch
define_default('DAEMON_SLEEP_INTERVAL', 120);
- define_default('_MIN_CACHE_FILE_SIZE', 1024);
+ // default sleep interval between feed updates (sec)
+ define_default('MIN_CACHE_FILE_SIZE', 1024);
+ // do not cache files smaller than that (bytes)
+ define_default('CACHE_MAX_DAYS', 7);
+ // max age in days for various automatically cached (temporary) files
+
+ /* tunables end here */
if (DB_TYPE == "pgsql") {
define('SUBSTRING_FOR_DATE', 'SUBSTRING_FOR_DATE');
define('SELF_USER_AGENT', 'Tiny Tiny RSS/' . VERSION . ' (http://tt-rss.org/)');
ini_set('user_agent', SELF_USER_AGENT);
- require_once 'lib/pubsubhubbub/Publisher.php';
-
$schema_version = false;
function _debug_suppress($suppress) {
}
}
- /**
- * Compute the Mozilla Firefox feed adding URL from server HOST and REQUEST_URI.
- *
- * @return string The Mozilla Firefox feed adding URL.
- */
- function add_feed_url() {
- //$url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
-
- $url_path = get_self_url_prefix() .
- "/public.php?op=subscribe&feed_url=%s";
- return $url_path;
- } // function add_feed_url
-
function encrypt_password($pass, $salt = '', $mode2 = false) {
if ($salt && $mode2) {
return "MODE2:" . hash('sha256', $salt . $pass);