From: Andrew Dolgov Date: Fri, 1 Apr 2011 16:14:49 +0000 (+0400) Subject: because get_self_url_prefix() referenced information unavailable to php CLI clients... X-Git-Tag: 1.5.3~79 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=ed102aa083839c205db31bff3402b1d8783e2860;p=tt-rss.git because get_self_url_prefix() referenced information unavailable to php CLI clients, add config option SELF_URL_PATH --- diff --git a/config.php-dist b/config.php-dist index 8b01aeb8..4fea9cc0 100644 --- a/config.php-dist +++ b/config.php-dist @@ -9,6 +9,10 @@ define('DB_PASS', "XXXXXX"); //define('DB_PORT', '5432'); // when neeeded, PG-only + define('SELF_URL_PATH', 'http://localhost/tt-rss'); + // 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 diff --git a/functions.php b/functions.php index 5096484c..a6e53702 100644 --- a/functions.php +++ b/functions.php @@ -766,7 +766,7 @@ return; // no articles } - if (PUBSUBHUBBUB_HUB && $pubsub_state != 2) { + if ($pubsub_state != 2) { $feed_hub_url = false; if ($use_simplepie) { @@ -5507,7 +5507,7 @@ function get_self_url_prefix() { - $url_path = ""; + /* $url_path = ""; if ($_SERVER['HTTPS'] != "on") { $url_path = "http://"; @@ -5517,7 +5517,9 @@ $url_path .= $_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); - return $url_path; + return $url_path; */ + + return SELF_URL_PATH; } function opml_publish_url($link){ @@ -5558,8 +5560,10 @@ * @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 .= "?op=pref-feeds&quiet=1&subop=add&feed_url=%s"; + //$url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); + + $url_path = get_self_url_prefix() . + "/backend.php?op=pref-feeds&quiet=1&subop=add&feed_url=%s"; return $url_path; } // function add_feed_url diff --git a/sanity_config.php b/sanity_config.php index 22598d3d..24827926 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', 'MAGPIE_FETCH_TIME_OUT', 'MAGPIE_CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'SINGLE_USER_MODE', 'TMP_DIRECTORY', 'ENABLE_UPDATE_DAEMON', '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', 'SIMPLEPIE_CACHE_DIR', 'SIMPLEPIE_CACHE_IMAGES', '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', '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'); ?>