From 61e420e964cea6e70d445a872f88ca5a56fc31d0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 12 Apr 2011 19:44:39 +0400 Subject: [PATCH] config: cleanup --- config.php-dist | 34 +++++++++++++--------------------- functions.php | 10 +++++++--- sanity_config.php | 4 ++-- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/config.php-dist b/config.php-dist index 1fccbfccc..1fc384c74 100644 --- a/config.php-dist +++ b/config.php-dist @@ -13,14 +13,18 @@ // Full URL of your tt-rss installation. You need to set this option // correctly for tt-rss to function properly. - define('MAGPIE_FETCH_TIME_OUT', 60); - // Magpie's default timeout is 5 seconds. Some RSS feeds, - // such as from large Trac installs, can take significantly - // longer than 5 seconds to generate. To prevent failed - // updates, increase this. + define('SINGLE_USER_MODE', true); + // Operate in single user mode, disables all functionality related to + // multiple users. + + define('CACHE_DIR', 'cache'); + // Local cache directory for RSS feed content. - define('MAGPIE_CACHE_DIR', 'cache/magpie'); - // Local cache directory for RSS feeds + define('SIMPLEPIE_CACHE_IMAGES', false); + // Allow caching feed images when using SimplePie, to bypass hotlink + // prevention and such at expense of local disk space and bandwidth. + // Note that you (or your users) also have to enable image caching + // in feed editor. define('ICONS_DIR', "icons"); define('ICONS_URL', "icons"); @@ -31,10 +35,6 @@ // need to change this and rename icons/ directory if you install tt-rss // into website root. - define('SINGLE_USER_MODE', true); - // Operate in single user mode, disables all functionality related to - // multiple users. - define('TMP_DIRECTORY', '/tmp'); // Directory for temporary files @@ -88,15 +88,6 @@ // 0 - Magpie // 1 - SimplePie - define('SIMPLEPIE_CACHE_DIR', 'cache/simplepie'); - // Cache directory for RSS feeds when using SimplePie - - define('SIMPLEPIE_CACHE_IMAGES', false); - // Allow caching feed images when using SimplePie, to bypass hotlink - // prevention and such at expense of local disk space and bandwidth. - // Note that you (or your users) also have to enable image caching - // in feed editor. - define('COUNTERS_MAX_AGE', 365); // Hard limit for unread counters calculation. Try tweaking this // parameter to speed up tt-rss when having a huge number of articles @@ -177,7 +168,8 @@ // Please see http://tt-rss.org/wiki/SphinxSearch for more information. define('SPHINX_INDEX', 'ttrss'); - // Index name in Sphinx configuration + // Index name in Sphinx configuration. You can specify multiple indexes + // as a comma-separated string. define('ENABLE_TWEET_BUTTON', false); // Enable 'tweet this' button for articles diff --git a/functions.php b/functions.php index bccb99d2a..b56fd3ac4 100644 --- a/functions.php +++ b/functions.php @@ -611,11 +611,15 @@ define('MAGPIE_CACHE_AGE', get_feed_update_interval($link, $feed) * 60); define('MAGPIE_CACHE_ON', !$no_cache); + define('MAGPIE_FETCH_TIME_OUT', 60); + define('MAGPIE_CACHE_DIR', CACHE_DIR . "/magpie"); $rss = @fetch_rss($fetch_url); } else { - if (!is_dir(SIMPLEPIE_CACHE_DIR)) { - mkdir(SIMPLEPIE_CACHE_DIR); + $simplepie_cache_dir = CACHE_DIR . "/simplepie"; + + if (!is_dir($simplepie_cache_dir)) { + mkdir($simplepie_cache_dir); } $rss = new SimplePie(); @@ -641,7 +645,7 @@ $rss->enable_cache(!$no_cache); if (!$no_cache) { - $rss->set_cache_location(SIMPLEPIE_CACHE_DIR); + $rss->set_cache_location($simplepie_cache_dir); $rss->set_cache_duration(get_feed_update_interval($link, $feed) * 60); } diff --git a/sanity_config.php b/sanity_config.php index ffbb0e97d..dcc3f6e73 100644 --- a/sanity_config.php +++ b/sanity_config.php @@ -1,3 +1,3 @@ - +$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'SELF_URL_PATH', 'SINGLE_USER_MODE', 'CACHE_DIR', 'SIMPLEPIE_CACHE_IMAGES', 'ICONS_DIR', 'ICONS_URL', 'TMP_DIRECTORY', 'DAEMON_SLEEP_INTERVAL', 'DATABASE_BACKED_SESSIONS', 'SESSION_CHECK_ADDRESS', 'SESSION_COOKIE_LIFETIME', 'SESSION_EXPIRE_TIME', 'DAEMON_UPDATE_LOGIN_LIMIT', 'CHECK_FOR_NEW_VERSION', 'DIGEST_ENABLE', 'DIGEST_EMAIL_LIMIT', 'DAEMON_SENDS_DIGESTS', 'MYSQL_CHARSET', 'DEFAULT_UPDATE_METHOD', 'COUNTERS_MAX_AGE', 'DIGEST_FROM_NAME', 'DIGEST_FROM_ADDRESS', 'DIGEST_SUBJECT', 'DIGEST_SMTP_HOST', 'DIGEST_SMTP_LOGIN', 'DIGEST_SMTP_PASSWORD', 'DAEMON_FEED_LIMIT', 'ALLOW_REMOTE_USER_AUTH', 'AUTO_LOGIN', 'AUTO_CREATE_USER', 'LOCK_DIRECTORY', 'ENABLE_GZIP_OUTPUT', 'PHP_EXECUTABLE', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'FEEDBACK_URL', 'FORCE_ARTICLE_PURGE', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_TWEET_BUTTON', 'CONSUMER_KEY', 'CONSUMER_SECRET', 'PUBSUBHUBBUB_HUB', 'ISCONFIGURED', 'CONFIG_VERSION'); ?>