<?

//=============================//
//                             //
//   pingStatus v0.1           //
//   pingStatus Cron Job file  //
//   pingStatus.Cron.php       //
//   by Stanga Razvan          //
//   razvan_stanga@yahoo.com   //
//   http://www.phprebel.org   //
//                             //
//       MADE IN ROMANIA       //
//                             //
//=============================//

class pingStatusCron {

//---------
// Cron Job
//---------

function do_write ($time_cache$file) {

        
ksort ($time_cache);

        
$file_data "<?\r\n";
        
        foreach( 
$time_cache as $t => $c )
        {
            
$file_data .= '$time_cache['."'".$t."'".']'."\t=\t'".$c."';\r\n";    
        }
        
        
$file_data .= "".'?'.'>';

        
$this->writetofile ("includes/_time/".$file.".php"$file_data);

}

//-------------------
// Start Write 2 File
//-------------------

function writetofile ($path,$data,$backup=0) {

      if ( 
file_exists($path) ) {
        if (
$backup==1) {
              
$filenamenew=$path."venom";
              
rename ($path,$filenamenew);
        } else {
              
unlink($path);
        }
    }


      if (
$data!="") {
        
$filenum=fopen($path,"w");
        
fwrite($filenum,$data);
        
fclose($filenum);

      }
}

}

?>