Beispiel #1
0
 public function scriviLog($_testo)
 {
     $ret = FALSE;
     try {
         // Recupero l'IP
         $infoUtente = new SaxInfoUtente();
         // Gestione cartella che contiene tutti i log
         $posizioneLog = $this->getDirLog() . '/';
         // Gestione cartella anno
         $anno = date("Y");
         $posizioneLog .= $anno . "/";
         // Gestione cartella mese
         $mese = date("m");
         $posizioneLog .= $mese . "/";
         // Creo e riempio il file di log
         $giorno = date("d");
         $data = date("d/m/Y");
         $ora = date("H:i:s");
         $stringaLog = $data . "\t" . $ora . "\t" . $this->getUsernameLog() . "\t" . $infoUtente->getIp() . "\t" . $_testo . "#\r\n";
         $ret = SaxFileSystem::scriviFile($posizioneLog . $giorno . ".log", $stringaLog);
     } catch (Exception $e) {
         throw $e;
     }
     return $ret;
 }
Beispiel #2
0
 public static function getTestoFileReplace($_file, $_arrReplace)
 {
     try {
         $ret = SaxFileSystem::leggiFile($_file);
         if ($ret) {
             foreach ($_arrReplace as $chiave => $valore) {
                 $ret = str_replace($chiave, $valore, $ret);
             }
         }
         return $ret;
     } catch (Exception $e) {
         throw $e;
     }
 }