public function writeLog($string) {
    $Config = GiroCheckout_SDK_Config::getInstance();
    $path = str_replace('\\', '/', $Config->getConfig('DEBUG_LOG_PATH'));

    if (!is_dir($path)) {
      if (!mkdir($path)) {
        error_log('Log directory does not exist. Please create directory: ' . $path . '.');
      }
      //write .htaccess to log directory
      $htfp = fopen($path . '/.htaccess', 'w');
      fwrite($htfp, "Order allow,deny\nDeny from all");
      fclose($htfp);
    }

    if (!self::$fp) {
      self::$fp = fopen($path . '/' . self::$logFileName, 'a');
      if (!self::$fp) {
        error_log('Log File (' . $path . '/' . self::$logFileName . ') is not writeable.');
      }
    }

    fwrite(self::$fp, $string);
  }
public function writeLog($string) {
    $Config = GiroCheckout_SDK_Config::getInstance();
    $path = str_replace('\\', '/', $Config->getConfig('DEBUG_LOG_PATH'));

    if (!is_dir($path)) {
      if (!mkdir($path)) {
        error_log('Log directory does not exist. Please create directory: ' . $path . '.');
      }
      //write .htaccess to log directory
      $htfp = fopen($path . '/.htaccess', 'w');
      fwrite($htfp, "Order allow,deny\nDeny from all");
      fclose($htfp);
    }

    if (!self::$fp) {
      self::$fp = fopen($path . '/' . self::$logFileName, 'a');
      if (!self::$fp) {
        error_log('Log File (' . $path . '/' . self::$logFileName . ') is not writeable.');
      }
    }

    fwrite(self::$fp, $string);
  }
public function writeLog ( $ string ) { $ Config = GiroCheckout_SDK_Config :: getInstance ( ) ; $ path = str_replace ( '\\' , '/' , $ Config -> getConfig ( 'DEBUG_LOG_PATH' ) ) ; if ( ! is_dir ( $ path ) ) { if ( ! mkdir ( $ path ) ) { error_log ( 'Log directory does not exist. Please create directory: ' . $ path . '.' ) ; } //write .htaccess to log directory $ htfp = fopen ( $ path . '/.htaccess' , 'w' ) ; fwrite ( $ htfp , "Order allow,deny\nDeny from all" ) ; fclose ( $ htfp ) ; } if ( ! self :: $ fp ) { self :: $ fp = fopen ( $ path . '/' . self :: $ logFileName , 'a' ) ; if ( ! self :: $ fp ) { error_log ( 'Log File (' . $ path . '/' . self :: $ logFileName . ') is not writeable.' ) ; } } fwrite ( self :: $ fp , $ string ) ; }
Writes log into log file

@param string $string Text to write to log
Writes log into log file