Exemplo n.º 1
0
 /**
  * Creates the log file
  * @throws Exception
  * @return boolean
  */
 public static function createFile()
 {
     if (!self::$active) {
         return false;
     }
     $defaultPath = PagSeguroLibrary::getPath();
     $defaultName = 'PagSeguro.log';
     self::$fileLocation = $defaultPath . DIRECTORY_SEPARATOR . $defaultName;
     if ($f = @fopen(self::$fileLocation, "a")) {
         fclose($f);
     } else {
         throw new Exception("Can't create log file. Permission denied. File location: " . self::$fileLocation);
     }
 }
Exemplo n.º 2
0
 /**
  * Creates the log file
  * @throws Exception
  * @return boolean
  */
 public static function createFile()
 {
     if (!self::$active) {
         return false;
     }
     $defaultPath = PagSeguroLibrary::getPath();
     $defaultName = 'PagSeguro.log';
     self::$fileLocation = $defaultPath . DIRECTORY_SEPARATOR . $defaultName;
     try {
         $f = fopen(self::$fileLocation, "a");
         fclose($f);
     } catch (Exception $e) {
         echo $e->getMessage() . " - Can't create log file. Permission denied. File location: " . self::$fileLocation;
     }
 }
Exemplo n.º 3
0
 public static function createFile($logFile = false)
 {
     if (!self::$active) {
         return false;
     }
     $defaultPath = PagSeguroLibrary::getPath();
     $defaultName = 'PagSeguro.log';
     self::$fileLocation = $logFile ? $logFile : $defaultPath . DIRECTORY_SEPARATOR . $defaultName;
     try {
         $f = fopen(self::$fileLocation, "a");
         if (!$f) {
             throw new Exception('Unable to open the input file');
         }
         fclose($f);
         return true;
     } catch (Exception $e) {
         echo $e->getMessage() . " - Can't create log file. Permission denied. File location: " . self::$fileLocation;
         return false;
     }
 }
 public static function createFile()
 {
     if (!self::$active) {
         return false;
     }
     $defaultPath = PagSeguroLibrary::getPath();
     $defaultName = 'PagSeguro' . mt_rand() . '.log';
     self::$fileLocation = $defaultPath . DIRECTORY_SEPARATOR . $defaultName;
     Configuration::updateValue('PAGSEGURO_LOG_FILELOCATION', "/modules/pagseguro/features/PagSeguroLibrary/" . $defaultName);
     try {
         $f = fopen(self::$fileLocation, "a");
         if (!$f) {
             throw new Exception('Unable to open the input file');
         }
         fclose($f);
         return true;
     } catch (Exception $e) {
         echo $e->getMessage() . " - Can't create log file. Permission denied. File location: " . self::$fileLocation;
         return false;
     }
 }