WP_Filesystem_SSH2::cwd │ public │ WP 2.7.0

Gets the current working directory.

Метод класса: WP_Filesystem_SSH2{}

Хуков нет.

Возвращает

string|false. The current working directory on success, false on failure.

Использование

$WP_Filesystem_SSH2 = new WP_Filesystem_SSH2();
$WP_Filesystem_SSH2->cwd();

Список изменений

С версии 2.7.0 Введена.

Код WP_Filesystem_SSH2::cwd() WP 7.1.4

public function cwd() {
	if ( ! $this->sftp_link ) {
		return false;
	}

	$cwd = ssh2_sftp_realpath( $this->sftp_link, '.' );

	if ( ! is_string( $cwd ) ) {
		return false;
	}

	return trailingslashit( trim( $cwd ) );
}