public function __call($function, array $arguments)
{
$function = 'ftp_' . $function;
if (function_exists($function)) {
array_unshift($arguments, $this->conn);
return call_user_func_array($function, $arguments);
}
throw new FtpException("{$function} is not a valid FTP function");
}
/** * Call an internal method or a FTP method handled by the wrapper. * * Wrap the FTP PHP functions to call as method of FtpClient object. * The connection is automaticaly passed to the FTP PHP functions. * * @param string $method * @param array $arguments * @return mixed * @throws FtpException When the function is not valid */ public function __call($method, array $arguments) { return $this->ftp->__call($method, $arguments); }