(int)$config['cache_time'] && $config['cache_time']!==-1){ //File is more than a day old (or cache time setting)! Delete so it will update! unlink($_cache_file); } die; } //Attempt to get HTML from main server $_server_url=$config['server_url']."?".http_build_query(array( "request"=>$_request, "api"=>$config['api_key'], "pretty_url"=>$pretty_url_mode )); if($debug_mode){ debugMessage("Using server url - $_server_url"); //Get contents (showing errors) $_html_contents=cpaBuildGetContents($_server_url); } else{ //Get contents (ignore errors) $_html_contents=@cpaBuildGetContents($_server_url); } if($_html_contents){ if($config['mirror'] != "cpabuild.com" || $config['asset_mirror'] != "bucket.cpabuild.com"){ $_html_contents=str_replace("https://cpabuild.com/",$protocol."://".$config['mirror']."/",$_html_contents); $_html_contents=str_replace("https://bucket.cpabuild.com/",$protocol."://".$config['asset_mirror']."/",$_html_contents); $_html_contents=str_replace("http://cpabuild.com/",$protocol."://".$config['mirror']."/",$_html_contents); $_html_contents=str_replace("http://bucket.cpabuild.com/",$protocol."://".$config['asset_mirror']."/",$_html_contents); $_html_contents=str_replace("//bucket.cpabuild.com/",$protocol."://".$config['asset_mirror']."/",$_html_contents); $_html_contents=str_replace("//cpabuild.com/",$protocol."://".$config['mirror']."/",$_html_contents); } echo $_html_contents; cacheContents($_html_contents,$_cache_file); die; } else{ debugMessage("Error getting contents from server url. Redirecting to 404.php"); include $_CWD."/404.php"; die; }