开发者

Turning Magpie Cache off

开发者 https://www.devze.com 2023-01-11 19:15 出处:网络
Im using magpie to pull rss feeds from several websites. im going to run a cron job to do this so would like to disable caching. im using php ofcourse and was 开发者_如何学JAVAwondering how i can do t

Im using magpie to pull rss feeds from several websites. im going to run a cron job to do this so would like to disable caching. im using php ofcourse and was 开发者_如何学JAVAwondering how i can do this. Thx


I found out in rss_fetch.php. scroll to init() function and set define('MAGPIE_CACHE_ON', true); to define('MAGPIE_CACHE_ON', false);

    function init () {
        if ( defined('MAGPIE_INITALIZED') ) {
            return;
        }
        else {
            define('MAGPIE_INITALIZED', true);
        }

        if ( !defined('MAGPIE_CACHE_ON') ) {
            define('MAGPIE_CACHE_ON', false);
        }
}


That (Sir Lojik's answer) will work, but rather than hack the Magpie code itself, you should put the define statement in your own code that calls Magpie:

define('MAGPIE_CACHE_ON', false);

That will override Magpie's setting (per the "if (!defined...." stuff in the code) and you won't need to remember to hack Magpie again should a new version ever be released.

It also means that you can have some scripts use the cache and other scripts ignore the cache, should that feature be useful to you.

0

精彩评论

暂无评论...
验证码 换一张
取 消