public static function IncludePath() { if (is_null(self::$IncludePath)) { self::$IncludePath = dirname(__FILE__); } return self::$IncludePath; }
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; }