Deployer\Server\Remote\SshExtension::upload PHP Method

upload() public method

public upload ( $local, $remote )
    public function upload($local, $remote)
    {
        $this->checkConnection();
        $remote = str_replace(DIRECTORY_SEPARATOR, '/', $remote);
        $dir = str_replace(DIRECTORY_SEPARATOR, '/', dirname($remote));
        if (!isset($this->directories[$dir])) {
            $this->session->getSftp()->mkdir($dir, -1, true);
            $this->directories[$dir] = true;
        }
        if ($this->session->getSftp()->send($local, $remote) === false) {
            throw new \RuntimeException('Can not upload file.');
        }
    }