WP_Filesystem_SSH2::owner() – Gets the file owner.

You appear to be a bot. Output may be restricted

Description

Gets the file owner.

Usage

$string|false = WP_Filesystem_SSH2::owner( $file );

Parameters

$file
( string ) required – Path to the file.

Returns

string|false Username of the owner on success, false on failure.

Source

File name: wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
Lines:

1 to 19 of 19
  public function owner( $file ) {
    $owneruid = @fileowner( $this->WP_Filesystem_SSH2::sftp_path( $file ) );

    if ( ! $owneruid ) {
      return false;
    }

    if ( ! function_exists( 'posix_getpwuid' ) ) {
      return $owneruid;
    }

    $ownerarray = posix_getpwuid( $owneruid );

    if ( ! $ownerarray ) {
      return false;
    }

    return $ownerarray['name'];
  }
 

 View on GitHub View on Trac