sitemap as $xml_file_url_list) { if ($index_updated >= $max_updated) {break;}; // abort if done max $xml_file_url = $xml_file_url_list->loc; echo("Starting on file: ". $xml_file_url ); // log // traverse XML file getting URL's $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $xml_file_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec ($ch); curl_close ($ch); $xml = new SimpleXMLElement($data); // for each URL foreach ($xml->url as $url_list) { $index_reviewed++; //index URL's reviewed if ($index_updated >= $max_updated) {break;}; // abort if done max // echo " DOES NOT EXIST, create it.\n"; $url = $url_list->loc; //check for matching file file; w/o http:// & w/ _.html $temp_file = $base_path . substr($url, 7) ."_.html"; //echo($temp_file ."\n"); // log // check for file if (!(file_exists($temp_file))) { // echo " DOES NOT EXIST. create via Curl request\n"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec ($ch); curl_close ($ch); $index_updated++; //index URL's updated }else{ // echo " DOES EXIST.\n"; } } // Done w/ file echo("Ending on file: ". $xml_file_url); } echo("Reviewed: ". $index_reviewed ." | Updated: ". $index_updated ); echo("\n-- Ending BOOST_CACHE_WARMER @ ". date('l jS \of F Y h:i:s A') ."\n\n"); ?>