FtpClient\FtpClient::login PHP Метод

login() публичный Метод

Logs in to an FTP connection.
public login ( string $username = 'anonymous', string $password = '' ) : FtpClient
$username string
$password string
Результат FtpClient
    public function login($username = 'anonymous', $password = '')
    {
        $result = $this->ftp->login($username, $password);
        if ($result === false) {
            throw new FtpException('Login incorrect');
        }
        return $this;
    }

Usage Example

Пример #1
0
 public function __construct($host, $user, $password, $environment)
 {
     $this->connection = new \FtpClient\FtpClient();
     $this->connection->connect($host);
     $this->connection->login($user, $password);
     $this->environment = $environment;
 }