private function GetCookieFile() { if (is_null($this->CookieJar)) { $this->CookieJar = tempnam(Config::getTmpDir(), "cURL-"); } }
function save_tmp_file($content, $dir1, $dir2, $filename) { if (!file_exists(Config::getTmpDir())) { NeobitsLogError("no tmp dir!"); return FALSE; } $csv_tmp = Config::getTmpDir() . "/" . $dir1; if (!file_exists($csv_tmp)) { if (!mkdir($csv_tmp)) { NeobitsLogError("cannot create csv dir {$csv_tmp}"); return FALSE; } } if (!file_exists($csv_tmp . "/" . $dir2)) { if (!mkdir($csv_tmp . "/" . $dir2)) { NeobitsLogError("cannot create csv dir {$csv_tmp}" . "/" . $dir2); return FALSE; } } $csv_dir = $csv_tmp . "/" . $dir2 . "/"; $csv_file = $filename; $fp = fopen($csv_dir . $csv_file, "w"); fwrite($fp, $content); fclose($fp); return $csv_dir; }
public function GetSFTPFileAttempt($Host, $User, $Password, $FilePath, $Port) { $downloadFile = tempnam(Config::getTmpDir(), "{$this->PartyID}-"); $command = "/usr/bin/expect -f " . Config::IncludePath() . "/sftp_expect {$Host} {$Port} {$User} {$Password} {$FilePath} {$downloadFile}"; $output = exec($command, $op, $return); if ($return != 0) { return FALSE; } return $downloadFile; }