protected function generateStat($object, $container, $size) {
    // This is not entirely accurate. Basically, if the
    // file is marked public, it gets 100775, and if
    // it is private, it gets 100770.
    //
    // Mode is always set to file (100XXX) because there
    // is no alternative that is more sensible. PHP docs
    // do not recommend an alternative.
    //
    // octdec(100770) == 33272
    // octdec(100775) == 33277
    $mode = $container->acl()->isPublic() ? 33277 : 33272;

    // We have to fake the UID value in order for is_readible()/is_writable()
    // to work. Note that on Windows systems, stat does not look for a UID.
    if (function_exists('posix_geteuid')) {
      $uid = posix_geteuid();
      $gid = posix_getegid();
    }
    else {
      $uid = 0;
      $gid = 0;
    }

    if ($object instanceof \HPCloud\Storage\ObjectStorage\RemoteObject) {
      $modTime = $object->lastModified();
    }
    else {
      $modTime = 0;
    }
    $values = array(
      'dev' => 0,
      'ino' => 0,
      'mode' => $mode,
      'nlink' => 0,
      'uid' => $uid,
      'gid' => $gid,
      'rdev' => 0,
      'size' => $size,
      'atime' => $modTime,
      'mtime' => $modTime,
      'ctime' => $modTime,
      'blksize' => -1,
      'blocks' => -1,
    );

    $final = array_values($values) + $values;

    return $final;

  }
protected function generateStat($object, $container, $size) {
    // This is not entirely accurate. Basically, if the
    // file is marked public, it gets 100775, and if
    // it is private, it gets 100770.
    //
    // Mode is always set to file (100XXX) because there
    // is no alternative that is more sensible. PHP docs
    // do not recommend an alternative.
    //
    // octdec(100770) == 33272
    // octdec(100775) == 33277
    $mode = $container->acl()->isPublic() ? 33277 : 33272;

    // We have to fake the UID value in order for is_readible()/is_writable()
    // to work. Note that on Windows systems, stat does not look for a UID.
    if (function_exists('posix_geteuid')) {
      $uid = posix_geteuid();
      $gid = posix_getegid();
    }
    else {
      $uid = 0;
      $gid = 0;
    }

    if ($object instanceof \HPCloud\Storage\ObjectStorage\RemoteObject) {
      $modTime = $object->lastModified();
    }
    else {
      $modTime = 0;
    }
    $values = array(
      'dev' => 0,
      'ino' => 0,
      'mode' => $mode,
      'nlink' => 0,
      'uid' => $uid,
      'gid' => $gid,
      'rdev' => 0,
      'size' => $size,
      'atime' => $modTime,
      'mtime' => $modTime,
      'ctime' => $modTime,
      'blksize' => -1,
      'blocks' => -1,
    );

    $final = array_values($values) + $values;

    return $final;

  }
protected function generateStat ( $ object , $ container , $ size ) { // This is not entirely accurate. Basically, if the // file is marked public, it gets 100775, and if // it is private, it gets 100770. // // Mode is always set to file (100XXX) because there // is no alternative that is more sensible. PHP docs // do not recommend an alternative. // // octdec(100770) == 33272 // octdec(100775) == 33277 $ mode = $ container -> acl ( ) -> isPublic ( ) ? 33277 : 33272 ; // We have to fake the UID value in order for is_readible()/is_writable() // to work. Note that on Windows systems, stat does not look for a UID. if ( function_exists ( 'posix_geteuid' ) ) { $ uid = posix_geteuid ( ) ; $ gid = posix_getegid ( ) ; } else { $ uid = 0 ; $ gid = 0 ; } if ( $ object instanceof \ HPCloud \ Storage \ ObjectStorage \ RemoteObject ) { $ modTime = $ object -> lastModified ( ) ; } else { $ modTime = 0 ; } $ values = array ( 'dev' => 0 , 'ino' => 0 , 'mode' => $ mode , 'nlink' => 0 , 'uid' => $ uid , 'gid' => $ gid , 'rdev' => 0 , 'size' => $ size , 'atime' => $ modTime , 'mtime' => $ modTime , 'ctime' => $ modTime , 'blksize' => - 1 , 'blocks' => - 1 , ) ; $ final = array_values ( $ values ) + $ values ; return $ final ; }
Generate a reasonably accurate STAT array.

Notes on mode:
- All modes are of the (octal) form 100XXX, where
XXX is replaced by the permission string. Thus,
this always reports that the type is "file" (100).
- Currently, only two permission sets are generated:
- 770: Represents the ACL::makePrivate() perm.
- 775: Represents the ACL::makePublic() perm.

Notes on mtime/atime/ctime:
- For whatever reason, Swift only stores one timestamp.
We use that for mtime, atime, and ctime.

Notes on size:
- Size must be calculated externally, as it will sometimes
be the remote's Content-Length, and it will sometimes be
the cached stat['size'] for the underlying buffer.
Generate a reasonably accurate STAT array .