Subversion Repositories Sigmater

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 Andrea 1
<?php
2
 
3
 
4
/* apro il file di log */
5
function open_log($path_log){
6
  //echo "Il valore del path del file di log vale ".$path_log; 
7
  $fp_log=fopen($path_log,"w+");
8
  if(!$fp_log){
9
      echo "Errore apertura del file di log";
10
      return false;
11
  }
12
  write_log($fp_log,"****************************************************************");
13
  return $fp_log;
14
}
15
 
16
/* scrivo sul file di log */
17
function write_log($fp_log,$msg){
18
 
19
   $date = date("Ymd-H:i:s");
20
   $msg =$date." ".$msg."\n";
21
   fwrite($fp_log,$msg);
22
 
23
}
24
 
25
// chiudo il file di log
26
function close_log($fp_log)
27
{
28
  write_log($fp_log,"****************************************************************");
29
  fclose($fp_log);
30
}
31
?>