Subversion Repositories oidplus

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. namespace phpseclib3\Net\SFTP;
  4.  
  5. /**
  6.  * http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-7.1
  7.  * the order, in this case, matters quite a lot - see \phpseclib3\Net\SFTP::_parseAttributes() to understand why
  8.  *
  9.  * @internal
  10.  */
  11. abstract class Attribute
  12. {
  13.     const SIZE = 0x00000001;
  14.     const UIDGID = 0x00000002;          // defined in SFTPv3, removed in SFTPv4+
  15.     const OWNERGROUP = 0x00000080;      // defined in SFTPv4+
  16.     const PERMISSIONS = 0x00000004;
  17.     const ACCESSTIME = 0x00000008;
  18.     const CREATETIME = 0x00000010;      // SFTPv4+
  19.     const MODIFYTIME = 0x00000020;
  20.     const ACL = 0x00000040;
  21.     const SUBSECOND_TIMES = 0x00000100;
  22.     const BITS = 0x00000200;            // SFTPv5+
  23.     const ALLOCATION_SIZE = 0x00000400; // SFTPv6+
  24.     const TEXT_HINT = 0x00000800;
  25.     const MIME_TYPE = 0x00001000;
  26.     const LINK_COUNT = 0x00002000;
  27.     const UNTRANSLATED_NAME = 0x00004000;
  28.     const CTIME = 0x00008000;
  29.     // 0x80000000 will yield a floating point on 32-bit systems and converting floating points to integers
  30.     // yields inconsistent behavior depending on how php is compiled.  so we left shift -1 (which, in
  31.     // two's compliment, consists of all 1 bits) by 31.  on 64-bit systems this'll yield 0xFFFFFFFF80000000.
  32.     // that's not a problem, however, and 'anded' and a 32-bit number, as all the leading 1 bits are ignored.
  33.     const EXTENDED = (-1 << 31) & 0xFFFFFFFF;
  34.  
  35.     /**
  36.      * @return array
  37.      */
  38.     public static function getConstants()
  39.     {
  40.         $reflectionClass = new \ReflectionClass(static::class);
  41.         return $reflectionClass->getConstants();
  42.     }
  43. }
  44.