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