Changeset 349 for dev/cron

Show
Ignore:
Timestamp:
10/19/08 15:49:55 (12 years ago)
Author:
beans
Message:

Fixed the cron scripts

Location:
dev/cron
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dev/cron/cron_fetcher.php

    r343 r349  
    1616 
    1717// Has to be run from the KB main directory for nested includes to work 
    18 $KB_HOME = "location/of/your/kb/main/dir"; 
     18echo "Edit the \$KB_HOME and remove this line and the next\n"; 
     19die(); 
     20$KB_HOME = "/your/killboard/path"; 
    1921chdir($KB_HOME);  
    2022 
    2123require_once('kbconfig.php'); 
    22 require_once('common/includes/class.db_memcache.php'); 
    23 $mc = new Memcache(); 
    24 $mc->connect("127.0.0.1", 11211); 
    2524require_once('common/includes/globals.php'); 
    2625require_once('common/includes/class.config.php'); 
     
    3029require_once('common/admin/feed_fetcher.php'); 
    3130 
     31$config = new Config(KB_SITE); 
     32if (((bool)config::get('cfg_memcache')) === true) 
     33{ 
     34        require_once('common/includes/class.db_memcache.php'); 
     35        $mc = new Memcache(); 
     36        $mc->connect(config::get('cfg_memcache_server'), config::get('cfg_memcache_port')); 
     37} 
     38 
    3239$validurl = "/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}((:[0-9]{1,5})?\/.*)?$/i"; 
    3340 
    3441// load the config from the database 
    35 $config = new Config(KB_SITE); 
    3642if (config::get('fetch_feed_count')) 
    3743    $feedcount = config::get('fetch_feed_count'); 
     
    9096        for ($l = $week - 1; $l <= $week; $l++) 
    9197        { 
    92             $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str)); 
    93             $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str . "&losses=1")); 
     98            $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str)). "\n"; 
     99            $out .= preg_replace('/<div.+No kills added from feed.+<\/div>/','',$feedfetch->grab($feed[$i] . "&year=" . $year . "&week=" . $l, $myid . $str . "&losses=1")) . "\n"; 
    94100        } 
    95101    } 
  • dev/cron/cron_import.php

    r343 r349  
    1010 
    1111// Edit the path below with your webspace directory to the killboard root folder - also check your php folder is correct as defined by the first line of this file 
    12 $KB_HOME = "location/of/your/kb/main/dir"; 
     12echo "Edit the \$KB_HOME and remove this line and the next\n"; 
     13die(); 
     14$KB_HOME = "/your/killboard/path"; 
    1315//chdir($KB_HOME);  
    14 chdir('/../../'); // finds Killboard root assuming that the we've started where we're supposed to start (<kb root>/mods/api_mod) - if this fails comment out and uncomment two lines above and edit path to correct path 
     16//chdir('/../../'); // finds Killboard root assuming that the we've started where we're supposed to start (<kb root>/mods/api_mod) - if this fails comment out and uncomment two lines above and edit path to correct path 
    1517 
    1618$path = ini_get("include_path"); 
     
    2224require_once( "common/includes/class.eveapi.php" ); 
    2325require_once( "common/includes/db.php" ); 
    24 require_once( "common/includes/class.db_memcache.php" ); 
    25  
    26 $mc = new Memcache(); 
    27 $mc->connect("127.0.0.1", 11211); 
    2826 
    2927$config = new Config(KB_SITE); 
     28if (((bool)config::get('cfg_memcache')) === true) 
     29{ 
     30        require_once('common/includes/class.db_memcache.php'); 
     31        $mc = new Memcache(); 
     32        $mc->connect(config::get('cfg_memcache_server'), config::get('cfg_memcache_port')); 
     33} 
     34 
    3035define('KB_TITLE', config::get('cfg_kbtitle')); 
    3136