GC_Filesystem_FTPext::is_dir()

最后更新于:2021-11-27 18:47:14

GC_Filesystem_FTPext::is_dir( string$path)

Checks if resource is a directory.

参数

$path

(string) (Required) Directory path.

响应

(bool) Whether $path is a directory.

源文件

文件: gc-admin/includes/class-gc-filesystem-ftpext.php

	public function is_dir( $path ) {
		$cwd    = $this->cwd();
		$result = @ftp_chdir( $this->link, trailingslashit( $path ) );

		if ( $result && $path === $this->cwd() || $this->cwd() !== $cwd ) {
			@ftp_chdir( $this->link, $cwd );
			return true;
		}

		return false;
	}