HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/ly.fwmnzf.com/vendor/nelexa/zip/src/Constants/ZipCompressionMethod.php
<?php

namespace PhpZip\Constants;

use PhpZip\Exception\ZipUnsupportMethodException;

/**
 * Class ZipCompressionMethod.
 */
final class ZipCompressionMethod
{
    /** @var int Compression method Store */
    const STORED = 0;

    /** @var int Compression method Deflate */
    const DEFLATED = 8;

    /** @var int Compression method Bzip2 */
    const BZIP2 = 12;

    /** @var int Compression method AES-Encryption */
    const WINZIP_AES = 99;

    /** @var array Compression Methods */
    private static $ZIP_COMPRESSION_METHODS = [
        self::STORED => 'Stored',
        1 => 'Shrunk',
        2 => 'Reduced compression factor 1',
        3 => 'Reduced compression factor 2',
        4 => 'Reduced compression factor 3',
        5 => 'Reduced compression factor 4',
        6 => 'Imploded',
        7 => 'Reserved for Tokenizing compression algorithm',
        self::DEFLATED => 'Deflated',
        9 => 'Enhanced Deflating using Deflate64(tm)',
        10 => 'PKWARE Data Compression Library Imploding',
        11 => 'Reserved by PKWARE',
        self::BZIP2 => 'BZIP2',
        13 => 'Reserved by PKWARE',
        14 => 'LZMA',
        15 => 'Reserved by PKWARE',
        16 => 'Reserved by PKWARE',
        17 => 'Reserved by PKWARE',
        18 => 'File is compressed using IBM TERSE (new)',
        19 => 'IBM LZ77 z Architecture (PFS)',
        96 => 'WinZip JPEG Compression',
        97 => 'WavPack compressed data',
        98 => 'PPMd version I, Rev 1',
        self::WINZIP_AES => 'AES Encryption',
    ];

    /**
     * @param int $value
     *
     * @return string
     */
    public static function getCompressionMethodName($value)
    {
        return isset(self::$ZIP_COMPRESSION_METHODS[$value]) ?
            self::$ZIP_COMPRESSION_METHODS[$value] :
            'Unknown Method';
    }

    /**
     * @return int[]
     */
    public static function getSupportMethods()
    {
        static $methods;

        if ($methods === null) {
            $methods = [
                self::STORED,
                self::DEFLATED,
            ];

            if (\extension_loaded('bz2')) {
                $methods[] = self::BZIP2;
            }
        }

        return $methods;
    }

    /**
     * @param int $compressionMethod
     *
     * @throws ZipUnsupportMethodException
     */
    public static function checkSupport($compressionMethod)
    {
        $compressionMethod = (int) $compressionMethod;

        if (!\in_array($compressionMethod, self::getSupportMethods(), true)) {
            throw new ZipUnsupportMethodException(sprintf(
                'Compression method %d (%s) is not supported.',
                $compressionMethod,
                self::getCompressionMethodName($compressionMethod)
            ));
        }
    }
}