array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.ssh2-sftp-realpath.php', 1 => 'ssh2_sftp_realpath', 2 => 'Resolve o caminho real de uma string de caminho fornecida', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'Funções de SSH2', ), 'prev' => array ( 0 => 'function.ssh2-sftp-readlink.php', 1 => 'ssh2_sftp_readlink', ), 'next' => array ( 0 => 'function.ssh2-sftp-rename.php', 1 => 'ssh2_sftp_rename', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'pt_BR', 'path' => 'reference/ssh2/functions/ssh2-sftp-realpath.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

ssh2_sftp_realpath

(PECL ssh2 >= 0.9.0)

ssh2_sftp_realpathResolve o caminho real de uma string de caminho fornecida

Descrição

ssh2_sftp_realpath(resource $sftp, string $filename): string

Traduz filename para o caminho real efetivo no sistema de arquivos remoto.

Parâmetros

sftp

Um recurso SSH2 SFTP aberto por ssh2_sftp().

filename

Valor Retornado

Retorna o caminho real como uma string.

Exemplos

Exemplo #1 Resolvendo um nome de caminho

<?php
$connection
= ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'usuario', 'senha');
$sftp = ssh2_sftp($connection);

$realpath = ssh2_sftp_realpath($sftp, '/home/usuario/../../../..//./usr/../etc/passwd');
/* $realpath agora é: '/etc/passwd' */
?>

Veja Também