1 => __("Magpie"),
2 => __("SimplePie"));
- if (ENABLE_SIMPLEPIE) {
+ if (DEFAULT_UPDATE_METHOD == "1") {
$update_methods[0] .= ' (SimplePie)';
} else {
$update_methods[0] .= ' (Magpie)';
// Connection charset for MySQL. Only enable if having charset-related
// errors with MySQL (mangled characters, errors when updating feeds, etc).
- define('ENABLE_SIMPLEPIE', false);
- // Enables SimplePie RSS parsing library (experimental). When this option
- // is disabled, Tiny Tiny RSS defaults to Magpie library.
-
- // SimplePie is somewhat faster, more robust and less clunky as Magpie.
- // While it doesn't internally support HTTP Digest authentication
- // (required for Livejournal protected feeds and such) and SSL, it can
- // support it when using CURL.
-
- // To summarize, if your PHP has CURL extension or you aren't subscribed
- // to any feeds using HTTP Digest authentication and Magpie XML parsing
- // errors are bothering you too much, you can try enabling SimplePie.
+ define('DEFAULT_UPDATE_METHOD', 0);
+ // Which feed parsing library to use as default:
+ // 0 - Magpie
+ // 1 - SimplePie
define('SIMPLEPIE_CACHE_DIR', '/var/tmp/simplepie-ttrss-cache');
// Cache directory for RSS feeds when using SimplePie
// intervals is disabled and all articles (which are not starred)
// older than this amount of days are purged.
- define('CONFIG_VERSION', 18);
+ define('CONFIG_VERSION', 19);
// Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file).
$auth_login = db_fetch_result($result, 0, "auth_login");
$auth_pass = db_fetch_result($result, 0, "auth_pass");
- if (ALLOW_SELECT_UPDATE_METHOD) {
- if (ENABLE_SIMPLEPIE) {
- $use_simplepie = $update_method != 1;
- } else {
- $use_simplepie = $update_method == 2;
- }
+ if (DEFAULT_UPDATE_METHOD == "1") {
+ $use_simplepie = $update_method != 1;
} else {
- $use_simplepie = ENABLE_SIMPLEPIE;
+ $use_simplepie = $update_method == 2;
}
if (defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug']) {
}
error_reporting(0);
- if (ENABLE_SIMPLEPIE) {
+ if (DEFAULT_UPDATE_INTERVAL == "1") {
$rss = new SimplePie();
$rss->set_useragent(SIMPLEPIE_USERAGENT . MAGPIE_USER_AGENT_EXT);
// $rss->set_timeout(MAGPIE_FETCH_TIME_OUT);
if ($rss) {
- if (ENABLE_SIMPLEPIE) {
+ if (DEFAULT_UPDATE_METHOD == "1") {
$items = $rss->get_items();
} else {
$items = $rss->items;
$latest_item = $items[0];
- if (ENABLE_SIMPLEPIE) {
+ if (DEFAULT_UPDATE_METHOD == "1") {
$last_title = $latest_item->get_title();
} else {
$last_title = $latest_item["title"];
$latest_version = trim(preg_replace("/(Milestone)|(completed)/", "", $last_title));
- if (ENABLE_SIMPLEPIE) {
+ if (DEFAULT_UPDATE_METHOD == "1") {
$release_url = sanitize_rss($link, $latest_item->get_link());
$content = sanitize_rss($link, $latest_item->get_description());
} else {
$checked = "";
}
- if (ENABLE_SIMPLEPIE && SIMPLEPIE_CACHE_IMAGES) {
+ if (SIMPLEPIE_CACHE_IMAGES) {
$disabled = "";
$label_class = "";
} else {
__('Cache images locally')."</label>";
- if (ENABLE_SIMPLEPIE && SIMPLEPIE_CACHE_IMAGES) {
+ if (SIMPLEPIE_CACHE_IMAGES) {
print " "; batch_edit_cbox("cache_images", "cache_images_l");
}
$parent_qpart = 'parent_feed = NULL';
}
- if (ENABLE_SIMPLEPIE && SIMPLEPIE_CACHE_IMAGES) {
+ if (SIMPLEPIE_CACHE_IMAGES) {
$cache_images_qpart = "cache_images = $cache_images,";
} else {
$cache_images_qpart = "";
<?php
require_once "functions.php";
- define('EXPECTED_CONFIG_VERSION', 18);
+ define('EXPECTED_CONFIG_VERSION', 19);
define('SCHEMA_VERSION', 66);
if (!file_exists("config.php")) {
}
+ if (defined('ENABLE_SIMPLEPIE')) {
+ $err_msg = "config: ENABLE_SIMPLEPIE is obsolete and replaced with DEFAULT_UPDATE_METHOD. Please adjust your config.php.";
+ }
+
+ if (!defined('DEFAULT_UPDATE_METHOD') || (DEFAULT_UPDATE_METHOD != 0 &&
+ DEFAULT_UPDATE_METHOD != 1)) {
+ $err_msg = "config: DEFAULT_UPDATE_METHOD should be either 0 or 1.";
+ }
+
if ($err_msg) {
print "<b>Fatal Error</b>: $err_msg\n";
exit;