Guest User

Untitled

a guest
Aug 2nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. # Backuper FTP Class
  2. class Backuper_FTP {
  3.  
  4. protected $ftphost;
  5. protected $ftpuser;
  6. protected $ftppass;
  7. protected $connection;
  8.  
  9. # Constructor
  10. public function __construct($username, $password) {
  11.  
  12. $this->ftphost = "ftp01.sitedump.com";
  13. $this->ftpuser = $username;
  14. $this->ftppass = $password;
  15. }
  16.  
  17. # Connect to server
  18. public function connect() {
  19.  
  20. # Connect to FTP server
  21. $this->connection = ftp_connect($this->ftphost);
  22.  
  23. return (bool) $this->connection;
  24. }
  25.  
  26. # Login to server
  27. public function login() {
  28.  
  29. if(@ftp_login($this->connection, $this->ftpuser, $this->ftppass))
  30. return true;
  31. else
  32. return false;
  33. }
  34. }
Add Comment
Please, Sign In to add comment