]> git.wh0rd.org Git - tt-rss.git/commitdiff
config: replace confusing option ENABLE_SIMPLEPIE with DEFAULT_UPDATE_METHOD; bump...
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 30 Jun 2010 08:57:11 +0000 (12:57 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 30 Jun 2010 08:57:11 +0000 (12:57 +0400)
backend.php
config.php-dist
functions.php
modules/pref-feeds.php
sanity_check.php

index 8ccc503afc9aea1d01b17b27137bb554baed8ea9..38af31c1c2f1de2c43ae5b3a3e2e38abf806a2d4 100644 (file)
                1   => __("Magpie"),
                2   => __("SimplePie"));
 
-       if (ENABLE_SIMPLEPIE) {
+       if (DEFAULT_UPDATE_METHOD == "1") {
                $update_methods[0] .= ' (SimplePie)';
        } else {
                $update_methods[0] .= ' (Magpie)';
index 58811646d69076c7ab86c631bc17250d4f565d31..ea236ff5612f9d829989f21a711c1973c5423092 100644 (file)
        // 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).
 
index 4bf9cee4c601bdabc6a5844121fb33d7dec1ef90..9bf2bcacecefece6294075a0b3e6b6e819a3ff79 100644 (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 {
index 74232a67087fa03c704c26868b21e66671f0f352..c0d436cecef4564b35e9b67ce35d899c6d75cf7c 100644 (file)
                                $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 "&nbsp;"; 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 = "";
index d2f0e31778862e8b41e7c21d7397ba2ddcc7bfd7..b0d7477c75be36164f6d99ccd55a2836334c9242 100644 (file)
@@ -1,7 +1,7 @@
 <?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;