FtpClient\FtpWrapper::__call PHP Method

__call() public method

Forward the method call to FTP functions
public __call ( string $function, array $arguments ) : mixed
$function string
$arguments array
return mixed
    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");
    }

Usage Example

Beispiel #1
0
 /**
  * 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);
 }