GC_Filesystem_SSH2::group()

最后更新于:2021-11-27 20:23:35

GC_Filesystem_SSH2::group( string$file)

Gets the file’s group.

参数

$file

(string) (Required) Path to the file.

响应

(string|false) The group on success, false on failure.

源文件

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

	public function group( $file ) {
		$gid = @filegroup( $this->sftp_path( $file ) );

		if ( ! $gid ) {
			return false;
		}

		if ( ! function_exists( 'posix_getgrgid' ) ) {
			return $gid;
		}

		$grouparray = posix_getgrgid( $gid );

		if ( ! $grouparray ) {
			return false;
		}

		return $grouparray['name'];
	}