Created
January 14, 2012 03:25
-
-
Save clone1018/1610119 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ftp{ | |
public $conn; | |
public function __construct($url){ | |
$this->conn = ftp_connect($url); | |
} | |
public function __call($func,$a){ | |
if(strstr($func,'ftp_') !== false && function_exists($func)){ | |
array_unshift($a,$this->conn); | |
return call_user_func_array($func,$a); | |
}else{ | |
// replace with your own error handler. | |
die("$func is not a valid FTP function"); | |
} | |
} | |
} | |
// Example | |
$ftp = new ftp('YOURIP'); | |
$ftp->ftp_login('YOURUSER','YOURPASS'); | |
var_dump($ftp->ftp_nlist("./serviceNUM/plugins/mcMMO")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment