*
* Please, support this software, send any suggestion and improvement to me
* or the mailing list and we will try to keep it updated and make it better
* every day.
*
* If you like it and use it, please let me know or contact the wmlprogramming
* mailing list: wmlprogramming@yahoogroups.com
*
*/
set_time_limit(600);
list($usec, $sec) = explode(" ", microtime());
$start = ((float)$usec + (float)$sec);
require_once('./wurfl_config.php');
define('FORCED_UPDATE', true);
require_once(WURFL_PARSER_FILE);
list($usec, $sec) = explode(" ", microtime());
$load_parser = ((float)$usec + (float)$sec);
wurfl_log('update_cache', "Forced cache update started");
if (WURFL_USE_CACHE === true) {
parse();
if ( WURFL_USE_MULTICACHE === true ) {
wurfl_log('update_cache', "Updating multicache dir");
touch(MULTICACHE_TOUCH);
if ( is_dir(MULTICACHE_DIR) )
rename(substr(MULTICACHE_DIR, 0, -1), substr(MULTICACHE_DIR, 0, -1).'.'.time());
rename(substr(MULTICACHE_TMP_DIR, 0, -1), substr(MULTICACHE_DIR, 0, -1));
unlink(MULTICACHE_TOUCH);
}
wurfl_log('update_cache', "Done updating cache");
} else {
wurfl_log('update_cache', "Why update cache if WURFL_URE_CACHE is not set to true?");
}
list($usec, $sec) = explode(" ", microtime());
$parse = ((float)$usec + (float)$sec);
echo "Parser load time:".($load_parser-$start)."
\n";
echo "Parsing time:".($parse-$load_parser)."
\n";
echo "Total:".($end-$start)."
\n";
?>