diff --git a/vendor/.gitignore b/vendor/.gitignore deleted file mode 100644 index 244030a..0000000 --- a/vendor/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ - -!.gitignore \ No newline at end of file diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index ac85932..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - /dev/null; cd "../zircote/swagger-php/bin" && pwd) - -if [ -d /proc/cygdrive ]; then - case $(which php) in - $(readlink -n /proc/cygdrive)/*) - # We are in Cygwin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); - ;; - esac -fi - -"${dir}/openapi" "$@" diff --git a/vendor/bin/openapi.bat b/vendor/bin/openapi.bat deleted file mode 100644 index d12766b..0000000 --- a/vendor/bin/openapi.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../zircote/swagger-php/bin/openapi -php "%BIN_TARGET%" %* diff --git a/vendor/bin/var-dump-server b/vendor/bin/var-dump-server deleted file mode 100644 index 4b749cc..0000000 --- a/vendor/bin/var-dump-server +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env php - var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); -} -include $binPath; diff --git a/vendor/bin/var-dump-server.bat b/vendor/bin/var-dump-server.bat deleted file mode 100644 index 46836b5..0000000 --- a/vendor/bin/var-dump-server.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../symfony/var-dumper/Resources/bin/var-dump-server -php "%BIN_TARGET%" %* diff --git a/vendor/bin/yaml-lint b/vendor/bin/yaml-lint deleted file mode 100644 index 9bcc2ad..0000000 --- a/vendor/bin/yaml-lint +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env php - var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); -} -include $binPath; diff --git a/vendor/bin/yaml-lint.bat b/vendor/bin/yaml-lint.bat deleted file mode 100644 index 0474134..0000000 --- a/vendor/bin/yaml-lint.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../symfony/yaml/Resources/bin/yaml-lint -php "%BIN_TARGET%" %* diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php deleted file mode 100644 index 247294d..0000000 --- a/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,479 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - private $vendorDir; - - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - private static $registeredLoaders = array(); - - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - } - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php deleted file mode 100644 index 0924b78..0000000 --- a/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,571 +0,0 @@ - - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => 'e60cfe2b6616b1bcb1c91f148a81369e11161013', - 'name' => 'topthink/think', - ), - 'versions' => - array ( - 'doctrine/annotations' => - array ( - 'pretty_version' => '1.12.1', - 'version' => '1.12.1.0', - 'aliases' => - array ( - ), - 'reference' => 'b17c5014ef81d212ac539f07a1001832df1b6d3b', - ), - 'doctrine/lexer' => - array ( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'aliases' => - array ( - ), - 'reference' => 'e864bbf5904cb8f5bb334f99209b48018522f042', - ), - 'edward1108/edward-captcha' => - array ( - 'pretty_version' => '1.1', - 'version' => '1.1.0.0', - 'aliases' => - array ( - ), - 'reference' => '426ceee34507c30d4b21e0dd349b571371aef700', - ), - 'egulias/email-validator' => - array ( - 'pretty_version' => '2.1.25', - 'version' => '2.1.25.0', - 'aliases' => - array ( - ), - 'reference' => '0dbf5d78455d4d6a41d186da50adc1122ec066f4', - ), - 'lcobucci/clock' => - array ( - 'pretty_version' => '2.0.0', - 'version' => '2.0.0.0', - 'aliases' => - array ( - ), - 'reference' => '353d83fe2e6ae95745b16b3d911813df6a05bfb3', - ), - 'lcobucci/jwt' => - array ( - 'pretty_version' => '4.1.2', - 'version' => '4.1.2.0', - 'aliases' => - array ( - ), - 'reference' => 'c544710aa18e079baf0027ca4c8236913f46945b', - ), - 'league/flysystem' => - array ( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', - 'aliases' => - array ( - ), - 'reference' => '9be3b16c877d477357c015cec057548cf9b2a14a', - ), - 'league/flysystem-cached-adapter' => - array ( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'aliases' => - array ( - ), - 'reference' => 'd1925efb2207ac4be3ad0c40b8277175f99ffaff', - ), - 'league/mime-type-detection' => - array ( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', - 'aliases' => - array ( - ), - 'reference' => '3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3', - ), - 'psr/cache' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8', - ), - 'psr/container' => - array ( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f', - ), - 'psr/log' => - array ( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', - 'aliases' => - array ( - ), - 'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc', - ), - 'psr/simple-cache' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', - ), - 'swiftmailer/swiftmailer' => - array ( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', - 'aliases' => - array ( - ), - 'reference' => '698a6a9f54d7eb321274de3ad19863802c879fb7', - ), - 'symfony/deprecation-contracts' => - array ( - 'pretty_version' => 'v2.2.0', - 'version' => '2.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '5fa56b4074d1ae755beb55617ddafe6f5d78f665', - ), - 'symfony/finder' => - array ( - 'pretty_version' => 'v5.2.4', - 'version' => '5.2.4.0', - 'aliases' => - array ( - ), - 'reference' => '0d639a0943822626290d169965804f79400e6a04', - ), - 'symfony/polyfill-ctype' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => 'c6c942b1ac76c82448322025e084cadc56048b4e', - ), - 'symfony/polyfill-iconv' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '06fb361659649bcfd6a208a0f1fcaf4e827ad342', - ), - 'symfony/polyfill-intl-idn' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '2d63434d922daf7da8dd863e7907e67ee3031483', - ), - 'symfony/polyfill-intl-normalizer' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '43a0283138253ed1d48d352ab6d0bdb3f809f248', - ), - 'symfony/polyfill-mbstring' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '5232de97ee3b75b0360528dae24e73db49566ab1', - ), - 'symfony/polyfill-php72' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => 'cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9', - ), - 'symfony/polyfill-php80' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91', - ), - 'symfony/var-dumper' => - array ( - 'pretty_version' => 'v4.4.20', - 'version' => '4.4.20.0', - 'aliases' => - array ( - ), - 'reference' => 'a1eab2f69906dc83c5ddba4632180260d0ab4f7f', - ), - 'symfony/yaml' => - array ( - 'pretty_version' => 'v5.2.4', - 'version' => '5.2.4.0', - 'aliases' => - array ( - ), - 'reference' => '7d6ae0cce3c33965af681a4355f1c4de326ed277', - ), - 'topthink/framework' => - array ( - 'pretty_version' => 'v6.0.7', - 'version' => '6.0.7.0', - 'aliases' => - array ( - ), - 'reference' => 'db8fe22520a9660dd5e4c87e304034ac49e39270', - ), - 'topthink/think' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => 'e60cfe2b6616b1bcb1c91f148a81369e11161013', - ), - 'topthink/think-helper' => - array ( - 'pretty_version' => 'v3.1.4', - 'version' => '3.1.4.0', - 'aliases' => - array ( - ), - 'reference' => 'c28d37743bda4a0455286ca85b17b5791d626e10', - ), - 'topthink/think-migration' => - array ( - 'pretty_version' => 'v3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '5717d9e5f3ea745f6dbfd1e30b4402aaadff9a79', - ), - 'topthink/think-multi-app' => - array ( - 'pretty_version' => 'v1.0.14', - 'version' => '1.0.14.0', - 'aliases' => - array ( - ), - 'reference' => 'ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3', - ), - 'topthink/think-orm' => - array ( - 'pretty_version' => 'v2.0.39', - 'version' => '2.0.39.0', - 'aliases' => - array ( - ), - 'reference' => '39a9d0a0e52d9b8bad9d98484d8484cdf5b683a7', - ), - 'topthink/think-trace' => - array ( - 'pretty_version' => 'v1.4', - 'version' => '1.4.0.0', - 'aliases' => - array ( - ), - 'reference' => '9a9fa8f767b6c66c5a133ad21ca1bc96ad329444', - ), - 'zircote/swagger-php' => - array ( - 'pretty_version' => '3.1.0', - 'version' => '3.1.0.0', - 'aliases' => - array ( - ), - 'reference' => '9d172471e56433b5c7061006b9a766f262a3edfd', - ), - ), -); -private static $canGetVendors; -private static $installedByVendor = array(); - - - - - - - -public static function getInstalledPackages() -{ -$packages = array(); -foreach (self::getInstalled() as $installed) { -$packages[] = array_keys($installed['versions']); -} - - -if (1 === \count($packages)) { -return $packages[0]; -} - -return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); -} - - - - - - - - - -public static function isInstalled($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (isset($installed['versions'][$packageName])) { -return true; -} -} - -return false; -} - - - - - - - - - - - - - - -public static function satisfies(VersionParser $parser, $packageName, $constraint) -{ -$constraint = $parser->parseConstraints($constraint); -$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - -return $provided->matches($constraint); -} - - - - - - - - - - -public static function getVersionRanges($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -$ranges = array(); -if (isset($installed['versions'][$packageName]['pretty_version'])) { -$ranges[] = $installed['versions'][$packageName]['pretty_version']; -} -if (array_key_exists('aliases', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); -} -if (array_key_exists('replaced', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); -} -if (array_key_exists('provided', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); -} - -return implode(' || ', $ranges); -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getVersion($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['version'])) { -return null; -} - -return $installed['versions'][$packageName]['version']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getPrettyVersion($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['pretty_version'])) { -return null; -} - -return $installed['versions'][$packageName]['pretty_version']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getReference($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['reference'])) { -return null; -} - -return $installed['versions'][$packageName]['reference']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getRootPackage() -{ -$installed = self::getInstalled(); - -return $installed[0]['root']; -} - - - - - - - -public static function getRawData() -{ -return self::$installed; -} - - - - - - - - - - - - - - - - - - - -public static function reload($data) -{ -self::$installed = $data; -self::$installedByVendor = array(); -} - - - - -private static function getInstalled() -{ -if (null === self::$canGetVendors) { -self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); -} - -$installed = array(); - -if (self::$canGetVendors) { -foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { -if (isset(self::$installedByVendor[$vendorDir])) { -$installed[] = self::$installedByVendor[$vendorDir]; -} elseif (is_file($vendorDir.'/composer/installed.php')) { -$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; -} -} -} - -$installed[] = self::$installed; - -return $installed; -} -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index f2efbf8..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,15 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', -); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php deleted file mode 100644 index 94895bf..0000000 --- a/vendor/composer/autoload_files.php +++ /dev/null @@ -1,23 +0,0 @@ - $vendorDir . '/topthink/think-helper/src/helper.php', - '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', - '35fab96057f1bf5e7aba31a8a6d5fdde' => $vendorDir . '/topthink/think-orm/stubs/load_stubs.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - 'b2759b3fbd06631840a9638abcd22485' => $vendorDir . '/edward1108/edward-captcha/src/helper.php', - '2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', - '0ccdf99b8f62f02c52cba55802e0c2e7' => $vendorDir . '/zircote/swagger-php/src/functions.php', -); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 7cb803d..0000000 --- a/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,10 +0,0 @@ - array($baseDir . '/extend'), -); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php deleted file mode 100644 index 60db6eb..0000000 --- a/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,39 +0,0 @@ - array($vendorDir . '/topthink/think-trace/src'), - 'think\\migration\\' => array($vendorDir . '/topthink/think-migration/src'), - 'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'), - 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src'), - 'edward\\captcha\\' => array($vendorDir . '/edward1108/edward-captcha/src'), - 'app\\' => array($baseDir . '/app'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), - 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), - 'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), - 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), - 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), - 'Phinx\\' => array($vendorDir . '/topthink/think-migration/phinx/src/Phinx'), - 'OpenApi\\' => array($vendorDir . '/zircote/swagger-php/src'), - 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), - 'League\\Flysystem\\Cached\\' => array($vendorDir . '/league/flysystem-cached-adapter/src'), - 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), - 'Lcobucci\\JWT\\' => array($vendorDir . '/lcobucci/jwt/src'), - 'Lcobucci\\Clock\\' => array($vendorDir . '/lcobucci/clock/src'), - 'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/src'), - 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'), - 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index e4d106d..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,75 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit9caf0e5e183c101daf530f1044c09467::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit9caf0e5e183c101daf530f1044c09467::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire9caf0e5e183c101daf530f1044c09467($fileIdentifier, $file); - } - - return $loader; - } -} - -function composerRequire9caf0e5e183c101daf530f1044c09467($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index cf805ed..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,234 +0,0 @@ - __DIR__ . '/..' . '/topthink/think-helper/src/helper.php', - '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', - '35fab96057f1bf5e7aba31a8a6d5fdde' => __DIR__ . '/..' . '/topthink/think-orm/stubs/load_stubs.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - 'b2759b3fbd06631840a9638abcd22485' => __DIR__ . '/..' . '/edward1108/edward-captcha/src/helper.php', - '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', - '0ccdf99b8f62f02c52cba55802e0c2e7' => __DIR__ . '/..' . '/zircote/swagger-php/src/functions.php', - ); - - public static $prefixLengthsPsr4 = array ( - 't' => - array ( - 'think\\trace\\' => 12, - 'think\\migration\\' => 16, - 'think\\app\\' => 10, - 'think\\' => 6, - ), - 'e' => - array ( - 'edward\\captcha\\' => 15, - ), - 'a' => - array ( - 'app\\' => 4, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php72\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, - 'Symfony\\Polyfill\\Intl\\Idn\\' => 26, - 'Symfony\\Polyfill\\Iconv\\' => 23, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Component\\Yaml\\' => 23, - 'Symfony\\Component\\VarDumper\\' => 28, - 'Symfony\\Component\\Finder\\' => 25, - ), - 'P' => - array ( - 'Psr\\SimpleCache\\' => 16, - 'Psr\\Log\\' => 8, - 'Psr\\Container\\' => 14, - 'Psr\\Cache\\' => 10, - 'Phinx\\' => 6, - ), - 'O' => - array ( - 'OpenApi\\' => 8, - ), - 'L' => - array ( - 'League\\MimeTypeDetection\\' => 25, - 'League\\Flysystem\\Cached\\' => 24, - 'League\\Flysystem\\' => 17, - 'Lcobucci\\JWT\\' => 13, - 'Lcobucci\\Clock\\' => 15, - ), - 'E' => - array ( - 'Egulias\\EmailValidator\\' => 23, - ), - 'D' => - array ( - 'Doctrine\\Common\\Lexer\\' => 22, - 'Doctrine\\Common\\Annotations\\' => 28, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'think\\trace\\' => - array ( - 0 => __DIR__ . '/..' . '/topthink/think-trace/src', - ), - 'think\\migration\\' => - array ( - 0 => __DIR__ . '/..' . '/topthink/think-migration/src', - ), - 'think\\app\\' => - array ( - 0 => __DIR__ . '/..' . '/topthink/think-multi-app/src', - ), - 'think\\' => - array ( - 0 => __DIR__ . '/..' . '/topthink/framework/src/think', - 1 => __DIR__ . '/..' . '/topthink/think-helper/src', - 2 => __DIR__ . '/..' . '/topthink/think-orm/src', - ), - 'edward\\captcha\\' => - array ( - 0 => __DIR__ . '/..' . '/edward1108/edward-captcha/src', - ), - 'app\\' => - array ( - 0 => __DIR__ . '/../..' . '/app', - ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Php72\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', - ), - 'Symfony\\Polyfill\\Intl\\Idn\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn', - ), - 'Symfony\\Polyfill\\Iconv\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-iconv', - ), - 'Symfony\\Polyfill\\Ctype\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Component\\Yaml\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/yaml', - ), - 'Symfony\\Component\\VarDumper\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/var-dumper', - ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), - 'Psr\\SimpleCache\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/simple-cache/src', - ), - 'Psr\\Log\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'Psr\\Cache\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/cache/src', - ), - 'Phinx\\' => - array ( - 0 => __DIR__ . '/..' . '/topthink/think-migration/phinx/src/Phinx', - ), - 'OpenApi\\' => - array ( - 0 => __DIR__ . '/..' . '/zircote/swagger-php/src', - ), - 'League\\MimeTypeDetection\\' => - array ( - 0 => __DIR__ . '/..' . '/league/mime-type-detection/src', - ), - 'League\\Flysystem\\Cached\\' => - array ( - 0 => __DIR__ . '/..' . '/league/flysystem-cached-adapter/src', - ), - 'League\\Flysystem\\' => - array ( - 0 => __DIR__ . '/..' . '/league/flysystem/src', - ), - 'Lcobucci\\JWT\\' => - array ( - 0 => __DIR__ . '/..' . '/lcobucci/jwt/src', - ), - 'Lcobucci\\Clock\\' => - array ( - 0 => __DIR__ . '/..' . '/lcobucci/clock/src', - ), - 'Egulias\\EmailValidator\\' => - array ( - 0 => __DIR__ . '/..' . '/egulias/email-validator/src', - ), - 'Doctrine\\Common\\Lexer\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer', - ), - 'Doctrine\\Common\\Annotations\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/annotations/lib/Doctrine/Common/Annotations', - ), - ); - - public static $fallbackDirsPsr0 = array ( - 0 => __DIR__ . '/../..' . '/extend', - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit9caf0e5e183c101daf530f1044c09467::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit9caf0e5e183c101daf530f1044c09467::$prefixDirsPsr4; - $loader->fallbackDirsPsr0 = ComposerStaticInit9caf0e5e183c101daf530f1044c09467::$fallbackDirsPsr0; - $loader->classMap = ComposerStaticInit9caf0e5e183c101daf530f1044c09467::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index 7fa747a..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,2397 +0,0 @@ -{ - "packages": [ - { - "name": "doctrine/annotations", - "version": "1.12.1", - "version_normalized": "1.12.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/b17c5014ef81d212ac539f07a1001832df1b6d3b", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" - }, - "time": "2021-02-21T21:00:45+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.12.1" - }, - "install-path": "../doctrine/annotations" - }, - { - "name": "doctrine/lexer", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" - }, - "time": "2020-05-25T17:44:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "install-path": "../doctrine/lexer" - }, - { - "name": "edward1108/edward-captcha", - "version": "1.1", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/Edward1108/edward-captcha.git", - "reference": "426ceee34507c30d4b21e0dd349b571371aef700" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Edward1108/edward-captcha/zipball/426ceee34507c30d4b21e0dd349b571371aef700", - "reference": "426ceee34507c30d4b21e0dd349b571371aef700", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1.0", - "topthink/framework": "^6.0.0" - }, - "time": "2020-07-22T06:49:35+00:00", - "type": "library", - "extra": { - "think": { - "services": [ - "edward\\captcha\\CaptchaService" - ], - "config": { - "captcha": "src/config.php" - } - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "edward\\captcha\\": "src/" - }, - "files": [ - "src/helper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "edward", - "email": "xuyuanhua1987@163.com" - } - ], - "description": "ThinkPHP6验证码(图片、短信)支持api友好化", - "homepage": "https://github.com/Edward1108/edward-captcha", - "support": { - "issues": "https://github.com/Edward1108/edward-captcha/issues", - "source": "https://github.com/Edward1108/edward-captcha/tree/master" - }, - "install-path": "../edward1108/edward-captcha" - }, - { - "name": "egulias/email-validator", - "version": "2.1.25", - "version_normalized": "2.1.25.0", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", - "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "doctrine/lexer": "^1.0.1", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.10" - }, - "require-dev": { - "dominicsayers/isemail": "^3.0.7", - "phpunit/phpunit": "^4.8.36|^7.5.15", - "satooshi/php-coveralls": "^1.0.1" - }, - "suggest": { - "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" - }, - "time": "2020-12-29T14:50:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Egulias\\EmailValidator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails against several RFCs", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "emailvalidation", - "emailvalidator", - "validation", - "validator" - ], - "support": { - "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/2.1.25" - }, - "funding": [ - { - "url": "https://github.com/egulias", - "type": "github" - } - ], - "install-path": "../egulias/email-validator" - }, - { - "name": "lcobucci/clock", - "version": "2.0.0", - "version_normalized": "2.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/lcobucci/clock.git", - "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/353d83fe2e6ae95745b16b3d911813df6a05bfb3", - "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "infection/infection": "^0.17", - "lcobucci/coding-standard": "^6.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/php-code-coverage": "9.1.4", - "phpunit/phpunit": "9.3.7" - }, - "time": "2020-08-27T18:56:02+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Lcobucci\\Clock\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Luís Cobucci", - "email": "lcobucci@gmail.com" - } - ], - "description": "Yet another clock abstraction", - "support": { - "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/2.0.x" - }, - "funding": [ - { - "url": "https://github.com/lcobucci", - "type": "github" - }, - { - "url": "https://www.patreon.com/lcobucci", - "type": "patreon" - } - ], - "install-path": "../lcobucci/clock" - }, - { - "name": "lcobucci/jwt", - "version": "4.1.2", - "version_normalized": "4.1.2.0", - "source": { - "type": "git", - "url": "https://github.com/lcobucci/jwt.git", - "reference": "c544710aa18e079baf0027ca4c8236913f46945b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/c544710aa18e079baf0027ca4c8236913f46945b", - "reference": "c544710aa18e079baf0027ca4c8236913f46945b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-hash": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "ext-sodium": "*", - "lcobucci/clock": "^2.0", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "infection/infection": "^0.21", - "lcobucci/coding-standard": "^6.0", - "mikey179/vfsstream": "^1.6.7", - "phpbench/phpbench": "^1.0@alpha", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/php-invoker": "^3.1", - "phpunit/phpunit": "^9.5" - }, - "time": "2021-02-19T19:37:15+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Lcobucci\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Luís Cobucci", - "email": "lcobucci@gmail.com", - "role": "Developer" - } - ], - "description": "A simple library to work with JSON Web Token and JSON Web Signature", - "keywords": [ - "JWS", - "jwt" - ], - "support": { - "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/4.1.2" - }, - "funding": [ - { - "url": "https://github.com/lcobucci", - "type": "github" - }, - { - "url": "https://www.patreon.com/lcobucci", - "type": "patreon" - } - ], - "install-path": "../lcobucci/jwt" - }, - { - "name": "league/flysystem", - "version": "1.1.3", - "version_normalized": "1.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-fileinfo": "Required for MimeType", - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "time": "2020-08-23T07:39:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "install-path": "../league/flysystem" - }, - { - "name": "league/flysystem-cached-adapter", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem-cached-adapter.git", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "league/flysystem": "~1.0", - "psr/cache": "^1.0.0" - }, - "require-dev": { - "mockery/mockery": "~0.9", - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7", - "predis/predis": "~1.0", - "tedivm/stash": "~0.12" - }, - "suggest": { - "ext-phpredis": "Pure C implemented extension for PHP" - }, - "time": "2020-07-25T15:56:04+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\Cached\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "frankdejonge", - "email": "info@frenky.net" - } - ], - "description": "An adapter decorator to enable meta-data caching.", - "install-path": "../league/flysystem-cached-adapter" - }, - { - "name": "league/mime-type-detection", - "version": "1.7.0", - "version_normalized": "1.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" - }, - "time": "2021-01-18T20:58:21+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "support": { - "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" - }, - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "install-path": "../league/mime-type-detection" - }, - { - "name": "psr/cache", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2016-08-06T20:24:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "install-path": "../psr/cache" - }, - { - "name": "psr/container", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2017-02-14T16:28:37+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "install-path": "../psr/container" - }, - { - "name": "psr/log", - "version": "1.1.3", - "version_normalized": "1.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2020-03-23T09:12:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "install-path": "../psr/log" - }, - { - "name": "psr/simple-cache", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2017-10-23T01:57:42+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "install-path": "../psr/simple-cache" - }, - { - "name": "swiftmailer/swiftmailer", - "version": "v6.2.5", - "version_normalized": "6.2.5.0", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/698a6a9f54d7eb321274de3ad19863802c879fb7", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "egulias/email-validator": "^2.0", - "php": ">=7.0.0", - "symfony/polyfill-iconv": "^1.0", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "symfony/phpunit-bridge": "^4.4|^5.0" - }, - "suggest": { - "ext-intl": "Needed to support internationalized email addresses" - }, - "time": "2021-01-12T09:35:59+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "lib/swift_required.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "https://swiftmailer.symfony.com", - "keywords": [ - "email", - "mail", - "mailer" - ], - "support": { - "issues": "https://github.com/swiftmailer/swiftmailer/issues", - "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.5" - }, - "funding": [ - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/swiftmailer/swiftmailer", - "type": "tidelift" - } - ], - "install-path": "../swiftmailer/swiftmailer" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "time": "2020-09-07T11:33:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/master" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, - { - "name": "symfony/finder", - "version": "v5.2.4", - "version_normalized": "5.2.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "0d639a0943822626290d169965804f79400e6a04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", - "reference": "0d639a0943822626290d169965804f79400e6a04", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.2.5" - }, - "time": "2021-02-15T18:55:04+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/finder" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2021-01-07T16:49:33+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-iconv", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/06fb361659649bcfd6a208a0f1fcaf4e827ad342", - "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-iconv": "For best performance" - }, - "time": "2021-01-22T09:19:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Iconv\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Iconv extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "iconv", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-iconv" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2021-01-22T09:19:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-idn" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2021-01-22T09:19:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-normalizer" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2021-01-22T09:19:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-01-07T16:49:33+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php72" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-01-07T16:49:33+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/var-dumper", - "version": "v4.4.20", - "version_normalized": "4.4.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a1eab2f69906dc83c5ddba4632180260d0ab4f7f", - "reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php72": "~1.5", - "symfony/polyfill-php80": "^1.15" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", - "symfony/console": "<3.4" - }, - "require-dev": { - "ext-iconv": "*", - "symfony/console": "^3.4|^4.0|^5.0", - "symfony/process": "^4.4|^5.0", - "twig/twig": "^1.43|^2.13|^3.0.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, - "time": "2021-01-27T09:09:26+00:00", - "bin": [ - "Resources/bin/var-dump-server" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides mechanisms for walking through any arbitrary PHP variable", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.20" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/var-dumper" - }, - { - "name": "symfony/yaml", - "version": "v5.2.4", - "version_normalized": "5.2.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "7d6ae0cce3c33965af681a4355f1c4de326ed277" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/7d6ae0cce3c33965af681a4355f1c4de326ed277", - "reference": "7d6ae0cce3c33965af681a4355f1c4de326ed277", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<4.4" - }, - "require-dev": { - "symfony/console": "^4.4|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "time": "2021-02-22T15:48:39+00:00", - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v5.2.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/yaml" - }, - { - "name": "topthink/framework", - "version": "v6.0.7", - "version_normalized": "6.0.7.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/framework.git", - "reference": "db8fe22520a9660dd5e4c87e304034ac49e39270" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/db8fe22520a9660dd5e4c87e304034ac49e39270", - "reference": "db8fe22520a9660dd5e4c87e304034ac49e39270", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "league/flysystem": "^1.0", - "league/flysystem-cached-adapter": "^1.0", - "php": ">=7.1.0", - "psr/container": "~1.0", - "psr/log": "~1.0", - "psr/simple-cache": "^1.0", - "topthink/think-helper": "^3.1.1", - "topthink/think-orm": "^2.0" - }, - "require-dev": { - "mikey179/vfsstream": "^1.6", - "mockery/mockery": "^1.2", - "phpunit/phpunit": "^7.0" - }, - "time": "2021-01-25T14:48:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [], - "psr-4": { - "think\\": "src/think/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - }, - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "description": "The ThinkPHP Framework.", - "homepage": "http://thinkphp.cn/", - "keywords": [ - "framework", - "orm", - "thinkphp" - ], - "support": { - "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.7" - }, - "install-path": "../topthink/framework" - }, - { - "name": "topthink/think-helper", - "version": "v3.1.4", - "version_normalized": "3.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-helper.git", - "reference": "c28d37743bda4a0455286ca85b17b5791d626e10" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/top-think/think-helper/zipball/c28d37743bda4a0455286ca85b17b5791d626e10", - "reference": "c28d37743bda4a0455286ca85b17b5791d626e10", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1.0" - }, - "time": "2019-11-08T08:01:10+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\": "src" - }, - "files": [ - "src/helper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "description": "The ThinkPHP6 Helper Package", - "install-path": "../topthink/think-helper" - }, - { - "name": "topthink/think-migration", - "version": "v3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-migration.git", - "reference": "5717d9e5f3ea745f6dbfd1e30b4402aaadff9a79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/top-think/think-migration/zipball/5717d9e5f3ea745f6dbfd1e30b4402aaadff9a79", - "reference": "5717d9e5f3ea745f6dbfd1e30b4402aaadff9a79", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "topthink/framework": "^6.0.0", - "topthink/think-helper": "^3.0.3" - }, - "require-dev": { - "fzaninotto/faker": "^1.8" - }, - "suggest": { - "fzaninotto/faker": "Required to use the factory builder (^1.8)." - }, - "time": "2020-12-07T05:54:22+00:00", - "type": "library", - "extra": { - "think": { - "services": [ - "think\\migration\\Service" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Phinx\\": "phinx/src/Phinx", - "think\\migration\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "support": { - "issues": "https://github.com/top-think/think-migration/issues", - "source": "https://github.com/top-think/think-migration/tree/v3.0.3" - }, - "install-path": "../topthink/think-migration" - }, - { - "name": "topthink/think-multi-app", - "version": "v1.0.14", - "version_normalized": "1.0.14.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-multi-app.git", - "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3", - "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1.0", - "topthink/framework": "^6.0.0" - }, - "time": "2020-07-12T13:50:37+00:00", - "type": "library", - "extra": { - "think": { - "services": [ - "think\\app\\Service" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\app\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - } - ], - "description": "thinkphp6 multi app support", - "install-path": "../topthink/think-multi-app" - }, - { - "name": "topthink/think-orm", - "version": "v2.0.39", - "version_normalized": "2.0.39.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-orm.git", - "reference": "39a9d0a0e52d9b8bad9d98484d8484cdf5b683a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/39a9d0a0e52d9b8bad9d98484d8484cdf5b683a7", - "reference": "39a9d0a0e52d9b8bad9d98484d8484cdf5b683a7", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-json": "*", - "ext-pdo": "*", - "php": ">=7.1.0", - "psr/log": "~1.0", - "psr/simple-cache": "^1.0", - "topthink/think-helper": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7|^8|^9.5" - }, - "time": "2021-02-26T10:20:00+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\": "src" - }, - "files": [ - "stubs/load_stubs.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - } - ], - "description": "think orm", - "keywords": [ - "database", - "orm" - ], - "support": { - "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.39" - }, - "install-path": "../topthink/think-orm" - }, - { - "name": "topthink/think-trace", - "version": "v1.4", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-trace.git", - "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", - "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1.0", - "topthink/framework": "^6.0.0" - }, - "time": "2020-06-29T05:27:28+00:00", - "type": "library", - "extra": { - "think": { - "services": [ - "think\\trace\\Service" - ], - "config": { - "trace": "src/config.php" - } - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\trace\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - } - ], - "description": "thinkphp debug trace", - "install-path": "../topthink/think-trace" - }, - { - "name": "zircote/swagger-php", - "version": "3.1.0", - "version_normalized": "3.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/zircote/swagger-php.git", - "reference": "9d172471e56433b5c7061006b9a766f262a3edfd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/9d172471e56433b5c7061006b9a766f262a3edfd", - "reference": "9d172471e56433b5c7061006b9a766f262a3edfd", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "doctrine/annotations": "*", - "ext-json": "*", - "php": ">=7.2", - "symfony/finder": ">=2.2", - "symfony/yaml": ">=3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "phpunit/phpunit": ">=8" - }, - "time": "2020-09-03T20:18:43+00:00", - "bin": [ - "bin/openapi" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "OpenApi\\": "src" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Robert Allen", - "email": "zircote@gmail.com" - }, - { - "name": "Bob Fanger", - "email": "bfanger@gmail.com", - "homepage": "https://bfanger.nl" - }, - { - "name": "Martin Rademacher", - "email": "mano@radebatz.net", - "homepage": "https://radebatz.net" - } - ], - "description": "swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations", - "homepage": "https://github.com/zircote/swagger-php/", - "keywords": [ - "api", - "json", - "rest", - "service discovery" - ], - "support": { - "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/3.1.0" - }, - "install-path": "../zircote/swagger-php" - } - ], - "dev": true, - "dev-package-names": [ - "symfony/polyfill-php80", - "symfony/var-dumper", - "topthink/think-trace" - ] -} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php deleted file mode 100644 index 730c877..0000000 --- a/vendor/composer/installed.php +++ /dev/null @@ -1,312 +0,0 @@ - - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => 'e60cfe2b6616b1bcb1c91f148a81369e11161013', - 'name' => 'topthink/think', - ), - 'versions' => - array ( - 'doctrine/annotations' => - array ( - 'pretty_version' => '1.12.1', - 'version' => '1.12.1.0', - 'aliases' => - array ( - ), - 'reference' => 'b17c5014ef81d212ac539f07a1001832df1b6d3b', - ), - 'doctrine/lexer' => - array ( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'aliases' => - array ( - ), - 'reference' => 'e864bbf5904cb8f5bb334f99209b48018522f042', - ), - 'edward1108/edward-captcha' => - array ( - 'pretty_version' => '1.1', - 'version' => '1.1.0.0', - 'aliases' => - array ( - ), - 'reference' => '426ceee34507c30d4b21e0dd349b571371aef700', - ), - 'egulias/email-validator' => - array ( - 'pretty_version' => '2.1.25', - 'version' => '2.1.25.0', - 'aliases' => - array ( - ), - 'reference' => '0dbf5d78455d4d6a41d186da50adc1122ec066f4', - ), - 'lcobucci/clock' => - array ( - 'pretty_version' => '2.0.0', - 'version' => '2.0.0.0', - 'aliases' => - array ( - ), - 'reference' => '353d83fe2e6ae95745b16b3d911813df6a05bfb3', - ), - 'lcobucci/jwt' => - array ( - 'pretty_version' => '4.1.2', - 'version' => '4.1.2.0', - 'aliases' => - array ( - ), - 'reference' => 'c544710aa18e079baf0027ca4c8236913f46945b', - ), - 'league/flysystem' => - array ( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', - 'aliases' => - array ( - ), - 'reference' => '9be3b16c877d477357c015cec057548cf9b2a14a', - ), - 'league/flysystem-cached-adapter' => - array ( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'aliases' => - array ( - ), - 'reference' => 'd1925efb2207ac4be3ad0c40b8277175f99ffaff', - ), - 'league/mime-type-detection' => - array ( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', - 'aliases' => - array ( - ), - 'reference' => '3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3', - ), - 'psr/cache' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8', - ), - 'psr/container' => - array ( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f', - ), - 'psr/log' => - array ( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', - 'aliases' => - array ( - ), - 'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc', - ), - 'psr/simple-cache' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', - ), - 'swiftmailer/swiftmailer' => - array ( - 'pretty_version' => 'v6.2.5', - 'version' => '6.2.5.0', - 'aliases' => - array ( - ), - 'reference' => '698a6a9f54d7eb321274de3ad19863802c879fb7', - ), - 'symfony/deprecation-contracts' => - array ( - 'pretty_version' => 'v2.2.0', - 'version' => '2.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '5fa56b4074d1ae755beb55617ddafe6f5d78f665', - ), - 'symfony/finder' => - array ( - 'pretty_version' => 'v5.2.4', - 'version' => '5.2.4.0', - 'aliases' => - array ( - ), - 'reference' => '0d639a0943822626290d169965804f79400e6a04', - ), - 'symfony/polyfill-ctype' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => 'c6c942b1ac76c82448322025e084cadc56048b4e', - ), - 'symfony/polyfill-iconv' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '06fb361659649bcfd6a208a0f1fcaf4e827ad342', - ), - 'symfony/polyfill-intl-idn' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '2d63434d922daf7da8dd863e7907e67ee3031483', - ), - 'symfony/polyfill-intl-normalizer' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '43a0283138253ed1d48d352ab6d0bdb3f809f248', - ), - 'symfony/polyfill-mbstring' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => '5232de97ee3b75b0360528dae24e73db49566ab1', - ), - 'symfony/polyfill-php72' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => 'cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9', - ), - 'symfony/polyfill-php80' => - array ( - 'pretty_version' => 'v1.22.1', - 'version' => '1.22.1.0', - 'aliases' => - array ( - ), - 'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91', - ), - 'symfony/var-dumper' => - array ( - 'pretty_version' => 'v4.4.20', - 'version' => '4.4.20.0', - 'aliases' => - array ( - ), - 'reference' => 'a1eab2f69906dc83c5ddba4632180260d0ab4f7f', - ), - 'symfony/yaml' => - array ( - 'pretty_version' => 'v5.2.4', - 'version' => '5.2.4.0', - 'aliases' => - array ( - ), - 'reference' => '7d6ae0cce3c33965af681a4355f1c4de326ed277', - ), - 'topthink/framework' => - array ( - 'pretty_version' => 'v6.0.7', - 'version' => '6.0.7.0', - 'aliases' => - array ( - ), - 'reference' => 'db8fe22520a9660dd5e4c87e304034ac49e39270', - ), - 'topthink/think' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => 'e60cfe2b6616b1bcb1c91f148a81369e11161013', - ), - 'topthink/think-helper' => - array ( - 'pretty_version' => 'v3.1.4', - 'version' => '3.1.4.0', - 'aliases' => - array ( - ), - 'reference' => 'c28d37743bda4a0455286ca85b17b5791d626e10', - ), - 'topthink/think-migration' => - array ( - 'pretty_version' => 'v3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '5717d9e5f3ea745f6dbfd1e30b4402aaadff9a79', - ), - 'topthink/think-multi-app' => - array ( - 'pretty_version' => 'v1.0.14', - 'version' => '1.0.14.0', - 'aliases' => - array ( - ), - 'reference' => 'ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3', - ), - 'topthink/think-orm' => - array ( - 'pretty_version' => 'v2.0.39', - 'version' => '2.0.39.0', - 'aliases' => - array ( - ), - 'reference' => '39a9d0a0e52d9b8bad9d98484d8484cdf5b683a7', - ), - 'topthink/think-trace' => - array ( - 'pretty_version' => 'v1.4', - 'version' => '1.4.0.0', - 'aliases' => - array ( - ), - 'reference' => '9a9fa8f767b6c66c5a133ad21ca1bc96ad329444', - ), - 'zircote/swagger-php' => - array ( - 'pretty_version' => '3.1.0', - 'version' => '3.1.0.0', - 'aliases' => - array ( - ), - 'reference' => '9d172471e56433b5c7061006b9a766f262a3edfd', - ), - ), -); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php deleted file mode 100644 index 580fa96..0000000 --- a/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 70400)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/vendor/doctrine/annotations/CHANGELOG.md b/vendor/doctrine/annotations/CHANGELOG.md deleted file mode 100644 index 0b0ba1a..0000000 --- a/vendor/doctrine/annotations/CHANGELOG.md +++ /dev/null @@ -1,162 +0,0 @@ -## Changelog - -### 1.6.1 - -This release fixes an issue in which annotations such as `@foo-bar` -and `@foo-` were incorrectly recognised as valid, and both erroneously -parsed as `@foo`. - -Any annotation with `@name-*` format will now silently be ignored, -allowing vendor-specific annotations to be prefixed with the tool -name. - -Total issues resolved: **3** - -- [165: Update the composer branch alias](https://github.com/doctrine/annotations/pull/165) thanks to @mikeSimonson -- [209: Change Annotation::value typehint to mixed](https://github.com/doctrine/annotations/pull/209) thanks to @malarzm -- [257: Skip parsing annotations containing dashes, such as `@Foo-bar`, or `@Foo-`](https://github.com/doctrine/annotations/pull/257) thanks to @Ocramius - -### 1.6.0 - -This release brings a new endpoint that make sure that you can't shoot yourself in the foot by calling ```registerLoader``` multiple times and a few tests improvements. - -Total issues resolved: **7** - -- [145: Memory leak in AnnotationRegistry::registerLoader() when called multiple times](https://github.com/doctrine/annotations/issues/145) thanks to @TriAnMan -- [146: Import error on @experimental Annotation](https://github.com/doctrine/annotations/issues/146) thanks to @aturki -- [147: Ignoring @experimental annotation used by Symfony 3.3 CacheAdapter](https://github.com/doctrine/annotations/pull/147) thanks to @aturki -- [151: Remove duplicate code in `DCOM58Test`](https://github.com/doctrine/annotations/pull/151) thanks to @tuanphpvn -- [161: Prevent loading class_exists multiple times](https://github.com/doctrine/annotations/pull/161) thanks to @jrjohnson -- [162: Add registerUniqueLoader to AnnotationRegistry](https://github.com/doctrine/annotations/pull/162) thanks to @jrjohnson -- [163: Use assertDirectoryExists and assertDirectoryNotExists](https://github.com/doctrine/annotations/pull/163) thanks to @carusogabriel - -Thanks to everyone involved in this release. - -### 1.5.0 - -This release increments the minimum supported PHP version to 7.1.0. - -Also, HHVM official support has been dropped. - -Some noticeable performance improvements to annotation autoloading -have been applied, making failed annotation autoloading less heavy -on the filesystem access. - -- [133: Add @throws annotation in AnnotationReader#__construct()](https://github.com/doctrine/annotations/issues/133) thanks to @SenseException -- [134: Require PHP 7.1, drop HHVM support](https://github.com/doctrine/annotations/issues/134) thanks to @lcobucci -- [135: Prevent the same loader from being registered twice](https://github.com/doctrine/annotations/issues/135) thanks to @jrjohnson -- [137: #135 optimise multiple class load attempts in AnnotationRegistry](https://github.com/doctrine/annotations/issues/137) thanks to @Ocramius - - -### 1.4.0 - -This release fix an issue were some annotations could be not loaded if the namespace in the use statement started with a backslash. -It also update the tests and drop the support for php 5.X - -- [115: Missing annotations with the latest composer version](https://github.com/doctrine/annotations/issues/115) thanks to @pascalporedda -- [120: Missing annotations with the latest composer version](https://github.com/doctrine/annotations/pull/120) thanks to @gnat42 -- [121: Adding a more detailed explanation of the test](https://github.com/doctrine/annotations/pull/121) thanks to @mikeSimonson -- [101: Test annotation parameters containing space](https://github.com/doctrine/annotations/pull/101) thanks to @mikeSimonson -- [111: Cleanup: move to correct phpunit assertions](https://github.com/doctrine/annotations/pull/111) thanks to @Ocramius -- [112: Removes support for PHP 5.x](https://github.com/doctrine/annotations/pull/112) thanks to @railto -- [113: bumped phpunit version to 5.7](https://github.com/doctrine/annotations/pull/113) thanks to @gabbydgab -- [114: Enhancement: Use SVG Travis build badge](https://github.com/doctrine/annotations/pull/114) thanks to @localheinz -- [118: Integrating PHPStan](https://github.com/doctrine/annotations/pull/118) thanks to @ondrejmirtes - -### 1.3.1 - 2016-12-30 - -This release fixes an issue with ignored annotations that were already -autoloaded, causing the `SimpleAnnotationReader` to pick them up -anyway. [#110](https://github.com/doctrine/annotations/pull/110) - -Additionally, an issue was fixed in the `CachedReader`, which was -not correctly checking the freshness of cached annotations when -traits were defined on a class. [#105](https://github.com/doctrine/annotations/pull/105) - -Total issues resolved: **2** - -- [105: Return single max timestamp](https://github.com/doctrine/annotations/pull/105) -- [110: setIgnoreNotImportedAnnotations(true) didn’t work for existing classes](https://github.com/doctrine/annotations/pull/110) - -### 1.3.0 - -This release introduces a PHP version bump. `doctrine/annotations` now requires PHP -5.6 or later to be installed. - -A series of additional improvements have been introduced: - - * support for PHP 7 "grouped use statements" - * support for ignoring entire namespace names - via `Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredNamespace()` and - `Doctrine\Common\Annotations\DocParser::setIgnoredAnnotationNamespaces()`. This will - allow you to ignore annotations from namespaces that you cannot autoload - * testing all parent classes and interfaces when checking if the annotation cache - in the `CachedReader` is fresh - * simplifying the cache keys used by the `CachedReader`: keys are no longer artificially - namespaced, since `Doctrine\Common\Cache` already supports that - * corrected parsing of multibyte strings when `mbstring.func_overload` is enabled - * corrected parsing of annotations when `"\t"` is put before the first annotation - in a docblock - * allow skipping non-imported annotations when a custom `DocParser` is passed to - the `AnnotationReader` constructor - -Total issues resolved: **15** - -- [45: DocParser can now ignore whole namespaces](https://github.com/doctrine/annotations/pull/45) -- [57: Switch to the docker-based infrastructure on Travis](https://github.com/doctrine/annotations/pull/57) -- [59: opcache.load_comments has been removed from PHP 7](https://github.com/doctrine/annotations/pull/59) -- [62: [CachedReader\ Test traits and parent class to see if cache is fresh](https://github.com/doctrine/annotations/pull/62) -- [65: Remove cache salt making key unnecessarily long](https://github.com/doctrine/annotations/pull/65) -- [66: Fix of incorrect parsing multibyte strings](https://github.com/doctrine/annotations/pull/66) -- [68: Annotations that are indented by tab are not processed.](https://github.com/doctrine/annotations/issues/68) -- [69: Support for Group Use Statements](https://github.com/doctrine/annotations/pull/69) -- [70: Allow tab character before first annotation in DocBlock](https://github.com/doctrine/annotations/pull/70) -- [74: Ignore not registered annotations fix](https://github.com/doctrine/annotations/pull/74) -- [92: Added tests for AnnotationRegistry class.](https://github.com/doctrine/annotations/pull/92) -- [96: Fix/#62 check trait and parent class ttl in annotations](https://github.com/doctrine/annotations/pull/96) -- [97: Feature - #45 - allow ignoring entire namespaces](https://github.com/doctrine/annotations/pull/97) -- [98: Enhancement/#65 remove cache salt from cached reader](https://github.com/doctrine/annotations/pull/98) -- [99: Fix - #70 - allow tab character before first annotation in docblock](https://github.com/doctrine/annotations/pull/99) - -### 1.2.4 - -Total issues resolved: **1** - -- [51: FileCacheReader::saveCacheFile::unlink fix](https://github.com/doctrine/annotations/pull/51) - -### 1.2.3 - -Total issues resolved: [**2**](https://github.com/doctrine/annotations/milestones/v1.2.3) - -- [49: #46 - applying correct `chmod()` to generated cache file](https://github.com/doctrine/annotations/pull/49) -- [50: Hotfix: match escaped quotes (revert #44)](https://github.com/doctrine/annotations/pull/50) - -### 1.2.2 - -Total issues resolved: **4** - -- [43: Exclude files from distribution with .gitattributes](https://github.com/doctrine/annotations/pull/43) -- [44: Update DocLexer.php](https://github.com/doctrine/annotations/pull/44) -- [46: A plain "file_put_contents" can cause havoc](https://github.com/doctrine/annotations/pull/46) -- [48: Deprecating the `FileCacheReader` in 1.2.2: will be removed in 2.0.0](https://github.com/doctrine/annotations/pull/48) - -### 1.2.1 - -Total issues resolved: **4** - -- [38: fixes doctrine/common#326](https://github.com/doctrine/annotations/pull/38) -- [39: Remove superfluous NS](https://github.com/doctrine/annotations/pull/39) -- [41: Warn if load_comments is not enabled.](https://github.com/doctrine/annotations/pull/41) -- [42: Clean up unused uses](https://github.com/doctrine/annotations/pull/42) - -### 1.2.0 - - * HHVM support - * Allowing dangling comma in annotations - * Excluded annotations are no longer autoloaded - * Importing namespaces also in traits - * Added support for `::class` 5.5-style constant, works also in 5.3 and 5.4 - -### 1.1.0 - - * Add Exception when ZendOptimizer+ or Opcache is configured to drop comments diff --git a/vendor/doctrine/annotations/LICENSE b/vendor/doctrine/annotations/LICENSE deleted file mode 100644 index 5e781fc..0000000 --- a/vendor/doctrine/annotations/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2013 Doctrine Project - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/doctrine/annotations/README.md b/vendor/doctrine/annotations/README.md deleted file mode 100644 index ddeddd2..0000000 --- a/vendor/doctrine/annotations/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Doctrine Annotations - -[![Build Status](https://github.com/doctrine/annotations/workflows/Continuous%20Integration/badge.svg?label=build)](https://github.com/doctrine/persistence/actions) -[![Dependency Status](https://www.versioneye.com/package/php--doctrine--annotations/badge.png)](https://www.versioneye.com/package/php--doctrine--annotations) -[![Reference Status](https://www.versioneye.com/php/doctrine:annotations/reference_badge.svg)](https://www.versioneye.com/php/doctrine:annotations/references) -[![Total Downloads](https://poser.pugx.org/doctrine/annotations/downloads.png)](https://packagist.org/packages/doctrine/annotations) -[![Latest Stable Version](https://img.shields.io/packagist/v/doctrine/annotations.svg?label=stable)](https://packagist.org/packages/doctrine/annotations) - -Docblock Annotations Parser library (extracted from [Doctrine Common](https://github.com/doctrine/common)). - -## Documentation - -See the [doctrine-project website](https://www.doctrine-project.org/projects/doctrine-annotations/en/latest/index.html). - -## Contributing - -When making a pull request, make sure your changes follow the -[Coding Standard Guidelines](https://www.doctrine-project.org/projects/doctrine-coding-standard/en/current/reference/index.html#introduction). - -## Changelog - -See [CHANGELOG.md](CHANGELOG.md). diff --git a/vendor/doctrine/annotations/composer.json b/vendor/doctrine/annotations/composer.json deleted file mode 100644 index e14ce93..0000000 --- a/vendor/doctrine/annotations/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "doctrine/annotations", - "type": "library", - "description": "Docblock Annotations Parser", - "keywords": ["annotations", "docblock", "parser"], - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": "^7.1 || ^8.0", - "ext-tokenizer": "*", - "doctrine/lexer": "1.*" - }, - "require-dev": { - "doctrine/cache": "1.*", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" - }, - "config": { - "sort-packages": true - }, - "autoload": { - "psr-4": { "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } - }, - "autoload-dev": { - "psr-4": { - "Doctrine\\Performance\\Common\\Annotations\\": "tests/Doctrine/Performance/Common/Annotations", - "Doctrine\\Tests\\Common\\Annotations\\": "tests/Doctrine/Tests/Common/Annotations" - }, - "files": [ - "tests/Doctrine/Tests/Common/Annotations/Fixtures/functions.php", - "tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php" - ] - } -} diff --git a/vendor/doctrine/annotations/docs/en/annotations.rst b/vendor/doctrine/annotations/docs/en/annotations.rst deleted file mode 100644 index 648ab26..0000000 --- a/vendor/doctrine/annotations/docs/en/annotations.rst +++ /dev/null @@ -1,271 +0,0 @@ -Handling Annotations -==================== - -There are several different approaches to handling annotations in PHP. -Doctrine Annotations maps docblock annotations to PHP classes. Because -not all docblock annotations are used for metadata purposes a filter is -applied to ignore or skip classes that are not Doctrine annotations. - -Take a look at the following code snippet: - -.. code-block:: php - - namespace MyProject\Entities; - - use Doctrine\ORM\Mapping AS ORM; - use Symfony\Component\Validator\Constraints AS Assert; - - /** - * @author Benjamin Eberlei - * @ORM\Entity - * @MyProject\Annotations\Foobarable - */ - class User - { - /** - * @ORM\Id @ORM\Column @ORM\GeneratedValue - * @dummy - * @var int - */ - private $id; - - /** - * @ORM\Column(type="string") - * @Assert\NotEmpty - * @Assert\Email - * @var string - */ - private $email; - } - -In this snippet you can see a variety of different docblock annotations: - -- Documentation annotations such as ``@var`` and ``@author``. These - annotations are ignored and never considered for throwing an - exception due to wrongly used annotations. -- Annotations imported through use statements. The statement ``use - Doctrine\ORM\Mapping AS ORM`` makes all classes under that namespace - available as ``@ORM\ClassName``. Same goes for the import of - ``@Assert``. -- The ``@dummy`` annotation. It is not a documentation annotation and - not ignored. For Doctrine Annotations it is not entirely clear how - to handle this annotation. Depending on the configuration an exception - (unknown annotation) will be thrown when parsing this annotation. -- The fully qualified annotation ``@MyProject\Annotations\Foobarable``. - This is transformed directly into the given class name. - -How are these annotations loaded? From looking at the code you could -guess that the ORM Mapping, Assert Validation and the fully qualified -annotation can just be loaded using -the defined PHP autoloaders. This is not the case however: For error -handling reasons every check for class existence inside the -``AnnotationReader`` sets the second parameter $autoload -of ``class_exists($name, $autoload)`` to false. To work flawlessly the -``AnnotationReader`` requires silent autoloaders which many autoloaders are -not. Silent autoloading is NOT part of the `PSR-0 specification -`_ -for autoloading. - -This is why Doctrine Annotations uses its own autoloading mechanism -through a global registry. If you are wondering about the annotation -registry being global, there is no other way to solve the architectural -problems of autoloading annotation classes in a straightforward fashion. -Additionally if you think about PHP autoloading then you recognize it is -a global as well. - -To anticipate the configuration section, making the above PHP class work -with Doctrine Annotations requires this setup: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - use Doctrine\Common\Annotations\AnnotationRegistry; - - AnnotationRegistry::registerFile("/path/to/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); - AnnotationRegistry::registerAutoloadNamespace("Symfony\Component\Validator\Constraint", "/path/to/symfony/src"); - AnnotationRegistry::registerAutoloadNamespace("MyProject\Annotations", "/path/to/myproject/src"); - - $reader = new AnnotationReader(); - AnnotationReader::addGlobalIgnoredName('dummy'); - -The second block with the annotation registry calls registers all the -three different annotation namespaces that are used. -Doctrine Annotations saves all its annotations in a single file, that is -why ``AnnotationRegistry#registerFile`` is used in contrast to -``AnnotationRegistry#registerAutoloadNamespace`` which creates a PSR-0 -compatible loading mechanism for class to file names. - -In the third block, we create the actual ``AnnotationReader`` instance. -Note that we also add ``dummy`` to the global list of ignored -annotations for which we do not throw exceptions. Setting this is -necessary in our example case, otherwise ``@dummy`` would trigger an -exception to be thrown during the parsing of the docblock of -``MyProject\Entities\User#id``. - -Setup and Configuration ------------------------ - -To use the annotations library is simple, you just need to create a new -``AnnotationReader`` instance: - -.. code-block:: php - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - -This creates a simple annotation reader with no caching other than in -memory (in php arrays). Since parsing docblocks can be expensive you -should cache this process by using a caching reader. - -You can use a file caching reader, but please note it is deprecated to -do so: - -.. code-block:: php - - use Doctrine\Common\Annotations\FileCacheReader; - use Doctrine\Common\Annotations\AnnotationReader; - - $reader = new FileCacheReader( - new AnnotationReader(), - "/path/to/cache", - $debug = true - ); - -If you set the ``debug`` flag to ``true`` the cache reader will check -for changes in the original files, which is very important during -development. If you don't set it to ``true`` you have to delete the -directory to clear the cache. This gives faster performance, however -should only be used in production, because of its inconvenience during -development. - -You can also use one of the ``Doctrine\Common\Cache\Cache`` cache -implementations to cache the annotations: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - use Doctrine\Common\Annotations\CachedReader; - use Doctrine\Common\Cache\ApcCache; - - $reader = new CachedReader( - new AnnotationReader(), - new ApcCache(), - $debug = true - ); - -The ``debug`` flag is used here as well to invalidate the cache files -when the PHP class with annotations changed and should be used during -development. - -.. warning :: - - The ``AnnotationReader`` works and caches under the - assumption that all annotations of a doc-block are processed at - once. That means that annotation classes that do not exist and - aren't loaded and cannot be autoloaded (using the - AnnotationRegistry) would never be visible and not accessible if a - cache is used unless the cache is cleared and the annotations - requested again, this time with all annotations defined. - -By default the annotation reader returns a list of annotations with -numeric indexes. If you want your annotations to be indexed by their -class name you can wrap the reader in an ``IndexedReader``: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - use Doctrine\Common\Annotations\IndexedReader; - - $reader = new IndexedReader(new AnnotationReader()); - -.. warning:: - - You should never wrap the indexed reader inside a cached reader, - only the other way around. This way you can re-use the cache with - indexed or numeric keys, otherwise your code may experience failures - due to caching in a numerical or indexed format. - -Registering Annotations -~~~~~~~~~~~~~~~~~~~~~~~ - -As explained in the introduction, Doctrine Annotations uses its own -autoloading mechanism to determine if a given annotation has a -corresponding PHP class that can be autoloaded. For annotation -autoloading you have to configure the -``Doctrine\Common\Annotations\AnnotationRegistry``. There are three -different mechanisms to configure annotation autoloading: - -- Calling ``AnnotationRegistry#registerFile($file)`` to register a file - that contains one or more annotation classes. -- Calling ``AnnotationRegistry#registerNamespace($namespace, $dirs = - null)`` to register that the given namespace contains annotations and - that their base directory is located at the given $dirs or in the - include path if ``NULL`` is passed. The given directories should *NOT* - be the directory where classes of the namespace are in, but the base - directory of the root namespace. The AnnotationRegistry uses a - namespace to directory separator approach to resolve the correct path. -- Calling ``AnnotationRegistry#registerLoader($callable)`` to register - an autoloader callback. The callback accepts the class as first and - only parameter and has to return ``true`` if the corresponding file - was found and included. - -.. note:: - - Loaders have to fail silently, if a class is not found even if it - matches for example the namespace prefix of that loader. Never is a - loader to throw a warning or exception if the loading failed - otherwise parsing doc block annotations will become a huge pain. - -A sample loader callback could look like: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationRegistry; - use Symfony\Component\ClassLoader\UniversalClassLoader; - - AnnotationRegistry::registerLoader(function($class) { - $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php"; - - if (file_exists("/my/base/path/" . $file)) { - // file_exists() makes sure that the loader fails silently - require "/my/base/path/" . $file; - } - }); - - $loader = new UniversalClassLoader(); - AnnotationRegistry::registerLoader(array($loader, "loadClass")); - - -Ignoring missing exceptions -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default an exception is thrown from the ``AnnotationReader`` if an -annotation was found that: - -- is not part of the list of ignored "documentation annotations"; -- was not imported through a use statement; -- is not a fully qualified class that exists. - -You can disable this behavior for specific names if your docblocks do -not follow strict requirements: - -.. code-block:: php - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - AnnotationReader::addGlobalIgnoredName('foo'); - -PHP Imports -~~~~~~~~~~~ - -By default the annotation reader parses the use-statement of a php file -to gain access to the import rules and register them for the annotation -processing. Only if you are using PHP Imports can you validate the -correct usage of annotations and throw exceptions if you misspelled an -annotation. This mechanism is enabled by default. - -To ease the upgrade path, we still allow you to disable this mechanism. -Note however that we will remove this in future versions: - -.. code-block:: php - - $reader = new \Doctrine\Common\Annotations\AnnotationReader(); - $reader->setEnabledPhpImports(false); diff --git a/vendor/doctrine/annotations/docs/en/custom.rst b/vendor/doctrine/annotations/docs/en/custom.rst deleted file mode 100644 index 11fbe1a..0000000 --- a/vendor/doctrine/annotations/docs/en/custom.rst +++ /dev/null @@ -1,443 +0,0 @@ -Custom Annotation Classes -========================= - -If you want to define your own annotations, you just have to group them -in a namespace and register this namespace in the ``AnnotationRegistry``. -Annotation classes have to contain a class-level docblock with the text -``@Annotation``: - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** @Annotation */ - class Bar - { - // some code - } - -Inject annotation values ------------------------- - -The annotation parser checks if the annotation constructor has arguments, -if so then it will pass the value array, otherwise it will try to inject -values into public properties directly: - - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * - * Some Annotation using a constructor - */ - class Bar - { - private $foo; - - public function __construct(array $values) - { - $this->foo = $values['foo']; - } - } - - /** - * @Annotation - * - * Some Annotation without a constructor - */ - class Foo - { - public $bar; - } - -Optional: Constructors with Named Parameters --------------------------------------------- - -Starting with Annotations v1.11 a new annotation instantiation strategy -is available that aims at compatibility of Annotation classes with the PHP 8 -attribute feature. You need to declare a constructor with regular parameter -names that match the named arguments in the annotation syntax. - -To enable this feature, you can tag your annotation class with -``@NamedArgumentConstructor`` (available from v1.12) or implement the -``Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation`` interface -(available from v1.11 and deprecated as of v1.12). -When using the ``@NamedArgumentConstructor`` tag, the first argument of the -constructor is considered as the default one. - - -Usage with the ``@NamedArgumentContrustor`` tag - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @NamedArgumentConstructor - */ - class Bar implements NamedArgumentConstructorAnnotation - { - private $foo; - - public function __construct(string $foo) - { - $this->foo = $foo; - } - } - - /** Usable with @Bar(foo="baz") */ - /** Usable with @Bar("baz") */ - -In combination with PHP 8's constructor property promotion feature -you can simplify this to: - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @NamedArgumentConstructor - */ - class Bar implements NamedArgumentConstructorAnnotation - { - public function __construct(private string $foo) {} - } - - -Usage with the -``Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation`` -interface (v1.11, deprecated as of v1.12): -.. code-block:: php - - namespace MyCompany\Annotations; - - use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; - - /** @Annotation */ - class Bar implements NamedArgumentConstructorAnnotation - { - private $foo; - - public function __construct(private string $foo) {} - } - - /** Usable with @Bar(foo="baz") */ - -Annotation Target ------------------ - -``@Target`` indicates the kinds of class elements to which an annotation -type is applicable. Then you could define one or more targets: - -- ``CLASS`` Allowed in class docblocks -- ``PROPERTY`` Allowed in property docblocks -- ``METHOD`` Allowed in the method docblocks -- ``FUNCTION`` Allowed in function dockblocks -- ``ALL`` Allowed in class, property, method and function docblocks -- ``ANNOTATION`` Allowed inside other annotations - -If the annotations is not allowed in the current context, an -``AnnotationException`` is thrown. - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @Target({"METHOD","PROPERTY"}) - */ - class Bar - { - // some code - } - - /** - * @Annotation - * @Target("CLASS") - */ - class Foo - { - // some code - } - -Attribute types ---------------- - -The annotation parser checks the given parameters using the phpdoc -annotation ``@var``, The data type could be validated using the ``@var`` -annotation on the annotation properties or using the ``@Attributes`` and -``@Attribute`` annotations. - -If the data type does not match you get an ``AnnotationException`` - -.. code-block:: php - - namespace MyCompany\Annotations; - - /** - * @Annotation - * @Target({"METHOD","PROPERTY"}) - */ - class Bar - { - /** @var mixed */ - public $mixed; - - /** @var boolean */ - public $boolean; - - /** @var bool */ - public $bool; - - /** @var float */ - public $float; - - /** @var string */ - public $string; - - /** @var integer */ - public $integer; - - /** @var array */ - public $array; - - /** @var SomeAnnotationClass */ - public $annotation; - - /** @var array */ - public $arrayOfIntegers; - - /** @var array */ - public $arrayOfAnnotations; - } - - /** - * @Annotation - * @Target({"METHOD","PROPERTY"}) - * @Attributes({ - * @Attribute("stringProperty", type = "string"), - * @Attribute("annotProperty", type = "SomeAnnotationClass"), - * }) - */ - class Foo - { - public function __construct(array $values) - { - $this->stringProperty = $values['stringProperty']; - $this->annotProperty = $values['annotProperty']; - } - - // some code - } - -Annotation Required -------------------- - -``@Required`` indicates that the field must be specified when the -annotation is used. If it is not used you get an ``AnnotationException`` -stating that this value can not be null. - -Declaring a required field: - -.. code-block:: php - - /** - * @Annotation - * @Target("ALL") - */ - class Foo - { - /** @Required */ - public $requiredField; - } - -Usage: - -.. code-block:: php - - /** @Foo(requiredField="value") */ - public $direction; // Valid - - /** @Foo */ - public $direction; // Required field missing, throws an AnnotationException - - -Enumerated values ------------------ - -- An annotation property marked with ``@Enum`` is a field that accepts a - fixed set of scalar values. -- You should use ``@Enum`` fields any time you need to represent fixed - values. -- The annotation parser checks the given value and throws an - ``AnnotationException`` if the value does not match. - - -Declaring an enumerated property: - -.. code-block:: php - - /** - * @Annotation - * @Target("ALL") - */ - class Direction - { - /** - * @Enum({"NORTH", "SOUTH", "EAST", "WEST"}) - */ - public $value; - } - -Annotation usage: - -.. code-block:: php - - /** @Direction("NORTH") */ - public $direction; // Valid value - - /** @Direction("NORTHEAST") */ - public $direction; // Invalid value, throws an AnnotationException - - -Constants ---------- - -The use of constants and class constants is available on the annotations -parser. - -The following usages are allowed: - -.. code-block:: php - - namespace MyCompany\Entity; - - use MyCompany\Annotations\Foo; - use MyCompany\Annotations\Bar; - use MyCompany\Entity\SomeClass; - - /** - * @Foo(PHP_EOL) - * @Bar(Bar::FOO) - * @Foo({SomeClass::FOO, SomeClass::BAR}) - * @Bar({SomeClass::FOO_KEY = SomeClass::BAR_VALUE}) - */ - class User - { - } - - -Be careful with constants and the cache ! - -.. note:: - - The cached reader will not re-evaluate each time an annotation is - loaded from cache. When a constant is changed the cache must be - cleaned. - - -Usage ------ - -Using the library API is simple. Using the annotations described in the -previous section, you can now annotate other classes with your -annotations: - -.. code-block:: php - - namespace MyCompany\Entity; - - use MyCompany\Annotations\Foo; - use MyCompany\Annotations\Bar; - - /** - * @Foo(bar="foo") - * @Bar(foo="bar") - */ - class User - { - } - -Now we can write a script to get the annotations above: - -.. code-block:: php - - $reflClass = new ReflectionClass('MyCompany\Entity\User'); - $classAnnotations = $reader->getClassAnnotations($reflClass); - - foreach ($classAnnotations AS $annot) { - if ($annot instanceof \MyCompany\Annotations\Foo) { - echo $annot->bar; // prints "foo"; - } else if ($annot instanceof \MyCompany\Annotations\Bar) { - echo $annot->foo; // prints "bar"; - } - } - -You have a complete API for retrieving annotation class instances from a -class, property or method docblock: - - -Reader API -~~~~~~~~~~ - -Access all annotations of a class -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getClassAnnotations(\ReflectionClass $class); - -Access one annotation of a class -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getClassAnnotation(\ReflectionClass $class, $annotationName); - -Access all annotations of a method -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getMethodAnnotations(\ReflectionMethod $method); - -Access one annotation of a method -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName); - -Access all annotations of a property -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getPropertyAnnotations(\ReflectionProperty $property); - -Access one annotation of a property -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName); - -Access all annotations of a function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getFunctionAnnotations(\ReflectionFunction $property); - -Access one annotation of a function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: php - - public function getFunctionAnnotation(\ReflectionFunction $property, $annotationName); diff --git a/vendor/doctrine/annotations/docs/en/index.rst b/vendor/doctrine/annotations/docs/en/index.rst deleted file mode 100644 index fd001f4..0000000 --- a/vendor/doctrine/annotations/docs/en/index.rst +++ /dev/null @@ -1,101 +0,0 @@ -Introduction -============ - -Doctrine Annotations allows to implement custom annotation -functionality for PHP classes and functions. - -.. code-block:: php - - class Foo - { - /** - * @MyAnnotation(myProperty="value") - */ - private $bar; - } - -Annotations aren't implemented in PHP itself which is why this component -offers a way to use the PHP doc-blocks as a place for the well known -annotation syntax using the ``@`` char. - -Annotations in Doctrine are used for the ORM configuration to build the -class mapping, but it can be used in other projects for other purposes -too. - -Installation -============ - -You can install the Annotation component with composer: - -.. code-block:: - -   $ composer require doctrine/annotations - -Create an annotation class -========================== - -An annotation class is a representation of the later used annotation -configuration in classes. The annotation class of the previous example -looks like this: - -.. code-block:: php - - /** - * @Annotation - */ - final class MyAnnotation - { - public $myProperty; - } - -The annotation class is declared as an annotation by ``@Annotation``. - -:ref:`Read more about custom annotations. ` - -Reading annotations -=================== - -The access to the annotations happens by reflection of the class or function -containing them. There are multiple reader-classes implementing the -``Doctrine\Common\Annotations\Reader`` interface, that can access the -annotations of a class. A common one is -``Doctrine\Common\Annotations\AnnotationReader``: - -.. code-block:: php - - use Doctrine\Common\Annotations\AnnotationReader; - use Doctrine\Common\Annotations\AnnotationRegistry; - - // Deprecated and will be removed in 2.0 but currently needed - AnnotationRegistry::registerLoader('class_exists'); - - $reflectionClass = new ReflectionClass(Foo::class); - $property = $reflectionClass->getProperty('bar'); - - $reader = new AnnotationReader(); - $myAnnotation = $reader->getPropertyAnnotation( - $property, - MyAnnotation::class - ); - - echo $myAnnotation->myProperty; // result: "value" - -Note that ``AnnotationRegistry::registerLoader('class_exists')`` only works -if you already have an autoloader configured (i.e. composer autoloader). -Otherwise, :ref:`please take a look to the other annotation autoload mechanisms `. - -A reader has multiple methods to access the annotations of a class or -function. - -:ref:`Read more about handling annotations. ` - -IDE Support ------------ - -Some IDEs already provide support for annotations: - -- Eclipse via the `Symfony2 Plugin `_ -- PhpStorm via the `PHP Annotations Plugin `_ or the `Symfony Plugin `_ - -.. _Read more about handling annotations.: annotations -.. _Read more about custom annotations.: custom diff --git a/vendor/doctrine/annotations/docs/en/sidebar.rst b/vendor/doctrine/annotations/docs/en/sidebar.rst deleted file mode 100644 index 6f5d13c..0000000 --- a/vendor/doctrine/annotations/docs/en/sidebar.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. toctree:: - :depth: 3 - - index - annotations - custom diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php deleted file mode 100644 index 750270e..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php +++ /dev/null @@ -1,59 +0,0 @@ - $data Key-value for properties to be defined in this class. - */ - final public function __construct(array $data) - { - foreach ($data as $key => $value) { - $this->$key = $value; - } - } - - /** - * Error handler for unknown property accessor in Annotation class. - * - * @param string $name Unknown property name. - * - * @throws BadMethodCallException - */ - public function __get($name) - { - throw new BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class) - ); - } - - /** - * Error handler for unknown property mutator in Annotation class. - * - * @param string $name Unknown property name. - * @param mixed $value Property value. - * - * @throws BadMethodCallException - */ - public function __set($name, $value) - { - throw new BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class) - ); - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php deleted file mode 100644 index b1f8514..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php +++ /dev/null @@ -1,21 +0,0 @@ - */ - public $value; -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php deleted file mode 100644 index 35d6410..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php +++ /dev/null @@ -1,69 +0,0 @@ - */ - public $value; - - /** - * Literal target declaration. - * - * @var mixed[] - */ - public $literal; - - /** - * @throws InvalidArgumentException - * - * @phpstan-param array{literal?: mixed[], value: list} $values - */ - public function __construct(array $values) - { - if (! isset($values['literal'])) { - $values['literal'] = []; - } - - foreach ($values['value'] as $var) { - if (! is_scalar($var)) { - throw new InvalidArgumentException(sprintf( - '@Enum supports only scalar values "%s" given.', - is_object($var) ? get_class($var) : gettype($var) - )); - } - } - - foreach ($values['literal'] as $key => $var) { - if (! in_array($key, $values['value'])) { - throw new InvalidArgumentException(sprintf( - 'Undefined enumerator value "%s" for literal "%s".', - $key, - $var - )); - } - } - - $this->value = $values['value']; - $this->literal = $values['literal']; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php deleted file mode 100644 index ae60f7d..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php +++ /dev/null @@ -1,43 +0,0 @@ - */ - public $names; - - /** - * @throws RuntimeException - * - * @phpstan-param array{value: string|list} $values - */ - public function __construct(array $values) - { - if (is_string($values['value'])) { - $values['value'] = [$values['value']]; - } - - if (! is_array($values['value'])) { - throw new RuntimeException(sprintf( - '@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', - json_encode($values['value']) - )); - } - - $this->names = $values['value']; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php deleted file mode 100644 index 1690601..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php +++ /dev/null @@ -1,13 +0,0 @@ - */ - private static $map = [ - 'ALL' => self::TARGET_ALL, - 'CLASS' => self::TARGET_CLASS, - 'METHOD' => self::TARGET_METHOD, - 'PROPERTY' => self::TARGET_PROPERTY, - 'FUNCTION' => self::TARGET_FUNCTION, - 'ANNOTATION' => self::TARGET_ANNOTATION, - ]; - - /** @phpstan-var list */ - public $value; - - /** - * Targets as bitmask. - * - * @var int - */ - public $targets; - - /** - * Literal target declaration. - * - * @var string - */ - public $literal; - - /** - * @throws InvalidArgumentException - * - * @phpstan-param array{value?: string|list} $values - */ - public function __construct(array $values) - { - if (! isset($values['value'])) { - $values['value'] = null; - } - - if (is_string($values['value'])) { - $values['value'] = [$values['value']]; - } - - if (! is_array($values['value'])) { - throw new InvalidArgumentException( - sprintf( - '@Target expects either a string value, or an array of strings, "%s" given.', - is_object($values['value']) ? get_class($values['value']) : gettype($values['value']) - ) - ); - } - - $bitmask = 0; - foreach ($values['value'] as $literal) { - if (! isset(self::$map[$literal])) { - throw new InvalidArgumentException( - sprintf( - 'Invalid Target "%s". Available targets: [%s]', - $literal, - implode(', ', array_keys(self::$map)) - ) - ); - } - - $bitmask |= self::$map[$literal]; - } - - $this->targets = $bitmask; - $this->value = $values['value']; - $this->literal = implode(', ', $this->value); - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php deleted file mode 100644 index b1ea64e..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php +++ /dev/null @@ -1,171 +0,0 @@ - $available - */ - public static function enumeratorError($attributeName, $annotationName, $context, $available, $given) - { - return new self(sprintf( - '[Enum Error] Attribute "%s" of @%s declared on %s accepts only [%s], but got %s.', - $attributeName, - $annotationName, - $context, - implode(', ', $available), - is_object($given) ? get_class($given) : $given - )); - } - - /** - * @return AnnotationException - */ - public static function optimizerPlusSaveComments() - { - return new self( - 'You have to enable opcache.save_comments=1 or zend_optimizerplus.save_comments=1.' - ); - } - - /** - * @return AnnotationException - */ - public static function optimizerPlusLoadComments() - { - return new self( - 'You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1.' - ); - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php deleted file mode 100644 index 1f538ee..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ /dev/null @@ -1,389 +0,0 @@ - - */ - private static $globalImports = [ - 'ignoreannotation' => Annotation\IgnoreAnnotation::class, - ]; - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names are case sensitive. - * - * @var array - */ - private static $globalIgnoredNames = ImplicitlyIgnoredAnnotationNames::LIST; - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names are case sensitive. - * - * @var array - */ - private static $globalIgnoredNamespaces = []; - - /** - * Add a new annotation to the globally ignored annotation names with regard to exception handling. - * - * @param string $name - */ - public static function addGlobalIgnoredName($name) - { - self::$globalIgnoredNames[$name] = true; - } - - /** - * Add a new annotation to the globally ignored annotation namespaces with regard to exception handling. - * - * @param string $namespace - */ - public static function addGlobalIgnoredNamespace($namespace) - { - self::$globalIgnoredNamespaces[$namespace] = true; - } - - /** - * Annotations parser. - * - * @var DocParser - */ - private $parser; - - /** - * Annotations parser used to collect parsing metadata. - * - * @var DocParser - */ - private $preParser; - - /** - * PHP parser used to collect imports. - * - * @var PhpParser - */ - private $phpParser; - - /** - * In-memory cache mechanism to store imported annotations per class. - * - * @psalm-var array<'class'|'function', array>> - */ - private $imports = []; - - /** - * In-memory cache mechanism to store ignored annotations per class. - * - * @psalm-var array<'class'|'function', array>> - */ - private $ignoredAnnotationNames = []; - - /** - * Initializes a new AnnotationReader. - * - * @throws AnnotationException - */ - public function __construct(?DocParser $parser = null) - { - if ( - extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.save_comments') === '0' || - ini_get('opcache.save_comments') === '0') - ) { - throw AnnotationException::optimizerPlusSaveComments(); - } - - if (extension_loaded('Zend OPcache') && ini_get('opcache.save_comments') === 0) { - throw AnnotationException::optimizerPlusSaveComments(); - } - - // Make sure that the IgnoreAnnotation annotation is loaded - class_exists(IgnoreAnnotation::class); - - $this->parser = $parser ?: new DocParser(); - - $this->preParser = new DocParser(); - - $this->preParser->setImports(self::$globalImports); - $this->preParser->setIgnoreNotImportedAnnotations(true); - $this->preParser->setIgnoredAnnotationNames(self::$globalIgnoredNames); - - $this->phpParser = new PhpParser(); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - $this->parser->setTarget(Target::TARGET_CLASS); - $this->parser->setImports($this->getImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - $annotations = $this->getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $context = 'property ' . $class->getName() . '::$' . $property->getName(); - - $this->parser->setTarget(Target::TARGET_PROPERTY); - $this->parser->setImports($this->getPropertyImports($property)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($property->getDocComment(), $context); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - - $this->parser->setTarget(Target::TARGET_METHOD); - $this->parser->setImports($this->getMethodImports($method)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($method->getDocComment(), $context); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Gets the annotations applied to a function. - * - * @phpstan-return list An array of Annotations. - */ - public function getFunctionAnnotations(ReflectionFunction $function): array - { - $context = 'function ' . $function->getName(); - - $this->parser->setTarget(Target::TARGET_FUNCTION); - $this->parser->setImports($this->getImports($function)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($function)); - $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); - - return $this->parser->parse($function->getDocComment(), $context); - } - - /** - * Gets a function annotation. - * - * @return object|null The Annotation or NULL, if the requested annotation does not exist. - */ - public function getFunctionAnnotation(ReflectionFunction $function, string $annotationName) - { - $annotations = $this->getFunctionAnnotations($function); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Returns the ignored annotations for the given class or function. - * - * @param ReflectionClass|ReflectionFunction $reflection - * - * @return array - */ - private function getIgnoredAnnotationNames($reflection): array - { - $type = $reflection instanceof ReflectionClass ? 'class' : 'function'; - $name = $reflection->getName(); - - if (isset($this->ignoredAnnotationNames[$type][$name])) { - return $this->ignoredAnnotationNames[$type][$name]; - } - - $this->collectParsingMetadata($reflection); - - return $this->ignoredAnnotationNames[$type][$name]; - } - - /** - * Retrieves imports for a class or a function. - * - * @param ReflectionClass|ReflectionFunction $reflection - * - * @return array - */ - private function getImports($reflection): array - { - $type = $reflection instanceof ReflectionClass ? 'class' : 'function'; - $name = $reflection->getName(); - - if (isset($this->imports[$type][$name])) { - return $this->imports[$type][$name]; - } - - $this->collectParsingMetadata($reflection); - - return $this->imports[$type][$name]; - } - - /** - * Retrieves imports for methods. - * - * @return array - */ - private function getMethodImports(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $classImports = $this->getImports($class); - - $traitImports = []; - - foreach ($class->getTraits() as $trait) { - if ( - ! $trait->hasMethod($method->getName()) - || $trait->getFileName() !== $method->getFileName() - ) { - continue; - } - - $traitImports = array_merge($traitImports, $this->phpParser->parseUseStatements($trait)); - } - - return array_merge($classImports, $traitImports); - } - - /** - * Retrieves imports for properties. - * - * @return array - */ - private function getPropertyImports(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $classImports = $this->getImports($class); - - $traitImports = []; - - foreach ($class->getTraits() as $trait) { - if (! $trait->hasProperty($property->getName())) { - continue; - } - - $traitImports = array_merge($traitImports, $this->phpParser->parseUseStatements($trait)); - } - - return array_merge($classImports, $traitImports); - } - - /** - * Collects parsing metadata for a given class or function. - * - * @param ReflectionClass|ReflectionFunction $reflection - */ - private function collectParsingMetadata($reflection): void - { - $type = $reflection instanceof ReflectionClass ? 'class' : 'function'; - $name = $reflection->getName(); - - $ignoredAnnotationNames = self::$globalIgnoredNames; - $annotations = $this->preParser->parse($reflection->getDocComment(), $type . ' ' . $name); - - foreach ($annotations as $annotation) { - if (! ($annotation instanceof IgnoreAnnotation)) { - continue; - } - - foreach ($annotation->names as $annot) { - $ignoredAnnotationNames[$annot] = true; - } - } - - $this->imports[$type][$name] = array_merge( - self::$globalImports, - $this->phpParser->parseUseStatements($reflection), - [ - '__NAMESPACE__' => $reflection->getNamespaceName(), - 'self' => $name, - ] - ); - - $this->ignoredAnnotationNames[$type][$name] = $ignoredAnnotationNames; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php deleted file mode 100644 index 259d497..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php +++ /dev/null @@ -1,190 +0,0 @@ -|null $dirs - */ - public static function registerAutoloadNamespace(string $namespace, $dirs = null): void - { - self::$autoloadNamespaces[$namespace] = $dirs; - } - - /** - * Registers multiple namespaces. - * - * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm. - * - * @deprecated This method is deprecated and will be removed in - * doctrine/annotations 2.0. Annotations will be autoloaded in 2.0. - * - * @param string[][]|string[]|null[] $namespaces indexed by namespace name - */ - public static function registerAutoloadNamespaces(array $namespaces): void - { - self::$autoloadNamespaces = array_merge(self::$autoloadNamespaces, $namespaces); - } - - /** - * Registers an autoloading callable for annotations, much like spl_autoload_register(). - * - * NOTE: These class loaders HAVE to be silent when a class was not found! - * IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class. - * - * @deprecated This method is deprecated and will be removed in - * doctrine/annotations 2.0. Annotations will be autoloaded in 2.0. - */ - public static function registerLoader(callable $callable): void - { - // Reset our static cache now that we have a new loader to work with - self::$failedToAutoload = []; - self::$loaders[] = $callable; - } - - /** - * Registers an autoloading callable for annotations, if it is not already registered - * - * @deprecated This method is deprecated and will be removed in - * doctrine/annotations 2.0. Annotations will be autoloaded in 2.0. - */ - public static function registerUniqueLoader(callable $callable): void - { - if (in_array($callable, self::$loaders, true)) { - return; - } - - self::registerLoader($callable); - } - - /** - * Autoloads an annotation class silently. - */ - public static function loadAnnotationClass(string $class): bool - { - if (class_exists($class, false)) { - return true; - } - - if (array_key_exists($class, self::$failedToAutoload)) { - return false; - } - - foreach (self::$autoloadNamespaces as $namespace => $dirs) { - if (strpos($class, $namespace) !== 0) { - continue; - } - - $file = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; - - if ($dirs === null) { - $path = stream_resolve_include_path($file); - if ($path) { - require $path; - - return true; - } - } else { - foreach ((array) $dirs as $dir) { - if (is_file($dir . DIRECTORY_SEPARATOR . $file)) { - require $dir . DIRECTORY_SEPARATOR . $file; - - return true; - } - } - } - } - - foreach (self::$loaders as $loader) { - if ($loader($class) === true) { - return true; - } - } - - if ( - self::$loaders === [] && - self::$autoloadNamespaces === [] && - self::$registerFileUsed === false && - class_exists($class) - ) { - return true; - } - - self::$failedToAutoload[$class] = null; - - return false; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php deleted file mode 100644 index 91fbad0..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php +++ /dev/null @@ -1,264 +0,0 @@ -> */ - private $loadedAnnotations = []; - - /** @var int[] */ - private $loadedFilemtimes = []; - - /** - * @param bool $debug - */ - public function __construct(Reader $reader, Cache $cache, $debug = false) - { - $this->delegate = $reader; - $this->cache = $cache; - $this->debug = (bool) $debug; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - $cacheKey = $class->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - $annots = $this->fetchFromCache($cacheKey, $class); - if ($annots === false) { - $annots = $this->delegate->getClassAnnotations($class); - $this->saveToCache($cacheKey, $annots); - } - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $cacheKey = $class->getName() . '$' . $property->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - $annots = $this->fetchFromCache($cacheKey, $class); - if ($annots === false) { - $annots = $this->delegate->getPropertyAnnotations($property); - $this->saveToCache($cacheKey, $annots); - } - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $cacheKey = $class->getName() . '#' . $method->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - $annots = $this->fetchFromCache($cacheKey, $class); - if ($annots === false) { - $annots = $this->delegate->getMethodAnnotations($method); - $this->saveToCache($cacheKey, $annots); - } - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * Clears loaded annotations. - * - * @return void - */ - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = []; - $this->loadedFilemtimes = []; - } - - /** - * Fetches a value from the cache. - * - * @param string $cacheKey The cache key. - * - * @return mixed The cached value or false when the value is not in cache. - */ - private function fetchFromCache($cacheKey, ReflectionClass $class) - { - $data = $this->cache->fetch($cacheKey); - if ($data !== false) { - if (! $this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - return false; - } - - /** - * Saves a value to the cache. - * - * @param string $cacheKey The cache key. - * @param mixed $value The value. - * - * @return void - */ - private function saveToCache($cacheKey, $value) - { - $this->cache->save($cacheKey, $value); - if (! $this->debug) { - return; - } - - $this->cache->save('[C]' . $cacheKey, time()); - } - - /** - * Checks if the cache is fresh. - * - * @param string $cacheKey - * - * @return bool - */ - private function isCacheFresh($cacheKey, ReflectionClass $class) - { - $lastModification = $this->getLastModification($class); - if ($lastModification === 0) { - return true; - } - - return $this->cache->fetch('[C]' . $cacheKey) >= $lastModification; - } - - /** - * Returns the time the class was last modified, testing traits and parents - */ - private function getLastModification(ReflectionClass $class): int - { - $filename = $class->getFileName(); - - if (isset($this->loadedFilemtimes[$filename])) { - return $this->loadedFilemtimes[$filename]; - } - - $parent = $class->getParentClass(); - - $lastModification = max(array_merge( - [$filename ? filemtime($filename) : 0], - array_map(function (ReflectionClass $reflectionTrait): int { - return $this->getTraitLastModificationTime($reflectionTrait); - }, $class->getTraits()), - array_map(function (ReflectionClass $class): int { - return $this->getLastModification($class); - }, $class->getInterfaces()), - $parent ? [$this->getLastModification($parent)] : [] - )); - - assert($lastModification !== false); - - return $this->loadedFilemtimes[$filename] = $lastModification; - } - - private function getTraitLastModificationTime(ReflectionClass $reflectionTrait): int - { - $fileName = $reflectionTrait->getFileName(); - - if (isset($this->loadedFilemtimes[$fileName])) { - return $this->loadedFilemtimes[$fileName]; - } - - $lastModificationTime = max(array_merge( - [$fileName ? filemtime($fileName) : 0], - array_map(function (ReflectionClass $reflectionTrait): int { - return $this->getTraitLastModificationTime($reflectionTrait); - }, $reflectionTrait->getTraits()) - )); - - assert($lastModificationTime !== false); - - return $this->loadedFilemtimes[$fileName] = $lastModificationTime; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php deleted file mode 100644 index f6567c5..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php +++ /dev/null @@ -1,129 +0,0 @@ -= 100 - public const T_IDENTIFIER = 100; - public const T_AT = 101; - public const T_CLOSE_CURLY_BRACES = 102; - public const T_CLOSE_PARENTHESIS = 103; - public const T_COMMA = 104; - public const T_EQUALS = 105; - public const T_FALSE = 106; - public const T_NAMESPACE_SEPARATOR = 107; - public const T_OPEN_CURLY_BRACES = 108; - public const T_OPEN_PARENTHESIS = 109; - public const T_TRUE = 110; - public const T_NULL = 111; - public const T_COLON = 112; - public const T_MINUS = 113; - - /** @var array */ - protected $noCase = [ - '@' => self::T_AT, - ',' => self::T_COMMA, - '(' => self::T_OPEN_PARENTHESIS, - ')' => self::T_CLOSE_PARENTHESIS, - '{' => self::T_OPEN_CURLY_BRACES, - '}' => self::T_CLOSE_CURLY_BRACES, - '=' => self::T_EQUALS, - ':' => self::T_COLON, - '-' => self::T_MINUS, - '\\' => self::T_NAMESPACE_SEPARATOR, - ]; - - /** @var array */ - protected $withCase = [ - 'true' => self::T_TRUE, - 'false' => self::T_FALSE, - 'null' => self::T_NULL, - ]; - - /** - * Whether the next token starts immediately, or if there were - * non-captured symbols before that - */ - public function nextTokenIsAdjacent(): bool - { - return $this->token === null - || ($this->lookahead !== null - && ($this->lookahead['position'] - $this->token['position']) === strlen($this->token['value'])); - } - - /** - * {@inheritdoc} - */ - protected function getCatchablePatterns() - { - return [ - '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*', - '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', - '"(?:""|[^"])*+"', - ]; - } - - /** - * {@inheritdoc} - */ - protected function getNonCatchablePatterns() - { - return ['\s+', '\*+', '(.)']; - } - - /** - * {@inheritdoc} - */ - protected function getType(&$value) - { - $type = self::T_NONE; - - if ($value[0] === '"') { - $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2)); - - return self::T_STRING; - } - - if (isset($this->noCase[$value])) { - return $this->noCase[$value]; - } - - if ($value[0] === '_' || $value[0] === '\\' || ctype_alpha($value[0])) { - return self::T_IDENTIFIER; - } - - $lowerValue = strtolower($value); - - if (isset($this->withCase[$lowerValue])) { - return $this->withCase[$lowerValue]; - } - - // Checking numeric value - if (is_numeric($value)) { - return strpos($value, '.') !== false || stripos($value, 'e') !== false - ? self::T_FLOAT : self::T_INTEGER; - } - - return $type; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php deleted file mode 100644 index ae530c5..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php +++ /dev/null @@ -1,1459 +0,0 @@ - - */ - private static $classIdentifiers = [ - DocLexer::T_IDENTIFIER, - DocLexer::T_TRUE, - DocLexer::T_FALSE, - DocLexer::T_NULL, - ]; - - /** - * The lexer. - * - * @var DocLexer - */ - private $lexer; - - /** - * Current target context. - * - * @var int - */ - private $target; - - /** - * Doc parser used to collect annotation target. - * - * @var DocParser - */ - private static $metadataParser; - - /** - * Flag to control if the current annotation is nested or not. - * - * @var bool - */ - private $isNestedAnnotation = false; - - /** - * Hashmap containing all use-statements that are to be used when parsing - * the given doc block. - * - * @var array - */ - private $imports = []; - - /** - * This hashmap is used internally to cache results of class_exists() - * look-ups. - * - * @var array - */ - private $classExists = []; - - /** - * Whether annotations that have not been imported should be ignored. - * - * @var bool - */ - private $ignoreNotImportedAnnotations = false; - - /** - * An array of default namespaces if operating in simple mode. - * - * @var string[] - */ - private $namespaces = []; - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names must be the raw names as used in the class, not the fully qualified - * - * @var bool[] indexed by annotation name - */ - private $ignoredAnnotationNames = []; - - /** - * A list with annotations in namespaced format - * that are not causing exceptions when not resolved to an annotation class. - * - * @var bool[] indexed by namespace name - */ - private $ignoredAnnotationNamespaces = []; - - /** @var string */ - private $context = ''; - - /** - * Hash-map for caching annotation metadata. - * - * @var array - */ - private static $annotationMetadata = [ - Annotation\Target::class => [ - 'is_annotation' => true, - 'has_constructor' => true, - 'has_named_argument_constructor' => false, - 'properties' => [], - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'attribute_types' => [ - 'value' => [ - 'required' => false, - 'type' => 'array', - 'array_type' => 'string', - 'value' => 'array', - ], - ], - ], - Annotation\Attribute::class => [ - 'is_annotation' => true, - 'has_constructor' => false, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_ANNOTATION', - 'targets' => Target::TARGET_ANNOTATION, - 'default_property' => 'name', - 'properties' => [ - 'name' => 'name', - 'type' => 'type', - 'required' => 'required', - ], - 'attribute_types' => [ - 'value' => [ - 'required' => true, - 'type' => 'string', - 'value' => 'string', - ], - 'type' => [ - 'required' => true, - 'type' => 'string', - 'value' => 'string', - ], - 'required' => [ - 'required' => false, - 'type' => 'boolean', - 'value' => 'boolean', - ], - ], - ], - Annotation\Attributes::class => [ - 'is_annotation' => true, - 'has_constructor' => false, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'properties' => ['value' => 'value'], - 'attribute_types' => [ - 'value' => [ - 'type' => 'array', - 'required' => true, - 'array_type' => Annotation\Attribute::class, - 'value' => 'array<' . Annotation\Attribute::class . '>', - ], - ], - ], - Annotation\Enum::class => [ - 'is_annotation' => true, - 'has_constructor' => true, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_PROPERTY', - 'targets' => Target::TARGET_PROPERTY, - 'default_property' => 'value', - 'properties' => ['value' => 'value'], - 'attribute_types' => [ - 'value' => [ - 'type' => 'array', - 'required' => true, - ], - 'literal' => [ - 'type' => 'array', - 'required' => false, - ], - ], - ], - Annotation\NamedArgumentConstructor::class => [ - 'is_annotation' => true, - 'has_constructor' => false, - 'has_named_argument_constructor' => false, - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => null, - 'properties' => [], - 'attribute_types' => [], - ], - ]; - - /** - * Hash-map for handle types declaration. - * - * @var array - */ - private static $typeMap = [ - 'float' => 'double', - 'bool' => 'boolean', - // allow uppercase Boolean in honor of George Boole - 'Boolean' => 'boolean', - 'int' => 'integer', - ]; - - /** - * Constructs a new DocParser. - */ - public function __construct() - { - $this->lexer = new DocLexer(); - } - - /** - * Sets the annotation names that are ignored during the parsing process. - * - * The names are supposed to be the raw names as used in the class, not the - * fully qualified class names. - * - * @param bool[] $names indexed by annotation name - * - * @return void - */ - public function setIgnoredAnnotationNames(array $names) - { - $this->ignoredAnnotationNames = $names; - } - - /** - * Sets the annotation namespaces that are ignored during the parsing process. - * - * @param bool[] $ignoredAnnotationNamespaces indexed by annotation namespace name - * - * @return void - */ - public function setIgnoredAnnotationNamespaces($ignoredAnnotationNamespaces) - { - $this->ignoredAnnotationNamespaces = $ignoredAnnotationNamespaces; - } - - /** - * Sets ignore on not-imported annotations. - * - * @param bool $bool - * - * @return void - */ - public function setIgnoreNotImportedAnnotations($bool) - { - $this->ignoreNotImportedAnnotations = (bool) $bool; - } - - /** - * Sets the default namespaces. - * - * @param string $namespace - * - * @return void - * - * @throws RuntimeException - */ - public function addNamespace($namespace) - { - if ($this->imports) { - throw new RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - - $this->namespaces[] = $namespace; - } - - /** - * Sets the imports. - * - * @param array $imports - * - * @return void - * - * @throws RuntimeException - */ - public function setImports(array $imports) - { - if ($this->namespaces) { - throw new RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - - $this->imports = $imports; - } - - /** - * Sets current target context as bitmask. - * - * @param int $target - * - * @return void - */ - public function setTarget($target) - { - $this->target = $target; - } - - /** - * Parses the given docblock string for annotations. - * - * @param string $input The docblock string to parse. - * @param string $context The parsing context. - * - * @throws AnnotationException - * @throws ReflectionException - * - * @phpstan-return list Array of annotations. If no annotations are found, an empty array is returned. - */ - public function parse($input, $context = '') - { - $pos = $this->findInitialTokenPosition($input); - if ($pos === null) { - return []; - } - - $this->context = $context; - - $this->lexer->setInput(trim(substr($input, $pos), '* /')); - $this->lexer->moveNext(); - - return $this->Annotations(); - } - - /** - * Finds the first valid annotation - * - * @param string $input The docblock string to parse - */ - private function findInitialTokenPosition($input): ?int - { - $pos = 0; - - // search for first valid annotation - while (($pos = strpos($input, '@', $pos)) !== false) { - $preceding = substr($input, $pos - 1, 1); - - // if the @ is preceded by a space, a tab or * it is valid - if ($pos === 0 || $preceding === ' ' || $preceding === '*' || $preceding === "\t") { - return $pos; - } - - $pos++; - } - - return null; - } - - /** - * Attempts to match the given token with the current lookahead token. - * If they match, updates the lookahead token; otherwise raises a syntax error. - * - * @param int $token Type of token. - * - * @return bool True if tokens match; false otherwise. - * - * @throws AnnotationException - */ - private function match(int $token): bool - { - if (! $this->lexer->isNextToken($token)) { - throw $this->syntaxError($this->lexer->getLiteral($token)); - } - - return $this->lexer->moveNext(); - } - - /** - * Attempts to match the current lookahead token with any of the given tokens. - * - * If any of them matches, this method updates the lookahead token; otherwise - * a syntax error is raised. - * - * @throws AnnotationException - * - * @phpstan-param list $tokens - */ - private function matchAny(array $tokens): bool - { - if (! $this->lexer->isNextTokenAny($tokens)) { - throw $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens))); - } - - return $this->lexer->moveNext(); - } - - /** - * Generates a new syntax error. - * - * @param string $expected Expected string. - * @param mixed[]|null $token Optional token. - */ - private function syntaxError(string $expected, ?array $token = null): AnnotationException - { - if ($token === null) { - $token = $this->lexer->lookahead; - } - - $message = sprintf('Expected %s, got ', $expected); - $message .= $this->lexer->lookahead === null - ? 'end of string' - : sprintf("'%s' at position %s", $token['value'], $token['position']); - - if (strlen($this->context)) { - $message .= ' in ' . $this->context; - } - - $message .= '.'; - - return AnnotationException::syntaxError($message); - } - - /** - * Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism - * but uses the {@link AnnotationRegistry} to load classes. - * - * @param class-string $fqcn - */ - private function classExists(string $fqcn): bool - { - if (isset($this->classExists[$fqcn])) { - return $this->classExists[$fqcn]; - } - - // first check if the class already exists, maybe loaded through another AnnotationReader - if (class_exists($fqcn, false)) { - return $this->classExists[$fqcn] = true; - } - - // final check, does this class exist? - return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn); - } - - /** - * Collects parsing metadata for a given annotation class - * - * @param class-string $name The annotation name - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function collectAnnotationMetadata(string $name): void - { - if (self::$metadataParser === null) { - self::$metadataParser = new self(); - - self::$metadataParser->setIgnoreNotImportedAnnotations(true); - self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames); - self::$metadataParser->setImports([ - 'enum' => Enum::class, - 'target' => Target::class, - 'attribute' => Attribute::class, - 'attributes' => Attributes::class, - 'namedargumentconstructor' => NamedArgumentConstructor::class, - ]); - - // Make sure that annotations from metadata are loaded - class_exists(Enum::class); - class_exists(Target::class); - class_exists(Attribute::class); - class_exists(Attributes::class); - class_exists(NamedArgumentConstructor::class); - } - - $class = new ReflectionClass($name); - $docComment = $class->getDocComment(); - - // Sets default values for annotation metadata - $constructor = $class->getConstructor(); - $metadata = [ - 'default_property' => null, - 'has_constructor' => $constructor !== null && $constructor->getNumberOfParameters() > 0, - 'constructor_args' => [], - 'properties' => [], - 'property_types' => [], - 'attribute_types' => [], - 'targets_literal' => null, - 'targets' => Target::TARGET_ALL, - 'is_annotation' => strpos($docComment, '@Annotation') !== false, - ]; - - $metadata['has_named_argument_constructor'] = $metadata['has_constructor'] - && $class->implementsInterface(NamedArgumentConstructorAnnotation::class); - - // verify that the class is really meant to be an annotation - if ($metadata['is_annotation']) { - self::$metadataParser->setTarget(Target::TARGET_CLASS); - - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { - if ($annotation instanceof Target) { - $metadata['targets'] = $annotation->targets; - $metadata['targets_literal'] = $annotation->literal; - - continue; - } - - if ($annotation instanceof NamedArgumentConstructor) { - $metadata['has_named_argument_constructor'] = $metadata['has_constructor']; - if ($metadata['has_named_argument_constructor']) { - // choose the first argument as the default property - $metadata['default_property'] = $constructor->getParameters()[0]->getName(); - } - } - - if (! ($annotation instanceof Attributes)) { - continue; - } - - foreach ($annotation->value as $attribute) { - $this->collectAttributeTypeMetadata($metadata, $attribute); - } - } - - // if not has a constructor will inject values into public properties - if ($metadata['has_constructor'] === false) { - // collect all public properties - foreach ($class->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { - $metadata['properties'][$property->name] = $property->name; - - $propertyComment = $property->getDocComment(); - if ($propertyComment === false) { - continue; - } - - $attribute = new Attribute(); - - $attribute->required = (strpos($propertyComment, '@Required') !== false); - $attribute->name = $property->name; - $attribute->type = (strpos($propertyComment, '@var') !== false && - preg_match('/@var\s+([^\s]+)/', $propertyComment, $matches)) - ? $matches[1] - : 'mixed'; - - $this->collectAttributeTypeMetadata($metadata, $attribute); - - // checks if the property has @Enum - if (strpos($propertyComment, '@Enum') === false) { - continue; - } - - $context = 'property ' . $class->name . '::$' . $property->name; - - self::$metadataParser->setTarget(Target::TARGET_PROPERTY); - - foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) { - if (! $annotation instanceof Enum) { - continue; - } - - $metadata['enum'][$property->name]['value'] = $annotation->value; - $metadata['enum'][$property->name]['literal'] = (! empty($annotation->literal)) - ? $annotation->literal - : $annotation->value; - } - } - - // choose the first property as default property - $metadata['default_property'] = reset($metadata['properties']); - } elseif ($metadata['has_named_argument_constructor']) { - foreach ($constructor->getParameters() as $parameter) { - $metadata['constructor_args'][$parameter->getName()] = [ - 'position' => $parameter->getPosition(), - 'default' => $parameter->isOptional() ? $parameter->getDefaultValue() : null, - ]; - } - } - } - - self::$annotationMetadata[$name] = $metadata; - } - - /** - * Collects parsing metadata for a given attribute. - * - * @param mixed[] $metadata - */ - private function collectAttributeTypeMetadata(array &$metadata, Attribute $attribute): void - { - // handle internal type declaration - $type = self::$typeMap[$attribute->type] ?? $attribute->type; - - // handle the case if the property type is mixed - if ($type === 'mixed') { - return; - } - - // Evaluate type - $pos = strpos($type, '<'); - if ($pos !== false) { - // Checks if the property has array - $arrayType = substr($type, $pos + 1, -1); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType; - } else { - // Checks if the property has type[] - $pos = strrpos($type, '['); - if ($pos !== false) { - $arrayType = substr($type, 0, $pos); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType; - } - } - - $metadata['attribute_types'][$attribute->name]['type'] = $type; - $metadata['attribute_types'][$attribute->name]['value'] = $attribute->type; - $metadata['attribute_types'][$attribute->name]['required'] = $attribute->required; - } - - /** - * Annotations ::= Annotation {[ "*" ]* [Annotation]}* - * - * @throws AnnotationException - * @throws ReflectionException - * - * @phpstan-return list - */ - private function Annotations(): array - { - $annotations = []; - - while ($this->lexer->lookahead !== null) { - if ($this->lexer->lookahead['type'] !== DocLexer::T_AT) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is preceded by non-catchable pattern - if ( - $this->lexer->token !== null && - $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen( - $this->lexer->token['value'] - ) - ) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is followed by either a namespace separator, or - // an identifier token - $peek = $this->lexer->glimpse(); - if ( - ($peek === null) - || ($peek['type'] !== DocLexer::T_NAMESPACE_SEPARATOR && ! in_array( - $peek['type'], - self::$classIdentifiers, - true - )) - || $peek['position'] !== $this->lexer->lookahead['position'] + 1 - ) { - $this->lexer->moveNext(); - continue; - } - - $this->isNestedAnnotation = false; - $annot = $this->Annotation(); - if ($annot === false) { - continue; - } - - $annotations[] = $annot; - } - - return $annotations; - } - - /** - * Annotation ::= "@" AnnotationName MethodCall - * AnnotationName ::= QualifiedName | SimpleName - * QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName - * NameSpacePart ::= identifier | null | false | true - * SimpleName ::= identifier | null | false | true - * - * @return object|false False if it is not a valid annotation. - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Annotation() - { - $this->match(DocLexer::T_AT); - - // check if we have an annotation - $name = $this->Identifier(); - - if ( - $this->lexer->isNextToken(DocLexer::T_MINUS) - && $this->lexer->nextTokenIsAdjacent() - ) { - // Annotations with dashes, such as "@foo-" or "@foo-bar", are to be discarded - return false; - } - - // only process names which are not fully qualified, yet - // fully qualified names must start with a \ - $originalName = $name; - - if ($name[0] !== '\\') { - $pos = strpos($name, '\\'); - $alias = ($pos === false) ? $name : substr($name, 0, $pos); - $found = false; - $loweredAlias = strtolower($alias); - - if ($this->namespaces) { - foreach ($this->namespaces as $namespace) { - if ($this->classExists($namespace . '\\' . $name)) { - $name = $namespace . '\\' . $name; - $found = true; - break; - } - } - } elseif (isset($this->imports[$loweredAlias])) { - $namespace = ltrim($this->imports[$loweredAlias], '\\'); - $name = ($pos !== false) - ? $namespace . substr($name, $pos) - : $namespace; - $found = $this->classExists($name); - } elseif ( - ! isset($this->ignoredAnnotationNames[$name]) - && isset($this->imports['__NAMESPACE__']) - && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name) - ) { - $name = $this->imports['__NAMESPACE__'] . '\\' . $name; - $found = true; - } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { - $found = true; - } - - if (! $found) { - if ($this->isIgnoredAnnotation($name)) { - return false; - } - - throw AnnotationException::semanticalError(sprintf( - <<<'EXCEPTION' -The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation? -EXCEPTION - , - $name, - $this->context - )); - } - } - - $name = ltrim($name, '\\'); - - if (! $this->classExists($name)) { - throw AnnotationException::semanticalError(sprintf( - 'The annotation "@%s" in %s does not exist, or could not be auto-loaded.', - $name, - $this->context - )); - } - - // at this point, $name contains the fully qualified class name of the - // annotation, and it is also guaranteed that this class exists, and - // that it is loaded - - // collects the metadata annotation only if there is not yet - if (! isset(self::$annotationMetadata[$name])) { - $this->collectAnnotationMetadata($name); - } - - // verify that the class is really meant to be an annotation and not just any ordinary class - if (self::$annotationMetadata[$name]['is_annotation'] === false) { - if ($this->isIgnoredAnnotation($originalName) || $this->isIgnoredAnnotation($name)) { - return false; - } - - throw AnnotationException::semanticalError(sprintf( - <<<'EXCEPTION' -The class "%s" is not annotated with @Annotation. -Are you sure this class can be used as annotation? -If so, then you need to add @Annotation to the _class_ doc comment of "%s". -If it is indeed no annotation, then you need to add @IgnoreAnnotation("%s") to the _class_ doc comment of %s. -EXCEPTION - , - $name, - $name, - $originalName, - $this->context - )); - } - - //if target is nested annotation - $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target; - - // Next will be nested - $this->isNestedAnnotation = true; - - //if annotation does not support current target - if ((self::$annotationMetadata[$name]['targets'] & $target) === 0 && $target) { - throw AnnotationException::semanticalError( - sprintf( - <<<'EXCEPTION' -Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s. -EXCEPTION - , - $originalName, - $this->context, - self::$annotationMetadata[$name]['targets_literal'] - ) - ); - } - - $arguments = $this->MethodCall(); - $values = $this->resolvePositionalValues($arguments, $name); - - if (isset(self::$annotationMetadata[$name]['enum'])) { - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) { - // checks if the attribute is a valid enumerator - if (isset($values[$property]) && ! in_array($values[$property], $enum['value'])) { - throw AnnotationException::enumeratorError( - $property, - $name, - $this->context, - $enum['literal'], - $values[$property] - ); - } - } - } - - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) { - if ( - $property === self::$annotationMetadata[$name]['default_property'] - && ! isset($values[$property]) && isset($values['value']) - ) { - $property = 'value'; - } - - // handle a not given attribute or null value - if (! isset($values[$property])) { - if ($type['required']) { - throw AnnotationException::requiredError( - $property, - $originalName, - $this->context, - 'a(n) ' . $type['value'] - ); - } - - continue; - } - - if ($type['type'] === 'array') { - // handle the case of a single value - if (! is_array($values[$property])) { - $values[$property] = [$values[$property]]; - } - - // checks if the attribute has array type declaration, such as "array" - if (isset($type['array_type'])) { - foreach ($values[$property] as $item) { - if (gettype($item) !== $type['array_type'] && ! $item instanceof $type['array_type']) { - throw AnnotationException::attributeTypeError( - $property, - $originalName, - $this->context, - 'either a(n) ' . $type['array_type'] . ', or an array of ' . $type['array_type'] . 's', - $item - ); - } - } - } - } elseif (gettype($values[$property]) !== $type['type'] && ! $values[$property] instanceof $type['type']) { - throw AnnotationException::attributeTypeError( - $property, - $originalName, - $this->context, - 'a(n) ' . $type['value'], - $values[$property] - ); - } - } - - if (self::$annotationMetadata[$name]['has_named_argument_constructor']) { - if (PHP_VERSION_ID >= 80000) { - return new $name(...$values); - } - - $positionalValues = []; - foreach (self::$annotationMetadata[$name]['constructor_args'] as $property => $parameter) { - $positionalValues[$parameter['position']] = $parameter['default']; - } - - foreach ($values as $property => $value) { - if (! isset(self::$annotationMetadata[$name]['constructor_args'][$property])) { - throw AnnotationException::creationError(sprintf( - <<<'EXCEPTION' -The annotation @%s declared on %s does not have a property named "%s" -that can be set through its named arguments constructor. -Available named arguments: %s -EXCEPTION - , - $originalName, - $this->context, - $property, - implode(', ', array_keys(self::$annotationMetadata[$name]['constructor_args'])) - )); - } - - $positionalValues[self::$annotationMetadata[$name]['constructor_args'][$property]['position']] = $value; - } - - return new $name(...$positionalValues); - } - - // check if the annotation expects values via the constructor, - // or directly injected into public properties - if (self::$annotationMetadata[$name]['has_constructor'] === true) { - return new $name($values); - } - - $instance = new $name(); - - foreach ($values as $property => $value) { - if (! isset(self::$annotationMetadata[$name]['properties'][$property])) { - if ($property !== 'value') { - throw AnnotationException::creationError(sprintf( - <<<'EXCEPTION' -The annotation @%s declared on %s does not have a property named "%s". -Available properties: %s -EXCEPTION - , - $originalName, - $this->context, - $property, - implode(', ', self::$annotationMetadata[$name]['properties']) - )); - } - - // handle the case if the property has no annotations - $property = self::$annotationMetadata[$name]['default_property']; - if (! $property) { - throw AnnotationException::creationError(sprintf( - 'The annotation @%s declared on %s does not accept any values, but got %s.', - $originalName, - $this->context, - json_encode($values) - )); - } - } - - $instance->{$property} = $value; - } - - return $instance; - } - - /** - * MethodCall ::= ["(" [Values] ")"] - * - * @return mixed[] - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function MethodCall(): array - { - $values = []; - - if (! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { - return $values; - } - - $this->match(DocLexer::T_OPEN_PARENTHESIS); - - if (! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - $values = $this->Values(); - } - - $this->match(DocLexer::T_CLOSE_PARENTHESIS); - - return $values; - } - - /** - * Values ::= Array | Value {"," Value}* [","] - * - * @return mixed[] - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Values(): array - { - $values = [$this->Value()]; - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - break; - } - - $token = $this->lexer->lookahead; - $value = $this->Value(); - - $values[] = $value; - } - - $namedArguments = []; - $positionalArguments = []; - foreach ($values as $k => $value) { - if (is_object($value) && $value instanceof stdClass) { - $namedArguments[$value->name] = $value->value; - } else { - $positionalArguments[$k] = $value; - } - } - - return ['named_arguments' => $namedArguments, 'positional_arguments' => $positionalArguments]; - } - - /** - * Constant ::= integer | string | float | boolean - * - * @return mixed - * - * @throws AnnotationException - */ - private function Constant() - { - $identifier = $this->Identifier(); - - if (! defined($identifier) && strpos($identifier, '::') !== false && $identifier[0] !== '\\') { - [$className, $const] = explode('::', $identifier); - - $pos = strpos($className, '\\'); - $alias = ($pos === false) ? $className : substr($className, 0, $pos); - $found = false; - $loweredAlias = strtolower($alias); - - switch (true) { - case ! empty($this->namespaces): - foreach ($this->namespaces as $ns) { - if (class_exists($ns . '\\' . $className) || interface_exists($ns . '\\' . $className)) { - $className = $ns . '\\' . $className; - $found = true; - break; - } - } - - break; - - case isset($this->imports[$loweredAlias]): - $found = true; - $className = ($pos !== false) - ? $this->imports[$loweredAlias] . substr($className, $pos) - : $this->imports[$loweredAlias]; - break; - - default: - if (isset($this->imports['__NAMESPACE__'])) { - $ns = $this->imports['__NAMESPACE__']; - - if (class_exists($ns . '\\' . $className) || interface_exists($ns . '\\' . $className)) { - $className = $ns . '\\' . $className; - $found = true; - } - } - - break; - } - - if ($found) { - $identifier = $className . '::' . $const; - } - } - - /** - * Checks if identifier ends with ::class and remove the leading backslash if it exists. - */ - if ( - $this->identifierEndsWithClassConstant($identifier) && - ! $this->identifierStartsWithBackslash($identifier) - ) { - return substr($identifier, 0, $this->getClassConstantPositionInIdentifier($identifier)); - } - - if ($this->identifierEndsWithClassConstant($identifier) && $this->identifierStartsWithBackslash($identifier)) { - return substr($identifier, 1, $this->getClassConstantPositionInIdentifier($identifier) - 1); - } - - if (! defined($identifier)) { - throw AnnotationException::semanticalErrorConstants($identifier, $this->context); - } - - return constant($identifier); - } - - private function identifierStartsWithBackslash(string $identifier): bool - { - return $identifier[0] === '\\'; - } - - private function identifierEndsWithClassConstant(string $identifier): bool - { - return $this->getClassConstantPositionInIdentifier($identifier) === strlen($identifier) - strlen('::class'); - } - - /** - * @return int|false - */ - private function getClassConstantPositionInIdentifier(string $identifier) - { - return stripos($identifier, '::class'); - } - - /** - * Identifier ::= string - * - * @throws AnnotationException - */ - private function Identifier(): string - { - // check if we have an annotation - if (! $this->lexer->isNextTokenAny(self::$classIdentifiers)) { - throw $this->syntaxError('namespace separator or identifier'); - } - - $this->lexer->moveNext(); - - $className = $this->lexer->token['value']; - - while ( - $this->lexer->lookahead !== null && - $this->lexer->lookahead['position'] === ($this->lexer->token['position'] + - strlen($this->lexer->token['value'])) && - $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR) - ) { - $this->match(DocLexer::T_NAMESPACE_SEPARATOR); - $this->matchAny(self::$classIdentifiers); - - $className .= '\\' . $this->lexer->token['value']; - } - - return $className; - } - - /** - * Value ::= PlainValue | FieldAssignment - * - * @return mixed - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Value() - { - $peek = $this->lexer->glimpse(); - - if ($peek['type'] === DocLexer::T_EQUALS) { - return $this->FieldAssignment(); - } - - return $this->PlainValue(); - } - - /** - * PlainValue ::= integer | string | float | boolean | Array | Annotation - * - * @return mixed - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function PlainValue() - { - if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { - return $this->Arrayx(); - } - - if ($this->lexer->isNextToken(DocLexer::T_AT)) { - return $this->Annotation(); - } - - if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) { - return $this->Constant(); - } - - switch ($this->lexer->lookahead['type']) { - case DocLexer::T_STRING: - $this->match(DocLexer::T_STRING); - - return $this->lexer->token['value']; - - case DocLexer::T_INTEGER: - $this->match(DocLexer::T_INTEGER); - - return (int) $this->lexer->token['value']; - - case DocLexer::T_FLOAT: - $this->match(DocLexer::T_FLOAT); - - return (float) $this->lexer->token['value']; - - case DocLexer::T_TRUE: - $this->match(DocLexer::T_TRUE); - - return true; - - case DocLexer::T_FALSE: - $this->match(DocLexer::T_FALSE); - - return false; - - case DocLexer::T_NULL: - $this->match(DocLexer::T_NULL); - - return null; - - default: - throw $this->syntaxError('PlainValue'); - } - } - - /** - * FieldAssignment ::= FieldName "=" PlainValue - * FieldName ::= identifier - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function FieldAssignment(): stdClass - { - $this->match(DocLexer::T_IDENTIFIER); - $fieldName = $this->lexer->token['value']; - - $this->match(DocLexer::T_EQUALS); - - $item = new stdClass(); - $item->name = $fieldName; - $item->value = $this->PlainValue(); - - return $item; - } - - /** - * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}" - * - * @return mixed[] - * - * @throws AnnotationException - * @throws ReflectionException - */ - private function Arrayx(): array - { - $array = $values = []; - - $this->match(DocLexer::T_OPEN_CURLY_BRACES); - - // If the array is empty, stop parsing and return. - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - return $array; - } - - $values[] = $this->ArrayEntry(); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - // optional trailing comma - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - break; - } - - $values[] = $this->ArrayEntry(); - } - - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - foreach ($values as $value) { - [$key, $val] = $value; - - if ($key !== null) { - $array[$key] = $val; - } else { - $array[] = $val; - } - } - - return $array; - } - - /** - * ArrayEntry ::= Value | KeyValuePair - * KeyValuePair ::= Key ("=" | ":") PlainValue | Constant - * Key ::= string | integer | Constant - * - * @throws AnnotationException - * @throws ReflectionException - * - * @phpstan-return array{mixed, mixed} - */ - private function ArrayEntry(): array - { - $peek = $this->lexer->glimpse(); - - if ( - $peek['type'] === DocLexer::T_EQUALS - || $peek['type'] === DocLexer::T_COLON - ) { - if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) { - $key = $this->Constant(); - } else { - $this->matchAny([DocLexer::T_INTEGER, DocLexer::T_STRING]); - $key = $this->lexer->token['value']; - } - - $this->matchAny([DocLexer::T_EQUALS, DocLexer::T_COLON]); - - return [$key, $this->PlainValue()]; - } - - return [null, $this->Value()]; - } - - /** - * Checks whether the given $name matches any ignored annotation name or namespace - */ - private function isIgnoredAnnotation(string $name): bool - { - if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) { - return true; - } - - foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) { - $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\'; - - if (stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace) === 0) { - return true; - } - } - - return false; - } - - /** - * Resolve positional arguments (without name) to named ones - * - * @param array $arguments - * - * @return array - */ - private function resolvePositionalValues(array $arguments, string $name): array - { - $positionalArguments = $arguments['positional_arguments'] ?? []; - $values = $arguments['named_arguments'] ?? []; - - if ( - self::$annotationMetadata[$name]['has_named_argument_constructor'] - && self::$annotationMetadata[$name]['default_property'] !== null - ) { - // We must ensure that we don't have positional arguments after named ones - $positions = array_keys($positionalArguments); - $lastPosition = null; - foreach ($positions as $position) { - if ( - ($lastPosition === null && $position !== 0) || - ($lastPosition !== null && $position !== $lastPosition + 1) - ) { - throw $this->syntaxError('Positional arguments after named arguments is not allowed'); - } - - $lastPosition = $position; - } - - foreach (self::$annotationMetadata[$name]['constructor_args'] as $property => $parameter) { - $position = $parameter['position']; - if (isset($values[$property]) || ! isset($positionalArguments[$position])) { - continue; - } - - $values[$property] = $positionalArguments[$position]; - } - } else { - if (count($positionalArguments) > 0 && ! isset($values['value'])) { - if (count($positionalArguments) === 1) { - $value = array_pop($positionalArguments); - } else { - $value = array_values($positionalArguments); - } - - $values['value'] = $value; - } - } - - return $values; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php deleted file mode 100644 index e6a7a95..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php +++ /dev/null @@ -1,315 +0,0 @@ -> */ - private $loadedAnnotations = []; - - /** @var array */ - private $classNameHashes = []; - - /** @var int */ - private $umask; - - /** - * @param string $cacheDir - * @param bool $debug - * @param int $umask - * - * @throws InvalidArgumentException - */ - public function __construct(Reader $reader, $cacheDir, $debug = false, $umask = 0002) - { - if (! is_int($umask)) { - throw new InvalidArgumentException(sprintf( - 'The parameter umask must be an integer, was: %s', - gettype($umask) - )); - } - - $this->reader = $reader; - $this->umask = $umask; - - if (! is_dir($cacheDir) && ! @mkdir($cacheDir, 0777 & (~$this->umask), true)) { - throw new InvalidArgumentException(sprintf( - 'The directory "%s" does not exist and could not be created.', - $cacheDir - )); - } - - $this->dir = rtrim($cacheDir, '\\/'); - $this->debug = $debug; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - if (! isset($this->classNameHashes[$class->name])) { - $this->classNameHashes[$class->name] = sha1($class->name); - } - - $key = $this->classNameHashes[$class->name]; - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php'; - if (! is_file($path)) { - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - - return $this->loadedAnnotations[$key] = $annot; - } - - $filename = $class->getFilename(); - if ( - $this->debug - && $filename !== false - && filemtime($path) < filemtime($filename) - ) { - @unlink($path); - - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - if (! isset($this->classNameHashes[$class->name])) { - $this->classNameHashes[$class->name] = sha1($class->name); - } - - $key = $this->classNameHashes[$class->name] . '$' . $property->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php'; - if (! is_file($path)) { - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - - return $this->loadedAnnotations[$key] = $annot; - } - - $filename = $class->getFilename(); - if ( - $this->debug - && $filename !== false - && filemtime($path) < filemtime($filename) - ) { - @unlink($path); - - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - if (! isset($this->classNameHashes[$class->name])) { - $this->classNameHashes[$class->name] = sha1($class->name); - } - - $key = $this->classNameHashes[$class->name] . '#' . $method->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php'; - if (! is_file($path)) { - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - - return $this->loadedAnnotations[$key] = $annot; - } - - $filename = $class->getFilename(); - if ( - $this->debug - && $filename !== false - && filemtime($path) < filemtime($filename) - ) { - @unlink($path); - - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - /** - * Saves the cache file. - * - * @param string $path - * @param mixed $data - * - * @return void - */ - private function saveCacheFile($path, $data) - { - if (! is_writable($this->dir)) { - throw new InvalidArgumentException(sprintf( - <<<'EXCEPTION' -The directory "%s" is not writable. Both the webserver and the console user need access. -You can manage access rights for multiple users with "chmod +a". -If your system does not support this, check out the acl package., -EXCEPTION - , - $this->dir - )); - } - - $tempfile = tempnam($this->dir, uniqid('', true)); - - if ($tempfile === false) { - throw new RuntimeException(sprintf('Unable to create tempfile in directory: %s', $this->dir)); - } - - @chmod($tempfile, 0666 & (~$this->umask)); - - $written = file_put_contents( - $tempfile, - 'umask)); - - if (rename($tempfile, $path) === false) { - @unlink($tempfile); - - throw new RuntimeException(sprintf('Unable to rename %s to %s', $tempfile, $path)); - } - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - $annotations = $this->getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Clears loaded annotations. - * - * @return void - */ - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = []; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php deleted file mode 100644 index 52b929d..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php +++ /dev/null @@ -1,171 +0,0 @@ - true, - 'Attribute' => true, - 'Attributes' => true, - /* Can we enable this? 'Enum' => true, */ - 'Required' => true, - 'Target' => true, - ]; - - private const WidelyUsedNonStandard = [ - 'fix' => true, - 'fixme' => true, - 'override' => true, - ]; - - private const PhpDocumentor1 = [ - 'abstract' => true, - 'access' => true, - 'code' => true, - 'deprec' => true, - 'endcode' => true, - 'exception' => true, - 'final' => true, - 'ingroup' => true, - 'inheritdoc' => true, - 'inheritDoc' => true, - 'magic' => true, - 'name' => true, - 'private' => true, - 'static' => true, - 'staticvar' => true, - 'staticVar' => true, - 'toc' => true, - 'tutorial' => true, - 'throw' => true, - ]; - - private const PhpDocumentor2 = [ - 'api' => true, - 'author' => true, - 'category' => true, - 'copyright' => true, - 'deprecated' => true, - 'example' => true, - 'filesource' => true, - 'global' => true, - 'ignore' => true, - /* Can we enable this? 'index' => true, */ - 'internal' => true, - 'license' => true, - 'link' => true, - 'method' => true, - 'package' => true, - 'param' => true, - 'property' => true, - 'property-read' => true, - 'property-write' => true, - 'return' => true, - 'see' => true, - 'since' => true, - 'source' => true, - 'subpackage' => true, - 'throws' => true, - 'todo' => true, - 'TODO' => true, - 'usedby' => true, - 'uses' => true, - 'var' => true, - 'version' => true, - ]; - - private const PHPUnit = [ - 'author' => true, - 'after' => true, - 'afterClass' => true, - 'backupGlobals' => true, - 'backupStaticAttributes' => true, - 'before' => true, - 'beforeClass' => true, - 'codeCoverageIgnore' => true, - 'codeCoverageIgnoreStart' => true, - 'codeCoverageIgnoreEnd' => true, - 'covers' => true, - 'coversDefaultClass' => true, - 'coversNothing' => true, - 'dataProvider' => true, - 'depends' => true, - 'doesNotPerformAssertions' => true, - 'expectedException' => true, - 'expectedExceptionCode' => true, - 'expectedExceptionMessage' => true, - 'expectedExceptionMessageRegExp' => true, - 'group' => true, - 'large' => true, - 'medium' => true, - 'preserveGlobalState' => true, - 'requires' => true, - 'runTestsInSeparateProcesses' => true, - 'runInSeparateProcess' => true, - 'small' => true, - 'test' => true, - 'testdox' => true, - 'testWith' => true, - 'ticket' => true, - 'uses' => true, - ]; - - private const PhpCheckStyle = ['SuppressWarnings' => true]; - - private const PhpStorm = ['noinspection' => true]; - - private const PEAR = ['package_version' => true]; - - private const PlainUML = [ - 'startuml' => true, - 'enduml' => true, - ]; - - private const Symfony = ['experimental' => true]; - - private const PhpCodeSniffer = [ - 'codingStandardsIgnoreStart' => true, - 'codingStandardsIgnoreEnd' => true, - ]; - - private const SlevomatCodingStandard = ['phpcsSuppress' => true]; - - private const PhpStan = [ - 'extends' => true, - 'implements' => true, - 'template' => true, - 'use' => true, - ]; - - private const Phan = ['suppress' => true]; - - private const Rector = ['noRector' => true]; - - public const LIST = self::Reserved - + self::WidelyUsedNonStandard - + self::PhpDocumentor1 - + self::PhpDocumentor2 - + self::PHPUnit - + self::PhpCheckStyle - + self::PhpStorm - + self::PEAR - + self::PlainUML - + self::Symfony - + self::SlevomatCodingStandard - + self::PhpCodeSniffer - + self::PhpStan - + self::Phan - + self::Rector; - - private function __construct() - { - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php deleted file mode 100644 index 42e7076..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php +++ /dev/null @@ -1,100 +0,0 @@ -delegate = $reader; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - $annotations = []; - foreach ($this->delegate->getClassAnnotations($class) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotation) - { - return $this->delegate->getClassAnnotation($class, $annotation); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $annotations = []; - foreach ($this->delegate->getMethodAnnotations($method) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotation) - { - return $this->delegate->getMethodAnnotation($method, $annotation); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $annotations = []; - foreach ($this->delegate->getPropertyAnnotations($property) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotation) - { - return $this->delegate->getPropertyAnnotation($property, $annotation); - } - - /** - * Proxies all methods to the delegate. - * - * @param string $method - * @param mixed[] $args - * - * @return mixed - */ - public function __call($method, $args) - { - return call_user_func_array([$this->delegate, $method], $args); - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/NamedArgumentConstructorAnnotation.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/NamedArgumentConstructorAnnotation.php deleted file mode 100644 index 8af224c..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/NamedArgumentConstructorAnnotation.php +++ /dev/null @@ -1,14 +0,0 @@ -ReflectionClass object. - * - * @return array A list with use statements in the form (Alias => FQN). - */ - public function parseClass(ReflectionClass $class) - { - return $this->parseUseStatements($class); - } - - /** - * Parse a class or function for use statements. - * - * @param ReflectionClass|ReflectionFunction $reflection - * - * @psalm-return array a list with use statements in the form (Alias => FQN). - */ - public function parseUseStatements($reflection): array - { - if (method_exists($reflection, 'getUseStatements')) { - return $reflection->getUseStatements(); - } - - $filename = $reflection->getFileName(); - - if ($filename === false) { - return []; - } - - $content = $this->getFileContent($filename, $reflection->getStartLine()); - - if ($content === null) { - return []; - } - - $namespace = preg_quote($reflection->getNamespaceName()); - $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); - $tokenizer = new TokenParser('parseUseStatements($reflection->getNamespaceName()); - } - - /** - * Gets the content of the file right up to the given line number. - * - * @param string $filename The name of the file to load. - * @param int $lineNumber The number of lines to read from file. - * - * @return string|null The content of the file or null if the file does not exist. - */ - private function getFileContent($filename, $lineNumber) - { - if (! is_file($filename)) { - return null; - } - - $content = ''; - $lineCnt = 0; - $file = new SplFileObject($filename); - while (! $file->eof()) { - if ($lineCnt++ === $lineNumber) { - break; - } - - $content .= $file->fgets(); - } - - return $content; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php deleted file mode 100644 index 0663ffd..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php +++ /dev/null @@ -1,80 +0,0 @@ - An array of Annotations. - */ - public function getClassAnnotations(ReflectionClass $class); - - /** - * Gets a class annotation. - * - * @param ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @param class-string $annotationName The name of the annotation. - * - * @return T|null The Annotation or NULL, if the requested annotation does not exist. - * - * @template T - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName); - - /** - * Gets the annotations applied to a method. - * - * @param ReflectionMethod $method The ReflectionMethod of the method from which - * the annotations should be read. - * - * @return array An array of Annotations. - */ - public function getMethodAnnotations(ReflectionMethod $method); - - /** - * Gets a method annotation. - * - * @param ReflectionMethod $method The ReflectionMethod to read the annotations from. - * @param class-string $annotationName The name of the annotation. - * - * @return T|null The Annotation or NULL, if the requested annotation does not exist. - * - * @template T - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName); - - /** - * Gets the annotations applied to a property. - * - * @param ReflectionProperty $property The ReflectionProperty of the property - * from which the annotations should be read. - * - * @return array An array of Annotations. - */ - public function getPropertyAnnotations(ReflectionProperty $property); - - /** - * Gets a property annotation. - * - * @param ReflectionProperty $property The ReflectionProperty to read the annotations from. - * @param class-string $annotationName The name of the annotation. - * - * @return T|null The Annotation or NULL, if the requested annotation does not exist. - * - * @template T - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName); -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php deleted file mode 100644 index 8a78c11..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php +++ /dev/null @@ -1,114 +0,0 @@ -parser = new DocParser(); - $this->parser->setIgnoreNotImportedAnnotations(true); - } - - /** - * Adds a namespace in which we will look for annotations. - * - * @param string $namespace - * - * @return void - */ - public function addNamespace($namespace) - { - $this->parser->addNamespace($namespace); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - return $this->parser->parse( - $method->getDocComment(), - 'method ' . $method->getDeclaringClass()->name . '::' . $method->getName() . '()' - ); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - return $this->parser->parse( - $property->getDocComment(), - 'property ' . $property->getDeclaringClass()->name . '::$' . $property->getName() - ); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } -} diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php deleted file mode 100644 index 9605fb8..0000000 --- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php +++ /dev/null @@ -1,208 +0,0 @@ - - */ - private $tokens; - - /** - * The number of tokens. - * - * @var int - */ - private $numTokens; - - /** - * The current array pointer. - * - * @var int - */ - private $pointer = 0; - - /** - * @param string $contents - */ - public function __construct($contents) - { - $this->tokens = token_get_all($contents); - - // The PHP parser sets internal compiler globals for certain things. Annoyingly, the last docblock comment it - // saw gets stored in doc_comment. When it comes to compile the next thing to be include()d this stored - // doc_comment becomes owned by the first thing the compiler sees in the file that it considers might have a - // docblock. If the first thing in the file is a class without a doc block this would cause calls to - // getDocBlock() on said class to return our long lost doc_comment. Argh. - // To workaround, cause the parser to parse an empty docblock. Sure getDocBlock() will return this, but at least - // it's harmless to us. - token_get_all("numTokens = count($this->tokens); - } - - /** - * Gets the next non whitespace and non comment token. - * - * @param bool $docCommentIsComment If TRUE then a doc comment is considered a comment and skipped. - * If FALSE then only whitespace and normal comments are skipped. - * - * @return mixed[]|string|null The token if exists, null otherwise. - */ - public function next($docCommentIsComment = true) - { - for ($i = $this->pointer; $i < $this->numTokens; $i++) { - $this->pointer++; - if ( - $this->tokens[$i][0] === T_WHITESPACE || - $this->tokens[$i][0] === T_COMMENT || - ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT) - ) { - continue; - } - - return $this->tokens[$i]; - } - - return null; - } - - /** - * Parses a single use statement. - * - * @return array A list with all found class names for a use statement. - */ - public function parseUseStatement() - { - $groupRoot = ''; - $class = ''; - $alias = ''; - $statements = []; - $explicitAlias = false; - while (($token = $this->next())) { - if (! $explicitAlias && $token[0] === T_STRING) { - $class .= $token[1]; - $alias = $token[1]; - } elseif ($explicitAlias && $token[0] === T_STRING) { - $alias = $token[1]; - } elseif ( - PHP_VERSION_ID >= 80000 && - ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED) - ) { - $class .= $token[1]; - - $classSplit = explode('\\', $token[1]); - $alias = $classSplit[count($classSplit) - 1]; - } elseif ($token[0] === T_NS_SEPARATOR) { - $class .= '\\'; - $alias = ''; - } elseif ($token[0] === T_AS) { - $explicitAlias = true; - $alias = ''; - } elseif ($token === ',') { - $statements[strtolower($alias)] = $groupRoot . $class; - $class = ''; - $alias = ''; - $explicitAlias = false; - } elseif ($token === ';') { - $statements[strtolower($alias)] = $groupRoot . $class; - break; - } elseif ($token === '{') { - $groupRoot = $class; - $class = ''; - } elseif ($token === '}') { - continue; - } else { - break; - } - } - - return $statements; - } - - /** - * Gets all use statements. - * - * @param string $namespaceName The namespace name of the reflected class. - * - * @return array A list with all found use statements. - */ - public function parseUseStatements($namespaceName) - { - $statements = []; - while (($token = $this->next())) { - if ($token[0] === T_USE) { - $statements = array_merge($statements, $this->parseUseStatement()); - continue; - } - - if ($token[0] !== T_NAMESPACE || $this->parseNamespace() !== $namespaceName) { - continue; - } - - // Get fresh array for new namespace. This is to prevent the parser to collect the use statements - // for a previous namespace with the same name. This is the case if a namespace is defined twice - // or if a namespace with the same name is commented out. - $statements = []; - } - - return $statements; - } - - /** - * Gets the namespace. - * - * @return string The found namespace. - */ - public function parseNamespace() - { - $name = ''; - while ( - ($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR || ( - PHP_VERSION_ID >= 80000 && - ($token[0] === T_NAME_QUALIFIED || $token[0] === T_NAME_FULLY_QUALIFIED) - )) - ) { - $name .= $token[1]; - } - - return $name; - } - - /** - * Gets the class name. - * - * @return string The found class name. - */ - public function parseClass() - { - // Namespaces and class names are tokenized the same: T_STRINGs - // separated by T_NS_SEPARATOR so we can use one function to provide - // both. - return $this->parseNamespace(); - } -} diff --git a/vendor/doctrine/lexer/LICENSE b/vendor/doctrine/lexer/LICENSE deleted file mode 100644 index e8fdec4..0000000 --- a/vendor/doctrine/lexer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2018 Doctrine Project - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/doctrine/lexer/README.md b/vendor/doctrine/lexer/README.md deleted file mode 100644 index e1b419a..0000000 --- a/vendor/doctrine/lexer/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Doctrine Lexer - -Build Status: [![Build Status](https://travis-ci.org/doctrine/lexer.svg?branch=master)](https://travis-ci.org/doctrine/lexer) - -Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers. - -This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL). - -https://www.doctrine-project.org/projects/lexer.html diff --git a/vendor/doctrine/lexer/composer.json b/vendor/doctrine/lexer/composer.json deleted file mode 100644 index 3432bae..0000000 --- a/vendor/doctrine/lexer/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "doctrine/lexer", - "type": "library", - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "keywords": [ - "php", - "parser", - "lexer", - "annotations", - "docblock" - ], - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" - }, - "autoload": { - "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } - }, - "autoload-dev": { - "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "config": { - "sort-packages": true - } -} diff --git a/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php b/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php deleted file mode 100644 index 385643a..0000000 --- a/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php +++ /dev/null @@ -1,328 +0,0 @@ -input = $input; - $this->tokens = []; - - $this->reset(); - $this->scan($input); - } - - /** - * Resets the lexer. - * - * @return void - */ - public function reset() - { - $this->lookahead = null; - $this->token = null; - $this->peek = 0; - $this->position = 0; - } - - /** - * Resets the peek pointer to 0. - * - * @return void - */ - public function resetPeek() - { - $this->peek = 0; - } - - /** - * Resets the lexer position on the input to the given position. - * - * @param int $position Position to place the lexical scanner. - * - * @return void - */ - public function resetPosition($position = 0) - { - $this->position = $position; - } - - /** - * Retrieve the original lexer's input until a given position. - * - * @param int $position - * - * @return string - */ - public function getInputUntilPosition($position) - { - return substr($this->input, 0, $position); - } - - /** - * Checks whether a given token matches the current lookahead. - * - * @param int|string $token - * - * @return bool - */ - public function isNextToken($token) - { - return $this->lookahead !== null && $this->lookahead['type'] === $token; - } - - /** - * Checks whether any of the given tokens matches the current lookahead. - * - * @param array $tokens - * - * @return bool - */ - public function isNextTokenAny(array $tokens) - { - return $this->lookahead !== null && in_array($this->lookahead['type'], $tokens, true); - } - - /** - * Moves to the next token in the input string. - * - * @return bool - */ - public function moveNext() - { - $this->peek = 0; - $this->token = $this->lookahead; - $this->lookahead = isset($this->tokens[$this->position]) - ? $this->tokens[$this->position++] : null; - - return $this->lookahead !== null; - } - - /** - * Tells the lexer to skip input tokens until it sees a token with the given value. - * - * @param string $type The token type to skip until. - * - * @return void - */ - public function skipUntil($type) - { - while ($this->lookahead !== null && $this->lookahead['type'] !== $type) { - $this->moveNext(); - } - } - - /** - * Checks if given value is identical to the given token. - * - * @param mixed $value - * @param int|string $token - * - * @return bool - */ - public function isA($value, $token) - { - return $this->getType($value) === $token; - } - - /** - * Moves the lookahead token forward. - * - * @return array|null The next token or NULL if there are no more tokens ahead. - */ - public function peek() - { - if (isset($this->tokens[$this->position + $this->peek])) { - return $this->tokens[$this->position + $this->peek++]; - } - - return null; - } - - /** - * Peeks at the next token, returns it and immediately resets the peek. - * - * @return array|null The next token or NULL if there are no more tokens ahead. - */ - public function glimpse() - { - $peek = $this->peek(); - $this->peek = 0; - - return $peek; - } - - /** - * Scans the input string for tokens. - * - * @param string $input A query string. - * - * @return void - */ - protected function scan($input) - { - if (! isset($this->regex)) { - $this->regex = sprintf( - '/(%s)|%s/%s', - implode(')|(', $this->getCatchablePatterns()), - implode('|', $this->getNonCatchablePatterns()), - $this->getModifiers() - ); - } - - $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; - $matches = preg_split($this->regex, $input, -1, $flags); - - if ($matches === false) { - // Work around https://bugs.php.net/78122 - $matches = [[$input, 0]]; - } - - foreach ($matches as $match) { - // Must remain before 'value' assignment since it can change content - $type = $this->getType($match[0]); - - $this->tokens[] = [ - 'value' => $match[0], - 'type' => $type, - 'position' => $match[1], - ]; - } - } - - /** - * Gets the literal for a given token. - * - * @param int|string $token - * - * @return int|string - */ - public function getLiteral($token) - { - $className = static::class; - $reflClass = new ReflectionClass($className); - $constants = $reflClass->getConstants(); - - foreach ($constants as $name => $value) { - if ($value === $token) { - return $className . '::' . $name; - } - } - - return $token; - } - - /** - * Regex modifiers - * - * @return string - */ - protected function getModifiers() - { - return 'iu'; - } - - /** - * Lexical catchable patterns. - * - * @return array - */ - abstract protected function getCatchablePatterns(); - - /** - * Lexical non-catchable patterns. - * - * @return array - */ - abstract protected function getNonCatchablePatterns(); - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * - * @return int|string|null - */ - abstract protected function getType(&$value); -} diff --git a/vendor/edward1108/edward-captcha/.gitignore b/vendor/edward1108/edward-captcha/.gitignore deleted file mode 100644 index cb4c3b9..0000000 --- a/vendor/edward1108/edward-captcha/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/vendor -/.idea -composer.phar -composer.lock -.DS_Store \ No newline at end of file diff --git a/vendor/edward1108/edward-captcha/LICENSE b/vendor/edward1108/edward-captcha/LICENSE deleted file mode 100644 index 2f43bbd..0000000 --- a/vendor/edward1108/edward-captcha/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Apache Licence是著名的非盈利开源组织Apache采用的协议。 -该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, -允许代码修改,再作为开源或商业软件发布。需要满足 -的条件: -1. 需要给代码的用户一份Apache Licence ; -2. 如果你修改了代码,需要在被修改的文件中说明; -3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 -带有原来代码中的协议,商标,专利声明和其他原来作者规 -定需要包含的说明; -4. 如果再发布的产品中包含一个Notice文件,则在Notice文 -件中需要带有本协议内容。你可以在Notice中增加自己的 -许可,但不可以表现为对Apache Licence构成更改。 -具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/edward1108/edward-captcha/README.md b/vendor/edward1108/edward-captcha/README.md deleted file mode 100644 index dae0729..0000000 --- a/vendor/edward1108/edward-captcha/README.md +++ /dev/null @@ -1,114 +0,0 @@ -# edward-captcha - -thinkphp6 验证码类库,支持base64 - -## 安装 -> composer require edward1108/edward-captcha - -## 前后端分离中使用 -###### 生成短信验证码 -``` - -use edward\captcha\facade\CaptchaApi; - -$data = CaptchaApi::createSMS($phone); - -其中$data 返回为: -{ - "key": "13800138000", - "code": "20" - } - - phone: 为手机号 - key: 返回给前端,用于前端提交验证 - code: 验证码值,用短信发送出去 -``` - -###### 验证短信验证码 -``` -CaptchaApi::checkSMS($code,$key); - -其中code为用户输入的短信验证码, key为上面返回到key 用于替代session, 同时使用cache作为缓冲。 -``` - -###### 生成图片验证码 -``` - -use edward\captcha\facade\CaptchaApi; - -$data = CaptchaApi::create(); - -其中$data 返回为: -{ - "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAA+CAMAAAA1S/atAAAAUVBMVEXz+/5PIIu7wNCXyJjEr5mY\r\noKKqrMbcyc+wnp3W0brRm5zLysbKxOGMcrZjO5lfNpC1qNLFurRwTJZ4Vqfe3++hjcSSeKKBYpys\r\nn7duSpl/TpGMCFihAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAF4UlEQVRogeWbi3rjKAxGoblNEif1\r\nbuzO7L7/gy6SwAgQGOw4ab/9O800tsE6kcTNRKkGHQ7we6i48hcqPX48Hltu2Kr9Hn73aICaXpmu\r\n12UVE3QVunBX0qboCK3+3+gfHx9w/zTwcugXUKHmH4P+oRSw/6r2OmLPstflejv66VRVbVk+1w27\r\nZISMXoS2Au5K9Ixy6KcCekOkAHcGHamXo4PWoB9RwonTk9BBCG1fmd6MnpPhLqIbDtNyxTAZ4YXC\r\nxVeQXGQ+17cSYJe9jrFSyU6fU5sFcy38VkLqIrpxez7qWW/+Hq1oAU9WufOG2ngxy74J+vls/p2r\r\nLm3p90SVA76Ebru05beWhNxV7E2jHVHfDt2/lgXQp9N26LlOkbTfPz3Tz+fudtf689bPXbkQvZzj\r\nToQtodshywbof/2trR7DzKWLcp2oa9j9ayA3WltGfoGuHPo0R6n9OSC/jV+/zX/3qNgwmnC4P3w4\r\nHE6S14VKmSrG7f3j4f58+syHwME4Hds5GrgBwn4wmGNQanSXfvpwSNDFSgPNBHx/g4Czb0Sny3Ok\r\nSiG6voRmame6Beu8BWQTmPSF4fDJOEJ0raRKSXy0lWHvbjbX6K3o89XoYKDA3rEwj7yGUWBafgiH\r\nLxkBqsuy24FmKdc74nbocrSvRQfsS2KmNuk8TqkcovdoEHR6HXN7gKBFdlvJNBUpBDwEWj+FWybP\r\nV6KTyy37ZHnIOoQBb3zR2f6e/kQxBout5EphfnE4zPQHQw/JZtFzLdwTvE5mBgrYDSDv2u94DtFH\r\nPBNNQDRjZ+qIHTyO2BV9IaEfj5mJ/jp0slQJLbA7NPQG9RaegUYA0Xts+0N05nI6QNPk6x/MXSKv\r\nnFTG7asXUgfoI8+suDPOKXG5PazR36CgaxtYzT19KjxntYpdztAVsJtwz0+ozcV+SWFzdJkcjxP6\r\nPRjJAjquge0n9KCMjuMIaSw63qzkdeR27Hl0lTzk6G9MY6ZUvXQ/jiPgcz5Cp+lSgj6RuwOm9wzR\r\niV3lct2GCLEX0DcXEgyPANB6XQF7jJ6QC+jmZNrC4/Ic5IyMrkU9GTYSsfuBnSqip+SI/s+8zSe3\r\nQBej2wIyO4k+2ucLzWTddwldIMepUYzep+zTyI6h47WPCvZnR0A3jp1jv/GOPYvuyXegCf3y7x0F\r\nDSaqSxvWGN3jqkr2QNUtvKiJSkdeByMY+tSYcnLz1rL7Zd6gzYrZ+Xh+Il3Ovg7dJ7gOcx1Gc+4d\r\nC4c42svoMfuU6wF2F7CLErjXd24PtzoD5LwxY7z+U+Dku52PeLsSkqBH7NTCW07m8gK0FY0DIvoa\r\nvl3+FExJ9W0cYeJ85ytU/cTgJ7YhuVLM6+6ZTtxJB/Yh9sTN2Of79evUwrfRF9CJne4fVuRWbfzy\r\nDVLv4WevXKp7dHpJxiesUo7r36RFzigJn9VUiV9Ch8EhLMHBimxQC6zS3G04cHJ3FUb7Lq46HZrp\r\nydqUPVNEyavjQb9eSV9GT80kB/ZTSzrQOcdeksChA27PXihS90xEWCBJVI3u5iOUt8GKrCcvL4h3\r\nXbKmHXLHSyQSeuWTMDVPX48uzenp+MSOU5ok0OcqTcK8pHpyqr1A32InFE+eQ+toJGPYW4xTLdyt\r\n5PYGGfxGF+lo84HWnl1h29aKruq5Vb6Fn7uFhN+2ugVFL/wtY0d/L0A35f2IfzPpFL91Zc+X1B7c\r\n9mom13etuQ6CEpuzJ0Pe9kVNXzRgB+3gkWe7A4PB37Zah36R2K0Wuu9FXrdaio5bjWL21XpBroda\r\n5vWpaEOXNKPXen2F7Hw0O0haUKF//dbiKzBPrPEHoG9h4Q8J+E1MfHkzt0jvsfFNW1gj8VxfshM3\r\nr8xubsUXud4rtsae23+9ULnaiPo7sHvl/bS0Prmu7+B1tzXd6tno2apen+vJFweiLZvfzuurd5g4\r\npV8XibZsPhl9da6v3EMY63Xo2dpq0eUvky7S9RpHfHaj7raqC3jpO30LFTzkJ2W3Z2+smmaOvspZ\r\nX+d/MZUz1l7P1Q0AAAAASUVORK5CYII=\r\n", - "key": "$2y$10$JS3S//sVv5YhKZmxFdh4WevMPF3mhV0YpNr76daQs3acpv/JOUUIW", - "md5": "c16a5320fa475530d9583c34fd356ef5", - "code": "20" - } - - base64: 图片base64地址 - key: 用于前端提交验证 - md5: 验证码端md5值,用于前端自我验证先,验证通过再请求发送 验证码和key到后台进行验证 - code: 验证码值,方便用于postman测试和自动化测试,切记正式上线,记得返回api是进行unset() 掉该值,避免被别人利用 -``` - -###### 验证图片验证码 -``` -CaptchaApi::check($code,$key); - -其中code为用户输入的验证码, key为上面返回到key 用于替代session, 同时使用cache作为缓冲 -``` - -## 来源 -~~~ -基于think-captcha进行扩展,保留了think-captcha所有功能,用于非前后端分离项目 -~~~ - -## 使用 - -### 在控制器中输出验证码 - -在控制器的操作方法中使用 - -~~~ -public function captcha($id = '') -{ - return captcha($id); -} -~~~ -然后注册对应的路由来输出验证码 - - -### 模板里输出验证码 - -首先要在你应用的路由定义文件中,注册一个验证码路由规则。 - -~~~ -\think\facade\Route::get('captcha/[:id]', "\\edward\\captcha\\CaptchaController@index"); -~~~ - -然后就可以在模板文件中使用 -~~~ -
{:captcha_img()}
-~~~ -或者 -~~~ -
captcha
-~~~ -> 上面两种的最终效果是一样的 - - -### 控制器里验证 - -使用TP的内置验证功能即可 -~~~ -$this->validate($data,[ - 'captcha|验证码'=>'require|captcha' -]); -~~~ -或者手动验证 -~~~ -if(!captcha_check($captcha)){ - //验证失败 -}; -~~~ \ No newline at end of file diff --git a/vendor/edward1108/edward-captcha/assets/bgs/1.jpg b/vendor/edward1108/edward-captcha/assets/bgs/1.jpg deleted file mode 100644 index d417136..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/1.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/bgs/2.jpg b/vendor/edward1108/edward-captcha/assets/bgs/2.jpg deleted file mode 100644 index 56640bd..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/2.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/bgs/3.jpg b/vendor/edward1108/edward-captcha/assets/bgs/3.jpg deleted file mode 100644 index 83e5bd9..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/3.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/bgs/4.jpg b/vendor/edward1108/edward-captcha/assets/bgs/4.jpg deleted file mode 100644 index 97a3721..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/4.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/bgs/5.jpg b/vendor/edward1108/edward-captcha/assets/bgs/5.jpg deleted file mode 100644 index 220a17a..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/5.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/bgs/6.jpg b/vendor/edward1108/edward-captcha/assets/bgs/6.jpg deleted file mode 100644 index be53ea0..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/6.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/bgs/7.jpg b/vendor/edward1108/edward-captcha/assets/bgs/7.jpg deleted file mode 100644 index fbf537f..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/7.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/bgs/8.jpg b/vendor/edward1108/edward-captcha/assets/bgs/8.jpg deleted file mode 100644 index e10cf28..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/bgs/8.jpg and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/ttfs/1.ttf b/vendor/edward1108/edward-captcha/assets/ttfs/1.ttf deleted file mode 100644 index 9eae6f2..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/ttfs/1.ttf and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/ttfs/2.ttf b/vendor/edward1108/edward-captcha/assets/ttfs/2.ttf deleted file mode 100644 index 6386c6b..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/ttfs/2.ttf and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/ttfs/3.ttf b/vendor/edward1108/edward-captcha/assets/ttfs/3.ttf deleted file mode 100644 index 678a491..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/ttfs/3.ttf and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/ttfs/4.ttf b/vendor/edward1108/edward-captcha/assets/ttfs/4.ttf deleted file mode 100644 index db43334..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/ttfs/4.ttf and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/ttfs/5.ttf b/vendor/edward1108/edward-captcha/assets/ttfs/5.ttf deleted file mode 100644 index 8c082c8..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/ttfs/5.ttf and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/ttfs/6.ttf b/vendor/edward1108/edward-captcha/assets/ttfs/6.ttf deleted file mode 100644 index 45a038b..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/ttfs/6.ttf and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/assets/zhttfs/1.ttf b/vendor/edward1108/edward-captcha/assets/zhttfs/1.ttf deleted file mode 100644 index 1c14f7f..0000000 Binary files a/vendor/edward1108/edward-captcha/assets/zhttfs/1.ttf and /dev/null differ diff --git a/vendor/edward1108/edward-captcha/composer.json b/vendor/edward1108/edward-captcha/composer.json deleted file mode 100644 index be89769..0000000 --- a/vendor/edward1108/edward-captcha/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "edward1108/edward-captcha", - "description": "ThinkPHP6验证码(图片、短信)支持api友好化", - "authors": [ - { - "name": "edward", - "email": "xuyuanhua1987@163.com" - } - ], - "require": { - "php": ">=7.1.0", - "topthink/framework": "^6.0.0" - }, - "homepage": "https://github.com/Edward1108/edward-captcha", - "license": "MIT", - "autoload": { - "psr-4": { - "edward\\captcha\\": "src/" - }, - "files": [ - "src/helper.php" - ] - }, - "extra": { - "think": { - "services": [ - "edward\\captcha\\CaptchaService" - ], - "config": { - "captcha": "src/config.php" - } - } - } -} diff --git a/vendor/edward1108/edward-captcha/src/Captcha.php b/vendor/edward1108/edward-captcha/src/Captcha.php deleted file mode 100644 index 4722d8b..0000000 --- a/vendor/edward1108/edward-captcha/src/Captcha.php +++ /dev/null @@ -1,340 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace edward\captcha; - -use Exception; -use think\Config; -use think\Response; -use think\Session; - -class Captcha -{ - private $im = null; // 验证码图片实例 - private $color = null; // 验证码字体颜色 - - /** - * @var Config|null - */ - private $config = null; - - /** - * @var Session|null - */ - private $session = null; - - // 验证码字符集合 - protected $codeSet = '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY'; - // 验证码过期时间(s) - protected $expire = 1800; - // 使用中文验证码 - protected $useZh = false; - // 中文验证码字符串 - protected $zhSet = '们以我到他会作时要动国产的一是工就年阶义发成部民可出能方进在了不和有大这主中人上为来分生对于学下级地个用同行面说种过命度革而多子后自社加小机也经力线本电高量长党得实家定深法表着水理化争现所二起政三好十战无农使性前等反体合斗路图把结第里正新开论之物从当两些还天资事队批点育重其思与间内去因件日利相由压员气业代全组数果期导平各基或月毛然如应形想制心样干都向变关问比展那它最及外没看治提五解系林者米群头意只明四道马认次文通但条较克又公孔领军流入接席位情运器并飞原油放立题质指建区验活众很教决特此常石强极土少已根共直团统式转别造切九你取西持总料连任志观调七么山程百报更见必真保热委手改管处己将修支识病象几先老光专什六型具示复安带每东增则完风回南广劳轮科北打积车计给节做务被整联步类集号列温装即毫知轴研单色坚据速防史拉世设达尔场织历花受求传口断况采精金界品判参层止边清至万确究书术状厂须离再目海交权且儿青才证低越际八试规斯近注办布门铁需走议县兵固除般引齿千胜细影济白格效置推空配刀叶率述今选养德话查差半敌始片施响收华觉备名红续均药标记难存测士身紧液派准斤角降维板许破述技消底床田势端感往神便贺村构照容非搞亚磨族火段算适讲按值美态黄易彪服早班麦削信排台声该击素张密害侯草何树肥继右属市严径螺检左页抗苏显苦英快称坏移约巴材省黑武培著河帝仅针怎植京助升王眼她抓含苗副杂普谈围食射源例致酸旧却充足短划剂宣环落首尺波承粉践府鱼随考刻靠够满夫失包住促枝局菌杆周护岩师举曲春元超负砂封换太模贫减阳扬江析亩木言球朝医校古呢稻宋听唯输滑站另卫字鼓刚写刘微略范供阿块某功套友限项余倒卷创律雨让骨远帮初皮播优占死毒圈伟季训控激找叫云互跟裂粮粒母练塞钢顶策双留误础吸阻故寸盾晚丝女散焊功株亲院冷彻弹错散商视艺灭版烈零室轻血倍缺厘泵察绝富城冲喷壤简否柱李望盘磁雄似困巩益洲脱投送奴侧润盖挥距触星松送获兴独官混纪依未突架宽冬章湿偏纹吃执阀矿寨责熟稳夺硬价努翻奇甲预职评读背协损棉侵灰虽矛厚罗泥辟告卵箱掌氧恩爱停曾溶营终纲孟钱待尽俄缩沙退陈讨奋械载胞幼哪剥迫旋征槽倒握担仍呀鲜吧卡粗介钻逐弱脚怕盐末阴丰雾冠丙街莱贝辐肠付吉渗瑞惊顿挤秒悬姆烂森糖圣凹陶词迟蚕亿矩康遵牧遭幅园腔订香肉弟屋敏恢忘编印蜂急拿扩伤飞露核缘游振操央伍域甚迅辉异序免纸夜乡久隶缸夹念兰映沟乙吗儒杀汽磷艰晶插埃燃欢铁补咱芽永瓦倾阵碳演威附牙芽永瓦斜灌欧献顺猪洋腐请透司危括脉宜笑若尾束壮暴企菜穗楚汉愈绿拖牛份染既秋遍锻玉夏疗尖殖井费州访吹荣铜沿替滚客召旱悟刺脑措贯藏敢令隙炉壳硫煤迎铸粘探临薄旬善福纵择礼愿伏残雷延烟句纯渐耕跑泽慢栽鲁赤繁境潮横掉锥希池败船假亮谓托伙哲怀割摆贡呈劲财仪沉炼麻罪祖息车穿货销齐鼠抽画饲龙库守筑房歌寒喜哥洗蚀废纳腹乎录镜妇恶脂庄擦险赞钟摇典柄辩竹谷卖乱虚桥奥伯赶垂途额壁网截野遗静谋弄挂课镇妄盛耐援扎虑键归符庆聚绕摩忙舞遇索顾胶羊湖钉仁音迹碎伸灯避泛亡答勇频皇柳哈揭甘诺概宪浓岛袭谁洪谢炮浇斑讯懂灵蛋闭孩释乳巨徒私银伊景坦累匀霉杜乐勒隔弯绩招绍胡呼痛峰零柴簧午跳居尚丁秦稍追梁折耗碱殊岗挖氏刃剧堆赫荷胸衡勤膜篇登驻案刊秧缓凸役剪川雪链渔啦脸户洛孢勃盟买杨宗焦赛旗滤硅炭股坐蒸凝竟陷枪黎救冒暗洞犯筒您宋弧爆谬涂味津臂障褐陆啊健尊豆拔莫抵桑坡缝警挑污冰柬嘴啥饭塑寄赵喊垫丹渡耳刨虎笔稀昆浪萨茶滴浅拥穴覆伦娘吨浸袖珠雌妈紫戏塔锤震岁貌洁剖牢锋疑霸闪埔猛诉刷狠忽灾闹乔唐漏闻沈熔氯荒茎男凡抢像浆旁玻亦忠唱蒙予纷捕锁尤乘乌智淡允叛畜俘摸锈扫毕璃宝芯爷鉴秘净蒋钙肩腾枯抛轨堂拌爸循诱祝励肯酒绳穷塘燥泡袋朗喂铝软渠颗惯贸粪综墙趋彼届墨碍启逆卸航衣孙龄岭骗休借'; - // 使用背景图片 - protected $useImgBg = false; - // 验证码字体大小(px) - protected $fontSize = 25; - // 是否画混淆曲线 - protected $useCurve = true; - // 是否添加杂点 - protected $useNoise = true; - // 验证码图片高度 - protected $imageH = 0; - // 验证码图片宽度 - protected $imageW = 0; - // 验证码位数 - protected $length = 5; - // 验证码字体,不设置随机获取 - protected $fontttf = ''; - // 背景颜色 - protected $bg = [243, 251, 254]; - //算术验证码 - protected $math = false; - - /** - * 架构方法 设置参数 - * @access public - * @param Config $config - * @param Session $session - */ - public function __construct(Config $config, Session $session) - { - $this->config = $config; - $this->session = $session; - } - - /** - * 配置验证码 - * @param string|null $config - */ - protected function configure(string $config = null): void - { - if (is_null($config)) { - $config = $this->config->get('captcha', []); - } else { - $config = $this->config->get('captcha.' . $config, []); - } - - foreach ($config as $key => $val) { - if (property_exists($this, $key)) { - $this->{$key} = $val; - } - } - } - - /** - * 创建验证码 - * @return array - * @throws Exception - */ - protected function generate(): array - { - $bag = ''; - - if ($this->math) { - $this->useZh = false; - $this->length = 5; - - $x = random_int(10, 30); - $y = random_int(1, 9); - $bag = "{$x} + {$y} = "; - $key = $x + $y; - $key .= ''; - } else { - if ($this->useZh) { - $characters = preg_split('/(?zhSet); - } else { - $characters = str_split($this->codeSet); - } - - for ($i = 0; $i < $this->length; $i++) { - $bag .= $characters[rand(0, count($characters) - 1)]; - } - - $key = mb_strtolower($bag, 'UTF-8'); - } - - $hash = password_hash($key, PASSWORD_BCRYPT, ['cost' => 10]); - - $this->session->set('captcha', [ - 'key' => $hash, - ]); - - return [ - 'value' => $bag, - 'key' => $hash, - ]; - } - - /** - * 验证验证码是否正确 - * @access public - * @param string $code 用户验证码 - * @return bool 用户验证码是否正确 - */ - public function check(string $code): bool - { - if (!$this->session->has('captcha')) { - return false; - } - - $key = $this->session->get('captcha.key'); - - $code = mb_strtolower($code, 'UTF-8'); - - $res = password_verify($code, $key); - - if ($res) { - $this->session->delete('captcha'); - } - - return $res; - } - - /** - * 输出验证码并把验证码的值保存的session中 - * @access public - * @param null|string $config - * @param bool $api - * @return Response - */ - public function create(string $config = null, bool $api = false): Response - { - $this->configure($config); - - $generator = $this->generate(); - - // 图片宽(px) - $this->imageW || $this->imageW = $this->length * $this->fontSize * 1.5 + $this->length * $this->fontSize / 2; - // 图片高(px) - $this->imageH || $this->imageH = $this->fontSize * 2.5; - // 建立一幅 $this->imageW x $this->imageH 的图像 - $this->im = imagecreate($this->imageW, $this->imageH); - // 设置背景 - imagecolorallocate($this->im, $this->bg[0], $this->bg[1], $this->bg[2]); - - // 验证码字体随机颜色 - $this->color = imagecolorallocate($this->im, mt_rand(1, 150), mt_rand(1, 150), mt_rand(1, 150)); - - // 验证码使用随机字体 - $ttfPath = __DIR__ . '/../assets/' . ($this->useZh ? 'zhttfs' : 'ttfs') . '/'; - - if (empty($this->fontttf)) { - $dir = dir($ttfPath); - $ttfs = []; - while (false !== ($file = $dir->read())) { - if ('.' != $file[0] && substr($file, -4) == '.ttf') { - $ttfs[] = $file; - } - } - $dir->close(); - $this->fontttf = $ttfs[array_rand($ttfs)]; - } - - $fontttf = $ttfPath . $this->fontttf; - - if ($this->useImgBg) { - $this->background(); - } - - if ($this->useNoise) { - // 绘杂点 - $this->writeNoise(); - } - if ($this->useCurve) { - // 绘干扰线 - $this->writeCurve(); - } - - // 绘验证码 - $text = $this->useZh ? preg_split('/(? $char) { - - $x = $this->fontSize * ($index + 1) * mt_rand(1.2, 1.6) * ($this->math ? 1 : 1.5); - $y = $this->fontSize + mt_rand(10, 20); - $angle = $this->math ? 0 : mt_rand(-40, 40); - - imagettftext($this->im, $this->fontSize, $angle, $x, $y, $this->color, $fontttf, $char); - } - - ob_start(); - // 输出图像 - imagepng($this->im); - $content = ob_get_clean(); - imagedestroy($this->im); - - return response($content, 200, ['Content-Length' => strlen($content)])->contentType('image/png'); - } - - /** - * 画一条由两条连在一起构成的随机正弦函数曲线作干扰线(你可以改成更帅的曲线函数) - * - * 高中的数学公式咋都忘了涅,写出来 - * 正弦型函数解析式:y=Asin(ωx+φ)+b - * 各常数值对函数图像的影响: - * A:决定峰值(即纵向拉伸压缩的倍数) - * b:表示波形在Y轴的位置关系或纵向移动距离(上加下减) - * φ:决定波形与X轴位置关系或横向移动距离(左加右减) - * ω:决定周期(最小正周期T=2π/∣ω∣) - * - */ - protected function writeCurve(): void - { - $px = $py = 0; - - // 曲线前部分 - $A = mt_rand(1, $this->imageH / 2); // 振幅 - $b = mt_rand(-$this->imageH / 4, $this->imageH / 4); // Y轴方向偏移量 - $f = mt_rand(-$this->imageH / 4, $this->imageH / 4); // X轴方向偏移量 - $T = mt_rand($this->imageH, $this->imageW * 2); // 周期 - $w = (2 * M_PI) / $T; - - $px1 = 0; // 曲线横坐标起始位置 - $px2 = mt_rand($this->imageW / 2, $this->imageW * 0.8); // 曲线横坐标结束位置 - - for ($px = $px1; $px <= $px2; $px = $px + 1) { - if (0 != $w) { - $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(ωx+φ) + b - $i = (int)($this->fontSize / 5); - while ($i > 0) { - imagesetpixel($this->im, $px + $i, $py + $i, $this->color); // 这里(while)循环画像素点比imagettftext和imagestring用字体大小一次画出(不用这while循环)性能要好很多 - $i--; - } - } - } - - // 曲线后部分 - $A = mt_rand(1, $this->imageH / 2); // 振幅 - $f = mt_rand(-$this->imageH / 4, $this->imageH / 4); // X轴方向偏移量 - $T = mt_rand($this->imageH, $this->imageW * 2); // 周期 - $w = (2 * M_PI) / $T; - $b = $py - $A * sin($w * $px + $f) - $this->imageH / 2; - $px1 = $px2; - $px2 = $this->imageW; - - for ($px = $px1; $px <= $px2; $px = $px + 1) { - if (0 != $w) { - $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(ωx+φ) + b - $i = (int)($this->fontSize / 5); - while ($i > 0) { - imagesetpixel($this->im, $px + $i, $py + $i, $this->color); - $i--; - } - } - } - } - - /** - * 画杂点 - * 往图片上写不同颜色的字母或数字 - */ - protected function writeNoise(): void - { - $codeSet = '2345678abcdefhijkmnpqrstuvwxyz'; - for ($i = 0; $i < 10; $i++) { - //杂点颜色 - $noiseColor = imagecolorallocate($this->im, mt_rand(150, 225), mt_rand(150, 225), mt_rand(150, 225)); - for ($j = 0; $j < 5; $j++) { - // 绘杂点 - imagestring($this->im, 5, mt_rand(-10, $this->imageW), mt_rand(-10, $this->imageH), $codeSet[mt_rand(0, 29)], $noiseColor); - } - } - } - - /** - * 绘制背景图片 - * 注:如果验证码输出图片比较大,将占用比较多的系统资源 - */ - protected function background(): void - { - $path = __DIR__ . '/../assets/bgs/'; - $dir = dir($path); - - $bgs = []; - while (false !== ($file = $dir->read())) { - if ('.' != $file[0] && substr($file, -4) == '.jpg') { - $bgs[] = $path . $file; - } - } - $dir->close(); - - $gb = $bgs[array_rand($bgs)]; - - list($width, $height) = @getimagesize($gb); - // Resample - $bgImage = @imagecreatefromjpeg($gb); - @imagecopyresampled($this->im, $bgImage, 0, 0, 0, 0, $this->imageW, $this->imageH, $width, $height); - @imagedestroy($bgImage); - } - -} diff --git a/vendor/edward1108/edward-captcha/src/CaptchaApi.php b/vendor/edward1108/edward-captcha/src/CaptchaApi.php deleted file mode 100644 index da641f7..0000000 --- a/vendor/edward1108/edward-captcha/src/CaptchaApi.php +++ /dev/null @@ -1,369 +0,0 @@ -config = $config; - $this->cache = $cache; - } - - /** - * 配置验证码 - * @param string|null $config - */ - protected function configure(string $config = null): void - { - if (is_null($config)) { - $config = $this->config->get('captcha', []); - } else { - $config = $this->config->get('captcha.' . $config, []); - } - - foreach ($config as $key => $val) { - if (property_exists($this, $key)) { - $this->{$key} = $val; - } - } - } - - /** - * 创建验证码 - * @return array - * @throws Exception - */ - protected function generate(): array - { - $bag = ''; - - if ($this->math) { - $this->useZh = false; - $this->length = 5; - - $x = random_int(10, 30); - $y = random_int(1, 9); - $bag = "{$x} + {$y} = "; - $key = $x + $y; - $key .= ''; - } else { - if ($this->useZh) { - $characters = preg_split('/(?zhSet); - } else { - $characters = str_split($this->codeSet); - } - - for ($i = 0; $i < $this->length; $i++) { - $bag .= $characters[rand(0, count($characters) - 1)]; - } - - $key = mb_strtolower($bag, 'UTF-8'); - } - - $hash = password_hash($key, PASSWORD_BCRYPT, ['cost' => 10]); - $this->cache->set('captchaApi.' . $hash, $key, $this->expire); - - return [ - 'value' => $bag, - 'key' => $hash, - 'code' => $key, - 'md5' => md5($key), - ]; - } - - /** - * 输出验证码并把验证码的值保存的缓存中 - * @access public - * @param null|string $config - * @param bool $api - * @return object - */ - public function createSMS(string $phone = null): array - { - $key = rand(1000, 9999); - $this->cache->set('captchaSMS.' . $phone, $key, $this->expire); - return [ - 'key' => $phone, - 'code' => $key, - ]; - } - - /** - * 输出验证码并把验证码的值保存的缓存中 - * @access public - * @param null|string $config - * @param bool $api - * @return object - */ - public function checkSMS(string $code, string $phone): bool - { - $res = false; - if ($this->cache->get('captchaSMS.' . $phone) == $code) { - $res = true; - } - - if ($res) { - $this->cache->delete('captchaSMS.' . $phone); - } - - return $res; - } - - /** - * 验证验证码是否正确 - * @access public - * @param string $code 用户验证码 - * @param string $key 用户验证码key - * @return bool 用户验证码是否正确 - */ - public function check(string $code, string $hash): bool - { - $res = false; - if ($this->cache->get('captchaApi.' . $hash)) { - $code = mb_strtolower($code, 'UTF-8'); - $res = password_verify($code, $hash); - } - - if ($res) { - $this->cache->delete('captchaApi.' . $hash); - } - - return $res; - } - - /** - * 输出验证码并把验证码的值保存的缓存中 - * @access public - * @param null|string $config - * @param bool $api - * @return object - */ - public function create(string $config = null, bool $api = false): array - { - $this->configure($config); - - $generator = $this->generate(); - - // 图片宽(px) - $this->imageW || $this->imageW = $this->length * $this->fontSize * 1.5 + $this->length * $this->fontSize / 2; - // 图片高(px) - $this->imageH || $this->imageH = $this->fontSize * 2.5; - // 建立一幅 $this->imageW x $this->imageH 的图像 - $this->im = imagecreate($this->imageW, $this->imageH); - // 设置背景 - imagecolorallocate($this->im, $this->bg[0], $this->bg[1], $this->bg[2]); - - // 验证码字体随机颜色 - $this->color = imagecolorallocate($this->im, mt_rand(1, 150), mt_rand(1, 150), mt_rand(1, 150)); - - // 验证码使用随机字体 - $ttfPath = __DIR__ . '/../assets/' . ($this->useZh ? 'zhttfs' : 'ttfs') . '/'; - - if (empty($this->fontttf)) { - $dir = dir($ttfPath); - $ttfs = []; - while (false !== ($file = $dir->read())) { - if ('.' != $file[0] && substr($file, -4) == '.ttf') { - $ttfs[] = $file; - } - } - $dir->close(); - $this->fontttf = $ttfs[array_rand($ttfs)]; - } - - $fontttf = $ttfPath . $this->fontttf; - - if ($this->useImgBg) { - $this->background(); - } - - if ($this->useNoise) { - // 绘杂点 - $this->writeNoise(); - } - if ($this->useCurve) { - // 绘干扰线 - $this->writeCurve(); - } - - // 绘验证码 - $text = $this->useZh ? preg_split('/(? $char) { - - $x = $this->fontSize * ($index + 1) * mt_rand(1.2, 1.6) * ($this->math ? 1 : 1.5); - $y = $this->fontSize + mt_rand(10, 20); - $angle = $this->math ? 0 : mt_rand(-40, 40); - - imagettftext($this->im, $this->fontSize, $angle, $x, $y, $this->color, $fontttf, $char); - } - - ob_start(); - // 输出图像 - imagepng($this->im); - $content = ob_get_clean(); - imagedestroy($this->im); - return [ - 'base64' => 'data:image/png;base64,' . chunk_split(base64_encode($content)), - 'key' => $generator['key'], - 'code' => $generator['code'], - 'md5' => $generator['md5'], - ]; - } - - /** - * 画一条由两条连在一起构成的随机正弦函数曲线作干扰线(你可以改成更帅的曲线函数) - * - * 高中的数学公式咋都忘了涅,写出来 - * 正弦型函数解析式:y=Asin(ωx+φ)+b - * 各常数值对函数图像的影响: - * A:决定峰值(即纵向拉伸压缩的倍数) - * b:表示波形在Y轴的位置关系或纵向移动距离(上加下减) - * φ:决定波形与X轴位置关系或横向移动距离(左加右减) - * ω:决定周期(最小正周期T=2π/∣ω∣) - * - */ - protected function writeCurve(): void - { - $px = $py = 0; - - // 曲线前部分 - $A = mt_rand(1, $this->imageH / 2); // 振幅 - $b = mt_rand(-$this->imageH / 4, $this->imageH / 4); // Y轴方向偏移量 - $f = mt_rand(-$this->imageH / 4, $this->imageH / 4); // X轴方向偏移量 - $T = mt_rand($this->imageH, $this->imageW * 2); // 周期 - $w = (2 * M_PI) / $T; - - $px1 = 0; // 曲线横坐标起始位置 - $px2 = mt_rand($this->imageW / 2, $this->imageW * 0.8); // 曲线横坐标结束位置 - - for ($px = $px1; $px <= $px2; $px = $px + 1) { - if (0 != $w) { - $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(ωx+φ) + b - $i = (int)($this->fontSize / 5); - while ($i > 0) { - imagesetpixel($this->im, $px + $i, $py + $i, $this->color); // 这里(while)循环画像素点比imagettftext和imagestring用字体大小一次画出(不用这while循环)性能要好很多 - $i--; - } - } - } - - // 曲线后部分 - $A = mt_rand(1, $this->imageH / 2); // 振幅 - $f = mt_rand(-$this->imageH / 4, $this->imageH / 4); // X轴方向偏移量 - $T = mt_rand($this->imageH, $this->imageW * 2); // 周期 - $w = (2 * M_PI) / $T; - $b = $py - $A * sin($w * $px + $f) - $this->imageH / 2; - $px1 = $px2; - $px2 = $this->imageW; - - for ($px = $px1; $px <= $px2; $px = $px + 1) { - if (0 != $w) { - $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(ωx+φ) + b - $i = (int)($this->fontSize / 5); - while ($i > 0) { - imagesetpixel($this->im, $px + $i, $py + $i, $this->color); - $i--; - } - } - } - } - - /** - * 画杂点 - * 往图片上写不同颜色的字母或数字 - */ - protected function writeNoise(): void - { - $codeSet = '2345678abcdefhijkmnpqrstuvwxyz'; - for ($i = 0; $i < 10; $i++) { - //杂点颜色 - $noiseColor = imagecolorallocate($this->im, mt_rand(150, 225), mt_rand(150, 225), mt_rand(150, 225)); - for ($j = 0; $j < 5; $j++) { - // 绘杂点 - imagestring($this->im, 5, mt_rand(-10, $this->imageW), mt_rand(-10, $this->imageH), $codeSet[mt_rand(0, 29)], $noiseColor); - } - } - } - - /** - * 绘制背景图片 - * 注:如果验证码输出图片比较大,将占用比较多的系统资源 - */ - protected function background(): void - { - $path = __DIR__ . '/../assets/bgs/'; - $dir = dir($path); - - $bgs = []; - while (false !== ($file = $dir->read())) { - if ('.' != $file[0] && substr($file, -4) == '.jpg') { - $bgs[] = $path . $file; - } - } - $dir->close(); - - $gb = $bgs[array_rand($bgs)]; - - list($width, $height) = @getimagesize($gb); - // Resample - $bgImage = @imagecreatefromjpeg($gb); - @imagecopyresampled($this->im, $bgImage, 0, 0, 0, 0, $this->imageW, $this->imageH, $width, $height); - @imagedestroy($bgImage); - } - -} diff --git a/vendor/edward1108/edward-captcha/src/CaptchaController.php b/vendor/edward1108/edward-captcha/src/CaptchaController.php deleted file mode 100644 index 898ee3f..0000000 --- a/vendor/edward1108/edward-captcha/src/CaptchaController.php +++ /dev/null @@ -1,20 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace edward\captcha; - -class CaptchaController -{ - public function index(Captcha $captcha, $config = null) - { - return $captcha->create($config); - } -} diff --git a/vendor/edward1108/edward-captcha/src/CaptchaService.php b/vendor/edward1108/edward-captcha/src/CaptchaService.php deleted file mode 100644 index 1a81e86..0000000 --- a/vendor/edward1108/edward-captcha/src/CaptchaService.php +++ /dev/null @@ -1,23 +0,0 @@ -extend('captcha', function ($value) { - return captcha_check($value); - }, ':attribute错误!'); - }); - - $this->registerRoutes(function (Route $route) { - $route->get('captcha/[:config]', "\\edward\\captcha\\CaptchaController@index"); - }); - } -} diff --git a/vendor/edward1108/edward-captcha/src/config.php b/vendor/edward1108/edward-captcha/src/config.php deleted file mode 100644 index ac741dc..0000000 --- a/vendor/edward1108/edward-captcha/src/config.php +++ /dev/null @@ -1,39 +0,0 @@ - 5, - // 验证码字符集合 - 'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY', - // 验证码过期时间 - 'expire' => 1800, - // 是否使用中文验证码 - 'useZh' => false, - // 是否使用算术验证码 - 'math' => false, - // 是否使用背景图 - 'useImgBg' => false, - //验证码字符大小 - 'fontSize' => 25, - // 是否使用混淆曲线 - 'useCurve' => true, - //是否添加杂点 - 'useNoise' => true, - // 验证码字体 不设置则随机 - 'fontttf' => '', - //背景颜色 - 'bg' => [243, 251, 254], - // 验证码图片高度 - 'imageH' => 0, - // 验证码图片宽度 - 'imageW' => 0, - - // 添加额外的验证码设置 - // verify => [ - // 'length'=>4, - // ... - //], -]; diff --git a/vendor/edward1108/edward-captcha/src/facade/Captcha.php b/vendor/edward1108/edward-captcha/src/facade/Captcha.php deleted file mode 100644 index 13c95f8..0000000 --- a/vendor/edward1108/edward-captcha/src/facade/Captcha.php +++ /dev/null @@ -1,18 +0,0 @@ - -// +---------------------------------------------------------------------- - -use edward\captcha\facade\Captcha; -use think\facade\Route; -use think\Response; - -/** - * @param string $config - * @return \think\Response - */ -function captcha($config = null): Response -{ - return Captcha::create($config); -} - -/** - * @param $config - * @return string - */ -function captcha_src($config = null): string -{ - return Route::buildUrl('/captcha' . ($config ? "/{$config}" : '')); -} - -/** - * @param $id - * @return string - */ -function captcha_img($id = '', $domid = ''): string -{ - $src = captcha_src($id); - - $domid = empty($domid) ? $domid : "id='" . $domid . "'"; - - return "captcha"; -} - -/** - * @param string $value - * @return bool - */ -function captcha_check($value) -{ - return Captcha::check($value); -} diff --git a/vendor/egulias/email-validator/LICENSE b/vendor/egulias/email-validator/LICENSE deleted file mode 100644 index c34d2c1..0000000 --- a/vendor/egulias/email-validator/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2016 Eduardo Gulias Davis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/egulias/email-validator/composer.json b/vendor/egulias/email-validator/composer.json deleted file mode 100644 index a275696..0000000 --- a/vendor/egulias/email-validator/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "egulias/email-validator", - "description": "A library for validating emails against several RFCs", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": ["email", "validation", "validator", "emailvalidation", "emailvalidator"], - "license": "MIT", - "authors": [ - {"name": "Eduardo Gulias Davis"} - ], - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "require": { - "php": ">=5.5", - "doctrine/lexer": "^1.0.1", - "symfony/polyfill-intl-idn": "^1.10" - }, - "require-dev": { - "dominicsayers/isemail": "^3.0.7", - "phpunit/phpunit": "^4.8.36|^7.5.15", - "satooshi/php-coveralls": "^1.0.1" - }, - "suggest": { - "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" - }, - "autoload": { - "psr-4": { - "Egulias\\EmailValidator\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Egulias\\EmailValidator\\Tests\\": "tests" - } - } -} diff --git a/vendor/egulias/email-validator/src/EmailLexer.php b/vendor/egulias/email-validator/src/EmailLexer.php deleted file mode 100644 index 59dcd58..0000000 --- a/vendor/egulias/email-validator/src/EmailLexer.php +++ /dev/null @@ -1,283 +0,0 @@ - self::S_OPENPARENTHESIS, - ')' => self::S_CLOSEPARENTHESIS, - '<' => self::S_LOWERTHAN, - '>' => self::S_GREATERTHAN, - '[' => self::S_OPENBRACKET, - ']' => self::S_CLOSEBRACKET, - ':' => self::S_COLON, - ';' => self::S_SEMICOLON, - '@' => self::S_AT, - '\\' => self::S_BACKSLASH, - '/' => self::S_SLASH, - ',' => self::S_COMMA, - '.' => self::S_DOT, - "'" => self::S_SQUOTE, - "`" => self::S_BACKTICK, - '"' => self::S_DQUOTE, - '-' => self::S_HYPHEN, - '::' => self::S_DOUBLECOLON, - ' ' => self::S_SP, - "\t" => self::S_HTAB, - "\r" => self::S_CR, - "\n" => self::S_LF, - "\r\n" => self::CRLF, - 'IPv6' => self::S_IPV6TAG, - '{' => self::S_OPENQBRACKET, - '}' => self::S_CLOSEQBRACKET, - '' => self::S_EMPTY, - '\0' => self::C_NUL, - ); - - /** - * @var bool - */ - protected $hasInvalidTokens = false; - - /** - * @var array - * - * @psalm-var array{value:string, type:null|int, position:int}|array - */ - protected $previous = []; - - /** - * The last matched/seen token. - * - * @var array - * - * @psalm-var array{value:string, type:null|int, position:int} - */ - public $token; - - /** - * The next token in the input. - * - * @var array|null - */ - public $lookahead; - - /** - * @psalm-var array{value:'', type:null, position:0} - */ - private static $nullToken = [ - 'value' => '', - 'type' => null, - 'position' => 0, - ]; - - public function __construct() - { - $this->previous = $this->token = self::$nullToken; - $this->lookahead = null; - } - - /** - * @return void - */ - public function reset() - { - $this->hasInvalidTokens = false; - parent::reset(); - $this->previous = $this->token = self::$nullToken; - } - - /** - * @return bool - */ - public function hasInvalidTokens() - { - return $this->hasInvalidTokens; - } - - /** - * @param int $type - * @throws \UnexpectedValueException - * @return boolean - * - * @psalm-suppress InvalidScalarArgument - */ - public function find($type) - { - $search = clone $this; - $search->skipUntil($type); - - if (!$search->lookahead) { - throw new \UnexpectedValueException($type . ' not found'); - } - return true; - } - - /** - * getPrevious - * - * @return array - */ - public function getPrevious() - { - return $this->previous; - } - - /** - * moveNext - * - * @return boolean - */ - public function moveNext() - { - $this->previous = $this->token; - $hasNext = parent::moveNext(); - $this->token = $this->token ?: self::$nullToken; - - return $hasNext; - } - - /** - * Lexical catchable patterns. - * - * @return string[] - */ - protected function getCatchablePatterns() - { - return array( - '[a-zA-Z_]+[46]?', //ASCII and domain literal - '[^\x00-\x7F]', //UTF-8 - '[0-9]+', - '\r\n', - '::', - '\s+?', - '.', - ); - } - - /** - * Lexical non-catchable patterns. - * - * @return string[] - */ - protected function getNonCatchablePatterns() - { - return array('[\xA0-\xff]+'); - } - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * @throws \InvalidArgumentException - * @return integer - */ - protected function getType(&$value) - { - if ($this->isNullType($value)) { - return self::C_NUL; - } - - if ($this->isValid($value)) { - return $this->charValue[$value]; - } - - if ($this->isUTF8Invalid($value)) { - $this->hasInvalidTokens = true; - return self::INVALID; - } - - return self::GENERIC; - } - - /** - * @param string $value - * - * @return bool - */ - protected function isValid($value) - { - if (isset($this->charValue[$value])) { - return true; - } - - return false; - } - - /** - * @param string $value - * @return bool - */ - protected function isNullType($value) - { - if ($value === "\0") { - return true; - } - - return false; - } - - /** - * @param string $value - * @return bool - */ - protected function isUTF8Invalid($value) - { - if (preg_match('/\p{Cc}+/u', $value)) { - return true; - } - - return false; - } - - /** - * @return string - */ - protected function getModifiers() - { - return 'iu'; - } -} diff --git a/vendor/egulias/email-validator/src/EmailParser.php b/vendor/egulias/email-validator/src/EmailParser.php deleted file mode 100644 index 6b7bad6..0000000 --- a/vendor/egulias/email-validator/src/EmailParser.php +++ /dev/null @@ -1,137 +0,0 @@ - - */ -class EmailParser -{ - const EMAIL_MAX_LENGTH = 254; - - /** - * @var array - */ - protected $warnings = []; - - /** - * @var string - */ - protected $domainPart = ''; - - /** - * @var string - */ - protected $localPart = ''; - /** - * @var EmailLexer - */ - protected $lexer; - - /** - * @var LocalPart - */ - protected $localPartParser; - - /** - * @var DomainPart - */ - protected $domainPartParser; - - public function __construct(EmailLexer $lexer) - { - $this->lexer = $lexer; - $this->localPartParser = new LocalPart($this->lexer); - $this->domainPartParser = new DomainPart($this->lexer); - } - - /** - * @param string $str - * @return array - */ - public function parse($str) - { - $this->lexer->setInput($str); - - if (!$this->hasAtToken()) { - throw new NoLocalPart(); - } - - - $this->localPartParser->parse($str); - $this->domainPartParser->parse($str); - - $this->setParts($str); - - if ($this->lexer->hasInvalidTokens()) { - throw new ExpectingATEXT(); - } - - return array('local' => $this->localPart, 'domain' => $this->domainPart); - } - - /** - * @return Warning\Warning[] - */ - public function getWarnings() - { - $localPartWarnings = $this->localPartParser->getWarnings(); - $domainPartWarnings = $this->domainPartParser->getWarnings(); - $this->warnings = array_merge($localPartWarnings, $domainPartWarnings); - - $this->addLongEmailWarning($this->localPart, $this->domainPart); - - return $this->warnings; - } - - /** - * @return string - */ - public function getParsedDomainPart() - { - return $this->domainPart; - } - - /** - * @param string $email - */ - protected function setParts($email) - { - $parts = explode('@', $email); - $this->domainPart = $this->domainPartParser->getDomainPart(); - $this->localPart = $parts[0]; - } - - /** - * @return bool - */ - protected function hasAtToken() - { - $this->lexer->moveNext(); - $this->lexer->moveNext(); - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - return false; - } - - return true; - } - - /** - * @param string $localPart - * @param string $parsedDomainPart - */ - protected function addLongEmailWarning($localPart, $parsedDomainPart) - { - if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) { - $this->warnings[EmailTooLong::CODE] = new EmailTooLong(); - } - } -} diff --git a/vendor/egulias/email-validator/src/EmailValidator.php b/vendor/egulias/email-validator/src/EmailValidator.php deleted file mode 100644 index a30f21d..0000000 --- a/vendor/egulias/email-validator/src/EmailValidator.php +++ /dev/null @@ -1,67 +0,0 @@ -lexer = new EmailLexer(); - } - - /** - * @param string $email - * @param EmailValidation $emailValidation - * @return bool - */ - public function isValid($email, EmailValidation $emailValidation) - { - $isValid = $emailValidation->isValid($email, $this->lexer); - $this->warnings = $emailValidation->getWarnings(); - $this->error = $emailValidation->getError(); - - return $isValid; - } - - /** - * @return boolean - */ - public function hasWarnings() - { - return !empty($this->warnings); - } - - /** - * @return array - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * @return InvalidEmail|null - */ - public function getError() - { - return $this->error; - } -} diff --git a/vendor/egulias/email-validator/src/Exception/AtextAfterCFWS.php b/vendor/egulias/email-validator/src/Exception/AtextAfterCFWS.php deleted file mode 100644 index 97f41a2..0000000 --- a/vendor/egulias/email-validator/src/Exception/AtextAfterCFWS.php +++ /dev/null @@ -1,9 +0,0 @@ -lexer->moveNext(); - - $this->performDomainStartChecks(); - - $domain = $this->doParseDomainPart(); - - $prev = $this->lexer->getPrevious(); - $length = strlen($domain); - - if ($prev['type'] === EmailLexer::S_DOT) { - throw new DotAtEnd(); - } - if ($prev['type'] === EmailLexer::S_HYPHEN) { - throw new DomainHyphened(); - } - if ($length > self::DOMAIN_MAX_LENGTH) { - $this->warnings[DomainTooLong::CODE] = new DomainTooLong(); - } - if ($prev['type'] === EmailLexer::S_CR) { - throw new CRLFAtTheEnd(); - } - $this->domainPart = $domain; - } - - private function performDomainStartChecks() - { - $this->checkInvalidTokensAfterAT(); - $this->checkEmptyDomain(); - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->warnings[DeprecatedComment::CODE] = new DeprecatedComment(); - $this->parseDomainComments(); - } - } - - private function checkEmptyDomain() - { - $thereIsNoDomain = $this->lexer->token['type'] === EmailLexer::S_EMPTY || - ($this->lexer->token['type'] === EmailLexer::S_SP && - !$this->lexer->isNextToken(EmailLexer::GENERIC)); - - if ($thereIsNoDomain) { - throw new NoDomainPart(); - } - } - - private function checkInvalidTokensAfterAT() - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT) { - throw new DotAtStart(); - } - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) { - throw new DomainHyphened(); - } - } - - /** - * @return string - */ - public function getDomainPart() - { - return $this->domainPart; - } - - /** - * @param string $addressLiteral - * @param int $maxGroups - */ - public function checkIPV6Tag($addressLiteral, $maxGroups = 8) - { - $prev = $this->lexer->getPrevious(); - if ($prev['type'] === EmailLexer::S_COLON) { - $this->warnings[IPV6ColonEnd::CODE] = new IPV6ColonEnd(); - } - - $IPv6 = substr($addressLiteral, 5); - //Daniel Marschall's new IPv6 testing strategy - $matchesIP = explode(':', $IPv6); - $groupCount = count($matchesIP); - $colons = strpos($IPv6, '::'); - - if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) { - $this->warnings[IPV6BadChar::CODE] = new IPV6BadChar(); - } - - if ($colons === false) { - // We need exactly the right number of groups - if ($groupCount !== $maxGroups) { - $this->warnings[IPV6GroupCount::CODE] = new IPV6GroupCount(); - } - return; - } - - if ($colons !== strrpos($IPv6, '::')) { - $this->warnings[IPV6DoubleColon::CODE] = new IPV6DoubleColon(); - return; - } - - if ($colons === 0 || $colons === (strlen($IPv6) - 2)) { - // RFC 4291 allows :: at the start or end of an address - //with 7 other groups in addition - ++$maxGroups; - } - - if ($groupCount > $maxGroups) { - $this->warnings[IPV6MaxGroups::CODE] = new IPV6MaxGroups(); - } elseif ($groupCount === $maxGroups) { - $this->warnings[IPV6Deprecated::CODE] = new IPV6Deprecated(); - } - } - - /** - * @return string - */ - protected function doParseDomainPart() - { - $domain = ''; - $label = ''; - $openedParenthesis = 0; - do { - $prev = $this->lexer->getPrevious(); - - $this->checkNotAllowedChars($this->lexer->token); - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->parseComments(); - $openedParenthesis += $this->getOpenedParenthesis(); - $this->lexer->moveNext(); - $tmpPrev = $this->lexer->getPrevious(); - if ($tmpPrev['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - $openedParenthesis--; - } - } - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - if ($openedParenthesis === 0) { - throw new UnopenedComment(); - } else { - $openedParenthesis--; - } - } - - $this->checkConsecutiveDots(); - $this->checkDomainPartExceptions($prev); - - if ($this->hasBrackets()) { - $this->parseDomainLiteral(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_DOT) { - $this->checkLabelLength($label); - $label = ''; - } else { - $label .= $this->lexer->token['value']; - } - - if ($this->isFWS()) { - $this->parseFWS(); - } - - $domain .= $this->lexer->token['value']; - $this->lexer->moveNext(); - if ($this->lexer->token['type'] === EmailLexer::S_SP) { - throw new CharNotAllowed(); - } - } while (null !== $this->lexer->token['type']); - - $this->checkLabelLength($label); - - return $domain; - } - - private function checkNotAllowedChars(array $token) - { - $notAllowed = [EmailLexer::S_BACKSLASH => true, EmailLexer::S_SLASH=> true]; - if (isset($notAllowed[$token['type']])) { - throw new CharNotAllowed(); - } - } - - /** - * @return string|false - */ - protected function parseDomainLiteral() - { - if ($this->lexer->isNextToken(EmailLexer::S_COLON)) { - $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); - } - if ($this->lexer->isNextToken(EmailLexer::S_IPV6TAG)) { - $lexer = clone $this->lexer; - $lexer->moveNext(); - if ($lexer->isNextToken(EmailLexer::S_DOUBLECOLON)) { - $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); - } - } - - return $this->doParseDomainLiteral(); - } - - /** - * @return string|false - */ - protected function doParseDomainLiteral() - { - $IPv6TAG = false; - $addressLiteral = ''; - do { - if ($this->lexer->token['type'] === EmailLexer::C_NUL) { - throw new ExpectingDTEXT(); - } - - if ($this->lexer->token['type'] === EmailLexer::INVALID || - $this->lexer->token['type'] === EmailLexer::C_DEL || - $this->lexer->token['type'] === EmailLexer::S_LF - ) { - $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); - } - - if ($this->lexer->isNextTokenAny(array(EmailLexer::S_OPENQBRACKET, EmailLexer::S_OPENBRACKET))) { - throw new ExpectingDTEXT(); - } - - if ($this->lexer->isNextTokenAny( - array(EmailLexer::S_HTAB, EmailLexer::S_SP, $this->lexer->token['type'] === EmailLexer::CRLF) - )) { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - $this->parseFWS(); - } - - if ($this->lexer->isNextToken(EmailLexer::S_CR)) { - throw new CRNoLF(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH) { - $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); - $addressLiteral .= $this->lexer->token['value']; - $this->lexer->moveNext(); - $this->validateQuotedPair(); - } - if ($this->lexer->token['type'] === EmailLexer::S_IPV6TAG) { - $IPv6TAG = true; - } - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEQBRACKET) { - break; - } - - $addressLiteral .= $this->lexer->token['value']; - - } while ($this->lexer->moveNext()); - - $addressLiteral = str_replace('[', '', $addressLiteral); - $addressLiteral = $this->checkIPV4Tag($addressLiteral); - - if (false === $addressLiteral) { - return $addressLiteral; - } - - if (!$IPv6TAG) { - $this->warnings[DomainLiteral::CODE] = new DomainLiteral(); - return $addressLiteral; - } - - $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); - - $this->checkIPV6Tag($addressLiteral); - - return $addressLiteral; - } - - /** - * @param string $addressLiteral - * - * @return string|false - */ - protected function checkIPV4Tag($addressLiteral) - { - $matchesIP = array(); - - // Extract IPv4 part from the end of the address-literal (if there is one) - if (preg_match( - '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', - $addressLiteral, - $matchesIP - ) > 0 - ) { - $index = strrpos($addressLiteral, $matchesIP[0]); - if ($index === 0) { - $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); - return false; - } - // Convert IPv4 part to IPv6 format for further testing - $addressLiteral = substr($addressLiteral, 0, (int) $index) . '0:0'; - } - - return $addressLiteral; - } - - protected function checkDomainPartExceptions(array $prev) - { - $invalidDomainTokens = array( - EmailLexer::S_DQUOTE => true, - EmailLexer::S_SQUOTE => true, - EmailLexer::S_BACKTICK => true, - EmailLexer::S_SEMICOLON => true, - EmailLexer::S_GREATERTHAN => true, - EmailLexer::S_LOWERTHAN => true, - ); - - if (isset($invalidDomainTokens[$this->lexer->token['type']])) { - throw new ExpectingATEXT(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_COMMA) { - throw new CommaInDomain(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - throw new ConsecutiveAt(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENQBRACKET && $prev['type'] !== EmailLexer::S_AT) { - throw new ExpectingATEXT(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new DomainHyphened(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH - && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - throw new ExpectingATEXT(); - } - } - - /** - * @return bool - */ - protected function hasBrackets() - { - if ($this->lexer->token['type'] !== EmailLexer::S_OPENBRACKET) { - return false; - } - - try { - $this->lexer->find(EmailLexer::S_CLOSEBRACKET); - } catch (\RuntimeException $e) { - throw new ExpectingDomainLiteralClose(); - } - - return true; - } - - /** - * @param string $label - */ - protected function checkLabelLength($label) - { - if ($this->isLabelTooLong($label)) { - $this->warnings[LabelTooLong::CODE] = new LabelTooLong(); - } - } - - /** - * @param string $label - * @return bool - */ - private function isLabelTooLong($label) - { - if (preg_match('/[^\x00-\x7F]/', $label)) { - idn_to_ascii($label, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46, $idnaInfo); - - return (bool) ($idnaInfo['errors'] & IDNA_ERROR_LABEL_TOO_LONG); - } - - return strlen($label) > self::LABEL_MAX_LENGTH; - } - - protected function parseDomainComments() - { - $this->isUnclosedComment(); - while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - $this->warnEscaping(); - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - if ($this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new ExpectingATEXT(); - } - } - - protected function addTLDWarnings() - { - if ($this->warnings[DomainLiteral::CODE]) { - $this->warnings[TLD::CODE] = new TLD(); - } - } -} diff --git a/vendor/egulias/email-validator/src/Parser/LocalPart.php b/vendor/egulias/email-validator/src/Parser/LocalPart.php deleted file mode 100644 index 3c21f34..0000000 --- a/vendor/egulias/email-validator/src/Parser/LocalPart.php +++ /dev/null @@ -1,145 +0,0 @@ -lexer->token['type'] !== EmailLexer::S_AT && null !== $this->lexer->token['type']) { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && null === $this->lexer->getPrevious()['type']) { - throw new DotAtStart(); - } - - $closingQuote = $this->checkDQUOTE($closingQuote); - if ($closingQuote && $parseDQuote) { - $parseDQuote = $this->parseDoubleQuote(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->parseComments(); - $openedParenthesis += $this->getOpenedParenthesis(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - if ($openedParenthesis === 0) { - throw new UnopenedComment(); - } - - $openedParenthesis--; - } - - $this->checkConsecutiveDots(); - - if ($this->lexer->token['type'] === EmailLexer::S_DOT && - $this->lexer->isNextToken(EmailLexer::S_AT) - ) { - throw new DotAtEnd(); - } - - $this->warnEscaping(); - $this->isInvalidToken($this->lexer->token, $closingQuote); - - if ($this->isFWS()) { - $this->parseFWS(); - } - - $totalLength += strlen($this->lexer->token['value']); - $this->lexer->moveNext(); - } - - if ($totalLength > LocalTooLong::LOCAL_PART_LENGTH) { - $this->warnings[LocalTooLong::CODE] = new LocalTooLong(); - } - } - - /** - * @return bool - */ - protected function parseDoubleQuote() - { - $parseAgain = true; - $special = array( - EmailLexer::S_CR => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_LF => true - ); - - $invalid = array( - EmailLexer::C_NUL => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_CR => true, - EmailLexer::S_LF => true - ); - $setSpecialsWarning = true; - - $this->lexer->moveNext(); - - while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && null !== $this->lexer->token['type']) { - $parseAgain = false; - if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - $setSpecialsWarning = false; - } - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH && $this->lexer->isNextToken(EmailLexer::S_DQUOTE)) { - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - - if (!$this->escaped() && isset($invalid[$this->lexer->token['type']])) { - throw new ExpectingATEXT(); - } - } - - $prev = $this->lexer->getPrevious(); - - if ($prev['type'] === EmailLexer::S_BACKSLASH) { - if (!$this->checkDQUOTE(false)) { - throw new UnclosedQuotedString(); - } - } - - if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { - throw new ExpectingAT(); - } - - return $parseAgain; - } - - /** - * @param bool $closingQuote - */ - protected function isInvalidToken(array $token, $closingQuote) - { - $forbidden = array( - EmailLexer::S_COMMA, - EmailLexer::S_CLOSEBRACKET, - EmailLexer::S_OPENBRACKET, - EmailLexer::S_GREATERTHAN, - EmailLexer::S_LOWERTHAN, - EmailLexer::S_COLON, - EmailLexer::S_SEMICOLON, - EmailLexer::INVALID - ); - - if (in_array($token['type'], $forbidden) && !$closingQuote) { - throw new ExpectingATEXT(); - } - } -} diff --git a/vendor/egulias/email-validator/src/Parser/Parser.php b/vendor/egulias/email-validator/src/Parser/Parser.php deleted file mode 100644 index ccdc938..0000000 --- a/vendor/egulias/email-validator/src/Parser/Parser.php +++ /dev/null @@ -1,249 +0,0 @@ -lexer = $lexer; - } - - /** - * @return \Egulias\EmailValidator\Warning\Warning[] - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * @param string $str - */ - abstract public function parse($str); - - /** @return int */ - public function getOpenedParenthesis() - { - return $this->openedParenthesis; - } - - /** - * validateQuotedPair - */ - protected function validateQuotedPair() - { - if (!($this->lexer->token['type'] === EmailLexer::INVALID - || $this->lexer->token['type'] === EmailLexer::C_DEL)) { - throw new ExpectingQPair(); - } - - $this->warnings[QuotedPart::CODE] = - new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); - } - - protected function parseComments() - { - $this->openedParenthesis = 1; - $this->isUnclosedComment(); - $this->warnings[Comment::CODE] = new Comment(); - while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - if ($this->lexer->isNextToken(EmailLexer::S_OPENPARENTHESIS)) { - $this->openedParenthesis++; - } - $this->warnEscaping(); - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - if ($this->lexer->isNextTokenAny(array(EmailLexer::GENERIC, EmailLexer::S_EMPTY))) { - throw new ExpectingATEXT(); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT)) { - $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); - } - } - - /** - * @return bool - */ - protected function isUnclosedComment() - { - try { - $this->lexer->find(EmailLexer::S_CLOSEPARENTHESIS); - return true; - } catch (\RuntimeException $e) { - throw new UnclosedComment(); - } - } - - protected function parseFWS() - { - $previous = $this->lexer->getPrevious(); - - $this->checkCRLFInFWS(); - - if ($this->lexer->token['type'] === EmailLexer::S_CR) { - throw new CRNoLF(); - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { - throw new AtextAfterCFWS(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { - throw new ExpectingCTEXT(); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type'] === EmailLexer::S_AT) { - $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); - } else { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - } - } - - protected function checkConsecutiveDots() - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new ConsecutiveDot(); - } - } - - /** - * @return bool - */ - protected function isFWS() - { - if ($this->escaped()) { - return false; - } - - if ($this->lexer->token['type'] === EmailLexer::S_SP || - $this->lexer->token['type'] === EmailLexer::S_HTAB || - $this->lexer->token['type'] === EmailLexer::S_CR || - $this->lexer->token['type'] === EmailLexer::S_LF || - $this->lexer->token['type'] === EmailLexer::CRLF - ) { - return true; - } - - return false; - } - - /** - * @return bool - */ - protected function escaped() - { - $previous = $this->lexer->getPrevious(); - - if ($previous && $previous['type'] === EmailLexer::S_BACKSLASH - && - $this->lexer->token['type'] !== EmailLexer::GENERIC - ) { - return true; - } - - return false; - } - - /** - * @return bool - */ - protected function warnEscaping() - { - if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { - return false; - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC)) { - throw new ExpectingATEXT(); - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { - return false; - } - - $this->warnings[QuotedPart::CODE] = - new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); - return true; - - } - - /** - * @param bool $hasClosingQuote - * - * @return bool - */ - protected function checkDQUOTE($hasClosingQuote) - { - if ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE) { - return $hasClosingQuote; - } - if ($hasClosingQuote) { - return $hasClosingQuote; - } - $previous = $this->lexer->getPrevious(); - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] === EmailLexer::GENERIC) { - throw new ExpectingATEXT(); - } - - try { - $this->lexer->find(EmailLexer::S_DQUOTE); - $hasClosingQuote = true; - } catch (\Exception $e) { - throw new UnclosedQuotedString(); - } - $this->warnings[QuotedString::CODE] = new QuotedString($previous['value'], $this->lexer->token['value']); - - return $hasClosingQuote; - } - - protected function checkCRLFInFWS() - { - if ($this->lexer->token['type'] !== EmailLexer::CRLF) { - return; - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - throw new CRLFX2(); - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - throw new CRLFAtTheEnd(); - } - } -} diff --git a/vendor/egulias/email-validator/src/Validation/DNSCheckValidation.php b/vendor/egulias/email-validator/src/Validation/DNSCheckValidation.php deleted file mode 100644 index 491082a..0000000 --- a/vendor/egulias/email-validator/src/Validation/DNSCheckValidation.php +++ /dev/null @@ -1,166 +0,0 @@ -error = new LocalOrReservedDomain(); - return false; - } - - return $this->checkDns($host); - } - - public function getError() - { - return $this->error; - } - - public function getWarnings() - { - return $this->warnings; - } - - /** - * @param string $host - * - * @return bool - */ - protected function checkDns($host) - { - $variant = INTL_IDNA_VARIANT_UTS46; - - $host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.'; - - return $this->validateDnsRecords($host); - } - - - /** - * Validate the DNS records for given host. - * - * @param string $host A set of DNS records in the format returned by dns_get_record. - * - * @return bool True on success. - */ - private function validateDnsRecords($host) - { - // Get all MX, A and AAAA DNS records for host - // Using @ as workaround to fix https://bugs.php.net/bug.php?id=73149 - $dnsRecords = @dns_get_record($host, DNS_MX + DNS_A + DNS_AAAA); - - - // No MX, A or AAAA DNS records - if (empty($dnsRecords)) { - $this->error = new NoDNSRecord(); - return false; - } - - // For each DNS record - foreach ($dnsRecords as $dnsRecord) { - if (!$this->validateMXRecord($dnsRecord)) { - return false; - } - } - - // No MX records (fallback to A or AAAA records) - if (empty($this->mxRecords)) { - $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord(); - } - - return true; - } - - /** - * Validate an MX record - * - * @param array $dnsRecord Given DNS record. - * - * @return bool True if valid. - */ - private function validateMxRecord($dnsRecord) - { - if ($dnsRecord['type'] !== 'MX') { - return true; - } - - // "Null MX" record indicates the domain accepts no mail (https://tools.ietf.org/html/rfc7505) - if (empty($dnsRecord['target']) || $dnsRecord['target'] === '.') { - $this->error = new DomainAcceptsNoMail(); - return false; - } - - $this->mxRecords[] = $dnsRecord; - - return true; - } -} diff --git a/vendor/egulias/email-validator/src/Validation/EmailValidation.php b/vendor/egulias/email-validator/src/Validation/EmailValidation.php deleted file mode 100644 index d5a015b..0000000 --- a/vendor/egulias/email-validator/src/Validation/EmailValidation.php +++ /dev/null @@ -1,34 +0,0 @@ -errors = $errors; - parent::__construct(); - } - - /** - * @return InvalidEmail[] - */ - public function getErrors() - { - return $this->errors; - } -} diff --git a/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php b/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php deleted file mode 100644 index feb2240..0000000 --- a/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php +++ /dev/null @@ -1,124 +0,0 @@ -validations = $validations; - $this->mode = $mode; - } - - /** - * {@inheritdoc} - */ - public function isValid($email, EmailLexer $emailLexer) - { - $result = true; - $errors = []; - foreach ($this->validations as $validation) { - $emailLexer->reset(); - $validationResult = $validation->isValid($email, $emailLexer); - $result = $result && $validationResult; - $this->warnings = array_merge($this->warnings, $validation->getWarnings()); - $errors = $this->addNewError($validation->getError(), $errors); - - if ($this->shouldStop($result)) { - break; - } - } - - if (!empty($errors)) { - $this->error = new MultipleErrors($errors); - } - - return $result; - } - - /** - * @param \Egulias\EmailValidator\Exception\InvalidEmail|null $possibleError - * @param \Egulias\EmailValidator\Exception\InvalidEmail[] $errors - * - * @return \Egulias\EmailValidator\Exception\InvalidEmail[] - */ - private function addNewError($possibleError, array $errors) - { - if (null !== $possibleError) { - $errors[] = $possibleError; - } - - return $errors; - } - - /** - * @param bool $result - * - * @return bool - */ - private function shouldStop($result) - { - return !$result && $this->mode === self::STOP_ON_ERROR; - } - - /** - * Returns the validation errors. - * - * @return MultipleErrors|null - */ - public function getError() - { - return $this->error; - } - - /** - * {@inheritdoc} - */ - public function getWarnings() - { - return $this->warnings; - } -} diff --git a/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php b/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php deleted file mode 100644 index 6b31e54..0000000 --- a/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php +++ /dev/null @@ -1,41 +0,0 @@ -getWarnings())) { - return true; - } - - $this->error = new RFCWarnings(); - - return false; - } - - /** - * {@inheritdoc} - */ - public function getError() - { - return $this->error ?: parent::getError(); - } -} diff --git a/vendor/egulias/email-validator/src/Validation/RFCValidation.php b/vendor/egulias/email-validator/src/Validation/RFCValidation.php deleted file mode 100644 index 8781e0b..0000000 --- a/vendor/egulias/email-validator/src/Validation/RFCValidation.php +++ /dev/null @@ -1,49 +0,0 @@ -parser = new EmailParser($emailLexer); - try { - $this->parser->parse((string)$email); - } catch (InvalidEmail $invalid) { - $this->error = $invalid; - return false; - } - - $this->warnings = $this->parser->getWarnings(); - return true; - } - - public function getError() - { - return $this->error; - } - - public function getWarnings() - { - return $this->warnings; - } -} diff --git a/vendor/egulias/email-validator/src/Validation/SpoofCheckValidation.php b/vendor/egulias/email-validator/src/Validation/SpoofCheckValidation.php deleted file mode 100644 index e10bfab..0000000 --- a/vendor/egulias/email-validator/src/Validation/SpoofCheckValidation.php +++ /dev/null @@ -1,51 +0,0 @@ -setChecks(Spoofchecker::SINGLE_SCRIPT); - - if ($checker->isSuspicious($email)) { - $this->error = new SpoofEmail(); - } - - return $this->error === null; - } - - /** - * @return InvalidEmail|null - */ - public function getError() - { - return $this->error; - } - - public function getWarnings() - { - return []; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/AddressLiteral.php b/vendor/egulias/email-validator/src/Warning/AddressLiteral.php deleted file mode 100644 index 77e70f7..0000000 --- a/vendor/egulias/email-validator/src/Warning/AddressLiteral.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Address literal in domain part'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/CFWSNearAt.php b/vendor/egulias/email-validator/src/Warning/CFWSNearAt.php deleted file mode 100644 index be43bbe..0000000 --- a/vendor/egulias/email-validator/src/Warning/CFWSNearAt.php +++ /dev/null @@ -1,13 +0,0 @@ -message = "Deprecated folding white space near @"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/CFWSWithFWS.php b/vendor/egulias/email-validator/src/Warning/CFWSWithFWS.php deleted file mode 100644 index dea3450..0000000 --- a/vendor/egulias/email-validator/src/Warning/CFWSWithFWS.php +++ /dev/null @@ -1,13 +0,0 @@ -message = 'Folding whites space followed by folding white space'; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/Comment.php b/vendor/egulias/email-validator/src/Warning/Comment.php deleted file mode 100644 index 704c290..0000000 --- a/vendor/egulias/email-validator/src/Warning/Comment.php +++ /dev/null @@ -1,13 +0,0 @@ -message = "Comments found in this email"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/DeprecatedComment.php b/vendor/egulias/email-validator/src/Warning/DeprecatedComment.php deleted file mode 100644 index ad43bd7..0000000 --- a/vendor/egulias/email-validator/src/Warning/DeprecatedComment.php +++ /dev/null @@ -1,13 +0,0 @@ -message = 'Deprecated comments'; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/DomainLiteral.php b/vendor/egulias/email-validator/src/Warning/DomainLiteral.php deleted file mode 100644 index 6f36b5e..0000000 --- a/vendor/egulias/email-validator/src/Warning/DomainLiteral.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Domain Literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/DomainTooLong.php b/vendor/egulias/email-validator/src/Warning/DomainTooLong.php deleted file mode 100644 index 61ff17a..0000000 --- a/vendor/egulias/email-validator/src/Warning/DomainTooLong.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Domain is too long, exceeds 255 chars'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/EmailTooLong.php b/vendor/egulias/email-validator/src/Warning/EmailTooLong.php deleted file mode 100644 index 497309d..0000000 --- a/vendor/egulias/email-validator/src/Warning/EmailTooLong.php +++ /dev/null @@ -1,15 +0,0 @@ -message = 'Email is too long, exceeds ' . EmailParser::EMAIL_MAX_LENGTH; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6BadChar.php b/vendor/egulias/email-validator/src/Warning/IPV6BadChar.php deleted file mode 100644 index ba2fcc0..0000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6BadChar.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Bad char in IPV6 domain literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6ColonEnd.php b/vendor/egulias/email-validator/src/Warning/IPV6ColonEnd.php deleted file mode 100644 index 41afa78..0000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6ColonEnd.php +++ /dev/null @@ -1,14 +0,0 @@ -message = ':: found at the end of the domain literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6ColonStart.php b/vendor/egulias/email-validator/src/Warning/IPV6ColonStart.php deleted file mode 100644 index 1bf754e..0000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6ColonStart.php +++ /dev/null @@ -1,14 +0,0 @@ -message = ':: found at the start of the domain literal'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6Deprecated.php b/vendor/egulias/email-validator/src/Warning/IPV6Deprecated.php deleted file mode 100644 index d752caa..0000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6Deprecated.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Deprecated form of IPV6'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6DoubleColon.php b/vendor/egulias/email-validator/src/Warning/IPV6DoubleColon.php deleted file mode 100644 index 4f82394..0000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6DoubleColon.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Double colon found after IPV6 tag'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6GroupCount.php b/vendor/egulias/email-validator/src/Warning/IPV6GroupCount.php deleted file mode 100644 index a59d317..0000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6GroupCount.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Group count is not IPV6 valid'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/IPV6MaxGroups.php b/vendor/egulias/email-validator/src/Warning/IPV6MaxGroups.php deleted file mode 100644 index 936274c..0000000 --- a/vendor/egulias/email-validator/src/Warning/IPV6MaxGroups.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Reached the maximum number of IPV6 groups allowed'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/LabelTooLong.php b/vendor/egulias/email-validator/src/Warning/LabelTooLong.php deleted file mode 100644 index daf07f4..0000000 --- a/vendor/egulias/email-validator/src/Warning/LabelTooLong.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'Label too long'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/LocalTooLong.php b/vendor/egulias/email-validator/src/Warning/LocalTooLong.php deleted file mode 100644 index 0d08d8b..0000000 --- a/vendor/egulias/email-validator/src/Warning/LocalTooLong.php +++ /dev/null @@ -1,15 +0,0 @@ -message = 'Local part is too long, exceeds 64 chars (octets)'; - $this->rfcNumber = 5322; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/NoDNSMXRecord.php b/vendor/egulias/email-validator/src/Warning/NoDNSMXRecord.php deleted file mode 100644 index b3c21a1..0000000 --- a/vendor/egulias/email-validator/src/Warning/NoDNSMXRecord.php +++ /dev/null @@ -1,14 +0,0 @@ -message = 'No MX DSN record was found for this email'; - $this->rfcNumber = 5321; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/ObsoleteDTEXT.php b/vendor/egulias/email-validator/src/Warning/ObsoleteDTEXT.php deleted file mode 100644 index 10f19e3..0000000 --- a/vendor/egulias/email-validator/src/Warning/ObsoleteDTEXT.php +++ /dev/null @@ -1,14 +0,0 @@ -rfcNumber = 5322; - $this->message = 'Obsolete DTEXT in domain literal'; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/QuotedPart.php b/vendor/egulias/email-validator/src/Warning/QuotedPart.php deleted file mode 100644 index 36a4265..0000000 --- a/vendor/egulias/email-validator/src/Warning/QuotedPart.php +++ /dev/null @@ -1,17 +0,0 @@ -message = "Deprecated Quoted String found between $prevToken and $postToken"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/QuotedString.php b/vendor/egulias/email-validator/src/Warning/QuotedString.php deleted file mode 100644 index 817e4e8..0000000 --- a/vendor/egulias/email-validator/src/Warning/QuotedString.php +++ /dev/null @@ -1,17 +0,0 @@ -message = "Quoted String found between $prevToken and $postToken"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/TLD.php b/vendor/egulias/email-validator/src/Warning/TLD.php deleted file mode 100644 index 2338b9f..0000000 --- a/vendor/egulias/email-validator/src/Warning/TLD.php +++ /dev/null @@ -1,13 +0,0 @@ -message = "RFC5321, TLD"; - } -} diff --git a/vendor/egulias/email-validator/src/Warning/Warning.php b/vendor/egulias/email-validator/src/Warning/Warning.php deleted file mode 100644 index a2ee7b0..0000000 --- a/vendor/egulias/email-validator/src/Warning/Warning.php +++ /dev/null @@ -1,47 +0,0 @@ -message; - } - - /** - * @return int - */ - public function code() - { - return static::CODE; - } - - /** - * @return int - */ - public function RFCNumber() - { - return $this->rfcNumber; - } - - public function __toString() - { - return $this->message() . " rfc: " . $this->rfcNumber . "interal code: " . static::CODE; - } -} diff --git a/vendor/lcobucci/clock/LICENSE b/vendor/lcobucci/clock/LICENSE deleted file mode 100644 index 58ea944..0000000 --- a/vendor/lcobucci/clock/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Luís Cobucci - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/lcobucci/clock/composer.json b/vendor/lcobucci/clock/composer.json deleted file mode 100644 index e0d2f78..0000000 --- a/vendor/lcobucci/clock/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "lcobucci/clock", - "description": "Yet another clock abstraction", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Luís Cobucci", - "email": "lcobucci@gmail.com" - } - ], - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "infection/infection": "^0.17", - "lcobucci/coding-standard": "^6.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/php-code-coverage": "9.1.4", - "phpunit/phpunit": "9.3.7" - }, - "autoload": { - "psr-4": { - "Lcobucci\\Clock\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Lcobucci\\Clock\\": "test" - } - }, - "config": { - "preferred-install": "dist", - "sort-packages": true - } -} diff --git a/vendor/lcobucci/clock/src/Clock.php b/vendor/lcobucci/clock/src/Clock.php deleted file mode 100644 index f356776..0000000 --- a/vendor/lcobucci/clock/src/Clock.php +++ /dev/null @@ -1,11 +0,0 @@ -now = $now; - } - - public static function fromUTC(): self - { - return new self(new DateTimeImmutable('now', new DateTimeZone('UTC'))); - } - - public function setTo(DateTimeImmutable $now): void - { - $this->now = $now; - } - - public function now(): DateTimeImmutable - { - return $this->now; - } -} diff --git a/vendor/lcobucci/clock/src/SystemClock.php b/vendor/lcobucci/clock/src/SystemClock.php deleted file mode 100644 index f40559c..0000000 --- a/vendor/lcobucci/clock/src/SystemClock.php +++ /dev/null @@ -1,34 +0,0 @@ -timezone = $timezone; - } - - public static function fromUTC(): self - { - return new self(new DateTimeZone('UTC')); - } - - public static function fromSystemTimezone(): self - { - return new self(new DateTimeZone(date_default_timezone_get())); - } - - public function now(): DateTimeImmutable - { - return new DateTimeImmutable('now', $this->timezone); - } -} diff --git a/vendor/lcobucci/jwt/LICENSE b/vendor/lcobucci/jwt/LICENSE deleted file mode 100644 index cc7e28f..0000000 --- a/vendor/lcobucci/jwt/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014, Luís Cobucci -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the {organization} nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/lcobucci/jwt/composer.json b/vendor/lcobucci/jwt/composer.json deleted file mode 100644 index a3dea13..0000000 --- a/vendor/lcobucci/jwt/composer.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "lcobucci/jwt", - "type": "library", - "description": "A simple library to work with JSON Web Token and JSON Web Signature", - "keywords": [ - "JWT", - "JWS" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Luís Cobucci", - "email": "lcobucci@gmail.com", - "role": "Developer" - } - ], - "require": { - "php": "^7.4 || ^8.0", - "ext-hash": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "ext-sodium": "*", - "lcobucci/clock": "^2.0" - }, - "require-dev": { - "infection/infection": "^0.21", - "lcobucci/coding-standard": "^6.0", - "mikey179/vfsstream": "^1.6.7", - "phpbench/phpbench": "^1.0@alpha", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/php-invoker": "^3.1", - "phpunit/phpunit": "^9.5" - }, - "config": { - "preferred-install": "dist", - "sort-packages": true - }, - "autoload": { - "psr-4": { - "Lcobucci\\JWT\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Lcobucci\\JWT\\": [ - "test/_keys", - "test/unit", - "test/performance" - ], - "Lcobucci\\JWT\\FunctionalTests\\": "test/functional" - } - } -} diff --git a/vendor/lcobucci/jwt/src/Builder.php b/vendor/lcobucci/jwt/src/Builder.php deleted file mode 100644 index 531e9d3..0000000 --- a/vendor/lcobucci/jwt/src/Builder.php +++ /dev/null @@ -1,77 +0,0 @@ - $claims - * - * @return array - */ - public function formatClaims(array $claims): array; -} diff --git a/vendor/lcobucci/jwt/src/Configuration.php b/vendor/lcobucci/jwt/src/Configuration.php deleted file mode 100644 index 8da1c8a..0000000 --- a/vendor/lcobucci/jwt/src/Configuration.php +++ /dev/null @@ -1,154 +0,0 @@ -signer = $signer; - $this->signingKey = $signingKey; - $this->verificationKey = $verificationKey; - $this->parser = new Token\Parser($decoder ?? new JoseEncoder()); - $this->validator = new Validation\Validator(); - - $this->builderFactory = static function (ClaimsFormatter $claimFormatter) use ($encoder): Builder { - return new Token\Builder($encoder ?? new JoseEncoder(), $claimFormatter); - }; - } - - public static function forAsymmetricSigner( - Signer $signer, - Key $signingKey, - Key $verificationKey, - ?Encoder $encoder = null, - ?Decoder $decoder = null - ): self { - return new self( - $signer, - $signingKey, - $verificationKey, - $encoder, - $decoder - ); - } - - public static function forSymmetricSigner( - Signer $signer, - Key $key, - ?Encoder $encoder = null, - ?Decoder $decoder = null - ): self { - return new self( - $signer, - $key, - $key, - $encoder, - $decoder - ); - } - - public static function forUnsecuredSigner( - ?Encoder $encoder = null, - ?Decoder $decoder = null - ): self { - $key = InMemory::empty(); - - return new self( - new None(), - $key, - $key, - $encoder, - $decoder - ); - } - - /** @param callable(ClaimsFormatter): Builder $builderFactory */ - public function setBuilderFactory(callable $builderFactory): void - { - $this->builderFactory = Closure::fromCallable($builderFactory); - } - - public function builder(?ClaimsFormatter $claimFormatter = null): Builder - { - return ($this->builderFactory)($claimFormatter ?? ChainedFormatter::default()); - } - - public function parser(): Parser - { - return $this->parser; - } - - public function setParser(Parser $parser): void - { - $this->parser = $parser; - } - - public function signer(): Signer - { - return $this->signer; - } - - public function signingKey(): Key - { - return $this->signingKey; - } - - public function verificationKey(): Key - { - return $this->verificationKey; - } - - public function validator(): Validator - { - return $this->validator; - } - - public function setValidator(Validator $validator): void - { - $this->validator = $validator; - } - - /** @return Constraint[] */ - public function validationConstraints(): array - { - return $this->validationConstraints; - } - - public function setValidationConstraints(Constraint ...$validationConstraints): void - { - $this->validationConstraints = $validationConstraints; - } -} diff --git a/vendor/lcobucci/jwt/src/Decoder.php b/vendor/lcobucci/jwt/src/Decoder.php deleted file mode 100644 index 10fc991..0000000 --- a/vendor/lcobucci/jwt/src/Decoder.php +++ /dev/null @@ -1,27 +0,0 @@ - */ - private array $formatters; - - public function __construct(ClaimsFormatter ...$formatters) - { - $this->formatters = $formatters; - } - - public static function default(): self - { - return new self(new UnifyAudience(), new MicrosecondBasedDateConversion()); - } - - public static function withUnixTimestampDates(): self - { - return new self(new UnifyAudience(), new UnixTimestampDates()); - } - - /** @inheritdoc */ - public function formatClaims(array $claims): array - { - foreach ($this->formatters as $formatter) { - $claims = $formatter->formatClaims($claims); - } - - return $claims; - } -} diff --git a/vendor/lcobucci/jwt/src/Encoding/JoseEncoder.php b/vendor/lcobucci/jwt/src/Encoding/JoseEncoder.php deleted file mode 100644 index 597d15f..0000000 --- a/vendor/lcobucci/jwt/src/Encoding/JoseEncoder.php +++ /dev/null @@ -1,60 +0,0 @@ -convertDate($claims[$claim]); - } - - return $claims; - } - - /** @return int|string */ - private function convertDate(DateTimeImmutable $date) - { - $seconds = $date->format('U'); - $microseconds = $date->format('u'); - - if ((int) $microseconds === 0) { - return (int) $seconds; - } - - return $seconds . '.' . $microseconds; - } -} diff --git a/vendor/lcobucci/jwt/src/Encoding/UnifyAudience.php b/vendor/lcobucci/jwt/src/Encoding/UnifyAudience.php deleted file mode 100644 index cf57252..0000000 --- a/vendor/lcobucci/jwt/src/Encoding/UnifyAudience.php +++ /dev/null @@ -1,29 +0,0 @@ -convertDate($claims[$claim]); - } - - return $claims; - } - - private function convertDate(DateTimeImmutable $date): int - { - return $date->getTimestamp(); - } -} diff --git a/vendor/lcobucci/jwt/src/Exception.php b/vendor/lcobucci/jwt/src/Exception.php deleted file mode 100644 index 4b3916e..0000000 --- a/vendor/lcobucci/jwt/src/Exception.php +++ /dev/null @@ -1,10 +0,0 @@ -converter = $converter; - } - - public static function create(): Ecdsa - { - return new static(new MultibyteStringConverter()); // @phpstan-ignore-line - } - - final public function sign(string $payload, Key $key): string - { - return $this->converter->fromAsn1( - $this->createSignature($key->contents(), $key->passphrase(), $payload), - $this->keyLength() - ); - } - - final public function verify(string $expected, string $payload, Key $key): bool - { - return $this->verifySignature( - $this->converter->toAsn1($expected, $this->keyLength()), - $payload, - $key->contents() - ); - } - - final public function keyType(): int - { - return OPENSSL_KEYTYPE_EC; - } - - /** - * Returns the length of each point in the signature, so that we can calculate and verify R and S points properly - * - * @internal - */ - abstract public function keyLength(): int; -} diff --git a/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php b/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php deleted file mode 100644 index d9ca751..0000000 --- a/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php +++ /dev/null @@ -1,25 +0,0 @@ - self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : ''; - - $asn1 = hex2bin( - self::ASN1_SEQUENCE - . $lengthPrefix . dechex($totalLength) - . self::ASN1_INTEGER . dechex($lengthR) . $pointR - . self::ASN1_INTEGER . dechex($lengthS) . $pointS - ); - assert(is_string($asn1)); - - return $asn1; - } - - private static function octetLength(string $data): int - { - return (int) (mb_strlen($data, '8bit') / self::BYTE_SIZE); - } - - private static function preparePositiveInteger(string $data): string - { - if (mb_substr($data, 0, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) { - return self::ASN1_NEGATIVE_INTEGER . $data; - } - - while ( - mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER - && mb_substr($data, 2, self::BYTE_SIZE, '8bit') <= self::ASN1_BIG_INTEGER_LIMIT - ) { - $data = mb_substr($data, 2, null, '8bit'); - } - - return $data; - } - - public function fromAsn1(string $signature, int $length): string - { - $message = bin2hex($signature); - $position = 0; - - if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_SEQUENCE) { - throw ConversionFailed::incorrectStartSequence(); - } - - // @phpstan-ignore-next-line - if (self::readAsn1Content($message, $position, self::BYTE_SIZE) === self::ASN1_LENGTH_2BYTES) { - $position += self::BYTE_SIZE; - } - - $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); - $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); - - $points = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT) . str_pad($pointS, $length, '0', STR_PAD_LEFT)); - assert(is_string($points)); - - return $points; - } - - private static function readAsn1Content(string $message, int &$position, int $length): string - { - $content = mb_substr($message, $position, $length, '8bit'); - $position += $length; - - return $content; - } - - private static function readAsn1Integer(string $message, int &$position): string - { - if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_INTEGER) { - throw ConversionFailed::integerExpected(); - } - - $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE)); - - return self::readAsn1Content($message, $position, $length * self::BYTE_SIZE); - } - - private static function retrievePositiveInteger(string $data): string - { - while ( - mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER - && mb_substr($data, 2, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT - ) { - $data = mb_substr($data, 2, null, '8bit'); - } - - return $data; - } -} diff --git a/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php b/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php deleted file mode 100644 index 36f6ec1..0000000 --- a/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php +++ /dev/null @@ -1,26 +0,0 @@ -contents()); - } catch (SodiumException $sodiumException) { - throw new InvalidKeyProvided($sodiumException->getMessage(), 0, $sodiumException); - } - } - - public function verify(string $expected, string $payload, Key $key): bool - { - try { - return sodium_crypto_sign_verify_detached($expected, $payload, $key->contents()); - } catch (SodiumException $sodiumException) { - throw new InvalidKeyProvided($sodiumException->getMessage(), 0, $sodiumException); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Signer/Hmac.php b/vendor/lcobucci/jwt/src/Signer/Hmac.php deleted file mode 100644 index 05b46bc..0000000 --- a/vendor/lcobucci/jwt/src/Signer/Hmac.php +++ /dev/null @@ -1,24 +0,0 @@ -algorithm(), $payload, $key->contents(), true); - } - - final public function verify(string $expected, string $payload, Key $key): bool - { - return hash_equals($expected, $this->sign($payload, $key)); - } - - abstract public function algorithm(): string; -} diff --git a/vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php b/vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php deleted file mode 100644 index 4be692e..0000000 --- a/vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php +++ /dev/null @@ -1,19 +0,0 @@ -contents = $contents; - $this->passphrase = $passphrase; - } - - public static function empty(): self - { - return new self('', ''); - } - - public static function plainText(string $contents, string $passphrase = ''): self - { - return new self($contents, $passphrase); - } - - public static function base64Encoded(string $contents, string $passphrase = ''): self - { - $decoded = SodiumBase64Polyfill::base642bin( - $contents, - SodiumBase64Polyfill::SODIUM_BASE64_VARIANT_ORIGINAL - ); - - return new self($decoded, $passphrase); - } - - /** @throws FileCouldNotBeRead */ - public static function file(string $path, string $passphrase = ''): self - { - try { - $file = new SplFileObject($path); - } catch (Throwable $exception) { - throw FileCouldNotBeRead::onPath($path, $exception); - } - - $contents = $file->fread($file->getSize()); - assert(is_string($contents)); - - return new self($contents, $passphrase); - } - - public function contents(): string - { - return $this->contents; - } - - public function passphrase(): string - { - return $this->passphrase; - } -} diff --git a/vendor/lcobucci/jwt/src/Signer/Key/LocalFileReference.php b/vendor/lcobucci/jwt/src/Signer/Key/LocalFileReference.php deleted file mode 100644 index 4663e9e..0000000 --- a/vendor/lcobucci/jwt/src/Signer/Key/LocalFileReference.php +++ /dev/null @@ -1,48 +0,0 @@ -path = $path; - $this->passphrase = $passphrase; - } - - /** @throws FileCouldNotBeRead */ - public static function file(string $path, string $passphrase = ''): self - { - if (strpos($path, self::PATH_PREFIX) === 0) { - $path = substr($path, 7); - } - - if (! file_exists($path)) { - throw FileCouldNotBeRead::onPath($path); - } - - return new self($path, $passphrase); - } - - public function contents(): string - { - return self::PATH_PREFIX . $this->path; - } - - public function passphrase(): string - { - return $this->passphrase; - } -} diff --git a/vendor/lcobucci/jwt/src/Signer/None.php b/vendor/lcobucci/jwt/src/Signer/None.php deleted file mode 100644 index 4e6ecb1..0000000 --- a/vendor/lcobucci/jwt/src/Signer/None.php +++ /dev/null @@ -1,26 +0,0 @@ -getPrivateKey($pem, $passphrase); - - try { - $signature = ''; - - if (! openssl_sign($payload, $signature, $key, $this->algorithm())) { - $error = openssl_error_string(); - assert(is_string($error)); - - throw CannotSignPayload::errorHappened($error); - } - - return $signature; - } finally { - $this->freeKey($key); - } - } - - /** - * @return resource|OpenSSLAsymmetricKey - * - * @throws CannotSignPayload - */ - private function getPrivateKey(string $pem, string $passphrase) - { - $privateKey = openssl_pkey_get_private($pem, $passphrase); - $this->validateKey($privateKey); - - return $privateKey; - } - - /** @throws InvalidKeyProvided */ - final protected function verifySignature( - string $expected, - string $payload, - string $pem - ): bool { - $key = $this->getPublicKey($pem); - $result = openssl_verify($payload, $expected, $key, $this->algorithm()); - $this->freeKey($key); - - return $result === 1; - } - - /** - * @return resource|OpenSSLAsymmetricKey - * - * @throws InvalidKeyProvided - */ - private function getPublicKey(string $pem) - { - $publicKey = openssl_pkey_get_public($pem); - $this->validateKey($publicKey); - - return $publicKey; - } - - /** - * Raises an exception when the key type is not the expected type - * - * @param resource|OpenSSLAsymmetricKey|bool $key - * - * @throws InvalidKeyProvided - */ - private function validateKey($key): void - { - if (is_bool($key)) { - $error = openssl_error_string(); - assert(is_string($error)); - - throw InvalidKeyProvided::cannotBeParsed($error); - } - - $details = openssl_pkey_get_details($key); - assert(is_array($details)); - - if (! array_key_exists('key', $details) || $details['type'] !== $this->keyType()) { - throw InvalidKeyProvided::incompatibleKey(); - } - } - - /** @param resource|OpenSSLAsymmetricKey $key */ - private function freeKey($key): void - { - if ($key instanceof OpenSSLAsymmetricKey) { - return; - } - - openssl_free_key($key); // Deprecated and no longer necessary as of PHP >= 8.0 - } - - /** - * Returns the type of key to be used to create/verify the signature (using OpenSSL constants) - * - * @internal - */ - abstract public function keyType(): int; - - /** - * Returns which algorithm to be used to create/verify the signature (using OpenSSL constants) - * - * @internal - */ - abstract public function algorithm(): int; -} diff --git a/vendor/lcobucci/jwt/src/Signer/Rsa.php b/vendor/lcobucci/jwt/src/Signer/Rsa.php deleted file mode 100644 index ff54dd3..0000000 --- a/vendor/lcobucci/jwt/src/Signer/Rsa.php +++ /dev/null @@ -1,24 +0,0 @@ -createSignature($key->contents(), $key->passphrase(), $payload); - } - - final public function verify(string $expected, string $payload, Key $key): bool - { - return $this->verifySignature($expected, $payload, $key->contents()); - } - - final public function keyType(): int - { - return OPENSSL_KEYTYPE_RSA; - } -} diff --git a/vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php b/vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php deleted file mode 100644 index 9e56c70..0000000 --- a/vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php +++ /dev/null @@ -1,21 +0,0 @@ - */ - private array $headers = ['typ' => 'JWT', 'alg' => null]; - - /** @var array */ - private array $claims = []; - - private Encoder $encoder; - private ClaimsFormatter $claimFormatter; - - public function __construct(Encoder $encoder, ClaimsFormatter $claimFormatter) - { - $this->encoder = $encoder; - $this->claimFormatter = $claimFormatter; - } - - public function permittedFor(string ...$audiences): BuilderInterface - { - $configured = $this->claims[RegisteredClaims::AUDIENCE] ?? []; - $toAppend = array_diff($audiences, $configured); - - return $this->setClaim(RegisteredClaims::AUDIENCE, array_merge($configured, $toAppend)); - } - - public function expiresAt(DateTimeImmutable $expiration): BuilderInterface - { - return $this->setClaim(RegisteredClaims::EXPIRATION_TIME, $expiration); - } - - public function identifiedBy(string $id): BuilderInterface - { - return $this->setClaim(RegisteredClaims::ID, $id); - } - - public function issuedAt(DateTimeImmutable $issuedAt): BuilderInterface - { - return $this->setClaim(RegisteredClaims::ISSUED_AT, $issuedAt); - } - - public function issuedBy(string $issuer): BuilderInterface - { - return $this->setClaim(RegisteredClaims::ISSUER, $issuer); - } - - public function canOnlyBeUsedAfter(DateTimeImmutable $notBefore): BuilderInterface - { - return $this->setClaim(RegisteredClaims::NOT_BEFORE, $notBefore); - } - - public function relatedTo(string $subject): BuilderInterface - { - return $this->setClaim(RegisteredClaims::SUBJECT, $subject); - } - - /** @inheritdoc */ - public function withHeader(string $name, $value): BuilderInterface - { - $this->headers[$name] = $value; - - return $this; - } - - /** @inheritdoc */ - public function withClaim(string $name, $value): BuilderInterface - { - if (in_array($name, RegisteredClaims::ALL, true)) { - throw RegisteredClaimGiven::forClaim($name); - } - - return $this->setClaim($name, $value); - } - - /** @param mixed $value */ - private function setClaim(string $name, $value): BuilderInterface - { - $this->claims[$name] = $value; - - return $this; - } - - /** - * @param array $items - * - * @throws CannotEncodeContent When data cannot be converted to JSON. - */ - private function encode(array $items): string - { - return $this->encoder->base64UrlEncode( - $this->encoder->jsonEncode($items) - ); - } - - public function getToken(Signer $signer, Key $key): Plain - { - $headers = $this->headers; - $headers['alg'] = $signer->algorithmId(); - - $encodedHeaders = $this->encode($headers); - $encodedClaims = $this->encode($this->claimFormatter->formatClaims($this->claims)); - - $signature = $signer->sign($encodedHeaders . '.' . $encodedClaims, $key); - $encodedSignature = $this->encoder->base64UrlEncode($signature); - - return new Plain( - new DataSet($headers, $encodedHeaders), - new DataSet($this->claims, $encodedClaims), - new Signature($signature, $encodedSignature) - ); - } -} diff --git a/vendor/lcobucci/jwt/src/Token/DataSet.php b/vendor/lcobucci/jwt/src/Token/DataSet.php deleted file mode 100644 index f9256d6..0000000 --- a/vendor/lcobucci/jwt/src/Token/DataSet.php +++ /dev/null @@ -1,46 +0,0 @@ - */ - private array $data; - private string $encoded; - - /** @param mixed[] $data */ - public function __construct(array $data, string $encoded) - { - $this->data = $data; - $this->encoded = $encoded; - } - - /** - * @param mixed|null $default - * - * @return mixed|null - */ - public function get(string $name, $default = null) - { - return $this->data[$name] ?? $default; - } - - public function has(string $name): bool - { - return array_key_exists($name, $this->data); - } - - /** @return mixed[] */ - public function all(): array - { - return $this->data; - } - - public function toString(): string - { - return $this->encoded; - } -} diff --git a/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php b/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php deleted file mode 100644 index 49c2840..0000000 --- a/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php +++ /dev/null @@ -1,25 +0,0 @@ -decoder = $decoder; - } - - public function parse(string $jwt): TokenInterface - { - [$encodedHeaders, $encodedClaims, $encodedSignature] = $this->splitJwt($jwt); - - $header = $this->parseHeader($encodedHeaders); - - return new Plain( - new DataSet($header, $encodedHeaders), - new DataSet($this->parseClaims($encodedClaims), $encodedClaims), - $this->parseSignature($header, $encodedSignature) - ); - } - - /** - * Splits the JWT string into an array - * - * @return string[] - * - * @throws InvalidTokenStructure When JWT doesn't have all parts. - */ - private function splitJwt(string $jwt): array - { - $data = explode('.', $jwt); - - if (count($data) !== 3) { - throw InvalidTokenStructure::missingOrNotEnoughSeparators(); - } - - return $data; - } - - /** - * Parses the header from a string - * - * @return mixed[] - * - * @throws UnsupportedHeaderFound When an invalid header is informed. - * @throws InvalidTokenStructure When parsed content isn't an array. - */ - private function parseHeader(string $data): array - { - $header = $this->decoder->jsonDecode($this->decoder->base64UrlDecode($data)); - - if (! is_array($header)) { - throw InvalidTokenStructure::arrayExpected('headers'); - } - - if (array_key_exists('enc', $header)) { - throw UnsupportedHeaderFound::encryption(); - } - - if (! array_key_exists('typ', $header)) { - $header['typ'] = 'JWT'; - } - - return $header; - } - - /** - * Parses the claim set from a string - * - * @return mixed[] - * - * @throws InvalidTokenStructure When parsed content isn't an array or contains non-parseable dates. - */ - private function parseClaims(string $data): array - { - $claims = $this->decoder->jsonDecode($this->decoder->base64UrlDecode($data)); - - if (! is_array($claims)) { - throw InvalidTokenStructure::arrayExpected('claims'); - } - - if (array_key_exists(RegisteredClaims::AUDIENCE, $claims)) { - $claims[RegisteredClaims::AUDIENCE] = (array) $claims[RegisteredClaims::AUDIENCE]; - } - - foreach (RegisteredClaims::DATE_CLAIMS as $claim) { - if (! array_key_exists($claim, $claims)) { - continue; - } - - $claims[$claim] = $this->convertDate((string) $claims[$claim]); - } - - return $claims; - } - - /** @throws InvalidTokenStructure */ - private function convertDate(string $value): DateTimeImmutable - { - if (strpos($value, '.') === false) { - return new DateTimeImmutable('@' . $value); - } - - $date = DateTimeImmutable::createFromFormat('U.u', $value); - - if ($date === false) { - throw InvalidTokenStructure::dateIsNotParseable($value); - } - - return $date; - } - - /** - * Returns the signature from given data - * - * @param mixed[] $header - */ - private function parseSignature(array $header, string $data): Signature - { - if ($data === '' || ! array_key_exists('alg', $header) || $header['alg'] === 'none') { - return Signature::fromEmptyData(); - } - - $hash = $this->decoder->base64UrlDecode($data); - - return new Signature($hash, $data); - } -} diff --git a/vendor/lcobucci/jwt/src/Token/Plain.php b/vendor/lcobucci/jwt/src/Token/Plain.php deleted file mode 100644 index 8903e6a..0000000 --- a/vendor/lcobucci/jwt/src/Token/Plain.php +++ /dev/null @@ -1,92 +0,0 @@ -headers = $headers; - $this->claims = $claims; - $this->signature = $signature; - } - - public function headers(): DataSet - { - return $this->headers; - } - - public function claims(): DataSet - { - return $this->claims; - } - - public function signature(): Signature - { - return $this->signature; - } - - public function payload(): string - { - return $this->headers->toString() . '.' . $this->claims->toString(); - } - - public function isPermittedFor(string $audience): bool - { - return in_array($audience, $this->claims->get(RegisteredClaims::AUDIENCE, []), true); - } - - public function isIdentifiedBy(string $id): bool - { - return $this->claims->get(RegisteredClaims::ID) === $id; - } - - public function isRelatedTo(string $subject): bool - { - return $this->claims->get(RegisteredClaims::SUBJECT) === $subject; - } - - public function hasBeenIssuedBy(string ...$issuers): bool - { - return in_array($this->claims->get(RegisteredClaims::ISSUER), $issuers, true); - } - - public function hasBeenIssuedBefore(DateTimeInterface $now): bool - { - return $now >= $this->claims->get(RegisteredClaims::ISSUED_AT); - } - - public function isMinimumTimeBefore(DateTimeInterface $now): bool - { - return $now >= $this->claims->get(RegisteredClaims::NOT_BEFORE); - } - - public function isExpired(DateTimeInterface $now): bool - { - if (! $this->claims->has(RegisteredClaims::EXPIRATION_TIME)) { - return false; - } - - return $now >= $this->claims->get(RegisteredClaims::EXPIRATION_TIME); - } - - public function toString(): string - { - return $this->headers->toString() . '.' - . $this->claims->toString() . '.' - . $this->signature->toString(); - } -} diff --git a/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php b/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php deleted file mode 100644 index e70996e..0000000 --- a/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php +++ /dev/null @@ -1,20 +0,0 @@ -hash = $hash; - $this->encoded = $encoded; - } - - public static function fromEmptyData(): self - { - return new self('', ''); - } - - public function hash(): string - { - return $this->hash; - } - - /** - * Returns the encoded version of the signature - */ - public function toString(): string - { - return $this->encoded; - } -} diff --git a/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php b/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php deleted file mode 100644 index 1824078..0000000 --- a/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php +++ /dev/null @@ -1,15 +0,0 @@ -id = $id; - } - - public function assert(Token $token): void - { - if (! $token->isIdentifiedBy($this->id)) { - throw new ConstraintViolation( - 'The token is not identified with the expected ID' - ); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php b/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php deleted file mode 100644 index 5f5346e..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php +++ /dev/null @@ -1,28 +0,0 @@ -issuers = $issuers; - } - - public function assert(Token $token): void - { - if (! $token->hasBeenIssuedBy(...$this->issuers)) { - throw new ConstraintViolation( - 'The token was not issued by the given issuers' - ); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php b/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php deleted file mode 100644 index 53abc0d..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php +++ /dev/null @@ -1,15 +0,0 @@ -clock = $clock; - $this->leeway = $this->guardLeeway($leeway); - } - - private function guardLeeway(?DateInterval $leeway): DateInterval - { - if ($leeway === null) { - return new DateInterval('PT0S'); - } - - if ($leeway->invert === 1) { - throw LeewayCannotBeNegative::create(); - } - - return $leeway; - } - - public function assert(Token $token): void - { - $now = $this->clock->now(); - - $this->assertIssueTime($token, $now->add($this->leeway)); - $this->assertMinimumTime($token, $now->add($this->leeway)); - $this->assertExpiration($token, $now->sub($this->leeway)); - } - - /** @throws ConstraintViolation */ - private function assertExpiration(Token $token, DateTimeInterface $now): void - { - if ($token->isExpired($now)) { - throw new ConstraintViolation('The token is expired'); - } - } - - /** @throws ConstraintViolation */ - private function assertMinimumTime(Token $token, DateTimeInterface $now): void - { - if (! $token->isMinimumTimeBefore($now)) { - throw new ConstraintViolation('The token cannot be used yet'); - } - } - - /** @throws ConstraintViolation */ - private function assertIssueTime(Token $token, DateTimeInterface $now): void - { - if (! $token->hasBeenIssuedBefore($now)) { - throw new ConstraintViolation('The token was issued in the future'); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php b/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php deleted file mode 100644 index 1155697..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php +++ /dev/null @@ -1,27 +0,0 @@ -audience = $audience; - } - - public function assert(Token $token): void - { - if (! $token->isPermittedFor($this->audience)) { - throw new ConstraintViolation( - 'The token is not allowed to be used by this audience' - ); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php b/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php deleted file mode 100644 index 8beecd7..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php +++ /dev/null @@ -1,27 +0,0 @@ -subject = $subject; - } - - public function assert(Token $token): void - { - if (! $token->isRelatedTo($this->subject)) { - throw new ConstraintViolation( - 'The token is not related to the expected subject' - ); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php b/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php deleted file mode 100644 index 1bc1e90..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php +++ /dev/null @@ -1,37 +0,0 @@ -signer = $signer; - $this->key = $key; - } - - public function assert(Token $token): void - { - if (! $token instanceof UnencryptedToken) { - throw new ConstraintViolation('You should pass a plain token'); - } - - if ($token->headers()->get('alg') !== $this->signer->algorithmId()) { - throw new ConstraintViolation('Token signer mismatch'); - } - - if (! $this->signer->verify($token->signature()->hash(), $token->payload(), $this->key)) { - throw new ConstraintViolation('Token signature mismatch'); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Constraint/StrictValidAt.php b/vendor/lcobucci/jwt/src/Validation/Constraint/StrictValidAt.php deleted file mode 100644 index bb22109..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Constraint/StrictValidAt.php +++ /dev/null @@ -1,86 +0,0 @@ -clock = $clock; - $this->leeway = $this->guardLeeway($leeway); - } - - private function guardLeeway(?DateInterval $leeway): DateInterval - { - if ($leeway === null) { - return new DateInterval('PT0S'); - } - - if ($leeway->invert === 1) { - throw LeewayCannotBeNegative::create(); - } - - return $leeway; - } - - public function assert(Token $token): void - { - if (! $token instanceof UnencryptedToken) { - throw new ConstraintViolation('You should pass a plain token'); - } - - $now = $this->clock->now(); - - $this->assertIssueTime($token, $now->add($this->leeway)); - $this->assertMinimumTime($token, $now->add($this->leeway)); - $this->assertExpiration($token, $now->sub($this->leeway)); - } - - /** @throws ConstraintViolation */ - private function assertExpiration(UnencryptedToken $token, DateTimeInterface $now): void - { - if (! $token->claims()->has(Token\RegisteredClaims::EXPIRATION_TIME)) { - throw new ConstraintViolation('"Expiration Time" claim missing'); - } - - if ($token->isExpired($now)) { - throw new ConstraintViolation('The token is expired'); - } - } - - /** @throws ConstraintViolation */ - private function assertMinimumTime(UnencryptedToken $token, DateTimeInterface $now): void - { - if (! $token->claims()->has(Token\RegisteredClaims::NOT_BEFORE)) { - throw new ConstraintViolation('"Not Before" claim missing'); - } - - if (! $token->isMinimumTimeBefore($now)) { - throw new ConstraintViolation('The token cannot be used yet'); - } - } - - /** @throws ConstraintViolation */ - private function assertIssueTime(UnencryptedToken $token, DateTimeInterface $now): void - { - if (! $token->claims()->has(Token\RegisteredClaims::ISSUED_AT)) { - throw new ConstraintViolation('"Issued At" claim missing'); - } - - if (! $token->hasBeenIssuedBefore($now)) { - throw new ConstraintViolation('The token was issued in the future'); - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Constraint/ValidAt.php b/vendor/lcobucci/jwt/src/Validation/Constraint/ValidAt.php deleted file mode 100644 index db7f6ba..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Constraint/ValidAt.php +++ /dev/null @@ -1,25 +0,0 @@ -constraint = new LooseValidAt($clock, $leeway); - } - - public function assert(Token $token): void - { - $this->constraint->assert($token); - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php b/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php deleted file mode 100644 index 39a56ed..0000000 --- a/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php +++ /dev/null @@ -1,11 +0,0 @@ -violations = $violations; - - return $exception; - } - - /** @param ConstraintViolation[] $violations */ - private static function buildMessage(array $violations): string - { - $violations = array_map( - static function (ConstraintViolation $violation): string { - return '- ' . $violation->getMessage(); - }, - $violations - ); - - $message = "The token violates some mandatory constraints, details:\n"; - $message .= implode("\n", $violations); - - return $message; - } - - /** @return ConstraintViolation[] */ - public function violations(): array - { - return $this->violations; - } -} diff --git a/vendor/lcobucci/jwt/src/Validation/Validator.php b/vendor/lcobucci/jwt/src/Validation/Validator.php deleted file mode 100644 index 62d0618..0000000 --- a/vendor/lcobucci/jwt/src/Validation/Validator.php +++ /dev/null @@ -1,56 +0,0 @@ -checkConstraint($constraint, $token, $violations); - } - - if ($violations) { - throw RequiredConstraintsViolated::fromViolations(...$violations); - } - } - - /** @param ConstraintViolation[] $violations */ - private function checkConstraint( - Constraint $constraint, - Token $token, - array &$violations - ): void { - try { - $constraint->assert($token); - } catch (ConstraintViolation $e) { - $violations[] = $e; - } - } - - public function validate(Token $token, Constraint ...$constraints): bool - { - if ($constraints === []) { - throw new NoConstraintsGiven('No constraint given.'); - } - - try { - foreach ($constraints as $constraint) { - $constraint->assert($token); - } - - return true; - } catch (ConstraintViolation $e) { - return false; - } - } -} diff --git a/vendor/lcobucci/jwt/src/Validator.php b/vendor/lcobucci/jwt/src/Validator.php deleted file mode 100644 index d0ce4b8..0000000 --- a/vendor/lcobucci/jwt/src/Validator.php +++ /dev/null @@ -1,20 +0,0 @@ -level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers(['-yoda_conditions', 'ordered_use', 'short_array_syntax']) - ->finder(Symfony\CS\Finder\DefaultFinder::create() - ->in(__DIR__.'/src/')); \ No newline at end of file diff --git a/vendor/league/flysystem-cached-adapter/.scrutinizer.yml b/vendor/league/flysystem-cached-adapter/.scrutinizer.yml deleted file mode 100644 index fa39b52..0000000 --- a/vendor/league/flysystem-cached-adapter/.scrutinizer.yml +++ /dev/null @@ -1,34 +0,0 @@ -filter: - paths: [src/*] -checks: - php: - code_rating: true - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true -tools: - external_code_coverage: - timeout: 900 - runs: 6 - php_code_coverage: false - php_code_sniffer: - config: - standard: PSR2 - filter: - paths: ['src'] - php_loc: - enabled: true - excluded_dirs: [vendor, spec, stubs] - php_cpd: - enabled: true - excluded_dirs: [vendor, spec, stubs] \ No newline at end of file diff --git a/vendor/league/flysystem-cached-adapter/.travis.yml b/vendor/league/flysystem-cached-adapter/.travis.yml deleted file mode 100644 index 6706449..0000000 --- a/vendor/league/flysystem-cached-adapter/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - -matrix: - allow_failures: - - php: 5.5 - -env: - - COMPOSER_OPTS="" - - COMPOSER_OPTS="--prefer-lowest" - -install: - - if [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then composer require phpunit/phpunit:^4.8.36 phpspec/phpspec:^2 --prefer-dist --update-with-dependencies; fi - - if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then composer require phpunit/phpunit:^6.0 --prefer-dist --update-with-dependencies; fi - - travis_retry composer update --prefer-dist $COMPOSER_OPTS - -script: - - vendor/bin/phpspec run - - vendor/bin/phpunit - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar' - - php ocular.phar code-coverage:upload --format=php-clover ./clover/phpunit.xml' diff --git a/vendor/league/flysystem-cached-adapter/LICENSE b/vendor/league/flysystem-cached-adapter/LICENSE deleted file mode 100644 index 666f6c8..0000000 --- a/vendor/league/flysystem-cached-adapter/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/league/flysystem-cached-adapter/clover/.gitignore b/vendor/league/flysystem-cached-adapter/clover/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/vendor/league/flysystem-cached-adapter/clover/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/vendor/league/flysystem-cached-adapter/composer.json b/vendor/league/flysystem-cached-adapter/composer.json deleted file mode 100644 index df7fb7f..0000000 --- a/vendor/league/flysystem-cached-adapter/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "league/flysystem-cached-adapter", - "description": "An adapter decorator to enable meta-data caching.", - "autoload": { - "psr-4": { - "League\\Flysystem\\Cached\\": "src/" - } - }, - "require": { - "league/flysystem": "~1.0", - "psr/cache": "^1.0.0" - }, - "require-dev": { - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7", - "mockery/mockery": "~0.9", - "predis/predis": "~1.0", - "tedivm/stash": "~0.12" - }, - "suggest": { - "ext-phpredis": "Pure C implemented extension for PHP" - }, - "license": "MIT", - "authors": [ - { - "name": "frankdejonge", - "email": "info@frenky.net" - } - ] -} diff --git a/vendor/league/flysystem-cached-adapter/phpspec.yml b/vendor/league/flysystem-cached-adapter/phpspec.yml deleted file mode 100644 index 5eabcb2..0000000 --- a/vendor/league/flysystem-cached-adapter/phpspec.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -suites: - cached_adapter_suite: - namespace: League\Flysystem\Cached - psr4_prefix: League\Flysystem\Cached -formatter.name: pretty diff --git a/vendor/league/flysystem-cached-adapter/phpunit.php b/vendor/league/flysystem-cached-adapter/phpunit.php deleted file mode 100644 index d109587..0000000 --- a/vendor/league/flysystem-cached-adapter/phpunit.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - - ./tests/ - - - - - ./src/ - - - - - - - - diff --git a/vendor/league/flysystem-cached-adapter/readme.md b/vendor/league/flysystem-cached-adapter/readme.md deleted file mode 100644 index dd1433d..0000000 --- a/vendor/league/flysystem-cached-adapter/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# Flysystem Cached CachedAdapter - -[![Author](http://img.shields.io/badge/author-@frankdejonge-blue.svg?style=flat-square)](https://twitter.com/frankdejonge) -[![Build Status](https://img.shields.io/travis/thephpleague/flysystem-cached-adapter/master.svg?style=flat-square)](https://travis-ci.org/thephpleague/flysystem-cached-adapter) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/thephpleague/flysystem-cached-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/flysystem-cached-adapter/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/g/thephpleague/flysystem-cached-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/flysystem-cached-adapter) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Packagist Version](https://img.shields.io/packagist/v/league/flysystem-cached-adapter.svg?style=flat-square)](https://packagist.org/packages/league/flysystem-cached-adapter) -[![Total Downloads](https://img.shields.io/packagist/dt/league/flysystem-cached-adapter.svg?style=flat-square)](https://packagist.org/packages/league/flysystem-cached-adapter) - - -The adapter decorator caches metadata and directory listings. - -```bash -composer require league/flysystem-cached-adapter -``` - -## Usage - -[Check out the docs.](https://flysystem.thephpleague.com/docs/advanced/caching/) diff --git a/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php b/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php deleted file mode 100644 index 69428d9..0000000 --- a/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php +++ /dev/null @@ -1,435 +0,0 @@ -adapter = $adapter; - $this->cache = $cache; - $this->cache->load()->shouldBeCalled(); - $this->beConstructedWith($adapter, $cache); - } - - public function it_is_initializable() - { - $this->shouldHaveType('League\Flysystem\Cached\CachedAdapter'); - $this->shouldHaveType('League\Flysystem\AdapterInterface'); - } - - public function it_should_forward_read_streams() - { - $path = 'path.txt'; - $response = ['path' => $path]; - $this->adapter->readStream($path)->willReturn($response); - $this->readStream($path)->shouldbe($response); - } - - public function it_should_cache_writes() - { - $type = 'file'; - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $response = compact('path', 'contents', 'type'); - $this->adapter->write($path, $contents, $config)->willReturn($response); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->write($path, $contents, $config)->shouldBe($response); - } - - public function it_should_cache_streamed_writes() - { - $type = 'file'; - $path = 'path.txt'; - $stream = tmpfile(); - $config = new Config(); - $response = compact('path', 'stream', 'type'); - $this->adapter->writeStream($path, $stream, $config)->willReturn($response); - $this->cache->updateObject($path, ['contents' => false] + $response, true)->shouldBeCalled(); - $this->writeStream($path, $stream, $config)->shouldBe($response); - fclose($stream); - } - - public function it_should_cache_streamed_updates() - { - $type = 'file'; - $path = 'path.txt'; - $stream = tmpfile(); - $config = new Config(); - $response = compact('path', 'stream', 'type'); - $this->adapter->updateStream($path, $stream, $config)->willReturn($response); - $this->cache->updateObject($path, ['contents' => false] + $response, true)->shouldBeCalled(); - $this->updateStream($path, $stream, $config)->shouldBe($response); - fclose($stream); - } - - public function it_should_ignore_failed_writes() - { - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $this->adapter->write($path, $contents, $config)->willReturn(false); - $this->write($path, $contents, $config)->shouldBe(false); - } - - public function it_should_ignore_failed_streamed_writes() - { - $path = 'path.txt'; - $contents = tmpfile(); - $config = new Config(); - $this->adapter->writeStream($path, $contents, $config)->willReturn(false); - $this->writeStream($path, $contents, $config)->shouldBe(false); - fclose($contents); - } - - public function it_should_cache_updated() - { - $type = 'file'; - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $response = compact('path', 'contents', 'type'); - $this->adapter->update($path, $contents, $config)->willReturn($response); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->update($path, $contents, $config)->shouldBe($response); - } - - public function it_should_ignore_failed_updates() - { - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $this->adapter->update($path, $contents, $config)->willReturn(false); - $this->update($path, $contents, $config)->shouldBe(false); - } - - public function it_should_ignore_failed_streamed_updates() - { - $path = 'path.txt'; - $contents = tmpfile(); - $config = new Config(); - $this->adapter->updateStream($path, $contents, $config)->willReturn(false); - $this->updateStream($path, $contents, $config)->shouldBe(false); - fclose($contents); - } - - public function it_should_cache_renames() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->rename($old, $new)->willReturn(true); - $this->cache->rename($old, $new)->shouldBeCalled(); - $this->rename($old, $new)->shouldBe(true); - } - - public function it_should_ignore_rename_fails() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->rename($old, $new)->willReturn(false); - $this->rename($old, $new)->shouldBe(false); - } - - public function it_should_cache_copies() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->copy($old, $new)->willReturn(true); - $this->cache->copy($old, $new)->shouldBeCalled(); - $this->copy($old, $new)->shouldBe(true); - } - - public function it_should_ignore_copy_fails() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->copy($old, $new)->willReturn(false); - $this->copy($old, $new)->shouldBe(false); - } - - public function it_should_cache_deletes() - { - $delete = 'delete.txt'; - $this->adapter->delete($delete)->willReturn(true); - $this->cache->delete($delete)->shouldBeCalled(); - $this->delete($delete)->shouldBe(true); - } - - public function it_should_ignore_delete_fails() - { - $delete = 'delete.txt'; - $this->adapter->delete($delete)->willReturn(false); - $this->delete($delete)->shouldBe(false); - } - - public function it_should_cache_dir_deletes() - { - $delete = 'delete'; - $this->adapter->deleteDir($delete)->willReturn(true); - $this->cache->deleteDir($delete)->shouldBeCalled(); - $this->deleteDir($delete)->shouldBe(true); - } - - public function it_should_ignore_delete_dir_fails() - { - $delete = 'delete'; - $this->adapter->deleteDir($delete)->willReturn(false); - $this->deleteDir($delete)->shouldBe(false); - } - - public function it_should_cache_dir_creates() - { - $dirname = 'dirname'; - $config = new Config(); - $response = ['path' => $dirname, 'type' => 'dir']; - $this->adapter->createDir($dirname, $config)->willReturn($response); - $this->cache->updateObject($dirname, $response, true)->shouldBeCalled(); - $this->createDir($dirname, $config)->shouldBe($response); - } - - public function it_should_ignore_create_dir_fails() - { - $dirname = 'dirname'; - $config = new Config(); - $this->adapter->createDir($dirname, $config)->willReturn(false); - $this->createDir($dirname, $config)->shouldBe(false); - } - - public function it_should_cache_set_visibility() - { - $path = 'path.txt'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $this->adapter->setVisibility($path, $visibility)->willReturn(true); - $this->cache->updateObject($path, ['path' => $path, 'visibility' => $visibility], true)->shouldBeCalled(); - $this->setVisibility($path, $visibility)->shouldBe(true); - } - - public function it_should_ignore_set_visibility_fails() - { - $dirname = 'delete'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $this->adapter->setVisibility($dirname, $visibility)->willReturn(false); - $this->setVisibility($dirname, $visibility)->shouldBe(false); - } - - public function it_should_indicate_missing_files() - { - $this->cache->has($path = 'path.txt')->willReturn(false); - $this->has($path)->shouldBe(false); - } - - public function it_should_indicate_file_existance() - { - $this->cache->has($path = 'path.txt')->willReturn(true); - $this->has($path)->shouldBe(true); - } - - public function it_should_cache_missing_files() - { - $this->cache->has($path = 'path.txt')->willReturn(null); - $this->adapter->has($path)->willReturn(false); - $this->cache->storeMiss($path)->shouldBeCalled(); - $this->has($path)->shouldBe(false); - } - - public function it_should_delete_when_metadata_is_missing() - { - $path = 'path.txt'; - $this->cache->has($path)->willReturn(true); - $this->cache->getSize($path)->willReturn(['path' => $path]); - $this->adapter->getSize($path)->willReturn($response = ['path' => $path, 'size' => 1024]); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->getSize($path)->shouldBe($response); - } - - public function it_should_cache_has() - { - $this->cache->has($path = 'path.txt')->willReturn(null); - $this->adapter->has($path)->willReturn(true); - $this->cache->updateObject($path, compact('path'), true)->shouldBeCalled(); - $this->has($path)->shouldBe(true); - } - - public function it_should_list_cached_contents() - { - $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(true); - $response = [['path' => 'path.txt']]; - $this->cache->listContents($dirname, $recursive)->willReturn($response); - $this->listContents($dirname, $recursive)->shouldBe($response); - } - - public function it_should_ignore_failed_list_contents() - { - $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(false); - $this->adapter->listContents($dirname, $recursive)->willReturn(false); - $this->listContents($dirname, $recursive)->shouldBe(false); - } - - public function it_should_cache_contents_listings() - { - $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(false); - $response = [['path' => 'path.txt']]; - $this->adapter->listContents($dirname, $recursive)->willReturn($response); - $this->cache->storeContents($dirname, $response, $recursive)->shouldBeCalled(); - $this->listContents($dirname, $recursive)->shouldBe($response); - } - - public function it_should_use_cached_visibility() - { - $this->make_it_use_getter_cache('getVisibility', 'path.txt', [ - 'path' => 'path.txt', - 'visibility' => AdapterInterface::VISIBILITY_PUBLIC, - ]); - } - - public function it_should_cache_get_visibility() - { - $path = 'path.txt'; - $response = ['visibility' => AdapterInterface::VISIBILITY_PUBLIC, 'path' => $path]; - $this->make_it_cache_getter('getVisibility', $path, $response); - } - - public function it_should_ignore_failed_get_visibility() - { - $path = 'path.txt'; - $this->make_it_ignore_failed_getter('getVisibility', $path); - } - - public function it_should_use_cached_timestamp() - { - $this->make_it_use_getter_cache('getTimestamp', 'path.txt', [ - 'path' => 'path.txt', - 'timestamp' => 1234, - ]); - } - - public function it_should_cache_timestamps() - { - $this->make_it_cache_getter('getTimestamp', 'path.txt', [ - 'path' => 'path.txt', - 'timestamp' => 1234, - ]); - } - - public function it_should_ignore_failed_get_timestamps() - { - $this->make_it_ignore_failed_getter('getTimestamp', 'path.txt'); - } - - public function it_should_cache_get_metadata() - { - $path = 'path.txt'; - $response = ['visibility' => AdapterInterface::VISIBILITY_PUBLIC, 'path' => $path]; - $this->make_it_cache_getter('getMetadata', $path, $response); - } - - public function it_should_use_cached_metadata() - { - $this->make_it_use_getter_cache('getMetadata', 'path.txt', [ - 'path' => 'path.txt', - 'timestamp' => 1234, - ]); - } - - public function it_should_ignore_failed_get_metadata() - { - $this->make_it_ignore_failed_getter('getMetadata', 'path.txt'); - } - - public function it_should_cache_get_size() - { - $path = 'path.txt'; - $response = ['size' => 1234, 'path' => $path]; - $this->make_it_cache_getter('getSize', $path, $response); - } - - public function it_should_use_cached_size() - { - $this->make_it_use_getter_cache('getSize', 'path.txt', [ - 'path' => 'path.txt', - 'size' => 1234, - ]); - } - - public function it_should_ignore_failed_get_size() - { - $this->make_it_ignore_failed_getter('getSize', 'path.txt'); - } - - public function it_should_cache_get_mimetype() - { - $path = 'path.txt'; - $response = ['mimetype' => 'text/plain', 'path' => $path]; - $this->make_it_cache_getter('getMimetype', $path, $response); - } - - public function it_should_use_cached_mimetype() - { - $this->make_it_use_getter_cache('getMimetype', 'path.txt', [ - 'path' => 'path.txt', - 'mimetype' => 'text/plain', - ]); - } - - public function it_should_ignore_failed_get_mimetype() - { - $this->make_it_ignore_failed_getter('getMimetype', 'path.txt'); - } - - public function it_should_cache_reads() - { - $path = 'path.txt'; - $response = ['path' => $path, 'contents' => 'contents']; - $this->make_it_cache_getter('read', $path, $response); - } - - public function it_should_use_cached_file_contents() - { - $this->make_it_use_getter_cache('read', 'path.txt', [ - 'path' => 'path.txt', - 'contents' => 'contents' - ]); - } - - public function it_should_ignore_failed_reads() - { - $this->make_it_ignore_failed_getter('read', 'path.txt'); - } - - protected function make_it_use_getter_cache($method, $path, $response) - { - $this->cache->{$method}($path)->willReturn($response); - $this->{$method}($path)->shouldBe($response); - } - - protected function make_it_cache_getter($method, $path, $response) - { - $this->cache->{$method}($path)->willReturn(false); - $this->adapter->{$method}($path)->willReturn($response); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->{$method}($path)->shouldBe($response); - } - - protected function make_it_ignore_failed_getter($method, $path) - { - $this->cache->{$method}($path)->willReturn(false); - $this->adapter->{$method}($path)->willReturn(false); - $this->{$method}($path)->shouldBe(false); - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/CacheInterface.php b/vendor/league/flysystem-cached-adapter/src/CacheInterface.php deleted file mode 100644 index de3ab3d..0000000 --- a/vendor/league/flysystem-cached-adapter/src/CacheInterface.php +++ /dev/null @@ -1,101 +0,0 @@ -adapter = $adapter; - $this->cache = $cache; - $this->cache->load(); - } - - /** - * Get the underlying Adapter implementation. - * - * @return AdapterInterface - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * Get the used Cache implementation. - * - * @return CacheInterface - */ - public function getCache() - { - return $this->cache; - } - - /** - * {@inheritdoc} - */ - public function write($path, $contents, Config $config) - { - $result = $this->adapter->write($path, $contents, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function writeStream($path, $resource, Config $config) - { - $result = $this->adapter->writeStream($path, $resource, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $contents = false; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function update($path, $contents, Config $config) - { - $result = $this->adapter->update($path, $contents, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function updateStream($path, $resource, Config $config) - { - $result = $this->adapter->updateStream($path, $resource, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $contents = false; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function rename($path, $newPath) - { - $result = $this->adapter->rename($path, $newPath); - - if ($result !== false) { - $this->cache->rename($path, $newPath); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function copy($path, $newpath) - { - $result = $this->adapter->copy($path, $newpath); - - if ($result !== false) { - $this->cache->copy($path, $newpath); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function delete($path) - { - $result = $this->adapter->delete($path); - - if ($result !== false) { - $this->cache->delete($path); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function deleteDir($dirname) - { - $result = $this->adapter->deleteDir($dirname); - - if ($result !== false) { - $this->cache->deleteDir($dirname); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function createDir($dirname, Config $config) - { - $result = $this->adapter->createDir($dirname, $config); - - if ($result !== false) { - $type = 'dir'; - $path = $dirname; - $this->cache->updateObject($dirname, compact('path', 'type'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function setVisibility($path, $visibility) - { - $result = $this->adapter->setVisibility($path, $visibility); - - if ($result !== false) { - $this->cache->updateObject($path, compact('path', 'visibility'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function has($path) - { - $cacheHas = $this->cache->has($path); - - if ($cacheHas !== null) { - return $cacheHas; - } - - $adapterResponse = $this->adapter->has($path); - - if (! $adapterResponse) { - $this->cache->storeMiss($path); - } else { - $cacheEntry = is_array($adapterResponse) ? $adapterResponse : compact('path'); - $this->cache->updateObject($path, $cacheEntry, true); - } - - return $adapterResponse; - } - - /** - * {@inheritdoc} - */ - public function read($path) - { - return $this->callWithFallback('contents', $path, 'read'); - } - - /** - * {@inheritdoc} - */ - public function readStream($path) - { - return $this->adapter->readStream($path); - } - - /** - * Get the path prefix. - * - * @return string|null path prefix or null if pathPrefix is empty - */ - public function getPathPrefix() - { - return $this->adapter->getPathPrefix(); - } - - /** - * Prefix a path. - * - * @param string $path - * - * @return string prefixed path - */ - public function applyPathPrefix($path) - { - return $this->adapter->applyPathPrefix($path); - } - - /** - * {@inheritdoc} - */ - public function listContents($directory = '', $recursive = false) - { - if ($this->cache->isComplete($directory, $recursive)) { - return $this->cache->listContents($directory, $recursive); - } - - $result = $this->adapter->listContents($directory, $recursive); - - if ($result !== false) { - $this->cache->storeContents($directory, $result, $recursive); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function getMetadata($path) - { - return $this->callWithFallback(null, $path, 'getMetadata'); - } - - /** - * {@inheritdoc} - */ - public function getSize($path) - { - return $this->callWithFallback('size', $path, 'getSize'); - } - - /** - * {@inheritdoc} - */ - public function getMimetype($path) - { - return $this->callWithFallback('mimetype', $path, 'getMimetype'); - } - - /** - * {@inheritdoc} - */ - public function getTimestamp($path) - { - return $this->callWithFallback('timestamp', $path, 'getTimestamp'); - } - - /** - * {@inheritdoc} - */ - public function getVisibility($path) - { - return $this->callWithFallback('visibility', $path, 'getVisibility'); - } - - /** - * Call a method and cache the response. - * - * @param string $property - * @param string $path - * @param string $method - * - * @return mixed - */ - protected function callWithFallback($property, $path, $method) - { - $result = $this->cache->{$method}($path); - - if ($result !== false && ($property === null || array_key_exists($property, $result))) { - return $result; - } - - $result = $this->adapter->{$method}($path); - - if ($result) { - $object = $result + compact('path'); - $this->cache->updateObject($path, $object, true); - } - - return $result; - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php b/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php deleted file mode 100644 index 141b468..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php +++ /dev/null @@ -1,418 +0,0 @@ -autosave) { - $this->save(); - } - } - - /** - * Get the autosave setting. - * - * @return bool autosave - */ - public function getAutosave() - { - return $this->autosave; - } - - /** - * Get the autosave setting. - * - * @param bool $autosave - */ - public function setAutosave($autosave) - { - $this->autosave = $autosave; - } - - /** - * Store the contents listing. - * - * @param string $directory - * @param array $contents - * @param bool $recursive - * - * @return array contents listing - */ - public function storeContents($directory, array $contents, $recursive = false) - { - $directories = [$directory]; - - foreach ($contents as $object) { - $this->updateObject($object['path'], $object); - $object = $this->cache[$object['path']]; - - if ($recursive && $this->pathIsInDirectory($directory, $object['path'])) { - $directories[] = $object['dirname']; - } - } - - foreach (array_unique($directories) as $directory) { - $this->setComplete($directory, $recursive); - } - - $this->autosave(); - } - - /** - * Update the metadata for an object. - * - * @param string $path object path - * @param array $object object metadata - * @param bool $autosave whether to trigger the autosave routine - */ - public function updateObject($path, array $object, $autosave = false) - { - if (! $this->has($path)) { - $this->cache[$path] = Util::pathinfo($path); - } - - $this->cache[$path] = array_merge($this->cache[$path], $object); - - if ($autosave) { - $this->autosave(); - } - - $this->ensureParentDirectories($path); - } - - /** - * Store object hit miss. - * - * @param string $path - */ - public function storeMiss($path) - { - $this->cache[$path] = false; - $this->autosave(); - } - - /** - * Get the contents listing. - * - * @param string $dirname - * @param bool $recursive - * - * @return array contents listing - */ - public function listContents($dirname = '', $recursive = false) - { - $result = []; - - foreach ($this->cache as $object) { - if ($object === false) { - continue; - } - if ($object['dirname'] === $dirname) { - $result[] = $object; - } elseif ($recursive && $this->pathIsInDirectory($dirname, $object['path'])) { - $result[] = $object; - } - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function has($path) - { - if ($path !== false && array_key_exists($path, $this->cache)) { - return $this->cache[$path] !== false; - } - - if ($this->isComplete(Util::dirname($path), false)) { - return false; - } - } - - /** - * {@inheritdoc} - */ - public function read($path) - { - if (isset($this->cache[$path]['contents']) && $this->cache[$path]['contents'] !== false) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function readStream($path) - { - return false; - } - - /** - * {@inheritdoc} - */ - public function rename($path, $newpath) - { - if ($this->has($path)) { - $object = $this->cache[$path]; - unset($this->cache[$path]); - $object['path'] = $newpath; - $object = array_merge($object, Util::pathinfo($newpath)); - $this->cache[$newpath] = $object; - $this->autosave(); - } - } - - /** - * {@inheritdoc} - */ - public function copy($path, $newpath) - { - if ($this->has($path)) { - $object = $this->cache[$path]; - $object = array_merge($object, Util::pathinfo($newpath)); - $this->updateObject($newpath, $object, true); - } - } - - /** - * {@inheritdoc} - */ - public function delete($path) - { - $this->storeMiss($path); - } - - /** - * {@inheritdoc} - */ - public function deleteDir($dirname) - { - foreach ($this->cache as $path => $object) { - if ($this->pathIsInDirectory($dirname, $path) || $path === $dirname) { - unset($this->cache[$path]); - } - } - - unset($this->complete[$dirname]); - - $this->autosave(); - } - - /** - * {@inheritdoc} - */ - public function getMimetype($path) - { - if (isset($this->cache[$path]['mimetype'])) { - return $this->cache[$path]; - } - - if (! $result = $this->read($path)) { - return false; - } - - $mimetype = Util::guessMimeType($path, $result['contents']); - $this->cache[$path]['mimetype'] = $mimetype; - - return $this->cache[$path]; - } - - /** - * {@inheritdoc} - */ - public function getSize($path) - { - if (isset($this->cache[$path]['size'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getTimestamp($path) - { - if (isset($this->cache[$path]['timestamp'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getVisibility($path) - { - if (isset($this->cache[$path]['visibility'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getMetadata($path) - { - if (isset($this->cache[$path]['type'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function isComplete($dirname, $recursive) - { - if (! array_key_exists($dirname, $this->complete)) { - return false; - } - - if ($recursive && $this->complete[$dirname] !== 'recursive') { - return false; - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function setComplete($dirname, $recursive) - { - $this->complete[$dirname] = $recursive ? 'recursive' : true; - } - - /** - * Filter the contents from a listing. - * - * @param array $contents object listing - * - * @return array filtered contents - */ - public function cleanContents(array $contents) - { - $cachedProperties = array_flip([ - 'path', 'dirname', 'basename', 'extension', 'filename', - 'size', 'mimetype', 'visibility', 'timestamp', 'type', - 'md5', - ]); - - foreach ($contents as $path => $object) { - if (is_array($object)) { - $contents[$path] = array_intersect_key($object, $cachedProperties); - } - } - - return $contents; - } - - /** - * {@inheritdoc} - */ - public function flush() - { - $this->cache = []; - $this->complete = []; - $this->autosave(); - } - - /** - * {@inheritdoc} - */ - public function autosave() - { - if ($this->autosave) { - $this->save(); - } - } - - /** - * Retrieve serialized cache data. - * - * @return string serialized data - */ - public function getForStorage() - { - $cleaned = $this->cleanContents($this->cache); - - return json_encode([$cleaned, $this->complete]); - } - - /** - * Load from serialized cache data. - * - * @param string $json - */ - public function setFromStorage($json) - { - list($cache, $complete) = json_decode($json, true); - - if (json_last_error() === JSON_ERROR_NONE && is_array($cache) && is_array($complete)) { - $this->cache = $cache; - $this->complete = $complete; - } - } - - /** - * Ensure parent directories of an object. - * - * @param string $path object path - */ - public function ensureParentDirectories($path) - { - $object = $this->cache[$path]; - - while ($object['dirname'] !== '' && ! isset($this->cache[$object['dirname']])) { - $object = Util::pathinfo($object['dirname']); - $object['type'] = 'dir'; - $this->cache[$object['path']] = $object; - } - } - - /** - * Determines if the path is inside the directory. - * - * @param string $directory - * @param string $path - * - * @return bool - */ - protected function pathIsInDirectory($directory, $path) - { - return $directory === '' || strpos($path, $directory . '/') === 0; - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php b/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php deleted file mode 100644 index 649a60e..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php +++ /dev/null @@ -1,115 +0,0 @@ -adapter = $adapter; - $this->file = $file; - $this->setExpire($expire); - } - - /** - * Set the expiration time in seconds. - * - * @param int $expire relative expiration time - */ - protected function setExpire($expire) - { - if ($expire) { - $this->expire = $this->getTime($expire); - } - } - - /** - * Get expiration time in seconds. - * - * @param int $time relative expiration time - * - * @return int actual expiration time - */ - protected function getTime($time = 0) - { - return intval(microtime(true)) + $time; - } - - /** - * {@inheritdoc} - */ - public function setFromStorage($json) - { - list($cache, $complete, $expire) = json_decode($json, true); - - if (! $expire || $expire > $this->getTime()) { - $this->cache = is_array($cache) ? $cache : []; - $this->complete = is_array($complete) ? $complete : []; - } else { - $this->adapter->delete($this->file); - } - } - - /** - * {@inheritdoc} - */ - public function load() - { - if ($this->adapter->has($this->file)) { - $file = $this->adapter->read($this->file); - if ($file && !empty($file['contents'])) { - $this->setFromStorage($file['contents']); - } - } - } - - /** - * {@inheritdoc} - */ - public function getForStorage() - { - $cleaned = $this->cleanContents($this->cache); - - return json_encode([$cleaned, $this->complete, $this->expire]); - } - - /** - * {@inheritdoc} - */ - public function save() - { - $config = new Config(); - $contents = $this->getForStorage(); - - if ($this->adapter->has($this->file)) { - $this->adapter->update($this->file, $contents, $config); - } else { - $this->adapter->write($this->file, $contents, $config); - } - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php b/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php deleted file mode 100644 index f67d271..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php +++ /dev/null @@ -1,59 +0,0 @@ -key = $key; - $this->expire = $expire; - $this->memcached = $memcached; - } - - /** - * {@inheritdoc} - */ - public function load() - { - $contents = $this->memcached->get($this->key); - - if ($contents !== false) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $expiration = $this->expire === null ? 0 : time() + $this->expire; - $this->memcached->set($this->key, $contents, $expiration); - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php b/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php deleted file mode 100644 index d0914fa..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php +++ /dev/null @@ -1,22 +0,0 @@ -client = $client ?: new Redis(); - $this->key = $key; - $this->expire = $expire; - } - - /** - * {@inheritdoc} - */ - public function load() - { - $contents = $this->client->get($this->key); - - if ($contents !== false) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $this->client->set($this->key, $contents); - - if ($this->expire !== null) { - $this->client->expire($this->key, $this->expire); - } - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php b/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php deleted file mode 100644 index 8a29574..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php +++ /dev/null @@ -1,75 +0,0 @@ -client = $client ?: new Client(); - $this->key = $key; - $this->expire = $expire; - } - - /** - * {@inheritdoc} - */ - public function load() - { - if (($contents = $this->executeCommand('get', [$this->key])) !== null) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $this->executeCommand('set', [$this->key, $contents]); - - if ($this->expire !== null) { - $this->executeCommand('expire', [$this->key, $this->expire]); - } - } - - /** - * Execute a Predis command. - * - * @param string $name - * @param array $arguments - * - * @return string - */ - protected function executeCommand($name, array $arguments) - { - $command = $this->client->createCommand($name, $arguments); - - return $this->client->executeCommand($command); - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php b/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php deleted file mode 100644 index 43be87e..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php +++ /dev/null @@ -1,59 +0,0 @@ -pool = $pool; - $this->key = $key; - $this->expire = $expire; - } - - /** - * {@inheritdoc} - */ - public function save() - { - $item = $this->pool->getItem($this->key); - $item->set($this->getForStorage()); - $item->expiresAfter($this->expire); - $this->pool->save($item); - } - - /** - * {@inheritdoc} - */ - public function load() - { - $item = $this->pool->getItem($this->key); - if ($item->isHit()) { - $this->setFromStorage($item->get()); - } - } -} \ No newline at end of file diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php b/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php deleted file mode 100644 index e05b832..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php +++ /dev/null @@ -1,60 +0,0 @@ -key = $key; - $this->expire = $expire; - $this->pool = $pool; - } - - /** - * {@inheritdoc} - */ - public function load() - { - $item = $this->pool->getItem($this->key); - $contents = $item->get(); - - if ($item->isMiss() === false) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $item = $this->pool->getItem($this->key); - $item->set($contents, $this->expire); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php deleted file mode 100644 index b63cba7..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php +++ /dev/null @@ -1,104 +0,0 @@ -shouldReceive('has')->once()->with('file.json')->andReturn(false); - $cache = new Adapter($adapter, 'file.json', 10); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadExpired() - { - $response = ['contents' => json_encode([[], ['' => true], 1234567890]), 'path' => 'file.json']; - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true); - $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response); - $adapter->shouldReceive('delete')->once()->with('file.json'); - $cache = new Adapter($adapter, 'file.json', 10); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = ['contents' => json_encode([[], ['' => true], 9876543210]), 'path' => 'file.json']; - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true); - $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response); - $cache = new Adapter($adapter, 'file.json', 10); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSaveExists() - { - $response = json_encode([[], [], null]); - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true); - $adapter->shouldReceive('update')->once()->with('file.json', $response, Mockery::any()); - $cache = new Adapter($adapter, 'file.json', null); - $cache->save(); - } - - public function testSaveNew() - { - $response = json_encode([[], [], null]); - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(false); - $adapter->shouldReceive('write')->once()->with('file.json', $response, Mockery::any()); - $cache = new Adapter($adapter, 'file.json', null); - $cache->save(); - } - - public function testStoreContentsRecursive() - { - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(false); - $adapter->shouldReceive('write')->once()->with('file.json', Mockery::any(), Mockery::any()); - - $cache = new Adapter($adapter, 'file.json', null); - - $contents = [ - ['path' => 'foo/bar', 'dirname' => 'foo'], - ['path' => 'afoo/bang', 'dirname' => 'afoo'], - ]; - - $cache->storeContents('foo', $contents, true); - - $this->assertTrue($cache->isComplete('foo', true)); - $this->assertFalse($cache->isComplete('afoo', true)); - } - - public function testDeleteDir() - { - $cache_data = [ - 'foo' => ['path' => 'foo', 'type' => 'dir', 'dirname' => ''], - 'foo/bar' => ['path' => 'foo/bar', 'type' => 'file', 'dirname' => 'foo'], - 'foobaz' => ['path' => 'foobaz', 'type' => 'file', 'dirname' => ''], - ]; - - $response = [ - 'contents' => json_encode([$cache_data, [], null]), - 'path' => 'file.json', - ]; - - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->zeroOrMoreTimes()->with('file.json')->andReturn(true); - $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response); - $adapter->shouldReceive('update')->once()->with('file.json', Mockery::any(), Mockery::any())->andReturn(true); - - $cache = new Adapter($adapter, 'file.json', null); - $cache->load(); - - $cache->deleteDir('foo', true); - - $this->assertSame(1, count($cache->listContents('', true))); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php b/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php deleted file mode 100644 index 40d4c91..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php +++ /dev/null @@ -1,16 +0,0 @@ -shouldReceive('load')->once(); - $cached_adapter = new CachedAdapter($adapter, $cache); - $this->assertInstanceOf('League\Flysystem\AdapterInterface', $cached_adapter->getAdapter()); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php b/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php deleted file mode 100644 index e3d9ad9..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php +++ /dev/null @@ -1,35 +0,0 @@ -shouldReceive('get')->once()->andReturn(false); - $cache = new Memcached($client); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $client = Mockery::mock('Memcached'); - $client->shouldReceive('get')->once()->andReturn($response); - $cache = new Memcached($client); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $response = json_encode([[], []]); - $client = Mockery::mock('Memcached'); - $client->shouldReceive('set')->once()->andReturn($response); - $cache = new Memcached($client); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php deleted file mode 100644 index 3ac58fd..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php +++ /dev/null @@ -1,255 +0,0 @@ -setAutosave(true); - $this->assertTrue($cache->getAutosave()); - $cache->setAutosave(false); - $this->assertFalse($cache->getAutosave()); - } - - public function testCacheMiss() - { - $cache = new Memory(); - $cache->storeMiss('path.txt'); - $this->assertFalse($cache->has('path.txt')); - } - - public function testIsComplete() - { - $cache = new Memory(); - $this->assertFalse($cache->isComplete('dirname', false)); - $cache->setComplete('dirname', false); - $this->assertFalse($cache->isComplete('dirname', true)); - $cache->setComplete('dirname', true); - $this->assertTrue($cache->isComplete('dirname', true)); - } - - public function testCleanContents() - { - $cache = new Memory(); - $input = [[ - 'path' => 'path.txt', - 'visibility' => 'public', - 'invalid' => 'thing', - ]]; - - $expected = [[ - 'path' => 'path.txt', - 'visibility' => 'public', - ]]; - - $output = $cache->cleanContents($input); - $this->assertEquals($expected, $output); - } - - public function testGetForStorage() - { - $cache = new Memory(); - $input = [[ - 'path' => 'path.txt', - 'visibility' => 'public', - 'type' => 'file', - ]]; - - $cache->storeContents('', $input, true); - $contents = $cache->listContents('', true); - $cached = []; - foreach ($contents as $item) { - $cached[$item['path']] = $item; - } - - $this->assertEquals(json_encode([$cached, ['' => 'recursive']]), $cache->getForStorage()); - } - - public function testParentCompleteIsUsedDuringHas() - { - $cache = new Memory(); - $cache->setComplete('dirname', false); - $this->assertFalse($cache->has('dirname/path.txt')); - } - - public function testFlush() - { - $cache = new Memory(); - $cache->setComplete('dirname', true); - $cache->updateObject('path.txt', [ - 'path' => 'path.txt', - 'visibility' => 'public', - ]); - $cache->flush(); - $this->assertFalse($cache->isComplete('dirname', true)); - $this->assertNull($cache->has('path.txt')); - } - - public function testSetFromStorage() - { - $cache = new Memory(); - $json = [[ - 'path.txt' => ['path' => 'path.txt', 'type' => 'file'], - ], ['dirname' => 'recursive']]; - $jsonString = json_encode($json); - $cache->setFromStorage($jsonString); - $this->assertTrue($cache->has('path.txt')); - $this->assertTrue($cache->isComplete('dirname', true)); - } - - public function testGetMetadataFail() - { - $cache = new Memory(); - $this->assertFalse($cache->getMetadata('path.txt')); - } - - public function metaGetterProvider() - { - return [ - ['getTimestamp', 'timestamp', 12344], - ['getMimetype', 'mimetype', 'text/plain'], - ['getSize', 'size', 12], - ['getVisibility', 'visibility', 'private'], - ['read', 'contents', '__contents__'], - ]; - } - - /** - * @dataProvider metaGetterProvider - * - * @param $method - * @param $key - * @param $value - */ - public function testMetaGetters($method, $key, $value) - { - $cache = new Memory(); - $this->assertFalse($cache->{$method}('path.txt')); - $cache->updateObject('path.txt', $object = [ - 'path' => 'path.txt', - 'type' => 'file', - $key => $value, - ] + Util::pathinfo('path.txt'), true); - $this->assertEquals($object, $cache->{$method}('path.txt')); - $this->assertEquals($object, $cache->getMetadata('path.txt')); - } - - public function testGetDerivedMimetype() - { - $cache = new Memory(); - $cache->updateObject('path.txt', [ - 'contents' => 'something', - ]); - $response = $cache->getMimetype('path.txt'); - $this->assertEquals('text/plain', $response['mimetype']); - } - - public function testCopyFail() - { - $cache = new Memory(); - $cache->copy('one', 'two'); - $this->assertNull($cache->has('two')); - $this->assertNull($cache->load()); - } - - public function testStoreContents() - { - $cache = new Memory(); - $cache->storeContents('dirname', [ - ['path' => 'dirname', 'type' => 'dir'], - ['path' => 'dirname/nested', 'type' => 'dir'], - ['path' => 'dirname/nested/deep', 'type' => 'dir'], - ['path' => 'other/nested/deep', 'type' => 'dir'], - ], true); - - $this->isTrue($cache->isComplete('other/nested', true)); - } - - public function testDelete() - { - $cache = new Memory(); - $cache->updateObject('path.txt', ['type' => 'file']); - $this->assertTrue($cache->has('path.txt')); - $cache->delete('path.txt'); - $this->assertFalse($cache->has('path.txt')); - } - - public function testDeleteDir() - { - $cache = new Memory(); - $cache->storeContents('dirname', [ - ['path' => 'dirname/path.txt', 'type' => 'file'], - ]); - $this->assertTrue($cache->isComplete('dirname', false)); - $this->assertTrue($cache->has('dirname/path.txt')); - $cache->deleteDir('dirname'); - $this->assertFalse($cache->isComplete('dirname', false)); - $this->assertNull($cache->has('dirname/path.txt')); - } - - public function testReadStream() - { - $cache = new Memory(); - $this->assertFalse($cache->readStream('path.txt')); - } - - public function testRename() - { - $cache = new Memory(); - $cache->updateObject('path.txt', ['type' => 'file']); - $cache->rename('path.txt', 'newpath.txt'); - $this->assertTrue($cache->has('newpath.txt')); - } - - public function testCopy() - { - $cache = new Memory(); - $cache->updateObject('path.txt', ['type' => 'file']); - $cache->copy('path.txt', 'newpath.txt'); - $this->assertTrue($cache->has('newpath.txt')); - } - - public function testComplextListContents() - { - $cache = new Memory(); - $cache->storeContents('', [ - ['path' => 'dirname', 'type' => 'dir'], - ['path' => 'dirname/file.txt', 'type' => 'file'], - ['path' => 'other', 'type' => 'dir'], - ['path' => 'other/file.txt', 'type' => 'file'], - ['path' => 'other/nested/file.txt', 'type' => 'file'], - ]); - - $this->assertCount(3, $cache->listContents('other', true)); - } - - public function testComplextListContentsWithDeletedFile() - { - $cache = new Memory(); - $cache->storeContents('', [ - ['path' => 'dirname', 'type' => 'dir'], - ['path' => 'dirname/file.txt', 'type' => 'file'], - ['path' => 'other', 'type' => 'dir'], - ['path' => 'other/file.txt', 'type' => 'file'], - ['path' => 'other/another_file.txt', 'type' => 'file'], - ]); - - $cache->delete('other/another_file.txt'); - $this->assertCount(4, $cache->listContents('', true)); - } - - public function testCacheMissIfContentsIsFalse() - { - $cache = new Memory(); - $cache->updateObject('path.txt', [ - 'path' => 'path.txt', - 'contents' => false, - ], true); - - $this->assertFalse($cache->read('path.txt')); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php deleted file mode 100644 index 148616f..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals($cache, $cache->storeMiss('file.txt')); - $this->assertNull($cache->setComplete('', false)); - $this->assertNull($cache->load()); - $this->assertNull($cache->flush()); - $this->assertNull($cache->has('path.txt')); - $this->assertNull($cache->autosave()); - $this->assertFalse($cache->isComplete('', false)); - $this->assertFalse($cache->read('something')); - $this->assertFalse($cache->readStream('something')); - $this->assertFalse($cache->getMetadata('something')); - $this->assertFalse($cache->getMimetype('something')); - $this->assertFalse($cache->getSize('something')); - $this->assertFalse($cache->getTimestamp('something')); - $this->assertFalse($cache->getVisibility('something')); - $this->assertEmpty($cache->listContents('', false)); - $this->assertFalse($cache->rename('', '')); - $this->assertFalse($cache->copy('', '')); - $this->assertNull($cache->save()); - $object = ['path' => 'path.ext']; - $this->assertEquals($object, $cache->updateObject('path.txt', $object)); - $this->assertEquals([['path' => 'some/file.txt']], $cache->storeContents('unknwon', [ - ['path' => 'some/file.txt'], - ], false)); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php b/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php deleted file mode 100644 index d1ccb65..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php +++ /dev/null @@ -1,45 +0,0 @@ -shouldReceive('get')->with('flysystem')->once()->andReturn(false); - $cache = new PhpRedis($client); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $client = Mockery::mock('Redis'); - $client->shouldReceive('get')->with('flysystem')->once()->andReturn($response); - $cache = new PhpRedis($client); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Redis'); - $client->shouldReceive('set')->with('flysystem', $data)->once(); - $cache = new PhpRedis($client); - $cache->save(); - } - - public function testSaveWithExpire() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Redis'); - $client->shouldReceive('set')->with('flysystem', $data)->once(); - $client->shouldReceive('expire')->with('flysystem', 20)->once(); - $cache = new PhpRedis($client, 'flysystem', 20); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/PredisTests.php b/vendor/league/flysystem-cached-adapter/tests/PredisTests.php deleted file mode 100644 index e33e104..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/PredisTests.php +++ /dev/null @@ -1,55 +0,0 @@ -shouldReceive('createCommand')->with('get', ['flysystem'])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->andReturn(null); - $cache = new Predis($client); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $client = Mockery::mock('Predis\Client'); - $command = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('get', ['flysystem'])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->andReturn($response); - $cache = new Predis($client); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Predis\Client'); - $command = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('set', ['flysystem', $data])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->once(); - $cache = new Predis($client); - $cache->save(); - } - - public function testSaveWithExpire() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Predis\Client'); - $command = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('set', ['flysystem', $data])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->once(); - $expireCommand = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('expire', ['flysystem', 20])->once()->andReturn($expireCommand); - $client->shouldReceive('executeCommand')->with($expireCommand)->once(); - $cache = new Predis($client, 'flysystem', 20); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php b/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php deleted file mode 100644 index d5e5700..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php +++ /dev/null @@ -1,45 +0,0 @@ -shouldReceive('isHit')->once()->andReturn(false); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Psr6Cache($pool); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $pool = Mockery::mock('Psr\Cache\CacheItemPoolInterface'); - $item = Mockery::mock('Psr\Cache\CacheItemInterface'); - $item->shouldReceive('get')->once()->andReturn($response); - $item->shouldReceive('isHit')->once()->andReturn(true); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Psr6Cache($pool); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $response = json_encode([[], []]); - $ttl = 4711; - $pool = Mockery::mock('Psr\Cache\CacheItemPoolInterface'); - $item = Mockery::mock('Psr\Cache\CacheItemInterface'); - $item->shouldReceive('expiresAfter')->once()->with($ttl); - $item->shouldReceive('set')->once()->andReturn($response); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $pool->shouldReceive('save')->once()->with($item); - $cache = new Psr6Cache($pool, 'foo', $ttl); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/StashTest.php b/vendor/league/flysystem-cached-adapter/tests/StashTest.php deleted file mode 100644 index 29e142d..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/StashTest.php +++ /dev/null @@ -1,43 +0,0 @@ -shouldReceive('get')->once()->andReturn(null); - $item->shouldReceive('isMiss')->once()->andReturn(true); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Stash($pool); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $pool = Mockery::mock('Stash\Pool'); - $item = Mockery::mock('Stash\Item'); - $item->shouldReceive('get')->once()->andReturn($response); - $item->shouldReceive('isMiss')->once()->andReturn(false); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Stash($pool); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $response = json_encode([[], []]); - $pool = Mockery::mock('Stash\Pool'); - $item = Mockery::mock('Stash\Item'); - $item->shouldReceive('set')->once()->andReturn($response); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Stash($pool); - $cache->save(); - } -} diff --git a/vendor/league/flysystem/CODE_OF_CONDUCT.md b/vendor/league/flysystem/CODE_OF_CONDUCT.md deleted file mode 100644 index 89569c0..0000000 --- a/vendor/league/flysystem/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at info+flysystem@frankdejonge.nl. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/vendor/league/flysystem/LICENSE b/vendor/league/flysystem/LICENSE deleted file mode 100644 index f2684c8..0000000 --- a/vendor/league/flysystem/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2019 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/league/flysystem/SECURITY.md b/vendor/league/flysystem/SECURITY.md deleted file mode 100644 index f5b205e..0000000 --- a/vendor/league/flysystem/SECURITY.md +++ /dev/null @@ -1,16 +0,0 @@ -# Security Policy - -## Supported Versions - -| Version | Supported | -| ------- | ------------------ | -| 1.0.x | :white_check_mark: | -| 2.0.x | :x: | - -## Reporting a Vulnerability - -When you've encountered a security vulnerability, please disclose it securely. - -The security process is described at: -[https://flysystem.thephpleague.com/docs/security/](https://flysystem.thephpleague.com/docs/security/) - diff --git a/vendor/league/flysystem/composer.json b/vendor/league/flysystem/composer.json deleted file mode 100644 index bd7434a..0000000 --- a/vendor/league/flysystem/composer.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "league/flysystem", - "type": "library", - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "filesystem", "filesystems", "files", "storage", "dropbox", "aws", - "abstraction", "s3", "ftp", "sftp", "remote", "webdav", - "file systems", "cloud", "cloud files", "rackspace", "copy.com" - ], - "funding": [ - { - "type": "other", - "url": "https://offset.earth/frankdejonge" - } - ], - "license": "MIT", - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "require": { - "php": "^7.2.5 || ^8.0", - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "League\\Flysystem\\Stub\\": "stub/" - } - }, - "suggest": { - "ext-fileinfo": "Required for MimeType", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "scripts": { - "phpstan": "php phpstan.php" - } -} diff --git a/vendor/league/flysystem/deprecations.md b/vendor/league/flysystem/deprecations.md deleted file mode 100644 index c336a42..0000000 --- a/vendor/league/flysystem/deprecations.md +++ /dev/null @@ -1,19 +0,0 @@ -# Deprecations - -This document lists all the planned deprecations. - -## Handlers will be removed in 2.0 - -The `Handler` type and associated calls will be removed in version 2.0. - -### Upgrade path - -You should create your own implementation for handling OOP usage, -but it's recommended to move away from using an OOP-style wrapper entirely. - -The reason for this is that it's too easy for implementation details (for -your application this is Flysystem) to leak into the application. The most -important part for Flysystem is that it improves portability and creates a -solid boundary between your application core and the infrastructure you use. -The OOP-style handling breaks this principle, therefore I want to stop -promoting it. diff --git a/vendor/league/flysystem/src/Adapter/AbstractAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractAdapter.php deleted file mode 100644 index e577ac4..0000000 --- a/vendor/league/flysystem/src/Adapter/AbstractAdapter.php +++ /dev/null @@ -1,72 +0,0 @@ -pathPrefix = null; - - return; - } - - $this->pathPrefix = rtrim($prefix, '\\/') . $this->pathSeparator; - } - - /** - * Get the path prefix. - * - * @return string|null path prefix or null if pathPrefix is empty - */ - public function getPathPrefix() - { - return $this->pathPrefix; - } - - /** - * Prefix a path. - * - * @param string $path - * - * @return string prefixed path - */ - public function applyPathPrefix($path) - { - return $this->getPathPrefix() . ltrim($path, '\\/'); - } - - /** - * Remove a path prefix. - * - * @param string $path - * - * @return string path without the prefix - */ - public function removePathPrefix($path) - { - return substr($path, strlen($this->getPathPrefix())); - } -} diff --git a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php deleted file mode 100644 index b232cdc..0000000 --- a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php +++ /dev/null @@ -1,705 +0,0 @@ -safeStorage = new SafeStorage(); - $this->setConfig($config); - } - - /** - * Set the config. - * - * @param array $config - * - * @return $this - */ - public function setConfig(array $config) - { - foreach ($this->configurable as $setting) { - if ( ! isset($config[$setting])) { - continue; - } - - $method = 'set' . ucfirst($setting); - - if (method_exists($this, $method)) { - $this->$method($config[$setting]); - } - } - - return $this; - } - - /** - * Returns the host. - * - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Set the host. - * - * @param string $host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - - return $this; - } - - /** - * Set the public permission value. - * - * @param int $permPublic - * - * @return $this - */ - public function setPermPublic($permPublic) - { - $this->permPublic = $permPublic; - - return $this; - } - - /** - * Set the private permission value. - * - * @param int $permPrivate - * - * @return $this - */ - public function setPermPrivate($permPrivate) - { - $this->permPrivate = $permPrivate; - - return $this; - } - - /** - * Returns the ftp port. - * - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Returns the root folder to work from. - * - * @return string - */ - public function getRoot() - { - return $this->root; - } - - /** - * Set the ftp port. - * - * @param int|string $port - * - * @return $this - */ - public function setPort($port) - { - $this->port = (int) $port; - - return $this; - } - - /** - * Set the root folder to work from. - * - * @param string $root - * - * @return $this - */ - public function setRoot($root) - { - $this->root = rtrim($root, '\\/') . $this->separator; - - return $this; - } - - /** - * Returns the ftp username. - * - * @return string username - */ - public function getUsername() - { - $username = $this->safeStorage->retrieveSafely('username'); - - return $username !== null ? $username : 'anonymous'; - } - - /** - * Set ftp username. - * - * @param string $username - * - * @return $this - */ - public function setUsername($username) - { - $this->safeStorage->storeSafely('username', $username); - - return $this; - } - - /** - * Returns the password. - * - * @return string password - */ - public function getPassword() - { - return $this->safeStorage->retrieveSafely('password'); - } - - /** - * Set the ftp password. - * - * @param string $password - * - * @return $this - */ - public function setPassword($password) - { - $this->safeStorage->storeSafely('password', $password); - - return $this; - } - - /** - * Returns the amount of seconds before the connection will timeout. - * - * @return int - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Set the amount of seconds before the connection should timeout. - * - * @param int $timeout - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->timeout = (int) $timeout; - - return $this; - } - - /** - * Return the FTP system type. - * - * @return string - */ - public function getSystemType() - { - return $this->systemType; - } - - /** - * Set the FTP system type (windows or unix). - * - * @param string $systemType - * - * @return $this - */ - public function setSystemType($systemType) - { - $this->systemType = strtolower($systemType); - - return $this; - } - - /** - * True to enable timestamps for FTP servers that return unix-style listings. - * - * @param bool $bool - * - * @return $this - */ - public function setEnableTimestampsOnUnixListings($bool = false) - { - $this->enableTimestampsOnUnixListings = $bool; - - return $this; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return $this->listDirectoryContents($directory, $recursive); - } - - abstract protected function listDirectoryContents($directory, $recursive = false); - - /** - * Normalize a directory listing. - * - * @param array $listing - * @param string $prefix - * - * @return array directory listing - */ - protected function normalizeListing(array $listing, $prefix = '') - { - $base = $prefix; - $result = []; - $listing = $this->removeDotDirectories($listing); - - while ($item = array_shift($listing)) { - if (preg_match('#^.*:$#', $item)) { - $base = preg_replace('~^\./*|:$~', '', $item); - continue; - } - - $result[] = $this->normalizeObject($item, $base); - } - - return $this->sortListing($result); - } - - /** - * Sort a directory listing. - * - * @param array $result - * - * @return array sorted listing - */ - protected function sortListing(array $result) - { - $compare = function ($one, $two) { - return strnatcmp($one['path'], $two['path']); - }; - - usort($result, $compare); - - return $result; - } - - /** - * Normalize a file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - * - * @throws NotSupportedException - */ - protected function normalizeObject($item, $base) - { - $systemType = $this->systemType ?: $this->detectSystemType($item); - - if ($systemType === 'unix') { - return $this->normalizeUnixObject($item, $base); - } elseif ($systemType === 'windows') { - return $this->normalizeWindowsObject($item, $base); - } - - throw NotSupportedException::forFtpSystemType($systemType); - } - - /** - * Normalize a Unix file entry. - * - * Given $item contains: - * '-rw-r--r-- 1 ftp ftp 409 Aug 19 09:01 file1.txt' - * - * This function will return: - * [ - * 'type' => 'file', - * 'path' => 'file1.txt', - * 'visibility' => 'public', - * 'size' => 409, - * 'timestamp' => 1566205260 - * ] - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeUnixObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 7); - - if (count(explode(' ', $item, 9)) !== 9) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($permissions, /* $number */, /* $owner */, /* $group */, $size, $month, $day, $timeOrYear, $name) = explode(' ', $item, 9); - $type = $this->detectType($permissions); - $path = $base === '' ? $name : $base . $this->separator . $name; - - if ($type === 'dir') { - $result = compact('type', 'path'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - $permissions = $this->normalizePermissions($permissions); - $visibility = $permissions & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE; - $size = (int) $size; - - $result = compact('type', 'path', 'visibility', 'size'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - /** - * Only accurate to the minute (current year), or to the day. - * - * Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command - * - * Note: The 'MLSD' command is a machine-readable replacement for 'LIST' - * but many FTP servers do not support it :( - * - * @param string $month e.g. 'Aug' - * @param string $day e.g. '19' - * @param string $timeOrYear e.g. '09:01' OR '2015' - * - * @return int - */ - protected function normalizeUnixTimestamp($month, $day, $timeOrYear) - { - if (is_numeric($timeOrYear)) { - $year = $timeOrYear; - $hour = '00'; - $minute = '00'; - $seconds = '00'; - } else { - $year = date('Y'); - list($hour, $minute) = explode(':', $timeOrYear); - $seconds = '00'; - } - $dateTime = DateTime::createFromFormat('Y-M-j-G:i:s', "{$year}-{$month}-{$day}-{$hour}:{$minute}:{$seconds}"); - - return $dateTime->getTimestamp(); - } - - /** - * Normalize a Windows/DOS file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeWindowsObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 3); - - if (count(explode(' ', $item, 4)) !== 4) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($date, $time, $size, $name) = explode(' ', $item, 4); - $path = $base === '' ? $name : $base . $this->separator . $name; - - // Check for the correct date/time format - $format = strlen($date) === 8 ? 'm-d-yH:iA' : 'Y-m-dH:i'; - $dt = DateTime::createFromFormat($format, $date . $time); - $timestamp = $dt ? $dt->getTimestamp() : (int) strtotime("$date $time"); - - if ($size === '') { - $type = 'dir'; - - return compact('type', 'path', 'timestamp'); - } - - $type = 'file'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $size = (int) $size; - - return compact('type', 'path', 'visibility', 'size', 'timestamp'); - } - - /** - * Get the system type from a listing item. - * - * @param string $item - * - * @return string the system type - */ - protected function detectSystemType($item) - { - return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', $item) ? 'windows' : 'unix'; - } - - /** - * Get the file type from the permissions. - * - * @param string $permissions - * - * @return string file type - */ - protected function detectType($permissions) - { - return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file'; - } - - /** - * Normalize a permissions string. - * - * @param string $permissions - * - * @return int - */ - protected function normalizePermissions($permissions) - { - if (is_numeric($permissions)) { - return ((int) $permissions) & 0777; - } - - // remove the type identifier - $permissions = substr($permissions, 1); - - // map the string rights to the numeric counterparts - $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; - $permissions = strtr($permissions, $map); - - // split up the permission groups - $parts = str_split($permissions, 3); - - // convert the groups - $mapper = function ($part) { - return array_sum(str_split($part)); - }; - - // converts to decimal number - return octdec(implode('', array_map($mapper, $parts))); - } - - /** - * Filter out dot-directories. - * - * @param array $list - * - * @return array - */ - public function removeDotDirectories(array $list) - { - $filter = function ($line) { - return $line !== '' && ! preg_match('#.* \.(\.)?$|^total#', $line); - }; - - return array_filter($list, $filter); - } - - /** - * @inheritdoc - */ - public function has($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return $this->getMetadata($path); - } - - /** - * Ensure a directory exists. - * - * @param string $dirname - */ - public function ensureDirectory($dirname) - { - $dirname = (string) $dirname; - - if ($dirname !== '' && ! $this->has($dirname)) { - $this->createDir($dirname, new Config()); - } - } - - /** - * @return mixed - */ - public function getConnection() - { - if ( ! $this->isConnected()) { - $this->disconnect(); - $this->connect(); - } - - return $this->connection; - } - - /** - * Get the public permission value. - * - * @return int - */ - public function getPermPublic() - { - return $this->permPublic; - } - - /** - * Get the private permission value. - * - * @return int - */ - public function getPermPrivate() - { - return $this->permPrivate; - } - - /** - * Disconnect on destruction. - */ - public function __destruct() - { - $this->disconnect(); - } - - /** - * Establish a connection. - */ - abstract public function connect(); - - /** - * Close the connection. - */ - abstract public function disconnect(); - - /** - * Check if a connection is active. - * - * @return bool - */ - abstract public function isConnected(); - - protected function escapePath($path) - { - return str_replace(['*', '[', ']'], ['\\*', '\\[', '\\]'], $path); - } -} diff --git a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php b/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php deleted file mode 100644 index fd8d216..0000000 --- a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php +++ /dev/null @@ -1,12 +0,0 @@ -transferMode = $mode; - - return $this; - } - - /** - * Set if Ssl is enabled. - * - * @param bool $ssl - * - * @return $this - */ - public function setSsl($ssl) - { - $this->ssl = (bool) $ssl; - - return $this; - } - - /** - * Set if passive mode should be used. - * - * @param bool $passive - */ - public function setPassive($passive = true) - { - $this->passive = $passive; - } - - /** - * @param bool $ignorePassiveAddress - */ - public function setIgnorePassiveAddress($ignorePassiveAddress) - { - $this->ignorePassiveAddress = $ignorePassiveAddress; - } - - /** - * @param bool $recurseManually - */ - public function setRecurseManually($recurseManually) - { - $this->recurseManually = $recurseManually; - } - - /** - * @param bool $utf8 - */ - public function setUtf8($utf8) - { - $this->utf8 = (bool) $utf8; - } - - /** - * Connect to the FTP server. - */ - public function connect() - { - $tries = 3; - start_connecting: - - if ($this->ssl) { - $this->connection = @ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } else { - $this->connection = @ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } - - if ( ! $this->connection) { - $tries--; - - if ($tries > 0) goto start_connecting; - - throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); - } - - $this->login(); - $this->setUtf8Mode(); - $this->setConnectionPassiveMode(); - $this->setConnectionRoot(); - $this->isPureFtpd = $this->isPureFtpdServer(); - } - - /** - * Set the connection to UTF-8 mode. - */ - protected function setUtf8Mode() - { - if ($this->utf8) { - $response = ftp_raw($this->connection, "OPTS UTF8 ON"); - if (substr($response[0], 0, 3) !== '200') { - throw new ConnectionRuntimeException( - 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - } - - /** - * Set the connections to passive mode. - * - * @throws ConnectionRuntimeException - */ - protected function setConnectionPassiveMode() - { - if (is_bool($this->ignorePassiveAddress) && defined('FTP_USEPASVADDRESS')) { - ftp_set_option($this->connection, FTP_USEPASVADDRESS, ! $this->ignorePassiveAddress); - } - - if ( ! ftp_pasv($this->connection, $this->passive)) { - throw new ConnectionRuntimeException( - 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - - /** - * Set the connection root. - */ - protected function setConnectionRoot() - { - $root = $this->getRoot(); - $connection = $this->connection; - - if ($root && ! ftp_chdir($connection, $root)) { - throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); - } - - // Store absolute path for further reference. - // This is needed when creating directories and - // initial root was a relative path, else the root - // would be relative to the chdir'd path. - $this->root = ftp_pwd($connection); - } - - /** - * Login. - * - * @throws ConnectionRuntimeException - */ - protected function login() - { - set_error_handler(function () { - }); - $isLoggedIn = ftp_login( - $this->connection, - $this->getUsername(), - $this->getPassword() - ); - restore_error_handler(); - - if ( ! $isLoggedIn) { - $this->disconnect(); - throw new ConnectionRuntimeException( - 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( - ) . ', username: ' . $this->getUsername() - ); - } - } - - /** - * Disconnect from the FTP server. - */ - public function disconnect() - { - if (is_resource($this->connection)) { - @ftp_close($this->connection); - } - - $this->connection = null; - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $contents); - rewind($stream); - $result = $this->writeStream($path, $stream, $config); - fclose($stream); - - if ($result === false) { - return false; - } - - $result['contents'] = $contents; - $result['mimetype'] = $config->get('mimetype') ?: Util::guessMimeType($path, $contents); - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $this->ensureDirectory(Util::dirname($path)); - - if ( ! ftp_fput($this->getConnection(), $path, $resource, $this->transferMode)) { - return false; - } - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - } - - $type = 'file'; - - return compact('type', 'path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return $this->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return ftp_rename($this->getConnection(), $path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return ftp_delete($this->getConnection(), $path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $connection = $this->getConnection(); - $contents = array_reverse($this->listDirectoryContents($dirname, false)); - - foreach ($contents as $object) { - if ($object['type'] === 'file') { - if ( ! ftp_delete($connection, $object['path'])) { - return false; - } - } elseif ( ! $this->deleteDir($object['path'])) { - return false; - } - } - - return ftp_rmdir($connection, $dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $connection = $this->getConnection(); - $directories = explode('/', $dirname); - - foreach ($directories as $directory) { - if (false === $this->createActualDirectory($directory, $connection)) { - $this->setConnectionRoot(); - - return false; - } - - ftp_chdir($connection, $directory); - } - - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $dirname]; - } - - /** - * Create a directory. - * - * @param string $directory - * @param resource $connection - * - * @return bool - */ - protected function createActualDirectory($directory, $connection) - { - // List the current directory - $listing = ftp_nlist($connection, '.') ?: []; - - foreach ($listing as $key => $item) { - if (preg_match('~^\./.*~', $item)) { - $listing[$key] = substr($item, 2); - } - } - - if (in_array($directory, $listing, true)) { - return true; - } - - return (boolean) ftp_mkdir($connection, $directory); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - if ($path === '') { - return ['type' => 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $listing = $this->ftpRawlist('-A', $path); - - if (empty($listing) || in_array('total 0', $listing, true)) { - return false; - } - - if (preg_match('/.* not found/', $listing[0])) { - return false; - } - - if (preg_match('/^total [0-9]*$/', $listing[0])) { - array_shift($listing); - } - - return $this->normalizeObject($listing[0], ''); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - if ( ! $metadata = $this->getMetadata($path)) { - return false; - } - - $metadata['mimetype'] = MimeType::detectByFilename($path); - - return $metadata; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $timestamp = ftp_mdtm($this->getConnection(), $path); - - return ($timestamp !== -1) ? ['path' => $path, 'timestamp' => $timestamp] : false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - if ( ! $object = $this->readStream($path)) { - return false; - } - - $object['contents'] = stream_get_contents($object['stream']); - fclose($object['stream']); - unset($object['stream']); - - return $object; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $stream = fopen('php://temp', 'w+b'); - $result = ftp_fget($this->getConnection(), $stream, $path, $this->transferMode); - rewind($stream); - - if ( ! $result) { - fclose($stream); - - return false; - } - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $mode = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? $this->getPermPublic() : $this->getPermPrivate(); - - if ( ! ftp_chmod($this->getConnection(), $mode, $path)) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContents($directory, $recursive = true) - { - if ($recursive && $this->recurseManually) { - return $this->listDirectoryContentsRecursive($directory); - } - - $options = $recursive ? '-alnR' : '-aln'; - $listing = $this->ftpRawlist($options, $directory); - - return $listing ? $this->normalizeListing($listing, $directory) : []; - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContentsRecursive($directory) - { - $listing = $this->normalizeListing($this->ftpRawlist('-aln', $directory) ?: [], $directory); - $output = []; - - foreach ($listing as $item) { - $output[] = $item; - if ($item['type'] !== 'dir') { - continue; - } - $output = array_merge($output, $this->listDirectoryContentsRecursive($item['path'])); - } - - return $output; - } - - /** - * Check if the connection is open. - * - * @return bool - * - * @throws ConnectionErrorException - */ - public function isConnected() - { - return is_resource($this->connection) - && $this->getRawExecResponseCode('NOOP') === 200; - } - - /** - * @return bool - */ - protected function isPureFtpdServer() - { - $response = ftp_raw($this->connection, 'HELP'); - - return stripos(implode(' ', $response), 'Pure-FTPd') !== false; - } - - /** - * The ftp_rawlist function with optional escaping. - * - * @param string $options - * @param string $path - * - * @return array - */ - protected function ftpRawlist($options, $path) - { - $connection = $this->getConnection(); - - if ($this->isPureFtpd) { - $path = str_replace(' ', '\ ', $path); - $this->escapePath($path); - } - - return ftp_rawlist($connection, $options . ' ' . $path); - } - - private function getRawExecResponseCode($command) - { - $response = @ftp_raw($this->connection, trim($command)); - - return (int) preg_replace('/\D/', '', implode(' ', $response)); - } -} diff --git a/vendor/league/flysystem/src/Adapter/Ftpd.php b/vendor/league/flysystem/src/Adapter/Ftpd.php deleted file mode 100644 index 7e71d19..0000000 --- a/vendor/league/flysystem/src/Adapter/Ftpd.php +++ /dev/null @@ -1,48 +0,0 @@ - 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path)); - - if ( ! $object || count($object) < 3) { - return false; - } - - if (substr($object[1], 0, 5) === "ftpd:") { - return false; - } - - return $this->normalizeObject($object[1], ''); - } - - /** - * @inheritdoc - */ - protected function listDirectoryContents($directory, $recursive = true) - { - $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive); - - if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) { - return []; - } - - return $this->normalizeListing($listing, $directory); - } -} diff --git a/vendor/league/flysystem/src/Adapter/Local.php b/vendor/league/flysystem/src/Adapter/Local.php deleted file mode 100644 index 747c463..0000000 --- a/vendor/league/flysystem/src/Adapter/Local.php +++ /dev/null @@ -1,533 +0,0 @@ - [ - 'public' => 0644, - 'private' => 0600, - ], - 'dir' => [ - 'public' => 0755, - 'private' => 0700, - ], - ]; - - /** - * @var string - */ - protected $pathSeparator = DIRECTORY_SEPARATOR; - - /** - * @var array - */ - protected $permissionMap; - - /** - * @var int - */ - protected $writeFlags; - - /** - * @var int - */ - private $linkHandling; - - /** - * Constructor. - * - * @param string $root - * @param int $writeFlags - * @param int $linkHandling - * @param array $permissions - * - * @throws LogicException - */ - public function __construct($root, $writeFlags = LOCK_EX, $linkHandling = self::DISALLOW_LINKS, array $permissions = []) - { - $root = is_link($root) ? realpath($root) : $root; - $this->permissionMap = array_replace_recursive(static::$permissions, $permissions); - $this->ensureDirectory($root); - - if ( ! is_dir($root) || ! is_readable($root)) { - throw new LogicException('The root path ' . $root . ' is not readable.'); - } - - $this->setPathPrefix($root); - $this->writeFlags = $writeFlags; - $this->linkHandling = $linkHandling; - } - - /** - * Ensure the root directory exists. - * - * @param string $root root directory path - * - * @return void - * - * @throws Exception in case the root directory can not be created - */ - protected function ensureDirectory($root) - { - if ( ! is_dir($root)) { - $umask = umask(0); - - if ( ! @mkdir($root, $this->permissionMap['dir']['public'], true)) { - $mkdirError = error_get_last(); - } - - umask($umask); - clearstatcache(false, $root); - - if ( ! is_dir($root)) { - $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : ''; - throw new Exception(sprintf('Impossible to create the root directory "%s". %s', $root, $errorMessage)); - } - } - } - - /** - * @inheritdoc - */ - public function has($path) - { - $location = $this->applyPathPrefix($path); - - return file_exists($location); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - - if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) { - return false; - } - - $type = 'file'; - $result = compact('contents', 'type', 'size', 'path'); - - if ($visibility = $config->get('visibility')) { - $result['visibility'] = $visibility; - $this->setVisibility($path, $visibility); - } - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - $stream = fopen($location, 'w+b'); - - if ( ! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) { - return false; - } - - $type = 'file'; - $result = compact('type', 'path'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $location = $this->applyPathPrefix($path); - $stream = fopen($location, 'rb'); - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $size = file_put_contents($location, $contents, $this->writeFlags); - - if ($size === false) { - return false; - } - - $type = 'file'; - - $result = compact('type', 'path', 'size', 'contents'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function read($path) - { - $location = $this->applyPathPrefix($path); - $contents = @file_get_contents($location); - - if ($contents === false) { - return false; - } - - return ['type' => 'file', 'path' => $path, 'contents' => $contents]; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $parentDirectory = $this->applyPathPrefix(Util::dirname($newpath)); - $this->ensureDirectory($parentDirectory); - - return rename($location, $destination); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $this->ensureDirectory(dirname($destination)); - - return copy($location, $destination); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $location = $this->applyPathPrefix($path); - - return @unlink($location); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $result = []; - $location = $this->applyPathPrefix($directory); - - if ( ! is_dir($location)) { - return []; - } - - $iterator = $recursive ? $this->getRecursiveDirectoryIterator($location) : $this->getDirectoryIterator($location); - - foreach ($iterator as $file) { - $path = $this->getFilePath($file); - - if (preg_match('#(^|/|\\\\)\.{1,2}$#', $path)) { - continue; - } - - $result[] = $this->normalizeFileInfo($file); - } - - unset($iterator); - - return array_filter($result); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $info = new SplFileInfo($location); - - return $this->normalizeFileInfo($info); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $location = $this->applyPathPrefix($path); - $finfo = new Finfo(FILEINFO_MIME_TYPE); - $mimetype = $finfo->file($location); - - if (in_array($mimetype, ['application/octet-stream', 'inode/x-empty', 'application/x-empty'])) { - $mimetype = Util\MimeType::detectByFilename($location); - } - - return ['path' => $path, 'type' => 'file', 'mimetype' => $mimetype]; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $permissions = octdec(substr(sprintf('%o', fileperms($location)), -4)); - $type = is_dir($location) ? 'dir' : 'file'; - - foreach ($this->permissionMap[$type] as $visibility => $visibilityPermissions) { - if ($visibilityPermissions == $permissions) { - return compact('path', 'visibility'); - } - } - - $visibility = substr(sprintf('%o', fileperms($location)), -4); - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $location = $this->applyPathPrefix($path); - $type = is_dir($location) ? 'dir' : 'file'; - $success = chmod($location, $this->permissionMap[$type][$visibility]); - - if ($success === false) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $location = $this->applyPathPrefix($dirname); - $umask = umask(0); - $visibility = $config->get('visibility', 'public'); - $return = ['path' => $dirname, 'type' => 'dir']; - - if ( ! is_dir($location)) { - if (false === @mkdir($location, $this->permissionMap['dir'][$visibility], true) - || false === is_dir($location)) { - $return = false; - } - } - - umask($umask); - - return $return; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $location = $this->applyPathPrefix($dirname); - - if ( ! is_dir($location)) { - return false; - } - - $contents = $this->getRecursiveDirectoryIterator($location, RecursiveIteratorIterator::CHILD_FIRST); - - /** @var SplFileInfo $file */ - foreach ($contents as $file) { - $this->guardAgainstUnreadableFileInfo($file); - $this->deleteFileInfoObject($file); - } - - unset($contents); - - return rmdir($location); - } - - /** - * @param SplFileInfo $file - */ - protected function deleteFileInfoObject(SplFileInfo $file) - { - switch ($file->getType()) { - case 'dir': - rmdir($file->getRealPath()); - break; - case 'link': - unlink($file->getPathname()); - break; - default: - unlink($file->getRealPath()); - } - } - - /** - * Normalize the file info. - * - * @param SplFileInfo $file - * - * @return array|void - * - * @throws NotSupportedException - */ - protected function normalizeFileInfo(SplFileInfo $file) - { - if ( ! $file->isLink()) { - return $this->mapFileInfo($file); - } - - if ($this->linkHandling & self::DISALLOW_LINKS) { - throw NotSupportedException::forLink($file); - } - } - - /** - * Get the normalized path from a SplFileInfo object. - * - * @param SplFileInfo $file - * - * @return string - */ - protected function getFilePath(SplFileInfo $file) - { - $location = $file->getPathname(); - $path = $this->removePathPrefix($location); - - return trim(str_replace('\\', '/', $path), '/'); - } - - /** - * @param string $path - * @param int $mode - * - * @return RecursiveIteratorIterator - */ - protected function getRecursiveDirectoryIterator($path, $mode = RecursiveIteratorIterator::SELF_FIRST) - { - return new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), - $mode - ); - } - - /** - * @param string $path - * - * @return DirectoryIterator - */ - protected function getDirectoryIterator($path) - { - $iterator = new DirectoryIterator($path); - - return $iterator; - } - - /** - * @param SplFileInfo $file - * - * @return array - */ - protected function mapFileInfo(SplFileInfo $file) - { - $normalized = [ - 'type' => $file->getType(), - 'path' => $this->getFilePath($file), - ]; - - $normalized['timestamp'] = $file->getMTime(); - - if ($normalized['type'] === 'file') { - $normalized['size'] = $file->getSize(); - } - - return $normalized; - } - - /** - * @param SplFileInfo $file - * - * @throws UnreadableFileException - */ - protected function guardAgainstUnreadableFileInfo(SplFileInfo $file) - { - if ( ! $file->isReadable()) { - throw UnreadableFileException::forFileInfo($file); - } - } -} diff --git a/vendor/league/flysystem/src/Adapter/NullAdapter.php b/vendor/league/flysystem/src/Adapter/NullAdapter.php deleted file mode 100644 index 2527087..0000000 --- a/vendor/league/flysystem/src/Adapter/NullAdapter.php +++ /dev/null @@ -1,144 +0,0 @@ -get('visibility')) { - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return false; - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return []; - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - return compact('visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - return ['path' => $dirname, 'type' => 'dir']; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - return false; - } -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php deleted file mode 100644 index fc0a747..0000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php +++ /dev/null @@ -1,33 +0,0 @@ -readStream($path); - - if ($response === false || ! is_resource($response['stream'])) { - return false; - } - - $result = $this->writeStream($newpath, $response['stream'], new Config()); - - if ($result !== false && is_resource($response['stream'])) { - fclose($response['stream']); - } - - return $result !== false; - } - - // Required abstract method - - /** - * @param string $path - * - * @return resource - */ - abstract public function readStream($path); - - /** - * @param string $path - * @param resource $resource - * @param Config $config - * - * @return resource - */ - abstract public function writeStream($path, $resource, Config $config); -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php deleted file mode 100644 index 2b31c01..0000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php +++ /dev/null @@ -1,44 +0,0 @@ -read($path)) { - return false; - } - - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $data['contents']); - rewind($stream); - $data['stream'] = $stream; - unset($data['contents']); - - return $data; - } - - /** - * Reads a file. - * - * @param string $path - * - * @return array|false - * - * @see League\Flysystem\ReadInterface::read() - */ - abstract public function read($path); -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php deleted file mode 100644 index 8042496..0000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php +++ /dev/null @@ -1,9 +0,0 @@ -stream($path, $resource, $config, 'write'); - } - - /** - * Update a file using a stream. - * - * @param string $path - * @param resource $resource - * @param Config $config Config object or visibility setting - * - * @return mixed false of file metadata - */ - public function updateStream($path, $resource, Config $config) - { - return $this->stream($path, $resource, $config, 'update'); - } - - // Required abstract methods - abstract public function write($pash, $contents, Config $config); - abstract public function update($pash, $contents, Config $config); -} diff --git a/vendor/league/flysystem/src/Adapter/SynologyFtp.php b/vendor/league/flysystem/src/Adapter/SynologyFtp.php deleted file mode 100644 index fe0d344..0000000 --- a/vendor/league/flysystem/src/Adapter/SynologyFtp.php +++ /dev/null @@ -1,8 +0,0 @@ -settings = $settings; - } - - /** - * Get a setting. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - public function get($key, $default = null) - { - if ( ! array_key_exists($key, $this->settings)) { - return $this->getDefault($key, $default); - } - - return $this->settings[$key]; - } - - /** - * Check if an item exists by key. - * - * @param string $key - * - * @return bool - */ - public function has($key) - { - if (array_key_exists($key, $this->settings)) { - return true; - } - - return $this->fallback instanceof Config - ? $this->fallback->has($key) - : false; - } - - /** - * Try to retrieve a default setting from a config fallback. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - protected function getDefault($key, $default) - { - if ( ! $this->fallback) { - return $default; - } - - return $this->fallback->get($key, $default); - } - - /** - * Set a setting. - * - * @param string $key - * @param mixed $value - * - * @return $this - */ - public function set($key, $value) - { - $this->settings[$key] = $value; - - return $this; - } - - /** - * Set the fallback. - * - * @param Config $fallback - * - * @return $this - */ - public function setFallback(Config $fallback) - { - $this->fallback = $fallback; - - return $this; - } -} diff --git a/vendor/league/flysystem/src/ConfigAwareTrait.php b/vendor/league/flysystem/src/ConfigAwareTrait.php deleted file mode 100644 index 202d605..0000000 --- a/vendor/league/flysystem/src/ConfigAwareTrait.php +++ /dev/null @@ -1,49 +0,0 @@ -config = $config ? Util::ensureConfig($config) : new Config; - } - - /** - * Get the Config. - * - * @return Config config object - */ - public function getConfig() - { - return $this->config; - } - - /** - * Convert a config array to a Config object with the correct fallback. - * - * @param array $config - * - * @return Config - */ - protected function prepareConfig(array $config) - { - $config = new Config($config); - $config->setFallback($this->getConfig()); - - return $config; - } -} diff --git a/vendor/league/flysystem/src/ConnectionErrorException.php b/vendor/league/flysystem/src/ConnectionErrorException.php deleted file mode 100644 index adb651d..0000000 --- a/vendor/league/flysystem/src/ConnectionErrorException.php +++ /dev/null @@ -1,9 +0,0 @@ -filesystem->deleteDir($this->path); - } - - /** - * List the directory contents. - * - * @param bool $recursive - * - * @return array|bool directory contents or false - */ - public function getContents($recursive = false) - { - return $this->filesystem->listContents($this->path, $recursive); - } -} diff --git a/vendor/league/flysystem/src/Exception.php b/vendor/league/flysystem/src/Exception.php deleted file mode 100644 index 4596c0a..0000000 --- a/vendor/league/flysystem/src/Exception.php +++ /dev/null @@ -1,8 +0,0 @@ -filesystem->has($this->path); - } - - /** - * Read the file. - * - * @return string|false file contents - */ - public function read() - { - return $this->filesystem->read($this->path); - } - - /** - * Read the file as a stream. - * - * @return resource|false file stream - */ - public function readStream() - { - return $this->filesystem->readStream($this->path); - } - - /** - * Write the new file. - * - * @param string $content - * - * @return bool success boolean - */ - public function write($content) - { - return $this->filesystem->write($this->path, $content); - } - - /** - * Write the new file using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function writeStream($resource) - { - return $this->filesystem->writeStream($this->path, $resource); - } - - /** - * Update the file contents. - * - * @param string $content - * - * @return bool success boolean - */ - public function update($content) - { - return $this->filesystem->update($this->path, $content); - } - - /** - * Update the file contents with a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function updateStream($resource) - { - return $this->filesystem->updateStream($this->path, $resource); - } - - /** - * Create the file or update if exists. - * - * @param string $content - * - * @return bool success boolean - */ - public function put($content) - { - return $this->filesystem->put($this->path, $content); - } - - /** - * Create the file or update if exists using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function putStream($resource) - { - return $this->filesystem->putStream($this->path, $resource); - } - - /** - * Rename the file. - * - * @param string $newpath - * - * @return bool success boolean - */ - public function rename($newpath) - { - if ($this->filesystem->rename($this->path, $newpath)) { - $this->path = $newpath; - - return true; - } - - return false; - } - - /** - * Copy the file. - * - * @param string $newpath - * - * @return File|false new file or false - */ - public function copy($newpath) - { - if ($this->filesystem->copy($this->path, $newpath)) { - return new File($this->filesystem, $newpath); - } - - return false; - } - - /** - * Get the file's timestamp. - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp() - { - return $this->filesystem->getTimestamp($this->path); - } - - /** - * Get the file's mimetype. - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype() - { - return $this->filesystem->getMimetype($this->path); - } - - /** - * Get the file's visibility. - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility() - { - return $this->filesystem->getVisibility($this->path); - } - - /** - * Get the file's metadata. - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata() - { - return $this->filesystem->getMetadata($this->path); - } - - /** - * Get the file size. - * - * @return int|false The file size or false on failure. - */ - public function getSize() - { - return $this->filesystem->getSize($this->path); - } - - /** - * Delete the file. - * - * @return bool success boolean - */ - public function delete() - { - return $this->filesystem->delete($this->path); - } -} diff --git a/vendor/league/flysystem/src/FileExistsException.php b/vendor/league/flysystem/src/FileExistsException.php deleted file mode 100644 index c82e20c..0000000 --- a/vendor/league/flysystem/src/FileExistsException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File already exists at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/league/flysystem/src/FileNotFoundException.php b/vendor/league/flysystem/src/FileNotFoundException.php deleted file mode 100644 index 989df69..0000000 --- a/vendor/league/flysystem/src/FileNotFoundException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was not found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/league/flysystem/src/Filesystem.php b/vendor/league/flysystem/src/Filesystem.php deleted file mode 100644 index 59cc82e..0000000 --- a/vendor/league/flysystem/src/Filesystem.php +++ /dev/null @@ -1,408 +0,0 @@ -adapter = $adapter; - $this->setConfig($config); - } - - /** - * Get the Adapter. - * - * @return AdapterInterface adapter - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * @inheritdoc - */ - public function has($path) - { - $path = Util::normalizePath($path); - - return strlen($path) === 0 ? false : (bool) $this->getAdapter()->has($path); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function put($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function putStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - Util::rewindStream($resource); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function readAndDelete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - $contents = $this->read($path); - - if ($contents === false) { - return false; - } - - $this->delete($path); - - return $contents; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - $this->assertPresent($path); - - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - $this->assertPresent($path); - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function read($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! ($object = $this->getAdapter()->read($path))) { - return false; - } - - return $object['contents']; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! $object = $this->getAdapter()->readStream($path)) { - return false; - } - - return $object['stream']; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return (bool) $this->getAdapter()->rename($path, $newpath); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return $this->getAdapter()->copy($path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->delete($path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $dirname = Util::normalizePath($dirname); - - if ($dirname === '') { - throw new RootViolationException('Root directories can not be deleted.'); - } - - return (bool) $this->getAdapter()->deleteDir($dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, array $config = []) - { - $dirname = Util::normalizePath($dirname); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->createDir($dirname, $config); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $directory = Util::normalizePath($directory); - $contents = $this->getAdapter()->listContents($directory, $recursive); - - return (new ContentListingFormatter($directory, $recursive, $this->config->get('case_sensitive', true))) - ->formatListing($contents); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getMimetype($path)) || ! array_key_exists('mimetype', $object)) { - return false; - } - - return $object['mimetype']; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getTimestamp($path)) || ! array_key_exists('timestamp', $object)) { - return false; - } - - return (int) $object['timestamp']; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getVisibility($path)) || ! array_key_exists('visibility', $object)) { - return false; - } - - return $object['visibility']; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getSize($path)) || ! array_key_exists('size', $object)) { - return false; - } - - return (int) $object['size']; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return (bool) $this->getAdapter()->setVisibility($path, $visibility); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function get($path, Handler $handler = null) - { - $path = Util::normalizePath($path); - - if ( ! $handler) { - $metadata = $this->getMetadata($path); - $handler = ($metadata && $metadata['type'] === 'file') ? new File($this, $path) : new Directory($this, $path); - } - - $handler->setPath($path); - $handler->setFilesystem($this); - - return $handler; - } - - /** - * Assert a file is present. - * - * @param string $path path to file - * - * @throws FileNotFoundException - * - * @return void - */ - public function assertPresent($path) - { - if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) { - throw new FileNotFoundException($path); - } - } - - /** - * Assert a file is absent. - * - * @param string $path path to file - * - * @throws FileExistsException - * - * @return void - */ - public function assertAbsent($path) - { - if ($this->config->get('disable_asserts', false) === false && $this->has($path)) { - throw new FileExistsException($path); - } - } -} diff --git a/vendor/league/flysystem/src/FilesystemException.php b/vendor/league/flysystem/src/FilesystemException.php deleted file mode 100644 index 3121e53..0000000 --- a/vendor/league/flysystem/src/FilesystemException.php +++ /dev/null @@ -1,7 +0,0 @@ -path = $path; - $this->filesystem = $filesystem; - } - - /** - * Check whether the entree is a directory. - * - * @return bool - */ - public function isDir() - { - return $this->getType() === 'dir'; - } - - /** - * Check whether the entree is a file. - * - * @return bool - */ - public function isFile() - { - return $this->getType() === 'file'; - } - - /** - * Retrieve the entree type (file|dir). - * - * @return string file or dir - */ - public function getType() - { - $metadata = $this->filesystem->getMetadata($this->path); - - return $metadata ? $metadata['type'] : 'dir'; - } - - /** - * Set the Filesystem object. - * - * @param FilesystemInterface $filesystem - * - * @return $this - */ - public function setFilesystem(FilesystemInterface $filesystem) - { - $this->filesystem = $filesystem; - - return $this; - } - - /** - * Retrieve the Filesystem object. - * - * @return FilesystemInterface - */ - public function getFilesystem() - { - return $this->filesystem; - } - - /** - * Set the entree path. - * - * @param string $path - * - * @return $this - */ - public function setPath($path) - { - $this->path = $path; - - return $this; - } - - /** - * Retrieve the entree path. - * - * @return string path - */ - public function getPath() - { - return $this->path; - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @return mixed - */ - public function __call($method, array $arguments) - { - array_unshift($arguments, $this->path); - $callback = [$this->filesystem, $method]; - - try { - return call_user_func_array($callback, $arguments); - } catch (BadMethodCallException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_called_class() - . '::' . $method - ); - } - } -} diff --git a/vendor/league/flysystem/src/InvalidRootException.php b/vendor/league/flysystem/src/InvalidRootException.php deleted file mode 100644 index 468d1d5..0000000 --- a/vendor/league/flysystem/src/InvalidRootException.php +++ /dev/null @@ -1,9 +0,0 @@ - Filesystem,] - * - * @throws InvalidArgumentException - */ - public function __construct(array $filesystems = []) - { - $this->mountFilesystems($filesystems); - } - - /** - * Mount filesystems. - * - * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystems(array $filesystems) - { - foreach ($filesystems as $prefix => $filesystem) { - $this->mountFilesystem($prefix, $filesystem); - } - - return $this; - } - - /** - * Mount filesystems. - * - * @param string $prefix - * @param FilesystemInterface $filesystem - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystem($prefix, FilesystemInterface $filesystem) - { - if ( ! is_string($prefix)) { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #1 to be a string.'); - } - - $this->filesystems[$prefix] = $filesystem; - - return $this; - } - - /** - * Get the filesystem with the corresponding prefix. - * - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return FilesystemInterface - */ - public function getFilesystem($prefix) - { - if ( ! isset($this->filesystems[$prefix])) { - throw new FilesystemNotFoundException('No filesystem mounted with prefix ' . $prefix); - } - - return $this->filesystems[$prefix]; - } - - /** - * Retrieve the prefix from an arguments array. - * - * @param array $arguments - * - * @throws InvalidArgumentException - * - * @return array [:prefix, :arguments] - */ - public function filterPrefix(array $arguments) - { - if (empty($arguments)) { - throw new InvalidArgumentException('At least one argument needed'); - } - - $path = array_shift($arguments); - - if ( ! is_string($path)) { - throw new InvalidArgumentException('First argument should be a string'); - } - - list($prefix, $path) = $this->getPrefixAndPath($path); - array_unshift($arguments, $path); - - return [$prefix, $arguments]; - } - - /** - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listContents($directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $filesystem = $this->getFilesystem($prefix); - $result = $filesystem->listContents($directory, $recursive); - - foreach ($result as &$file) { - $file['filesystem'] = $prefix; - } - - return $result; - } - - /** - * Call forwarder. - * - * @param string $method - * @param array $arguments - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function __call($method, $arguments) - { - list($prefix, $arguments) = $this->filterPrefix($arguments); - - return $this->invokePluginOnFilesystem($method, $arguments, $prefix); - } - - /** - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * @throws FileExistsException - * - * @return bool - */ - public function copy($from, $to, array $config = []) - { - list($prefixFrom, $from) = $this->getPrefixAndPath($from); - - $buffer = $this->getFilesystem($prefixFrom)->readStream($from); - - if ($buffer === false) { - return false; - } - - list($prefixTo, $to) = $this->getPrefixAndPath($to); - - $result = $this->getFilesystem($prefixTo)->writeStream($to, $buffer, $config); - - if (is_resource($buffer)) { - fclose($buffer); - } - - return $result; - } - - /** - * List with plugin adapter. - * - * @param array $keys - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listWith(array $keys = [], $directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $arguments = [$keys, $directory, $recursive]; - - return $this->invokePluginOnFilesystem('listWith', $arguments, $prefix); - } - - /** - * Move a file. - * - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return bool - */ - public function move($from, $to, array $config = []) - { - list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from); - list($prefixTo, $pathTo) = $this->getPrefixAndPath($to); - - if ($prefixFrom === $prefixTo) { - $filesystem = $this->getFilesystem($prefixFrom); - $renamed = $filesystem->rename($pathFrom, $pathTo); - - if ($renamed && isset($config['visibility'])) { - return $filesystem->setVisibility($pathTo, $config['visibility']); - } - - return $renamed; - } - - $copied = $this->copy($from, $to, $config); - - if ($copied) { - return $this->delete($from); - } - - return false; - } - - /** - * Invoke a plugin on a filesystem mounted on a given prefix. - * - * @param string $method - * @param array $arguments - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function invokePluginOnFilesystem($method, $arguments, $prefix) - { - $filesystem = $this->getFilesystem($prefix); - - try { - return $this->invokePlugin($method, $arguments, $filesystem); - } catch (PluginNotFoundException $e) { - // Let it pass, it's ok, don't panic. - } - - $callback = [$filesystem, $method]; - - return call_user_func_array($callback, $arguments); - } - - /** - * @param string $path - * - * @throws InvalidArgumentException - * - * @return string[] [:prefix, :path] - */ - protected function getPrefixAndPath($path) - { - if (strpos($path, '://') < 1) { - throw new InvalidArgumentException('No prefix detected in path: ' . $path); - } - - return explode('://', $path, 2); - } - - /** - * Check whether a file exists. - * - * @param string $path - * - * @return bool - */ - public function has($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->has($path); - } - - /** - * Read a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents or false on failure. - */ - public function read($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->read($path); - } - - /** - * Retrieves a read-stream for a path. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return resource|false The path resource or false on failure. - */ - public function readStream($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readStream($path); - } - - /** - * Get a file's metadata. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMetadata($path); - } - - /** - * Get a file's size. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return int|false The file size or false on failure. - */ - public function getSize($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getSize($path); - } - - /** - * Get a file's mime-type. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMimetype($path); - } - - /** - * Get a file's timestamp. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getTimestamp($path); - } - - /** - * Get a file's visibility. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getVisibility($path); - } - - /** - * Write a new file. - * - * @param string $path The path of the new file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function write($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->write($path, $contents, $config); - } - - /** - * Write a new file using a stream. - * - * @param string $path The path of the new file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function writeStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->writeStream($path, $resource, $config); - } - - /** - * Update an existing file. - * - * @param string $path The path of the existing file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function update($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->update($path, $contents, $config); - } - - /** - * Update an existing file using a stream. - * - * @param string $path The path of the existing file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function updateStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->updateStream($path, $resource, $config); - } - - /** - * Rename a file. - * - * @param string $path Path to the existing file. - * @param string $newpath The new path of the file. - * - * @throws FileExistsException Thrown if $newpath exists. - * @throws FileNotFoundException Thrown if $path does not exist. - * - * @return bool True on success, false on failure. - */ - public function rename($path, $newpath) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->rename($path, $newpath); - } - - /** - * Delete a file. - * - * @param string $path - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function delete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->delete($path); - } - - /** - * Delete a directory. - * - * @param string $dirname - * - * @throws RootViolationException Thrown if $dirname is empty. - * - * @return bool True on success, false on failure. - */ - public function deleteDir($dirname) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->deleteDir($dirname); - } - - /** - * Create a directory. - * - * @param string $dirname The name of the new directory. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function createDir($dirname, array $config = []) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->createDir($dirname); - } - - /** - * Set the visibility for a file. - * - * @param string $path The path to the file. - * @param string $visibility One of 'public' or 'private'. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function setVisibility($path, $visibility) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->setVisibility($path, $visibility); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function put($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->put($path, $contents, $config); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException Thrown if $resource is not a resource. - * - * @return bool True on success, false on failure. - */ - public function putStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->putStream($path, $resource, $config); - } - - /** - * Read and delete a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents, or false on failure. - */ - public function readAndDelete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readAndDelete($path); - } - - /** - * Get a file/directory handler. - * - * @deprecated - * - * @param string $path The path to the file. - * @param Handler $handler An optional existing handler to populate. - * - * @return Handler Either a file or directory handler. - */ - public function get($path, Handler $handler = null) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->get($path); - } -} diff --git a/vendor/league/flysystem/src/NotSupportedException.php b/vendor/league/flysystem/src/NotSupportedException.php deleted file mode 100644 index e0a989b..0000000 --- a/vendor/league/flysystem/src/NotSupportedException.php +++ /dev/null @@ -1,37 +0,0 @@ -getPathname()); - } - - /** - * Create a new exception for a link. - * - * @param string $systemType - * - * @return static - */ - public static function forFtpSystemType($systemType) - { - $message = "The FTP system type '$systemType' is currently not supported."; - - return new static($message); - } -} diff --git a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php b/vendor/league/flysystem/src/Plugin/AbstractPlugin.php deleted file mode 100644 index 0d56789..0000000 --- a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php +++ /dev/null @@ -1,24 +0,0 @@ -filesystem = $filesystem; - } -} diff --git a/vendor/league/flysystem/src/Plugin/EmptyDir.php b/vendor/league/flysystem/src/Plugin/EmptyDir.php deleted file mode 100644 index b5ae7f5..0000000 --- a/vendor/league/flysystem/src/Plugin/EmptyDir.php +++ /dev/null @@ -1,34 +0,0 @@ -filesystem->listContents($dirname, false); - - foreach ($listing as $item) { - if ($item['type'] === 'dir') { - $this->filesystem->deleteDir($item['path']); - } else { - $this->filesystem->delete($item['path']); - } - } - } -} diff --git a/vendor/league/flysystem/src/Plugin/ForcedCopy.php b/vendor/league/flysystem/src/Plugin/ForcedCopy.php deleted file mode 100644 index a41e9f3..0000000 --- a/vendor/league/flysystem/src/Plugin/ForcedCopy.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->copy($path, $newpath); - } - - return false; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ForcedRename.php b/vendor/league/flysystem/src/Plugin/ForcedRename.php deleted file mode 100644 index 3f51cd6..0000000 --- a/vendor/league/flysystem/src/Plugin/ForcedRename.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->rename($path, $newpath); - } - - return false; - } -} diff --git a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php b/vendor/league/flysystem/src/Plugin/GetWithMetadata.php deleted file mode 100644 index 6fe4f05..0000000 --- a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php +++ /dev/null @@ -1,51 +0,0 @@ -filesystem->getMetadata($path); - - if ( ! $object) { - return false; - } - - $keys = array_diff($metadata, array_keys($object)); - - foreach ($keys as $key) { - if ( ! method_exists($this->filesystem, $method = 'get' . ucfirst($key))) { - throw new InvalidArgumentException('Could not fetch metadata: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($path); - } - - return $object; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListFiles.php b/vendor/league/flysystem/src/Plugin/ListFiles.php deleted file mode 100644 index 9669fe7..0000000 --- a/vendor/league/flysystem/src/Plugin/ListFiles.php +++ /dev/null @@ -1,35 +0,0 @@ -filesystem->listContents($directory, $recursive); - - $filter = function ($object) { - return $object['type'] === 'file'; - }; - - return array_values(array_filter($contents, $filter)); - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListPaths.php b/vendor/league/flysystem/src/Plugin/ListPaths.php deleted file mode 100644 index 514bdf0..0000000 --- a/vendor/league/flysystem/src/Plugin/ListPaths.php +++ /dev/null @@ -1,36 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $object) { - $result[] = $object['path']; - } - - return $result; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListWith.php b/vendor/league/flysystem/src/Plugin/ListWith.php deleted file mode 100644 index d90464e..0000000 --- a/vendor/league/flysystem/src/Plugin/ListWith.php +++ /dev/null @@ -1,60 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $index => $object) { - if ($object['type'] === 'file') { - $missingKeys = array_diff($keys, array_keys($object)); - $contents[$index] = array_reduce($missingKeys, [$this, 'getMetadataByName'], $object); - } - } - - return $contents; - } - - /** - * Get a meta-data value by key name. - * - * @param array $object - * @param string $key - * - * @return array - */ - protected function getMetadataByName(array $object, $key) - { - $method = 'get' . ucfirst($key); - - if ( ! method_exists($this->filesystem, $method)) { - throw new \InvalidArgumentException('Could not get meta-data for key: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($object['path']); - - return $object; - } -} diff --git a/vendor/league/flysystem/src/Plugin/PluggableTrait.php b/vendor/league/flysystem/src/Plugin/PluggableTrait.php deleted file mode 100644 index 922edfe..0000000 --- a/vendor/league/flysystem/src/Plugin/PluggableTrait.php +++ /dev/null @@ -1,97 +0,0 @@ -plugins[$plugin->getMethod()] = $plugin; - - return $this; - } - - /** - * Find a specific plugin. - * - * @param string $method - * - * @throws PluginNotFoundException - * - * @return PluginInterface - */ - protected function findPlugin($method) - { - if ( ! isset($this->plugins[$method])) { - throw new PluginNotFoundException('Plugin not found for method: ' . $method); - } - - return $this->plugins[$method]; - } - - /** - * Invoke a plugin by method name. - * - * @param string $method - * @param array $arguments - * @param FilesystemInterface $filesystem - * - * @throws PluginNotFoundException - * - * @return mixed - */ - protected function invokePlugin($method, array $arguments, FilesystemInterface $filesystem) - { - $plugin = $this->findPlugin($method); - $plugin->setFilesystem($filesystem); - $callback = [$plugin, 'handle']; - - return call_user_func_array($callback, $arguments); - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @throws BadMethodCallException - * - * @return mixed - */ - public function __call($method, array $arguments) - { - try { - return $this->invokePlugin($method, $arguments, $this); - } catch (PluginNotFoundException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_class($this) - . '::' . $method - ); - } - } -} diff --git a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php b/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php deleted file mode 100644 index fd1d7e7..0000000 --- a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php +++ /dev/null @@ -1,10 +0,0 @@ -hash = spl_object_hash($this); - static::$safeStorage[$this->hash] = []; - } - - public function storeSafely($key, $value) - { - static::$safeStorage[$this->hash][$key] = $value; - } - - public function retrieveSafely($key) - { - if (array_key_exists($key, static::$safeStorage[$this->hash])) { - return static::$safeStorage[$this->hash][$key]; - } - } - - public function __destruct() - { - unset(static::$safeStorage[$this->hash]); - } -} diff --git a/vendor/league/flysystem/src/UnreadableFileException.php b/vendor/league/flysystem/src/UnreadableFileException.php deleted file mode 100644 index e668033..0000000 --- a/vendor/league/flysystem/src/UnreadableFileException.php +++ /dev/null @@ -1,18 +0,0 @@ -getRealPath() - ) - ); - } -} diff --git a/vendor/league/flysystem/src/Util.php b/vendor/league/flysystem/src/Util.php deleted file mode 100644 index 76454a0..0000000 --- a/vendor/league/flysystem/src/Util.php +++ /dev/null @@ -1,353 +0,0 @@ - '']; - } - - /** - * Normalize a dirname return value. - * - * @param string $dirname - * - * @return string normalized dirname - */ - public static function normalizeDirname($dirname) - { - return $dirname === '.' ? '' : $dirname; - } - - /** - * Get a normalized dirname from a path. - * - * @param string $path - * - * @return string dirname - */ - public static function dirname($path) - { - return static::normalizeDirname(dirname($path)); - } - - /** - * Map result arrays. - * - * @param array $object - * @param array $map - * - * @return array mapped result - */ - public static function map(array $object, array $map) - { - $result = []; - - foreach ($map as $from => $to) { - if ( ! isset($object[$from])) { - continue; - } - - $result[$to] = $object[$from]; - } - - return $result; - } - - /** - * Normalize path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizePath($path) - { - return static::normalizeRelativePath($path); - } - - /** - * Normalize relative directories in a path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizeRelativePath($path) - { - $path = str_replace('\\', '/', $path); - $path = static::removeFunkyWhiteSpace($path); - - $parts = []; - - foreach (explode('/', $path) as $part) { - switch ($part) { - case '': - case '.': - break; - - case '..': - if (empty($parts)) { - throw new LogicException( - 'Path is outside of the defined root, path: [' . $path . ']' - ); - } - array_pop($parts); - break; - - default: - $parts[] = $part; - break; - } - } - - return implode('/', $parts); - } - - /** - * Removes unprintable characters and invalid unicode characters. - * - * @param string $path - * - * @return string $path - */ - protected static function removeFunkyWhiteSpace($path) - { - // We do this check in a loop, since removing invalid unicode characters - // can lead to new characters being created. - while (preg_match('#\p{C}+|^\./#u', $path)) { - $path = preg_replace('#\p{C}+|^\./#u', '', $path); - } - - return $path; - } - - /** - * Normalize prefix. - * - * @param string $prefix - * @param string $separator - * - * @return string normalized path - */ - public static function normalizePrefix($prefix, $separator) - { - return rtrim($prefix, $separator) . $separator; - } - - /** - * Get content size. - * - * @param string $contents - * - * @return int content size - */ - public static function contentSize($contents) - { - return defined('MB_OVERLOAD_STRING') ? mb_strlen($contents, '8bit') : strlen($contents); - } - - /** - * Guess MIME Type based on the path of the file and it's content. - * - * @param string $path - * @param string|resource $content - * - * @return string|null MIME Type or NULL if no extension detected - */ - public static function guessMimeType($path, $content) - { - $mimeType = MimeType::detectByContent($content); - - if ( ! (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm']))) { - return $mimeType; - } - - return MimeType::detectByFilename($path); - } - - /** - * Emulate directories. - * - * @param array $listing - * - * @return array listing with emulated directories - */ - public static function emulateDirectories(array $listing) - { - $directories = []; - $listedDirectories = []; - - foreach ($listing as $object) { - list($directories, $listedDirectories) = static::emulateObjectDirectories($object, $directories, $listedDirectories); - } - - $directories = array_diff(array_unique($directories), array_unique($listedDirectories)); - - foreach ($directories as $directory) { - $listing[] = static::pathinfo($directory) + ['type' => 'dir']; - } - - return $listing; - } - - /** - * Ensure a Config instance. - * - * @param null|array|Config $config - * - * @return Config config instance - * - * @throw LogicException - */ - public static function ensureConfig($config) - { - if ($config === null) { - return new Config(); - } - - if ($config instanceof Config) { - return $config; - } - - if (is_array($config)) { - return new Config($config); - } - - throw new LogicException('A config should either be an array or a Flysystem\Config object.'); - } - - /** - * Rewind a stream. - * - * @param resource $resource - */ - public static function rewindStream($resource) - { - if (ftell($resource) !== 0 && static::isSeekableStream($resource)) { - rewind($resource); - } - } - - public static function isSeekableStream($resource) - { - $metadata = stream_get_meta_data($resource); - - return $metadata['seekable']; - } - - /** - * Get the size of a stream. - * - * @param resource $resource - * - * @return int|null stream size - */ - public static function getStreamSize($resource) - { - $stat = fstat($resource); - - if ( ! is_array($stat) || ! isset($stat['size'])) { - return null; - } - - return $stat['size']; - } - - /** - * Emulate the directories of a single object. - * - * @param array $object - * @param array $directories - * @param array $listedDirectories - * - * @return array - */ - protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories) - { - if ($object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - } - - if ( ! isset($object['dirname']) || trim($object['dirname']) === '') { - return [$directories, $listedDirectories]; - } - - $parent = $object['dirname']; - - while (isset($parent) && trim($parent) !== '' && ! in_array($parent, $directories)) { - $directories[] = $parent; - $parent = static::dirname($parent); - } - - if (isset($object['type']) && $object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - - return [$directories, $listedDirectories]; - } - - return [$directories, $listedDirectories]; - } - - /** - * Returns the trailing name component of the path. - * - * @param string $path - * - * @return string - */ - private static function basename($path) - { - $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/'; - - $path = rtrim($path, $separators); - - $basename = preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path); - - if (DIRECTORY_SEPARATOR === '/') { - return $basename; - } - // @codeCoverageIgnoreStart - // Extra Windows path munging. This is tested via AppVeyor, but code - // coverage is not reported. - - // Handle relative paths with drive letters. c:file.txt. - while (preg_match('#^[a-zA-Z]{1}:[^\\\/]#', $basename)) { - $basename = substr($basename, 2); - } - - // Remove colon for standalone drive letter names. - if (preg_match('#^[a-zA-Z]{1}:$#', $basename)) { - $basename = rtrim($basename, ':'); - } - - return $basename; - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/league/flysystem/src/Util/ContentListingFormatter.php b/vendor/league/flysystem/src/Util/ContentListingFormatter.php deleted file mode 100644 index ae0d3b9..0000000 --- a/vendor/league/flysystem/src/Util/ContentListingFormatter.php +++ /dev/null @@ -1,122 +0,0 @@ -directory = rtrim($directory, '/'); - $this->recursive = $recursive; - $this->caseSensitive = $caseSensitive; - } - - /** - * Format contents listing. - * - * @param array $listing - * - * @return array - */ - public function formatListing(array $listing) - { - $listing = array_filter(array_map([$this, 'addPathInfo'], $listing), [$this, 'isEntryOutOfScope']); - - return $this->sortListing(array_values($listing)); - } - - private function addPathInfo(array $entry) - { - return $entry + Util::pathinfo($entry['path']); - } - - /** - * Determine if the entry is out of scope. - * - * @param array $entry - * - * @return bool - */ - private function isEntryOutOfScope(array $entry) - { - if (empty($entry['path']) && $entry['path'] !== '0') { - return false; - } - - if ($this->recursive) { - return $this->residesInDirectory($entry); - } - - return $this->isDirectChild($entry); - } - - /** - * Check if the entry resides within the parent directory. - * - * @param array $entry - * - * @return bool - */ - private function residesInDirectory(array $entry) - { - if ($this->directory === '') { - return true; - } - - return $this->caseSensitive - ? strpos($entry['path'], $this->directory . '/') === 0 - : stripos($entry['path'], $this->directory . '/') === 0; - } - - /** - * Check if the entry is a direct child of the directory. - * - * @param array $entry - * - * @return bool - */ - private function isDirectChild(array $entry) - { - return $this->caseSensitive - ? $entry['dirname'] === $this->directory - : strcasecmp($this->directory, $entry['dirname']) === 0; - } - - /** - * @param array $listing - * - * @return array - */ - private function sortListing(array $listing) - { - usort($listing, function ($a, $b) { - return strcasecmp($a['path'], $b['path']); - }); - - return $listing; - } -} diff --git a/vendor/league/flysystem/src/Util/MimeType.php b/vendor/league/flysystem/src/Util/MimeType.php deleted file mode 100644 index 35cba3f..0000000 --- a/vendor/league/flysystem/src/Util/MimeType.php +++ /dev/null @@ -1,80 +0,0 @@ -detectMimeTypeFromBuffer($content); - } - - return 'text/plain'; - } - - /** - * Detects MIME Type based on file extension. - * - * @param string $extension - * - * @return string MIME Type - */ - public static function detectByFileExtension($extension) - { - return static::detector()->detectMimeTypeFromPath('artificial.' . $extension) ?: 'text/plain'; - } - - /** - * @param string $filename - * - * @return string MIME Type - */ - public static function detectByFilename($filename) - { - return static::detector()->detectMimeTypeFromPath($filename) ?: 'text/plain'; - } - - /** - * @return array Map of file extension to MIME Type - */ - public static function getExtensionToMimeTypeMap() - { - return static::$extensionToMimeTypeMap; - } -} diff --git a/vendor/league/flysystem/src/Util/StreamHasher.php b/vendor/league/flysystem/src/Util/StreamHasher.php deleted file mode 100644 index 938ec5d..0000000 --- a/vendor/league/flysystem/src/Util/StreamHasher.php +++ /dev/null @@ -1,36 +0,0 @@ -algo = $algo; - } - - /** - * @param resource $resource - * - * @return string - */ - public function hash($resource) - { - rewind($resource); - $context = hash_init($this->algo); - hash_update_stream($context, $resource); - fclose($resource); - - return hash_final($context); - } -} diff --git a/vendor/league/mime-type-detection/CHANGELOG.md b/vendor/league/mime-type-detection/CHANGELOG.md deleted file mode 100644 index d9eab90..0000000 --- a/vendor/league/mime-type-detection/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# Changelog - -## 1.7.0 - 2021-01-18 - -### Added - -- Added a `bufferSampleSize` parameter to the `FinfoMimeTypeDetector` class that allows you to send a reduced content sample which costs less memory. - -## 1.6.0 - 2021-01-18 - -### Changes - -- Updated generated mime-type map diff --git a/vendor/league/mime-type-detection/LICENSE b/vendor/league/mime-type-detection/LICENSE deleted file mode 100644 index 7c1027d..0000000 --- a/vendor/league/mime-type-detection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2020 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/league/mime-type-detection/composer.json b/vendor/league/mime-type-detection/composer.json deleted file mode 100644 index 765b05c..0000000 --- a/vendor/league/mime-type-detection/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "league/mime-type-detection", - "description": "Mime-type detection for Flysystem", - "license": "MIT", - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "scripts": { - "phpstan": "vendor/bin/phpstan analyse -l 6 src" - }, - "require": { - "php": "^7.2 || ^8.0", - "ext-fileinfo": "*" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.8 || ^9.3", - "phpstan/phpstan": "^0.12.68", - "friendsofphp/php-cs-fixer": "^2.18" - }, - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "config": { - "platform": { - "php": "7.2.0" - } - } -} diff --git a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php deleted file mode 100644 index fc04241..0000000 --- a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php +++ /dev/null @@ -1,13 +0,0 @@ -extensions = $extensions ?: new GeneratedExtensionToMimeTypeMap(); - } - - public function detectMimeType(string $path, $contents): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensions->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return null; - } -} diff --git a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php deleted file mode 100644 index 1dad7bc..0000000 --- a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php +++ /dev/null @@ -1,10 +0,0 @@ -finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); - $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); - $this->bufferSampleSize = $bufferSampleSize; - } - - public function detectMimeType(string $path, $contents): ?string - { - $mimeType = is_string($contents) - ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) - : null; - - if ($mimeType !== null && ! in_array($mimeType, self::INCONCLUSIVE_MIME_TYPES)) { - return $mimeType; - } - - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensionMap->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return @$this->finfo->file($path) ?: null; - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return @$this->finfo->buffer($this->takeSample($contents)) ?: null; - } - - private function takeSample(string $contents): string - { - if ($this->bufferSampleSize === null) { - return $contents; - } - - return (string) substr($contents, 0, $this->bufferSampleSize); - } -} diff --git a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php deleted file mode 100644 index 698e276..0000000 --- a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php +++ /dev/null @@ -1,1209 +0,0 @@ - 'application/vnd.1000minds.decision-model+xml', - '3dml' => 'text/vnd.in3d.3dml', - '3ds' => 'image/x-3ds', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gp', - '3gpp' => 'video/3gpp', - '3mf' => 'model/3mf', - '7z' => 'application/x-7z-compressed', - '7zip' => 'application/x-7z-compressed', - '123' => 'application/vnd.lotus-1-2-3', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-acc', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/vnd.nokia.n-gage.ac+xml', - 'ac3' => 'audio/ac3', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/pdf', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'apk' => 'application/vnd.android.package-archive', - 'apng' => 'image/apng', - 'appcache' => 'text/cache-manifest', - 'application' => 'application/x-ms-application', - 'apr' => 'application/vnd.lotus-approach', - 'arc' => 'application/x-freearc', - 'arj' => 'application/x-arj', - 'asc' => 'application/pgp-signature', - 'asf' => 'video/x-ms-asf', - 'asm' => 'text/x-asm', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomdeleted' => 'application/atomdeleted+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/x-au', - 'avi' => 'video/x-msvideo', - 'avif' => 'image/avif', - 'aw' => 'application/applixware', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azv' => 'image/vnd.airzip.accelerator.azv', - 'azw' => 'application/vnd.amazon.ebook', - 'b16' => 'image/vnd.pco.b16', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bdoc' => 'application/x-bdoc', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'blb' => 'application/x-blorb', - 'blorb' => 'application/x-blorb', - 'bmi' => 'application/vnd.bmi', - 'bmml' => 'application/vnd.balsamiq.bmml+xml', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'bpmn' => 'application/octet-stream', - 'bsp' => 'model/vnd.valve.source.compiled-map', - 'btif' => 'image/prs.btif', - 'buffer' => 'application/octet-stream', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'cab' => 'application/vnd.ms-cab-compressed', - 'caf' => 'audio/x-caf', - 'cap' => 'application/vnd.tcpdump.pcap', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cb7' => 'application/x-cbr', - 'cba' => 'application/x-cbr', - 'cbr' => 'application/x-cbr', - 'cbt' => 'application/x-cbr', - 'cbz' => 'application/x-cbr', - 'cc' => 'text/x-c', - 'cco' => 'application/x-cocoa', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdfx' => 'application/cdfx+xml', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdr' => 'application/cdr', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfs' => 'application/x-cfs-compressed', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cjs' => 'application/node', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/octet-stream', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'coffee' => 'text/coffeescript', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'crx' => 'application/x-chrome-extension', - 'cryptonote' => 'application/vnd.rig.cryptonote', - 'csh' => 'application/x-csh', - 'csl' => 'application/vnd.citationstyles.style+xml', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'csr' => 'application/octet-stream', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dart' => 'application/vnd.dart', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dbf' => 'application/vnd.dbf', - 'dbk' => 'application/docbook+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'ddf' => 'application/vnd.syncml.dmddf+xml', - 'dds' => 'image/vnd.ms-dds', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dgc' => 'application/x-dgc-compressed', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'disposition-notification' => 'message/disposition-notification', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/octet-stream', - 'dmg' => 'application/x-apple-diskimage', - 'dmn' => 'application/octet-stream', - 'dmp' => 'application/vnd.tcpdump.pcap', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dra' => 'audio/vnd.dra', - 'drle' => 'image/dicom-rle', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvb' => 'video/vnd.dvb.file', - 'dvi' => 'application/x-dvi', - 'dwd' => 'application/atsc-dwd+xml', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ear' => 'application/java-archive', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'emf' => 'image/emf', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'emotionml' => 'application/emotionml+xml', - 'emz' => 'application/x-msmetafile', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es' => 'application/ecmascript', - 'es3' => 'application/vnd.eszigno3+xml', - 'esa' => 'application/vnd.osgi.subsystem', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'eva' => 'application/x-eva', - 'evy' => 'application/x-envoy', - 'exe' => 'application/octet-stream', - 'exi' => 'application/exi', - 'exr' => 'image/aces', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/mp4', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fdt' => 'application/fdt+xml', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'fits' => 'image/fits', - 'flac' => 'audio/x-flac', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'fo' => 'application/vnd.software602.filler.form+xml', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gam' => 'application/x-tads', - 'gbr' => 'application/rpki-ghostbusters', - 'gca' => 'application/x-gca-compressed', - 'gdl' => 'model/vnd.gdl', - 'gdoc' => 'application/vnd.google-apps.document', - 'geo' => 'application/vnd.dynageo', - 'geojson' => 'application/geo+json', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'glb' => 'model/gltf-binary', - 'gltf' => 'model/gltf+json', - 'gml' => 'application/gml+xml', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gpg' => 'application/gpg-keys', - 'gph' => 'application/vnd.flographit', - 'gpx' => 'application/gpx+xml', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gramps' => 'application/x-gramps-xml', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gsheet' => 'application/vnd.google-apps.spreadsheet', - 'gslides' => 'application/vnd.google-apps.presentation', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxf' => 'application/gxf', - 'gxt' => 'application/vnd.geonext', - 'gz' => 'application/x-gzip', - 'gzip' => 'application/x-gzip', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hbs' => 'text/x-handlebars-template', - 'hdd' => 'application/x-virtualbox-hdd', - 'hdf' => 'application/x-hdf', - 'heic' => 'image/heic', - 'heics' => 'image/heic-sequence', - 'heif' => 'image/heif', - 'heifs' => 'image/heif-sequence', - 'hej2' => 'image/hej2k', - 'held' => 'application/atsc-held+xml', - 'hh' => 'text/x-c', - 'hjson' => 'application/hjson', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'hsj2' => 'image/hsj2', - 'htc' => 'text/x-component', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'img' => 'application/octet-stream', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ini' => 'text/plain', - 'ink' => 'application/inkml+xml', - 'inkml' => 'application/inkml+xml', - 'install' => 'application/x-install-instructions', - 'iota' => 'application/vnd.astraea-software.iota', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/x-iso9660-image', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'its' => 'application/its+xml', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jade' => 'text/jade', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'jardiff' => 'application/x-java-archive-diff', - 'java' => 'text/x-java-source', - 'jhc' => 'image/jphc', - 'jisp' => 'application/vnd.jisp', - 'jls' => 'image/jls', - 'jlt' => 'application/vnd.hp-jlyt', - 'jng' => 'image/x-jng', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jp2' => 'image/jp2', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpf' => 'image/jpx', - 'jpg' => 'image/jpeg', - 'jpg2' => 'image/jp2', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jph' => 'image/jph', - 'jpm' => 'video/jpm', - 'jpx' => 'image/jpx', - 'js' => 'application/javascript', - 'json' => 'application/json', - 'json5' => 'application/json5', - 'jsonld' => 'application/ld+json', - 'jsonml' => 'application/jsonml+json', - 'jsx' => 'text/jsx', - 'jxr' => 'image/jxr', - 'jxra' => 'image/jxra', - 'jxrs' => 'image/jxrs', - 'jxs' => 'image/jxs', - 'jxsc' => 'image/jxsc', - 'jxsi' => 'image/jxsi', - 'jxss' => 'image/jxss', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kdb' => 'application/octet-stream', - 'kdbx' => 'application/x-keepass2', - 'key' => 'application/vnd.apple.keynote', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'kpxx' => 'application/vnd.ds-keypoint', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktx2' => 'image/ktx2', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'less' => 'text/less', - 'lgr' => 'application/lgr+xml', - 'lha' => 'application/octet-stream', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'litcoffee' => 'text/coffeescript', - 'lnk' => 'application/x-ms-shortcut', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lua' => 'text/x-lua', - 'luac' => 'application/x-lua-bytecode', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/octet-stream', - 'm1v' => 'video/mpeg', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'text/plain', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/x-m4a', - 'm4p' => 'application/mp4', - 'm4u' => 'application/vnd.mpegurl', - 'm4v' => 'video/x-m4v', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm21' => 'application/mp21', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'maei' => 'application/mmt-aei+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'manifest' => 'text/cache-manifest', - 'map' => 'application/json', - 'mar' => 'application/octet-stream', - 'markdown' => 'text/markdown', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'md' => 'text/markdown', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'mdx' => 'text/mdx', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'metalink' => 'application/metalink+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mft' => 'application/rpki-manifest', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mie' => 'application/x-mie', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mjs' => 'application/javascript', - 'mk3d' => 'video/x-matroska', - 'mka' => 'audio/x-matroska', - 'mkd' => 'text/x-markdown', - 'mks' => 'video/x-matroska', - 'mkv' => 'video/x-matroska', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mml' => 'text/mathml', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mng' => 'video/x-mng', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mp21' => 'application/mp21', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpd' => 'application/dash+xml', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msg' => 'application/vnd.ms-outlook', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msl' => 'application/vnd.mobius.msl', - 'msm' => 'application/octet-stream', - 'msp' => 'application/octet-stream', - 'msty' => 'application/vnd.muvee.style', - 'mtl' => 'model/mtl', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musd' => 'application/mmt-usd+xml', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxmf' => 'audio/mobile-xmf', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'nfo' => 'text/x-nfo', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nitf' => 'application/vnd.nitf', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nq' => 'application/n-quads', - 'nsc' => 'application/x-conference', - 'nsf' => 'application/vnd.lotus-notes', - 'nt' => 'application/n-triples', - 'ntf' => 'application/vnd.nitf', - 'numbers' => 'application/vnd.apple.numbers', - 'nzb' => 'application/x-nzb', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'obgx' => 'application/vnd.openblox.game+xml', - 'obj' => 'model/obj', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogex' => 'model/vnd.opengex', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'omdoc' => 'application/omdoc+xml', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'opml' => 'text/x-opml', - 'oprc' => 'application/vnd.palm', - 'opus' => 'audio/ogg', - 'org' => 'text/x-org', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'osm' => 'application/vnd.openstreetmap.data+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'font/otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'ova' => 'application/x-virtualbox-ova', - 'ovf' => 'application/x-virtualbox-ovf', - 'owl' => 'application/rdf+xml', - 'oxps' => 'application/oxps', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p7a' => 'application/x-pkcs7-signature', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'p10' => 'application/x-pkcs10', - 'p12' => 'application/x-pkcs12', - 'pac' => 'application/x-ns-proxy-autoconfig', - 'pages' => 'application/vnd.apple.pages', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcap' => 'application/vnd.tcpdump.pcap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/x-pilot', - 'pde' => 'text/x-processing', - 'pdf' => 'application/pdf', - 'pem' => 'application/x-x509-user-cert', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp', - 'php' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'phtml' => 'application/x-httpd-php', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'pkpass' => 'application/vnd.apple.pkpass', - 'pl' => 'application/x-perl', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pm' => 'application/x-perl', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppa' => 'application/vnd.ms-powerpoint', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'application/x-pilot', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'provx' => 'application/provenance+xml', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'application/x-photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'pti' => 'image/prs.pti', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'raml' => 'application/raml+yaml', - 'rapd' => 'application/route-apd+xml', - 'rar' => 'application/x-rar', - 'ras' => 'image/x-cmu-raster', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'relo' => 'application/p2p-overlay+xml', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'ris' => 'application/x-research-info-systems', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'audio/x-pn-realaudio', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rmvb' => 'application/vnd.rn-realmedia-vbr', - 'rnc' => 'application/relax-ng-compact-syntax', - 'rng' => 'application/xml', - 'roa' => 'application/rpki-roa', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsa' => 'application/x-pkcs7', - 'rsat' => 'application/atsc-rsat+xml', - 'rsd' => 'application/rsd+xml', - 'rsheet' => 'application/urc-ressheet+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'text/rtf', - 'rtx' => 'text/richtext', - 'run' => 'application/x-makeself', - 'rusd' => 'application/route-usd+xml', - 'rv' => 'video/vnd.rn-realvideo', - 's' => 'text/x-asm', - 's3m' => 'audio/s3m', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sass' => 'text/x-sass', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scss' => 'text/x-scss', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'sea' => 'application/octet-stream', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'senmlx' => 'application/senml+xml', - 'sensmlx' => 'application/sensml+xml', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sfv' => 'text/x-sfv', - 'sgi' => 'image/sgi', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shex' => 'text/shex', - 'shf' => 'application/shf+xml', - 'shtml' => 'text/html', - 'sid' => 'image/x-mrsid-image', - 'sieve' => 'application/sieve', - 'sig' => 'application/pgp-signature', - 'sil' => 'audio/silk', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'siv' => 'application/sieve', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slim' => 'text/slim', - 'slm' => 'text/slim', - 'sls' => 'application/route-s-tsid+xml', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'smv' => 'video/x-smv', - 'smzip' => 'application/vnd.stepmania.package', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spdx' => 'text/spdx', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'sql' => 'application/x-sql', - 'src' => 'application/x-wais-source', - 'srt' => 'application/x-subrip', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'ssdl' => 'application/ssdl+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'sst' => 'application/octet-stream', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'model/stl', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'styl' => 'text/stylus', - 'stylus' => 'text/stylus', - 'sub' => 'text/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'swidtag' => 'application/swid+xml', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 't3' => 'application/x-t3vm-image', - 't38' => 'image/t38', - 'taglet' => 'application/vnd.mynfc', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tap' => 'image/vnd.tencent.tap', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'td' => 'application/urc-targetdesc+xml', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'tfx' => 'image/tiff-fx', - 'tga' => 'image/x-tga', - 'tgz' => 'application/x-tar', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tk' => 'application/x-tcl', - 'tmo' => 'application/vnd.tmobile-livetv', - 'toml' => 'application/toml', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trm' => 'application/x-msterminal', - 'ts' => 'video/mp2t', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'font/collection', - 'ttf' => 'font/ttf', - 'ttl' => 'text/turtle', - 'ttml' => 'application/ttml+xml', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u8dsn' => 'message/global-delivery-status', - 'u8hdr' => 'message/global-headers', - 'u8mdn' => 'message/global-disposition-notification', - 'u8msg' => 'message/global', - 'u32' => 'application/x-authorware-bin', - 'ubj' => 'application/ubjson', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'ulx' => 'application/x-glulx', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'usdz' => 'model/vnd.usdz+zip', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvvz' => 'application/vnd.dece.zip', - 'uvx' => 'application/vnd.dece.unspecified', - 'uvz' => 'application/vnd.dece.zip', - 'vbox' => 'application/x-virtualbox-vbox', - 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', - 'vcard' => 'text/vcard', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vdi' => 'application/x-virtualbox-vdi', - 'vhd' => 'application/x-virtualbox-vhd', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vlc' => 'application/videolan', - 'vmdk' => 'application/x-virtualbox-vmdk', - 'vob' => 'video/x-ms-vob', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtf' => 'image/vnd.valve.source.texture', - 'vtt' => 'text/vtt', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wadl' => 'application/vnd.sun.wadl+xml', - 'war' => 'application/java-archive', - 'wasm' => 'application/wasm', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'wdp' => 'image/vnd.ms-photo', - 'weba' => 'audio/webm', - 'webapp' => 'application/x-web-app-manifest+json', - 'webm' => 'video/webm', - 'webmanifest' => 'application/manifest+json', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgt' => 'application/widget', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'image/wmf', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-msmetafile', - 'woff' => 'font/woff', - 'woff2' => 'font/woff2', - 'word' => 'application/msword', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsc' => 'message/vnd.wfa.wsc', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x3d' => 'model/x3d+xml', - 'x3db' => 'model/x3d+fastinfoset', - 'x3dbz' => 'model/x3d+binary', - 'x3dv' => 'model/x3d-vrml', - 'x3dvz' => 'model/x3d+vrml', - 'x3dz' => 'model/x3d+xml', - 'x32' => 'application/x-authorware-bin', - 'x_b' => 'model/vnd.parasolid.transmit.binary', - 'x_t' => 'model/vnd.parasolid.transmit.text', - 'xaml' => 'application/xaml+xml', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xav' => 'application/xcap-att+xml', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xca' => 'application/xcap-caps+xml', - 'xcs' => 'application/calendar+xml', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xel' => 'application/xcap-el+xml', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/xcap-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xl' => 'application/excel', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlf' => 'application/xliff+xml', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xm' => 'audio/xm', - 'xml' => 'application/xml', - 'xns' => 'application/xcap-ns+xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpl' => 'application/xproc+xml', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsd' => 'application/xml', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'xz' => 'application/x-xz', - 'yaml' => 'text/yaml', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'yml' => 'text/yaml', - 'ymp' => 'text/x-suse-ymp', - 'z' => 'application/x-compress', - 'z1' => 'application/x-zmachine', - 'z2' => 'application/x-zmachine', - 'z3' => 'application/x-zmachine', - 'z4' => 'application/x-zmachine', - 'z5' => 'application/x-zmachine', - 'z6' => 'application/x-zmachine', - 'z7' => 'application/x-zmachine', - 'z8' => 'application/x-zmachine', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/x-zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml', - 'zsh' => 'text/x-scriptzsh', - ]; - - public function lookupMimeType(string $extension): ?string - { - return self::MIME_TYPES_FOR_EXTENSIONS[$extension] ?? null; - } -} diff --git a/vendor/league/mime-type-detection/src/MimeTypeDetector.php b/vendor/league/mime-type-detection/src/MimeTypeDetector.php deleted file mode 100644 index 5d799d2..0000000 --- a/vendor/league/mime-type-detection/src/MimeTypeDetector.php +++ /dev/null @@ -1,19 +0,0 @@ -=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/cache/src/CacheException.php b/vendor/psr/cache/src/CacheException.php deleted file mode 100644 index e27f22f..0000000 --- a/vendor/psr/cache/src/CacheException.php +++ /dev/null @@ -1,10 +0,0 @@ -=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php deleted file mode 100644 index d35c6b4..0000000 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } -} diff --git a/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/vendor/psr/log/Psr/Log/InvalidArgumentException.php deleted file mode 100644 index 67f852d..0000000 --- a/vendor/psr/log/Psr/Log/InvalidArgumentException.php +++ /dev/null @@ -1,7 +0,0 @@ -logger = $logger; - } -} diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/Psr/Log/LoggerInterface.php deleted file mode 100644 index 2206cfd..0000000 --- a/vendor/psr/log/Psr/Log/LoggerInterface.php +++ /dev/null @@ -1,125 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - abstract public function log($level, $message, array $context = array()); -} diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/Psr/Log/NullLogger.php deleted file mode 100644 index c8f7293..0000000 --- a/vendor/psr/log/Psr/Log/NullLogger.php +++ /dev/null @@ -1,30 +0,0 @@ -logger) { }` - * blocks. - */ -class NullLogger extends AbstractLogger -{ - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - public function log($level, $message, array $context = array()) - { - // noop - } -} diff --git a/vendor/psr/log/Psr/Log/Test/DummyTest.php b/vendor/psr/log/Psr/Log/Test/DummyTest.php deleted file mode 100644 index 9638c11..0000000 --- a/vendor/psr/log/Psr/Log/Test/DummyTest.php +++ /dev/null @@ -1,18 +0,0 @@ - ". - * - * Example ->error('Foo') would yield "error Foo". - * - * @return string[] - */ - abstract public function getLogs(); - - public function testImplements() - { - $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); - } - - /** - * @dataProvider provideLevelsAndMessages - */ - public function testLogsAtAllLevels($level, $message) - { - $logger = $this->getLogger(); - $logger->{$level}($message, array('user' => 'Bob')); - $logger->log($level, $message, array('user' => 'Bob')); - - $expected = array( - $level.' message of level '.$level.' with context: Bob', - $level.' message of level '.$level.' with context: Bob', - ); - $this->assertEquals($expected, $this->getLogs()); - } - - public function provideLevelsAndMessages() - { - return array( - LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), - LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), - LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), - LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), - LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), - LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), - LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), - LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), - ); - } - - /** - * @expectedException \Psr\Log\InvalidArgumentException - */ - public function testThrowsOnInvalidLevel() - { - $logger = $this->getLogger(); - $logger->log('invalid level', 'Foo'); - } - - public function testContextReplacement() - { - $logger = $this->getLogger(); - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); - - $expected = array('info {Message {nothing} Bob Bar a}'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testObjectCastToString() - { - if (method_exists($this, 'createPartialMock')) { - $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); - } else { - $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); - } - $dummy->expects($this->once()) - ->method('__toString') - ->will($this->returnValue('DUMMY')); - - $this->getLogger()->warning($dummy); - - $expected = array('warning DUMMY'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextCanContainAnything() - { - $closed = fopen('php://memory', 'r'); - fclose($closed); - - $context = array( - 'bool' => true, - 'null' => null, - 'string' => 'Foo', - 'int' => 0, - 'float' => 0.5, - 'nested' => array('with object' => new DummyTest), - 'object' => new \DateTime, - 'resource' => fopen('php://memory', 'r'), - 'closed' => $closed, - ); - - $this->getLogger()->warning('Crazy context data', $context); - - $expected = array('warning Crazy context data'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextExceptionKeyCanBeExceptionOrOtherValues() - { - $logger = $this->getLogger(); - $logger->warning('Random message', array('exception' => 'oops')); - $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); - - $expected = array( - 'warning Random message', - 'critical Uncaught Exception!' - ); - $this->assertEquals($expected, $this->getLogs()); - } -} diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php deleted file mode 100644 index 1be3230..0000000 --- a/vendor/psr/log/Psr/Log/Test/TestLogger.php +++ /dev/null @@ -1,147 +0,0 @@ - $level, - 'message' => $message, - 'context' => $context, - ]; - - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } - - public function hasRecords($level) - { - return isset($this->recordsByLevel[$level]); - } - - public function hasRecord($record, $level) - { - if (is_string($record)) { - $record = ['message' => $record]; - } - return $this->hasRecordThatPasses(function ($rec) use ($record) { - if ($rec['message'] !== $record['message']) { - return false; - } - if (isset($record['context']) && $rec['context'] !== $record['context']) { - return false; - } - return true; - }, $level); - } - - public function hasRecordThatContains($message, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== false; - }, $level); - } - - public function hasRecordThatMatches($regex, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($regex) { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - - public function hasRecordThatPasses(callable $predicate, $level) - { - if (!isset($this->recordsByLevel[$level])) { - return false; - } - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if (call_user_func($predicate, $rec, $i)) { - return true; - } - } - return false; - } - - public function __call($method, $args) - { - if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = strtolower($matches[2]); - if (method_exists($this, $genericMethod)) { - $args[] = $level; - return call_user_func_array([$this, $genericMethod], $args); - } - } - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); - } - - public function reset() - { - $this->records = []; - $this->recordsByLevel = []; - } -} diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md deleted file mode 100644 index a9f20c4..0000000 --- a/vendor/psr/log/README.md +++ /dev/null @@ -1,58 +0,0 @@ -PSR Log -======= - -This repository holds all interfaces/classes/traits related to -[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). - -Note that this is not a logger of its own. It is merely an interface that -describes a logger. See the specification for more details. - -Installation ------------- - -```bash -composer require psr/log -``` - -Usage ------ - -If you need a logger, you can use the interface like this: - -```php -logger = $logger; - } - - public function doSomething() - { - if ($this->logger) { - $this->logger->info('Doing work'); - } - - try { - $this->doSomethingElse(); - } catch (Exception $exception) { - $this->logger->error('Oh no!', array('exception' => $exception)); - } - - // do something useful - } -} -``` - -You can then pick one of the implementations of the interface to get a logger. - -If you want to implement the interface, you can require this package and -implement `Psr\Log\LoggerInterface` in your code. Please read the -[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -for details. diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json deleted file mode 100644 index 3f6d4ee..0000000 --- a/vendor/psr/log/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "psr/log", - "description": "Common interface for logging libraries", - "keywords": ["psr", "psr-3", "log"], - "homepage": "https://github.com/php-fig/log", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - } -} diff --git a/vendor/psr/simple-cache/.editorconfig b/vendor/psr/simple-cache/.editorconfig deleted file mode 100644 index 48542cb..0000000 --- a/vendor/psr/simple-cache/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - -root = true - -[*] -charset = utf-8 -indent_size = 4 -indent_style = space -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/psr/simple-cache/LICENSE.md b/vendor/psr/simple-cache/LICENSE.md deleted file mode 100644 index e49a7c8..0000000 --- a/vendor/psr/simple-cache/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# The MIT License (MIT) - -Copyright (c) 2016 PHP Framework Interoperability Group - -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. diff --git a/vendor/psr/simple-cache/README.md b/vendor/psr/simple-cache/README.md deleted file mode 100644 index 43641d1..0000000 --- a/vendor/psr/simple-cache/README.md +++ /dev/null @@ -1,8 +0,0 @@ -PHP FIG Simple Cache PSR -======================== - -This repository holds all interfaces related to PSR-16. - -Note that this is not a cache implementation of its own. It is merely an interface that describes a cache implementation. See [the specification](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for more details. - -You can find implementations of the specification by looking for packages providing the [psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) virtual package. diff --git a/vendor/psr/simple-cache/composer.json b/vendor/psr/simple-cache/composer.json deleted file mode 100644 index 2978fa5..0000000 --- a/vendor/psr/simple-cache/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/simple-cache", - "description": "Common interfaces for simple caching", - "keywords": ["psr", "psr-16", "cache", "simple-cache", "caching"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/simple-cache/src/CacheException.php b/vendor/psr/simple-cache/src/CacheException.php deleted file mode 100644 index eba5381..0000000 --- a/vendor/psr/simple-cache/src/CacheException.php +++ /dev/null @@ -1,10 +0,0 @@ - value pairs. Cache keys that do not exist or are stale will have $default as value. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if $keys is neither an array nor a Traversable, - * or if any of the $keys are not a legal value. - */ - public function getMultiple($keys, $default = null); - - /** - * Persists a set of key => value pairs in the cache, with an optional TTL. - * - * @param iterable $values A list of key => value pairs for a multiple-set operation. - * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and - * the driver supports TTL then the library may set a default value - * for it or let the driver take care of that. - * - * @return bool True on success and false on failure. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if $values is neither an array nor a Traversable, - * or if any of the $values are not a legal value. - */ - public function setMultiple($values, $ttl = null); - - /** - * Deletes multiple cache items in a single operation. - * - * @param iterable $keys A list of string-based keys to be deleted. - * - * @return bool True if the items were successfully removed. False if there was an error. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if $keys is neither an array nor a Traversable, - * or if any of the $keys are not a legal value. - */ - public function deleteMultiple($keys); - - /** - * Determines whether an item is present in the cache. - * - * NOTE: It is recommended that has() is only to be used for cache warming type purposes - * and not to be used within your live applications operations for get/set, as this method - * is subject to a race condition where your has() will return true and immediately after, - * another script can remove it making the state of your app out of date. - * - * @param string $key The cache item key. - * - * @return bool - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function has($key); -} diff --git a/vendor/psr/simple-cache/src/InvalidArgumentException.php b/vendor/psr/simple-cache/src/InvalidArgumentException.php deleted file mode 100644 index 6a9524a..0000000 --- a/vendor/psr/simple-cache/src/InvalidArgumentException.php +++ /dev/null @@ -1,13 +0,0 @@ - 'edward\\captcha\\CaptchaService', - 1 => 'think\\migration\\Service', - 2 => 'think\\app\\Service', - 3 => 'think\\trace\\Service', -); \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/.gitattributes b/vendor/swiftmailer/swiftmailer/.gitattributes deleted file mode 100644 index dc96281..0000000 --- a/vendor/swiftmailer/swiftmailer/.gitattributes +++ /dev/null @@ -1,11 +0,0 @@ -*.crt -crlf -*.key -crlf -*.srl -crlf -*.pub -crlf -*.priv -crlf -*.txt -crlf - -# ignore directories in the git-generated distributed .zip archive -/doc/notes export-ignore -/tests export-ignore -/phpunit.xml.dist export-ignore diff --git a/vendor/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md b/vendor/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 5db6524..0000000 --- a/vendor/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,19 +0,0 @@ - - -| Q | A -| ------------------- | ----- -| Bug report? | yes/no -| Feature request? | yes/no -| RFC? | yes/no -| How used? | Standalone/Symfony/3party -| Swiftmailer version | x.y.z -| PHP version | x.y.z - -### Observed behaviour - - -### Expected behaviour - - -### Example - diff --git a/vendor/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md b/vendor/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 4b39510..0000000 --- a/vendor/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,14 +0,0 @@ - - -| Q | A -| ------------- | --- -| Bug fix? | yes/no -| New feature? | yes/no -| Doc update? | yes/no -| BC breaks? | yes/no -| Deprecations? | yes/no -| Fixed tickets | #... -| License | MIT - - - diff --git a/vendor/swiftmailer/swiftmailer/.gitignore b/vendor/swiftmailer/swiftmailer/.gitignore deleted file mode 100644 index a911ddf..0000000 --- a/vendor/swiftmailer/swiftmailer/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.php_cs.cache -/.phpunit -/.phpunit.result.cache -/build/* -/composer.lock -/phpunit.xml -/tests/acceptance.conf.php -/tests/smoke.conf.php -/vendor/ diff --git a/vendor/swiftmailer/swiftmailer/.php_cs.dist b/vendor/swiftmailer/swiftmailer/.php_cs.dist deleted file mode 100644 index 563b48b..0000000 --- a/vendor/swiftmailer/swiftmailer/.php_cs.dist +++ /dev/null @@ -1,21 +0,0 @@ -setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, - '@PHPUnit75Migration:risky' => true, - 'php_unit_dedicate_assert' => ['target' => '5.6'], - 'array_syntax' => ['syntax' => 'short'], - 'php_unit_fqcn_annotation' => true, - 'no_unreachable_default_argument_value' => false, - 'braces' => ['allow_single_line_closure' => true], - 'heredoc_to_nowdoc' => false, - 'ordered_imports' => true, - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], - 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'], - 'fopen_flags' => false, - ]) - ->setRiskyAllowed(true) - ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) -; diff --git a/vendor/swiftmailer/swiftmailer/.travis.yml b/vendor/swiftmailer/swiftmailer/.travis.yml deleted file mode 100644 index 4468782..0000000 --- a/vendor/swiftmailer/swiftmailer/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: php - -before_script: - - cp tests/acceptance.conf.php.default tests/acceptance.conf.php - - cp tests/smoke.conf.php.default tests/smoke.conf.php - - composer self-update - - composer update --no-interaction --prefer-source - - gem install mime-types -v 2.99.1 - - gem install mailcatcher - - mailcatcher --smtp-port 4456 - -script: ./vendor/bin/simple-phpunit - -env: - global: - - SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 - -matrix: - include: - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - - php: 8.0 - fast_finish: true - -cache: - directories: - - .phpunit diff --git a/vendor/swiftmailer/swiftmailer/CHANGES b/vendor/swiftmailer/swiftmailer/CHANGES deleted file mode 100644 index 5f80420..0000000 --- a/vendor/swiftmailer/swiftmailer/CHANGES +++ /dev/null @@ -1,366 +0,0 @@ -Changelog -========= - -6.2.5 (2021-XX-XX) ------------------- - - * n/a - -6.2.4 (2020-12-08) ------------------- - - * Prevent flushing of the bubble queue when event handler raises another event - * Add support for PHP 8 - * Code cleanups - -6.2.3 (2019-11-12) ------------------- - - * no changes - -6.2.2 (2019-11-12) ------------------- - - * fixed compat with PHP 7.4 - * fixed error message when connecting to a stream raises an error before connect() - -6.2.1 (2019-04-21) ------------------- - - * reverted "deprecated Swift_CharacterStream_ArrayCharacterStream and Swift_CharacterStream_NgCharacterStream in favor of Swift_CharacterStream_CharacterStream" - -6.2.0 (2019-03-10) ------------------- - - * added support for symfony/polyfill-intl-dn - * deprecated Swift_CharacterStream_ArrayCharacterStream and Swift_CharacterStream_NgCharacterStream in favor of Swift_CharacterStream_CharacterStream - -6.1.3 (2018-09-11) ------------------- - - * added auto-start to the SMTP transport when sending a message - * tweaked error message when the response from an SMTP server is empty - * fixed missing property in Swift_Mime_IdGenerator - * exposed original body content type with Swift_Mime_SimpleMimeEntity::getBodyContentType() - * fixed typo in variable name in Swift_AddressEncoder_IdnAddressEncoder - * fixed return type in MessageLogger - * fixed missing property addressEncoder in SimpleHeaderFactory class - -6.1.2 (2018-07-13) ------------------- - - * handled recipient errors when pipelining - -6.1.1 (2018-07-04) ------------------- - - * removed hard dependency on an IDN encoder - -6.1.0 (2018-07-02) ------------------- - - * added address encoder exceptions during send - * added support for bubbling up authenticator error messages - * added support for non-ASCII email addresses - * introduced new dependencies: transport.smtphandlers and transport.authhandlers - * deprecated Swift_Signers_OpenDKIMSigner; use Swift_Signers_DKIMSigner instead - * added support for SMTP pipelining - * added Swift_Transport_Esmtp_EightBitMimeHandler - * fixed startTLS only allowed tls1.0, now allowed: tls1.0, tls1.1, tls1.2 - -6.0.2 (2017-09-30) ------------------- - - * fixed DecoratorPlugin - * removed usage of getmypid() - -6.0.1 (2017-05-20) ------------------- - - * fixed BC break that can be avoided easily - -6.0.0 (2017-05-19) ------------------- - - * added Swift_Transport::ping() - * removed Swift_Mime_HeaderFactory, Swift_Mime_HeaderSet, Swift_Mime_Message, Swift_Mime_MimeEntity, - and Swift_Mime_ParameterizedHeader interfaces - * removed Swift_MailTransport and Swift_Transport_MailTransport - * removed Swift_Encoding - * removed the Swift_Transport_MailInvoker interface and Swift_Transport_SimpleMailInvoker class - * removed the Swift_SignedMessage class - * removed newInstance() methods everywhere - * methods operating on Date header now use DateTimeImmutable object instead of Unix timestamp; - Swift_Mime_Headers_DateHeader::getTimestamp()/setTimestamp() renamed to getDateTime()/setDateTime() - * bumped minimum version to PHP 7.0 - * removed Swift_Validate and replaced by egulias/email-validator - -5.4.9 (2018-01-23) ------------------- - - * no changes, last version of the 5.x series - -5.4.8 (2017-05-01) ------------------- - - * fixed encoding inheritance in addPart() - * fixed sorting MIME children when their types are equal - -5.4.7 (2017-04-20) ------------------- - - * fixed NTLMAuthenticator clobbering bcmath scale - -5.4.6 (2017-02-13) ------------------- - - * removed exceptions thrown in destructors as they lead to fatal errors - * switched to use sha256 by default in DKIM as per the RFC - * fixed an 'Undefined variable: pipes' PHP notice - * fixed long To headers when using the mail transport - * fixed NTLMAuthenticator when no domain is passed with the username - * prevented fatal error during unserialization of a message - * fixed a PHP warning when sending a message that has a length of a multiple of 8192 - -5.4.5 (2016-12-29) ------------------- - - * SECURITY FIX: fixed CVE-2016-10074 by disallowing potentially unsafe shell characters - - Prior to 5.4.5, the mail transport (Swift_Transport_MailTransport) was vulnerable to passing - arbitrary shell arguments if the "From", "ReturnPath" or "Sender" header came - from a non-trusted source, potentially allowing Remote Code Execution - * deprecated the mail transport - -5.4.4 (2016-11-23) ------------------- - - * reverted escaping command-line args to mail (PHP mail() function already does it) - -5.4.3 (2016-07-08) ------------------- - - * fixed SimpleHeaderSet::has()/get() when the 0 index is removed - * removed the need to have mcrypt installed - * fixed broken MIME header encoding with quotes/colons and non-ascii chars - * allowed mail transport send for messages without To header - * fixed PHP 7 support - -5.4.2 (2016-05-01) ------------------- - - * fixed support for IPv6 sockets - * added auto-retry when sending messages from the memory spool - * fixed consecutive read calls in Swift_ByteStream_FileByteStream - * added support for iso-8859-15 encoding - * fixed PHP mail extra params on missing reversePath - * added methods to set custom stream context options - * fixed charset changes in QpContentEncoderProxy - * added return-path header to the ignoredHeaders list of DKIMSigner - * fixed crlf for subject using mail - * fixed add soft line break only when necessary - * fixed escaping command-line args to mail - -5.4.1 (2015-06-06) ------------------- - - * made Swiftmailer exceptions confirm to PHP base exception constructor signature - * fixed MAIL FROM & RCPT TO headers to be RFC compliant - -5.4.0 (2015-03-14) ------------------- - - * added the possibility to add extra certs to PKCS#7 signature - * fix base64 encoding with streams - * added a new RESULT_SPOOLED status for SpoolTransport - * fixed getBody() on attachments when called more than once - * removed dots from generated filenames in filespool - -5.3.1 (2014-12-05) ------------------- - - * fixed cloning of messages with attachments - -5.3.0 (2014-10-04) ------------------- - - * fixed cloning when using signers - * reverted removal of Swift_Encoding - * drop support for PHP 5.2.x - -5.2.2 (2014-09-20) ------------------- - - * fixed Japanese support - * fixed the memory spool when the message changes when in the pool - * added support for cloning messages - * fixed PHP warning in the redirect plugin - * changed the way to and cc-ed email are sent to only use one transaction - -5.2.1 (2014-06-13) ------------------- - - * SECURITY FIX: fixed CLI escaping when using sendmail as a transport - - Prior to 5.2.1, the sendmail transport (Swift_Transport_SendmailTransport) - was vulnerable to an arbitrary shell execution if the "From" header came - from a non-trusted source and no "Return-Path" is configured. - - * fixed parameter in DKIMSigner - * fixed compatibility with PHP < 5.4 - -5.2.0 (2014-05-08) ------------------- - - * fixed Swift_ByteStream_FileByteStream::read() to match to the specification - * fixed from-charset and to-charset arguments in mbstring_convert_encoding() usages - * fixed infinite loop in StreamBuffer - * fixed NullTransport to return the number of ignored emails instead of 0 - * Use phpunit and mockery for unit testing (realityking) - -5.1.0 (2014-03-18) ------------------- - - * fixed data writing to stream when sending large messages - * added support for libopendkim (https://github.com/xdecock/php-opendkim) - * merged SignedMessage and Message - * added Gmail XOAuth2 authentication - * updated the list of known mime types - * added NTLM authentication - -5.0.3 (2013-12-03) ------------------- - - * fixed double-dot bug - * fixed DKIM signer - -5.0.2 (2013-08-30) ------------------- - - * handled correct exception type while reading IoBuffer output - -5.0.1 (2013-06-17) ------------------- - - * changed the spool to only start the transport when a mail has to be sent - * fixed compatibility with PHP 5.2 - * fixed LICENSE file - -5.0.0 (2013-04-30) ------------------- - - * changed the license from LGPL to MIT - -4.3.1 (2013-04-11) ------------------- - - * removed usage of the native QP encoder when the charset is not UTF-8 - * fixed usage of uniqid to avoid collisions - * made a performance improvement when tokenizing large headers - * fixed usage of the PHP native QP encoder on PHP 5.4.7+ - -4.3.0 (2013-01-08) ------------------- - - * made the temporary directory configurable via the TMPDIR env variable - * added S/MIME signer and encryption support - -4.2.2 (2012-10-25) ------------------- - - * added the possibility to throttle messages per second in ThrottlerPlugin (mostly for Amazon SES) - * switched mime.qpcontentencoder to automatically use the PHP native encoder on PHP 5.4.7+ - * allowed specifying a whitelist with regular expressions in RedirectingPlugin - -4.2.1 (2012-07-13) ------------------- - - * changed the coding standards to PSR-1/2 - * fixed issue with autoloading - * added NativeQpContentEncoder to enhance performance (for PHP 5.3+) - -4.2.0 (2012-06-29) ------------------- - - * added documentation about how to use the Japanese support introduced in 4.1.8 - * added a way to override the default configuration in a lazy way - * changed the PEAR init script to lazy-load the initialization - * fixed a bug when calling Swift_Preferences before anything else (regression introduced in 4.1.8) - -4.1.8 (2012-06-17) ------------------- - - * added Japanese iso-2022-jp support - * changed the init script to lazy-load the initialization - * fixed docblocks (@id) which caused some problems with libraries parsing the dobclocks - * fixed Swift_Mime_Headers_IdentificationHeader::setId() when passed an array of ids - * fixed encoding of email addresses in headers - * added replacements setter to the Decorator plugin - -4.1.7 (2012-04-26) ------------------- - - * fixed QpEncoder safeMapShareId property - -4.1.6 (2012-03-23) ------------------- - - * reduced the size of serialized Messages - -4.1.5 (2012-01-04) ------------------- - - * enforced Swift_Spool::queueMessage() to return a Boolean - * made an optimization to the memory spool: start the transport only when required - * prevented stream_socket_client() from generating an error and throw a Swift_TransportException instead - * fixed a PHP warning when calling to mail() when safe_mode is off - * many doc tweaks - -4.1.4 (2011-12-16) ------------------- - - * added a memory spool (Swift_MemorySpool) - * fixed too many opened files when sending emails with attachments - -4.1.3 (2011-10-27) ------------------- - - * added STARTTLS support - * added missing @return tags on fluent methods - * added a MessageLogger plugin that logs all sent messages - * added composer.json - -4.1.2 (2011-09-13) ------------------- - - * fixed wrong detection of magic_quotes_runtime - * fixed fatal errors when no To or Subject header has been set - * fixed charset on parameter header continuations - * added documentation about how to install Swiftmailer from the PEAR channel - * fixed various typos and markup problem in the documentation - * fixed warning when cache directory does not exist - * fixed "slashes are escaped" bug - * changed require_once() to require() in autoload - -4.1.1 (2011-07-04) ------------------- - - * added missing file in PEAR package - -4.1.0 (2011-06-30) ------------------- - - * documentation has been converted to ReST - -4.1.0 RC1 (2011-06-17) ----------------------- - -New features: - - * changed the Decorator Plugin to allow replacements in all headers - * added Swift_Mime_Grammar and Swift_Validate to validate an email address - * modified the autoloader to lazy-initialize Swiftmailer - * removed Swift_Mailer::batchSend() - * added NullTransport - * added new plugins: RedirectingPlugin and ImpersonatePlugin - * added a way to send messages asynchronously (Spool) diff --git a/vendor/swiftmailer/swiftmailer/LICENSE b/vendor/swiftmailer/swiftmailer/LICENSE deleted file mode 100644 index ab72077..0000000 --- a/vendor/swiftmailer/swiftmailer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/swiftmailer/swiftmailer/README.md b/vendor/swiftmailer/swiftmailer/README.md deleted file mode 100644 index 0e1fb4c..0000000 --- a/vendor/swiftmailer/swiftmailer/README.md +++ /dev/null @@ -1,19 +0,0 @@ -Swift Mailer ------------- - -Swift Mailer is a component based mailing solution for PHP. -It is released under the MIT license. - -Swift Mailer is highly object-oriented by design and lends itself -to use in complex web application with a great deal of flexibility. - -For full details on usage, read the [documentation](https://swiftmailer.symfony.com/docs/introduction.html). - -Sponsors --------- - - diff --git a/vendor/swiftmailer/swiftmailer/composer.json b/vendor/swiftmailer/swiftmailer/composer.json deleted file mode 100644 index d66dc4c..0000000 --- a/vendor/swiftmailer/swiftmailer/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "swiftmailer/swiftmailer", - "type": "library", - "description": "Swiftmailer, free feature-rich PHP mailer", - "keywords": ["mail","mailer","email"], - "homepage": "https://swiftmailer.symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "php": ">=7.0.0", - "egulias/email-validator": "^2.0", - "symfony/polyfill-iconv": "^1.0", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-intl-idn": "^1.10" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "symfony/phpunit-bridge": "^4.4|^5.0" - }, - "suggest": { - "ext-intl": "Needed to support internationalized email addresses" - }, - "autoload": { - "files": ["lib/swift_required.php"] - }, - "autoload-dev": { - "psr-0": { "Swift_": "tests/unit" } - }, - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/doc/headers.rst b/vendor/swiftmailer/swiftmailer/doc/headers.rst deleted file mode 100644 index 8b8bece..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/headers.rst +++ /dev/null @@ -1,621 +0,0 @@ -Message Headers -=============== - -Sometimes you'll want to add your own headers to a message or modify/remove -headers that are already present. You work with the message's HeaderSet to do -this. - -Header Basics -------------- - -All MIME entities in Swift Mailer -- including the message itself -- store -their headers in a single object called a HeaderSet. This HeaderSet is -retrieved with the ``getHeaders()`` method. - -As mentioned in the previous chapter, everything that forms a part of a message -in Swift Mailer is a MIME entity that is represented by an instance of -``Swift_Mime_SimpleMimeEntity``. This includes -- most notably -- the message -object itself, attachments, MIME parts and embedded images. Each of these MIME -entities consists of a body and a set of headers that describe the body. - -For all of the "standard" headers in these MIME entities, such as the -``Content-Type``, there are named methods for working with them, such as -``setContentType()`` and ``getContentType()``. This is because headers are a -moderately complex area of the library. Each header has a slightly different -required structure that it must meet in order to comply with the standards that -govern email (and that are checked by spam blockers etc). - -You fetch the HeaderSet from a MIME entity like so:: - - $message = new Swift_Message(); - - // Fetch the HeaderSet from a Message object - $headers = $message->getHeaders(); - - $attachment = Swift_Attachment::fromPath('document.pdf'); - - // Fetch the HeaderSet from an attachment object - $headers = $attachment->getHeaders(); - -The job of the HeaderSet is to contain and manage instances of Header objects. -Depending upon the MIME entity the HeaderSet came from, the contents of the -HeaderSet will be different, since an attachment for example has a different -set of headers to those in a message. - -You can find out what the HeaderSet contains with a quick loop, dumping out the -names of the headers:: - - foreach ($headers->getAll() as $header) { - printf("%s
\n", $header->getFieldName()); - } - - /* - Content-Transfer-Encoding - Content-Type - MIME-Version - Date - Message-ID - From - Subject - To - */ - -You can also dump out the rendered HeaderSet by calling its ``toString()`` -method:: - - echo $headers->toString(); - - /* - Message-ID: <1234869991.499a9ee7f1d5e@swift.generated> - Date: Tue, 17 Feb 2009 22:26:31 +1100 - Subject: Awesome subject! - From: sender@example.org - To: recipient@example.org - MIME-Version: 1.0 - Content-Type: text/plain; charset=utf-8 - Content-Transfer-Encoding: quoted-printable - */ - -Where the complexity comes in is when you want to modify an existing header. -This complexity comes from the fact that each header can be of a slightly -different type (such as a Date header, or a header that contains email -addresses, or a header that has key-value parameters on it!). Each header in -the HeaderSet is an instance of ``Swift_Mime_Header``. They all have common -functionality, but knowing exactly what type of header you're working with will -allow you a little more control. - -You can determine the type of header by comparing the return value of its -``getFieldType()`` method with the constants ``TYPE_TEXT``, -``TYPE_PARAMETERIZED``, ``TYPE_DATE``, ``TYPE_MAILBOX``, ``TYPE_ID`` and -``TYPE_PATH`` which are defined in ``Swift_Mime_Header``:: - - foreach ($headers->getAll() as $header) { - switch ($header->getFieldType()) { - case Swift_Mime_Header::TYPE_TEXT: $type = 'text'; - break; - case Swift_Mime_Header::TYPE_PARAMETERIZED: $type = 'parameterized'; - break; - case Swift_Mime_Header::TYPE_MAILBOX: $type = 'mailbox'; - break; - case Swift_Mime_Header::TYPE_DATE: $type = 'date'; - break; - case Swift_Mime_Header::TYPE_ID: $type = 'ID'; - break; - case Swift_Mime_Header::TYPE_PATH: $type = 'path'; - break; - } - printf("%s: is a %s header
\n", $header->getFieldName(), $type); - } - - /* - Content-Transfer-Encoding: is a text header - Content-Type: is a parameterized header - MIME-Version: is a text header - Date: is a date header - Message-ID: is a ID header - From: is a mailbox header - Subject: is a text header - To: is a mailbox header - */ - -Headers can be removed from the set, modified within the set, or added to the -set. - -The following sections show you how to work with the HeaderSet and explain the -details of each implementation of ``Swift_Mime_Header`` that may exist within -the HeaderSet. - -Header Types ------------- - -Because all headers are modeled on different data (dates, addresses, text!) -there are different types of Header in Swift Mailer. Swift Mailer attempts to -categorize all possible MIME headers into more general groups, defined by a -small number of classes. - -Text Headers -~~~~~~~~~~~~ - -Text headers are the simplest type of Header. They contain textual information -with no special information included within it -- for example the Subject -header in a message. - -There's nothing particularly interesting about a text header, though it is -probably the one you'd opt to use if you need to add a custom header to a -message. It represents text just like you'd think it does. If the text contains -characters that are not permitted in a message header (such as new lines, or -non-ascii characters) then the header takes care of encoding the text so that -it can be used. - -No header -- including text headers -- in Swift Mailer is vulnerable to -header-injection attacks. Swift Mailer breaks any attempt at header injection -by encoding the dangerous data into a non-dangerous form. - -It's easy to add a new text header to a HeaderSet. You do this by calling the -HeaderSet's ``addTextHeader()`` method:: - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addTextHeader('Your-Header-Name', 'the header value'); - -Changing the value of an existing text header is done by calling it's -``setValue()`` method:: - - $subject = $message->getHeaders()->get('Subject'); - $subject->setValue('new subject'); - -When output via ``toString()``, a text header produces something like the -following:: - - $subject = $message->getHeaders()->get('Subject'); - $subject->setValue('amazing subject line'); - echo $subject->toString(); - - /* - - Subject: amazing subject line - - */ - -If the header contains any characters that are outside of the US-ASCII range -however, they will be encoded. This is nothing to be concerned about since mail -clients will decode them back:: - - $subject = $message->getHeaders()->get('Subject'); - $subject->setValue('contains – dash'); - echo $subject->toString(); - - /* - - Subject: contains =?utf-8?Q?=E2=80=93?= dash - - */ - -Parameterized Headers -~~~~~~~~~~~~~~~~~~~~~ - -Parameterized headers are text headers that contain key-value parameters -following the textual content. The Content-Type header of a message is a -parameterized header since it contains charset information after the content -type. - -The parameterized header type is a special type of text header. It extends the -text header by allowing additional information to follow it. All of the methods -from text headers are available in addition to the methods described here. - -Adding a parameterized header to a HeaderSet is done by using the -``addParameterizedHeader()`` method which takes a text value like -``addTextHeader()`` but it also accepts an associative array of key-value -parameters:: - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addParameterizedHeader( - 'Header-Name', 'header value', - ['foo' => 'bar'] - ); - -To change the text value of the header, call it's ``setValue()`` method just as -you do with text headers. - -To change the parameters in the header, call the header's ``setParameters()`` -method or the ``setParameter()`` method (note the pluralization):: - - $type = $message->getHeaders()->get('Content-Type'); - - // setParameters() takes an associative array - $type->setParameters([ - 'name' => 'file.txt', - 'charset' => 'iso-8859-1' - ]); - - // setParameter() takes two args for $key and $value - $type->setParameter('charset', 'iso-8859-1'); - -When output via ``toString()``, a parameterized header produces something like -the following:: - - $type = $message->getHeaders()->get('Content-Type'); - $type->setValue('text/html'); - $type->setParameter('charset', 'utf-8'); - - echo $type->toString(); - - /* - - Content-Type: text/html; charset=utf-8 - - */ - -If the header contains any characters that are outside of the US-ASCII range -however, they will be encoded, just like they are for text headers. This is -nothing to be concerned about since mail clients will decode them back. -Likewise, if the parameters contain any non-ascii characters they will be -encoded so that they can be transmitted safely:: - - $attachment = new Swift_Attachment(); - $disp = $attachment->getHeaders()->get('Content-Disposition'); - $disp->setValue('attachment'); - $disp->setParameter('filename', 'report–may.pdf'); - echo $disp->toString(); - - /* - - Content-Disposition: attachment; filename*=utf-8''report%E2%80%93may.pdf - - */ - -Date Headers -~~~~~~~~~~~~ - -Date headers contains an RFC 2822 formatted date (i.e. what PHP's ``date('r')`` -returns). They are used anywhere a date or time is needed to be presented as a -message header. - -The data on which a date header is modeled as a DateTimeImmutable object. The -object is used to create a correctly structured RFC 2822 formatted date with -timezone such as ``Tue, 17 Feb 2009 22:26:31 +1100``. - -The obvious place this header type is used is in the ``Date:`` header of the -message itself. - -It's easy to add a new date header to a HeaderSet. You do this by calling the -HeaderSet's ``addDateHeader()`` method:: - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addDateHeader('Your-Header', new DateTimeImmutable('3 days ago')); - -Changing the value of an existing date header is done by calling it's -``setDateTime()`` method:: - - $date = $message->getHeaders()->get('Date'); - $date->setDateTime(new DateTimeImmutable()); - -When output via ``toString()``, a date header produces something like the -following:: - - $date = $message->getHeaders()->get('Date'); - echo $date->toString(); - - /* - - Date: Wed, 18 Feb 2009 13:35:02 +1100 - - */ - -Mailbox (e-mail address) Headers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Mailbox headers contain one or more email addresses, possibly with personalized -names attached to them. The data on which they are modeled is represented by an -associative array of email addresses and names. - -Mailbox headers are probably the most complex header type to understand in -Swift Mailer because they accept their input as an array which can take various -forms, as described in the previous chapter. - -All of the headers that contain e-mail addresses in a message -- with the -exception of ``Return-Path:`` which has a stricter syntax -- use this header -type. That is, ``To:``, ``From:`` etc. - -You add a new mailbox header to a HeaderSet by calling the HeaderSet's -``addMailboxHeader()`` method:: - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addMailboxHeader('Your-Header-Name', [ - 'person1@example.org' => 'Person Name One', - 'person2@example.org', - 'person3@example.org', - 'person4@example.org' => 'Another named person' - ]); - -Changing the value of an existing mailbox header is done by calling it's -``setNameAddresses()`` method:: - - $to = $message->getHeaders()->get('To'); - $to->setNameAddresses([ - 'joe@example.org' => 'Joe Bloggs', - 'john@example.org' => 'John Doe', - 'no-name@example.org' - ]); - -If you don't wish to concern yourself with the complicated accepted input -formats accepted by ``setNameAddresses()`` as described in the previous chapter -and you only want to set one or more addresses (not names) then you can just -use the ``setAddresses()`` method instead:: - - $to = $message->getHeaders()->get('To'); - $to->setAddresses([ - 'joe@example.org', - 'john@example.org', - 'no-name@example.org' - ]); - -.. note:: - - Both methods will accept the above input format in practice. - -If all you want to do is set a single address in the header, you can use a -string as the input parameter to ``setAddresses()`` and/or -``setNameAddresses()``:: - - $to = $message->getHeaders()->get('To'); - $to->setAddresses('joe-bloggs@example.org'); - -When output via ``toString()``, a mailbox header produces something like the -following:: - - $to = $message->getHeaders()->get('To'); - $to->setNameAddresses([ - 'person1@example.org' => 'Name of Person', - 'person2@example.org', - 'person3@example.org' => 'Another Person' - ]); - - echo $to->toString(); - - /* - - To: Name of Person , person2@example.org, Another Person - - - */ - -Internationalized domains are automatically converted to IDN encoding:: - - $to = $message->getHeaders()->get('To'); - $to->setAddresses('joe@ëxämple.org'); - - echo $to->toString(); - - /* - - To: joe@xn--xmple-gra1c.org - - */ - -ID Headers -~~~~~~~~~~ - -ID headers contain identifiers for the entity (or the message). The most -notable ID header is the Message-ID header on the message itself. - -An ID that exists inside an ID header looks more-or-less less like an email -address. For example, ``<1234955437.499becad62ec2@example.org>``. The part to -the left of the @ sign is usually unique, based on the current time and some -random factor. The part on the right is usually a domain name. - -Any ID passed to the header's ``setId()`` method absolutely MUST conform to -this structure, otherwise you'll get an Exception thrown at you by Swift Mailer -(a ``Swift_RfcComplianceException``). This is to ensure that the generated -email complies with relevant RFC documents and therefore is less likely to be -blocked as spam. - -It's easy to add a new ID header to a HeaderSet. You do this by calling the -HeaderSet's ``addIdHeader()`` method:: - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addIdHeader('Your-Header-Name', '123456.unqiue@example.org'); - -Changing the value of an existing ID header is done by calling its ``setId()`` -method:: - - $msgId = $message->getHeaders()->get('Message-ID'); - $msgId->setId(time() . '.' . uniqid('thing') . '@example.org'); - -When output via ``toString()``, an ID header produces something like the -following:: - - $msgId = $message->getHeaders()->get('Message-ID'); - echo $msgId->toString(); - - /* - - Message-ID: <1234955437.499becad62ec2@example.org> - - */ - -Path Headers -~~~~~~~~~~~~ - -Path headers are like very-restricted mailbox headers. They contain a single -email address with no associated name. The Return-Path header of a message is a -path header. - -You add a new path header to a HeaderSet by calling the HeaderSet's -``addPathHeader()`` method:: - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addPathHeader('Your-Header-Name', 'person@example.org'); - -Changing the value of an existing path header is done by calling its -``setAddress()`` method:: - - $return = $message->getHeaders()->get('Return-Path'); - $return->setAddress('my-address@example.org'); - -When output via ``toString()``, a path header produces something like the -following:: - - $return = $message->getHeaders()->get('Return-Path'); - $return->setAddress('person@example.org'); - echo $return->toString(); - - /* - - Return-Path: - - */ - -Header Operations ------------------ - -Working with the headers in a message involves knowing how to use the methods -on the HeaderSet and on the individual Headers within the HeaderSet. - -Adding new Headers -~~~~~~~~~~~~~~~~~~ - -New headers can be added to the HeaderSet by using one of the provided -``add..Header()`` methods. - -The added header will appear in the message when it is sent:: - - // Adding a custom header to a message - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addTextHeader('X-Mine', 'something here'); - - // Adding a custom header to an attachment - $attachment = Swift_Attachment::fromPath('/path/to/doc.pdf'); - $attachment->getHeaders()->addDateHeader('X-Created-Time', time()); - -Retrieving Headers -~~~~~~~~~~~~~~~~~~ - -Headers are retrieved through the HeaderSet's ``get()`` and ``getAll()`` -methods:: - - $headers = $message->getHeaders(); - - // Get the To: header - $toHeader = $headers->get('To'); - - // Get all headers named "X-Foo" - $fooHeaders = $headers->getAll('X-Foo'); - - // Get the second header named "X-Foo" - $foo = $headers->get('X-Foo', 1); - - // Get all headers that are present - $all = $headers->getAll(); - -When using ``get()`` a single header is returned that matches the name (case -insensitive) that is passed to it. When using ``getAll()`` with a header name, -an array of headers with that name are returned. Calling ``getAll()`` with no -arguments returns an array of all headers present in the entity. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``getAll()`` exists to fetch all - headers with a specified name. In addition, ``get()`` accepts an optional - numerical index, starting from zero to specify which header you want more - specifically. - -.. note:: - - If you want to modify the contents of the header and you don't know for - sure what type of header it is then you may need to check the type by - calling its ``getFieldType()`` method. - -Check if a Header Exists -~~~~~~~~~~~~~~~~~~~~~~~~ - -You can check if a named header is present in a HeaderSet by calling its -``has()`` method:: - - $headers = $message->getHeaders(); - - // Check if the To: header exists - if ($headers->has('To')) { - echo 'To: exists'; - } - - // Check if an X-Foo header exists twice (i.e. check for the 2nd one) - if ($headers->has('X-Foo', 1)) { - echo 'Second X-Foo header exists'; - } - -If the header exists, ``true`` will be returned or ``false`` if not. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``has()`` accepts an optional - numerical index, starting from zero to specify which header you want to - check more specifically. - -Removing Headers -~~~~~~~~~~~~~~~~ - -Removing a Header from the HeaderSet is done by calling the HeaderSet's -``remove()`` or ``removeAll()`` methods:: - - $headers = $message->getHeaders(); - - // Remove the Subject: header - $headers->remove('Subject'); - - // Remove all X-Foo headers - $headers->removeAll('X-Foo'); - - // Remove only the second X-Foo header - $headers->remove('X-Foo', 1); - -When calling ``remove()`` a single header will be removed. When calling -``removeAll()`` all headers with the given name will be removed. If no headers -exist with the given name, no errors will occur. - -.. note:: - - It's valid for some headers to appear more than once in a message (e.g. - the Received header). For this reason ``remove()`` accepts an optional - numerical index, starting from zero to specify which header you want to - check more specifically. For the same reason, ``removeAll()`` exists to - remove all headers that have the given name. - -Modifying a Header's Content -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To change a Header's content you should know what type of header it is and then -call it's appropriate setter method. All headers also have a -``setFieldBodyModel()`` method that accepts a mixed parameter and delegates to -the correct setter:: - -The header will be updated inside the HeaderSet and the changes will be seen -when the message is sent:: - - $headers = $message->getHeaders(); - - // Change the Subject: header - $subj = $headers->get('Subject'); - $subj->setValue('new subject here'); - - // Change the To: header - $to = $headers->get('To'); - $to->setNameAddresses([ - 'person@example.org' => 'Person', - 'thing@example.org' - ]); - - // Using the setFieldBodyModel() just delegates to the correct method - // So here to calls setNameAddresses() - $to->setFieldBodyModel([ - 'person@example.org' => 'Person', - 'thing@example.org' - ]); diff --git a/vendor/swiftmailer/swiftmailer/doc/index.rst b/vendor/swiftmailer/swiftmailer/doc/index.rst deleted file mode 100644 index 5d92889..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -Swiftmailer -=========== - -.. toctree:: - :maxdepth: 2 - - introduction - messages - headers - sending - plugins - japanese diff --git a/vendor/swiftmailer/swiftmailer/doc/introduction.rst b/vendor/swiftmailer/swiftmailer/doc/introduction.rst deleted file mode 100644 index 8c61cfb..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/introduction.rst +++ /dev/null @@ -1,61 +0,0 @@ -Introduction -============ - -Swift Mailer is a component based library for sending e-mails from PHP applications. - -System Requirements -------------------- - -Swift Mailer requires PHP 7.0 or higher (``proc_*`` functions must be -available). - -Swift Mailer does not work when used with function overloading as implemented -by ``mbstring`` when ``mbstring.func_overload`` is set to ``2``. - -Installation ------------- - -The recommended way to install Swiftmailer is via Composer: - -.. code-block:: bash - - $ composer require "swiftmailer/swiftmailer:^6.0" - -Basic Usage ------------ - -Here is the simplest way to send emails with Swift Mailer:: - - require_once '/path/to/vendor/autoload.php'; - - // Create the Transport - $transport = (new Swift_SmtpTransport('smtp.example.org', 25)) - ->setUsername('your username') - ->setPassword('your password') - ; - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - - // Create a message - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself') - ; - - // Send the message - $result = $mailer->send($message); - -You can also use Sendmail as a transport:: - - // Sendmail - $transport = new Swift_SendmailTransport('/usr/sbin/sendmail -bs'); - -Getting Help ------------- - -For general support, use `Stack Overflow `_. - -For bug reports and feature requests, create a new ticket in `GitHub -`_. diff --git a/vendor/swiftmailer/swiftmailer/doc/japanese.rst b/vendor/swiftmailer/swiftmailer/doc/japanese.rst deleted file mode 100644 index 5454821..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/japanese.rst +++ /dev/null @@ -1,19 +0,0 @@ -Using Swift Mailer for Japanese Emails -====================================== - -To send emails in Japanese, you need to tweak the default configuration. - -Call the ``Swift::init()`` method with the following code as early as possible -in your code:: - - Swift::init(function () { - Swift_DependencyContainer::getInstance() - ->register('mime.qpheaderencoder') - ->asAliasOf('mime.base64headerencoder'); - - Swift_Preferences::getInstance()->setCharset('iso-2022-jp'); - }); - - /* rest of code goes here */ - -That's all! diff --git a/vendor/swiftmailer/swiftmailer/doc/messages.rst b/vendor/swiftmailer/swiftmailer/doc/messages.rst deleted file mode 100644 index 53c5b36..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/messages.rst +++ /dev/null @@ -1,947 +0,0 @@ -Creating Messages -================= - -Creating messages in Swift Mailer is done by making use of the various MIME -entities provided with the library. Complex messages can be quickly created -with very little effort. - -Quick Reference ---------------- - -You can think of creating a Message as being similar to the steps you perform -when you click the Compose button in your mail client. You give it a subject, -specify some recipients, add any attachments and write your message:: - - // Create the message - $message = (new Swift_Message()) - - // Give the message a subject - ->setSubject('Your subject') - - // Set the From address with an associative array - ->setFrom(['john@doe.com' => 'John Doe']) - - // Set the To addresses with an associative array (setTo/setCc/setBcc) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - - // Give it a body - ->setBody('Here is the message itself') - - // And optionally an alternative body - ->addPart('Here is the message itself', 'text/html') - - // Optionally add any attachments - ->attach(Swift_Attachment::fromPath('my-document.pdf')) - ; - -Message Basics --------------- - -A message is a container for anything you want to send to somebody else. There -are several basic aspects of a message that you should know. - -An e-mail message is made up of several relatively simple entities that are -combined in different ways to achieve different results. All of these entities -have the same fundamental outline but serve a different purpose. The Message -itself can be defined as a MIME entity, an Attachment is a MIME entity, all -MIME parts are MIME entities -- and so on! - -The basic units of each MIME entity -- be it the Message itself, or an -Attachment -- are its Headers and its body: - -.. code-block:: text - - Header-Name: A header value - Other-Header: Another value - - The body content itself - -The Headers of a MIME entity, and its body must conform to some strict -standards defined by various RFC documents. Swift Mailer ensures that these -specifications are followed by using various types of object, including -Encoders and different Header types to generate the entity. - -The Structure of a Message -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Of all of the MIME entities, a message -- ``Swift_Message`` is the largest and -most complex. It has many properties that can be updated and it can contain -other MIME entities -- attachments for example -- nested inside it. - -A Message has a lot of different Headers which are there to present information -about the message to the recipients' mail client. Most of these headers will be -familiar to the majority of users, but we'll list the basic ones. Although it's -possible to work directly with the Headers of a Message (or other MIME entity), -the standard Headers have accessor methods provided to abstract away the -complex details for you. For example, although the Date on a message is written -with a strict format, you only need to pass a DateTimeInterface instance to -``setDate()``. - -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| Header | Description | Accessors | -+===============================+====================================================================================================================================+=============================================+ -| ``Message-ID`` | Identifies this message with a unique ID, usually containing the domain name and time generated | ``getId()`` / ``setId()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Return-Path`` | Specifies where bounces should go (Swift Mailer reads this for other uses) | ``getReturnPath()`` / ``setReturnPath()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``From`` | Specifies the address of the person who the message is from. This can be multiple addresses if multiple people wrote the message. | ``getFrom()`` / ``setFrom()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Sender`` | Specifies the address of the person who physically sent the message (higher precedence than ``From:``) | ``getSender()`` / ``setSender()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``To`` | Specifies the addresses of the intended recipients | ``getTo()`` / ``setTo()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Cc`` | Specifies the addresses of recipients who will be copied in on the message | ``getCc()`` / ``setCc()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Bcc`` | Specifies the addresses of recipients who the message will be blind-copied to. Other recipients will not be aware of these copies. | ``getBcc()`` / ``setBcc()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Reply-To`` | Specifies the address where replies are sent to | ``getReplyTo()`` / ``setReplyTo()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Subject`` | Specifies the subject line that is displayed in the recipients' mail client | ``getSubject()`` / ``setSubject()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Date`` | Specifies the date at which the message was sent | ``getDate()`` / ``setDate()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Content-Type`` | Specifies the format of the message (usually ``text/plain`` or ``text/html``) | ``getContentType()`` / ``setContentType()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Content-Transfer-Encoding`` | Specifies the encoding scheme in the message | ``getEncoder()`` / ``setEncoder()`` | -+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ - -Working with a Message Object -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Although there are a lot of available methods on a message object, you only -need to make use of a small subset of them. Usually you'll use -``setSubject()``, ``setTo()`` and ``setFrom()`` before setting the body of your -message with ``setBody()``:: - - $message = new Swift_Message(); - $message->setSubject('My subject'); - -All MIME entities (including a message) have a ``toString()`` method that you -can call if you want to take a look at what is going to be sent. For example, -if you ``echo $message->toString();`` you would see something like this: - -.. code-block:: text - - Message-ID: <1230173678.4952f5eeb1432@swift.generated> - Date: Thu, 25 Dec 2008 13:54:38 +1100 - Subject: Example subject - From: Chris Corbyn - To: Receiver Name - MIME-Version: 1.0 - Content-Type: text/plain; charset=utf-8 - Content-Transfer-Encoding: quoted-printable - - Here is the message - -We'll take a closer look at the methods you use to create your message in the -following sections. - -Adding Content to Your Message ------------------------------- - -Rich content can be added to messages in Swift Mailer with relative ease by -calling methods such as ``setSubject()``, ``setBody()``, ``addPart()`` and -``attach()``. - -Setting the Subject Line -~~~~~~~~~~~~~~~~~~~~~~~~ - -The subject line, displayed in the recipients' mail client can be set with the -``setSubject()`` method, or as a parameter to ``new Swift_Message()``:: - - // Pass it as a parameter when you create the message - $message = new Swift_Message('My amazing subject'); - - // Or set it after like this - $message->setSubject('My amazing subject'); - -Setting the Body Content -~~~~~~~~~~~~~~~~~~~~~~~~ - -The body of the message -- seen when the user opens the message -- is specified -by calling the ``setBody()`` method. If an alternative body is to be included, -``addPart()`` can be used. - -The body of a message is the main part that is read by the user. Often people -want to send a message in HTML format (``text/html``), other times people want -to send in plain text (``text/plain``), or sometimes people want to send both -versions and allow the recipient to choose how they view the message. - -As a rule of thumb, if you're going to send a HTML email, always include a -plain-text equivalent of the same content so that users who prefer to read -plain text can do so. - -If the recipient's mail client offers preferences for displaying text vs. HTML -then the mail client will present that part to the user where available. In -other cases the mail client will display the "best" part it can - usually HTML -if you've included HTML:: - - // Pass it as a parameter when you create the message - $message = new Swift_Message('Subject here', 'My amazing body'); - - // Or set it after like this - $message->setBody('My amazing body', 'text/html'); - - // Add alternative parts with addPart() - $message->addPart('My amazing body in plain text', 'text/plain'); - -Attaching Files ---------------- - -Attachments are downloadable parts of a message and can be added by calling the -``attach()`` method on the message. You can add attachments that exist on disk, -or you can create attachments on-the-fly. - -Although we refer to files sent over e-mails as "attachments" -- because -they're attached to the message -- lots of other parts of the message are -actually "attached" even if we don't refer to these parts as attachments. - -File attachments are created by the ``Swift_Attachment`` class and then -attached to the message via the ``attach()`` method on it. For all of the -"every day" MIME types such as all image formats, word documents, PDFs and -spreadsheets you don't need to explicitly set the content-type of the -attachment, though it would do no harm to do so. For less common formats you -should set the content-type -- which we'll cover in a moment. - -Attaching Existing Files -~~~~~~~~~~~~~~~~~~~~~~~~ - -Files that already exist, either on disk or at a URL can be attached to a -message with just one line of code, using ``Swift_Attachment::fromPath()``. - -You can attach files that exist locally, or if your PHP installation has -``allow_url_fopen`` turned on you can attach files from other -websites. - -The attachment will be presented to the recipient as a downloadable file with -the same filename as the one you attached:: - - // Create the attachment - // * Note that you can technically leave the content-type parameter out - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg', 'image/jpeg'); - - // Attach it to the message - $message->attach($attachment); - - // The two statements above could be written in one line instead - $message->attach(Swift_Attachment::fromPath('/path/to/image.jpg')); - - // You can attach files from a URL if allow_url_fopen is on in php.ini - $message->attach(Swift_Attachment::fromPath('http://site.tld/logo.png')); - -Setting the Filename -~~~~~~~~~~~~~~~~~~~~ - -Usually you don't need to explicitly set the filename of an attachment because -the name of the attached file will be used by default, but if you want to set -the filename you use the ``setFilename()`` method of the Attachment. - -The attachment will be attached in the normal way, but meta-data sent inside -the email will rename the file to something else:: - - // Create the attachment and call its setFilename() method - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg') - ->setFilename('cool.jpg'); - - // Because there's a fluid interface, you can do this in one statement - $message->attach( - Swift_Attachment::fromPath('/path/to/image.jpg')->setFilename('cool.jpg') - ); - -Attaching Dynamic Content -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Files that are generated at runtime, such as PDF documents or images created -via GD can be attached directly to a message without writing them out to disk. -Use ``Swift_Attachment`` directly. - -The attachment will be presented to the recipient as a downloadable file -with the filename and content-type you specify:: - - // Create your file contents in the normal way, but don't write them to disk - $data = create_my_pdf_data(); - - // Create the attachment with your data - $attachment = new Swift_Attachment($data, 'my-file.pdf', 'application/pdf'); - - // Attach it to the message - $message->attach($attachment); - - - // You can alternatively use method chaining to build the attachment - $attachment = (new Swift_Attachment()) - ->setFilename('my-file.pdf') - ->setContentType('application/pdf') - ->setBody($data) - ; - -.. note:: - - If you would usually write the file to disk anyway you should just attach - it with ``Swift_Attachment::fromPath()`` since this will use less memory. - -Changing the Disposition -~~~~~~~~~~~~~~~~~~~~~~~~ - -Attachments just appear as files that can be saved to the Desktop if desired. -You can make attachment appear inline where possible by using the -``setDisposition()`` method of an attachment. - -The attachment will be displayed within the email viewing window if the mail -client knows how to display it:: - - // Create the attachment and call its setDisposition() method - $attachment = Swift_Attachment::fromPath('/path/to/image.jpg') - ->setDisposition('inline'); - - - // Because there's a fluid interface, you can do this in one statement - $message->attach( - Swift_Attachment::fromPath('/path/to/image.jpg')->setDisposition('inline') - ); - -.. note:: - - If you try to create an inline attachment for a non-displayable file type - such as a ZIP file, the mail client should just present the attachment as - normal. - -Embedding Inline Media Files -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Often, people want to include an image or other content inline with a HTML -message. It's easy to do this with HTML linking to remote resources, but this -approach is usually blocked by mail clients. Swift Mailer allows you to embed -your media directly into the message. - -Mail clients usually block downloads from remote resources because this -technique was often abused as a mean of tracking who opened an email. If -you're sending a HTML email and you want to include an image in the message -another approach you can take is to embed the image directly. - -Swift Mailer makes embedding files into messages extremely streamlined. You -embed a file by calling the ``embed()`` method of the message, -which returns a value you can use in a ``src`` or -``href`` attribute in your HTML. - -Just like with attachments, it's possible to embed dynamically generated -content without having an existing file available. - -The embedded files are sent in the email as a special type of attachment that -has a unique ID used to reference them within your HTML attributes. On mail -clients that do not support embedded files they may appear as attachments. - -Although this is commonly done for images, in theory it will work for any -displayable (or playable) media type. Support for other media types (such as -video) is dependent on the mail client however. - -Embedding Existing Files -........................ - -Files that already exist, either on disk or at a URL can be embedded in a -message with just one line of code, using ``Swift_EmbeddedFile::fromPath()``. - -You can embed files that exist locally, or if your PHP installation has -``allow_url_fopen`` turned on you can embed files from other websites. - -The file will be displayed with the message inline with the HTML wherever its ID -is used as a ``src`` attribute:: - - // Create the message - $message = new Swift_Message('My subject'); - - // Set the body - $message->setBody( - '' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - - // You can embed files from a URL if allow_url_fopen is on in php.ini - $message->setBody( - '' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' - ); - -.. note:: - - ``Swift_Image`` and ``Swift_EmbeddedFile`` are just aliases of one another. - ``Swift_Image`` exists for semantic purposes. - -.. note:: - - You can embed files in two stages if you prefer. Just capture the return - value of ``embed()`` in a variable and use that as the ``src`` attribute:: - - // If placing the embed() code inline becomes cumbersome - // it's easy to do this in two steps - $cid = $message->embed(Swift_Image::fromPath('image.png')); - - $message->setBody( - '' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - -Embedding Dynamic Content -......................... - -Images that are generated at runtime, such as images created via GD can be -embedded directly to a message without writing them out to disk. Use the -standard ``new Swift_Image()`` method. - -The file will be displayed with the message inline with the HTML wherever its ID -is used as a ``src`` attribute:: - - // Create your file contents in the normal way, but don't write them to disk - $img_data = create_my_image_data(); - - // Create the message - $message = new Swift_Message('My subject'); - - // Set the body - $message->setBody( - '' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - -.. note:: - - ``Swift_Image`` and ``Swift_EmbeddedFile`` are just aliases of one another. - ``Swift_Image`` exists for semantic purposes. - -.. note:: - - You can embed files in two stages if you prefer. Just capture the return - value of ``embed()`` in a variable and use that as the ``src`` attribute:: - - // If placing the embed() code inline becomes cumbersome - // it's easy to do this in two steps - $cid = $message->embed(new Swift_Image($img_data, 'image.jpg', 'image/jpeg')); - - $message->setBody( - '' . - ' ' . - ' Here is an image Image' . - ' Rest of message' . - ' ' . - '', - 'text/html' // Mark the content-type as HTML - ); - -Adding Recipients to Your Message ---------------------------------- - -Recipients are specified within the message itself via ``setTo()``, ``setCc()`` -and ``setBcc()``. Swift Mailer reads these recipients from the message when it -gets sent so that it knows where to send the message to. - -Message recipients are one of three types: - -* ``To:`` recipients -- the primary recipients (required) - -* ``Cc:`` recipients -- receive a copy of the message (optional) - -* ``Bcc:`` recipients -- hidden from other recipients (optional) - -Each type can contain one, or several addresses. It's possible to list only the -addresses of the recipients, or you can personalize the address by providing -the real name of the recipient. - -Make sure to add only valid email addresses as recipients. If you try to add an -invalid email address with ``setTo()``, ``setCc()`` or ``setBcc()``, Swift -Mailer will throw a ``Swift_RfcComplianceException``. - -If you add recipients automatically based on a data source that may contain -invalid email addresses, you can prevent possible exceptions by validating the -addresses using:: - use Egulias\EmailValidator\EmailValidator; - use Egulias\EmailValidator\Validation\RFCValidation; - - $validator = new EmailValidator(); - $validator->isValid("example@example.com", new RFCValidation()); //true -and only adding addresses that validate. Another way would be to wrap your ``setTo()``, ``setCc()`` and -``setBcc()`` calls in a try-catch block and handle the -``Swift_RfcComplianceException`` in the catch block. - -.. sidebar:: Syntax for Addresses - - If you only wish to refer to a single email address (for example your - ``From:`` address) then you can just use a string:: - - $message->setFrom('some@address.tld'); - - If you want to include a name then you must use an associative array:: - - $message->setFrom(['some@address.tld' => 'The Name']); - - If you want to include multiple addresses then you must use an array:: - - $message->setTo(['some@address.tld', 'other@address.tld']); - - You can mix personalized (addresses with a name) and non-personalized - addresses in the same list by mixing the use of associative and - non-associative array syntax:: - - $message->setTo([ - 'recipient-with-name@example.org' => 'Recipient Name One', - 'no-name@example.org', // Note that this is not a key-value pair - 'named-recipient@example.org' => 'Recipient Name Two' - ]); - -Setting ``To:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``To:`` recipients are required in a message and are set with the ``setTo()`` -or ``addTo()`` methods of the message. - -To set ``To:`` recipients, create the message object using either ``new -Swift_Message( ... )``, then call the ``setTo()`` method with a complete array -of addresses, or use the ``addTo()`` method to iteratively add recipients. - -The ``setTo()`` method accepts input in various formats as described earlier in -this chapter. The ``addTo()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -``To:`` recipients are visible in the message headers and will be seen by the -other recipients:: - - // Using setTo() to set all recipients in one go - $message->setTo([ - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - ]); - -.. note:: - - Multiple calls to ``setTo()`` will not add new recipients -- each - call overrides the previous calls. If you want to iteratively add - recipients, use the ``addTo()`` method:: - - // Using addTo() to add recipients iteratively - $message->addTo('person1@example.org'); - $message->addTo('person2@example.org', 'Person 2 Name'); - -Setting ``Cc:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``Cc:`` recipients are set with the ``setCc()`` or ``addCc()`` methods of the -message. - -To set ``Cc:`` recipients, create the message object using either ``new -Swift_Message( ... )``, then call the ``setCc()`` method with a complete array -of addresses, or use the ``addCc()`` method to iteratively add recipients. - -The ``setCc()`` method accepts input in various formats as described earlier in -this chapter. The ``addCc()`` method takes either one or two parameters. The -first being the email address and the second optional parameter being the name -of the recipient. - -``Cc:`` recipients are visible in the message headers and will be seen by the -other recipients:: - - // Using setTo() to set all recipients in one go - $message->setTo([ - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - ]); - -.. note:: - - Multiple calls to ``setCc()`` will not add new recipients -- each call - overrides the previous calls. If you want to iteratively add Cc: - recipients, use the ``addCc()`` method:: - - // Using addCc() to add recipients iteratively - $message->addCc('person1@example.org'); - $message->addCc('person2@example.org', 'Person 2 Name'); - -Setting ``Bcc:`` Recipients -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``Bcc:`` recipients receive a copy of the message without anybody else knowing -it, and are set with the ``setBcc()`` or ``addBcc()`` methods of the message. - -To set ``Bcc:`` recipients, create the message object using either ``new -Swift_Message( ... )``, then call the ``setBcc()`` method with a complete array -of addresses, or use the ``addBcc()`` method to iteratively add recipients. - -The ``setBcc()`` method accepts input in various formats as described earlier -in this chapter. The ``addBcc()`` method takes either one or two parameters. -The first being the email address and the second optional parameter being the -name of the recipient. - -Only the individual ``Bcc:`` recipient will see their address in the message -headers. Other recipients (including other ``Bcc:`` recipients) will not see -the address:: - - // Using setBcc() to set all recipients in one go - $message->setBcc([ - 'person1@example.org', - 'person2@otherdomain.org' => 'Person 2 Name', - 'person3@example.org', - 'person4@example.org', - 'person5@example.org' => 'Person 5 Name' - ]); - -.. note:: - - Multiple calls to ``setBcc()`` will not add new recipients -- each call - overrides the previous calls. If you want to iteratively add Bcc: - recipients, use the ``addBcc()`` method:: - - // Using addBcc() to add recipients iteratively - $message->addBcc('person1@example.org'); - $message->addBcc('person2@example.org', 'Person 2 Name'); - -.. sidebar:: Internationalized Email Addresses - - Traditionally only ASCII characters have been allowed in email addresses. - With the introduction of internationalized domain names (IDNs), non-ASCII - characters may appear in the domain name. By default, Swiftmailer encodes - such domain names in Punycode (e.g. xn--xample-ova.invalid). This is - compatible with all mail servers. - - RFC 6531 introduced an SMTP extension, SMTPUTF8, that allows non-ASCII - characters in email addresses on both sides of the @ sign. To send to such - addresses, your outbound SMTP server must support the SMTPUTF8 extension. - You should use the ``Swift_AddressEncoder_Utf8AddressEncoder`` address - encoder and enable the ``Swift_Transport_Esmtp_SmtpUtf8Handler`` SMTP - extension handler:: - - $smtpUtf8 = new Swift_Transport_Esmtp_SmtpUtf8Handler(); - $transport->setExtensionHandlers([$smtpUtf8]); - $utf8Encoder = new Swift_AddressEncoder_Utf8AddressEncoder(); - $transport->setAddressEncoder($utf8Encoder); - -Specifying Sender Details -------------------------- - -An email must include information about who sent it. Usually this is managed by -the ``From:`` address, however there are other options. - -The sender information is contained in three possible places: - -* ``From:`` -- the address(es) of who wrote the message (required) - -* ``Sender:`` -- the address of the single person who sent the message - (optional) - -* ``Return-Path:`` -- the address where bounces should go to (optional) - -You must always include a ``From:`` address by using ``setFrom()`` on the -message. Swift Mailer will use this as the default ``Return-Path:`` unless -otherwise specified. - -The ``Sender:`` address exists because the person who actually sent the email -may not be the person who wrote the email. It has a higher precedence than the -``From:`` address and will be used as the ``Return-Path:`` unless otherwise -specified. - -Setting the ``From:`` Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A ``From:`` address is required and is set with the ``setFrom()`` method of the -message. ``From:`` addresses specify who actually wrote the email, and usually -who sent it. - -What most people probably don't realize is that you can have more than one -``From:`` address if more than one person wrote the email -- for example if an -email was put together by a committee. - -The ``From:`` address(es) are visible in the message headers and will be seen -by the recipients. - -.. note:: - - If you set multiple ``From:`` addresses then you absolutely must set a - ``Sender:`` address to indicate who physically sent the message. - -:: - - // Set a single From: address - $message->setFrom('your@address.tld'); - - // Set a From: address including a name - $message->setFrom(['your@address.tld' => 'Your Name']); - - // Set multiple From: addresses if multiple people wrote the email - $message->setFrom([ - 'person1@example.org' => 'Sender One', - 'person2@example.org' => 'Sender Two' - ]); - -Setting the ``Sender:`` Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A ``Sender:`` address specifies who sent the message and is set with the -``setSender()`` method of the message. - -The ``Sender:`` address is visible in the message headers and will be seen by -the recipients. - -This address will be used as the ``Return-Path:`` unless otherwise specified. - -.. note:: - - If you set multiple ``From:`` addresses then you absolutely must set a - ``Sender:`` address to indicate who physically sent the message. - -You must not set more than one sender address on a message because it's not -possible for more than one person to send a single message:: - - $message->setSender('your@address.tld'); - -Setting the ``Return-Path:`` (Bounce) Address -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``Return-Path:`` address specifies where bounce notifications should be -sent and is set with the ``setReturnPath()`` method of the message. - -You can only have one ``Return-Path:`` and it must not include a personal name. - -Bounce notifications will be sent to this address:: - - $message->setReturnPath('bounces@address.tld'); - -Signed/Encrypted Message ------------------------- - -To increase the integrity/security of a message it is possible to sign and/or -encrypt an message using one or multiple signers. - -S/MIME -~~~~~~ - -S/MIME can sign and/or encrypt a message using the OpenSSL extension. - -When signing a message, the signer creates a signature of the entire content of -the message (including attachments). - -The certificate and private key must be PEM encoded, and can be either created -using for example OpenSSL or obtained at an official Certificate Authority (CA). - -**The recipient must have the CA certificate in the list of trusted issuers in -order to verify the signature.** - -**Make sure the certificate supports emailProtection.** - -When using OpenSSL this can done by the including the *-addtrust -emailProtection* parameter when creating the certificate:: - - $message = new Swift_Message(); - - $smimeSigner = new Swift_Signers_SMimeSigner(); - $smimeSigner->setSignCertificate('/path/to/certificate.pem', '/path/to/private-key.pem'); - $message->attachSigner($smimeSigner); - -When the private key is secured using a passphrase use the following instead:: - - $message = new Swift_Message(); - - $smimeSigner = new Swift_Signers_SMimeSigner(); - $smimeSigner->setSignCertificate('/path/to/certificate.pem', ['/path/to/private-key.pem', 'passphrase']); - $message->attachSigner($smimeSigner); - -By default the signature is added as attachment, making the message still -readable for mailing agents not supporting signed messages. - -Storing the message as binary is also possible but not recommended:: - - $smimeSigner->setSignCertificate('/path/to/certificate.pem', '/path/to/private-key.pem', PKCS7_BINARY); - -When encrypting the message (also known as enveloping), the entire message -(including attachments) is encrypted using a certificate, and the recipient can -then decrypt the message using corresponding private key. - -Encrypting ensures nobody can read the contents of the message without the -private key. - -Normally the recipient provides a certificate for encrypting and keeping the -decryption key private. - -Using both signing and encrypting is also possible:: - - $message = new Swift_Message(); - - $smimeSigner = new Swift_Signers_SMimeSigner(); - $smimeSigner->setSignCertificate('/path/to/sign-certificate.pem', '/path/to/private-key.pem'); - $smimeSigner->setEncryptCertificate('/path/to/encrypt-certificate.pem'); - $message->attachSigner($smimeSigner); - -The used encryption cipher can be set as the second parameter of -setEncryptCertificate() - -See https://secure.php.net/manual/openssl.ciphers for a list of supported ciphers. - -By default the message is first signed and then encrypted, this can be changed -by adding:: - - $smimeSigner->setSignThenEncrypt(false); - -**Changing this is not recommended as most mail agents don't support this -none-standard way.** - -Only when having trouble with sign then encrypt method, this should be changed. - -Requesting a Read Receipt -------------------------- - -It is possible to request a read-receipt to be sent to an address when the -email is opened. To request a read receipt set the address with -``setReadReceiptTo()``:: - - $message->setReadReceiptTo('your@address.tld'); - -When the email is opened, if the mail client supports it a notification will be -sent to this address. - -.. note:: - - Read receipts won't work for the majority of recipients since many mail - clients auto-disable them. Those clients that will send a read receipt - will make the user aware that one has been requested. - -Setting the Character Set -------------------------- - -The character set of the message (and its MIME parts) is set with the -``setCharset()`` method. You can also change the global default of UTF-8 by -working with the ``Swift_Preferences`` class. - -Swift Mailer will default to the UTF-8 character set unless otherwise -overridden. UTF-8 will work in most instances since it includes all of the -standard US keyboard characters in addition to most international characters. - -It is absolutely vital however that you know what character set your message -(or it's MIME parts) are written in otherwise your message may be received -completely garbled. - -There are two places in Swift Mailer where you can change the character set: - -* In the ``Swift_Preferences`` class - -* On each individual message and/or MIME part - -To set the character set of your Message: - -* Change the global UTF-8 setting by calling - ``Swift_Preferences::setCharset()``; or - -* Call the ``setCharset()`` method on the message or the MIME part:: - - // Approach 1: Change the global setting (suggested) - Swift_Preferences::getInstance()->setCharset('iso-8859-2'); - - // Approach 2: Call the setCharset() method of the message - $message = (new Swift_Message()) - ->setCharset('iso-8859-2'); - - // Approach 3: Specify the charset when setting the body - $message->setBody('My body', 'text/html', 'iso-8859-2'); - - // Approach 4: Specify the charset for each part added - $message->addPart('My part', 'text/plain', 'iso-8859-2'); - -Setting the Encoding --------------------- - -The body of each MIME part needs to be encoded. Binary attachments are encoded -in base64 using the ``Swift_Mime_ContentEncoder_Base64ContentEncoder``. Text -parts are traditionally encoded in quoted-printable using -``Swift_Mime_ContentEncoder_QpContentEncoder`` or -``Swift_Mime_ContentEncoder_NativeQpContentEncoder``. - -The encoder of the message or MIME part is set with the ``setEncoder()`` method. - -Quoted-printable is the safe choice, because it converts 8-bit text as 7-bit. -Most modern SMTP servers support 8-bit text. This is advertised via the 8BITMIME -SMTP extension. If your outbound SMTP server supports this SMTP extension, and -it supports downgrading the message (e.g converting to quoted-printable on the -fly) when delivering to a downstream server that does not support the extension, -you may wish to use ``Swift_Mime_ContentEncoder_PlainContentEncoder`` in -``8bit`` mode instead. This has the advantage that the source data is slightly -more readable and compact, especially for non-Western languages. - - $eightBitMime = new Swift_Transport_Esmtp_EightBitMimeHandler(); - $transport->setExtensionHandlers([$eightBitMime]); - $plainEncoder = new Swift_Mime_ContentEncoder_PlainContentEncoder('8bit'); - $message->setEncoder($plainEncoder); - -Setting the Line Length ------------------------ - -The length of lines in a message can be changed by using the -``setMaxLineLength()`` method on the message:: - - $message->setMaxLineLength(1000); - -Swift Mailer defaults to using 78 characters per line in a message. This is -done for historical reasons and so that the message can be easily viewed in -plain-text terminals - -Lines that are longer than the line length specified will be wrapped between -words. - -.. note:: - - You should never set a maximum length longer than 1000 characters - according to RFC 2822. Doing so could have unspecified side-effects such - as truncating parts of your message when it is transported between SMTP - servers. - -Setting the Message Priority ----------------------------- - -You can change the priority of the message with ``setPriority()``. Setting the -priority will not change the way your email is sent -- it is purely an -indicative setting for the recipient:: - - // Indicate "High" priority - $message->setPriority(2); - -The priority of a message is an indication to the recipient what significance -it has. Swift Mailer allows you to set the priority by calling the -``setPriority`` method. This method takes an integer value between 1 and 5: - -* ``Swift_Mime_SimpleMessage::PRIORITY_HIGHEST``: 1 -* ``Swift_Mime_SimpleMessage::PRIORITY_HIGH``: 2 -* ``Swift_Mime_SimpleMessage::PRIORITY_NORMAL``: 3 -* ``Swift_Mime_SimpleMessage::PRIORITY_LOW``: 4 -* ``Swift_Mime_SimpleMessage::PRIORITY_LOWEST``: 5 - -:: - - // Or use the constant to be more explicit - $message->setPriority(Swift_Mime_SimpleMessage::PRIORITY_HIGH); diff --git a/vendor/swiftmailer/swiftmailer/doc/plugins.rst b/vendor/swiftmailer/swiftmailer/doc/plugins.rst deleted file mode 100644 index 548b07f..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/plugins.rst +++ /dev/null @@ -1,337 +0,0 @@ -Plugins -======= - -Plugins exist to extend, or modify the behaviour of Swift Mailer. They respond -to Events that are fired within the Transports during sending. - -There are a number of Plugins provided as part of the base Swift Mailer package -and they all follow a common interface to respond to Events fired within the -library. Interfaces are provided to "listen" to each type of Event fired and to -act as desired when a listened-to Event occurs. - -Although several plugins are provided with Swift Mailer out-of-the-box, the -Events system has been specifically designed to make it easy for experienced -object-oriented developers to write their own plugins in order to achieve -goals that may not be possible with the base library. - -AntiFlood Plugin ----------------- - -Many SMTP servers have limits on the number of messages that may be sent during -any single SMTP connection. The AntiFlood plugin provides a way to stay within -this limit while still managing a large number of emails. - -A typical limit for a single connection is 100 emails. If the server you -connect to imposes such a limit, it expects you to disconnect after that number -of emails has been sent. You could manage this manually within a loop, but the -AntiFlood plugin provides the necessary wrapper code so that you don't need to -worry about this logic. - -Regardless of limits imposed by the server, it's usually a good idea to be -conservative with the resources of the SMTP server. Sending will become -sluggish if the server is being over-used so using the AntiFlood plugin will -not be a bad idea even if no limits exist. - -The AntiFlood plugin's logic is basically to disconnect and the immediately -re-connect with the SMTP server every X number of emails sent, where X is a -number you specify to the plugin. - -You can also specify a time period in seconds that Swift Mailer should pause -for between the disconnect/re-connect process. It's a good idea to pause for a -short time (say 30 seconds every 100 emails) simply to give the SMTP server a -chance to process its queue and recover some resources. - -Using the AntiFlood Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The AntiFlood Plugin -- like all plugins -- is added with the Mailer class's -``registerPlugin()`` method. It takes two constructor parameters: the number of -emails to pause after, and optionally the number of seconds to pause for. - -When Swift Mailer sends messages it will count the number of messages that have -been sent since the last re-connect. Once the number hits your specified -threshold it will disconnect and re-connect, optionally pausing for a specified -amount of time:: - - // Create the Mailer using any Transport - $mailer = new Swift_Mailer( - new Swift_SmtpTransport('smtp.example.org', 25) - ); - - // Use AntiFlood to re-connect after 100 emails - $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100)); - - // And specify a time in seconds to pause for (30 secs) - $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100, 30)); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - -Throttler Plugin ----------------- - -If your SMTP server has restrictions in place to limit the rate at which you -send emails, then your code will need to be aware of this rate-limiting. The -Throttler plugin makes Swift Mailer run at a rate-limited speed. - -Many shared hosts don't open their SMTP servers as a free-for-all. Usually they -have policies in place (probably to discourage spammers) that only allow you to -send a fixed number of emails per-hour/day. - -The Throttler plugin supports two modes of rate-limiting and with each, you -will need to do that math to figure out the values you want. The plugin can -limit based on the number of emails per minute, or the number of -bytes-transferred per-minute. - -Using the Throttler Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Throttler Plugin -- like all plugins -- is added with the Mailer class' -``registerPlugin()`` method. It has two required constructor parameters that -tell it how to do its rate-limiting. - -When Swift Mailer sends messages it will keep track of the rate at which -sending messages is occurring. If it realises that sending is happening too -fast, it will cause your program to ``sleep()`` for enough time to average out -the rate:: - - // Create the Mailer using any Transport - $mailer = new Swift_Mailer( - new Swift_SmtpTransport('smtp.example.org', 25) - ); - - // Rate limit to 100 emails per-minute - $mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin( - 100, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE - )); - - // Rate limit to 10MB per-minute - $mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin( - 1024 * 1024 * 10, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE - )); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - -Logger Plugin -------------- - -The Logger plugins helps with debugging during the process of sending. It can -help to identify why an SMTP server is rejecting addresses, or any other -hard-to-find problems that may arise. - -The Logger plugin comes in two parts. There's the plugin itself, along with one -of a number of possible Loggers that you may choose to use. For example, the -logger may output messages directly in realtime, or it may capture messages in -an array. - -One other notable feature is the way in which the Logger plugin changes -Exception messages. If Exceptions are being thrown but the error message does -not provide conclusive information as to the source of the problem (such as an -ambiguous SMTP error) the Logger plugin includes the entire SMTP transcript in -the error message so that debugging becomes a simpler task. - -There are a few available Loggers included with Swift Mailer, but writing your -own implementation is incredibly simple and is achieved by creating a short -class that implements the ``Swift_Plugins_Logger`` interface. - -* ``Swift_Plugins_Loggers_ArrayLogger``: Keeps a collection of log messages - inside an array. The array content can be cleared or dumped out to the screen. - -* ``Swift_Plugins_Loggers_EchoLogger``: Prints output to the screen in - realtime. Handy for very rudimentary debug output. - -Using the Logger Plugin -~~~~~~~~~~~~~~~~~~~~~~~ - -The Logger Plugin -- like all plugins -- is added with the Mailer class' -``registerPlugin()`` method. It accepts an instance of ``Swift_Plugins_Logger`` -in its constructor. - -When Swift Mailer sends messages it will keep a log of all the interactions -with the underlying Transport being used. Depending upon the Logger that has -been used the behaviour will differ, but all implementations offer a way to get -the contents of the log:: - - // Create the Mailer using any Transport - $mailer = new Swift_Mailer( - new Swift_SmtpTransport('smtp.example.org', 25) - ); - - // To use the ArrayLogger - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); - - // Or to use the Echo Logger - $logger = new Swift_Plugins_Loggers_EchoLogger(); - $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); - - // Continue sending as normal - for ($lotsOfRecipients as $recipient) { - ... - - $mailer->send( ... ); - } - - // Dump the log contents - // NOTE: The EchoLogger dumps in realtime so dump() does nothing for it - echo $logger->dump(); - -Decorator Plugin ----------------- - -Often there's a need to send the same message to multiple recipients, but with -tiny variations such as the recipient's name being used inside the message -body. The Decorator plugin aims to provide a solution for allowing these small -differences. - -The decorator plugin works by intercepting the sending process of Swift Mailer, -reading the email address in the To: field and then looking up a set of -replacements for a template. - -While the use of this plugin is simple, it is probably the most commonly -misunderstood plugin due to the way in which it works. The typical mistake -users make is to try registering the plugin multiple times (once for each -recipient) -- inside a loop for example. This is incorrect. - -The Decorator plugin should be registered just once, but containing the list of -all recipients prior to sending. It will use this list of recipients to find -the required replacements during sending. - -Using the Decorator Plugin -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To use the Decorator plugin, simply create an associative array of replacements -based on email addresses and then use the mailer's ``registerPlugin()`` method -to add the plugin. - -First create an associative array of replacements based on the email addresses -you'll be sending the message to. - -.. note:: - - The replacements array becomes a 2-dimensional array whose keys are the - email addresses and whose values are an associative array of replacements - for that email address. The curly braces used in this example can be any - type of syntax you choose, provided they match the placeholders in your - email template:: - - $replacements = []; - foreach ($users as $user) { - $replacements[$user['email']] = [ - '{username}'=>$user['username'], - '{resetcode}'=>$user['resetcode'] - ]; - } - -Now create an instance of the Decorator plugin using this array of replacements -and then register it with the Mailer. Do this only once! - -:: - - $decorator = new Swift_Plugins_DecoratorPlugin($replacements); - - $mailer->registerPlugin($decorator); - -When you create your message, replace elements in the body (and/or the subject -line) with your placeholders:: - - $message = (new Swift_Message()) - ->setSubject('Important notice for {username}') - ->setBody( - "Hello {username}, you requested to reset your password.\n" . - "Please visit https://example.com/pwreset and use the reset code {resetcode} to set a new password." - ) - ; - - foreach ($users as $user) { - $message->addTo($user['email']); - } - -When you send this message to each of your recipients listed in your -``$replacements`` array they will receive a message customized for just -themselves. For example, the message used above when received may appear like -this to one user: - -.. code-block:: text - - Subject: Important notice for smilingsunshine2009 - - Hello smilingsunshine2009, you requested to reset your password. - Please visit https://example.com/pwreset and use the reset code 183457 to set a new password. - -While another use may receive the message as: - -.. code-block:: text - - Subject: Important notice for billy-bo-bob - - Hello billy-bo-bob, you requested to reset your password. - Please visit https://example.com/pwreset and use the reset code 539127 to set a new password. - -While the decorator plugin provides a means to solve this problem, there are -various ways you could tackle this problem without the need for a plugin. We're -trying to come up with a better way ourselves and while we have several -(obvious) ideas we don't quite have the perfect solution to go ahead and -implement it. Watch this space. - -Providing Your Own Replacements Lookup for the Decorator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Filling an array with replacements may not be the best solution for providing -replacement information to the decorator. If you have a more elegant algorithm -that performs replacement lookups on-the-fly you may provide your own -implementation. - -Providing your own replacements lookup implementation for the Decorator is -simply a matter of passing an instance of -``Swift_Plugins_Decorator_Replacements`` to the decorator plugin's constructor, -rather than passing in an array. - -The Replacements interface is very simple to implement since it has just one -method: ``getReplacementsFor($address)``. - -Imagine you want to look up replacements from a database on-the-fly, you might -provide an implementation that does this. You need to create a small class:: - - class DbReplacements implements Swift_Plugins_Decorator_Replacements { - public function getReplacementsFor($address) { - global $db; // Your PDO instance with a connection to your database - $query = $db->prepare( - "SELECT * FROM `users` WHERE `email` = ?" - ); - - $query->execute([$address]); - - if ($row = $query->fetch(PDO::FETCH_ASSOC)) { - return [ - '{username}'=>$row['username'], - '{resetcode}'=>$row['resetcode'] - ]; - } - } - } - -Now all you need to do is pass an instance of your class into the Decorator -plugin's constructor instead of passing an array:: - - $decorator = new Swift_Plugins_DecoratorPlugin(new DbReplacements()); - - $mailer->registerPlugin($decorator); - -For each message sent, the plugin will call your class' -``getReplacementsFor()`` method to find the array of replacements it needs. - -.. note:: - - If your lookup algorithm is case sensitive, you should transform the - ``$address`` argument as appropriate -- for example by passing it through - ``strtolower()``. diff --git a/vendor/swiftmailer/swiftmailer/doc/sending.rst b/vendor/swiftmailer/swiftmailer/doc/sending.rst deleted file mode 100644 index 0104207..0000000 --- a/vendor/swiftmailer/swiftmailer/doc/sending.rst +++ /dev/null @@ -1,453 +0,0 @@ -Sending Messages -================ - -Quick Reference for Sending a Message -------------------------------------- - -Sending a message is very straightforward. You create a Transport, use it to -create the Mailer, then you use the Mailer to send the message. - -When using ``send()`` the message will be sent just like it would be sent if -you used your mail client. An integer is returned which includes the number of -successful recipients. If none of the recipients could be sent to then zero -will be returned, which equates to a boolean ``false``. If you set two ``To:`` -recipients and three ``Bcc:`` recipients in the message and all of the -recipients are delivered to successfully then the value 5 will be returned:: - - // Create the Transport - $transport = (new Swift_SmtpTransport('smtp.example.org', 25)) - ->setUsername('your username') - ->setPassword('your password') - ; - - /* - You could alternatively use a different transport such as Sendmail: - - // Sendmail - $transport = new Swift_SendmailTransport('/usr/sbin/sendmail -bs'); - */ - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - - // Create a message - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself') - ; - - // Send the message - $result = $mailer->send($message); - -Transport Types -~~~~~~~~~~~~~~~ - -Transports are the classes in Swift Mailer that are responsible for -communicating with a service in order to deliver a Message. There are several -types of Transport in Swift Mailer, all of which implement the -``Swift_Transport`` interface:: - -* ``Swift_SmtpTransport``: Sends messages over SMTP; Supports Authentication; - Supports Encryption. Very portable; Pleasingly predictable results; Provides - good feedback; - -* ``Swift_SendmailTransport``: Communicates with a locally installed - ``sendmail`` executable (Linux/UNIX). Quick time-to-run; Provides - less-accurate feedback than SMTP; Requires ``sendmail`` installation; - -* ``Swift_LoadBalancedTransport``: Cycles through a collection of the other - Transports to manage load-reduction. Provides graceful fallback if one - Transport fails (e.g. an SMTP server is down); Keeps the load on remote - services down by spreading the work; - -* ``Swift_FailoverTransport``: Works in conjunction with a collection of the - other Transports to provide high-availability. Provides graceful fallback if - one Transport fails (e.g. an SMTP server is down). - -The SMTP Transport -.................. - -The SMTP Transport sends messages over the (standardized) Simple Message -Transfer Protocol. It can deal with encryption and authentication. - -The SMTP Transport, ``Swift_SmtpTransport`` is without doubt the most commonly -used Transport because it will work on 99% of web servers (I just made that -number up, but you get the idea). All the server needs is the ability to -connect to a remote (or even local) SMTP server on the correct port number -(usually 25). - -SMTP servers often require users to authenticate with a username and password -before any mail can be sent to other domains. This is easily achieved using -Swift Mailer with the SMTP Transport. - -SMTP is a protocol -- in other words it's a "way" of communicating a job to be -done (i.e. sending a message). The SMTP protocol is the fundamental basis on -which messages are delivered all over the internet 7 days a week, 365 days a -year. For this reason it's the most "direct" method of sending messages you can -use and it's the one that will give you the most power and feedback (such as -delivery failures) when using Swift Mailer. - -Because SMTP is generally run as a remote service (i.e. you connect to it over -the network/internet) it's extremely portable from server-to-server. You can -easily store the SMTP server address and port number in a configuration file -within your application and adjust the settings accordingly if the code is -moved or if the SMTP server is changed. - -Some SMTP servers -- Google for example -- use encryption for security reasons. -Swift Mailer supports using both SSL and TLS encryption settings. - -Using the SMTP Transport -^^^^^^^^^^^^^^^^^^^^^^^^ - -The SMTP Transport is easy to use. Most configuration options can be set with -the constructor. - -To use the SMTP Transport you need to know which SMTP server your code needs to -connect to. Ask your web host if you're not sure. Lots of people ask me who to -connect to -- I really can't answer that since it's a setting that's extremely -specific to your hosting environment. - -A connection to the SMTP server will be established upon the first call to -``send()``:: - - // Create the Transport - $transport = new Swift_SmtpTransport('smtp.example.org', 25); - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - - /* - It's also possible to use multiple method calls - - $transport = (new Swift_SmtpTransport()) - ->setHost('smtp.example.org') - ->setPort(25) - ; - */ - -Encrypted SMTP -^^^^^^^^^^^^^^ - -You can use SSL or TLS encryption with the SMTP Transport by specifying it as a -parameter or with a method call:: - - // Create the Transport - $transport = new Swift_SmtpTransport('smtp.example.org', 587, 'ssl'); - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - -A connection to the SMTP server will be established upon the first call to -``send()``. The connection will be initiated with the correct encryption -settings. - -.. note:: - - For SSL or TLS encryption to work your PHP installation must have - appropriate OpenSSL transports wrappers. You can check if "tls" and/or - "ssl" are present in your PHP installation by using the PHP function - ``stream_get_transports()``. - -.. note:: - If you are using Mailcatcher_, make sure you do not set the encryption - for the ``Swift_SmtpTransport``, since Mailcatcher does not support encryption. - -SMTP with a Username and Password -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Some servers require authentication. You can provide a username and password -with ``setUsername()`` and ``setPassword()`` methods:: - - // Create the Transport the call setUsername() and setPassword() - $transport = (new Swift_SmtpTransport('smtp.example.org', 25)) - ->setUsername('username') - ->setPassword('password') - ; - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - -Your username and password will be used to authenticate upon first connect when -``send()`` are first used on the Mailer. - -If authentication fails, an Exception of type ``Swift_TransportException`` will -be thrown. - -.. note:: - - If you need to know early whether or not authentication has failed and an - Exception is going to be thrown, call the ``start()`` method on the - created Transport. - -The Sendmail Transport -...................... - -The Sendmail Transport sends messages by communicating with a locally installed -MTA -- such as ``sendmail``. - -The Sendmail Transport, ``Swift_SendmailTransport`` does not directly connect -to any remote services. It is designed for Linux servers that have ``sendmail`` -installed. The Transport starts a local ``sendmail`` process and sends messages -to it. Usually the ``sendmail`` process will respond quickly as it spools your -messages to disk before sending them. - -The Transport is named the Sendmail Transport for historical reasons -(``sendmail`` was the "standard" UNIX tool for sending e-mail for years). It -will send messages using other transfer agents such as Exim or Postfix despite -its name, provided they have the relevant sendmail wrappers so that they can be -started with the correct command-line flags. - -It's a common misconception that because the Sendmail Transport returns a -result very quickly it must therefore deliver messages to recipients quickly -- -this is not true. It's not slow by any means, but it's certainly not faster -than SMTP when it comes to getting messages to the intended recipients. This is -because sendmail itself sends the messages over SMTP once they have been -quickly spooled to disk. - -The Sendmail Transport has the potential to be just as smart of the SMTP -Transport when it comes to notifying Swift Mailer about which recipients were -rejected, but in reality the majority of locally installed ``sendmail`` -instances are not configured well enough to provide any useful feedback. As -such Swift Mailer may report successful deliveries where they did in fact fail -before they even left your server. - -You can run the Sendmail Transport in two different modes specified by command -line flags: - -* "``-bs``" runs in SMTP mode so theoretically it will act like the SMTP - Transport - -* "``-t``" runs in piped mode with no feedback, but theoretically faster, - though not advised - -You can think of the Sendmail Transport as a sort of asynchronous SMTP -Transport -- though if you have problems with delivery failures you should try -using the SMTP Transport instead. Swift Mailer isn't doing the work here, it's -simply passing the work to somebody else (i.e. ``sendmail``). - -Using the Sendmail Transport -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -To use the Sendmail Transport you simply need to call ``new -Swift_SendmailTransport()`` with the command as a parameter. - -To use the Sendmail Transport you need to know where ``sendmail`` or another -MTA exists on the server. Swift Mailer uses a default value of -``/usr/sbin/sendmail``, which should work on most systems. - -You specify the entire command as a parameter (i.e. including the command line -flags). Swift Mailer supports operational modes of "``-bs``" (default) and -"``-t``". - -.. note:: - - If you run sendmail in "``-t``" mode you will get no feedback as to whether - or not sending has succeeded. Use "``-bs``" unless you have a reason not to. - -A sendmail process will be started upon the first call to ``send()``. If the -process cannot be started successfully an Exception of type -``Swift_TransportException`` will be thrown:: - - // Create the Transport - $transport = new Swift_SendmailTransport('/usr/sbin/exim -bs'); - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - -Available Methods for Sending Messages -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Mailer class offers one method for sending Messages -- ``send()``. - -When a message is sent in Swift Mailer, the Mailer class communicates with -whichever Transport class you have chosen to use. - -Each recipient in the message should either be accepted or rejected by the -Transport. For example, if the domain name on the email address is not -reachable the SMTP Transport may reject the address because it cannot process -it. ``send()`` will return an integer indicating the number of accepted -recipients. - -.. note:: - - It's possible to find out which recipients were rejected -- we'll cover that - later in this chapter. - -Using the ``send()`` Method -........................... - -The ``send()`` method of the ``Swift_Mailer`` class sends a message using -exactly the same logic as your Desktop mail client would use. Just pass it a -Message and get a result. - -The message will be sent just like it would be sent if you used your mail -client. An integer is returned which includes the number of successful -recipients. If none of the recipients could be sent to then zero will be -returned, which equates to a boolean ``false``. If you set two -``To:`` recipients and three ``Bcc:`` recipients in the message and all of the -recipients are delivered to successfully then the value 5 will be returned:: - - // Create the Transport - $transport = new Swift_SmtpTransport('localhost', 25); - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - - // Create a message - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself') - ; - - // Send the message - $numSent = $mailer->send($message); - - printf("Sent %d messages\n", $numSent); - - /* Note that often that only the boolean equivalent of the - return value is of concern (zero indicates FALSE) - - if ($mailer->send($message)) - { - echo "Sent\n"; - } - else - { - echo "Failed\n"; - } - - */ - -Sending Emails in Batch -....................... - -If you want to send a separate message to each recipient so that only their own -address shows up in the ``To:`` field, follow the following recipe: - -* Create a Transport from one of the provided Transports -- - ``Swift_SmtpTransport``, ``Swift_SendmailTransport``, - or one of the aggregate Transports. - -* Create an instance of the ``Swift_Mailer`` class, using the Transport as - it's constructor parameter. - -* Create a Message. - -* Iterate over the recipients and send message via the ``send()`` method on - the Mailer object. - -Each recipient of the messages receives a different copy with only their own -email address on the ``To:`` field. - -Make sure to add only valid email addresses as recipients. If you try to add an -invalid email address with ``setTo()``, ``setCc()`` or ``setBcc()``, Swift -Mailer will throw a ``Swift_RfcComplianceException``. - -If you add recipients automatically based on a data source that may contain -invalid email addresses, you can prevent possible exceptions by validating the -addresses using ``Egulias\EmailValidator\EmailValidator`` (a dependency that is -installed with Swift Mailer) and only adding addresses that validate. Another -way would be to wrap your ``setTo()``, ``setCc()`` and ``setBcc()`` calls in a -try-catch block and handle the ``Swift_RfcComplianceException`` in the catch -block. - -Handling invalid addresses properly is especially important when sending emails -in large batches since a single invalid address might cause an unhandled -exception and stop the execution or your script early. - -.. note:: - - In the following example, two emails are sent. One to each of - ``receiver@domain.org`` and ``other@domain.org``. These recipients will - not be aware of each other:: - - // Create the Transport - $transport = new Swift_SmtpTransport('localhost', 25); - - // Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - - // Create a message - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setBody('Here is the message itself') - ; - - // Send the message - $failedRecipients = []; - $numSent = 0; - $to = ['receiver@domain.org', 'other@domain.org' => 'A name']; - - foreach ($to as $address => $name) - { - if (is_int($address)) { - $message->setTo($name); - } else { - $message->setTo([$address => $name]); - } - - $numSent += $mailer->send($message, $failedRecipients); - } - - printf("Sent %d messages\n", $numSent); - -Finding out Rejected Addresses -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It's possible to get a list of addresses that were rejected by the Transport by -using a by-reference parameter to ``send()``. - -As Swift Mailer attempts to send the message to each address given to it, if a -recipient is rejected it will be added to the array. You can pass an existing -array, otherwise one will be created by-reference. - -Collecting the list of recipients that were rejected can be useful in -circumstances where you need to "prune" a mailing list for example when some -addresses cannot be delivered to. - -Getting Failures By-reference -............................. - -Collecting delivery failures by-reference with the ``send()`` method is as -simple as passing a variable name to the method call:: - - $mailer = new Swift_Mailer( ... ); - - $message = (new Swift_Message( ... )) - ->setFrom( ... ) - ->setTo([ - 'receiver@bad-domain.org' => 'Receiver Name', - 'other@domain.org' => 'A name', - 'other-receiver@bad-domain.org' => 'Other Name' - )) - ->setBody( ... ) - ; - - // Pass a variable name to the send() method - if (!$mailer->send($message, $failures)) - { - echo "Failures:"; - print_r($failures); - } - - /* - Failures: - Array ( - 0 => receiver@bad-domain.org, - 1 => other-receiver@bad-domain.org - ) - */ - -If the Transport rejects any of the recipients, the culprit addresses will be -added to the array provided by-reference. - -.. note:: - - If the variable name does not yet exist, it will be initialized as an - empty array and then failures will be added to that array. If the variable - already exists it will be type-cast to an array and failures will be added - to it. - -.. _Mailcatcher: https://mailcatcher.me/ diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php deleted file mode 100644 index ddb7bb2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php +++ /dev/null @@ -1,78 +0,0 @@ -address = $address; - } - - public function getAddress(): string - { - return $this->address; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php deleted file mode 100644 index 7a1420f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php +++ /dev/null @@ -1,54 +0,0 @@ -createDependenciesFor('mime.attachment') - ); - - $this->setBody($data, $contentType); - $this->setFilename($filename); - } - - /** - * Create a new Attachment from a filesystem path. - * - * @param string $path - * @param string $contentType optional - * - * @return self - */ - public static function fromPath($path, $contentType = null) - { - return (new self())->setFile( - new Swift_ByteStream_FileByteStream($path), - $contentType - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php deleted file mode 100644 index 3a69c15..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php +++ /dev/null @@ -1,176 +0,0 @@ -filters[$key] = $filter; - } - - /** - * Remove an already present StreamFilter based on its $key. - * - * @param string $key - */ - public function removeFilter($key) - { - unset($this->filters[$key]); - } - - /** - * Writes $bytes to the end of the stream. - * - * @param string $bytes - * - * @throws Swift_IoException - * - * @return int - */ - public function write($bytes) - { - $this->writeBuffer .= $bytes; - foreach ($this->filters as $filter) { - if ($filter->shouldBuffer($this->writeBuffer)) { - return; - } - } - $this->doWrite($this->writeBuffer); - - return ++$this->sequence; - } - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - * - * @throws Swift_IoException - */ - public function commit() - { - $this->doWrite($this->writeBuffer); - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - */ - public function bind(Swift_InputByteStream $is) - { - $this->mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->mirrors as $k => $stream) { - if ($is === $stream) { - if ('' !== $this->writeBuffer) { - $stream->write($this->writeBuffer); - } - unset($this->mirrors[$k]); - } - } - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * - * @throws Swift_IoException - */ - public function flushBuffers() - { - if ('' !== $this->writeBuffer) { - $this->doWrite($this->writeBuffer); - } - $this->flush(); - - foreach ($this->mirrors as $stream) { - $stream->flushBuffers(); - } - } - - /** Run $bytes through all filters */ - private function filter($bytes) - { - foreach ($this->filters as $filter) { - $bytes = $filter->filter($bytes); - } - - return $bytes; - } - - /** Just write the bytes to the stream */ - private function doWrite($bytes) - { - $this->doCommit($this->filter($bytes)); - - foreach ($this->mirrors as $stream) { - $stream->write($bytes); - } - - $this->writeBuffer = ''; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php deleted file mode 100644 index 4f3dcc3..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php +++ /dev/null @@ -1,178 +0,0 @@ -array = $stack; - $this->arraySize = \count($stack); - } elseif (\is_string($stack)) { - $this->write($stack); - } else { - $this->array = []; - } - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. - * - * If less bytes exist than are requested the - * remaining bytes are given instead. If no bytes are remaining at all, boolean - * false is returned. - * - * @param int $length - * - * @return string - */ - public function read($length) - { - if ($this->offset == $this->arraySize) { - return false; - } - - // Don't use array slice - $end = $length + $this->offset; - $end = $this->arraySize < $end ? $this->arraySize : $end; - $ret = ''; - for (; $this->offset < $end; ++$this->offset) { - $ret .= $this->array[$this->offset]; - } - - return $ret; - } - - /** - * Writes $bytes to the end of the stream. - * - * @param string $bytes - */ - public function write($bytes) - { - $to_add = str_split($bytes); - foreach ($to_add as $value) { - $this->array[] = $value; - } - $this->arraySize = \count($this->array); - - foreach ($this->mirrors as $stream) { - $stream->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - */ - public function bind(Swift_InputByteStream $is) - { - $this->mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->mirrors as $k => $stream) { - if ($is === $stream) { - unset($this->mirrors[$k]); - } - } - } - - /** - * Move the internal read pointer to $byteOffset in the stream. - * - * @param int $byteOffset - * - * @return bool - */ - public function setReadPointer($byteOffset) - { - if ($byteOffset > $this->arraySize) { - $byteOffset = $this->arraySize; - } elseif ($byteOffset < 0) { - $byteOffset = 0; - } - - $this->offset = $byteOffset; - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - */ - public function flushBuffers() - { - $this->offset = 0; - $this->array = []; - $this->arraySize = 0; - - foreach ($this->mirrors as $stream) { - $stream->flushBuffers(); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php deleted file mode 100644 index f639121..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php +++ /dev/null @@ -1,214 +0,0 @@ -path = $path; - $this->mode = $writable ? 'w+b' : 'rb'; - } - - /** - * Get the complete path to the file. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. - * - * If less bytes exist than are requested the - * remaining bytes are given instead. If no bytes are remaining at all, boolean - * false is returned. - * - * @param int $length - * - * @return string|bool - * - * @throws Swift_IoException - */ - public function read($length) - { - $fp = $this->getReadHandle(); - if (!feof($fp)) { - $bytes = fread($fp, $length); - $this->offset = ftell($fp); - - // If we read one byte after reaching the end of the file - // feof() will return false and an empty string is returned - if ((false === $bytes || '' === $bytes) && feof($fp)) { - $this->resetReadHandle(); - - return false; - } - - return $bytes; - } - - $this->resetReadHandle(); - - return false; - } - - /** - * Move the internal read pointer to $byteOffset in the stream. - * - * @param int $byteOffset - * - * @return bool - */ - public function setReadPointer($byteOffset) - { - if (isset($this->reader)) { - $this->seekReadStreamToPosition($byteOffset); - } - $this->offset = $byteOffset; - } - - /** Just write the bytes to the file */ - protected function doCommit($bytes) - { - fwrite($this->getWriteHandle(), $bytes); - $this->resetReadHandle(); - } - - /** Not used */ - protected function flush() - { - } - - /** Get the resource for reading */ - private function getReadHandle() - { - if (!isset($this->reader)) { - $pointer = @fopen($this->path, 'rb'); - if (!$pointer) { - throw new Swift_IoException('Unable to open file for reading ['.$this->path.']'); - } - $this->reader = $pointer; - if (0 != $this->offset) { - $this->getReadStreamSeekableStatus(); - $this->seekReadStreamToPosition($this->offset); - } - } - - return $this->reader; - } - - /** Get the resource for writing */ - private function getWriteHandle() - { - if (!isset($this->writer)) { - if (!$this->writer = fopen($this->path, $this->mode)) { - throw new Swift_IoException('Unable to open file for writing ['.$this->path.']'); - } - } - - return $this->writer; - } - - /** Force a reload of the resource for reading */ - private function resetReadHandle() - { - if (isset($this->reader)) { - fclose($this->reader); - $this->reader = null; - } - } - - /** Check if ReadOnly Stream is seekable */ - private function getReadStreamSeekableStatus() - { - $metas = stream_get_meta_data($this->reader); - $this->seekable = $metas['seekable']; - } - - /** Streams in a readOnly stream ensuring copy if needed */ - private function seekReadStreamToPosition($offset) - { - if (null === $this->seekable) { - $this->getReadStreamSeekableStatus(); - } - if (false === $this->seekable) { - $currentPos = ftell($this->reader); - if ($currentPos < $offset) { - $toDiscard = $offset - $currentPos; - fread($this->reader, $toDiscard); - - return; - } - $this->copyReadStream(); - } - fseek($this->reader, $offset, SEEK_SET); - } - - /** Copy a readOnly Stream to ensure seekability */ - private function copyReadStream() - { - if ($tmpFile = fopen('php://temp/maxmemory:4096', 'w+b')) { - /* We have opened a php:// Stream Should work without problem */ - } elseif (\function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir()) && ($tmpFile = tmpfile())) { - /* We have opened a tmpfile */ - } else { - throw new Swift_IoException('Unable to copy the file to make it seekable, sys_temp_dir is not writable, php://memory not available'); - } - $currentPos = ftell($this->reader); - fclose($this->reader); - $source = fopen($this->path, 'rb'); - if (!$source) { - throw new Swift_IoException('Unable to open file for copying ['.$this->path.']'); - } - fseek($tmpFile, 0, SEEK_SET); - while (!feof($source)) { - fwrite($tmpFile, fread($source, 4096)); - } - fseek($tmpFile, $currentPos, SEEK_SET); - fclose($source); - $this->reader = $tmpFile; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php deleted file mode 100644 index 0dc6190..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php +++ /dev/null @@ -1,52 +0,0 @@ -getPath()))) { - throw new Swift_IoException('Failed to get temporary file content.'); - } - - return $content; - } - - public function __destruct() - { - if (file_exists($this->getPath())) { - @unlink($this->getPath()); - } - } - - public function __sleep() - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php deleted file mode 100644 index 4267adb..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php +++ /dev/null @@ -1,67 +0,0 @@ - - */ -interface Swift_CharacterReader -{ - const MAP_TYPE_INVALID = 0x01; - const MAP_TYPE_FIXED_LEN = 0x02; - const MAP_TYPE_POSITIONS = 0x03; - - /** - * Returns the complete character map. - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars); - - /** - * Returns the mapType, see constants. - * - * @return int - */ - public function getMapType(); - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param int[] $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size); - - /** - * Returns the number of bytes which should be read to start each character. - * - * For fixed width character sets this should be the number of octets-per-character. - * For multibyte character sets this will probably be 1. - * - * @return int - */ - public function getInitialByteSize(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php deleted file mode 100644 index 3e055af..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class Swift_CharacterReader_GenericFixedWidthReader implements Swift_CharacterReader -{ - /** - * The number of bytes in a single character. - * - * @var int - */ - private $width; - - /** - * Creates a new GenericFixedWidthReader using $width bytes per character. - * - * @param int $width - */ - public function __construct($width) - { - $this->width = $width; - } - - /** - * Returns the complete character map. - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) - { - $strlen = \strlen($string); - // % and / are CPU intensive, so, maybe find a better way - $ignored = $strlen % $this->width; - $ignoredChars = $ignored ? substr($string, -$ignored) : ''; - $currentMap = $this->width; - - return ($strlen - $ignored) / $this->width; - } - - /** - * Returns the mapType. - * - * @return int - */ - public function getMapType() - { - return self::MAP_TYPE_FIXED_LEN; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param string $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size) - { - $needed = $this->width - $size; - - return $needed > -1 ? $needed : -1; - } - - /** - * Returns the number of bytes which should be read to start each character. - * - * @return int - */ - public function getInitialByteSize() - { - return $this->width; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php deleted file mode 100644 index ffc05f7..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php +++ /dev/null @@ -1,84 +0,0 @@ - "\x07F") { - // Invalid char - $currentMap[$i + $startOffset] = $string[$i]; - } - } - - return $strlen; - } - - /** - * Returns mapType. - * - * @return int mapType - */ - public function getMapType() - { - return self::MAP_TYPE_INVALID; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param string $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size) - { - $byte = reset($bytes); - if (1 == \count($bytes) && $byte >= 0x00 && $byte <= 0x7F) { - return 0; - } - - return -1; - } - - /** - * Returns the number of bytes which should be read to start each character. - * - * @return int - */ - public function getInitialByteSize() - { - return 1; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php deleted file mode 100644 index da37e0d..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php +++ /dev/null @@ -1,176 +0,0 @@ - - */ -class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader -{ - /** Pre-computed for optimization */ - private static $length_map = [ - // N=0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x0N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x1N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x2N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x3N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x4N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x5N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x6N - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x7N - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x8N - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x9N - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xAN - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xBN - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xCN - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xDN - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xEN - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, // 0xFN - ]; - - private static $s_length_map = [ - "\x00" => 1, "\x01" => 1, "\x02" => 1, "\x03" => 1, "\x04" => 1, "\x05" => 1, "\x06" => 1, "\x07" => 1, - "\x08" => 1, "\x09" => 1, "\x0a" => 1, "\x0b" => 1, "\x0c" => 1, "\x0d" => 1, "\x0e" => 1, "\x0f" => 1, - "\x10" => 1, "\x11" => 1, "\x12" => 1, "\x13" => 1, "\x14" => 1, "\x15" => 1, "\x16" => 1, "\x17" => 1, - "\x18" => 1, "\x19" => 1, "\x1a" => 1, "\x1b" => 1, "\x1c" => 1, "\x1d" => 1, "\x1e" => 1, "\x1f" => 1, - "\x20" => 1, "\x21" => 1, "\x22" => 1, "\x23" => 1, "\x24" => 1, "\x25" => 1, "\x26" => 1, "\x27" => 1, - "\x28" => 1, "\x29" => 1, "\x2a" => 1, "\x2b" => 1, "\x2c" => 1, "\x2d" => 1, "\x2e" => 1, "\x2f" => 1, - "\x30" => 1, "\x31" => 1, "\x32" => 1, "\x33" => 1, "\x34" => 1, "\x35" => 1, "\x36" => 1, "\x37" => 1, - "\x38" => 1, "\x39" => 1, "\x3a" => 1, "\x3b" => 1, "\x3c" => 1, "\x3d" => 1, "\x3e" => 1, "\x3f" => 1, - "\x40" => 1, "\x41" => 1, "\x42" => 1, "\x43" => 1, "\x44" => 1, "\x45" => 1, "\x46" => 1, "\x47" => 1, - "\x48" => 1, "\x49" => 1, "\x4a" => 1, "\x4b" => 1, "\x4c" => 1, "\x4d" => 1, "\x4e" => 1, "\x4f" => 1, - "\x50" => 1, "\x51" => 1, "\x52" => 1, "\x53" => 1, "\x54" => 1, "\x55" => 1, "\x56" => 1, "\x57" => 1, - "\x58" => 1, "\x59" => 1, "\x5a" => 1, "\x5b" => 1, "\x5c" => 1, "\x5d" => 1, "\x5e" => 1, "\x5f" => 1, - "\x60" => 1, "\x61" => 1, "\x62" => 1, "\x63" => 1, "\x64" => 1, "\x65" => 1, "\x66" => 1, "\x67" => 1, - "\x68" => 1, "\x69" => 1, "\x6a" => 1, "\x6b" => 1, "\x6c" => 1, "\x6d" => 1, "\x6e" => 1, "\x6f" => 1, - "\x70" => 1, "\x71" => 1, "\x72" => 1, "\x73" => 1, "\x74" => 1, "\x75" => 1, "\x76" => 1, "\x77" => 1, - "\x78" => 1, "\x79" => 1, "\x7a" => 1, "\x7b" => 1, "\x7c" => 1, "\x7d" => 1, "\x7e" => 1, "\x7f" => 1, - "\x80" => 0, "\x81" => 0, "\x82" => 0, "\x83" => 0, "\x84" => 0, "\x85" => 0, "\x86" => 0, "\x87" => 0, - "\x88" => 0, "\x89" => 0, "\x8a" => 0, "\x8b" => 0, "\x8c" => 0, "\x8d" => 0, "\x8e" => 0, "\x8f" => 0, - "\x90" => 0, "\x91" => 0, "\x92" => 0, "\x93" => 0, "\x94" => 0, "\x95" => 0, "\x96" => 0, "\x97" => 0, - "\x98" => 0, "\x99" => 0, "\x9a" => 0, "\x9b" => 0, "\x9c" => 0, "\x9d" => 0, "\x9e" => 0, "\x9f" => 0, - "\xa0" => 0, "\xa1" => 0, "\xa2" => 0, "\xa3" => 0, "\xa4" => 0, "\xa5" => 0, "\xa6" => 0, "\xa7" => 0, - "\xa8" => 0, "\xa9" => 0, "\xaa" => 0, "\xab" => 0, "\xac" => 0, "\xad" => 0, "\xae" => 0, "\xaf" => 0, - "\xb0" => 0, "\xb1" => 0, "\xb2" => 0, "\xb3" => 0, "\xb4" => 0, "\xb5" => 0, "\xb6" => 0, "\xb7" => 0, - "\xb8" => 0, "\xb9" => 0, "\xba" => 0, "\xbb" => 0, "\xbc" => 0, "\xbd" => 0, "\xbe" => 0, "\xbf" => 0, - "\xc0" => 2, "\xc1" => 2, "\xc2" => 2, "\xc3" => 2, "\xc4" => 2, "\xc5" => 2, "\xc6" => 2, "\xc7" => 2, - "\xc8" => 2, "\xc9" => 2, "\xca" => 2, "\xcb" => 2, "\xcc" => 2, "\xcd" => 2, "\xce" => 2, "\xcf" => 2, - "\xd0" => 2, "\xd1" => 2, "\xd2" => 2, "\xd3" => 2, "\xd4" => 2, "\xd5" => 2, "\xd6" => 2, "\xd7" => 2, - "\xd8" => 2, "\xd9" => 2, "\xda" => 2, "\xdb" => 2, "\xdc" => 2, "\xdd" => 2, "\xde" => 2, "\xdf" => 2, - "\xe0" => 3, "\xe1" => 3, "\xe2" => 3, "\xe3" => 3, "\xe4" => 3, "\xe5" => 3, "\xe6" => 3, "\xe7" => 3, - "\xe8" => 3, "\xe9" => 3, "\xea" => 3, "\xeb" => 3, "\xec" => 3, "\xed" => 3, "\xee" => 3, "\xef" => 3, - "\xf0" => 4, "\xf1" => 4, "\xf2" => 4, "\xf3" => 4, "\xf4" => 4, "\xf5" => 4, "\xf6" => 4, "\xf7" => 4, - "\xf8" => 5, "\xf9" => 5, "\xfa" => 5, "\xfb" => 5, "\xfc" => 6, "\xfd" => 6, "\xfe" => 0, "\xff" => 0, - ]; - - /** - * Returns the complete character map. - * - * @param string $string - * @param int $startOffset - * @param array $currentMap - * @param mixed $ignoredChars - * - * @return int - */ - public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) - { - if (!isset($currentMap['i']) || !isset($currentMap['p'])) { - $currentMap['p'] = $currentMap['i'] = []; - } - - $strlen = \strlen($string); - $charPos = \count($currentMap['p']); - $foundChars = 0; - $invalid = false; - for ($i = 0; $i < $strlen; ++$i) { - $char = $string[$i]; - $size = self::$s_length_map[$char]; - if (0 == $size) { - /* char is invalid, we must wait for a resync */ - $invalid = true; - continue; - } else { - if (true === $invalid) { - /* We mark the chars as invalid and start a new char */ - $currentMap['p'][$charPos + $foundChars] = $startOffset + $i; - $currentMap['i'][$charPos + $foundChars] = true; - ++$foundChars; - $invalid = false; - } - if (($i + $size) > $strlen) { - $ignoredChars = substr($string, $i); - break; - } - for ($j = 1; $j < $size; ++$j) { - $char = $string[$i + $j]; - if ($char > "\x7F" && $char < "\xC0") { - // Valid - continue parsing - } else { - /* char is invalid, we must wait for a resync */ - $invalid = true; - continue 2; - } - } - /* Ok we got a complete char here */ - $currentMap['p'][$charPos + $foundChars] = $startOffset + $i + $size; - $i += $j - 1; - ++$foundChars; - } - } - - return $foundChars; - } - - /** - * Returns mapType. - * - * @return int mapType - */ - public function getMapType() - { - return self::MAP_TYPE_POSITIONS; - } - - /** - * Returns an integer which specifies how many more bytes to read. - * - * A positive integer indicates the number of more bytes to fetch before invoking - * this method again. - * A value of zero means this is already a valid character. - * A value of -1 means this cannot possibly be a valid character. - * - * @param string $bytes - * @param int $size - * - * @return int - */ - public function validateByteSequence($bytes, $size) - { - if ($size < 1) { - return -1; - } - $needed = self::$length_map[$bytes[0]] - $size; - - return $needed > -1 ? $needed : -1; - } - - /** - * Returns the number of bytes which should be read to start each character. - * - * @return int - */ - public function getInitialByteSize() - { - return 1; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php deleted file mode 100644 index 15b6c69..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php +++ /dev/null @@ -1,26 +0,0 @@ -init(); - } - - public function __wakeup() - { - $this->init(); - } - - public function init() - { - if (\count(self::$map) > 0) { - return; - } - - $prefix = 'Swift_CharacterReader_'; - - $singleByte = [ - 'class' => $prefix.'GenericFixedWidthReader', - 'constructor' => [1], - ]; - - $doubleByte = [ - 'class' => $prefix.'GenericFixedWidthReader', - 'constructor' => [2], - ]; - - $fourBytes = [ - 'class' => $prefix.'GenericFixedWidthReader', - 'constructor' => [4], - ]; - - // Utf-8 - self::$map['utf-?8'] = [ - 'class' => $prefix.'Utf8Reader', - 'constructor' => [], - ]; - - //7-8 bit charsets - self::$map['(us-)?ascii'] = $singleByte; - self::$map['(iso|iec)-?8859-?[0-9]+'] = $singleByte; - self::$map['windows-?125[0-9]'] = $singleByte; - self::$map['cp-?[0-9]+'] = $singleByte; - self::$map['ansi'] = $singleByte; - self::$map['macintosh'] = $singleByte; - self::$map['koi-?7'] = $singleByte; - self::$map['koi-?8-?.+'] = $singleByte; - self::$map['mik'] = $singleByte; - self::$map['(cork|t1)'] = $singleByte; - self::$map['v?iscii'] = $singleByte; - - //16 bits - self::$map['(ucs-?2|utf-?16)'] = $doubleByte; - - //32 bits - self::$map['(ucs-?4|utf-?32)'] = $fourBytes; - - // Fallback - self::$map['.*'] = $singleByte; - } - - /** - * Returns a CharacterReader suitable for the charset applied. - * - * @param string $charset - * - * @return Swift_CharacterReader - */ - public function getReaderFor($charset) - { - $charset = strtolower(trim($charset)); - foreach (self::$map as $pattern => $spec) { - $re = '/^'.$pattern.'$/D'; - if (preg_match($re, $charset)) { - if (!\array_key_exists($pattern, self::$loaded)) { - $reflector = new ReflectionClass($spec['class']); - if ($reflector->getConstructor()) { - $reader = $reflector->newInstanceArgs($spec['constructor']); - } else { - $reader = $reflector->newInstance(); - } - self::$loaded[$pattern] = $reader; - } - - return self::$loaded[$pattern]; - } - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php deleted file mode 100644 index c9d8a07..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php +++ /dev/null @@ -1,87 +0,0 @@ -setCharacterReaderFactory($factory); - $this->setCharacterSet($charset); - } - - /** - * Set the character set used in this CharacterStream. - * - * @param string $charset - */ - public function setCharacterSet($charset) - { - $this->charset = $charset; - $this->charReader = null; - } - - /** - * Set the CharacterReaderFactory for multi charset support. - */ - public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) - { - $this->charReaderFactory = $factory; - } - - /** - * Overwrite this character stream using the byte sequence in the byte stream. - * - * @param Swift_OutputByteStream $os output stream to read from - */ - public function importByteStream(Swift_OutputByteStream $os) - { - if (!isset($this->charReader)) { - $this->charReader = $this->charReaderFactory - ->getReaderFor($this->charset); - } - - $startLength = $this->charReader->getInitialByteSize(); - while (false !== $bytes = $os->read($startLength)) { - $c = []; - for ($i = 0, $len = \strlen($bytes); $i < $len; ++$i) { - $c[] = self::$byteMap[$bytes[$i]]; - } - $size = \count($c); - $need = $this->charReader - ->validateByteSequence($c, $size); - if ($need > 0 && - false !== $bytes = $os->read($need)) { - for ($i = 0, $len = \strlen($bytes); $i < $len; ++$i) { - $c[] = self::$byteMap[$bytes[$i]]; - } - } - $this->array[] = $c; - ++$this->array_size; - } - } - - /** - * Import a string a bytes into this CharacterStream, overwriting any existing - * data in the stream. - * - * @param string $string - */ - public function importString($string) - { - $this->flushContents(); - $this->write($string); - } - - /** - * Read $length characters from the stream and move the internal pointer - * $length further into the stream. - * - * @param int $length - * - * @return string - */ - public function read($length) - { - if ($this->offset == $this->array_size) { - return false; - } - - // Don't use array slice - $arrays = []; - $end = $length + $this->offset; - for ($i = $this->offset; $i < $end; ++$i) { - if (!isset($this->array[$i])) { - break; - } - $arrays[] = $this->array[$i]; - } - $this->offset += $i - $this->offset; // Limit function calls - $chars = false; - foreach ($arrays as $array) { - $chars .= implode('', array_map('chr', $array)); - } - - return $chars; - } - - /** - * Read $length characters from the stream and return a 1-dimensional array - * containing there octet values. - * - * @param int $length - * - * @return int[] - */ - public function readBytes($length) - { - if ($this->offset == $this->array_size) { - return false; - } - $arrays = []; - $end = $length + $this->offset; - for ($i = $this->offset; $i < $end; ++$i) { - if (!isset($this->array[$i])) { - break; - } - $arrays[] = $this->array[$i]; - } - $this->offset += ($i - $this->offset); // Limit function calls - - return array_merge(...$arrays); - } - - /** - * Write $chars to the end of the stream. - * - * @param string $chars - */ - public function write($chars) - { - if (!isset($this->charReader)) { - $this->charReader = $this->charReaderFactory->getReaderFor( - $this->charset); - } - - $startLength = $this->charReader->getInitialByteSize(); - - $fp = fopen('php://memory', 'w+b'); - fwrite($fp, $chars); - unset($chars); - fseek($fp, 0, SEEK_SET); - - $buffer = [0]; - $buf_pos = 1; - $buf_len = 1; - $has_datas = true; - do { - $bytes = []; - // Buffer Filing - if ($buf_len - $buf_pos < $startLength) { - $buf = array_splice($buffer, $buf_pos); - $new = $this->reloadBuffer($fp, 100); - if ($new) { - $buffer = array_merge($buf, $new); - $buf_len = \count($buffer); - $buf_pos = 0; - } else { - $has_datas = false; - } - } - if ($buf_len - $buf_pos > 0) { - $size = 0; - for ($i = 0; $i < $startLength && isset($buffer[$buf_pos]); ++$i) { - ++$size; - $bytes[] = $buffer[$buf_pos++]; - } - $need = $this->charReader->validateByteSequence( - $bytes, $size); - if ($need > 0) { - if ($buf_len - $buf_pos < $need) { - $new = $this->reloadBuffer($fp, $need); - - if ($new) { - $buffer = array_merge($buffer, $new); - $buf_len = \count($buffer); - } - } - for ($i = 0; $i < $need && isset($buffer[$buf_pos]); ++$i) { - $bytes[] = $buffer[$buf_pos++]; - } - } - $this->array[] = $bytes; - ++$this->array_size; - } - } while ($has_datas); - - fclose($fp); - } - - /** - * Move the internal pointer to $charOffset in the stream. - * - * @param int $charOffset - */ - public function setPointer($charOffset) - { - if ($charOffset > $this->array_size) { - $charOffset = $this->array_size; - } elseif ($charOffset < 0) { - $charOffset = 0; - } - $this->offset = $charOffset; - } - - /** - * Empty the stream and reset the internal pointer. - */ - public function flushContents() - { - $this->offset = 0; - $this->array = []; - $this->array_size = 0; - } - - private function reloadBuffer($fp, $len) - { - if (!feof($fp) && false !== ($bytes = fread($fp, $len))) { - $buf = []; - for ($i = 0, $len = \strlen($bytes); $i < $len; ++$i) { - $buf[] = self::$byteMap[$bytes[$i]]; - } - - return $buf; - } - - return false; - } - - private static function initializeMaps() - { - if (!isset(self::$charMap)) { - self::$charMap = []; - for ($byte = 0; $byte < 256; ++$byte) { - self::$charMap[$byte] = \chr($byte); - } - self::$byteMap = array_flip(self::$charMap); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php deleted file mode 100644 index 7578dda..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php +++ /dev/null @@ -1,262 +0,0 @@ - - */ -class Swift_CharacterStream_NgCharacterStream implements Swift_CharacterStream -{ - /** - * The char reader (lazy-loaded) for the current charset. - * - * @var Swift_CharacterReader - */ - private $charReader; - - /** - * A factory for creating CharacterReader instances. - * - * @var Swift_CharacterReaderFactory - */ - private $charReaderFactory; - - /** - * The character set this stream is using. - * - * @var string - */ - private $charset; - - /** - * The data's stored as-is. - * - * @var string - */ - private $datas = ''; - - /** - * Number of bytes in the stream. - * - * @var int - */ - private $datasSize = 0; - - /** - * Map. - * - * @var mixed - */ - private $map; - - /** - * Map Type. - * - * @var int - */ - private $mapType = 0; - - /** - * Number of characters in the stream. - * - * @var int - */ - private $charCount = 0; - - /** - * Position in the stream. - * - * @var int - */ - private $currentPos = 0; - - /** - * Constructor. - * - * @param string $charset - */ - public function __construct(Swift_CharacterReaderFactory $factory, $charset) - { - $this->setCharacterReaderFactory($factory); - $this->setCharacterSet($charset); - } - - /* -- Changing parameters of the stream -- */ - - /** - * Set the character set used in this CharacterStream. - * - * @param string $charset - */ - public function setCharacterSet($charset) - { - $this->charset = $charset; - $this->charReader = null; - $this->mapType = 0; - } - - /** - * Set the CharacterReaderFactory for multi charset support. - */ - public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) - { - $this->charReaderFactory = $factory; - } - - /** - * @see Swift_CharacterStream::flushContents() - */ - public function flushContents() - { - $this->datas = null; - $this->map = null; - $this->charCount = 0; - $this->currentPos = 0; - $this->datasSize = 0; - } - - /** - * @see Swift_CharacterStream::importByteStream() - */ - public function importByteStream(Swift_OutputByteStream $os) - { - $this->flushContents(); - $blocks = 512; - $os->setReadPointer(0); - while (false !== ($read = $os->read($blocks))) { - $this->write($read); - } - } - - /** - * @see Swift_CharacterStream::importString() - * - * @param string $string - */ - public function importString($string) - { - $this->flushContents(); - $this->write($string); - } - - /** - * @see Swift_CharacterStream::read() - * - * @param int $length - * - * @return string - */ - public function read($length) - { - if ($this->currentPos >= $this->charCount) { - return false; - } - $ret = false; - $length = ($this->currentPos + $length > $this->charCount) ? $this->charCount - $this->currentPos : $length; - switch ($this->mapType) { - case Swift_CharacterReader::MAP_TYPE_FIXED_LEN: - $len = $length * $this->map; - $ret = substr($this->datas, - $this->currentPos * $this->map, - $len); - $this->currentPos += $length; - break; - - case Swift_CharacterReader::MAP_TYPE_INVALID: - $ret = ''; - for (; $this->currentPos < $length; ++$this->currentPos) { - if (isset($this->map[$this->currentPos])) { - $ret .= '?'; - } else { - $ret .= $this->datas[$this->currentPos]; - } - } - break; - - case Swift_CharacterReader::MAP_TYPE_POSITIONS: - $end = $this->currentPos + $length; - $end = $end > $this->charCount ? $this->charCount : $end; - $ret = ''; - $start = 0; - if ($this->currentPos > 0) { - $start = $this->map['p'][$this->currentPos - 1]; - } - $to = $start; - for (; $this->currentPos < $end; ++$this->currentPos) { - if (isset($this->map['i'][$this->currentPos])) { - $ret .= substr($this->datas, $start, $to - $start).'?'; - $start = $this->map['p'][$this->currentPos]; - } else { - $to = $this->map['p'][$this->currentPos]; - } - } - $ret .= substr($this->datas, $start, $to - $start); - break; - } - - return $ret; - } - - /** - * @see Swift_CharacterStream::readBytes() - * - * @param int $length - * - * @return int[] - */ - public function readBytes($length) - { - $read = $this->read($length); - if (false !== $read) { - $ret = array_map('ord', str_split($read, 1)); - - return $ret; - } - - return false; - } - - /** - * @see Swift_CharacterStream::setPointer() - * - * @param int $charOffset - */ - public function setPointer($charOffset) - { - if ($this->charCount < $charOffset) { - $charOffset = $this->charCount; - } - $this->currentPos = $charOffset; - } - - /** - * @see Swift_CharacterStream::write() - * - * @param string $chars - */ - public function write($chars) - { - if (!isset($this->charReader)) { - $this->charReader = $this->charReaderFactory->getReaderFor( - $this->charset); - $this->map = []; - $this->mapType = $this->charReader->getMapType(); - } - $ignored = ''; - $this->datas .= $chars; - $this->charCount += $this->charReader->getCharPositions(substr($this->datas, $this->datasSize), $this->datasSize, $this->map, $ignored); - if (false !== $ignored) { - $this->datasSize = \strlen($this->datas) - \strlen($ignored); - } else { - $this->datasSize = \strlen($this->datas); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php deleted file mode 100644 index a711bac..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ConfigurableSpool.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Base class for Spools (implements time and message limits). - * - * @author Fabien Potencier - */ -abstract class Swift_ConfigurableSpool implements Swift_Spool -{ - /** The maximum number of messages to send per flush */ - private $message_limit; - - /** The time limit per flush */ - private $time_limit; - - /** - * Sets the maximum number of messages to send per flush. - * - * @param int $limit - */ - public function setMessageLimit($limit) - { - $this->message_limit = (int) $limit; - } - - /** - * Gets the maximum number of messages to send per flush. - * - * @return int The limit - */ - public function getMessageLimit() - { - return $this->message_limit; - } - - /** - * Sets the time limit (in seconds) per flush. - * - * @param int $limit The limit - */ - public function setTimeLimit($limit) - { - $this->time_limit = (int) $limit; - } - - /** - * Gets the time limit (in seconds) per flush. - * - * @return int The limit - */ - public function getTimeLimit() - { - return $this->time_limit; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php deleted file mode 100644 index 3cc885e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php +++ /dev/null @@ -1,387 +0,0 @@ -store); - } - - /** - * Test if an item is registered in this container with the given name. - * - * @see register() - * - * @param string $itemName - * - * @return bool - */ - public function has($itemName) - { - return \array_key_exists($itemName, $this->store) - && isset($this->store[$itemName]['lookupType']); - } - - /** - * Lookup the item with the given $itemName. - * - * @see register() - * - * @param string $itemName - * - * @return mixed - * - * @throws Swift_DependencyException If the dependency is not found - */ - public function lookup($itemName) - { - if (!$this->has($itemName)) { - throw new Swift_DependencyException('Cannot lookup dependency "'.$itemName.'" since it is not registered.'); - } - - switch ($this->store[$itemName]['lookupType']) { - case self::TYPE_ALIAS: - return $this->createAlias($itemName); - case self::TYPE_VALUE: - return $this->getValue($itemName); - case self::TYPE_INSTANCE: - return $this->createNewInstance($itemName); - case self::TYPE_SHARED: - return $this->createSharedInstance($itemName); - case self::TYPE_ARRAY: - return $this->createDependenciesFor($itemName); - } - } - - /** - * Create an array of arguments passed to the constructor of $itemName. - * - * @param string $itemName - * - * @return array - */ - public function createDependenciesFor($itemName) - { - $args = []; - if (isset($this->store[$itemName]['args'])) { - $args = $this->resolveArgs($this->store[$itemName]['args']); - } - - return $args; - } - - /** - * Register a new dependency with $itemName. - * - * This method returns the current DependencyContainer instance because it - * requires the use of the fluid interface to set the specific details for the - * dependency. - * - * @see asNewInstanceOf(), asSharedInstanceOf(), asValue() - * - * @param string $itemName - * - * @return $this - */ - public function register($itemName) - { - $this->store[$itemName] = []; - $this->endPoint = &$this->store[$itemName]; - - return $this; - } - - /** - * Specify the previously registered item as a literal value. - * - * {@link register()} must be called before this will work. - * - * @param mixed $value - * - * @return $this - */ - public function asValue($value) - { - $endPoint = &$this->getEndPoint(); - $endPoint['lookupType'] = self::TYPE_VALUE; - $endPoint['value'] = $value; - - return $this; - } - - /** - * Specify the previously registered item as an alias of another item. - * - * @param string $lookup - * - * @return $this - */ - public function asAliasOf($lookup) - { - $endPoint = &$this->getEndPoint(); - $endPoint['lookupType'] = self::TYPE_ALIAS; - $endPoint['ref'] = $lookup; - - return $this; - } - - /** - * Specify the previously registered item as a new instance of $className. - * - * {@link register()} must be called before this will work. - * Any arguments can be set with {@link withDependencies()}, - * {@link addConstructorValue()} or {@link addConstructorLookup()}. - * - * @see withDependencies(), addConstructorValue(), addConstructorLookup() - * - * @param string $className - * - * @return $this - */ - public function asNewInstanceOf($className) - { - $endPoint = &$this->getEndPoint(); - $endPoint['lookupType'] = self::TYPE_INSTANCE; - $endPoint['className'] = $className; - - return $this; - } - - /** - * Specify the previously registered item as a shared instance of $className. - * - * {@link register()} must be called before this will work. - * - * @param string $className - * - * @return $this - */ - public function asSharedInstanceOf($className) - { - $endPoint = &$this->getEndPoint(); - $endPoint['lookupType'] = self::TYPE_SHARED; - $endPoint['className'] = $className; - - return $this; - } - - /** - * Specify the previously registered item as array of dependencies. - * - * {@link register()} must be called before this will work. - * - * @return $this - */ - public function asArray() - { - $endPoint = &$this->getEndPoint(); - $endPoint['lookupType'] = self::TYPE_ARRAY; - - return $this; - } - - /** - * Specify a list of injected dependencies for the previously registered item. - * - * This method takes an array of lookup names. - * - * @see addConstructorValue(), addConstructorLookup() - * - * @return $this - */ - public function withDependencies(array $lookups) - { - $endPoint = &$this->getEndPoint(); - $endPoint['args'] = []; - foreach ($lookups as $lookup) { - $this->addConstructorLookup($lookup); - } - - return $this; - } - - /** - * Specify a literal (non looked up) value for the constructor of the - * previously registered item. - * - * @see withDependencies(), addConstructorLookup() - * - * @param mixed $value - * - * @return $this - */ - public function addConstructorValue($value) - { - $endPoint = &$this->getEndPoint(); - if (!isset($endPoint['args'])) { - $endPoint['args'] = []; - } - $endPoint['args'][] = ['type' => 'value', 'item' => $value]; - - return $this; - } - - /** - * Specify a dependency lookup for the constructor of the previously - * registered item. - * - * @see withDependencies(), addConstructorValue() - * - * @param string $lookup - * - * @return $this - */ - public function addConstructorLookup($lookup) - { - $endPoint = &$this->getEndPoint(); - if (!isset($this->endPoint['args'])) { - $endPoint['args'] = []; - } - $endPoint['args'][] = ['type' => 'lookup', 'item' => $lookup]; - - return $this; - } - - /** Get the literal value with $itemName */ - private function getValue($itemName) - { - return $this->store[$itemName]['value']; - } - - /** Resolve an alias to another item */ - private function createAlias($itemName) - { - return $this->lookup($this->store[$itemName]['ref']); - } - - /** Create a fresh instance of $itemName */ - private function createNewInstance($itemName) - { - $reflector = new ReflectionClass($this->store[$itemName]['className']); - if ($reflector->getConstructor()) { - return $reflector->newInstanceArgs( - $this->createDependenciesFor($itemName) - ); - } - - return $reflector->newInstance(); - } - - /** Create and register a shared instance of $itemName */ - private function createSharedInstance($itemName) - { - if (!isset($this->store[$itemName]['instance'])) { - $this->store[$itemName]['instance'] = $this->createNewInstance($itemName); - } - - return $this->store[$itemName]['instance']; - } - - /** Get the current endpoint in the store */ - private function &getEndPoint() - { - if (!isset($this->endPoint)) { - throw new BadMethodCallException('Component must first be registered by calling register()'); - } - - return $this->endPoint; - } - - /** Get an argument list with dependencies resolved */ - private function resolveArgs(array $args) - { - $resolved = []; - foreach ($args as $argDefinition) { - switch ($argDefinition['type']) { - case 'lookup': - $resolved[] = $this->lookupRecursive($argDefinition['item']); - break; - case 'value': - $resolved[] = $argDefinition['item']; - break; - } - } - - return $resolved; - } - - /** Resolve a single dependency with an collections */ - private function lookupRecursive($item) - { - if (\is_array($item)) { - $collection = []; - foreach ($item as $k => $v) { - $collection[$k] = $this->lookupRecursive($v); - } - - return $collection; - } - - return $this->lookup($item); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php deleted file mode 100644 index 799d38d..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyException.php +++ /dev/null @@ -1,27 +0,0 @@ -createDependenciesFor('mime.embeddedfile') - ); - - $this->setBody($data); - $this->setFilename($filename); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Create a new EmbeddedFile from a filesystem path. - * - * @param string $path - * - * @return Swift_Mime_EmbeddedFile - */ - public static function fromPath($path) - { - return (new self())->setFile(new Swift_ByteStream_FileByteStream($path)); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php deleted file mode 100644 index 2073abc..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder.php +++ /dev/null @@ -1,28 +0,0 @@ -= $maxLineLength || 76 < $maxLineLength) { - $maxLineLength = 76; - } - - $encodedString = base64_encode($string); - $firstLine = ''; - - if (0 != $firstLineOffset) { - $firstLine = substr( - $encodedString, 0, $maxLineLength - $firstLineOffset - )."\r\n"; - $encodedString = substr( - $encodedString, $maxLineLength - $firstLineOffset - ); - } - - return $firstLine.trim(chunk_split($encodedString, $maxLineLength, "\r\n")); - } - - /** - * Does nothing. - */ - public function charsetChanged($charset) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php deleted file mode 100644 index f078d6d..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php +++ /dev/null @@ -1,300 +0,0 @@ - '=00', 1 => '=01', 2 => '=02', 3 => '=03', 4 => '=04', - 5 => '=05', 6 => '=06', 7 => '=07', 8 => '=08', 9 => '=09', - 10 => '=0A', 11 => '=0B', 12 => '=0C', 13 => '=0D', 14 => '=0E', - 15 => '=0F', 16 => '=10', 17 => '=11', 18 => '=12', 19 => '=13', - 20 => '=14', 21 => '=15', 22 => '=16', 23 => '=17', 24 => '=18', - 25 => '=19', 26 => '=1A', 27 => '=1B', 28 => '=1C', 29 => '=1D', - 30 => '=1E', 31 => '=1F', 32 => '=20', 33 => '=21', 34 => '=22', - 35 => '=23', 36 => '=24', 37 => '=25', 38 => '=26', 39 => '=27', - 40 => '=28', 41 => '=29', 42 => '=2A', 43 => '=2B', 44 => '=2C', - 45 => '=2D', 46 => '=2E', 47 => '=2F', 48 => '=30', 49 => '=31', - 50 => '=32', 51 => '=33', 52 => '=34', 53 => '=35', 54 => '=36', - 55 => '=37', 56 => '=38', 57 => '=39', 58 => '=3A', 59 => '=3B', - 60 => '=3C', 61 => '=3D', 62 => '=3E', 63 => '=3F', 64 => '=40', - 65 => '=41', 66 => '=42', 67 => '=43', 68 => '=44', 69 => '=45', - 70 => '=46', 71 => '=47', 72 => '=48', 73 => '=49', 74 => '=4A', - 75 => '=4B', 76 => '=4C', 77 => '=4D', 78 => '=4E', 79 => '=4F', - 80 => '=50', 81 => '=51', 82 => '=52', 83 => '=53', 84 => '=54', - 85 => '=55', 86 => '=56', 87 => '=57', 88 => '=58', 89 => '=59', - 90 => '=5A', 91 => '=5B', 92 => '=5C', 93 => '=5D', 94 => '=5E', - 95 => '=5F', 96 => '=60', 97 => '=61', 98 => '=62', 99 => '=63', - 100 => '=64', 101 => '=65', 102 => '=66', 103 => '=67', 104 => '=68', - 105 => '=69', 106 => '=6A', 107 => '=6B', 108 => '=6C', 109 => '=6D', - 110 => '=6E', 111 => '=6F', 112 => '=70', 113 => '=71', 114 => '=72', - 115 => '=73', 116 => '=74', 117 => '=75', 118 => '=76', 119 => '=77', - 120 => '=78', 121 => '=79', 122 => '=7A', 123 => '=7B', 124 => '=7C', - 125 => '=7D', 126 => '=7E', 127 => '=7F', 128 => '=80', 129 => '=81', - 130 => '=82', 131 => '=83', 132 => '=84', 133 => '=85', 134 => '=86', - 135 => '=87', 136 => '=88', 137 => '=89', 138 => '=8A', 139 => '=8B', - 140 => '=8C', 141 => '=8D', 142 => '=8E', 143 => '=8F', 144 => '=90', - 145 => '=91', 146 => '=92', 147 => '=93', 148 => '=94', 149 => '=95', - 150 => '=96', 151 => '=97', 152 => '=98', 153 => '=99', 154 => '=9A', - 155 => '=9B', 156 => '=9C', 157 => '=9D', 158 => '=9E', 159 => '=9F', - 160 => '=A0', 161 => '=A1', 162 => '=A2', 163 => '=A3', 164 => '=A4', - 165 => '=A5', 166 => '=A6', 167 => '=A7', 168 => '=A8', 169 => '=A9', - 170 => '=AA', 171 => '=AB', 172 => '=AC', 173 => '=AD', 174 => '=AE', - 175 => '=AF', 176 => '=B0', 177 => '=B1', 178 => '=B2', 179 => '=B3', - 180 => '=B4', 181 => '=B5', 182 => '=B6', 183 => '=B7', 184 => '=B8', - 185 => '=B9', 186 => '=BA', 187 => '=BB', 188 => '=BC', 189 => '=BD', - 190 => '=BE', 191 => '=BF', 192 => '=C0', 193 => '=C1', 194 => '=C2', - 195 => '=C3', 196 => '=C4', 197 => '=C5', 198 => '=C6', 199 => '=C7', - 200 => '=C8', 201 => '=C9', 202 => '=CA', 203 => '=CB', 204 => '=CC', - 205 => '=CD', 206 => '=CE', 207 => '=CF', 208 => '=D0', 209 => '=D1', - 210 => '=D2', 211 => '=D3', 212 => '=D4', 213 => '=D5', 214 => '=D6', - 215 => '=D7', 216 => '=D8', 217 => '=D9', 218 => '=DA', 219 => '=DB', - 220 => '=DC', 221 => '=DD', 222 => '=DE', 223 => '=DF', 224 => '=E0', - 225 => '=E1', 226 => '=E2', 227 => '=E3', 228 => '=E4', 229 => '=E5', - 230 => '=E6', 231 => '=E7', 232 => '=E8', 233 => '=E9', 234 => '=EA', - 235 => '=EB', 236 => '=EC', 237 => '=ED', 238 => '=EE', 239 => '=EF', - 240 => '=F0', 241 => '=F1', 242 => '=F2', 243 => '=F3', 244 => '=F4', - 245 => '=F5', 246 => '=F6', 247 => '=F7', 248 => '=F8', 249 => '=F9', - 250 => '=FA', 251 => '=FB', 252 => '=FC', 253 => '=FD', 254 => '=FE', - 255 => '=FF', - ]; - - protected static $safeMapShare = []; - - /** - * A map of non-encoded ascii characters. - * - * @var string[] - */ - protected $safeMap = []; - - /** - * Creates a new QpEncoder for the given CharacterStream. - * - * @param Swift_CharacterStream $charStream to use for reading characters - * @param Swift_StreamFilter $filter if input should be canonicalized - */ - public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null) - { - $this->charStream = $charStream; - if (!isset(self::$safeMapShare[$this->getSafeMapShareId()])) { - $this->initSafeMap(); - self::$safeMapShare[$this->getSafeMapShareId()] = $this->safeMap; - } else { - $this->safeMap = self::$safeMapShare[$this->getSafeMapShareId()]; - } - $this->filter = $filter; - } - - public function __sleep() - { - return ['charStream', 'filter']; - } - - public function __wakeup() - { - if (!isset(self::$safeMapShare[$this->getSafeMapShareId()])) { - $this->initSafeMap(); - self::$safeMapShare[$this->getSafeMapShareId()] = $this->safeMap; - } else { - $this->safeMap = self::$safeMapShare[$this->getSafeMapShareId()]; - } - } - - protected function getSafeMapShareId() - { - return static::class; - } - - protected function initSafeMap() - { - foreach (array_merge( - [0x09, 0x20], range(0x21, 0x3C), range(0x3E, 0x7E)) as $byte) { - $this->safeMap[$byte] = \chr($byte); - } - } - - /** - * Takes an unencoded string and produces a QP encoded string from it. - * - * QP encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - * - * @param string $string to encode - * @param int $firstLineOffset optional - * @param int $maxLineLength optional 0 indicates the default of 76 chars - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($maxLineLength > 76 || $maxLineLength <= 0) { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $lines = []; - $lNo = 0; - $lines[$lNo] = ''; - $currentLine = &$lines[$lNo++]; - $size = $lineLen = 0; - - $this->charStream->flushContents(); - $this->charStream->importString($string); - - // Fetching more than 4 chars at one is slower, as is fetching fewer bytes - // Conveniently 4 chars is the UTF-8 safe number since UTF-8 has up to 6 - // bytes per char and (6 * 4 * 3 = 72 chars per line) * =NN is 3 bytes - while (false !== $bytes = $this->nextSequence()) { - // If we're filtering the input - if (isset($this->filter)) { - // If we can't filter because we need more bytes - while ($this->filter->shouldBuffer($bytes)) { - // Then collect bytes into the buffer - if (false === $moreBytes = $this->nextSequence(1)) { - break; - } - - foreach ($moreBytes as $b) { - $bytes[] = $b; - } - } - // And filter them - $bytes = $this->filter->filter($bytes); - } - - $enc = $this->encodeByteSequence($bytes, $size); - - $i = strpos($enc, '=0D=0A'); - $newLineLength = $lineLen + (false === $i ? $size : $i); - - if ($currentLine && $newLineLength >= $thisLineLength) { - $lines[$lNo] = ''; - $currentLine = &$lines[$lNo++]; - $thisLineLength = $maxLineLength; - $lineLen = 0; - } - - $currentLine .= $enc; - - if (false === $i) { - $lineLen += $size; - } else { - // 6 is the length of '=0D=0A'. - $lineLen = $size - strrpos($enc, '=0D=0A') - 6; - } - } - - return $this->standardize(implode("=\r\n", $lines)); - } - - /** - * Updates the charset used. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->charStream->setCharacterSet($charset); - } - - /** - * Encode the given byte array into a verbatim QP form. - * - * @param int[] $bytes - * @param int $size - * - * @return string - */ - protected function encodeByteSequence(array $bytes, &$size) - { - $ret = ''; - $size = 0; - foreach ($bytes as $b) { - if (isset($this->safeMap[$b])) { - $ret .= $this->safeMap[$b]; - ++$size; - } else { - $ret .= self::$qpMap[$b]; - $size += 3; - } - } - - return $ret; - } - - /** - * Get the next sequence of bytes to read from the char stream. - * - * @param int $size number of bytes to read - * - * @return int[] - */ - protected function nextSequence($size = 4) - { - return $this->charStream->readBytes($size); - } - - /** - * Make sure CRLF is correct and HT/SPACE are in valid places. - * - * @param string $string - * - * @return string - */ - protected function standardize($string) - { - $string = str_replace(["\t=0D=0A", ' =0D=0A', '=0D=0A'], - ["=09\r\n", "=20\r\n", "\r\n"], $string - ); - switch ($end = \ord(substr($string, -1))) { - case 0x09: - case 0x20: - $string = substr_replace($string, self::$qpMap[$end], -1); - } - - return $string; - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->charStream = clone $this->charStream; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php deleted file mode 100644 index 7eac368..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php +++ /dev/null @@ -1,90 +0,0 @@ -charStream = $charStream; - } - - /** - * Takes an unencoded string and produces a string encoded according to - * RFC 2231 from it. - * - * @param string $string - * @param int $firstLineOffset - * @param int $maxLineLength optional, 0 indicates the default of 75 bytes - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - $lines = []; - $lineCount = 0; - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - - if (0 >= $maxLineLength) { - $maxLineLength = 75; - } - - $this->charStream->flushContents(); - $this->charStream->importString($string); - - $thisLineLength = $maxLineLength - $firstLineOffset; - - while (false !== $char = $this->charStream->read(4)) { - $encodedChar = rawurlencode($char); - if (0 != \strlen($currentLine) - && \strlen($currentLine.$encodedChar) > $thisLineLength) { - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - $thisLineLength = $maxLineLength; - } - $currentLine .= $encodedChar; - } - - return implode("\r\n", $lines); - } - - /** - * Updates the charset used. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->charStream->setCharacterSet($charset); - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->charStream = clone $this->charStream; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php deleted file mode 100644 index 18994c1..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandEvent.php +++ /dev/null @@ -1,64 +0,0 @@ -command = $command; - $this->successCodes = $successCodes; - } - - /** - * Get the command which was sent to the server. - * - * @return string - */ - public function getCommand() - { - return $this->command; - } - - /** - * Get the numeric response codes which indicate success for this command. - * - * @return int[] - */ - public function getSuccessCodes() - { - return $this->successCodes; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php deleted file mode 100644 index b158eab..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php +++ /dev/null @@ -1,22 +0,0 @@ -source = $source; - } - - /** - * Get the source object of this event. - * - * @return object - */ - public function getSource() - { - return $this->source; - } - - /** - * Prevent this Event from bubbling any further up the stack. - */ - public function cancelBubble($cancel = true) - { - $this->bubbleCancelled = $cancel; - } - - /** - * Returns true if this Event will not bubble any further up the stack. - * - * @return bool - */ - public function bubbleCancelled() - { - return $this->bubbleCancelled; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php deleted file mode 100644 index ff7c371..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php +++ /dev/null @@ -1,64 +0,0 @@ -response = $response; - $this->valid = $valid; - } - - /** - * Get the response which was received from the server. - * - * @return string - */ - public function getResponse() - { - return $this->response; - } - - /** - * Get the success status of this Event. - * - * @return bool - */ - public function isValid() - { - return $this->valid; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php deleted file mode 100644 index 85115a3..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php +++ /dev/null @@ -1,22 +0,0 @@ -message = $message; - $this->result = self::RESULT_PENDING; - } - - /** - * Get the Transport used to send the Message. - * - * @return Swift_Transport - */ - public function getTransport() - { - return $this->getSource(); - } - - /** - * Get the Message being sent. - * - * @return Swift_Mime_SimpleMessage - */ - public function getMessage() - { - return $this->message; - } - - /** - * Set the array of addresses that failed in sending. - * - * @param array $recipients - */ - public function setFailedRecipients($recipients) - { - $this->failedRecipients = $recipients; - } - - /** - * Get an recipient addresses which were not accepted for delivery. - * - * @return string[] - */ - public function getFailedRecipients() - { - return $this->failedRecipients; - } - - /** - * Set the result of sending. - * - * @param int $result - */ - public function setResult($result) - { - $this->result = $result; - } - - /** - * Get the result of this Event. - * - * The return value is a bitmask from - * {@see RESULT_PENDING, RESULT_SUCCESS, RESULT_TENTATIVE, RESULT_FAILED} - * - * @return int - */ - public function getResult() - { - return $this->result; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php deleted file mode 100644 index f7bf55e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php +++ /dev/null @@ -1,27 +0,0 @@ -eventMap = [ - 'Swift_Events_CommandEvent' => 'Swift_Events_CommandListener', - 'Swift_Events_ResponseEvent' => 'Swift_Events_ResponseListener', - 'Swift_Events_SendEvent' => 'Swift_Events_SendListener', - 'Swift_Events_TransportChangeEvent' => 'Swift_Events_TransportChangeListener', - 'Swift_Events_TransportExceptionEvent' => 'Swift_Events_TransportExceptionListener', - ]; - } - - /** - * Create a new SendEvent for $source and $message. - * - * @return Swift_Events_SendEvent - */ - public function createSendEvent(Swift_Transport $source, Swift_Mime_SimpleMessage $message) - { - return new Swift_Events_SendEvent($source, $message); - } - - /** - * Create a new CommandEvent for $source and $command. - * - * @param string $command That will be executed - * @param array $successCodes That are needed - * - * @return Swift_Events_CommandEvent - */ - public function createCommandEvent(Swift_Transport $source, $command, $successCodes = []) - { - return new Swift_Events_CommandEvent($source, $command, $successCodes); - } - - /** - * Create a new ResponseEvent for $source and $response. - * - * @param string $response - * @param bool $valid If the response is valid - * - * @return Swift_Events_ResponseEvent - */ - public function createResponseEvent(Swift_Transport $source, $response, $valid) - { - return new Swift_Events_ResponseEvent($source, $response, $valid); - } - - /** - * Create a new TransportChangeEvent for $source. - * - * @return Swift_Events_TransportChangeEvent - */ - public function createTransportChangeEvent(Swift_Transport $source) - { - return new Swift_Events_TransportChangeEvent($source); - } - - /** - * Create a new TransportExceptionEvent for $source. - * - * @return Swift_Events_TransportExceptionEvent - */ - public function createTransportExceptionEvent(Swift_Transport $source, Swift_TransportException $ex) - { - return new Swift_Events_TransportExceptionEvent($source, $ex); - } - - /** - * Bind an event listener to this dispatcher. - */ - public function bindEventListener(Swift_Events_EventListener $listener) - { - foreach ($this->listeners as $l) { - // Already loaded - if ($l === $listener) { - return; - } - } - $this->listeners[] = $listener; - } - - /** - * Dispatch the given Event to all suitable listeners. - * - * @param string $target method - */ - public function dispatchEvent(Swift_Events_EventObject $evt, $target) - { - $bubbleQueue = $this->prepareBubbleQueue($evt); - $this->bubble($bubbleQueue, $evt, $target); - } - - /** Queue listeners on a stack ready for $evt to be bubbled up it */ - private function prepareBubbleQueue(Swift_Events_EventObject $evt) - { - $bubbleQueue = []; - $evtClass = \get_class($evt); - foreach ($this->listeners as $listener) { - if (\array_key_exists($evtClass, $this->eventMap) - && ($listener instanceof $this->eventMap[$evtClass])) { - $bubbleQueue[] = $listener; - } - } - - return $bubbleQueue; - } - - /** Bubble $evt up the stack calling $target() on each listener */ - private function bubble(array &$bubbleQueue, Swift_Events_EventObject $evt, $target) - { - if (!$evt->bubbleCancelled() && $listener = array_shift($bubbleQueue)) { - $listener->$target($evt); - $this->bubble($bubbleQueue, $evt, $target); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php deleted file mode 100644 index a8972fd..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php +++ /dev/null @@ -1,27 +0,0 @@ -getSource(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php deleted file mode 100644 index 4a7492b..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php +++ /dev/null @@ -1,37 +0,0 @@ -exception = $ex; - } - - /** - * Get the TransportException thrown. - * - * @return Swift_TransportException - */ - public function getException() - { - return $this->exception; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php deleted file mode 100644 index ad80eb0..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php +++ /dev/null @@ -1,22 +0,0 @@ -createDependenciesFor('transport.failover') - ); - - $this->setTransports($transports); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php deleted file mode 100644 index 7af8471..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php +++ /dev/null @@ -1,208 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages on the filesystem. - * - * @author Fabien Potencier - * @author Xavier De Cock - */ -class Swift_FileSpool extends Swift_ConfigurableSpool -{ - /** The spool directory */ - private $path; - - /** - * File WriteRetry Limit. - * - * @var int - */ - private $retryLimit = 10; - - /** - * Create a new FileSpool. - * - * @param string $path - * - * @throws Swift_IoException - */ - public function __construct($path) - { - $this->path = $path; - - if (!file_exists($this->path)) { - if (!mkdir($this->path, 0777, true)) { - throw new Swift_IoException(sprintf('Unable to create path "%s".', $this->path)); - } - } - } - - /** - * Tests if this Spool mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Spool mechanism. - */ - public function start() - { - } - - /** - * Stops this Spool mechanism. - */ - public function stop() - { - } - - /** - * Allow to manage the enqueuing retry limit. - * - * Default, is ten and allows over 64^20 different fileNames - * - * @param int $limit - */ - public function setRetryLimit($limit) - { - $this->retryLimit = $limit; - } - - /** - * Queues a message. - * - * @param Swift_Mime_SimpleMessage $message The message to store - * - * @throws Swift_IoException - * - * @return bool - */ - public function queueMessage(Swift_Mime_SimpleMessage $message) - { - $ser = serialize($message); - $fileName = $this->path.'/'.$this->getRandomString(10); - for ($i = 0; $i < $this->retryLimit; ++$i) { - /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */ - $fp = @fopen($fileName.'.message', 'xb'); - if (false !== $fp) { - if (false === fwrite($fp, $ser)) { - return false; - } - - return fclose($fp); - } else { - /* The file already exists, we try a longer fileName */ - $fileName .= $this->getRandomString(1); - } - } - - throw new Swift_IoException(sprintf('Unable to create a file for enqueuing Message in "%s".', $this->path)); - } - - /** - * Execute a recovery if for any reason a process is sending for too long. - * - * @param int $timeout in second Defaults is for very slow smtp responses - */ - public function recover($timeout = 900) - { - foreach (new DirectoryIterator($this->path) as $file) { - $file = $file->getRealPath(); - - if ('.message.sending' == substr($file, -16)) { - $lockedtime = filectime($file); - if ((time() - $lockedtime) > $timeout) { - rename($file, substr($file, 0, -8)); - } - } - } - } - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent e-mail's - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) - { - $directoryIterator = new DirectoryIterator($this->path); - - /* Start the transport only if there are queued files to send */ - if (!$transport->isStarted()) { - foreach ($directoryIterator as $file) { - if ('.message' == substr($file->getRealPath(), -8)) { - $transport->start(); - break; - } - } - } - - $failedRecipients = (array) $failedRecipients; - $count = 0; - $time = time(); - foreach ($directoryIterator as $file) { - $file = $file->getRealPath(); - - if ('.message' != substr($file, -8)) { - continue; - } - - /* We try a rename, it's an atomic operation, and avoid locking the file */ - if (rename($file, $file.'.sending')) { - $message = unserialize(file_get_contents($file.'.sending')); - - $count += $transport->send($message, $failedRecipients); - - unlink($file.'.sending'); - } else { - /* This message has just been catched by another process */ - continue; - } - - if ($this->getMessageLimit() && $count >= $this->getMessageLimit()) { - break; - } - - if ($this->getTimeLimit() && (time() - $time) >= $this->getTimeLimit()) { - break; - } - } - - return $count; - } - - /** - * Returns a random string needed to generate a fileName for the queue. - * - * @param int $count - * - * @return string - */ - protected function getRandomString($count) - { - // This string MUST stay FS safe, avoid special chars - $base = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-'; - $ret = ''; - $strlen = \strlen($base); - for ($i = 0; $i < $count; ++$i) { - $ret .= $base[random_int(0, $strlen - 1)]; - } - - return $ret; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php deleted file mode 100644 index 0b24db1..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileStream.php +++ /dev/null @@ -1,24 +0,0 @@ -setFile(new Swift_ByteStream_FileByteStream($path)); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php deleted file mode 100644 index 379a5a1..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/InputByteStream.php +++ /dev/null @@ -1,75 +0,0 @@ -stream = $stream; - } - - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - $this->prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $this->contents[$nsKey][$itemKey] = $string; - break; - case self::MODE_APPEND: - if (!$this->hasKey($nsKey, $itemKey)) { - $this->contents[$nsKey][$itemKey] = ''; - } - $this->contents[$nsKey][$itemKey] .= $string; - break; - default: - throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); - } - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param int $mode - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - $this->prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $this->clearKey($nsKey, $itemKey); - // no break - case self::MODE_APPEND: - if (!$this->hasKey($nsKey, $itemKey)) { - $this->contents[$nsKey][$itemKey] = ''; - } - while (false !== $bytes = $os->read(8192)) { - $this->contents[$nsKey][$itemKey] .= $bytes; - } - break; - default: - throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); - } - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * - * NOTE: The stream will always write in append mode. - * - * @param string $nsKey - * @param string $itemKey - * - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - $is = clone $this->stream; - $is->setKeyCache($this); - $is->setNsKey($nsKey); - $is->setItemKey($itemKey); - if (isset($writeThrough)) { - $is->setWriteThroughStream($writeThrough); - } - - return $is; - } - - /** - * Get data back out of the cache as a string. - * - * @param string $nsKey - * @param string $itemKey - * - * @return string - */ - public function getString($nsKey, $itemKey) - { - $this->prepareCache($nsKey); - if ($this->hasKey($nsKey, $itemKey)) { - return $this->contents[$nsKey][$itemKey]; - } - } - - /** - * Get data back out of the cache as a ByteStream. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - $this->prepareCache($nsKey); - $is->write($this->getString($nsKey, $itemKey)); - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * - * @param string $nsKey - * @param string $itemKey - * - * @return bool - */ - public function hasKey($nsKey, $itemKey) - { - $this->prepareCache($nsKey); - - return \array_key_exists($itemKey, $this->contents[$nsKey]); - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - unset($this->contents[$nsKey][$itemKey]); - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * - * @param string $nsKey - */ - public function clearAll($nsKey) - { - unset($this->contents[$nsKey]); - } - - /** - * Initialize the namespace of $nsKey if needed. - * - * @param string $nsKey - */ - private function prepareCache($nsKey) - { - if (!\array_key_exists($nsKey, $this->contents)) { - $this->contents[$nsKey] = []; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php deleted file mode 100644 index 33b6367..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php +++ /dev/null @@ -1,294 +0,0 @@ -stream = $stream; - $this->path = $path; - } - - /** - * Set a string into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param string $string - * @param int $mode - * - * @throws Swift_IoException - */ - public function setString($nsKey, $itemKey, $string, $mode) - { - $this->prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_START); - break; - case self::MODE_APPEND: - $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_END); - break; - default: - throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); - break; - } - fwrite($fp, $string); - $this->freeHandle($nsKey, $itemKey); - } - - /** - * Set a ByteStream into the cache under $itemKey for the namespace $nsKey. - * - * @see MODE_WRITE, MODE_APPEND - * - * @param string $nsKey - * @param string $itemKey - * @param int $mode - * - * @throws Swift_IoException - */ - public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode) - { - $this->prepareCache($nsKey); - switch ($mode) { - case self::MODE_WRITE: - $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_START); - break; - case self::MODE_APPEND: - $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_END); - break; - default: - throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); - break; - } - while (false !== $bytes = $os->read(8192)) { - fwrite($fp, $bytes); - } - $this->freeHandle($nsKey, $itemKey); - } - - /** - * Provides a ByteStream which when written to, writes data to $itemKey. - * - * NOTE: The stream will always write in append mode. - * - * @param string $nsKey - * @param string $itemKey - * - * @return Swift_InputByteStream - */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) - { - $is = clone $this->stream; - $is->setKeyCache($this); - $is->setNsKey($nsKey); - $is->setItemKey($itemKey); - if (isset($writeThrough)) { - $is->setWriteThroughStream($writeThrough); - } - - return $is; - } - - /** - * Get data back out of the cache as a string. - * - * @param string $nsKey - * @param string $itemKey - * - * @throws Swift_IoException - * - * @return string - */ - public function getString($nsKey, $itemKey) - { - $this->prepareCache($nsKey); - if ($this->hasKey($nsKey, $itemKey)) { - $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_START); - $str = ''; - while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { - $str .= $bytes; - } - $this->freeHandle($nsKey, $itemKey); - - return $str; - } - } - - /** - * Get data back out of the cache as a ByteStream. - * - * @param string $nsKey - * @param string $itemKey - * @param Swift_InputByteStream $is to write the data to - */ - public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) - { - if ($this->hasKey($nsKey, $itemKey)) { - $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_START); - while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { - $is->write($bytes); - } - $this->freeHandle($nsKey, $itemKey); - } - } - - /** - * Check if the given $itemKey exists in the namespace $nsKey. - * - * @param string $nsKey - * @param string $itemKey - * - * @return bool - */ - public function hasKey($nsKey, $itemKey) - { - return is_file($this->path.'/'.$nsKey.'/'.$itemKey); - } - - /** - * Clear data for $itemKey in the namespace $nsKey if it exists. - * - * @param string $nsKey - * @param string $itemKey - */ - public function clearKey($nsKey, $itemKey) - { - if ($this->hasKey($nsKey, $itemKey)) { - $this->freeHandle($nsKey, $itemKey); - unlink($this->path.'/'.$nsKey.'/'.$itemKey); - } - } - - /** - * Clear all data in the namespace $nsKey if it exists. - * - * @param string $nsKey - */ - public function clearAll($nsKey) - { - if (\array_key_exists($nsKey, $this->keys)) { - foreach ($this->keys[$nsKey] as $itemKey => $null) { - $this->clearKey($nsKey, $itemKey); - } - if (is_dir($this->path.'/'.$nsKey)) { - rmdir($this->path.'/'.$nsKey); - } - unset($this->keys[$nsKey]); - } - } - - /** - * Initialize the namespace of $nsKey if needed. - * - * @param string $nsKey - */ - private function prepareCache($nsKey) - { - $cacheDir = $this->path.'/'.$nsKey; - if (!is_dir($cacheDir)) { - if (!mkdir($cacheDir)) { - throw new Swift_IoException('Failed to create cache directory '.$cacheDir); - } - $this->keys[$nsKey] = []; - } - } - - /** - * Get a file handle on the cache item. - * - * @param string $nsKey - * @param string $itemKey - * @param int $position - * - * @return resource - */ - private function getHandle($nsKey, $itemKey, $position) - { - if (!isset($this->keys[$nsKey][$itemKey])) { - $openMode = $this->hasKey($nsKey, $itemKey) ? 'r+b' : 'w+b'; - $fp = fopen($this->path.'/'.$nsKey.'/'.$itemKey, $openMode); - $this->keys[$nsKey][$itemKey] = $fp; - } - if (self::POSITION_START == $position) { - fseek($this->keys[$nsKey][$itemKey], 0, SEEK_SET); - } elseif (self::POSITION_END == $position) { - fseek($this->keys[$nsKey][$itemKey], 0, SEEK_END); - } - - return $this->keys[$nsKey][$itemKey]; - } - - private function freeHandle($nsKey, $itemKey) - { - $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_CURRENT); - fclose($fp); - $this->keys[$nsKey][$itemKey] = null; - } - - /** - * Destructor. - */ - public function __destruct() - { - foreach ($this->keys as $nsKey => $null) { - $this->clearAll($nsKey); - } - } - - public function __wakeup() - { - $this->keys = []; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php deleted file mode 100644 index be2dbba..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php +++ /dev/null @@ -1,47 +0,0 @@ -keyCache = $keyCache; - } - - /** - * Specify a stream to write through for each write(). - */ - public function setWriteThroughStream(Swift_InputByteStream $is) - { - $this->writeThrough = $is; - } - - /** - * Writes $bytes to the end of the stream. - * - * @param string $bytes - * @param Swift_InputByteStream $is optional - */ - public function write($bytes, Swift_InputByteStream $is = null) - { - $this->keyCache->setString( - $this->nsKey, $this->itemKey, $bytes, Swift_KeyCache::MODE_APPEND - ); - if (isset($is)) { - $is->write($bytes); - } - if (isset($this->writeThrough)) { - $this->writeThrough->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Not used. - */ - public function bind(Swift_InputByteStream $is) - { - } - - /** - * Not used. - */ - public function unbind(Swift_InputByteStream $is) - { - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - */ - public function flushBuffers() - { - $this->keyCache->clearKey($this->nsKey, $this->itemKey); - } - - /** - * Set the nsKey which will be written to. - * - * @param string $nsKey - */ - public function setNsKey($nsKey) - { - $this->nsKey = $nsKey; - } - - /** - * Set the itemKey which will be written to. - * - * @param string $itemKey - */ - public function setItemKey($itemKey) - { - $this->itemKey = $itemKey; - } - - /** - * Any implementation should be cloneable, allowing the clone to access a - * separate $nsKey and $itemKey. - */ - public function __clone() - { - $this->writeThrough = null; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php deleted file mode 100644 index 244b5f6..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php +++ /dev/null @@ -1,33 +0,0 @@ -createDependenciesFor('transport.loadbalanced') - ); - - $this->setTransports($transports); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php deleted file mode 100644 index 5763007..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php +++ /dev/null @@ -1,98 +0,0 @@ -transport = $transport; - } - - /** - * Create a new class instance of one of the message services. - * - * For example 'mimepart' would create a 'message.mimepart' instance - * - * @param string $service - * - * @return object - */ - public function createMessage($service = 'message') - { - return Swift_DependencyContainer::getInstance() - ->lookup('message.'.$service); - } - - /** - * Send the given Message like it would be sent in a mail client. - * - * All recipients (with the exception of Bcc) will be able to see the other - * recipients this message was sent to. - * - * Recipient/sender data will be retrieved from the Message object. - * - * The return value is the number of recipients who were accepted for - * delivery. - * - * @param array $failedRecipients An array of failures by-reference - * - * @return int The number of successful recipients. Can be 0 which indicates failure - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - - // FIXME: to be removed in 7.0 (as transport must now start itself on send) - if (!$this->transport->isStarted()) { - $this->transport->start(); - } - - $sent = 0; - - try { - $sent = $this->transport->send($message, $failedRecipients); - } catch (Swift_RfcComplianceException $e) { - foreach ($message->getTo() as $address => $name) { - $failedRecipients[] = $address; - } - } - - return $sent; - } - - /** - * Register a plugin using a known unique key (e.g. myPlugin). - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->transport->registerPlugin($plugin); - } - - /** - * The Transport used to send messages. - * - * @return Swift_Transport - */ - public function getTransport() - { - return $this->transport; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php deleted file mode 100644 index 19aa82a..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php +++ /dev/null @@ -1,53 +0,0 @@ -recipients = $recipients; - } - - /** - * Returns true only if there are more recipients to send to. - * - * @return bool - */ - public function hasNext() - { - return !empty($this->recipients); - } - - /** - * Returns an array where the keys are the addresses of recipients and the - * values are the names. e.g. ('foo@bar' => 'Foo') or ('foo@bar' => NULL). - * - * @return array - */ - public function nextRecipient() - { - return array_splice($this->recipients, 0, 1); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php deleted file mode 100644 index 650f3ec..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - 'Foo') or ('foo@bar' => NULL). - * - * @return array - */ - public function nextRecipient(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php deleted file mode 100644 index e3b0894..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MemorySpool.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in memory. - * - * @author Fabien Potencier - */ -class Swift_MemorySpool implements Swift_Spool -{ - protected $messages = []; - private $flushRetries = 3; - - /** - * Tests if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * @param int $retries - */ - public function setFlushRetries($retries) - { - $this->flushRetries = $retries; - } - - /** - * Stores a message in the queue. - * - * @param Swift_Mime_SimpleMessage $message The message to store - * - * @return bool Whether the operation has succeeded - */ - public function queueMessage(Swift_Mime_SimpleMessage $message) - { - //clone the message to make sure it is not changed while in the queue - $this->messages[] = clone $message; - - return true; - } - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) - { - if (!$this->messages) { - return 0; - } - - if (!$transport->isStarted()) { - $transport->start(); - } - - $count = 0; - $retries = $this->flushRetries; - while ($retries--) { - try { - while ($message = array_pop($this->messages)) { - $count += $transport->send($message, $failedRecipients); - } - } catch (Swift_TransportException $exception) { - if ($retries) { - // re-queue the message at the end of the queue to give a chance - // to the other messages to be sent, in case the failure was due to - // this message and not just the transport failing - array_unshift($this->messages, $message); - - // wait half a second before we try again - usleep(500000); - } else { - throw $exception; - } - } - } - - return $count; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php deleted file mode 100644 index 819ffc3..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php +++ /dev/null @@ -1,279 +0,0 @@ -createDependenciesFor('mime.message') - ); - - if (!isset($charset)) { - $charset = Swift_DependencyContainer::getInstance() - ->lookup('properties.charset'); - } - $this->setSubject($subject); - $this->setBody($body); - $this->setCharset($charset); - if ($contentType) { - $this->setContentType($contentType); - } - } - - /** - * Add a MimePart to this Message. - * - * @param string|Swift_OutputByteStream $body - * @param string $contentType - * @param string $charset - * - * @return $this - */ - public function addPart($body, $contentType = null, $charset = null) - { - return $this->attach((new Swift_MimePart($body, $contentType, $charset))->setEncoder($this->getEncoder())); - } - - /** - * Attach a new signature handler to the message. - * - * @return $this - */ - public function attachSigner(Swift_Signer $signer) - { - if ($signer instanceof Swift_Signers_HeaderSigner) { - $this->headerSigners[] = $signer; - } elseif ($signer instanceof Swift_Signers_BodySigner) { - $this->bodySigners[] = $signer; - } - - return $this; - } - - /** - * Detach a signature handler from a message. - * - * @return $this - */ - public function detachSigner(Swift_Signer $signer) - { - if ($signer instanceof Swift_Signers_HeaderSigner) { - foreach ($this->headerSigners as $k => $headerSigner) { - if ($headerSigner === $signer) { - unset($this->headerSigners[$k]); - - return $this; - } - } - } elseif ($signer instanceof Swift_Signers_BodySigner) { - foreach ($this->bodySigners as $k => $bodySigner) { - if ($bodySigner === $signer) { - unset($this->bodySigners[$k]); - - return $this; - } - } - } - - return $this; - } - - /** - * Clear all signature handlers attached to the message. - * - * @return $this - */ - public function clearSigners() - { - $this->headerSigners = []; - $this->bodySigners = []; - - return $this; - } - - /** - * Get this message as a complete string. - * - * @return string - */ - public function toString() - { - if (empty($this->headerSigners) && empty($this->bodySigners)) { - return parent::toString(); - } - - $this->saveMessage(); - - $this->doSign(); - - $string = parent::toString(); - - $this->restoreMessage(); - - return $string; - } - - /** - * Write this message to a {@link Swift_InputByteStream}. - */ - public function toByteStream(Swift_InputByteStream $is) - { - if (empty($this->headerSigners) && empty($this->bodySigners)) { - parent::toByteStream($is); - - return; - } - - $this->saveMessage(); - - $this->doSign(); - - parent::toByteStream($is); - - $this->restoreMessage(); - } - - public function __wakeup() - { - Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.message'); - } - - /** - * loops through signers and apply the signatures. - */ - protected function doSign() - { - foreach ($this->bodySigners as $signer) { - $altered = $signer->getAlteredHeaders(); - $this->saveHeaders($altered); - $signer->signMessage($this); - } - - foreach ($this->headerSigners as $signer) { - $altered = $signer->getAlteredHeaders(); - $this->saveHeaders($altered); - $signer->reset(); - - $signer->setHeaders($this->getHeaders()); - - $signer->startBody(); - $this->bodyToByteStream($signer); - $signer->endBody(); - - $signer->addSignature($this->getHeaders()); - } - } - - /** - * save the message before any signature is applied. - */ - protected function saveMessage() - { - $this->savedMessage = ['headers' => []]; - $this->savedMessage['body'] = $this->getBody(); - $this->savedMessage['children'] = $this->getChildren(); - if (\count($this->savedMessage['children']) > 0 && '' != $this->getBody()) { - $this->setChildren(array_merge([$this->becomeMimePart()], $this->savedMessage['children'])); - $this->setBody(''); - } - } - - /** - * save the original headers. - */ - protected function saveHeaders(array $altered) - { - foreach ($altered as $head) { - $lc = strtolower($head); - - if (!isset($this->savedMessage['headers'][$lc])) { - $this->savedMessage['headers'][$lc] = $this->getHeaders()->getAll($head); - } - } - } - - /** - * Remove or restore altered headers. - */ - protected function restoreHeaders() - { - foreach ($this->savedMessage['headers'] as $name => $savedValue) { - $headers = $this->getHeaders()->getAll($name); - - foreach ($headers as $key => $value) { - if (!isset($savedValue[$key])) { - $this->getHeaders()->remove($name, $key); - } - } - } - } - - /** - * Restore message body. - */ - protected function restoreMessage() - { - $this->setBody($this->savedMessage['body']); - $this->setChildren($this->savedMessage['children']); - - $this->restoreHeaders(); - $this->savedMessage = []; - } - - /** - * Clone Message Signers. - * - * @see Swift_Mime_SimpleMimeEntity::__clone() - */ - public function __clone() - { - parent::__clone(); - foreach ($this->bodySigners as $key => $bodySigner) { - $this->bodySigners[$key] = clone $bodySigner; - } - - foreach ($this->headerSigners as $key => $headerSigner) { - $this->headerSigners[$key] = clone $headerSigner; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php deleted file mode 100644 index d994373..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php +++ /dev/null @@ -1,144 +0,0 @@ -setDisposition('attachment'); - $this->setContentType('application/octet-stream'); - $this->mimeTypes = $mimeTypes; - } - - /** - * Get the nesting level used for this attachment. - * - * Always returns {@link LEVEL_MIXED}. - * - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_MIXED; - } - - /** - * Get the Content-Disposition of this attachment. - * - * By default attachments have a disposition of "attachment". - * - * @return string - */ - public function getDisposition() - { - return $this->getHeaderFieldModel('Content-Disposition'); - } - - /** - * Set the Content-Disposition of this attachment. - * - * @param string $disposition - * - * @return $this - */ - public function setDisposition($disposition) - { - if (!$this->setHeaderFieldModel('Content-Disposition', $disposition)) { - $this->getHeaders()->addParameterizedHeader('Content-Disposition', $disposition); - } - - return $this; - } - - /** - * Get the filename of this attachment when downloaded. - * - * @return string - */ - public function getFilename() - { - return $this->getHeaderParameter('Content-Disposition', 'filename'); - } - - /** - * Set the filename of this attachment. - * - * @param string $filename - * - * @return $this - */ - public function setFilename($filename) - { - $this->setHeaderParameter('Content-Disposition', 'filename', $filename); - $this->setHeaderParameter('Content-Type', 'name', $filename); - - return $this; - } - - /** - * Get the file size of this attachment. - * - * @return int - */ - public function getSize() - { - return $this->getHeaderParameter('Content-Disposition', 'size'); - } - - /** - * Set the file size of this attachment. - * - * @param int $size - * - * @return $this - */ - public function setSize($size) - { - $this->setHeaderParameter('Content-Disposition', 'size', $size); - - return $this; - } - - /** - * Set the file that this attachment is for. - * - * @param string $contentType optional - * - * @return $this - */ - public function setFile(Swift_FileStream $file, $contentType = null) - { - $this->setFilename(basename($file->getPath())); - $this->setBody($file, $contentType); - if (!isset($contentType)) { - $extension = strtolower(substr($file->getPath(), strrpos($file->getPath(), '.') + 1)); - - if (\array_key_exists($extension, $this->mimeTypes)) { - $this->setContentType($this->mimeTypes[$extension]); - } - } - - return $this; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php deleted file mode 100644 index b49c3a8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php +++ /dev/null @@ -1,24 +0,0 @@ -= $maxLineLength || 76 < $maxLineLength) { - $maxLineLength = 76; - } - - $remainder = 0; - $base64ReadBufferRemainderBytes = null; - - // To reduce memory usage, the output buffer is streamed to the input buffer like so: - // Output Stream => base64encode => wrap line length => Input Stream - // HOWEVER it's important to note that base64_encode() should only be passed whole triplets of data (except for the final chunk of data) - // otherwise it will assume the input data has *ended* and it will incorrectly pad/terminate the base64 data mid-stream. - // We use $base64ReadBufferRemainderBytes to carry over 1-2 "remainder" bytes from the each chunk from OutputStream and pre-pend those onto the - // chunk of bytes read in the next iteration. - // When the OutputStream is empty, we must flush any remainder bytes. - while (true) { - $readBytes = $os->read(8192); - $atEOF = (false === $readBytes); - - if ($atEOF) { - $streamTheseBytes = $base64ReadBufferRemainderBytes; - } else { - $streamTheseBytes = $base64ReadBufferRemainderBytes.$readBytes; - } - $base64ReadBufferRemainderBytes = null; - $bytesLength = \strlen($streamTheseBytes); - - if (0 === $bytesLength) { // no data left to encode - break; - } - - // if we're not on the last block of the ouput stream, make sure $streamTheseBytes ends with a complete triplet of data - // and carry over remainder 1-2 bytes to the next loop iteration - if (!$atEOF) { - $excessBytes = $bytesLength % 3; - if (0 !== $excessBytes) { - $base64ReadBufferRemainderBytes = substr($streamTheseBytes, -$excessBytes); - $streamTheseBytes = substr($streamTheseBytes, 0, $bytesLength - $excessBytes); - } - } - - $encoded = base64_encode($streamTheseBytes); - $encodedTransformed = ''; - $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; - - while ($thisMaxLineLength < \strlen($encoded)) { - $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength)."\r\n"; - $firstLineOffset = 0; - $encoded = substr($encoded, $thisMaxLineLength); - $thisMaxLineLength = $maxLineLength; - $remainder = 0; - } - - if (0 < $remainingLength = \strlen($encoded)) { - $remainder += $remainingLength; - $encodedTransformed .= $encoded; - $encoded = null; - } - - $is->write($encodedTransformed); - - if ($atEOF) { - break; - } - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'base64'. - * - * @return string - */ - public function getName() - { - return 'base64'; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php deleted file mode 100644 index 8dfea60..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php +++ /dev/null @@ -1,121 +0,0 @@ -charset = $charset ?: 'utf-8'; - } - - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->charset = $charset; - } - - /** - * Encode $in to $out. - * - * @param Swift_OutputByteStream $os to read from - * @param Swift_InputByteStream $is to write to - * @param int $firstLineOffset - * @param int $maxLineLength 0 indicates the default length for this encoding - * - * @throws RuntimeException - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - if ('utf-8' !== $this->charset) { - throw new RuntimeException(sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); - } - - $string = ''; - - while (false !== $bytes = $os->read(8192)) { - $string .= $bytes; - } - - $is->write($this->encodeString($string)); - } - - /** - * Get the MIME name of this content encoding scheme. - * - * @return string - */ - public function getName() - { - return 'quoted-printable'; - } - - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset if first line needs to be shorter - * @param int $maxLineLength 0 indicates the default length for this encoding - * - * @throws RuntimeException - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ('utf-8' !== $this->charset) { - throw new RuntimeException(sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); - } - - return $this->standardize(quoted_printable_encode($string)); - } - - /** - * Make sure CRLF is correct and HT/SPACE are in valid places. - * - * @param string $string - * - * @return string - */ - protected function standardize($string) - { - // transform CR or LF to CRLF - $string = preg_replace('~=0D(?!=0A)|(? - */ -class Swift_Mime_ContentEncoder_NullContentEncoder implements Swift_Mime_ContentEncoder -{ - /** - * The name of this encoding scheme (probably 7bit or 8bit). - * - * @var string - */ - private $name; - - /** - * Creates a new NullContentEncoder with $name (probably 7bit or 8bit). - * - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset ignored - * @param int $maxLineLength ignored - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - return $string; - } - - /** - * Encode stream $in to stream $out. - * - * @param int $firstLineOffset ignored - * @param int $maxLineLength ignored - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - while (false !== ($bytes = $os->read(8192))) { - $is->write($bytes); - } - } - - /** - * Get the name of this encoding scheme. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Not used. - */ - public function charsetChanged($charset) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php deleted file mode 100644 index 72592fc..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php +++ /dev/null @@ -1,164 +0,0 @@ -name = $name; - $this->canonical = $canonical; - } - - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset ignored - * @param int $maxLineLength - 0 means no wrapping will occur - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($this->canonical) { - $string = $this->canonicalize($string); - } - - return $this->safeWordwrap($string, $maxLineLength, "\r\n"); - } - - /** - * Encode stream $in to stream $out. - * - * @param int $firstLineOffset ignored - * @param int $maxLineLength optional, 0 means no wrapping will occur - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - $leftOver = ''; - while (false !== $bytes = $os->read(8192)) { - $toencode = $leftOver.$bytes; - if ($this->canonical) { - $toencode = $this->canonicalize($toencode); - } - $wrapped = $this->safeWordwrap($toencode, $maxLineLength, "\r\n"); - $lastLinePos = strrpos($wrapped, "\r\n"); - $leftOver = substr($wrapped, $lastLinePos); - $wrapped = substr($wrapped, 0, $lastLinePos); - - $is->write($wrapped); - } - if (\strlen($leftOver)) { - $is->write($leftOver); - } - } - - /** - * Get the name of this encoding scheme. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Not used. - */ - public function charsetChanged($charset) - { - } - - /** - * A safer (but weaker) wordwrap for unicode. - * - * @param string $string - * @param int $length - * @param string $le - * - * @return string - */ - private function safeWordwrap($string, $length = 75, $le = "\r\n") - { - if (0 >= $length) { - return $string; - } - - $originalLines = explode($le, $string); - - $lines = []; - $lineCount = 0; - - foreach ($originalLines as $originalLine) { - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - - //$chunks = preg_split('/(?<=[\ \t,\.!\?\-&\+\/])/', $originalLine); - $chunks = preg_split('/(?<=\s)/', $originalLine); - - foreach ($chunks as $chunk) { - if (0 != \strlen($currentLine) - && \strlen($currentLine.$chunk) > $length) { - $lines[] = ''; - $currentLine = &$lines[$lineCount++]; - } - $currentLine .= $chunk; - } - } - - return implode("\r\n", $lines); - } - - /** - * Canonicalize string input (fix CRLF). - * - * @param string $string - * - * @return string - */ - private function canonicalize($string) - { - return str_replace( - ["\r\n", "\r", "\n"], - ["\n", "\n", "\r\n"], - $string - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php deleted file mode 100644 index 465ffd8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php +++ /dev/null @@ -1,134 +0,0 @@ -dotEscape = $dotEscape; - parent::__construct($charStream, $filter); - } - - public function __sleep() - { - return ['charStream', 'filter', 'dotEscape']; - } - - protected function getSafeMapShareId() - { - return static::class.($this->dotEscape ? '.dotEscape' : ''); - } - - protected function initSafeMap() - { - parent::initSafeMap(); - if ($this->dotEscape) { - /* Encode . as =2e for buggy remote servers */ - unset($this->safeMap[0x2e]); - } - } - - /** - * Encode stream $in to stream $out. - * - * QP encoded strings have a maximum line length of 76 characters. - * If the first line needs to be shorter, indicate the difference with - * $firstLineOffset. - * - * @param Swift_OutputByteStream $os output stream - * @param Swift_InputByteStream $is input stream - * @param int $firstLineOffset - * @param int $maxLineLength - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - if ($maxLineLength > 76 || $maxLineLength <= 0) { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $this->charStream->flushContents(); - $this->charStream->importByteStream($os); - - $currentLine = ''; - $prepend = ''; - $size = $lineLen = 0; - - while (false !== $bytes = $this->nextSequence()) { - // If we're filtering the input - if (isset($this->filter)) { - // If we can't filter because we need more bytes - while ($this->filter->shouldBuffer($bytes)) { - // Then collect bytes into the buffer - if (false === $moreBytes = $this->nextSequence(1)) { - break; - } - - foreach ($moreBytes as $b) { - $bytes[] = $b; - } - } - // And filter them - $bytes = $this->filter->filter($bytes); - } - - $enc = $this->encodeByteSequence($bytes, $size); - - $i = strpos($enc, '=0D=0A'); - $newLineLength = $lineLen + (false === $i ? $size : $i); - - if ($currentLine && $newLineLength >= $thisLineLength) { - $is->write($prepend.$this->standardize($currentLine)); - $currentLine = ''; - $prepend = "=\r\n"; - $thisLineLength = $maxLineLength; - $lineLen = 0; - } - - $currentLine .= $enc; - - if (false === $i) { - $lineLen += $size; - } else { - // 6 is the length of '=0D=0A'. - $lineLen = $size - strrpos($enc, '=0D=0A') - 6; - } - } - if (\strlen($currentLine)) { - $is->write($prepend.$this->standardize($currentLine)); - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'quoted-printable'. - * - * @return string - */ - public function getName() - { - return 'quoted-printable'; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php deleted file mode 100644 index f3ece43..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php +++ /dev/null @@ -1,96 +0,0 @@ - - */ -class Swift_Mime_ContentEncoder_QpContentEncoderProxy implements Swift_Mime_ContentEncoder -{ - /** - * @var Swift_Mime_ContentEncoder_QpContentEncoder - */ - private $safeEncoder; - - /** - * @var Swift_Mime_ContentEncoder_NativeQpContentEncoder - */ - private $nativeEncoder; - - /** - * @var string|null - */ - private $charset; - - /** - * Constructor. - * - * @param string|null $charset - */ - public function __construct(Swift_Mime_ContentEncoder_QpContentEncoder $safeEncoder, Swift_Mime_ContentEncoder_NativeQpContentEncoder $nativeEncoder, $charset) - { - $this->safeEncoder = $safeEncoder; - $this->nativeEncoder = $nativeEncoder; - $this->charset = $charset; - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->safeEncoder = clone $this->safeEncoder; - $this->nativeEncoder = clone $this->nativeEncoder; - } - - /** - * {@inheritdoc} - */ - public function charsetChanged($charset) - { - $this->charset = $charset; - $this->safeEncoder->charsetChanged($charset); - } - - /** - * {@inheritdoc} - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - $this->getEncoder()->encodeByteStream($os, $is, $firstLineOffset, $maxLineLength); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'quoted-printable'; - } - - /** - * {@inheritdoc} - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - return $this->getEncoder()->encodeString($string, $firstLineOffset, $maxLineLength); - } - - /** - * @return Swift_Mime_ContentEncoder - */ - private function getEncoder() - { - return 'utf-8' === $this->charset ? $this->nativeEncoder : $this->safeEncoder; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php deleted file mode 100644 index 870e7f4..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class Swift_Mime_ContentEncoder_RawContentEncoder implements Swift_Mime_ContentEncoder -{ - /** - * Encode a given string to produce an encoded string. - * - * @param string $string - * @param int $firstLineOffset ignored - * @param int $maxLineLength ignored - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - return $string; - } - - /** - * Encode stream $in to stream $out. - * - * @param int $firstLineOffset ignored - * @param int $maxLineLength ignored - */ - public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) - { - while (false !== ($bytes = $os->read(8192))) { - $is->write($bytes); - } - } - - /** - * Get the name of this encoding scheme. - * - * @return string - */ - public function getName() - { - return 'raw'; - } - - /** - * Not used. - */ - public function charsetChanged($charset) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php deleted file mode 100644 index 42a5177..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php +++ /dev/null @@ -1,41 +0,0 @@ -setDisposition('inline'); - $this->setId($this->getId()); - } - - /** - * Get the nesting level of this EmbeddedFile. - * - * Returns {@see LEVEL_RELATED}. - * - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_RELATED; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php deleted file mode 100644 index 1a952ec..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php +++ /dev/null @@ -1,22 +0,0 @@ -getName(), "\r\n"); - mb_internal_encoding($old); - - return $newstring; - } - - return parent::encodeString($string, $firstLineOffset, $maxLineLength); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php deleted file mode 100644 index 378c480..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php +++ /dev/null @@ -1,65 +0,0 @@ -safeMap[$byte] = \chr($byte); - } - } - - /** - * Get the name of this encoding scheme. - * - * Returns the string 'Q'. - * - * @return string - */ - public function getName() - { - return 'Q'; - } - - /** - * Takes an unencoded string and produces a QP encoded string from it. - * - * @param string $string string to encode - * @param int $firstLineOffset optional - * @param int $maxLineLength optional, 0 indicates the default of 76 chars - * - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) - { - return str_replace([' ', '=20', "=\r\n"], ['_', '_', "\r\n"], - parent::encodeString($string, $firstLineOffset, $maxLineLength) - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php deleted file mode 100644 index 22caeb2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php +++ /dev/null @@ -1,476 +0,0 @@ -clearCachedValueIf($charset != $this->charset); - $this->charset = $charset; - if (isset($this->encoder)) { - $this->encoder->charsetChanged($charset); - } - } - - /** - * Get the character set used in this Header. - * - * @return string - */ - public function getCharset() - { - return $this->charset; - } - - /** - * Set the language used in this Header. - * - * For example, for US English, 'en-us'. - * This can be unspecified. - * - * @param string $lang - */ - public function setLanguage($lang) - { - $this->clearCachedValueIf($this->lang != $lang); - $this->lang = $lang; - } - - /** - * Get the language used in this Header. - * - * @return string - */ - public function getLanguage() - { - return $this->lang; - } - - /** - * Set the encoder used for encoding the header. - */ - public function setEncoder(Swift_Mime_HeaderEncoder $encoder) - { - $this->encoder = $encoder; - $this->setCachedValue(null); - } - - /** - * Get the encoder used for encoding this Header. - * - * @return Swift_Mime_HeaderEncoder - */ - public function getEncoder() - { - return $this->encoder; - } - - /** - * Get the name of this header (e.g. charset). - * - * @return string - */ - public function getFieldName() - { - return $this->name; - } - - /** - * Set the maximum length of lines in the header (excluding EOL). - * - * @param int $lineLength - */ - public function setMaxLineLength($lineLength) - { - $this->clearCachedValueIf($this->lineLength != $lineLength); - $this->lineLength = $lineLength; - } - - /** - * Get the maximum permitted length of lines in this Header. - * - * @return int - */ - public function getMaxLineLength() - { - return $this->lineLength; - } - - /** - * Get this Header rendered as a RFC 2822 compliant string. - * - * @return string - * - * @throws Swift_RfcComplianceException - */ - public function toString() - { - return $this->tokensToString($this->toTokens()); - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Set the name of this Header field. - * - * @param string $name - */ - protected function setFieldName($name) - { - $this->name = $name; - } - - /** - * Produces a compliant, formatted RFC 2822 'phrase' based on the string given. - * - * @param string $string as displayed - * @param string $charset of the text - * @param bool $shorten the first line to make remove for header name - * - * @return string - */ - protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false) - { - // Treat token as exactly what was given - $phraseStr = $string; - // If it's not valid - - if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) { - // .. but it is just ascii text, try escaping some characters - // and make it a quoted-string - if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) { - $phraseStr = $this->escapeSpecials($phraseStr, ['"']); - $phraseStr = '"'.$phraseStr.'"'; - } else { - // ... otherwise it needs encoding - // Determine space remaining on line if first line - if ($shorten) { - $usedLength = \strlen($header->getFieldName().': '); - } else { - $usedLength = 0; - } - $phraseStr = $this->encodeWords($header, $string, $usedLength); - } - } - - return $phraseStr; - } - - /** - * Escape special characters in a string (convert to quoted-pairs). - * - * @param string $token - * @param string[] $include additional chars to escape - * - * @return string - */ - private function escapeSpecials($token, $include = []) - { - foreach (array_merge(['\\'], $include) as $char) { - $token = str_replace($char, '\\'.$char, $token); - } - - return $token; - } - - /** - * Encode needed word tokens within a string of input. - * - * @param string $input - * @param string $usedLength optional - * - * @return string - */ - protected function encodeWords(Swift_Mime_Header $header, $input, $usedLength = -1) - { - $value = ''; - - $tokens = $this->getEncodableWordTokens($input); - - foreach ($tokens as $token) { - // See RFC 2822, Sect 2.2 (really 2.2 ??) - if ($this->tokenNeedsEncoding($token)) { - // Don't encode starting WSP - $firstChar = substr($token, 0, 1); - switch ($firstChar) { - case ' ': - case "\t": - $value .= $firstChar; - $token = substr($token, 1); - } - - if (-1 == $usedLength) { - $usedLength = \strlen($header->getFieldName().': ') + \strlen($value); - } - $value .= $this->getTokenAsEncodedWord($token, $usedLength); - - $header->setMaxLineLength(76); // Forcefully override - } else { - $value .= $token; - } - } - - return $value; - } - - /** - * Test if a token needs to be encoded or not. - * - * @param string $token - * - * @return bool - */ - protected function tokenNeedsEncoding($token) - { - return preg_match('~[\x00-\x08\x10-\x19\x7F-\xFF\r\n]~', $token); - } - - /** - * Splits a string into tokens in blocks of words which can be encoded quickly. - * - * @param string $string - * - * @return string[] - */ - protected function getEncodableWordTokens($string) - { - $tokens = []; - - $encodedToken = ''; - // Split at all whitespace boundaries - foreach (preg_split('~(?=[\t ])~', $string) as $token) { - if ($this->tokenNeedsEncoding($token)) { - $encodedToken .= $token; - } else { - if (\strlen($encodedToken) > 0) { - $tokens[] = $encodedToken; - $encodedToken = ''; - } - $tokens[] = $token; - } - } - if (\strlen($encodedToken)) { - $tokens[] = $encodedToken; - } - - return $tokens; - } - - /** - * Get a token as an encoded word for safe insertion into headers. - * - * @param string $token token to encode - * @param int $firstLineOffset optional - * - * @return string - */ - protected function getTokenAsEncodedWord($token, $firstLineOffset = 0) - { - // Adjust $firstLineOffset to account for space needed for syntax - $charsetDecl = $this->charset; - if (isset($this->lang)) { - $charsetDecl .= '*'.$this->lang; - } - $encodingWrapperLength = \strlen( - '=?'.$charsetDecl.'?'.$this->encoder->getName().'??=' - ); - - if ($firstLineOffset >= 75) { - //Does this logic need to be here? - $firstLineOffset = 0; - } - - $encodedTextLines = explode("\r\n", - $this->encoder->encodeString( - $token, $firstLineOffset, 75 - $encodingWrapperLength, $this->charset - ) - ); - - if ('iso-2022-jp' !== strtolower($this->charset)) { - // special encoding for iso-2022-jp using mb_encode_mimeheader - foreach ($encodedTextLines as $lineNum => $line) { - $encodedTextLines[$lineNum] = '=?'.$charsetDecl. - '?'.$this->encoder->getName(). - '?'.$line.'?='; - } - } - - return implode("\r\n ", $encodedTextLines); - } - - /** - * Generates tokens from the given string which include CRLF as individual tokens. - * - * @param string $token - * - * @return string[] - */ - protected function generateTokenLines($token) - { - return preg_split('~(\r\n)~', $token, -1, PREG_SPLIT_DELIM_CAPTURE); - } - - /** - * Set a value into the cache. - * - * @param string $value - */ - protected function setCachedValue($value) - { - $this->cachedValue = $value; - } - - /** - * Get the value in the cache. - * - * @return string - */ - protected function getCachedValue() - { - return $this->cachedValue; - } - - /** - * Clear the cached value if $condition is met. - * - * @param bool $condition - */ - protected function clearCachedValueIf($condition) - { - if ($condition) { - $this->setCachedValue(null); - } - } - - /** - * Generate a list of all tokens in the final header. - * - * @param string $string The string to tokenize - * - * @return array An array of tokens as strings - */ - protected function toTokens($string = null) - { - if (null === $string) { - $string = $this->getFieldBody(); - } - - $tokens = []; - - // Generate atoms; split at all invisible boundaries followed by WSP - foreach (preg_split('~(?=[ \t])~', $string) as $token) { - $newTokens = $this->generateTokenLines($token); - foreach ($newTokens as $newToken) { - $tokens[] = $newToken; - } - } - - return $tokens; - } - - /** - * Takes an array of tokens which appear in the header and turns them into - * an RFC 2822 compliant string, adding FWSP where needed. - * - * @param string[] $tokens - * - * @return string - */ - private function tokensToString(array $tokens) - { - $lineCount = 0; - $headerLines = []; - $headerLines[] = $this->name.': '; - $currentLine = &$headerLines[$lineCount++]; - - // Build all tokens back into compliant header - foreach ($tokens as $i => $token) { - // Line longer than specified maximum or token was just a new line - if (("\r\n" == $token) || - ($i > 0 && \strlen($currentLine.$token) > $this->lineLength) - && 0 < \strlen($currentLine)) { - $headerLines[] = ''; - $currentLine = &$headerLines[$lineCount++]; - } - - // Append token to the line - if ("\r\n" != $token) { - $currentLine .= $token; - } - } - - // Implode with FWS (RFC 2822, 2.2.3) - return implode("\r\n", $headerLines)."\r\n"; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php deleted file mode 100644 index efe1dad..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php +++ /dev/null @@ -1,113 +0,0 @@ -setFieldName($name); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_DATE; - } - - /** - * Set the model for the field body. - * - * @param DateTimeInterface $model - */ - public function setFieldBodyModel($model) - { - $this->setDateTime($model); - } - - /** - * Get the model for the field body. - * - * @return DateTimeImmutable - */ - public function getFieldBodyModel() - { - return $this->getDateTime(); - } - - /** - * Get the date-time representing the Date in this Header. - * - * @return DateTimeImmutable - */ - public function getDateTime() - { - return $this->dateTime; - } - - /** - * Set the date-time of the Date in this Header. - * - * If a DateTime instance is provided, it is converted to DateTimeImmutable. - */ - public function setDateTime(DateTimeInterface $dateTime) - { - $this->clearCachedValueIf($this->getCachedValue() != $dateTime->format(DateTime::RFC2822)); - if ($dateTime instanceof DateTime) { - $immutable = new DateTimeImmutable('@'.$dateTime->getTimestamp()); - $dateTime = $immutable->setTimezone($dateTime->getTimezone()); - } - $this->dateTime = $dateTime; - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * - * @see toString() - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - if (isset($this->dateTime)) { - $this->setCachedValue($this->dateTime->format(DateTime::RFC2822)); - } - } - - return $this->getCachedValue(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php deleted file mode 100644 index dcea0c9..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php +++ /dev/null @@ -1,186 +0,0 @@ -setFieldName($name); - $this->emailValidator = $emailValidator; - $this->addressEncoder = $addressEncoder ?? new Swift_AddressEncoder_IdnAddressEncoder(); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_ID; - } - - /** - * Set the model for the field body. - * - * This method takes a string ID, or an array of IDs. - * - * @param mixed $model - * - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setId($model); - } - - /** - * Get the model for the field body. - * - * This method returns an array of IDs - * - * @return array - */ - public function getFieldBodyModel() - { - return $this->getIds(); - } - - /** - * Set the ID used in the value of this header. - * - * @param string|array $id - * - * @throws Swift_RfcComplianceException - */ - public function setId($id) - { - $this->setIds(\is_array($id) ? $id : [$id]); - } - - /** - * Get the ID used in the value of this Header. - * - * If multiple IDs are set only the first is returned. - * - * @return string - */ - public function getId() - { - if (\count($this->ids) > 0) { - return $this->ids[0]; - } - } - - /** - * Set a collection of IDs to use in the value of this Header. - * - * @param string[] $ids - * - * @throws Swift_RfcComplianceException - */ - public function setIds(array $ids) - { - $actualIds = []; - - foreach ($ids as $id) { - $this->assertValidId($id); - $actualIds[] = $id; - } - - $this->clearCachedValueIf($this->ids != $actualIds); - $this->ids = $actualIds; - } - - /** - * Get the list of IDs used in this Header. - * - * @return string[] - */ - public function getIds() - { - return $this->ids; - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@see toString()} for that). - * - * @see toString() - * - * @throws Swift_RfcComplianceException - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - $angleAddrs = []; - - foreach ($this->ids as $id) { - $angleAddrs[] = '<'.$this->addressEncoder->encodeString($id).'>'; - } - - $this->setCachedValue(implode(' ', $angleAddrs)); - } - - return $this->getCachedValue(); - } - - /** - * Throws an Exception if the id passed does not comply with RFC 2822. - * - * @param string $id - * - * @throws Swift_RfcComplianceException - */ - private function assertValidId($id) - { - if (!$this->emailValidator->isValid($id, new RFCValidation())) { - throw new Swift_RfcComplianceException('Invalid ID given <'.$id.'>'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php deleted file mode 100644 index ddd5e8c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php +++ /dev/null @@ -1,358 +0,0 @@ -setFieldName($name); - $this->setEncoder($encoder); - $this->emailValidator = $emailValidator; - $this->addressEncoder = $addressEncoder ?? new Swift_AddressEncoder_IdnAddressEncoder(); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_MAILBOX; - } - - /** - * Set the model for the field body. - * - * This method takes a string, or an array of addresses. - * - * @param mixed $model - * - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setNameAddresses($model); - } - - /** - * Get the model for the field body. - * - * This method returns an associative array like {@link getNameAddresses()} - * - * @throws Swift_RfcComplianceException - * - * @return array - */ - public function getFieldBodyModel() - { - return $this->getNameAddresses(); - } - - /** - * Set a list of mailboxes to be shown in this Header. - * - * The mailboxes can be a simple array of addresses, or an array of - * key=>value pairs where (email => personalName). - * Example: - * - * setNameAddresses(array( - * 'chris@swiftmailer.org' => 'Chris Corbyn', - * 'mark@swiftmailer.org' //No associated personal name - * )); - * ?> - * - * - * @see __construct() - * @see setAddresses() - * @see setValue() - * - * @param string|string[] $mailboxes - * - * @throws Swift_RfcComplianceException - */ - public function setNameAddresses($mailboxes) - { - $this->mailboxes = $this->normalizeMailboxes((array) $mailboxes); - $this->setCachedValue(null); //Clear any cached value - } - - /** - * Get the full mailbox list of this Header as an array of valid RFC 2822 strings. - * - * Example: - * - * 'Chris Corbyn', - * 'mark@swiftmailer.org' => 'Mark Corbyn') - * ); - * print_r($header->getNameAddressStrings()); - * // array ( - * // 0 => Chris Corbyn , - * // 1 => Mark Corbyn - * // ) - * ?> - * - * - * @see getNameAddresses() - * @see toString() - * - * @throws Swift_RfcComplianceException - * - * @return string[] - */ - public function getNameAddressStrings() - { - return $this->createNameAddressStrings($this->getNameAddresses()); - } - - /** - * Get all mailboxes in this Header as key=>value pairs. - * - * The key is the address and the value is the name (or null if none set). - * Example: - * - * 'Chris Corbyn', - * 'mark@swiftmailer.org' => 'Mark Corbyn') - * ); - * print_r($header->getNameAddresses()); - * // array ( - * // chris@swiftmailer.org => Chris Corbyn, - * // mark@swiftmailer.org => Mark Corbyn - * // ) - * ?> - * - * - * @see getAddresses() - * @see getNameAddressStrings() - * - * @return string[] - */ - public function getNameAddresses() - { - return $this->mailboxes; - } - - /** - * Makes this Header represent a list of plain email addresses with no names. - * - * Example: - * - * setAddresses( - * array('one@domain.tld', 'two@domain.tld', 'three@domain.tld') - * ); - * ?> - * - * - * @see setNameAddresses() - * @see setValue() - * - * @param string[] $addresses - * - * @throws Swift_RfcComplianceException - */ - public function setAddresses($addresses) - { - $this->setNameAddresses(array_values((array) $addresses)); - } - - /** - * Get all email addresses in this Header. - * - * @see getNameAddresses() - * - * @return string[] - */ - public function getAddresses() - { - return array_keys($this->mailboxes); - } - - /** - * Remove one or more addresses from this Header. - * - * @param string|string[] $addresses - */ - public function removeAddresses($addresses) - { - $this->setCachedValue(null); - foreach ((array) $addresses as $address) { - unset($this->mailboxes[$address]); - } - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * - * @see toString() - * - * @throws Swift_RfcComplianceException - * - * @return string - */ - public function getFieldBody() - { - // Compute the string value of the header only if needed - if (null === $this->getCachedValue()) { - $this->setCachedValue($this->createMailboxListString($this->mailboxes)); - } - - return $this->getCachedValue(); - } - - /** - * Normalizes a user-input list of mailboxes into consistent key=>value pairs. - * - * @param string[] $mailboxes - * - * @return string[] - */ - protected function normalizeMailboxes(array $mailboxes) - { - $actualMailboxes = []; - - foreach ($mailboxes as $key => $value) { - if (\is_string($key)) { - //key is email addr - $address = $key; - $name = $value; - } else { - $address = $value; - $name = null; - } - $this->assertValidAddress($address); - $actualMailboxes[$address] = $name; - } - - return $actualMailboxes; - } - - /** - * Produces a compliant, formatted display-name based on the string given. - * - * @param string $displayName as displayed - * @param bool $shorten the first line to make remove for header name - * - * @return string - */ - protected function createDisplayNameString($displayName, $shorten = false) - { - return $this->createPhrase($this, $displayName, $this->getCharset(), $this->getEncoder(), $shorten); - } - - /** - * Creates a string form of all the mailboxes in the passed array. - * - * @param string[] $mailboxes - * - * @throws Swift_RfcComplianceException - * - * @return string - */ - protected function createMailboxListString(array $mailboxes) - { - return implode(', ', $this->createNameAddressStrings($mailboxes)); - } - - /** - * Redefine the encoding requirements for mailboxes. - * - * All "specials" must be encoded as the full header value will not be quoted - * - * @see RFC 2822 3.2.1 - * - * @param string $token - * - * @return bool - */ - protected function tokenNeedsEncoding($token) - { - return preg_match('/[()<>\[\]:;@\,."]/', $token) || parent::tokenNeedsEncoding($token); - } - - /** - * Return an array of strings conforming the the name-addr spec of RFC 2822. - * - * @param string[] $mailboxes - * - * @return string[] - */ - private function createNameAddressStrings(array $mailboxes) - { - $strings = []; - - foreach ($mailboxes as $email => $name) { - $mailboxStr = $this->addressEncoder->encodeString($email); - if (null !== $name) { - $nameStr = $this->createDisplayNameString($name, empty($strings)); - $mailboxStr = $nameStr.' <'.$mailboxStr.'>'; - } - $strings[] = $mailboxStr; - } - - return $strings; - } - - /** - * Throws an Exception if the address passed does not comply with RFC 2822. - * - * @param string $address - * - * @throws Swift_RfcComplianceException if invalid - */ - private function assertValidAddress($address) - { - if (!$this->emailValidator->isValid($address, new RFCValidation())) { - throw new Swift_RfcComplianceException('Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php deleted file mode 100644 index fafb5ba..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php +++ /dev/null @@ -1,135 +0,0 @@ - - * - * @deprecated since SwiftMailer 6.1.0; use Swift_Signers_DKIMSigner instead. - */ -class Swift_Mime_Headers_OpenDKIMHeader implements Swift_Mime_Header -{ - /** - * The value of this Header. - * - * @var string - */ - private $value; - - /** - * The name of this Header. - * - * @var string - */ - private $fieldName; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->fieldName = $name; - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_TEXT; - } - - /** - * Set the model for the field body. - * - * This method takes a string for the field value. - * - * @param string $model - */ - public function setFieldBodyModel($model) - { - $this->setValue($model); - } - - /** - * Get the model for the field body. - * - * This method returns a string. - * - * @return string - */ - public function getFieldBodyModel() - { - return $this->getValue(); - } - - /** - * Get the (unencoded) value of this header. - * - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Set the (unencoded) value of this header. - * - * @param string $value - */ - public function setValue($value) - { - $this->value = $value; - } - - /** - * Get the value of this header prepared for rendering. - * - * @return string - */ - public function getFieldBody() - { - return $this->value; - } - - /** - * Get this Header rendered as a RFC 2822 compliant string. - * - * @return string - */ - public function toString() - { - return $this->fieldName.': '.$this->value."\r\n"; - } - - /** - * Set the Header FieldName. - * - * @see Swift_Mime_Header::getFieldName() - */ - public function getFieldName() - { - return $this->fieldName; - } - - /** - * Ignored. - */ - public function setCharset($charset) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php deleted file mode 100644 index 47c15e6..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php +++ /dev/null @@ -1,255 +0,0 @@ -paramEncoder = $paramEncoder; - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_PARAMETERIZED; - } - - /** - * Set the character set used in this Header. - * - * @param string $charset - */ - public function setCharset($charset) - { - parent::setCharset($charset); - if (isset($this->paramEncoder)) { - $this->paramEncoder->charsetChanged($charset); - } - } - - /** - * Set the value of $parameter. - * - * @param string $parameter - * @param string $value - */ - public function setParameter($parameter, $value) - { - $this->setParameters(array_merge($this->getParameters(), [$parameter => $value])); - } - - /** - * Get the value of $parameter. - * - * @param string $parameter - * - * @return string - */ - public function getParameter($parameter) - { - $params = $this->getParameters(); - - return $params[$parameter] ?? null; - } - - /** - * Set an associative array of parameter names mapped to values. - * - * @param string[] $parameters - */ - public function setParameters(array $parameters) - { - $this->clearCachedValueIf($this->params != $parameters); - $this->params = $parameters; - } - - /** - * Returns an associative array of parameter names mapped to values. - * - * @return string[] - */ - public function getParameters() - { - return $this->params; - } - - /** - * Get the value of this header prepared for rendering. - * - * @return string - */ - public function getFieldBody() //TODO: Check caching here - { - $body = parent::getFieldBody(); - foreach ($this->params as $name => $value) { - if (null !== $value) { - // Add the parameter - $body .= '; '.$this->createParameter($name, $value); - } - } - - return $body; - } - - /** - * Generate a list of all tokens in the final header. - * - * This doesn't need to be overridden in theory, but it is for implementation - * reasons to prevent potential breakage of attributes. - * - * @param string $string The string to tokenize - * - * @return array An array of tokens as strings - */ - protected function toTokens($string = null) - { - $tokens = parent::toTokens(parent::getFieldBody()); - - // Try creating any parameters - foreach ($this->params as $name => $value) { - if (null !== $value) { - // Add the semi-colon separator - $tokens[\count($tokens) - 1] .= ';'; - $tokens = array_merge($tokens, $this->generateTokenLines( - ' '.$this->createParameter($name, $value) - )); - } - } - - return $tokens; - } - - /** - * Render a RFC 2047 compliant header parameter from the $name and $value. - * - * @param string $name - * @param string $value - * - * @return string - */ - private function createParameter($name, $value) - { - $origValue = $value; - - $encoded = false; - // Allow room for parameter name, indices, "=" and DQUOTEs - $maxValueLength = $this->getMaxLineLength() - \strlen($name.'=*N"";') - 1; - $firstLineOffset = 0; - - // If it's not already a valid parameter value... - if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { - // TODO: text, or something else?? - // ... and it's not ascii - if (!preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $value)) { - $encoded = true; - // Allow space for the indices, charset and language - $maxValueLength = $this->getMaxLineLength() - \strlen($name.'*N*="";') - 1; - $firstLineOffset = \strlen( - $this->getCharset()."'".$this->getLanguage()."'" - ); - } - } - - // Encode if we need to - if ($encoded || \strlen($value) > $maxValueLength) { - if (isset($this->paramEncoder)) { - $value = $this->paramEncoder->encodeString( - $origValue, $firstLineOffset, $maxValueLength, $this->getCharset() - ); - } else { - // We have to go against RFC 2183/2231 in some areas for interoperability - $value = $this->getTokenAsEncodedWord($origValue); - $encoded = false; - } - } - - $valueLines = isset($this->paramEncoder) ? explode("\r\n", $value) : [$value]; - - // Need to add indices - if (\count($valueLines) > 1) { - $paramLines = []; - foreach ($valueLines as $i => $line) { - $paramLines[] = $name.'*'.$i. - $this->getEndOfParameterValue($line, true, 0 == $i); - } - - return implode(";\r\n ", $paramLines); - } else { - return $name.$this->getEndOfParameterValue( - $valueLines[0], $encoded, true - ); - } - } - - /** - * Returns the parameter value from the "=" and beyond. - * - * @param string $value to append - * @param bool $encoded - * @param bool $firstLine - * - * @return string - */ - private function getEndOfParameterValue($value, $encoded = false, $firstLine = false) - { - if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { - $value = '"'.$value.'"'; - } - $prepend = '='; - if ($encoded) { - $prepend = '*='; - if ($firstLine) { - $prepend = '*='.$this->getCharset()."'".$this->getLanguage(). - "'"; - } - } - - return $prepend.$value; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php deleted file mode 100644 index 81b421e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php +++ /dev/null @@ -1,153 +0,0 @@ -setFieldName($name); - $this->emailValidator = $emailValidator; - $this->addressEncoder = $addressEncoder ?? new Swift_AddressEncoder_IdnAddressEncoder(); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_PATH; - } - - /** - * Set the model for the field body. - * This method takes a string for an address. - * - * @param string $model - * - * @throws Swift_RfcComplianceException - */ - public function setFieldBodyModel($model) - { - $this->setAddress($model); - } - - /** - * Get the model for the field body. - * This method returns a string email address. - * - * @return mixed - */ - public function getFieldBodyModel() - { - return $this->getAddress(); - } - - /** - * Set the Address which should appear in this Header. - * - * @param string $address - * - * @throws Swift_RfcComplianceException - */ - public function setAddress($address) - { - if (null === $address) { - $this->address = null; - } elseif ('' == $address) { - $this->address = ''; - } else { - $this->assertValidAddress($address); - $this->address = $address; - } - $this->setCachedValue(null); - } - - /** - * Get the address which is used in this Header (if any). - * - * Null is returned if no address is set. - * - * @return string - */ - public function getAddress() - { - return $this->address; - } - - /** - * Get the string value of the body in this Header. - * - * This is not necessarily RFC 2822 compliant since folding white space will - * not be added at this stage (see {@link toString()} for that). - * - * @see toString() - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - if (isset($this->address)) { - $address = $this->addressEncoder->encodeString($this->address); - $this->setCachedValue('<'.$address.'>'); - } - } - - return $this->getCachedValue(); - } - - /** - * Throws an Exception if the address passed does not comply with RFC 2822. - * - * @param string $address - * - * @throws Swift_RfcComplianceException If address is invalid - */ - private function assertValidAddress($address) - { - if (!$this->emailValidator->isValid($address, new RFCValidation())) { - throw new Swift_RfcComplianceException('Address set in PathHeader does not comply with addr-spec of RFC 2822.'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php deleted file mode 100644 index 64f160d..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php +++ /dev/null @@ -1,109 +0,0 @@ -setFieldName($name); - $this->setEncoder($encoder); - } - - /** - * Get the type of Header that this instance represents. - * - * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX - * @see TYPE_DATE, TYPE_ID, TYPE_PATH - * - * @return int - */ - public function getFieldType() - { - return self::TYPE_TEXT; - } - - /** - * Set the model for the field body. - * - * This method takes a string for the field value. - * - * @param string $model - */ - public function setFieldBodyModel($model) - { - $this->setValue($model); - } - - /** - * Get the model for the field body. - * - * This method returns a string. - * - * @return string - */ - public function getFieldBodyModel() - { - return $this->getValue(); - } - - /** - * Get the (unencoded) value of this header. - * - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Set the (unencoded) value of this header. - * - * @param string $value - */ - public function setValue($value) - { - $this->clearCachedValueIf($this->value != $value); - $this->value = $value; - } - - /** - * Get the value of this header prepared for rendering. - * - * @return string - */ - public function getFieldBody() - { - if (!$this->getCachedValue()) { - $this->setCachedValue( - $this->encodeWords($this, $this->value) - ); - } - - return $this->getCachedValue(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/IdGenerator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/IdGenerator.php deleted file mode 100644 index 3ce35f2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/IdGenerator.php +++ /dev/null @@ -1,54 +0,0 @@ -idRight = $idRight; - } - - /** - * Returns the right-hand side of the "@" used in all generated IDs. - * - * @return string - */ - public function getIdRight() - { - return $this->idRight; - } - - /** - * Sets the right-hand side of the "@" to use in all generated IDs. - * - * @param string $idRight - */ - public function setIdRight($idRight) - { - $this->idRight = $idRight; - } - - /** - * @return string - */ - public function generateId() - { - // 32 hex values for the left part - return bin2hex(random_bytes(16)).'@'.$this->idRight; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php deleted file mode 100644 index fa0726a..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php +++ /dev/null @@ -1,199 +0,0 @@ -setContentType('text/plain'); - if (null !== $charset) { - $this->setCharset($charset); - } - } - - /** - * Set the body of this entity, either as a string, or as an instance of - * {@link Swift_OutputByteStream}. - * - * @param mixed $body - * @param string $contentType optional - * @param string $charset optional - * - * @return $this - */ - public function setBody($body, $contentType = null, $charset = null) - { - if (isset($charset)) { - $this->setCharset($charset); - } - $body = $this->convertString($body); - - parent::setBody($body, $contentType); - - return $this; - } - - /** - * Get the character set of this entity. - * - * @return string - */ - public function getCharset() - { - return $this->getHeaderParameter('Content-Type', 'charset'); - } - - /** - * Set the character set of this entity. - * - * @param string $charset - * - * @return $this - */ - public function setCharset($charset) - { - $this->setHeaderParameter('Content-Type', 'charset', $charset); - if ($charset !== $this->userCharset) { - $this->clearCache(); - } - $this->userCharset = $charset; - parent::charsetChanged($charset); - - return $this; - } - - /** - * Get the format of this entity (i.e. flowed or fixed). - * - * @return string - */ - public function getFormat() - { - return $this->getHeaderParameter('Content-Type', 'format'); - } - - /** - * Set the format of this entity (flowed or fixed). - * - * @param string $format - * - * @return $this - */ - public function setFormat($format) - { - $this->setHeaderParameter('Content-Type', 'format', $format); - $this->userFormat = $format; - - return $this; - } - - /** - * Test if delsp is being used for this entity. - * - * @return bool - */ - public function getDelSp() - { - return 'yes' === $this->getHeaderParameter('Content-Type', 'delsp'); - } - - /** - * Turn delsp on or off for this entity. - * - * @param bool $delsp - * - * @return $this - */ - public function setDelSp($delsp = true) - { - $this->setHeaderParameter('Content-Type', 'delsp', $delsp ? 'yes' : null); - $this->userDelSp = $delsp; - - return $this; - } - - /** - * Get the nesting level of this entity. - * - * @see LEVEL_TOP, LEVEL_ALTERNATIVE, LEVEL_MIXED, LEVEL_RELATED - * - * @return int - */ - public function getNestingLevel() - { - return $this->nestingLevel; - } - - /** - * Receive notification that the charset has changed on this document, or a - * parent document. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->setCharset($charset); - } - - /** Fix the content-type and encoding of this entity */ - protected function fixHeaders() - { - parent::fixHeaders(); - if (\count($this->getChildren())) { - $this->setHeaderParameter('Content-Type', 'charset', null); - $this->setHeaderParameter('Content-Type', 'format', null); - $this->setHeaderParameter('Content-Type', 'delsp', null); - } else { - $this->setCharset($this->userCharset); - $this->setFormat($this->userFormat); - $this->setDelSp($this->userDelSp); - } - } - - /** Set the nesting level of this entity */ - protected function setNestingLevel($level) - { - $this->nestingLevel = $level; - } - - /** Encode charset when charset is not utf-8 */ - protected function convertString($string) - { - $charset = strtolower($this->getCharset()); - if (!\in_array($charset, ['utf-8', 'iso-8859-1', 'iso-8859-15', ''])) { - return mb_convert_encoding($string, $charset, 'utf-8'); - } - - return $string; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php deleted file mode 100644 index b4345f4..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php +++ /dev/null @@ -1,194 +0,0 @@ -encoder = $encoder; - $this->paramEncoder = $paramEncoder; - $this->emailValidator = $emailValidator; - $this->charset = $charset; - $this->addressEncoder = $addressEncoder ?? new Swift_AddressEncoder_IdnAddressEncoder(); - } - - /** - * Create a new Mailbox Header with a list of $addresses. - * - * @param string $name - * @param array|string|null $addresses - * - * @return Swift_Mime_Header - */ - public function createMailboxHeader($name, $addresses = null) - { - $header = new Swift_Mime_Headers_MailboxHeader($name, $this->encoder, $this->emailValidator, $this->addressEncoder); - if (isset($addresses)) { - $header->setFieldBodyModel($addresses); - } - $this->setHeaderCharset($header); - - return $header; - } - - /** - * Create a new Date header using $dateTime. - * - * @param string $name - * - * @return Swift_Mime_Header - */ - public function createDateHeader($name, DateTimeInterface $dateTime = null) - { - $header = new Swift_Mime_Headers_DateHeader($name); - if (isset($dateTime)) { - $header->setFieldBodyModel($dateTime); - } - $this->setHeaderCharset($header); - - return $header; - } - - /** - * Create a new basic text header with $name and $value. - * - * @param string $name - * @param string $value - * - * @return Swift_Mime_Header - */ - public function createTextHeader($name, $value = null) - { - $header = new Swift_Mime_Headers_UnstructuredHeader($name, $this->encoder); - if (isset($value)) { - $header->setFieldBodyModel($value); - } - $this->setHeaderCharset($header); - - return $header; - } - - /** - * Create a new ParameterizedHeader with $name, $value and $params. - * - * @param string $name - * @param string $value - * @param array $params - * - * @return Swift_Mime_Headers_ParameterizedHeader - */ - public function createParameterizedHeader($name, $value = null, $params = []) - { - $header = new Swift_Mime_Headers_ParameterizedHeader($name, $this->encoder, ('content-disposition' == strtolower($name)) ? $this->paramEncoder : null); - if (isset($value)) { - $header->setFieldBodyModel($value); - } - foreach ($params as $k => $v) { - $header->setParameter($k, $v); - } - $this->setHeaderCharset($header); - - return $header; - } - - /** - * Create a new ID header for Message-ID or Content-ID. - * - * @param string $name - * @param string|array $ids - * - * @return Swift_Mime_Header - */ - public function createIdHeader($name, $ids = null) - { - $header = new Swift_Mime_Headers_IdentificationHeader($name, $this->emailValidator); - if (isset($ids)) { - $header->setFieldBodyModel($ids); - } - $this->setHeaderCharset($header); - - return $header; - } - - /** - * Create a new Path header with an address (path) in it. - * - * @param string $name - * @param string $path - * - * @return Swift_Mime_Header - */ - public function createPathHeader($name, $path = null) - { - $header = new Swift_Mime_Headers_PathHeader($name, $this->emailValidator); - if (isset($path)) { - $header->setFieldBodyModel($path); - } - $this->setHeaderCharset($header); - - return $header; - } - - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->charset = $charset; - $this->encoder->charsetChanged($charset); - $this->paramEncoder->charsetChanged($charset); - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->encoder = clone $this->encoder; - $this->paramEncoder = clone $this->paramEncoder; - } - - /** Apply the charset to the Header */ - private function setHeaderCharset(Swift_Mime_Header $header) - { - if (isset($this->charset)) { - $header->setCharset($this->charset); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php deleted file mode 100644 index d55cf66..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php +++ /dev/null @@ -1,399 +0,0 @@ -factory = $factory; - if (isset($charset)) { - $this->setCharset($charset); - } - } - - public function newInstance() - { - return new self($this->factory); - } - - /** - * Set the charset used by these headers. - * - * @param string $charset - */ - public function setCharset($charset) - { - $this->charset = $charset; - $this->factory->charsetChanged($charset); - $this->notifyHeadersOfCharset($charset); - } - - /** - * Add a new Mailbox Header with a list of $addresses. - * - * @param string $name - * @param array|string $addresses - */ - public function addMailboxHeader($name, $addresses = null) - { - $this->storeHeader($name, $this->factory->createMailboxHeader($name, $addresses)); - } - - /** - * Add a new Date header using $dateTime. - * - * @param string $name - */ - public function addDateHeader($name, DateTimeInterface $dateTime = null) - { - $this->storeHeader($name, $this->factory->createDateHeader($name, $dateTime)); - } - - /** - * Add a new basic text header with $name and $value. - * - * @param string $name - * @param string $value - */ - public function addTextHeader($name, $value = null) - { - $this->storeHeader($name, $this->factory->createTextHeader($name, $value)); - } - - /** - * Add a new ParameterizedHeader with $name, $value and $params. - * - * @param string $name - * @param string $value - * @param array $params - */ - public function addParameterizedHeader($name, $value = null, $params = []) - { - $this->storeHeader($name, $this->factory->createParameterizedHeader($name, $value, $params)); - } - - /** - * Add a new ID header for Message-ID or Content-ID. - * - * @param string $name - * @param string|array $ids - */ - public function addIdHeader($name, $ids = null) - { - $this->storeHeader($name, $this->factory->createIdHeader($name, $ids)); - } - - /** - * Add a new Path header with an address (path) in it. - * - * @param string $name - * @param string $path - */ - public function addPathHeader($name, $path = null) - { - $this->storeHeader($name, $this->factory->createPathHeader($name, $path)); - } - - /** - * Returns true if at least one header with the given $name exists. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - * - * @return bool - */ - public function has($name, $index = 0) - { - $lowerName = strtolower($name); - - if (!\array_key_exists($lowerName, $this->headers)) { - return false; - } - - if (\func_num_args() < 2) { - // index was not specified, so we only need to check that there is at least one header value set - return (bool) \count($this->headers[$lowerName]); - } - - return \array_key_exists($index, $this->headers[$lowerName]); - } - - /** - * Set a header in the HeaderSet. - * - * The header may be a previously fetched header via {@link get()} or it may - * be one that has been created separately. - * - * If $index is specified, the header will be inserted into the set at this - * offset. - * - * @param int $index - */ - public function set(Swift_Mime_Header $header, $index = 0) - { - $this->storeHeader($header->getFieldName(), $header, $index); - } - - /** - * Get the header with the given $name. - * - * If multiple headers match, the actual one may be specified by $index. - * Returns NULL if none present. - * - * @param string $name - * @param int $index - * - * @return Swift_Mime_Header - */ - public function get($name, $index = 0) - { - $name = strtolower($name); - - if (\func_num_args() < 2) { - if ($this->has($name)) { - $values = array_values($this->headers[$name]); - - return array_shift($values); - } - } else { - if ($this->has($name, $index)) { - return $this->headers[$name][$index]; - } - } - } - - /** - * Get all headers with the given $name. - * - * @param string $name - * - * @return array - */ - public function getAll($name = null) - { - if (!isset($name)) { - $headers = []; - foreach ($this->headers as $collection) { - $headers = array_merge($headers, $collection); - } - - return $headers; - } - - $lowerName = strtolower($name); - if (!\array_key_exists($lowerName, $this->headers)) { - return []; - } - - return $this->headers[$lowerName]; - } - - /** - * Return the name of all Headers. - * - * @return array - */ - public function listAll() - { - $headers = $this->headers; - if ($this->canSort()) { - uksort($headers, [$this, 'sortHeaders']); - } - - return array_keys($headers); - } - - /** - * Remove the header with the given $name if it's set. - * - * If multiple headers match, the actual one may be specified by $index. - * - * @param string $name - * @param int $index - */ - public function remove($name, $index = 0) - { - $lowerName = strtolower($name); - unset($this->headers[$lowerName][$index]); - } - - /** - * Remove all headers with the given $name. - * - * @param string $name - */ - public function removeAll($name) - { - $lowerName = strtolower($name); - unset($this->headers[$lowerName]); - } - - /** - * Define a list of Header names as an array in the correct order. - * - * These Headers will be output in the given order where present. - */ - public function defineOrdering(array $sequence) - { - $this->order = array_flip(array_map('strtolower', $sequence)); - } - - /** - * Set a list of header names which must always be displayed when set. - * - * Usually headers without a field value won't be output unless set here. - */ - public function setAlwaysDisplayed(array $names) - { - $this->required = array_flip(array_map('strtolower', $names)); - } - - /** - * Notify this observer that the entity's charset has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->setCharset($charset); - } - - /** - * Returns a string with a representation of all headers. - * - * @return string - */ - public function toString() - { - $string = ''; - $headers = $this->headers; - if ($this->canSort()) { - uksort($headers, [$this, 'sortHeaders']); - } - foreach ($headers as $collection) { - foreach ($collection as $header) { - if ($this->isDisplayed($header) || '' != $header->getFieldBody()) { - $string .= $header->toString(); - } - } - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @return string - * - * @see toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** Save a Header to the internal collection */ - private function storeHeader($name, Swift_Mime_Header $header, $offset = null) - { - if (!isset($this->headers[strtolower($name)])) { - $this->headers[strtolower($name)] = []; - } - if (!isset($offset)) { - $this->headers[strtolower($name)][] = $header; - } else { - $this->headers[strtolower($name)][$offset] = $header; - } - } - - /** Test if the headers can be sorted */ - private function canSort() - { - return \count($this->order) > 0; - } - - /** uksort() algorithm for Header ordering */ - private function sortHeaders($a, $b) - { - $lowerA = strtolower($a); - $lowerB = strtolower($b); - $aPos = \array_key_exists($lowerA, $this->order) ? $this->order[$lowerA] : -1; - $bPos = \array_key_exists($lowerB, $this->order) ? $this->order[$lowerB] : -1; - - if (-1 === $aPos && -1 === $bPos) { - // just be sure to be determinist here - return $a > $b ? -1 : 1; - } - - if (-1 == $aPos) { - return 1; - } elseif (-1 == $bPos) { - return -1; - } - - return $aPos < $bPos ? -1 : 1; - } - - /** Test if the given Header is always displayed */ - private function isDisplayed(Swift_Mime_Header $header) - { - return \array_key_exists(strtolower($header->getFieldName()), $this->required); - } - - /** Notify all Headers of the new charset */ - private function notifyHeadersOfCharset($charset) - { - foreach ($this->headers as $headerGroup) { - foreach ($headerGroup as $header) { - $header->setCharset($charset); - } - } - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->factory = clone $this->factory; - foreach ($this->headers as $groupKey => $headerGroup) { - foreach ($headerGroup as $key => $header) { - $this->headers[$groupKey][$key] = clone $header; - } - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php deleted file mode 100644 index 62da165..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php +++ /dev/null @@ -1,642 +0,0 @@ -getHeaders()->defineOrdering([ - 'Return-Path', - 'Received', - 'DKIM-Signature', - 'DomainKey-Signature', - 'Sender', - 'Message-ID', - 'Date', - 'Subject', - 'From', - 'Reply-To', - 'To', - 'Cc', - 'Bcc', - 'MIME-Version', - 'Content-Type', - 'Content-Transfer-Encoding', - ]); - $this->getHeaders()->setAlwaysDisplayed(['Date', 'Message-ID', 'From']); - $this->getHeaders()->addTextHeader('MIME-Version', '1.0'); - $this->setDate(new DateTimeImmutable()); - $this->setId($this->getId()); - $this->getHeaders()->addMailboxHeader('From'); - } - - /** - * Always returns {@link LEVEL_TOP} for a message instance. - * - * @return int - */ - public function getNestingLevel() - { - return self::LEVEL_TOP; - } - - /** - * Set the subject of this message. - * - * @param string $subject - * - * @return $this - */ - public function setSubject($subject) - { - if (!$this->setHeaderFieldModel('Subject', $subject)) { - $this->getHeaders()->addTextHeader('Subject', $subject); - } - - return $this; - } - - /** - * Get the subject of this message. - * - * @return string - */ - public function getSubject() - { - return $this->getHeaderFieldModel('Subject'); - } - - /** - * Set the date at which this message was created. - * - * @return $this - */ - public function setDate(DateTimeInterface $dateTime) - { - if (!$this->setHeaderFieldModel('Date', $dateTime)) { - $this->getHeaders()->addDateHeader('Date', $dateTime); - } - - return $this; - } - - /** - * Get the date at which this message was created. - * - * @return DateTimeInterface - */ - public function getDate() - { - return $this->getHeaderFieldModel('Date'); - } - - /** - * Set the return-path (the bounce address) of this message. - * - * @param string $address - * - * @return $this - */ - public function setReturnPath($address) - { - if (!$this->setHeaderFieldModel('Return-Path', $address)) { - $this->getHeaders()->addPathHeader('Return-Path', $address); - } - - return $this; - } - - /** - * Get the return-path (bounce address) of this message. - * - * @return string - */ - public function getReturnPath() - { - return $this->getHeaderFieldModel('Return-Path'); - } - - /** - * Set the sender of this message. - * - * This does not override the From field, but it has a higher significance. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function setSender($address, $name = null) - { - if (!\is_array($address) && isset($name)) { - $address = [$address => $name]; - } - - if (!$this->setHeaderFieldModel('Sender', (array) $address)) { - $this->getHeaders()->addMailboxHeader('Sender', (array) $address); - } - - return $this; - } - - /** - * Get the sender of this message. - * - * @return string - */ - public function getSender() - { - return $this->getHeaderFieldModel('Sender'); - } - - /** - * Add a From: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addFrom($address, $name = null) - { - $current = $this->getFrom(); - $current[$address] = $name; - - return $this->setFrom($current); - } - - /** - * Set the from address of this message. - * - * You may pass an array of addresses if this message is from multiple people. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param string|array $addresses - * @param string $name optional - * - * @return $this - */ - public function setFrom($addresses, $name = null) - { - if (!\is_array($addresses) && isset($name)) { - $addresses = [$addresses => $name]; - } - - if (!$this->setHeaderFieldModel('From', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('From', (array) $addresses); - } - - return $this; - } - - /** - * Get the from address of this message. - * - * @return mixed - */ - public function getFrom() - { - return $this->getHeaderFieldModel('From'); - } - - /** - * Add a Reply-To: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addReplyTo($address, $name = null) - { - $current = $this->getReplyTo(); - $current[$address] = $name; - - return $this->setReplyTo($current); - } - - /** - * Set the reply-to address of this message. - * - * You may pass an array of addresses if replies will go to multiple people. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setReplyTo($addresses, $name = null) - { - if (!\is_array($addresses) && isset($name)) { - $addresses = [$addresses => $name]; - } - - if (!$this->setHeaderFieldModel('Reply-To', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Reply-To', (array) $addresses); - } - - return $this; - } - - /** - * Get the reply-to address of this message. - * - * @return string - */ - public function getReplyTo() - { - return $this->getHeaderFieldModel('Reply-To'); - } - - /** - * Add a To: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addTo($address, $name = null) - { - $current = $this->getTo(); - $current[$address] = $name; - - return $this->setTo($current); - } - - /** - * Set the to addresses of this message. - * - * If multiple recipients will receive the message an array should be used. - * Example: array('receiver@domain.org', 'other@domain.org' => 'A name') - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setTo($addresses, $name = null) - { - if (!\is_array($addresses) && isset($name)) { - $addresses = [$addresses => $name]; - } - - if (!$this->setHeaderFieldModel('To', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('To', (array) $addresses); - } - - return $this; - } - - /** - * Get the To addresses of this message. - * - * @return array - */ - public function getTo() - { - return $this->getHeaderFieldModel('To'); - } - - /** - * Add a Cc: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addCc($address, $name = null) - { - $current = $this->getCc(); - $current[$address] = $name; - - return $this->setCc($current); - } - - /** - * Set the Cc addresses of this message. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setCc($addresses, $name = null) - { - if (!\is_array($addresses) && isset($name)) { - $addresses = [$addresses => $name]; - } - - if (!$this->setHeaderFieldModel('Cc', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Cc', (array) $addresses); - } - - return $this; - } - - /** - * Get the Cc address of this message. - * - * @return array - */ - public function getCc() - { - return $this->getHeaderFieldModel('Cc'); - } - - /** - * Add a Bcc: address to this message. - * - * If $name is passed this name will be associated with the address. - * - * @param string $address - * @param string $name optional - * - * @return $this - */ - public function addBcc($address, $name = null) - { - $current = $this->getBcc(); - $current[$address] = $name; - - return $this->setBcc($current); - } - - /** - * Set the Bcc addresses of this message. - * - * If $name is passed and the first parameter is a string, this name will be - * associated with the address. - * - * @param mixed $addresses - * @param string $name optional - * - * @return $this - */ - public function setBcc($addresses, $name = null) - { - if (!\is_array($addresses) && isset($name)) { - $addresses = [$addresses => $name]; - } - - if (!$this->setHeaderFieldModel('Bcc', (array) $addresses)) { - $this->getHeaders()->addMailboxHeader('Bcc', (array) $addresses); - } - - return $this; - } - - /** - * Get the Bcc addresses of this message. - * - * @return array - */ - public function getBcc() - { - return $this->getHeaderFieldModel('Bcc'); - } - - /** - * Set the priority of this message. - * - * The value is an integer where 1 is the highest priority and 5 is the lowest. - * - * @param int $priority - * - * @return $this - */ - public function setPriority($priority) - { - $priorityMap = [ - self::PRIORITY_HIGHEST => 'Highest', - self::PRIORITY_HIGH => 'High', - self::PRIORITY_NORMAL => 'Normal', - self::PRIORITY_LOW => 'Low', - self::PRIORITY_LOWEST => 'Lowest', - ]; - $pMapKeys = array_keys($priorityMap); - if ($priority > max($pMapKeys)) { - $priority = max($pMapKeys); - } elseif ($priority < min($pMapKeys)) { - $priority = min($pMapKeys); - } - if (!$this->setHeaderFieldModel('X-Priority', - sprintf('%d (%s)', $priority, $priorityMap[$priority]))) { - $this->getHeaders()->addTextHeader('X-Priority', - sprintf('%d (%s)', $priority, $priorityMap[$priority])); - } - - return $this; - } - - /** - * Get the priority of this message. - * - * The returned value is an integer where 1 is the highest priority and 5 - * is the lowest. - * - * @return int - */ - public function getPriority() - { - list($priority) = sscanf($this->getHeaderFieldModel('X-Priority'), - '%[1-5]' - ); - - return $priority ?? 3; - } - - /** - * Ask for a delivery receipt from the recipient to be sent to $addresses. - * - * @param array $addresses - * - * @return $this - */ - public function setReadReceiptTo($addresses) - { - if (!$this->setHeaderFieldModel('Disposition-Notification-To', $addresses)) { - $this->getHeaders() - ->addMailboxHeader('Disposition-Notification-To', $addresses); - } - - return $this; - } - - /** - * Get the addresses to which a read-receipt will be sent. - * - * @return string - */ - public function getReadReceiptTo() - { - return $this->getHeaderFieldModel('Disposition-Notification-To'); - } - - /** - * Attach a {@link Swift_Mime_SimpleMimeEntity} such as an Attachment or MimePart. - * - * @return $this - */ - public function attach(Swift_Mime_SimpleMimeEntity $entity) - { - $this->setChildren(array_merge($this->getChildren(), [$entity])); - - return $this; - } - - /** - * Remove an already attached entity. - * - * @return $this - */ - public function detach(Swift_Mime_SimpleMimeEntity $entity) - { - $newChildren = []; - foreach ($this->getChildren() as $child) { - if ($entity !== $child) { - $newChildren[] = $child; - } - } - $this->setChildren($newChildren); - - return $this; - } - - /** - * Attach a {@link Swift_Mime_SimpleMimeEntity} and return it's CID source. - * - * This method should be used when embedding images or other data in a message. - * - * @return string - */ - public function embed(Swift_Mime_SimpleMimeEntity $entity) - { - $this->attach($entity); - - return 'cid:'.$entity->getId(); - } - - /** - * Get this message as a complete string. - * - * @return string - */ - public function toString() - { - if (\count($children = $this->getChildren()) > 0 && '' != $this->getBody()) { - $this->setChildren(array_merge([$this->becomeMimePart()], $children)); - $string = parent::toString(); - $this->setChildren($children); - } else { - $string = parent::toString(); - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @see toString() - * - * @return string - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Write this message to a {@link Swift_InputByteStream}. - */ - public function toByteStream(Swift_InputByteStream $is) - { - if (\count($children = $this->getChildren()) > 0 && '' != $this->getBody()) { - $this->setChildren(array_merge([$this->becomeMimePart()], $children)); - parent::toByteStream($is); - $this->setChildren($children); - } else { - parent::toByteStream($is); - } - } - - /** @see Swift_Mime_SimpleMimeEntity::getIdField() */ - protected function getIdField() - { - return 'Message-ID'; - } - - /** Turn the body of this message into a child of itself if needed */ - protected function becomeMimePart() - { - $part = new parent($this->getHeaders()->newInstance(), $this->getEncoder(), - $this->getCache(), $this->getIdGenerator(), $this->userCharset - ); - $part->setContentType($this->userContentType); - $part->setBody($this->getBody()); - $part->setFormat($this->userFormat); - $part->setDelSp($this->userDelSp); - $part->setNestingLevel($this->getTopNestingLevel()); - - return $part; - } - - /** Get the highest nesting level nested inside this message */ - private function getTopNestingLevel() - { - $highestLevel = $this->getNestingLevel(); - foreach ($this->getChildren() as $child) { - $childLevel = $child->getNestingLevel(); - if ($highestLevel < $childLevel) { - $highestLevel = $childLevel; - } - } - - return $highestLevel; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php deleted file mode 100644 index fa18aa8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php +++ /dev/null @@ -1,826 +0,0 @@ - [self::LEVEL_TOP, self::LEVEL_MIXED], - 'multipart/alternative' => [self::LEVEL_MIXED, self::LEVEL_ALTERNATIVE], - 'multipart/related' => [self::LEVEL_ALTERNATIVE, self::LEVEL_RELATED], - ]; - - /** A set of filter rules to define what level an entity should be nested at */ - private $compoundLevelFilters = []; - - /** The nesting level of this entity */ - private $nestingLevel = self::LEVEL_ALTERNATIVE; - - /** A KeyCache instance used during encoding and streaming */ - private $cache; - - /** Direct descendants of this entity */ - private $immediateChildren = []; - - /** All descendants of this entity */ - private $children = []; - - /** The maximum line length of the body of this entity */ - private $maxLineLength = 78; - - /** The order in which alternative mime types should appear */ - private $alternativePartOrder = [ - 'text/plain' => 1, - 'text/html' => 2, - 'multipart/related' => 3, - ]; - - /** The CID of this entity */ - private $id; - - /** The key used for accessing the cache */ - private $cacheKey; - - protected $userContentType; - - /** - * Create a new SimpleMimeEntity with $headers, $encoder and $cache. - */ - public function __construct(Swift_Mime_SimpleHeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator) - { - $this->cacheKey = bin2hex(random_bytes(16)); // set 32 hex values - $this->cache = $cache; - $this->headers = $headers; - $this->idGenerator = $idGenerator; - $this->setEncoder($encoder); - $this->headers->defineOrdering(['Content-Type', 'Content-Transfer-Encoding']); - - // This array specifies that, when the entire MIME document contains - // $compoundLevel, then for each child within $level, if its Content-Type - // is $contentType then it should be treated as if it's level is - // $neededLevel instead. I tried to write that unambiguously! :-\ - // Data Structure: - // array ( - // $compoundLevel => array( - // $level => array( - // $contentType => $neededLevel - // ) - // ) - // ) - - $this->compoundLevelFilters = [ - (self::LEVEL_ALTERNATIVE + self::LEVEL_RELATED) => [ - self::LEVEL_ALTERNATIVE => [ - 'text/plain' => self::LEVEL_ALTERNATIVE, - 'text/html' => self::LEVEL_RELATED, - ], - ], - ]; - - $this->id = $this->idGenerator->generateId(); - } - - /** - * Generate a new Content-ID or Message-ID for this MIME entity. - * - * @return string - */ - public function generateId() - { - $this->setId($this->idGenerator->generateId()); - - return $this->id; - } - - /** - * Get the {@link Swift_Mime_SimpleHeaderSet} for this entity. - * - * @return Swift_Mime_SimpleHeaderSet - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Get the nesting level of this entity. - * - * @see LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE - * - * @return int - */ - public function getNestingLevel() - { - return $this->nestingLevel; - } - - /** - * Get the Content-type of this entity. - * - * @return string - */ - public function getContentType() - { - return $this->getHeaderFieldModel('Content-Type'); - } - - /** - * Get the Body Content-type of this entity. - * - * @return string - */ - public function getBodyContentType() - { - return $this->userContentType; - } - - /** - * Set the Content-type of this entity. - * - * @param string $type - * - * @return $this - */ - public function setContentType($type) - { - $this->setContentTypeInHeaders($type); - // Keep track of the value so that if the content-type changes automatically - // due to added child entities, it can be restored if they are later removed - $this->userContentType = $type; - - return $this; - } - - /** - * Get the CID of this entity. - * - * The CID will only be present in headers if a Content-ID header is present. - * - * @return string - */ - public function getId() - { - $tmp = (array) $this->getHeaderFieldModel($this->getIdField()); - - return $this->headers->has($this->getIdField()) ? current($tmp) : $this->id; - } - - /** - * Set the CID of this entity. - * - * @param string $id - * - * @return $this - */ - public function setId($id) - { - if (!$this->setHeaderFieldModel($this->getIdField(), $id)) { - $this->headers->addIdHeader($this->getIdField(), $id); - } - $this->id = $id; - - return $this; - } - - /** - * Get the description of this entity. - * - * This value comes from the Content-Description header if set. - * - * @return string - */ - public function getDescription() - { - return $this->getHeaderFieldModel('Content-Description'); - } - - /** - * Set the description of this entity. - * - * This method sets a value in the Content-ID header. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - if (!$this->setHeaderFieldModel('Content-Description', $description)) { - $this->headers->addTextHeader('Content-Description', $description); - } - - return $this; - } - - /** - * Get the maximum line length of the body of this entity. - * - * @return int - */ - public function getMaxLineLength() - { - return $this->maxLineLength; - } - - /** - * Set the maximum line length of lines in this body. - * - * Though not enforced by the library, lines should not exceed 1000 chars. - * - * @param int $length - * - * @return $this - */ - public function setMaxLineLength($length) - { - $this->maxLineLength = $length; - - return $this; - } - - /** - * Get all children added to this entity. - * - * @return Swift_Mime_SimpleMimeEntity[] - */ - public function getChildren() - { - return $this->children; - } - - /** - * Set all children of this entity. - * - * @param Swift_Mime_SimpleMimeEntity[] $children - * @param int $compoundLevel For internal use only - * - * @return $this - */ - public function setChildren(array $children, $compoundLevel = null) - { - // TODO: Try to refactor this logic - $compoundLevel = $compoundLevel ?? $this->getCompoundLevel($children); - $immediateChildren = []; - $grandchildren = []; - $newContentType = $this->userContentType; - - foreach ($children as $child) { - $level = $this->getNeededChildLevel($child, $compoundLevel); - if (empty($immediateChildren)) { - //first iteration - $immediateChildren = [$child]; - } else { - $nextLevel = $this->getNeededChildLevel($immediateChildren[0], $compoundLevel); - if ($nextLevel == $level) { - $immediateChildren[] = $child; - } elseif ($level < $nextLevel) { - // Re-assign immediateChildren to grandchildren - $grandchildren = array_merge($grandchildren, $immediateChildren); - // Set new children - $immediateChildren = [$child]; - } else { - $grandchildren[] = $child; - } - } - } - - if ($immediateChildren) { - $lowestLevel = $this->getNeededChildLevel($immediateChildren[0], $compoundLevel); - - // Determine which composite media type is needed to accommodate the - // immediate children - foreach ($this->compositeRanges as $mediaType => $range) { - if ($lowestLevel > $range[0] && $lowestLevel <= $range[1]) { - $newContentType = $mediaType; - - break; - } - } - - // Put any grandchildren in a subpart - if (!empty($grandchildren)) { - $subentity = $this->createChild(); - $subentity->setNestingLevel($lowestLevel); - $subentity->setChildren($grandchildren, $compoundLevel); - array_unshift($immediateChildren, $subentity); - } - } - - $this->immediateChildren = $immediateChildren; - $this->children = $children; - $this->setContentTypeInHeaders($newContentType); - $this->fixHeaders(); - $this->sortChildren(); - - return $this; - } - - /** - * Get the body of this entity as a string. - * - * @return string - */ - public function getBody() - { - return $this->body instanceof Swift_OutputByteStream ? $this->readStream($this->body) : $this->body; - } - - /** - * Set the body of this entity, either as a string, or as an instance of - * {@link Swift_OutputByteStream}. - * - * @param mixed $body - * @param string $contentType optional - * - * @return $this - */ - public function setBody($body, $contentType = null) - { - if ($body !== $this->body) { - $this->clearCache(); - } - - $this->body = $body; - if (null !== $contentType) { - $this->setContentType($contentType); - } - - return $this; - } - - /** - * Get the encoder used for the body of this entity. - * - * @return Swift_Mime_ContentEncoder - */ - public function getEncoder() - { - return $this->encoder; - } - - /** - * Set the encoder used for the body of this entity. - * - * @return $this - */ - public function setEncoder(Swift_Mime_ContentEncoder $encoder) - { - if ($encoder !== $this->encoder) { - $this->clearCache(); - } - - $this->encoder = $encoder; - $this->setEncoding($encoder->getName()); - $this->notifyEncoderChanged($encoder); - - return $this; - } - - /** - * Get the boundary used to separate children in this entity. - * - * @return string - */ - public function getBoundary() - { - if (!isset($this->boundary)) { - $this->boundary = '_=_swift_'.time().'_'.bin2hex(random_bytes(16)).'_=_'; - } - - return $this->boundary; - } - - /** - * Set the boundary used to separate children in this entity. - * - * @param string $boundary - * - * @throws Swift_RfcComplianceException - * - * @return $this - */ - public function setBoundary($boundary) - { - $this->assertValidBoundary($boundary); - $this->boundary = $boundary; - - return $this; - } - - /** - * Receive notification that the charset of this entity, or a parent entity - * has changed. - * - * @param string $charset - */ - public function charsetChanged($charset) - { - $this->notifyCharsetChanged($charset); - } - - /** - * Receive notification that the encoder of this entity or a parent entity - * has changed. - */ - public function encoderChanged(Swift_Mime_ContentEncoder $encoder) - { - $this->notifyEncoderChanged($encoder); - } - - /** - * Get this entire entity as a string. - * - * @return string - */ - public function toString() - { - $string = $this->headers->toString(); - $string .= $this->bodyToString(); - - return $string; - } - - /** - * Get this entire entity as a string. - * - * @return string - */ - protected function bodyToString() - { - $string = ''; - - if (isset($this->body) && empty($this->immediateChildren)) { - if ($this->cache->hasKey($this->cacheKey, 'body')) { - $body = $this->cache->getString($this->cacheKey, 'body'); - } else { - $body = "\r\n".$this->encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()); - $this->cache->setString($this->cacheKey, 'body', $body, Swift_KeyCache::MODE_WRITE); - } - $string .= $body; - } - - if (!empty($this->immediateChildren)) { - foreach ($this->immediateChildren as $child) { - $string .= "\r\n\r\n--".$this->getBoundary()."\r\n"; - $string .= $child->toString(); - } - $string .= "\r\n\r\n--".$this->getBoundary()."--\r\n"; - } - - return $string; - } - - /** - * Returns a string representation of this object. - * - * @see toString() - * - * @return string - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Write this entire entity to a {@see Swift_InputByteStream}. - */ - public function toByteStream(Swift_InputByteStream $is) - { - $is->write($this->headers->toString()); - $is->commit(); - - $this->bodyToByteStream($is); - } - - /** - * Write this entire entity to a {@link Swift_InputByteStream}. - */ - protected function bodyToByteStream(Swift_InputByteStream $is) - { - if (empty($this->immediateChildren)) { - if (isset($this->body)) { - if ($this->cache->hasKey($this->cacheKey, 'body')) { - $this->cache->exportToByteStream($this->cacheKey, 'body', $is); - } else { - $cacheIs = $this->cache->getInputByteStream($this->cacheKey, 'body'); - if ($cacheIs) { - $is->bind($cacheIs); - } - - $is->write("\r\n"); - - if ($this->body instanceof Swift_OutputByteStream) { - $this->body->setReadPointer(0); - - $this->encoder->encodeByteStream($this->body, $is, 0, $this->getMaxLineLength()); - } else { - $is->write($this->encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength())); - } - - if ($cacheIs) { - $is->unbind($cacheIs); - } - } - } - } - - if (!empty($this->immediateChildren)) { - foreach ($this->immediateChildren as $child) { - $is->write("\r\n\r\n--".$this->getBoundary()."\r\n"); - $child->toByteStream($is); - } - $is->write("\r\n\r\n--".$this->getBoundary()."--\r\n"); - } - } - - /** - * Get the name of the header that provides the ID of this entity. - */ - protected function getIdField() - { - return 'Content-ID'; - } - - /** - * Get the model data (usually an array or a string) for $field. - */ - protected function getHeaderFieldModel($field) - { - if ($this->headers->has($field)) { - return $this->headers->get($field)->getFieldBodyModel(); - } - } - - /** - * Set the model data for $field. - */ - protected function setHeaderFieldModel($field, $model) - { - if ($this->headers->has($field)) { - $this->headers->get($field)->setFieldBodyModel($model); - - return true; - } - - return false; - } - - /** - * Get the parameter value of $parameter on $field header. - */ - protected function getHeaderParameter($field, $parameter) - { - if ($this->headers->has($field)) { - return $this->headers->get($field)->getParameter($parameter); - } - } - - /** - * Set the parameter value of $parameter on $field header. - */ - protected function setHeaderParameter($field, $parameter, $value) - { - if ($this->headers->has($field)) { - $this->headers->get($field)->setParameter($parameter, $value); - - return true; - } - - return false; - } - - /** - * Re-evaluate what content type and encoding should be used on this entity. - */ - protected function fixHeaders() - { - if (\count($this->immediateChildren)) { - $this->setHeaderParameter('Content-Type', 'boundary', - $this->getBoundary() - ); - $this->headers->remove('Content-Transfer-Encoding'); - } else { - $this->setHeaderParameter('Content-Type', 'boundary', null); - $this->setEncoding($this->encoder->getName()); - } - } - - /** - * Get the KeyCache used in this entity. - * - * @return Swift_KeyCache - */ - protected function getCache() - { - return $this->cache; - } - - /** - * Get the ID generator. - * - * @return Swift_IdGenerator - */ - protected function getIdGenerator() - { - return $this->idGenerator; - } - - /** - * Empty the KeyCache for this entity. - */ - protected function clearCache() - { - $this->cache->clearKey($this->cacheKey, 'body'); - } - - private function readStream(Swift_OutputByteStream $os) - { - $string = ''; - while (false !== $bytes = $os->read(8192)) { - $string .= $bytes; - } - - $os->setReadPointer(0); - - return $string; - } - - private function setEncoding($encoding) - { - if (!$this->setHeaderFieldModel('Content-Transfer-Encoding', $encoding)) { - $this->headers->addTextHeader('Content-Transfer-Encoding', $encoding); - } - } - - private function assertValidBoundary($boundary) - { - if (!preg_match('/^[a-z0-9\'\(\)\+_\-,\.\/:=\?\ ]{0,69}[a-z0-9\'\(\)\+_\-,\.\/:=\?]$/Di', $boundary)) { - throw new Swift_RfcComplianceException('Mime boundary set is not RFC 2046 compliant.'); - } - } - - private function setContentTypeInHeaders($type) - { - if (!$this->setHeaderFieldModel('Content-Type', $type)) { - $this->headers->addParameterizedHeader('Content-Type', $type); - } - } - - private function setNestingLevel($level) - { - $this->nestingLevel = $level; - } - - private function getCompoundLevel($children) - { - $level = 0; - foreach ($children as $child) { - $level |= $child->getNestingLevel(); - } - - return $level; - } - - private function getNeededChildLevel($child, $compoundLevel) - { - $filter = []; - foreach ($this->compoundLevelFilters as $bitmask => $rules) { - if (($compoundLevel & $bitmask) === $bitmask) { - $filter = $rules + $filter; - } - } - - $realLevel = $child->getNestingLevel(); - $lowercaseType = strtolower($child->getContentType()); - - if (isset($filter[$realLevel]) && isset($filter[$realLevel][$lowercaseType])) { - return $filter[$realLevel][$lowercaseType]; - } - - return $realLevel; - } - - private function createChild() - { - return new self($this->headers->newInstance(), $this->encoder, $this->cache, $this->idGenerator); - } - - private function notifyEncoderChanged(Swift_Mime_ContentEncoder $encoder) - { - foreach ($this->immediateChildren as $child) { - $child->encoderChanged($encoder); - } - } - - private function notifyCharsetChanged($charset) - { - $this->encoder->charsetChanged($charset); - $this->headers->charsetChanged($charset); - foreach ($this->immediateChildren as $child) { - $child->charsetChanged($charset); - } - } - - private function sortChildren() - { - $shouldSort = false; - foreach ($this->immediateChildren as $child) { - // NOTE: This include alternative parts moved into a related part - if (self::LEVEL_ALTERNATIVE == $child->getNestingLevel()) { - $shouldSort = true; - break; - } - } - - // Sort in order of preference, if there is one - if ($shouldSort) { - // Group the messages by order of preference - $sorted = []; - foreach ($this->immediateChildren as $child) { - $type = $child->getContentType(); - $level = \array_key_exists($type, $this->alternativePartOrder) ? $this->alternativePartOrder[$type] : max($this->alternativePartOrder) + 1; - - if (empty($sorted[$level])) { - $sorted[$level] = []; - } - - $sorted[$level][] = $child; - } - - ksort($sorted); - - $this->immediateChildren = array_reduce($sorted, 'array_merge', []); - } - } - - /** - * Empties it's own contents from the cache. - */ - public function __destruct() - { - if ($this->cache instanceof Swift_KeyCache) { - $this->cache->clearAll($this->cacheKey); - } - } - - /** - * Make a deep copy of object. - */ - public function __clone() - { - $this->headers = clone $this->headers; - $this->encoder = clone $this->encoder; - $this->cacheKey = bin2hex(random_bytes(16)); // set 32 hex values - $children = []; - foreach ($this->children as $pos => $child) { - $children[$pos] = clone $child; - } - $this->setChildren($children); - } - - public function __wakeup() - { - $this->cacheKey = bin2hex(random_bytes(16)); // set 32 hex values - $this->cache = new Swift_KeyCache_ArrayKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php deleted file mode 100644 index ea97619..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php +++ /dev/null @@ -1,45 +0,0 @@ -createDependenciesFor('mime.part') - ); - - if (!isset($charset)) { - $charset = Swift_DependencyContainer::getInstance() - ->lookup('properties.charset'); - } - $this->setBody($body); - $this->setCharset($charset); - if ($contentType) { - $this->setContentType($contentType); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php deleted file mode 100644 index e44b7af..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pretends messages have been sent, but just ignores them. - * - * @author Fabien Potencier - */ -class Swift_NullTransport extends Swift_Transport_NullTransport -{ - public function __construct() - { - \call_user_func_array( - [$this, 'Swift_Transport_NullTransport::__construct'], - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.null') - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php deleted file mode 100644 index 1f26f9b..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/OutputByteStream.php +++ /dev/null @@ -1,46 +0,0 @@ -setThreshold($threshold); - $this->setSleepTime($sleep); - $this->sleeper = $sleeper; - } - - /** - * Set the number of emails to send before restarting. - * - * @param int $threshold - */ - public function setThreshold($threshold) - { - $this->threshold = $threshold; - } - - /** - * Get the number of emails to send before restarting. - * - * @return int - */ - public function getThreshold() - { - return $this->threshold; - } - - /** - * Set the number of seconds to sleep for during a restart. - * - * @param int $sleep time - */ - public function setSleepTime($sleep) - { - $this->sleep = $sleep; - } - - /** - * Get the number of seconds to sleep for during a restart. - * - * @return int - */ - public function getSleepTime() - { - return $this->sleep; - } - - /** - * Invoked immediately before the Message is sent. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - } - - /** - * Invoked immediately after the Message is sent. - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - ++$this->counter; - if ($this->counter >= $this->threshold) { - $transport = $evt->getTransport(); - $transport->stop(); - if ($this->sleep) { - $this->sleep($this->sleep); - } - $transport->start(); - $this->counter = 0; - } - } - - /** - * Sleep for $seconds. - * - * @param int $seconds - */ - public function sleep($seconds) - { - if (isset($this->sleeper)) { - $this->sleeper->sleep($seconds); - } else { - sleep($seconds); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php deleted file mode 100644 index 36451f4..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php +++ /dev/null @@ -1,154 +0,0 @@ -getMessage(); - $message->toByteStream($this); - } - - /** - * Invoked immediately following a command being sent. - */ - public function commandSent(Swift_Events_CommandEvent $evt) - { - $command = $evt->getCommand(); - $this->out += \strlen($command); - } - - /** - * Invoked immediately following a response coming back. - */ - public function responseReceived(Swift_Events_ResponseEvent $evt) - { - $response = $evt->getResponse(); - $this->in += \strlen($response); - } - - /** - * Called when a message is sent so that the outgoing counter can be increased. - * - * @param string $bytes - */ - public function write($bytes) - { - $this->out += \strlen($bytes); - foreach ($this->mirrors as $stream) { - $stream->write($bytes); - } - } - - /** - * Not used. - */ - public function commit() - { - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - */ - public function bind(Swift_InputByteStream $is) - { - $this->mirrors[] = $is; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - */ - public function unbind(Swift_InputByteStream $is) - { - foreach ($this->mirrors as $k => $stream) { - if ($is === $stream) { - unset($this->mirrors[$k]); - } - } - } - - /** - * Not used. - */ - public function flushBuffers() - { - foreach ($this->mirrors as $stream) { - $stream->flushBuffers(); - } - } - - /** - * Get the total number of bytes sent to the server. - * - * @return int - */ - public function getBytesOut() - { - return $this->out; - } - - /** - * Get the total number of bytes received from the server. - * - * @return int - */ - public function getBytesIn() - { - return $this->in; - } - - /** - * Reset the internal counters to zero. - */ - public function reset() - { - $this->out = 0; - $this->in = 0; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php deleted file mode 100644 index 9f9f08b..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php +++ /dev/null @@ -1,31 +0,0 @@ - - * $replacements = array( - * "address1@domain.tld" => array("{a}" => "b", "{c}" => "d"), - * "address2@domain.tld" => array("{a}" => "x", "{c}" => "y") - * ) - * - * - * When using an instance of {@link Swift_Plugins_Decorator_Replacements}, - * the object should return just the array of replacements for the address - * given to {@link Swift_Plugins_Decorator_Replacements::getReplacementsFor()}. - * - * @param mixed $replacements Array or Swift_Plugins_Decorator_Replacements - */ - public function __construct($replacements) - { - $this->setReplacements($replacements); - } - - /** - * Sets replacements. - * - * @param mixed $replacements Array or Swift_Plugins_Decorator_Replacements - * - * @see __construct() - */ - public function setReplacements($replacements) - { - if (!($replacements instanceof Swift_Plugins_Decorator_Replacements)) { - $this->replacements = (array) $replacements; - } else { - $this->replacements = $replacements; - } - } - - /** - * Invoked immediately before the Message is sent. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $this->restoreMessage($message); - $to = array_keys($message->getTo()); - $address = array_shift($to); - if ($replacements = $this->getReplacementsFor($address)) { - $body = $message->getBody(); - $search = array_keys($replacements); - $replace = array_values($replacements); - $bodyReplaced = str_replace( - $search, $replace, $body - ); - if ($body != $bodyReplaced) { - $this->originalBody = $body; - $message->setBody($bodyReplaced); - } - - foreach ($message->getHeaders()->getAll() as $header) { - $body = $header->getFieldBodyModel(); - $count = 0; - if (\is_array($body)) { - $bodyReplaced = []; - foreach ($body as $key => $value) { - $count1 = 0; - $count2 = 0; - $key = \is_string($key) ? str_replace($search, $replace, $key, $count1) : $key; - $value = \is_string($value) ? str_replace($search, $replace, $value, $count2) : $value; - $bodyReplaced[$key] = $value; - - if (!$count && ($count1 || $count2)) { - $count = 1; - } - } - } elseif (\is_string($body)) { - $bodyReplaced = str_replace($search, $replace, $body, $count); - } - - if ($count) { - $this->originalHeaders[$header->getFieldName()] = $body; - $header->setFieldBodyModel($bodyReplaced); - } - } - - $children = (array) $message->getChildren(); - foreach ($children as $child) { - list($type) = sscanf($child->getContentType(), '%[^/]/%s'); - if ('text' == $type) { - $body = $child->getBody(); - $bodyReplaced = str_replace( - $search, $replace, $body - ); - if ($body != $bodyReplaced) { - $child->setBody($bodyReplaced); - $this->originalChildBodies[$child->getId()] = $body; - } - } - } - $this->lastMessage = $message; - } - } - - /** - * Find a map of replacements for the address. - * - * If this plugin was provided with a delegate instance of - * {@link Swift_Plugins_Decorator_Replacements} then the call will be - * delegated to it. Otherwise, it will attempt to find the replacements - * from the array provided in the constructor. - * - * If no replacements can be found, an empty value (NULL) is returned. - * - * @param string $address - * - * @return array - */ - public function getReplacementsFor($address) - { - if ($this->replacements instanceof Swift_Plugins_Decorator_Replacements) { - return $this->replacements->getReplacementsFor($address); - } - - return $this->replacements[$address] ?? null; - } - - /** - * Invoked immediately after the Message is sent. - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $this->restoreMessage($evt->getMessage()); - } - - /** Restore a changed message back to its original state */ - private function restoreMessage(Swift_Mime_SimpleMessage $message) - { - if ($this->lastMessage === $message) { - if (isset($this->originalBody)) { - $message->setBody($this->originalBody); - $this->originalBody = null; - } - if (!empty($this->originalHeaders)) { - foreach ($message->getHeaders()->getAll() as $header) { - if (\array_key_exists($header->getFieldName(), $this->originalHeaders)) { - $header->setFieldBodyModel($this->originalHeaders[$header->getFieldName()]); - } - } - $this->originalHeaders = []; - } - if (!empty($this->originalChildBodies)) { - $children = (array) $message->getChildren(); - foreach ($children as $child) { - $id = $child->getId(); - if (\array_key_exists($id, $this->originalChildBodies)) { - $child->setBody($this->originalChildBodies[$id]); - } - } - $this->originalChildBodies = []; - } - $this->lastMessage = null; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php deleted file mode 100644 index 3f4dbbf..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php +++ /dev/null @@ -1,65 +0,0 @@ -sender = $sender; - } - - /** - * Invoked immediately before the Message is sent. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $headers = $message->getHeaders(); - - // save current recipients - $headers->addPathHeader('X-Swift-Return-Path', $message->getReturnPath()); - - // replace them with the one to send to - $message->setReturnPath($this->sender); - } - - /** - * Invoked immediately after the Message is sent. - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - - // restore original headers - $headers = $message->getHeaders(); - - if ($headers->has('X-Swift-Return-Path')) { - $message->setReturnPath($headers->get('X-Swift-Return-Path')->getAddress()); - $headers->removeAll('X-Swift-Return-Path'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php deleted file mode 100644 index d9bce89..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Logger.php +++ /dev/null @@ -1,36 +0,0 @@ -logger = $logger; - } - - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry) - { - $this->logger->add($entry); - } - - /** - * Clear the log contents. - */ - public function clear() - { - $this->logger->clear(); - } - - /** - * Get this log as a string. - * - * @return string - */ - public function dump() - { - return $this->logger->dump(); - } - - /** - * Invoked immediately following a command being sent. - */ - public function commandSent(Swift_Events_CommandEvent $evt) - { - $command = $evt->getCommand(); - $this->logger->add(sprintf('>> %s', $command)); - } - - /** - * Invoked immediately following a response coming back. - */ - public function responseReceived(Swift_Events_ResponseEvent $evt) - { - $response = $evt->getResponse(); - $this->logger->add(sprintf('<< %s', $response)); - } - - /** - * Invoked just before a Transport is started. - */ - public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) - { - $transportName = \get_class($evt->getSource()); - $this->logger->add(sprintf('++ Starting %s', $transportName)); - } - - /** - * Invoked immediately after the Transport is started. - */ - public function transportStarted(Swift_Events_TransportChangeEvent $evt) - { - $transportName = \get_class($evt->getSource()); - $this->logger->add(sprintf('++ %s started', $transportName)); - } - - /** - * Invoked just before a Transport is stopped. - */ - public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) - { - $transportName = \get_class($evt->getSource()); - $this->logger->add(sprintf('++ Stopping %s', $transportName)); - } - - /** - * Invoked immediately after the Transport is stopped. - */ - public function transportStopped(Swift_Events_TransportChangeEvent $evt) - { - $transportName = \get_class($evt->getSource()); - $this->logger->add(sprintf('++ %s stopped', $transportName)); - } - - /** - * Invoked as a TransportException is thrown in the Transport system. - */ - public function exceptionThrown(Swift_Events_TransportExceptionEvent $evt) - { - $e = $evt->getException(); - $message = $e->getMessage(); - $code = $e->getCode(); - $this->logger->add(sprintf('!! %s (code: %s)', $message, $code)); - $message .= PHP_EOL; - $message .= 'Log data:'.PHP_EOL; - $message .= $this->logger->dump(); - $evt->cancelBubble(); - throw new Swift_TransportException($message, $code, $e->getPrevious()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php deleted file mode 100644 index 6f595ad..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php +++ /dev/null @@ -1,72 +0,0 @@ -size = $size; - } - - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry) - { - $this->log[] = $entry; - while (\count($this->log) > $this->size) { - array_shift($this->log); - } - } - - /** - * Clear the log contents. - */ - public function clear() - { - $this->log = []; - } - - /** - * Get this log as a string. - * - * @return string - */ - public function dump() - { - return implode(PHP_EOL, $this->log); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php deleted file mode 100644 index 40a53d2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php +++ /dev/null @@ -1,58 +0,0 @@ -isHtml = $isHtml; - } - - /** - * Add a log entry. - * - * @param string $entry - */ - public function add($entry) - { - if ($this->isHtml) { - printf('%s%s%s', htmlspecialchars($entry, ENT_QUOTES), '
', PHP_EOL); - } else { - printf('%s%s', $entry, PHP_EOL); - } - } - - /** - * Not implemented. - */ - public function clear() - { - } - - /** - * Not implemented. - */ - public function dump() - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php deleted file mode 100644 index 39c48ed..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php +++ /dev/null @@ -1,70 +0,0 @@ -messages = []; - } - - /** - * Get the message list. - * - * @return Swift_Mime_SimpleMessage[] - */ - public function getMessages() - { - return $this->messages; - } - - /** - * Get the message count. - * - * @return int count - */ - public function countMessages() - { - return \count($this->messages); - } - - /** - * Empty the message list. - */ - public function clear() - { - $this->messages = []; - } - - /** - * Invoked immediately before the Message is sent. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $this->messages[] = clone $evt->getMessage(); - } - - /** - * Invoked immediately after the Message is sent. - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php deleted file mode 100644 index fb99e4c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php +++ /dev/null @@ -1,31 +0,0 @@ -host = $host; - $this->port = $port; - $this->crypto = $crypto; - } - - /** - * Set a Pop3Connection to delegate to instead of connecting directly. - * - * @return $this - */ - public function setConnection(Swift_Plugins_Pop_Pop3Connection $connection) - { - $this->connection = $connection; - - return $this; - } - - /** - * Bind this plugin to a specific SMTP transport instance. - */ - public function bindSmtp(Swift_Transport $smtp) - { - $this->transport = $smtp; - } - - /** - * Set the connection timeout in seconds (default 10). - * - * @param int $timeout - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->timeout = (int) $timeout; - - return $this; - } - - /** - * Set the username to use when connecting (if needed). - * - * @param string $username - * - * @return $this - */ - public function setUsername($username) - { - $this->username = $username; - - return $this; - } - - /** - * Set the password to use when connecting (if needed). - * - * @param string $password - * - * @return $this - */ - public function setPassword($password) - { - $this->password = $password; - - return $this; - } - - /** - * Connect to the POP3 host and authenticate. - * - * @throws Swift_Plugins_Pop_Pop3Exception if connection fails - */ - public function connect() - { - if (isset($this->connection)) { - $this->connection->connect(); - } else { - if (!isset($this->socket)) { - if (!$socket = fsockopen( - $this->getHostString(), $this->port, $errno, $errstr, $this->timeout)) { - throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to connect to POP3 host [%s]: %s', $this->host, $errstr)); - } - $this->socket = $socket; - - if (false === $greeting = fgets($this->socket)) { - throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to connect to POP3 host [%s]', trim($greeting))); - } - - $this->assertOk($greeting); - - if ($this->username) { - $this->command(sprintf("USER %s\r\n", $this->username)); - $this->command(sprintf("PASS %s\r\n", $this->password)); - } - } - } - } - - /** - * Disconnect from the POP3 host. - */ - public function disconnect() - { - if (isset($this->connection)) { - $this->connection->disconnect(); - } else { - $this->command("QUIT\r\n"); - if (!fclose($this->socket)) { - throw new Swift_Plugins_Pop_Pop3Exception(sprintf('POP3 host [%s] connection could not be stopped', $this->host)); - } - $this->socket = null; - } - } - - /** - * Invoked just before a Transport is started. - */ - public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) - { - if (isset($this->transport)) { - if ($this->transport !== $evt->getTransport()) { - return; - } - } - - $this->connect(); - $this->disconnect(); - } - - /** - * Not used. - */ - public function transportStarted(Swift_Events_TransportChangeEvent $evt) - { - } - - /** - * Not used. - */ - public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) - { - } - - /** - * Not used. - */ - public function transportStopped(Swift_Events_TransportChangeEvent $evt) - { - } - - private function command($command) - { - if (!fwrite($this->socket, $command)) { - throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to write command [%s] to POP3 host', trim($command))); - } - - if (false === $response = fgets($this->socket)) { - throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to read from POP3 host after command [%s]', trim($command))); - } - - $this->assertOk($response); - - return $response; - } - - private function assertOk($response) - { - if ('+OK' != substr($response, 0, 3)) { - throw new Swift_Plugins_Pop_Pop3Exception(sprintf('POP3 command failed [%s]', trim($response))); - } - } - - private function getHostString() - { - $host = $this->host; - switch (strtolower($this->crypto)) { - case 'ssl': - $host = 'ssl://'.$host; - break; - - case 'tls': - $host = 'tls://'.$host; - break; - } - - return $host; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php deleted file mode 100644 index f7373b2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php +++ /dev/null @@ -1,201 +0,0 @@ -recipient = $recipient; - $this->whitelist = $whitelist; - } - - /** - * Set the recipient of all messages. - * - * @param mixed $recipient - */ - public function setRecipient($recipient) - { - $this->recipient = $recipient; - } - - /** - * Get the recipient of all messages. - * - * @return mixed - */ - public function getRecipient() - { - return $this->recipient; - } - - /** - * Set a list of regular expressions to whitelist certain recipients. - */ - public function setWhitelist(array $whitelist) - { - $this->whitelist = $whitelist; - } - - /** - * Get the whitelist. - * - * @return array - */ - public function getWhitelist() - { - return $this->whitelist; - } - - /** - * Invoked immediately before the Message is sent. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $headers = $message->getHeaders(); - - // conditionally save current recipients - - if ($headers->has('to')) { - $headers->addMailboxHeader('X-Swift-To', $message->getTo()); - } - - if ($headers->has('cc')) { - $headers->addMailboxHeader('X-Swift-Cc', $message->getCc()); - } - - if ($headers->has('bcc')) { - $headers->addMailboxHeader('X-Swift-Bcc', $message->getBcc()); - } - - // Filter remaining headers against whitelist - $this->filterHeaderSet($headers, 'To'); - $this->filterHeaderSet($headers, 'Cc'); - $this->filterHeaderSet($headers, 'Bcc'); - - // Add each hard coded recipient - $to = $message->getTo(); - if (null === $to) { - $to = []; - } - - foreach ((array) $this->recipient as $recipient) { - if (!\array_key_exists($recipient, $to)) { - $message->addTo($recipient); - } - } - } - - /** - * Filter header set against a whitelist of regular expressions. - * - * @param string $type - */ - private function filterHeaderSet(Swift_Mime_SimpleHeaderSet $headerSet, $type) - { - foreach ($headerSet->getAll($type) as $headers) { - $headers->setNameAddresses($this->filterNameAddresses($headers->getNameAddresses())); - } - } - - /** - * Filtered list of addresses => name pairs. - * - * @return array - */ - private function filterNameAddresses(array $recipients) - { - $filtered = []; - - foreach ($recipients as $address => $name) { - if ($this->isWhitelisted($address)) { - $filtered[$address] = $name; - } - } - - return $filtered; - } - - /** - * Matches address against whitelist of regular expressions. - * - * @return bool - */ - protected function isWhitelisted($recipient) - { - if (\in_array($recipient, (array) $this->recipient)) { - return true; - } - - foreach ($this->whitelist as $pattern) { - if (preg_match($pattern, $recipient)) { - return true; - } - } - - return false; - } - - /** - * Invoked immediately after the Message is sent. - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $this->restoreMessage($evt->getMessage()); - } - - private function restoreMessage(Swift_Mime_SimpleMessage $message) - { - // restore original headers - $headers = $message->getHeaders(); - - if ($headers->has('X-Swift-To')) { - $message->setTo($headers->get('X-Swift-To')->getNameAddresses()); - $headers->removeAll('X-Swift-To'); - } else { - $message->setTo(null); - } - - if ($headers->has('X-Swift-Cc')) { - $message->setCc($headers->get('X-Swift-Cc')->getNameAddresses()); - $headers->removeAll('X-Swift-Cc'); - } - - if ($headers->has('X-Swift-Bcc')) { - $message->setBcc($headers->get('X-Swift-Bcc')->getNameAddresses()); - $headers->removeAll('X-Swift-Bcc'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php deleted file mode 100644 index b881833..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php +++ /dev/null @@ -1,31 +0,0 @@ -reporter = $reporter; - } - - /** - * Not used. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - } - - /** - * Invoked immediately after the Message is sent. - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - $message = $evt->getMessage(); - $failures = array_flip($evt->getFailedRecipients()); - foreach ((array) $message->getTo() as $address => $null) { - $this->reporter->notify($message, $address, (\array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); - } - foreach ((array) $message->getCc() as $address => $null) { - $this->reporter->notify($message, $address, (\array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); - } - foreach ((array) $message->getBcc() as $address => $null) { - $this->reporter->notify($message, $address, (\array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php deleted file mode 100644 index 249cffb..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php +++ /dev/null @@ -1,58 +0,0 @@ -failures_cache[$address])) { - $this->failures[] = $address; - $this->failures_cache[$address] = true; - } - } - - /** - * Get an array of addresses for which delivery failed. - * - * @return array - */ - public function getFailedRecipients() - { - return $this->failures; - } - - /** - * Clear the buffer (empty the list). - */ - public function clear() - { - $this->failures = $this->failures_cache = []; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php deleted file mode 100644 index 1cfc3f9..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php +++ /dev/null @@ -1,38 +0,0 @@ -'.PHP_EOL; - echo 'PASS '.$address.PHP_EOL; - echo ''.PHP_EOL; - flush(); - } else { - echo '
'.PHP_EOL; - echo 'FAIL '.$address.PHP_EOL; - echo '
'.PHP_EOL; - flush(); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php deleted file mode 100644 index 595c0f6..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php +++ /dev/null @@ -1,24 +0,0 @@ -rate = $rate; - $this->mode = $mode; - $this->sleeper = $sleeper; - $this->timer = $timer; - } - - /** - * Invoked immediately before the Message is sent. - */ - public function beforeSendPerformed(Swift_Events_SendEvent $evt) - { - $time = $this->getTimestamp(); - if (!isset($this->start)) { - $this->start = $time; - } - $duration = $time - $this->start; - - switch ($this->mode) { - case self::BYTES_PER_MINUTE: - $sleep = $this->throttleBytesPerMinute($duration); - break; - case self::MESSAGES_PER_SECOND: - $sleep = $this->throttleMessagesPerSecond($duration); - break; - case self::MESSAGES_PER_MINUTE: - $sleep = $this->throttleMessagesPerMinute($duration); - break; - default: - $sleep = 0; - break; - } - - if ($sleep > 0) { - $this->sleep($sleep); - } - } - - /** - * Invoked when a Message is sent. - */ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - parent::sendPerformed($evt); - ++$this->messages; - } - - /** - * Sleep for $seconds. - * - * @param int $seconds - */ - public function sleep($seconds) - { - if (isset($this->sleeper)) { - $this->sleeper->sleep($seconds); - } else { - sleep($seconds); - } - } - - /** - * Get the current UNIX timestamp. - * - * @return int - */ - public function getTimestamp() - { - if (isset($this->timer)) { - return $this->timer->getTimestamp(); - } - - return time(); - } - - /** - * Get a number of seconds to sleep for. - * - * @param int $timePassed - * - * @return int - */ - private function throttleBytesPerMinute($timePassed) - { - $expectedDuration = $this->getBytesOut() / ($this->rate / 60); - - return (int) ceil($expectedDuration - $timePassed); - } - - /** - * Get a number of seconds to sleep for. - * - * @param int $timePassed - * - * @return int - */ - private function throttleMessagesPerSecond($timePassed) - { - $expectedDuration = $this->messages / $this->rate; - - return (int) ceil($expectedDuration - $timePassed); - } - - /** - * Get a number of seconds to sleep for. - * - * @param int $timePassed - * - * @return int - */ - private function throttleMessagesPerMinute($timePassed) - { - $expectedDuration = $this->messages / ($this->rate / 60); - - return (int) ceil($expectedDuration - $timePassed); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php deleted file mode 100644 index 9c8deb3..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Timer.php +++ /dev/null @@ -1,24 +0,0 @@ -register('properties.charset')->asValue($charset); - - return $this; - } - - /** - * Set the directory where temporary files can be saved. - * - * @param string $dir - * - * @return $this - */ - public function setTempDir($dir) - { - Swift_DependencyContainer::getInstance()->register('tempdir')->asValue($dir); - - return $this; - } - - /** - * Set the type of cache to use (i.e. "disk" or "array"). - * - * @param string $type - * - * @return $this - */ - public function setCacheType($type) - { - Swift_DependencyContainer::getInstance()->register('cache')->asAliasOf(sprintf('cache.%s', $type)); - - return $this; - } - - /** - * Set the QuotedPrintable dot escaper preference. - * - * @param bool $dotEscape - * - * @return $this - */ - public function setQPDotEscape($dotEscape) - { - $dotEscape = !empty($dotEscape); - Swift_DependencyContainer::getInstance() - ->register('mime.qpcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') - ->withDependencies(['mime.charstream', 'mime.bytecanonicalizer']) - ->addConstructorValue($dotEscape); - - return $this; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php deleted file mode 100644 index 2897474..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -createDependenciesFor('transport.sendmail') - ); - - $this->setCommand($command); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signer.php deleted file mode 100644 index 26c5e28..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signer.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ -interface Swift_Signer -{ - public function reset(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php deleted file mode 100644 index b25c427..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -interface Swift_Signers_BodySigner extends Swift_Signer -{ - /** - * Change the Swift_Signed_Message to apply the singing. - * - * @return self - */ - public function signMessage(Swift_Message $message); - - /** - * Return the list of header a signer might tamper. - * - * @return array - */ - public function getAlteredHeaders(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php deleted file mode 100644 index 9a26abd..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php +++ /dev/null @@ -1,682 +0,0 @@ - - */ -class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner -{ - /** - * PrivateKey. - * - * @var string - */ - protected $privateKey; - - /** - * DomainName. - * - * @var string - */ - protected $domainName; - - /** - * Selector. - * - * @var string - */ - protected $selector; - - private $passphrase = ''; - - /** - * Hash algorithm used. - * - * @see RFC6376 3.3: Signers MUST implement and SHOULD sign using rsa-sha256. - * - * @var string - */ - protected $hashAlgorithm = 'rsa-sha256'; - - /** - * Body canon method. - * - * @var string - */ - protected $bodyCanon = 'simple'; - - /** - * Header canon method. - * - * @var string - */ - protected $headerCanon = 'simple'; - - /** - * Headers not being signed. - * - * @var array - */ - protected $ignoredHeaders = ['return-path' => true]; - - /** - * Signer identity. - * - * @var string - */ - protected $signerIdentity; - - /** - * BodyLength. - * - * @var int - */ - protected $bodyLen = 0; - - /** - * Maximum signedLen. - * - * @var int - */ - protected $maxLen = PHP_INT_MAX; - - /** - * Embbed bodyLen in signature. - * - * @var bool - */ - protected $showLen = false; - - /** - * When the signature has been applied (true means time()), false means not embedded. - * - * @var mixed - */ - protected $signatureTimestamp = true; - - /** - * When will the signature expires false means not embedded, if sigTimestamp is auto - * Expiration is relative, otherwise it's absolute. - * - * @var int - */ - protected $signatureExpiration = false; - - /** - * Must we embed signed headers? - * - * @var bool - */ - protected $debugHeaders = false; - - // work variables - /** - * Headers used to generate hash. - * - * @var array - */ - protected $signedHeaders = []; - - /** - * If debugHeaders is set store debugData here. - * - * @var string[] - */ - private $debugHeadersData = []; - - /** - * Stores the bodyHash. - * - * @var string - */ - private $bodyHash = ''; - - /** - * Stores the signature header. - * - * @var Swift_Mime_Headers_ParameterizedHeader - */ - protected $dkimHeader; - - private $bodyHashHandler; - - private $headerHash; - - private $headerCanonData = ''; - - private $bodyCanonEmptyCounter = 0; - - private $bodyCanonIgnoreStart = 2; - - private $bodyCanonSpace = false; - - private $bodyCanonLastChar = null; - - private $bodyCanonLine = ''; - - private $bound = []; - - /** - * Constructor. - * - * @param string $privateKey - * @param string $domainName - * @param string $selector - * @param string $passphrase - */ - public function __construct($privateKey, $domainName, $selector, $passphrase = '') - { - $this->privateKey = $privateKey; - $this->domainName = $domainName; - $this->signerIdentity = '@'.$domainName; - $this->selector = $selector; - $this->passphrase = $passphrase; - } - - /** - * Reset the Signer. - * - * @see Swift_Signer::reset() - */ - public function reset() - { - $this->headerHash = null; - $this->signedHeaders = []; - $this->bodyHash = null; - $this->bodyHashHandler = null; - $this->bodyCanonIgnoreStart = 2; - $this->bodyCanonEmptyCounter = 0; - $this->bodyCanonLastChar = null; - $this->bodyCanonSpace = false; - } - - /** - * Writes $bytes to the end of the stream. - * - * Writing may not happen immediately if the stream chooses to buffer. If - * you want to write these bytes with immediate effect, call {@link commit()} - * after calling write(). - * - * This method returns the sequence ID of the write (i.e. 1 for first, 2 for - * second, etc etc). - * - * @param string $bytes - * - * @return int - * - * @throws Swift_IoException - */ - // TODO fix return - public function write($bytes) - { - $this->canonicalizeBody($bytes); - foreach ($this->bound as $is) { - $is->write($bytes); - } - } - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - */ - public function commit() - { - // Nothing to do - return; - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - */ - public function bind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - $this->bound[] = $is; - - return; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - */ - public function unbind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - foreach ($this->bound as $k => $stream) { - if ($stream === $is) { - unset($this->bound[$k]); - - return; - } - } - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * - * @throws Swift_IoException - */ - public function flushBuffers() - { - $this->reset(); - } - - /** - * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1. - * - * @param string $hash 'rsa-sha1' or 'rsa-sha256' - * - * @throws Swift_SwiftException - * - * @return $this - */ - public function setHashAlgorithm($hash) - { - switch ($hash) { - case 'rsa-sha1': - $this->hashAlgorithm = 'rsa-sha1'; - break; - case 'rsa-sha256': - $this->hashAlgorithm = 'rsa-sha256'; - if (!\defined('OPENSSL_ALGO_SHA256')) { - throw new Swift_SwiftException('Unable to set sha256 as it is not supported by OpenSSL.'); - } - break; - default: - throw new Swift_SwiftException('Unable to set the hash algorithm, must be one of rsa-sha1 or rsa-sha256 (%s given).', $hash); - } - - return $this; - } - - /** - * Set the body canonicalization algorithm. - * - * @param string $canon - * - * @return $this - */ - public function setBodyCanon($canon) - { - if ('relaxed' == $canon) { - $this->bodyCanon = 'relaxed'; - } else { - $this->bodyCanon = 'simple'; - } - - return $this; - } - - /** - * Set the header canonicalization algorithm. - * - * @param string $canon - * - * @return $this - */ - public function setHeaderCanon($canon) - { - if ('relaxed' == $canon) { - $this->headerCanon = 'relaxed'; - } else { - $this->headerCanon = 'simple'; - } - - return $this; - } - - /** - * Set the signer identity. - * - * @param string $identity - * - * @return $this - */ - public function setSignerIdentity($identity) - { - $this->signerIdentity = $identity; - - return $this; - } - - /** - * Set the length of the body to sign. - * - * @param mixed $len (bool or int) - * - * @return $this - */ - public function setBodySignedLen($len) - { - if (true === $len) { - $this->showLen = true; - $this->maxLen = PHP_INT_MAX; - } elseif (false === $len) { - $this->showLen = false; - $this->maxLen = PHP_INT_MAX; - } else { - $this->showLen = true; - $this->maxLen = (int) $len; - } - - return $this; - } - - /** - * Set the signature timestamp. - * - * @param int $time A timestamp - * - * @return $this - */ - public function setSignatureTimestamp($time) - { - $this->signatureTimestamp = $time; - - return $this; - } - - /** - * Set the signature expiration timestamp. - * - * @param int $time A timestamp - * - * @return $this - */ - public function setSignatureExpiration($time) - { - $this->signatureExpiration = $time; - - return $this; - } - - /** - * Enable / disable the DebugHeaders. - * - * @param bool $debug - * - * @return Swift_Signers_DKIMSigner - */ - public function setDebugHeaders($debug) - { - $this->debugHeaders = (bool) $debug; - - return $this; - } - - /** - * Start Body. - */ - public function startBody() - { - // Init - switch ($this->hashAlgorithm) { - case 'rsa-sha256': - $this->bodyHashHandler = hash_init('sha256'); - break; - case 'rsa-sha1': - $this->bodyHashHandler = hash_init('sha1'); - break; - } - $this->bodyCanonLine = ''; - } - - /** - * End Body. - */ - public function endBody() - { - $this->endOfBody(); - } - - /** - * Returns the list of Headers Tampered by this plugin. - * - * @return array - */ - public function getAlteredHeaders() - { - if ($this->debugHeaders) { - return ['DKIM-Signature', 'X-DebugHash']; - } else { - return ['DKIM-Signature']; - } - } - - /** - * Adds an ignored Header. - * - * @param string $header_name - * - * @return Swift_Signers_DKIMSigner - */ - public function ignoreHeader($header_name) - { - $this->ignoredHeaders[strtolower($header_name)] = true; - - return $this; - } - - /** - * Set the headers to sign. - * - * @return Swift_Signers_DKIMSigner - */ - public function setHeaders(Swift_Mime_SimpleHeaderSet $headers) - { - $this->headerCanonData = ''; - // Loop through Headers - $listHeaders = $headers->listAll(); - foreach ($listHeaders as $hName) { - // Check if we need to ignore Header - if (!isset($this->ignoredHeaders[strtolower($hName)])) { - if ($headers->has($hName)) { - $tmp = $headers->getAll($hName); - foreach ($tmp as $header) { - if ('' != $header->getFieldBody()) { - $this->addHeader($header->toString()); - $this->signedHeaders[] = $header->getFieldName(); - } - } - } - } - } - - return $this; - } - - /** - * Add the signature to the given Headers. - * - * @return Swift_Signers_DKIMSigner - */ - public function addSignature(Swift_Mime_SimpleHeaderSet $headers) - { - // Prepare the DKIM-Signature - $params = ['v' => '1', 'a' => $this->hashAlgorithm, 'bh' => base64_encode($this->bodyHash), 'd' => $this->domainName, 'h' => implode(': ', $this->signedHeaders), 'i' => $this->signerIdentity, 's' => $this->selector]; - if ('simple' != $this->bodyCanon) { - $params['c'] = $this->headerCanon.'/'.$this->bodyCanon; - } elseif ('simple' != $this->headerCanon) { - $params['c'] = $this->headerCanon; - } - if ($this->showLen) { - $params['l'] = $this->bodyLen; - } - if (true === $this->signatureTimestamp) { - $params['t'] = time(); - if (false !== $this->signatureExpiration) { - $params['x'] = $params['t'] + $this->signatureExpiration; - } - } else { - if (false !== $this->signatureTimestamp) { - $params['t'] = $this->signatureTimestamp; - } - if (false !== $this->signatureExpiration) { - $params['x'] = $this->signatureExpiration; - } - } - if ($this->debugHeaders) { - $params['z'] = implode('|', $this->debugHeadersData); - } - $string = ''; - foreach ($params as $k => $v) { - $string .= $k.'='.$v.'; '; - } - $string = trim($string); - $headers->addTextHeader('DKIM-Signature', $string); - // Add the last DKIM-Signature - $tmp = $headers->getAll('DKIM-Signature'); - $this->dkimHeader = end($tmp); - $this->addHeader(trim($this->dkimHeader->toString())."\r\n b=", true); - if ($this->debugHeaders) { - $headers->addTextHeader('X-DebugHash', base64_encode($this->headerHash)); - } - $this->dkimHeader->setValue($string.' b='.trim(chunk_split(base64_encode($this->getEncryptedHash()), 73, ' '))); - - return $this; - } - - /* Private helpers */ - - protected function addHeader($header, $is_sig = false) - { - switch ($this->headerCanon) { - case 'relaxed': - // Prepare Header and cascade - $exploded = explode(':', $header, 2); - $name = strtolower(trim($exploded[0])); - $value = str_replace("\r\n", '', $exploded[1]); - $value = preg_replace("/[ \t][ \t]+/", ' ', $value); - $header = $name.':'.trim($value).($is_sig ? '' : "\r\n"); - // no break - case 'simple': - // Nothing to do - } - $this->addToHeaderHash($header); - } - - protected function canonicalizeBody($string) - { - $len = \strlen($string); - $canon = ''; - $method = ('relaxed' == $this->bodyCanon); - for ($i = 0; $i < $len; ++$i) { - if ($this->bodyCanonIgnoreStart > 0) { - --$this->bodyCanonIgnoreStart; - continue; - } - switch ($string[$i]) { - case "\r": - $this->bodyCanonLastChar = "\r"; - break; - case "\n": - if ("\r" == $this->bodyCanonLastChar) { - if ($method) { - $this->bodyCanonSpace = false; - } - if ('' == $this->bodyCanonLine) { - ++$this->bodyCanonEmptyCounter; - } else { - $this->bodyCanonLine = ''; - $canon .= "\r\n"; - } - } else { - // Wooops Error - // todo handle it but should never happen - } - break; - case ' ': - case "\t": - if ($method) { - $this->bodyCanonSpace = true; - break; - } - // no break - default: - if ($this->bodyCanonEmptyCounter > 0) { - $canon .= str_repeat("\r\n", $this->bodyCanonEmptyCounter); - $this->bodyCanonEmptyCounter = 0; - } - if ($this->bodyCanonSpace) { - $this->bodyCanonLine .= ' '; - $canon .= ' '; - $this->bodyCanonSpace = false; - } - $this->bodyCanonLine .= $string[$i]; - $canon .= $string[$i]; - } - } - $this->addToBodyHash($canon); - } - - protected function endOfBody() - { - // Add trailing Line return if last line is non empty - if (\strlen($this->bodyCanonLine) > 0) { - $this->addToBodyHash("\r\n"); - } - $this->bodyHash = hash_final($this->bodyHashHandler, true); - } - - private function addToBodyHash($string) - { - $len = \strlen($string); - if ($len > ($new_len = ($this->maxLen - $this->bodyLen))) { - $string = substr($string, 0, $new_len); - $len = $new_len; - } - hash_update($this->bodyHashHandler, $string); - $this->bodyLen += $len; - } - - private function addToHeaderHash($header) - { - if ($this->debugHeaders) { - $this->debugHeadersData[] = trim($header); - } - $this->headerCanonData .= $header; - } - - /** - * @throws Swift_SwiftException - * - * @return string - */ - private function getEncryptedHash() - { - $signature = ''; - switch ($this->hashAlgorithm) { - case 'rsa-sha1': - $algorithm = OPENSSL_ALGO_SHA1; - break; - case 'rsa-sha256': - $algorithm = OPENSSL_ALGO_SHA256; - break; - } - $pkeyId = openssl_get_privatekey($this->privateKey, $this->passphrase); - if (!$pkeyId) { - throw new Swift_SwiftException('Unable to load DKIM Private Key ['.openssl_error_string().']'); - } - if (openssl_sign($this->headerCanonData, $signature, $pkeyId, $algorithm)) { - return $signature; - } - throw new Swift_SwiftException('Unable to sign DKIM Hash ['.openssl_error_string().']'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php deleted file mode 100644 index 8833765..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php +++ /dev/null @@ -1,504 +0,0 @@ - - */ -class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner -{ - /** - * PrivateKey. - * - * @var string - */ - protected $privateKey; - - /** - * DomainName. - * - * @var string - */ - protected $domainName; - - /** - * Selector. - * - * @var string - */ - protected $selector; - - /** - * Hash algorithm used. - * - * @var string - */ - protected $hashAlgorithm = 'rsa-sha1'; - - /** - * Canonisation method. - * - * @var string - */ - protected $canon = 'simple'; - - /** - * Headers not being signed. - * - * @var array - */ - protected $ignoredHeaders = []; - - /** - * Signer identity. - * - * @var string - */ - protected $signerIdentity; - - /** - * Must we embed signed headers? - * - * @var bool - */ - protected $debugHeaders = false; - - // work variables - /** - * Headers used to generate hash. - * - * @var array - */ - private $signedHeaders = []; - - /** - * Stores the signature header. - * - * @var Swift_Mime_Headers_ParameterizedHeader - */ - protected $domainKeyHeader; - - /** - * Hash Handler. - * - * @var resource|null - */ - private $hashHandler; - - private $canonData = ''; - - private $bodyCanonEmptyCounter = 0; - - private $bodyCanonIgnoreStart = 2; - - private $bodyCanonSpace = false; - - private $bodyCanonLastChar = null; - - private $bodyCanonLine = ''; - - private $bound = []; - - /** - * Constructor. - * - * @param string $privateKey - * @param string $domainName - * @param string $selector - */ - public function __construct($privateKey, $domainName, $selector) - { - $this->privateKey = $privateKey; - $this->domainName = $domainName; - $this->signerIdentity = '@'.$domainName; - $this->selector = $selector; - } - - /** - * Resets internal states. - * - * @return $this - */ - public function reset() - { - $this->hashHandler = null; - $this->bodyCanonIgnoreStart = 2; - $this->bodyCanonEmptyCounter = 0; - $this->bodyCanonLastChar = null; - $this->bodyCanonSpace = false; - - return $this; - } - - /** - * Writes $bytes to the end of the stream. - * - * Writing may not happen immediately if the stream chooses to buffer. If - * you want to write these bytes with immediate effect, call {@link commit()} - * after calling write(). - * - * This method returns the sequence ID of the write (i.e. 1 for first, 2 for - * second, etc etc). - * - * @param string $bytes - * - * @return int - * - * @throws Swift_IoException - * - * @return $this - */ - public function write($bytes) - { - $this->canonicalizeBody($bytes); - foreach ($this->bound as $is) { - $is->write($bytes); - } - - return $this; - } - - /** - * For any bytes that are currently buffered inside the stream, force them - * off the buffer. - * - * @throws Swift_IoException - * - * @return $this - */ - public function commit() - { - // Nothing to do - return $this; - } - - /** - * Attach $is to this stream. - * - * The stream acts as an observer, receiving all data that is written. - * All {@link write()} and {@link flushBuffers()} operations will be mirrored. - * - * @return $this - */ - public function bind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - $this->bound[] = $is; - - return $this; - } - - /** - * Remove an already bound stream. - * - * If $is is not bound, no errors will be raised. - * If the stream currently has any buffered data it will be written to $is - * before unbinding occurs. - * - * @return $this - */ - public function unbind(Swift_InputByteStream $is) - { - // Don't have to mirror anything - foreach ($this->bound as $k => $stream) { - if ($stream === $is) { - unset($this->bound[$k]); - - break; - } - } - - return $this; - } - - /** - * Flush the contents of the stream (empty it) and set the internal pointer - * to the beginning. - * - * @throws Swift_IoException - * - * @return $this - */ - public function flushBuffers() - { - $this->reset(); - - return $this; - } - - /** - * Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256. - * - * @param string $hash - * - * @return $this - */ - public function setHashAlgorithm($hash) - { - $this->hashAlgorithm = 'rsa-sha1'; - - return $this; - } - - /** - * Set the canonicalization algorithm. - * - * @param string $canon simple | nofws defaults to simple - * - * @return $this - */ - public function setCanon($canon) - { - if ('nofws' == $canon) { - $this->canon = 'nofws'; - } else { - $this->canon = 'simple'; - } - - return $this; - } - - /** - * Set the signer identity. - * - * @param string $identity - * - * @return $this - */ - public function setSignerIdentity($identity) - { - $this->signerIdentity = $identity; - - return $this; - } - - /** - * Enable / disable the DebugHeaders. - * - * @param bool $debug - * - * @return $this - */ - public function setDebugHeaders($debug) - { - $this->debugHeaders = (bool) $debug; - - return $this; - } - - /** - * Start Body. - */ - public function startBody() - { - } - - /** - * End Body. - */ - public function endBody() - { - $this->endOfBody(); - } - - /** - * Returns the list of Headers Tampered by this plugin. - * - * @return array - */ - public function getAlteredHeaders() - { - if ($this->debugHeaders) { - return ['DomainKey-Signature', 'X-DebugHash']; - } - - return ['DomainKey-Signature']; - } - - /** - * Adds an ignored Header. - * - * @param string $header_name - * - * @return $this - */ - public function ignoreHeader($header_name) - { - $this->ignoredHeaders[strtolower($header_name)] = true; - - return $this; - } - - /** - * Set the headers to sign. - * - * @return $this - */ - public function setHeaders(Swift_Mime_SimpleHeaderSet $headers) - { - $this->startHash(); - $this->canonData = ''; - // Loop through Headers - $listHeaders = $headers->listAll(); - foreach ($listHeaders as $hName) { - // Check if we need to ignore Header - if (!isset($this->ignoredHeaders[strtolower($hName)])) { - if ($headers->has($hName)) { - $tmp = $headers->getAll($hName); - foreach ($tmp as $header) { - if ('' != $header->getFieldBody()) { - $this->addHeader($header->toString()); - $this->signedHeaders[] = $header->getFieldName(); - } - } - } - } - } - $this->endOfHeaders(); - - return $this; - } - - /** - * Add the signature to the given Headers. - * - * @return $this - */ - public function addSignature(Swift_Mime_SimpleHeaderSet $headers) - { - // Prepare the DomainKey-Signature Header - $params = ['a' => $this->hashAlgorithm, 'b' => chunk_split(base64_encode($this->getEncryptedHash()), 73, ' '), 'c' => $this->canon, 'd' => $this->domainName, 'h' => implode(': ', $this->signedHeaders), 'q' => 'dns', 's' => $this->selector]; - $string = ''; - foreach ($params as $k => $v) { - $string .= $k.'='.$v.'; '; - } - $string = trim($string); - $headers->addTextHeader('DomainKey-Signature', $string); - - return $this; - } - - /* Private helpers */ - - protected function addHeader($header) - { - switch ($this->canon) { - case 'nofws': - // Prepare Header and cascade - $exploded = explode(':', $header, 2); - $name = strtolower(trim($exploded[0])); - $value = str_replace("\r\n", '', $exploded[1]); - $value = preg_replace("/[ \t][ \t]+/", ' ', $value); - $header = $name.':'.trim($value)."\r\n"; - // no break - case 'simple': - // Nothing to do - } - $this->addToHash($header); - } - - protected function endOfHeaders() - { - $this->bodyCanonEmptyCounter = 1; - } - - protected function canonicalizeBody($string) - { - $len = \strlen($string); - $canon = ''; - $nofws = ('nofws' == $this->canon); - for ($i = 0; $i < $len; ++$i) { - if ($this->bodyCanonIgnoreStart > 0) { - --$this->bodyCanonIgnoreStart; - continue; - } - switch ($string[$i]) { - case "\r": - $this->bodyCanonLastChar = "\r"; - break; - case "\n": - if ("\r" == $this->bodyCanonLastChar) { - if ($nofws) { - $this->bodyCanonSpace = false; - } - if ('' == $this->bodyCanonLine) { - ++$this->bodyCanonEmptyCounter; - } else { - $this->bodyCanonLine = ''; - $canon .= "\r\n"; - } - } else { - // Wooops Error - throw new Swift_SwiftException('Invalid new line sequence in mail found \n without preceding \r'); - } - break; - case ' ': - case "\t": - case "\x09": //HTAB - if ($nofws) { - $this->bodyCanonSpace = true; - break; - } - // no break - default: - if ($this->bodyCanonEmptyCounter > 0) { - $canon .= str_repeat("\r\n", $this->bodyCanonEmptyCounter); - $this->bodyCanonEmptyCounter = 0; - } - $this->bodyCanonLine .= $string[$i]; - $canon .= $string[$i]; - } - } - $this->addToHash($canon); - } - - protected function endOfBody() - { - if (\strlen($this->bodyCanonLine) > 0) { - $this->addToHash("\r\n"); - } - } - - private function addToHash($string) - { - $this->canonData .= $string; - hash_update($this->hashHandler, $string); - } - - private function startHash() - { - // Init - switch ($this->hashAlgorithm) { - case 'rsa-sha1': - $this->hashHandler = hash_init('sha1'); - break; - } - $this->bodyCanonLine = ''; - } - - /** - * @throws Swift_SwiftException - * - * @return string - */ - private function getEncryptedHash() - { - $signature = ''; - $pkeyId = openssl_get_privatekey($this->privateKey); - if (!$pkeyId) { - throw new Swift_SwiftException('Unable to load DomainKey Private Key ['.openssl_error_string().']'); - } - if (openssl_sign($this->canonData, $signature, $pkeyId, OPENSSL_ALGO_SHA1)) { - return $signature; - } - throw new Swift_SwiftException('Unable to sign DomainKey Hash ['.openssl_error_string().']'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php deleted file mode 100644 index 6f5c209..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream -{ - /** - * Exclude an header from the signed headers. - * - * @param string $header_name - * - * @return self - */ - public function ignoreHeader($header_name); - - /** - * Prepare the Signer to get a new Body. - * - * @return self - */ - public function startBody(); - - /** - * Give the signal that the body has finished streaming. - * - * @return self - */ - public function endBody(); - - /** - * Give the headers already given. - * - * @return self - */ - public function setHeaders(Swift_Mime_SimpleHeaderSet $headers); - - /** - * Add the header(s) to the headerSet. - * - * @return self - */ - public function addSignature(Swift_Mime_SimpleHeaderSet $headers); - - /** - * Return the list of header a signer might tamper. - * - * @return array - */ - public function getAlteredHeaders(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php deleted file mode 100644 index 6d7b589..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php +++ /dev/null @@ -1,183 +0,0 @@ - - * - * @deprecated since SwiftMailer 6.1.0; use Swift_Signers_DKIMSigner instead. - */ -class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner -{ - private $peclLoaded = false; - - private $dkimHandler = null; - - private $dropFirstLF = true; - - const CANON_RELAXED = 1; - const CANON_SIMPLE = 2; - const SIG_RSA_SHA1 = 3; - const SIG_RSA_SHA256 = 4; - - public function __construct($privateKey, $domainName, $selector) - { - if (!\extension_loaded('opendkim')) { - throw new Swift_SwiftException('php-opendkim extension not found'); - } - - $this->peclLoaded = true; - - parent::__construct($privateKey, $domainName, $selector); - } - - public function addSignature(Swift_Mime_SimpleHeaderSet $headers) - { - $header = new Swift_Mime_Headers_OpenDKIMHeader('DKIM-Signature'); - $headerVal = $this->dkimHandler->getSignatureHeader(); - if (false === $headerVal || \is_int($headerVal)) { - throw new Swift_SwiftException('OpenDKIM Error: '.$this->dkimHandler->getError()); - } - $header->setValue($headerVal); - $headers->set($header); - - return $this; - } - - public function setHeaders(Swift_Mime_SimpleHeaderSet $headers) - { - $hash = 'rsa-sha1' == $this->hashAlgorithm ? OpenDKIMSign::ALG_RSASHA1 : OpenDKIMSign::ALG_RSASHA256; - $bodyCanon = 'simple' == $this->bodyCanon ? OpenDKIMSign::CANON_SIMPLE : OpenDKIMSign::CANON_RELAXED; - $headerCanon = 'simple' == $this->headerCanon ? OpenDKIMSign::CANON_SIMPLE : OpenDKIMSign::CANON_RELAXED; - $this->dkimHandler = new OpenDKIMSign($this->privateKey, $this->selector, $this->domainName, $headerCanon, $bodyCanon, $hash, -1); - // Hardcode signature Margin for now - $this->dkimHandler->setMargin(78); - - if (!is_numeric($this->signatureTimestamp)) { - OpenDKIM::setOption(OpenDKIM::OPTS_FIXEDTIME, time()); - } else { - if (!OpenDKIM::setOption(OpenDKIM::OPTS_FIXEDTIME, $this->signatureTimestamp)) { - throw new Swift_SwiftException('Unable to force signature timestamp ['.openssl_error_string().']'); - } - } - if (isset($this->signerIdentity)) { - $this->dkimHandler->setSigner($this->signerIdentity); - } - $listHeaders = $headers->listAll(); - foreach ($listHeaders as $hName) { - // Check if we need to ignore Header - if (!isset($this->ignoredHeaders[strtolower($hName)])) { - $tmp = $headers->getAll($hName); - if ($headers->has($hName)) { - foreach ($tmp as $header) { - if ('' != $header->getFieldBody()) { - $htosign = $header->toString(); - $this->dkimHandler->header($htosign); - $this->signedHeaders[] = $header->getFieldName(); - } - } - } - } - } - - return $this; - } - - public function startBody() - { - if (!$this->peclLoaded) { - return parent::startBody(); - } - $this->dropFirstLF = true; - $this->dkimHandler->eoh(); - - return $this; - } - - public function endBody() - { - if (!$this->peclLoaded) { - return parent::endBody(); - } - $this->dkimHandler->eom(); - - return $this; - } - - public function reset() - { - $this->dkimHandler = null; - parent::reset(); - - return $this; - } - - /** - * Set the signature timestamp. - * - * @param int $time - * - * @return $this - */ - public function setSignatureTimestamp($time) - { - $this->signatureTimestamp = $time; - - return $this; - } - - /** - * Set the signature expiration timestamp. - * - * @param int $time - * - * @return $this - */ - public function setSignatureExpiration($time) - { - $this->signatureExpiration = $time; - - return $this; - } - - /** - * Enable / disable the DebugHeaders. - * - * @param bool $debug - * - * @return $this - */ - public function setDebugHeaders($debug) - { - $this->debugHeaders = (bool) $debug; - - return $this; - } - - // Protected - - protected function canonicalizeBody($string) - { - if (!$this->peclLoaded) { - return parent::canonicalizeBody($string); - } - if (true === $this->dropFirstLF) { - if ("\r" == $string[0] && "\n" == $string[1]) { - $string = substr($string, 2); - } - } - $this->dropFirstLF = false; - if (\strlen($string)) { - $this->dkimHandler->body($string); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php deleted file mode 100644 index 30f3cbd..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php +++ /dev/null @@ -1,542 +0,0 @@ - - * @author Jan Flora - */ -class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner -{ - protected $signCertificate; - protected $signPrivateKey; - protected $encryptCert; - protected $signThenEncrypt = true; - protected $signLevel; - protected $encryptLevel; - protected $signOptions; - protected $encryptOptions; - protected $encryptCipher; - protected $extraCerts = null; - protected $wrapFullMessage = false; - - /** - * @var Swift_StreamFilters_StringReplacementFilterFactory - */ - protected $replacementFactory; - - /** - * @var Swift_Mime_SimpleHeaderFactory - */ - protected $headerFactory; - - /** - * Constructor. - * - * @param string|null $signCertificate - * @param string|null $signPrivateKey - * @param string|null $encryptCertificate - */ - public function __construct($signCertificate = null, $signPrivateKey = null, $encryptCertificate = null) - { - if (null !== $signPrivateKey) { - $this->setSignCertificate($signCertificate, $signPrivateKey); - } - - if (null !== $encryptCertificate) { - $this->setEncryptCertificate($encryptCertificate); - } - - $this->replacementFactory = Swift_DependencyContainer::getInstance() - ->lookup('transport.replacementfactory'); - - $this->signOptions = PKCS7_DETACHED; - $this->encryptCipher = OPENSSL_CIPHER_AES_128_CBC; - } - - /** - * Set the certificate location to use for signing. - * - * @see https://secure.php.net/manual/en/openssl.pkcs7.flags.php - * - * @param string $certificate - * @param string|array $privateKey If the key needs an passphrase use array('file-location', 'passphrase') instead - * @param int $signOptions Bitwise operator options for openssl_pkcs7_sign() - * @param string $extraCerts A file containing intermediate certificates needed by the signing certificate - * - * @return $this - */ - public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null) - { - $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate)); - - if (null !== $privateKey) { - if (\is_array($privateKey)) { - $this->signPrivateKey = $privateKey; - $this->signPrivateKey[0] = 'file://'.str_replace('\\', '/', realpath($privateKey[0])); - } else { - $this->signPrivateKey = 'file://'.str_replace('\\', '/', realpath($privateKey)); - } - } - - $this->signOptions = $signOptions; - $this->extraCerts = $extraCerts ? realpath($extraCerts) : null; - - return $this; - } - - /** - * Set the certificate location to use for encryption. - * - * @see https://secure.php.net/manual/en/openssl.pkcs7.flags.php - * @see https://secure.php.net/manual/en/openssl.ciphers.php - * - * @param string|array $recipientCerts Either an single X.509 certificate, or an assoc array of X.509 certificates. - * @param int $cipher - * - * @return $this - */ - public function setEncryptCertificate($recipientCerts, $cipher = null) - { - if (\is_array($recipientCerts)) { - $this->encryptCert = []; - - foreach ($recipientCerts as $cert) { - $this->encryptCert[] = 'file://'.str_replace('\\', '/', realpath($cert)); - } - } else { - $this->encryptCert = 'file://'.str_replace('\\', '/', realpath($recipientCerts)); - } - - if (null !== $cipher) { - $this->encryptCipher = $cipher; - } - - return $this; - } - - /** - * @return string - */ - public function getSignCertificate() - { - return $this->signCertificate; - } - - /** - * @return string - */ - public function getSignPrivateKey() - { - return $this->signPrivateKey; - } - - /** - * Set perform signing before encryption. - * - * The default is to first sign the message and then encrypt. - * But some older mail clients, namely Microsoft Outlook 2000 will work when the message first encrypted. - * As this goes against the official specs, its recommended to only use 'encryption -> signing' when specifically targeting these 'broken' clients. - * - * @param bool $signThenEncrypt - * - * @return $this - */ - public function setSignThenEncrypt($signThenEncrypt = true) - { - $this->signThenEncrypt = $signThenEncrypt; - - return $this; - } - - /** - * @return bool - */ - public function isSignThenEncrypt() - { - return $this->signThenEncrypt; - } - - /** - * Resets internal states. - * - * @return $this - */ - public function reset() - { - return $this; - } - - /** - * Specify whether to wrap the entire MIME message in the S/MIME message. - * - * According to RFC5751 section 3.1: - * In order to protect outer, non-content-related message header fields - * (for instance, the "Subject", "To", "From", and "Cc" fields), the - * sending client MAY wrap a full MIME message in a message/rfc822 - * wrapper in order to apply S/MIME security services to these header - * fields. It is up to the receiving client to decide how to present - * this "inner" header along with the unprotected "outer" header. - * - * @param bool $wrap - * - * @return $this - */ - public function setWrapFullMessage($wrap) - { - $this->wrapFullMessage = $wrap; - } - - /** - * Change the Swift_Message to apply the signing. - * - * @return $this - */ - public function signMessage(Swift_Message $message) - { - if (null === $this->signCertificate && null === $this->encryptCert) { - return $this; - } - - if ($this->signThenEncrypt) { - $this->smimeSignMessage($message); - $this->smimeEncryptMessage($message); - } else { - $this->smimeEncryptMessage($message); - $this->smimeSignMessage($message); - } - } - - /** - * Return the list of header a signer might tamper. - * - * @return array - */ - public function getAlteredHeaders() - { - return ['Content-Type', 'Content-Transfer-Encoding', 'Content-Disposition']; - } - - /** - * Sign a Swift message. - */ - protected function smimeSignMessage(Swift_Message $message) - { - // If we don't have a certificate we can't sign the message - if (null === $this->signCertificate) { - return; - } - - // Work on a clone of the original message - $signMessage = clone $message; - $signMessage->clearSigners(); - - if ($this->wrapFullMessage) { - // The original message essentially becomes the body of the new - // wrapped message - $signMessage = $this->wrapMimeMessage($signMessage); - } else { - // Only keep header needed to parse the body correctly - $this->clearAllHeaders($signMessage); - $this->copyHeaders( - $message, - $signMessage, - [ - 'Content-Type', - 'Content-Transfer-Encoding', - 'Content-Disposition', - ] - ); - } - - // Copy the cloned message into a temporary file stream - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $signMessage->toByteStream($messageStream); - $messageStream->commit(); - $signedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - // Sign the message using openssl - if (!openssl_pkcs7_sign( - $messageStream->getPath(), - $signedMessageStream->getPath(), - $this->signCertificate, - $this->signPrivateKey, - [], - $this->signOptions, - $this->extraCerts - ) - ) { - throw new Swift_IoException(sprintf('Failed to sign S/Mime message. Error: "%s".', openssl_error_string())); - } - - // Parse the resulting signed message content back into the Swift message - // preserving the original headers - $this->parseSSLOutput($signedMessageStream, $message); - } - - /** - * Encrypt a Swift message. - */ - protected function smimeEncryptMessage(Swift_Message $message) - { - // If we don't have a certificate we can't encrypt the message - if (null === $this->encryptCert) { - return; - } - - // Work on a clone of the original message - $encryptMessage = clone $message; - $encryptMessage->clearSigners(); - - if ($this->wrapFullMessage) { - // The original message essentially becomes the body of the new - // wrapped message - $encryptMessage = $this->wrapMimeMessage($encryptMessage); - } else { - // Only keep header needed to parse the body correctly - $this->clearAllHeaders($encryptMessage); - $this->copyHeaders( - $message, - $encryptMessage, - [ - 'Content-Type', - 'Content-Transfer-Encoding', - 'Content-Disposition', - ] - ); - } - - // Convert the message content (including headers) to a string - // and place it in a temporary file - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $encryptMessage->toByteStream($messageStream); - $messageStream->commit(); - $encryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - // Encrypt the message - if (!openssl_pkcs7_encrypt( - $messageStream->getPath(), - $encryptedMessageStream->getPath(), - $this->encryptCert, - [], - 0, - $this->encryptCipher - ) - ) { - throw new Swift_IoException(sprintf('Failed to encrypt S/Mime message. Error: "%s".', openssl_error_string())); - } - - // Parse the resulting signed message content back into the Swift message - // preserving the original headers - $this->parseSSLOutput($encryptedMessageStream, $message); - } - - /** - * Copy named headers from one Swift message to another. - */ - protected function copyHeaders( - Swift_Message $fromMessage, - Swift_Message $toMessage, - array $headers = [] - ) { - foreach ($headers as $header) { - $this->copyHeader($fromMessage, $toMessage, $header); - } - } - - /** - * Copy a single header from one Swift message to another. - * - * @param string $headerName - */ - protected function copyHeader(Swift_Message $fromMessage, Swift_Message $toMessage, $headerName) - { - $header = $fromMessage->getHeaders()->get($headerName); - if (!$header) { - return; - } - $headers = $toMessage->getHeaders(); - switch ($header->getFieldType()) { - case Swift_Mime_Header::TYPE_TEXT: - $headers->addTextHeader($header->getFieldName(), $header->getValue()); - break; - case Swift_Mime_Header::TYPE_PARAMETERIZED: - $headers->addParameterizedHeader( - $header->getFieldName(), - $header->getValue(), - $header->getParameters() - ); - break; - } - } - - /** - * Remove all headers from a Swift message. - */ - protected function clearAllHeaders(Swift_Message $message) - { - $headers = $message->getHeaders(); - foreach ($headers->listAll() as $header) { - $headers->removeAll($header); - } - } - - /** - * Wraps a Swift_Message in a message/rfc822 MIME part. - * - * @return Swift_MimePart - */ - protected function wrapMimeMessage(Swift_Message $message) - { - // Start by copying the original message into a message stream - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - // Create a new MIME part that wraps the original stream - $wrappedMessage = new Swift_MimePart($messageStream, 'message/rfc822'); - $wrappedMessage->setEncoder(new Swift_Mime_ContentEncoder_PlainContentEncoder('7bit')); - - return $wrappedMessage; - } - - protected function parseSSLOutput(Swift_InputByteStream $inputStream, Swift_Message $message) - { - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $this->copyFromOpenSSLOutput($inputStream, $messageStream); - - $this->streamToMime($messageStream, $message); - } - - /** - * Merges an OutputByteStream from OpenSSL to a Swift_Message. - */ - protected function streamToMime(Swift_OutputByteStream $fromStream, Swift_Message $message) - { - // Parse the stream into headers and body - list($headers, $messageStream) = $this->parseStream($fromStream); - - // Get the original message headers - $messageHeaders = $message->getHeaders(); - - // Let the stream determine the headers describing the body content, - // since the body of the original message is overwritten by the body - // coming from the stream. - // These are all content-* headers. - - // Default transfer encoding is 7bit if not set - $encoding = ''; - // Remove all existing transfer encoding headers - $messageHeaders->removeAll('Content-Transfer-Encoding'); - // See whether the stream sets the transfer encoding - if (isset($headers['content-transfer-encoding'])) { - $encoding = $headers['content-transfer-encoding']; - } - - // We use the null content encoder, since the body is already encoded - // according to the transfer encoding specified in the stream - $message->setEncoder(new Swift_Mime_ContentEncoder_NullContentEncoder($encoding)); - - // Set the disposition, if present - if (isset($headers['content-disposition'])) { - $messageHeaders->addTextHeader('Content-Disposition', $headers['content-disposition']); - } - - // Copy over the body from the stream using the content type dictated - // by the stream content - $message->setChildren([]); - $message->setBody($messageStream, $headers['content-type']); - } - - /** - * This message will parse the headers of a MIME email byte stream - * and return an array that contains the headers as an associative - * array and the email body as a string. - * - * @return array - */ - protected function parseStream(Swift_OutputByteStream $emailStream) - { - $bufferLength = 78; - $headerData = ''; - $headerBodySeparator = "\r\n\r\n"; - - $emailStream->setReadPointer(0); - - // Read out the headers section from the stream to a string - while (false !== ($buffer = $emailStream->read($bufferLength))) { - $headerData .= $buffer; - - $headersPosEnd = strpos($headerData, $headerBodySeparator); - - // Stop reading if we found the end of the headers - if (false !== $headersPosEnd) { - break; - } - } - - // Split the header data into lines - $headerData = trim(substr($headerData, 0, $headersPosEnd)); - $headerLines = explode("\r\n", $headerData); - unset($headerData); - - $headers = []; - $currentHeaderName = ''; - - // Transform header lines into an associative array - foreach ($headerLines as $headerLine) { - // Handle headers that span multiple lines - if (false === strpos($headerLine, ':')) { - $headers[$currentHeaderName] .= ' '.trim($headerLine); - continue; - } - - $header = explode(':', $headerLine, 2); - $currentHeaderName = strtolower($header[0]); - $headers[$currentHeaderName] = trim($header[1]); - } - - // Read the entire email body into a byte stream - $bodyStream = new Swift_ByteStream_TemporaryFileByteStream(); - - // Skip the header and separator and point to the body - $emailStream->setReadPointer($headersPosEnd + \strlen($headerBodySeparator)); - - while (false !== ($buffer = $emailStream->read($bufferLength))) { - $bodyStream->write($buffer); - } - - $bodyStream->commit(); - - return [$headers, $bodyStream]; - } - - protected function copyFromOpenSSLOutput(Swift_OutputByteStream $fromStream, Swift_InputByteStream $toStream) - { - $bufferLength = 4096; - $filteredStream = new Swift_ByteStream_TemporaryFileByteStream(); - $filteredStream->addFilter($this->replacementFactory->createFilter("\r\n", "\n"), 'CRLF to LF'); - $filteredStream->addFilter($this->replacementFactory->createFilter("\n", "\r\n"), 'LF to CRLF'); - - while (false !== ($buffer = $fromStream->read($bufferLength))) { - $filteredStream->write($buffer); - } - - $filteredStream->flushBuffers(); - - while (false !== ($buffer = $filteredStream->read($bufferLength))) { - $toStream->write($buffer); - } - - $toStream->commit(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php deleted file mode 100644 index 726b468..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php +++ /dev/null @@ -1,42 +0,0 @@ -createDependenciesFor('transport.smtp') - ); - - $this->setHost($host); - $this->setPort($port); - $this->setEncryption($encryption); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php deleted file mode 100644 index 9d0e8fe..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Spool.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for spools. - * - * @author Fabien Potencier - */ -interface Swift_Spool -{ - /** - * Starts this Spool mechanism. - */ - public function start(); - - /** - * Stops this Spool mechanism. - */ - public function stop(); - - /** - * Tests if this Spool mechanism has started. - * - * @return bool - */ - public function isStarted(); - - /** - * Queues a message. - * - * @param Swift_Mime_SimpleMessage $message The message to store - * - * @return bool Whether the operation has succeeded - */ - public function queueMessage(Swift_Mime_SimpleMessage $message); - - /** - * Sends messages using the given transport instance. - * - * @param Swift_Transport $transport A transport instance - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php deleted file mode 100644 index c08e0fb..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in a queue. - * - * @author Fabien Potencier - */ -class Swift_SpoolTransport extends Swift_Transport_SpoolTransport -{ - /** - * Create a new SpoolTransport. - */ - public function __construct(Swift_Spool $spool) - { - $arguments = Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.spool'); - - $arguments[] = $spool; - - \call_user_func_array( - [$this, 'Swift_Transport_SpoolTransport::__construct'], - $arguments - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php deleted file mode 100644 index 362be2e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilter.php +++ /dev/null @@ -1,35 +0,0 @@ -index = []; - $this->tree = []; - $this->replace = []; - $this->repSize = []; - - $tree = null; - $i = null; - $last_size = $size = 0; - foreach ($search as $i => $search_element) { - if (null !== $tree) { - $tree[-1] = min(\count($replace) - 1, $i - 1); - $tree[-2] = $last_size; - } - $tree = &$this->tree; - if (\is_array($search_element)) { - foreach ($search_element as $k => $char) { - $this->index[$char] = true; - if (!isset($tree[$char])) { - $tree[$char] = []; - } - $tree = &$tree[$char]; - } - $last_size = $k + 1; - $size = max($size, $last_size); - } else { - $last_size = 1; - if (!isset($tree[$search_element])) { - $tree[$search_element] = []; - } - $tree = &$tree[$search_element]; - $size = max($last_size, $size); - $this->index[$search_element] = true; - } - } - if (null !== $i) { - $tree[-1] = min(\count($replace) - 1, $i); - $tree[-2] = $last_size; - $this->treeMaxLen = $size; - } - foreach ($replace as $rep) { - if (!\is_array($rep)) { - $rep = [$rep]; - } - $this->replace[] = $rep; - } - for ($i = \count($this->replace) - 1; $i >= 0; --$i) { - $this->replace[$i] = $rep = $this->filter($this->replace[$i], $i); - $this->repSize[$i] = \count($rep); - } - } - - /** - * Returns true if based on the buffer passed more bytes should be buffered. - * - * @param array $buffer - * - * @return bool - */ - public function shouldBuffer($buffer) - { - $endOfBuffer = end($buffer); - - return isset($this->index[$endOfBuffer]); - } - - /** - * Perform the actual replacements on $buffer and return the result. - * - * @param array $buffer - * @param int $minReplaces - * - * @return array - */ - public function filter($buffer, $minReplaces = -1) - { - if (0 == $this->treeMaxLen) { - return $buffer; - } - - $newBuffer = []; - $buf_size = \count($buffer); - $last_size = 0; - for ($i = 0; $i < $buf_size; ++$i) { - $search_pos = $this->tree; - $last_found = PHP_INT_MAX; - // We try to find if the next byte is part of a search pattern - for ($j = 0; $j <= $this->treeMaxLen; ++$j) { - // We have a new byte for a search pattern - if (isset($buffer[$p = $i + $j]) && isset($search_pos[$buffer[$p]])) { - $search_pos = $search_pos[$buffer[$p]]; - // We have a complete pattern, save, in case we don't find a better match later - if (isset($search_pos[-1]) && $search_pos[-1] < $last_found - && $search_pos[-1] > $minReplaces) { - $last_found = $search_pos[-1]; - $last_size = $search_pos[-2]; - } - } - // We got a complete pattern - elseif (PHP_INT_MAX !== $last_found) { - // Adding replacement datas to output buffer - $rep_size = $this->repSize[$last_found]; - for ($j = 0; $j < $rep_size; ++$j) { - $newBuffer[] = $this->replace[$last_found][$j]; - } - // We Move cursor forward - $i += $last_size - 1; - // Edge Case, last position in buffer - if ($i >= $buf_size) { - $newBuffer[] = $buffer[$i]; - } - - // We start the next loop - continue 2; - } else { - // this byte is not in a pattern and we haven't found another pattern - break; - } - } - // Normal byte, move it to output buffer - $newBuffer[] = $buffer[$i]; - } - - return $newBuffer; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php deleted file mode 100644 index 50a63f1..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php +++ /dev/null @@ -1,70 +0,0 @@ -search = $search; - $this->replace = $replace; - } - - /** - * Returns true if based on the buffer passed more bytes should be buffered. - * - * @param string $buffer - * - * @return bool - */ - public function shouldBuffer($buffer) - { - if ('' === $buffer) { - return false; - } - - $endOfBuffer = substr($buffer, -1); - foreach ((array) $this->search as $needle) { - if (false !== strpos($needle, $endOfBuffer)) { - return true; - } - } - - return false; - } - - /** - * Perform the actual replacements on $buffer and return the result. - * - * @param string $buffer - * - * @return string - */ - public function filter($buffer) - { - return str_replace($this->search, $this->replace, $buffer); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php deleted file mode 100644 index 783b889..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php +++ /dev/null @@ -1,45 +0,0 @@ -filters[$search][$replace])) { - if (!isset($this->filters[$search])) { - $this->filters[$search] = []; - } - - if (!isset($this->filters[$search][$replace])) { - $this->filters[$search][$replace] = []; - } - - $this->filters[$search][$replace] = new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } - - return $this->filters[$search][$replace]; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php deleted file mode 100644 index 15e68b1..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SwiftException.php +++ /dev/null @@ -1,28 +0,0 @@ -ping()) { - * $transport->stop(); - * $transport->start(); - * } - * - * The Transport mechanism will be started, if it is not already. - * - * It is undefined if the Transport mechanism attempts to restart as long as - * the return value reflects whether the mechanism is now functional. - * - * @return bool TRUE if the transport is alive - */ - public function ping(); - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * This is the responsibility of the send method to start the transport if needed. - * - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null); - - /** - * Register a plugin in the Transport. - */ - public function registerPlugin(Swift_Events_EventListener $plugin); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php deleted file mode 100644 index 546b2d8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php +++ /dev/null @@ -1,556 +0,0 @@ -buffer = $buf; - $this->eventDispatcher = $dispatcher; - $this->addressEncoder = $addressEncoder ?? new Swift_AddressEncoder_IdnAddressEncoder(); - $this->setLocalDomain($localDomain); - } - - /** - * Set the name of the local domain which Swift will identify itself as. - * - * This should be a fully-qualified domain name and should be truly the domain - * you're using. - * - * If your server does not have a domain name, use the IP address. This will - * automatically be wrapped in square brackets as described in RFC 5321, - * section 4.1.3. - * - * @param string $domain - * - * @return $this - */ - public function setLocalDomain($domain) - { - if ('[' !== substr($domain, 0, 1)) { - if (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - $domain = '['.$domain.']'; - } elseif (filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - $domain = '[IPv6:'.$domain.']'; - } - } - - $this->domain = $domain; - - return $this; - } - - /** - * Get the name of the domain Swift will identify as. - * - * If an IP address was specified, this will be returned wrapped in square - * brackets as described in RFC 5321, section 4.1.3. - * - * @return string - */ - public function getLocalDomain() - { - return $this->domain; - } - - /** - * Sets the source IP. - * - * @param string $source - */ - public function setSourceIp($source) - { - $this->sourceIp = $source; - } - - /** - * Returns the IP used to connect to the destination. - * - * @return string - */ - public function getSourceIp() - { - return $this->sourceIp; - } - - public function setAddressEncoder(Swift_AddressEncoder $addressEncoder) - { - $this->addressEncoder = $addressEncoder; - } - - public function getAddressEncoder() - { - return $this->addressEncoder; - } - - /** - * Start the SMTP connection. - */ - public function start() - { - if (!$this->started) { - if ($evt = $this->eventDispatcher->createTransportChangeEvent($this)) { - $this->eventDispatcher->dispatchEvent($evt, 'beforeTransportStarted'); - if ($evt->bubbleCancelled()) { - return; - } - } - - try { - $this->buffer->initialize($this->getBufferParams()); - } catch (Swift_TransportException $e) { - $this->throwException($e); - } - $this->readGreeting(); - $this->doHeloCommand(); - - if ($evt) { - $this->eventDispatcher->dispatchEvent($evt, 'transportStarted'); - } - - $this->started = true; - } - } - - /** - * Test if an SMTP connection has been established. - * - * @return bool - */ - public function isStarted() - { - return $this->started; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) - { - if (!$this->isStarted()) { - $this->start(); - } - - $sent = 0; - $failedRecipients = (array) $failedRecipients; - - if ($evt = $this->eventDispatcher->createSendEvent($this, $message)) { - $this->eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if (!$reversePath = $this->getReversePath($message)) { - $this->throwException(new Swift_TransportException('Cannot send message without a sender address')); - } - - $to = (array) $message->getTo(); - $cc = (array) $message->getCc(); - $tos = array_merge($to, $cc); - $bcc = (array) $message->getBcc(); - - $message->setBcc([]); - - try { - $sent += $this->sendTo($message, $reversePath, $tos, $failedRecipients); - $sent += $this->sendBcc($message, $reversePath, $bcc, $failedRecipients); - } finally { - $message->setBcc($bcc); - } - - if ($evt) { - if ($sent == \count($to) + \count($cc) + \count($bcc)) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - } elseif ($sent > 0) { - $evt->setResult(Swift_Events_SendEvent::RESULT_TENTATIVE); - } else { - $evt->setResult(Swift_Events_SendEvent::RESULT_FAILED); - } - $evt->setFailedRecipients($failedRecipients); - $this->eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); //Make sure a new Message ID is used - - return $sent; - } - - /** - * Stop the SMTP connection. - */ - public function stop() - { - if ($this->started) { - if ($evt = $this->eventDispatcher->createTransportChangeEvent($this)) { - $this->eventDispatcher->dispatchEvent($evt, 'beforeTransportStopped'); - if ($evt->bubbleCancelled()) { - return; - } - } - - try { - $this->executeCommand("QUIT\r\n", [221]); - } catch (Swift_TransportException $e) { - } - - try { - $this->buffer->terminate(); - - if ($evt) { - $this->eventDispatcher->dispatchEvent($evt, 'transportStopped'); - } - } catch (Swift_TransportException $e) { - $this->throwException($e); - } - } - $this->started = false; - } - - /** - * {@inheritdoc} - */ - public function ping() - { - try { - if (!$this->isStarted()) { - $this->start(); - } - - $this->executeCommand("NOOP\r\n", [250]); - } catch (Swift_TransportException $e) { - try { - $this->stop(); - } catch (Swift_TransportException $e) { - } - - return false; - } - - return true; - } - - /** - * Register a plugin. - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->eventDispatcher->bindEventListener($plugin); - } - - /** - * Reset the current mail transaction. - */ - public function reset() - { - $this->executeCommand("RSET\r\n", [250], $failures, true); - } - - /** - * Get the IoBuffer where read/writes are occurring. - * - * @return Swift_Transport_IoBuffer - */ - public function getBuffer() - { - return $this->buffer; - } - - /** - * Run a command against the buffer, expecting the given response codes. - * - * If no response codes are given, the response will not be validated. - * If codes are given, an exception will be thrown on an invalid response. - * If the command is RCPT TO, and the pipeline is non-empty, no exception - * will be thrown; instead the failing address is added to $failures. - * - * @param string $command - * @param int[] $codes - * @param string[] $failures An array of failures by-reference - * @param bool $pipeline Do not wait for response - * @param string $address the address, if command is RCPT TO - * - * @return string|null The server response, or null if pipelining is enabled - */ - public function executeCommand($command, $codes = [], &$failures = null, $pipeline = false, $address = null) - { - $failures = (array) $failures; - $seq = $this->buffer->write($command); - if ($evt = $this->eventDispatcher->createCommandEvent($this, $command, $codes)) { - $this->eventDispatcher->dispatchEvent($evt, 'commandSent'); - } - - $this->pipeline[] = [$command, $seq, $codes, $address]; - - if ($pipeline && $this->pipelining) { - return null; - } - - $response = null; - - while ($this->pipeline) { - list($command, $seq, $codes, $address) = array_shift($this->pipeline); - $response = $this->getFullResponse($seq); - try { - $this->assertResponseCode($response, $codes); - } catch (Swift_TransportException $e) { - if ($this->pipeline && $address) { - $failures[] = $address; - } else { - $this->throwException($e); - } - } - } - - return $response; - } - - /** Read the opening SMTP greeting */ - protected function readGreeting() - { - $this->assertResponseCode($this->getFullResponse(0), [220]); - } - - /** Send the HELO welcome */ - protected function doHeloCommand() - { - $this->executeCommand( - sprintf("HELO %s\r\n", $this->domain), [250] - ); - } - - /** Send the MAIL FROM command */ - protected function doMailFromCommand($address) - { - $address = $this->addressEncoder->encodeString($address); - $this->executeCommand( - sprintf("MAIL FROM:<%s>\r\n", $address), [250], $failures, true - ); - } - - /** Send the RCPT TO command */ - protected function doRcptToCommand($address) - { - $address = $this->addressEncoder->encodeString($address); - $this->executeCommand( - sprintf("RCPT TO:<%s>\r\n", $address), [250, 251, 252], $failures, true, $address - ); - } - - /** Send the DATA command */ - protected function doDataCommand(&$failedRecipients) - { - $this->executeCommand("DATA\r\n", [354], $failedRecipients); - } - - /** Stream the contents of the message over the buffer */ - protected function streamMessage(Swift_Mime_SimpleMessage $message) - { - $this->buffer->setWriteTranslations(["\r\n." => "\r\n.."]); - try { - $message->toByteStream($this->buffer); - $this->buffer->flushBuffers(); - } catch (Swift_TransportException $e) { - $this->throwException($e); - } - $this->buffer->setWriteTranslations([]); - $this->executeCommand("\r\n.\r\n", [250]); - } - - /** Determine the best-use reverse path for this message */ - protected function getReversePath(Swift_Mime_SimpleMessage $message) - { - $return = $message->getReturnPath(); - $sender = $message->getSender(); - $from = $message->getFrom(); - $path = null; - if (!empty($return)) { - $path = $return; - } elseif (!empty($sender)) { - // Don't use array_keys - reset($sender); // Reset Pointer to first pos - $path = key($sender); // Get key - } elseif (!empty($from)) { - reset($from); // Reset Pointer to first pos - $path = key($from); // Get key - } - - return $path; - } - - /** Throw a TransportException, first sending it to any listeners */ - protected function throwException(Swift_TransportException $e) - { - if ($evt = $this->eventDispatcher->createTransportExceptionEvent($this, $e)) { - $this->eventDispatcher->dispatchEvent($evt, 'exceptionThrown'); - if (!$evt->bubbleCancelled()) { - throw $e; - } - } else { - throw $e; - } - } - - /** Throws an Exception if a response code is incorrect */ - protected function assertResponseCode($response, $wanted) - { - if (!$response) { - $this->throwException(new Swift_TransportException('Expected response code '.implode('/', $wanted).' but got an empty response')); - } - - list($code) = sscanf($response, '%3d'); - $valid = (empty($wanted) || \in_array($code, $wanted)); - - if ($evt = $this->eventDispatcher->createResponseEvent($this, $response, - $valid)) { - $this->eventDispatcher->dispatchEvent($evt, 'responseReceived'); - } - - if (!$valid) { - $this->throwException(new Swift_TransportException('Expected response code '.implode('/', $wanted).' but got code "'.$code.'", with message "'.$response.'"', $code)); - } - } - - /** Get an entire multi-line response using its sequence number */ - protected function getFullResponse($seq) - { - $response = ''; - try { - do { - $line = $this->buffer->readLine($seq); - $response .= $line; - } while (null !== $line && false !== $line && ' ' != $line[3]); - } catch (Swift_TransportException $e) { - $this->throwException($e); - } catch (Swift_IoException $e) { - $this->throwException(new Swift_TransportException($e->getMessage(), 0, $e)); - } - - return $response; - } - - /** Send an email to the given recipients from the given reverse path */ - private function doMailTransaction($message, $reversePath, array $recipients, array &$failedRecipients) - { - $sent = 0; - $this->doMailFromCommand($reversePath); - foreach ($recipients as $forwardPath) { - try { - $this->doRcptToCommand($forwardPath); - ++$sent; - } catch (Swift_TransportException $e) { - $failedRecipients[] = $forwardPath; - } catch (Swift_AddressEncoderException $e) { - $failedRecipients[] = $forwardPath; - } - } - - if (0 != $sent) { - $sent += \count($failedRecipients); - $this->doDataCommand($failedRecipients); - $sent -= \count($failedRecipients); - - $this->streamMessage($message); - } else { - $this->reset(); - } - - return $sent; - } - - /** Send a message to the given To: recipients */ - private function sendTo(Swift_Mime_SimpleMessage $message, $reversePath, array $to, array &$failedRecipients) - { - if (empty($to)) { - return 0; - } - - return $this->doMailTransaction($message, $reversePath, array_keys($to), - $failedRecipients); - } - - /** Send a message to all Bcc: recipients */ - private function sendBcc(Swift_Mime_SimpleMessage $message, $reversePath, array $bcc, array &$failedRecipients) - { - $sent = 0; - foreach ($bcc as $forwardPath => $name) { - $message->setBcc([$forwardPath => $name]); - $sent += $this->doMailTransaction( - $message, $reversePath, [$forwardPath], $failedRecipients - ); - } - - return $sent; - } - - /** - * Destructor. - */ - public function __destruct() - { - try { - $this->stop(); - } catch (Exception $e) { - } - } - - public function __sleep() - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php deleted file mode 100644 index e7ccf6d..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php +++ /dev/null @@ -1,75 +0,0 @@ -executeCommand("AUTH CRAM-MD5\r\n", [334]); - $challenge = base64_decode(substr($challenge, 4)); - $message = base64_encode( - $username.' '.$this->getResponse($password, $challenge) - ); - $agent->executeCommand(sprintf("%s\r\n", $message), [235]); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", [250]); - - throw $e; - } - } - - /** - * Generate a CRAM-MD5 response from a server challenge. - * - * @param string $secret - * @param string $challenge - * - * @return string - */ - private function getResponse($secret, $challenge) - { - if (\strlen($secret) > 64) { - $secret = pack('H32', md5($secret)); - } - - if (\strlen($secret) < 64) { - $secret = str_pad($secret, 64, \chr(0)); - } - - $k_ipad = substr($secret, 0, 64) ^ str_repeat(\chr(0x36), 64); - $k_opad = substr($secret, 0, 64) ^ str_repeat(\chr(0x5C), 64); - - $inner = pack('H32', md5($k_ipad.$challenge)); - $digest = md5($k_opad.$inner); - - return $digest; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php deleted file mode 100644 index 458c038..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php +++ /dev/null @@ -1,45 +0,0 @@ -executeCommand("AUTH LOGIN\r\n", [334]); - $agent->executeCommand(sprintf("%s\r\n", base64_encode($username)), [334]); - $agent->executeCommand(sprintf("%s\r\n", base64_encode($password)), [235]); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", [250]); - - throw $e; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php deleted file mode 100644 index 21c070e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php +++ /dev/null @@ -1,681 +0,0 @@ - - */ -class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Esmtp_Authenticator -{ - const NTLMSIG = "NTLMSSP\x00"; - const DESCONST = 'KGS!@#$%'; - - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword() - { - return 'NTLM'; - } - - /** - * {@inheritdoc} - * - * @throws \LogicException - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) - { - if (!\function_exists('openssl_encrypt')) { - throw new LogicException('The OpenSSL extension must be enabled to use the NTLM authenticator.'); - } - - if (!\function_exists('bcmul')) { - throw new LogicException('The BCMath functions must be enabled to use the NTLM authenticator.'); - } - - try { - // execute AUTH command and filter out the code at the beginning - // AUTH NTLM xxxx - $response = base64_decode(substr(trim($this->sendMessage1($agent)), 4)); - - // extra parameters for our unit cases - $timestamp = \func_num_args() > 3 ? func_get_arg(3) : $this->getCorrectTimestamp(bcmul(microtime(true), '1000')); - $client = \func_num_args() > 4 ? func_get_arg(4) : random_bytes(8); - - // Message 3 response - $this->sendMessage3($response, $username, $password, $timestamp, $client, $agent); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", [250]); - - throw $e; - } - } - - protected function si2bin($si, $bits = 32) - { - $bin = null; - if ($si >= -2 ** ($bits - 1) && ($si <= 2 ** ($bits - 1))) { - // positive or zero - if ($si >= 0) { - $bin = base_convert($si, 10, 2); - // pad to $bits bit - $bin_length = \strlen($bin); - if ($bin_length < $bits) { - $bin = str_repeat('0', $bits - $bin_length).$bin; - } - } else { - // negative - $si = -$si - 2 ** $bits; - $bin = base_convert($si, 10, 2); - $bin_length = \strlen($bin); - if ($bin_length > $bits) { - $bin = str_repeat('1', $bits - $bin_length).$bin; - } - } - } - - return $bin; - } - - /** - * Send our auth message and returns the response. - * - * @return string SMTP Response - */ - protected function sendMessage1(Swift_Transport_SmtpAgent $agent) - { - $message = $this->createMessage1(); - - return $agent->executeCommand(sprintf("AUTH %s %s\r\n", $this->getAuthKeyword(), base64_encode($message)), [334]); - } - - /** - * Fetch all details of our response (message 2). - * - * @param string $response - * - * @return array our response parsed - */ - protected function parseMessage2($response) - { - $responseHex = bin2hex($response); - $length = floor(hexdec(substr($responseHex, 28, 4)) / 256) * 2; - $offset = floor(hexdec(substr($responseHex, 32, 4)) / 256) * 2; - $challenge = hex2bin(substr($responseHex, 48, 16)); - $context = hex2bin(substr($responseHex, 64, 16)); - $targetInfoH = hex2bin(substr($responseHex, 80, 16)); - $targetName = hex2bin(substr($responseHex, $offset, $length)); - $offset = floor(hexdec(substr($responseHex, 88, 4)) / 256) * 2; - $targetInfoBlock = substr($responseHex, $offset); - list($domainName, $serverName, $DNSDomainName, $DNSServerName, $terminatorByte) = $this->readSubBlock($targetInfoBlock); - - return [ - $challenge, - $context, - $targetInfoH, - $targetName, - $domainName, - $serverName, - $DNSDomainName, - $DNSServerName, - hex2bin($targetInfoBlock), - $terminatorByte, - ]; - } - - /** - * Read the blob information in from message2. - * - * @return array - */ - protected function readSubBlock($block) - { - // remove terminatorByte cause it's always the same - $block = substr($block, 0, -8); - - $length = \strlen($block); - $offset = 0; - $data = []; - while ($offset < $length) { - $blockLength = hexdec(substr(substr($block, $offset, 8), -4)) / 256; - $offset += 8; - $data[] = hex2bin(substr($block, $offset, $blockLength * 2)); - $offset += $blockLength * 2; - } - - if (3 == \count($data)) { - $data[] = $data[2]; - $data[2] = ''; - } - - $data[] = $this->createByte('00'); - - return $data; - } - - /** - * Send our final message with all our data. - * - * @param string $response Message 1 response (message 2) - * @param string $username - * @param string $password - * @param string $timestamp - * @param string $client - * @param bool $v2 Use version2 of the protocol - * - * @return string - */ - protected function sendMessage3($response, $username, $password, $timestamp, $client, Swift_Transport_SmtpAgent $agent, $v2 = true) - { - list($domain, $username) = $this->getDomainAndUsername($username); - //$challenge, $context, $targetInfoH, $targetName, $domainName, $workstation, $DNSDomainName, $DNSServerName, $blob, $ter - list($challenge, , , , , $workstation, , , $blob) = $this->parseMessage2($response); - - if (!$v2) { - // LMv1 - $lmResponse = $this->createLMPassword($password, $challenge); - // NTLMv1 - $ntlmResponse = $this->createNTLMPassword($password, $challenge); - } else { - // LMv2 - $lmResponse = $this->createLMv2Password($password, $username, $domain, $challenge, $client); - // NTLMv2 - $ntlmResponse = $this->createNTLMv2Hash($password, $username, $domain, $challenge, $blob, $timestamp, $client); - } - - $message = $this->createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse); - - return $agent->executeCommand(sprintf("%s\r\n", base64_encode($message)), [235]); - } - - /** - * Create our message 1. - * - * @return string - */ - protected function createMessage1() - { - return self::NTLMSIG - .$this->createByte('01') // Message 1 -.$this->createByte('0702'); // Flags - } - - /** - * Create our message 3. - * - * @param string $domain - * @param string $username - * @param string $workstation - * @param string $lmResponse - * @param string $ntlmResponse - * - * @return string - */ - protected function createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse) - { - // Create security buffers - $domainSec = $this->createSecurityBuffer($domain, 64); - $domainInfo = $this->readSecurityBuffer(bin2hex($domainSec)); - $userSec = $this->createSecurityBuffer($username, ($domainInfo[0] + $domainInfo[1]) / 2); - $userInfo = $this->readSecurityBuffer(bin2hex($userSec)); - $workSec = $this->createSecurityBuffer($workstation, ($userInfo[0] + $userInfo[1]) / 2); - $workInfo = $this->readSecurityBuffer(bin2hex($workSec)); - $lmSec = $this->createSecurityBuffer($lmResponse, ($workInfo[0] + $workInfo[1]) / 2, true); - $lmInfo = $this->readSecurityBuffer(bin2hex($lmSec)); - $ntlmSec = $this->createSecurityBuffer($ntlmResponse, ($lmInfo[0] + $lmInfo[1]) / 2, true); - - return self::NTLMSIG - .$this->createByte('03') // TYPE 3 message -.$lmSec // LM response header -.$ntlmSec // NTLM response header -.$domainSec // Domain header -.$userSec // User header -.$workSec // Workstation header -.$this->createByte('000000009a', 8) // session key header (empty) -.$this->createByte('01020000') // FLAGS -.$this->convertTo16bit($domain) // domain name -.$this->convertTo16bit($username) // username -.$this->convertTo16bit($workstation) // workstation -.$lmResponse - .$ntlmResponse; - } - - /** - * @param string $timestamp Epoch timestamp in microseconds - * @param string $client Random bytes - * @param string $targetInfo - * - * @return string - */ - protected function createBlob($timestamp, $client, $targetInfo) - { - return $this->createByte('0101') - .$this->createByte('00') - .$timestamp - .$client - .$this->createByte('00') - .$targetInfo - .$this->createByte('00'); - } - - /** - * Get domain and username from our username. - * - * @example DOMAIN\username - * - * @param string $name - * - * @return array - */ - protected function getDomainAndUsername($name) - { - if (false !== strpos($name, '\\')) { - return explode('\\', $name); - } - - if (false !== strpos($name, '@')) { - list($user, $domain) = explode('@', $name); - - return [$domain, $user]; - } - - // no domain passed - return ['', $name]; - } - - /** - * Create LMv1 response. - * - * @param string $password - * @param string $challenge - * - * @return string - */ - protected function createLMPassword($password, $challenge) - { - // FIRST PART - $password = $this->createByte(strtoupper($password), 14, false); - list($key1, $key2) = str_split($password, 7); - - $desKey1 = $this->createDesKey($key1); - $desKey2 = $this->createDesKey($key2); - - $constantDecrypt = $this->createByte($this->desEncrypt(self::DESCONST, $desKey1).$this->desEncrypt(self::DESCONST, $desKey2), 21, false); - - // SECOND PART - list($key1, $key2, $key3) = str_split($constantDecrypt, 7); - - $desKey1 = $this->createDesKey($key1); - $desKey2 = $this->createDesKey($key2); - $desKey3 = $this->createDesKey($key3); - - return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); - } - - /** - * Create NTLMv1 response. - * - * @param string $password - * @param string $challenge - * - * @return string - */ - protected function createNTLMPassword($password, $challenge) - { - // FIRST PART - $ntlmHash = $this->createByte($this->md4Encrypt($password), 21, false); - list($key1, $key2, $key3) = str_split($ntlmHash, 7); - - $desKey1 = $this->createDesKey($key1); - $desKey2 = $this->createDesKey($key2); - $desKey3 = $this->createDesKey($key3); - - return $this->desEncrypt($challenge, $desKey1).$this->desEncrypt($challenge, $desKey2).$this->desEncrypt($challenge, $desKey3); - } - - /** - * Convert a normal timestamp to a tenth of a microtime epoch time. - * - * @param string $time - * - * @return string - */ - protected function getCorrectTimestamp($time) - { - // Get our timestamp (tricky!) - $time = number_format($time, 0, '.', ''); // save microtime to string - $time = bcadd($time, '11644473600000', 0); // add epoch time - $time = bcmul($time, 10000, 0); // tenths of a microsecond. - - $binary = $this->si2bin($time, 64); // create 64 bit binary string - $timestamp = ''; - for ($i = 0; $i < 8; ++$i) { - $timestamp .= \chr(bindec(substr($binary, -(($i + 1) * 8), 8))); - } - - return $timestamp; - } - - /** - * Create LMv2 response. - * - * @param string $password - * @param string $username - * @param string $domain - * @param string $challenge NTLM Challenge - * @param string $client Random string - * - * @return string - */ - protected function createLMv2Password($password, $username, $domain, $challenge, $client) - { - $lmPass = '00'; // by default 00 - // if $password > 15 than we can't use this method - if (\strlen($password) <= 15) { - $ntlmHash = $this->md4Encrypt($password); - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); - - $lmPass = bin2hex($this->md5Encrypt($ntml2Hash, $challenge.$client).$client); - } - - return $this->createByte($lmPass, 24); - } - - /** - * Create NTLMv2 response. - * - * @param string $password - * @param string $username - * @param string $domain - * @param string $challenge Hex values - * @param string $targetInfo Hex values - * @param string $timestamp - * @param string $client Random bytes - * - * @return string - * - * @see http://davenport.sourceforge.net/ntlm.html#theNtlmResponse - */ - protected function createNTLMv2Hash($password, $username, $domain, $challenge, $targetInfo, $timestamp, $client) - { - $ntlmHash = $this->md4Encrypt($password); - $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); - - // create blob - $blob = $this->createBlob($timestamp, $client, $targetInfo); - - $ntlmv2Response = $this->md5Encrypt($ntml2Hash, $challenge.$blob); - - return $ntlmv2Response.$blob; - } - - protected function createDesKey($key) - { - $material = [bin2hex($key[0])]; - $len = \strlen($key); - for ($i = 1; $i < $len; ++$i) { - list($high, $low) = str_split(bin2hex($key[$i])); - $v = $this->castToByte(\ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xf)), $i)); - $material[] = str_pad(substr(dechex($v), -2), 2, '0', STR_PAD_LEFT); // cast to byte - } - $material[] = str_pad(substr(dechex($this->castToByte(\ord($key[6]) << 1)), -2), 2, '0'); - - // odd parity - foreach ($material as $k => $v) { - $b = $this->castToByte(hexdec($v)); - $needsParity = 0 == (($this->uRShift($b, 7) ^ $this->uRShift($b, 6) ^ $this->uRShift($b, 5) - ^ $this->uRShift($b, 4) ^ $this->uRShift($b, 3) ^ $this->uRShift($b, 2) - ^ $this->uRShift($b, 1)) & 0x01); - - list($high, $low) = str_split($v); - if ($needsParity) { - $material[$k] = dechex(hexdec($high) | 0x0).dechex(hexdec($low) | 0x1); - } else { - $material[$k] = dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xe); - } - } - - return hex2bin(implode('', $material)); - } - - /** HELPER FUNCTIONS */ - - /** - * Create our security buffer depending on length and offset. - * - * @param string $value Value we want to put in - * @param int $offset start of value - * @param bool $is16 Do we 16bit string or not? - * - * @return string - */ - protected function createSecurityBuffer($value, $offset, $is16 = false) - { - $length = \strlen(bin2hex($value)); - $length = $is16 ? $length / 2 : $length; - $length = $this->createByte(str_pad(dechex($length), 2, '0', STR_PAD_LEFT), 2); - - return $length.$length.$this->createByte(dechex($offset), 4); - } - - /** - * Read our security buffer to fetch length and offset of our value. - * - * @param string $value Securitybuffer in hex - * - * @return array array with length and offset - */ - protected function readSecurityBuffer($value) - { - $length = floor(hexdec(substr($value, 0, 4)) / 256) * 2; - $offset = floor(hexdec(substr($value, 8, 4)) / 256) * 2; - - return [$length, $offset]; - } - - /** - * Cast to byte java equivalent to (byte). - * - * @param int $v - * - * @return int - */ - protected function castToByte($v) - { - return (($v + 128) % 256) - 128; - } - - /** - * Java unsigned right bitwise - * $a >>> $b. - * - * @param int $a - * @param int $b - * - * @return int - */ - protected function uRShift($a, $b) - { - if (0 == $b) { - return $a; - } - - return ($a >> $b) & ~(1 << (8 * PHP_INT_SIZE - 1) >> ($b - 1)); - } - - /** - * Right padding with 0 to certain length. - * - * @param string $input - * @param int $bytes Length of bytes - * @param bool $isHex Did we provided hex value - * - * @return string - */ - protected function createByte($input, $bytes = 4, $isHex = true) - { - if ($isHex) { - $byte = hex2bin(str_pad($input, $bytes * 2, '00')); - } else { - $byte = str_pad($input, $bytes, "\x00"); - } - - return $byte; - } - - /** ENCRYPTION ALGORITHMS */ - - /** - * DES Encryption. - * - * @param string $value An 8-byte string - * @param string $key - * - * @return string - */ - protected function desEncrypt($value, $key) - { - return substr(openssl_encrypt($value, 'DES-ECB', $key, \OPENSSL_RAW_DATA), 0, 8); - } - - /** - * MD5 Encryption. - * - * @param string $key Encryption key - * @param string $msg Message to encrypt - * - * @return string - */ - protected function md5Encrypt($key, $msg) - { - $blocksize = 64; - if (\strlen($key) > $blocksize) { - $key = pack('H*', md5($key)); - } - - $key = str_pad($key, $blocksize, "\0"); - $ipadk = $key ^ str_repeat("\x36", $blocksize); - $opadk = $key ^ str_repeat("\x5c", $blocksize); - - return pack('H*', md5($opadk.pack('H*', md5($ipadk.$msg)))); - } - - /** - * MD4 Encryption. - * - * @param string $input - * - * @return string - * - * @see https://secure.php.net/manual/en/ref.hash.php - */ - protected function md4Encrypt($input) - { - $input = $this->convertTo16bit($input); - - return \function_exists('hash') ? hex2bin(hash('md4', $input)) : mhash(MHASH_MD4, $input); - } - - /** - * Convert UTF-8 to UTF-16. - * - * @param string $input - * - * @return string - */ - protected function convertTo16bit($input) - { - return iconv('UTF-8', 'UTF-16LE', $input); - } - - /** - * @param string $message - */ - protected function debug($message) - { - $message = bin2hex($message); - $messageId = substr($message, 16, 8); - echo substr($message, 0, 16)." NTLMSSP Signature
\n"; - echo $messageId." Type Indicator
\n"; - - if ('02000000' == $messageId) { - $map = [ - 'Challenge', - 'Context', - 'Target Information Security Buffer', - 'Target Name Data', - 'NetBIOS Domain Name', - 'NetBIOS Server Name', - 'DNS Domain Name', - 'DNS Server Name', - 'BLOB', - 'Target Information Terminator', - ]; - - $data = $this->parseMessage2(hex2bin($message)); - - foreach ($map as $key => $value) { - echo bin2hex($data[$key]).' - '.$data[$key].' ||| '.$value."
\n"; - } - } elseif ('03000000' == $messageId) { - $i = 0; - $data[$i++] = substr($message, 24, 16); - list($lmLength, $lmOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 40, 16); - list($ntmlLength, $ntmlOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 56, 16); - list($targetLength, $targetOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 72, 16); - list($userLength, $userOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 88, 16); - list($workLength, $workOffset) = $this->readSecurityBuffer($data[$i - 1]); - - $data[$i++] = substr($message, 104, 16); - $data[$i++] = substr($message, 120, 8); - $data[$i++] = substr($message, $targetOffset, $targetLength); - $data[$i++] = substr($message, $userOffset, $userLength); - $data[$i++] = substr($message, $workOffset, $workLength); - $data[$i++] = substr($message, $lmOffset, $lmLength); - $data[$i] = substr($message, $ntmlOffset, $ntmlLength); - - $map = [ - 'LM Response Security Buffer', - 'NTLM Response Security Buffer', - 'Target Name Security Buffer', - 'User Name Security Buffer', - 'Workstation Name Security Buffer', - 'Session Key Security Buffer', - 'Flags', - 'Target Name Data', - 'User Name Data', - 'Workstation Name Data', - 'LM Response Data', - 'NTLM Response Data', - ]; - - foreach ($map as $key => $value) { - echo $data[$key].' - '.hex2bin($data[$key]).' ||| '.$value."
\n"; - } - } - - echo '

'; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php deleted file mode 100644 index 41d0a50..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php +++ /dev/null @@ -1,44 +0,0 @@ -executeCommand(sprintf("AUTH PLAIN %s\r\n", $message), [235]); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", [250]); - - throw $e; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php deleted file mode 100644 index 859f22f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php +++ /dev/null @@ -1,64 +0,0 @@ - - * $transport = (new Swift_SmtpTransport('smtp.gmail.com', 587, 'tls')) - * ->setAuthMode('XOAUTH2') - * ->setUsername('YOUR_EMAIL_ADDRESS') - * ->setPassword('YOUR_ACCESS_TOKEN'); - * - * - * @author xu.li - * - * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol - */ -class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator implements Swift_Transport_Esmtp_Authenticator -{ - /** - * Get the name of the AUTH mechanism this Authenticator handles. - * - * @return string - */ - public function getAuthKeyword() - { - return 'XOAUTH2'; - } - - /** - * {@inheritdoc} - */ - public function authenticate(Swift_Transport_SmtpAgent $agent, $email, $token) - { - try { - $param = $this->constructXOAuth2Params($email, $token); - $agent->executeCommand('AUTH XOAUTH2 '.$param."\r\n", [235]); - - return true; - } catch (Swift_TransportException $e) { - $agent->executeCommand("RSET\r\n", [250]); - - throw $e; - } - } - - /** - * Construct the auth parameter. - * - * @see https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism - */ - protected function constructXOAuth2Params($email, $token) - { - return base64_encode("user=$email\1auth=Bearer $token\1\1"); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php deleted file mode 100644 index dd55913..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php +++ /dev/null @@ -1,268 +0,0 @@ -setAuthenticators($authenticators); - } - - /** - * Set the Authenticators which can process a login request. - * - * @param Swift_Transport_Esmtp_Authenticator[] $authenticators - */ - public function setAuthenticators(array $authenticators) - { - $this->authenticators = $authenticators; - } - - /** - * Get the Authenticators which can process a login request. - * - * @return Swift_Transport_Esmtp_Authenticator[] - */ - public function getAuthenticators() - { - return $this->authenticators; - } - - /** - * Set the username to authenticate with. - * - * @param string $username - */ - public function setUsername($username) - { - $this->username = $username; - } - - /** - * Get the username to authenticate with. - * - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Set the password to authenticate with. - * - * @param string $password - */ - public function setPassword($password) - { - $this->password = $password; - } - - /** - * Get the password to authenticate with. - * - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Set the auth mode to use to authenticate. - * - * @param string $mode - */ - public function setAuthMode($mode) - { - $this->auth_mode = $mode; - } - - /** - * Get the auth mode to use to authenticate. - * - * @return string - */ - public function getAuthMode() - { - return $this->auth_mode; - } - - /** - * Get the name of the ESMTP extension this handles. - * - * @return string - */ - public function getHandledKeyword() - { - return 'AUTH'; - } - - /** - * Set the parameters which the EHLO greeting indicated. - * - * @param string[] $parameters - */ - public function setKeywordParams(array $parameters) - { - $this->esmtpParams = $parameters; - } - - /** - * Runs immediately after a EHLO has been issued. - * - * @param Swift_Transport_SmtpAgent $agent to read/write - */ - public function afterEhlo(Swift_Transport_SmtpAgent $agent) - { - if ($this->username) { - $count = 0; - $errors = []; - foreach ($this->getAuthenticatorsForAgent() as $authenticator) { - if (\in_array(strtolower($authenticator->getAuthKeyword()), array_map('strtolower', $this->esmtpParams))) { - ++$count; - try { - if ($authenticator->authenticate($agent, $this->username, $this->password)) { - return; - } - } catch (Swift_TransportException $e) { - // keep the error message, but tries the other authenticators - $errors[] = [$authenticator->getAuthKeyword(), $e->getMessage()]; - } - } - } - - $message = 'Failed to authenticate on SMTP server with username "'.$this->username.'" using '.$count.' possible authenticators.'; - foreach ($errors as $error) { - $message .= ' Authenticator '.$error[0].' returned '.$error[1].'.'; - } - throw new Swift_TransportException($message); - } - } - - /** - * Not used. - */ - public function getMailParams() - { - return []; - } - - /** - * Not used. - */ - public function getRcptParams() - { - return []; - } - - /** - * Not used. - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = [], &$failedRecipients = null, &$stop = false) - { - } - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * - * This method is called to ensure extensions can be execute in an appropriate order. - * - * @param string $esmtpKeyword to compare with - * - * @return int - */ - public function getPriorityOver($esmtpKeyword) - { - return 0; - } - - /** - * Returns an array of method names which are exposed to the Esmtp class. - * - * @return string[] - */ - public function exposeMixinMethods() - { - return ['setUsername', 'getUsername', 'setPassword', 'getPassword', 'setAuthMode', 'getAuthMode']; - } - - /** - * Not used. - */ - public function resetState() - { - } - - /** - * Returns the authenticator list for the given agent. - * - * @return array - */ - protected function getAuthenticatorsForAgent() - { - if (!$mode = strtolower($this->auth_mode)) { - return $this->authenticators; - } - - foreach ($this->authenticators as $authenticator) { - if (strtolower($authenticator->getAuthKeyword()) == $mode) { - return [$authenticator]; - } - } - - throw new Swift_TransportException('Auth mode '.$mode.' is invalid'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php deleted file mode 100644 index f692a6f..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php +++ /dev/null @@ -1,36 +0,0 @@ -encoding = $encoding; - } - - /** - * Get the name of the ESMTP extension this handles. - * - * @return string - */ - public function getHandledKeyword() - { - return '8BITMIME'; - } - - /** - * Not used. - */ - public function setKeywordParams(array $parameters) - { - } - - /** - * Not used. - */ - public function afterEhlo(Swift_Transport_SmtpAgent $agent) - { - } - - /** - * Get params which are appended to MAIL FROM:<>. - * - * @return string[] - */ - public function getMailParams() - { - return ['BODY='.$this->encoding]; - } - - /** - * Not used. - */ - public function getRcptParams() - { - return []; - } - - /** - * Not used. - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = [], &$failedRecipients = null, &$stop = false) - { - } - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * - * This method is called to ensure extensions can be execute in an appropriate order. - * - * @param string $esmtpKeyword to compare with - * - * @return int - */ - public function getPriorityOver($esmtpKeyword) - { - return 0; - } - - /** - * Not used. - */ - public function exposeMixinMethods() - { - return []; - } - - /** - * Not used. - */ - public function resetState() - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/SmtpUtf8Handler.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/SmtpUtf8Handler.php deleted file mode 100644 index 7d0252a..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/SmtpUtf8Handler.php +++ /dev/null @@ -1,107 +0,0 @@ -. - * - * @return string[] - */ - public function getMailParams() - { - return ['SMTPUTF8']; - } - - /** - * Not used. - */ - public function getRcptParams() - { - return []; - } - - /** - * Not used. - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = [], &$failedRecipients = null, &$stop = false) - { - } - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * - * This method is called to ensure extensions can be execute in an appropriate order. - * - * @param string $esmtpKeyword to compare with - * - * @return int - */ - public function getPriorityOver($esmtpKeyword) - { - return 0; - } - - /** - * Not used. - */ - public function exposeMixinMethods() - { - return []; - } - - /** - * Not used. - */ - public function resetState() - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php deleted file mode 100644 index b8ea36e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php +++ /dev/null @@ -1,86 +0,0 @@ -. - * - * @return string[] - */ - public function getMailParams(); - - /** - * Get params which are appended to RCPT TO:<>. - * - * @return string[] - */ - public function getRcptParams(); - - /** - * Runs when a command is due to be sent. - * - * @param Swift_Transport_SmtpAgent $agent to read/write - * @param string $command to send - * @param int[] $codes expected in response - * @param string[] $failedRecipients to collect failures - * @param bool $stop to be set true by-reference if the command is now sent - */ - public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = [], &$failedRecipients = null, &$stop = false); - - /** - * Returns +1, -1 or 0 according to the rules for usort(). - * - * This method is called to ensure extensions can be execute in an appropriate order. - * - * @param string $esmtpKeyword to compare with - * - * @return int - */ - public function getPriorityOver($esmtpKeyword); - - /** - * Returns an array of method names which are exposed to the Esmtp class. - * - * @return string[] - */ - public function exposeMixinMethods(); - - /** - * Tells this handler to clear any buffers and reset its state. - */ - public function resetState(); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php deleted file mode 100644 index bce0cdd..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php +++ /dev/null @@ -1,446 +0,0 @@ - 'tcp', - 'host' => 'localhost', - 'port' => 25, - 'timeout' => 30, - 'blocking' => 1, - 'tls' => false, - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'stream_context_options' => [], - ]; - - /** - * Creates a new EsmtpTransport using the given I/O buffer. - * - * @param Swift_Transport_EsmtpHandler[] $extensionHandlers - * @param string $localDomain - */ - public function __construct(Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null) - { - parent::__construct($buf, $dispatcher, $localDomain, $addressEncoder); - $this->setExtensionHandlers($extensionHandlers); - } - - /** - * Set the host to connect to. - * - * Literal IPv6 addresses should be wrapped in square brackets. - * - * @param string $host - * - * @return $this - */ - public function setHost($host) - { - $this->params['host'] = $host; - - return $this; - } - - /** - * Get the host to connect to. - * - * @return string - */ - public function getHost() - { - return $this->params['host']; - } - - /** - * Set the port to connect to. - * - * @param int $port - * - * @return $this - */ - public function setPort($port) - { - $this->params['port'] = (int) $port; - - return $this; - } - - /** - * Get the port to connect to. - * - * @return int - */ - public function getPort() - { - return $this->params['port']; - } - - /** - * Set the connection timeout. - * - * @param int $timeout seconds - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->params['timeout'] = (int) $timeout; - $this->buffer->setParam('timeout', (int) $timeout); - - return $this; - } - - /** - * Get the connection timeout. - * - * @return int - */ - public function getTimeout() - { - return $this->params['timeout']; - } - - /** - * Set the encryption type (tls or ssl). - * - * @param string $encryption - * - * @return $this - */ - public function setEncryption($encryption) - { - $encryption = strtolower($encryption); - if ('tls' == $encryption) { - $this->params['protocol'] = 'tcp'; - $this->params['tls'] = true; - } else { - $this->params['protocol'] = $encryption; - $this->params['tls'] = false; - } - - return $this; - } - - /** - * Get the encryption type. - * - * @return string - */ - public function getEncryption() - { - return $this->params['tls'] ? 'tls' : $this->params['protocol']; - } - - /** - * Sets the stream context options. - * - * @param array $options - * - * @return $this - */ - public function setStreamOptions($options) - { - $this->params['stream_context_options'] = $options; - - return $this; - } - - /** - * Returns the stream context options. - * - * @return array - */ - public function getStreamOptions() - { - return $this->params['stream_context_options']; - } - - /** - * Sets the source IP. - * - * IPv6 addresses should be wrapped in square brackets. - * - * @param string $source - * - * @return $this - */ - public function setSourceIp($source) - { - $this->params['sourceIp'] = $source; - - return $this; - } - - /** - * Returns the IP used to connect to the destination. - * - * @return string - */ - public function getSourceIp() - { - return $this->params['sourceIp'] ?? null; - } - - /** - * Sets whether SMTP pipelining is enabled. - * - * By default, support is auto-detected using the PIPELINING SMTP extension. - * Use this function to override that in the unlikely event of compatibility - * issues. - * - * @param bool $enabled - * - * @return $this - */ - public function setPipelining($enabled) - { - $this->pipelining = $enabled; - - return $this; - } - - /** - * Returns whether SMTP pipelining is enabled. - * - * @return bool|null a boolean if pipelining is explicitly enabled or disabled, - * or null if support is auto-detected - */ - public function getPipelining() - { - return $this->pipelining; - } - - /** - * Set ESMTP extension handlers. - * - * @param Swift_Transport_EsmtpHandler[] $handlers - * - * @return $this - */ - public function setExtensionHandlers(array $handlers) - { - $assoc = []; - foreach ($handlers as $handler) { - $assoc[$handler->getHandledKeyword()] = $handler; - } - uasort($assoc, function ($a, $b) { - return $a->getPriorityOver($b->getHandledKeyword()); - }); - $this->handlers = $assoc; - $this->setHandlerParams(); - - return $this; - } - - /** - * Get ESMTP extension handlers. - * - * @return Swift_Transport_EsmtpHandler[] - */ - public function getExtensionHandlers() - { - return array_values($this->handlers); - } - - /** - * Run a command against the buffer, expecting the given response codes. - * - * If no response codes are given, the response will not be validated. - * If codes are given, an exception will be thrown on an invalid response. - * - * @param string $command - * @param int[] $codes - * @param string[] $failures An array of failures by-reference - * @param bool $pipeline Do not wait for response - * @param string $address the address, if command is RCPT TO - * - * @return string|null The server response, or null if pipelining is enabled - */ - public function executeCommand($command, $codes = [], &$failures = null, $pipeline = false, $address = null) - { - $failures = (array) $failures; - $stopSignal = false; - $response = null; - foreach ($this->getActiveHandlers() as $handler) { - $response = $handler->onCommand( - $this, $command, $codes, $failures, $stopSignal - ); - if ($stopSignal) { - return $response; - } - } - - return parent::executeCommand($command, $codes, $failures, $pipeline, $address); - } - - /** Mixin handling method for ESMTP handlers */ - public function __call($method, $args) - { - foreach ($this->handlers as $handler) { - if (\in_array(strtolower($method), - array_map('strtolower', (array) $handler->exposeMixinMethods()) - )) { - $return = \call_user_func_array([$handler, $method], $args); - // Allow fluid method calls - if (null === $return && 'set' == substr($method, 0, 3)) { - return $this; - } else { - return $return; - } - } - } - trigger_error('Call to undefined method '.$method, E_USER_ERROR); - } - - /** Get the params to initialize the buffer */ - protected function getBufferParams() - { - return $this->params; - } - - /** Overridden to perform EHLO instead */ - protected function doHeloCommand() - { - try { - $response = $this->executeCommand( - sprintf("EHLO %s\r\n", $this->domain), [250] - ); - } catch (Swift_TransportException $e) { - return parent::doHeloCommand(); - } - - if ($this->params['tls']) { - try { - $this->executeCommand("STARTTLS\r\n", [220]); - - if (!$this->buffer->startTLS()) { - throw new Swift_TransportException('Unable to connect with TLS encryption'); - } - - try { - $response = $this->executeCommand( - sprintf("EHLO %s\r\n", $this->domain), [250] - ); - } catch (Swift_TransportException $e) { - return parent::doHeloCommand(); - } - } catch (Swift_TransportException $e) { - $this->throwException($e); - } - } - - $this->capabilities = $this->getCapabilities($response); - if (!isset($this->pipelining)) { - $this->pipelining = isset($this->capabilities['PIPELINING']); - } - - $this->setHandlerParams(); - foreach ($this->getActiveHandlers() as $handler) { - $handler->afterEhlo($this); - } - } - - /** Overridden to add Extension support */ - protected function doMailFromCommand($address) - { - $address = $this->addressEncoder->encodeString($address); - $handlers = $this->getActiveHandlers(); - $params = []; - foreach ($handlers as $handler) { - $params = array_merge($params, (array) $handler->getMailParams()); - } - $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; - $this->executeCommand( - sprintf("MAIL FROM:<%s>%s\r\n", $address, $paramStr), [250], $failures, true - ); - } - - /** Overridden to add Extension support */ - protected function doRcptToCommand($address) - { - $address = $this->addressEncoder->encodeString($address); - $handlers = $this->getActiveHandlers(); - $params = []; - foreach ($handlers as $handler) { - $params = array_merge($params, (array) $handler->getRcptParams()); - } - $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; - $this->executeCommand( - sprintf("RCPT TO:<%s>%s\r\n", $address, $paramStr), [250, 251, 252], $failures, true, $address - ); - } - - /** Determine ESMTP capabilities by function group */ - private function getCapabilities($ehloResponse) - { - $capabilities = []; - $ehloResponse = trim($ehloResponse); - $lines = explode("\r\n", $ehloResponse); - array_shift($lines); - foreach ($lines as $line) { - if (preg_match('/^[0-9]{3}[ -]([A-Z0-9-]+)((?:[ =].*)?)$/Di', $line, $matches)) { - $keyword = strtoupper($matches[1]); - $paramStr = strtoupper(ltrim($matches[2], ' =')); - $params = !empty($paramStr) ? explode(' ', $paramStr) : []; - $capabilities[$keyword] = $params; - } - } - - return $capabilities; - } - - /** Set parameters which are used by each extension handler */ - private function setHandlerParams() - { - foreach ($this->handlers as $keyword => $handler) { - if (\array_key_exists($keyword, $this->capabilities)) { - $handler->setKeywordParams($this->capabilities[$keyword]); - } - } - } - - /** Get ESMTP handlers which are currently ok to use */ - private function getActiveHandlers() - { - $handlers = []; - foreach ($this->handlers as $keyword => $handler) { - if (\array_key_exists($keyword, $this->capabilities)) { - $handlers[] = $handler; - } - } - - return $handlers; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php deleted file mode 100644 index 1a4b475..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php +++ /dev/null @@ -1,103 +0,0 @@ -transports); - for ($i = 0; $i < $maxTransports - && $transport = $this->getNextTransport(); ++$i) { - if ($transport->ping()) { - return true; - } else { - $this->killCurrentTransport(); - } - } - - return \count($this->transports) > 0; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) - { - $maxTransports = \count($this->transports); - $sent = 0; - $this->lastUsedTransport = null; - - for ($i = 0; $i < $maxTransports - && $transport = $this->getNextTransport(); ++$i) { - try { - if (!$transport->isStarted()) { - $transport->start(); - } - - if ($sent = $transport->send($message, $failedRecipients)) { - $this->lastUsedTransport = $transport; - - return $sent; - } - } catch (Swift_TransportException $e) { - $this->killCurrentTransport(); - } - } - - if (0 == \count($this->transports)) { - throw new Swift_TransportException('All Transports in FailoverTransport failed, or no Transports available'); - } - - return $sent; - } - - protected function getNextTransport() - { - if (!isset($this->currentTransport)) { - $this->currentTransport = parent::getNextTransport(); - } - - return $this->currentTransport; - } - - protected function killCurrentTransport() - { - $this->currentTransport = null; - parent::killCurrentTransport(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php deleted file mode 100644 index 50f1e5e..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php +++ /dev/null @@ -1,65 +0,0 @@ -transports = $transports; - $this->deadTransports = []; - } - - /** - * Get $transports to delegate to. - * - * @return Swift_Transport[] - */ - public function getTransports() - { - return array_merge($this->transports, $this->deadTransports); - } - - /** - * Get the Transport used in the last successful send operation. - * - * @return Swift_Transport - */ - public function getLastUsedTransport() - { - return $this->lastUsedTransport; - } - - /** - * Test if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return \count($this->transports) > 0; - } - - /** - * Start this Transport mechanism. - */ - public function start() - { - $this->transports = array_merge($this->transports, $this->deadTransports); - } - - /** - * Stop this Transport mechanism. - */ - public function stop() - { - foreach ($this->transports as $transport) { - $transport->stop(); - } - } - - /** - * {@inheritdoc} - */ - public function ping() - { - foreach ($this->transports as $transport) { - if (!$transport->ping()) { - $this->killCurrentTransport(); - } - } - - return \count($this->transports) > 0; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * The return value is the number of recipients who were accepted for delivery. - * - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) - { - $maxTransports = \count($this->transports); - $sent = 0; - $this->lastUsedTransport = null; - - for ($i = 0; $i < $maxTransports - && $transport = $this->getNextTransport(); ++$i) { - try { - if (!$transport->isStarted()) { - $transport->start(); - } - if ($sent = $transport->send($message, $failedRecipients)) { - $this->lastUsedTransport = $transport; - break; - } - } catch (Swift_TransportException $e) { - $this->killCurrentTransport(); - } - } - - if (0 == \count($this->transports)) { - throw new Swift_TransportException('All Transports in LoadBalancedTransport failed, or no Transports available'); - } - - return $sent; - } - - /** - * Register a plugin. - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - foreach ($this->transports as $transport) { - $transport->registerPlugin($plugin); - } - } - - /** - * Rotates the transport list around and returns the first instance. - * - * @return Swift_Transport - */ - protected function getNextTransport() - { - if ($next = array_shift($this->transports)) { - $this->transports[] = $next; - } - - return $next; - } - - /** - * Tag the currently used (top of stack) transport as dead/useless. - */ - protected function killCurrentTransport() - { - if ($transport = array_pop($this->transports)) { - try { - $transport->stop(); - } catch (Exception $e) { - } - $this->deadTransports[] = $transport; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php deleted file mode 100644 index 7d910db..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Pretends messages have been sent, but just ignores them. - * - * @author Fabien Potencier - */ -class Swift_Transport_NullTransport implements Swift_Transport -{ - /** The event dispatcher from the plugin API */ - private $eventDispatcher; - - /** - * Constructor. - */ - public function __construct(Swift_Events_EventDispatcher $eventDispatcher) - { - $this->eventDispatcher = $eventDispatcher; - } - - /** - * Tests if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * {@inheritdoc} - */ - public function ping() - { - return true; - } - - /** - * Sends the given message. - * - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent emails - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) - { - if ($evt = $this->eventDispatcher->createSendEvent($this, $message)) { - $this->eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $this->eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $count = ( - \count((array) $message->getTo()) - + \count((array) $message->getCc()) - + \count((array) $message->getBcc()) - ); - - return $count; - } - - /** - * Register a plugin. - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->eventDispatcher->bindEventListener($plugin); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php deleted file mode 100644 index 72ddae8..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php +++ /dev/null @@ -1,158 +0,0 @@ - 30, - 'blocking' => 1, - 'command' => '/usr/sbin/sendmail -bs', - 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS, - ]; - - /** - * Create a new SendmailTransport with $buf for I/O. - * - * @param string $localDomain - */ - public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null) - { - parent::__construct($buf, $dispatcher, $localDomain, $addressEncoder); - } - - /** - * Start the standalone SMTP session if running in -bs mode. - */ - public function start() - { - if (false !== strpos($this->getCommand(), ' -bs')) { - parent::start(); - } - } - - /** - * Set the command to invoke. - * - * If using -t mode you are strongly advised to include -oi or -i in the flags. - * For example: /usr/sbin/sendmail -oi -t - * Swift will append a -f flag if one is not present. - * - * The recommended mode is "-bs" since it is interactive and failure notifications - * are hence possible. - * - * @param string $command - * - * @return $this - */ - public function setCommand($command) - { - $this->params['command'] = $command; - - return $this; - } - - /** - * Get the sendmail command which will be invoked. - * - * @return string - */ - public function getCommand() - { - return $this->params['command']; - } - - /** - * Send the given Message. - * - * Recipient/sender data will be retrieved from the Message API. - * - * The return value is the number of recipients who were accepted for delivery. - * NOTE: If using 'sendmail -t' you will not be aware of any failures until - * they bounce (i.e. send() will always return 100% success). - * - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) - { - $failedRecipients = (array) $failedRecipients; - $command = $this->getCommand(); - $buffer = $this->getBuffer(); - $count = 0; - - if (false !== strpos($command, ' -t')) { - if ($evt = $this->eventDispatcher->createSendEvent($this, $message)) { - $this->eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - if (false === strpos($command, ' -f')) { - $command .= ' -f'.escapeshellarg($this->getReversePath($message)); - } - - $buffer->initialize(array_merge($this->params, ['command' => $command])); - - if (false === strpos($command, ' -i') && false === strpos($command, ' -oi')) { - $buffer->setWriteTranslations(["\r\n" => "\n", "\n." => "\n.."]); - } else { - $buffer->setWriteTranslations(["\r\n" => "\n"]); - } - - $count = \count((array) $message->getTo()) - + \count((array) $message->getCc()) - + \count((array) $message->getBcc()) - ; - $message->toByteStream($buffer); - $buffer->flushBuffers(); - $buffer->setWriteTranslations([]); - $buffer->terminate(); - - if ($evt) { - $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); - $evt->setFailedRecipients($failedRecipients); - $this->eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - $message->generateId(); - } elseif (false !== strpos($command, ' -bs')) { - $count = parent::send($message, $failedRecipients); - } else { - $this->throwException(new Swift_TransportException( - 'Unsupported sendmail command flags ['.$command.']. '. - 'Must be one of "-bs" or "-t" but can include additional flags.' - )); - } - - return $count; - } - - /** Get the params to initialize the buffer */ - protected function getBufferParams() - { - return $this->params; - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php deleted file mode 100644 index e8ce65c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SmtpAgent.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Stores Messages in a queue. - * - * @author Fabien Potencier - */ -class Swift_Transport_SpoolTransport implements Swift_Transport -{ - /** The spool instance */ - private $spool; - - /** The event dispatcher from the plugin API */ - private $eventDispatcher; - - /** - * Constructor. - */ - public function __construct(Swift_Events_EventDispatcher $eventDispatcher, Swift_Spool $spool = null) - { - $this->eventDispatcher = $eventDispatcher; - $this->spool = $spool; - } - - /** - * Sets the spool object. - * - * @return $this - */ - public function setSpool(Swift_Spool $spool) - { - $this->spool = $spool; - - return $this; - } - - /** - * Get the spool object. - * - * @return Swift_Spool - */ - public function getSpool() - { - return $this->spool; - } - - /** - * Tests if this Transport mechanism has started. - * - * @return bool - */ - public function isStarted() - { - return true; - } - - /** - * Starts this Transport mechanism. - */ - public function start() - { - } - - /** - * Stops this Transport mechanism. - */ - public function stop() - { - } - - /** - * {@inheritdoc} - */ - public function ping() - { - return true; - } - - /** - * Sends the given message. - * - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent e-mail's - */ - public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) - { - if ($evt = $this->eventDispatcher->createSendEvent($this, $message)) { - $this->eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed'); - if ($evt->bubbleCancelled()) { - return 0; - } - } - - $success = $this->spool->queueMessage($message); - - if ($evt) { - $evt->setResult($success ? Swift_Events_SendEvent::RESULT_SPOOLED : Swift_Events_SendEvent::RESULT_FAILED); - $this->eventDispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - return 1; - } - - /** - * Register a plugin. - */ - public function registerPlugin(Swift_Events_EventListener $plugin) - { - $this->eventDispatcher->bindEventListener($plugin); - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php deleted file mode 100644 index 70782ad..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php +++ /dev/null @@ -1,319 +0,0 @@ -replacementFactory = $replacementFactory; - } - - /** - * Perform any initialization needed, using the given $params. - * - * Parameters will vary depending upon the type of IoBuffer used. - */ - public function initialize(array $params) - { - $this->params = $params; - switch ($params['type']) { - case self::TYPE_PROCESS: - $this->establishProcessConnection(); - break; - case self::TYPE_SOCKET: - default: - $this->establishSocketConnection(); - break; - } - } - - /** - * Set an individual param on the buffer (e.g. switching to SSL). - * - * @param string $param - * @param mixed $value - */ - public function setParam($param, $value) - { - if (isset($this->stream)) { - switch ($param) { - case 'timeout': - if ($this->stream) { - stream_set_timeout($this->stream, $value); - } - break; - - case 'blocking': - if ($this->stream) { - stream_set_blocking($this->stream, 1); - } - } - } - $this->params[$param] = $value; - } - - public function startTLS() - { - // STREAM_CRYPTO_METHOD_TLS_CLIENT only allow tls1.0 connections (some php versions) - // To support modern tls we allow explicit tls1.0, tls1.1, tls1.2 - // Ssl3 and older are not allowed because they are vulnerable - // @TODO make tls arguments configurable - return stream_socket_enable_crypto($this->stream, true, STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT); - } - - /** - * Perform any shutdown logic needed. - */ - public function terminate() - { - if (isset($this->stream)) { - switch ($this->params['type']) { - case self::TYPE_PROCESS: - fclose($this->in); - fclose($this->out); - proc_close($this->stream); - break; - case self::TYPE_SOCKET: - default: - fclose($this->stream); - break; - } - } - $this->stream = null; - $this->out = null; - $this->in = null; - } - - /** - * Set an array of string replacements which should be made on data written - * to the buffer. - * - * This could replace LF with CRLF for example. - * - * @param string[] $replacements - */ - public function setWriteTranslations(array $replacements) - { - foreach ($this->translations as $search => $replace) { - if (!isset($replacements[$search])) { - $this->removeFilter($search); - unset($this->translations[$search]); - } - } - - foreach ($replacements as $search => $replace) { - if (!isset($this->translations[$search])) { - $this->addFilter( - $this->replacementFactory->createFilter($search, $replace), $search - ); - $this->translations[$search] = true; - } - } - } - - /** - * Get a line of output (including any CRLF). - * - * The $sequence number comes from any writes and may or may not be used - * depending upon the implementation. - * - * @param int $sequence of last write to scan from - * - * @return string - * - * @throws Swift_IoException - */ - public function readLine($sequence) - { - if (isset($this->out) && !feof($this->out)) { - $line = fgets($this->out); - if (0 == \strlen($line)) { - $metas = stream_get_meta_data($this->out); - if ($metas['timed_out']) { - throw new Swift_IoException('Connection to '.$this->getReadConnectionDescription().' Timed Out'); - } - } - - return $line; - } - } - - /** - * Reads $length bytes from the stream into a string and moves the pointer - * through the stream by $length. - * - * If less bytes exist than are requested the remaining bytes are given instead. - * If no bytes are remaining at all, boolean false is returned. - * - * @param int $length - * - * @return string|bool - * - * @throws Swift_IoException - */ - public function read($length) - { - if (isset($this->out) && !feof($this->out)) { - $ret = fread($this->out, $length); - if (0 == \strlen($ret)) { - $metas = stream_get_meta_data($this->out); - if ($metas['timed_out']) { - throw new Swift_IoException('Connection to '.$this->getReadConnectionDescription().' Timed Out'); - } - } - - return $ret; - } - } - - /** Not implemented */ - public function setReadPointer($byteOffset) - { - } - - /** Flush the stream contents */ - protected function flush() - { - if (isset($this->in)) { - fflush($this->in); - } - } - - /** Write this bytes to the stream */ - protected function doCommit($bytes) - { - if (isset($this->in)) { - $bytesToWrite = \strlen($bytes); - $totalBytesWritten = 0; - - while ($totalBytesWritten < $bytesToWrite) { - $bytesWritten = fwrite($this->in, substr($bytes, $totalBytesWritten)); - if (false === $bytesWritten || 0 === $bytesWritten) { - break; - } - - $totalBytesWritten += $bytesWritten; - } - - if ($totalBytesWritten > 0) { - return ++$this->sequence; - } - } - } - - /** - * Establishes a connection to a remote server. - */ - private function establishSocketConnection() - { - $host = $this->params['host']; - if (!empty($this->params['protocol'])) { - $host = $this->params['protocol'].'://'.$host; - } - $timeout = 15; - if (!empty($this->params['timeout'])) { - $timeout = $this->params['timeout']; - } - $options = []; - if (!empty($this->params['sourceIp'])) { - $options['socket']['bindto'] = $this->params['sourceIp'].':0'; - } - - if (isset($this->params['stream_context_options'])) { - $options = array_merge($options, $this->params['stream_context_options']); - } - $streamContext = stream_context_create($options); - - set_error_handler(function ($type, $msg) { - throw new Swift_TransportException('Connection could not be established with host '.$this->params['host'].' :'.$msg); - }); - try { - $this->stream = stream_socket_client($host.':'.$this->params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); - } finally { - restore_error_handler(); - } - - if (!empty($this->params['blocking'])) { - stream_set_blocking($this->stream, 1); - } else { - stream_set_blocking($this->stream, 0); - } - stream_set_timeout($this->stream, $timeout); - $this->in = &$this->stream; - $this->out = &$this->stream; - } - - /** - * Opens a process for input/output. - */ - private function establishProcessConnection() - { - $command = $this->params['command']; - $descriptorSpec = [ - 0 => ['pipe', 'r'], - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - $pipes = []; - $this->stream = proc_open($command, $descriptorSpec, $pipes); - stream_set_blocking($pipes[2], 0); - if ($err = stream_get_contents($pipes[2])) { - throw new Swift_TransportException('Process could not be started ['.$err.']'); - } - $this->in = &$pipes[0]; - $this->out = &$pipes[1]; - } - - private function getReadConnectionDescription() - { - switch ($this->params['type']) { - case self::TYPE_PROCESS: - return 'Process '.$this->params['command']; - break; - - case self::TYPE_SOCKET: - default: - $host = $this->params['host']; - if (!empty($this->params['protocol'])) { - $host = $this->params['protocol'].'://'.$host; - } - $host .= ':'.$this->params['port']; - - return $host; - break; - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php deleted file mode 100644 index c741745..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/TransportException.php +++ /dev/null @@ -1,28 +0,0 @@ -register('cache') - ->asAliasOf('cache.array') - - ->register('tempdir') - ->asValue('/tmp') - - ->register('cache.null') - ->asSharedInstanceOf('Swift_KeyCache_NullKeyCache') - - ->register('cache.array') - ->asSharedInstanceOf('Swift_KeyCache_ArrayKeyCache') - ->withDependencies(['cache.inputstream']) - - ->register('cache.disk') - ->asSharedInstanceOf('Swift_KeyCache_DiskKeyCache') - ->withDependencies(['cache.inputstream', 'tempdir']) - - ->register('cache.inputstream') - ->asNewInstanceOf('Swift_KeyCache_SimpleKeyCacheInputStream') -; diff --git a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php b/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php deleted file mode 100644 index 64d69d2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/message_deps.php +++ /dev/null @@ -1,9 +0,0 @@ -register('message.message') - ->asNewInstanceOf('Swift_Message') - - ->register('message.mimepart') - ->asNewInstanceOf('Swift_MimePart') -; diff --git a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php b/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php deleted file mode 100644 index 307756c..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/mime_deps.php +++ /dev/null @@ -1,134 +0,0 @@ -register('properties.charset') - ->asValue('utf-8') - - ->register('email.validator') - ->asSharedInstanceOf('Egulias\EmailValidator\EmailValidator') - - ->register('mime.idgenerator.idright') - // As SERVER_NAME can come from the user in certain configurations, check that - // it does not contain forbidden characters (see RFC 952 and RFC 2181). Use - // preg_replace() instead of preg_match() to prevent DoS attacks with long host names. - ->asValue(!empty($_SERVER['SERVER_NAME']) && '' === preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'swift.generated') - - ->register('mime.idgenerator') - ->asSharedInstanceOf('Swift_Mime_IdGenerator') - ->withDependencies([ - 'mime.idgenerator.idright', - ]) - - ->register('mime.message') - ->asNewInstanceOf('Swift_Mime_SimpleMessage') - ->withDependencies([ - 'mime.headerset', - 'mime.textcontentencoder', - 'cache', - 'mime.idgenerator', - 'properties.charset', - ]) - - ->register('mime.part') - ->asNewInstanceOf('Swift_Mime_MimePart') - ->withDependencies([ - 'mime.headerset', - 'mime.textcontentencoder', - 'cache', - 'mime.idgenerator', - 'properties.charset', - ]) - - ->register('mime.attachment') - ->asNewInstanceOf('Swift_Mime_Attachment') - ->withDependencies([ - 'mime.headerset', - 'mime.base64contentencoder', - 'cache', - 'mime.idgenerator', - ]) - ->addConstructorValue($swift_mime_types) - - ->register('mime.embeddedfile') - ->asNewInstanceOf('Swift_Mime_EmbeddedFile') - ->withDependencies([ - 'mime.headerset', - 'mime.base64contentencoder', - 'cache', - 'mime.idgenerator', - ]) - ->addConstructorValue($swift_mime_types) - - ->register('mime.headerfactory') - ->asNewInstanceOf('Swift_Mime_SimpleHeaderFactory') - ->withDependencies([ - 'mime.qpheaderencoder', - 'mime.rfc2231encoder', - 'email.validator', - 'properties.charset', - 'address.idnaddressencoder', - ]) - - ->register('mime.headerset') - ->asNewInstanceOf('Swift_Mime_SimpleHeaderSet') - ->withDependencies(['mime.headerfactory', 'properties.charset']) - - ->register('mime.qpheaderencoder') - ->asNewInstanceOf('Swift_Mime_HeaderEncoder_QpHeaderEncoder') - ->withDependencies(['mime.charstream']) - - ->register('mime.base64headerencoder') - ->asNewInstanceOf('Swift_Mime_HeaderEncoder_Base64HeaderEncoder') - ->withDependencies(['mime.charstream']) - - ->register('mime.charstream') - ->asNewInstanceOf('Swift_CharacterStream_NgCharacterStream') - ->withDependencies(['mime.characterreaderfactory', 'properties.charset']) - - ->register('mime.bytecanonicalizer') - ->asSharedInstanceOf('Swift_StreamFilters_ByteArrayReplacementFilter') - ->addConstructorValue([[0x0D, 0x0A], [0x0D], [0x0A]]) - ->addConstructorValue([[0x0A], [0x0A], [0x0D, 0x0A]]) - - ->register('mime.characterreaderfactory') - ->asSharedInstanceOf('Swift_CharacterReaderFactory_SimpleCharacterReaderFactory') - - ->register('mime.textcontentencoder') - ->asAliasOf('mime.qpcontentencoder') - - ->register('mime.safeqpcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') - ->withDependencies(['mime.charstream', 'mime.bytecanonicalizer']) - - ->register('mime.rawcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_RawContentEncoder') - - ->register('mime.nativeqpcontentencoder') - ->withDependencies(['properties.charset']) - ->asNewInstanceOf('Swift_Mime_ContentEncoder_NativeQpContentEncoder') - - ->register('mime.qpcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoderProxy') - ->withDependencies(['mime.safeqpcontentencoder', 'mime.nativeqpcontentencoder', 'properties.charset']) - - ->register('mime.7bitcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') - ->addConstructorValue('7bit') - ->addConstructorValue(true) - - ->register('mime.8bitcontentencoder') - ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') - ->addConstructorValue('8bit') - ->addConstructorValue(true) - - ->register('mime.base64contentencoder') - ->asSharedInstanceOf('Swift_Mime_ContentEncoder_Base64ContentEncoder') - - ->register('mime.rfc2231encoder') - ->asNewInstanceOf('Swift_Encoder_Rfc2231Encoder') - ->withDependencies(['mime.charstream']) -; - -unset($swift_mime_types); diff --git a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php b/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php deleted file mode 100644 index 34a63c7..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/dependency_maps/transport_deps.php +++ /dev/null @@ -1,97 +0,0 @@ -register('transport.localdomain') - // As SERVER_NAME can come from the user in certain configurations, check that - // it does not contain forbidden characters (see RFC 952 and RFC 2181). Use - // preg_replace() instead of preg_match() to prevent DoS attacks with long host names. - ->asValue(!empty($_SERVER['SERVER_NAME']) && '' === preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $_SERVER['SERVER_NAME']) ? trim($_SERVER['SERVER_NAME'], '[]') : '127.0.0.1') - - ->register('transport.smtp') - ->asNewInstanceOf('Swift_Transport_EsmtpTransport') - ->withDependencies([ - 'transport.buffer', - 'transport.smtphandlers', - 'transport.eventdispatcher', - 'transport.localdomain', - 'address.idnaddressencoder', - ]) - - ->register('transport.sendmail') - ->asNewInstanceOf('Swift_Transport_SendmailTransport') - ->withDependencies([ - 'transport.buffer', - 'transport.eventdispatcher', - 'transport.localdomain', - ]) - - ->register('transport.loadbalanced') - ->asNewInstanceOf('Swift_Transport_LoadBalancedTransport') - - ->register('transport.failover') - ->asNewInstanceOf('Swift_Transport_FailoverTransport') - - ->register('transport.spool') - ->asNewInstanceOf('Swift_Transport_SpoolTransport') - ->withDependencies(['transport.eventdispatcher']) - - ->register('transport.null') - ->asNewInstanceOf('Swift_Transport_NullTransport') - ->withDependencies(['transport.eventdispatcher']) - - ->register('transport.buffer') - ->asNewInstanceOf('Swift_Transport_StreamBuffer') - ->withDependencies(['transport.replacementfactory']) - - ->register('transport.smtphandlers') - ->asArray() - ->withDependencies(['transport.authhandler']) - - ->register('transport.authhandler') - ->asNewInstanceOf('Swift_Transport_Esmtp_AuthHandler') - ->withDependencies(['transport.authhandlers']) - - ->register('transport.authhandlers') - ->asArray() - ->withDependencies([ - 'transport.crammd5auth', - 'transport.loginauth', - 'transport.plainauth', - 'transport.ntlmauth', - 'transport.xoauth2auth', - ]) - - ->register('transport.smtputf8handler') - ->asNewInstanceOf('Swift_Transport_Esmtp_SmtpUtf8Handler') - - ->register('transport.8bitmimehandler') - ->asNewInstanceOf('Swift_Transport_Esmtp_EightBitMimeHandler') - ->addConstructorValue('8BITMIME') - - ->register('transport.crammd5auth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_CramMd5Authenticator') - - ->register('transport.loginauth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_LoginAuthenticator') - - ->register('transport.plainauth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_PlainAuthenticator') - - ->register('transport.xoauth2auth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_XOAuth2Authenticator') - - ->register('transport.ntlmauth') - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_NTLMAuthenticator') - - ->register('transport.eventdispatcher') - ->asNewInstanceOf('Swift_Events_SimpleEventDispatcher') - - ->register('transport.replacementfactory') - ->asSharedInstanceOf('Swift_StreamFilters_StringReplacementFilterFactory') - - ->register('address.idnaddressencoder') - ->asNewInstanceOf('Swift_AddressEncoder_IdnAddressEncoder') - - ->register('address.utf8addressencoder') - ->asNewInstanceOf('Swift_AddressEncoder_Utf8AddressEncoder') -; diff --git a/vendor/swiftmailer/swiftmailer/lib/mime_types.php b/vendor/swiftmailer/swiftmailer/lib/mime_types.php deleted file mode 100644 index 72c6fd2..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/mime_types.php +++ /dev/null @@ -1,1007 +0,0 @@ - 'text/vnd.in3d.3dml', - '3ds' => 'image/x-3ds', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-aac', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/pkix-attr-cert', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'apk' => 'application/vnd.android.package-archive', - 'appcache' => 'text/cache-manifest', - 'apr' => 'application/vnd.lotus-approach', - 'aps' => 'application/postscript', - 'arc' => 'application/x-freearc', - 'asc' => 'application/pgp-signature', - 'asf' => 'video/x-ms-asf', - 'asm' => 'text/x-asm', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/basic', - 'avi' => 'video/x-msvideo', - 'aw' => 'application/applixware', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azw' => 'application/vnd.amazon.ebook', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'blb' => 'application/x-blorb', - 'blorb' => 'application/x-blorb', - 'bmi' => 'application/vnd.bmi', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'btif' => 'image/prs.btif', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'cab' => 'application/vnd.ms-cab-compressed', - 'caf' => 'audio/x-caf', - 'cap' => 'application/vnd.tcpdump.pcap', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cb7' => 'application/x-cbr', - 'cba' => 'application/x-cbr', - 'cbr' => 'application/x-cbr', - 'cbt' => 'application/x-cbr', - 'cbz' => 'application/x-cbr', - 'cc' => 'text/x-c', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfs' => 'application/x-cfs-compressed', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/java-vm', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'csh' => 'application/x-csh', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dart' => 'application/vnd.dart', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dbk' => 'application/docbook+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dgc' => 'application/x-dgc-compressed', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/x-msdownload', - 'dmg' => 'application/x-apple-diskimage', - 'dmp' => 'application/vnd.tcpdump.pcap', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.document.macroenabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dra' => 'audio/vnd.dra', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvb' => 'video/vnd.dvb.file', - 'dvi' => 'application/x-dvi', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'emf' => 'application/x-msmetafile', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'emz' => 'application/x-msmetafile', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es3' => 'application/vnd.eszigno3+xml', - 'esa' => 'application/vnd.osgi.subsystem', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'eva' => 'application/x-eva', - 'evy' => 'application/x-envoy', - 'exe' => 'application/x-msdownload', - 'exi' => 'application/exi', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/x-f4v', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'flac' => 'audio/x-flac', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gam' => 'application/x-tads', - 'gbr' => 'application/rpki-ghostbusters', - 'gca' => 'application/x-gca-compressed', - 'gdl' => 'model/vnd.gdl', - 'geo' => 'application/vnd.dynageo', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'gml' => 'application/gml+xml', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gph' => 'application/vnd.flographit', - 'gpx' => 'application/gpx+xml', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gramps' => 'application/x-gramps-xml', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxf' => 'application/gxf', - 'gxt' => 'application/vnd.geonext', - 'gz' => 'application/x-gzip', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hdf' => 'application/x-hdf', - 'hh' => 'text/x-c', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ink' => 'application/inkml+xml', - 'inkml' => 'application/inkml+xml', - 'install' => 'application/x-install-instructions', - 'iota' => 'application/vnd.astraea-software.iota', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/x-iso9660-image', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'java' => 'text/x-java-source', - 'jisp' => 'application/vnd.jisp', - 'jlt' => 'application/vnd.hp-jlyt', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jpm' => 'video/jpm', - 'js' => 'application/javascript', - 'json' => 'application/json', - 'jsonml' => 'application/jsonml+json', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'kpxx' => 'application/vnd.ds-keypoint', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'lha' => 'application/x-lzh-compressed', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'lnk' => 'application/x-ms-shortcut', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/x-lzh-compressed', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm1v' => 'video/mpeg', - 'm21' => 'application/mp21', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'audio/x-mpegurl', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/mp4', - 'm4u' => 'video/vnd.mpegurl', - 'm4v' => 'video/x-m4v', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'mar' => 'application/octet-stream', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'metalink' => 'application/metalink+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mft' => 'application/rpki-manifest', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mie' => 'application/x-mie', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mk3d' => 'video/x-matroska', - 'mka' => 'audio/x-matroska', - 'mks' => 'video/x-matroska', - 'mkv' => 'video/x-matroska', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mng' => 'video/x-mng', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp21' => 'application/mp21', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msl' => 'application/vnd.mobius.msl', - 'msty' => 'application/vnd.muvee.style', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'nfo' => 'text/x-nfo', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nitf' => 'application/vnd.nitf', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nsc' => 'application/x-conference', - 'nsf' => 'application/vnd.lotus-notes', - 'ntf' => 'application/vnd.nitf', - 'nzb' => 'application/x-nzb', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'obj' => 'application/x-tgif', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'omdoc' => 'application/omdoc+xml', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'opml' => 'text/x-opml', - 'oprc' => 'application/vnd.palm', - 'org' => 'application/vnd.lotus-organizer', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'application/x-font-otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'oxps' => 'application/oxps', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p10' => 'application/pkcs10', - 'p12' => 'application/x-pkcs12', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcap' => 'application/vnd.tcpdump.pcap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/vnd.palm', - 'pdf' => 'application/pdf', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp-encrypted', - 'php' => 'application/x-php', - 'php3' => 'application/x-php', - 'php4' => 'application/x-php', - 'php5' => 'application/x-php', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'application/x-mobipocket-ebook', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'image/vnd.adobe.photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-pn-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'ris' => 'application/x-research-info-systems', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'application/vnd.rn-realmedia', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rmvb' => 'application/vnd.rn-realmedia-vbr', - 'rnc' => 'application/relax-ng-compact-syntax', - 'roa' => 'application/rpki-roa', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsd' => 'application/rsd+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'rtx' => 'text/richtext', - 's' => 'text/x-asm', - 's3m' => 'audio/s3m', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sfv' => 'text/x-sfv', - 'sgi' => 'image/sgi', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shf' => 'application/shf+xml', - 'sid' => 'image/x-mrsid-image', - 'sig' => 'application/pgp-signature', - 'sil' => 'audio/silk', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil+xml', - 'smil' => 'application/smil+xml', - 'smv' => 'video/x-smv', - 'smzip' => 'application/vnd.stepmania.package', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'sql' => 'application/x-sql', - 'src' => 'application/x-wais-source', - 'srt' => 'application/x-subrip', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'ssdl' => 'application/ssdl+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'application/vnd.ms-pki.stl', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'sub' => 'text/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 't3' => 'application/x-t3vm-image', - 'taglet' => 'application/vnd.mynfc', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'tga' => 'image/x-tga', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tmo' => 'application/vnd.tmobile-livetv', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trm' => 'application/x-msterminal', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'application/x-font-ttf', - 'ttf' => 'application/x-font-ttf', - 'ttl' => 'text/turtle', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u32' => 'application/x-authorware-bin', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'ulx' => 'application/x-glulx', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvvz' => 'application/vnd.dece.zip', - 'uvx' => 'application/vnd.dece.unspecified', - 'uvz' => 'application/vnd.dece.zip', - 'vcard' => 'text/vcard', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vob' => 'video/x-ms-vob', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'wdp' => 'image/vnd.ms-photo', - 'weba' => 'audio/webm', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgt' => 'application/widget', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'application/x-msmetafile', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-msmetafile', - 'woff' => 'application/font-woff', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x32' => 'application/x-authorware-bin', - 'x3d' => 'model/x3d+xml', - 'x3db' => 'model/x3d+binary', - 'x3dbz' => 'model/x3d+binary', - 'x3dv' => 'model/x3d+vrml', - 'x3dvz' => 'model/x3d+vrml', - 'x3dz' => 'model/x3d+xml', - 'xaml' => 'application/xaml+xml', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlf' => 'application/x-xliff+xml', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xm' => 'audio/xm', - 'xml' => 'application/xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpl' => 'application/xproc+xml', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'xz' => 'application/x-xz', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'z1' => 'application/x-zmachine', - 'z2' => 'application/x-zmachine', - 'z3' => 'application/x-zmachine', - 'z4' => 'application/x-zmachine', - 'z5' => 'application/x-zmachine', - 'z6' => 'application/x-zmachine', - 'z7' => 'application/x-zmachine', - 'z8' => 'application/x-zmachine', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml', - '123' => 'application/vnd.lotus-1-2-3', -]; diff --git a/vendor/swiftmailer/swiftmailer/lib/preferences.php b/vendor/swiftmailer/swiftmailer/lib/preferences.php deleted file mode 100644 index 27b7065..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/preferences.php +++ /dev/null @@ -1,19 +0,0 @@ -setCharset('utf-8'); - -// Without these lines the default caching mechanism is "array" but this uses a lot of memory. -// If possible, use a disk cache to enable attaching large attachments etc. -// You can override the default temporary directory by setting the TMPDIR environment variable. -if (@is_writable($tmpDir = sys_get_temp_dir())) { - $preferences->setTempDir($tmpDir)->setCacheType('disk'); -} diff --git a/vendor/swiftmailer/swiftmailer/lib/swift_required.php b/vendor/swiftmailer/swiftmailer/lib/swift_required.php deleted file mode 100644 index d696056..0000000 --- a/vendor/swiftmailer/swiftmailer/lib/swift_required.php +++ /dev/null @@ -1,22 +0,0 @@ - 'application/x-php', - 'php3' => 'application/x-php', - 'php4' => 'application/x-php', - 'php5' => 'application/x-php', - 'zip' => 'application/zip', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'css' => 'text/css', - 'js' => 'text/javascript', - 'txt' => 'text/plain', - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'avi' => 'video/avi', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bz2', - 'csv' => 'text/csv', - 'dmg' => 'application/x-apple-diskimage', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'eml' => 'message/rfc822', - 'aps' => 'application/postscript', - 'exe' => 'application/x-ms-dos-executable', - 'flv' => 'video/x-flv', - 'gz' => 'application/x-gzip', - 'hqx' => 'application/stuffit', - 'htm' => 'text/html', - 'html' => 'text/html', - 'jar' => 'application/x-java-archive', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'm3u' => 'audio/x-mpegurl', - 'm4a' => 'audio/mp4', - 'mdb' => 'application/x-msaccess', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'odg' => 'vnd.oasis.opendocument.graphics', - 'odp' => 'vnd.oasis.opendocument.presentation', - 'odt' => 'vnd.oasis.opendocument.text', - 'ods' => 'vnd.oasis.opendocument.spreadsheet', - 'ogg' => 'audio/ogg', - 'pdf' => 'application/pdf', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'rar' => 'application/x-rar-compressed', - 'rtf' => 'application/rtf', - 'tar' => 'application/x-tar', - 'sit' => 'application/x-stuffit', - 'svg' => 'image/svg+xml', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'ttf' => 'application/x-font-truetype', - 'vcf' => 'text/x-vcard', - 'wav' => 'audio/wav', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'audio/x-ms-wmv', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - ]; - - // wrap array for generating file - foreach ($valid_mime_types_preset as $extension => $mime_type) { - // generate array for mimetype to extension resolver (only first match) - $valid_mime_types[$extension] = "'{$extension}' => '{$mime_type}'"; - } - - // all extensions from second match - foreach ($matches[2] as $i => $extensions) { - // explode multiple extensions from string - $extensions = explode(' ', strtolower($extensions)); - - // force array for foreach - if (!\is_array($extensions)) { - $extensions = [$extensions]; - } - - foreach ($extensions as $extension) { - // get mime type - $mime_type = $matches[1][$i]; - - // check if string length lower than 10 - if (\strlen($extension) < 10) { - if (!isset($valid_mime_types[$mime_type])) { - // generate array for mimetype to extension resolver (only first match) - $valid_mime_types[$extension] = "'{$extension}' => '{$mime_type}'"; - } - } - } - } - } - - $xml = simplexml_load_string($mime_xml); - - foreach ($xml as $node) { - // check if there is no pattern - if (!isset($node->glob['pattern'])) { - continue; - } - - // get all matching extensions from match - foreach ((array) $node->glob['pattern'] as $extension) { - // skip none glob extensions - if (false === strpos($extension, '.')) { - continue; - } - - // remove get only last part - $extension = explode('.', strtolower($extension)); - $extension = end($extension); - } - - if (isset($node->glob['pattern'][0])) { - // mime type - $mime_type = strtolower((string) $node['type']); - - // get first extension - $extension = strtolower(trim($node->glob['ddpattern'][0], '*.')); - - // skip none glob extensions and check if string length between 1 and 10 - if (false !== strpos($extension, '.') || \strlen($extension) < 1 || \strlen($extension) > 9) { - continue; - } - - // check if string length lower than 10 - if (!isset($valid_mime_types[$mime_type])) { - // generate array for mimetype to extension resolver (only first match) - $valid_mime_types[$extension] = "'{$extension}' => '{$mime_type}'"; - } - } - } - - // full list of valid extensions only - $valid_mime_types = array_unique($valid_mime_types); - ksort($valid_mime_types); - - // combine mime types and extensions array - $output = "$preamble\$swift_mime_types = array(\n ".implode(",\n ", $valid_mime_types)."\n);"; - - // write mime_types.php config file - @file_put_contents('./mime_types.php', $output); -} - -generateUpToDateMimeArray(); diff --git a/vendor/symfony/deprecation-contracts/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8..0000000 --- a/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index e984777..0000000 --- a/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/master/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index 5593b1d..0000000 --- a/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933..0000000 --- a/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index 052541c..0000000 --- a/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index d437150..0000000 --- a/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/vendor/symfony/finder/CHANGELOG.md b/vendor/symfony/finder/CHANGELOG.md deleted file mode 100644 index 33f5bd5..0000000 --- a/vendor/symfony/finder/CHANGELOG.md +++ /dev/null @@ -1,79 +0,0 @@ -CHANGELOG -========= - -5.0.0 ------ - - * added `$useNaturalSort` argument to `Finder::sortByName()` - -4.3.0 ------ - - * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore - -4.2.0 ------ - - * added $useNaturalSort option to Finder::sortByName() method - * the `Finder::sortByName()` method will have a new `$useNaturalSort` - argument in version 5.0, not defining it is deprecated - * added `Finder::reverseSorting()` to reverse the sorting - -4.0.0 ------ - - * removed `ExceptionInterface` - * removed `Symfony\Component\Finder\Iterator\FilterIterator` - -3.4.0 ------ - - * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` - * added Finder::hasResults() method to check if any results were found - -3.3.0 ------ - - * added double-star matching to Glob::toRegex() - -3.0.0 ------ - - * removed deprecated classes - -2.8.0 ------ - - * deprecated adapters and related classes - -2.5.0 ------ - * added support for GLOB_BRACE in the paths passed to Finder::in() - -2.3.0 ------ - - * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) - * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception - -2.2.0 ------ - - * added Finder::path() and Finder::notPath() methods - * added finder adapters to improve performance on specific platforms - * added support for wildcard characters (glob patterns) in the paths passed - to Finder::in() - -2.1.0 ------ - - * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and - Finder::sortByModifiedTime() - * added Countable to Finder - * added support for an array of directories as an argument to - Finder::exclude() - * added searching based on the file content via Finder::contains() and - Finder::notContains() - * added support for the != operator in the Comparator - * [BC BREAK] filter expressions (used for file name and content) are no more - considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/vendor/symfony/finder/Comparator/Comparator.php b/vendor/symfony/finder/Comparator/Comparator.php deleted file mode 100644 index cfe3965..0000000 --- a/vendor/symfony/finder/Comparator/Comparator.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * Comparator. - * - * @author Fabien Potencier - */ -class Comparator -{ - private $target; - private $operator = '=='; - - /** - * Gets the target value. - * - * @return string The target value - */ - public function getTarget() - { - return $this->target; - } - - public function setTarget(string $target) - { - $this->target = $target; - } - - /** - * Gets the comparison operator. - * - * @return string The operator - */ - public function getOperator() - { - return $this->operator; - } - - /** - * Sets the comparison operator. - * - * @throws \InvalidArgumentException - */ - public function setOperator(string $operator) - { - if ('' === $operator) { - $operator = '=='; - } - - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } - - /** - * Tests against the target. - * - * @param mixed $test A test value - * - * @return bool - */ - public function test($test) - { - switch ($this->operator) { - case '>': - return $test > $this->target; - case '>=': - return $test >= $this->target; - case '<': - return $test < $this->target; - case '<=': - return $test <= $this->target; - case '!=': - return $test != $this->target; - } - - return $test == $this->target; - } -} diff --git a/vendor/symfony/finder/Comparator/DateComparator.php b/vendor/symfony/finder/Comparator/DateComparator.php deleted file mode 100644 index ae22c6c..0000000 --- a/vendor/symfony/finder/Comparator/DateComparator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTime($matches[2]); - $target = $date->format('U'); - } catch (\Exception $e) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = $matches[1] ?? '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - $this->setOperator($operator); - $this->setTarget($target); - } -} diff --git a/vendor/symfony/finder/Comparator/NumberComparator.php b/vendor/symfony/finder/Comparator/NumberComparator.php deleted file mode 100644 index 78e1bd3..0000000 --- a/vendor/symfony/finder/Comparator/NumberComparator.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|int $test A comparison string or an integer - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test)); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - $this->setTarget($target); - $this->setOperator($matches[1] ?? '=='); - } -} diff --git a/vendor/symfony/finder/Exception/AccessDeniedException.php b/vendor/symfony/finder/Exception/AccessDeniedException.php deleted file mode 100644 index ee195ea..0000000 --- a/vendor/symfony/finder/Exception/AccessDeniedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon - */ -class AccessDeniedException extends \UnexpectedValueException -{ -} diff --git a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/vendor/symfony/finder/Exception/DirectoryNotFoundException.php deleted file mode 100644 index c6cc0f2..0000000 --- a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Andreas Erhard - */ -class DirectoryNotFoundException extends \InvalidArgumentException -{ -} diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php deleted file mode 100644 index b5a3b96..0000000 --- a/vendor/symfony/finder/Finder.php +++ /dev/null @@ -1,806 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\LazyIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier - */ -class Finder implements \IteratorAggregate, \Countable -{ - public const IGNORE_VCS_FILES = 1; - public const IGNORE_DOT_FILES = 2; - public const IGNORE_VCS_IGNORED_FILES = 4; - - private $mode = 0; - private $names = []; - private $notNames = []; - private $exclude = []; - private $filters = []; - private $depths = []; - private $sizes = []; - private $followLinks = false; - private $reverseSorting = false; - private $sort = false; - private $ignore = 0; - private $dirs = []; - private $dates = []; - private $iterators = []; - private $contains = []; - private $notContains = []; - private $paths = []; - private $notPaths = []; - private $ignoreUnreadableDirs = false; - - private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - * - * @return static - */ - public static function create() - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * $finder->depth(['>= 1', '< 3']) - * - * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth($levels) - { - foreach ((array) $levels as $level) { - $this->depths[] = new Comparator\NumberComparator($level); - } - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); - * - * @param string|string[] $dates A date range string or an array of date ranges - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date($dates) - { - foreach ((array) $dates as $date) { - $this->dates[] = new Comparator\DateComparator($date); - } - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above - * $finder->name('test.php') - * $finder->name(['test.py', 'test.php']) - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name($patterns) - { - $this->names = array_merge($this->names, (array) $patterns); - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName($patterns) - { - $this->notNames = array_merge($this->notNames, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * $finder->contains(['dolor', '/ipsum/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains($patterns) - { - $this->contains = array_merge($this->contains, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * $finder->notContains(['lorem', '/dolor/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains($patterns) - { - $this->notContains = array_merge($this->notContains, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * $finder->path(['some dir', 'another/dir']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path($patterns) - { - $this->paths = array_merge($this->paths, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * $finder->notPath(['some/file.txt', 'another/file.log']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath($patterns) - { - $this->notPaths = array_merge($this->notPaths, (array) $patterns); - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * $finder->size(['> 10K', '< 20K']) - * - * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size($sizes) - { - foreach ((array) $sizes as $size) { - $this->sizes[] = new Comparator\NumberComparator($size); - } - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude($dirs) - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles(bool $ignoreDotFiles) - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS(bool $ignoreVCS) - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Forces Finder to obey .gitignore and ignore files based on rules listed there. - * - * This option is disabled by default. - * - * @return $this - */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored) - { - if ($ignoreVCSIgnored) { - $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern($pattern) - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure) - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName(bool $useNaturalSort = false) - { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType() - { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Reverses the sorting. - * - * @return $this - */ - public function reverseSorting() - { - $this->reverseSorting = true; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure) - { - $this->filters[] = $closure; - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks() - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @return $this - */ - public function ignoreUnreadableDirs(bool $ignore = true) - { - $this->ignoreUnreadableDirs = $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|string[] $dirs A directory path or an array of directories - * - * @return $this - * - * @throws DirectoryNotFoundException if one of the directories does not exist - */ - public function in($dirs) - { - $resolvedDirs = []; - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = $this->normalizeDir($dir); - } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { - sort($glob); - $resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob)); - } else { - throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, $resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator|SplFileInfo[] An iterator - * - * @throws \LogicException if the in() method has not been called - */ - public function getIterator() - { - if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { - $iterator = $this->searchInDirectory($this->dirs[0]); - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable - */ - public function append(iterable $iterator) - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } elseif ($iterator instanceof \Traversable || \is_array($iterator)) { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); - $it[$file->getPathname()] = $file; - } - $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); - } - - return $this; - } - - /** - * Check if any results were found. - * - * @return bool - */ - public function hasResults() - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - * - * @return int - */ - public function count() - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - $exclude = $this->exclude; - $notPaths = $this->notPaths; - - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $exclude = array_merge($exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $notPaths[] = '#(^|/)\..+(/|$)#'; - } - - if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { - $gitignoreFilePath = sprintf('%s/.gitignore', $dir); - if (!is_readable($gitignoreFilePath)) { - throw new \RuntimeException(sprintf('The "ignoreVCSIgnored" option cannot be used by the Finder as the "%s" file is not readable.', $gitignoreFilePath)); - } - $notPaths = array_merge($notPaths, [Gitignore::toRegex(file_get_contents($gitignoreFilePath))]); - } - - $minDepth = 0; - $maxDepth = \PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper - */ - private function normalizeDir(string $dir): string - { - if ('/' === $dir) { - return $dir; - } - - $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - - if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { - $dir .= '/'; - } - - return $dir; - } -} diff --git a/vendor/symfony/finder/Gitignore.php b/vendor/symfony/finder/Gitignore.php deleted file mode 100644 index dfe0a0a..0000000 --- a/vendor/symfony/finder/Gitignore.php +++ /dev/null @@ -1,133 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Gitignore matches against text. - * - * @author Ahmed Abdou - */ -class Gitignore -{ - /** - * Returns a regexp which is the equivalent of the gitignore pattern. - * - * @return string The regexp - */ - public static function toRegex(string $gitignoreFileContent): string - { - $gitignoreFileContent = preg_replace('/^[^\\\r\n]*#.*/m', '', $gitignoreFileContent); - $gitignoreLines = preg_split('/\r\n|\r|\n/', $gitignoreFileContent); - - $positives = []; - $negatives = []; - foreach ($gitignoreLines as $i => $line) { - $line = trim($line); - if ('' === $line) { - continue; - } - - if (1 === preg_match('/^!/', $line)) { - $positives[$i] = null; - $negatives[$i] = self::getRegexFromGitignore(preg_replace('/^!(.*)/', '${1}', $line), true); - - continue; - } - $negatives[$i] = null; - $positives[$i] = self::getRegexFromGitignore($line); - } - - $index = 0; - $patterns = []; - foreach ($positives as $pattern) { - if (null === $pattern) { - continue; - } - - $negativesAfter = array_filter(\array_slice($negatives, ++$index)); - if ([] !== $negativesAfter) { - $pattern .= sprintf('(?'.$regex.'($|\/.*))'; - } -} diff --git a/vendor/symfony/finder/Glob.php b/vendor/symfony/finder/Glob.php deleted file mode 100644 index 8447932..0000000 --- a/vendor/symfony/finder/Glob.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - * - * @return string - */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = \strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -} diff --git a/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/vendor/symfony/finder/Iterator/CustomFilterIterator.php deleted file mode 100644 index a30bbd0..0000000 --- a/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier - */ -class CustomFilterIterator extends \FilterIterator -{ - private $filters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!\is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === $filter($fileinfo)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php deleted file mode 100644 index 2e97e00..0000000 --- a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param DateComparator[] $comparators An array of DateComparator instances - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php deleted file mode 100644 index 18e751d..0000000 --- a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -} diff --git a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php deleted file mode 100644 index 6a1b291..0000000 --- a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - private $iterator; - private $isRecursive; - private $excludedDirs = []; - private $excludedPattern; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = []; - foreach ($directories as $directory) { - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || false !== strpos($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool True if the value should be kept, false otherwise - */ - public function accept() - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - return true; - } - - /** - * @return bool - */ - public function hasChildren() - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - public function getChildren() - { - $children = new self($this->iterator->getChildren(), []); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -} diff --git a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php deleted file mode 100644 index 0ea2c50..0000000 --- a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier - */ -class FileTypeFilterIterator extends \FilterIterator -{ - public const ONLY_FILES = 1; - public const ONLY_DIRECTORIES = 2; - - private $mode; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php deleted file mode 100644 index b26a368..0000000 --- a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - * - * @return string regexp corresponding to a given string or regexp - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/vendor/symfony/finder/Iterator/FilenameFilterIterator.php deleted file mode 100644 index dedd1ca..0000000 --- a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - * - * @return string regexp corresponding to a given glob or regexp - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -} diff --git a/vendor/symfony/finder/Iterator/LazyIterator.php b/vendor/symfony/finder/Iterator/LazyIterator.php deleted file mode 100644 index 32cc37f..0000000 --- a/vendor/symfony/finder/Iterator/LazyIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * @author Jérémy Derussé - * - * @internal - */ -class LazyIterator implements \IteratorAggregate -{ - private $iteratorFactory; - - public function __construct(callable $iteratorFactory) - { - $this->iteratorFactory = $iteratorFactory; - } - - public function getIterator(): \Traversable - { - yield from ($this->iteratorFactory)(); - } -} diff --git a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php deleted file mode 100644 index 78a34ab..0000000 --- a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected $matchRegexps = []; - protected $noMatchRegexps = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $matchPatterns An array of patterns that need to match - * @param string[] $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - * - * @return bool - */ - protected function isAccepted(string $string) - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - * - * @return bool - */ - protected function isRegex(string $str) - { - if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - * - * @return string - */ - abstract protected function toRegex(string $str); -} diff --git a/vendor/symfony/finder/Iterator/PathFilterIterator.php b/vendor/symfony/finder/Iterator/PathFilterIterator.php deleted file mode 100644 index 67b71f4..0000000 --- a/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - * - * @return string regexp corresponding to a given string or regexp - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php deleted file mode 100644 index 7616b14..0000000 --- a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - /** - * @var bool - */ - private $ignoreUnreadableDirs; - - /** - * @var bool - */ - private $rewindable; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private $rootPath; - private $subPath; - private $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = \DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - * - * @return SplFileInfo File information - */ - public function current() - { - // the logic here avoids redoing the same work in all iterations - - if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = (string) $this->getSubPath(); - } - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - - if ('/' !== $basePath = $this->rootPath) { - $basePath .= $this->directorySeparator; - } - - return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); - } - - /** - * @return \RecursiveIterator - * - * @throws AccessDeniedException - */ - public function getChildren() - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - if ($this->ignoreUnreadableDirs) { - // If directory is unreadable and finder is set to ignore it, a fake empty content is returned. - return new \RecursiveArrayIterator([]); - } else { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Do nothing for non rewindable stream. - */ - public function rewind() - { - if (false === $this->isRewindable()) { - return; - } - - parent::rewind(); - } - - /** - * Checks if the stream is rewindable. - * - * @return bool true when the stream is rewindable, false otherwise - */ - public function isRewindable() - { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); - - if ($infos['seekable']) { - return $this->rewindable = true; - } - } - - return $this->rewindable = false; - } -} diff --git a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php deleted file mode 100644 index 2aeef67..0000000 --- a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param NumberComparator[] $comparators An array of NumberComparator instances - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/SortableIterator.php b/vendor/symfony/finder/Iterator/SortableIterator.php deleted file mode 100644 index 74c8db2..0000000 --- a/vendor/symfony/finder/Iterator/SortableIterator.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier - */ -class SortableIterator implements \IteratorAggregate -{ - public const SORT_BY_NONE = 0; - public const SORT_BY_NAME = 1; - public const SORT_BY_TYPE = 2; - public const SORT_BY_ACCESSED_TIME = 3; - public const SORT_BY_CHANGED_TIME = 4; - public const SORT_BY_MODIFIED_TIME = 5; - public const SORT_BY_NAME_NATURAL = 6; - - private $iterator; - private $sort; - - /** - * @param \Traversable $iterator The Iterator to filter - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) - { - $this->iterator = $iterator; - $order = $reverseOrder ? -1 : 1; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - if ($a->isDir() && $b->isFile()) { - return -$order; - } elseif ($a->isFile() && $b->isDir()) { - return $order; - } - - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; - } elseif (self::SORT_BY_NONE === $sort) { - $this->sort = $order; - } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort; - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - /** - * @return \Traversable - */ - public function getIterator() - { - if (1 === $this->sort) { - return $this->iterator; - } - - $array = iterator_to_array($this->iterator, true); - - if (-1 === $this->sort) { - $array = array_reverse($array); - } else { - uasort($array, $this->sort); - } - - return new \ArrayIterator($array); - } -} diff --git a/vendor/symfony/finder/LICENSE b/vendor/symfony/finder/LICENSE deleted file mode 100644 index 9ff2d0d..0000000 --- a/vendor/symfony/finder/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/finder/README.md b/vendor/symfony/finder/README.md deleted file mode 100644 index 0b19c75..0000000 --- a/vendor/symfony/finder/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Finder Component -================ - -The Finder component finds files and directories via an intuitive fluent -interface. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/finder.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/finder/SplFileInfo.php b/vendor/symfony/finder/SplFileInfo.php deleted file mode 100644 index 62c9faa..0000000 --- a/vendor/symfony/finder/SplFileInfo.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier - */ -class SplFileInfo extends \SplFileInfo -{ - private $relativePath; - private $relativePathname; - - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { - parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - * - * @return string the relative path - */ - public function getRelativePath() - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - * - * @return string the relative path name - */ - public function getRelativePathname() - { - return $this->relativePathname; - } - - public function getFilenameWithoutExtension(): string - { - $filename = $this->getFilename(); - - return pathinfo($filename, \PATHINFO_FILENAME); - } - - /** - * Returns the contents of the file. - * - * @return string the contents of the file - * - * @throws \RuntimeException - */ - public function getContents() - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - $content = file_get_contents($this->getPathname()); - restore_error_handler(); - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -} diff --git a/vendor/symfony/finder/composer.json b/vendor/symfony/finder/composer.json deleted file mode 100644 index dc097b3..0000000 --- a/vendor/symfony/finder/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "symfony/finder", - "type": "library", - "description": "Finds files and directories via an intuitive fluent interface", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Finder\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index 58414dc..0000000 --- a/vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param string|int $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param string|int $int - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/vendor/symfony/polyfill-ctype/LICENSE b/vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 3f853aa..0000000 --- a/vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-ctype/README.md b/vendor/symfony/polyfill-ctype/README.md deleted file mode 100644 index 8add1ab..0000000 --- a/vendor/symfony/polyfill-ctype/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Ctype -======================== - -This component provides `ctype_*` functions to users who run php versions without the ctype extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-ctype/bootstrap.php b/vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b..0000000 --- a/vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/bootstrap80.php b/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f861..0000000 --- a/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json deleted file mode 100644 index 995978c..0000000 --- a/vendor/symfony/polyfill-ctype/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-ctype", - "type": "library", - "description": "Symfony polyfill for ctype functions", - "keywords": ["polyfill", "compatibility", "portable", "ctype"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-iconv/Iconv.php b/vendor/symfony/polyfill-iconv/Iconv.php deleted file mode 100644 index c17a70d..0000000 --- a/vendor/symfony/polyfill-iconv/Iconv.php +++ /dev/null @@ -1,744 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Iconv; - -/** - * iconv implementation in pure PHP, UTF-8 centric. - * - * Implemented: - * - iconv - Convert string to requested character encoding - * - iconv_mime_decode - Decodes a MIME header field - * - iconv_mime_decode_headers - Decodes multiple MIME header fields at once - * - iconv_get_encoding - Retrieve internal configuration variables of iconv extension - * - iconv_set_encoding - Set current setting for character encoding conversion - * - iconv_mime_encode - Composes a MIME header field - * - iconv_strlen - Returns the character count of string - * - iconv_strpos - Finds position of first occurrence of a needle within a haystack - * - iconv_strrpos - Finds the last occurrence of a needle within a haystack - * - iconv_substr - Cut out part of a string - * - * Charsets available for conversion are defined by files - * in the charset/ directory and by Iconv::$alias below. - * You're welcome to send back any addition you make. - * - * @author Nicolas Grekas - * - * @internal - */ -final class Iconv -{ - public const ERROR_ILLEGAL_CHARACTER = 'iconv(): Detected an illegal character in input string'; - public const ERROR_WRONG_CHARSET = 'iconv(): Wrong charset, conversion from `%s\' to `%s\' is not allowed'; - - public static $inputEncoding = 'utf-8'; - public static $outputEncoding = 'utf-8'; - public static $internalEncoding = 'utf-8'; - - private static $alias = [ - 'utf8' => 'utf-8', - 'ascii' => 'us-ascii', - 'tis-620' => 'iso-8859-11', - 'cp1250' => 'windows-1250', - 'cp1251' => 'windows-1251', - 'cp1252' => 'windows-1252', - 'cp1253' => 'windows-1253', - 'cp1254' => 'windows-1254', - 'cp1255' => 'windows-1255', - 'cp1256' => 'windows-1256', - 'cp1257' => 'windows-1257', - 'cp1258' => 'windows-1258', - 'shift-jis' => 'cp932', - 'shift_jis' => 'cp932', - 'latin1' => 'iso-8859-1', - 'latin2' => 'iso-8859-2', - 'latin3' => 'iso-8859-3', - 'latin4' => 'iso-8859-4', - 'latin5' => 'iso-8859-9', - 'latin6' => 'iso-8859-10', - 'latin7' => 'iso-8859-13', - 'latin8' => 'iso-8859-14', - 'latin9' => 'iso-8859-15', - 'latin10' => 'iso-8859-16', - 'iso8859-1' => 'iso-8859-1', - 'iso8859-2' => 'iso-8859-2', - 'iso8859-3' => 'iso-8859-3', - 'iso8859-4' => 'iso-8859-4', - 'iso8859-5' => 'iso-8859-5', - 'iso8859-6' => 'iso-8859-6', - 'iso8859-7' => 'iso-8859-7', - 'iso8859-8' => 'iso-8859-8', - 'iso8859-9' => 'iso-8859-9', - 'iso8859-10' => 'iso-8859-10', - 'iso8859-11' => 'iso-8859-11', - 'iso8859-12' => 'iso-8859-12', - 'iso8859-13' => 'iso-8859-13', - 'iso8859-14' => 'iso-8859-14', - 'iso8859-15' => 'iso-8859-15', - 'iso8859-16' => 'iso-8859-16', - 'iso_8859-1' => 'iso-8859-1', - 'iso_8859-2' => 'iso-8859-2', - 'iso_8859-3' => 'iso-8859-3', - 'iso_8859-4' => 'iso-8859-4', - 'iso_8859-5' => 'iso-8859-5', - 'iso_8859-6' => 'iso-8859-6', - 'iso_8859-7' => 'iso-8859-7', - 'iso_8859-8' => 'iso-8859-8', - 'iso_8859-9' => 'iso-8859-9', - 'iso_8859-10' => 'iso-8859-10', - 'iso_8859-11' => 'iso-8859-11', - 'iso_8859-12' => 'iso-8859-12', - 'iso_8859-13' => 'iso-8859-13', - 'iso_8859-14' => 'iso-8859-14', - 'iso_8859-15' => 'iso-8859-15', - 'iso_8859-16' => 'iso-8859-16', - 'iso88591' => 'iso-8859-1', - 'iso88592' => 'iso-8859-2', - 'iso88593' => 'iso-8859-3', - 'iso88594' => 'iso-8859-4', - 'iso88595' => 'iso-8859-5', - 'iso88596' => 'iso-8859-6', - 'iso88597' => 'iso-8859-7', - 'iso88598' => 'iso-8859-8', - 'iso88599' => 'iso-8859-9', - 'iso885910' => 'iso-8859-10', - 'iso885911' => 'iso-8859-11', - 'iso885912' => 'iso-8859-12', - 'iso885913' => 'iso-8859-13', - 'iso885914' => 'iso-8859-14', - 'iso885915' => 'iso-8859-15', - 'iso885916' => 'iso-8859-16', - ]; - private static $translitMap = []; - private static $convertMap = []; - private static $errorHandler; - private static $lastError; - - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $isValidUtf8; - - public static function iconv($inCharset, $outCharset, $str) - { - $str = (string) $str; - if ('' === $str) { - return ''; - } - - // Prepare for //IGNORE and //TRANSLIT - - $translit = $ignore = ''; - - $outCharset = strtolower($outCharset); - $inCharset = strtolower($inCharset); - - if ('' === $outCharset) { - $outCharset = 'iso-8859-1'; - } - if ('' === $inCharset) { - $inCharset = 'iso-8859-1'; - } - - do { - $loop = false; - - if ('//translit' === substr($outCharset, -10)) { - $loop = $translit = true; - $outCharset = substr($outCharset, 0, -10); - } - - if ('//ignore' === substr($outCharset, -8)) { - $loop = $ignore = true; - $outCharset = substr($outCharset, 0, -8); - } - } while ($loop); - - do { - $loop = false; - - if ('//translit' === substr($inCharset, -10)) { - $loop = true; - $inCharset = substr($inCharset, 0, -10); - } - - if ('//ignore' === substr($inCharset, -8)) { - $loop = true; - $inCharset = substr($inCharset, 0, -8); - } - } while ($loop); - - if (isset(self::$alias[$inCharset])) { - $inCharset = self::$alias[$inCharset]; - } - if (isset(self::$alias[$outCharset])) { - $outCharset = self::$alias[$outCharset]; - } - - // Load charset maps - - if (('utf-8' !== $inCharset && !self::loadMap('from.', $inCharset, $inMap)) - || ('utf-8' !== $outCharset && !self::loadMap('to.', $outCharset, $outMap))) { - trigger_error(sprintf(self::ERROR_WRONG_CHARSET, $inCharset, $outCharset)); - - return false; - } - - if ('utf-8' !== $inCharset) { - // Convert input to UTF-8 - $result = ''; - if (self::mapToUtf8($result, $inMap, $str, $ignore)) { - $str = $result; - } else { - $str = false; - } - self::$isValidUtf8 = true; - } else { - self::$isValidUtf8 = preg_match('//u', $str); - - if (!self::$isValidUtf8 && !$ignore) { - trigger_error(self::ERROR_ILLEGAL_CHARACTER); - - return false; - } - - if ('utf-8' === $outCharset) { - // UTF-8 validation - $str = self::utf8ToUtf8($str, $ignore); - } - } - - if ('utf-8' !== $outCharset && false !== $str) { - // Convert output to UTF-8 - $result = ''; - if (self::mapFromUtf8($result, $outMap, $str, $ignore, $translit)) { - return $result; - } - - return false; - } - - return $str; - } - - public static function iconv_mime_decode_headers($str, $mode = 0, $charset = null) - { - if (null === $charset) { - $charset = self::$internalEncoding; - } - - if (false !== strpos($str, "\r")) { - $str = strtr(str_replace("\r\n", "\n", $str), "\r", "\n"); - } - $str = explode("\n\n", $str, 2); - - $headers = []; - - $str = preg_split('/\n(?![ \t])/', $str[0]); - foreach ($str as $str) { - $str = self::iconv_mime_decode($str, $mode, $charset); - if (false === $str) { - return false; - } - $str = explode(':', $str, 2); - - if (2 === \count($str)) { - if (isset($headers[$str[0]])) { - if (!\is_array($headers[$str[0]])) { - $headers[$str[0]] = [$headers[$str[0]]]; - } - $headers[$str[0]][] = ltrim($str[1]); - } else { - $headers[$str[0]] = ltrim($str[1]); - } - } - } - - return $headers; - } - - public static function iconv_mime_decode($str, $mode = 0, $charset = null) - { - if (null === $charset) { - $charset = self::$internalEncoding; - } - if (\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) { - $charset .= '//IGNORE'; - } - - if (false !== strpos($str, "\r")) { - $str = strtr(str_replace("\r\n", "\n", $str), "\r", "\n"); - } - $str = preg_split('/\n(?![ \t])/', rtrim($str), 2); - $str = preg_replace('/[ \t]*\n[ \t]+/', ' ', rtrim($str[0])); - $str = preg_split('/=\?([^?]+)\?([bqBQ])\?(.*?)\?=/', $str, -1, \PREG_SPLIT_DELIM_CAPTURE); - - $result = self::iconv('utf-8', $charset, $str[0]); - if (false === $result) { - return false; - } - - $i = 1; - $len = \count($str); - - while ($i < $len) { - $c = strtolower($str[$i]); - if ((\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) - && 'utf-8' !== $c - && !isset(self::$alias[$c]) - && !self::loadMap('from.', $c, $d)) { - $d = false; - } elseif ('B' === strtoupper($str[$i + 1])) { - $d = base64_decode($str[$i + 2]); - } else { - $d = rawurldecode(strtr(str_replace('%', '%25', $str[$i + 2]), '=_', '% ')); - } - - if (false !== $d) { - if ('' !== $d) { - if ('' === $d = self::iconv($c, $charset, $d)) { - $str[$i + 3] = substr($str[$i + 3], 1); - } else { - $result .= $d; - } - } - $d = self::iconv('utf-8', $charset, $str[$i + 3]); - if ('' !== trim($d)) { - $result .= $d; - } - } elseif (\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) { - $result .= "=?{$str[$i]}?{$str[$i + 1]}?{$str[$i + 2]}?={$str[$i + 3]}"; - } else { - $result = false; - break; - } - - $i += 4; - } - - return $result; - } - - public static function iconv_get_encoding($type = 'all') - { - switch ($type) { - case 'input_encoding': return self::$inputEncoding; - case 'output_encoding': return self::$outputEncoding; - case 'internal_encoding': return self::$internalEncoding; - } - - return [ - 'input_encoding' => self::$inputEncoding, - 'output_encoding' => self::$outputEncoding, - 'internal_encoding' => self::$internalEncoding, - ]; - } - - public static function iconv_set_encoding($type, $charset) - { - switch ($type) { - case 'input_encoding': self::$inputEncoding = $charset; break; - case 'output_encoding': self::$outputEncoding = $charset; break; - case 'internal_encoding': self::$internalEncoding = $charset; break; - default: return false; - } - - return true; - } - - public static function iconv_mime_encode($fieldName, $fieldValue, $pref = null) - { - if (!\is_array($pref)) { - $pref = []; - } - - $pref += [ - 'scheme' => 'B', - 'input-charset' => self::$internalEncoding, - 'output-charset' => self::$internalEncoding, - 'line-length' => 76, - 'line-break-chars' => "\r\n", - ]; - - if (preg_match('/[\x80-\xFF]/', $fieldName)) { - $fieldName = ''; - } - - $scheme = strtoupper(substr($pref['scheme'], 0, 1)); - $in = strtolower($pref['input-charset']); - $out = strtolower($pref['output-charset']); - - if ('utf-8' !== $in && false === $fieldValue = self::iconv($in, 'utf-8', $fieldValue)) { - return false; - } - - preg_match_all('/./us', $fieldValue, $chars); - - $chars = $chars[0] ?? []; - - $lineBreak = (int) $pref['line-length']; - $lineStart = "=?{$pref['output-charset']}?{$scheme}?"; - $lineLength = \strlen($fieldName) + 2 + \strlen($lineStart) + 2; - $lineOffset = \strlen($lineStart) + 3; - $lineData = ''; - - $fieldValue = []; - - $Q = 'Q' === $scheme; - - foreach ($chars as $c) { - if ('utf-8' !== $out && false === $c = self::iconv('utf-8', $out, $c)) { - return false; - } - - $o = $Q - ? $c = preg_replace_callback( - '/[=_\?\x00-\x1F\x80-\xFF]/', - [__CLASS__, 'qpByteCallback'], - $c - ) - : base64_encode($lineData.$c); - - if (isset($o[$lineBreak - $lineLength])) { - if (!$Q) { - $lineData = base64_encode($lineData); - } - $fieldValue[] = $lineStart.$lineData.'?='; - $lineLength = $lineOffset; - $lineData = ''; - } - - $lineData .= $c; - $Q && $lineLength += \strlen($c); - } - - if ('' !== $lineData) { - if (!$Q) { - $lineData = base64_encode($lineData); - } - $fieldValue[] = $lineStart.$lineData.'?='; - } - - return $fieldName.': '.implode($pref['line-break-chars'].' ', $fieldValue); - } - - public static function iconv_strlen($s, $encoding = null) - { - static $hasXml = null; - if (null === $hasXml) { - $hasXml = \extension_loaded('xml'); - } - - if ($hasXml) { - return self::strlen1($s, $encoding); - } - - return self::strlen2($s, $encoding); - } - - public static function strlen1($s, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - if (0 !== stripos($encoding, 'utf-8') && false === $s = self::iconv($encoding, 'utf-8', $s)) { - return false; - } - - return \strlen(utf8_decode($s)); - } - - public static function strlen2($s, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - if (0 !== stripos($encoding, 'utf-8') && false === $s = self::iconv($encoding, 'utf-8', $s)) { - return false; - } - - $ulenMask = self::$ulenMask; - - $i = 0; - $j = 0; - $len = \strlen($s); - - while ($i < $len) { - $u = $s[$i] & "\xF0"; - $i += $ulenMask[$u] ?? 1; - ++$j; - } - - return $j; - } - - public static function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - - if (0 !== stripos($encoding, 'utf-8')) { - if (false === $haystack = self::iconv($encoding, 'utf-8', $haystack)) { - return false; - } - if (false === $needle = self::iconv($encoding, 'utf-8', $needle)) { - return false; - } - } - - if ($offset = (int) $offset) { - $haystack = self::iconv_substr($haystack, $offset, 2147483647, 'utf-8'); - } - $pos = strpos($haystack, $needle); - - return false === $pos ? false : ($offset + ($pos ? self::iconv_strlen(substr($haystack, 0, $pos), 'utf-8') : 0)); - } - - public static function iconv_strrpos($haystack, $needle, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - - if (0 !== stripos($encoding, 'utf-8')) { - if (false === $haystack = self::iconv($encoding, 'utf-8', $haystack)) { - return false; - } - if (false === $needle = self::iconv($encoding, 'utf-8', $needle)) { - return false; - } - } - - $pos = isset($needle[0]) ? strrpos($haystack, $needle) : false; - - return false === $pos ? false : self::iconv_strlen($pos ? substr($haystack, 0, $pos) : $haystack, 'utf-8'); - } - - public static function iconv_substr($s, $start, $length = 2147483647, $encoding = null) - { - if (null === $encoding) { - $encoding = self::$internalEncoding; - } - if (0 !== stripos($encoding, 'utf-8')) { - $encoding = null; - } elseif (false === $s = self::iconv($encoding, 'utf-8', $s)) { - return false; - } - - $s = (string) $s; - $slen = self::iconv_strlen($s, 'utf-8'); - $start = (int) $start; - - if (0 > $start) { - $start += $slen; - } - if (0 > $start) { - if (\PHP_VERSION_ID < 80000) { - return false; - } - - $start = 0; - } - if ($start >= $slen) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - $rx = $slen - $start; - - if (0 > $length) { - $length += $rx; - } - if (0 === $length) { - return ''; - } - if (0 > $length) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - if ($length > $rx) { - $length = $rx; - } - - $rx = '/^'.($start ? self::pregOffset($start) : '').'('.self::pregOffset($length).')/u'; - - $s = preg_match($rx, $s, $s) ? $s[1] : ''; - - if (null === $encoding) { - return $s; - } - - return self::iconv('utf-8', $encoding, $s); - } - - private static function loadMap($type, $charset, &$map) - { - if (!isset(self::$convertMap[$type.$charset])) { - if (false === $map = self::getData($type.$charset)) { - if ('to.' === $type && self::loadMap('from.', $charset, $map)) { - $map = array_flip($map); - } else { - return false; - } - } - - self::$convertMap[$type.$charset] = $map; - } else { - $map = self::$convertMap[$type.$charset]; - } - - return true; - } - - private static function utf8ToUtf8($str, $ignore) - { - $ulenMask = self::$ulenMask; - $valid = self::$isValidUtf8; - - $u = $str; - $i = $j = 0; - $len = \strlen($str); - - while ($i < $len) { - if ($str[$i] < "\x80") { - $u[$j++] = $str[$i++]; - } else { - $ulen = $str[$i] & "\xF0"; - $ulen = $ulenMask[$ulen] ?? 1; - $uchr = substr($str, $i, $ulen); - - if (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr))) { - if ($ignore) { - ++$i; - continue; - } - - trigger_error(self::ERROR_ILLEGAL_CHARACTER); - - return false; - } - - $i += $ulen; - - $u[$j++] = $uchr[0]; - - isset($uchr[1]) && 0 !== ($u[$j++] = $uchr[1]) - && isset($uchr[2]) && 0 !== ($u[$j++] = $uchr[2]) - && isset($uchr[3]) && 0 !== ($u[$j++] = $uchr[3]); - } - } - - return substr($u, 0, $j); - } - - private static function mapToUtf8(&$result, array $map, $str, $ignore) - { - $len = \strlen($str); - for ($i = 0; $i < $len; ++$i) { - if (isset($str[$i + 1], $map[$str[$i].$str[$i + 1]])) { - $result .= $map[$str[$i].$str[++$i]]; - } elseif (isset($map[$str[$i]])) { - $result .= $map[$str[$i]]; - } elseif (!$ignore) { - trigger_error(self::ERROR_ILLEGAL_CHARACTER); - - return false; - } - } - - return true; - } - - private static function mapFromUtf8(&$result, array $map, $str, $ignore, $translit) - { - $ulenMask = self::$ulenMask; - $valid = self::$isValidUtf8; - - if ($translit && !self::$translitMap) { - self::$translitMap = self::getData('translit'); - } - - $i = 0; - $len = \strlen($str); - - while ($i < $len) { - if ($str[$i] < "\x80") { - $uchr = $str[$i++]; - } else { - $ulen = $str[$i] & "\xF0"; - $ulen = $ulenMask[$ulen] ?? 1; - $uchr = substr($str, $i, $ulen); - - if ($ignore && (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr)))) { - ++$i; - continue; - } - - $i += $ulen; - } - - if (isset($map[$uchr])) { - $result .= $map[$uchr]; - } elseif ($translit) { - if (isset(self::$translitMap[$uchr])) { - $uchr = self::$translitMap[$uchr]; - } elseif ($uchr >= "\xC3\x80") { - $uchr = \Normalizer::normalize($uchr, \Normalizer::NFD); - - if ($uchr[0] < "\x80") { - $uchr = $uchr[0]; - } elseif ($ignore) { - continue; - } else { - return false; - } - } elseif ($ignore) { - continue; - } else { - return false; - } - - $str = $uchr.substr($str, $i); - $len = \strlen($str); - $i = 0; - } elseif (!$ignore) { - return false; - } - } - - return true; - } - - private static function qpByteCallback(array $m) - { - return '='.strtoupper(dechex(\ord($m[0]))); - } - - private static function pregOffset($offset) - { - $rx = []; - $offset = (int) $offset; - - while ($offset > 65535) { - $rx[] = '.{65535}'; - $offset -= 65535; - } - - return implode('', $rx).'.{'.$offset.'}'; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/charset/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/vendor/symfony/polyfill-iconv/LICENSE b/vendor/symfony/polyfill-iconv/LICENSE deleted file mode 100644 index 4cd8bdd..0000000 --- a/vendor/symfony/polyfill-iconv/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-iconv/README.md b/vendor/symfony/polyfill-iconv/README.md deleted file mode 100644 index b0c8984..0000000 --- a/vendor/symfony/polyfill-iconv/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Iconv -======================== - -This component provides a native PHP implementation of the -[php.net/iconv](https://php.net/iconv) functions -(short of [`ob_iconv_handler`](https://php.net/ob-iconv-handler)). - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.big5.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.big5.php deleted file mode 100644 index b119854..0000000 --- a/vendor/symfony/polyfill-iconv/Resources/charset/from.big5.php +++ /dev/null @@ -1,13719 +0,0 @@ - ' ', - 'A' => ',', - 'B' => '、', - 'C' => '。', - 'D' => '.', - 'E' => '•', - 'F' => ';', - 'G' => ':', - 'H' => '?', - 'I' => '!', - 'J' => '︰', - 'K' => '…', - 'L' => '‥', - 'M' => '﹐', - 'N' => '、', - 'O' => '﹒', - 'P' => '·', - 'Q' => '﹔', - 'R' => '﹕', - 'S' => '﹖', - 'T' => '﹗', - 'U' => '|', - 'V' => '–', - 'W' => '︱', - 'X' => '—', - 'Y' => '︳', - 'Z' => '�', - '[' => '︴', - '\\' => '﹏', - ']' => '(', - '^' => ')', - '_' => '︵', - '`' => '︶', - 'a' => '{', - 'b' => '}', - 'c' => '︷', - 'd' => '︸', - 'e' => '〔', - 'f' => '〕', - 'g' => '︹', - 'h' => '︺', - 'i' => '【', - 'j' => '】', - 'k' => '︻', - 'l' => '︼', - 'm' => '《', - 'n' => '》', - 'o' => '︽', - 'p' => '︾', - 'q' => '〈', - 'r' => '〉', - 's' => '︿', - 't' => '﹀', - 'u' => '「', - 'v' => '」', - 'w' => '﹁', - 'x' => '﹂', - 'y' => '『', - 'z' => '』', - '{' => '﹃', - '|' => '﹄', - '}' => '﹙', - '~' => '﹚', - '' => '﹛', - '' => '﹜', - '' => '﹝', - '' => '﹞', - '' => '‘', - '' => '’', - '' => '“', - '' => '”', - '' => '〝', - '' => '〞', - '' => '‵', - '' => '′', - '' => '#', - '' => '&', - '' => '*', - '' => '※', - '' => '§', - '' => '〃', - '' => '○', - '' => '●', - '' => '△', - '' => '▲', - '' => '◎', - '' => '☆', - '' => '★', - '' => '◇', - '' => '◆', - '' => '□', - '' => '■', - '' => '▽', - '' => '▼', - '' => '㊣', - '' => '℅', - '' => '‾', - '' => '�', - '' => '_', - '' => '�', - '' => '﹉', - '' => '﹊', - '' => '﹍', - '' => '﹎', - '' => '﹋', - '' => '﹌', - '' => '﹟', - '' => '﹠', - '' => '﹡', - '' => '+', - '' => '-', - '' => '×', - '' => '÷', - '' => '±', - '' => '√', - '' => '<', - '' => '>', - '' => '=', - '' => '≦', - '' => '≧', - '' => '≠', - '' => '∞', - '' => '≒', - '' => '≡', - '' => '﹢', - '' => '﹣', - '' => '﹤', - '' => '﹥', - '' => '﹦', - '' => '∼', - '' => '∩', - '' => '∪', - '' => '⊥', - '' => '∠', - '' => '∟', - '' => '⊿', - '' => '㏒', - '' => '㏑', - '' => '∫', - '' => '∮', - '' => '∵', - '' => '∴', - '' => '♀', - '' => '♂', - '' => '♁', - '' => '☉', - '' => '↑', - '' => '↓', - '' => '←', - '' => '→', - '' => '↖', - '' => '↗', - '' => '↙', - '' => '↘', - '' => '∥', - '' => '∣', - '' => '�', - '@' => '�', - 'A' => '/', - 'B' => '\', - 'C' => '$', - 'D' => '¥', - 'E' => '〒', - 'F' => '¢', - 'G' => '£', - 'H' => '%', - 'I' => '@', - 'J' => '℃', - 'K' => '℉', - 'L' => '﹩', - 'M' => '﹪', - 'N' => '﹫', - 'O' => '㏕', - 'P' => '㎜', - 'Q' => '㎝', - 'R' => '㎞', - 'S' => '㏎', - 'T' => '㎡', - 'U' => '㎎', - 'V' => '㎏', - 'W' => '㏄', - 'X' => '°', - 'Y' => '兙', - 'Z' => '兛', - '[' => '兞', - '\\' => '兝', - ']' => '兡', - '^' => '兣', - '_' => '嗧', - '`' => '瓩', - 'a' => '糎', - 'b' => '▁', - 'c' => '▂', - 'd' => '▃', - 'e' => '▄', - 'f' => '▅', - 'g' => '▆', - 'h' => '▇', - 'i' => '█', - 'j' => '▏', - 'k' => '▎', - 'l' => '▍', - 'm' => '▌', - 'n' => '▋', - 'o' => '▊', - 'p' => '▉', - 'q' => '┼', - 'r' => '┴', - 's' => '┬', - 't' => '┤', - 'u' => '├', - 'v' => '▔', - 'w' => '─', - 'x' => '│', - 'y' => '▕', - 'z' => '┌', - '{' => '┐', - '|' => '└', - '}' => '┘', - '~' => '╭', - '' => '╮', - '' => '╰', - '' => '╯', - '' => '═', - '' => '╞', - '' => '╪', - '' => '╡', - '' => '◢', - '' => '◣', - '' => '◥', - '' => '◤', - '' => '╱', - '' => '╲', - '' => '╳', - '' => '0', - '' => '1', - '' => '2', - '' => '3', - '' => '4', - '' => '5', - '' => '6', - '' => '7', - '' => '8', - '' => '9', - '' => 'Ⅰ', - '' => 'Ⅱ', - '' => 'Ⅲ', - '' => 'Ⅳ', - '' => 'Ⅴ', - '' => 'Ⅵ', - '' => 'Ⅶ', - '' => 'Ⅷ', - '' => 'Ⅸ', - '' => 'Ⅹ', - '' => '〡', - '' => '〢', - '' => '〣', - '' => '〤', - '' => '〥', - '' => '〦', - '' => '〧', - '' => '〨', - '' => '〩', - '' => '�', - '' => '卄', - '' => '�', - '' => 'A', - '' => 'B', - '' => 'C', - '' => 'D', - '' => 'E', - '' => 'F', - '' => 'G', - '' => 'H', - '' => 'I', - '' => 'J', - '' => 'K', - '' => 'L', - '' => 'M', - '' => 'N', - '' => 'O', - '' => 'P', - '' => 'Q', - '' => 'R', - '' => 'S', - '' => 'T', - '' => 'U', - '' => 'V', - '' => 'W', - '' => 'X', - '' => 'Y', - '' => 'Z', - '' => 'a', - '' => 'b', - '' => 'c', - '' => 'd', - '' => 'e', - '' => 'f', - '' => 'g', - '' => 'h', - '' => 'i', - '' => 'j', - '' => 'k', - '' => 'l', - '' => 'm', - '' => 'n', - '' => 'o', - '' => 'p', - '' => 'q', - '' => 'r', - '' => 's', - '' => 't', - '' => 'u', - '' => 'v', - '@' => 'w', - 'A' => 'x', - 'B' => 'y', - 'C' => 'z', - 'D' => 'Α', - 'E' => 'Β', - 'F' => 'Γ', - 'G' => 'Δ', - 'H' => 'Ε', - 'I' => 'Ζ', - 'J' => 'Η', - 'K' => 'Θ', - 'L' => 'Ι', - 'M' => 'Κ', - 'N' => 'Λ', - 'O' => 'Μ', - 'P' => 'Ν', - 'Q' => 'Ξ', - 'R' => 'Ο', - 'S' => 'Π', - 'T' => 'Ρ', - 'U' => 'Σ', - 'V' => 'Τ', - 'W' => 'Υ', - 'X' => 'Φ', - 'Y' => 'Χ', - 'Z' => 'Ψ', - '[' => 'Ω', - '\\' => 'α', - ']' => 'β', - '^' => 'γ', - '_' => 'δ', - '`' => 'ε', - 'a' => 'ζ', - 'b' => 'η', - 'c' => 'θ', - 'd' => 'ι', - 'e' => 'κ', - 'f' => 'λ', - 'g' => 'μ', - 'h' => 'ν', - 'i' => 'ξ', - 'j' => 'ο', - 'k' => 'π', - 'l' => 'ρ', - 'm' => 'σ', - 'n' => 'τ', - 'o' => 'υ', - 'p' => 'φ', - 'q' => 'χ', - 'r' => 'ψ', - 's' => 'ω', - 't' => 'ㄅ', - 'u' => 'ㄆ', - 'v' => 'ㄇ', - 'w' => 'ㄈ', - 'x' => 'ㄉ', - 'y' => 'ㄊ', - 'z' => 'ㄋ', - '{' => 'ㄌ', - '|' => 'ㄍ', - '}' => 'ㄎ', - '~' => 'ㄏ', - '' => 'ㄐ', - '' => 'ㄑ', - '' => 'ㄒ', - '' => 'ㄓ', - '' => 'ㄔ', - '' => 'ㄕ', - '' => 'ㄖ', - '' => 'ㄗ', - '' => 'ㄘ', - '' => 'ㄙ', - '' => 'ㄚ', - '' => 'ㄛ', - '' => 'ㄜ', - '' => 'ㄝ', - '' => 'ㄞ', - '' => 'ㄟ', - '' => 'ㄠ', - '' => 'ㄡ', - '' => 'ㄢ', - '' => 'ㄣ', - '' => 'ㄤ', - '' => 'ㄥ', - '' => 'ㄦ', - '' => 'ㄧ', - '' => 'ㄨ', - '' => 'ㄩ', - '' => '˙', - '' => 'ˉ', - '' => 'ˊ', - '' => 'ˇ', - '' => 'ˋ', - '@' => '一', - 'A' => '乙', - 'B' => '丁', - 'C' => '七', - 'D' => '乃', - 'E' => '九', - 'F' => '了', - 'G' => '二', - 'H' => '人', - 'I' => '儿', - 'J' => '入', - 'K' => '八', - 'L' => '几', - 'M' => '刀', - 'N' => '刁', - 'O' => '力', - 'P' => '匕', - 'Q' => '十', - 'R' => '卜', - 'S' => '又', - 'T' => '三', - 'U' => '下', - 'V' => '丈', - 'W' => '上', - 'X' => '丫', - 'Y' => '丸', - 'Z' => '凡', - '[' => '久', - '\\' => '么', - ']' => '也', - '^' => '乞', - '_' => '于', - '`' => '亡', - 'a' => '兀', - 'b' => '刃', - 'c' => '勺', - 'd' => '千', - 'e' => '叉', - 'f' => '口', - 'g' => '土', - 'h' => '士', - 'i' => '夕', - 'j' => '大', - 'k' => '女', - 'l' => '子', - 'm' => '孑', - 'n' => '孓', - 'o' => '寸', - 'p' => '小', - 'q' => '尢', - 'r' => '尸', - 's' => '山', - 't' => '川', - 'u' => '工', - 'v' => '己', - 'w' => '已', - 'x' => '巳', - 'y' => '巾', - 'z' => '干', - '{' => '廾', - '|' => '弋', - '}' => '弓', - '~' => '才', - '' => '丑', - '' => '丐', - '' => '不', - '' => '中', - '' => '丰', - '' => '丹', - '' => '之', - '' => '尹', - '' => '予', - '' => '云', - '' => '井', - '' => '互', - '' => '五', - '' => '亢', - '' => '仁', - '' => '什', - '' => '仃', - '' => '仆', - '' => '仇', - '' => '仍', - '' => '今', - '' => '介', - '' => '仄', - '' => '元', - '' => '允', - '' => '內', - '' => '六', - '' => '兮', - '' => '公', - '' => '冗', - '' => '凶', - '' => '分', - '' => '切', - '' => '刈', - '' => '勻', - '' => '勾', - '' => '勿', - '' => '化', - '' => '匹', - '' => '午', - '' => '升', - '' => '卅', - '' => '卞', - '' => '厄', - '' => '友', - '' => '及', - '' => '反', - '' => '壬', - '' => '天', - '' => '夫', - '' => '太', - '' => '夭', - '' => '孔', - '' => '少', - '' => '尤', - '' => '尺', - '' => '屯', - '' => '巴', - '' => '幻', - '' => '廿', - '' => '弔', - '' => '引', - '' => '心', - '' => '戈', - '' => '戶', - '' => '手', - '' => '扎', - '' => '支', - '' => '文', - '' => '斗', - '' => '斤', - '' => '方', - '' => '日', - '' => '曰', - '' => '月', - '' => '木', - '' => '欠', - '' => '止', - '' => '歹', - '' => '毋', - '' => '比', - '' => '毛', - '' => '氏', - '' => '水', - '' => '火', - '' => '爪', - '' => '父', - '' => '爻', - '' => '片', - '' => '牙', - '' => '牛', - '' => '犬', - '' => '王', - '' => '丙', - '@' => '世', - 'A' => '丕', - 'B' => '且', - 'C' => '丘', - 'D' => '主', - 'E' => '乍', - 'F' => '乏', - 'G' => '乎', - 'H' => '以', - 'I' => '付', - 'J' => '仔', - 'K' => '仕', - 'L' => '他', - 'M' => '仗', - 'N' => '代', - 'O' => '令', - 'P' => '仙', - 'Q' => '仞', - 'R' => '充', - 'S' => '兄', - 'T' => '冉', - 'U' => '冊', - 'V' => '冬', - 'W' => '凹', - 'X' => '出', - 'Y' => '凸', - 'Z' => '刊', - '[' => '加', - '\\' => '功', - ']' => '包', - '^' => '匆', - '_' => '北', - '`' => '匝', - 'a' => '仟', - 'b' => '半', - 'c' => '卉', - 'd' => '卡', - 'e' => '占', - 'f' => '卯', - 'g' => '卮', - 'h' => '去', - 'i' => '可', - 'j' => '古', - 'k' => '右', - 'l' => '召', - 'm' => '叮', - 'n' => '叩', - 'o' => '叨', - 'p' => '叼', - 'q' => '司', - 'r' => '叵', - 's' => '叫', - 't' => '另', - 'u' => '只', - 'v' => '史', - 'w' => '叱', - 'x' => '台', - 'y' => '句', - 'z' => '叭', - '{' => '叻', - '|' => '四', - '}' => '囚', - '~' => '外', - '' => '央', - '' => '失', - '' => '奴', - '' => '奶', - '' => '孕', - '' => '它', - '' => '尼', - '' => '巨', - '' => '巧', - '' => '左', - '' => '市', - '' => '布', - '' => '平', - '' => '幼', - '' => '弁', - '' => '弘', - '' => '弗', - '' => '必', - '' => '戊', - '' => '打', - '' => '扔', - '' => '扒', - '' => '扑', - '' => '斥', - '' => '旦', - '' => '朮', - '' => '本', - '' => '未', - '' => '末', - '' => '札', - '' => '正', - '' => '母', - '' => '民', - '' => '氐', - '' => '永', - '' => '汁', - '' => '汀', - '' => '氾', - '' => '犯', - '' => '玄', - '' => '玉', - '' => '瓜', - '' => '瓦', - '' => '甘', - '' => '生', - '' => '用', - '' => '甩', - '' => '田', - '' => '由', - '' => '甲', - '' => '申', - '' => '疋', - '' => '白', - '' => '皮', - '' => '皿', - '' => '目', - '' => '矛', - '' => '矢', - '' => '石', - '' => '示', - '' => '禾', - '' => '穴', - '' => '立', - '' => '丞', - '' => '丟', - '' => '乒', - '' => '乓', - '' => '乩', - '' => '亙', - '' => '交', - '' => '亦', - '' => '亥', - '' => '仿', - '' => '伉', - '' => '伙', - '' => '伊', - '' => '伕', - '' => '伍', - '' => '伐', - '' => '休', - '' => '伏', - '' => '仲', - '' => '件', - '' => '任', - '' => '仰', - '' => '仳', - '' => '份', - '' => '企', - '' => '伋', - '' => '光', - '' => '兇', - '' => '兆', - '' => '先', - '' => '全', - '@' => '共', - 'A' => '再', - 'B' => '冰', - 'C' => '列', - 'D' => '刑', - 'E' => '划', - 'F' => '刎', - 'G' => '刖', - 'H' => '劣', - 'I' => '匈', - 'J' => '匡', - 'K' => '匠', - 'L' => '印', - 'M' => '危', - 'N' => '吉', - 'O' => '吏', - 'P' => '同', - 'Q' => '吊', - 'R' => '吐', - 'S' => '吁', - 'T' => '吋', - 'U' => '各', - 'V' => '向', - 'W' => '名', - 'X' => '合', - 'Y' => '吃', - 'Z' => '后', - '[' => '吆', - '\\' => '吒', - ']' => '因', - '^' => '回', - '_' => '囝', - '`' => '圳', - 'a' => '地', - 'b' => '在', - 'c' => '圭', - 'd' => '圬', - 'e' => '圯', - 'f' => '圩', - 'g' => '夙', - 'h' => '多', - 'i' => '夷', - 'j' => '夸', - 'k' => '妄', - 'l' => '奸', - 'm' => '妃', - 'n' => '好', - 'o' => '她', - 'p' => '如', - 'q' => '妁', - 'r' => '字', - 's' => '存', - 't' => '宇', - 'u' => '守', - 'v' => '宅', - 'w' => '安', - 'x' => '寺', - 'y' => '尖', - 'z' => '屹', - '{' => '州', - '|' => '帆', - '}' => '并', - '~' => '年', - '' => '式', - '' => '弛', - '' => '忙', - '' => '忖', - '' => '戎', - '' => '戌', - '' => '戍', - '' => '成', - '' => '扣', - '' => '扛', - '' => '托', - '' => '收', - '' => '早', - '' => '旨', - '' => '旬', - '' => '旭', - '' => '曲', - '' => '曳', - '' => '有', - '' => '朽', - '' => '朴', - '' => '朱', - '' => '朵', - '' => '次', - '' => '此', - '' => '死', - '' => '氖', - '' => '汝', - '' => '汗', - '' => '汙', - '' => '江', - '' => '池', - '' => '汐', - '' => '汕', - '' => '污', - '' => '汛', - '' => '汍', - '' => '汎', - '' => '灰', - '' => '牟', - '' => '牝', - '' => '百', - '' => '竹', - '' => '米', - '' => '糸', - '' => '缶', - '' => '羊', - '' => '羽', - '' => '老', - '' => '考', - '' => '而', - '' => '耒', - '' => '耳', - '' => '聿', - '' => '肉', - '' => '肋', - '' => '肌', - '' => '臣', - '' => '自', - '' => '至', - '' => '臼', - '' => '舌', - '' => '舛', - '' => '舟', - '' => '艮', - '' => '色', - '' => '艾', - '' => '虫', - '' => '血', - '' => '行', - '' => '衣', - '' => '西', - '' => '阡', - '' => '串', - '' => '亨', - '' => '位', - '' => '住', - '' => '佇', - '' => '佗', - '' => '佞', - '' => '伴', - '' => '佛', - '' => '何', - '' => '估', - '' => '佐', - '' => '佑', - '' => '伽', - '' => '伺', - '' => '伸', - '' => '佃', - '' => '佔', - '' => '似', - '' => '但', - '' => '佣', - '@' => '作', - 'A' => '你', - 'B' => '伯', - 'C' => '低', - 'D' => '伶', - 'E' => '余', - 'F' => '佝', - 'G' => '佈', - 'H' => '佚', - 'I' => '兌', - 'J' => '克', - 'K' => '免', - 'L' => '兵', - 'M' => '冶', - 'N' => '冷', - 'O' => '別', - 'P' => '判', - 'Q' => '利', - 'R' => '刪', - 'S' => '刨', - 'T' => '劫', - 'U' => '助', - 'V' => '努', - 'W' => '劬', - 'X' => '匣', - 'Y' => '即', - 'Z' => '卵', - '[' => '吝', - '\\' => '吭', - ']' => '吞', - '^' => '吾', - '_' => '否', - '`' => '呎', - 'a' => '吧', - 'b' => '呆', - 'c' => '呃', - 'd' => '吳', - 'e' => '呈', - 'f' => '呂', - 'g' => '君', - 'h' => '吩', - 'i' => '告', - 'j' => '吹', - 'k' => '吻', - 'l' => '吸', - 'm' => '吮', - 'n' => '吵', - 'o' => '吶', - 'p' => '吠', - 'q' => '吼', - 'r' => '呀', - 's' => '吱', - 't' => '含', - 'u' => '吟', - 'v' => '听', - 'w' => '囪', - 'x' => '困', - 'y' => '囤', - 'z' => '囫', - '{' => '坊', - '|' => '坑', - '}' => '址', - '~' => '坍', - '' => '均', - '' => '坎', - '' => '圾', - '' => '坐', - '' => '坏', - '' => '圻', - '' => '壯', - '' => '夾', - '' => '妝', - '' => '妒', - '' => '妨', - '' => '妞', - '' => '妣', - '' => '妙', - '' => '妖', - '' => '妍', - '' => '妤', - '' => '妓', - '' => '妊', - '' => '妥', - '' => '孝', - '' => '孜', - '' => '孚', - '' => '孛', - '' => '完', - '' => '宋', - '' => '宏', - '' => '尬', - '' => '局', - '' => '屁', - '' => '尿', - '' => '尾', - '' => '岐', - '' => '岑', - '' => '岔', - '' => '岌', - '' => '巫', - '' => '希', - '' => '序', - '' => '庇', - '' => '床', - '' => '廷', - '' => '弄', - '' => '弟', - '' => '彤', - '' => '形', - '' => '彷', - '' => '役', - '' => '忘', - '' => '忌', - '' => '志', - '' => '忍', - '' => '忱', - '' => '快', - '' => '忸', - '' => '忪', - '' => '戒', - '' => '我', - '' => '抄', - '' => '抗', - '' => '抖', - '' => '技', - '' => '扶', - '' => '抉', - '' => '扭', - '' => '把', - '' => '扼', - '' => '找', - '' => '批', - '' => '扳', - '' => '抒', - '' => '扯', - '' => '折', - '' => '扮', - '' => '投', - '' => '抓', - '' => '抑', - '' => '抆', - '' => '改', - '' => '攻', - '' => '攸', - '' => '旱', - '' => '更', - '' => '束', - '' => '李', - '' => '杏', - '' => '材', - '' => '村', - '' => '杜', - '' => '杖', - '' => '杞', - '' => '杉', - '' => '杆', - '' => '杠', - '@' => '杓', - 'A' => '杗', - 'B' => '步', - 'C' => '每', - 'D' => '求', - 'E' => '汞', - 'F' => '沙', - 'G' => '沁', - 'H' => '沈', - 'I' => '沉', - 'J' => '沅', - 'K' => '沛', - 'L' => '汪', - 'M' => '決', - 'N' => '沐', - 'O' => '汰', - 'P' => '沌', - 'Q' => '汨', - 'R' => '沖', - 'S' => '沒', - 'T' => '汽', - 'U' => '沃', - 'V' => '汲', - 'W' => '汾', - 'X' => '汴', - 'Y' => '沆', - 'Z' => '汶', - '[' => '沍', - '\\' => '沔', - ']' => '沘', - '^' => '沂', - '_' => '灶', - '`' => '灼', - 'a' => '災', - 'b' => '灸', - 'c' => '牢', - 'd' => '牡', - 'e' => '牠', - 'f' => '狄', - 'g' => '狂', - 'h' => '玖', - 'i' => '甬', - 'j' => '甫', - 'k' => '男', - 'l' => '甸', - 'm' => '皂', - 'n' => '盯', - 'o' => '矣', - 'p' => '私', - 'q' => '秀', - 'r' => '禿', - 's' => '究', - 't' => '系', - 'u' => '罕', - 'v' => '肖', - 'w' => '肓', - 'x' => '肝', - 'y' => '肘', - 'z' => '肛', - '{' => '肚', - '|' => '育', - '}' => '良', - '~' => '芒', - '' => '芋', - '' => '芍', - '' => '見', - '' => '角', - '' => '言', - '' => '谷', - '' => '豆', - '' => '豕', - '' => '貝', - '' => '赤', - '' => '走', - '' => '足', - '' => '身', - '' => '車', - '' => '辛', - '' => '辰', - '' => '迂', - '' => '迆', - '' => '迅', - '' => '迄', - '' => '巡', - '' => '邑', - '' => '邢', - '' => '邪', - '' => '邦', - '' => '那', - '' => '酉', - '' => '釆', - '' => '里', - '' => '防', - '' => '阮', - '' => '阱', - '' => '阪', - '' => '阬', - '' => '並', - '' => '乖', - '' => '乳', - '' => '事', - '' => '些', - '' => '亞', - '' => '享', - '' => '京', - '' => '佯', - '' => '依', - '' => '侍', - '' => '佳', - '' => '使', - '' => '佬', - '' => '供', - '' => '例', - '' => '來', - '' => '侃', - '' => '佰', - '' => '併', - '' => '侈', - '' => '佩', - '' => '佻', - '' => '侖', - '' => '佾', - '' => '侏', - '' => '侑', - '' => '佺', - '' => '兔', - '' => '兒', - '' => '兕', - '' => '兩', - '' => '具', - '' => '其', - '' => '典', - '' => '冽', - '' => '函', - '' => '刻', - '' => '券', - '' => '刷', - '' => '刺', - '' => '到', - '' => '刮', - '' => '制', - '' => '剁', - '' => '劾', - '' => '劻', - '' => '卒', - '' => '協', - '' => '卓', - '' => '卑', - '' => '卦', - '' => '卷', - '' => '卸', - '' => '卹', - '' => '取', - '' => '叔', - '' => '受', - '' => '味', - '' => '呵', - '@' => '咖', - 'A' => '呸', - 'B' => '咕', - 'C' => '咀', - 'D' => '呻', - 'E' => '呷', - 'F' => '咄', - 'G' => '咒', - 'H' => '咆', - 'I' => '呼', - 'J' => '咐', - 'K' => '呱', - 'L' => '呶', - 'M' => '和', - 'N' => '咚', - 'O' => '呢', - 'P' => '周', - 'Q' => '咋', - 'R' => '命', - 'S' => '咎', - 'T' => '固', - 'U' => '垃', - 'V' => '坷', - 'W' => '坪', - 'X' => '坩', - 'Y' => '坡', - 'Z' => '坦', - '[' => '坤', - '\\' => '坼', - ']' => '夜', - '^' => '奉', - '_' => '奇', - '`' => '奈', - 'a' => '奄', - 'b' => '奔', - 'c' => '妾', - 'd' => '妻', - 'e' => '委', - 'f' => '妹', - 'g' => '妮', - 'h' => '姑', - 'i' => '姆', - 'j' => '姐', - 'k' => '姍', - 'l' => '始', - 'm' => '姓', - 'n' => '姊', - 'o' => '妯', - 'p' => '妳', - 'q' => '姒', - 'r' => '姅', - 's' => '孟', - 't' => '孤', - 'u' => '季', - 'v' => '宗', - 'w' => '定', - 'x' => '官', - 'y' => '宜', - 'z' => '宙', - '{' => '宛', - '|' => '尚', - '}' => '屈', - '~' => '居', - '' => '屆', - '' => '岷', - '' => '岡', - '' => '岸', - '' => '岩', - '' => '岫', - '' => '岱', - '' => '岳', - '' => '帘', - '' => '帚', - '' => '帖', - '' => '帕', - '' => '帛', - '' => '帑', - '' => '幸', - '' => '庚', - '' => '店', - '' => '府', - '' => '底', - '' => '庖', - '' => '延', - '' => '弦', - '' => '弧', - '' => '弩', - '' => '往', - '' => '征', - '' => '彿', - '' => '彼', - '' => '忝', - '' => '忠', - '' => '忽', - '' => '念', - '' => '忿', - '' => '怏', - '' => '怔', - '' => '怯', - '' => '怵', - '' => '怖', - '' => '怪', - '' => '怕', - '' => '怡', - '' => '性', - '' => '怩', - '' => '怫', - '' => '怛', - '' => '或', - '' => '戕', - '' => '房', - '' => '戾', - '' => '所', - '' => '承', - '' => '拉', - '' => '拌', - '' => '拄', - '' => '抿', - '' => '拂', - '' => '抹', - '' => '拒', - '' => '招', - '' => '披', - '' => '拓', - '' => '拔', - '' => '拋', - '' => '拈', - '' => '抨', - '' => '抽', - '' => '押', - '' => '拐', - '' => '拙', - '' => '拇', - '' => '拍', - '' => '抵', - '' => '拚', - '' => '抱', - '' => '拘', - '' => '拖', - '' => '拗', - '' => '拆', - '' => '抬', - '' => '拎', - '' => '放', - '' => '斧', - '' => '於', - '' => '旺', - '' => '昔', - '' => '易', - '' => '昌', - '' => '昆', - '' => '昂', - '' => '明', - '' => '昀', - '' => '昏', - '' => '昕', - '' => '昊', - '@' => '昇', - 'A' => '服', - 'B' => '朋', - 'C' => '杭', - 'D' => '枋', - 'E' => '枕', - 'F' => '東', - 'G' => '果', - 'H' => '杳', - 'I' => '杷', - 'J' => '枇', - 'K' => '枝', - 'L' => '林', - 'M' => '杯', - 'N' => '杰', - 'O' => '板', - 'P' => '枉', - 'Q' => '松', - 'R' => '析', - 'S' => '杵', - 'T' => '枚', - 'U' => '枓', - 'V' => '杼', - 'W' => '杪', - 'X' => '杲', - 'Y' => '欣', - 'Z' => '武', - '[' => '歧', - '\\' => '歿', - ']' => '氓', - '^' => '氛', - '_' => '泣', - '`' => '注', - 'a' => '泳', - 'b' => '沱', - 'c' => '泌', - 'd' => '泥', - 'e' => '河', - 'f' => '沽', - 'g' => '沾', - 'h' => '沼', - 'i' => '波', - 'j' => '沫', - 'k' => '法', - 'l' => '泓', - 'm' => '沸', - 'n' => '泄', - 'o' => '油', - 'p' => '況', - 'q' => '沮', - 'r' => '泗', - 's' => '泅', - 't' => '泱', - 'u' => '沿', - 'v' => '治', - 'w' => '泡', - 'x' => '泛', - 'y' => '泊', - 'z' => '沬', - '{' => '泯', - '|' => '泜', - '}' => '泖', - '~' => '泠', - '' => '炕', - '' => '炎', - '' => '炒', - '' => '炊', - '' => '炙', - '' => '爬', - '' => '爭', - '' => '爸', - '' => '版', - '' => '牧', - '' => '物', - '' => '狀', - '' => '狎', - '' => '狙', - '' => '狗', - '' => '狐', - '' => '玩', - '' => '玨', - '' => '玟', - '' => '玫', - '' => '玥', - '' => '甽', - '' => '疝', - '' => '疙', - '' => '疚', - '' => '的', - '' => '盂', - '' => '盲', - '' => '直', - '' => '知', - '' => '矽', - '' => '社', - '' => '祀', - '' => '祁', - '' => '秉', - '' => '秈', - '' => '空', - '' => '穹', - '' => '竺', - '' => '糾', - '' => '罔', - '' => '羌', - '' => '羋', - '' => '者', - '' => '肺', - '' => '肥', - '' => '肢', - '' => '肱', - '' => '股', - '' => '肫', - '' => '肩', - '' => '肴', - '' => '肪', - '' => '肯', - '' => '臥', - '' => '臾', - '' => '舍', - '' => '芳', - '' => '芝', - '' => '芙', - '' => '芭', - '' => '芽', - '' => '芟', - '' => '芹', - '' => '花', - '' => '芬', - '' => '芥', - '' => '芯', - '' => '芸', - '' => '芣', - '' => '芰', - '' => '芾', - '' => '芷', - '' => '虎', - '' => '虱', - '' => '初', - '' => '表', - '' => '軋', - '' => '迎', - '' => '返', - '' => '近', - '' => '邵', - '' => '邸', - '' => '邱', - '' => '邶', - '' => '采', - '' => '金', - '' => '長', - '' => '門', - '' => '阜', - '' => '陀', - '' => '阿', - '' => '阻', - '' => '附', - '@' => '陂', - 'A' => '隹', - 'B' => '雨', - 'C' => '青', - 'D' => '非', - 'E' => '亟', - 'F' => '亭', - 'G' => '亮', - 'H' => '信', - 'I' => '侵', - 'J' => '侯', - 'K' => '便', - 'L' => '俠', - 'M' => '俑', - 'N' => '俏', - 'O' => '保', - 'P' => '促', - 'Q' => '侶', - 'R' => '俘', - 'S' => '俟', - 'T' => '俊', - 'U' => '俗', - 'V' => '侮', - 'W' => '俐', - 'X' => '俄', - 'Y' => '係', - 'Z' => '俚', - '[' => '俎', - '\\' => '俞', - ']' => '侷', - '^' => '兗', - '_' => '冒', - '`' => '冑', - 'a' => '冠', - 'b' => '剎', - 'c' => '剃', - 'd' => '削', - 'e' => '前', - 'f' => '剌', - 'g' => '剋', - 'h' => '則', - 'i' => '勇', - 'j' => '勉', - 'k' => '勃', - 'l' => '勁', - 'm' => '匍', - 'n' => '南', - 'o' => '卻', - 'p' => '厚', - 'q' => '叛', - 'r' => '咬', - 's' => '哀', - 't' => '咨', - 'u' => '哎', - 'v' => '哉', - 'w' => '咸', - 'x' => '咦', - 'y' => '咳', - 'z' => '哇', - '{' => '哂', - '|' => '咽', - '}' => '咪', - '~' => '品', - '' => '哄', - '' => '哈', - '' => '咯', - '' => '咫', - '' => '咱', - '' => '咻', - '' => '咩', - '' => '咧', - '' => '咿', - '' => '囿', - '' => '垂', - '' => '型', - '' => '垠', - '' => '垣', - '' => '垢', - '' => '城', - '' => '垮', - '' => '垓', - '' => '奕', - '' => '契', - '' => '奏', - '' => '奎', - '' => '奐', - '' => '姜', - '' => '姘', - '' => '姿', - '' => '姣', - '' => '姨', - '' => '娃', - '' => '姥', - '' => '姪', - '' => '姚', - '' => '姦', - '' => '威', - '' => '姻', - '' => '孩', - '' => '宣', - '' => '宦', - '' => '室', - '' => '客', - '' => '宥', - '' => '封', - '' => '屎', - '' => '屏', - '' => '屍', - '' => '屋', - '' => '峙', - '' => '峒', - '' => '巷', - '' => '帝', - '' => '帥', - '' => '帟', - '' => '幽', - '' => '庠', - '' => '度', - '' => '建', - '' => '弈', - '' => '弭', - '' => '彥', - '' => '很', - '' => '待', - '' => '徊', - '' => '律', - '' => '徇', - '' => '後', - '' => '徉', - '' => '怒', - '' => '思', - '' => '怠', - '' => '急', - '' => '怎', - '' => '怨', - '' => '恍', - '' => '恰', - '' => '恨', - '' => '恢', - '' => '恆', - '' => '恃', - '' => '恬', - '' => '恫', - '' => '恪', - '' => '恤', - '' => '扁', - '' => '拜', - '' => '挖', - '' => '按', - '' => '拼', - '' => '拭', - '' => '持', - '' => '拮', - '' => '拽', - '' => '指', - '' => '拱', - '' => '拷', - '@' => '拯', - 'A' => '括', - 'B' => '拾', - 'C' => '拴', - 'D' => '挑', - 'E' => '挂', - 'F' => '政', - 'G' => '故', - 'H' => '斫', - 'I' => '施', - 'J' => '既', - 'K' => '春', - 'L' => '昭', - 'M' => '映', - 'N' => '昧', - 'O' => '是', - 'P' => '星', - 'Q' => '昨', - 'R' => '昱', - 'S' => '昤', - 'T' => '曷', - 'U' => '柿', - 'V' => '染', - 'W' => '柱', - 'X' => '柔', - 'Y' => '某', - 'Z' => '柬', - '[' => '架', - '\\' => '枯', - ']' => '柵', - '^' => '柩', - '_' => '柯', - '`' => '柄', - 'a' => '柑', - 'b' => '枴', - 'c' => '柚', - 'd' => '查', - 'e' => '枸', - 'f' => '柏', - 'g' => '柞', - 'h' => '柳', - 'i' => '枰', - 'j' => '柙', - 'k' => '柢', - 'l' => '柝', - 'm' => '柒', - 'n' => '歪', - 'o' => '殃', - 'p' => '殆', - 'q' => '段', - 'r' => '毒', - 's' => '毗', - 't' => '氟', - 'u' => '泉', - 'v' => '洋', - 'w' => '洲', - 'x' => '洪', - 'y' => '流', - 'z' => '津', - '{' => '洌', - '|' => '洱', - '}' => '洞', - '~' => '洗', - '' => '活', - '' => '洽', - '' => '派', - '' => '洶', - '' => '洛', - '' => '泵', - '' => '洹', - '' => '洧', - '' => '洸', - '' => '洩', - '' => '洮', - '' => '洵', - '' => '洎', - '' => '洫', - '' => '炫', - '' => '為', - '' => '炳', - '' => '炬', - '' => '炯', - '' => '炭', - '' => '炸', - '' => '炮', - '' => '炤', - '' => '爰', - '' => '牲', - '' => '牯', - '' => '牴', - '' => '狩', - '' => '狠', - '' => '狡', - '' => '玷', - '' => '珊', - '' => '玻', - '' => '玲', - '' => '珍', - '' => '珀', - '' => '玳', - '' => '甚', - '' => '甭', - '' => '畏', - '' => '界', - '' => '畎', - '' => '畋', - '' => '疫', - '' => '疤', - '' => '疥', - '' => '疢', - '' => '疣', - '' => '癸', - '' => '皆', - '' => '皇', - '' => '皈', - '' => '盈', - '' => '盆', - '' => '盃', - '' => '盅', - '' => '省', - '' => '盹', - '' => '相', - '' => '眉', - '' => '看', - '' => '盾', - '' => '盼', - '' => '眇', - '' => '矜', - '' => '砂', - '' => '研', - '' => '砌', - '' => '砍', - '' => '祆', - '' => '祉', - '' => '祈', - '' => '祇', - '' => '禹', - '' => '禺', - '' => '科', - '' => '秒', - '' => '秋', - '' => '穿', - '' => '突', - '' => '竿', - '' => '竽', - '' => '籽', - '' => '紂', - '' => '紅', - '' => '紀', - '' => '紉', - '' => '紇', - '' => '約', - '' => '紆', - '' => '缸', - '' => '美', - '' => '羿', - '' => '耄', - '@' => '耐', - 'A' => '耍', - 'B' => '耑', - 'C' => '耶', - 'D' => '胖', - 'E' => '胥', - 'F' => '胚', - 'G' => '胃', - 'H' => '胄', - 'I' => '背', - 'J' => '胡', - 'K' => '胛', - 'L' => '胎', - 'M' => '胞', - 'N' => '胤', - 'O' => '胝', - 'P' => '致', - 'Q' => '舢', - 'R' => '苧', - 'S' => '范', - 'T' => '茅', - 'U' => '苣', - 'V' => '苛', - 'W' => '苦', - 'X' => '茄', - 'Y' => '若', - 'Z' => '茂', - '[' => '茉', - '\\' => '苒', - ']' => '苗', - '^' => '英', - '_' => '茁', - '`' => '苜', - 'a' => '苔', - 'b' => '苑', - 'c' => '苞', - 'd' => '苓', - 'e' => '苟', - 'f' => '苯', - 'g' => '茆', - 'h' => '虐', - 'i' => '虹', - 'j' => '虻', - 'k' => '虺', - 'l' => '衍', - 'm' => '衫', - 'n' => '要', - 'o' => '觔', - 'p' => '計', - 'q' => '訂', - 'r' => '訃', - 's' => '貞', - 't' => '負', - 'u' => '赴', - 'v' => '赳', - 'w' => '趴', - 'x' => '軍', - 'y' => '軌', - 'z' => '述', - '{' => '迦', - '|' => '迢', - '}' => '迪', - '~' => '迥', - '' => '迭', - '' => '迫', - '' => '迤', - '' => '迨', - '' => '郊', - '' => '郎', - '' => '郁', - '' => '郃', - '' => '酋', - '' => '酊', - '' => '重', - '' => '閂', - '' => '限', - '' => '陋', - '' => '陌', - '' => '降', - '' => '面', - '' => '革', - '' => '韋', - '' => '韭', - '' => '音', - '' => '頁', - '' => '風', - '' => '飛', - '' => '食', - '' => '首', - '' => '香', - '' => '乘', - '' => '亳', - '' => '倌', - '' => '倍', - '' => '倣', - '' => '俯', - '' => '倦', - '' => '倥', - '' => '俸', - '' => '倩', - '' => '倖', - '' => '倆', - '' => '值', - '' => '借', - '' => '倚', - '' => '倒', - '' => '們', - '' => '俺', - '' => '倀', - '' => '倔', - '' => '倨', - '' => '俱', - '' => '倡', - '' => '個', - '' => '候', - '' => '倘', - '' => '俳', - '' => '修', - '' => '倭', - '' => '倪', - '' => '俾', - '' => '倫', - '' => '倉', - '' => '兼', - '' => '冤', - '' => '冥', - '' => '冢', - '' => '凍', - '' => '凌', - '' => '准', - '' => '凋', - '' => '剖', - '' => '剜', - '' => '剔', - '' => '剛', - '' => '剝', - '' => '匪', - '' => '卿', - '' => '原', - '' => '厝', - '' => '叟', - '' => '哨', - '' => '唐', - '' => '唁', - '' => '唷', - '' => '哼', - '' => '哥', - '' => '哲', - '' => '唆', - '' => '哺', - '' => '唔', - '' => '哩', - '' => '哭', - '' => '員', - '' => '唉', - '' => '哮', - '' => '哪', - '@' => '哦', - 'A' => '唧', - 'B' => '唇', - 'C' => '哽', - 'D' => '唏', - 'E' => '圃', - 'F' => '圄', - 'G' => '埂', - 'H' => '埔', - 'I' => '埋', - 'J' => '埃', - 'K' => '堉', - 'L' => '夏', - 'M' => '套', - 'N' => '奘', - 'O' => '奚', - 'P' => '娑', - 'Q' => '娘', - 'R' => '娜', - 'S' => '娟', - 'T' => '娛', - 'U' => '娓', - 'V' => '姬', - 'W' => '娠', - 'X' => '娣', - 'Y' => '娩', - 'Z' => '娥', - '[' => '娌', - '\\' => '娉', - ']' => '孫', - '^' => '屘', - '_' => '宰', - '`' => '害', - 'a' => '家', - 'b' => '宴', - 'c' => '宮', - 'd' => '宵', - 'e' => '容', - 'f' => '宸', - 'g' => '射', - 'h' => '屑', - 'i' => '展', - 'j' => '屐', - 'k' => '峭', - 'l' => '峽', - 'm' => '峻', - 'n' => '峪', - 'o' => '峨', - 'p' => '峰', - 'q' => '島', - 'r' => '崁', - 's' => '峴', - 't' => '差', - 'u' => '席', - 'v' => '師', - 'w' => '庫', - 'x' => '庭', - 'y' => '座', - 'z' => '弱', - '{' => '徒', - '|' => '徑', - '}' => '徐', - '~' => '恙', - '' => '恣', - '' => '恥', - '' => '恐', - '' => '恕', - '' => '恭', - '' => '恩', - '' => '息', - '' => '悄', - '' => '悟', - '' => '悚', - '' => '悍', - '' => '悔', - '' => '悌', - '' => '悅', - '' => '悖', - '' => '扇', - '' => '拳', - '' => '挈', - '' => '拿', - '' => '捎', - '' => '挾', - '' => '振', - '' => '捕', - '' => '捂', - '' => '捆', - '' => '捏', - '' => '捉', - '' => '挺', - '' => '捐', - '' => '挽', - '' => '挪', - '' => '挫', - '' => '挨', - '' => '捍', - '' => '捌', - '' => '效', - '' => '敉', - '' => '料', - '' => '旁', - '' => '旅', - '' => '時', - '' => '晉', - '' => '晏', - '' => '晃', - '' => '晒', - '' => '晌', - '' => '晅', - '' => '晁', - '' => '書', - '' => '朔', - '' => '朕', - '' => '朗', - '' => '校', - '' => '核', - '' => '案', - '' => '框', - '' => '桓', - '' => '根', - '' => '桂', - '' => '桔', - '' => '栩', - '' => '梳', - '' => '栗', - '' => '桌', - '' => '桑', - '' => '栽', - '' => '柴', - '' => '桐', - '' => '桀', - '' => '格', - '' => '桃', - '' => '株', - '' => '桅', - '' => '栓', - '' => '栘', - '' => '桁', - '' => '殊', - '' => '殉', - '' => '殷', - '' => '氣', - '' => '氧', - '' => '氨', - '' => '氦', - '' => '氤', - '' => '泰', - '' => '浪', - '' => '涕', - '' => '消', - '' => '涇', - '' => '浦', - '' => '浸', - '' => '海', - '' => '浙', - '' => '涓', - '@' => '浬', - 'A' => '涉', - 'B' => '浮', - 'C' => '浚', - 'D' => '浴', - 'E' => '浩', - 'F' => '涌', - 'G' => '涊', - 'H' => '浹', - 'I' => '涅', - 'J' => '浥', - 'K' => '涔', - 'L' => '烊', - 'M' => '烘', - 'N' => '烤', - 'O' => '烙', - 'P' => '烈', - 'Q' => '烏', - 'R' => '爹', - 'S' => '特', - 'T' => '狼', - 'U' => '狹', - 'V' => '狽', - 'W' => '狸', - 'X' => '狷', - 'Y' => '玆', - 'Z' => '班', - '[' => '琉', - '\\' => '珮', - ']' => '珠', - '^' => '珪', - '_' => '珞', - '`' => '畔', - 'a' => '畝', - 'b' => '畜', - 'c' => '畚', - 'd' => '留', - 'e' => '疾', - 'f' => '病', - 'g' => '症', - 'h' => '疲', - 'i' => '疳', - 'j' => '疽', - 'k' => '疼', - 'l' => '疹', - 'm' => '痂', - 'n' => '疸', - 'o' => '皋', - 'p' => '皰', - 'q' => '益', - 'r' => '盍', - 's' => '盎', - 't' => '眩', - 'u' => '真', - 'v' => '眠', - 'w' => '眨', - 'x' => '矩', - 'y' => '砰', - 'z' => '砧', - '{' => '砸', - '|' => '砝', - '}' => '破', - '~' => '砷', - '' => '砥', - '' => '砭', - '' => '砠', - '' => '砟', - '' => '砲', - '' => '祕', - '' => '祐', - '' => '祠', - '' => '祟', - '' => '祖', - '' => '神', - '' => '祝', - '' => '祗', - '' => '祚', - '' => '秤', - '' => '秣', - '' => '秧', - '' => '租', - '' => '秦', - '' => '秩', - '' => '秘', - '' => '窄', - '' => '窈', - '' => '站', - '' => '笆', - '' => '笑', - '' => '粉', - '' => '紡', - '' => '紗', - '' => '紋', - '' => '紊', - '' => '素', - '' => '索', - '' => '純', - '' => '紐', - '' => '紕', - '' => '級', - '' => '紜', - '' => '納', - '' => '紙', - '' => '紛', - '' => '缺', - '' => '罟', - '' => '羔', - '' => '翅', - '' => '翁', - '' => '耆', - '' => '耘', - '' => '耕', - '' => '耙', - '' => '耗', - '' => '耽', - '' => '耿', - '' => '胱', - '' => '脂', - '' => '胰', - '' => '脅', - '' => '胭', - '' => '胴', - '' => '脆', - '' => '胸', - '' => '胳', - '' => '脈', - '' => '能', - '' => '脊', - '' => '胼', - '' => '胯', - '' => '臭', - '' => '臬', - '' => '舀', - '' => '舐', - '' => '航', - '' => '舫', - '' => '舨', - '' => '般', - '' => '芻', - '' => '茫', - '' => '荒', - '' => '荔', - '' => '荊', - '' => '茸', - '' => '荐', - '' => '草', - '' => '茵', - '' => '茴', - '' => '荏', - '' => '茲', - '' => '茹', - '' => '茶', - '' => '茗', - '' => '荀', - '' => '茱', - '' => '茨', - '' => '荃', - '@' => '虔', - 'A' => '蚊', - 'B' => '蚪', - 'C' => '蚓', - 'D' => '蚤', - 'E' => '蚩', - 'F' => '蚌', - 'G' => '蚣', - 'H' => '蚜', - 'I' => '衰', - 'J' => '衷', - 'K' => '袁', - 'L' => '袂', - 'M' => '衽', - 'N' => '衹', - 'O' => '記', - 'P' => '訐', - 'Q' => '討', - 'R' => '訌', - 'S' => '訕', - 'T' => '訊', - 'U' => '託', - 'V' => '訓', - 'W' => '訖', - 'X' => '訏', - 'Y' => '訑', - 'Z' => '豈', - '[' => '豺', - '\\' => '豹', - ']' => '財', - '^' => '貢', - '_' => '起', - '`' => '躬', - 'a' => '軒', - 'b' => '軔', - 'c' => '軏', - 'd' => '辱', - 'e' => '送', - 'f' => '逆', - 'g' => '迷', - 'h' => '退', - 'i' => '迺', - 'j' => '迴', - 'k' => '逃', - 'l' => '追', - 'm' => '逅', - 'n' => '迸', - 'o' => '邕', - 'p' => '郡', - 'q' => '郝', - 'r' => '郢', - 's' => '酒', - 't' => '配', - 'u' => '酌', - 'v' => '釘', - 'w' => '針', - 'x' => '釗', - 'y' => '釜', - 'z' => '釙', - '{' => '閃', - '|' => '院', - '}' => '陣', - '~' => '陡', - '' => '陛', - '' => '陝', - '' => '除', - '' => '陘', - '' => '陞', - '' => '隻', - '' => '飢', - '' => '馬', - '' => '骨', - '' => '高', - '' => '鬥', - '' => '鬲', - '' => '鬼', - '' => '乾', - '' => '偺', - '' => '偽', - '' => '停', - '' => '假', - '' => '偃', - '' => '偌', - '' => '做', - '' => '偉', - '' => '健', - '' => '偶', - '' => '偎', - '' => '偕', - '' => '偵', - '' => '側', - '' => '偷', - '' => '偏', - '' => '倏', - '' => '偯', - '' => '偭', - '' => '兜', - '' => '冕', - '' => '凰', - '' => '剪', - '' => '副', - '' => '勒', - '' => '務', - '' => '勘', - '' => '動', - '' => '匐', - '' => '匏', - '' => '匙', - '' => '匿', - '' => '區', - '' => '匾', - '' => '參', - '' => '曼', - '' => '商', - '' => '啪', - '' => '啦', - '' => '啄', - '' => '啞', - '' => '啡', - '' => '啃', - '' => '啊', - '' => '唱', - '' => '啖', - '' => '問', - '' => '啕', - '' => '唯', - '' => '啤', - '' => '唸', - '' => '售', - '' => '啜', - '' => '唬', - '' => '啣', - '' => '唳', - '' => '啁', - '' => '啗', - '' => '圈', - '' => '國', - '' => '圉', - '' => '域', - '' => '堅', - '' => '堊', - '' => '堆', - '' => '埠', - '' => '埤', - '' => '基', - '' => '堂', - '' => '堵', - '' => '執', - '' => '培', - '' => '夠', - '' => '奢', - '' => '娶', - '' => '婁', - '' => '婉', - '' => '婦', - '' => '婪', - '' => '婀', - '@' => '娼', - 'A' => '婢', - 'B' => '婚', - 'C' => '婆', - 'D' => '婊', - 'E' => '孰', - 'F' => '寇', - 'G' => '寅', - 'H' => '寄', - 'I' => '寂', - 'J' => '宿', - 'K' => '密', - 'L' => '尉', - 'M' => '專', - 'N' => '將', - 'O' => '屠', - 'P' => '屜', - 'Q' => '屝', - 'R' => '崇', - 'S' => '崆', - 'T' => '崎', - 'U' => '崛', - 'V' => '崖', - 'W' => '崢', - 'X' => '崑', - 'Y' => '崩', - 'Z' => '崔', - '[' => '崙', - '\\' => '崤', - ']' => '崧', - '^' => '崗', - '_' => '巢', - '`' => '常', - 'a' => '帶', - 'b' => '帳', - 'c' => '帷', - 'd' => '康', - 'e' => '庸', - 'f' => '庶', - 'g' => '庵', - 'h' => '庾', - 'i' => '張', - 'j' => '強', - 'k' => '彗', - 'l' => '彬', - 'm' => '彩', - 'n' => '彫', - 'o' => '得', - 'p' => '徙', - 'q' => '從', - 'r' => '徘', - 's' => '御', - 't' => '徠', - 'u' => '徜', - 'v' => '恿', - 'w' => '患', - 'x' => '悉', - 'y' => '悠', - 'z' => '您', - '{' => '惋', - '|' => '悴', - '}' => '惦', - '~' => '悽', - '' => '情', - '' => '悻', - '' => '悵', - '' => '惜', - '' => '悼', - '' => '惘', - '' => '惕', - '' => '惆', - '' => '惟', - '' => '悸', - '' => '惚', - '' => '惇', - '' => '戚', - '' => '戛', - '' => '扈', - '' => '掠', - '' => '控', - '' => '捲', - '' => '掖', - '' => '探', - '' => '接', - '' => '捷', - '' => '捧', - '' => '掘', - '' => '措', - '' => '捱', - '' => '掩', - '' => '掉', - '' => '掃', - '' => '掛', - '' => '捫', - '' => '推', - '' => '掄', - '' => '授', - '' => '掙', - '' => '採', - '' => '掬', - '' => '排', - '' => '掏', - '' => '掀', - '' => '捻', - '' => '捩', - '' => '捨', - '' => '捺', - '' => '敝', - '' => '敖', - '' => '救', - '' => '教', - '' => '敗', - '' => '啟', - '' => '敏', - '' => '敘', - '' => '敕', - '' => '敔', - '' => '斜', - '' => '斛', - '' => '斬', - '' => '族', - '' => '旋', - '' => '旌', - '' => '旎', - '' => '晝', - '' => '晚', - '' => '晤', - '' => '晨', - '' => '晦', - '' => '晞', - '' => '曹', - '' => '勗', - '' => '望', - '' => '梁', - '' => '梯', - '' => '梢', - '' => '梓', - '' => '梵', - '' => '桿', - '' => '桶', - '' => '梱', - '' => '梧', - '' => '梗', - '' => '械', - '' => '梃', - '' => '棄', - '' => '梭', - '' => '梆', - '' => '梅', - '' => '梔', - '' => '條', - '' => '梨', - '' => '梟', - '' => '梡', - '' => '梂', - '' => '欲', - '' => '殺', - '@' => '毫', - 'A' => '毬', - 'B' => '氫', - 'C' => '涎', - 'D' => '涼', - 'E' => '淳', - 'F' => '淙', - 'G' => '液', - 'H' => '淡', - 'I' => '淌', - 'J' => '淤', - 'K' => '添', - 'L' => '淺', - 'M' => '清', - 'N' => '淇', - 'O' => '淋', - 'P' => '涯', - 'Q' => '淑', - 'R' => '涮', - 'S' => '淞', - 'T' => '淹', - 'U' => '涸', - 'V' => '混', - 'W' => '淵', - 'X' => '淅', - 'Y' => '淒', - 'Z' => '渚', - '[' => '涵', - '\\' => '淚', - ']' => '淫', - '^' => '淘', - '_' => '淪', - '`' => '深', - 'a' => '淮', - 'b' => '淨', - 'c' => '淆', - 'd' => '淄', - 'e' => '涪', - 'f' => '淬', - 'g' => '涿', - 'h' => '淦', - 'i' => '烹', - 'j' => '焉', - 'k' => '焊', - 'l' => '烽', - 'm' => '烯', - 'n' => '爽', - 'o' => '牽', - 'p' => '犁', - 'q' => '猜', - 'r' => '猛', - 's' => '猖', - 't' => '猓', - 'u' => '猙', - 'v' => '率', - 'w' => '琅', - 'x' => '琊', - 'y' => '球', - 'z' => '理', - '{' => '現', - '|' => '琍', - '}' => '瓠', - '~' => '瓶', - '' => '瓷', - '' => '甜', - '' => '產', - '' => '略', - '' => '畦', - '' => '畢', - '' => '異', - '' => '疏', - '' => '痔', - '' => '痕', - '' => '疵', - '' => '痊', - '' => '痍', - '' => '皎', - '' => '盔', - '' => '盒', - '' => '盛', - '' => '眷', - '' => '眾', - '' => '眼', - '' => '眶', - '' => '眸', - '' => '眺', - '' => '硫', - '' => '硃', - '' => '硎', - '' => '祥', - '' => '票', - '' => '祭', - '' => '移', - '' => '窒', - '' => '窕', - '' => '笠', - '' => '笨', - '' => '笛', - '' => '第', - '' => '符', - '' => '笙', - '' => '笞', - '' => '笮', - '' => '粒', - '' => '粗', - '' => '粕', - '' => '絆', - '' => '絃', - '' => '統', - '' => '紮', - '' => '紹', - '' => '紼', - '' => '絀', - '' => '細', - '' => '紳', - '' => '組', - '' => '累', - '' => '終', - '' => '紲', - '' => '紱', - '' => '缽', - '' => '羞', - '' => '羚', - '' => '翌', - '' => '翎', - '' => '習', - '' => '耜', - '' => '聊', - '' => '聆', - '' => '脯', - '' => '脖', - '' => '脣', - '' => '脫', - '' => '脩', - '' => '脰', - '' => '脤', - '' => '舂', - '' => '舵', - '' => '舷', - '' => '舶', - '' => '船', - '' => '莎', - '' => '莞', - '' => '莘', - '' => '荸', - '' => '莢', - '' => '莖', - '' => '莽', - '' => '莫', - '' => '莒', - '' => '莊', - '' => '莓', - '' => '莉', - '' => '莠', - '' => '荷', - '' => '荻', - '' => '荼', - '@' => '莆', - 'A' => '莧', - 'B' => '處', - 'C' => '彪', - 'D' => '蛇', - 'E' => '蛀', - 'F' => '蚶', - 'G' => '蛄', - 'H' => '蚵', - 'I' => '蛆', - 'J' => '蛋', - 'K' => '蚱', - 'L' => '蚯', - 'M' => '蛉', - 'N' => '術', - 'O' => '袞', - 'P' => '袈', - 'Q' => '被', - 'R' => '袒', - 'S' => '袖', - 'T' => '袍', - 'U' => '袋', - 'V' => '覓', - 'W' => '規', - 'X' => '訪', - 'Y' => '訝', - 'Z' => '訣', - '[' => '訥', - '\\' => '許', - ']' => '設', - '^' => '訟', - '_' => '訛', - '`' => '訢', - 'a' => '豉', - 'b' => '豚', - 'c' => '販', - 'd' => '責', - 'e' => '貫', - 'f' => '貨', - 'g' => '貪', - 'h' => '貧', - 'i' => '赧', - 'j' => '赦', - 'k' => '趾', - 'l' => '趺', - 'm' => '軛', - 'n' => '軟', - 'o' => '這', - 'p' => '逍', - 'q' => '通', - 'r' => '逗', - 's' => '連', - 't' => '速', - 'u' => '逝', - 'v' => '逐', - 'w' => '逕', - 'x' => '逞', - 'y' => '造', - 'z' => '透', - '{' => '逢', - '|' => '逖', - '}' => '逛', - '~' => '途', - '' => '部', - '' => '郭', - '' => '都', - '' => '酗', - '' => '野', - '' => '釵', - '' => '釦', - '' => '釣', - '' => '釧', - '' => '釭', - '' => '釩', - '' => '閉', - '' => '陪', - '' => '陵', - '' => '陳', - '' => '陸', - '' => '陰', - '' => '陴', - '' => '陶', - '' => '陷', - '' => '陬', - '' => '雀', - '' => '雪', - '' => '雩', - '' => '章', - '' => '竟', - '' => '頂', - '' => '頃', - '' => '魚', - '' => '鳥', - '' => '鹵', - '' => '鹿', - '' => '麥', - '' => '麻', - '' => '傢', - '' => '傍', - '' => '傅', - '' => '備', - '' => '傑', - '' => '傀', - '' => '傖', - '' => '傘', - '' => '傚', - '' => '最', - '' => '凱', - '' => '割', - '' => '剴', - '' => '創', - '' => '剩', - '' => '勞', - '' => '勝', - '' => '勛', - '' => '博', - '' => '厥', - '' => '啻', - '' => '喀', - '' => '喧', - '' => '啼', - '' => '喊', - '' => '喝', - '' => '喘', - '' => '喂', - '' => '喜', - '' => '喪', - '' => '喔', - '' => '喇', - '' => '喋', - '' => '喃', - '' => '喳', - '' => '單', - '' => '喟', - '' => '唾', - '' => '喲', - '' => '喚', - '' => '喻', - '' => '喬', - '' => '喱', - '' => '啾', - '' => '喉', - '' => '喫', - '' => '喙', - '' => '圍', - '' => '堯', - '' => '堪', - '' => '場', - '' => '堤', - '' => '堰', - '' => '報', - '' => '堡', - '' => '堝', - '' => '堠', - '' => '壹', - '' => '壺', - '' => '奠', - '@' => '婷', - 'A' => '媚', - 'B' => '婿', - 'C' => '媒', - 'D' => '媛', - 'E' => '媧', - 'F' => '孳', - 'G' => '孱', - 'H' => '寒', - 'I' => '富', - 'J' => '寓', - 'K' => '寐', - 'L' => '尊', - 'M' => '尋', - 'N' => '就', - 'O' => '嵌', - 'P' => '嵐', - 'Q' => '崴', - 'R' => '嵇', - 'S' => '巽', - 'T' => '幅', - 'U' => '帽', - 'V' => '幀', - 'W' => '幃', - 'X' => '幾', - 'Y' => '廊', - 'Z' => '廁', - '[' => '廂', - '\\' => '廄', - ']' => '弼', - '^' => '彭', - '_' => '復', - '`' => '循', - 'a' => '徨', - 'b' => '惑', - 'c' => '惡', - 'd' => '悲', - 'e' => '悶', - 'f' => '惠', - 'g' => '愜', - 'h' => '愣', - 'i' => '惺', - 'j' => '愕', - 'k' => '惰', - 'l' => '惻', - 'm' => '惴', - 'n' => '慨', - 'o' => '惱', - 'p' => '愎', - 'q' => '惶', - 'r' => '愉', - 's' => '愀', - 't' => '愒', - 'u' => '戟', - 'v' => '扉', - 'w' => '掣', - 'x' => '掌', - 'y' => '描', - 'z' => '揀', - '{' => '揩', - '|' => '揉', - '}' => '揆', - '~' => '揍', - '' => '插', - '' => '揣', - '' => '提', - '' => '握', - '' => '揖', - '' => '揭', - '' => '揮', - '' => '捶', - '' => '援', - '' => '揪', - '' => '換', - '' => '摒', - '' => '揚', - '' => '揹', - '' => '敞', - '' => '敦', - '' => '敢', - '' => '散', - '' => '斑', - '' => '斐', - '' => '斯', - '' => '普', - '' => '晰', - '' => '晴', - '' => '晶', - '' => '景', - '' => '暑', - '' => '智', - '' => '晾', - '' => '晷', - '' => '曾', - '' => '替', - '' => '期', - '' => '朝', - '' => '棺', - '' => '棕', - '' => '棠', - '' => '棘', - '' => '棗', - '' => '椅', - '' => '棟', - '' => '棵', - '' => '森', - '' => '棧', - '' => '棹', - '' => '棒', - '' => '棲', - '' => '棣', - '' => '棋', - '' => '棍', - '' => '植', - '' => '椒', - '' => '椎', - '' => '棉', - '' => '棚', - '' => '楮', - '' => '棻', - '' => '款', - '' => '欺', - '' => '欽', - '' => '殘', - '' => '殖', - '' => '殼', - '' => '毯', - '' => '氮', - '' => '氯', - '' => '氬', - '' => '港', - '' => '游', - '' => '湔', - '' => '渡', - '' => '渲', - '' => '湧', - '' => '湊', - '' => '渠', - '' => '渥', - '' => '渣', - '' => '減', - '' => '湛', - '' => '湘', - '' => '渤', - '' => '湖', - '' => '湮', - '' => '渭', - '' => '渦', - '' => '湯', - '' => '渴', - '' => '湍', - '' => '渺', - '' => '測', - '' => '湃', - '' => '渝', - '' => '渾', - '' => '滋', - '@' => '溉', - 'A' => '渙', - 'B' => '湎', - 'C' => '湣', - 'D' => '湄', - 'E' => '湲', - 'F' => '湩', - 'G' => '湟', - 'H' => '焙', - 'I' => '焚', - 'J' => '焦', - 'K' => '焰', - 'L' => '無', - 'M' => '然', - 'N' => '煮', - 'O' => '焜', - 'P' => '牌', - 'Q' => '犄', - 'R' => '犀', - 'S' => '猶', - 'T' => '猥', - 'U' => '猴', - 'V' => '猩', - 'W' => '琺', - 'X' => '琪', - 'Y' => '琳', - 'Z' => '琢', - '[' => '琥', - '\\' => '琵', - ']' => '琶', - '^' => '琴', - '_' => '琯', - '`' => '琛', - 'a' => '琦', - 'b' => '琨', - 'c' => '甥', - 'd' => '甦', - 'e' => '畫', - 'f' => '番', - 'g' => '痢', - 'h' => '痛', - 'i' => '痣', - 'j' => '痙', - 'k' => '痘', - 'l' => '痞', - 'm' => '痠', - 'n' => '登', - 'o' => '發', - 'p' => '皖', - 'q' => '皓', - 'r' => '皴', - 's' => '盜', - 't' => '睏', - 'u' => '短', - 'v' => '硝', - 'w' => '硬', - 'x' => '硯', - 'y' => '稍', - 'z' => '稈', - '{' => '程', - '|' => '稅', - '}' => '稀', - '~' => '窘', - '' => '窗', - '' => '窖', - '' => '童', - '' => '竣', - '' => '等', - '' => '策', - '' => '筆', - '' => '筐', - '' => '筒', - '' => '答', - '' => '筍', - '' => '筋', - '' => '筏', - '' => '筑', - '' => '粟', - '' => '粥', - '' => '絞', - '' => '結', - '' => '絨', - '' => '絕', - '' => '紫', - '' => '絮', - '' => '絲', - '' => '絡', - '' => '給', - '' => '絢', - '' => '絰', - '' => '絳', - '' => '善', - '' => '翔', - '' => '翕', - '' => '耋', - '' => '聒', - '' => '肅', - '' => '腕', - '' => '腔', - '' => '腋', - '' => '腑', - '' => '腎', - '' => '脹', - '' => '腆', - '' => '脾', - '' => '腌', - '' => '腓', - '' => '腴', - '' => '舒', - '' => '舜', - '' => '菩', - '' => '萃', - '' => '菸', - '' => '萍', - '' => '菠', - '' => '菅', - '' => '萋', - '' => '菁', - '' => '華', - '' => '菱', - '' => '菴', - '' => '著', - '' => '萊', - '' => '菰', - '' => '萌', - '' => '菌', - '' => '菽', - '' => '菲', - '' => '菊', - '' => '萸', - '' => '萎', - '' => '萄', - '' => '菜', - '' => '萇', - '' => '菔', - '' => '菟', - '' => '虛', - '' => '蛟', - '' => '蛙', - '' => '蛭', - '' => '蛔', - '' => '蛛', - '' => '蛤', - '' => '蛐', - '' => '蛞', - '' => '街', - '' => '裁', - '' => '裂', - '' => '袱', - '' => '覃', - '' => '視', - '' => '註', - '' => '詠', - '' => '評', - '' => '詞', - '' => '証', - '' => '詁', - '@' => '詔', - 'A' => '詛', - 'B' => '詐', - 'C' => '詆', - 'D' => '訴', - 'E' => '診', - 'F' => '訶', - 'G' => '詖', - 'H' => '象', - 'I' => '貂', - 'J' => '貯', - 'K' => '貼', - 'L' => '貳', - 'M' => '貽', - 'N' => '賁', - 'O' => '費', - 'P' => '賀', - 'Q' => '貴', - 'R' => '買', - 'S' => '貶', - 'T' => '貿', - 'U' => '貸', - 'V' => '越', - 'W' => '超', - 'X' => '趁', - 'Y' => '跎', - 'Z' => '距', - '[' => '跋', - '\\' => '跚', - ']' => '跑', - '^' => '跌', - '_' => '跛', - '`' => '跆', - 'a' => '軻', - 'b' => '軸', - 'c' => '軼', - 'd' => '辜', - 'e' => '逮', - 'f' => '逵', - 'g' => '週', - 'h' => '逸', - 'i' => '進', - 'j' => '逶', - 'k' => '鄂', - 'l' => '郵', - 'm' => '鄉', - 'n' => '郾', - 'o' => '酣', - 'p' => '酥', - 'q' => '量', - 'r' => '鈔', - 's' => '鈕', - 't' => '鈣', - 'u' => '鈉', - 'v' => '鈞', - 'w' => '鈍', - 'x' => '鈐', - 'y' => '鈇', - 'z' => '鈑', - '{' => '閔', - '|' => '閏', - '}' => '開', - '~' => '閑', - '' => '間', - '' => '閒', - '' => '閎', - '' => '隊', - '' => '階', - '' => '隋', - '' => '陽', - '' => '隅', - '' => '隆', - '' => '隍', - '' => '陲', - '' => '隄', - '' => '雁', - '' => '雅', - '' => '雄', - '' => '集', - '' => '雇', - '' => '雯', - '' => '雲', - '' => '韌', - '' => '項', - '' => '順', - '' => '須', - '' => '飧', - '' => '飪', - '' => '飯', - '' => '飩', - '' => '飲', - '' => '飭', - '' => '馮', - '' => '馭', - '' => '黃', - '' => '黍', - '' => '黑', - '' => '亂', - '' => '傭', - '' => '債', - '' => '傲', - '' => '傳', - '' => '僅', - '' => '傾', - '' => '催', - '' => '傷', - '' => '傻', - '' => '傯', - '' => '僇', - '' => '剿', - '' => '剷', - '' => '剽', - '' => '募', - '' => '勦', - '' => '勤', - '' => '勢', - '' => '勣', - '' => '匯', - '' => '嗟', - '' => '嗨', - '' => '嗓', - '' => '嗦', - '' => '嗎', - '' => '嗜', - '' => '嗇', - '' => '嗑', - '' => '嗣', - '' => '嗤', - '' => '嗯', - '' => '嗚', - '' => '嗡', - '' => '嗅', - '' => '嗆', - '' => '嗥', - '' => '嗉', - '' => '園', - '' => '圓', - '' => '塞', - '' => '塑', - '' => '塘', - '' => '塗', - '' => '塚', - '' => '塔', - '' => '填', - '' => '塌', - '' => '塭', - '' => '塊', - '' => '塢', - '' => '塒', - '' => '塋', - '' => '奧', - '' => '嫁', - '' => '嫉', - '' => '嫌', - '' => '媾', - '' => '媽', - '' => '媼', - '@' => '媳', - 'A' => '嫂', - 'B' => '媲', - 'C' => '嵩', - 'D' => '嵯', - 'E' => '幌', - 'F' => '幹', - 'G' => '廉', - 'H' => '廈', - 'I' => '弒', - 'J' => '彙', - 'K' => '徬', - 'L' => '微', - 'M' => '愚', - 'N' => '意', - 'O' => '慈', - 'P' => '感', - 'Q' => '想', - 'R' => '愛', - 'S' => '惹', - 'T' => '愁', - 'U' => '愈', - 'V' => '慎', - 'W' => '慌', - 'X' => '慄', - 'Y' => '慍', - 'Z' => '愾', - '[' => '愴', - '\\' => '愧', - ']' => '愍', - '^' => '愆', - '_' => '愷', - '`' => '戡', - 'a' => '戢', - 'b' => '搓', - 'c' => '搾', - 'd' => '搞', - 'e' => '搪', - 'f' => '搭', - 'g' => '搽', - 'h' => '搬', - 'i' => '搏', - 'j' => '搜', - 'k' => '搔', - 'l' => '損', - 'm' => '搶', - 'n' => '搖', - 'o' => '搗', - 'p' => '搆', - 'q' => '敬', - 'r' => '斟', - 's' => '新', - 't' => '暗', - 'u' => '暉', - 'v' => '暇', - 'w' => '暈', - 'x' => '暖', - 'y' => '暄', - 'z' => '暘', - '{' => '暍', - '|' => '會', - '}' => '榔', - '~' => '業', - '' => '楚', - '' => '楷', - '' => '楠', - '' => '楔', - '' => '極', - '' => '椰', - '' => '概', - '' => '楊', - '' => '楨', - '' => '楫', - '' => '楞', - '' => '楓', - '' => '楹', - '' => '榆', - '' => '楝', - '' => '楣', - '' => '楛', - '' => '歇', - '' => '歲', - '' => '毀', - '' => '殿', - '' => '毓', - '' => '毽', - '' => '溢', - '' => '溯', - '' => '滓', - '' => '溶', - '' => '滂', - '' => '源', - '' => '溝', - '' => '滇', - '' => '滅', - '' => '溥', - '' => '溘', - '' => '溼', - '' => '溺', - '' => '溫', - '' => '滑', - '' => '準', - '' => '溜', - '' => '滄', - '' => '滔', - '' => '溪', - '' => '溧', - '' => '溴', - '' => '煎', - '' => '煙', - '' => '煩', - '' => '煤', - '' => '煉', - '' => '照', - '' => '煜', - '' => '煬', - '' => '煦', - '' => '煌', - '' => '煥', - '' => '煞', - '' => '煆', - '' => '煨', - '' => '煖', - '' => '爺', - '' => '牒', - '' => '猷', - '' => '獅', - '' => '猿', - '' => '猾', - '' => '瑯', - '' => '瑚', - '' => '瑕', - '' => '瑟', - '' => '瑞', - '' => '瑁', - '' => '琿', - '' => '瑙', - '' => '瑛', - '' => '瑜', - '' => '當', - '' => '畸', - '' => '瘀', - '' => '痰', - '' => '瘁', - '' => '痲', - '' => '痱', - '' => '痺', - '' => '痿', - '' => '痴', - '' => '痳', - '' => '盞', - '' => '盟', - '' => '睛', - '' => '睫', - '' => '睦', - '' => '睞', - '' => '督', - '@' => '睹', - 'A' => '睪', - 'B' => '睬', - 'C' => '睜', - 'D' => '睥', - 'E' => '睨', - 'F' => '睢', - 'G' => '矮', - 'H' => '碎', - 'I' => '碰', - 'J' => '碗', - 'K' => '碘', - 'L' => '碌', - 'M' => '碉', - 'N' => '硼', - 'O' => '碑', - 'P' => '碓', - 'Q' => '硿', - 'R' => '祺', - 'S' => '祿', - 'T' => '禁', - 'U' => '萬', - 'V' => '禽', - 'W' => '稜', - 'X' => '稚', - 'Y' => '稠', - 'Z' => '稔', - '[' => '稟', - '\\' => '稞', - ']' => '窟', - '^' => '窠', - '_' => '筷', - '`' => '節', - 'a' => '筠', - 'b' => '筮', - 'c' => '筧', - 'd' => '粱', - 'e' => '粳', - 'f' => '粵', - 'g' => '經', - 'h' => '絹', - 'i' => '綑', - 'j' => '綁', - 'k' => '綏', - 'l' => '絛', - 'm' => '置', - 'n' => '罩', - 'o' => '罪', - 'p' => '署', - 'q' => '義', - 'r' => '羨', - 's' => '群', - 't' => '聖', - 'u' => '聘', - 'v' => '肆', - 'w' => '肄', - 'x' => '腱', - 'y' => '腰', - 'z' => '腸', - '{' => '腥', - '|' => '腮', - '}' => '腳', - '~' => '腫', - '' => '腹', - '' => '腺', - '' => '腦', - '' => '舅', - '' => '艇', - '' => '蒂', - '' => '葷', - '' => '落', - '' => '萱', - '' => '葵', - '' => '葦', - '' => '葫', - '' => '葉', - '' => '葬', - '' => '葛', - '' => '萼', - '' => '萵', - '' => '葡', - '' => '董', - '' => '葩', - '' => '葭', - '' => '葆', - '' => '虞', - '' => '虜', - '' => '號', - '' => '蛹', - '' => '蜓', - '' => '蜈', - '' => '蜇', - '' => '蜀', - '' => '蛾', - '' => '蛻', - '' => '蜂', - '' => '蜃', - '' => '蜆', - '' => '蜊', - '' => '衙', - '' => '裟', - '' => '裔', - '' => '裙', - '' => '補', - '' => '裘', - '' => '裝', - '' => '裡', - '' => '裊', - '' => '裕', - '' => '裒', - '' => '覜', - '' => '解', - '' => '詫', - '' => '該', - '' => '詳', - '' => '試', - '' => '詩', - '' => '詰', - '' => '誇', - '' => '詼', - '' => '詣', - '' => '誠', - '' => '話', - '' => '誅', - '' => '詭', - '' => '詢', - '' => '詮', - '' => '詬', - '' => '詹', - '' => '詻', - '' => '訾', - '' => '詨', - '' => '豢', - '' => '貊', - '' => '貉', - '' => '賊', - '' => '資', - '' => '賈', - '' => '賄', - '' => '貲', - '' => '賃', - '' => '賂', - '' => '賅', - '' => '跡', - '' => '跟', - '' => '跨', - '' => '路', - '' => '跳', - '' => '跺', - '' => '跪', - '' => '跤', - '' => '跦', - '' => '躲', - '' => '較', - '' => '載', - '' => '軾', - '' => '輊', - '@' => '辟', - 'A' => '農', - 'B' => '運', - 'C' => '遊', - 'D' => '道', - 'E' => '遂', - 'F' => '達', - 'G' => '逼', - 'H' => '違', - 'I' => '遐', - 'J' => '遇', - 'K' => '遏', - 'L' => '過', - 'M' => '遍', - 'N' => '遑', - 'O' => '逾', - 'P' => '遁', - 'Q' => '鄒', - 'R' => '鄗', - 'S' => '酬', - 'T' => '酪', - 'U' => '酩', - 'V' => '釉', - 'W' => '鈷', - 'X' => '鉗', - 'Y' => '鈸', - 'Z' => '鈽', - '[' => '鉀', - '\\' => '鈾', - ']' => '鉛', - '^' => '鉋', - '_' => '鉤', - '`' => '鉑', - 'a' => '鈴', - 'b' => '鉉', - 'c' => '鉍', - 'd' => '鉅', - 'e' => '鈹', - 'f' => '鈿', - 'g' => '鉚', - 'h' => '閘', - 'i' => '隘', - 'j' => '隔', - 'k' => '隕', - 'l' => '雍', - 'm' => '雋', - 'n' => '雉', - 'o' => '雊', - 'p' => '雷', - 'q' => '電', - 'r' => '雹', - 's' => '零', - 't' => '靖', - 'u' => '靴', - 'v' => '靶', - 'w' => '預', - 'x' => '頑', - 'y' => '頓', - 'z' => '頊', - '{' => '頒', - '|' => '頌', - '}' => '飼', - '~' => '飴', - '' => '飽', - '' => '飾', - '' => '馳', - '' => '馱', - '' => '馴', - '' => '髡', - '' => '鳩', - '' => '麂', - '' => '鼎', - '' => '鼓', - '' => '鼠', - '' => '僧', - '' => '僮', - '' => '僥', - '' => '僖', - '' => '僭', - '' => '僚', - '' => '僕', - '' => '像', - '' => '僑', - '' => '僱', - '' => '僎', - '' => '僩', - '' => '兢', - '' => '凳', - '' => '劃', - '' => '劂', - '' => '匱', - '' => '厭', - '' => '嗾', - '' => '嘀', - '' => '嘛', - '' => '嘗', - '' => '嗽', - '' => '嘔', - '' => '嘆', - '' => '嘉', - '' => '嘍', - '' => '嘎', - '' => '嗷', - '' => '嘖', - '' => '嘟', - '' => '嘈', - '' => '嘐', - '' => '嗶', - '' => '團', - '' => '圖', - '' => '塵', - '' => '塾', - '' => '境', - '' => '墓', - '' => '墊', - '' => '塹', - '' => '墅', - '' => '塽', - '' => '壽', - '' => '夥', - '' => '夢', - '' => '夤', - '' => '奪', - '' => '奩', - '' => '嫡', - '' => '嫦', - '' => '嫩', - '' => '嫗', - '' => '嫖', - '' => '嫘', - '' => '嫣', - '' => '孵', - '' => '寞', - '' => '寧', - '' => '寡', - '' => '寥', - '' => '實', - '' => '寨', - '' => '寢', - '' => '寤', - '' => '察', - '' => '對', - '' => '屢', - '' => '嶄', - '' => '嶇', - '' => '幛', - '' => '幣', - '' => '幕', - '' => '幗', - '' => '幔', - '' => '廓', - '' => '廖', - '' => '弊', - '' => '彆', - '' => '彰', - '' => '徹', - '' => '慇', - '@' => '愿', - 'A' => '態', - 'B' => '慷', - 'C' => '慢', - 'D' => '慣', - 'E' => '慟', - 'F' => '慚', - 'G' => '慘', - 'H' => '慵', - 'I' => '截', - 'J' => '撇', - 'K' => '摘', - 'L' => '摔', - 'M' => '撤', - 'N' => '摸', - 'O' => '摟', - 'P' => '摺', - 'Q' => '摑', - 'R' => '摧', - 'S' => '搴', - 'T' => '摭', - 'U' => '摻', - 'V' => '敲', - 'W' => '斡', - 'X' => '旗', - 'Y' => '旖', - 'Z' => '暢', - '[' => '暨', - '\\' => '暝', - ']' => '榜', - '^' => '榨', - '_' => '榕', - '`' => '槁', - 'a' => '榮', - 'b' => '槓', - 'c' => '構', - 'd' => '榛', - 'e' => '榷', - 'f' => '榻', - 'g' => '榫', - 'h' => '榴', - 'i' => '槐', - 'j' => '槍', - 'k' => '榭', - 'l' => '槌', - 'm' => '榦', - 'n' => '槃', - 'o' => '榣', - 'p' => '歉', - 'q' => '歌', - 'r' => '氳', - 's' => '漳', - 't' => '演', - 'u' => '滾', - 'v' => '漓', - 'w' => '滴', - 'x' => '漩', - 'y' => '漾', - 'z' => '漠', - '{' => '漬', - '|' => '漏', - '}' => '漂', - '~' => '漢', - '' => '滿', - '' => '滯', - '' => '漆', - '' => '漱', - '' => '漸', - '' => '漲', - '' => '漣', - '' => '漕', - '' => '漫', - '' => '漯', - '' => '澈', - '' => '漪', - '' => '滬', - '' => '漁', - '' => '滲', - '' => '滌', - '' => '滷', - '' => '熔', - '' => '熙', - '' => '煽', - '' => '熊', - '' => '熄', - '' => '熒', - '' => '爾', - '' => '犒', - '' => '犖', - '' => '獄', - '' => '獐', - '' => '瑤', - '' => '瑣', - '' => '瑪', - '' => '瑰', - '' => '瑭', - '' => '甄', - '' => '疑', - '' => '瘧', - '' => '瘍', - '' => '瘋', - '' => '瘉', - '' => '瘓', - '' => '盡', - '' => '監', - '' => '瞄', - '' => '睽', - '' => '睿', - '' => '睡', - '' => '磁', - '' => '碟', - '' => '碧', - '' => '碳', - '' => '碩', - '' => '碣', - '' => '禎', - '' => '福', - '' => '禍', - '' => '種', - '' => '稱', - '' => '窪', - '' => '窩', - '' => '竭', - '' => '端', - '' => '管', - '' => '箕', - '' => '箋', - '' => '筵', - '' => '算', - '' => '箝', - '' => '箔', - '' => '箏', - '' => '箸', - '' => '箇', - '' => '箄', - '' => '粹', - '' => '粽', - '' => '精', - '' => '綻', - '' => '綰', - '' => '綜', - '' => '綽', - '' => '綾', - '' => '綠', - '' => '緊', - '' => '綴', - '' => '網', - '' => '綱', - '' => '綺', - '' => '綢', - '' => '綿', - '' => '綵', - '' => '綸', - '' => '維', - '' => '緒', - '' => '緇', - '' => '綬', - '@' => '罰', - 'A' => '翠', - 'B' => '翡', - 'C' => '翟', - 'D' => '聞', - 'E' => '聚', - 'F' => '肇', - 'G' => '腐', - 'H' => '膀', - 'I' => '膏', - 'J' => '膈', - 'K' => '膊', - 'L' => '腿', - 'M' => '膂', - 'N' => '臧', - 'O' => '臺', - 'P' => '與', - 'Q' => '舔', - 'R' => '舞', - 'S' => '艋', - 'T' => '蓉', - 'U' => '蒿', - 'V' => '蓆', - 'W' => '蓄', - 'X' => '蒙', - 'Y' => '蒞', - 'Z' => '蒲', - '[' => '蒜', - '\\' => '蓋', - ']' => '蒸', - '^' => '蓀', - '_' => '蓓', - '`' => '蒐', - 'a' => '蒼', - 'b' => '蓑', - 'c' => '蓊', - 'd' => '蜿', - 'e' => '蜜', - 'f' => '蜻', - 'g' => '蜢', - 'h' => '蜥', - 'i' => '蜴', - 'j' => '蜘', - 'k' => '蝕', - 'l' => '蜷', - 'm' => '蜩', - 'n' => '裳', - 'o' => '褂', - 'p' => '裴', - 'q' => '裹', - 'r' => '裸', - 's' => '製', - 't' => '裨', - 'u' => '褚', - 'v' => '裯', - 'w' => '誦', - 'x' => '誌', - 'y' => '語', - 'z' => '誣', - '{' => '認', - '|' => '誡', - '}' => '誓', - '~' => '誤', - '' => '說', - '' => '誥', - '' => '誨', - '' => '誘', - '' => '誑', - '' => '誚', - '' => '誧', - '' => '豪', - '' => '貍', - '' => '貌', - '' => '賓', - '' => '賑', - '' => '賒', - '' => '赫', - '' => '趙', - '' => '趕', - '' => '跼', - '' => '輔', - '' => '輒', - '' => '輕', - '' => '輓', - '' => '辣', - '' => '遠', - '' => '遘', - '' => '遜', - '' => '遣', - '' => '遙', - '' => '遞', - '' => '遢', - '' => '遝', - '' => '遛', - '' => '鄙', - '' => '鄘', - '' => '鄞', - '' => '酵', - '' => '酸', - '' => '酷', - '' => '酴', - '' => '鉸', - '' => '銀', - '' => '銅', - '' => '銘', - '' => '銖', - '' => '鉻', - '' => '銓', - '' => '銜', - '' => '銨', - '' => '鉼', - '' => '銑', - '' => '閡', - '' => '閨', - '' => '閩', - '' => '閣', - '' => '閥', - '' => '閤', - '' => '隙', - '' => '障', - '' => '際', - '' => '雌', - '' => '雒', - '' => '需', - '' => '靼', - '' => '鞅', - '' => '韶', - '' => '頗', - '' => '領', - '' => '颯', - '' => '颱', - '' => '餃', - '' => '餅', - '' => '餌', - '' => '餉', - '' => '駁', - '' => '骯', - '' => '骰', - '' => '髦', - '' => '魁', - '' => '魂', - '' => '鳴', - '' => '鳶', - '' => '鳳', - '' => '麼', - '' => '鼻', - '' => '齊', - '' => '億', - '' => '儀', - '' => '僻', - '' => '僵', - '' => '價', - '' => '儂', - '' => '儈', - '' => '儉', - '' => '儅', - '' => '凜', - '@' => '劇', - 'A' => '劈', - 'B' => '劉', - 'C' => '劍', - 'D' => '劊', - 'E' => '勰', - 'F' => '厲', - 'G' => '嘮', - 'H' => '嘻', - 'I' => '嘹', - 'J' => '嘲', - 'K' => '嘿', - 'L' => '嘴', - 'M' => '嘩', - 'N' => '噓', - 'O' => '噎', - 'P' => '噗', - 'Q' => '噴', - 'R' => '嘶', - 'S' => '嘯', - 'T' => '嘰', - 'U' => '墀', - 'V' => '墟', - 'W' => '增', - 'X' => '墳', - 'Y' => '墜', - 'Z' => '墮', - '[' => '墩', - '\\' => '墦', - ']' => '奭', - '^' => '嬉', - '_' => '嫻', - '`' => '嬋', - 'a' => '嫵', - 'b' => '嬌', - 'c' => '嬈', - 'd' => '寮', - 'e' => '寬', - 'f' => '審', - 'g' => '寫', - 'h' => '層', - 'i' => '履', - 'j' => '嶝', - 'k' => '嶔', - 'l' => '幢', - 'm' => '幟', - 'n' => '幡', - 'o' => '廢', - 'p' => '廚', - 'q' => '廟', - 'r' => '廝', - 's' => '廣', - 't' => '廠', - 'u' => '彈', - 'v' => '影', - 'w' => '德', - 'x' => '徵', - 'y' => '慶', - 'z' => '慧', - '{' => '慮', - '|' => '慝', - '}' => '慕', - '~' => '憂', - '' => '慼', - '' => '慰', - '' => '慫', - '' => '慾', - '' => '憧', - '' => '憐', - '' => '憫', - '' => '憎', - '' => '憬', - '' => '憚', - '' => '憤', - '' => '憔', - '' => '憮', - '' => '戮', - '' => '摩', - '' => '摯', - '' => '摹', - '' => '撞', - '' => '撲', - '' => '撈', - '' => '撐', - '' => '撰', - '' => '撥', - '' => '撓', - '' => '撕', - '' => '撩', - '' => '撒', - '' => '撮', - '' => '播', - '' => '撫', - '' => '撚', - '' => '撬', - '' => '撙', - '' => '撢', - '' => '撳', - '' => '敵', - '' => '敷', - '' => '數', - '' => '暮', - '' => '暫', - '' => '暴', - '' => '暱', - '' => '樣', - '' => '樟', - '' => '槨', - '' => '樁', - '' => '樞', - '' => '標', - '' => '槽', - '' => '模', - '' => '樓', - '' => '樊', - '' => '槳', - '' => '樂', - '' => '樅', - '' => '槭', - '' => '樑', - '' => '歐', - '' => '歎', - '' => '殤', - '' => '毅', - '' => '毆', - '' => '漿', - '' => '潼', - '' => '澄', - '' => '潑', - '' => '潦', - '' => '潔', - '' => '澆', - '' => '潭', - '' => '潛', - '' => '潸', - '' => '潮', - '' => '澎', - '' => '潺', - '' => '潰', - '' => '潤', - '' => '澗', - '' => '潘', - '' => '滕', - '' => '潯', - '' => '潠', - '' => '潟', - '' => '熟', - '' => '熬', - '' => '熱', - '' => '熨', - '' => '牖', - '' => '犛', - '' => '獎', - '' => '獗', - '' => '瑩', - '' => '璋', - '' => '璃', - '@' => '瑾', - 'A' => '璀', - 'B' => '畿', - 'C' => '瘠', - 'D' => '瘩', - 'E' => '瘟', - 'F' => '瘤', - 'G' => '瘦', - 'H' => '瘡', - 'I' => '瘢', - 'J' => '皚', - 'K' => '皺', - 'L' => '盤', - 'M' => '瞎', - 'N' => '瞇', - 'O' => '瞌', - 'P' => '瞑', - 'Q' => '瞋', - 'R' => '磋', - 'S' => '磅', - 'T' => '確', - 'U' => '磊', - 'V' => '碾', - 'W' => '磕', - 'X' => '碼', - 'Y' => '磐', - 'Z' => '稿', - '[' => '稼', - '\\' => '穀', - ']' => '稽', - '^' => '稷', - '_' => '稻', - '`' => '窯', - 'a' => '窮', - 'b' => '箭', - 'c' => '箱', - 'd' => '範', - 'e' => '箴', - 'f' => '篆', - 'g' => '篇', - 'h' => '篁', - 'i' => '箠', - 'j' => '篌', - 'k' => '糊', - 'l' => '締', - 'm' => '練', - 'n' => '緯', - 'o' => '緻', - 'p' => '緘', - 'q' => '緬', - 'r' => '緝', - 's' => '編', - 't' => '緣', - 'u' => '線', - 'v' => '緞', - 'w' => '緩', - 'x' => '綞', - 'y' => '緙', - 'z' => '緲', - '{' => '緹', - '|' => '罵', - '}' => '罷', - '~' => '羯', - '' => '翩', - '' => '耦', - '' => '膛', - '' => '膜', - '' => '膝', - '' => '膠', - '' => '膚', - '' => '膘', - '' => '蔗', - '' => '蔽', - '' => '蔚', - '' => '蓮', - '' => '蔬', - '' => '蔭', - '' => '蔓', - '' => '蔑', - '' => '蔣', - '' => '蔡', - '' => '蔔', - '' => '蓬', - '' => '蔥', - '' => '蓿', - '' => '蔆', - '' => '螂', - '' => '蝴', - '' => '蝶', - '' => '蝠', - '' => '蝦', - '' => '蝸', - '' => '蝨', - '' => '蝙', - '' => '蝗', - '' => '蝌', - '' => '蝓', - '' => '衛', - '' => '衝', - '' => '褐', - '' => '複', - '' => '褒', - '' => '褓', - '' => '褕', - '' => '褊', - '' => '誼', - '' => '諒', - '' => '談', - '' => '諄', - '' => '誕', - '' => '請', - '' => '諸', - '' => '課', - '' => '諉', - '' => '諂', - '' => '調', - '' => '誰', - '' => '論', - '' => '諍', - '' => '誶', - '' => '誹', - '' => '諛', - '' => '豌', - '' => '豎', - '' => '豬', - '' => '賠', - '' => '賞', - '' => '賦', - '' => '賤', - '' => '賬', - '' => '賭', - '' => '賢', - '' => '賣', - '' => '賜', - '' => '質', - '' => '賡', - '' => '赭', - '' => '趟', - '' => '趣', - '' => '踫', - '' => '踐', - '' => '踝', - '' => '踢', - '' => '踏', - '' => '踩', - '' => '踟', - '' => '踡', - '' => '踞', - '' => '躺', - '' => '輝', - '' => '輛', - '' => '輟', - '' => '輩', - '' => '輦', - '' => '輪', - '' => '輜', - '' => '輞', - '@' => '輥', - 'A' => '適', - 'B' => '遮', - 'C' => '遨', - 'D' => '遭', - 'E' => '遷', - 'F' => '鄰', - 'G' => '鄭', - 'H' => '鄧', - 'I' => '鄱', - 'J' => '醇', - 'K' => '醉', - 'L' => '醋', - 'M' => '醃', - 'N' => '鋅', - 'O' => '銻', - 'P' => '銷', - 'Q' => '鋪', - 'R' => '銬', - 'S' => '鋤', - 'T' => '鋁', - 'U' => '銳', - 'V' => '銼', - 'W' => '鋒', - 'X' => '鋇', - 'Y' => '鋰', - 'Z' => '銲', - '[' => '閭', - '\\' => '閱', - ']' => '霄', - '^' => '霆', - '_' => '震', - '`' => '霉', - 'a' => '靠', - 'b' => '鞍', - 'c' => '鞋', - 'd' => '鞏', - 'e' => '頡', - 'f' => '頫', - 'g' => '頜', - 'h' => '颳', - 'i' => '養', - 'j' => '餓', - 'k' => '餒', - 'l' => '餘', - 'm' => '駝', - 'n' => '駐', - 'o' => '駟', - 'p' => '駛', - 'q' => '駑', - 'r' => '駕', - 's' => '駒', - 't' => '駙', - 'u' => '骷', - 'v' => '髮', - 'w' => '髯', - 'x' => '鬧', - 'y' => '魅', - 'z' => '魄', - '{' => '魷', - '|' => '魯', - '}' => '鴆', - '~' => '鴉', - '' => '鴃', - '' => '麩', - '' => '麾', - '' => '黎', - '' => '墨', - '' => '齒', - '' => '儒', - '' => '儘', - '' => '儔', - '' => '儐', - '' => '儕', - '' => '冀', - '' => '冪', - '' => '凝', - '' => '劑', - '' => '劓', - '' => '勳', - '' => '噙', - '' => '噫', - '' => '噹', - '' => '噩', - '' => '噤', - '' => '噸', - '' => '噪', - '' => '器', - '' => '噥', - '' => '噱', - '' => '噯', - '' => '噬', - '' => '噢', - '' => '噶', - '' => '壁', - '' => '墾', - '' => '壇', - '' => '壅', - '' => '奮', - '' => '嬝', - '' => '嬴', - '' => '學', - '' => '寰', - '' => '導', - '' => '彊', - '' => '憲', - '' => '憑', - '' => '憩', - '' => '憊', - '' => '懍', - '' => '憶', - '' => '憾', - '' => '懊', - '' => '懈', - '' => '戰', - '' => '擅', - '' => '擁', - '' => '擋', - '' => '撻', - '' => '撼', - '' => '據', - '' => '擄', - '' => '擇', - '' => '擂', - '' => '操', - '' => '撿', - '' => '擒', - '' => '擔', - '' => '撾', - '' => '整', - '' => '曆', - '' => '曉', - '' => '暹', - '' => '曄', - '' => '曇', - '' => '暸', - '' => '樽', - '' => '樸', - '' => '樺', - '' => '橙', - '' => '橫', - '' => '橘', - '' => '樹', - '' => '橄', - '' => '橢', - '' => '橡', - '' => '橋', - '' => '橇', - '' => '樵', - '' => '機', - '' => '橈', - '' => '歙', - '' => '歷', - '' => '氅', - '' => '濂', - '' => '澱', - '' => '澡', - '@' => '濃', - 'A' => '澤', - 'B' => '濁', - 'C' => '澧', - 'D' => '澳', - 'E' => '激', - 'F' => '澹', - 'G' => '澶', - 'H' => '澦', - 'I' => '澠', - 'J' => '澴', - 'K' => '熾', - 'L' => '燉', - 'M' => '燐', - 'N' => '燒', - 'O' => '燈', - 'P' => '燕', - 'Q' => '熹', - 'R' => '燎', - 'S' => '燙', - 'T' => '燜', - 'U' => '燃', - 'V' => '燄', - 'W' => '獨', - 'X' => '璜', - 'Y' => '璣', - 'Z' => '璘', - '[' => '璟', - '\\' => '璞', - ']' => '瓢', - '^' => '甌', - '_' => '甍', - '`' => '瘴', - 'a' => '瘸', - 'b' => '瘺', - 'c' => '盧', - 'd' => '盥', - 'e' => '瞠', - 'f' => '瞞', - 'g' => '瞟', - 'h' => '瞥', - 'i' => '磨', - 'j' => '磚', - 'k' => '磬', - 'l' => '磧', - 'm' => '禦', - 'n' => '積', - 'o' => '穎', - 'p' => '穆', - 'q' => '穌', - 'r' => '穋', - 's' => '窺', - 't' => '篙', - 'u' => '簑', - 'v' => '築', - 'w' => '篤', - 'x' => '篛', - 'y' => '篡', - 'z' => '篩', - '{' => '篦', - '|' => '糕', - '}' => '糖', - '~' => '縊', - '' => '縑', - '' => '縈', - '' => '縛', - '' => '縣', - '' => '縞', - '' => '縝', - '' => '縉', - '' => '縐', - '' => '罹', - '' => '羲', - '' => '翰', - '' => '翱', - '' => '翮', - '' => '耨', - '' => '膳', - '' => '膩', - '' => '膨', - '' => '臻', - '' => '興', - '' => '艘', - '' => '艙', - '' => '蕊', - '' => '蕙', - '' => '蕈', - '' => '蕨', - '' => '蕩', - '' => '蕃', - '' => '蕉', - '' => '蕭', - '' => '蕪', - '' => '蕞', - '' => '螃', - '' => '螟', - '' => '螞', - '' => '螢', - '' => '融', - '' => '衡', - '' => '褪', - '' => '褲', - '' => '褥', - '' => '褫', - '' => '褡', - '' => '親', - '' => '覦', - '' => '諦', - '' => '諺', - '' => '諫', - '' => '諱', - '' => '謀', - '' => '諜', - '' => '諧', - '' => '諮', - '' => '諾', - '' => '謁', - '' => '謂', - '' => '諷', - '' => '諭', - '' => '諳', - '' => '諶', - '' => '諼', - '' => '豫', - '' => '豭', - '' => '貓', - '' => '賴', - '' => '蹄', - '' => '踱', - '' => '踴', - '' => '蹂', - '' => '踹', - '' => '踵', - '' => '輻', - '' => '輯', - '' => '輸', - '' => '輳', - '' => '辨', - '' => '辦', - '' => '遵', - '' => '遴', - '' => '選', - '' => '遲', - '' => '遼', - '' => '遺', - '' => '鄴', - '' => '醒', - '' => '錠', - '' => '錶', - '' => '鋸', - '' => '錳', - '' => '錯', - '' => '錢', - '' => '鋼', - '' => '錫', - '' => '錄', - '' => '錚', - '@' => '錐', - 'A' => '錦', - 'B' => '錡', - 'C' => '錕', - 'D' => '錮', - 'E' => '錙', - 'F' => '閻', - 'G' => '隧', - 'H' => '隨', - 'I' => '險', - 'J' => '雕', - 'K' => '霎', - 'L' => '霑', - 'M' => '霖', - 'N' => '霍', - 'O' => '霓', - 'P' => '霏', - 'Q' => '靛', - 'R' => '靜', - 'S' => '靦', - 'T' => '鞘', - 'U' => '頰', - 'V' => '頸', - 'W' => '頻', - 'X' => '頷', - 'Y' => '頭', - 'Z' => '頹', - '[' => '頤', - '\\' => '餐', - ']' => '館', - '^' => '餞', - '_' => '餛', - '`' => '餡', - 'a' => '餚', - 'b' => '駭', - 'c' => '駢', - 'd' => '駱', - 'e' => '骸', - 'f' => '骼', - 'g' => '髻', - 'h' => '髭', - 'i' => '鬨', - 'j' => '鮑', - 'k' => '鴕', - 'l' => '鴣', - 'm' => '鴦', - 'n' => '鴨', - 'o' => '鴒', - 'p' => '鴛', - 'q' => '默', - 'r' => '黔', - 's' => '龍', - 't' => '龜', - 'u' => '優', - 'v' => '償', - 'w' => '儡', - 'x' => '儲', - 'y' => '勵', - 'z' => '嚎', - '{' => '嚀', - '|' => '嚐', - '}' => '嚅', - '~' => '嚇', - '' => '嚏', - '' => '壕', - '' => '壓', - '' => '壑', - '' => '壎', - '' => '嬰', - '' => '嬪', - '' => '嬤', - '' => '孺', - '' => '尷', - '' => '屨', - '' => '嶼', - '' => '嶺', - '' => '嶽', - '' => '嶸', - '' => '幫', - '' => '彌', - '' => '徽', - '' => '應', - '' => '懂', - '' => '懇', - '' => '懦', - '' => '懋', - '' => '戲', - '' => '戴', - '' => '擎', - '' => '擊', - '' => '擘', - '' => '擠', - '' => '擰', - '' => '擦', - '' => '擬', - '' => '擱', - '' => '擢', - '' => '擭', - '' => '斂', - '' => '斃', - '' => '曙', - '' => '曖', - '' => '檀', - '' => '檔', - '' => '檄', - '' => '檢', - '' => '檜', - '' => '櫛', - '' => '檣', - '' => '橾', - '' => '檗', - '' => '檐', - '' => '檠', - '' => '歜', - '' => '殮', - '' => '毚', - '' => '氈', - '' => '濘', - '' => '濱', - '' => '濟', - '' => '濠', - '' => '濛', - '' => '濤', - '' => '濫', - '' => '濯', - '' => '澀', - '' => '濬', - '' => '濡', - '' => '濩', - '' => '濕', - '' => '濮', - '' => '濰', - '' => '燧', - '' => '營', - '' => '燮', - '' => '燦', - '' => '燥', - '' => '燭', - '' => '燬', - '' => '燴', - '' => '燠', - '' => '爵', - '' => '牆', - '' => '獰', - '' => '獲', - '' => '璩', - '' => '環', - '' => '璦', - '' => '璨', - '' => '癆', - '' => '療', - '' => '癌', - '' => '盪', - '' => '瞳', - '' => '瞪', - '' => '瞰', - '' => '瞬', - '@' => '瞧', - 'A' => '瞭', - 'B' => '矯', - 'C' => '磷', - 'D' => '磺', - 'E' => '磴', - 'F' => '磯', - 'G' => '礁', - 'H' => '禧', - 'I' => '禪', - 'J' => '穗', - 'K' => '窿', - 'L' => '簇', - 'M' => '簍', - 'N' => '篾', - 'O' => '篷', - 'P' => '簌', - 'Q' => '篠', - 'R' => '糠', - 'S' => '糜', - 'T' => '糞', - 'U' => '糢', - 'V' => '糟', - 'W' => '糙', - 'X' => '糝', - 'Y' => '縮', - 'Z' => '績', - '[' => '繆', - '\\' => '縷', - ']' => '縲', - '^' => '繃', - '_' => '縫', - '`' => '總', - 'a' => '縱', - 'b' => '繅', - 'c' => '繁', - 'd' => '縴', - 'e' => '縹', - 'f' => '繈', - 'g' => '縵', - 'h' => '縿', - 'i' => '縯', - 'j' => '罄', - 'k' => '翳', - 'l' => '翼', - 'm' => '聱', - 'n' => '聲', - 'o' => '聰', - 'p' => '聯', - 'q' => '聳', - 'r' => '臆', - 's' => '臃', - 't' => '膺', - 'u' => '臂', - 'v' => '臀', - 'w' => '膿', - 'x' => '膽', - 'y' => '臉', - 'z' => '膾', - '{' => '臨', - '|' => '舉', - '}' => '艱', - '~' => '薪', - '' => '薄', - '' => '蕾', - '' => '薜', - '' => '薑', - '' => '薔', - '' => '薯', - '' => '薛', - '' => '薇', - '' => '薨', - '' => '薊', - '' => '虧', - '' => '蟀', - '' => '蟑', - '' => '螳', - '' => '蟒', - '' => '蟆', - '' => '螫', - '' => '螻', - '' => '螺', - '' => '蟈', - '' => '蟋', - '' => '褻', - '' => '褶', - '' => '襄', - '' => '褸', - '' => '褽', - '' => '覬', - '' => '謎', - '' => '謗', - '' => '謙', - '' => '講', - '' => '謊', - '' => '謠', - '' => '謝', - '' => '謄', - '' => '謐', - '' => '豁', - '' => '谿', - '' => '豳', - '' => '賺', - '' => '賽', - '' => '購', - '' => '賸', - '' => '賻', - '' => '趨', - '' => '蹉', - '' => '蹋', - '' => '蹈', - '' => '蹊', - '' => '轄', - '' => '輾', - '' => '轂', - '' => '轅', - '' => '輿', - '' => '避', - '' => '遽', - '' => '還', - '' => '邁', - '' => '邂', - '' => '邀', - '' => '鄹', - '' => '醣', - '' => '醞', - '' => '醜', - '' => '鍍', - '' => '鎂', - '' => '錨', - '' => '鍵', - '' => '鍊', - '' => '鍥', - '' => '鍋', - '' => '錘', - '' => '鍾', - '' => '鍬', - '' => '鍛', - '' => '鍰', - '' => '鍚', - '' => '鍔', - '' => '闊', - '' => '闋', - '' => '闌', - '' => '闈', - '' => '闆', - '' => '隱', - '' => '隸', - '' => '雖', - '' => '霜', - '' => '霞', - '' => '鞠', - '' => '韓', - '' => '顆', - '' => '颶', - '' => '餵', - '' => '騁', - '@' => '駿', - 'A' => '鮮', - 'B' => '鮫', - 'C' => '鮪', - 'D' => '鮭', - 'E' => '鴻', - 'F' => '鴿', - 'G' => '麋', - 'H' => '黏', - 'I' => '點', - 'J' => '黜', - 'K' => '黝', - 'L' => '黛', - 'M' => '鼾', - 'N' => '齋', - 'O' => '叢', - 'P' => '嚕', - 'Q' => '嚮', - 'R' => '壙', - 'S' => '壘', - 'T' => '嬸', - 'U' => '彝', - 'V' => '懣', - 'W' => '戳', - 'X' => '擴', - 'Y' => '擲', - 'Z' => '擾', - '[' => '攆', - '\\' => '擺', - ']' => '擻', - '^' => '擷', - '_' => '斷', - '`' => '曜', - 'a' => '朦', - 'b' => '檳', - 'c' => '檬', - 'd' => '櫃', - 'e' => '檻', - 'f' => '檸', - 'g' => '櫂', - 'h' => '檮', - 'i' => '檯', - 'j' => '歟', - 'k' => '歸', - 'l' => '殯', - 'm' => '瀉', - 'n' => '瀋', - 'o' => '濾', - 'p' => '瀆', - 'q' => '濺', - 'r' => '瀑', - 's' => '瀏', - 't' => '燻', - 'u' => '燼', - 'v' => '燾', - 'w' => '燸', - 'x' => '獷', - 'y' => '獵', - 'z' => '璧', - '{' => '璿', - '|' => '甕', - '}' => '癖', - '~' => '癘', - '¡' => '癒', - '¢' => '瞽', - '£' => '瞿', - '¤' => '瞻', - '¥' => '瞼', - '¦' => '礎', - '§' => '禮', - '¨' => '穡', - '©' => '穢', - 'ª' => '穠', - '«' => '竄', - '¬' => '竅', - '­' => '簫', - '®' => '簧', - '¯' => '簪', - '°' => '簞', - '±' => '簣', - '²' => '簡', - '³' => '糧', - '´' => '織', - 'µ' => '繕', - '¶' => '繞', - '·' => '繚', - '¸' => '繡', - '¹' => '繒', - 'º' => '繙', - '»' => '罈', - '¼' => '翹', - '½' => '翻', - '¾' => '職', - '¿' => '聶', - '' => '臍', - '' => '臏', - '' => '舊', - '' => '藏', - '' => '薩', - '' => '藍', - '' => '藐', - '' => '藉', - '' => '薰', - '' => '薺', - '' => '薹', - '' => '薦', - '' => '蟯', - '' => '蟬', - '' => '蟲', - '' => '蟠', - '' => '覆', - '' => '覲', - '' => '觴', - '' => '謨', - '' => '謹', - '' => '謬', - '' => '謫', - '' => '豐', - '' => '贅', - '' => '蹙', - '' => '蹣', - '' => '蹦', - '' => '蹤', - '' => '蹟', - '' => '蹕', - '' => '軀', - '' => '轉', - '' => '轍', - '' => '邇', - '' => '邃', - '' => '邈', - '' => '醫', - '' => '醬', - '' => '釐', - '' => '鎔', - '' => '鎊', - '' => '鎖', - '' => '鎢', - '' => '鎳', - '' => '鎮', - '' => '鎬', - '' => '鎰', - '' => '鎘', - '' => '鎚', - '' => '鎗', - '' => '闔', - '' => '闖', - '' => '闐', - '' => '闕', - '' => '離', - '' => '雜', - '' => '雙', - '' => '雛', - '' => '雞', - '' => '霤', - '' => '鞣', - '' => '鞦', - '@' => '鞭', - 'A' => '韹', - 'B' => '額', - 'C' => '顏', - 'D' => '題', - 'E' => '顎', - 'F' => '顓', - 'G' => '颺', - 'H' => '餾', - 'I' => '餿', - 'J' => '餽', - 'K' => '餮', - 'L' => '馥', - 'M' => '騎', - 'N' => '髁', - 'O' => '鬃', - 'P' => '鬆', - 'Q' => '魏', - 'R' => '魎', - 'S' => '魍', - 'T' => '鯊', - 'U' => '鯉', - 'V' => '鯽', - 'W' => '鯈', - 'X' => '鯀', - 'Y' => '鵑', - 'Z' => '鵝', - '[' => '鵠', - '\\' => '黠', - ']' => '鼕', - '^' => '鼬', - '_' => '儳', - '`' => '嚥', - 'a' => '壞', - 'b' => '壟', - 'c' => '壢', - 'd' => '寵', - 'e' => '龐', - 'f' => '廬', - 'g' => '懲', - 'h' => '懷', - 'i' => '懶', - 'j' => '懵', - 'k' => '攀', - 'l' => '攏', - 'm' => '曠', - 'n' => '曝', - 'o' => '櫥', - 'p' => '櫝', - 'q' => '櫚', - 'r' => '櫓', - 's' => '瀛', - 't' => '瀟', - 'u' => '瀨', - 'v' => '瀚', - 'w' => '瀝', - 'x' => '瀕', - 'y' => '瀘', - 'z' => '爆', - '{' => '爍', - '|' => '牘', - '}' => '犢', - '~' => '獸', - 'á' => '獺', - 'â' => '璽', - 'ã' => '瓊', - 'ä' => '瓣', - 'å' => '疇', - 'æ' => '疆', - 'ç' => '癟', - 'è' => '癡', - 'é' => '矇', - 'ê' => '礙', - 'ë' => '禱', - 'ì' => '穫', - 'í' => '穩', - 'î' => '簾', - 'ï' => '簿', - 'ð' => '簸', - 'ñ' => '簽', - 'ò' => '簷', - 'ó' => '籀', - 'ô' => '繫', - 'õ' => '繭', - 'ö' => '繹', - '÷' => '繩', - 'ø' => '繪', - 'ù' => '羅', - 'ú' => '繳', - 'û' => '羶', - 'ü' => '羹', - 'ý' => '羸', - 'þ' => '臘', - 'ÿ' => '藩', - '' => '藝', - '' => '藪', - '' => '藕', - '' => '藤', - '' => '藥', - '' => '藷', - '' => '蟻', - '' => '蠅', - '' => '蠍', - '' => '蟹', - '' => '蟾', - '' => '襠', - '' => '襟', - '' => '襖', - '' => '襞', - '' => '譁', - '' => '譜', - '' => '識', - '' => '證', - '' => '譚', - '' => '譎', - '' => '譏', - '' => '譆', - '' => '譙', - '' => '贈', - '' => '贊', - '' => '蹼', - '' => '蹲', - '' => '躇', - '' => '蹶', - '' => '蹬', - '' => '蹺', - '' => '蹴', - '' => '轔', - '' => '轎', - '' => '辭', - '' => '邊', - '' => '邋', - '' => '醱', - '' => '醮', - '' => '鏡', - '' => '鏑', - '' => '鏟', - '' => '鏃', - '' => '鏈', - '' => '鏜', - '' => '鏝', - '' => '鏖', - '' => '鏢', - '' => '鏍', - '' => '鏘', - '' => '鏤', - '' => '鏗', - '' => '鏨', - '' => '關', - '' => '隴', - '' => '難', - '' => '霪', - '' => '霧', - '' => '靡', - '' => '韜', - '' => '韻', - '' => '類', - '@' => '願', - 'A' => '顛', - 'B' => '颼', - 'C' => '饅', - 'D' => '饉', - 'E' => '騖', - 'F' => '騙', - 'G' => '鬍', - 'H' => '鯨', - 'I' => '鯧', - 'J' => '鯖', - 'K' => '鯛', - 'L' => '鶉', - 'M' => '鵡', - 'N' => '鵲', - 'O' => '鵪', - 'P' => '鵬', - 'Q' => '麒', - 'R' => '麗', - 'S' => '麓', - 'T' => '麴', - 'U' => '勸', - 'V' => '嚨', - 'W' => '嚷', - 'X' => '嚶', - 'Y' => '嚴', - 'Z' => '嚼', - '[' => '壤', - '\\' => '孀', - ']' => '孃', - '^' => '孽', - '_' => '寶', - '`' => '巉', - 'a' => '懸', - 'b' => '懺', - 'c' => '攘', - 'd' => '攔', - 'e' => '攙', - 'f' => '曦', - 'g' => '朧', - 'h' => '櫬', - 'i' => '瀾', - 'j' => '瀰', - 'k' => '瀲', - 'l' => '爐', - 'm' => '獻', - 'n' => '瓏', - 'o' => '癢', - 'p' => '癥', - 'q' => '礦', - 'r' => '礪', - 's' => '礬', - 't' => '礫', - 'u' => '竇', - 'v' => '競', - 'w' => '籌', - 'x' => '籃', - 'y' => '籍', - 'z' => '糯', - '{' => '糰', - '|' => '辮', - '}' => '繽', - '~' => '繼', - 'ġ' => '纂', - 'Ģ' => '罌', - 'ģ' => '耀', - 'Ĥ' => '臚', - 'ĥ' => '艦', - 'Ħ' => '藻', - 'ħ' => '藹', - 'Ĩ' => '蘑', - 'ĩ' => '藺', - 'Ī' => '蘆', - 'ī' => '蘋', - 'Ĭ' => '蘇', - 'ĭ' => '蘊', - 'Į' => '蠔', - 'į' => '蠕', - 'İ' => '襤', - 'ı' => '覺', - 'IJ' => '觸', - 'ij' => '議', - 'Ĵ' => '譬', - 'ĵ' => '警', - 'Ķ' => '譯', - 'ķ' => '譟', - 'ĸ' => '譫', - 'Ĺ' => '贏', - 'ĺ' => '贍', - 'Ļ' => '躉', - 'ļ' => '躁', - 'Ľ' => '躅', - 'ľ' => '躂', - 'Ŀ' => '醴', - '' => '釋', - '' => '鐘', - '' => '鐃', - '' => '鏽', - '' => '闡', - '' => '霰', - '' => '飄', - '' => '饒', - '' => '饑', - '' => '馨', - '' => '騫', - '' => '騰', - '' => '騷', - '' => '騵', - '' => '鰓', - '' => '鰍', - '' => '鹹', - '' => '麵', - '' => '黨', - '' => '鼯', - '' => '齟', - '' => '齣', - '' => '齡', - '' => '儷', - '' => '儸', - '' => '囁', - '' => '囀', - '' => '囂', - '' => '夔', - '' => '屬', - '' => '巍', - '' => '懼', - '' => '懾', - '' => '攝', - '' => '攜', - '' => '斕', - '' => '曩', - '' => '櫻', - '' => '欄', - '' => '櫺', - '' => '殲', - '' => '灌', - '' => '爛', - '' => '犧', - '' => '瓖', - '' => '瓔', - '' => '癩', - '' => '矓', - '' => '籐', - '' => '纏', - '' => '續', - '' => '羼', - '' => '蘗', - '' => '蘭', - '' => '蘚', - '' => '蠣', - '' => '蠢', - '' => '蠡', - '' => '蠟', - '' => '襪', - '' => '襬', - '' => '覽', - '' => '譴', - '@' => '護', - 'A' => '譽', - 'B' => '贓', - 'C' => '躊', - 'D' => '躍', - 'E' => '躋', - 'F' => '轟', - 'G' => '辯', - 'H' => '醺', - 'I' => '鐮', - 'J' => '鐳', - 'K' => '鐵', - 'L' => '鐺', - 'M' => '鐸', - 'N' => '鐲', - 'O' => '鐫', - 'P' => '闢', - 'Q' => '霸', - 'R' => '霹', - 'S' => '露', - 'T' => '響', - 'U' => '顧', - 'V' => '顥', - 'W' => '饗', - 'X' => '驅', - 'Y' => '驃', - 'Z' => '驀', - '[' => '騾', - '\\' => '髏', - ']' => '魔', - '^' => '魑', - '_' => '鰭', - '`' => '鰥', - 'a' => '鶯', - 'b' => '鶴', - 'c' => '鷂', - 'd' => '鶸', - 'e' => '麝', - 'f' => '黯', - 'g' => '鼙', - 'h' => '齜', - 'i' => '齦', - 'j' => '齧', - 'k' => '儼', - 'l' => '儻', - 'm' => '囈', - 'n' => '囊', - 'o' => '囉', - 'p' => '孿', - 'q' => '巔', - 'r' => '巒', - 's' => '彎', - 't' => '懿', - 'u' => '攤', - 'v' => '權', - 'w' => '歡', - 'x' => '灑', - 'y' => '灘', - 'z' => '玀', - '{' => '瓤', - '|' => '疊', - '}' => '癮', - '~' => '癬', - 'š' => '禳', - 'Ţ' => '籠', - 'ţ' => '籟', - 'Ť' => '聾', - 'ť' => '聽', - 'Ŧ' => '臟', - 'ŧ' => '襲', - 'Ũ' => '襯', - 'ũ' => '觼', - 'Ū' => '讀', - 'ū' => '贖', - 'Ŭ' => '贗', - 'ŭ' => '躑', - 'Ů' => '躓', - 'ů' => '轡', - 'Ű' => '酈', - 'ű' => '鑄', - 'Ų' => '鑑', - 'ų' => '鑒', - 'Ŵ' => '霽', - 'ŵ' => '霾', - 'Ŷ' => '韃', - 'ŷ' => '韁', - 'Ÿ' => '顫', - 'Ź' => '饕', - 'ź' => '驕', - 'Ż' => '驍', - 'ż' => '髒', - 'Ž' => '鬚', - 'ž' => '鱉', - 'ſ' => '鰱', - '' => '鰾', - '' => '鰻', - '' => '鷓', - '' => '鷗', - '' => '鼴', - '' => '齬', - '' => '齪', - '' => '龔', - '' => '囌', - '' => '巖', - '' => '戀', - '' => '攣', - '' => '攫', - '' => '攪', - '' => '曬', - '' => '欐', - '' => '瓚', - '' => '竊', - '' => '籤', - '' => '籣', - '' => '籥', - '' => '纓', - '' => '纖', - '' => '纔', - '' => '臢', - '' => '蘸', - '' => '蘿', - '' => '蠱', - '' => '變', - '' => '邐', - '' => '邏', - '' => '鑣', - '' => '鑠', - '' => '鑤', - '' => '靨', - '' => '顯', - '' => '饜', - '' => '驚', - '' => '驛', - '' => '驗', - '' => '髓', - '' => '體', - '' => '髑', - '' => '鱔', - '' => '鱗', - '' => '鱖', - '' => '鷥', - '' => '麟', - '' => '黴', - '' => '囑', - '' => '壩', - '' => '攬', - '' => '灞', - '' => '癱', - '' => '癲', - '' => '矗', - '' => '罐', - '' => '羈', - '' => '蠶', - '' => '蠹', - '' => '衢', - '' => '讓', - '' => '讒', - '@' => '讖', - 'A' => '艷', - 'B' => '贛', - 'C' => '釀', - 'D' => '鑪', - 'E' => '靂', - 'F' => '靈', - 'G' => '靄', - 'H' => '韆', - 'I' => '顰', - 'J' => '驟', - 'K' => '鬢', - 'L' => '魘', - 'M' => '鱟', - 'N' => '鷹', - 'O' => '鷺', - 'P' => '鹼', - 'Q' => '鹽', - 'R' => '鼇', - 'S' => '齷', - 'T' => '齲', - 'U' => '廳', - 'V' => '欖', - 'W' => '灣', - 'X' => '籬', - 'Y' => '籮', - 'Z' => '蠻', - '[' => '觀', - '\\' => '躡', - ']' => '釁', - '^' => '鑲', - '_' => '鑰', - '`' => '顱', - 'a' => '饞', - 'b' => '髖', - 'c' => '鬣', - 'd' => '黌', - 'e' => '灤', - 'f' => '矚', - 'g' => '讚', - 'h' => '鑷', - 'i' => '韉', - 'j' => '驢', - 'k' => '驥', - 'l' => '纜', - 'm' => '讜', - 'n' => '躪', - 'o' => '釅', - 'p' => '鑽', - 'q' => '鑾', - 'r' => '鑼', - 's' => '鱷', - 't' => '鱸', - 'u' => '黷', - 'v' => '豔', - 'w' => '鑿', - 'x' => '鸚', - 'y' => '爨', - 'z' => '驪', - '{' => '鬱', - '|' => '鸛', - '}' => '鸞', - '~' => '籲', - 'ơ' => 'ヾ', - 'Ƣ' => 'ゝ', - 'ƣ' => 'ゞ', - 'Ƥ' => '々', - 'ƥ' => 'ぁ', - 'Ʀ' => 'あ', - 'Ƨ' => 'ぃ', - 'ƨ' => 'い', - 'Ʃ' => 'ぅ', - 'ƪ' => 'う', - 'ƫ' => 'ぇ', - 'Ƭ' => 'え', - 'ƭ' => 'ぉ', - 'Ʈ' => 'お', - 'Ư' => 'か', - 'ư' => 'が', - 'Ʊ' => 'き', - 'Ʋ' => 'ぎ', - 'Ƴ' => 'く', - 'ƴ' => 'ぐ', - 'Ƶ' => 'け', - 'ƶ' => 'げ', - 'Ʒ' => 'こ', - 'Ƹ' => 'ご', - 'ƹ' => 'さ', - 'ƺ' => 'ざ', - 'ƻ' => 'し', - 'Ƽ' => 'じ', - 'ƽ' => 'す', - 'ƾ' => 'ず', - 'ƿ' => 'せ', - '' => 'ぜ', - '' => 'そ', - '' => 'ぞ', - '' => 'た', - '' => 'だ', - '' => 'ち', - '' => 'ぢ', - '' => 'っ', - '' => 'つ', - '' => 'づ', - '' => 'て', - '' => 'で', - '' => 'と', - '' => 'ど', - '' => 'な', - '' => 'に', - '' => 'ぬ', - '' => 'ね', - '' => 'の', - '' => 'は', - '' => 'ば', - '' => 'ぱ', - '' => 'ひ', - '' => 'び', - '' => 'ぴ', - '' => 'ふ', - '' => 'ぶ', - '' => 'ぷ', - '' => 'へ', - '' => 'べ', - '' => 'ぺ', - '' => 'ほ', - '' => 'ぼ', - '' => 'ぽ', - '' => 'ま', - '' => 'み', - '' => 'む', - '' => 'め', - '' => 'も', - '' => 'ゃ', - '' => 'や', - '' => 'ゅ', - '' => 'ゆ', - '' => 'ょ', - '' => 'よ', - '' => 'ら', - '' => 'り', - '' => 'る', - '' => 'れ', - '' => 'ろ', - '' => 'ゎ', - '' => 'わ', - '' => 'ゐ', - '' => 'ゑ', - '' => 'を', - '' => 'ん', - '' => 'ァ', - '' => 'ア', - '' => 'ィ', - '' => 'イ', - '' => 'ゥ', - '' => 'ウ', - '' => 'ェ', - '@' => 'エ', - 'A' => 'ォ', - 'B' => 'オ', - 'C' => 'カ', - 'D' => 'ガ', - 'E' => 'キ', - 'F' => 'ギ', - 'G' => 'ク', - 'H' => 'グ', - 'I' => 'ケ', - 'J' => 'ゲ', - 'K' => 'コ', - 'L' => 'ゴ', - 'M' => 'サ', - 'N' => 'ザ', - 'O' => 'シ', - 'P' => 'ジ', - 'Q' => 'ス', - 'R' => 'ズ', - 'S' => 'セ', - 'T' => 'ゼ', - 'U' => 'ソ', - 'V' => 'ゾ', - 'W' => 'タ', - 'X' => 'ダ', - 'Y' => 'チ', - 'Z' => 'ヂ', - '[' => 'ッ', - '\\' => 'ツ', - ']' => 'ヅ', - '^' => 'テ', - '_' => 'デ', - '`' => 'ト', - 'a' => 'ド', - 'b' => 'ナ', - 'c' => 'ニ', - 'd' => 'ヌ', - 'e' => 'ネ', - 'f' => 'ノ', - 'g' => 'ハ', - 'h' => 'バ', - 'i' => 'パ', - 'j' => 'ヒ', - 'k' => 'ビ', - 'l' => 'ピ', - 'm' => 'フ', - 'n' => 'ブ', - 'o' => 'プ', - 'p' => 'ヘ', - 'q' => 'ベ', - 'r' => 'ペ', - 's' => 'ホ', - 't' => 'ボ', - 'u' => 'ポ', - 'v' => 'マ', - 'w' => 'ミ', - 'x' => 'ム', - 'y' => 'メ', - 'z' => 'モ', - '{' => 'ャ', - '|' => 'ヤ', - '}' => 'ュ', - '~' => 'ユ', - 'ǡ' => 'ョ', - 'Ǣ' => 'ヨ', - 'ǣ' => 'ラ', - 'Ǥ' => 'リ', - 'ǥ' => 'ル', - 'Ǧ' => 'レ', - 'ǧ' => 'ロ', - 'Ǩ' => 'ヮ', - 'ǩ' => 'ワ', - 'Ǫ' => 'ヰ', - 'ǫ' => 'ヱ', - 'Ǭ' => 'ヲ', - 'ǭ' => 'ン', - 'Ǯ' => 'ヴ', - 'ǯ' => 'ヵ', - 'ǰ' => 'ヶ', - 'DZ' => 'Д', - 'Dz' => 'Е', - 'dz' => 'Ё', - 'Ǵ' => 'Ж', - 'ǵ' => 'З', - 'Ƕ' => 'И', - 'Ƿ' => 'Й', - 'Ǹ' => 'К', - 'ǹ' => 'Л', - 'Ǻ' => 'М', - 'ǻ' => 'У', - 'Ǽ' => 'Ф', - 'ǽ' => 'Х', - 'Ǿ' => 'Ц', - 'ǿ' => 'Ч', - '' => 'Ш', - '' => 'Щ', - '' => 'Ъ', - '' => 'Ы', - '' => 'Ь', - '' => 'Э', - '' => 'Ю', - '' => 'Я', - '' => 'а', - '' => 'б', - '' => 'в', - '' => 'г', - '' => 'д', - '' => 'е', - '' => 'ё', - '' => 'ж', - '' => 'з', - '' => 'и', - '' => 'й', - '' => 'к', - '' => 'л', - '' => 'м', - '' => 'н', - '' => 'о', - '' => 'п', - '' => 'р', - '' => 'с', - '' => 'т', - '' => 'у', - '' => 'ф', - '' => 'х', - '' => 'ц', - '' => 'ч', - '' => 'ш', - '' => 'щ', - '' => 'ъ', - '' => 'ы', - '' => 'ь', - '' => 'э', - '' => 'ю', - '' => 'я', - '' => '①', - '' => '②', - '' => '③', - '' => '④', - '' => '⑤', - '' => '⑥', - '' => '⑦', - '' => '⑧', - '' => '⑨', - '' => '⑩', - '' => '⑴', - '' => '⑵', - '' => '⑶', - '' => '⑷', - '' => '⑸', - '' => '⑹', - '' => '⑺', - '' => '⑻', - '' => '⑼', - '' => '⑽', - '@' => '乂', - 'A' => '乜', - 'B' => '凵', - 'C' => '匚', - 'D' => '厂', - 'E' => '万', - 'F' => '丌', - 'G' => '乇', - 'H' => '亍', - 'I' => '囗', - 'J' => '兀', - 'K' => '屮', - 'L' => '彳', - 'M' => '丏', - 'N' => '冇', - 'O' => '与', - 'P' => '丮', - 'Q' => '亓', - 'R' => '仂', - 'S' => '仉', - 'T' => '仈', - 'U' => '冘', - 'V' => '勼', - 'W' => '卬', - 'X' => '厹', - 'Y' => '圠', - 'Z' => '夃', - '[' => '夬', - '\\' => '尐', - ']' => '巿', - '^' => '旡', - '_' => '殳', - '`' => '毌', - 'a' => '气', - 'b' => '爿', - 'c' => '丱', - 'd' => '丼', - 'e' => '仨', - 'f' => '仜', - 'g' => '仩', - 'h' => '仡', - 'i' => '仝', - 'j' => '仚', - 'k' => '刌', - 'l' => '匜', - 'm' => '卌', - 'n' => '圢', - 'o' => '圣', - 'p' => '夗', - 'q' => '夯', - 'r' => '宁', - 's' => '宄', - 't' => '尒', - 'u' => '尻', - 'v' => '屴', - 'w' => '屳', - 'x' => '帄', - 'y' => '庀', - 'z' => '庂', - '{' => '忉', - '|' => '戉', - '}' => '扐', - '~' => '氕', - 'ɡ' => '氶', - 'ɢ' => '汃', - 'ɣ' => '氿', - 'ɤ' => '氻', - 'ɥ' => '犮', - 'ɦ' => '犰', - 'ɧ' => '玊', - 'ɨ' => '禸', - 'ɩ' => '肊', - 'ɪ' => '阞', - 'ɫ' => '伎', - 'ɬ' => '优', - 'ɭ' => '伬', - 'ɮ' => '仵', - 'ɯ' => '伔', - 'ɰ' => '仱', - 'ɱ' => '伀', - 'ɲ' => '价', - 'ɳ' => '伈', - 'ɴ' => '伝', - 'ɵ' => '伂', - 'ɶ' => '伅', - 'ɷ' => '伢', - 'ɸ' => '伓', - 'ɹ' => '伄', - 'ɺ' => '仴', - 'ɻ' => '伒', - 'ɼ' => '冱', - 'ɽ' => '刓', - 'ɾ' => '刉', - 'ɿ' => '刐', - '' => '劦', - '' => '匢', - '' => '匟', - '' => '卍', - '' => '厊', - '' => '吇', - '' => '囡', - '' => '囟', - '' => '圮', - '' => '圪', - '' => '圴', - '' => '夼', - '' => '妀', - '' => '奼', - '' => '妅', - '' => '奻', - '' => '奾', - '' => '奷', - '' => '奿', - '' => '孖', - '' => '尕', - '' => '尥', - '' => '屼', - '' => '屺', - '' => '屻', - '' => '屾', - '' => '巟', - '' => '幵', - '' => '庄', - '' => '异', - '' => '弚', - '' => '彴', - '' => '忕', - '' => '忔', - '' => '忏', - '' => '扜', - '' => '扞', - '' => '扤', - '' => '扡', - '' => '扦', - '' => '扢', - '' => '扙', - '' => '扠', - '' => '扚', - '' => '扥', - '' => '旯', - '' => '旮', - '' => '朾', - '' => '朹', - '' => '朸', - '' => '朻', - '' => '机', - '' => '朿', - '' => '朼', - '' => '朳', - '' => '氘', - '' => '汆', - '' => '汒', - '' => '汜', - '' => '汏', - '' => '汊', - '' => '汔', - '' => '汋', - '@' => '汌', - 'A' => '灱', - 'B' => '牞', - 'C' => '犴', - 'D' => '犵', - 'E' => '玎', - 'F' => '甪', - 'G' => '癿', - 'H' => '穵', - 'I' => '网', - 'J' => '艸', - 'K' => '艼', - 'L' => '芀', - 'M' => '艽', - 'N' => '艿', - 'O' => '虍', - 'P' => '襾', - 'Q' => '邙', - 'R' => '邗', - 'S' => '邘', - 'T' => '邛', - 'U' => '邔', - 'V' => '阢', - 'W' => '阤', - 'X' => '阠', - 'Y' => '阣', - 'Z' => '佖', - '[' => '伻', - '\\' => '佢', - ']' => '佉', - '^' => '体', - '_' => '佤', - '`' => '伾', - 'a' => '佧', - 'b' => '佒', - 'c' => '佟', - 'd' => '佁', - 'e' => '佘', - 'f' => '伭', - 'g' => '伳', - 'h' => '伿', - 'i' => '佡', - 'j' => '冏', - 'k' => '冹', - 'l' => '刜', - 'm' => '刞', - 'n' => '刡', - 'o' => '劭', - 'p' => '劮', - 'q' => '匉', - 'r' => '卣', - 's' => '卲', - 't' => '厎', - 'u' => '厏', - 'v' => '吰', - 'w' => '吷', - 'x' => '吪', - 'y' => '呔', - 'z' => '呅', - '{' => '吙', - '|' => '吜', - '}' => '吥', - '~' => '吘', - 'ʡ' => '吽', - 'ʢ' => '呏', - 'ʣ' => '呁', - 'ʤ' => '吨', - 'ʥ' => '吤', - 'ʦ' => '呇', - 'ʧ' => '囮', - 'ʨ' => '囧', - 'ʩ' => '囥', - 'ʪ' => '坁', - 'ʫ' => '坅', - 'ʬ' => '坌', - 'ʭ' => '坉', - 'ʮ' => '坋', - 'ʯ' => '坒', - 'ʰ' => '夆', - 'ʱ' => '奀', - 'ʲ' => '妦', - 'ʳ' => '妘', - 'ʴ' => '妠', - 'ʵ' => '妗', - 'ʶ' => '妎', - 'ʷ' => '妢', - 'ʸ' => '妐', - 'ʹ' => '妏', - 'ʺ' => '妧', - 'ʻ' => '妡', - 'ʼ' => '宎', - 'ʽ' => '宒', - 'ʾ' => '尨', - 'ʿ' => '尪', - '' => '岍', - '' => '岏', - '' => '岈', - '' => '岋', - '' => '岉', - '' => '岒', - '' => '岊', - '' => '岆', - '' => '岓', - '' => '岕', - '' => '巠', - '' => '帊', - '' => '帎', - '' => '庋', - '' => '庉', - '' => '庌', - '' => '庈', - '' => '庍', - '' => '弅', - '' => '弝', - '' => '彸', - '' => '彶', - '' => '忒', - '' => '忑', - '' => '忐', - '' => '忭', - '' => '忨', - '' => '忮', - '' => '忳', - '' => '忡', - '' => '忤', - '' => '忣', - '' => '忺', - '' => '忯', - '' => '忷', - '' => '忻', - '' => '怀', - '' => '忴', - '' => '戺', - '' => '抃', - '' => '抌', - '' => '抎', - '' => '抏', - '' => '抔', - '' => '抇', - '' => '扱', - '' => '扻', - '' => '扺', - '' => '扰', - '' => '抁', - '' => '抈', - '' => '扷', - '' => '扽', - '' => '扲', - '' => '扴', - '' => '攷', - '' => '旰', - '' => '旴', - '' => '旳', - '' => '旲', - '' => '旵', - '' => '杅', - '' => '杇', - '@' => '杙', - 'A' => '杕', - 'B' => '杌', - 'C' => '杈', - 'D' => '杝', - 'E' => '杍', - 'F' => '杚', - 'G' => '杋', - 'H' => '毐', - 'I' => '氙', - 'J' => '氚', - 'K' => '汸', - 'L' => '汧', - 'M' => '汫', - 'N' => '沄', - 'O' => '沋', - 'P' => '沏', - 'Q' => '汱', - 'R' => '汯', - 'S' => '汩', - 'T' => '沚', - 'U' => '汭', - 'V' => '沇', - 'W' => '沕', - 'X' => '沜', - 'Y' => '汦', - 'Z' => '汳', - '[' => '汥', - '\\' => '汻', - ']' => '沎', - '^' => '灴', - '_' => '灺', - '`' => '牣', - 'a' => '犿', - 'b' => '犽', - 'c' => '狃', - 'd' => '狆', - 'e' => '狁', - 'f' => '犺', - 'g' => '狅', - 'h' => '玕', - 'i' => '玗', - 'j' => '玓', - 'k' => '玔', - 'l' => '玒', - 'm' => '町', - 'n' => '甹', - 'o' => '疔', - 'p' => '疕', - 'q' => '皁', - 'r' => '礽', - 's' => '耴', - 't' => '肕', - 'u' => '肙', - 'v' => '肐', - 'w' => '肒', - 'x' => '肜', - 'y' => '芐', - 'z' => '芏', - '{' => '芅', - '|' => '芎', - '}' => '芑', - '~' => '芓', - 'ˡ' => '芊', - 'ˢ' => '芃', - 'ˣ' => '芄', - 'ˤ' => '豸', - '˥' => '迉', - '˦' => '辿', - '˧' => '邟', - '˨' => '邡', - '˩' => '邥', - '˪' => '邞', - '˫' => '邧', - 'ˬ' => '邠', - '˭' => '阰', - 'ˮ' => '阨', - '˯' => '阯', - '˰' => '阭', - '˱' => '丳', - '˲' => '侘', - '˳' => '佼', - '˴' => '侅', - '˵' => '佽', - '˶' => '侀', - '˷' => '侇', - '˸' => '佶', - '˹' => '佴', - '˺' => '侉', - '˻' => '侄', - '˼' => '佷', - '˽' => '佌', - '˾' => '侗', - '˿' => '佪', - '' => '侚', - '' => '佹', - '' => '侁', - '' => '佸', - '' => '侐', - '' => '侜', - '' => '侔', - '' => '侞', - '' => '侒', - '' => '侂', - '' => '侕', - '' => '佫', - '' => '佮', - '' => '冞', - '' => '冼', - '' => '冾', - '' => '刵', - '' => '刲', - '' => '刳', - '' => '剆', - '' => '刱', - '' => '劼', - '' => '匊', - '' => '匋', - '' => '匼', - '' => '厒', - '' => '厔', - '' => '咇', - '' => '呿', - '' => '咁', - '' => '咑', - '' => '咂', - '' => '咈', - '' => '呫', - '' => '呺', - '' => '呾', - '' => '呥', - '' => '呬', - '' => '呴', - '' => '呦', - '' => '咍', - '' => '呯', - '' => '呡', - '' => '呠', - '' => '咘', - '' => '呣', - '' => '呧', - '' => '呤', - '' => '囷', - '' => '囹', - '' => '坯', - '' => '坲', - '' => '坭', - '' => '坫', - '' => '坱', - '' => '坰', - '' => '坶', - '' => '垀', - '' => '坵', - '' => '坻', - '' => '坳', - '' => '坴', - '' => '坢', - '@' => '坨', - 'A' => '坽', - 'B' => '夌', - 'C' => '奅', - 'D' => '妵', - 'E' => '妺', - 'F' => '姏', - 'G' => '姎', - 'H' => '妲', - 'I' => '姌', - 'J' => '姁', - 'K' => '妶', - 'L' => '妼', - 'M' => '姃', - 'N' => '姖', - 'O' => '妱', - 'P' => '妽', - 'Q' => '姀', - 'R' => '姈', - 'S' => '妴', - 'T' => '姇', - 'U' => '孢', - 'V' => '孥', - 'W' => '宓', - 'X' => '宕', - 'Y' => '屄', - 'Z' => '屇', - '[' => '岮', - '\\' => '岤', - ']' => '岠', - '^' => '岵', - '_' => '岯', - '`' => '岨', - 'a' => '岬', - 'b' => '岟', - 'c' => '岣', - 'd' => '岭', - 'e' => '岢', - 'f' => '岪', - 'g' => '岧', - 'h' => '岝', - 'i' => '岥', - 'j' => '岶', - 'k' => '岰', - 'l' => '岦', - 'm' => '帗', - 'n' => '帔', - 'o' => '帙', - 'p' => '弨', - 'q' => '弢', - 'r' => '弣', - 's' => '弤', - 't' => '彔', - 'u' => '徂', - 'v' => '彾', - 'w' => '彽', - 'x' => '忞', - 'y' => '忥', - 'z' => '怭', - '{' => '怦', - '|' => '怙', - '}' => '怲', - '~' => '怋', - '̡' => '怴', - '̢' => '怊', - '̣' => '怗', - '̤' => '怳', - '̥' => '怚', - '̦' => '怞', - '̧' => '怬', - '̨' => '怢', - '̩' => '怍', - '̪' => '怐', - '̫' => '怮', - '̬' => '怓', - '̭' => '怑', - '̮' => '怌', - '̯' => '怉', - '̰' => '怜', - '̱' => '戔', - '̲' => '戽', - '̳' => '抭', - '̴' => '抴', - '̵' => '拑', - '̶' => '抾', - '̷' => '抪', - '̸' => '抶', - '̹' => '拊', - '̺' => '抮', - '̻' => '抳', - '̼' => '抯', - '̽' => '抻', - '̾' => '抩', - '̿' => '抰', - '' => '抸', - '' => '攽', - '' => '斨', - '' => '斻', - '' => '昉', - '' => '旼', - '' => '昄', - '' => '昒', - '' => '昈', - '' => '旻', - '' => '昃', - '' => '昋', - '' => '昍', - '' => '昅', - '' => '旽', - '' => '昑', - '' => '昐', - '' => '曶', - '' => '朊', - '' => '枅', - '' => '杬', - '' => '枎', - '' => '枒', - '' => '杶', - '' => '杻', - '' => '枘', - '' => '枆', - '' => '构', - '' => '杴', - '' => '枍', - '' => '枌', - '' => '杺', - '' => '枟', - '' => '枑', - '' => '枙', - '' => '枃', - '' => '杽', - '' => '极', - '' => '杸', - '' => '杹', - '' => '枔', - '' => '欥', - '' => '殀', - '' => '歾', - '' => '毞', - '' => '氝', - '' => '沓', - '' => '泬', - '' => '泫', - '' => '泮', - '' => '泙', - '' => '沶', - '' => '泔', - '' => '沭', - '' => '泧', - '' => '沷', - '' => '泐', - '' => '泂', - '' => '沺', - '' => '泃', - '' => '泆', - '' => '泭', - '' => '泲', - '@' => '泒', - 'A' => '泝', - 'B' => '沴', - 'C' => '沊', - 'D' => '沝', - 'E' => '沀', - 'F' => '泞', - 'G' => '泀', - 'H' => '洰', - 'I' => '泍', - 'J' => '泇', - 'K' => '沰', - 'L' => '泹', - 'M' => '泏', - 'N' => '泩', - 'O' => '泑', - 'P' => '炔', - 'Q' => '炘', - 'R' => '炅', - 'S' => '炓', - 'T' => '炆', - 'U' => '炄', - 'V' => '炑', - 'W' => '炖', - 'X' => '炂', - 'Y' => '炚', - 'Z' => '炃', - '[' => '牪', - '\\' => '狖', - ']' => '狋', - '^' => '狘', - '_' => '狉', - '`' => '狜', - 'a' => '狒', - 'b' => '狔', - 'c' => '狚', - 'd' => '狌', - 'e' => '狑', - 'f' => '玤', - 'g' => '玡', - 'h' => '玭', - 'i' => '玦', - 'j' => '玢', - 'k' => '玠', - 'l' => '玬', - 'm' => '玝', - 'n' => '瓝', - 'o' => '瓨', - 'p' => '甿', - 'q' => '畀', - 'r' => '甾', - 's' => '疌', - 't' => '疘', - 'u' => '皯', - 'v' => '盳', - 'w' => '盱', - 'x' => '盰', - 'y' => '盵', - 'z' => '矸', - '{' => '矼', - '|' => '矹', - '}' => '矻', - '~' => '矺', - '͡' => '矷', - '͢' => '祂', - 'ͣ' => '礿', - 'ͤ' => '秅', - 'ͥ' => '穸', - 'ͦ' => '穻', - 'ͧ' => '竻', - 'ͨ' => '籵', - 'ͩ' => '糽', - 'ͪ' => '耵', - 'ͫ' => '肏', - 'ͬ' => '肮', - 'ͭ' => '肣', - 'ͮ' => '肸', - 'ͯ' => '肵', - 'Ͱ' => '肭', - 'ͱ' => '舠', - 'Ͳ' => '芠', - 'ͳ' => '苀', - 'ʹ' => '芫', - '͵' => '芚', - 'Ͷ' => '芘', - 'ͷ' => '芛', - '͸' => '芵', - '͹' => '芧', - 'ͺ' => '芮', - 'ͻ' => '芼', - 'ͼ' => '芞', - 'ͽ' => '芺', - ';' => '芴', - 'Ϳ' => '芨', - '' => '芡', - '' => '芩', - '' => '苂', - '' => '芤', - '' => '苃', - '' => '芶', - '' => '芢', - '' => '虰', - '' => '虯', - '' => '虭', - '' => '虮', - '' => '豖', - '' => '迒', - '' => '迋', - '' => '迓', - '' => '迍', - '' => '迖', - '' => '迕', - '' => '迗', - '' => '邲', - '' => '邴', - '' => '邯', - '' => '邳', - '' => '邰', - '' => '阹', - '' => '阽', - '' => '阼', - '' => '阺', - '' => '陃', - '' => '俍', - '' => '俅', - '' => '俓', - '' => '侲', - '' => '俉', - '' => '俋', - '' => '俁', - '' => '俔', - '' => '俜', - '' => '俙', - '' => '侻', - '' => '侳', - '' => '俛', - '' => '俇', - '' => '俖', - '' => '侺', - '' => '俀', - '' => '侹', - '' => '俬', - '' => '剄', - '' => '剉', - '' => '勀', - '' => '勂', - '' => '匽', - '' => '卼', - '' => '厗', - '' => '厖', - '' => '厙', - '' => '厘', - '' => '咺', - '' => '咡', - '' => '咭', - '' => '咥', - '' => '哏', - '@' => '哃', - 'A' => '茍', - 'B' => '咷', - 'C' => '咮', - 'D' => '哖', - 'E' => '咶', - 'F' => '哅', - 'G' => '哆', - 'H' => '咠', - 'I' => '呰', - 'J' => '咼', - 'K' => '咢', - 'L' => '咾', - 'M' => '呲', - 'N' => '哞', - 'O' => '咰', - 'P' => '垵', - 'Q' => '垞', - 'R' => '垟', - 'S' => '垤', - 'T' => '垌', - 'U' => '垗', - 'V' => '垝', - 'W' => '垛', - 'X' => '垔', - 'Y' => '垘', - 'Z' => '垏', - '[' => '垙', - '\\' => '垥', - ']' => '垚', - '^' => '垕', - '_' => '壴', - '`' => '复', - 'a' => '奓', - 'b' => '姡', - 'c' => '姞', - 'd' => '姮', - 'e' => '娀', - 'f' => '姱', - 'g' => '姝', - 'h' => '姺', - 'i' => '姽', - 'j' => '姼', - 'k' => '姶', - 'l' => '姤', - 'm' => '姲', - 'n' => '姷', - 'o' => '姛', - 'p' => '姩', - 'q' => '姳', - 'r' => '姵', - 's' => '姠', - 't' => '姾', - 'u' => '姴', - 'v' => '姭', - 'w' => '宨', - 'x' => '屌', - 'y' => '峐', - 'z' => '峘', - '{' => '峌', - '|' => '峗', - '}' => '峋', - '~' => '峛', - 'Ρ' => '峞', - '΢' => '峚', - 'Σ' => '峉', - 'Τ' => '峇', - 'Υ' => '峊', - 'Φ' => '峖', - 'Χ' => '峓', - 'Ψ' => '峔', - 'Ω' => '峏', - 'Ϊ' => '峈', - 'Ϋ' => '峆', - 'ά' => '峎', - 'έ' => '峟', - 'ή' => '峸', - 'ί' => '巹', - 'ΰ' => '帡', - 'α' => '帢', - 'β' => '帣', - 'γ' => '帠', - 'δ' => '帤', - 'ε' => '庰', - 'ζ' => '庤', - 'η' => '庢', - 'θ' => '庛', - 'ι' => '庣', - 'κ' => '庥', - 'λ' => '弇', - 'μ' => '弮', - 'ν' => '彖', - 'ξ' => '徆', - 'ο' => '怷', - '' => '怹', - '' => '恔', - '' => '恲', - '' => '恞', - '' => '恅', - '' => '恓', - '' => '恇', - '' => '恉', - '' => '恛', - '' => '恌', - '' => '恀', - '' => '恂', - '' => '恟', - '' => '怤', - '' => '恄', - '' => '恘', - '' => '恦', - '' => '恮', - '' => '扂', - '' => '扃', - '' => '拏', - '' => '挍', - '' => '挋', - '' => '拵', - '' => '挎', - '' => '挃', - '' => '拫', - '' => '拹', - '' => '挏', - '' => '挌', - '' => '拸', - '' => '拶', - '' => '挀', - '' => '挓', - '' => '挔', - '' => '拺', - '' => '挕', - '' => '拻', - '' => '拰', - '' => '敁', - '' => '敃', - '' => '斪', - '' => '斿', - '' => '昶', - '' => '昡', - '' => '昲', - '' => '昵', - '' => '昜', - '' => '昦', - '' => '昢', - '' => '昳', - '' => '昫', - '' => '昺', - '' => '昝', - '' => '昴', - '' => '昹', - '' => '昮', - '' => '朏', - '' => '朐', - '' => '柁', - '' => '柲', - '' => '柈', - '' => '枺', - '@' => '柜', - 'A' => '枻', - 'B' => '柸', - 'C' => '柘', - 'D' => '柀', - 'E' => '枷', - 'F' => '柅', - 'G' => '柫', - 'H' => '柤', - 'I' => '柟', - 'J' => '枵', - 'K' => '柍', - 'L' => '枳', - 'M' => '柷', - 'N' => '柶', - 'O' => '柮', - 'P' => '柣', - 'Q' => '柂', - 'R' => '枹', - 'S' => '柎', - 'T' => '柧', - 'U' => '柰', - 'V' => '枲', - 'W' => '柼', - 'X' => '柆', - 'Y' => '柭', - 'Z' => '柌', - '[' => '枮', - '\\' => '柦', - ']' => '柛', - '^' => '柺', - '_' => '柉', - '`' => '柊', - 'a' => '柃', - 'b' => '柪', - 'c' => '柋', - 'd' => '欨', - 'e' => '殂', - 'f' => '殄', - 'g' => '殶', - 'h' => '毖', - 'i' => '毘', - 'j' => '毠', - 'k' => '氠', - 'l' => '氡', - 'm' => '洨', - 'n' => '洴', - 'o' => '洭', - 'p' => '洟', - 'q' => '洼', - 'r' => '洿', - 's' => '洒', - 't' => '洊', - 'u' => '泚', - 'v' => '洳', - 'w' => '洄', - 'x' => '洙', - 'y' => '洺', - 'z' => '洚', - '{' => '洑', - '|' => '洀', - '}' => '洝', - '~' => '浂', - 'ϡ' => '洁', - 'Ϣ' => '洘', - 'ϣ' => '洷', - 'Ϥ' => '洃', - 'ϥ' => '洏', - 'Ϧ' => '浀', - 'ϧ' => '洇', - 'Ϩ' => '洠', - 'ϩ' => '洬', - 'Ϫ' => '洈', - 'ϫ' => '洢', - 'Ϭ' => '洉', - 'ϭ' => '洐', - 'Ϯ' => '炷', - 'ϯ' => '炟', - 'ϰ' => '炾', - 'ϱ' => '炱', - 'ϲ' => '炰', - 'ϳ' => '炡', - 'ϴ' => '炴', - 'ϵ' => '炵', - '϶' => '炩', - 'Ϸ' => '牁', - 'ϸ' => '牉', - 'Ϲ' => '牊', - 'Ϻ' => '牬', - 'ϻ' => '牰', - 'ϼ' => '牳', - 'Ͻ' => '牮', - 'Ͼ' => '狊', - 'Ͽ' => '狤', - '' => '狨', - '' => '狫', - '' => '狟', - '' => '狪', - '' => '狦', - '' => '狣', - '' => '玅', - '' => '珌', - '' => '珂', - '' => '珈', - '' => '珅', - '' => '玹', - '' => '玶', - '' => '玵', - '' => '玴', - '' => '珫', - '' => '玿', - '' => '珇', - '' => '玾', - '' => '珃', - '' => '珆', - '' => '玸', - '' => '珋', - '' => '瓬', - '' => '瓮', - '' => '甮', - '' => '畇', - '' => '畈', - '' => '疧', - '' => '疪', - '' => '癹', - '' => '盄', - '' => '眈', - '' => '眃', - '' => '眄', - '' => '眅', - '' => '眊', - '' => '盷', - '' => '盻', - '' => '盺', - '' => '矧', - '' => '矨', - '' => '砆', - '' => '砑', - '' => '砒', - '' => '砅', - '' => '砐', - '' => '砏', - '' => '砎', - '' => '砉', - '' => '砃', - '' => '砓', - '' => '祊', - '' => '祌', - '' => '祋', - '' => '祅', - '' => '祄', - '' => '秕', - '' => '种', - '' => '秏', - '' => '秖', - '' => '秎', - '' => '窀', - '@' => '穾', - 'A' => '竑', - 'B' => '笀', - 'C' => '笁', - 'D' => '籺', - 'E' => '籸', - 'F' => '籹', - 'G' => '籿', - 'H' => '粀', - 'I' => '粁', - 'J' => '紃', - 'K' => '紈', - 'L' => '紁', - 'M' => '罘', - 'N' => '羑', - 'O' => '羍', - 'P' => '羾', - 'Q' => '耇', - 'R' => '耎', - 'S' => '耏', - 'T' => '耔', - 'U' => '耷', - 'V' => '胘', - 'W' => '胇', - 'X' => '胠', - 'Y' => '胑', - 'Z' => '胈', - '[' => '胂', - '\\' => '胐', - ']' => '胅', - '^' => '胣', - '_' => '胙', - '`' => '胜', - 'a' => '胊', - 'b' => '胕', - 'c' => '胉', - 'd' => '胏', - 'e' => '胗', - 'f' => '胦', - 'g' => '胍', - 'h' => '臿', - 'i' => '舡', - 'j' => '芔', - 'k' => '苙', - 'l' => '苾', - 'm' => '苹', - 'n' => '茇', - 'o' => '苨', - 'p' => '茀', - 'q' => '苕', - 'r' => '茺', - 's' => '苫', - 't' => '苖', - 'u' => '苴', - 'v' => '苬', - 'w' => '苡', - 'x' => '苲', - 'y' => '苵', - 'z' => '茌', - '{' => '苻', - '|' => '苶', - '}' => '苰', - '~' => '苪', - 'С' => '苤', - 'Т' => '苠', - 'У' => '苺', - 'Ф' => '苳', - 'Х' => '苭', - 'Ц' => '虷', - 'Ч' => '虴', - 'Ш' => '虼', - 'Щ' => '虳', - 'Ъ' => '衁', - 'Ы' => '衎', - 'Ь' => '衧', - 'Э' => '衪', - 'Ю' => '衩', - 'Я' => '觓', - 'а' => '訄', - 'б' => '訇', - 'в' => '赲', - 'г' => '迣', - 'д' => '迡', - 'е' => '迮', - 'ж' => '迠', - 'з' => '郱', - 'и' => '邽', - 'й' => '邿', - 'к' => '郕', - 'л' => '郅', - 'м' => '邾', - 'н' => '郇', - 'о' => '郋', - 'п' => '郈', - '' => '釔', - '' => '釓', - '' => '陔', - '' => '陏', - '' => '陑', - '' => '陓', - '' => '陊', - '' => '陎', - '' => '倞', - '' => '倅', - '' => '倇', - '' => '倓', - '' => '倢', - '' => '倰', - '' => '倛', - '' => '俵', - '' => '俴', - '' => '倳', - '' => '倷', - '' => '倬', - '' => '俶', - '' => '俷', - '' => '倗', - '' => '倜', - '' => '倠', - '' => '倧', - '' => '倵', - '' => '倯', - '' => '倱', - '' => '倎', - '' => '党', - '' => '冔', - '' => '冓', - '' => '凊', - '' => '凄', - '' => '凅', - '' => '凈', - '' => '凎', - '' => '剡', - '' => '剚', - '' => '剒', - '' => '剞', - '' => '剟', - '' => '剕', - '' => '剢', - '' => '勍', - '' => '匎', - '' => '厞', - '' => '唦', - '' => '哢', - '' => '唗', - '' => '唒', - '' => '哧', - '' => '哳', - '' => '哤', - '' => '唚', - '' => '哿', - '' => '唄', - '' => '唈', - '' => '哫', - '' => '唑', - '' => '唅', - '' => '哱', - '@' => '唊', - 'A' => '哻', - 'B' => '哷', - 'C' => '哸', - 'D' => '哠', - 'E' => '唎', - 'F' => '唃', - 'G' => '唋', - 'H' => '圁', - 'I' => '圂', - 'J' => '埌', - 'K' => '堲', - 'L' => '埕', - 'M' => '埒', - 'N' => '垺', - 'O' => '埆', - 'P' => '垽', - 'Q' => '垼', - 'R' => '垸', - 'S' => '垶', - 'T' => '垿', - 'U' => '埇', - 'V' => '埐', - 'W' => '垹', - 'X' => '埁', - 'Y' => '夎', - 'Z' => '奊', - '[' => '娙', - '\\' => '娖', - ']' => '娭', - '^' => '娮', - '_' => '娕', - '`' => '娏', - 'a' => '娗', - 'b' => '娊', - 'c' => '娞', - 'd' => '娳', - 'e' => '孬', - 'f' => '宧', - 'g' => '宭', - 'h' => '宬', - 'i' => '尃', - 'j' => '屖', - 'k' => '屔', - 'l' => '峬', - 'm' => '峿', - 'n' => '峮', - 'o' => '峱', - 'p' => '峷', - 'q' => '崀', - 'r' => '峹', - 's' => '帩', - 't' => '帨', - 'u' => '庨', - 'v' => '庮', - 'w' => '庪', - 'x' => '庬', - 'y' => '弳', - 'z' => '弰', - '{' => '彧', - '|' => '恝', - '}' => '恚', - '~' => '恧', - 'ѡ' => '恁', - 'Ѣ' => '悢', - 'ѣ' => '悈', - 'Ѥ' => '悀', - 'ѥ' => '悒', - 'Ѧ' => '悁', - 'ѧ' => '悝', - 'Ѩ' => '悃', - 'ѩ' => '悕', - 'Ѫ' => '悛', - 'ѫ' => '悗', - 'Ѭ' => '悇', - 'ѭ' => '悜', - 'Ѯ' => '悎', - 'ѯ' => '戙', - 'Ѱ' => '扆', - 'ѱ' => '拲', - 'Ѳ' => '挐', - 'ѳ' => '捖', - 'Ѵ' => '挬', - 'ѵ' => '捄', - 'Ѷ' => '捅', - 'ѷ' => '挶', - 'Ѹ' => '捃', - 'ѹ' => '揤', - 'Ѻ' => '挹', - 'ѻ' => '捋', - 'Ѽ' => '捊', - 'ѽ' => '挼', - 'Ѿ' => '挩', - 'ѿ' => '捁', - '' => '挴', - '' => '捘', - '' => '捔', - '' => '捙', - '' => '挭', - '' => '捇', - '' => '挳', - '' => '捚', - '' => '捑', - '' => '挸', - '' => '捗', - '' => '捀', - '' => '捈', - '' => '敊', - '' => '敆', - '' => '旆', - '' => '旃', - '' => '旄', - '' => '旂', - '' => '晊', - '' => '晟', - '' => '晇', - '' => '晑', - '' => '朒', - '' => '朓', - '' => '栟', - '' => '栚', - '' => '桉', - '' => '栲', - '' => '栳', - '' => '栻', - '' => '桋', - '' => '桏', - '' => '栖', - '' => '栱', - '' => '栜', - '' => '栵', - '' => '栫', - '' => '栭', - '' => '栯', - '' => '桎', - '' => '桄', - '' => '栴', - '' => '栝', - '' => '栒', - '' => '栔', - '' => '栦', - '' => '栨', - '' => '栮', - '' => '桍', - '' => '栺', - '' => '栥', - '' => '栠', - '' => '欬', - '' => '欯', - '' => '欭', - '' => '欱', - '' => '欴', - '' => '歭', - '' => '肂', - '' => '殈', - '' => '毦', - '' => '毤', - '@' => '毨', - 'A' => '毣', - 'B' => '毢', - 'C' => '毧', - 'D' => '氥', - 'E' => '浺', - 'F' => '浣', - 'G' => '浤', - 'H' => '浶', - 'I' => '洍', - 'J' => '浡', - 'K' => '涒', - 'L' => '浘', - 'M' => '浢', - 'N' => '浭', - 'O' => '浯', - 'P' => '涑', - 'Q' => '涍', - 'R' => '淯', - 'S' => '浿', - 'T' => '涆', - 'U' => '浞', - 'V' => '浧', - 'W' => '浠', - 'X' => '涗', - 'Y' => '浰', - 'Z' => '浼', - '[' => '浟', - '\\' => '涂', - ']' => '涘', - '^' => '洯', - '_' => '浨', - '`' => '涋', - 'a' => '浾', - 'b' => '涀', - 'c' => '涄', - 'd' => '洖', - 'e' => '涃', - 'f' => '浻', - 'g' => '浽', - 'h' => '浵', - 'i' => '涐', - 'j' => '烜', - 'k' => '烓', - 'l' => '烑', - 'm' => '烝', - 'n' => '烋', - 'o' => '缹', - 'p' => '烢', - 'q' => '烗', - 'r' => '烒', - 's' => '烞', - 't' => '烠', - 'u' => '烔', - 'v' => '烍', - 'w' => '烅', - 'x' => '烆', - 'y' => '烇', - 'z' => '烚', - '{' => '烎', - '|' => '烡', - '}' => '牂', - '~' => '牸', - 'ҡ' => '牷', - 'Ң' => '牶', - 'ң' => '猀', - 'Ҥ' => '狺', - 'ҥ' => '狴', - 'Ҧ' => '狾', - 'ҧ' => '狶', - 'Ҩ' => '狳', - 'ҩ' => '狻', - 'Ҫ' => '猁', - 'ҫ' => '珓', - 'Ҭ' => '珙', - 'ҭ' => '珥', - 'Ү' => '珖', - 'ү' => '玼', - 'Ұ' => '珧', - 'ұ' => '珣', - 'Ҳ' => '珩', - 'ҳ' => '珜', - 'Ҵ' => '珒', - 'ҵ' => '珛', - 'Ҷ' => '珔', - 'ҷ' => '珝', - 'Ҹ' => '珚', - 'ҹ' => '珗', - 'Һ' => '珘', - 'һ' => '珨', - 'Ҽ' => '瓞', - 'ҽ' => '瓟', - 'Ҿ' => '瓴', - 'ҿ' => '瓵', - '' => '甡', - '' => '畛', - '' => '畟', - '' => '疰', - '' => '痁', - '' => '疻', - '' => '痄', - '' => '痀', - '' => '疿', - '' => '疶', - '' => '疺', - '' => '皊', - '' => '盉', - '' => '眝', - '' => '眛', - '' => '眐', - '' => '眓', - '' => '眒', - '' => '眣', - '' => '眑', - '' => '眕', - '' => '眙', - '' => '眚', - '' => '眢', - '' => '眧', - '' => '砣', - '' => '砬', - '' => '砢', - '' => '砵', - '' => '砯', - '' => '砨', - '' => '砮', - '' => '砫', - '' => '砡', - '' => '砩', - '' => '砳', - '' => '砪', - '' => '砱', - '' => '祔', - '' => '祛', - '' => '祏', - '' => '祜', - '' => '祓', - '' => '祒', - '' => '祑', - '' => '秫', - '' => '秬', - '' => '秠', - '' => '秮', - '' => '秭', - '' => '秪', - '' => '秜', - '' => '秞', - '' => '秝', - '' => '窆', - '' => '窉', - '' => '窅', - '' => '窋', - '' => '窌', - '' => '窊', - '' => '窇', - '' => '竘', - '' => '笐', - '@' => '笄', - 'A' => '笓', - 'B' => '笅', - 'C' => '笏', - 'D' => '笈', - 'E' => '笊', - 'F' => '笎', - 'G' => '笉', - 'H' => '笒', - 'I' => '粄', - 'J' => '粑', - 'K' => '粊', - 'L' => '粌', - 'M' => '粈', - 'N' => '粍', - 'O' => '粅', - 'P' => '紞', - 'Q' => '紝', - 'R' => '紑', - 'S' => '紎', - 'T' => '紘', - 'U' => '紖', - 'V' => '紓', - 'W' => '紟', - 'X' => '紒', - 'Y' => '紏', - 'Z' => '紌', - '[' => '罜', - '\\' => '罡', - ']' => '罞', - '^' => '罠', - '_' => '罝', - '`' => '罛', - 'a' => '羖', - 'b' => '羒', - 'c' => '翃', - 'd' => '翂', - 'e' => '翀', - 'f' => '耖', - 'g' => '耾', - 'h' => '耹', - 'i' => '胺', - 'j' => '胲', - 'k' => '胹', - 'l' => '胵', - 'm' => '脁', - 'n' => '胻', - 'o' => '脀', - 'p' => '舁', - 'q' => '舯', - 'r' => '舥', - 's' => '茳', - 't' => '茭', - 'u' => '荄', - 'v' => '茙', - 'w' => '荑', - 'x' => '茥', - 'y' => '荖', - 'z' => '茿', - '{' => '荁', - '|' => '茦', - '}' => '茜', - '~' => '茢', - 'ӡ' => '荂', - 'Ӣ' => '荎', - 'ӣ' => '茛', - 'Ӥ' => '茪', - 'ӥ' => '茈', - 'Ӧ' => '茼', - 'ӧ' => '荍', - 'Ө' => '茖', - 'ө' => '茤', - 'Ӫ' => '茠', - 'ӫ' => '茷', - 'Ӭ' => '茯', - 'ӭ' => '茩', - 'Ӯ' => '荇', - 'ӯ' => '荅', - 'Ӱ' => '荌', - 'ӱ' => '荓', - 'Ӳ' => '茞', - 'ӳ' => '茬', - 'Ӵ' => '荋', - 'ӵ' => '茧', - 'Ӷ' => '荈', - 'ӷ' => '虓', - 'Ӹ' => '虒', - 'ӹ' => '蚢', - 'Ӻ' => '蚨', - 'ӻ' => '蚖', - 'Ӽ' => '蚍', - 'ӽ' => '蚑', - 'Ӿ' => '蚞', - 'ӿ' => '蚇', - '' => '蚗', - '' => '蚆', - '' => '蚋', - '' => '蚚', - '' => '蚅', - '' => '蚥', - '' => '蚙', - '' => '蚡', - '' => '蚧', - '' => '蚕', - '' => '蚘', - '' => '蚎', - '' => '蚝', - '' => '蚐', - '' => '蚔', - '' => '衃', - '' => '衄', - '' => '衭', - '' => '衵', - '' => '衶', - '' => '衲', - '' => '袀', - '' => '衱', - '' => '衿', - '' => '衯', - '' => '袃', - '' => '衾', - '' => '衴', - '' => '衼', - '' => '訒', - '' => '豇', - '' => '豗', - '' => '豻', - '' => '貤', - '' => '貣', - '' => '赶', - '' => '赸', - '' => '趵', - '' => '趷', - '' => '趶', - '' => '軑', - '' => '軓', - '' => '迾', - '' => '迵', - '' => '适', - '' => '迿', - '' => '迻', - '' => '逄', - '' => '迼', - '' => '迶', - '' => '郖', - '' => '郠', - '' => '郙', - '' => '郚', - '' => '郣', - '' => '郟', - '' => '郥', - '' => '郘', - '' => '郛', - '' => '郗', - '' => '郜', - '' => '郤', - '' => '酐', - '@' => '酎', - 'A' => '酏', - 'B' => '釕', - 'C' => '釢', - 'D' => '釚', - 'E' => '陜', - 'F' => '陟', - 'G' => '隼', - 'H' => '飣', - 'I' => '髟', - 'J' => '鬯', - 'K' => '乿', - 'L' => '偰', - 'M' => '偪', - 'N' => '偡', - 'O' => '偞', - 'P' => '偠', - 'Q' => '偓', - 'R' => '偋', - 'S' => '偝', - 'T' => '偲', - 'U' => '偈', - 'V' => '偍', - 'W' => '偁', - 'X' => '偛', - 'Y' => '偊', - 'Z' => '偢', - '[' => '倕', - '\\' => '偅', - ']' => '偟', - '^' => '偩', - '_' => '偫', - '`' => '偣', - 'a' => '偤', - 'b' => '偆', - 'c' => '偀', - 'd' => '偮', - 'e' => '偳', - 'f' => '偗', - 'g' => '偑', - 'h' => '凐', - 'i' => '剫', - 'j' => '剭', - 'k' => '剬', - 'l' => '剮', - 'm' => '勖', - 'n' => '勓', - 'o' => '匭', - 'p' => '厜', - 'q' => '啵', - 'r' => '啶', - 's' => '唼', - 't' => '啍', - 'u' => '啐', - 'v' => '唴', - 'w' => '唪', - 'x' => '啑', - 'y' => '啢', - 'z' => '唶', - '{' => '唵', - '|' => '唰', - '}' => '啒', - '~' => '啅', - 'ԡ' => '唌', - 'Ԣ' => '唲', - 'ԣ' => '啥', - 'Ԥ' => '啎', - 'ԥ' => '唹', - 'Ԧ' => '啈', - 'ԧ' => '唭', - 'Ԩ' => '唻', - 'ԩ' => '啀', - 'Ԫ' => '啋', - 'ԫ' => '圊', - 'Ԭ' => '圇', - 'ԭ' => '埻', - 'Ԯ' => '堔', - 'ԯ' => '埢', - '԰' => '埶', - 'Ա' => '埜', - 'Բ' => '埴', - 'Գ' => '堀', - 'Դ' => '埭', - 'Ե' => '埽', - 'Զ' => '堈', - 'Է' => '埸', - 'Ը' => '堋', - 'Թ' => '埳', - 'Ժ' => '埏', - 'Ի' => '堇', - 'Լ' => '埮', - 'Խ' => '埣', - 'Ծ' => '埲', - 'Կ' => '埥', - '' => '埬', - '' => '埡', - '' => '堎', - '' => '埼', - '' => '堐', - '' => '埧', - '' => '堁', - '' => '堌', - '' => '埱', - '' => '埩', - '' => '埰', - '' => '堍', - '' => '堄', - '' => '奜', - '' => '婠', - '' => '婘', - '' => '婕', - '' => '婧', - '' => '婞', - '' => '娸', - '' => '娵', - '' => '婭', - '' => '婐', - '' => '婟', - '' => '婥', - '' => '婬', - '' => '婓', - '' => '婤', - '' => '婗', - '' => '婃', - '' => '婝', - '' => '婒', - '' => '婄', - '' => '婛', - '' => '婈', - '' => '媎', - '' => '娾', - '' => '婍', - '' => '娹', - '' => '婌', - '' => '婰', - '' => '婩', - '' => '婇', - '' => '婑', - '' => '婖', - '' => '婂', - '' => '婜', - '' => '孲', - '' => '孮', - '' => '寁', - '' => '寀', - '' => '屙', - '' => '崞', - '' => '崋', - '' => '崝', - '' => '崚', - '' => '崠', - '' => '崌', - '' => '崨', - '' => '崍', - '' => '崦', - '' => '崥', - '' => '崏', - '@' => '崰', - 'A' => '崒', - 'B' => '崣', - 'C' => '崟', - 'D' => '崮', - 'E' => '帾', - 'F' => '帴', - 'G' => '庱', - 'H' => '庴', - 'I' => '庹', - 'J' => '庲', - 'K' => '庳', - 'L' => '弶', - 'M' => '弸', - 'N' => '徛', - 'O' => '徖', - 'P' => '徟', - 'Q' => '悊', - 'R' => '悐', - 'S' => '悆', - 'T' => '悾', - 'U' => '悰', - 'V' => '悺', - 'W' => '惓', - 'X' => '惔', - 'Y' => '惏', - 'Z' => '惤', - '[' => '惙', - '\\' => '惝', - ']' => '惈', - '^' => '悱', - '_' => '惛', - '`' => '悷', - 'a' => '惊', - 'b' => '悿', - 'c' => '惃', - 'd' => '惍', - 'e' => '惀', - 'f' => '挲', - 'g' => '捥', - 'h' => '掊', - 'i' => '掂', - 'j' => '捽', - 'k' => '掽', - 'l' => '掞', - 'm' => '掭', - 'n' => '掝', - 'o' => '掗', - 'p' => '掫', - 'q' => '掎', - 'r' => '捯', - 's' => '掇', - 't' => '掐', - 'u' => '据', - 'v' => '掯', - 'w' => '捵', - 'x' => '掜', - 'y' => '捭', - 'z' => '掮', - '{' => '捼', - '|' => '掤', - '}' => '挻', - '~' => '掟', - 'ա' => '捸', - 'բ' => '掅', - 'գ' => '掁', - 'դ' => '掑', - 'ե' => '掍', - 'զ' => '捰', - 'է' => '敓', - 'ը' => '旍', - 'թ' => '晥', - 'ժ' => '晡', - 'ի' => '晛', - 'լ' => '晙', - 'խ' => '晜', - 'ծ' => '晢', - 'կ' => '朘', - 'հ' => '桹', - 'ձ' => '梇', - 'ղ' => '梐', - 'ճ' => '梜', - 'մ' => '桭', - 'յ' => '桮', - 'ն' => '梮', - 'շ' => '梫', - 'ո' => '楖', - 'չ' => '桯', - 'պ' => '梣', - 'ջ' => '梬', - 'ռ' => '梩', - 'ս' => '桵', - 'վ' => '桴', - 'տ' => '梲', - '' => '梏', - '' => '桷', - '' => '梒', - '' => '桼', - '' => '桫', - '' => '桲', - '' => '梪', - '' => '梀', - '' => '桱', - '' => '桾', - '' => '梛', - '' => '梖', - '' => '梋', - '' => '梠', - '' => '梉', - '' => '梤', - '' => '桸', - '' => '桻', - '' => '梑', - '' => '梌', - '' => '梊', - '' => '桽', - '' => '欶', - '' => '欳', - '' => '欷', - '' => '欸', - '' => '殑', - '' => '殏', - '' => '殍', - '' => '殎', - '' => '殌', - '' => '氪', - '' => '淀', - '' => '涫', - '' => '涴', - '' => '涳', - '' => '湴', - '' => '涬', - '' => '淩', - '' => '淢', - '' => '涷', - '' => '淶', - '' => '淔', - '' => '渀', - '' => '淈', - '' => '淠', - '' => '淟', - '' => '淖', - '' => '涾', - '' => '淥', - '' => '淜', - '' => '淝', - '' => '淛', - '' => '淴', - '' => '淊', - '' => '涽', - '' => '淭', - '' => '淰', - '' => '涺', - '' => '淕', - '' => '淂', - '' => '淏', - '' => '淉', - '@' => '淐', - 'A' => '淲', - 'B' => '淓', - 'C' => '淽', - 'D' => '淗', - 'E' => '淍', - 'F' => '淣', - 'G' => '涻', - 'H' => '烺', - 'I' => '焍', - 'J' => '烷', - 'K' => '焗', - 'L' => '烴', - 'M' => '焌', - 'N' => '烰', - 'O' => '焄', - 'P' => '烳', - 'Q' => '焐', - 'R' => '烼', - 'S' => '烿', - 'T' => '焆', - 'U' => '焓', - 'V' => '焀', - 'W' => '烸', - 'X' => '烶', - 'Y' => '焋', - 'Z' => '焂', - '[' => '焎', - '\\' => '牾', - ']' => '牻', - '^' => '牼', - '_' => '牿', - '`' => '猝', - 'a' => '猗', - 'b' => '猇', - 'c' => '猑', - 'd' => '猘', - 'e' => '猊', - 'f' => '猈', - 'g' => '狿', - 'h' => '猏', - 'i' => '猞', - 'j' => '玈', - 'k' => '珶', - 'l' => '珸', - 'm' => '珵', - 'n' => '琄', - 'o' => '琁', - 'p' => '珽', - 'q' => '琇', - 'r' => '琀', - 's' => '珺', - 't' => '珼', - 'u' => '珿', - 'v' => '琌', - 'w' => '琋', - 'x' => '珴', - 'y' => '琈', - 'z' => '畤', - '{' => '畣', - '|' => '痎', - '}' => '痒', - '~' => '痏', - '֡' => '痋', - '֢' => '痌', - '֣' => '痑', - '֤' => '痐', - '֥' => '皏', - '֦' => '皉', - '֧' => '盓', - '֨' => '眹', - '֩' => '眯', - '֪' => '眭', - '֫' => '眱', - '֬' => '眲', - '֭' => '眴', - '֮' => '眳', - '֯' => '眽', - 'ְ' => '眥', - 'ֱ' => '眻', - 'ֲ' => '眵', - 'ֳ' => '硈', - 'ִ' => '硒', - 'ֵ' => '硉', - 'ֶ' => '硍', - 'ַ' => '硊', - 'ָ' => '硌', - 'ֹ' => '砦', - 'ֺ' => '硅', - 'ֻ' => '硐', - 'ּ' => '祤', - 'ֽ' => '祧', - '־' => '祩', - 'ֿ' => '祪', - '' => '祣', - '' => '祫', - '' => '祡', - '' => '离', - '' => '秺', - '' => '秸', - '' => '秶', - '' => '秷', - '' => '窏', - '' => '窔', - '' => '窐', - '' => '笵', - '' => '筇', - '' => '笴', - '' => '笥', - '' => '笰', - '' => '笢', - '' => '笤', - '' => '笳', - '' => '笘', - '' => '笪', - '' => '笝', - '' => '笱', - '' => '笫', - '' => '笭', - '' => '笯', - '' => '笲', - '' => '笸', - '' => '笚', - '' => '笣', - '' => '粔', - '' => '粘', - '' => '粖', - '' => '粣', - '' => '紵', - '' => '紽', - '' => '紸', - '' => '紶', - '' => '紺', - '' => '絅', - '' => '紬', - '' => '紩', - '' => '絁', - '' => '絇', - '' => '紾', - '' => '紿', - '' => '絊', - '' => '紻', - '' => '紨', - '' => '罣', - '' => '羕', - '' => '羜', - '' => '羝', - '' => '羛', - '' => '翊', - '' => '翋', - '' => '翍', - '' => '翐', - '' => '翑', - '' => '翇', - '' => '翏', - '' => '翉', - '' => '耟', - '@' => '耞', - 'A' => '耛', - 'B' => '聇', - 'C' => '聃', - 'D' => '聈', - 'E' => '脘', - 'F' => '脥', - 'G' => '脙', - 'H' => '脛', - 'I' => '脭', - 'J' => '脟', - 'K' => '脬', - 'L' => '脞', - 'M' => '脡', - 'N' => '脕', - 'O' => '脧', - 'P' => '脝', - 'Q' => '脢', - 'R' => '舑', - 'S' => '舸', - 'T' => '舳', - 'U' => '舺', - 'V' => '舴', - 'W' => '舲', - 'X' => '艴', - 'Y' => '莐', - 'Z' => '莣', - '[' => '莨', - '\\' => '莍', - ']' => '荺', - '^' => '荳', - '_' => '莤', - '`' => '荴', - 'a' => '莏', - 'b' => '莁', - 'c' => '莕', - 'd' => '莙', - 'e' => '荵', - 'f' => '莔', - 'g' => '莩', - 'h' => '荽', - 'i' => '莃', - 'j' => '莌', - 'k' => '莝', - 'l' => '莛', - 'm' => '莪', - 'n' => '莋', - 'o' => '荾', - 'p' => '莥', - 'q' => '莯', - 'r' => '莈', - 's' => '莗', - 't' => '莰', - 'u' => '荿', - 'v' => '莦', - 'w' => '莇', - 'x' => '莮', - 'y' => '荶', - 'z' => '莚', - '{' => '虙', - '|' => '虖', - '}' => '蚿', - '~' => '蚷', - 'ס' => '蛂', - 'ע' => '蛁', - 'ף' => '蛅', - 'פ' => '蚺', - 'ץ' => '蚰', - 'צ' => '蛈', - 'ק' => '蚹', - 'ר' => '蚳', - 'ש' => '蚸', - 'ת' => '蛌', - '׫' => '蚴', - '׬' => '蚻', - '׭' => '蚼', - '׮' => '蛃', - 'ׯ' => '蚽', - 'װ' => '蚾', - 'ױ' => '衒', - 'ײ' => '袉', - '׳' => '袕', - '״' => '袨', - '׵' => '袢', - '׶' => '袪', - '׷' => '袚', - '׸' => '袑', - '׹' => '袡', - '׺' => '袟', - '׻' => '袘', - '׼' => '袧', - '׽' => '袙', - '׾' => '袛', - '׿' => '袗', - '' => '袤', - '' => '袬', - '' => '袌', - '' => '袓', - '' => '袎', - '' => '覂', - '' => '觖', - '' => '觙', - '' => '觕', - '' => '訰', - '' => '訧', - '' => '訬', - '' => '訞', - '' => '谹', - '' => '谻', - '' => '豜', - '' => '豝', - '' => '豽', - '' => '貥', - '' => '赽', - '' => '赻', - '' => '赹', - '' => '趼', - '' => '跂', - '' => '趹', - '' => '趿', - '' => '跁', - '' => '軘', - '' => '軞', - '' => '軝', - '' => '軜', - '' => '軗', - '' => '軠', - '' => '軡', - '' => '逤', - '' => '逋', - '' => '逑', - '' => '逜', - '' => '逌', - '' => '逡', - '' => '郯', - '' => '郪', - '' => '郰', - '' => '郴', - '' => '郲', - '' => '郳', - '' => '郔', - '' => '郫', - '' => '郬', - '' => '郩', - '' => '酖', - '' => '酘', - '' => '酚', - '' => '酓', - '' => '酕', - '' => '釬', - '' => '釴', - '' => '釱', - '' => '釳', - '' => '釸', - '' => '釤', - '' => '釹', - '' => '釪', - '@' => '釫', - 'A' => '釷', - 'B' => '釨', - 'C' => '釮', - 'D' => '镺', - 'E' => '閆', - 'F' => '閈', - 'G' => '陼', - 'H' => '陭', - 'I' => '陫', - 'J' => '陱', - 'K' => '陯', - 'L' => '隿', - 'M' => '靪', - 'N' => '頄', - 'O' => '飥', - 'P' => '馗', - 'Q' => '傛', - 'R' => '傕', - 'S' => '傔', - 'T' => '傞', - 'U' => '傋', - 'V' => '傣', - 'W' => '傃', - 'X' => '傌', - 'Y' => '傎', - 'Z' => '傝', - '[' => '偨', - '\\' => '傜', - ']' => '傒', - '^' => '傂', - '_' => '傇', - '`' => '兟', - 'a' => '凔', - 'b' => '匒', - 'c' => '匑', - 'd' => '厤', - 'e' => '厧', - 'f' => '喑', - 'g' => '喨', - 'h' => '喥', - 'i' => '喭', - 'j' => '啷', - 'k' => '噅', - 'l' => '喢', - 'm' => '喓', - 'n' => '喈', - 'o' => '喏', - 'p' => '喵', - 'q' => '喁', - 'r' => '喣', - 's' => '喒', - 't' => '喤', - 'u' => '啽', - 'v' => '喌', - 'w' => '喦', - 'x' => '啿', - 'y' => '喕', - 'z' => '喡', - '{' => '喎', - '|' => '圌', - '}' => '堩', - '~' => '堷', - 'ء' => '堙', - 'آ' => '堞', - 'أ' => '堧', - 'ؤ' => '堣', - 'إ' => '堨', - 'ئ' => '埵', - 'ا' => '塈', - 'ب' => '堥', - 'ة' => '堜', - 'ت' => '堛', - 'ث' => '堳', - 'ج' => '堿', - 'ح' => '堶', - 'خ' => '堮', - 'د' => '堹', - 'ذ' => '堸', - 'ر' => '堭', - 'ز' => '堬', - 'س' => '堻', - 'ش' => '奡', - 'ص' => '媯', - 'ض' => '媔', - 'ط' => '媟', - 'ظ' => '婺', - 'ع' => '媢', - 'غ' => '媞', - 'ػ' => '婸', - 'ؼ' => '媦', - 'ؽ' => '婼', - 'ؾ' => '媥', - 'ؿ' => '媬', - '' => '媕', - '' => '媮', - '' => '娷', - '' => '媄', - '' => '媊', - '' => '媗', - '' => '媃', - '' => '媋', - '' => '媩', - '' => '婻', - '' => '婽', - '' => '媌', - '' => '媜', - '' => '媏', - '' => '媓', - '' => '媝', - '' => '寪', - '' => '寍', - '' => '寋', - '' => '寔', - '' => '寑', - '' => '寊', - '' => '寎', - '' => '尌', - '' => '尰', - '' => '崷', - '' => '嵃', - '' => '嵫', - '' => '嵁', - '' => '嵋', - '' => '崿', - '' => '崵', - '' => '嵑', - '' => '嵎', - '' => '嵕', - '' => '崳', - '' => '崺', - '' => '嵒', - '' => '崽', - '' => '崱', - '' => '嵙', - '' => '嵂', - '' => '崹', - '' => '嵉', - '' => '崸', - '' => '崼', - '' => '崲', - '' => '崶', - '' => '嵀', - '' => '嵅', - '' => '幄', - '' => '幁', - '' => '彘', - '' => '徦', - '' => '徥', - '' => '徫', - '' => '惉', - '' => '悹', - '' => '惌', - '' => '惢', - '' => '惎', - '' => '惄', - '' => '愔', - '@' => '惲', - 'A' => '愊', - 'B' => '愖', - 'C' => '愅', - 'D' => '惵', - 'E' => '愓', - 'F' => '惸', - 'G' => '惼', - 'H' => '惾', - 'I' => '惁', - 'J' => '愃', - 'K' => '愘', - 'L' => '愝', - 'M' => '愐', - 'N' => '惿', - 'O' => '愄', - 'P' => '愋', - 'Q' => '扊', - 'R' => '掔', - 'S' => '掱', - 'T' => '掰', - 'U' => '揎', - 'V' => '揥', - 'W' => '揨', - 'X' => '揯', - 'Y' => '揃', - 'Z' => '撝', - '[' => '揳', - '\\' => '揊', - ']' => '揠', - '^' => '揶', - '_' => '揕', - '`' => '揲', - 'a' => '揵', - 'b' => '摡', - 'c' => '揟', - 'd' => '掾', - 'e' => '揝', - 'f' => '揜', - 'g' => '揄', - 'h' => '揘', - 'i' => '揓', - 'j' => '揂', - 'k' => '揇', - 'l' => '揌', - 'm' => '揋', - 'n' => '揈', - 'o' => '揰', - 'p' => '揗', - 'q' => '揙', - 'r' => '攲', - 's' => '敧', - 't' => '敪', - 'u' => '敤', - 'v' => '敜', - 'w' => '敨', - 'x' => '敥', - 'y' => '斌', - 'z' => '斝', - '{' => '斞', - '|' => '斮', - '}' => '旐', - '~' => '旒', - '١' => '晼', - '٢' => '晬', - '٣' => '晻', - '٤' => '暀', - '٥' => '晱', - '٦' => '晹', - '٧' => '晪', - '٨' => '晲', - '٩' => '朁', - '٪' => '椌', - '٫' => '棓', - '٬' => '椄', - '٭' => '棜', - 'ٮ' => '椪', - 'ٯ' => '棬', - 'ٰ' => '棪', - 'ٱ' => '棱', - 'ٲ' => '椏', - 'ٳ' => '棖', - 'ٴ' => '棷', - 'ٵ' => '棫', - 'ٶ' => '棤', - 'ٷ' => '棶', - 'ٸ' => '椓', - 'ٹ' => '椐', - 'ٺ' => '棳', - 'ٻ' => '棡', - 'ټ' => '椇', - 'ٽ' => '棌', - 'پ' => '椈', - 'ٿ' => '楰', - '' => '梴', - '' => '椑', - '' => '棯', - '' => '棆', - '' => '椔', - '' => '棸', - '' => '棐', - '' => '棽', - '' => '棼', - '' => '棨', - '' => '椋', - '' => '椊', - '' => '椗', - '' => '棎', - '' => '棈', - '' => '棝', - '' => '棞', - '' => '棦', - '' => '棴', - '' => '棑', - '' => '椆', - '' => '棔', - '' => '棩', - '' => '椕', - '' => '椥', - '' => '棇', - '' => '欹', - '' => '欻', - '' => '欿', - '' => '欼', - '' => '殔', - '' => '殗', - '' => '殙', - '' => '殕', - '' => '殽', - '' => '毰', - '' => '毲', - '' => '毳', - '' => '氰', - '' => '淼', - '' => '湆', - '' => '湇', - '' => '渟', - '' => '湉', - '' => '溈', - '' => '渼', - '' => '渽', - '' => '湅', - '' => '湢', - '' => '渫', - '' => '渿', - '' => '湁', - '' => '湝', - '' => '湳', - '' => '渜', - '' => '渳', - '' => '湋', - '' => '湀', - '' => '湑', - '' => '渻', - '' => '渃', - '' => '渮', - '' => '湞', - '@' => '湨', - 'A' => '湜', - 'B' => '湡', - 'C' => '渱', - 'D' => '渨', - 'E' => '湠', - 'F' => '湱', - 'G' => '湫', - 'H' => '渹', - 'I' => '渢', - 'J' => '渰', - 'K' => '湓', - 'L' => '湥', - 'M' => '渧', - 'N' => '湸', - 'O' => '湤', - 'P' => '湷', - 'Q' => '湕', - 'R' => '湹', - 'S' => '湒', - 'T' => '湦', - 'U' => '渵', - 'V' => '渶', - 'W' => '湚', - 'X' => '焠', - 'Y' => '焞', - 'Z' => '焯', - '[' => '烻', - '\\' => '焮', - ']' => '焱', - '^' => '焣', - '_' => '焥', - '`' => '焢', - 'a' => '焲', - 'b' => '焟', - 'c' => '焨', - 'd' => '焺', - 'e' => '焛', - 'f' => '牋', - 'g' => '牚', - 'h' => '犈', - 'i' => '犉', - 'j' => '犆', - 'k' => '犅', - 'l' => '犋', - 'm' => '猒', - 'n' => '猋', - 'o' => '猰', - 'p' => '猢', - 'q' => '猱', - 'r' => '猳', - 's' => '猧', - 't' => '猲', - 'u' => '猭', - 'v' => '猦', - 'w' => '猣', - 'x' => '猵', - 'y' => '猌', - 'z' => '琮', - '{' => '琬', - '|' => '琰', - '}' => '琫', - '~' => '琖', - 'ڡ' => '琚', - 'ڢ' => '琡', - 'ڣ' => '琭', - 'ڤ' => '琱', - 'ڥ' => '琤', - 'ڦ' => '琣', - 'ڧ' => '琝', - 'ڨ' => '琩', - 'ک' => '琠', - 'ڪ' => '琲', - 'ګ' => '瓻', - 'ڬ' => '甯', - 'ڭ' => '畯', - 'ڮ' => '畬', - 'گ' => '痧', - 'ڰ' => '痚', - 'ڱ' => '痡', - 'ڲ' => '痦', - 'ڳ' => '痝', - 'ڴ' => '痟', - 'ڵ' => '痤', - 'ڶ' => '痗', - 'ڷ' => '皕', - 'ڸ' => '皒', - 'ڹ' => '盚', - 'ں' => '睆', - 'ڻ' => '睇', - 'ڼ' => '睄', - 'ڽ' => '睍', - 'ھ' => '睅', - 'ڿ' => '睊', - '' => '睎', - '' => '睋', - '' => '睌', - '' => '矞', - '' => '矬', - '' => '硠', - '' => '硤', - '' => '硥', - '' => '硜', - '' => '硭', - '' => '硱', - '' => '硪', - '' => '确', - '' => '硰', - '' => '硩', - '' => '硨', - '' => '硞', - '' => '硢', - '' => '祴', - '' => '祳', - '' => '祲', - '' => '祰', - '' => '稂', - '' => '稊', - '' => '稃', - '' => '稌', - '' => '稄', - '' => '窙', - '' => '竦', - '' => '竤', - '' => '筊', - '' => '笻', - '' => '筄', - '' => '筈', - '' => '筌', - '' => '筎', - '' => '筀', - '' => '筘', - '' => '筅', - '' => '粢', - '' => '粞', - '' => '粨', - '' => '粡', - '' => '絘', - '' => '絯', - '' => '絣', - '' => '絓', - '' => '絖', - '' => '絧', - '' => '絪', - '' => '絏', - '' => '絭', - '' => '絜', - '' => '絫', - '' => '絒', - '' => '絔', - '' => '絩', - '' => '絑', - '' => '絟', - '' => '絎', - '' => '缾', - '' => '缿', - '' => '罥', - '@' => '罦', - 'A' => '羢', - 'B' => '羠', - 'C' => '羡', - 'D' => '翗', - 'E' => '聑', - 'F' => '聏', - 'G' => '聐', - 'H' => '胾', - 'I' => '胔', - 'J' => '腃', - 'K' => '腊', - 'L' => '腒', - 'M' => '腏', - 'N' => '腇', - 'O' => '脽', - 'P' => '腍', - 'Q' => '脺', - 'R' => '臦', - 'S' => '臮', - 'T' => '臷', - 'U' => '臸', - 'V' => '臹', - 'W' => '舄', - 'X' => '舼', - 'Y' => '舽', - 'Z' => '舿', - '[' => '艵', - '\\' => '茻', - ']' => '菏', - '^' => '菹', - '_' => '萣', - '`' => '菀', - 'a' => '菨', - 'b' => '萒', - 'c' => '菧', - 'd' => '菤', - 'e' => '菼', - 'f' => '菶', - 'g' => '萐', - 'h' => '菆', - 'i' => '菈', - 'j' => '菫', - 'k' => '菣', - 'l' => '莿', - 'm' => '萁', - 'n' => '菝', - 'o' => '菥', - 'p' => '菘', - 'q' => '菿', - 'r' => '菡', - 's' => '菋', - 't' => '菎', - 'u' => '菖', - 'v' => '菵', - 'w' => '菉', - 'x' => '萉', - 'y' => '萏', - 'z' => '菞', - '{' => '萑', - '|' => '萆', - '}' => '菂', - '~' => '菳', - 'ۡ' => '菕', - 'ۢ' => '菺', - 'ۣ' => '菇', - 'ۤ' => '菑', - 'ۥ' => '菪', - 'ۦ' => '萓', - 'ۧ' => '菃', - 'ۨ' => '菬', - '۩' => '菮', - '۪' => '菄', - '۫' => '菻', - '۬' => '菗', - 'ۭ' => '菢', - 'ۮ' => '萛', - 'ۯ' => '菛', - '۰' => '菾', - '۱' => '蛘', - '۲' => '蛢', - '۳' => '蛦', - '۴' => '蛓', - '۵' => '蛣', - '۶' => '蛚', - '۷' => '蛪', - '۸' => '蛝', - '۹' => '蛫', - 'ۺ' => '蛜', - 'ۻ' => '蛬', - 'ۼ' => '蛩', - '۽' => '蛗', - '۾' => '蛨', - 'ۿ' => '蛑', - '' => '衈', - '' => '衖', - '' => '衕', - '' => '袺', - '' => '裗', - '' => '袹', - '' => '袸', - '' => '裀', - '' => '袾', - '' => '袶', - '' => '袼', - '' => '袷', - '' => '袽', - '' => '袲', - '' => '褁', - '' => '裉', - '' => '覕', - '' => '覘', - '' => '覗', - '' => '觝', - '' => '觚', - '' => '觛', - '' => '詎', - '' => '詍', - '' => '訹', - '' => '詙', - '' => '詀', - '' => '詗', - '' => '詘', - '' => '詄', - '' => '詅', - '' => '詒', - '' => '詈', - '' => '詑', - '' => '詊', - '' => '詌', - '' => '詏', - '' => '豟', - '' => '貁', - '' => '貀', - '' => '貺', - '' => '貾', - '' => '貰', - '' => '貹', - '' => '貵', - '' => '趄', - '' => '趀', - '' => '趉', - '' => '跘', - '' => '跓', - '' => '跍', - '' => '跇', - '' => '跖', - '' => '跜', - '' => '跏', - '' => '跕', - '' => '跙', - '' => '跈', - '' => '跗', - '' => '跅', - '' => '軯', - '' => '軷', - '' => '軺', - '@' => '軹', - 'A' => '軦', - 'B' => '軮', - 'C' => '軥', - 'D' => '軵', - 'E' => '軧', - 'F' => '軨', - 'G' => '軶', - 'H' => '軫', - 'I' => '軱', - 'J' => '軬', - 'K' => '軴', - 'L' => '軩', - 'M' => '逭', - 'N' => '逴', - 'O' => '逯', - 'P' => '鄆', - 'Q' => '鄬', - 'R' => '鄄', - 'S' => '郿', - 'T' => '郼', - 'U' => '鄈', - 'V' => '郹', - 'W' => '郻', - 'X' => '鄁', - 'Y' => '鄀', - 'Z' => '鄇', - '[' => '鄅', - '\\' => '鄃', - ']' => '酡', - '^' => '酤', - '_' => '酟', - '`' => '酢', - 'a' => '酠', - 'b' => '鈁', - 'c' => '鈊', - 'd' => '鈥', - 'e' => '鈃', - 'f' => '鈚', - 'g' => '鈦', - 'h' => '鈏', - 'i' => '鈌', - 'j' => '鈀', - 'k' => '鈒', - 'l' => '釿', - 'm' => '釽', - 'n' => '鈆', - 'o' => '鈄', - 'p' => '鈧', - 'q' => '鈂', - 'r' => '鈜', - 's' => '鈤', - 't' => '鈙', - 'u' => '鈗', - 'v' => '鈅', - 'w' => '鈖', - 'x' => '镻', - 'y' => '閍', - 'z' => '閌', - '{' => '閐', - '|' => '隇', - '}' => '陾', - '~' => '隈', - 'ܡ' => '隉', - 'ܢ' => '隃', - 'ܣ' => '隀', - 'ܤ' => '雂', - 'ܥ' => '雈', - 'ܦ' => '雃', - 'ܧ' => '雱', - 'ܨ' => '雰', - 'ܩ' => '靬', - 'ܪ' => '靰', - 'ܫ' => '靮', - 'ܬ' => '頇', - 'ܭ' => '颩', - 'ܮ' => '飫', - 'ܯ' => '鳦', - 'ܰ' => '黹', - 'ܱ' => '亃', - 'ܲ' => '亄', - 'ܳ' => '亶', - 'ܴ' => '傽', - 'ܵ' => '傿', - 'ܶ' => '僆', - 'ܷ' => '傮', - 'ܸ' => '僄', - 'ܹ' => '僊', - 'ܺ' => '傴', - 'ܻ' => '僈', - 'ܼ' => '僂', - 'ܽ' => '傰', - 'ܾ' => '僁', - 'ܿ' => '傺', - '' => '傱', - '' => '僋', - '' => '僉', - '' => '傶', - '' => '傸', - '' => '凗', - '' => '剺', - '' => '剸', - '' => '剻', - '' => '剼', - '' => '嗃', - '' => '嗛', - '' => '嗌', - '' => '嗐', - '' => '嗋', - '' => '嗊', - '' => '嗝', - '' => '嗀', - '' => '嗔', - '' => '嗄', - '' => '嗩', - '' => '喿', - '' => '嗒', - '' => '喍', - '' => '嗏', - '' => '嗕', - '' => '嗢', - '' => '嗖', - '' => '嗈', - '' => '嗲', - '' => '嗍', - '' => '嗙', - '' => '嗂', - '' => '圔', - '' => '塓', - '' => '塨', - '' => '塤', - '' => '塏', - '' => '塍', - '' => '塉', - '' => '塯', - '' => '塕', - '' => '塎', - '' => '塝', - '' => '塙', - '' => '塥', - '' => '塛', - '' => '堽', - '' => '塣', - '' => '塱', - '' => '壼', - '' => '嫇', - '' => '嫄', - '' => '嫋', - '' => '媺', - '' => '媸', - '' => '媱', - '' => '媵', - '' => '媰', - '' => '媿', - '' => '嫈', - '' => '媻', - '' => '嫆', - '@' => '媷', - 'A' => '嫀', - 'B' => '嫊', - 'C' => '媴', - 'D' => '媶', - 'E' => '嫍', - 'F' => '媹', - 'G' => '媐', - 'H' => '寖', - 'I' => '寘', - 'J' => '寙', - 'K' => '尟', - 'L' => '尳', - 'M' => '嵱', - 'N' => '嵣', - 'O' => '嵊', - 'P' => '嵥', - 'Q' => '嵲', - 'R' => '嵬', - 'S' => '嵞', - 'T' => '嵨', - 'U' => '嵧', - 'V' => '嵢', - 'W' => '巰', - 'X' => '幏', - 'Y' => '幎', - 'Z' => '幊', - '[' => '幍', - '\\' => '幋', - ']' => '廅', - '^' => '廌', - '_' => '廆', - '`' => '廋', - 'a' => '廇', - 'b' => '彀', - 'c' => '徯', - 'd' => '徭', - 'e' => '惷', - 'f' => '慉', - 'g' => '慊', - 'h' => '愫', - 'i' => '慅', - 'j' => '愶', - 'k' => '愲', - 'l' => '愮', - 'm' => '慆', - 'n' => '愯', - 'o' => '慏', - 'p' => '愩', - 'q' => '慀', - 'r' => '戠', - 's' => '酨', - 't' => '戣', - 'u' => '戥', - 'v' => '戤', - 'w' => '揅', - 'x' => '揱', - 'y' => '揫', - 'z' => '搐', - '{' => '搒', - '|' => '搉', - '}' => '搠', - '~' => '搤', - 'ݡ' => '搳', - 'ݢ' => '摃', - 'ݣ' => '搟', - 'ݤ' => '搕', - 'ݥ' => '搘', - 'ݦ' => '搹', - 'ݧ' => '搷', - 'ݨ' => '搢', - 'ݩ' => '搣', - 'ݪ' => '搌', - 'ݫ' => '搦', - 'ݬ' => '搰', - 'ݭ' => '搨', - 'ݮ' => '摁', - 'ݯ' => '搵', - 'ݰ' => '搯', - 'ݱ' => '搊', - 'ݲ' => '搚', - 'ݳ' => '摀', - 'ݴ' => '搥', - 'ݵ' => '搧', - 'ݶ' => '搋', - 'ݷ' => '揧', - 'ݸ' => '搛', - 'ݹ' => '搮', - 'ݺ' => '搡', - 'ݻ' => '搎', - 'ݼ' => '敯', - 'ݽ' => '斒', - 'ݾ' => '旓', - 'ݿ' => '暆', - '' => '暌', - '' => '暕', - '' => '暐', - '' => '暋', - '' => '暊', - '' => '暙', - '' => '暔', - '' => '晸', - '' => '朠', - '' => '楦', - '' => '楟', - '' => '椸', - '' => '楎', - '' => '楢', - '' => '楱', - '' => '椿', - '' => '楅', - '' => '楪', - '' => '椹', - '' => '楂', - '' => '楗', - '' => '楙', - '' => '楺', - '' => '楈', - '' => '楉', - '' => '椵', - '' => '楬', - '' => '椳', - '' => '椽', - '' => '楥', - '' => '棰', - '' => '楸', - '' => '椴', - '' => '楩', - '' => '楀', - '' => '楯', - '' => '楄', - '' => '楶', - '' => '楘', - '' => '楁', - '' => '楴', - '' => '楌', - '' => '椻', - '' => '楋', - '' => '椷', - '' => '楜', - '' => '楏', - '' => '楑', - '' => '椲', - '' => '楒', - '' => '椯', - '' => '楻', - '' => '椼', - '' => '歆', - '' => '歅', - '' => '歃', - '' => '歂', - '' => '歈', - '' => '歁', - '' => '殛', - '' => '嗀', - '' => '毻', - '' => '毼', - '@' => '毹', - 'A' => '毷', - 'B' => '毸', - 'C' => '溛', - 'D' => '滖', - 'E' => '滈', - 'F' => '溏', - 'G' => '滀', - 'H' => '溟', - 'I' => '溓', - 'J' => '溔', - 'K' => '溠', - 'L' => '溱', - 'M' => '溹', - 'N' => '滆', - 'O' => '滒', - 'P' => '溽', - 'Q' => '滁', - 'R' => '溞', - 'S' => '滉', - 'T' => '溷', - 'U' => '溰', - 'V' => '滍', - 'W' => '溦', - 'X' => '滏', - 'Y' => '溲', - 'Z' => '溾', - '[' => '滃', - '\\' => '滜', - ']' => '滘', - '^' => '溙', - '_' => '溒', - '`' => '溎', - 'a' => '溍', - 'b' => '溤', - 'c' => '溡', - 'd' => '溿', - 'e' => '溳', - 'f' => '滐', - 'g' => '滊', - 'h' => '溗', - 'i' => '溮', - 'j' => '溣', - 'k' => '煇', - 'l' => '煔', - 'm' => '煒', - 'n' => '煣', - 'o' => '煠', - 'p' => '煁', - 'q' => '煝', - 'r' => '煢', - 's' => '煲', - 't' => '煸', - 'u' => '煪', - 'v' => '煡', - 'w' => '煂', - 'x' => '煘', - 'y' => '煃', - 'z' => '煋', - '{' => '煰', - '|' => '煟', - '}' => '煐', - '~' => '煓', - 'ޡ' => '煄', - 'ޢ' => '煍', - 'ޣ' => '煚', - 'ޤ' => '牏', - 'ޥ' => '犍', - 'ަ' => '犌', - 'ާ' => '犑', - 'ި' => '犐', - 'ީ' => '犎', - 'ު' => '猼', - 'ޫ' => '獂', - 'ެ' => '猻', - 'ޭ' => '猺', - 'ޮ' => '獀', - 'ޯ' => '獊', - 'ް' => '獉', - 'ޱ' => '瑄', - '޲' => '瑊', - '޳' => '瑋', - '޴' => '瑒', - '޵' => '瑑', - '޶' => '瑗', - '޷' => '瑀', - '޸' => '瑏', - '޹' => '瑐', - '޺' => '瑎', - '޻' => '瑂', - '޼' => '瑆', - '޽' => '瑍', - '޾' => '瑔', - '޿' => '瓡', - '' => '瓿', - '' => '瓾', - '' => '瓽', - '' => '甝', - '' => '畹', - '' => '畷', - '' => '榃', - '' => '痯', - '' => '瘏', - '' => '瘃', - '' => '痷', - '' => '痾', - '' => '痼', - '' => '痹', - '' => '痸', - '' => '瘐', - '' => '痻', - '' => '痶', - '' => '痭', - '' => '痵', - '' => '痽', - '' => '皙', - '' => '皵', - '' => '盝', - '' => '睕', - '' => '睟', - '' => '睠', - '' => '睒', - '' => '睖', - '' => '睚', - '' => '睩', - '' => '睧', - '' => '睔', - '' => '睙', - '' => '睭', - '' => '矠', - '' => '碇', - '' => '碚', - '' => '碔', - '' => '碏', - '' => '碄', - '' => '碕', - '' => '碅', - '' => '碆', - '' => '碡', - '' => '碃', - '' => '硹', - '' => '碙', - '' => '碀', - '' => '碖', - '' => '硻', - '' => '祼', - '' => '禂', - '' => '祽', - '' => '祹', - '' => '稑', - '' => '稘', - '' => '稙', - '' => '稒', - '' => '稗', - '' => '稕', - '' => '稢', - '' => '稓', - '@' => '稛', - 'A' => '稐', - 'B' => '窣', - 'C' => '窢', - 'D' => '窞', - 'E' => '竫', - 'F' => '筦', - 'G' => '筤', - 'H' => '筭', - 'I' => '筴', - 'J' => '筩', - 'K' => '筲', - 'L' => '筥', - 'M' => '筳', - 'N' => '筱', - 'O' => '筰', - 'P' => '筡', - 'Q' => '筸', - 'R' => '筶', - 'S' => '筣', - 'T' => '粲', - 'U' => '粴', - 'V' => '粯', - 'W' => '綈', - 'X' => '綆', - 'Y' => '綀', - 'Z' => '綍', - '[' => '絿', - '\\' => '綅', - ']' => '絺', - '^' => '綎', - '_' => '絻', - '`' => '綃', - 'a' => '絼', - 'b' => '綌', - 'c' => '綔', - 'd' => '綄', - 'e' => '絽', - 'f' => '綒', - 'g' => '罭', - 'h' => '罫', - 'i' => '罧', - 'j' => '罨', - 'k' => '罬', - 'l' => '羦', - 'm' => '羥', - 'n' => '羧', - 'o' => '翛', - 'p' => '翜', - 'q' => '耡', - 'r' => '腤', - 's' => '腠', - 't' => '腷', - 'u' => '腜', - 'v' => '腩', - 'w' => '腛', - 'x' => '腢', - 'y' => '腲', - 'z' => '朡', - '{' => '腞', - '|' => '腶', - '}' => '腧', - '~' => '腯', - 'ߡ' => '腄', - 'ߢ' => '腡', - 'ߣ' => '舝', - 'ߤ' => '艉', - 'ߥ' => '艄', - 'ߦ' => '艀', - 'ߧ' => '艂', - 'ߨ' => '艅', - 'ߩ' => '蓱', - 'ߪ' => '萿', - '߫' => '葖', - '߬' => '葶', - '߭' => '葹', - '߮' => '蒏', - '߯' => '蒍', - '߰' => '葥', - '߱' => '葑', - '߲' => '葀', - '߳' => '蒆', - 'ߴ' => '葧', - 'ߵ' => '萰', - '߶' => '葍', - '߷' => '葽', - '߸' => '葚', - '߹' => '葙', - 'ߺ' => '葴', - '߻' => '葳', - '߼' => '葝', - '߽' => '蔇', - '߾' => '葞', - '߿' => '萷', - '' => '萺', - '' => '萴', - '' => '葺', - '' => '葃', - '' => '葸', - '' => '萲', - '' => '葅', - '' => '萩', - '' => '菙', - '' => '葋', - '' => '萯', - '' => '葂', - '' => '萭', - '' => '葟', - '' => '葰', - '' => '萹', - '' => '葎', - '' => '葌', - '' => '葒', - '' => '葯', - '' => '蓅', - '' => '蒎', - '' => '萻', - '' => '葇', - '' => '萶', - '' => '萳', - '' => '葨', - '' => '葾', - '' => '葄', - '' => '萫', - '' => '葠', - '' => '葔', - '' => '葮', - '' => '葐', - '' => '蜋', - '' => '蜄', - '' => '蛷', - '' => '蜌', - '' => '蛺', - '' => '蛖', - '' => '蛵', - '' => '蝍', - '' => '蛸', - '' => '蜎', - '' => '蜉', - '' => '蜁', - '' => '蛶', - '' => '蜍', - '' => '蜅', - '' => '裖', - '' => '裋', - '' => '裍', - '' => '裎', - '' => '裞', - '' => '裛', - '' => '裚', - '' => '裌', - '' => '裐', - '' => '覅', - '' => '覛', - '' => '觟', - '' => '觥', - '' => '觤', - '@' => '觡', - 'A' => '觠', - 'B' => '觢', - 'C' => '觜', - 'D' => '触', - 'E' => '詶', - 'F' => '誆', - 'G' => '詿', - 'H' => '詡', - 'I' => '訿', - 'J' => '詷', - 'K' => '誂', - 'L' => '誄', - 'M' => '詵', - 'N' => '誃', - 'O' => '誁', - 'P' => '詴', - 'Q' => '詺', - 'R' => '谼', - 'S' => '豋', - 'T' => '豊', - 'U' => '豥', - 'V' => '豤', - 'W' => '豦', - 'X' => '貆', - 'Y' => '貄', - 'Z' => '貅', - '[' => '賌', - '\\' => '赨', - ']' => '赩', - '^' => '趑', - '_' => '趌', - '`' => '趎', - 'a' => '趏', - 'b' => '趍', - 'c' => '趓', - 'd' => '趔', - 'e' => '趐', - 'f' => '趒', - 'g' => '跰', - 'h' => '跠', - 'i' => '跬', - 'j' => '跱', - 'k' => '跮', - 'l' => '跐', - 'm' => '跩', - 'n' => '跣', - 'o' => '跢', - 'p' => '跧', - 'q' => '跲', - 'r' => '跫', - 's' => '跴', - 't' => '輆', - 'u' => '軿', - 'v' => '輁', - 'w' => '輀', - 'x' => '輅', - 'y' => '輇', - 'z' => '輈', - '{' => '輂', - '|' => '輋', - '}' => '遒', - '~' => '逿', - '' => '遄', - '' => '遉', - '' => '逽', - '' => '鄐', - '' => '鄍', - '' => '鄏', - '' => '鄑', - '' => '鄖', - '' => '鄔', - '' => '鄋', - '' => '鄎', - '' => '酮', - '' => '酯', - '' => '鉈', - '' => '鉒', - '' => '鈰', - '' => '鈺', - '' => '鉦', - '' => '鈳', - '' => '鉥', - '' => '鉞', - '' => '銃', - '' => '鈮', - '' => '鉊', - '' => '鉆', - '' => '鉭', - '' => '鉬', - '' => '鉏', - '' => '鉠', - '' => '鉧', - '' => '鉯', - '' => '鈶', - '' => '鉡', - '' => '鉰', - '' => '鈱', - '' => '鉔', - '' => '鉣', - '' => '鉐', - '' => '鉲', - '' => '鉎', - '' => '鉓', - '' => '鉌', - '' => '鉖', - '' => '鈲', - '' => '閟', - '' => '閜', - '' => '閞', - '' => '閛', - '' => '隒', - '' => '隓', - '' => '隑', - '' => '隗', - '' => '雎', - '' => '雺', - '' => '雽', - '' => '雸', - '' => '雵', - '' => '靳', - '' => '靷', - '' => '靸', - '' => '靲', - '' => '頏', - '' => '頍', - '' => '頎', - '' => '颬', - '' => '飶', - '' => '飹', - '' => '馯', - '' => '馲', - '' => '馰', - '' => '馵', - '' => '骭', - '' => '骫', - '' => '魛', - '' => '鳪', - '' => '鳭', - '' => '鳧', - '' => '麀', - '' => '黽', - '' => '僦', - '' => '僔', - '' => '僗', - '' => '僨', - '' => '僳', - '' => '僛', - '' => '僪', - '' => '僝', - '' => '僤', - '' => '僓', - '' => '僬', - '' => '僰', - '' => '僯', - '' => '僣', - '' => '僠', - '@' => '凘', - 'A' => '劀', - 'B' => '劁', - 'C' => '勩', - 'D' => '勫', - 'E' => '匰', - 'F' => '厬', - 'G' => '嘧', - 'H' => '嘕', - 'I' => '嘌', - 'J' => '嘒', - 'K' => '嗼', - 'L' => '嘏', - 'M' => '嘜', - 'N' => '嘁', - 'O' => '嘓', - 'P' => '嘂', - 'Q' => '嗺', - 'R' => '嘝', - 'S' => '嘄', - 'T' => '嗿', - 'U' => '嗹', - 'V' => '墉', - 'W' => '塼', - 'X' => '墐', - 'Y' => '墘', - 'Z' => '墆', - '[' => '墁', - '\\' => '塿', - ']' => '塴', - '^' => '墋', - '_' => '塺', - '`' => '墇', - 'a' => '墑', - 'b' => '墎', - 'c' => '塶', - 'd' => '墂', - 'e' => '墈', - 'f' => '塻', - 'g' => '墔', - 'h' => '墏', - 'i' => '壾', - 'j' => '奫', - 'k' => '嫜', - 'l' => '嫮', - 'm' => '嫥', - 'n' => '嫕', - 'o' => '嫪', - 'p' => '嫚', - 'q' => '嫭', - 'r' => '嫫', - 's' => '嫳', - 't' => '嫢', - 'u' => '嫠', - 'v' => '嫛', - 'w' => '嫬', - 'x' => '嫞', - 'y' => '嫝', - 'z' => '嫙', - '{' => '嫨', - '|' => '嫟', - '}' => '孷', - '~' => '寠', - '' => '寣', - '' => '屣', - '' => '嶂', - '' => '嶀', - '' => '嵽', - '' => '嶆', - '' => '嵺', - '' => '嶁', - '' => '嵷', - '' => '嶊', - '' => '嶉', - '' => '嶈', - '' => '嵾', - '' => '嵼', - '' => '嶍', - '' => '嵹', - '' => '嵿', - '' => '幘', - '' => '幙', - '' => '幓', - '' => '廘', - '' => '廑', - '' => '廗', - '' => '廎', - '' => '廜', - '' => '廕', - '' => '廙', - '' => '廒', - '' => '廔', - '' => '彄', - '' => '彃', - '' => '彯', - '' => '徶', - '' => '愬', - '' => '愨', - '' => '慁', - '' => '慞', - '' => '慱', - '' => '慳', - '' => '慒', - '' => '慓', - '' => '慲', - '' => '慬', - '' => '憀', - '' => '慴', - '' => '慔', - '' => '慺', - '' => '慛', - '' => '慥', - '' => '愻', - '' => '慪', - '' => '慡', - '' => '慖', - '' => '戩', - '' => '戧', - '' => '戫', - '' => '搫', - '' => '摍', - '' => '摛', - '' => '摝', - '' => '摴', - '' => '摶', - '' => '摲', - '' => '摳', - '' => '摽', - '' => '摵', - '' => '摦', - '' => '撦', - '' => '摎', - '' => '撂', - '' => '摞', - '' => '摜', - '' => '摋', - '' => '摓', - '' => '摠', - '' => '摐', - '' => '摿', - '' => '搿', - '' => '摬', - '' => '摫', - '' => '摙', - '' => '摥', - '' => '摷', - '' => '敳', - '' => '斠', - '' => '暡', - '' => '暠', - '' => '暟', - '' => '朅', - '' => '朄', - '' => '朢', - '' => '榱', - '' => '榶', - '' => '槉', - '@' => '榠', - 'A' => '槎', - 'B' => '榖', - 'C' => '榰', - 'D' => '榬', - 'E' => '榼', - 'F' => '榑', - 'G' => '榙', - 'H' => '榎', - 'I' => '榧', - 'J' => '榍', - 'K' => '榩', - 'L' => '榾', - 'M' => '榯', - 'N' => '榿', - 'O' => '槄', - 'P' => '榽', - 'Q' => '榤', - 'R' => '槔', - 'S' => '榹', - 'T' => '槊', - 'U' => '榚', - 'V' => '槏', - 'W' => '榳', - 'X' => '榓', - 'Y' => '榪', - 'Z' => '榡', - '[' => '榞', - '\\' => '槙', - ']' => '榗', - '^' => '榐', - '_' => '槂', - '`' => '榵', - 'a' => '榥', - 'b' => '槆', - 'c' => '歊', - 'd' => '歍', - 'e' => '歋', - 'f' => '殞', - 'g' => '殟', - 'h' => '殠', - 'i' => '毃', - 'j' => '毄', - 'k' => '毾', - 'l' => '滎', - 'm' => '滵', - 'n' => '滱', - 'o' => '漃', - 'p' => '漥', - 'q' => '滸', - 'r' => '漷', - 's' => '滻', - 't' => '漮', - 'u' => '漉', - 'v' => '潎', - 'w' => '漙', - 'x' => '漚', - 'y' => '漧', - 'z' => '漘', - '{' => '漻', - '|' => '漒', - '}' => '滭', - '~' => '漊', - '' => '漶', - '' => '潳', - '' => '滹', - '' => '滮', - '' => '漭', - '' => '潀', - '' => '漰', - '' => '漼', - '' => '漵', - '' => '滫', - '' => '漇', - '' => '漎', - '' => '潃', - '' => '漅', - '' => '滽', - '' => '滶', - '' => '漹', - '' => '漜', - '' => '滼', - '' => '漺', - '' => '漟', - '' => '漍', - '' => '漞', - '' => '漈', - '' => '漡', - '' => '熇', - '' => '熐', - '' => '熉', - '' => '熀', - '' => '熅', - '' => '熂', - '' => '熏', - '' => '煻', - '' => '熆', - '' => '熁', - '' => '熗', - '' => '牄', - '' => '牓', - '' => '犗', - '' => '犕', - '' => '犓', - '' => '獃', - '' => '獍', - '' => '獑', - '' => '獌', - '' => '瑢', - '' => '瑳', - '' => '瑱', - '' => '瑵', - '' => '瑲', - '' => '瑧', - '' => '瑮', - '' => '甀', - '' => '甂', - '' => '甃', - '' => '畽', - '' => '疐', - '' => '瘖', - '' => '瘈', - '' => '瘌', - '' => '瘕', - '' => '瘑', - '' => '瘊', - '' => '瘔', - '' => '皸', - '' => '瞁', - '' => '睼', - '' => '瞅', - '' => '瞂', - '' => '睮', - '' => '瞀', - '' => '睯', - '' => '睾', - '' => '瞃', - '' => '碲', - '' => '碪', - '' => '碴', - '' => '碭', - '' => '碨', - '' => '硾', - '' => '碫', - '' => '碞', - '' => '碥', - '' => '碠', - '' => '碬', - '' => '碢', - '' => '碤', - '' => '禘', - '' => '禊', - '' => '禋', - '' => '禖', - '' => '禕', - '' => '禔', - '' => '禓', - '@' => '禗', - 'A' => '禈', - 'B' => '禒', - 'C' => '禐', - 'D' => '稫', - 'E' => '穊', - 'F' => '稰', - 'G' => '稯', - 'H' => '稨', - 'I' => '稦', - 'J' => '窨', - 'K' => '窫', - 'L' => '窬', - 'M' => '竮', - 'N' => '箈', - 'O' => '箜', - 'P' => '箊', - 'Q' => '箑', - 'R' => '箐', - 'S' => '箖', - 'T' => '箍', - 'U' => '箌', - 'V' => '箛', - 'W' => '箎', - 'X' => '箅', - 'Y' => '箘', - 'Z' => '劄', - '[' => '箙', - '\\' => '箤', - ']' => '箂', - '^' => '粻', - '_' => '粿', - '`' => '粼', - 'a' => '粺', - 'b' => '綧', - 'c' => '綷', - 'd' => '緂', - 'e' => '綣', - 'f' => '綪', - 'g' => '緁', - 'h' => '緀', - 'i' => '緅', - 'j' => '綝', - 'k' => '緎', - 'l' => '緄', - 'm' => '緆', - 'n' => '緋', - 'o' => '緌', - 'p' => '綯', - 'q' => '綹', - 'r' => '綖', - 's' => '綼', - 't' => '綟', - 'u' => '綦', - 'v' => '綮', - 'w' => '綩', - 'x' => '綡', - 'y' => '緉', - 'z' => '罳', - '{' => '翢', - '|' => '翣', - '}' => '翥', - '~' => '翞', - '' => '耤', - '' => '聝', - '' => '聜', - '' => '膉', - '' => '膆', - '' => '膃', - '' => '膇', - '' => '膍', - '' => '膌', - '' => '膋', - '' => '舕', - '' => '蒗', - '' => '蒤', - '' => '蒡', - '' => '蒟', - '' => '蒺', - '' => '蓎', - '' => '蓂', - '' => '蒬', - '' => '蒮', - '' => '蒫', - '' => '蒹', - '' => '蒴', - '' => '蓁', - '' => '蓍', - '' => '蒪', - '' => '蒚', - '' => '蒱', - '' => '蓐', - '' => '蒝', - '' => '蒧', - '' => '蒻', - '' => '蒢', - '' => '蒔', - '' => '蓇', - '' => '蓌', - '' => '蒛', - '' => '蒩', - '' => '蒯', - '' => '蒨', - '' => '蓖', - '' => '蒘', - '' => '蒶', - '' => '蓏', - '' => '蒠', - '' => '蓗', - '' => '蓔', - '' => '蓒', - '' => '蓛', - '' => '蒰', - '' => '蒑', - '' => '虡', - '' => '蜳', - '' => '蜣', - '' => '蜨', - '' => '蝫', - '' => '蝀', - '' => '蜮', - '' => '蜞', - '' => '蜡', - '' => '蜙', - '' => '蜛', - '' => '蝃', - '' => '蜬', - '' => '蝁', - '' => '蜾', - '' => '蝆', - '' => '蜠', - '' => '蜲', - '' => '蜪', - '' => '蜭', - '' => '蜼', - '' => '蜒', - '' => '蜺', - '' => '蜱', - '' => '蜵', - '' => '蝂', - '' => '蜦', - '' => '蜧', - '' => '蜸', - '' => '蜤', - '' => '蜚', - '' => '蜰', - '' => '蜑', - '' => '裷', - '' => '裧', - '' => '裱', - '' => '裲', - '' => '裺', - '' => '裾', - '' => '裮', - '' => '裼', - '' => '裶', - '' => '裻', - '@' => '裰', - 'A' => '裬', - 'B' => '裫', - 'C' => '覝', - 'D' => '覡', - 'E' => '覟', - 'F' => '覞', - 'G' => '觩', - 'H' => '觫', - 'I' => '觨', - 'J' => '誫', - 'K' => '誙', - 'L' => '誋', - 'M' => '誒', - 'N' => '誏', - 'O' => '誖', - 'P' => '谽', - 'Q' => '豨', - 'R' => '豩', - 'S' => '賕', - 'T' => '賏', - 'U' => '賗', - 'V' => '趖', - 'W' => '踉', - 'X' => '踂', - 'Y' => '跿', - 'Z' => '踍', - '[' => '跽', - '\\' => '踊', - ']' => '踃', - '^' => '踇', - '_' => '踆', - '`' => '踅', - 'a' => '跾', - 'b' => '踀', - 'c' => '踄', - 'd' => '輐', - 'e' => '輑', - 'f' => '輎', - 'g' => '輍', - 'h' => '鄣', - 'i' => '鄜', - 'j' => '鄠', - 'k' => '鄢', - 'l' => '鄟', - 'm' => '鄝', - 'n' => '鄚', - 'o' => '鄤', - 'p' => '鄡', - 'q' => '鄛', - 'r' => '酺', - 's' => '酲', - 't' => '酹', - 'u' => '酳', - 'v' => '銥', - 'w' => '銤', - 'x' => '鉶', - 'y' => '銛', - 'z' => '鉺', - '{' => '銠', - '|' => '銔', - '}' => '銪', - '~' => '銍', - '' => '銦', - '' => '銚', - '' => '銫', - '' => '鉹', - '' => '銗', - '' => '鉿', - '' => '銣', - '' => '鋮', - '' => '銎', - '' => '銂', - '' => '銕', - '' => '銢', - '' => '鉽', - '' => '銈', - '' => '銡', - '' => '銊', - '' => '銆', - '' => '銌', - '' => '銙', - '' => '銧', - '' => '鉾', - '' => '銇', - '' => '銩', - '' => '銝', - '' => '銋', - '' => '鈭', - '' => '隞', - '' => '隡', - '' => '雿', - '' => '靘', - '' => '靽', - '' => '靺', - '' => '靾', - '' => '鞃', - '' => '鞀', - '' => '鞂', - '' => '靻', - '' => '鞄', - '' => '鞁', - '' => '靿', - '' => '韎', - '' => '韍', - '' => '頖', - '' => '颭', - '' => '颮', - '' => '餂', - '' => '餀', - '' => '餇', - '' => '馝', - '' => '馜', - '' => '駃', - '' => '馹', - '' => '馻', - '' => '馺', - '' => '駂', - '' => '馽', - '' => '駇', - '' => '骱', - '' => '髣', - '' => '髧', - '' => '鬾', - '' => '鬿', - '' => '魠', - '' => '魡', - '' => '魟', - '' => '鳱', - '' => '鳲', - '' => '鳵', - '' => '麧', - '' => '僿', - '' => '儃', - '' => '儰', - '' => '僸', - '' => '儆', - '' => '儇', - '' => '僶', - '' => '僾', - '' => '儋', - '' => '儌', - '' => '僽', - '' => '儊', - '' => '劋', - '' => '劌', - '' => '勱', - '' => '勯', - '' => '噈', - '' => '噂', - '' => '噌', - '' => '嘵', - '' => '噁', - '' => '噊', - '' => '噉', - '' => '噆', - '' => '噘', - '@' => '噚', - 'A' => '噀', - 'B' => '嘳', - 'C' => '嘽', - 'D' => '嘬', - 'E' => '嘾', - 'F' => '嘸', - 'G' => '嘪', - 'H' => '嘺', - 'I' => '圚', - 'J' => '墫', - 'K' => '墝', - 'L' => '墱', - 'M' => '墠', - 'N' => '墣', - 'O' => '墯', - 'P' => '墬', - 'Q' => '墥', - 'R' => '墡', - 'S' => '壿', - 'T' => '嫿', - 'U' => '嫴', - 'V' => '嫽', - 'W' => '嫷', - 'X' => '嫶', - 'Y' => '嬃', - 'Z' => '嫸', - '[' => '嬂', - '\\' => '嫹', - ']' => '嬁', - '^' => '嬇', - '_' => '嬅', - '`' => '嬏', - 'a' => '屧', - 'b' => '嶙', - 'c' => '嶗', - 'd' => '嶟', - 'e' => '嶒', - 'f' => '嶢', - 'g' => '嶓', - 'h' => '嶕', - 'i' => '嶠', - 'j' => '嶜', - 'k' => '嶡', - 'l' => '嶚', - 'm' => '嶞', - 'n' => '幩', - 'o' => '幝', - 'p' => '幠', - 'q' => '幜', - 'r' => '緳', - 's' => '廛', - 't' => '廞', - 'u' => '廡', - 'v' => '彉', - 'w' => '徲', - 'x' => '憋', - 'y' => '憃', - 'z' => '慹', - '{' => '憱', - '|' => '憰', - '}' => '憢', - '~' => '憉', - '' => '憛', - '' => '憓', - '' => '憯', - '' => '憭', - '' => '憟', - '' => '憒', - '' => '憪', - '' => '憡', - '' => '憍', - '' => '慦', - '' => '憳', - '' => '戭', - '' => '摮', - '' => '摰', - '' => '撖', - '' => '撠', - '' => '撅', - '' => '撗', - '' => '撜', - '' => '撏', - '' => '撋', - '' => '撊', - '' => '撌', - '' => '撣', - '' => '撟', - '' => '摨', - '' => '撱', - '' => '撘', - '' => '敶', - '' => '敺', - '' => '敹', - '' => '敻', - '' => '斲', - '' => '斳', - '' => '暵', - '' => '暰', - '' => '暩', - '' => '暲', - '' => '暷', - '' => '暪', - '' => '暯', - '' => '樀', - '' => '樆', - '' => '樗', - '' => '槥', - '' => '槸', - '' => '樕', - '' => '槱', - '' => '槤', - '' => '樠', - '' => '槿', - '' => '槬', - '' => '槢', - '' => '樛', - '' => '樝', - '' => '槾', - '' => '樧', - '' => '槲', - '' => '槮', - '' => '樔', - '' => '槷', - '' => '槧', - '' => '橀', - '' => '樈', - '' => '槦', - '' => '槻', - '' => '樍', - '' => '槼', - '' => '槫', - '' => '樉', - '' => '樄', - '' => '樘', - '' => '樥', - '' => '樏', - '' => '槶', - '' => '樦', - '' => '樇', - '' => '槴', - '' => '樖', - '' => '歑', - '' => '殥', - '' => '殣', - '' => '殢', - '' => '殦', - '' => '氁', - '' => '氀', - '' => '毿', - '' => '氂', - '' => '潁', - '' => '漦', - '' => '潾', - '' => '澇', - '' => '濆', - '' => '澒', - '@' => '澍', - 'A' => '澉', - 'B' => '澌', - 'C' => '潢', - 'D' => '潏', - 'E' => '澅', - 'F' => '潚', - 'G' => '澖', - 'H' => '潶', - 'I' => '潬', - 'J' => '澂', - 'K' => '潕', - 'L' => '潲', - 'M' => '潒', - 'N' => '潐', - 'O' => '潗', - 'P' => '澔', - 'Q' => '澓', - 'R' => '潝', - 'S' => '漀', - 'T' => '潡', - 'U' => '潫', - 'V' => '潽', - 'W' => '潧', - 'X' => '澐', - 'Y' => '潓', - 'Z' => '澋', - '[' => '潩', - '\\' => '潿', - ']' => '澕', - '^' => '潣', - '_' => '潷', - '`' => '潪', - 'a' => '潻', - 'b' => '熲', - 'c' => '熯', - 'd' => '熛', - 'e' => '熰', - 'f' => '熠', - 'g' => '熚', - 'h' => '熩', - 'i' => '熵', - 'j' => '熝', - 'k' => '熥', - 'l' => '熞', - 'm' => '熤', - 'n' => '熡', - 'o' => '熪', - 'p' => '熜', - 'q' => '熧', - 'r' => '熳', - 's' => '犘', - 't' => '犚', - 'u' => '獘', - 'v' => '獒', - 'w' => '獞', - 'x' => '獟', - 'y' => '獠', - 'z' => '獝', - '{' => '獛', - '|' => '獡', - '}' => '獚', - '~' => '獙', - '' => '獢', - '' => '璇', - '' => '璉', - '' => '璊', - '' => '璆', - '' => '璁', - '' => '瑽', - '' => '璅', - '' => '璈', - '' => '瑼', - '' => '瑹', - '' => '甈', - '' => '甇', - '' => '畾', - '' => '瘥', - '' => '瘞', - '' => '瘙', - '' => '瘝', - '' => '瘜', - '' => '瘣', - '' => '瘚', - '' => '瘨', - '' => '瘛', - '' => '皜', - '' => '皝', - '' => '皞', - '' => '皛', - '' => '瞍', - '' => '瞏', - '' => '瞉', - '' => '瞈', - '' => '磍', - '' => '碻', - '' => '磏', - '' => '磌', - '' => '磑', - '' => '磎', - '' => '磔', - '' => '磈', - '' => '磃', - '' => '磄', - '' => '磉', - '' => '禚', - '' => '禡', - '' => '禠', - '' => '禜', - '' => '禢', - '' => '禛', - '' => '歶', - '' => '稹', - '' => '窲', - '' => '窴', - '' => '窳', - '' => '箷', - '' => '篋', - '' => '箾', - '' => '箬', - '' => '篎', - '' => '箯', - '' => '箹', - '' => '篊', - '' => '箵', - '' => '糅', - '' => '糈', - '' => '糌', - '' => '糋', - '' => '緷', - '' => '緛', - '' => '緪', - '' => '緧', - '' => '緗', - '' => '緡', - '' => '縃', - '' => '緺', - '' => '緦', - '' => '緶', - '' => '緱', - '' => '緰', - '' => '緮', - '' => '緟', - '' => '罶', - '' => '羬', - '' => '羰', - '' => '羭', - '' => '翭', - '' => '翫', - '' => '翪', - '' => '翬', - '' => '翦', - '' => '翨', - '' => '聤', - '' => '聧', - '' => '膣', - '' => '膟', - '@' => '膞', - 'A' => '膕', - 'B' => '膢', - 'C' => '膙', - 'D' => '膗', - 'E' => '舖', - 'F' => '艏', - 'G' => '艓', - 'H' => '艒', - 'I' => '艐', - 'J' => '艎', - 'K' => '艑', - 'L' => '蔤', - 'M' => '蔻', - 'N' => '蔏', - 'O' => '蔀', - 'P' => '蔩', - 'Q' => '蔎', - 'R' => '蔉', - 'S' => '蔍', - 'T' => '蔟', - 'U' => '蔊', - 'V' => '蔧', - 'W' => '蔜', - 'X' => '蓻', - 'Y' => '蔫', - 'Z' => '蓺', - '[' => '蔈', - '\\' => '蔌', - ']' => '蓴', - '^' => '蔪', - '_' => '蓲', - '`' => '蔕', - 'a' => '蓷', - 'b' => '蓫', - 'c' => '蓳', - 'd' => '蓼', - 'e' => '蔒', - 'f' => '蓪', - 'g' => '蓩', - 'h' => '蔖', - 'i' => '蓾', - 'j' => '蔨', - 'k' => '蔝', - 'l' => '蔮', - 'm' => '蔂', - 'n' => '蓽', - 'o' => '蔞', - 'p' => '蓶', - 'q' => '蔱', - 'r' => '蔦', - 's' => '蓧', - 't' => '蓨', - 'u' => '蓰', - 'v' => '蓯', - 'w' => '蓹', - 'x' => '蔘', - 'y' => '蔠', - 'z' => '蔰', - '{' => '蔋', - '|' => '蔙', - '}' => '蔯', - '~' => '虢', - '' => '蝖', - '' => '蝣', - '' => '蝤', - '' => '蝷', - '' => '蟡', - '' => '蝳', - '' => '蝘', - '' => '蝔', - '' => '蝛', - '' => '蝒', - '' => '蝡', - '' => '蝚', - '' => '蝑', - '' => '蝞', - '' => '蝭', - '' => '蝪', - '' => '蝐', - '' => '蝎', - '' => '蝟', - '' => '蝝', - '' => '蝯', - '' => '蝬', - '' => '蝺', - '' => '蝮', - '' => '蝜', - '' => '蝥', - '' => '蝏', - '' => '蝻', - '' => '蝵', - '' => '蝢', - '' => '蝧', - '' => '蝩', - '' => '衚', - '' => '褅', - '' => '褌', - '' => '褔', - '' => '褋', - '' => '褗', - '' => '褘', - '' => '褙', - '' => '褆', - '' => '褖', - '' => '褑', - '' => '褎', - '' => '褉', - '' => '覢', - '' => '覤', - '' => '覣', - '' => '觭', - '' => '觰', - '' => '觬', - '' => '諏', - '' => '諆', - '' => '誸', - '' => '諓', - '' => '諑', - '' => '諔', - '' => '諕', - '' => '誻', - '' => '諗', - '' => '誾', - '' => '諀', - '' => '諅', - '' => '諘', - '' => '諃', - '' => '誺', - '' => '誽', - '' => '諙', - '' => '谾', - '' => '豍', - '' => '貏', - '' => '賥', - '' => '賟', - '' => '賙', - '' => '賨', - '' => '賚', - '' => '賝', - '' => '賧', - '' => '趠', - '' => '趜', - '' => '趡', - '' => '趛', - '' => '踠', - '' => '踣', - '' => '踥', - '' => '踤', - '' => '踮', - '' => '踕', - '' => '踛', - '' => '踖', - '' => '踑', - '' => '踙', - '' => '踦', - '' => '踧', - '@' => '踔', - 'A' => '踒', - 'B' => '踘', - 'C' => '踓', - 'D' => '踜', - 'E' => '踗', - 'F' => '踚', - 'G' => '輬', - 'H' => '輤', - 'I' => '輘', - 'J' => '輚', - 'K' => '輠', - 'L' => '輣', - 'M' => '輖', - 'N' => '輗', - 'O' => '遳', - 'P' => '遰', - 'Q' => '遯', - 'R' => '遧', - 'S' => '遫', - 'T' => '鄯', - 'U' => '鄫', - 'V' => '鄩', - 'W' => '鄪', - 'X' => '鄲', - 'Y' => '鄦', - 'Z' => '鄮', - '[' => '醅', - '\\' => '醆', - ']' => '醊', - '^' => '醁', - '_' => '醂', - '`' => '醄', - 'a' => '醀', - 'b' => '鋐', - 'c' => '鋃', - 'd' => '鋄', - 'e' => '鋀', - 'f' => '鋙', - 'g' => '銶', - 'h' => '鋏', - 'i' => '鋱', - 'j' => '鋟', - 'k' => '鋘', - 'l' => '鋩', - 'm' => '鋗', - 'n' => '鋝', - 'o' => '鋌', - 'p' => '鋯', - 'q' => '鋂', - 'r' => '鋨', - 's' => '鋊', - 't' => '鋈', - 'u' => '鋎', - 'v' => '鋦', - 'w' => '鋍', - 'x' => '鋕', - 'y' => '鋉', - 'z' => '鋠', - '{' => '鋞', - '|' => '鋧', - '}' => '鋑', - '~' => '鋓', - '' => '銵', - '' => '鋡', - '' => '鋆', - '' => '銴', - '' => '镼', - '' => '閬', - '' => '閫', - '' => '閮', - '' => '閰', - '' => '隤', - '' => '隢', - '' => '雓', - '' => '霅', - '' => '霈', - '' => '霂', - '' => '靚', - '' => '鞊', - '' => '鞎', - '' => '鞈', - '' => '韐', - '' => '韏', - '' => '頞', - '' => '頝', - '' => '頦', - '' => '頩', - '' => '頨', - '' => '頠', - '' => '頛', - '' => '頧', - '' => '颲', - '' => '餈', - '' => '飺', - '' => '餑', - '' => '餔', - '' => '餖', - '' => '餗', - '' => '餕', - '' => '駜', - '' => '駍', - '' => '駏', - '' => '駓', - '' => '駔', - '' => '駎', - '' => '駉', - '' => '駖', - '' => '駘', - '' => '駋', - '' => '駗', - '' => '駌', - '' => '骳', - '' => '髬', - '' => '髫', - '' => '髳', - '' => '髲', - '' => '髱', - '' => '魆', - '' => '魃', - '' => '魧', - '' => '魴', - '' => '魱', - '' => '魦', - '' => '魶', - '' => '魵', - '' => '魰', - '' => '魨', - '' => '魤', - '' => '魬', - '' => '鳼', - '' => '鳺', - '' => '鳽', - '' => '鳿', - '' => '鳷', - '' => '鴇', - '' => '鴀', - '' => '鳹', - '' => '鳻', - '' => '鴈', - '' => '鴅', - '' => '鴄', - '' => '麃', - '' => '黓', - '' => '鼏', - '' => '鼐', - '' => '儜', - '' => '儓', - '' => '儗', - '' => '儚', - '' => '儑', - '' => '凞', - '' => '匴', - '' => '叡', - '' => '噰', - '' => '噠', - '' => '噮', - '@' => '噳', - 'A' => '噦', - 'B' => '噣', - 'C' => '噭', - 'D' => '噲', - 'E' => '噞', - 'F' => '噷', - 'G' => '圜', - 'H' => '圛', - 'I' => '壈', - 'J' => '墽', - 'K' => '壉', - 'L' => '墿', - 'M' => '墺', - 'N' => '壂', - 'O' => '墼', - 'P' => '壆', - 'Q' => '嬗', - 'R' => '嬙', - 'S' => '嬛', - 'T' => '嬡', - 'U' => '嬔', - 'V' => '嬓', - 'W' => '嬐', - 'X' => '嬖', - 'Y' => '嬨', - 'Z' => '嬚', - '[' => '嬠', - '\\' => '嬞', - ']' => '寯', - '^' => '嶬', - '_' => '嶱', - '`' => '嶩', - 'a' => '嶧', - 'b' => '嶵', - 'c' => '嶰', - 'd' => '嶮', - 'e' => '嶪', - 'f' => '嶨', - 'g' => '嶲', - 'h' => '嶭', - 'i' => '嶯', - 'j' => '嶴', - 'k' => '幧', - 'l' => '幨', - 'm' => '幦', - 'n' => '幯', - 'o' => '廩', - 'p' => '廧', - 'q' => '廦', - 'r' => '廨', - 's' => '廥', - 't' => '彋', - 'u' => '徼', - 'v' => '憝', - 'w' => '憨', - 'x' => '憖', - 'y' => '懅', - 'z' => '憴', - '{' => '懆', - '|' => '懁', - '}' => '懌', - '~' => '憺', - '' => '憿', - '' => '憸', - '' => '憌', - '' => '擗', - '' => '擖', - '' => '擐', - '' => '擏', - '' => '擉', - '' => '撽', - '' => '撉', - '' => '擃', - '' => '擛', - '' => '擳', - '' => '擙', - '' => '攳', - '' => '敿', - '' => '敼', - '' => '斢', - '' => '曈', - '' => '暾', - '' => '曀', - '' => '曊', - '' => '曋', - '' => '曏', - '' => '暽', - '' => '暻', - '' => '暺', - '' => '曌', - '' => '朣', - '' => '樴', - '' => '橦', - '' => '橉', - '' => '橧', - '' => '樲', - '' => '橨', - '' => '樾', - '' => '橝', - '' => '橭', - '' => '橶', - '' => '橛', - '' => '橑', - '' => '樨', - '' => '橚', - '' => '樻', - '' => '樿', - '' => '橁', - '' => '橪', - '' => '橤', - '' => '橐', - '' => '橏', - '' => '橔', - '' => '橯', - '' => '橩', - '' => '橠', - '' => '樼', - '' => '橞', - '' => '橖', - '' => '橕', - '' => '橍', - '' => '橎', - '' => '橆', - '' => '歕', - '' => '歔', - '' => '歖', - '' => '殧', - '' => '殪', - '' => '殫', - '' => '毈', - '' => '毇', - '' => '氄', - '' => '氃', - '' => '氆', - '' => '澭', - '' => '濋', - '' => '澣', - '' => '濇', - '' => '澼', - '' => '濎', - '' => '濈', - '' => '潞', - '' => '濄', - '' => '澽', - '' => '澞', - '' => '濊', - '' => '澨', - '' => '瀄', - '' => '澥', - '' => '澮', - '' => '澺', - '' => '澬', - '' => '澪', - '' => '濏', - '' => '澿', - '' => '澸', - '@' => '澢', - 'A' => '濉', - 'B' => '澫', - 'C' => '濍', - 'D' => '澯', - 'E' => '澲', - 'F' => '澰', - 'G' => '燅', - 'H' => '燂', - 'I' => '熿', - 'J' => '熸', - 'K' => '燖', - 'L' => '燀', - 'M' => '燁', - 'N' => '燋', - 'O' => '燔', - 'P' => '燊', - 'Q' => '燇', - 'R' => '燏', - 'S' => '熽', - 'T' => '燘', - 'U' => '熼', - 'V' => '燆', - 'W' => '燚', - 'X' => '燛', - 'Y' => '犝', - 'Z' => '犞', - '[' => '獩', - '\\' => '獦', - ']' => '獧', - '^' => '獬', - '_' => '獥', - '`' => '獫', - 'a' => '獪', - 'b' => '瑿', - 'c' => '璚', - 'd' => '璠', - 'e' => '璔', - 'f' => '璒', - 'g' => '璕', - 'h' => '璡', - 'i' => '甋', - 'j' => '疀', - 'k' => '瘯', - 'l' => '瘭', - 'm' => '瘱', - 'n' => '瘽', - 'o' => '瘳', - 'p' => '瘼', - 'q' => '瘵', - 'r' => '瘲', - 's' => '瘰', - 't' => '皻', - 'u' => '盦', - 'v' => '瞚', - 'w' => '瞝', - 'x' => '瞡', - 'y' => '瞜', - 'z' => '瞛', - '{' => '瞢', - '|' => '瞣', - '}' => '瞕', - '~' => '瞙', - '' => '瞗', - '' => '磝', - '' => '磩', - '' => '磥', - '' => '磪', - '' => '磞', - '' => '磣', - '' => '磛', - '' => '磡', - '' => '磢', - '' => '磭', - '' => '磟', - '' => '磠', - '' => '禤', - '' => '穄', - '' => '穈', - '' => '穇', - '' => '窶', - '' => '窸', - '' => '窵', - '' => '窱', - '' => '窷', - '' => '篞', - '' => '篣', - '' => '篧', - '' => '篝', - '' => '篕', - '' => '篥', - '' => '篚', - '' => '篨', - '' => '篹', - '' => '篔', - '' => '篪', - '' => '篢', - '' => '篜', - '' => '篫', - '' => '篘', - '' => '篟', - '' => '糒', - '' => '糔', - '' => '糗', - '' => '糐', - '' => '糑', - '' => '縒', - '' => '縡', - '' => '縗', - '' => '縌', - '' => '縟', - '' => '縠', - '' => '縓', - '' => '縎', - '' => '縜', - '' => '縕', - '' => '縚', - '' => '縢', - '' => '縋', - '' => '縏', - '' => '縖', - '' => '縍', - '' => '縔', - '' => '縥', - '' => '縤', - '' => '罃', - '' => '罻', - '' => '罼', - '' => '罺', - '' => '羱', - '' => '翯', - '' => '耪', - '' => '耩', - '' => '聬', - '' => '膱', - '' => '膦', - '' => '膮', - '' => '膹', - '' => '膵', - '' => '膫', - '' => '膰', - '' => '膬', - '' => '膴', - '' => '膲', - '' => '膷', - '' => '膧', - '' => '臲', - '' => '艕', - '' => '艖', - '' => '艗', - '' => '蕖', - '' => '蕅', - '' => '蕫', - '' => '蕍', - '' => '蕓', - '' => '蕡', - '' => '蕘', - '@' => '蕀', - 'A' => '蕆', - 'B' => '蕤', - 'C' => '蕁', - 'D' => '蕢', - 'E' => '蕄', - 'F' => '蕑', - 'G' => '蕇', - 'H' => '蕣', - 'I' => '蔾', - 'J' => '蕛', - 'K' => '蕱', - 'L' => '蕎', - 'M' => '蕮', - 'N' => '蕵', - 'O' => '蕕', - 'P' => '蕧', - 'Q' => '蕠', - 'R' => '薌', - 'S' => '蕦', - 'T' => '蕝', - 'U' => '蕔', - 'V' => '蕥', - 'W' => '蕬', - 'X' => '虣', - 'Y' => '虥', - 'Z' => '虤', - '[' => '螛', - '\\' => '螏', - ']' => '螗', - '^' => '螓', - '_' => '螒', - '`' => '螈', - 'a' => '螁', - 'b' => '螖', - 'c' => '螘', - 'd' => '蝹', - 'e' => '螇', - 'f' => '螣', - 'g' => '螅', - 'h' => '螐', - 'i' => '螑', - 'j' => '螝', - 'k' => '螄', - 'l' => '螔', - 'm' => '螜', - 'n' => '螚', - 'o' => '螉', - 'p' => '褞', - 'q' => '褦', - 'r' => '褰', - 's' => '褭', - 't' => '褮', - 'u' => '褧', - 'v' => '褱', - 'w' => '褢', - 'x' => '褩', - 'y' => '褣', - 'z' => '褯', - '{' => '褬', - '|' => '褟', - '}' => '觱', - '~' => '諠', - '' => '諢', - '' => '諲', - '' => '諴', - '' => '諵', - '' => '諝', - '' => '謔', - '' => '諤', - '' => '諟', - '' => '諰', - '' => '諈', - '' => '諞', - '' => '諡', - '' => '諨', - '' => '諿', - '' => '諯', - '' => '諻', - '' => '貑', - '' => '貒', - '' => '貐', - '' => '賵', - '' => '賮', - '' => '賱', - '' => '賰', - '' => '賳', - '' => '赬', - '' => '赮', - '' => '趥', - '' => '趧', - '' => '踳', - '' => '踾', - '' => '踸', - '' => '蹀', - '' => '蹅', - '' => '踶', - '' => '踼', - '' => '踽', - '' => '蹁', - '' => '踰', - '' => '踿', - '' => '躽', - '' => '輶', - '' => '輮', - '' => '輵', - '' => '輲', - '' => '輹', - '' => '輷', - '' => '輴', - '' => '遶', - '' => '遹', - '' => '遻', - '' => '邆', - '' => '郺', - '' => '鄳', - '' => '鄵', - '' => '鄶', - '' => '醓', - '' => '醐', - '' => '醑', - '' => '醍', - '' => '醏', - '' => '錧', - '' => '錞', - '' => '錈', - '' => '錟', - '' => '錆', - '' => '錏', - '' => '鍺', - '' => '錸', - '' => '錼', - '' => '錛', - '' => '錣', - '' => '錒', - '' => '錁', - '' => '鍆', - '' => '錭', - '' => '錎', - '' => '錍', - '' => '鋋', - '' => '錝', - '' => '鋺', - '' => '錥', - '' => '錓', - '' => '鋹', - '' => '鋷', - '' => '錴', - '' => '錂', - '' => '錤', - '' => '鋿', - '' => '錩', - '' => '錹', - '' => '錵', - '' => '錪', - '' => '錔', - '' => '錌', - '@' => '錋', - 'A' => '鋾', - 'B' => '錉', - 'C' => '錀', - 'D' => '鋻', - 'E' => '錖', - 'F' => '閼', - 'G' => '闍', - 'H' => '閾', - 'I' => '閹', - 'J' => '閺', - 'K' => '閶', - 'L' => '閿', - 'M' => '閵', - 'N' => '閽', - 'O' => '隩', - 'P' => '雔', - 'Q' => '霋', - 'R' => '霒', - 'S' => '霐', - 'T' => '鞙', - 'U' => '鞗', - 'V' => '鞔', - 'W' => '韰', - 'X' => '韸', - 'Y' => '頵', - 'Z' => '頯', - '[' => '頲', - '\\' => '餤', - ']' => '餟', - '^' => '餧', - '_' => '餩', - '`' => '馞', - 'a' => '駮', - 'b' => '駬', - 'c' => '駥', - 'd' => '駤', - 'e' => '駰', - 'f' => '駣', - 'g' => '駪', - 'h' => '駩', - 'i' => '駧', - 'j' => '骹', - 'k' => '骿', - 'l' => '骴', - 'm' => '骻', - 'n' => '髶', - 'o' => '髺', - 'p' => '髹', - 'q' => '髷', - 'r' => '鬳', - 's' => '鮀', - 't' => '鮅', - 'u' => '鮇', - 'v' => '魼', - 'w' => '魾', - 'x' => '魻', - 'y' => '鮂', - 'z' => '鮓', - '{' => '鮒', - '|' => '鮐', - '}' => '魺', - '~' => '鮕', - '' => '魽', - '' => '鮈', - '' => '鴥', - '' => '鴗', - '' => '鴠', - '' => '鴞', - '' => '鴔', - '' => '鴩', - '' => '鴝', - '' => '鴘', - '' => '鴢', - '' => '鴐', - '' => '鴙', - '' => '鴟', - '' => '麈', - '' => '麆', - '' => '麇', - '' => '麮', - '' => '麭', - '' => '黕', - '' => '黖', - '' => '黺', - '' => '鼒', - '' => '鼽', - '' => '儦', - '' => '儥', - '' => '儢', - '' => '儤', - '' => '儠', - '' => '儩', - '' => '勴', - '' => '嚓', - '' => '嚌', - '' => '嚍', - '' => '嚆', - '' => '嚄', - '' => '嚃', - '' => '噾', - '' => '嚂', - '' => '噿', - '' => '嚁', - '' => '壖', - '' => '壔', - '' => '壏', - '' => '壒', - '' => '嬭', - '' => '嬥', - '' => '嬲', - '' => '嬣', - '' => '嬬', - '' => '嬧', - '' => '嬦', - '' => '嬯', - '' => '嬮', - '' => '孻', - '' => '寱', - '' => '寲', - '' => '嶷', - '' => '幬', - '' => '幪', - '' => '徾', - '' => '徻', - '' => '懃', - '' => '憵', - '' => '憼', - '' => '懧', - '' => '懠', - '' => '懥', - '' => '懤', - '' => '懨', - '' => '懞', - '' => '擯', - '' => '擩', - '' => '擣', - '' => '擫', - '' => '擤', - '' => '擨', - '' => '斁', - '' => '斀', - '' => '斶', - '' => '旚', - '' => '曒', - '' => '檍', - '' => '檖', - '' => '檁', - '' => '檥', - '' => '檉', - '' => '檟', - '' => '檛', - '' => '檡', - '' => '檞', - '' => '檇', - '' => '檓', - '' => '檎', - '@' => '檕', - 'A' => '檃', - 'B' => '檨', - 'C' => '檤', - 'D' => '檑', - 'E' => '橿', - 'F' => '檦', - 'G' => '檚', - 'H' => '檅', - 'I' => '檌', - 'J' => '檒', - 'K' => '歛', - 'L' => '殭', - 'M' => '氉', - 'N' => '濌', - 'O' => '澩', - 'P' => '濴', - 'Q' => '濔', - 'R' => '濣', - 'S' => '濜', - 'T' => '濭', - 'U' => '濧', - 'V' => '濦', - 'W' => '濞', - 'X' => '濲', - 'Y' => '濝', - 'Z' => '濢', - '[' => '濨', - '\\' => '燡', - ']' => '燱', - '^' => '燨', - '_' => '燲', - '`' => '燤', - 'a' => '燰', - 'b' => '燢', - 'c' => '獳', - 'd' => '獮', - 'e' => '獯', - 'f' => '璗', - 'g' => '璲', - 'h' => '璫', - 'i' => '璐', - 'j' => '璪', - 'k' => '璭', - 'l' => '璱', - 'm' => '璥', - 'n' => '璯', - 'o' => '甐', - 'p' => '甑', - 'q' => '甒', - 'r' => '甏', - 's' => '疄', - 't' => '癃', - 'u' => '癈', - 'v' => '癉', - 'w' => '癇', - 'x' => '皤', - 'y' => '盩', - 'z' => '瞵', - '{' => '瞫', - '|' => '瞲', - '}' => '瞷', - '~' => '瞶', - '' => '瞴', - '' => '瞱', - '' => '瞨', - '' => '矰', - '' => '磳', - '' => '磽', - '' => '礂', - '' => '磻', - '' => '磼', - '' => '磲', - '' => '礅', - '' => '磹', - '' => '磾', - '' => '礄', - '' => '禫', - '' => '禨', - '' => '穜', - '' => '穛', - '' => '穖', - '' => '穘', - '' => '穔', - '' => '穚', - '' => '窾', - '' => '竀', - '' => '竁', - '' => '簅', - '' => '簏', - '' => '篲', - '' => '簀', - '' => '篿', - '' => '篻', - '' => '簎', - '' => '篴', - '' => '簋', - '' => '篳', - '' => '簂', - '' => '簉', - '' => '簃', - '' => '簁', - '' => '篸', - '' => '篽', - '' => '簆', - '' => '篰', - '' => '篱', - '' => '簐', - '' => '簊', - '' => '糨', - '' => '縭', - '' => '縼', - '' => '繂', - '' => '縳', - '' => '顈', - '' => '縸', - '' => '縪', - '' => '繉', - '' => '繀', - '' => '繇', - '' => '縩', - '' => '繌', - '' => '縰', - '' => '縻', - '' => '縶', - '' => '繄', - '' => '縺', - '' => '罅', - '' => '罿', - '' => '罾', - '' => '罽', - '' => '翴', - '' => '翲', - '' => '耬', - '' => '膻', - '' => '臄', - '' => '臌', - '' => '臊', - '' => '臅', - '' => '臇', - '' => '膼', - '' => '臩', - '' => '艛', - '' => '艚', - '' => '艜', - '' => '薃', - '' => '薀', - '' => '薏', - '' => '薧', - '' => '薕', - '' => '薠', - '' => '薋', - '' => '薣', - '' => '蕻', - '' => '薤', - '' => '薚', - '' => '薞', - '@' => '蕷', - 'A' => '蕼', - 'B' => '薉', - 'C' => '薡', - 'D' => '蕺', - 'E' => '蕸', - 'F' => '蕗', - 'G' => '薎', - 'H' => '薖', - 'I' => '薆', - 'J' => '薍', - 'K' => '薙', - 'L' => '薝', - 'M' => '薁', - 'N' => '薢', - 'O' => '薂', - 'P' => '薈', - 'Q' => '薅', - 'R' => '蕹', - 'S' => '蕶', - 'T' => '薘', - 'U' => '薐', - 'V' => '薟', - 'W' => '虨', - 'X' => '螾', - 'Y' => '螪', - 'Z' => '螭', - '[' => '蟅', - '\\' => '螰', - ']' => '螬', - '^' => '螹', - '_' => '螵', - '`' => '螼', - 'a' => '螮', - 'b' => '蟉', - 'c' => '蟃', - 'd' => '蟂', - 'e' => '蟌', - 'f' => '螷', - 'g' => '螯', - 'h' => '蟄', - 'i' => '蟊', - 'j' => '螴', - 'k' => '螶', - 'l' => '螿', - 'm' => '螸', - 'n' => '螽', - 'o' => '蟞', - 'p' => '螲', - 'q' => '褵', - 'r' => '褳', - 's' => '褼', - 't' => '褾', - 'u' => '襁', - 'v' => '襒', - 'w' => '褷', - 'x' => '襂', - 'y' => '覭', - 'z' => '覯', - '{' => '覮', - '|' => '觲', - '}' => '觳', - '~' => '謞', - '' => '謘', - '' => '謖', - '' => '謑', - '' => '謅', - '' => '謋', - '' => '謢', - '' => '謏', - '' => '謒', - '' => '謕', - '' => '謇', - '' => '謍', - '' => '謈', - '' => '謆', - '' => '謜', - '' => '謓', - '' => '謚', - '' => '豏', - '' => '豰', - '' => '豲', - '' => '豱', - '' => '豯', - '' => '貕', - '' => '貔', - '' => '賹', - '' => '赯', - '' => '蹎', - '' => '蹍', - '' => '蹓', - '' => '蹐', - '' => '蹌', - '' => '蹇', - '' => '轃', - '' => '轀', - '' => '邅', - '' => '遾', - '' => '鄸', - '' => '醚', - '' => '醢', - '' => '醛', - '' => '醙', - '' => '醟', - '' => '醡', - '' => '醝', - '' => '醠', - '' => '鎡', - '' => '鎃', - '' => '鎯', - '' => '鍤', - '' => '鍖', - '' => '鍇', - '' => '鍼', - '' => '鍘', - '' => '鍜', - '' => '鍶', - '' => '鍉', - '' => '鍐', - '' => '鍑', - '' => '鍠', - '' => '鍭', - '' => '鎏', - '' => '鍌', - '' => '鍪', - '' => '鍹', - '' => '鍗', - '' => '鍕', - '' => '鍒', - '' => '鍏', - '' => '鍱', - '' => '鍷', - '' => '鍻', - '' => '鍡', - '' => '鍞', - '' => '鍣', - '' => '鍧', - '' => '鎀', - '' => '鍎', - '' => '鍙', - '' => '闇', - '' => '闀', - '' => '闉', - '' => '闃', - '' => '闅', - '' => '閷', - '' => '隮', - '' => '隰', - '' => '隬', - '' => '霠', - '' => '霟', - '' => '霘', - '' => '霝', - '' => '霙', - '' => '鞚', - '' => '鞡', - '' => '鞜', - '@' => '鞞', - 'A' => '鞝', - 'B' => '韕', - 'C' => '韔', - 'D' => '韱', - 'E' => '顁', - 'F' => '顄', - 'G' => '顊', - 'H' => '顉', - 'I' => '顅', - 'J' => '顃', - 'K' => '餥', - 'L' => '餫', - 'M' => '餬', - 'N' => '餪', - 'O' => '餳', - 'P' => '餲', - 'Q' => '餯', - 'R' => '餭', - 'S' => '餱', - 'T' => '餰', - 'U' => '馘', - 'V' => '馣', - 'W' => '馡', - 'X' => '騂', - 'Y' => '駺', - 'Z' => '駴', - '[' => '駷', - '\\' => '駹', - ']' => '駸', - '^' => '駶', - '_' => '駻', - '`' => '駽', - 'a' => '駾', - 'b' => '駼', - 'c' => '騃', - 'd' => '骾', - 'e' => '髾', - 'f' => '髽', - 'g' => '鬁', - 'h' => '髼', - 'i' => '魈', - 'j' => '鮚', - 'k' => '鮨', - 'l' => '鮞', - 'm' => '鮛', - 'n' => '鮦', - 'o' => '鮡', - 'p' => '鮥', - 'q' => '鮤', - 'r' => '鮆', - 's' => '鮢', - 't' => '鮠', - 'u' => '鮯', - 'v' => '鴳', - 'w' => '鵁', - 'x' => '鵧', - 'y' => '鴶', - 'z' => '鴮', - '{' => '鴯', - '|' => '鴱', - '}' => '鴸', - '~' => '鴰', - '' => '鵅', - '' => '鵂', - '' => '鵃', - '' => '鴾', - '' => '鴷', - '' => '鵀', - '' => '鴽', - '' => '翵', - '' => '鴭', - '' => '麊', - '' => '麉', - '' => '麍', - '' => '麰', - '' => '黈', - '' => '黚', - '' => '黻', - '' => '黿', - '' => '鼤', - '' => '鼣', - '' => '鼢', - '' => '齔', - '' => '龠', - '' => '儱', - '' => '儭', - '' => '儮', - '' => '嚘', - '' => '嚜', - '' => '嚗', - '' => '嚚', - '' => '嚝', - '' => '嚙', - '' => '奰', - '' => '嬼', - '' => '屩', - '' => '屪', - '' => '巀', - '' => '幭', - '' => '幮', - '' => '懘', - '' => '懟', - '' => '懭', - '' => '懮', - '' => '懱', - '' => '懪', - '' => '懰', - '' => '懫', - '' => '懖', - '' => '懩', - '' => '擿', - '' => '攄', - '' => '擽', - '' => '擸', - '' => '攁', - '' => '攃', - '' => '擼', - '' => '斔', - '' => '旛', - '' => '曚', - '' => '曛', - '' => '曘', - '' => '櫅', - '' => '檹', - '' => '檽', - '' => '櫡', - '' => '櫆', - '' => '檺', - '' => '檶', - '' => '檷', - '' => '櫇', - '' => '檴', - '' => '檭', - '' => '歞', - '' => '毉', - '' => '氋', - '' => '瀇', - '' => '瀌', - '' => '瀍', - '' => '瀁', - '' => '瀅', - '' => '瀔', - '' => '瀎', - '' => '濿', - '' => '瀀', - '' => '濻', - '' => '瀦', - '' => '濼', - '' => '濷', - '' => '瀊', - '' => '爁', - '' => '燿', - '' => '燹', - '' => '爃', - '' => '燽', - '' => '獶', - '@' => '璸', - 'A' => '瓀', - 'B' => '璵', - 'C' => '瓁', - 'D' => '璾', - 'E' => '璶', - 'F' => '璻', - 'G' => '瓂', - 'H' => '甔', - 'I' => '甓', - 'J' => '癜', - 'K' => '癤', - 'L' => '癙', - 'M' => '癐', - 'N' => '癓', - 'O' => '癗', - 'P' => '癚', - 'Q' => '皦', - 'R' => '皽', - 'S' => '盬', - 'T' => '矂', - 'U' => '瞺', - 'V' => '磿', - 'W' => '礌', - 'X' => '礓', - 'Y' => '礔', - 'Z' => '礉', - '[' => '礐', - '\\' => '礒', - ']' => '礑', - '^' => '禭', - '_' => '禬', - '`' => '穟', - 'a' => '簜', - 'b' => '簩', - 'c' => '簙', - 'd' => '簠', - 'e' => '簟', - 'f' => '簭', - 'g' => '簝', - 'h' => '簦', - 'i' => '簨', - 'j' => '簢', - 'k' => '簥', - 'l' => '簰', - 'm' => '繜', - 'n' => '繐', - 'o' => '繖', - 'p' => '繣', - 'q' => '繘', - 'r' => '繢', - 's' => '繟', - 't' => '繑', - 'u' => '繠', - 'v' => '繗', - 'w' => '繓', - 'x' => '羵', - 'y' => '羳', - 'z' => '翷', - '{' => '翸', - '|' => '聵', - '}' => '臑', - '~' => '臒', - '' => '臐', - '' => '艟', - '' => '艞', - '' => '薴', - '' => '藆', - '' => '藀', - '' => '藃', - '' => '藂', - '' => '薳', - '' => '薵', - '' => '薽', - '' => '藇', - '' => '藄', - '' => '薿', - '' => '藋', - '' => '藎', - '' => '藈', - '' => '藅', - '' => '薱', - '' => '薶', - '' => '藒', - '' => '蘤', - '' => '薸', - '' => '薷', - '' => '薾', - '' => '虩', - '' => '蟧', - '' => '蟦', - '' => '蟢', - '' => '蟛', - '' => '蟫', - '' => '蟪', - '' => '蟥', - '' => '蟟', - '' => '蟳', - '' => '蟤', - '' => '蟔', - '' => '蟜', - '' => '蟓', - '' => '蟭', - '' => '蟘', - '' => '蟣', - '' => '螤', - '' => '蟗', - '' => '蟙', - '' => '蠁', - '' => '蟴', - '' => '蟨', - '' => '蟝', - '' => '襓', - '' => '襋', - '' => '襏', - '' => '襌', - '' => '襆', - '' => '襐', - '' => '襑', - '' => '襉', - '' => '謪', - '' => '謧', - '' => '謣', - '' => '謳', - '' => '謰', - '' => '謵', - '' => '譇', - '' => '謯', - '' => '謼', - '' => '謾', - '' => '謱', - '' => '謥', - '' => '謷', - '' => '謦', - '' => '謶', - '' => '謮', - '' => '謤', - '' => '謻', - '' => '謽', - '' => '謺', - '' => '豂', - '' => '豵', - '' => '貙', - '' => '貘', - '' => '貗', - '' => '賾', - '' => '贄', - '' => '贂', - '' => '贀', - '' => '蹜', - '' => '蹢', - '' => '蹠', - '' => '蹗', - '' => '蹖', - '' => '蹞', - '' => '蹥', - '' => '蹧', - '@' => '蹛', - 'A' => '蹚', - 'B' => '蹡', - 'C' => '蹝', - 'D' => '蹩', - 'E' => '蹔', - 'F' => '轆', - 'G' => '轇', - 'H' => '轈', - 'I' => '轋', - 'J' => '鄨', - 'K' => '鄺', - 'L' => '鄻', - 'M' => '鄾', - 'N' => '醨', - 'O' => '醥', - 'P' => '醧', - 'Q' => '醯', - 'R' => '醪', - 'S' => '鎵', - 'T' => '鎌', - 'U' => '鎒', - 'V' => '鎷', - 'W' => '鎛', - 'X' => '鎝', - 'Y' => '鎉', - 'Z' => '鎧', - '[' => '鎎', - '\\' => '鎪', - ']' => '鎞', - '^' => '鎦', - '_' => '鎕', - '`' => '鎈', - 'a' => '鎙', - 'b' => '鎟', - 'c' => '鎍', - 'd' => '鎱', - 'e' => '鎑', - 'f' => '鎲', - 'g' => '鎤', - 'h' => '鎨', - 'i' => '鎴', - 'j' => '鎣', - 'k' => '鎥', - 'l' => '闒', - 'm' => '闓', - 'n' => '闑', - 'o' => '隳', - 'p' => '雗', - 'q' => '雚', - 'r' => '巂', - 's' => '雟', - 't' => '雘', - 'u' => '雝', - 'v' => '霣', - 'w' => '霢', - 'x' => '霥', - 'y' => '鞬', - 'z' => '鞮', - '{' => '鞨', - '|' => '鞫', - '}' => '鞤', - '~' => '鞪', - '' => '鞢', - '' => '鞥', - '' => '韗', - '' => '韙', - '' => '韖', - '' => '韘', - '' => '韺', - '' => '顐', - '' => '顑', - '' => '顒', - '' => '颸', - '' => '饁', - '' => '餼', - '' => '餺', - '' => '騏', - '' => '騋', - '' => '騉', - '' => '騍', - '' => '騄', - '' => '騑', - '' => '騊', - '' => '騅', - '' => '騇', - '' => '騆', - '' => '髀', - '' => '髜', - '' => '鬈', - '' => '鬄', - '' => '鬅', - '' => '鬩', - '' => '鬵', - '' => '魊', - '' => '魌', - '' => '魋', - '' => '鯇', - '' => '鯆', - '' => '鯃', - '' => '鮿', - '' => '鯁', - '' => '鮵', - '' => '鮸', - '' => '鯓', - '' => '鮶', - '' => '鯄', - '' => '鮹', - '' => '鮽', - '' => '鵜', - '' => '鵓', - '' => '鵏', - '' => '鵊', - '' => '鵛', - '' => '鵋', - '' => '鵙', - '' => '鵖', - '' => '鵌', - '' => '鵗', - '' => '鵒', - '' => '鵔', - '' => '鵟', - '' => '鵘', - '' => '鵚', - '' => '麎', - '' => '麌', - '' => '黟', - '' => '鼁', - '' => '鼀', - '' => '鼖', - '' => '鼥', - '' => '鼫', - '' => '鼪', - '' => '鼩', - '' => '鼨', - '' => '齌', - '' => '齕', - '' => '儴', - '' => '儵', - '' => '劖', - '' => '勷', - '' => '厴', - '' => '嚫', - '' => '嚭', - '' => '嚦', - '' => '嚧', - '' => '嚪', - '' => '嚬', - '' => '壚', - '' => '壝', - '' => '壛', - '' => '夒', - '' => '嬽', - '' => '嬾', - '' => '嬿', - '' => '巃', - '' => '幰', - '@' => '徿', - 'A' => '懻', - 'B' => '攇', - 'C' => '攐', - 'D' => '攍', - 'E' => '攉', - 'F' => '攌', - 'G' => '攎', - 'H' => '斄', - 'I' => '旞', - 'J' => '旝', - 'K' => '曞', - 'L' => '櫧', - 'M' => '櫠', - 'N' => '櫌', - 'O' => '櫑', - 'P' => '櫙', - 'Q' => '櫋', - 'R' => '櫟', - 'S' => '櫜', - 'T' => '櫐', - 'U' => '櫫', - 'V' => '櫏', - 'W' => '櫍', - 'X' => '櫞', - 'Y' => '歠', - 'Z' => '殰', - '[' => '氌', - '\\' => '瀙', - ']' => '瀧', - '^' => '瀠', - '_' => '瀖', - '`' => '瀫', - 'a' => '瀡', - 'b' => '瀢', - 'c' => '瀣', - 'd' => '瀩', - 'e' => '瀗', - 'f' => '瀤', - 'g' => '瀜', - 'h' => '瀪', - 'i' => '爌', - 'j' => '爊', - 'k' => '爇', - 'l' => '爂', - 'm' => '爅', - 'n' => '犥', - 'o' => '犦', - 'p' => '犤', - 'q' => '犣', - 'r' => '犡', - 's' => '瓋', - 't' => '瓅', - 'u' => '璷', - 'v' => '瓃', - 'w' => '甖', - 'x' => '癠', - 'y' => '矉', - 'z' => '矊', - '{' => '矄', - '|' => '矱', - '}' => '礝', - '~' => '礛', - '' => '礡', - '' => '礜', - '' => '礗', - '' => '礞', - '' => '禰', - '' => '穧', - '' => '穨', - '' => '簳', - '' => '簼', - '' => '簹', - '' => '簬', - '' => '簻', - '' => '糬', - '' => '糪', - '' => '繶', - '' => '繵', - '' => '繸', - '' => '繰', - '' => '繷', - '' => '繯', - '' => '繺', - '' => '繲', - '' => '繴', - '' => '繨', - '' => '罋', - '' => '罊', - '' => '羃', - '' => '羆', - '' => '羷', - '' => '翽', - '' => '翾', - '' => '聸', - '' => '臗', - '' => '臕', - '' => '艤', - '' => '艡', - '' => '艣', - '' => '藫', - '' => '藱', - '' => '藭', - '' => '藙', - '' => '藡', - '' => '藨', - '' => '藚', - '' => '藗', - '' => '藬', - '' => '藲', - '' => '藸', - '' => '藘', - '' => '藟', - '' => '藣', - '' => '藜', - '' => '藑', - '' => '藰', - '' => '藦', - '' => '藯', - '' => '藞', - '' => '藢', - '' => '蠀', - '' => '蟺', - '' => '蠃', - '' => '蟶', - '' => '蟷', - '' => '蠉', - '' => '蠌', - '' => '蠋', - '' => '蠆', - '' => '蟼', - '' => '蠈', - '' => '蟿', - '' => '蠊', - '' => '蠂', - '' => '襢', - '' => '襚', - '' => '襛', - '' => '襗', - '' => '襡', - '' => '襜', - '' => '襘', - '' => '襝', - '' => '襙', - '' => '覈', - '' => '覷', - '' => '覶', - '' => '觶', - '' => '譐', - '' => '譈', - '' => '譊', - '' => '譀', - '' => '譓', - '' => '譖', - '' => '譔', - '' => '譋', - '' => '譕', - '@' => '譑', - 'A' => '譂', - 'B' => '譒', - 'C' => '譗', - 'D' => '豃', - 'E' => '豷', - 'F' => '豶', - 'G' => '貚', - 'H' => '贆', - 'I' => '贇', - 'J' => '贉', - 'K' => '趬', - 'L' => '趪', - 'M' => '趭', - 'N' => '趫', - 'O' => '蹭', - 'P' => '蹸', - 'Q' => '蹳', - 'R' => '蹪', - 'S' => '蹯', - 'T' => '蹻', - 'U' => '軂', - 'V' => '轒', - 'W' => '轑', - 'X' => '轏', - 'Y' => '轐', - 'Z' => '轓', - '[' => '辴', - '\\' => '酀', - ']' => '鄿', - '^' => '醰', - '_' => '醭', - '`' => '鏞', - 'a' => '鏇', - 'b' => '鏏', - 'c' => '鏂', - 'd' => '鏚', - 'e' => '鏐', - 'f' => '鏹', - 'g' => '鏬', - 'h' => '鏌', - 'i' => '鏙', - 'j' => '鎩', - 'k' => '鏦', - 'l' => '鏊', - 'm' => '鏔', - 'n' => '鏮', - 'o' => '鏣', - 'p' => '鏕', - 'q' => '鏄', - 'r' => '鏎', - 's' => '鏀', - 't' => '鏒', - 'u' => '鏧', - 'v' => '镽', - 'w' => '闚', - 'x' => '闛', - 'y' => '雡', - 'z' => '霩', - '{' => '霫', - '|' => '霬', - '}' => '霨', - '~' => '霦', - '' => '鞳', - '' => '鞷', - '' => '鞶', - '' => '韝', - '' => '韞', - '' => '韟', - '' => '顜', - '' => '顙', - '' => '顝', - '' => '顗', - '' => '颿', - '' => '颽', - '' => '颻', - '' => '颾', - '' => '饈', - '' => '饇', - '' => '饃', - '' => '馦', - '' => '馧', - '' => '騚', - '' => '騕', - '' => '騥', - '' => '騝', - '' => '騤', - '' => '騛', - '' => '騢', - '' => '騠', - '' => '騧', - '' => '騣', - '' => '騞', - '' => '騜', - '' => '騔', - '' => '髂', - '' => '鬋', - '' => '鬊', - '' => '鬎', - '' => '鬌', - '' => '鬷', - '' => '鯪', - '' => '鯫', - '' => '鯠', - '' => '鯞', - '' => '鯤', - '' => '鯦', - '' => '鯢', - '' => '鯰', - '' => '鯔', - '' => '鯗', - '' => '鯬', - '' => '鯜', - '' => '鯙', - '' => '鯥', - '' => '鯕', - '' => '鯡', - '' => '鯚', - '' => '鵷', - '' => '鶁', - '' => '鶊', - '' => '鶄', - '' => '鶈', - '' => '鵱', - '' => '鶀', - '' => '鵸', - '' => '鶆', - '' => '鶋', - '' => '鶌', - '' => '鵽', - '' => '鵫', - '' => '鵴', - '' => '鵵', - '' => '鵰', - '' => '鵩', - '' => '鶅', - '' => '鵳', - '' => '鵻', - '' => '鶂', - '' => '鵯', - '' => '鵹', - '' => '鵿', - '' => '鶇', - '' => '鵨', - '' => '麔', - '' => '麑', - '' => '黀', - '' => '黼', - '' => '鼭', - '' => '齀', - '' => '齁', - '' => '齍', - '' => '齖', - '' => '齗', - '' => '齘', - '' => '匷', - '' => '嚲', - '@' => '嚵', - 'A' => '嚳', - 'B' => '壣', - 'C' => '孅', - 'D' => '巆', - 'E' => '巇', - 'F' => '廮', - 'G' => '廯', - 'H' => '忀', - 'I' => '忁', - 'J' => '懹', - 'K' => '攗', - 'L' => '攖', - 'M' => '攕', - 'N' => '攓', - 'O' => '旟', - 'P' => '曨', - 'Q' => '曣', - 'R' => '曤', - 'S' => '櫳', - 'T' => '櫰', - 'U' => '櫪', - 'V' => '櫨', - 'W' => '櫹', - 'X' => '櫱', - 'Y' => '櫮', - 'Z' => '櫯', - '[' => '瀼', - '\\' => '瀵', - ']' => '瀯', - '^' => '瀷', - '_' => '瀴', - '`' => '瀱', - 'a' => '灂', - 'b' => '瀸', - 'c' => '瀿', - 'd' => '瀺', - 'e' => '瀹', - 'f' => '灀', - 'g' => '瀻', - 'h' => '瀳', - 'i' => '灁', - 'j' => '爓', - 'k' => '爔', - 'l' => '犨', - 'm' => '獽', - 'n' => '獼', - 'o' => '璺', - 'p' => '皫', - 'q' => '皪', - 'r' => '皾', - 's' => '盭', - 't' => '矌', - 'u' => '矎', - 'v' => '矏', - 'w' => '矍', - 'x' => '矲', - 'y' => '礥', - 'z' => '礣', - '{' => '礧', - '|' => '礨', - '}' => '礤', - '~' => '礩', - '' => '禲', - '' => '穮', - '' => '穬', - '' => '穭', - '' => '竷', - '' => '籉', - '' => '籈', - '' => '籊', - '' => '籇', - '' => '籅', - '' => '糮', - '' => '繻', - '' => '繾', - '' => '纁', - '' => '纀', - '' => '羺', - '' => '翿', - '' => '聹', - '' => '臛', - '' => '臙', - '' => '舋', - '' => '艨', - '' => '艩', - '' => '蘢', - '' => '藿', - '' => '蘁', - '' => '藾', - '' => '蘛', - '' => '蘀', - '' => '藶', - '' => '蘄', - '' => '蘉', - '' => '蘅', - '' => '蘌', - '' => '藽', - '' => '蠙', - '' => '蠐', - '' => '蠑', - '' => '蠗', - '' => '蠓', - '' => '蠖', - '' => '襣', - '' => '襦', - '' => '覹', - '' => '觷', - '' => '譠', - '' => '譪', - '' => '譝', - '' => '譨', - '' => '譣', - '' => '譥', - '' => '譧', - '' => '譭', - '' => '趮', - '' => '躆', - '' => '躈', - '' => '躄', - '' => '轙', - '' => '轖', - '' => '轗', - '' => '轕', - '' => '轘', - '' => '轚', - '' => '邍', - '' => '酃', - '' => '酁', - '' => '醷', - '' => '醵', - '' => '醲', - '' => '醳', - '' => '鐋', - '' => '鐓', - '' => '鏻', - '' => '鐠', - '' => '鐏', - '' => '鐔', - '' => '鏾', - '' => '鐕', - '' => '鐐', - '' => '鐨', - '' => '鐙', - '' => '鐍', - '' => '鏵', - '' => '鐀', - '' => '鏷', - '' => '鐇', - '' => '鐎', - '' => '鐖', - '' => '鐒', - '' => '鏺', - '' => '鐉', - '' => '鏸', - '' => '鐊', - '' => '鏿', - '@' => '鏼', - 'A' => '鐌', - 'B' => '鏶', - 'C' => '鐑', - 'D' => '鐆', - 'E' => '闞', - 'F' => '闠', - 'G' => '闟', - 'H' => '霮', - 'I' => '霯', - 'J' => '鞹', - 'K' => '鞻', - 'L' => '韽', - 'M' => '韾', - 'N' => '顠', - 'O' => '顢', - 'P' => '顣', - 'Q' => '顟', - 'R' => '飁', - 'S' => '飂', - 'T' => '饐', - 'U' => '饎', - 'V' => '饙', - 'W' => '饌', - 'X' => '饋', - 'Y' => '饓', - 'Z' => '騲', - '[' => '騴', - '\\' => '騱', - ']' => '騬', - '^' => '騪', - '_' => '騶', - '`' => '騩', - 'a' => '騮', - 'b' => '騸', - 'c' => '騭', - 'd' => '髇', - 'e' => '髊', - 'f' => '髆', - 'g' => '鬐', - 'h' => '鬒', - 'i' => '鬑', - 'j' => '鰋', - 'k' => '鰈', - 'l' => '鯷', - 'm' => '鰅', - 'n' => '鰒', - 'o' => '鯸', - 'p' => '鱀', - 'q' => '鰇', - 'r' => '鰎', - 's' => '鰆', - 't' => '鰗', - 'u' => '鰔', - 'v' => '鰉', - 'w' => '鶟', - 'x' => '鶙', - 'y' => '鶤', - 'z' => '鶝', - '{' => '鶒', - '|' => '鶘', - '}' => '鶐', - '~' => '鶛', - '' => '鶠', - '' => '鶔', - '' => '鶜', - '' => '鶪', - '' => '鶗', - '' => '鶡', - '' => '鶚', - '' => '鶢', - '' => '鶨', - '' => '鶞', - '' => '鶣', - '' => '鶿', - '' => '鶩', - '' => '鶖', - '' => '鶦', - '' => '鶧', - '' => '麙', - '' => '麛', - '' => '麚', - '' => '黥', - '' => '黤', - '' => '黧', - '' => '黦', - '' => '鼰', - '' => '鼮', - '' => '齛', - '' => '齠', - '' => '齞', - '' => '齝', - '' => '齙', - '' => '龑', - '' => '儺', - '' => '儹', - '' => '劘', - '' => '劗', - '' => '囃', - '' => '嚽', - '' => '嚾', - '' => '孈', - '' => '孇', - '' => '巋', - '' => '巏', - '' => '廱', - '' => '懽', - '' => '攛', - '' => '欂', - '' => '櫼', - '' => '欃', - '' => '櫸', - '' => '欀', - '' => '灃', - '' => '灄', - '' => '灊', - '' => '灈', - '' => '灉', - '' => '灅', - '' => '灆', - '' => '爝', - '' => '爚', - '' => '爙', - '' => '獾', - '' => '甗', - '' => '癪', - '' => '矐', - '' => '礭', - '' => '礱', - '' => '礯', - '' => '籔', - '' => '籓', - '' => '糲', - '' => '纊', - '' => '纇', - '' => '纈', - '' => '纋', - '' => '纆', - '' => '纍', - '' => '罍', - '' => '羻', - '' => '耰', - '' => '臝', - '' => '蘘', - '' => '蘪', - '' => '蘦', - '' => '蘟', - '' => '蘣', - '' => '蘜', - '' => '蘙', - '' => '蘧', - '' => '蘮', - '' => '蘡', - '' => '蘠', - '' => '蘩', - '' => '蘞', - '' => '蘥', - '@' => '蠩', - 'A' => '蠝', - 'B' => '蠛', - 'C' => '蠠', - 'D' => '蠤', - 'E' => '蠜', - 'F' => '蠫', - 'G' => '衊', - 'H' => '襭', - 'I' => '襩', - 'J' => '襮', - 'K' => '襫', - 'L' => '觺', - 'M' => '譹', - 'N' => '譸', - 'O' => '譅', - 'P' => '譺', - 'Q' => '譻', - 'R' => '贐', - 'S' => '贔', - 'T' => '趯', - 'U' => '躎', - 'V' => '躌', - 'W' => '轞', - 'X' => '轛', - 'Y' => '轝', - 'Z' => '酆', - '[' => '酄', - '\\' => '酅', - ']' => '醹', - '^' => '鐿', - '_' => '鐻', - '`' => '鐶', - 'a' => '鐩', - 'b' => '鐽', - 'c' => '鐼', - 'd' => '鐰', - 'e' => '鐹', - 'f' => '鐪', - 'g' => '鐷', - 'h' => '鐬', - 'i' => '鑀', - 'j' => '鐱', - 'k' => '闥', - 'l' => '闤', - 'm' => '闣', - 'n' => '霵', - 'o' => '霺', - 'p' => '鞿', - 'q' => '韡', - 'r' => '顤', - 's' => '飉', - 't' => '飆', - 'u' => '飀', - 'v' => '饘', - 'w' => '饖', - 'x' => '騹', - 'y' => '騽', - 'z' => '驆', - '{' => '驄', - '|' => '驂', - '}' => '驁', - '~' => '騺', - '' => '騿', - '' => '髍', - '' => '鬕', - '' => '鬗', - '' => '鬘', - '' => '鬖', - '' => '鬺', - '' => '魒', - '' => '鰫', - '' => '鰝', - '' => '鰜', - '' => '鰬', - '' => '鰣', - '' => '鰨', - '' => '鰩', - '' => '鰤', - '' => '鰡', - '' => '鶷', - '' => '鶶', - '' => '鶼', - '' => '鷁', - '' => '鷇', - '' => '鷊', - '' => '鷏', - '' => '鶾', - '' => '鷅', - '' => '鷃', - '' => '鶻', - '' => '鶵', - '' => '鷎', - '' => '鶹', - '' => '鶺', - '' => '鶬', - '' => '鷈', - '' => '鶱', - '' => '鶭', - '' => '鷌', - '' => '鶳', - '' => '鷍', - '' => '鶲', - '' => '鹺', - '' => '麜', - '' => '黫', - '' => '黮', - '' => '黭', - '' => '鼛', - '' => '鼘', - '' => '鼚', - '' => '鼱', - '' => '齎', - '' => '齥', - '' => '齤', - '' => '龒', - '' => '亹', - '' => '囆', - '' => '囅', - '' => '囋', - '' => '奱', - '' => '孋', - '' => '孌', - '' => '巕', - '' => '巑', - '' => '廲', - '' => '攡', - '' => '攠', - '' => '攦', - '' => '攢', - '' => '欋', - '' => '欈', - '' => '欉', - '' => '氍', - '' => '灕', - '' => '灖', - '' => '灗', - '' => '灒', - '' => '爞', - '' => '爟', - '' => '犩', - '' => '獿', - '' => '瓘', - '' => '瓕', - '' => '瓙', - '' => '瓗', - '' => '癭', - '' => '皭', - '' => '礵', - '' => '禴', - '' => '穰', - '' => '穱', - '' => '籗', - '' => '籜', - '' => '籙', - '' => '籛', - '' => '籚', - '@' => '糴', - 'A' => '糱', - 'B' => '纑', - 'C' => '罏', - 'D' => '羇', - 'E' => '臞', - 'F' => '艫', - 'G' => '蘴', - 'H' => '蘵', - 'I' => '蘳', - 'J' => '蘬', - 'K' => '蘲', - 'L' => '蘶', - 'M' => '蠬', - 'N' => '蠨', - 'O' => '蠦', - 'P' => '蠪', - 'Q' => '蠥', - 'R' => '襱', - 'S' => '覿', - 'T' => '覾', - 'U' => '觻', - 'V' => '譾', - 'W' => '讄', - 'X' => '讂', - 'Y' => '讆', - 'Z' => '讅', - '[' => '譿', - '\\' => '贕', - ']' => '躕', - '^' => '躔', - '_' => '躚', - '`' => '躒', - 'a' => '躐', - 'b' => '躖', - 'c' => '躗', - 'd' => '轠', - 'e' => '轢', - 'f' => '酇', - 'g' => '鑌', - 'h' => '鑐', - 'i' => '鑊', - 'j' => '鑋', - 'k' => '鑏', - 'l' => '鑇', - 'm' => '鑅', - 'n' => '鑈', - 'o' => '鑉', - 'p' => '鑆', - 'q' => '霿', - 'r' => '韣', - 's' => '顪', - 't' => '顩', - 'u' => '飋', - 'v' => '饔', - 'w' => '饛', - 'x' => '驎', - 'y' => '驓', - 'z' => '驔', - '{' => '驌', - '|' => '驏', - '}' => '驈', - '~' => '驊', - '' => '驉', - '' => '驒', - '' => '驐', - '' => '髐', - '' => '鬙', - '' => '鬫', - '' => '鬻', - '' => '魖', - '' => '魕', - '' => '鱆', - '' => '鱈', - '' => '鰿', - '' => '鱄', - '' => '鰹', - '' => '鰳', - '' => '鱁', - '' => '鰼', - '' => '鰷', - '' => '鰴', - '' => '鰲', - '' => '鰽', - '' => '鰶', - '' => '鷛', - '' => '鷒', - '' => '鷞', - '' => '鷚', - '' => '鷋', - '' => '鷐', - '' => '鷜', - '' => '鷑', - '' => '鷟', - '' => '鷩', - '' => '鷙', - '' => '鷘', - '' => '鷖', - '' => '鷵', - '' => '鷕', - '' => '鷝', - '' => '麶', - '' => '黰', - '' => '鼵', - '' => '鼳', - '' => '鼲', - '' => '齂', - '' => '齫', - '' => '龕', - '' => '龢', - '' => '儽', - '' => '劙', - '' => '壨', - '' => '壧', - '' => '奲', - '' => '孍', - '' => '巘', - '' => '蠯', - '' => '彏', - '' => '戁', - '' => '戃', - '' => '戄', - '' => '攩', - '' => '攥', - '' => '斖', - '' => '曫', - '' => '欑', - '' => '欒', - '' => '欏', - '' => '毊', - '' => '灛', - '' => '灚', - '' => '爢', - '' => '玂', - '' => '玁', - '' => '玃', - '' => '癰', - '' => '矔', - '' => '籧', - '' => '籦', - '' => '纕', - '' => '艬', - '' => '蘺', - '' => '虀', - '' => '蘹', - '' => '蘼', - '' => '蘱', - '' => '蘻', - '' => '蘾', - '' => '蠰', - '' => '蠲', - '' => '蠮', - '' => '蠳', - '' => '襶', - '' => '襴', - '' => '襳', - '' => '觾', - '@' => '讌', - 'A' => '讎', - 'B' => '讋', - 'C' => '讈', - 'D' => '豅', - 'E' => '贙', - 'F' => '躘', - 'G' => '轤', - 'H' => '轣', - 'I' => '醼', - 'J' => '鑢', - 'K' => '鑕', - 'L' => '鑝', - 'M' => '鑗', - 'N' => '鑞', - 'O' => '韄', - 'P' => '韅', - 'Q' => '頀', - 'R' => '驖', - 'S' => '驙', - 'T' => '鬞', - 'U' => '鬟', - 'V' => '鬠', - 'W' => '鱒', - 'X' => '鱘', - 'Y' => '鱐', - 'Z' => '鱊', - '[' => '鱍', - '\\' => '鱋', - ']' => '鱕', - '^' => '鱙', - '_' => '鱌', - '`' => '鱎', - 'a' => '鷻', - 'b' => '鷷', - 'c' => '鷯', - 'd' => '鷣', - 'e' => '鷫', - 'f' => '鷸', - 'g' => '鷤', - 'h' => '鷶', - 'i' => '鷡', - 'j' => '鷮', - 'k' => '鷦', - 'l' => '鷲', - 'm' => '鷰', - 'n' => '鷢', - 'o' => '鷬', - 'p' => '鷴', - 'q' => '鷳', - 'r' => '鷨', - 's' => '鷭', - 't' => '黂', - 'u' => '黐', - 'v' => '黲', - 'w' => '黳', - 'x' => '鼆', - 'y' => '鼜', - 'z' => '鼸', - '{' => '鼷', - '|' => '鼶', - '}' => '齃', - '~' => '齏', - '' => '齱', - '' => '齰', - '' => '齮', - '' => '齯', - '' => '囓', - '' => '囍', - '' => '孎', - '' => '屭', - '' => '攭', - '' => '曭', - '' => '曮', - '' => '欓', - '' => '灟', - '' => '灡', - '' => '灝', - '' => '灠', - '' => '爣', - '' => '瓛', - '' => '瓥', - '' => '矕', - '' => '礸', - '' => '禷', - '' => '禶', - '' => '籪', - '' => '纗', - '' => '羉', - '' => '艭', - '' => '虃', - '' => '蠸', - '' => '蠷', - '' => '蠵', - '' => '衋', - '' => '讔', - '' => '讕', - '' => '躞', - '' => '躟', - '' => '躠', - '' => '躝', - '' => '醾', - '' => '醽', - '' => '釂', - '' => '鑫', - '' => '鑨', - '' => '鑩', - '' => '雥', - '' => '靆', - '' => '靃', - '' => '靇', - '' => '韇', - '' => '韥', - '' => '驞', - '' => '髕', - '' => '魙', - '' => '鱣', - '' => '鱧', - '' => '鱦', - '' => '鱢', - '' => '鱞', - '' => '鱠', - '' => '鸂', - '' => '鷾', - '' => '鸇', - '' => '鸃', - '' => '鸆', - '' => '鸅', - '' => '鸀', - '' => '鸁', - '' => '鸉', - '' => '鷿', - '' => '鷽', - '' => '鸄', - '' => '麠', - '' => '鼞', - '' => '齆', - '' => '齴', - '' => '齵', - '' => '齶', - '' => '囔', - '' => '攮', - '' => '斸', - '' => '欘', - '' => '欙', - '' => '欗', - '' => '欚', - '' => '灢', - '' => '爦', - '' => '犪', - '' => '矘', - '' => '矙', - '' => '礹', - '' => '籩', - '' => '籫', - '' => '糶', - '' => '纚', - '@' => '纘', - 'A' => '纛', - 'B' => '纙', - 'C' => '臠', - 'D' => '臡', - 'E' => '虆', - 'F' => '虇', - 'G' => '虈', - 'H' => '襹', - 'I' => '襺', - 'J' => '襼', - 'K' => '襻', - 'L' => '觿', - 'M' => '讘', - 'N' => '讙', - 'O' => '躥', - 'P' => '躤', - 'Q' => '躣', - 'R' => '鑮', - 'S' => '鑭', - 'T' => '鑯', - 'U' => '鑱', - 'V' => '鑳', - 'W' => '靉', - 'X' => '顲', - 'Y' => '饟', - 'Z' => '鱨', - '[' => '鱮', - '\\' => '鱭', - ']' => '鸋', - '^' => '鸍', - '_' => '鸐', - '`' => '鸏', - 'a' => '鸒', - 'b' => '鸑', - 'c' => '麡', - 'd' => '黵', - 'e' => '鼉', - 'f' => '齇', - 'g' => '齸', - 'h' => '齻', - 'i' => '齺', - 'j' => '齹', - 'k' => '圞', - 'l' => '灦', - 'm' => '籯', - 'n' => '蠼', - 'o' => '趲', - 'p' => '躦', - 'q' => '釃', - 'r' => '鑴', - 's' => '鑸', - 't' => '鑶', - 'u' => '鑵', - 'v' => '驠', - 'w' => '鱴', - 'x' => '鱳', - 'y' => '鱱', - 'z' => '鱵', - '{' => '鸔', - '|' => '鸓', - '}' => '黶', - '~' => '鼊', - '' => '龤', - '' => '灨', - '' => '灥', - '' => '糷', - '' => '虪', - '' => '蠾', - '' => '蠽', - '' => '蠿', - '' => '讞', - '' => '貜', - '' => '躩', - '' => '軉', - '' => '靋', - '' => '顳', - '' => '顴', - '' => '飌', - '' => '饡', - '' => '馫', - '' => '驤', - '' => '驦', - '' => '驧', - '' => '鬤', - '' => '鸕', - '' => '鸗', - '' => '齈', - '' => '戇', - '' => '欞', - '' => '爧', - '' => '虌', - '' => '躨', - '' => '钂', - '' => '钀', - '' => '钁', - '' => '驩', - '' => '驨', - '' => '鬮', - '' => '鸙', - '' => '爩', - '' => '虋', - '' => '讟', - '' => '钃', - '' => '鱹', - '' => '麷', - '' => '癵', - '' => '驫', - '' => '鱺', - '' => '鸝', - '' => '灩', - '' => '灪', - '' => '麤', - '' => '齾', - '' => '齉', - '' => '龘', -); - -$result =& $data; -unset($data); - -return $result; diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp037.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp037.php deleted file mode 100644 index a014e4b..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp037.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1006.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1006.php deleted file mode 100644 index 2b5e7be..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1006.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1026.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1026.php deleted file mode 100644 index aba455b..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp1026.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp424.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp424.php deleted file mode 100644 index e8e2370..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp424.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp437.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp437.php deleted file mode 100644 index e3ebb45..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp437.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp500.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp500.php deleted file mode 100644 index 3771c8f..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp500.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp737.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp737.php deleted file mode 100644 index 2d67d33..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp737.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp775.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp775.php deleted file mode 100644 index 1fbc4cd..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp775.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp850.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp850.php deleted file mode 100644 index 0b314c8..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp850.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp852.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp852.php deleted file mode 100644 index f8c318c..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp852.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp855.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp855.php deleted file mode 100644 index 48440ba..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp855.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp856.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp856.php deleted file mode 100644 index c9cac0c..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp856.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp857.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp857.php deleted file mode 100644 index 3e7770a..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp857.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp860.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp860.php deleted file mode 100644 index 2a52d47..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp860.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp861.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp861.php deleted file mode 100644 index 4ba6573..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp861.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp862.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp862.php deleted file mode 100644 index d2a29a2..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp862.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp863.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp863.php deleted file mode 100644 index 1f36b9a..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp863.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp864.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp864.php deleted file mode 100644 index 953e463..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp864.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp865.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp865.php deleted file mode 100644 index 2668bcc..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp865.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp866.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp866.php deleted file mode 100644 index a7b47f8..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp866.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp869.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp869.php deleted file mode 100644 index 0f04054..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp869.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp874.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp874.php deleted file mode 100644 index 4799456..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp874.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp875.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp875.php deleted file mode 100644 index 8561645..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp875.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp932.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp932.php deleted file mode 100644 index 0bf828f..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp932.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp936.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp936.php deleted file mode 100644 index a593d05..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp936.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp949.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp949.php deleted file mode 100644 index d4e99f1..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp949.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp950.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.cp950.php deleted file mode 100644 index 267b190..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.cp950.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-1.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-1.php deleted file mode 100644 index d7a217c..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-1.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-10.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-10.php deleted file mode 100644 index d60f647..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-10.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-11.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-11.php deleted file mode 100644 index d69220b..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-11.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-13.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-13.php deleted file mode 100644 index 838783f..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-13.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-14.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-14.php deleted file mode 100644 index 65a48ee..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-14.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-15.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-15.php deleted file mode 100644 index 42e50e0..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-15.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-16.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-16.php deleted file mode 100644 index 46758a6..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-16.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-2.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-2.php deleted file mode 100644 index 5f23f51..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-2.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-3.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-3.php deleted file mode 100644 index b31bb83..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-3.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-4.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-4.php deleted file mode 100644 index 9cbf9f3..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-4.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-5.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-5.php deleted file mode 100644 index fd03882..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-5.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-6.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-6.php deleted file mode 100644 index ed6f72f..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-6.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-7.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-7.php deleted file mode 100644 index cf723ac..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-7.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-8.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-8.php deleted file mode 100644 index c978731..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-8.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-9.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-9.php deleted file mode 100644 index 2a3e36a..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.iso-8859-9.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-r.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-r.php deleted file mode 100644 index d83c212..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-r.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-u.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-u.php deleted file mode 100644 index dbbf96b..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.koi8-u.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.us-ascii.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.us-ascii.php deleted file mode 100644 index 94a93b2..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.us-ascii.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1250.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1250.php deleted file mode 100644 index d1d5e6f..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1250.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1251.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1251.php deleted file mode 100644 index f422a71..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1251.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1252.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1252.php deleted file mode 100644 index ba6d203..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1252.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1253.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1253.php deleted file mode 100644 index c04dc8f..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1253.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1254.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1254.php deleted file mode 100644 index 1cfadcf..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1254.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1255.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1255.php deleted file mode 100644 index f73cbb6..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1255.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1256.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1256.php deleted file mode 100644 index 953704f..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1256.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1257.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1257.php deleted file mode 100644 index 78580ec..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1257.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1258.php b/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1258.php deleted file mode 100644 index de1609d..0000000 Binary files a/vendor/symfony/polyfill-iconv/Resources/charset/from.windows-1258.php and /dev/null differ diff --git a/vendor/symfony/polyfill-iconv/Resources/charset/translit.php b/vendor/symfony/polyfill-iconv/Resources/charset/translit.php deleted file mode 100644 index 779db64..0000000 --- a/vendor/symfony/polyfill-iconv/Resources/charset/translit.php +++ /dev/null @@ -1,4103 +0,0 @@ - 'μ', - '¼' => ' 1⁄4 ', - '½' => ' 1⁄2 ', - '¾' => ' 3⁄4 ', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ẚ' => 'aʾ', - '․' => '.', - '‥' => '..', - '…' => '...', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℡' => 'TEL', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => ' 1⁄7 ', - '⅑' => ' 1⁄9 ', - '⅒' => ' 1⁄10 ', - '⅓' => ' 1⁄3 ', - '⅔' => ' 2⁄3 ', - '⅕' => ' 1⁄5 ', - '⅖' => ' 2⁄5 ', - '⅗' => ' 3⁄5 ', - '⅘' => ' 4⁄5 ', - '⅙' => ' 1⁄6 ', - '⅚' => ' 5⁄6 ', - '⅛' => ' 1⁄8 ', - '⅜' => ' 3⁄8 ', - '⅝' => ' 5⁄8 ', - '⅞' => ' 7⁄8 ', - '⅟' => ' 1⁄ ', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => ' 0⁄3 ', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '(1)', - '②' => '(2)', - '③' => '(3)', - '④' => '(4)', - '⑤' => '(5)', - '⑥' => '(6)', - '⑦' => '(7)', - '⑧' => '(8)', - '⑨' => '(9)', - '⑩' => '(10)', - '⑪' => '(11)', - '⑫' => '(12)', - '⑬' => '(13)', - '⑭' => '(14)', - '⑮' => '(15)', - '⑯' => '(16)', - '⑰' => '(17)', - '⑱' => '(18)', - '⑲' => '(19)', - '⑳' => '(20)', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => '(A)', - 'Ⓑ' => '(B)', - 'Ⓒ' => '(C)', - 'Ⓓ' => '(D)', - 'Ⓔ' => '(E)', - 'Ⓕ' => '(F)', - 'Ⓖ' => '(G)', - 'Ⓗ' => '(H)', - 'Ⓘ' => '(I)', - 'Ⓙ' => '(J)', - 'Ⓚ' => '(K)', - 'Ⓛ' => '(L)', - 'Ⓜ' => '(M)', - 'Ⓝ' => '(N)', - 'Ⓞ' => '(O)', - 'Ⓟ' => '(P)', - 'Ⓠ' => '(Q)', - 'Ⓡ' => '(R)', - 'Ⓢ' => '(S)', - 'Ⓣ' => '(T)', - 'Ⓤ' => '(U)', - 'Ⓥ' => '(V)', - 'Ⓦ' => '(W)', - 'Ⓧ' => '(X)', - 'Ⓨ' => '(Y)', - 'Ⓩ' => '(Z)', - 'ⓐ' => '(a)', - 'ⓑ' => '(b)', - 'ⓒ' => '(c)', - 'ⓓ' => '(d)', - 'ⓔ' => '(e)', - 'ⓕ' => '(f)', - 'ⓖ' => '(g)', - 'ⓗ' => '(h)', - 'ⓘ' => '(i)', - 'ⓙ' => '(j)', - 'ⓚ' => '(k)', - 'ⓛ' => '(l)', - 'ⓜ' => '(m)', - 'ⓝ' => '(n)', - 'ⓞ' => '(o)', - 'ⓟ' => '(p)', - 'ⓠ' => '(q)', - 'ⓡ' => '(r)', - 'ⓢ' => '(s)', - 'ⓣ' => '(t)', - 'ⓤ' => '(u)', - 'ⓥ' => '(v)', - 'ⓦ' => '(w)', - 'ⓧ' => '(x)', - 'ⓨ' => '(y)', - 'ⓩ' => '(z)', - '⓪' => '(0)', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '(問)', - '㉅' => '(幼)', - '㉆' => '(文)', - '㉇' => '(箏)', - '㉐' => 'PTE', - '㉑' => '(21)', - '㉒' => '(22)', - '㉓' => '(23)', - '㉔' => '(24)', - '㉕' => '(25)', - '㉖' => '(26)', - '㉗' => '(27)', - '㉘' => '(28)', - '㉙' => '(29)', - '㉚' => '(30)', - '㉛' => '(31)', - '㉜' => '(32)', - '㉝' => '(33)', - '㉞' => '(34)', - '㉟' => '(35)', - '㉠' => '(ᄀ)', - '㉡' => '(ᄂ)', - '㉢' => '(ᄃ)', - '㉣' => '(ᄅ)', - '㉤' => '(ᄆ)', - '㉥' => '(ᄇ)', - '㉦' => '(ᄉ)', - '㉧' => '(ᄋ)', - '㉨' => '(ᄌ)', - '㉩' => '(ᄎ)', - '㉪' => '(ᄏ)', - '㉫' => '(ᄐ)', - '㉬' => '(ᄑ)', - '㉭' => '(ᄒ)', - '㉮' => '(가)', - '㉯' => '(나)', - '㉰' => '(다)', - '㉱' => '(라)', - '㉲' => '(마)', - '㉳' => '(바)', - '㉴' => '(사)', - '㉵' => '(아)', - '㉶' => '(자)', - '㉷' => '(차)', - '㉸' => '(카)', - '㉹' => '(타)', - '㉺' => '(파)', - '㉻' => '(하)', - '㉼' => '(참고)', - '㉽' => '(주의)', - '㉾' => '(우)', - '㊀' => '(一)', - '㊁' => '(二)', - '㊂' => '(三)', - '㊃' => '(四)', - '㊄' => '(五)', - '㊅' => '(六)', - '㊆' => '(七)', - '㊇' => '(八)', - '㊈' => '(九)', - '㊉' => '(十)', - '㊊' => '(月)', - '㊋' => '(火)', - '㊌' => '(水)', - '㊍' => '(木)', - '㊎' => '(金)', - '㊏' => '(土)', - '㊐' => '(日)', - '㊑' => '(株)', - '㊒' => '(有)', - '㊓' => '(社)', - '㊔' => '(名)', - '㊕' => '(特)', - '㊖' => '(財)', - '㊗' => '(祝)', - '㊘' => '(労)', - '㊙' => '(秘)', - '㊚' => '(男)', - '㊛' => '(女)', - '㊜' => '(適)', - '㊝' => '(優)', - '㊞' => '(印)', - '㊟' => '(注)', - '㊠' => '(項)', - '㊡' => '(休)', - '㊢' => '(写)', - '㊣' => '(正)', - '㊤' => '(上)', - '㊥' => '(中)', - '㊦' => '(下)', - '㊧' => '(左)', - '㊨' => '(右)', - '㊩' => '(医)', - '㊪' => '(宗)', - '㊫' => '(学)', - '㊬' => '(監)', - '㊭' => '(企)', - '㊮' => '(資)', - '㊯' => '(協)', - '㊰' => '(夜)', - '㊱' => '(36)', - '㊲' => '(37)', - '㊳' => '(38)', - '㊴' => '(39)', - '㊵' => '(40)', - '㊶' => '(41)', - '㊷' => '(42)', - '㊸' => '(43)', - '㊹' => '(44)', - '㊺' => '(45)', - '㊻' => '(46)', - '㊼' => '(47)', - '㊽' => '(48)', - '㊾' => '(49)', - '㊿' => '(50)', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => '(ア)', - '㋑' => '(イ)', - '㋒' => '(ウ)', - '㋓' => '(エ)', - '㋔' => '(オ)', - '㋕' => '(カ)', - '㋖' => '(キ)', - '㋗' => '(ク)', - '㋘' => '(ケ)', - '㋙' => '(コ)', - '㋚' => '(サ)', - '㋛' => '(シ)', - '㋜' => '(ス)', - '㋝' => '(セ)', - '㋞' => '(ソ)', - '㋟' => '(タ)', - '㋠' => '(チ)', - '㋡' => '(ツ)', - '㋢' => '(テ)', - '㋣' => '(ト)', - '㋤' => '(ナ)', - '㋥' => '(ニ)', - '㋦' => '(ヌ)', - '㋧' => '(ネ)', - '㋨' => '(ノ)', - '㋩' => '(ハ)', - '㋪' => '(ヒ)', - '㋫' => '(フ)', - '㋬' => '(ヘ)', - '㋭' => '(ホ)', - '㋮' => '(マ)', - '㋯' => '(ミ)', - '㋰' => '(ム)', - '㋱' => '(メ)', - '㋲' => '(モ)', - '㋳' => '(ヤ)', - '㋴' => '(ユ)', - '㋵' => '(ヨ)', - '㋶' => '(ラ)', - '㋷' => '(リ)', - '㋸' => '(ル)', - '㋹' => '(レ)', - '㋺' => '(ロ)', - '㋻' => '(ワ)', - '㋼' => '(ヰ)', - '㋽' => '(ヱ)', - '㋾' => '(ヲ)', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm²', - '㍹' => 'dm³', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μℓ', - '㎖' => 'mℓ', - '㎗' => 'dℓ', - '㎘' => 'kℓ', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm²', - '㎠' => 'cm²', - '㎡' => 'm²', - '㎢' => 'km²', - '㎣' => 'mm³', - '㎤' => 'cm³', - '㎥' => 'm³', - '㎦' => 'km³', - '㎧' => 'm∕s', - '㎨' => 'm∕s²', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s²', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '﨎' => '' . "\0" . '', - '﨏' => '' . "\0" . '', - '塚' => '塚', - '﨑' => '' . "\0" . '', - '晴' => '晴', - '﨓' => '' . "\0" . '', - '﨔' => '' . "\0" . '', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '﨟' => '' . "\0" . '', - '蘒' => '蘒', - '﨡' => '' . "\0" . '', - '諸' => '諸', - '﨣' => '' . "\0" . '', - '﨤' => '' . "\0" . '', - '逸' => '逸', - '都' => '都', - '﨧' => '' . "\0" . '', - '﨨' => '' . "\0" . '', - '﨩' => '' . "\0" . '', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'ſt', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', - 'ﬠ' => 'ע', - 'ﬡ' => 'א', - 'ﬢ' => 'ד', - 'ﬣ' => 'ה', - 'ﬤ' => 'כ', - 'ﬥ' => 'ל', - 'ﬦ' => 'ם', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ﭏ' => 'אל', - '﹉' => '‾', - '﹊' => '‾', - '﹋' => '‾', - '﹌' => '‾', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - 'A' => 'A', - 'B' => 'B', - 'C' => 'C', - 'D' => 'D', - 'E' => 'E', - 'F' => 'F', - 'G' => 'G', - 'H' => 'H', - 'I' => 'I', - 'J' => 'J', - 'K' => 'K', - 'L' => 'L', - 'M' => 'M', - 'N' => 'N', - 'O' => 'O', - 'P' => 'P', - 'Q' => 'Q', - 'R' => 'R', - 'S' => 'S', - 'T' => 'T', - 'U' => 'U', - 'V' => 'V', - 'W' => 'W', - 'X' => 'X', - 'Y' => 'Y', - 'Z' => 'Z', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - 'a' => 'a', - 'b' => 'b', - 'c' => 'c', - 'd' => 'd', - 'e' => 'e', - 'f' => 'f', - 'g' => 'g', - 'h' => 'h', - 'i' => 'i', - 'j' => 'j', - 'k' => 'k', - 'l' => 'l', - 'm' => 'm', - 'n' => 'n', - 'o' => 'o', - 'p' => 'p', - 'q' => 'q', - 'r' => 'r', - 's' => 's', - 't' => 't', - 'u' => 'u', - 'v' => 'v', - 'w' => 'w', - 'x' => 'x', - 'y' => 'y', - 'z' => 'z', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ㅤ', - 'ᄀ' => 'ㄱ', - 'ᄁ' => 'ㄲ', - 'ᆪ' => 'ㄳ', - 'ᄂ' => 'ㄴ', - 'ᆬ' => 'ㄵ', - 'ᆭ' => 'ㄶ', - 'ᄃ' => 'ㄷ', - 'ᄄ' => 'ㄸ', - 'ᄅ' => 'ㄹ', - 'ᆰ' => 'ㄺ', - 'ᆱ' => 'ㄻ', - 'ᆲ' => 'ㄼ', - 'ᆳ' => 'ㄽ', - 'ᆴ' => 'ㄾ', - 'ᆵ' => 'ㄿ', - 'ᄚ' => 'ㅀ', - 'ᄆ' => 'ㅁ', - 'ᄇ' => 'ㅂ', - 'ᄈ' => 'ㅃ', - 'ᄡ' => 'ㅄ', - 'ᄉ' => 'ㅅ', - 'ᄊ' => 'ㅆ', - 'ᄋ' => 'ㅇ', - 'ᄌ' => 'ㅈ', - 'ᄍ' => 'ㅉ', - 'ᄎ' => 'ㅊ', - 'ᄏ' => 'ㅋ', - 'ᄐ' => 'ㅌ', - 'ᄑ' => 'ㅍ', - 'ᄒ' => 'ㅎ', - 'ᅡ' => 'ㅏ', - 'ᅢ' => 'ㅐ', - 'ᅣ' => 'ㅑ', - 'ᅤ' => 'ㅒ', - 'ᅥ' => 'ㅓ', - 'ᅦ' => 'ㅔ', - 'ᅧ' => 'ㅕ', - 'ᅨ' => 'ㅖ', - 'ᅩ' => 'ㅗ', - 'ᅪ' => 'ㅘ', - 'ᅫ' => 'ㅙ', - 'ᅬ' => 'ㅚ', - 'ᅭ' => 'ㅛ', - 'ᅮ' => 'ㅜ', - 'ᅯ' => 'ㅝ', - 'ᅰ' => 'ㅞ', - 'ᅱ' => 'ㅟ', - 'ᅲ' => 'ㅠ', - 'ᅳ' => 'ㅡ', - 'ᅴ' => 'ㅢ', - 'ᅵ' => 'ㅣ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => '¯', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'ϴ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ϵ', - '𝛝' => 'ϑ', - '𝛞' => 'ϰ', - '𝛟' => 'ϕ', - '𝛠' => 'ϱ', - '𝛡' => 'ϖ', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'ϴ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ϵ', - '𝜗' => 'ϑ', - '𝜘' => 'ϰ', - '𝜙' => 'ϕ', - '𝜚' => 'ϱ', - '𝜛' => 'ϖ', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'ϴ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ϵ', - '𝝑' => 'ϑ', - '𝝒' => 'ϰ', - '𝝓' => 'ϕ', - '𝝔' => 'ϱ', - '𝝕' => 'ϖ', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'ϴ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ϵ', - '𝞋' => 'ϑ', - '𝞌' => 'ϰ', - '𝞍' => 'ϕ', - '𝞎' => 'ϱ', - '𝞏' => 'ϖ', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'ϴ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ϵ', - '𝟅' => 'ϑ', - '𝟆' => 'ϰ', - '𝟇' => 'ϕ', - '𝟈' => 'ϱ', - '𝟉' => 'ϖ', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => '(C)', - '🄬' => '(R)', - '🄭' => '(CD)', - '🄮' => '(WZ)', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '(得)', - '🉑' => '(可)', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', - 'Æ' => 'AE', - 'Ð' => 'D', - 'Ø' => 'O', - 'Þ' => 'TH', - 'ß' => 'ss', - 'æ' => 'ae', - 'ð' => 'd', - 'ø' => 'o', - 'þ' => 'th', - 'Đ' => 'D', - 'đ' => 'd', - 'Ħ' => 'H', - 'ħ' => 'h', - 'ı' => 'i', - 'ĸ' => 'q', - 'Ł' => 'L', - 'ł' => 'l', - 'Ŋ' => 'N', - 'ŋ' => 'n', - 'Œ' => 'OE', - 'œ' => 'oe', - 'Ŧ' => 'T', - 'ŧ' => 't', - 'ƀ' => 'b', - 'Ɓ' => 'B', - 'Ƃ' => 'B', - 'ƃ' => 'b', - 'Ƈ' => 'C', - 'ƈ' => 'c', - 'Ɖ' => 'D', - 'Ɗ' => 'D', - 'Ƌ' => 'D', - 'ƌ' => 'd', - 'Ɛ' => 'E', - 'Ƒ' => 'F', - 'ƒ' => 'f', - 'Ɠ' => 'G', - 'ƕ' => 'hv', - 'Ɩ' => 'I', - 'Ɨ' => 'I', - 'Ƙ' => 'K', - 'ƙ' => 'k', - 'ƚ' => 'l', - 'Ɲ' => 'N', - 'ƞ' => 'n', - 'Ƣ' => 'OI', - 'ƣ' => 'oi', - 'Ƥ' => 'P', - 'ƥ' => 'p', - 'ƫ' => 't', - 'Ƭ' => 'T', - 'ƭ' => 't', - 'Ʈ' => 'T', - 'Ʋ' => 'V', - 'Ƴ' => 'Y', - 'ƴ' => 'y', - 'Ƶ' => 'Z', - 'ƶ' => 'z', - 'Ǥ' => 'G', - 'ǥ' => 'g', - 'ȡ' => 'd', - 'Ȥ' => 'Z', - 'ȥ' => 'z', - 'ȴ' => 'l', - 'ȵ' => 'n', - 'ȶ' => 't', - 'ȷ' => 'j', - 'ȸ' => 'db', - 'ȹ' => 'qp', - 'Ⱥ' => 'A', - 'Ȼ' => 'C', - 'ȼ' => 'c', - 'Ƚ' => 'L', - 'Ⱦ' => 'T', - 'ȿ' => 's', - 'ɀ' => 'z', - 'Ƀ' => 'B', - 'Ʉ' => 'U', - 'Ɇ' => 'E', - 'ɇ' => 'e', - 'Ɉ' => 'J', - 'ɉ' => 'j', - 'Ɍ' => 'R', - 'ɍ' => 'r', - 'Ɏ' => 'Y', - 'ɏ' => 'y', - 'ɓ' => 'b', - 'ɕ' => 'c', - 'ɖ' => 'd', - 'ɗ' => 'd', - 'ɛ' => 'e', - 'ɟ' => 'j', - 'ɠ' => 'g', - 'ɡ' => 'g', - 'ɢ' => 'G', - 'ɦ' => 'h', - 'ɧ' => 'h', - 'ɨ' => 'i', - 'ɪ' => 'I', - 'ɫ' => 'l', - 'ɬ' => 'l', - 'ɭ' => 'l', - 'ɱ' => 'm', - 'ɲ' => 'n', - 'ɳ' => 'n', - 'ɴ' => 'N', - 'ɶ' => 'OE', - 'ɼ' => 'r', - 'ɽ' => 'r', - 'ɾ' => 'r', - 'ʀ' => 'R', - 'ʂ' => 's', - 'ʈ' => 't', - 'ʉ' => 'u', - 'ʋ' => 'v', - 'ʏ' => 'Y', - 'ʐ' => 'z', - 'ʑ' => 'z', - 'ʙ' => 'B', - 'ʛ' => 'G', - 'ʜ' => 'H', - 'ʝ' => 'j', - 'ʟ' => 'L', - 'ʠ' => 'q', - 'ʣ' => 'dz', - 'ʥ' => 'dz', - 'ʦ' => 'ts', - 'ʪ' => 'ls', - 'ʫ' => 'lz', - 'ᴀ' => 'A', - 'ᴁ' => 'AE', - 'ᴃ' => 'B', - 'ᴄ' => 'C', - 'ᴅ' => 'D', - 'ᴆ' => 'D', - 'ᴇ' => 'E', - 'ᴊ' => 'J', - 'ᴋ' => 'K', - 'ᴌ' => 'L', - 'ᴍ' => 'M', - 'ᴏ' => 'O', - 'ᴘ' => 'P', - 'ᴛ' => 'T', - 'ᴜ' => 'U', - 'ᴠ' => 'V', - 'ᴡ' => 'W', - 'ᴢ' => 'Z', - 'ᵫ' => 'ue', - 'ᵬ' => 'b', - 'ᵭ' => 'd', - 'ᵮ' => 'f', - 'ᵯ' => 'm', - 'ᵰ' => 'n', - 'ᵱ' => 'p', - 'ᵲ' => 'r', - 'ᵳ' => 'r', - 'ᵴ' => 's', - 'ᵵ' => 't', - 'ᵶ' => 'z', - 'ᵺ' => 'th', - 'ᵻ' => 'I', - 'ᵽ' => 'p', - 'ᵾ' => 'U', - 'ᶀ' => 'b', - 'ᶁ' => 'd', - 'ᶂ' => 'f', - 'ᶃ' => 'g', - 'ᶄ' => 'k', - 'ᶅ' => 'l', - 'ᶆ' => 'm', - 'ᶇ' => 'n', - 'ᶈ' => 'p', - 'ᶉ' => 'r', - 'ᶊ' => 's', - 'ᶌ' => 'v', - 'ᶍ' => 'x', - 'ᶎ' => 'z', - 'ᶏ' => 'a', - 'ᶑ' => 'd', - 'ᶒ' => 'e', - 'ᶓ' => 'e', - 'ᶖ' => 'i', - 'ᶙ' => 'u', - 'ẜ' => 's', - 'ẝ' => 's', - 'ẞ' => 'SS', - 'Ỻ' => 'LL', - 'ỻ' => 'll', - 'Ỽ' => 'V', - 'ỽ' => 'v', - 'Ỿ' => 'Y', - 'ỿ' => 'y', - 'Ⱡ' => 'L', - 'ⱡ' => 'l', - 'Ɫ' => 'L', - 'Ᵽ' => 'P', - 'Ɽ' => 'R', - 'ⱥ' => 'a', - 'ⱦ' => 't', - 'Ⱨ' => 'H', - 'ⱨ' => 'h', - 'Ⱪ' => 'K', - 'ⱪ' => 'k', - 'Ⱬ' => 'Z', - 'ⱬ' => 'z', - 'Ɱ' => 'M', - 'ⱱ' => 'v', - 'Ⱳ' => 'W', - 'ⱳ' => 'w', - 'ⱴ' => 'v', - 'ⱸ' => 'e', - 'ⱺ' => 'o', - 'Ȿ' => 'S', - 'Ɀ' => 'Z', - 'ꜰ' => 'F', - 'ꜱ' => 'S', - 'Ꜳ' => 'AA', - 'ꜳ' => 'aa', - 'Ꜵ' => 'AO', - 'ꜵ' => 'ao', - 'Ꜷ' => 'AU', - 'ꜷ' => 'au', - 'Ꜹ' => 'AV', - 'ꜹ' => 'av', - 'Ꜻ' => 'AV', - 'ꜻ' => 'av', - 'Ꜽ' => 'AY', - 'ꜽ' => 'ay', - 'Ꝁ' => 'K', - 'ꝁ' => 'k', - 'Ꝃ' => 'K', - 'ꝃ' => 'k', - 'Ꝅ' => 'K', - 'ꝅ' => 'k', - 'Ꝇ' => 'L', - 'ꝇ' => 'l', - 'Ꝉ' => 'L', - 'ꝉ' => 'l', - 'Ꝋ' => 'O', - 'ꝋ' => 'o', - 'Ꝍ' => 'O', - 'ꝍ' => 'o', - 'Ꝏ' => 'OO', - 'ꝏ' => 'oo', - 'Ꝑ' => 'P', - 'ꝑ' => 'p', - 'Ꝓ' => 'P', - 'ꝓ' => 'p', - 'Ꝕ' => 'P', - 'ꝕ' => 'p', - 'Ꝗ' => 'Q', - 'ꝗ' => 'q', - 'Ꝙ' => 'Q', - 'ꝙ' => 'q', - 'Ꝟ' => 'V', - 'ꝟ' => 'v', - 'Ꝡ' => 'VY', - 'ꝡ' => 'vy', - 'Ꝥ' => 'TH', - 'ꝥ' => 'th', - 'Ꝧ' => 'TH', - 'ꝧ' => 'th', - 'ꝱ' => 'd', - 'ꝲ' => 'l', - 'ꝳ' => 'm', - 'ꝴ' => 'n', - 'ꝵ' => 'r', - 'ꝶ' => 'R', - 'ꝷ' => 't', - 'Ꝺ' => 'D', - 'ꝺ' => 'd', - 'Ꝼ' => 'F', - 'ꝼ' => 'f', - 'Ꞇ' => 'T', - 'ꞇ' => 't', - 'Ꞑ' => 'N', - 'ꞑ' => 'n', - 'Ꞓ' => 'C', - 'ꞓ' => 'c', - 'Ꞡ' => 'G', - 'ꞡ' => 'g', - 'Ꞣ' => 'K', - 'ꞣ' => 'k', - 'Ꞥ' => 'N', - 'ꞥ' => 'n', - 'Ꞧ' => 'R', - 'ꞧ' => 'r', - 'Ꞩ' => 'S', - 'ꞩ' => 's', - 'Ɦ' => 'H', - '©' => '(C)', - '®' => '(R)', - '₠' => 'CE', - '₢' => 'Cr', - '₣' => 'Fr.', - '₤' => 'L.', - '₧' => 'Pts', - '₺' => 'TL', - '₹' => 'Rs', - '℗' => '(P)', - '℘' => 'P', - '℞' => 'Rx', - '〇' => '0', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - 'ʹ' => '\'', - 'ʺ' => '"', - 'ʻ' => '\'', - 'ʼ' => '\'', - 'ʽ' => '\'', - 'ˈ' => '\'', - 'ˋ' => '`', - '‘' => '\'', - '’' => '\'', - '‚' => ',', - '‛' => '\'', - '“' => '"', - '”' => '"', - '„' => ',,', - '‟' => '"', - '′' => '\'', - '〝' => '"', - '〞' => '"', - '«' => '<<', - '»' => '>>', - '‹' => '<', - '›' => '>', - '­' => '-', - '‐' => '-', - '‑' => '-', - '‒' => '-', - '–' => '-', - '—' => '-', - '―' => '-', - '︱' => '-', - '︲' => '-', - '˂' => '<', - '˃' => '>', - '˄' => '^', - 'ˆ' => '^', - 'ː' => ':', - '˜' => '~', - '‖' => '||', - '⁄' => '/', - '⁅' => '[', - '⁆' => ']', - '⁎' => '*', - '、' => ',', - '。' => '.', - '〈' => '<', - '〉' => '>', - '《' => '<<', - '》' => '>>', - '〔' => '[', - '〕' => ']', - '〘' => '[', - '〙' => ']', - '〚' => '[', - '〛' => ']', - '︐' => ',', - '︑' => ',', - '︒' => '.', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︙' => '...', - '︰' => '..', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '[', - '︺' => ']', - '︽' => '<<', - '︾' => '>>', - '︿' => '<', - '﹀' => '>', - '﹇' => '[', - '﹈' => ']', - '×' => '*', - '÷' => '/', - '˖' => '+', - '˗' => '-', - '−' => '-', - '∕' => '/', - '∖' => '\\', - '∣' => '|', - '∥' => '||', - '≪' => '<<', - '≫' => '>>', - '⦅' => '((', - '⦆' => '))', -); diff --git a/vendor/symfony/polyfill-iconv/bootstrap.php b/vendor/symfony/polyfill-iconv/bootstrap.php deleted file mode 100644 index 91fdba0..0000000 --- a/vendor/symfony/polyfill-iconv/bootstrap.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Iconv as p; - -if (extension_loaded('iconv')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('ICONV_IMPL')) { - define('ICONV_IMPL', 'Symfony'); -} -if (!defined('ICONV_VERSION')) { - define('ICONV_VERSION', '1.0'); -} -if (!defined('ICONV_MIME_DECODE_STRICT')) { - define('ICONV_MIME_DECODE_STRICT', 1); -} -if (!defined('ICONV_MIME_DECODE_CONTINUE_ON_ERROR')) { - define('ICONV_MIME_DECODE_CONTINUE_ON_ERROR', 2); -} - -if (!function_exists('iconv')) { - function iconv($from_encoding, $to_encoding, $string) { return p\Iconv::iconv($from_encoding, $to_encoding, $string); } -} -if (!function_exists('iconv_get_encoding')) { - function iconv_get_encoding($type = 'all') { return p\Iconv::iconv_get_encoding($type); } -} -if (!function_exists('iconv_set_encoding')) { - function iconv_set_encoding($type, $encoding) { return p\Iconv::iconv_set_encoding($type, $encoding); } -} -if (!function_exists('iconv_mime_encode')) { - function iconv_mime_encode($field_name, $field_value, $options = []) { return p\Iconv::iconv_mime_encode($field_name, $field_value, $options); } -} -if (!function_exists('iconv_mime_decode_headers')) { - function iconv_mime_decode_headers($headers, $mode = 0, $encoding = null) { return p\Iconv::iconv_mime_decode_headers($headers, $mode, $encoding); } -} - -if (extension_loaded('mbstring')) { - if (!function_exists('iconv_strlen')) { - function iconv_strlen($string, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strlen($string, $encoding); } - } - if (!function_exists('iconv_strpos')) { - function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strpos($haystack, $needle, $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos($haystack, $needle, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strrpos($haystack, $needle, 0, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr($string, $offset, $length = 2147483647, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_substr($string, $offset, $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode($string, $mode = 0, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_decode_mimeheader($string, $mode, $encoding); } - } -} else { - if (!function_exists('iconv_strlen')) { - if (extension_loaded('xml')) { - function iconv_strlen($string, $encoding = null) { return p\Iconv::strlen1($string, $encoding); } - } else { - function iconv_strlen($string, $encoding = null) { return p\Iconv::strlen2($string, $encoding); } - } - } - - if (!function_exists('iconv_strpos')) { - function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Iconv::iconv_strpos($haystack, $needle, $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos($haystack, $needle, $encoding = null) { return p\Iconv::iconv_strrpos($haystack, $needle, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr($string, $offset, $length = 2147483647, $encoding = null) { return p\Iconv::iconv_substr($string, $offset, $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode($string, $mode = 0, $encoding = null) { return p\Iconv::iconv_mime_decode($string, $mode, $encoding); } - } -} diff --git a/vendor/symfony/polyfill-iconv/bootstrap80.php b/vendor/symfony/polyfill-iconv/bootstrap80.php deleted file mode 100644 index c46eb48..0000000 --- a/vendor/symfony/polyfill-iconv/bootstrap80.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Iconv as p; - -if (!defined('ICONV_IMPL')) { - define('ICONV_IMPL', 'Symfony'); -} -if (!defined('ICONV_VERSION')) { - define('ICONV_VERSION', '1.0'); -} -if (!defined('ICONV_MIME_DECODE_STRICT')) { - define('ICONV_MIME_DECODE_STRICT', 1); -} -if (!defined('ICONV_MIME_DECODE_CONTINUE_ON_ERROR')) { - define('ICONV_MIME_DECODE_CONTINUE_ON_ERROR', 2); -} - -if (!function_exists('iconv')) { - function iconv(?string $from_encoding, ?string $to_encoding, ?string $string): string|false { return p\Iconv::iconv((string) $from_encoding, (string) $to_encoding, (string) $string); } -} -if (!function_exists('iconv_get_encoding')) { - function iconv_get_encoding(?string $type = 'all'): array|string|false { return p\Iconv::iconv_get_encoding((string) $type); } -} -if (!function_exists('iconv_set_encoding')) { - function iconv_set_encoding(?string $type, ?string $encoding): bool { return p\Iconv::iconv_set_encoding((string) $type, (string) $encoding); } -} -if (!function_exists('iconv_mime_encode')) { - function iconv_mime_encode(?string $field_name, ?string $field_value, ?array $options = []): string|false { return p\Iconv::iconv_mime_encode((string) $field_name, (string) $field_value, (array) $options); } -} -if (!function_exists('iconv_mime_decode_headers')) { - function iconv_mime_decode_headers(?string $headers, ?int $mode = 0, ?string $encoding = null): array|false { return p\Iconv::iconv_mime_decode_headers((string) $headers, (int) $mode, $encoding); } -} - -if (extension_loaded('mbstring')) { - if (!function_exists('iconv_strlen')) { - function iconv_strlen(?string $string, ?string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strlen((string) $string, $encoding); } - } - if (!function_exists('iconv_strpos')) { - function iconv_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos(?string $haystack, ?string $needle, ?string $encoding = null): int|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_strrpos((string) $haystack, (string) $needle, 0, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr(?string $string, ?int $offset, ?int $length = null, ?string $encoding = null): string|false { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_substr((string) $string, (int) $offset, (int) $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode($string, $mode = 0, $encoding = null) { null === $encoding && $encoding = p\Iconv::$internalEncoding; return mb_decode_mimeheader($string, $mode, $encoding); } - } -} else { - if (!function_exists('iconv_strlen')) { - if (extension_loaded('xml')) { - function iconv_strlen(?string $string, ?string $encoding = null): int|false { return p\Iconv::strlen1((string) $string, $encoding); } - } else { - function iconv_strlen(?string $string, ?string $encoding = null): int|false { return p\Iconv::strlen2((string) $string, $encoding); } - } - } - - if (!function_exists('iconv_strpos')) { - function iconv_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Iconv::iconv_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } - } - if (!function_exists('iconv_strrpos')) { - function iconv_strrpos(?string $haystack, ?string $needle, ?string $encoding = null): int|false { return p\Iconv::iconv_strrpos((string) $haystack, (string) $needle, $encoding); } - } - if (!function_exists('iconv_substr')) { - function iconv_substr(?string $string, ?int $offset, ?int $length = null, ?string $encoding = null): string|false { return p\Iconv::iconv_substr((string) $string, (string) $offset, (int) $length, $encoding); } - } - if (!function_exists('iconv_mime_decode')) { - function iconv_mime_decode(?string $string, ?int $mode = 0, ?string $encoding = null): string|false { return p\Iconv::iconv_mime_decode((string) $string, (int) $mode, $encoding); } - } -} diff --git a/vendor/symfony/polyfill-iconv/composer.json b/vendor/symfony/polyfill-iconv/composer.json deleted file mode 100644 index 4669f3f..0000000 --- a/vendor/symfony/polyfill-iconv/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-iconv", - "type": "library", - "description": "Symfony polyfill for the Iconv extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "iconv"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Iconv\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-iconv": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-intl-idn/Idn.php b/vendor/symfony/polyfill-intl-idn/Idn.php deleted file mode 100644 index fee3026..0000000 --- a/vendor/symfony/polyfill-intl-idn/Idn.php +++ /dev/null @@ -1,925 +0,0 @@ - and Trevor Rowbotham - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Idn; - -use Exception; -use Normalizer; -use Symfony\Polyfill\Intl\Idn\Resources\unidata\DisallowedRanges; -use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex; - -/** - * @see https://www.unicode.org/reports/tr46/ - * - * @internal - */ -final class Idn -{ - public const ERROR_EMPTY_LABEL = 1; - public const ERROR_LABEL_TOO_LONG = 2; - public const ERROR_DOMAIN_NAME_TOO_LONG = 4; - public const ERROR_LEADING_HYPHEN = 8; - public const ERROR_TRAILING_HYPHEN = 0x10; - public const ERROR_HYPHEN_3_4 = 0x20; - public const ERROR_LEADING_COMBINING_MARK = 0x40; - public const ERROR_DISALLOWED = 0x80; - public const ERROR_PUNYCODE = 0x100; - public const ERROR_LABEL_HAS_DOT = 0x200; - public const ERROR_INVALID_ACE_LABEL = 0x400; - public const ERROR_BIDI = 0x800; - public const ERROR_CONTEXTJ = 0x1000; - public const ERROR_CONTEXTO_PUNCTUATION = 0x2000; - public const ERROR_CONTEXTO_DIGITS = 0x4000; - - public const INTL_IDNA_VARIANT_2003 = 0; - public const INTL_IDNA_VARIANT_UTS46 = 1; - - public const IDNA_DEFAULT = 0; - public const IDNA_ALLOW_UNASSIGNED = 1; - public const IDNA_USE_STD3_RULES = 2; - public const IDNA_CHECK_BIDI = 4; - public const IDNA_CHECK_CONTEXTJ = 8; - public const IDNA_NONTRANSITIONAL_TO_ASCII = 16; - public const IDNA_NONTRANSITIONAL_TO_UNICODE = 32; - - public const MAX_DOMAIN_SIZE = 253; - public const MAX_LABEL_SIZE = 63; - - public const BASE = 36; - public const TMIN = 1; - public const TMAX = 26; - public const SKEW = 38; - public const DAMP = 700; - public const INITIAL_BIAS = 72; - public const INITIAL_N = 128; - public const DELIMITER = '-'; - public const MAX_INT = 2147483647; - - /** - * Contains the numeric value of a basic code point (for use in representing integers) in the - * range 0 to BASE-1, or -1 if b is does not represent a value. - * - * @var array - */ - private static $basicToDigit = [ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - ]; - - /** - * @var array - */ - private static $virama; - - /** - * @var array - */ - private static $mapped; - - /** - * @var array - */ - private static $ignored; - - /** - * @var array - */ - private static $deviation; - - /** - * @var array - */ - private static $disallowed; - - /** - * @var array - */ - private static $disallowed_STD3_mapped; - - /** - * @var array - */ - private static $disallowed_STD3_valid; - - /** - * @var bool - */ - private static $mappingTableLoaded = false; - - /** - * @see https://www.unicode.org/reports/tr46/#ToASCII - * - * @param string $domainName - * @param int $options - * @param int $variant - * @param array $idna_info - * - * @return string|false - */ - public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) - { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); - } - - $options = [ - 'CheckHyphens' => true, - 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), - 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), - 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), - 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_ASCII), - 'VerifyDnsLength' => true, - ]; - $info = new Info(); - $labels = self::process((string) $domainName, $options, $info); - - foreach ($labels as $i => $label) { - // Only convert labels to punycode that contain non-ASCII code points - if (1 === preg_match('/[^\x00-\x7F]/', $label)) { - try { - $label = 'xn--'.self::punycodeEncode($label); - } catch (Exception $e) { - $info->errors |= self::ERROR_PUNYCODE; - } - - $labels[$i] = $label; - } - } - - if ($options['VerifyDnsLength']) { - self::validateDomainAndLabelLength($labels, $info); - } - - $idna_info = [ - 'result' => implode('.', $labels), - 'isTransitionalDifferent' => $info->transitionalDifferent, - 'errors' => $info->errors, - ]; - - return 0 === $info->errors ? $idna_info['result'] : false; - } - - /** - * @see https://www.unicode.org/reports/tr46/#ToUnicode - * - * @param string $domainName - * @param int $options - * @param int $variant - * @param array $idna_info - * - * @return string|false - */ - public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) - { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); - } - - $info = new Info(); - $labels = self::process((string) $domainName, [ - 'CheckHyphens' => true, - 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), - 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), - 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), - 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_UNICODE), - ], $info); - $idna_info = [ - 'result' => implode('.', $labels), - 'isTransitionalDifferent' => $info->transitionalDifferent, - 'errors' => $info->errors, - ]; - - return 0 === $info->errors ? $idna_info['result'] : false; - } - - /** - * @param string $label - * - * @return bool - */ - private static function isValidContextJ(array $codePoints, $label) - { - if (!isset(self::$virama)) { - self::$virama = require __DIR__.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'unidata'.\DIRECTORY_SEPARATOR.'virama.php'; - } - - $offset = 0; - - foreach ($codePoints as $i => $codePoint) { - if (0x200C !== $codePoint && 0x200D !== $codePoint) { - continue; - } - - if (!isset($codePoints[$i - 1])) { - return false; - } - - // If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True; - if (isset(self::$virama[$codePoints[$i - 1]])) { - continue; - } - - // If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C(Joining_Type:T)*(Joining_Type:{R,D})) Then - // True; - // Generated RegExp = ([Joining_Type:{L,D}][Joining_Type:T]*\u200C[Joining_Type:T]*)[Joining_Type:{R,D}] - if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset)) { - $offset += \strlen($matches[1][0]); - - continue; - } - - return false; - } - - return true; - } - - /** - * @see https://www.unicode.org/reports/tr46/#ProcessingStepMap - * - * @param string $input - * @param array $options - * - * @return string - */ - private static function mapCodePoints($input, array $options, Info $info) - { - $str = ''; - $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; - $transitional = $options['Transitional_Processing']; - - foreach (self::utf8Decode($input) as $codePoint) { - $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); - - switch ($data['status']) { - case 'disallowed': - $info->errors |= self::ERROR_DISALLOWED; - - // no break. - - case 'valid': - $str .= mb_chr($codePoint, 'utf-8'); - - break; - - case 'ignored': - // Do nothing. - break; - - case 'mapped': - $str .= $data['mapping']; - - break; - - case 'deviation': - $info->transitionalDifferent = true; - $str .= ($transitional ? $data['mapping'] : mb_chr($codePoint, 'utf-8')); - - break; - } - } - - return $str; - } - - /** - * @see https://www.unicode.org/reports/tr46/#Processing - * - * @param string $domain - * @param array $options - * - * @return array - */ - private static function process($domain, array $options, Info $info) - { - // If VerifyDnsLength is not set, we are doing ToUnicode otherwise we are doing ToASCII and - // we need to respect the VerifyDnsLength option. - $checkForEmptyLabels = !isset($options['VerifyDnsLength']) || $options['VerifyDnsLength']; - - if ($checkForEmptyLabels && '' === $domain) { - $info->errors |= self::ERROR_EMPTY_LABEL; - - return [$domain]; - } - - // Step 1. Map each code point in the domain name string - $domain = self::mapCodePoints($domain, $options, $info); - - // Step 2. Normalize the domain name string to Unicode Normalization Form C. - if (!Normalizer::isNormalized($domain, Normalizer::FORM_C)) { - $domain = Normalizer::normalize($domain, Normalizer::FORM_C); - } - - // Step 3. Break the string into labels at U+002E (.) FULL STOP. - $labels = explode('.', $domain); - $lastLabelIndex = \count($labels) - 1; - - // Step 4. Convert and validate each label in the domain name string. - foreach ($labels as $i => $label) { - $validationOptions = $options; - - if ('xn--' === substr($label, 0, 4)) { - try { - $label = self::punycodeDecode(substr($label, 4)); - } catch (Exception $e) { - $info->errors |= self::ERROR_PUNYCODE; - - continue; - } - - $validationOptions['Transitional_Processing'] = false; - $labels[$i] = $label; - } - - self::validateLabel($label, $info, $validationOptions, $i > 0 && $i === $lastLabelIndex); - } - - if ($info->bidiDomain && !$info->validBidiDomain) { - $info->errors |= self::ERROR_BIDI; - } - - // Any input domain name string that does not record an error has been successfully - // processed according to this specification. Conversely, if an input domain_name string - // causes an error, then the processing of the input domain_name string fails. Determining - // what to do with error input is up to the caller, and not in the scope of this document. - return $labels; - } - - /** - * @see https://tools.ietf.org/html/rfc5893#section-2 - * - * @param string $label - */ - private static function validateBidiLabel($label, Info $info) - { - if (1 === preg_match(Regex::RTL_LABEL, $label)) { - $info->bidiDomain = true; - - // Step 1. The first character must be a character with Bidi property L, R, or AL. - // If it has the R or AL property, it is an RTL label - if (1 !== preg_match(Regex::BIDI_STEP_1_RTL, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 2. In an RTL label, only characters with the Bidi properties R, AL, AN, EN, ES, - // CS, ET, ON, BN, or NSM are allowed. - if (1 === preg_match(Regex::BIDI_STEP_2, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 3. In an RTL label, the end of the label must be a character with Bidi property - // R, AL, EN, or AN, followed by zero or more characters with Bidi property NSM. - if (1 !== preg_match(Regex::BIDI_STEP_3, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 4. In an RTL label, if an EN is present, no AN may be present, and vice versa. - if (1 === preg_match(Regex::BIDI_STEP_4_AN, $label) && 1 === preg_match(Regex::BIDI_STEP_4_EN, $label)) { - $info->validBidiDomain = false; - - return; - } - - return; - } - - // We are a LTR label - // Step 1. The first character must be a character with Bidi property L, R, or AL. - // If it has the L property, it is an LTR label. - if (1 !== preg_match(Regex::BIDI_STEP_1_LTR, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 5. In an LTR label, only characters with the Bidi properties L, EN, - // ES, CS, ET, ON, BN, or NSM are allowed. - if (1 === preg_match(Regex::BIDI_STEP_5, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 6.In an LTR label, the end of the label must be a character with Bidi property L or - // EN, followed by zero or more characters with Bidi property NSM. - if (1 !== preg_match(Regex::BIDI_STEP_6, $label)) { - $info->validBidiDomain = false; - - return; - } - } - - /** - * @param array $labels - */ - private static function validateDomainAndLabelLength(array $labels, Info $info) - { - $maxDomainSize = self::MAX_DOMAIN_SIZE; - $length = \count($labels); - - // Number of "." delimiters. - $domainLength = $length - 1; - - // If the last label is empty and it is not the first label, then it is the root label. - // Increase the max size by 1, making it 254, to account for the root label's "." - // delimiter. This also means we don't need to check the last label's length for being too - // long. - if ($length > 1 && '' === $labels[$length - 1]) { - ++$maxDomainSize; - --$length; - } - - for ($i = 0; $i < $length; ++$i) { - $bytes = \strlen($labels[$i]); - $domainLength += $bytes; - - if ($bytes > self::MAX_LABEL_SIZE) { - $info->errors |= self::ERROR_LABEL_TOO_LONG; - } - } - - if ($domainLength > $maxDomainSize) { - $info->errors |= self::ERROR_DOMAIN_NAME_TOO_LONG; - } - } - - /** - * @see https://www.unicode.org/reports/tr46/#Validity_Criteria - * - * @param string $label - * @param array $options - * @param bool $canBeEmpty - */ - private static function validateLabel($label, Info $info, array $options, $canBeEmpty) - { - if ('' === $label) { - if (!$canBeEmpty && (!isset($options['VerifyDnsLength']) || $options['VerifyDnsLength'])) { - $info->errors |= self::ERROR_EMPTY_LABEL; - } - - return; - } - - // Step 1. The label must be in Unicode Normalization Form C. - if (!Normalizer::isNormalized($label, Normalizer::FORM_C)) { - $info->errors |= self::ERROR_INVALID_ACE_LABEL; - } - - $codePoints = self::utf8Decode($label); - - if ($options['CheckHyphens']) { - // Step 2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character - // in both the thrid and fourth positions. - if (isset($codePoints[2], $codePoints[3]) && 0x002D === $codePoints[2] && 0x002D === $codePoints[3]) { - $info->errors |= self::ERROR_HYPHEN_3_4; - } - - // Step 3. If CheckHyphens, the label must neither begin nor end with a U+002D - // HYPHEN-MINUS character. - if ('-' === substr($label, 0, 1)) { - $info->errors |= self::ERROR_LEADING_HYPHEN; - } - - if ('-' === substr($label, -1, 1)) { - $info->errors |= self::ERROR_TRAILING_HYPHEN; - } - } - - // Step 4. The label must not contain a U+002E (.) FULL STOP. - if (false !== strpos($label, '.')) { - $info->errors |= self::ERROR_LABEL_HAS_DOT; - } - - // Step 5. The label must not begin with a combining mark, that is: General_Category=Mark. - if (1 === preg_match(Regex::COMBINING_MARK, $label)) { - $info->errors |= self::ERROR_LEADING_COMBINING_MARK; - } - - // Step 6. Each code point in the label must only have certain status values according to - // Section 5, IDNA Mapping Table: - $transitional = $options['Transitional_Processing']; - $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; - - foreach ($codePoints as $codePoint) { - $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); - $status = $data['status']; - - if ('valid' === $status || (!$transitional && 'deviation' === $status)) { - continue; - } - - $info->errors |= self::ERROR_DISALLOWED; - - break; - } - - // Step 7. If CheckJoiners, the label must satisify the ContextJ rules from Appendix A, in - // The Unicode Code Points and Internationalized Domain Names for Applications (IDNA) - // [IDNA2008]. - if ($options['CheckJoiners'] && !self::isValidContextJ($codePoints, $label)) { - $info->errors |= self::ERROR_CONTEXTJ; - } - - // Step 8. If CheckBidi, and if the domain name is a Bidi domain name, then the label must - // satisfy all six of the numbered conditions in [IDNA2008] RFC 5893, Section 2. - if ($options['CheckBidi'] && (!$info->bidiDomain || $info->validBidiDomain)) { - self::validateBidiLabel($label, $info); - } - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.2 - * - * @param string $input - * - * @return string - */ - private static function punycodeDecode($input) - { - $n = self::INITIAL_N; - $out = 0; - $i = 0; - $bias = self::INITIAL_BIAS; - $lastDelimIndex = strrpos($input, self::DELIMITER); - $b = false === $lastDelimIndex ? 0 : $lastDelimIndex; - $inputLength = \strlen($input); - $output = []; - $bytes = array_map('ord', str_split($input)); - - for ($j = 0; $j < $b; ++$j) { - if ($bytes[$j] > 0x7F) { - throw new Exception('Invalid input'); - } - - $output[$out++] = $input[$j]; - } - - if ($b > 0) { - ++$b; - } - - for ($in = $b; $in < $inputLength; ++$out) { - $oldi = $i; - $w = 1; - - for ($k = self::BASE; /* no condition */; $k += self::BASE) { - if ($in >= $inputLength) { - throw new Exception('Invalid input'); - } - - $digit = self::$basicToDigit[$bytes[$in++] & 0xFF]; - - if ($digit < 0) { - throw new Exception('Invalid input'); - } - - if ($digit > intdiv(self::MAX_INT - $i, $w)) { - throw new Exception('Integer overflow'); - } - - $i += $digit * $w; - - if ($k <= $bias) { - $t = self::TMIN; - } elseif ($k >= $bias + self::TMAX) { - $t = self::TMAX; - } else { - $t = $k - $bias; - } - - if ($digit < $t) { - break; - } - - $baseMinusT = self::BASE - $t; - - if ($w > intdiv(self::MAX_INT, $baseMinusT)) { - throw new Exception('Integer overflow'); - } - - $w *= $baseMinusT; - } - - $outPlusOne = $out + 1; - $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi); - - if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) { - throw new Exception('Integer overflow'); - } - - $n += intdiv($i, $outPlusOne); - $i %= $outPlusOne; - array_splice($output, $i++, 0, [mb_chr($n, 'utf-8')]); - } - - return implode('', $output); - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.3 - * - * @param string $input - * - * @return string - */ - private static function punycodeEncode($input) - { - $n = self::INITIAL_N; - $delta = 0; - $out = 0; - $bias = self::INITIAL_BIAS; - $inputLength = 0; - $output = ''; - $iter = self::utf8Decode($input); - - foreach ($iter as $codePoint) { - ++$inputLength; - - if ($codePoint < 0x80) { - $output .= \chr($codePoint); - ++$out; - } - } - - $h = $out; - $b = $out; - - if ($b > 0) { - $output .= self::DELIMITER; - ++$out; - } - - while ($h < $inputLength) { - $m = self::MAX_INT; - - foreach ($iter as $codePoint) { - if ($codePoint >= $n && $codePoint < $m) { - $m = $codePoint; - } - } - - if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) { - throw new Exception('Integer overflow'); - } - - $delta += ($m - $n) * ($h + 1); - $n = $m; - - foreach ($iter as $codePoint) { - if ($codePoint < $n && 0 === ++$delta) { - throw new Exception('Integer overflow'); - } - - if ($codePoint === $n) { - $q = $delta; - - for ($k = self::BASE; /* no condition */; $k += self::BASE) { - if ($k <= $bias) { - $t = self::TMIN; - } elseif ($k >= $bias + self::TMAX) { - $t = self::TMAX; - } else { - $t = $k - $bias; - } - - if ($q < $t) { - break; - } - - $qMinusT = $q - $t; - $baseMinusT = self::BASE - $t; - $output .= self::encodeDigit($t + ($qMinusT) % ($baseMinusT), false); - ++$out; - $q = intdiv($qMinusT, $baseMinusT); - } - - $output .= self::encodeDigit($q, false); - ++$out; - $bias = self::adaptBias($delta, $h + 1, $h === $b); - $delta = 0; - ++$h; - } - } - - ++$delta; - ++$n; - } - - return $output; - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.1 - * - * @param int $delta - * @param int $numPoints - * @param bool $firstTime - * - * @return int - */ - private static function adaptBias($delta, $numPoints, $firstTime) - { - // xxx >> 1 is a faster way of doing intdiv(xxx, 2) - $delta = $firstTime ? intdiv($delta, self::DAMP) : $delta >> 1; - $delta += intdiv($delta, $numPoints); - $k = 0; - - while ($delta > ((self::BASE - self::TMIN) * self::TMAX) >> 1) { - $delta = intdiv($delta, self::BASE - self::TMIN); - $k += self::BASE; - } - - return $k + intdiv((self::BASE - self::TMIN + 1) * $delta, $delta + self::SKEW); - } - - /** - * @param int $d - * @param bool $flag - * - * @return string - */ - private static function encodeDigit($d, $flag) - { - return \chr($d + 22 + 75 * ($d < 26 ? 1 : 0) - (($flag ? 1 : 0) << 5)); - } - - /** - * Takes a UTF-8 encoded string and converts it into a series of integer code points. Any - * invalid byte sequences will be replaced by a U+FFFD replacement code point. - * - * @see https://encoding.spec.whatwg.org/#utf-8-decoder - * - * @param string $input - * - * @return array - */ - private static function utf8Decode($input) - { - $bytesSeen = 0; - $bytesNeeded = 0; - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - $codePoint = 0; - $codePoints = []; - $length = \strlen($input); - - for ($i = 0; $i < $length; ++$i) { - $byte = \ord($input[$i]); - - if (0 === $bytesNeeded) { - if ($byte >= 0x00 && $byte <= 0x7F) { - $codePoints[] = $byte; - - continue; - } - - if ($byte >= 0xC2 && $byte <= 0xDF) { - $bytesNeeded = 1; - $codePoint = $byte & 0x1F; - } elseif ($byte >= 0xE0 && $byte <= 0xEF) { - if (0xE0 === $byte) { - $lowerBoundary = 0xA0; - } elseif (0xED === $byte) { - $upperBoundary = 0x9F; - } - - $bytesNeeded = 2; - $codePoint = $byte & 0xF; - } elseif ($byte >= 0xF0 && $byte <= 0xF4) { - if (0xF0 === $byte) { - $lowerBoundary = 0x90; - } elseif (0xF4 === $byte) { - $upperBoundary = 0x8F; - } - - $bytesNeeded = 3; - $codePoint = $byte & 0x7; - } else { - $codePoints[] = 0xFFFD; - } - - continue; - } - - if ($byte < $lowerBoundary || $byte > $upperBoundary) { - $codePoint = 0; - $bytesNeeded = 0; - $bytesSeen = 0; - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - --$i; - $codePoints[] = 0xFFFD; - - continue; - } - - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - $codePoint = ($codePoint << 6) | ($byte & 0x3F); - - if (++$bytesSeen !== $bytesNeeded) { - continue; - } - - $codePoints[] = $codePoint; - $codePoint = 0; - $bytesNeeded = 0; - $bytesSeen = 0; - } - - // String unexpectedly ended, so append a U+FFFD code point. - if (0 !== $bytesNeeded) { - $codePoints[] = 0xFFFD; - } - - return $codePoints; - } - - /** - * @param int $codePoint - * @param bool $useSTD3ASCIIRules - * - * @return array{status: string, mapping?: string} - */ - private static function lookupCodePointStatus($codePoint, $useSTD3ASCIIRules) - { - if (!self::$mappingTableLoaded) { - self::$mappingTableLoaded = true; - self::$mapped = require __DIR__.'/Resources/unidata/mapped.php'; - self::$ignored = require __DIR__.'/Resources/unidata/ignored.php'; - self::$deviation = require __DIR__.'/Resources/unidata/deviation.php'; - self::$disallowed = require __DIR__.'/Resources/unidata/disallowed.php'; - self::$disallowed_STD3_mapped = require __DIR__.'/Resources/unidata/disallowed_STD3_mapped.php'; - self::$disallowed_STD3_valid = require __DIR__.'/Resources/unidata/disallowed_STD3_valid.php'; - } - - if (isset(self::$mapped[$codePoint])) { - return ['status' => 'mapped', 'mapping' => self::$mapped[$codePoint]]; - } - - if (isset(self::$ignored[$codePoint])) { - return ['status' => 'ignored']; - } - - if (isset(self::$deviation[$codePoint])) { - return ['status' => 'deviation', 'mapping' => self::$deviation[$codePoint]]; - } - - if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) { - return ['status' => 'disallowed']; - } - - $isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]); - - if ($isDisallowedMapped || isset(self::$disallowed_STD3_valid[$codePoint])) { - $status = 'disallowed'; - - if (!$useSTD3ASCIIRules) { - $status = $isDisallowedMapped ? 'mapped' : 'valid'; - } - - if ($isDisallowedMapped) { - return ['status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]]; - } - - return ['status' => $status]; - } - - return ['status' => 'valid']; - } -} diff --git a/vendor/symfony/polyfill-intl-idn/Info.php b/vendor/symfony/polyfill-intl-idn/Info.php deleted file mode 100644 index 25c3582..0000000 --- a/vendor/symfony/polyfill-intl-idn/Info.php +++ /dev/null @@ -1,23 +0,0 @@ - and Trevor Rowbotham - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Idn; - -/** - * @internal - */ -class Info -{ - public $bidiDomain = false; - public $errors = 0; - public $validBidiDomain = true; - public $transitionalDifferent = false; -} diff --git a/vendor/symfony/polyfill-intl-idn/LICENSE b/vendor/symfony/polyfill-intl-idn/LICENSE deleted file mode 100644 index 03c5e25..0000000 --- a/vendor/symfony/polyfill-intl-idn/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier and Trevor Rowbotham - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-intl-idn/README.md b/vendor/symfony/polyfill-intl-idn/README.md deleted file mode 100644 index 2e75f2e..0000000 --- a/vendor/symfony/polyfill-intl-idn/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Intl: Idn -============================ - -This component provides [`idn_to_ascii`](https://php.net/idn-to-ascii) and [`idn_to_utf8`](https://php.net/idn-to-utf8) functions to users who run php versions without the [Intl](https://php.net/intl) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php deleted file mode 100644 index 5bb70e4..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php +++ /dev/null @@ -1,375 +0,0 @@ -= 128 && $codePoint <= 159) { - return true; - } - - if ($codePoint >= 2155 && $codePoint <= 2207) { - return true; - } - - if ($codePoint >= 3676 && $codePoint <= 3712) { - return true; - } - - if ($codePoint >= 3808 && $codePoint <= 3839) { - return true; - } - - if ($codePoint >= 4059 && $codePoint <= 4095) { - return true; - } - - if ($codePoint >= 4256 && $codePoint <= 4293) { - return true; - } - - if ($codePoint >= 6849 && $codePoint <= 6911) { - return true; - } - - if ($codePoint >= 11859 && $codePoint <= 11903) { - return true; - } - - if ($codePoint >= 42955 && $codePoint <= 42996) { - return true; - } - - if ($codePoint >= 55296 && $codePoint <= 57343) { - return true; - } - - if ($codePoint >= 57344 && $codePoint <= 63743) { - return true; - } - - if ($codePoint >= 64218 && $codePoint <= 64255) { - return true; - } - - if ($codePoint >= 64976 && $codePoint <= 65007) { - return true; - } - - if ($codePoint >= 65630 && $codePoint <= 65663) { - return true; - } - - if ($codePoint >= 65953 && $codePoint <= 65999) { - return true; - } - - if ($codePoint >= 66046 && $codePoint <= 66175) { - return true; - } - - if ($codePoint >= 66518 && $codePoint <= 66559) { - return true; - } - - if ($codePoint >= 66928 && $codePoint <= 67071) { - return true; - } - - if ($codePoint >= 67432 && $codePoint <= 67583) { - return true; - } - - if ($codePoint >= 67760 && $codePoint <= 67807) { - return true; - } - - if ($codePoint >= 67904 && $codePoint <= 67967) { - return true; - } - - if ($codePoint >= 68256 && $codePoint <= 68287) { - return true; - } - - if ($codePoint >= 68528 && $codePoint <= 68607) { - return true; - } - - if ($codePoint >= 68681 && $codePoint <= 68735) { - return true; - } - - if ($codePoint >= 68922 && $codePoint <= 69215) { - return true; - } - - if ($codePoint >= 69298 && $codePoint <= 69375) { - return true; - } - - if ($codePoint >= 69466 && $codePoint <= 69551) { - return true; - } - - if ($codePoint >= 70207 && $codePoint <= 70271) { - return true; - } - - if ($codePoint >= 70517 && $codePoint <= 70655) { - return true; - } - - if ($codePoint >= 70874 && $codePoint <= 71039) { - return true; - } - - if ($codePoint >= 71134 && $codePoint <= 71167) { - return true; - } - - if ($codePoint >= 71370 && $codePoint <= 71423) { - return true; - } - - if ($codePoint >= 71488 && $codePoint <= 71679) { - return true; - } - - if ($codePoint >= 71740 && $codePoint <= 71839) { - return true; - } - - if ($codePoint >= 72026 && $codePoint <= 72095) { - return true; - } - - if ($codePoint >= 72441 && $codePoint <= 72703) { - return true; - } - - if ($codePoint >= 72887 && $codePoint <= 72959) { - return true; - } - - if ($codePoint >= 73130 && $codePoint <= 73439) { - return true; - } - - if ($codePoint >= 73465 && $codePoint <= 73647) { - return true; - } - - if ($codePoint >= 74650 && $codePoint <= 74751) { - return true; - } - - if ($codePoint >= 75076 && $codePoint <= 77823) { - return true; - } - - if ($codePoint >= 78905 && $codePoint <= 82943) { - return true; - } - - if ($codePoint >= 83527 && $codePoint <= 92159) { - return true; - } - - if ($codePoint >= 92784 && $codePoint <= 92879) { - return true; - } - - if ($codePoint >= 93072 && $codePoint <= 93759) { - return true; - } - - if ($codePoint >= 93851 && $codePoint <= 93951) { - return true; - } - - if ($codePoint >= 94112 && $codePoint <= 94175) { - return true; - } - - if ($codePoint >= 101590 && $codePoint <= 101631) { - return true; - } - - if ($codePoint >= 101641 && $codePoint <= 110591) { - return true; - } - - if ($codePoint >= 110879 && $codePoint <= 110927) { - return true; - } - - if ($codePoint >= 111356 && $codePoint <= 113663) { - return true; - } - - if ($codePoint >= 113828 && $codePoint <= 118783) { - return true; - } - - if ($codePoint >= 119366 && $codePoint <= 119519) { - return true; - } - - if ($codePoint >= 119673 && $codePoint <= 119807) { - return true; - } - - if ($codePoint >= 121520 && $codePoint <= 122879) { - return true; - } - - if ($codePoint >= 122923 && $codePoint <= 123135) { - return true; - } - - if ($codePoint >= 123216 && $codePoint <= 123583) { - return true; - } - - if ($codePoint >= 123648 && $codePoint <= 124927) { - return true; - } - - if ($codePoint >= 125143 && $codePoint <= 125183) { - return true; - } - - if ($codePoint >= 125280 && $codePoint <= 126064) { - return true; - } - - if ($codePoint >= 126133 && $codePoint <= 126208) { - return true; - } - - if ($codePoint >= 126270 && $codePoint <= 126463) { - return true; - } - - if ($codePoint >= 126652 && $codePoint <= 126703) { - return true; - } - - if ($codePoint >= 126706 && $codePoint <= 126975) { - return true; - } - - if ($codePoint >= 127406 && $codePoint <= 127461) { - return true; - } - - if ($codePoint >= 127590 && $codePoint <= 127743) { - return true; - } - - if ($codePoint >= 129202 && $codePoint <= 129279) { - return true; - } - - if ($codePoint >= 129751 && $codePoint <= 129791) { - return true; - } - - if ($codePoint >= 129995 && $codePoint <= 130031) { - return true; - } - - if ($codePoint >= 130042 && $codePoint <= 131069) { - return true; - } - - if ($codePoint >= 173790 && $codePoint <= 173823) { - return true; - } - - if ($codePoint >= 191457 && $codePoint <= 194559) { - return true; - } - - if ($codePoint >= 195102 && $codePoint <= 196605) { - return true; - } - - if ($codePoint >= 201547 && $codePoint <= 262141) { - return true; - } - - if ($codePoint >= 262144 && $codePoint <= 327677) { - return true; - } - - if ($codePoint >= 327680 && $codePoint <= 393213) { - return true; - } - - if ($codePoint >= 393216 && $codePoint <= 458749) { - return true; - } - - if ($codePoint >= 458752 && $codePoint <= 524285) { - return true; - } - - if ($codePoint >= 524288 && $codePoint <= 589821) { - return true; - } - - if ($codePoint >= 589824 && $codePoint <= 655357) { - return true; - } - - if ($codePoint >= 655360 && $codePoint <= 720893) { - return true; - } - - if ($codePoint >= 720896 && $codePoint <= 786429) { - return true; - } - - if ($codePoint >= 786432 && $codePoint <= 851965) { - return true; - } - - if ($codePoint >= 851968 && $codePoint <= 917501) { - return true; - } - - if ($codePoint >= 917536 && $codePoint <= 917631) { - return true; - } - - if ($codePoint >= 917632 && $codePoint <= 917759) { - return true; - } - - if ($codePoint >= 918000 && $codePoint <= 983037) { - return true; - } - - if ($codePoint >= 983040 && $codePoint <= 1048573) { - return true; - } - - if ($codePoint >= 1048576 && $codePoint <= 1114109) { - return true; - } - - return false; - } -} diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php deleted file mode 100644 index c4b9778..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php +++ /dev/null @@ -1,24 +0,0 @@ - 'ss', - 962 => 'σ', - 8204 => '', - 8205 => '', -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php deleted file mode 100644 index 25a5f56..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php +++ /dev/null @@ -1,2638 +0,0 @@ - true, - 889 => true, - 896 => true, - 897 => true, - 898 => true, - 899 => true, - 907 => true, - 909 => true, - 930 => true, - 1216 => true, - 1328 => true, - 1367 => true, - 1368 => true, - 1419 => true, - 1420 => true, - 1424 => true, - 1480 => true, - 1481 => true, - 1482 => true, - 1483 => true, - 1484 => true, - 1485 => true, - 1486 => true, - 1487 => true, - 1515 => true, - 1516 => true, - 1517 => true, - 1518 => true, - 1525 => true, - 1526 => true, - 1527 => true, - 1528 => true, - 1529 => true, - 1530 => true, - 1531 => true, - 1532 => true, - 1533 => true, - 1534 => true, - 1535 => true, - 1536 => true, - 1537 => true, - 1538 => true, - 1539 => true, - 1540 => true, - 1541 => true, - 1564 => true, - 1565 => true, - 1757 => true, - 1806 => true, - 1807 => true, - 1867 => true, - 1868 => true, - 1970 => true, - 1971 => true, - 1972 => true, - 1973 => true, - 1974 => true, - 1975 => true, - 1976 => true, - 1977 => true, - 1978 => true, - 1979 => true, - 1980 => true, - 1981 => true, - 1982 => true, - 1983 => true, - 2043 => true, - 2044 => true, - 2094 => true, - 2095 => true, - 2111 => true, - 2140 => true, - 2141 => true, - 2143 => true, - 2229 => true, - 2248 => true, - 2249 => true, - 2250 => true, - 2251 => true, - 2252 => true, - 2253 => true, - 2254 => true, - 2255 => true, - 2256 => true, - 2257 => true, - 2258 => true, - 2274 => true, - 2436 => true, - 2445 => true, - 2446 => true, - 2449 => true, - 2450 => true, - 2473 => true, - 2481 => true, - 2483 => true, - 2484 => true, - 2485 => true, - 2490 => true, - 2491 => true, - 2501 => true, - 2502 => true, - 2505 => true, - 2506 => true, - 2511 => true, - 2512 => true, - 2513 => true, - 2514 => true, - 2515 => true, - 2516 => true, - 2517 => true, - 2518 => true, - 2520 => true, - 2521 => true, - 2522 => true, - 2523 => true, - 2526 => true, - 2532 => true, - 2533 => true, - 2559 => true, - 2560 => true, - 2564 => true, - 2571 => true, - 2572 => true, - 2573 => true, - 2574 => true, - 2577 => true, - 2578 => true, - 2601 => true, - 2609 => true, - 2612 => true, - 2615 => true, - 2618 => true, - 2619 => true, - 2621 => true, - 2627 => true, - 2628 => true, - 2629 => true, - 2630 => true, - 2633 => true, - 2634 => true, - 2638 => true, - 2639 => true, - 2640 => true, - 2642 => true, - 2643 => true, - 2644 => true, - 2645 => true, - 2646 => true, - 2647 => true, - 2648 => true, - 2653 => true, - 2655 => true, - 2656 => true, - 2657 => true, - 2658 => true, - 2659 => true, - 2660 => true, - 2661 => true, - 2679 => true, - 2680 => true, - 2681 => true, - 2682 => true, - 2683 => true, - 2684 => true, - 2685 => true, - 2686 => true, - 2687 => true, - 2688 => true, - 2692 => true, - 2702 => true, - 2706 => true, - 2729 => true, - 2737 => true, - 2740 => true, - 2746 => true, - 2747 => true, - 2758 => true, - 2762 => true, - 2766 => true, - 2767 => true, - 2769 => true, - 2770 => true, - 2771 => true, - 2772 => true, - 2773 => true, - 2774 => true, - 2775 => true, - 2776 => true, - 2777 => true, - 2778 => true, - 2779 => true, - 2780 => true, - 2781 => true, - 2782 => true, - 2783 => true, - 2788 => true, - 2789 => true, - 2802 => true, - 2803 => true, - 2804 => true, - 2805 => true, - 2806 => true, - 2807 => true, - 2808 => true, - 2816 => true, - 2820 => true, - 2829 => true, - 2830 => true, - 2833 => true, - 2834 => true, - 2857 => true, - 2865 => true, - 2868 => true, - 2874 => true, - 2875 => true, - 2885 => true, - 2886 => true, - 2889 => true, - 2890 => true, - 2894 => true, - 2895 => true, - 2896 => true, - 2897 => true, - 2898 => true, - 2899 => true, - 2900 => true, - 2904 => true, - 2905 => true, - 2906 => true, - 2907 => true, - 2910 => true, - 2916 => true, - 2917 => true, - 2936 => true, - 2937 => true, - 2938 => true, - 2939 => true, - 2940 => true, - 2941 => true, - 2942 => true, - 2943 => true, - 2944 => true, - 2945 => true, - 2948 => true, - 2955 => true, - 2956 => true, - 2957 => true, - 2961 => true, - 2966 => true, - 2967 => true, - 2968 => true, - 2971 => true, - 2973 => true, - 2976 => true, - 2977 => true, - 2978 => true, - 2981 => true, - 2982 => true, - 2983 => true, - 2987 => true, - 2988 => true, - 2989 => true, - 3002 => true, - 3003 => true, - 3004 => true, - 3005 => true, - 3011 => true, - 3012 => true, - 3013 => true, - 3017 => true, - 3022 => true, - 3023 => true, - 3025 => true, - 3026 => true, - 3027 => true, - 3028 => true, - 3029 => true, - 3030 => true, - 3032 => true, - 3033 => true, - 3034 => true, - 3035 => true, - 3036 => true, - 3037 => true, - 3038 => true, - 3039 => true, - 3040 => true, - 3041 => true, - 3042 => true, - 3043 => true, - 3044 => true, - 3045 => true, - 3067 => true, - 3068 => true, - 3069 => true, - 3070 => true, - 3071 => true, - 3085 => true, - 3089 => true, - 3113 => true, - 3130 => true, - 3131 => true, - 3132 => true, - 3141 => true, - 3145 => true, - 3150 => true, - 3151 => true, - 3152 => true, - 3153 => true, - 3154 => true, - 3155 => true, - 3156 => true, - 3159 => true, - 3163 => true, - 3164 => true, - 3165 => true, - 3166 => true, - 3167 => true, - 3172 => true, - 3173 => true, - 3184 => true, - 3185 => true, - 3186 => true, - 3187 => true, - 3188 => true, - 3189 => true, - 3190 => true, - 3213 => true, - 3217 => true, - 3241 => true, - 3252 => true, - 3258 => true, - 3259 => true, - 3269 => true, - 3273 => true, - 3278 => true, - 3279 => true, - 3280 => true, - 3281 => true, - 3282 => true, - 3283 => true, - 3284 => true, - 3287 => true, - 3288 => true, - 3289 => true, - 3290 => true, - 3291 => true, - 3292 => true, - 3293 => true, - 3295 => true, - 3300 => true, - 3301 => true, - 3312 => true, - 3315 => true, - 3316 => true, - 3317 => true, - 3318 => true, - 3319 => true, - 3320 => true, - 3321 => true, - 3322 => true, - 3323 => true, - 3324 => true, - 3325 => true, - 3326 => true, - 3327 => true, - 3341 => true, - 3345 => true, - 3397 => true, - 3401 => true, - 3408 => true, - 3409 => true, - 3410 => true, - 3411 => true, - 3428 => true, - 3429 => true, - 3456 => true, - 3460 => true, - 3479 => true, - 3480 => true, - 3481 => true, - 3506 => true, - 3516 => true, - 3518 => true, - 3519 => true, - 3527 => true, - 3528 => true, - 3529 => true, - 3531 => true, - 3532 => true, - 3533 => true, - 3534 => true, - 3541 => true, - 3543 => true, - 3552 => true, - 3553 => true, - 3554 => true, - 3555 => true, - 3556 => true, - 3557 => true, - 3568 => true, - 3569 => true, - 3573 => true, - 3574 => true, - 3575 => true, - 3576 => true, - 3577 => true, - 3578 => true, - 3579 => true, - 3580 => true, - 3581 => true, - 3582 => true, - 3583 => true, - 3584 => true, - 3643 => true, - 3644 => true, - 3645 => true, - 3646 => true, - 3715 => true, - 3717 => true, - 3723 => true, - 3748 => true, - 3750 => true, - 3774 => true, - 3775 => true, - 3781 => true, - 3783 => true, - 3790 => true, - 3791 => true, - 3802 => true, - 3803 => true, - 3912 => true, - 3949 => true, - 3950 => true, - 3951 => true, - 3952 => true, - 3992 => true, - 4029 => true, - 4045 => true, - 4294 => true, - 4296 => true, - 4297 => true, - 4298 => true, - 4299 => true, - 4300 => true, - 4302 => true, - 4303 => true, - 4447 => true, - 4448 => true, - 4681 => true, - 4686 => true, - 4687 => true, - 4695 => true, - 4697 => true, - 4702 => true, - 4703 => true, - 4745 => true, - 4750 => true, - 4751 => true, - 4785 => true, - 4790 => true, - 4791 => true, - 4799 => true, - 4801 => true, - 4806 => true, - 4807 => true, - 4823 => true, - 4881 => true, - 4886 => true, - 4887 => true, - 4955 => true, - 4956 => true, - 4989 => true, - 4990 => true, - 4991 => true, - 5018 => true, - 5019 => true, - 5020 => true, - 5021 => true, - 5022 => true, - 5023 => true, - 5110 => true, - 5111 => true, - 5118 => true, - 5119 => true, - 5760 => true, - 5789 => true, - 5790 => true, - 5791 => true, - 5881 => true, - 5882 => true, - 5883 => true, - 5884 => true, - 5885 => true, - 5886 => true, - 5887 => true, - 5901 => true, - 5909 => true, - 5910 => true, - 5911 => true, - 5912 => true, - 5913 => true, - 5914 => true, - 5915 => true, - 5916 => true, - 5917 => true, - 5918 => true, - 5919 => true, - 5943 => true, - 5944 => true, - 5945 => true, - 5946 => true, - 5947 => true, - 5948 => true, - 5949 => true, - 5950 => true, - 5951 => true, - 5972 => true, - 5973 => true, - 5974 => true, - 5975 => true, - 5976 => true, - 5977 => true, - 5978 => true, - 5979 => true, - 5980 => true, - 5981 => true, - 5982 => true, - 5983 => true, - 5997 => true, - 6001 => true, - 6004 => true, - 6005 => true, - 6006 => true, - 6007 => true, - 6008 => true, - 6009 => true, - 6010 => true, - 6011 => true, - 6012 => true, - 6013 => true, - 6014 => true, - 6015 => true, - 6068 => true, - 6069 => true, - 6110 => true, - 6111 => true, - 6122 => true, - 6123 => true, - 6124 => true, - 6125 => true, - 6126 => true, - 6127 => true, - 6138 => true, - 6139 => true, - 6140 => true, - 6141 => true, - 6142 => true, - 6143 => true, - 6150 => true, - 6158 => true, - 6159 => true, - 6170 => true, - 6171 => true, - 6172 => true, - 6173 => true, - 6174 => true, - 6175 => true, - 6265 => true, - 6266 => true, - 6267 => true, - 6268 => true, - 6269 => true, - 6270 => true, - 6271 => true, - 6315 => true, - 6316 => true, - 6317 => true, - 6318 => true, - 6319 => true, - 6390 => true, - 6391 => true, - 6392 => true, - 6393 => true, - 6394 => true, - 6395 => true, - 6396 => true, - 6397 => true, - 6398 => true, - 6399 => true, - 6431 => true, - 6444 => true, - 6445 => true, - 6446 => true, - 6447 => true, - 6460 => true, - 6461 => true, - 6462 => true, - 6463 => true, - 6465 => true, - 6466 => true, - 6467 => true, - 6510 => true, - 6511 => true, - 6517 => true, - 6518 => true, - 6519 => true, - 6520 => true, - 6521 => true, - 6522 => true, - 6523 => true, - 6524 => true, - 6525 => true, - 6526 => true, - 6527 => true, - 6572 => true, - 6573 => true, - 6574 => true, - 6575 => true, - 6602 => true, - 6603 => true, - 6604 => true, - 6605 => true, - 6606 => true, - 6607 => true, - 6619 => true, - 6620 => true, - 6621 => true, - 6684 => true, - 6685 => true, - 6751 => true, - 6781 => true, - 6782 => true, - 6794 => true, - 6795 => true, - 6796 => true, - 6797 => true, - 6798 => true, - 6799 => true, - 6810 => true, - 6811 => true, - 6812 => true, - 6813 => true, - 6814 => true, - 6815 => true, - 6830 => true, - 6831 => true, - 6988 => true, - 6989 => true, - 6990 => true, - 6991 => true, - 7037 => true, - 7038 => true, - 7039 => true, - 7156 => true, - 7157 => true, - 7158 => true, - 7159 => true, - 7160 => true, - 7161 => true, - 7162 => true, - 7163 => true, - 7224 => true, - 7225 => true, - 7226 => true, - 7242 => true, - 7243 => true, - 7244 => true, - 7305 => true, - 7306 => true, - 7307 => true, - 7308 => true, - 7309 => true, - 7310 => true, - 7311 => true, - 7355 => true, - 7356 => true, - 7368 => true, - 7369 => true, - 7370 => true, - 7371 => true, - 7372 => true, - 7373 => true, - 7374 => true, - 7375 => true, - 7419 => true, - 7420 => true, - 7421 => true, - 7422 => true, - 7423 => true, - 7674 => true, - 7958 => true, - 7959 => true, - 7966 => true, - 7967 => true, - 8006 => true, - 8007 => true, - 8014 => true, - 8015 => true, - 8024 => true, - 8026 => true, - 8028 => true, - 8030 => true, - 8062 => true, - 8063 => true, - 8117 => true, - 8133 => true, - 8148 => true, - 8149 => true, - 8156 => true, - 8176 => true, - 8177 => true, - 8181 => true, - 8191 => true, - 8206 => true, - 8207 => true, - 8228 => true, - 8229 => true, - 8230 => true, - 8232 => true, - 8233 => true, - 8234 => true, - 8235 => true, - 8236 => true, - 8237 => true, - 8238 => true, - 8289 => true, - 8290 => true, - 8291 => true, - 8293 => true, - 8294 => true, - 8295 => true, - 8296 => true, - 8297 => true, - 8298 => true, - 8299 => true, - 8300 => true, - 8301 => true, - 8302 => true, - 8303 => true, - 8306 => true, - 8307 => true, - 8335 => true, - 8349 => true, - 8350 => true, - 8351 => true, - 8384 => true, - 8385 => true, - 8386 => true, - 8387 => true, - 8388 => true, - 8389 => true, - 8390 => true, - 8391 => true, - 8392 => true, - 8393 => true, - 8394 => true, - 8395 => true, - 8396 => true, - 8397 => true, - 8398 => true, - 8399 => true, - 8433 => true, - 8434 => true, - 8435 => true, - 8436 => true, - 8437 => true, - 8438 => true, - 8439 => true, - 8440 => true, - 8441 => true, - 8442 => true, - 8443 => true, - 8444 => true, - 8445 => true, - 8446 => true, - 8447 => true, - 8498 => true, - 8579 => true, - 8588 => true, - 8589 => true, - 8590 => true, - 8591 => true, - 9255 => true, - 9256 => true, - 9257 => true, - 9258 => true, - 9259 => true, - 9260 => true, - 9261 => true, - 9262 => true, - 9263 => true, - 9264 => true, - 9265 => true, - 9266 => true, - 9267 => true, - 9268 => true, - 9269 => true, - 9270 => true, - 9271 => true, - 9272 => true, - 9273 => true, - 9274 => true, - 9275 => true, - 9276 => true, - 9277 => true, - 9278 => true, - 9279 => true, - 9291 => true, - 9292 => true, - 9293 => true, - 9294 => true, - 9295 => true, - 9296 => true, - 9297 => true, - 9298 => true, - 9299 => true, - 9300 => true, - 9301 => true, - 9302 => true, - 9303 => true, - 9304 => true, - 9305 => true, - 9306 => true, - 9307 => true, - 9308 => true, - 9309 => true, - 9310 => true, - 9311 => true, - 9352 => true, - 9353 => true, - 9354 => true, - 9355 => true, - 9356 => true, - 9357 => true, - 9358 => true, - 9359 => true, - 9360 => true, - 9361 => true, - 9362 => true, - 9363 => true, - 9364 => true, - 9365 => true, - 9366 => true, - 9367 => true, - 9368 => true, - 9369 => true, - 9370 => true, - 9371 => true, - 11124 => true, - 11125 => true, - 11158 => true, - 11311 => true, - 11359 => true, - 11508 => true, - 11509 => true, - 11510 => true, - 11511 => true, - 11512 => true, - 11558 => true, - 11560 => true, - 11561 => true, - 11562 => true, - 11563 => true, - 11564 => true, - 11566 => true, - 11567 => true, - 11624 => true, - 11625 => true, - 11626 => true, - 11627 => true, - 11628 => true, - 11629 => true, - 11630 => true, - 11633 => true, - 11634 => true, - 11635 => true, - 11636 => true, - 11637 => true, - 11638 => true, - 11639 => true, - 11640 => true, - 11641 => true, - 11642 => true, - 11643 => true, - 11644 => true, - 11645 => true, - 11646 => true, - 11671 => true, - 11672 => true, - 11673 => true, - 11674 => true, - 11675 => true, - 11676 => true, - 11677 => true, - 11678 => true, - 11679 => true, - 11687 => true, - 11695 => true, - 11703 => true, - 11711 => true, - 11719 => true, - 11727 => true, - 11735 => true, - 11743 => true, - 11930 => true, - 12020 => true, - 12021 => true, - 12022 => true, - 12023 => true, - 12024 => true, - 12025 => true, - 12026 => true, - 12027 => true, - 12028 => true, - 12029 => true, - 12030 => true, - 12031 => true, - 12246 => true, - 12247 => true, - 12248 => true, - 12249 => true, - 12250 => true, - 12251 => true, - 12252 => true, - 12253 => true, - 12254 => true, - 12255 => true, - 12256 => true, - 12257 => true, - 12258 => true, - 12259 => true, - 12260 => true, - 12261 => true, - 12262 => true, - 12263 => true, - 12264 => true, - 12265 => true, - 12266 => true, - 12267 => true, - 12268 => true, - 12269 => true, - 12270 => true, - 12271 => true, - 12272 => true, - 12273 => true, - 12274 => true, - 12275 => true, - 12276 => true, - 12277 => true, - 12278 => true, - 12279 => true, - 12280 => true, - 12281 => true, - 12282 => true, - 12283 => true, - 12284 => true, - 12285 => true, - 12286 => true, - 12287 => true, - 12352 => true, - 12439 => true, - 12440 => true, - 12544 => true, - 12545 => true, - 12546 => true, - 12547 => true, - 12548 => true, - 12592 => true, - 12644 => true, - 12687 => true, - 12772 => true, - 12773 => true, - 12774 => true, - 12775 => true, - 12776 => true, - 12777 => true, - 12778 => true, - 12779 => true, - 12780 => true, - 12781 => true, - 12782 => true, - 12783 => true, - 12831 => true, - 13250 => true, - 13255 => true, - 13272 => true, - 40957 => true, - 40958 => true, - 40959 => true, - 42125 => true, - 42126 => true, - 42127 => true, - 42183 => true, - 42184 => true, - 42185 => true, - 42186 => true, - 42187 => true, - 42188 => true, - 42189 => true, - 42190 => true, - 42191 => true, - 42540 => true, - 42541 => true, - 42542 => true, - 42543 => true, - 42544 => true, - 42545 => true, - 42546 => true, - 42547 => true, - 42548 => true, - 42549 => true, - 42550 => true, - 42551 => true, - 42552 => true, - 42553 => true, - 42554 => true, - 42555 => true, - 42556 => true, - 42557 => true, - 42558 => true, - 42559 => true, - 42744 => true, - 42745 => true, - 42746 => true, - 42747 => true, - 42748 => true, - 42749 => true, - 42750 => true, - 42751 => true, - 42944 => true, - 42945 => true, - 43053 => true, - 43054 => true, - 43055 => true, - 43066 => true, - 43067 => true, - 43068 => true, - 43069 => true, - 43070 => true, - 43071 => true, - 43128 => true, - 43129 => true, - 43130 => true, - 43131 => true, - 43132 => true, - 43133 => true, - 43134 => true, - 43135 => true, - 43206 => true, - 43207 => true, - 43208 => true, - 43209 => true, - 43210 => true, - 43211 => true, - 43212 => true, - 43213 => true, - 43226 => true, - 43227 => true, - 43228 => true, - 43229 => true, - 43230 => true, - 43231 => true, - 43348 => true, - 43349 => true, - 43350 => true, - 43351 => true, - 43352 => true, - 43353 => true, - 43354 => true, - 43355 => true, - 43356 => true, - 43357 => true, - 43358 => true, - 43389 => true, - 43390 => true, - 43391 => true, - 43470 => true, - 43482 => true, - 43483 => true, - 43484 => true, - 43485 => true, - 43519 => true, - 43575 => true, - 43576 => true, - 43577 => true, - 43578 => true, - 43579 => true, - 43580 => true, - 43581 => true, - 43582 => true, - 43583 => true, - 43598 => true, - 43599 => true, - 43610 => true, - 43611 => true, - 43715 => true, - 43716 => true, - 43717 => true, - 43718 => true, - 43719 => true, - 43720 => true, - 43721 => true, - 43722 => true, - 43723 => true, - 43724 => true, - 43725 => true, - 43726 => true, - 43727 => true, - 43728 => true, - 43729 => true, - 43730 => true, - 43731 => true, - 43732 => true, - 43733 => true, - 43734 => true, - 43735 => true, - 43736 => true, - 43737 => true, - 43738 => true, - 43767 => true, - 43768 => true, - 43769 => true, - 43770 => true, - 43771 => true, - 43772 => true, - 43773 => true, - 43774 => true, - 43775 => true, - 43776 => true, - 43783 => true, - 43784 => true, - 43791 => true, - 43792 => true, - 43799 => true, - 43800 => true, - 43801 => true, - 43802 => true, - 43803 => true, - 43804 => true, - 43805 => true, - 43806 => true, - 43807 => true, - 43815 => true, - 43823 => true, - 43884 => true, - 43885 => true, - 43886 => true, - 43887 => true, - 44014 => true, - 44015 => true, - 44026 => true, - 44027 => true, - 44028 => true, - 44029 => true, - 44030 => true, - 44031 => true, - 55204 => true, - 55205 => true, - 55206 => true, - 55207 => true, - 55208 => true, - 55209 => true, - 55210 => true, - 55211 => true, - 55212 => true, - 55213 => true, - 55214 => true, - 55215 => true, - 55239 => true, - 55240 => true, - 55241 => true, - 55242 => true, - 55292 => true, - 55293 => true, - 55294 => true, - 55295 => true, - 64110 => true, - 64111 => true, - 64263 => true, - 64264 => true, - 64265 => true, - 64266 => true, - 64267 => true, - 64268 => true, - 64269 => true, - 64270 => true, - 64271 => true, - 64272 => true, - 64273 => true, - 64274 => true, - 64280 => true, - 64281 => true, - 64282 => true, - 64283 => true, - 64284 => true, - 64311 => true, - 64317 => true, - 64319 => true, - 64322 => true, - 64325 => true, - 64450 => true, - 64451 => true, - 64452 => true, - 64453 => true, - 64454 => true, - 64455 => true, - 64456 => true, - 64457 => true, - 64458 => true, - 64459 => true, - 64460 => true, - 64461 => true, - 64462 => true, - 64463 => true, - 64464 => true, - 64465 => true, - 64466 => true, - 64832 => true, - 64833 => true, - 64834 => true, - 64835 => true, - 64836 => true, - 64837 => true, - 64838 => true, - 64839 => true, - 64840 => true, - 64841 => true, - 64842 => true, - 64843 => true, - 64844 => true, - 64845 => true, - 64846 => true, - 64847 => true, - 64912 => true, - 64913 => true, - 64968 => true, - 64969 => true, - 64970 => true, - 64971 => true, - 64972 => true, - 64973 => true, - 64974 => true, - 64975 => true, - 65022 => true, - 65023 => true, - 65042 => true, - 65049 => true, - 65050 => true, - 65051 => true, - 65052 => true, - 65053 => true, - 65054 => true, - 65055 => true, - 65072 => true, - 65106 => true, - 65107 => true, - 65127 => true, - 65132 => true, - 65133 => true, - 65134 => true, - 65135 => true, - 65141 => true, - 65277 => true, - 65278 => true, - 65280 => true, - 65440 => true, - 65471 => true, - 65472 => true, - 65473 => true, - 65480 => true, - 65481 => true, - 65488 => true, - 65489 => true, - 65496 => true, - 65497 => true, - 65501 => true, - 65502 => true, - 65503 => true, - 65511 => true, - 65519 => true, - 65520 => true, - 65521 => true, - 65522 => true, - 65523 => true, - 65524 => true, - 65525 => true, - 65526 => true, - 65527 => true, - 65528 => true, - 65529 => true, - 65530 => true, - 65531 => true, - 65532 => true, - 65533 => true, - 65534 => true, - 65535 => true, - 65548 => true, - 65575 => true, - 65595 => true, - 65598 => true, - 65614 => true, - 65615 => true, - 65787 => true, - 65788 => true, - 65789 => true, - 65790 => true, - 65791 => true, - 65795 => true, - 65796 => true, - 65797 => true, - 65798 => true, - 65844 => true, - 65845 => true, - 65846 => true, - 65935 => true, - 65949 => true, - 65950 => true, - 65951 => true, - 66205 => true, - 66206 => true, - 66207 => true, - 66257 => true, - 66258 => true, - 66259 => true, - 66260 => true, - 66261 => true, - 66262 => true, - 66263 => true, - 66264 => true, - 66265 => true, - 66266 => true, - 66267 => true, - 66268 => true, - 66269 => true, - 66270 => true, - 66271 => true, - 66300 => true, - 66301 => true, - 66302 => true, - 66303 => true, - 66340 => true, - 66341 => true, - 66342 => true, - 66343 => true, - 66344 => true, - 66345 => true, - 66346 => true, - 66347 => true, - 66348 => true, - 66379 => true, - 66380 => true, - 66381 => true, - 66382 => true, - 66383 => true, - 66427 => true, - 66428 => true, - 66429 => true, - 66430 => true, - 66431 => true, - 66462 => true, - 66500 => true, - 66501 => true, - 66502 => true, - 66503 => true, - 66718 => true, - 66719 => true, - 66730 => true, - 66731 => true, - 66732 => true, - 66733 => true, - 66734 => true, - 66735 => true, - 66772 => true, - 66773 => true, - 66774 => true, - 66775 => true, - 66812 => true, - 66813 => true, - 66814 => true, - 66815 => true, - 66856 => true, - 66857 => true, - 66858 => true, - 66859 => true, - 66860 => true, - 66861 => true, - 66862 => true, - 66863 => true, - 66916 => true, - 66917 => true, - 66918 => true, - 66919 => true, - 66920 => true, - 66921 => true, - 66922 => true, - 66923 => true, - 66924 => true, - 66925 => true, - 66926 => true, - 67383 => true, - 67384 => true, - 67385 => true, - 67386 => true, - 67387 => true, - 67388 => true, - 67389 => true, - 67390 => true, - 67391 => true, - 67414 => true, - 67415 => true, - 67416 => true, - 67417 => true, - 67418 => true, - 67419 => true, - 67420 => true, - 67421 => true, - 67422 => true, - 67423 => true, - 67590 => true, - 67591 => true, - 67593 => true, - 67638 => true, - 67641 => true, - 67642 => true, - 67643 => true, - 67645 => true, - 67646 => true, - 67670 => true, - 67743 => true, - 67744 => true, - 67745 => true, - 67746 => true, - 67747 => true, - 67748 => true, - 67749 => true, - 67750 => true, - 67827 => true, - 67830 => true, - 67831 => true, - 67832 => true, - 67833 => true, - 67834 => true, - 67868 => true, - 67869 => true, - 67870 => true, - 67898 => true, - 67899 => true, - 67900 => true, - 67901 => true, - 67902 => true, - 68024 => true, - 68025 => true, - 68026 => true, - 68027 => true, - 68048 => true, - 68049 => true, - 68100 => true, - 68103 => true, - 68104 => true, - 68105 => true, - 68106 => true, - 68107 => true, - 68116 => true, - 68120 => true, - 68150 => true, - 68151 => true, - 68155 => true, - 68156 => true, - 68157 => true, - 68158 => true, - 68169 => true, - 68170 => true, - 68171 => true, - 68172 => true, - 68173 => true, - 68174 => true, - 68175 => true, - 68185 => true, - 68186 => true, - 68187 => true, - 68188 => true, - 68189 => true, - 68190 => true, - 68191 => true, - 68327 => true, - 68328 => true, - 68329 => true, - 68330 => true, - 68343 => true, - 68344 => true, - 68345 => true, - 68346 => true, - 68347 => true, - 68348 => true, - 68349 => true, - 68350 => true, - 68351 => true, - 68406 => true, - 68407 => true, - 68408 => true, - 68438 => true, - 68439 => true, - 68467 => true, - 68468 => true, - 68469 => true, - 68470 => true, - 68471 => true, - 68498 => true, - 68499 => true, - 68500 => true, - 68501 => true, - 68502 => true, - 68503 => true, - 68504 => true, - 68509 => true, - 68510 => true, - 68511 => true, - 68512 => true, - 68513 => true, - 68514 => true, - 68515 => true, - 68516 => true, - 68517 => true, - 68518 => true, - 68519 => true, - 68520 => true, - 68787 => true, - 68788 => true, - 68789 => true, - 68790 => true, - 68791 => true, - 68792 => true, - 68793 => true, - 68794 => true, - 68795 => true, - 68796 => true, - 68797 => true, - 68798 => true, - 68799 => true, - 68851 => true, - 68852 => true, - 68853 => true, - 68854 => true, - 68855 => true, - 68856 => true, - 68857 => true, - 68904 => true, - 68905 => true, - 68906 => true, - 68907 => true, - 68908 => true, - 68909 => true, - 68910 => true, - 68911 => true, - 69247 => true, - 69290 => true, - 69294 => true, - 69295 => true, - 69416 => true, - 69417 => true, - 69418 => true, - 69419 => true, - 69420 => true, - 69421 => true, - 69422 => true, - 69423 => true, - 69580 => true, - 69581 => true, - 69582 => true, - 69583 => true, - 69584 => true, - 69585 => true, - 69586 => true, - 69587 => true, - 69588 => true, - 69589 => true, - 69590 => true, - 69591 => true, - 69592 => true, - 69593 => true, - 69594 => true, - 69595 => true, - 69596 => true, - 69597 => true, - 69598 => true, - 69599 => true, - 69623 => true, - 69624 => true, - 69625 => true, - 69626 => true, - 69627 => true, - 69628 => true, - 69629 => true, - 69630 => true, - 69631 => true, - 69710 => true, - 69711 => true, - 69712 => true, - 69713 => true, - 69744 => true, - 69745 => true, - 69746 => true, - 69747 => true, - 69748 => true, - 69749 => true, - 69750 => true, - 69751 => true, - 69752 => true, - 69753 => true, - 69754 => true, - 69755 => true, - 69756 => true, - 69757 => true, - 69758 => true, - 69821 => true, - 69826 => true, - 69827 => true, - 69828 => true, - 69829 => true, - 69830 => true, - 69831 => true, - 69832 => true, - 69833 => true, - 69834 => true, - 69835 => true, - 69836 => true, - 69837 => true, - 69838 => true, - 69839 => true, - 69865 => true, - 69866 => true, - 69867 => true, - 69868 => true, - 69869 => true, - 69870 => true, - 69871 => true, - 69882 => true, - 69883 => true, - 69884 => true, - 69885 => true, - 69886 => true, - 69887 => true, - 69941 => true, - 69960 => true, - 69961 => true, - 69962 => true, - 69963 => true, - 69964 => true, - 69965 => true, - 69966 => true, - 69967 => true, - 70007 => true, - 70008 => true, - 70009 => true, - 70010 => true, - 70011 => true, - 70012 => true, - 70013 => true, - 70014 => true, - 70015 => true, - 70112 => true, - 70133 => true, - 70134 => true, - 70135 => true, - 70136 => true, - 70137 => true, - 70138 => true, - 70139 => true, - 70140 => true, - 70141 => true, - 70142 => true, - 70143 => true, - 70162 => true, - 70279 => true, - 70281 => true, - 70286 => true, - 70302 => true, - 70314 => true, - 70315 => true, - 70316 => true, - 70317 => true, - 70318 => true, - 70319 => true, - 70379 => true, - 70380 => true, - 70381 => true, - 70382 => true, - 70383 => true, - 70394 => true, - 70395 => true, - 70396 => true, - 70397 => true, - 70398 => true, - 70399 => true, - 70404 => true, - 70413 => true, - 70414 => true, - 70417 => true, - 70418 => true, - 70441 => true, - 70449 => true, - 70452 => true, - 70458 => true, - 70469 => true, - 70470 => true, - 70473 => true, - 70474 => true, - 70478 => true, - 70479 => true, - 70481 => true, - 70482 => true, - 70483 => true, - 70484 => true, - 70485 => true, - 70486 => true, - 70488 => true, - 70489 => true, - 70490 => true, - 70491 => true, - 70492 => true, - 70500 => true, - 70501 => true, - 70509 => true, - 70510 => true, - 70511 => true, - 70748 => true, - 70754 => true, - 70755 => true, - 70756 => true, - 70757 => true, - 70758 => true, - 70759 => true, - 70760 => true, - 70761 => true, - 70762 => true, - 70763 => true, - 70764 => true, - 70765 => true, - 70766 => true, - 70767 => true, - 70768 => true, - 70769 => true, - 70770 => true, - 70771 => true, - 70772 => true, - 70773 => true, - 70774 => true, - 70775 => true, - 70776 => true, - 70777 => true, - 70778 => true, - 70779 => true, - 70780 => true, - 70781 => true, - 70782 => true, - 70783 => true, - 70856 => true, - 70857 => true, - 70858 => true, - 70859 => true, - 70860 => true, - 70861 => true, - 70862 => true, - 70863 => true, - 71094 => true, - 71095 => true, - 71237 => true, - 71238 => true, - 71239 => true, - 71240 => true, - 71241 => true, - 71242 => true, - 71243 => true, - 71244 => true, - 71245 => true, - 71246 => true, - 71247 => true, - 71258 => true, - 71259 => true, - 71260 => true, - 71261 => true, - 71262 => true, - 71263 => true, - 71277 => true, - 71278 => true, - 71279 => true, - 71280 => true, - 71281 => true, - 71282 => true, - 71283 => true, - 71284 => true, - 71285 => true, - 71286 => true, - 71287 => true, - 71288 => true, - 71289 => true, - 71290 => true, - 71291 => true, - 71292 => true, - 71293 => true, - 71294 => true, - 71295 => true, - 71353 => true, - 71354 => true, - 71355 => true, - 71356 => true, - 71357 => true, - 71358 => true, - 71359 => true, - 71451 => true, - 71452 => true, - 71468 => true, - 71469 => true, - 71470 => true, - 71471 => true, - 71923 => true, - 71924 => true, - 71925 => true, - 71926 => true, - 71927 => true, - 71928 => true, - 71929 => true, - 71930 => true, - 71931 => true, - 71932 => true, - 71933 => true, - 71934 => true, - 71943 => true, - 71944 => true, - 71946 => true, - 71947 => true, - 71956 => true, - 71959 => true, - 71990 => true, - 71993 => true, - 71994 => true, - 72007 => true, - 72008 => true, - 72009 => true, - 72010 => true, - 72011 => true, - 72012 => true, - 72013 => true, - 72014 => true, - 72015 => true, - 72104 => true, - 72105 => true, - 72152 => true, - 72153 => true, - 72165 => true, - 72166 => true, - 72167 => true, - 72168 => true, - 72169 => true, - 72170 => true, - 72171 => true, - 72172 => true, - 72173 => true, - 72174 => true, - 72175 => true, - 72176 => true, - 72177 => true, - 72178 => true, - 72179 => true, - 72180 => true, - 72181 => true, - 72182 => true, - 72183 => true, - 72184 => true, - 72185 => true, - 72186 => true, - 72187 => true, - 72188 => true, - 72189 => true, - 72190 => true, - 72191 => true, - 72264 => true, - 72265 => true, - 72266 => true, - 72267 => true, - 72268 => true, - 72269 => true, - 72270 => true, - 72271 => true, - 72355 => true, - 72356 => true, - 72357 => true, - 72358 => true, - 72359 => true, - 72360 => true, - 72361 => true, - 72362 => true, - 72363 => true, - 72364 => true, - 72365 => true, - 72366 => true, - 72367 => true, - 72368 => true, - 72369 => true, - 72370 => true, - 72371 => true, - 72372 => true, - 72373 => true, - 72374 => true, - 72375 => true, - 72376 => true, - 72377 => true, - 72378 => true, - 72379 => true, - 72380 => true, - 72381 => true, - 72382 => true, - 72383 => true, - 72713 => true, - 72759 => true, - 72774 => true, - 72775 => true, - 72776 => true, - 72777 => true, - 72778 => true, - 72779 => true, - 72780 => true, - 72781 => true, - 72782 => true, - 72783 => true, - 72813 => true, - 72814 => true, - 72815 => true, - 72848 => true, - 72849 => true, - 72872 => true, - 72967 => true, - 72970 => true, - 73015 => true, - 73016 => true, - 73017 => true, - 73019 => true, - 73022 => true, - 73032 => true, - 73033 => true, - 73034 => true, - 73035 => true, - 73036 => true, - 73037 => true, - 73038 => true, - 73039 => true, - 73050 => true, - 73051 => true, - 73052 => true, - 73053 => true, - 73054 => true, - 73055 => true, - 73062 => true, - 73065 => true, - 73103 => true, - 73106 => true, - 73113 => true, - 73114 => true, - 73115 => true, - 73116 => true, - 73117 => true, - 73118 => true, - 73119 => true, - 73649 => true, - 73650 => true, - 73651 => true, - 73652 => true, - 73653 => true, - 73654 => true, - 73655 => true, - 73656 => true, - 73657 => true, - 73658 => true, - 73659 => true, - 73660 => true, - 73661 => true, - 73662 => true, - 73663 => true, - 73714 => true, - 73715 => true, - 73716 => true, - 73717 => true, - 73718 => true, - 73719 => true, - 73720 => true, - 73721 => true, - 73722 => true, - 73723 => true, - 73724 => true, - 73725 => true, - 73726 => true, - 74863 => true, - 74869 => true, - 74870 => true, - 74871 => true, - 74872 => true, - 74873 => true, - 74874 => true, - 74875 => true, - 74876 => true, - 74877 => true, - 74878 => true, - 74879 => true, - 78895 => true, - 78896 => true, - 78897 => true, - 78898 => true, - 78899 => true, - 78900 => true, - 78901 => true, - 78902 => true, - 78903 => true, - 78904 => true, - 92729 => true, - 92730 => true, - 92731 => true, - 92732 => true, - 92733 => true, - 92734 => true, - 92735 => true, - 92767 => true, - 92778 => true, - 92779 => true, - 92780 => true, - 92781 => true, - 92910 => true, - 92911 => true, - 92918 => true, - 92919 => true, - 92920 => true, - 92921 => true, - 92922 => true, - 92923 => true, - 92924 => true, - 92925 => true, - 92926 => true, - 92927 => true, - 92998 => true, - 92999 => true, - 93000 => true, - 93001 => true, - 93002 => true, - 93003 => true, - 93004 => true, - 93005 => true, - 93006 => true, - 93007 => true, - 93018 => true, - 93026 => true, - 93048 => true, - 93049 => true, - 93050 => true, - 93051 => true, - 93052 => true, - 94027 => true, - 94028 => true, - 94029 => true, - 94030 => true, - 94088 => true, - 94089 => true, - 94090 => true, - 94091 => true, - 94092 => true, - 94093 => true, - 94094 => true, - 94181 => true, - 94182 => true, - 94183 => true, - 94184 => true, - 94185 => true, - 94186 => true, - 94187 => true, - 94188 => true, - 94189 => true, - 94190 => true, - 94191 => true, - 94194 => true, - 94195 => true, - 94196 => true, - 94197 => true, - 94198 => true, - 94199 => true, - 94200 => true, - 94201 => true, - 94202 => true, - 94203 => true, - 94204 => true, - 94205 => true, - 94206 => true, - 94207 => true, - 100344 => true, - 100345 => true, - 100346 => true, - 100347 => true, - 100348 => true, - 100349 => true, - 100350 => true, - 100351 => true, - 110931 => true, - 110932 => true, - 110933 => true, - 110934 => true, - 110935 => true, - 110936 => true, - 110937 => true, - 110938 => true, - 110939 => true, - 110940 => true, - 110941 => true, - 110942 => true, - 110943 => true, - 110944 => true, - 110945 => true, - 110946 => true, - 110947 => true, - 110952 => true, - 110953 => true, - 110954 => true, - 110955 => true, - 110956 => true, - 110957 => true, - 110958 => true, - 110959 => true, - 113771 => true, - 113772 => true, - 113773 => true, - 113774 => true, - 113775 => true, - 113789 => true, - 113790 => true, - 113791 => true, - 113801 => true, - 113802 => true, - 113803 => true, - 113804 => true, - 113805 => true, - 113806 => true, - 113807 => true, - 113818 => true, - 113819 => true, - 119030 => true, - 119031 => true, - 119032 => true, - 119033 => true, - 119034 => true, - 119035 => true, - 119036 => true, - 119037 => true, - 119038 => true, - 119039 => true, - 119079 => true, - 119080 => true, - 119155 => true, - 119156 => true, - 119157 => true, - 119158 => true, - 119159 => true, - 119160 => true, - 119161 => true, - 119162 => true, - 119273 => true, - 119274 => true, - 119275 => true, - 119276 => true, - 119277 => true, - 119278 => true, - 119279 => true, - 119280 => true, - 119281 => true, - 119282 => true, - 119283 => true, - 119284 => true, - 119285 => true, - 119286 => true, - 119287 => true, - 119288 => true, - 119289 => true, - 119290 => true, - 119291 => true, - 119292 => true, - 119293 => true, - 119294 => true, - 119295 => true, - 119540 => true, - 119541 => true, - 119542 => true, - 119543 => true, - 119544 => true, - 119545 => true, - 119546 => true, - 119547 => true, - 119548 => true, - 119549 => true, - 119550 => true, - 119551 => true, - 119639 => true, - 119640 => true, - 119641 => true, - 119642 => true, - 119643 => true, - 119644 => true, - 119645 => true, - 119646 => true, - 119647 => true, - 119893 => true, - 119965 => true, - 119968 => true, - 119969 => true, - 119971 => true, - 119972 => true, - 119975 => true, - 119976 => true, - 119981 => true, - 119994 => true, - 119996 => true, - 120004 => true, - 120070 => true, - 120075 => true, - 120076 => true, - 120085 => true, - 120093 => true, - 120122 => true, - 120127 => true, - 120133 => true, - 120135 => true, - 120136 => true, - 120137 => true, - 120145 => true, - 120486 => true, - 120487 => true, - 120780 => true, - 120781 => true, - 121484 => true, - 121485 => true, - 121486 => true, - 121487 => true, - 121488 => true, - 121489 => true, - 121490 => true, - 121491 => true, - 121492 => true, - 121493 => true, - 121494 => true, - 121495 => true, - 121496 => true, - 121497 => true, - 121498 => true, - 121504 => true, - 122887 => true, - 122905 => true, - 122906 => true, - 122914 => true, - 122917 => true, - 123181 => true, - 123182 => true, - 123183 => true, - 123198 => true, - 123199 => true, - 123210 => true, - 123211 => true, - 123212 => true, - 123213 => true, - 123642 => true, - 123643 => true, - 123644 => true, - 123645 => true, - 123646 => true, - 125125 => true, - 125126 => true, - 125260 => true, - 125261 => true, - 125262 => true, - 125263 => true, - 125274 => true, - 125275 => true, - 125276 => true, - 125277 => true, - 126468 => true, - 126496 => true, - 126499 => true, - 126501 => true, - 126502 => true, - 126504 => true, - 126515 => true, - 126520 => true, - 126522 => true, - 126524 => true, - 126525 => true, - 126526 => true, - 126527 => true, - 126528 => true, - 126529 => true, - 126531 => true, - 126532 => true, - 126533 => true, - 126534 => true, - 126536 => true, - 126538 => true, - 126540 => true, - 126544 => true, - 126547 => true, - 126549 => true, - 126550 => true, - 126552 => true, - 126554 => true, - 126556 => true, - 126558 => true, - 126560 => true, - 126563 => true, - 126565 => true, - 126566 => true, - 126571 => true, - 126579 => true, - 126584 => true, - 126589 => true, - 126591 => true, - 126602 => true, - 126620 => true, - 126621 => true, - 126622 => true, - 126623 => true, - 126624 => true, - 126628 => true, - 126634 => true, - 127020 => true, - 127021 => true, - 127022 => true, - 127023 => true, - 127124 => true, - 127125 => true, - 127126 => true, - 127127 => true, - 127128 => true, - 127129 => true, - 127130 => true, - 127131 => true, - 127132 => true, - 127133 => true, - 127134 => true, - 127135 => true, - 127151 => true, - 127152 => true, - 127168 => true, - 127184 => true, - 127222 => true, - 127223 => true, - 127224 => true, - 127225 => true, - 127226 => true, - 127227 => true, - 127228 => true, - 127229 => true, - 127230 => true, - 127231 => true, - 127232 => true, - 127491 => true, - 127492 => true, - 127493 => true, - 127494 => true, - 127495 => true, - 127496 => true, - 127497 => true, - 127498 => true, - 127499 => true, - 127500 => true, - 127501 => true, - 127502 => true, - 127503 => true, - 127548 => true, - 127549 => true, - 127550 => true, - 127551 => true, - 127561 => true, - 127562 => true, - 127563 => true, - 127564 => true, - 127565 => true, - 127566 => true, - 127567 => true, - 127570 => true, - 127571 => true, - 127572 => true, - 127573 => true, - 127574 => true, - 127575 => true, - 127576 => true, - 127577 => true, - 127578 => true, - 127579 => true, - 127580 => true, - 127581 => true, - 127582 => true, - 127583 => true, - 128728 => true, - 128729 => true, - 128730 => true, - 128731 => true, - 128732 => true, - 128733 => true, - 128734 => true, - 128735 => true, - 128749 => true, - 128750 => true, - 128751 => true, - 128765 => true, - 128766 => true, - 128767 => true, - 128884 => true, - 128885 => true, - 128886 => true, - 128887 => true, - 128888 => true, - 128889 => true, - 128890 => true, - 128891 => true, - 128892 => true, - 128893 => true, - 128894 => true, - 128895 => true, - 128985 => true, - 128986 => true, - 128987 => true, - 128988 => true, - 128989 => true, - 128990 => true, - 128991 => true, - 129004 => true, - 129005 => true, - 129006 => true, - 129007 => true, - 129008 => true, - 129009 => true, - 129010 => true, - 129011 => true, - 129012 => true, - 129013 => true, - 129014 => true, - 129015 => true, - 129016 => true, - 129017 => true, - 129018 => true, - 129019 => true, - 129020 => true, - 129021 => true, - 129022 => true, - 129023 => true, - 129036 => true, - 129037 => true, - 129038 => true, - 129039 => true, - 129096 => true, - 129097 => true, - 129098 => true, - 129099 => true, - 129100 => true, - 129101 => true, - 129102 => true, - 129103 => true, - 129114 => true, - 129115 => true, - 129116 => true, - 129117 => true, - 129118 => true, - 129119 => true, - 129160 => true, - 129161 => true, - 129162 => true, - 129163 => true, - 129164 => true, - 129165 => true, - 129166 => true, - 129167 => true, - 129198 => true, - 129199 => true, - 129401 => true, - 129484 => true, - 129620 => true, - 129621 => true, - 129622 => true, - 129623 => true, - 129624 => true, - 129625 => true, - 129626 => true, - 129627 => true, - 129628 => true, - 129629 => true, - 129630 => true, - 129631 => true, - 129646 => true, - 129647 => true, - 129653 => true, - 129654 => true, - 129655 => true, - 129659 => true, - 129660 => true, - 129661 => true, - 129662 => true, - 129663 => true, - 129671 => true, - 129672 => true, - 129673 => true, - 129674 => true, - 129675 => true, - 129676 => true, - 129677 => true, - 129678 => true, - 129679 => true, - 129705 => true, - 129706 => true, - 129707 => true, - 129708 => true, - 129709 => true, - 129710 => true, - 129711 => true, - 129719 => true, - 129720 => true, - 129721 => true, - 129722 => true, - 129723 => true, - 129724 => true, - 129725 => true, - 129726 => true, - 129727 => true, - 129731 => true, - 129732 => true, - 129733 => true, - 129734 => true, - 129735 => true, - 129736 => true, - 129737 => true, - 129738 => true, - 129739 => true, - 129740 => true, - 129741 => true, - 129742 => true, - 129743 => true, - 129939 => true, - 131070 => true, - 131071 => true, - 177973 => true, - 177974 => true, - 177975 => true, - 177976 => true, - 177977 => true, - 177978 => true, - 177979 => true, - 177980 => true, - 177981 => true, - 177982 => true, - 177983 => true, - 178206 => true, - 178207 => true, - 183970 => true, - 183971 => true, - 183972 => true, - 183973 => true, - 183974 => true, - 183975 => true, - 183976 => true, - 183977 => true, - 183978 => true, - 183979 => true, - 183980 => true, - 183981 => true, - 183982 => true, - 183983 => true, - 194664 => true, - 194676 => true, - 194847 => true, - 194911 => true, - 195007 => true, - 196606 => true, - 196607 => true, - 262142 => true, - 262143 => true, - 327678 => true, - 327679 => true, - 393214 => true, - 393215 => true, - 458750 => true, - 458751 => true, - 524286 => true, - 524287 => true, - 589822 => true, - 589823 => true, - 655358 => true, - 655359 => true, - 720894 => true, - 720895 => true, - 786430 => true, - 786431 => true, - 851966 => true, - 851967 => true, - 917502 => true, - 917503 => true, - 917504 => true, - 917505 => true, - 917506 => true, - 917507 => true, - 917508 => true, - 917509 => true, - 917510 => true, - 917511 => true, - 917512 => true, - 917513 => true, - 917514 => true, - 917515 => true, - 917516 => true, - 917517 => true, - 917518 => true, - 917519 => true, - 917520 => true, - 917521 => true, - 917522 => true, - 917523 => true, - 917524 => true, - 917525 => true, - 917526 => true, - 917527 => true, - 917528 => true, - 917529 => true, - 917530 => true, - 917531 => true, - 917532 => true, - 917533 => true, - 917534 => true, - 917535 => true, - 983038 => true, - 983039 => true, - 1048574 => true, - 1048575 => true, - 1114110 => true, - 1114111 => true, -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php deleted file mode 100644 index 54f21cc..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php +++ /dev/null @@ -1,308 +0,0 @@ - ' ', - 168 => ' ̈', - 175 => ' ̄', - 180 => ' ́', - 184 => ' ̧', - 728 => ' ̆', - 729 => ' ̇', - 730 => ' ̊', - 731 => ' ̨', - 732 => ' ̃', - 733 => ' ̋', - 890 => ' ι', - 894 => ';', - 900 => ' ́', - 901 => ' ̈́', - 8125 => ' ̓', - 8127 => ' ̓', - 8128 => ' ͂', - 8129 => ' ̈͂', - 8141 => ' ̓̀', - 8142 => ' ̓́', - 8143 => ' ̓͂', - 8157 => ' ̔̀', - 8158 => ' ̔́', - 8159 => ' ̔͂', - 8173 => ' ̈̀', - 8174 => ' ̈́', - 8175 => '`', - 8189 => ' ́', - 8190 => ' ̔', - 8192 => ' ', - 8193 => ' ', - 8194 => ' ', - 8195 => ' ', - 8196 => ' ', - 8197 => ' ', - 8198 => ' ', - 8199 => ' ', - 8200 => ' ', - 8201 => ' ', - 8202 => ' ', - 8215 => ' ̳', - 8239 => ' ', - 8252 => '!!', - 8254 => ' ̅', - 8263 => '??', - 8264 => '?!', - 8265 => '!?', - 8287 => ' ', - 8314 => '+', - 8316 => '=', - 8317 => '(', - 8318 => ')', - 8330 => '+', - 8332 => '=', - 8333 => '(', - 8334 => ')', - 8448 => 'a/c', - 8449 => 'a/s', - 8453 => 'c/o', - 8454 => 'c/u', - 9332 => '(1)', - 9333 => '(2)', - 9334 => '(3)', - 9335 => '(4)', - 9336 => '(5)', - 9337 => '(6)', - 9338 => '(7)', - 9339 => '(8)', - 9340 => '(9)', - 9341 => '(10)', - 9342 => '(11)', - 9343 => '(12)', - 9344 => '(13)', - 9345 => '(14)', - 9346 => '(15)', - 9347 => '(16)', - 9348 => '(17)', - 9349 => '(18)', - 9350 => '(19)', - 9351 => '(20)', - 9372 => '(a)', - 9373 => '(b)', - 9374 => '(c)', - 9375 => '(d)', - 9376 => '(e)', - 9377 => '(f)', - 9378 => '(g)', - 9379 => '(h)', - 9380 => '(i)', - 9381 => '(j)', - 9382 => '(k)', - 9383 => '(l)', - 9384 => '(m)', - 9385 => '(n)', - 9386 => '(o)', - 9387 => '(p)', - 9388 => '(q)', - 9389 => '(r)', - 9390 => '(s)', - 9391 => '(t)', - 9392 => '(u)', - 9393 => '(v)', - 9394 => '(w)', - 9395 => '(x)', - 9396 => '(y)', - 9397 => '(z)', - 10868 => '::=', - 10869 => '==', - 10870 => '===', - 12288 => ' ', - 12443 => ' ゙', - 12444 => ' ゚', - 12800 => '(ᄀ)', - 12801 => '(ᄂ)', - 12802 => '(ᄃ)', - 12803 => '(ᄅ)', - 12804 => '(ᄆ)', - 12805 => '(ᄇ)', - 12806 => '(ᄉ)', - 12807 => '(ᄋ)', - 12808 => '(ᄌ)', - 12809 => '(ᄎ)', - 12810 => '(ᄏ)', - 12811 => '(ᄐ)', - 12812 => '(ᄑ)', - 12813 => '(ᄒ)', - 12814 => '(가)', - 12815 => '(나)', - 12816 => '(다)', - 12817 => '(라)', - 12818 => '(마)', - 12819 => '(바)', - 12820 => '(사)', - 12821 => '(아)', - 12822 => '(자)', - 12823 => '(차)', - 12824 => '(카)', - 12825 => '(타)', - 12826 => '(파)', - 12827 => '(하)', - 12828 => '(주)', - 12829 => '(오전)', - 12830 => '(오후)', - 12832 => '(一)', - 12833 => '(二)', - 12834 => '(三)', - 12835 => '(四)', - 12836 => '(五)', - 12837 => '(六)', - 12838 => '(七)', - 12839 => '(八)', - 12840 => '(九)', - 12841 => '(十)', - 12842 => '(月)', - 12843 => '(火)', - 12844 => '(水)', - 12845 => '(木)', - 12846 => '(金)', - 12847 => '(土)', - 12848 => '(日)', - 12849 => '(株)', - 12850 => '(有)', - 12851 => '(社)', - 12852 => '(名)', - 12853 => '(特)', - 12854 => '(財)', - 12855 => '(祝)', - 12856 => '(労)', - 12857 => '(代)', - 12858 => '(呼)', - 12859 => '(学)', - 12860 => '(監)', - 12861 => '(企)', - 12862 => '(資)', - 12863 => '(協)', - 12864 => '(祭)', - 12865 => '(休)', - 12866 => '(自)', - 12867 => '(至)', - 64297 => '+', - 64606 => ' ٌّ', - 64607 => ' ٍّ', - 64608 => ' َّ', - 64609 => ' ُّ', - 64610 => ' ِّ', - 64611 => ' ّٰ', - 65018 => 'صلى الله عليه وسلم', - 65019 => 'جل جلاله', - 65040 => ',', - 65043 => ':', - 65044 => ';', - 65045 => '!', - 65046 => '?', - 65075 => '_', - 65076 => '_', - 65077 => '(', - 65078 => ')', - 65079 => '{', - 65080 => '}', - 65095 => '[', - 65096 => ']', - 65097 => ' ̅', - 65098 => ' ̅', - 65099 => ' ̅', - 65100 => ' ̅', - 65101 => '_', - 65102 => '_', - 65103 => '_', - 65104 => ',', - 65108 => ';', - 65109 => ':', - 65110 => '?', - 65111 => '!', - 65113 => '(', - 65114 => ')', - 65115 => '{', - 65116 => '}', - 65119 => '#', - 65120 => '&', - 65121 => '*', - 65122 => '+', - 65124 => '<', - 65125 => '>', - 65126 => '=', - 65128 => '\\', - 65129 => '$', - 65130 => '%', - 65131 => '@', - 65136 => ' ً', - 65138 => ' ٌ', - 65140 => ' ٍ', - 65142 => ' َ', - 65144 => ' ُ', - 65146 => ' ِ', - 65148 => ' ّ', - 65150 => ' ْ', - 65281 => '!', - 65282 => '"', - 65283 => '#', - 65284 => '$', - 65285 => '%', - 65286 => '&', - 65287 => '\'', - 65288 => '(', - 65289 => ')', - 65290 => '*', - 65291 => '+', - 65292 => ',', - 65295 => '/', - 65306 => ':', - 65307 => ';', - 65308 => '<', - 65309 => '=', - 65310 => '>', - 65311 => '?', - 65312 => '@', - 65339 => '[', - 65340 => '\\', - 65341 => ']', - 65342 => '^', - 65343 => '_', - 65344 => '`', - 65371 => '{', - 65372 => '|', - 65373 => '}', - 65374 => '~', - 65507 => ' ̄', - 127233 => '0,', - 127234 => '1,', - 127235 => '2,', - 127236 => '3,', - 127237 => '4,', - 127238 => '5,', - 127239 => '6,', - 127240 => '7,', - 127241 => '8,', - 127242 => '9,', - 127248 => '(a)', - 127249 => '(b)', - 127250 => '(c)', - 127251 => '(d)', - 127252 => '(e)', - 127253 => '(f)', - 127254 => '(g)', - 127255 => '(h)', - 127256 => '(i)', - 127257 => '(j)', - 127258 => '(k)', - 127259 => '(l)', - 127260 => '(m)', - 127261 => '(n)', - 127262 => '(o)', - 127263 => '(p)', - 127264 => '(q)', - 127265 => '(r)', - 127266 => '(s)', - 127267 => '(t)', - 127268 => '(u)', - 127269 => '(v)', - 127270 => '(w)', - 127271 => '(x)', - 127272 => '(y)', - 127273 => '(z)', -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php deleted file mode 100644 index 223396e..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php +++ /dev/null @@ -1,71 +0,0 @@ - true, - 1 => true, - 2 => true, - 3 => true, - 4 => true, - 5 => true, - 6 => true, - 7 => true, - 8 => true, - 9 => true, - 10 => true, - 11 => true, - 12 => true, - 13 => true, - 14 => true, - 15 => true, - 16 => true, - 17 => true, - 18 => true, - 19 => true, - 20 => true, - 21 => true, - 22 => true, - 23 => true, - 24 => true, - 25 => true, - 26 => true, - 27 => true, - 28 => true, - 29 => true, - 30 => true, - 31 => true, - 32 => true, - 33 => true, - 34 => true, - 35 => true, - 36 => true, - 37 => true, - 38 => true, - 39 => true, - 40 => true, - 41 => true, - 42 => true, - 43 => true, - 44 => true, - 47 => true, - 58 => true, - 59 => true, - 60 => true, - 61 => true, - 62 => true, - 63 => true, - 64 => true, - 91 => true, - 92 => true, - 93 => true, - 94 => true, - 95 => true, - 96 => true, - 123 => true, - 124 => true, - 125 => true, - 126 => true, - 127 => true, - 8800 => true, - 8814 => true, - 8815 => true, -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php deleted file mode 100644 index b377844..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php +++ /dev/null @@ -1,273 +0,0 @@ - true, - 847 => true, - 6155 => true, - 6156 => true, - 6157 => true, - 8203 => true, - 8288 => true, - 8292 => true, - 65024 => true, - 65025 => true, - 65026 => true, - 65027 => true, - 65028 => true, - 65029 => true, - 65030 => true, - 65031 => true, - 65032 => true, - 65033 => true, - 65034 => true, - 65035 => true, - 65036 => true, - 65037 => true, - 65038 => true, - 65039 => true, - 65279 => true, - 113824 => true, - 113825 => true, - 113826 => true, - 113827 => true, - 917760 => true, - 917761 => true, - 917762 => true, - 917763 => true, - 917764 => true, - 917765 => true, - 917766 => true, - 917767 => true, - 917768 => true, - 917769 => true, - 917770 => true, - 917771 => true, - 917772 => true, - 917773 => true, - 917774 => true, - 917775 => true, - 917776 => true, - 917777 => true, - 917778 => true, - 917779 => true, - 917780 => true, - 917781 => true, - 917782 => true, - 917783 => true, - 917784 => true, - 917785 => true, - 917786 => true, - 917787 => true, - 917788 => true, - 917789 => true, - 917790 => true, - 917791 => true, - 917792 => true, - 917793 => true, - 917794 => true, - 917795 => true, - 917796 => true, - 917797 => true, - 917798 => true, - 917799 => true, - 917800 => true, - 917801 => true, - 917802 => true, - 917803 => true, - 917804 => true, - 917805 => true, - 917806 => true, - 917807 => true, - 917808 => true, - 917809 => true, - 917810 => true, - 917811 => true, - 917812 => true, - 917813 => true, - 917814 => true, - 917815 => true, - 917816 => true, - 917817 => true, - 917818 => true, - 917819 => true, - 917820 => true, - 917821 => true, - 917822 => true, - 917823 => true, - 917824 => true, - 917825 => true, - 917826 => true, - 917827 => true, - 917828 => true, - 917829 => true, - 917830 => true, - 917831 => true, - 917832 => true, - 917833 => true, - 917834 => true, - 917835 => true, - 917836 => true, - 917837 => true, - 917838 => true, - 917839 => true, - 917840 => true, - 917841 => true, - 917842 => true, - 917843 => true, - 917844 => true, - 917845 => true, - 917846 => true, - 917847 => true, - 917848 => true, - 917849 => true, - 917850 => true, - 917851 => true, - 917852 => true, - 917853 => true, - 917854 => true, - 917855 => true, - 917856 => true, - 917857 => true, - 917858 => true, - 917859 => true, - 917860 => true, - 917861 => true, - 917862 => true, - 917863 => true, - 917864 => true, - 917865 => true, - 917866 => true, - 917867 => true, - 917868 => true, - 917869 => true, - 917870 => true, - 917871 => true, - 917872 => true, - 917873 => true, - 917874 => true, - 917875 => true, - 917876 => true, - 917877 => true, - 917878 => true, - 917879 => true, - 917880 => true, - 917881 => true, - 917882 => true, - 917883 => true, - 917884 => true, - 917885 => true, - 917886 => true, - 917887 => true, - 917888 => true, - 917889 => true, - 917890 => true, - 917891 => true, - 917892 => true, - 917893 => true, - 917894 => true, - 917895 => true, - 917896 => true, - 917897 => true, - 917898 => true, - 917899 => true, - 917900 => true, - 917901 => true, - 917902 => true, - 917903 => true, - 917904 => true, - 917905 => true, - 917906 => true, - 917907 => true, - 917908 => true, - 917909 => true, - 917910 => true, - 917911 => true, - 917912 => true, - 917913 => true, - 917914 => true, - 917915 => true, - 917916 => true, - 917917 => true, - 917918 => true, - 917919 => true, - 917920 => true, - 917921 => true, - 917922 => true, - 917923 => true, - 917924 => true, - 917925 => true, - 917926 => true, - 917927 => true, - 917928 => true, - 917929 => true, - 917930 => true, - 917931 => true, - 917932 => true, - 917933 => true, - 917934 => true, - 917935 => true, - 917936 => true, - 917937 => true, - 917938 => true, - 917939 => true, - 917940 => true, - 917941 => true, - 917942 => true, - 917943 => true, - 917944 => true, - 917945 => true, - 917946 => true, - 917947 => true, - 917948 => true, - 917949 => true, - 917950 => true, - 917951 => true, - 917952 => true, - 917953 => true, - 917954 => true, - 917955 => true, - 917956 => true, - 917957 => true, - 917958 => true, - 917959 => true, - 917960 => true, - 917961 => true, - 917962 => true, - 917963 => true, - 917964 => true, - 917965 => true, - 917966 => true, - 917967 => true, - 917968 => true, - 917969 => true, - 917970 => true, - 917971 => true, - 917972 => true, - 917973 => true, - 917974 => true, - 917975 => true, - 917976 => true, - 917977 => true, - 917978 => true, - 917979 => true, - 917980 => true, - 917981 => true, - 917982 => true, - 917983 => true, - 917984 => true, - 917985 => true, - 917986 => true, - 917987 => true, - 917988 => true, - 917989 => true, - 917990 => true, - 917991 => true, - 917992 => true, - 917993 => true, - 917994 => true, - 917995 => true, - 917996 => true, - 917997 => true, - 917998 => true, - 917999 => true, -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php deleted file mode 100644 index 9b85fe9..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php +++ /dev/null @@ -1,5778 +0,0 @@ - 'a', - 66 => 'b', - 67 => 'c', - 68 => 'd', - 69 => 'e', - 70 => 'f', - 71 => 'g', - 72 => 'h', - 73 => 'i', - 74 => 'j', - 75 => 'k', - 76 => 'l', - 77 => 'm', - 78 => 'n', - 79 => 'o', - 80 => 'p', - 81 => 'q', - 82 => 'r', - 83 => 's', - 84 => 't', - 85 => 'u', - 86 => 'v', - 87 => 'w', - 88 => 'x', - 89 => 'y', - 90 => 'z', - 170 => 'a', - 178 => '2', - 179 => '3', - 181 => 'μ', - 185 => '1', - 186 => 'o', - 188 => '1⁄4', - 189 => '1⁄2', - 190 => '3⁄4', - 192 => 'à', - 193 => 'á', - 194 => 'â', - 195 => 'ã', - 196 => 'ä', - 197 => 'å', - 198 => 'æ', - 199 => 'ç', - 200 => 'è', - 201 => 'é', - 202 => 'ê', - 203 => 'ë', - 204 => 'ì', - 205 => 'í', - 206 => 'î', - 207 => 'ï', - 208 => 'ð', - 209 => 'ñ', - 210 => 'ò', - 211 => 'ó', - 212 => 'ô', - 213 => 'õ', - 214 => 'ö', - 216 => 'ø', - 217 => 'ù', - 218 => 'ú', - 219 => 'û', - 220 => 'ü', - 221 => 'ý', - 222 => 'þ', - 256 => 'ā', - 258 => 'ă', - 260 => 'ą', - 262 => 'ć', - 264 => 'ĉ', - 266 => 'ċ', - 268 => 'č', - 270 => 'ď', - 272 => 'đ', - 274 => 'ē', - 276 => 'ĕ', - 278 => 'ė', - 280 => 'ę', - 282 => 'ě', - 284 => 'ĝ', - 286 => 'ğ', - 288 => 'ġ', - 290 => 'ģ', - 292 => 'ĥ', - 294 => 'ħ', - 296 => 'ĩ', - 298 => 'ī', - 300 => 'ĭ', - 302 => 'į', - 304 => 'i̇', - 306 => 'ij', - 307 => 'ij', - 308 => 'ĵ', - 310 => 'ķ', - 313 => 'ĺ', - 315 => 'ļ', - 317 => 'ľ', - 319 => 'l·', - 320 => 'l·', - 321 => 'ł', - 323 => 'ń', - 325 => 'ņ', - 327 => 'ň', - 329 => 'ʼn', - 330 => 'ŋ', - 332 => 'ō', - 334 => 'ŏ', - 336 => 'ő', - 338 => 'œ', - 340 => 'ŕ', - 342 => 'ŗ', - 344 => 'ř', - 346 => 'ś', - 348 => 'ŝ', - 350 => 'ş', - 352 => 'š', - 354 => 'ţ', - 356 => 'ť', - 358 => 'ŧ', - 360 => 'ũ', - 362 => 'ū', - 364 => 'ŭ', - 366 => 'ů', - 368 => 'ű', - 370 => 'ų', - 372 => 'ŵ', - 374 => 'ŷ', - 376 => 'ÿ', - 377 => 'ź', - 379 => 'ż', - 381 => 'ž', - 383 => 's', - 385 => 'ɓ', - 386 => 'ƃ', - 388 => 'ƅ', - 390 => 'ɔ', - 391 => 'ƈ', - 393 => 'ɖ', - 394 => 'ɗ', - 395 => 'ƌ', - 398 => 'ǝ', - 399 => 'ə', - 400 => 'ɛ', - 401 => 'ƒ', - 403 => 'ɠ', - 404 => 'ɣ', - 406 => 'ɩ', - 407 => 'ɨ', - 408 => 'ƙ', - 412 => 'ɯ', - 413 => 'ɲ', - 415 => 'ɵ', - 416 => 'ơ', - 418 => 'ƣ', - 420 => 'ƥ', - 422 => 'ʀ', - 423 => 'ƨ', - 425 => 'ʃ', - 428 => 'ƭ', - 430 => 'ʈ', - 431 => 'ư', - 433 => 'ʊ', - 434 => 'ʋ', - 435 => 'ƴ', - 437 => 'ƶ', - 439 => 'ʒ', - 440 => 'ƹ', - 444 => 'ƽ', - 452 => 'dž', - 453 => 'dž', - 454 => 'dž', - 455 => 'lj', - 456 => 'lj', - 457 => 'lj', - 458 => 'nj', - 459 => 'nj', - 460 => 'nj', - 461 => 'ǎ', - 463 => 'ǐ', - 465 => 'ǒ', - 467 => 'ǔ', - 469 => 'ǖ', - 471 => 'ǘ', - 473 => 'ǚ', - 475 => 'ǜ', - 478 => 'ǟ', - 480 => 'ǡ', - 482 => 'ǣ', - 484 => 'ǥ', - 486 => 'ǧ', - 488 => 'ǩ', - 490 => 'ǫ', - 492 => 'ǭ', - 494 => 'ǯ', - 497 => 'dz', - 498 => 'dz', - 499 => 'dz', - 500 => 'ǵ', - 502 => 'ƕ', - 503 => 'ƿ', - 504 => 'ǹ', - 506 => 'ǻ', - 508 => 'ǽ', - 510 => 'ǿ', - 512 => 'ȁ', - 514 => 'ȃ', - 516 => 'ȅ', - 518 => 'ȇ', - 520 => 'ȉ', - 522 => 'ȋ', - 524 => 'ȍ', - 526 => 'ȏ', - 528 => 'ȑ', - 530 => 'ȓ', - 532 => 'ȕ', - 534 => 'ȗ', - 536 => 'ș', - 538 => 'ț', - 540 => 'ȝ', - 542 => 'ȟ', - 544 => 'ƞ', - 546 => 'ȣ', - 548 => 'ȥ', - 550 => 'ȧ', - 552 => 'ȩ', - 554 => 'ȫ', - 556 => 'ȭ', - 558 => 'ȯ', - 560 => 'ȱ', - 562 => 'ȳ', - 570 => 'ⱥ', - 571 => 'ȼ', - 573 => 'ƚ', - 574 => 'ⱦ', - 577 => 'ɂ', - 579 => 'ƀ', - 580 => 'ʉ', - 581 => 'ʌ', - 582 => 'ɇ', - 584 => 'ɉ', - 586 => 'ɋ', - 588 => 'ɍ', - 590 => 'ɏ', - 688 => 'h', - 689 => 'ɦ', - 690 => 'j', - 691 => 'r', - 692 => 'ɹ', - 693 => 'ɻ', - 694 => 'ʁ', - 695 => 'w', - 696 => 'y', - 736 => 'ɣ', - 737 => 'l', - 738 => 's', - 739 => 'x', - 740 => 'ʕ', - 832 => '̀', - 833 => '́', - 835 => '̓', - 836 => '̈́', - 837 => 'ι', - 880 => 'ͱ', - 882 => 'ͳ', - 884 => 'ʹ', - 886 => 'ͷ', - 895 => 'ϳ', - 902 => 'ά', - 903 => '·', - 904 => 'έ', - 905 => 'ή', - 906 => 'ί', - 908 => 'ό', - 910 => 'ύ', - 911 => 'ώ', - 913 => 'α', - 914 => 'β', - 915 => 'γ', - 916 => 'δ', - 917 => 'ε', - 918 => 'ζ', - 919 => 'η', - 920 => 'θ', - 921 => 'ι', - 922 => 'κ', - 923 => 'λ', - 924 => 'μ', - 925 => 'ν', - 926 => 'ξ', - 927 => 'ο', - 928 => 'π', - 929 => 'ρ', - 931 => 'σ', - 932 => 'τ', - 933 => 'υ', - 934 => 'φ', - 935 => 'χ', - 936 => 'ψ', - 937 => 'ω', - 938 => 'ϊ', - 939 => 'ϋ', - 975 => 'ϗ', - 976 => 'β', - 977 => 'θ', - 978 => 'υ', - 979 => 'ύ', - 980 => 'ϋ', - 981 => 'φ', - 982 => 'π', - 984 => 'ϙ', - 986 => 'ϛ', - 988 => 'ϝ', - 990 => 'ϟ', - 992 => 'ϡ', - 994 => 'ϣ', - 996 => 'ϥ', - 998 => 'ϧ', - 1000 => 'ϩ', - 1002 => 'ϫ', - 1004 => 'ϭ', - 1006 => 'ϯ', - 1008 => 'κ', - 1009 => 'ρ', - 1010 => 'σ', - 1012 => 'θ', - 1013 => 'ε', - 1015 => 'ϸ', - 1017 => 'σ', - 1018 => 'ϻ', - 1021 => 'ͻ', - 1022 => 'ͼ', - 1023 => 'ͽ', - 1024 => 'ѐ', - 1025 => 'ё', - 1026 => 'ђ', - 1027 => 'ѓ', - 1028 => 'є', - 1029 => 'ѕ', - 1030 => 'і', - 1031 => 'ї', - 1032 => 'ј', - 1033 => 'љ', - 1034 => 'њ', - 1035 => 'ћ', - 1036 => 'ќ', - 1037 => 'ѝ', - 1038 => 'ў', - 1039 => 'џ', - 1040 => 'а', - 1041 => 'б', - 1042 => 'в', - 1043 => 'г', - 1044 => 'д', - 1045 => 'е', - 1046 => 'ж', - 1047 => 'з', - 1048 => 'и', - 1049 => 'й', - 1050 => 'к', - 1051 => 'л', - 1052 => 'м', - 1053 => 'н', - 1054 => 'о', - 1055 => 'п', - 1056 => 'р', - 1057 => 'с', - 1058 => 'т', - 1059 => 'у', - 1060 => 'ф', - 1061 => 'х', - 1062 => 'ц', - 1063 => 'ч', - 1064 => 'ш', - 1065 => 'щ', - 1066 => 'ъ', - 1067 => 'ы', - 1068 => 'ь', - 1069 => 'э', - 1070 => 'ю', - 1071 => 'я', - 1120 => 'ѡ', - 1122 => 'ѣ', - 1124 => 'ѥ', - 1126 => 'ѧ', - 1128 => 'ѩ', - 1130 => 'ѫ', - 1132 => 'ѭ', - 1134 => 'ѯ', - 1136 => 'ѱ', - 1138 => 'ѳ', - 1140 => 'ѵ', - 1142 => 'ѷ', - 1144 => 'ѹ', - 1146 => 'ѻ', - 1148 => 'ѽ', - 1150 => 'ѿ', - 1152 => 'ҁ', - 1162 => 'ҋ', - 1164 => 'ҍ', - 1166 => 'ҏ', - 1168 => 'ґ', - 1170 => 'ғ', - 1172 => 'ҕ', - 1174 => 'җ', - 1176 => 'ҙ', - 1178 => 'қ', - 1180 => 'ҝ', - 1182 => 'ҟ', - 1184 => 'ҡ', - 1186 => 'ң', - 1188 => 'ҥ', - 1190 => 'ҧ', - 1192 => 'ҩ', - 1194 => 'ҫ', - 1196 => 'ҭ', - 1198 => 'ү', - 1200 => 'ұ', - 1202 => 'ҳ', - 1204 => 'ҵ', - 1206 => 'ҷ', - 1208 => 'ҹ', - 1210 => 'һ', - 1212 => 'ҽ', - 1214 => 'ҿ', - 1217 => 'ӂ', - 1219 => 'ӄ', - 1221 => 'ӆ', - 1223 => 'ӈ', - 1225 => 'ӊ', - 1227 => 'ӌ', - 1229 => 'ӎ', - 1232 => 'ӑ', - 1234 => 'ӓ', - 1236 => 'ӕ', - 1238 => 'ӗ', - 1240 => 'ә', - 1242 => 'ӛ', - 1244 => 'ӝ', - 1246 => 'ӟ', - 1248 => 'ӡ', - 1250 => 'ӣ', - 1252 => 'ӥ', - 1254 => 'ӧ', - 1256 => 'ө', - 1258 => 'ӫ', - 1260 => 'ӭ', - 1262 => 'ӯ', - 1264 => 'ӱ', - 1266 => 'ӳ', - 1268 => 'ӵ', - 1270 => 'ӷ', - 1272 => 'ӹ', - 1274 => 'ӻ', - 1276 => 'ӽ', - 1278 => 'ӿ', - 1280 => 'ԁ', - 1282 => 'ԃ', - 1284 => 'ԅ', - 1286 => 'ԇ', - 1288 => 'ԉ', - 1290 => 'ԋ', - 1292 => 'ԍ', - 1294 => 'ԏ', - 1296 => 'ԑ', - 1298 => 'ԓ', - 1300 => 'ԕ', - 1302 => 'ԗ', - 1304 => 'ԙ', - 1306 => 'ԛ', - 1308 => 'ԝ', - 1310 => 'ԟ', - 1312 => 'ԡ', - 1314 => 'ԣ', - 1316 => 'ԥ', - 1318 => 'ԧ', - 1320 => 'ԩ', - 1322 => 'ԫ', - 1324 => 'ԭ', - 1326 => 'ԯ', - 1329 => 'ա', - 1330 => 'բ', - 1331 => 'գ', - 1332 => 'դ', - 1333 => 'ե', - 1334 => 'զ', - 1335 => 'է', - 1336 => 'ը', - 1337 => 'թ', - 1338 => 'ժ', - 1339 => 'ի', - 1340 => 'լ', - 1341 => 'խ', - 1342 => 'ծ', - 1343 => 'կ', - 1344 => 'հ', - 1345 => 'ձ', - 1346 => 'ղ', - 1347 => 'ճ', - 1348 => 'մ', - 1349 => 'յ', - 1350 => 'ն', - 1351 => 'շ', - 1352 => 'ո', - 1353 => 'չ', - 1354 => 'պ', - 1355 => 'ջ', - 1356 => 'ռ', - 1357 => 'ս', - 1358 => 'վ', - 1359 => 'տ', - 1360 => 'ր', - 1361 => 'ց', - 1362 => 'ւ', - 1363 => 'փ', - 1364 => 'ք', - 1365 => 'օ', - 1366 => 'ֆ', - 1415 => 'եւ', - 1653 => 'اٴ', - 1654 => 'وٴ', - 1655 => 'ۇٴ', - 1656 => 'يٴ', - 2392 => 'क़', - 2393 => 'ख़', - 2394 => 'ग़', - 2395 => 'ज़', - 2396 => 'ड़', - 2397 => 'ढ़', - 2398 => 'फ़', - 2399 => 'य़', - 2524 => 'ড়', - 2525 => 'ঢ়', - 2527 => 'য়', - 2611 => 'ਲ਼', - 2614 => 'ਸ਼', - 2649 => 'ਖ਼', - 2650 => 'ਗ਼', - 2651 => 'ਜ਼', - 2654 => 'ਫ਼', - 2908 => 'ଡ଼', - 2909 => 'ଢ଼', - 3635 => 'ํา', - 3763 => 'ໍາ', - 3804 => 'ຫນ', - 3805 => 'ຫມ', - 3852 => '་', - 3907 => 'གྷ', - 3917 => 'ཌྷ', - 3922 => 'དྷ', - 3927 => 'བྷ', - 3932 => 'ཛྷ', - 3945 => 'ཀྵ', - 3955 => 'ཱི', - 3957 => 'ཱུ', - 3958 => 'ྲྀ', - 3959 => 'ྲཱྀ', - 3960 => 'ླྀ', - 3961 => 'ླཱྀ', - 3969 => 'ཱྀ', - 3987 => 'ྒྷ', - 3997 => 'ྜྷ', - 4002 => 'ྡྷ', - 4007 => 'ྦྷ', - 4012 => 'ྫྷ', - 4025 => 'ྐྵ', - 4295 => 'ⴧ', - 4301 => 'ⴭ', - 4348 => 'ნ', - 5112 => 'Ᏸ', - 5113 => 'Ᏹ', - 5114 => 'Ᏺ', - 5115 => 'Ᏻ', - 5116 => 'Ᏼ', - 5117 => 'Ᏽ', - 7296 => 'в', - 7297 => 'д', - 7298 => 'о', - 7299 => 'с', - 7300 => 'т', - 7301 => 'т', - 7302 => 'ъ', - 7303 => 'ѣ', - 7304 => 'ꙋ', - 7312 => 'ა', - 7313 => 'ბ', - 7314 => 'გ', - 7315 => 'დ', - 7316 => 'ე', - 7317 => 'ვ', - 7318 => 'ზ', - 7319 => 'თ', - 7320 => 'ი', - 7321 => 'კ', - 7322 => 'ლ', - 7323 => 'მ', - 7324 => 'ნ', - 7325 => 'ო', - 7326 => 'პ', - 7327 => 'ჟ', - 7328 => 'რ', - 7329 => 'ს', - 7330 => 'ტ', - 7331 => 'უ', - 7332 => 'ფ', - 7333 => 'ქ', - 7334 => 'ღ', - 7335 => 'ყ', - 7336 => 'შ', - 7337 => 'ჩ', - 7338 => 'ც', - 7339 => 'ძ', - 7340 => 'წ', - 7341 => 'ჭ', - 7342 => 'ხ', - 7343 => 'ჯ', - 7344 => 'ჰ', - 7345 => 'ჱ', - 7346 => 'ჲ', - 7347 => 'ჳ', - 7348 => 'ჴ', - 7349 => 'ჵ', - 7350 => 'ჶ', - 7351 => 'ჷ', - 7352 => 'ჸ', - 7353 => 'ჹ', - 7354 => 'ჺ', - 7357 => 'ჽ', - 7358 => 'ჾ', - 7359 => 'ჿ', - 7468 => 'a', - 7469 => 'æ', - 7470 => 'b', - 7472 => 'd', - 7473 => 'e', - 7474 => 'ǝ', - 7475 => 'g', - 7476 => 'h', - 7477 => 'i', - 7478 => 'j', - 7479 => 'k', - 7480 => 'l', - 7481 => 'm', - 7482 => 'n', - 7484 => 'o', - 7485 => 'ȣ', - 7486 => 'p', - 7487 => 'r', - 7488 => 't', - 7489 => 'u', - 7490 => 'w', - 7491 => 'a', - 7492 => 'ɐ', - 7493 => 'ɑ', - 7494 => 'ᴂ', - 7495 => 'b', - 7496 => 'd', - 7497 => 'e', - 7498 => 'ə', - 7499 => 'ɛ', - 7500 => 'ɜ', - 7501 => 'g', - 7503 => 'k', - 7504 => 'm', - 7505 => 'ŋ', - 7506 => 'o', - 7507 => 'ɔ', - 7508 => 'ᴖ', - 7509 => 'ᴗ', - 7510 => 'p', - 7511 => 't', - 7512 => 'u', - 7513 => 'ᴝ', - 7514 => 'ɯ', - 7515 => 'v', - 7516 => 'ᴥ', - 7517 => 'β', - 7518 => 'γ', - 7519 => 'δ', - 7520 => 'φ', - 7521 => 'χ', - 7522 => 'i', - 7523 => 'r', - 7524 => 'u', - 7525 => 'v', - 7526 => 'β', - 7527 => 'γ', - 7528 => 'ρ', - 7529 => 'φ', - 7530 => 'χ', - 7544 => 'н', - 7579 => 'ɒ', - 7580 => 'c', - 7581 => 'ɕ', - 7582 => 'ð', - 7583 => 'ɜ', - 7584 => 'f', - 7585 => 'ɟ', - 7586 => 'ɡ', - 7587 => 'ɥ', - 7588 => 'ɨ', - 7589 => 'ɩ', - 7590 => 'ɪ', - 7591 => 'ᵻ', - 7592 => 'ʝ', - 7593 => 'ɭ', - 7594 => 'ᶅ', - 7595 => 'ʟ', - 7596 => 'ɱ', - 7597 => 'ɰ', - 7598 => 'ɲ', - 7599 => 'ɳ', - 7600 => 'ɴ', - 7601 => 'ɵ', - 7602 => 'ɸ', - 7603 => 'ʂ', - 7604 => 'ʃ', - 7605 => 'ƫ', - 7606 => 'ʉ', - 7607 => 'ʊ', - 7608 => 'ᴜ', - 7609 => 'ʋ', - 7610 => 'ʌ', - 7611 => 'z', - 7612 => 'ʐ', - 7613 => 'ʑ', - 7614 => 'ʒ', - 7615 => 'θ', - 7680 => 'ḁ', - 7682 => 'ḃ', - 7684 => 'ḅ', - 7686 => 'ḇ', - 7688 => 'ḉ', - 7690 => 'ḋ', - 7692 => 'ḍ', - 7694 => 'ḏ', - 7696 => 'ḑ', - 7698 => 'ḓ', - 7700 => 'ḕ', - 7702 => 'ḗ', - 7704 => 'ḙ', - 7706 => 'ḛ', - 7708 => 'ḝ', - 7710 => 'ḟ', - 7712 => 'ḡ', - 7714 => 'ḣ', - 7716 => 'ḥ', - 7718 => 'ḧ', - 7720 => 'ḩ', - 7722 => 'ḫ', - 7724 => 'ḭ', - 7726 => 'ḯ', - 7728 => 'ḱ', - 7730 => 'ḳ', - 7732 => 'ḵ', - 7734 => 'ḷ', - 7736 => 'ḹ', - 7738 => 'ḻ', - 7740 => 'ḽ', - 7742 => 'ḿ', - 7744 => 'ṁ', - 7746 => 'ṃ', - 7748 => 'ṅ', - 7750 => 'ṇ', - 7752 => 'ṉ', - 7754 => 'ṋ', - 7756 => 'ṍ', - 7758 => 'ṏ', - 7760 => 'ṑ', - 7762 => 'ṓ', - 7764 => 'ṕ', - 7766 => 'ṗ', - 7768 => 'ṙ', - 7770 => 'ṛ', - 7772 => 'ṝ', - 7774 => 'ṟ', - 7776 => 'ṡ', - 7778 => 'ṣ', - 7780 => 'ṥ', - 7782 => 'ṧ', - 7784 => 'ṩ', - 7786 => 'ṫ', - 7788 => 'ṭ', - 7790 => 'ṯ', - 7792 => 'ṱ', - 7794 => 'ṳ', - 7796 => 'ṵ', - 7798 => 'ṷ', - 7800 => 'ṹ', - 7802 => 'ṻ', - 7804 => 'ṽ', - 7806 => 'ṿ', - 7808 => 'ẁ', - 7810 => 'ẃ', - 7812 => 'ẅ', - 7814 => 'ẇ', - 7816 => 'ẉ', - 7818 => 'ẋ', - 7820 => 'ẍ', - 7822 => 'ẏ', - 7824 => 'ẑ', - 7826 => 'ẓ', - 7828 => 'ẕ', - 7834 => 'aʾ', - 7835 => 'ṡ', - 7838 => 'ss', - 7840 => 'ạ', - 7842 => 'ả', - 7844 => 'ấ', - 7846 => 'ầ', - 7848 => 'ẩ', - 7850 => 'ẫ', - 7852 => 'ậ', - 7854 => 'ắ', - 7856 => 'ằ', - 7858 => 'ẳ', - 7860 => 'ẵ', - 7862 => 'ặ', - 7864 => 'ẹ', - 7866 => 'ẻ', - 7868 => 'ẽ', - 7870 => 'ế', - 7872 => 'ề', - 7874 => 'ể', - 7876 => 'ễ', - 7878 => 'ệ', - 7880 => 'ỉ', - 7882 => 'ị', - 7884 => 'ọ', - 7886 => 'ỏ', - 7888 => 'ố', - 7890 => 'ồ', - 7892 => 'ổ', - 7894 => 'ỗ', - 7896 => 'ộ', - 7898 => 'ớ', - 7900 => 'ờ', - 7902 => 'ở', - 7904 => 'ỡ', - 7906 => 'ợ', - 7908 => 'ụ', - 7910 => 'ủ', - 7912 => 'ứ', - 7914 => 'ừ', - 7916 => 'ử', - 7918 => 'ữ', - 7920 => 'ự', - 7922 => 'ỳ', - 7924 => 'ỵ', - 7926 => 'ỷ', - 7928 => 'ỹ', - 7930 => 'ỻ', - 7932 => 'ỽ', - 7934 => 'ỿ', - 7944 => 'ἀ', - 7945 => 'ἁ', - 7946 => 'ἂ', - 7947 => 'ἃ', - 7948 => 'ἄ', - 7949 => 'ἅ', - 7950 => 'ἆ', - 7951 => 'ἇ', - 7960 => 'ἐ', - 7961 => 'ἑ', - 7962 => 'ἒ', - 7963 => 'ἓ', - 7964 => 'ἔ', - 7965 => 'ἕ', - 7976 => 'ἠ', - 7977 => 'ἡ', - 7978 => 'ἢ', - 7979 => 'ἣ', - 7980 => 'ἤ', - 7981 => 'ἥ', - 7982 => 'ἦ', - 7983 => 'ἧ', - 7992 => 'ἰ', - 7993 => 'ἱ', - 7994 => 'ἲ', - 7995 => 'ἳ', - 7996 => 'ἴ', - 7997 => 'ἵ', - 7998 => 'ἶ', - 7999 => 'ἷ', - 8008 => 'ὀ', - 8009 => 'ὁ', - 8010 => 'ὂ', - 8011 => 'ὃ', - 8012 => 'ὄ', - 8013 => 'ὅ', - 8025 => 'ὑ', - 8027 => 'ὓ', - 8029 => 'ὕ', - 8031 => 'ὗ', - 8040 => 'ὠ', - 8041 => 'ὡ', - 8042 => 'ὢ', - 8043 => 'ὣ', - 8044 => 'ὤ', - 8045 => 'ὥ', - 8046 => 'ὦ', - 8047 => 'ὧ', - 8049 => 'ά', - 8051 => 'έ', - 8053 => 'ή', - 8055 => 'ί', - 8057 => 'ό', - 8059 => 'ύ', - 8061 => 'ώ', - 8064 => 'ἀι', - 8065 => 'ἁι', - 8066 => 'ἂι', - 8067 => 'ἃι', - 8068 => 'ἄι', - 8069 => 'ἅι', - 8070 => 'ἆι', - 8071 => 'ἇι', - 8072 => 'ἀι', - 8073 => 'ἁι', - 8074 => 'ἂι', - 8075 => 'ἃι', - 8076 => 'ἄι', - 8077 => 'ἅι', - 8078 => 'ἆι', - 8079 => 'ἇι', - 8080 => 'ἠι', - 8081 => 'ἡι', - 8082 => 'ἢι', - 8083 => 'ἣι', - 8084 => 'ἤι', - 8085 => 'ἥι', - 8086 => 'ἦι', - 8087 => 'ἧι', - 8088 => 'ἠι', - 8089 => 'ἡι', - 8090 => 'ἢι', - 8091 => 'ἣι', - 8092 => 'ἤι', - 8093 => 'ἥι', - 8094 => 'ἦι', - 8095 => 'ἧι', - 8096 => 'ὠι', - 8097 => 'ὡι', - 8098 => 'ὢι', - 8099 => 'ὣι', - 8100 => 'ὤι', - 8101 => 'ὥι', - 8102 => 'ὦι', - 8103 => 'ὧι', - 8104 => 'ὠι', - 8105 => 'ὡι', - 8106 => 'ὢι', - 8107 => 'ὣι', - 8108 => 'ὤι', - 8109 => 'ὥι', - 8110 => 'ὦι', - 8111 => 'ὧι', - 8114 => 'ὰι', - 8115 => 'αι', - 8116 => 'άι', - 8119 => 'ᾶι', - 8120 => 'ᾰ', - 8121 => 'ᾱ', - 8122 => 'ὰ', - 8123 => 'ά', - 8124 => 'αι', - 8126 => 'ι', - 8130 => 'ὴι', - 8131 => 'ηι', - 8132 => 'ήι', - 8135 => 'ῆι', - 8136 => 'ὲ', - 8137 => 'έ', - 8138 => 'ὴ', - 8139 => 'ή', - 8140 => 'ηι', - 8147 => 'ΐ', - 8152 => 'ῐ', - 8153 => 'ῑ', - 8154 => 'ὶ', - 8155 => 'ί', - 8163 => 'ΰ', - 8168 => 'ῠ', - 8169 => 'ῡ', - 8170 => 'ὺ', - 8171 => 'ύ', - 8172 => 'ῥ', - 8178 => 'ὼι', - 8179 => 'ωι', - 8180 => 'ώι', - 8183 => 'ῶι', - 8184 => 'ὸ', - 8185 => 'ό', - 8186 => 'ὼ', - 8187 => 'ώ', - 8188 => 'ωι', - 8209 => '‐', - 8243 => '′′', - 8244 => '′′′', - 8246 => '‵‵', - 8247 => '‵‵‵', - 8279 => '′′′′', - 8304 => '0', - 8305 => 'i', - 8308 => '4', - 8309 => '5', - 8310 => '6', - 8311 => '7', - 8312 => '8', - 8313 => '9', - 8315 => '−', - 8319 => 'n', - 8320 => '0', - 8321 => '1', - 8322 => '2', - 8323 => '3', - 8324 => '4', - 8325 => '5', - 8326 => '6', - 8327 => '7', - 8328 => '8', - 8329 => '9', - 8331 => '−', - 8336 => 'a', - 8337 => 'e', - 8338 => 'o', - 8339 => 'x', - 8340 => 'ə', - 8341 => 'h', - 8342 => 'k', - 8343 => 'l', - 8344 => 'm', - 8345 => 'n', - 8346 => 'p', - 8347 => 's', - 8348 => 't', - 8360 => 'rs', - 8450 => 'c', - 8451 => '°c', - 8455 => 'ɛ', - 8457 => '°f', - 8458 => 'g', - 8459 => 'h', - 8460 => 'h', - 8461 => 'h', - 8462 => 'h', - 8463 => 'ħ', - 8464 => 'i', - 8465 => 'i', - 8466 => 'l', - 8467 => 'l', - 8469 => 'n', - 8470 => 'no', - 8473 => 'p', - 8474 => 'q', - 8475 => 'r', - 8476 => 'r', - 8477 => 'r', - 8480 => 'sm', - 8481 => 'tel', - 8482 => 'tm', - 8484 => 'z', - 8486 => 'ω', - 8488 => 'z', - 8490 => 'k', - 8491 => 'å', - 8492 => 'b', - 8493 => 'c', - 8495 => 'e', - 8496 => 'e', - 8497 => 'f', - 8499 => 'm', - 8500 => 'o', - 8501 => 'א', - 8502 => 'ב', - 8503 => 'ג', - 8504 => 'ד', - 8505 => 'i', - 8507 => 'fax', - 8508 => 'π', - 8509 => 'γ', - 8510 => 'γ', - 8511 => 'π', - 8512 => '∑', - 8517 => 'd', - 8518 => 'd', - 8519 => 'e', - 8520 => 'i', - 8521 => 'j', - 8528 => '1⁄7', - 8529 => '1⁄9', - 8530 => '1⁄10', - 8531 => '1⁄3', - 8532 => '2⁄3', - 8533 => '1⁄5', - 8534 => '2⁄5', - 8535 => '3⁄5', - 8536 => '4⁄5', - 8537 => '1⁄6', - 8538 => '5⁄6', - 8539 => '1⁄8', - 8540 => '3⁄8', - 8541 => '5⁄8', - 8542 => '7⁄8', - 8543 => '1⁄', - 8544 => 'i', - 8545 => 'ii', - 8546 => 'iii', - 8547 => 'iv', - 8548 => 'v', - 8549 => 'vi', - 8550 => 'vii', - 8551 => 'viii', - 8552 => 'ix', - 8553 => 'x', - 8554 => 'xi', - 8555 => 'xii', - 8556 => 'l', - 8557 => 'c', - 8558 => 'd', - 8559 => 'm', - 8560 => 'i', - 8561 => 'ii', - 8562 => 'iii', - 8563 => 'iv', - 8564 => 'v', - 8565 => 'vi', - 8566 => 'vii', - 8567 => 'viii', - 8568 => 'ix', - 8569 => 'x', - 8570 => 'xi', - 8571 => 'xii', - 8572 => 'l', - 8573 => 'c', - 8574 => 'd', - 8575 => 'm', - 8585 => '0⁄3', - 8748 => '∫∫', - 8749 => '∫∫∫', - 8751 => '∮∮', - 8752 => '∮∮∮', - 9001 => '〈', - 9002 => '〉', - 9312 => '1', - 9313 => '2', - 9314 => '3', - 9315 => '4', - 9316 => '5', - 9317 => '6', - 9318 => '7', - 9319 => '8', - 9320 => '9', - 9321 => '10', - 9322 => '11', - 9323 => '12', - 9324 => '13', - 9325 => '14', - 9326 => '15', - 9327 => '16', - 9328 => '17', - 9329 => '18', - 9330 => '19', - 9331 => '20', - 9398 => 'a', - 9399 => 'b', - 9400 => 'c', - 9401 => 'd', - 9402 => 'e', - 9403 => 'f', - 9404 => 'g', - 9405 => 'h', - 9406 => 'i', - 9407 => 'j', - 9408 => 'k', - 9409 => 'l', - 9410 => 'm', - 9411 => 'n', - 9412 => 'o', - 9413 => 'p', - 9414 => 'q', - 9415 => 'r', - 9416 => 's', - 9417 => 't', - 9418 => 'u', - 9419 => 'v', - 9420 => 'w', - 9421 => 'x', - 9422 => 'y', - 9423 => 'z', - 9424 => 'a', - 9425 => 'b', - 9426 => 'c', - 9427 => 'd', - 9428 => 'e', - 9429 => 'f', - 9430 => 'g', - 9431 => 'h', - 9432 => 'i', - 9433 => 'j', - 9434 => 'k', - 9435 => 'l', - 9436 => 'm', - 9437 => 'n', - 9438 => 'o', - 9439 => 'p', - 9440 => 'q', - 9441 => 'r', - 9442 => 's', - 9443 => 't', - 9444 => 'u', - 9445 => 'v', - 9446 => 'w', - 9447 => 'x', - 9448 => 'y', - 9449 => 'z', - 9450 => '0', - 10764 => '∫∫∫∫', - 10972 => '⫝̸', - 11264 => 'ⰰ', - 11265 => 'ⰱ', - 11266 => 'ⰲ', - 11267 => 'ⰳ', - 11268 => 'ⰴ', - 11269 => 'ⰵ', - 11270 => 'ⰶ', - 11271 => 'ⰷ', - 11272 => 'ⰸ', - 11273 => 'ⰹ', - 11274 => 'ⰺ', - 11275 => 'ⰻ', - 11276 => 'ⰼ', - 11277 => 'ⰽ', - 11278 => 'ⰾ', - 11279 => 'ⰿ', - 11280 => 'ⱀ', - 11281 => 'ⱁ', - 11282 => 'ⱂ', - 11283 => 'ⱃ', - 11284 => 'ⱄ', - 11285 => 'ⱅ', - 11286 => 'ⱆ', - 11287 => 'ⱇ', - 11288 => 'ⱈ', - 11289 => 'ⱉ', - 11290 => 'ⱊ', - 11291 => 'ⱋ', - 11292 => 'ⱌ', - 11293 => 'ⱍ', - 11294 => 'ⱎ', - 11295 => 'ⱏ', - 11296 => 'ⱐ', - 11297 => 'ⱑ', - 11298 => 'ⱒ', - 11299 => 'ⱓ', - 11300 => 'ⱔ', - 11301 => 'ⱕ', - 11302 => 'ⱖ', - 11303 => 'ⱗ', - 11304 => 'ⱘ', - 11305 => 'ⱙ', - 11306 => 'ⱚ', - 11307 => 'ⱛ', - 11308 => 'ⱜ', - 11309 => 'ⱝ', - 11310 => 'ⱞ', - 11360 => 'ⱡ', - 11362 => 'ɫ', - 11363 => 'ᵽ', - 11364 => 'ɽ', - 11367 => 'ⱨ', - 11369 => 'ⱪ', - 11371 => 'ⱬ', - 11373 => 'ɑ', - 11374 => 'ɱ', - 11375 => 'ɐ', - 11376 => 'ɒ', - 11378 => 'ⱳ', - 11381 => 'ⱶ', - 11388 => 'j', - 11389 => 'v', - 11390 => 'ȿ', - 11391 => 'ɀ', - 11392 => 'ⲁ', - 11394 => 'ⲃ', - 11396 => 'ⲅ', - 11398 => 'ⲇ', - 11400 => 'ⲉ', - 11402 => 'ⲋ', - 11404 => 'ⲍ', - 11406 => 'ⲏ', - 11408 => 'ⲑ', - 11410 => 'ⲓ', - 11412 => 'ⲕ', - 11414 => 'ⲗ', - 11416 => 'ⲙ', - 11418 => 'ⲛ', - 11420 => 'ⲝ', - 11422 => 'ⲟ', - 11424 => 'ⲡ', - 11426 => 'ⲣ', - 11428 => 'ⲥ', - 11430 => 'ⲧ', - 11432 => 'ⲩ', - 11434 => 'ⲫ', - 11436 => 'ⲭ', - 11438 => 'ⲯ', - 11440 => 'ⲱ', - 11442 => 'ⲳ', - 11444 => 'ⲵ', - 11446 => 'ⲷ', - 11448 => 'ⲹ', - 11450 => 'ⲻ', - 11452 => 'ⲽ', - 11454 => 'ⲿ', - 11456 => 'ⳁ', - 11458 => 'ⳃ', - 11460 => 'ⳅ', - 11462 => 'ⳇ', - 11464 => 'ⳉ', - 11466 => 'ⳋ', - 11468 => 'ⳍ', - 11470 => 'ⳏ', - 11472 => 'ⳑ', - 11474 => 'ⳓ', - 11476 => 'ⳕ', - 11478 => 'ⳗ', - 11480 => 'ⳙ', - 11482 => 'ⳛ', - 11484 => 'ⳝ', - 11486 => 'ⳟ', - 11488 => 'ⳡ', - 11490 => 'ⳣ', - 11499 => 'ⳬ', - 11501 => 'ⳮ', - 11506 => 'ⳳ', - 11631 => 'ⵡ', - 11935 => '母', - 12019 => '龟', - 12032 => '一', - 12033 => '丨', - 12034 => '丶', - 12035 => '丿', - 12036 => '乙', - 12037 => '亅', - 12038 => '二', - 12039 => '亠', - 12040 => '人', - 12041 => '儿', - 12042 => '入', - 12043 => '八', - 12044 => '冂', - 12045 => '冖', - 12046 => '冫', - 12047 => '几', - 12048 => '凵', - 12049 => '刀', - 12050 => '力', - 12051 => '勹', - 12052 => '匕', - 12053 => '匚', - 12054 => '匸', - 12055 => '十', - 12056 => '卜', - 12057 => '卩', - 12058 => '厂', - 12059 => '厶', - 12060 => '又', - 12061 => '口', - 12062 => '囗', - 12063 => '土', - 12064 => '士', - 12065 => '夂', - 12066 => '夊', - 12067 => '夕', - 12068 => '大', - 12069 => '女', - 12070 => '子', - 12071 => '宀', - 12072 => '寸', - 12073 => '小', - 12074 => '尢', - 12075 => '尸', - 12076 => '屮', - 12077 => '山', - 12078 => '巛', - 12079 => '工', - 12080 => '己', - 12081 => '巾', - 12082 => '干', - 12083 => '幺', - 12084 => '广', - 12085 => '廴', - 12086 => '廾', - 12087 => '弋', - 12088 => '弓', - 12089 => '彐', - 12090 => '彡', - 12091 => '彳', - 12092 => '心', - 12093 => '戈', - 12094 => '戶', - 12095 => '手', - 12096 => '支', - 12097 => '攴', - 12098 => '文', - 12099 => '斗', - 12100 => '斤', - 12101 => '方', - 12102 => '无', - 12103 => '日', - 12104 => '曰', - 12105 => '月', - 12106 => '木', - 12107 => '欠', - 12108 => '止', - 12109 => '歹', - 12110 => '殳', - 12111 => '毋', - 12112 => '比', - 12113 => '毛', - 12114 => '氏', - 12115 => '气', - 12116 => '水', - 12117 => '火', - 12118 => '爪', - 12119 => '父', - 12120 => '爻', - 12121 => '爿', - 12122 => '片', - 12123 => '牙', - 12124 => '牛', - 12125 => '犬', - 12126 => '玄', - 12127 => '玉', - 12128 => '瓜', - 12129 => '瓦', - 12130 => '甘', - 12131 => '生', - 12132 => '用', - 12133 => '田', - 12134 => '疋', - 12135 => '疒', - 12136 => '癶', - 12137 => '白', - 12138 => '皮', - 12139 => '皿', - 12140 => '目', - 12141 => '矛', - 12142 => '矢', - 12143 => '石', - 12144 => '示', - 12145 => '禸', - 12146 => '禾', - 12147 => '穴', - 12148 => '立', - 12149 => '竹', - 12150 => '米', - 12151 => '糸', - 12152 => '缶', - 12153 => '网', - 12154 => '羊', - 12155 => '羽', - 12156 => '老', - 12157 => '而', - 12158 => '耒', - 12159 => '耳', - 12160 => '聿', - 12161 => '肉', - 12162 => '臣', - 12163 => '自', - 12164 => '至', - 12165 => '臼', - 12166 => '舌', - 12167 => '舛', - 12168 => '舟', - 12169 => '艮', - 12170 => '色', - 12171 => '艸', - 12172 => '虍', - 12173 => '虫', - 12174 => '血', - 12175 => '行', - 12176 => '衣', - 12177 => '襾', - 12178 => '見', - 12179 => '角', - 12180 => '言', - 12181 => '谷', - 12182 => '豆', - 12183 => '豕', - 12184 => '豸', - 12185 => '貝', - 12186 => '赤', - 12187 => '走', - 12188 => '足', - 12189 => '身', - 12190 => '車', - 12191 => '辛', - 12192 => '辰', - 12193 => '辵', - 12194 => '邑', - 12195 => '酉', - 12196 => '釆', - 12197 => '里', - 12198 => '金', - 12199 => '長', - 12200 => '門', - 12201 => '阜', - 12202 => '隶', - 12203 => '隹', - 12204 => '雨', - 12205 => '靑', - 12206 => '非', - 12207 => '面', - 12208 => '革', - 12209 => '韋', - 12210 => '韭', - 12211 => '音', - 12212 => '頁', - 12213 => '風', - 12214 => '飛', - 12215 => '食', - 12216 => '首', - 12217 => '香', - 12218 => '馬', - 12219 => '骨', - 12220 => '高', - 12221 => '髟', - 12222 => '鬥', - 12223 => '鬯', - 12224 => '鬲', - 12225 => '鬼', - 12226 => '魚', - 12227 => '鳥', - 12228 => '鹵', - 12229 => '鹿', - 12230 => '麥', - 12231 => '麻', - 12232 => '黃', - 12233 => '黍', - 12234 => '黑', - 12235 => '黹', - 12236 => '黽', - 12237 => '鼎', - 12238 => '鼓', - 12239 => '鼠', - 12240 => '鼻', - 12241 => '齊', - 12242 => '齒', - 12243 => '龍', - 12244 => '龜', - 12245 => '龠', - 12290 => '.', - 12342 => '〒', - 12344 => '十', - 12345 => '卄', - 12346 => '卅', - 12447 => 'より', - 12543 => 'コト', - 12593 => 'ᄀ', - 12594 => 'ᄁ', - 12595 => 'ᆪ', - 12596 => 'ᄂ', - 12597 => 'ᆬ', - 12598 => 'ᆭ', - 12599 => 'ᄃ', - 12600 => 'ᄄ', - 12601 => 'ᄅ', - 12602 => 'ᆰ', - 12603 => 'ᆱ', - 12604 => 'ᆲ', - 12605 => 'ᆳ', - 12606 => 'ᆴ', - 12607 => 'ᆵ', - 12608 => 'ᄚ', - 12609 => 'ᄆ', - 12610 => 'ᄇ', - 12611 => 'ᄈ', - 12612 => 'ᄡ', - 12613 => 'ᄉ', - 12614 => 'ᄊ', - 12615 => 'ᄋ', - 12616 => 'ᄌ', - 12617 => 'ᄍ', - 12618 => 'ᄎ', - 12619 => 'ᄏ', - 12620 => 'ᄐ', - 12621 => 'ᄑ', - 12622 => 'ᄒ', - 12623 => 'ᅡ', - 12624 => 'ᅢ', - 12625 => 'ᅣ', - 12626 => 'ᅤ', - 12627 => 'ᅥ', - 12628 => 'ᅦ', - 12629 => 'ᅧ', - 12630 => 'ᅨ', - 12631 => 'ᅩ', - 12632 => 'ᅪ', - 12633 => 'ᅫ', - 12634 => 'ᅬ', - 12635 => 'ᅭ', - 12636 => 'ᅮ', - 12637 => 'ᅯ', - 12638 => 'ᅰ', - 12639 => 'ᅱ', - 12640 => 'ᅲ', - 12641 => 'ᅳ', - 12642 => 'ᅴ', - 12643 => 'ᅵ', - 12645 => 'ᄔ', - 12646 => 'ᄕ', - 12647 => 'ᇇ', - 12648 => 'ᇈ', - 12649 => 'ᇌ', - 12650 => 'ᇎ', - 12651 => 'ᇓ', - 12652 => 'ᇗ', - 12653 => 'ᇙ', - 12654 => 'ᄜ', - 12655 => 'ᇝ', - 12656 => 'ᇟ', - 12657 => 'ᄝ', - 12658 => 'ᄞ', - 12659 => 'ᄠ', - 12660 => 'ᄢ', - 12661 => 'ᄣ', - 12662 => 'ᄧ', - 12663 => 'ᄩ', - 12664 => 'ᄫ', - 12665 => 'ᄬ', - 12666 => 'ᄭ', - 12667 => 'ᄮ', - 12668 => 'ᄯ', - 12669 => 'ᄲ', - 12670 => 'ᄶ', - 12671 => 'ᅀ', - 12672 => 'ᅇ', - 12673 => 'ᅌ', - 12674 => 'ᇱ', - 12675 => 'ᇲ', - 12676 => 'ᅗ', - 12677 => 'ᅘ', - 12678 => 'ᅙ', - 12679 => 'ᆄ', - 12680 => 'ᆅ', - 12681 => 'ᆈ', - 12682 => 'ᆑ', - 12683 => 'ᆒ', - 12684 => 'ᆔ', - 12685 => 'ᆞ', - 12686 => 'ᆡ', - 12690 => '一', - 12691 => '二', - 12692 => '三', - 12693 => '四', - 12694 => '上', - 12695 => '中', - 12696 => '下', - 12697 => '甲', - 12698 => '乙', - 12699 => '丙', - 12700 => '丁', - 12701 => '天', - 12702 => '地', - 12703 => '人', - 12868 => '問', - 12869 => '幼', - 12870 => '文', - 12871 => '箏', - 12880 => 'pte', - 12881 => '21', - 12882 => '22', - 12883 => '23', - 12884 => '24', - 12885 => '25', - 12886 => '26', - 12887 => '27', - 12888 => '28', - 12889 => '29', - 12890 => '30', - 12891 => '31', - 12892 => '32', - 12893 => '33', - 12894 => '34', - 12895 => '35', - 12896 => 'ᄀ', - 12897 => 'ᄂ', - 12898 => 'ᄃ', - 12899 => 'ᄅ', - 12900 => 'ᄆ', - 12901 => 'ᄇ', - 12902 => 'ᄉ', - 12903 => 'ᄋ', - 12904 => 'ᄌ', - 12905 => 'ᄎ', - 12906 => 'ᄏ', - 12907 => 'ᄐ', - 12908 => 'ᄑ', - 12909 => 'ᄒ', - 12910 => '가', - 12911 => '나', - 12912 => '다', - 12913 => '라', - 12914 => '마', - 12915 => '바', - 12916 => '사', - 12917 => '아', - 12918 => '자', - 12919 => '차', - 12920 => '카', - 12921 => '타', - 12922 => '파', - 12923 => '하', - 12924 => '참고', - 12925 => '주의', - 12926 => '우', - 12928 => '一', - 12929 => '二', - 12930 => '三', - 12931 => '四', - 12932 => '五', - 12933 => '六', - 12934 => '七', - 12935 => '八', - 12936 => '九', - 12937 => '十', - 12938 => '月', - 12939 => '火', - 12940 => '水', - 12941 => '木', - 12942 => '金', - 12943 => '土', - 12944 => '日', - 12945 => '株', - 12946 => '有', - 12947 => '社', - 12948 => '名', - 12949 => '特', - 12950 => '財', - 12951 => '祝', - 12952 => '労', - 12953 => '秘', - 12954 => '男', - 12955 => '女', - 12956 => '適', - 12957 => '優', - 12958 => '印', - 12959 => '注', - 12960 => '項', - 12961 => '休', - 12962 => '写', - 12963 => '正', - 12964 => '上', - 12965 => '中', - 12966 => '下', - 12967 => '左', - 12968 => '右', - 12969 => '医', - 12970 => '宗', - 12971 => '学', - 12972 => '監', - 12973 => '企', - 12974 => '資', - 12975 => '協', - 12976 => '夜', - 12977 => '36', - 12978 => '37', - 12979 => '38', - 12980 => '39', - 12981 => '40', - 12982 => '41', - 12983 => '42', - 12984 => '43', - 12985 => '44', - 12986 => '45', - 12987 => '46', - 12988 => '47', - 12989 => '48', - 12990 => '49', - 12991 => '50', - 12992 => '1月', - 12993 => '2月', - 12994 => '3月', - 12995 => '4月', - 12996 => '5月', - 12997 => '6月', - 12998 => '7月', - 12999 => '8月', - 13000 => '9月', - 13001 => '10月', - 13002 => '11月', - 13003 => '12月', - 13004 => 'hg', - 13005 => 'erg', - 13006 => 'ev', - 13007 => 'ltd', - 13008 => 'ア', - 13009 => 'イ', - 13010 => 'ウ', - 13011 => 'エ', - 13012 => 'オ', - 13013 => 'カ', - 13014 => 'キ', - 13015 => 'ク', - 13016 => 'ケ', - 13017 => 'コ', - 13018 => 'サ', - 13019 => 'シ', - 13020 => 'ス', - 13021 => 'セ', - 13022 => 'ソ', - 13023 => 'タ', - 13024 => 'チ', - 13025 => 'ツ', - 13026 => 'テ', - 13027 => 'ト', - 13028 => 'ナ', - 13029 => 'ニ', - 13030 => 'ヌ', - 13031 => 'ネ', - 13032 => 'ノ', - 13033 => 'ハ', - 13034 => 'ヒ', - 13035 => 'フ', - 13036 => 'ヘ', - 13037 => 'ホ', - 13038 => 'マ', - 13039 => 'ミ', - 13040 => 'ム', - 13041 => 'メ', - 13042 => 'モ', - 13043 => 'ヤ', - 13044 => 'ユ', - 13045 => 'ヨ', - 13046 => 'ラ', - 13047 => 'リ', - 13048 => 'ル', - 13049 => 'レ', - 13050 => 'ロ', - 13051 => 'ワ', - 13052 => 'ヰ', - 13053 => 'ヱ', - 13054 => 'ヲ', - 13055 => '令和', - 13056 => 'アパート', - 13057 => 'アルファ', - 13058 => 'アンペア', - 13059 => 'アール', - 13060 => 'イニング', - 13061 => 'インチ', - 13062 => 'ウォン', - 13063 => 'エスクード', - 13064 => 'エーカー', - 13065 => 'オンス', - 13066 => 'オーム', - 13067 => 'カイリ', - 13068 => 'カラット', - 13069 => 'カロリー', - 13070 => 'ガロン', - 13071 => 'ガンマ', - 13072 => 'ギガ', - 13073 => 'ギニー', - 13074 => 'キュリー', - 13075 => 'ギルダー', - 13076 => 'キロ', - 13077 => 'キログラム', - 13078 => 'キロメートル', - 13079 => 'キロワット', - 13080 => 'グラム', - 13081 => 'グラムトン', - 13082 => 'クルゼイロ', - 13083 => 'クローネ', - 13084 => 'ケース', - 13085 => 'コルナ', - 13086 => 'コーポ', - 13087 => 'サイクル', - 13088 => 'サンチーム', - 13089 => 'シリング', - 13090 => 'センチ', - 13091 => 'セント', - 13092 => 'ダース', - 13093 => 'デシ', - 13094 => 'ドル', - 13095 => 'トン', - 13096 => 'ナノ', - 13097 => 'ノット', - 13098 => 'ハイツ', - 13099 => 'パーセント', - 13100 => 'パーツ', - 13101 => 'バーレル', - 13102 => 'ピアストル', - 13103 => 'ピクル', - 13104 => 'ピコ', - 13105 => 'ビル', - 13106 => 'ファラッド', - 13107 => 'フィート', - 13108 => 'ブッシェル', - 13109 => 'フラン', - 13110 => 'ヘクタール', - 13111 => 'ペソ', - 13112 => 'ペニヒ', - 13113 => 'ヘルツ', - 13114 => 'ペンス', - 13115 => 'ページ', - 13116 => 'ベータ', - 13117 => 'ポイント', - 13118 => 'ボルト', - 13119 => 'ホン', - 13120 => 'ポンド', - 13121 => 'ホール', - 13122 => 'ホーン', - 13123 => 'マイクロ', - 13124 => 'マイル', - 13125 => 'マッハ', - 13126 => 'マルク', - 13127 => 'マンション', - 13128 => 'ミクロン', - 13129 => 'ミリ', - 13130 => 'ミリバール', - 13131 => 'メガ', - 13132 => 'メガトン', - 13133 => 'メートル', - 13134 => 'ヤード', - 13135 => 'ヤール', - 13136 => 'ユアン', - 13137 => 'リットル', - 13138 => 'リラ', - 13139 => 'ルピー', - 13140 => 'ルーブル', - 13141 => 'レム', - 13142 => 'レントゲン', - 13143 => 'ワット', - 13144 => '0点', - 13145 => '1点', - 13146 => '2点', - 13147 => '3点', - 13148 => '4点', - 13149 => '5点', - 13150 => '6点', - 13151 => '7点', - 13152 => '8点', - 13153 => '9点', - 13154 => '10点', - 13155 => '11点', - 13156 => '12点', - 13157 => '13点', - 13158 => '14点', - 13159 => '15点', - 13160 => '16点', - 13161 => '17点', - 13162 => '18点', - 13163 => '19点', - 13164 => '20点', - 13165 => '21点', - 13166 => '22点', - 13167 => '23点', - 13168 => '24点', - 13169 => 'hpa', - 13170 => 'da', - 13171 => 'au', - 13172 => 'bar', - 13173 => 'ov', - 13174 => 'pc', - 13175 => 'dm', - 13176 => 'dm2', - 13177 => 'dm3', - 13178 => 'iu', - 13179 => '平成', - 13180 => '昭和', - 13181 => '大正', - 13182 => '明治', - 13183 => '株式会社', - 13184 => 'pa', - 13185 => 'na', - 13186 => 'μa', - 13187 => 'ma', - 13188 => 'ka', - 13189 => 'kb', - 13190 => 'mb', - 13191 => 'gb', - 13192 => 'cal', - 13193 => 'kcal', - 13194 => 'pf', - 13195 => 'nf', - 13196 => 'μf', - 13197 => 'μg', - 13198 => 'mg', - 13199 => 'kg', - 13200 => 'hz', - 13201 => 'khz', - 13202 => 'mhz', - 13203 => 'ghz', - 13204 => 'thz', - 13205 => 'μl', - 13206 => 'ml', - 13207 => 'dl', - 13208 => 'kl', - 13209 => 'fm', - 13210 => 'nm', - 13211 => 'μm', - 13212 => 'mm', - 13213 => 'cm', - 13214 => 'km', - 13215 => 'mm2', - 13216 => 'cm2', - 13217 => 'm2', - 13218 => 'km2', - 13219 => 'mm3', - 13220 => 'cm3', - 13221 => 'm3', - 13222 => 'km3', - 13223 => 'm∕s', - 13224 => 'm∕s2', - 13225 => 'pa', - 13226 => 'kpa', - 13227 => 'mpa', - 13228 => 'gpa', - 13229 => 'rad', - 13230 => 'rad∕s', - 13231 => 'rad∕s2', - 13232 => 'ps', - 13233 => 'ns', - 13234 => 'μs', - 13235 => 'ms', - 13236 => 'pv', - 13237 => 'nv', - 13238 => 'μv', - 13239 => 'mv', - 13240 => 'kv', - 13241 => 'mv', - 13242 => 'pw', - 13243 => 'nw', - 13244 => 'μw', - 13245 => 'mw', - 13246 => 'kw', - 13247 => 'mw', - 13248 => 'kω', - 13249 => 'mω', - 13251 => 'bq', - 13252 => 'cc', - 13253 => 'cd', - 13254 => 'c∕kg', - 13256 => 'db', - 13257 => 'gy', - 13258 => 'ha', - 13259 => 'hp', - 13260 => 'in', - 13261 => 'kk', - 13262 => 'km', - 13263 => 'kt', - 13264 => 'lm', - 13265 => 'ln', - 13266 => 'log', - 13267 => 'lx', - 13268 => 'mb', - 13269 => 'mil', - 13270 => 'mol', - 13271 => 'ph', - 13273 => 'ppm', - 13274 => 'pr', - 13275 => 'sr', - 13276 => 'sv', - 13277 => 'wb', - 13278 => 'v∕m', - 13279 => 'a∕m', - 13280 => '1日', - 13281 => '2日', - 13282 => '3日', - 13283 => '4日', - 13284 => '5日', - 13285 => '6日', - 13286 => '7日', - 13287 => '8日', - 13288 => '9日', - 13289 => '10日', - 13290 => '11日', - 13291 => '12日', - 13292 => '13日', - 13293 => '14日', - 13294 => '15日', - 13295 => '16日', - 13296 => '17日', - 13297 => '18日', - 13298 => '19日', - 13299 => '20日', - 13300 => '21日', - 13301 => '22日', - 13302 => '23日', - 13303 => '24日', - 13304 => '25日', - 13305 => '26日', - 13306 => '27日', - 13307 => '28日', - 13308 => '29日', - 13309 => '30日', - 13310 => '31日', - 13311 => 'gal', - 42560 => 'ꙁ', - 42562 => 'ꙃ', - 42564 => 'ꙅ', - 42566 => 'ꙇ', - 42568 => 'ꙉ', - 42570 => 'ꙋ', - 42572 => 'ꙍ', - 42574 => 'ꙏ', - 42576 => 'ꙑ', - 42578 => 'ꙓ', - 42580 => 'ꙕ', - 42582 => 'ꙗ', - 42584 => 'ꙙ', - 42586 => 'ꙛ', - 42588 => 'ꙝ', - 42590 => 'ꙟ', - 42592 => 'ꙡ', - 42594 => 'ꙣ', - 42596 => 'ꙥ', - 42598 => 'ꙧ', - 42600 => 'ꙩ', - 42602 => 'ꙫ', - 42604 => 'ꙭ', - 42624 => 'ꚁ', - 42626 => 'ꚃ', - 42628 => 'ꚅ', - 42630 => 'ꚇ', - 42632 => 'ꚉ', - 42634 => 'ꚋ', - 42636 => 'ꚍ', - 42638 => 'ꚏ', - 42640 => 'ꚑ', - 42642 => 'ꚓ', - 42644 => 'ꚕ', - 42646 => 'ꚗ', - 42648 => 'ꚙ', - 42650 => 'ꚛ', - 42652 => 'ъ', - 42653 => 'ь', - 42786 => 'ꜣ', - 42788 => 'ꜥ', - 42790 => 'ꜧ', - 42792 => 'ꜩ', - 42794 => 'ꜫ', - 42796 => 'ꜭ', - 42798 => 'ꜯ', - 42802 => 'ꜳ', - 42804 => 'ꜵ', - 42806 => 'ꜷ', - 42808 => 'ꜹ', - 42810 => 'ꜻ', - 42812 => 'ꜽ', - 42814 => 'ꜿ', - 42816 => 'ꝁ', - 42818 => 'ꝃ', - 42820 => 'ꝅ', - 42822 => 'ꝇ', - 42824 => 'ꝉ', - 42826 => 'ꝋ', - 42828 => 'ꝍ', - 42830 => 'ꝏ', - 42832 => 'ꝑ', - 42834 => 'ꝓ', - 42836 => 'ꝕ', - 42838 => 'ꝗ', - 42840 => 'ꝙ', - 42842 => 'ꝛ', - 42844 => 'ꝝ', - 42846 => 'ꝟ', - 42848 => 'ꝡ', - 42850 => 'ꝣ', - 42852 => 'ꝥ', - 42854 => 'ꝧ', - 42856 => 'ꝩ', - 42858 => 'ꝫ', - 42860 => 'ꝭ', - 42862 => 'ꝯ', - 42864 => 'ꝯ', - 42873 => 'ꝺ', - 42875 => 'ꝼ', - 42877 => 'ᵹ', - 42878 => 'ꝿ', - 42880 => 'ꞁ', - 42882 => 'ꞃ', - 42884 => 'ꞅ', - 42886 => 'ꞇ', - 42891 => 'ꞌ', - 42893 => 'ɥ', - 42896 => 'ꞑ', - 42898 => 'ꞓ', - 42902 => 'ꞗ', - 42904 => 'ꞙ', - 42906 => 'ꞛ', - 42908 => 'ꞝ', - 42910 => 'ꞟ', - 42912 => 'ꞡ', - 42914 => 'ꞣ', - 42916 => 'ꞥ', - 42918 => 'ꞧ', - 42920 => 'ꞩ', - 42922 => 'ɦ', - 42923 => 'ɜ', - 42924 => 'ɡ', - 42925 => 'ɬ', - 42926 => 'ɪ', - 42928 => 'ʞ', - 42929 => 'ʇ', - 42930 => 'ʝ', - 42931 => 'ꭓ', - 42932 => 'ꞵ', - 42934 => 'ꞷ', - 42936 => 'ꞹ', - 42938 => 'ꞻ', - 42940 => 'ꞽ', - 42942 => 'ꞿ', - 42946 => 'ꟃ', - 42948 => 'ꞔ', - 42949 => 'ʂ', - 42950 => 'ᶎ', - 42951 => 'ꟈ', - 42953 => 'ꟊ', - 42997 => 'ꟶ', - 43000 => 'ħ', - 43001 => 'œ', - 43868 => 'ꜧ', - 43869 => 'ꬷ', - 43870 => 'ɫ', - 43871 => 'ꭒ', - 43881 => 'ʍ', - 43888 => 'Ꭰ', - 43889 => 'Ꭱ', - 43890 => 'Ꭲ', - 43891 => 'Ꭳ', - 43892 => 'Ꭴ', - 43893 => 'Ꭵ', - 43894 => 'Ꭶ', - 43895 => 'Ꭷ', - 43896 => 'Ꭸ', - 43897 => 'Ꭹ', - 43898 => 'Ꭺ', - 43899 => 'Ꭻ', - 43900 => 'Ꭼ', - 43901 => 'Ꭽ', - 43902 => 'Ꭾ', - 43903 => 'Ꭿ', - 43904 => 'Ꮀ', - 43905 => 'Ꮁ', - 43906 => 'Ꮂ', - 43907 => 'Ꮃ', - 43908 => 'Ꮄ', - 43909 => 'Ꮅ', - 43910 => 'Ꮆ', - 43911 => 'Ꮇ', - 43912 => 'Ꮈ', - 43913 => 'Ꮉ', - 43914 => 'Ꮊ', - 43915 => 'Ꮋ', - 43916 => 'Ꮌ', - 43917 => 'Ꮍ', - 43918 => 'Ꮎ', - 43919 => 'Ꮏ', - 43920 => 'Ꮐ', - 43921 => 'Ꮑ', - 43922 => 'Ꮒ', - 43923 => 'Ꮓ', - 43924 => 'Ꮔ', - 43925 => 'Ꮕ', - 43926 => 'Ꮖ', - 43927 => 'Ꮗ', - 43928 => 'Ꮘ', - 43929 => 'Ꮙ', - 43930 => 'Ꮚ', - 43931 => 'Ꮛ', - 43932 => 'Ꮜ', - 43933 => 'Ꮝ', - 43934 => 'Ꮞ', - 43935 => 'Ꮟ', - 43936 => 'Ꮠ', - 43937 => 'Ꮡ', - 43938 => 'Ꮢ', - 43939 => 'Ꮣ', - 43940 => 'Ꮤ', - 43941 => 'Ꮥ', - 43942 => 'Ꮦ', - 43943 => 'Ꮧ', - 43944 => 'Ꮨ', - 43945 => 'Ꮩ', - 43946 => 'Ꮪ', - 43947 => 'Ꮫ', - 43948 => 'Ꮬ', - 43949 => 'Ꮭ', - 43950 => 'Ꮮ', - 43951 => 'Ꮯ', - 43952 => 'Ꮰ', - 43953 => 'Ꮱ', - 43954 => 'Ꮲ', - 43955 => 'Ꮳ', - 43956 => 'Ꮴ', - 43957 => 'Ꮵ', - 43958 => 'Ꮶ', - 43959 => 'Ꮷ', - 43960 => 'Ꮸ', - 43961 => 'Ꮹ', - 43962 => 'Ꮺ', - 43963 => 'Ꮻ', - 43964 => 'Ꮼ', - 43965 => 'Ꮽ', - 43966 => 'Ꮾ', - 43967 => 'Ꮿ', - 63744 => '豈', - 63745 => '更', - 63746 => '車', - 63747 => '賈', - 63748 => '滑', - 63749 => '串', - 63750 => '句', - 63751 => '龜', - 63752 => '龜', - 63753 => '契', - 63754 => '金', - 63755 => '喇', - 63756 => '奈', - 63757 => '懶', - 63758 => '癩', - 63759 => '羅', - 63760 => '蘿', - 63761 => '螺', - 63762 => '裸', - 63763 => '邏', - 63764 => '樂', - 63765 => '洛', - 63766 => '烙', - 63767 => '珞', - 63768 => '落', - 63769 => '酪', - 63770 => '駱', - 63771 => '亂', - 63772 => '卵', - 63773 => '欄', - 63774 => '爛', - 63775 => '蘭', - 63776 => '鸞', - 63777 => '嵐', - 63778 => '濫', - 63779 => '藍', - 63780 => '襤', - 63781 => '拉', - 63782 => '臘', - 63783 => '蠟', - 63784 => '廊', - 63785 => '朗', - 63786 => '浪', - 63787 => '狼', - 63788 => '郎', - 63789 => '來', - 63790 => '冷', - 63791 => '勞', - 63792 => '擄', - 63793 => '櫓', - 63794 => '爐', - 63795 => '盧', - 63796 => '老', - 63797 => '蘆', - 63798 => '虜', - 63799 => '路', - 63800 => '露', - 63801 => '魯', - 63802 => '鷺', - 63803 => '碌', - 63804 => '祿', - 63805 => '綠', - 63806 => '菉', - 63807 => '錄', - 63808 => '鹿', - 63809 => '論', - 63810 => '壟', - 63811 => '弄', - 63812 => '籠', - 63813 => '聾', - 63814 => '牢', - 63815 => '磊', - 63816 => '賂', - 63817 => '雷', - 63818 => '壘', - 63819 => '屢', - 63820 => '樓', - 63821 => '淚', - 63822 => '漏', - 63823 => '累', - 63824 => '縷', - 63825 => '陋', - 63826 => '勒', - 63827 => '肋', - 63828 => '凜', - 63829 => '凌', - 63830 => '稜', - 63831 => '綾', - 63832 => '菱', - 63833 => '陵', - 63834 => '讀', - 63835 => '拏', - 63836 => '樂', - 63837 => '諾', - 63838 => '丹', - 63839 => '寧', - 63840 => '怒', - 63841 => '率', - 63842 => '異', - 63843 => '北', - 63844 => '磻', - 63845 => '便', - 63846 => '復', - 63847 => '不', - 63848 => '泌', - 63849 => '數', - 63850 => '索', - 63851 => '參', - 63852 => '塞', - 63853 => '省', - 63854 => '葉', - 63855 => '說', - 63856 => '殺', - 63857 => '辰', - 63858 => '沈', - 63859 => '拾', - 63860 => '若', - 63861 => '掠', - 63862 => '略', - 63863 => '亮', - 63864 => '兩', - 63865 => '凉', - 63866 => '梁', - 63867 => '糧', - 63868 => '良', - 63869 => '諒', - 63870 => '量', - 63871 => '勵', - 63872 => '呂', - 63873 => '女', - 63874 => '廬', - 63875 => '旅', - 63876 => '濾', - 63877 => '礪', - 63878 => '閭', - 63879 => '驪', - 63880 => '麗', - 63881 => '黎', - 63882 => '力', - 63883 => '曆', - 63884 => '歷', - 63885 => '轢', - 63886 => '年', - 63887 => '憐', - 63888 => '戀', - 63889 => '撚', - 63890 => '漣', - 63891 => '煉', - 63892 => '璉', - 63893 => '秊', - 63894 => '練', - 63895 => '聯', - 63896 => '輦', - 63897 => '蓮', - 63898 => '連', - 63899 => '鍊', - 63900 => '列', - 63901 => '劣', - 63902 => '咽', - 63903 => '烈', - 63904 => '裂', - 63905 => '說', - 63906 => '廉', - 63907 => '念', - 63908 => '捻', - 63909 => '殮', - 63910 => '簾', - 63911 => '獵', - 63912 => '令', - 63913 => '囹', - 63914 => '寧', - 63915 => '嶺', - 63916 => '怜', - 63917 => '玲', - 63918 => '瑩', - 63919 => '羚', - 63920 => '聆', - 63921 => '鈴', - 63922 => '零', - 63923 => '靈', - 63924 => '領', - 63925 => '例', - 63926 => '禮', - 63927 => '醴', - 63928 => '隸', - 63929 => '惡', - 63930 => '了', - 63931 => '僚', - 63932 => '寮', - 63933 => '尿', - 63934 => '料', - 63935 => '樂', - 63936 => '燎', - 63937 => '療', - 63938 => '蓼', - 63939 => '遼', - 63940 => '龍', - 63941 => '暈', - 63942 => '阮', - 63943 => '劉', - 63944 => '杻', - 63945 => '柳', - 63946 => '流', - 63947 => '溜', - 63948 => '琉', - 63949 => '留', - 63950 => '硫', - 63951 => '紐', - 63952 => '類', - 63953 => '六', - 63954 => '戮', - 63955 => '陸', - 63956 => '倫', - 63957 => '崙', - 63958 => '淪', - 63959 => '輪', - 63960 => '律', - 63961 => '慄', - 63962 => '栗', - 63963 => '率', - 63964 => '隆', - 63965 => '利', - 63966 => '吏', - 63967 => '履', - 63968 => '易', - 63969 => '李', - 63970 => '梨', - 63971 => '泥', - 63972 => '理', - 63973 => '痢', - 63974 => '罹', - 63975 => '裏', - 63976 => '裡', - 63977 => '里', - 63978 => '離', - 63979 => '匿', - 63980 => '溺', - 63981 => '吝', - 63982 => '燐', - 63983 => '璘', - 63984 => '藺', - 63985 => '隣', - 63986 => '鱗', - 63987 => '麟', - 63988 => '林', - 63989 => '淋', - 63990 => '臨', - 63991 => '立', - 63992 => '笠', - 63993 => '粒', - 63994 => '狀', - 63995 => '炙', - 63996 => '識', - 63997 => '什', - 63998 => '茶', - 63999 => '刺', - 64000 => '切', - 64001 => '度', - 64002 => '拓', - 64003 => '糖', - 64004 => '宅', - 64005 => '洞', - 64006 => '暴', - 64007 => '輻', - 64008 => '行', - 64009 => '降', - 64010 => '見', - 64011 => '廓', - 64012 => '兀', - 64013 => '嗀', - 64016 => '塚', - 64018 => '晴', - 64021 => '凞', - 64022 => '猪', - 64023 => '益', - 64024 => '礼', - 64025 => '神', - 64026 => '祥', - 64027 => '福', - 64028 => '靖', - 64029 => '精', - 64030 => '羽', - 64032 => '蘒', - 64034 => '諸', - 64037 => '逸', - 64038 => '都', - 64042 => '飯', - 64043 => '飼', - 64044 => '館', - 64045 => '鶴', - 64046 => '郞', - 64047 => '隷', - 64048 => '侮', - 64049 => '僧', - 64050 => '免', - 64051 => '勉', - 64052 => '勤', - 64053 => '卑', - 64054 => '喝', - 64055 => '嘆', - 64056 => '器', - 64057 => '塀', - 64058 => '墨', - 64059 => '層', - 64060 => '屮', - 64061 => '悔', - 64062 => '慨', - 64063 => '憎', - 64064 => '懲', - 64065 => '敏', - 64066 => '既', - 64067 => '暑', - 64068 => '梅', - 64069 => '海', - 64070 => '渚', - 64071 => '漢', - 64072 => '煮', - 64073 => '爫', - 64074 => '琢', - 64075 => '碑', - 64076 => '社', - 64077 => '祉', - 64078 => '祈', - 64079 => '祐', - 64080 => '祖', - 64081 => '祝', - 64082 => '禍', - 64083 => '禎', - 64084 => '穀', - 64085 => '突', - 64086 => '節', - 64087 => '練', - 64088 => '縉', - 64089 => '繁', - 64090 => '署', - 64091 => '者', - 64092 => '臭', - 64093 => '艹', - 64094 => '艹', - 64095 => '著', - 64096 => '褐', - 64097 => '視', - 64098 => '謁', - 64099 => '謹', - 64100 => '賓', - 64101 => '贈', - 64102 => '辶', - 64103 => '逸', - 64104 => '難', - 64105 => '響', - 64106 => '頻', - 64107 => '恵', - 64108 => '𤋮', - 64109 => '舘', - 64112 => '並', - 64113 => '况', - 64114 => '全', - 64115 => '侀', - 64116 => '充', - 64117 => '冀', - 64118 => '勇', - 64119 => '勺', - 64120 => '喝', - 64121 => '啕', - 64122 => '喙', - 64123 => '嗢', - 64124 => '塚', - 64125 => '墳', - 64126 => '奄', - 64127 => '奔', - 64128 => '婢', - 64129 => '嬨', - 64130 => '廒', - 64131 => '廙', - 64132 => '彩', - 64133 => '徭', - 64134 => '惘', - 64135 => '慎', - 64136 => '愈', - 64137 => '憎', - 64138 => '慠', - 64139 => '懲', - 64140 => '戴', - 64141 => '揄', - 64142 => '搜', - 64143 => '摒', - 64144 => '敖', - 64145 => '晴', - 64146 => '朗', - 64147 => '望', - 64148 => '杖', - 64149 => '歹', - 64150 => '殺', - 64151 => '流', - 64152 => '滛', - 64153 => '滋', - 64154 => '漢', - 64155 => '瀞', - 64156 => '煮', - 64157 => '瞧', - 64158 => '爵', - 64159 => '犯', - 64160 => '猪', - 64161 => '瑱', - 64162 => '甆', - 64163 => '画', - 64164 => '瘝', - 64165 => '瘟', - 64166 => '益', - 64167 => '盛', - 64168 => '直', - 64169 => '睊', - 64170 => '着', - 64171 => '磌', - 64172 => '窱', - 64173 => '節', - 64174 => '类', - 64175 => '絛', - 64176 => '練', - 64177 => '缾', - 64178 => '者', - 64179 => '荒', - 64180 => '華', - 64181 => '蝹', - 64182 => '襁', - 64183 => '覆', - 64184 => '視', - 64185 => '調', - 64186 => '諸', - 64187 => '請', - 64188 => '謁', - 64189 => '諾', - 64190 => '諭', - 64191 => '謹', - 64192 => '變', - 64193 => '贈', - 64194 => '輸', - 64195 => '遲', - 64196 => '醙', - 64197 => '鉶', - 64198 => '陼', - 64199 => '難', - 64200 => '靖', - 64201 => '韛', - 64202 => '響', - 64203 => '頋', - 64204 => '頻', - 64205 => '鬒', - 64206 => '龜', - 64207 => '𢡊', - 64208 => '𢡄', - 64209 => '𣏕', - 64210 => '㮝', - 64211 => '䀘', - 64212 => '䀹', - 64213 => '𥉉', - 64214 => '𥳐', - 64215 => '𧻓', - 64216 => '齃', - 64217 => '龎', - 64256 => 'ff', - 64257 => 'fi', - 64258 => 'fl', - 64259 => 'ffi', - 64260 => 'ffl', - 64261 => 'st', - 64262 => 'st', - 64275 => 'մն', - 64276 => 'մե', - 64277 => 'մի', - 64278 => 'վն', - 64279 => 'մխ', - 64285 => 'יִ', - 64287 => 'ײַ', - 64288 => 'ע', - 64289 => 'א', - 64290 => 'ד', - 64291 => 'ה', - 64292 => 'כ', - 64293 => 'ל', - 64294 => 'ם', - 64295 => 'ר', - 64296 => 'ת', - 64298 => 'שׁ', - 64299 => 'שׂ', - 64300 => 'שּׁ', - 64301 => 'שּׂ', - 64302 => 'אַ', - 64303 => 'אָ', - 64304 => 'אּ', - 64305 => 'בּ', - 64306 => 'גּ', - 64307 => 'דּ', - 64308 => 'הּ', - 64309 => 'וּ', - 64310 => 'זּ', - 64312 => 'טּ', - 64313 => 'יּ', - 64314 => 'ךּ', - 64315 => 'כּ', - 64316 => 'לּ', - 64318 => 'מּ', - 64320 => 'נּ', - 64321 => 'סּ', - 64323 => 'ףּ', - 64324 => 'פּ', - 64326 => 'צּ', - 64327 => 'קּ', - 64328 => 'רּ', - 64329 => 'שּ', - 64330 => 'תּ', - 64331 => 'וֹ', - 64332 => 'בֿ', - 64333 => 'כֿ', - 64334 => 'פֿ', - 64335 => 'אל', - 64336 => 'ٱ', - 64337 => 'ٱ', - 64338 => 'ٻ', - 64339 => 'ٻ', - 64340 => 'ٻ', - 64341 => 'ٻ', - 64342 => 'پ', - 64343 => 'پ', - 64344 => 'پ', - 64345 => 'پ', - 64346 => 'ڀ', - 64347 => 'ڀ', - 64348 => 'ڀ', - 64349 => 'ڀ', - 64350 => 'ٺ', - 64351 => 'ٺ', - 64352 => 'ٺ', - 64353 => 'ٺ', - 64354 => 'ٿ', - 64355 => 'ٿ', - 64356 => 'ٿ', - 64357 => 'ٿ', - 64358 => 'ٹ', - 64359 => 'ٹ', - 64360 => 'ٹ', - 64361 => 'ٹ', - 64362 => 'ڤ', - 64363 => 'ڤ', - 64364 => 'ڤ', - 64365 => 'ڤ', - 64366 => 'ڦ', - 64367 => 'ڦ', - 64368 => 'ڦ', - 64369 => 'ڦ', - 64370 => 'ڄ', - 64371 => 'ڄ', - 64372 => 'ڄ', - 64373 => 'ڄ', - 64374 => 'ڃ', - 64375 => 'ڃ', - 64376 => 'ڃ', - 64377 => 'ڃ', - 64378 => 'چ', - 64379 => 'چ', - 64380 => 'چ', - 64381 => 'چ', - 64382 => 'ڇ', - 64383 => 'ڇ', - 64384 => 'ڇ', - 64385 => 'ڇ', - 64386 => 'ڍ', - 64387 => 'ڍ', - 64388 => 'ڌ', - 64389 => 'ڌ', - 64390 => 'ڎ', - 64391 => 'ڎ', - 64392 => 'ڈ', - 64393 => 'ڈ', - 64394 => 'ژ', - 64395 => 'ژ', - 64396 => 'ڑ', - 64397 => 'ڑ', - 64398 => 'ک', - 64399 => 'ک', - 64400 => 'ک', - 64401 => 'ک', - 64402 => 'گ', - 64403 => 'گ', - 64404 => 'گ', - 64405 => 'گ', - 64406 => 'ڳ', - 64407 => 'ڳ', - 64408 => 'ڳ', - 64409 => 'ڳ', - 64410 => 'ڱ', - 64411 => 'ڱ', - 64412 => 'ڱ', - 64413 => 'ڱ', - 64414 => 'ں', - 64415 => 'ں', - 64416 => 'ڻ', - 64417 => 'ڻ', - 64418 => 'ڻ', - 64419 => 'ڻ', - 64420 => 'ۀ', - 64421 => 'ۀ', - 64422 => 'ہ', - 64423 => 'ہ', - 64424 => 'ہ', - 64425 => 'ہ', - 64426 => 'ھ', - 64427 => 'ھ', - 64428 => 'ھ', - 64429 => 'ھ', - 64430 => 'ے', - 64431 => 'ے', - 64432 => 'ۓ', - 64433 => 'ۓ', - 64467 => 'ڭ', - 64468 => 'ڭ', - 64469 => 'ڭ', - 64470 => 'ڭ', - 64471 => 'ۇ', - 64472 => 'ۇ', - 64473 => 'ۆ', - 64474 => 'ۆ', - 64475 => 'ۈ', - 64476 => 'ۈ', - 64477 => 'ۇٴ', - 64478 => 'ۋ', - 64479 => 'ۋ', - 64480 => 'ۅ', - 64481 => 'ۅ', - 64482 => 'ۉ', - 64483 => 'ۉ', - 64484 => 'ې', - 64485 => 'ې', - 64486 => 'ې', - 64487 => 'ې', - 64488 => 'ى', - 64489 => 'ى', - 64490 => 'ئا', - 64491 => 'ئا', - 64492 => 'ئە', - 64493 => 'ئە', - 64494 => 'ئو', - 64495 => 'ئو', - 64496 => 'ئۇ', - 64497 => 'ئۇ', - 64498 => 'ئۆ', - 64499 => 'ئۆ', - 64500 => 'ئۈ', - 64501 => 'ئۈ', - 64502 => 'ئې', - 64503 => 'ئې', - 64504 => 'ئې', - 64505 => 'ئى', - 64506 => 'ئى', - 64507 => 'ئى', - 64508 => 'ی', - 64509 => 'ی', - 64510 => 'ی', - 64511 => 'ی', - 64512 => 'ئج', - 64513 => 'ئح', - 64514 => 'ئم', - 64515 => 'ئى', - 64516 => 'ئي', - 64517 => 'بج', - 64518 => 'بح', - 64519 => 'بخ', - 64520 => 'بم', - 64521 => 'بى', - 64522 => 'بي', - 64523 => 'تج', - 64524 => 'تح', - 64525 => 'تخ', - 64526 => 'تم', - 64527 => 'تى', - 64528 => 'تي', - 64529 => 'ثج', - 64530 => 'ثم', - 64531 => 'ثى', - 64532 => 'ثي', - 64533 => 'جح', - 64534 => 'جم', - 64535 => 'حج', - 64536 => 'حم', - 64537 => 'خج', - 64538 => 'خح', - 64539 => 'خم', - 64540 => 'سج', - 64541 => 'سح', - 64542 => 'سخ', - 64543 => 'سم', - 64544 => 'صح', - 64545 => 'صم', - 64546 => 'ضج', - 64547 => 'ضح', - 64548 => 'ضخ', - 64549 => 'ضم', - 64550 => 'طح', - 64551 => 'طم', - 64552 => 'ظم', - 64553 => 'عج', - 64554 => 'عم', - 64555 => 'غج', - 64556 => 'غم', - 64557 => 'فج', - 64558 => 'فح', - 64559 => 'فخ', - 64560 => 'فم', - 64561 => 'فى', - 64562 => 'في', - 64563 => 'قح', - 64564 => 'قم', - 64565 => 'قى', - 64566 => 'قي', - 64567 => 'كا', - 64568 => 'كج', - 64569 => 'كح', - 64570 => 'كخ', - 64571 => 'كل', - 64572 => 'كم', - 64573 => 'كى', - 64574 => 'كي', - 64575 => 'لج', - 64576 => 'لح', - 64577 => 'لخ', - 64578 => 'لم', - 64579 => 'لى', - 64580 => 'لي', - 64581 => 'مج', - 64582 => 'مح', - 64583 => 'مخ', - 64584 => 'مم', - 64585 => 'مى', - 64586 => 'مي', - 64587 => 'نج', - 64588 => 'نح', - 64589 => 'نخ', - 64590 => 'نم', - 64591 => 'نى', - 64592 => 'ني', - 64593 => 'هج', - 64594 => 'هم', - 64595 => 'هى', - 64596 => 'هي', - 64597 => 'يج', - 64598 => 'يح', - 64599 => 'يخ', - 64600 => 'يم', - 64601 => 'يى', - 64602 => 'يي', - 64603 => 'ذٰ', - 64604 => 'رٰ', - 64605 => 'ىٰ', - 64612 => 'ئر', - 64613 => 'ئز', - 64614 => 'ئم', - 64615 => 'ئن', - 64616 => 'ئى', - 64617 => 'ئي', - 64618 => 'بر', - 64619 => 'بز', - 64620 => 'بم', - 64621 => 'بن', - 64622 => 'بى', - 64623 => 'بي', - 64624 => 'تر', - 64625 => 'تز', - 64626 => 'تم', - 64627 => 'تن', - 64628 => 'تى', - 64629 => 'تي', - 64630 => 'ثر', - 64631 => 'ثز', - 64632 => 'ثم', - 64633 => 'ثن', - 64634 => 'ثى', - 64635 => 'ثي', - 64636 => 'فى', - 64637 => 'في', - 64638 => 'قى', - 64639 => 'قي', - 64640 => 'كا', - 64641 => 'كل', - 64642 => 'كم', - 64643 => 'كى', - 64644 => 'كي', - 64645 => 'لم', - 64646 => 'لى', - 64647 => 'لي', - 64648 => 'ما', - 64649 => 'مم', - 64650 => 'نر', - 64651 => 'نز', - 64652 => 'نم', - 64653 => 'نن', - 64654 => 'نى', - 64655 => 'ني', - 64656 => 'ىٰ', - 64657 => 'ير', - 64658 => 'يز', - 64659 => 'يم', - 64660 => 'ين', - 64661 => 'يى', - 64662 => 'يي', - 64663 => 'ئج', - 64664 => 'ئح', - 64665 => 'ئخ', - 64666 => 'ئم', - 64667 => 'ئه', - 64668 => 'بج', - 64669 => 'بح', - 64670 => 'بخ', - 64671 => 'بم', - 64672 => 'به', - 64673 => 'تج', - 64674 => 'تح', - 64675 => 'تخ', - 64676 => 'تم', - 64677 => 'ته', - 64678 => 'ثم', - 64679 => 'جح', - 64680 => 'جم', - 64681 => 'حج', - 64682 => 'حم', - 64683 => 'خج', - 64684 => 'خم', - 64685 => 'سج', - 64686 => 'سح', - 64687 => 'سخ', - 64688 => 'سم', - 64689 => 'صح', - 64690 => 'صخ', - 64691 => 'صم', - 64692 => 'ضج', - 64693 => 'ضح', - 64694 => 'ضخ', - 64695 => 'ضم', - 64696 => 'طح', - 64697 => 'ظم', - 64698 => 'عج', - 64699 => 'عم', - 64700 => 'غج', - 64701 => 'غم', - 64702 => 'فج', - 64703 => 'فح', - 64704 => 'فخ', - 64705 => 'فم', - 64706 => 'قح', - 64707 => 'قم', - 64708 => 'كج', - 64709 => 'كح', - 64710 => 'كخ', - 64711 => 'كل', - 64712 => 'كم', - 64713 => 'لج', - 64714 => 'لح', - 64715 => 'لخ', - 64716 => 'لم', - 64717 => 'له', - 64718 => 'مج', - 64719 => 'مح', - 64720 => 'مخ', - 64721 => 'مم', - 64722 => 'نج', - 64723 => 'نح', - 64724 => 'نخ', - 64725 => 'نم', - 64726 => 'نه', - 64727 => 'هج', - 64728 => 'هم', - 64729 => 'هٰ', - 64730 => 'يج', - 64731 => 'يح', - 64732 => 'يخ', - 64733 => 'يم', - 64734 => 'يه', - 64735 => 'ئم', - 64736 => 'ئه', - 64737 => 'بم', - 64738 => 'به', - 64739 => 'تم', - 64740 => 'ته', - 64741 => 'ثم', - 64742 => 'ثه', - 64743 => 'سم', - 64744 => 'سه', - 64745 => 'شم', - 64746 => 'شه', - 64747 => 'كل', - 64748 => 'كم', - 64749 => 'لم', - 64750 => 'نم', - 64751 => 'نه', - 64752 => 'يم', - 64753 => 'يه', - 64754 => 'ـَّ', - 64755 => 'ـُّ', - 64756 => 'ـِّ', - 64757 => 'طى', - 64758 => 'طي', - 64759 => 'عى', - 64760 => 'عي', - 64761 => 'غى', - 64762 => 'غي', - 64763 => 'سى', - 64764 => 'سي', - 64765 => 'شى', - 64766 => 'شي', - 64767 => 'حى', - 64768 => 'حي', - 64769 => 'جى', - 64770 => 'جي', - 64771 => 'خى', - 64772 => 'خي', - 64773 => 'صى', - 64774 => 'صي', - 64775 => 'ضى', - 64776 => 'ضي', - 64777 => 'شج', - 64778 => 'شح', - 64779 => 'شخ', - 64780 => 'شم', - 64781 => 'شر', - 64782 => 'سر', - 64783 => 'صر', - 64784 => 'ضر', - 64785 => 'طى', - 64786 => 'طي', - 64787 => 'عى', - 64788 => 'عي', - 64789 => 'غى', - 64790 => 'غي', - 64791 => 'سى', - 64792 => 'سي', - 64793 => 'شى', - 64794 => 'شي', - 64795 => 'حى', - 64796 => 'حي', - 64797 => 'جى', - 64798 => 'جي', - 64799 => 'خى', - 64800 => 'خي', - 64801 => 'صى', - 64802 => 'صي', - 64803 => 'ضى', - 64804 => 'ضي', - 64805 => 'شج', - 64806 => 'شح', - 64807 => 'شخ', - 64808 => 'شم', - 64809 => 'شر', - 64810 => 'سر', - 64811 => 'صر', - 64812 => 'ضر', - 64813 => 'شج', - 64814 => 'شح', - 64815 => 'شخ', - 64816 => 'شم', - 64817 => 'سه', - 64818 => 'شه', - 64819 => 'طم', - 64820 => 'سج', - 64821 => 'سح', - 64822 => 'سخ', - 64823 => 'شج', - 64824 => 'شح', - 64825 => 'شخ', - 64826 => 'طم', - 64827 => 'ظم', - 64828 => 'اً', - 64829 => 'اً', - 64848 => 'تجم', - 64849 => 'تحج', - 64850 => 'تحج', - 64851 => 'تحم', - 64852 => 'تخم', - 64853 => 'تمج', - 64854 => 'تمح', - 64855 => 'تمخ', - 64856 => 'جمح', - 64857 => 'جمح', - 64858 => 'حمي', - 64859 => 'حمى', - 64860 => 'سحج', - 64861 => 'سجح', - 64862 => 'سجى', - 64863 => 'سمح', - 64864 => 'سمح', - 64865 => 'سمج', - 64866 => 'سمم', - 64867 => 'سمم', - 64868 => 'صحح', - 64869 => 'صحح', - 64870 => 'صمم', - 64871 => 'شحم', - 64872 => 'شحم', - 64873 => 'شجي', - 64874 => 'شمخ', - 64875 => 'شمخ', - 64876 => 'شمم', - 64877 => 'شمم', - 64878 => 'ضحى', - 64879 => 'ضخم', - 64880 => 'ضخم', - 64881 => 'طمح', - 64882 => 'طمح', - 64883 => 'طمم', - 64884 => 'طمي', - 64885 => 'عجم', - 64886 => 'عمم', - 64887 => 'عمم', - 64888 => 'عمى', - 64889 => 'غمم', - 64890 => 'غمي', - 64891 => 'غمى', - 64892 => 'فخم', - 64893 => 'فخم', - 64894 => 'قمح', - 64895 => 'قمم', - 64896 => 'لحم', - 64897 => 'لحي', - 64898 => 'لحى', - 64899 => 'لجج', - 64900 => 'لجج', - 64901 => 'لخم', - 64902 => 'لخم', - 64903 => 'لمح', - 64904 => 'لمح', - 64905 => 'محج', - 64906 => 'محم', - 64907 => 'محي', - 64908 => 'مجح', - 64909 => 'مجم', - 64910 => 'مخج', - 64911 => 'مخم', - 64914 => 'مجخ', - 64915 => 'همج', - 64916 => 'همم', - 64917 => 'نحم', - 64918 => 'نحى', - 64919 => 'نجم', - 64920 => 'نجم', - 64921 => 'نجى', - 64922 => 'نمي', - 64923 => 'نمى', - 64924 => 'يمم', - 64925 => 'يمم', - 64926 => 'بخي', - 64927 => 'تجي', - 64928 => 'تجى', - 64929 => 'تخي', - 64930 => 'تخى', - 64931 => 'تمي', - 64932 => 'تمى', - 64933 => 'جمي', - 64934 => 'جحى', - 64935 => 'جمى', - 64936 => 'سخى', - 64937 => 'صحي', - 64938 => 'شحي', - 64939 => 'ضحي', - 64940 => 'لجي', - 64941 => 'لمي', - 64942 => 'يحي', - 64943 => 'يجي', - 64944 => 'يمي', - 64945 => 'ممي', - 64946 => 'قمي', - 64947 => 'نحي', - 64948 => 'قمح', - 64949 => 'لحم', - 64950 => 'عمي', - 64951 => 'كمي', - 64952 => 'نجح', - 64953 => 'مخي', - 64954 => 'لجم', - 64955 => 'كمم', - 64956 => 'لجم', - 64957 => 'نجح', - 64958 => 'جحي', - 64959 => 'حجي', - 64960 => 'مجي', - 64961 => 'فمي', - 64962 => 'بحي', - 64963 => 'كمم', - 64964 => 'عجم', - 64965 => 'صمم', - 64966 => 'سخي', - 64967 => 'نجي', - 65008 => 'صلے', - 65009 => 'قلے', - 65010 => 'الله', - 65011 => 'اكبر', - 65012 => 'محمد', - 65013 => 'صلعم', - 65014 => 'رسول', - 65015 => 'عليه', - 65016 => 'وسلم', - 65017 => 'صلى', - 65020 => 'ریال', - 65041 => '、', - 65047 => '〖', - 65048 => '〗', - 65073 => '—', - 65074 => '–', - 65081 => '〔', - 65082 => '〕', - 65083 => '【', - 65084 => '】', - 65085 => '《', - 65086 => '》', - 65087 => '〈', - 65088 => '〉', - 65089 => '「', - 65090 => '」', - 65091 => '『', - 65092 => '』', - 65105 => '、', - 65112 => '—', - 65117 => '〔', - 65118 => '〕', - 65123 => '-', - 65137 => 'ـً', - 65143 => 'ـَ', - 65145 => 'ـُ', - 65147 => 'ـِ', - 65149 => 'ـّ', - 65151 => 'ـْ', - 65152 => 'ء', - 65153 => 'آ', - 65154 => 'آ', - 65155 => 'أ', - 65156 => 'أ', - 65157 => 'ؤ', - 65158 => 'ؤ', - 65159 => 'إ', - 65160 => 'إ', - 65161 => 'ئ', - 65162 => 'ئ', - 65163 => 'ئ', - 65164 => 'ئ', - 65165 => 'ا', - 65166 => 'ا', - 65167 => 'ب', - 65168 => 'ب', - 65169 => 'ب', - 65170 => 'ب', - 65171 => 'ة', - 65172 => 'ة', - 65173 => 'ت', - 65174 => 'ت', - 65175 => 'ت', - 65176 => 'ت', - 65177 => 'ث', - 65178 => 'ث', - 65179 => 'ث', - 65180 => 'ث', - 65181 => 'ج', - 65182 => 'ج', - 65183 => 'ج', - 65184 => 'ج', - 65185 => 'ح', - 65186 => 'ح', - 65187 => 'ح', - 65188 => 'ح', - 65189 => 'خ', - 65190 => 'خ', - 65191 => 'خ', - 65192 => 'خ', - 65193 => 'د', - 65194 => 'د', - 65195 => 'ذ', - 65196 => 'ذ', - 65197 => 'ر', - 65198 => 'ر', - 65199 => 'ز', - 65200 => 'ز', - 65201 => 'س', - 65202 => 'س', - 65203 => 'س', - 65204 => 'س', - 65205 => 'ش', - 65206 => 'ش', - 65207 => 'ش', - 65208 => 'ش', - 65209 => 'ص', - 65210 => 'ص', - 65211 => 'ص', - 65212 => 'ص', - 65213 => 'ض', - 65214 => 'ض', - 65215 => 'ض', - 65216 => 'ض', - 65217 => 'ط', - 65218 => 'ط', - 65219 => 'ط', - 65220 => 'ط', - 65221 => 'ظ', - 65222 => 'ظ', - 65223 => 'ظ', - 65224 => 'ظ', - 65225 => 'ع', - 65226 => 'ع', - 65227 => 'ع', - 65228 => 'ع', - 65229 => 'غ', - 65230 => 'غ', - 65231 => 'غ', - 65232 => 'غ', - 65233 => 'ف', - 65234 => 'ف', - 65235 => 'ف', - 65236 => 'ف', - 65237 => 'ق', - 65238 => 'ق', - 65239 => 'ق', - 65240 => 'ق', - 65241 => 'ك', - 65242 => 'ك', - 65243 => 'ك', - 65244 => 'ك', - 65245 => 'ل', - 65246 => 'ل', - 65247 => 'ل', - 65248 => 'ل', - 65249 => 'م', - 65250 => 'م', - 65251 => 'م', - 65252 => 'م', - 65253 => 'ن', - 65254 => 'ن', - 65255 => 'ن', - 65256 => 'ن', - 65257 => 'ه', - 65258 => 'ه', - 65259 => 'ه', - 65260 => 'ه', - 65261 => 'و', - 65262 => 'و', - 65263 => 'ى', - 65264 => 'ى', - 65265 => 'ي', - 65266 => 'ي', - 65267 => 'ي', - 65268 => 'ي', - 65269 => 'لآ', - 65270 => 'لآ', - 65271 => 'لأ', - 65272 => 'لأ', - 65273 => 'لإ', - 65274 => 'لإ', - 65275 => 'لا', - 65276 => 'لا', - 65293 => '-', - 65294 => '.', - 65296 => '0', - 65297 => '1', - 65298 => '2', - 65299 => '3', - 65300 => '4', - 65301 => '5', - 65302 => '6', - 65303 => '7', - 65304 => '8', - 65305 => '9', - 65313 => 'a', - 65314 => 'b', - 65315 => 'c', - 65316 => 'd', - 65317 => 'e', - 65318 => 'f', - 65319 => 'g', - 65320 => 'h', - 65321 => 'i', - 65322 => 'j', - 65323 => 'k', - 65324 => 'l', - 65325 => 'm', - 65326 => 'n', - 65327 => 'o', - 65328 => 'p', - 65329 => 'q', - 65330 => 'r', - 65331 => 's', - 65332 => 't', - 65333 => 'u', - 65334 => 'v', - 65335 => 'w', - 65336 => 'x', - 65337 => 'y', - 65338 => 'z', - 65345 => 'a', - 65346 => 'b', - 65347 => 'c', - 65348 => 'd', - 65349 => 'e', - 65350 => 'f', - 65351 => 'g', - 65352 => 'h', - 65353 => 'i', - 65354 => 'j', - 65355 => 'k', - 65356 => 'l', - 65357 => 'm', - 65358 => 'n', - 65359 => 'o', - 65360 => 'p', - 65361 => 'q', - 65362 => 'r', - 65363 => 's', - 65364 => 't', - 65365 => 'u', - 65366 => 'v', - 65367 => 'w', - 65368 => 'x', - 65369 => 'y', - 65370 => 'z', - 65375 => '⦅', - 65376 => '⦆', - 65377 => '.', - 65378 => '「', - 65379 => '」', - 65380 => '、', - 65381 => '・', - 65382 => 'ヲ', - 65383 => 'ァ', - 65384 => 'ィ', - 65385 => 'ゥ', - 65386 => 'ェ', - 65387 => 'ォ', - 65388 => 'ャ', - 65389 => 'ュ', - 65390 => 'ョ', - 65391 => 'ッ', - 65392 => 'ー', - 65393 => 'ア', - 65394 => 'イ', - 65395 => 'ウ', - 65396 => 'エ', - 65397 => 'オ', - 65398 => 'カ', - 65399 => 'キ', - 65400 => 'ク', - 65401 => 'ケ', - 65402 => 'コ', - 65403 => 'サ', - 65404 => 'シ', - 65405 => 'ス', - 65406 => 'セ', - 65407 => 'ソ', - 65408 => 'タ', - 65409 => 'チ', - 65410 => 'ツ', - 65411 => 'テ', - 65412 => 'ト', - 65413 => 'ナ', - 65414 => 'ニ', - 65415 => 'ヌ', - 65416 => 'ネ', - 65417 => 'ノ', - 65418 => 'ハ', - 65419 => 'ヒ', - 65420 => 'フ', - 65421 => 'ヘ', - 65422 => 'ホ', - 65423 => 'マ', - 65424 => 'ミ', - 65425 => 'ム', - 65426 => 'メ', - 65427 => 'モ', - 65428 => 'ヤ', - 65429 => 'ユ', - 65430 => 'ヨ', - 65431 => 'ラ', - 65432 => 'リ', - 65433 => 'ル', - 65434 => 'レ', - 65435 => 'ロ', - 65436 => 'ワ', - 65437 => 'ン', - 65438 => '゙', - 65439 => '゚', - 65441 => 'ᄀ', - 65442 => 'ᄁ', - 65443 => 'ᆪ', - 65444 => 'ᄂ', - 65445 => 'ᆬ', - 65446 => 'ᆭ', - 65447 => 'ᄃ', - 65448 => 'ᄄ', - 65449 => 'ᄅ', - 65450 => 'ᆰ', - 65451 => 'ᆱ', - 65452 => 'ᆲ', - 65453 => 'ᆳ', - 65454 => 'ᆴ', - 65455 => 'ᆵ', - 65456 => 'ᄚ', - 65457 => 'ᄆ', - 65458 => 'ᄇ', - 65459 => 'ᄈ', - 65460 => 'ᄡ', - 65461 => 'ᄉ', - 65462 => 'ᄊ', - 65463 => 'ᄋ', - 65464 => 'ᄌ', - 65465 => 'ᄍ', - 65466 => 'ᄎ', - 65467 => 'ᄏ', - 65468 => 'ᄐ', - 65469 => 'ᄑ', - 65470 => 'ᄒ', - 65474 => 'ᅡ', - 65475 => 'ᅢ', - 65476 => 'ᅣ', - 65477 => 'ᅤ', - 65478 => 'ᅥ', - 65479 => 'ᅦ', - 65482 => 'ᅧ', - 65483 => 'ᅨ', - 65484 => 'ᅩ', - 65485 => 'ᅪ', - 65486 => 'ᅫ', - 65487 => 'ᅬ', - 65490 => 'ᅭ', - 65491 => 'ᅮ', - 65492 => 'ᅯ', - 65493 => 'ᅰ', - 65494 => 'ᅱ', - 65495 => 'ᅲ', - 65498 => 'ᅳ', - 65499 => 'ᅴ', - 65500 => 'ᅵ', - 65504 => '¢', - 65505 => '£', - 65506 => '¬', - 65508 => '¦', - 65509 => '¥', - 65510 => '₩', - 65512 => '│', - 65513 => '←', - 65514 => '↑', - 65515 => '→', - 65516 => '↓', - 65517 => '■', - 65518 => '○', - 66560 => '𐐨', - 66561 => '𐐩', - 66562 => '𐐪', - 66563 => '𐐫', - 66564 => '𐐬', - 66565 => '𐐭', - 66566 => '𐐮', - 66567 => '𐐯', - 66568 => '𐐰', - 66569 => '𐐱', - 66570 => '𐐲', - 66571 => '𐐳', - 66572 => '𐐴', - 66573 => '𐐵', - 66574 => '𐐶', - 66575 => '𐐷', - 66576 => '𐐸', - 66577 => '𐐹', - 66578 => '𐐺', - 66579 => '𐐻', - 66580 => '𐐼', - 66581 => '𐐽', - 66582 => '𐐾', - 66583 => '𐐿', - 66584 => '𐑀', - 66585 => '𐑁', - 66586 => '𐑂', - 66587 => '𐑃', - 66588 => '𐑄', - 66589 => '𐑅', - 66590 => '𐑆', - 66591 => '𐑇', - 66592 => '𐑈', - 66593 => '𐑉', - 66594 => '𐑊', - 66595 => '𐑋', - 66596 => '𐑌', - 66597 => '𐑍', - 66598 => '𐑎', - 66599 => '𐑏', - 66736 => '𐓘', - 66737 => '𐓙', - 66738 => '𐓚', - 66739 => '𐓛', - 66740 => '𐓜', - 66741 => '𐓝', - 66742 => '𐓞', - 66743 => '𐓟', - 66744 => '𐓠', - 66745 => '𐓡', - 66746 => '𐓢', - 66747 => '𐓣', - 66748 => '𐓤', - 66749 => '𐓥', - 66750 => '𐓦', - 66751 => '𐓧', - 66752 => '𐓨', - 66753 => '𐓩', - 66754 => '𐓪', - 66755 => '𐓫', - 66756 => '𐓬', - 66757 => '𐓭', - 66758 => '𐓮', - 66759 => '𐓯', - 66760 => '𐓰', - 66761 => '𐓱', - 66762 => '𐓲', - 66763 => '𐓳', - 66764 => '𐓴', - 66765 => '𐓵', - 66766 => '𐓶', - 66767 => '𐓷', - 66768 => '𐓸', - 66769 => '𐓹', - 66770 => '𐓺', - 66771 => '𐓻', - 68736 => '𐳀', - 68737 => '𐳁', - 68738 => '𐳂', - 68739 => '𐳃', - 68740 => '𐳄', - 68741 => '𐳅', - 68742 => '𐳆', - 68743 => '𐳇', - 68744 => '𐳈', - 68745 => '𐳉', - 68746 => '𐳊', - 68747 => '𐳋', - 68748 => '𐳌', - 68749 => '𐳍', - 68750 => '𐳎', - 68751 => '𐳏', - 68752 => '𐳐', - 68753 => '𐳑', - 68754 => '𐳒', - 68755 => '𐳓', - 68756 => '𐳔', - 68757 => '𐳕', - 68758 => '𐳖', - 68759 => '𐳗', - 68760 => '𐳘', - 68761 => '𐳙', - 68762 => '𐳚', - 68763 => '𐳛', - 68764 => '𐳜', - 68765 => '𐳝', - 68766 => '𐳞', - 68767 => '𐳟', - 68768 => '𐳠', - 68769 => '𐳡', - 68770 => '𐳢', - 68771 => '𐳣', - 68772 => '𐳤', - 68773 => '𐳥', - 68774 => '𐳦', - 68775 => '𐳧', - 68776 => '𐳨', - 68777 => '𐳩', - 68778 => '𐳪', - 68779 => '𐳫', - 68780 => '𐳬', - 68781 => '𐳭', - 68782 => '𐳮', - 68783 => '𐳯', - 68784 => '𐳰', - 68785 => '𐳱', - 68786 => '𐳲', - 71840 => '𑣀', - 71841 => '𑣁', - 71842 => '𑣂', - 71843 => '𑣃', - 71844 => '𑣄', - 71845 => '𑣅', - 71846 => '𑣆', - 71847 => '𑣇', - 71848 => '𑣈', - 71849 => '𑣉', - 71850 => '𑣊', - 71851 => '𑣋', - 71852 => '𑣌', - 71853 => '𑣍', - 71854 => '𑣎', - 71855 => '𑣏', - 71856 => '𑣐', - 71857 => '𑣑', - 71858 => '𑣒', - 71859 => '𑣓', - 71860 => '𑣔', - 71861 => '𑣕', - 71862 => '𑣖', - 71863 => '𑣗', - 71864 => '𑣘', - 71865 => '𑣙', - 71866 => '𑣚', - 71867 => '𑣛', - 71868 => '𑣜', - 71869 => '𑣝', - 71870 => '𑣞', - 71871 => '𑣟', - 93760 => '𖹠', - 93761 => '𖹡', - 93762 => '𖹢', - 93763 => '𖹣', - 93764 => '𖹤', - 93765 => '𖹥', - 93766 => '𖹦', - 93767 => '𖹧', - 93768 => '𖹨', - 93769 => '𖹩', - 93770 => '𖹪', - 93771 => '𖹫', - 93772 => '𖹬', - 93773 => '𖹭', - 93774 => '𖹮', - 93775 => '𖹯', - 93776 => '𖹰', - 93777 => '𖹱', - 93778 => '𖹲', - 93779 => '𖹳', - 93780 => '𖹴', - 93781 => '𖹵', - 93782 => '𖹶', - 93783 => '𖹷', - 93784 => '𖹸', - 93785 => '𖹹', - 93786 => '𖹺', - 93787 => '𖹻', - 93788 => '𖹼', - 93789 => '𖹽', - 93790 => '𖹾', - 93791 => '𖹿', - 119134 => '𝅗𝅥', - 119135 => '𝅘𝅥', - 119136 => '𝅘𝅥𝅮', - 119137 => '𝅘𝅥𝅯', - 119138 => '𝅘𝅥𝅰', - 119139 => '𝅘𝅥𝅱', - 119140 => '𝅘𝅥𝅲', - 119227 => '𝆹𝅥', - 119228 => '𝆺𝅥', - 119229 => '𝆹𝅥𝅮', - 119230 => '𝆺𝅥𝅮', - 119231 => '𝆹𝅥𝅯', - 119232 => '𝆺𝅥𝅯', - 119808 => 'a', - 119809 => 'b', - 119810 => 'c', - 119811 => 'd', - 119812 => 'e', - 119813 => 'f', - 119814 => 'g', - 119815 => 'h', - 119816 => 'i', - 119817 => 'j', - 119818 => 'k', - 119819 => 'l', - 119820 => 'm', - 119821 => 'n', - 119822 => 'o', - 119823 => 'p', - 119824 => 'q', - 119825 => 'r', - 119826 => 's', - 119827 => 't', - 119828 => 'u', - 119829 => 'v', - 119830 => 'w', - 119831 => 'x', - 119832 => 'y', - 119833 => 'z', - 119834 => 'a', - 119835 => 'b', - 119836 => 'c', - 119837 => 'd', - 119838 => 'e', - 119839 => 'f', - 119840 => 'g', - 119841 => 'h', - 119842 => 'i', - 119843 => 'j', - 119844 => 'k', - 119845 => 'l', - 119846 => 'm', - 119847 => 'n', - 119848 => 'o', - 119849 => 'p', - 119850 => 'q', - 119851 => 'r', - 119852 => 's', - 119853 => 't', - 119854 => 'u', - 119855 => 'v', - 119856 => 'w', - 119857 => 'x', - 119858 => 'y', - 119859 => 'z', - 119860 => 'a', - 119861 => 'b', - 119862 => 'c', - 119863 => 'd', - 119864 => 'e', - 119865 => 'f', - 119866 => 'g', - 119867 => 'h', - 119868 => 'i', - 119869 => 'j', - 119870 => 'k', - 119871 => 'l', - 119872 => 'm', - 119873 => 'n', - 119874 => 'o', - 119875 => 'p', - 119876 => 'q', - 119877 => 'r', - 119878 => 's', - 119879 => 't', - 119880 => 'u', - 119881 => 'v', - 119882 => 'w', - 119883 => 'x', - 119884 => 'y', - 119885 => 'z', - 119886 => 'a', - 119887 => 'b', - 119888 => 'c', - 119889 => 'd', - 119890 => 'e', - 119891 => 'f', - 119892 => 'g', - 119894 => 'i', - 119895 => 'j', - 119896 => 'k', - 119897 => 'l', - 119898 => 'm', - 119899 => 'n', - 119900 => 'o', - 119901 => 'p', - 119902 => 'q', - 119903 => 'r', - 119904 => 's', - 119905 => 't', - 119906 => 'u', - 119907 => 'v', - 119908 => 'w', - 119909 => 'x', - 119910 => 'y', - 119911 => 'z', - 119912 => 'a', - 119913 => 'b', - 119914 => 'c', - 119915 => 'd', - 119916 => 'e', - 119917 => 'f', - 119918 => 'g', - 119919 => 'h', - 119920 => 'i', - 119921 => 'j', - 119922 => 'k', - 119923 => 'l', - 119924 => 'm', - 119925 => 'n', - 119926 => 'o', - 119927 => 'p', - 119928 => 'q', - 119929 => 'r', - 119930 => 's', - 119931 => 't', - 119932 => 'u', - 119933 => 'v', - 119934 => 'w', - 119935 => 'x', - 119936 => 'y', - 119937 => 'z', - 119938 => 'a', - 119939 => 'b', - 119940 => 'c', - 119941 => 'd', - 119942 => 'e', - 119943 => 'f', - 119944 => 'g', - 119945 => 'h', - 119946 => 'i', - 119947 => 'j', - 119948 => 'k', - 119949 => 'l', - 119950 => 'm', - 119951 => 'n', - 119952 => 'o', - 119953 => 'p', - 119954 => 'q', - 119955 => 'r', - 119956 => 's', - 119957 => 't', - 119958 => 'u', - 119959 => 'v', - 119960 => 'w', - 119961 => 'x', - 119962 => 'y', - 119963 => 'z', - 119964 => 'a', - 119966 => 'c', - 119967 => 'd', - 119970 => 'g', - 119973 => 'j', - 119974 => 'k', - 119977 => 'n', - 119978 => 'o', - 119979 => 'p', - 119980 => 'q', - 119982 => 's', - 119983 => 't', - 119984 => 'u', - 119985 => 'v', - 119986 => 'w', - 119987 => 'x', - 119988 => 'y', - 119989 => 'z', - 119990 => 'a', - 119991 => 'b', - 119992 => 'c', - 119993 => 'd', - 119995 => 'f', - 119997 => 'h', - 119998 => 'i', - 119999 => 'j', - 120000 => 'k', - 120001 => 'l', - 120002 => 'm', - 120003 => 'n', - 120005 => 'p', - 120006 => 'q', - 120007 => 'r', - 120008 => 's', - 120009 => 't', - 120010 => 'u', - 120011 => 'v', - 120012 => 'w', - 120013 => 'x', - 120014 => 'y', - 120015 => 'z', - 120016 => 'a', - 120017 => 'b', - 120018 => 'c', - 120019 => 'd', - 120020 => 'e', - 120021 => 'f', - 120022 => 'g', - 120023 => 'h', - 120024 => 'i', - 120025 => 'j', - 120026 => 'k', - 120027 => 'l', - 120028 => 'm', - 120029 => 'n', - 120030 => 'o', - 120031 => 'p', - 120032 => 'q', - 120033 => 'r', - 120034 => 's', - 120035 => 't', - 120036 => 'u', - 120037 => 'v', - 120038 => 'w', - 120039 => 'x', - 120040 => 'y', - 120041 => 'z', - 120042 => 'a', - 120043 => 'b', - 120044 => 'c', - 120045 => 'd', - 120046 => 'e', - 120047 => 'f', - 120048 => 'g', - 120049 => 'h', - 120050 => 'i', - 120051 => 'j', - 120052 => 'k', - 120053 => 'l', - 120054 => 'm', - 120055 => 'n', - 120056 => 'o', - 120057 => 'p', - 120058 => 'q', - 120059 => 'r', - 120060 => 's', - 120061 => 't', - 120062 => 'u', - 120063 => 'v', - 120064 => 'w', - 120065 => 'x', - 120066 => 'y', - 120067 => 'z', - 120068 => 'a', - 120069 => 'b', - 120071 => 'd', - 120072 => 'e', - 120073 => 'f', - 120074 => 'g', - 120077 => 'j', - 120078 => 'k', - 120079 => 'l', - 120080 => 'm', - 120081 => 'n', - 120082 => 'o', - 120083 => 'p', - 120084 => 'q', - 120086 => 's', - 120087 => 't', - 120088 => 'u', - 120089 => 'v', - 120090 => 'w', - 120091 => 'x', - 120092 => 'y', - 120094 => 'a', - 120095 => 'b', - 120096 => 'c', - 120097 => 'd', - 120098 => 'e', - 120099 => 'f', - 120100 => 'g', - 120101 => 'h', - 120102 => 'i', - 120103 => 'j', - 120104 => 'k', - 120105 => 'l', - 120106 => 'm', - 120107 => 'n', - 120108 => 'o', - 120109 => 'p', - 120110 => 'q', - 120111 => 'r', - 120112 => 's', - 120113 => 't', - 120114 => 'u', - 120115 => 'v', - 120116 => 'w', - 120117 => 'x', - 120118 => 'y', - 120119 => 'z', - 120120 => 'a', - 120121 => 'b', - 120123 => 'd', - 120124 => 'e', - 120125 => 'f', - 120126 => 'g', - 120128 => 'i', - 120129 => 'j', - 120130 => 'k', - 120131 => 'l', - 120132 => 'm', - 120134 => 'o', - 120138 => 's', - 120139 => 't', - 120140 => 'u', - 120141 => 'v', - 120142 => 'w', - 120143 => 'x', - 120144 => 'y', - 120146 => 'a', - 120147 => 'b', - 120148 => 'c', - 120149 => 'd', - 120150 => 'e', - 120151 => 'f', - 120152 => 'g', - 120153 => 'h', - 120154 => 'i', - 120155 => 'j', - 120156 => 'k', - 120157 => 'l', - 120158 => 'm', - 120159 => 'n', - 120160 => 'o', - 120161 => 'p', - 120162 => 'q', - 120163 => 'r', - 120164 => 's', - 120165 => 't', - 120166 => 'u', - 120167 => 'v', - 120168 => 'w', - 120169 => 'x', - 120170 => 'y', - 120171 => 'z', - 120172 => 'a', - 120173 => 'b', - 120174 => 'c', - 120175 => 'd', - 120176 => 'e', - 120177 => 'f', - 120178 => 'g', - 120179 => 'h', - 120180 => 'i', - 120181 => 'j', - 120182 => 'k', - 120183 => 'l', - 120184 => 'm', - 120185 => 'n', - 120186 => 'o', - 120187 => 'p', - 120188 => 'q', - 120189 => 'r', - 120190 => 's', - 120191 => 't', - 120192 => 'u', - 120193 => 'v', - 120194 => 'w', - 120195 => 'x', - 120196 => 'y', - 120197 => 'z', - 120198 => 'a', - 120199 => 'b', - 120200 => 'c', - 120201 => 'd', - 120202 => 'e', - 120203 => 'f', - 120204 => 'g', - 120205 => 'h', - 120206 => 'i', - 120207 => 'j', - 120208 => 'k', - 120209 => 'l', - 120210 => 'm', - 120211 => 'n', - 120212 => 'o', - 120213 => 'p', - 120214 => 'q', - 120215 => 'r', - 120216 => 's', - 120217 => 't', - 120218 => 'u', - 120219 => 'v', - 120220 => 'w', - 120221 => 'x', - 120222 => 'y', - 120223 => 'z', - 120224 => 'a', - 120225 => 'b', - 120226 => 'c', - 120227 => 'd', - 120228 => 'e', - 120229 => 'f', - 120230 => 'g', - 120231 => 'h', - 120232 => 'i', - 120233 => 'j', - 120234 => 'k', - 120235 => 'l', - 120236 => 'm', - 120237 => 'n', - 120238 => 'o', - 120239 => 'p', - 120240 => 'q', - 120241 => 'r', - 120242 => 's', - 120243 => 't', - 120244 => 'u', - 120245 => 'v', - 120246 => 'w', - 120247 => 'x', - 120248 => 'y', - 120249 => 'z', - 120250 => 'a', - 120251 => 'b', - 120252 => 'c', - 120253 => 'd', - 120254 => 'e', - 120255 => 'f', - 120256 => 'g', - 120257 => 'h', - 120258 => 'i', - 120259 => 'j', - 120260 => 'k', - 120261 => 'l', - 120262 => 'm', - 120263 => 'n', - 120264 => 'o', - 120265 => 'p', - 120266 => 'q', - 120267 => 'r', - 120268 => 's', - 120269 => 't', - 120270 => 'u', - 120271 => 'v', - 120272 => 'w', - 120273 => 'x', - 120274 => 'y', - 120275 => 'z', - 120276 => 'a', - 120277 => 'b', - 120278 => 'c', - 120279 => 'd', - 120280 => 'e', - 120281 => 'f', - 120282 => 'g', - 120283 => 'h', - 120284 => 'i', - 120285 => 'j', - 120286 => 'k', - 120287 => 'l', - 120288 => 'm', - 120289 => 'n', - 120290 => 'o', - 120291 => 'p', - 120292 => 'q', - 120293 => 'r', - 120294 => 's', - 120295 => 't', - 120296 => 'u', - 120297 => 'v', - 120298 => 'w', - 120299 => 'x', - 120300 => 'y', - 120301 => 'z', - 120302 => 'a', - 120303 => 'b', - 120304 => 'c', - 120305 => 'd', - 120306 => 'e', - 120307 => 'f', - 120308 => 'g', - 120309 => 'h', - 120310 => 'i', - 120311 => 'j', - 120312 => 'k', - 120313 => 'l', - 120314 => 'm', - 120315 => 'n', - 120316 => 'o', - 120317 => 'p', - 120318 => 'q', - 120319 => 'r', - 120320 => 's', - 120321 => 't', - 120322 => 'u', - 120323 => 'v', - 120324 => 'w', - 120325 => 'x', - 120326 => 'y', - 120327 => 'z', - 120328 => 'a', - 120329 => 'b', - 120330 => 'c', - 120331 => 'd', - 120332 => 'e', - 120333 => 'f', - 120334 => 'g', - 120335 => 'h', - 120336 => 'i', - 120337 => 'j', - 120338 => 'k', - 120339 => 'l', - 120340 => 'm', - 120341 => 'n', - 120342 => 'o', - 120343 => 'p', - 120344 => 'q', - 120345 => 'r', - 120346 => 's', - 120347 => 't', - 120348 => 'u', - 120349 => 'v', - 120350 => 'w', - 120351 => 'x', - 120352 => 'y', - 120353 => 'z', - 120354 => 'a', - 120355 => 'b', - 120356 => 'c', - 120357 => 'd', - 120358 => 'e', - 120359 => 'f', - 120360 => 'g', - 120361 => 'h', - 120362 => 'i', - 120363 => 'j', - 120364 => 'k', - 120365 => 'l', - 120366 => 'm', - 120367 => 'n', - 120368 => 'o', - 120369 => 'p', - 120370 => 'q', - 120371 => 'r', - 120372 => 's', - 120373 => 't', - 120374 => 'u', - 120375 => 'v', - 120376 => 'w', - 120377 => 'x', - 120378 => 'y', - 120379 => 'z', - 120380 => 'a', - 120381 => 'b', - 120382 => 'c', - 120383 => 'd', - 120384 => 'e', - 120385 => 'f', - 120386 => 'g', - 120387 => 'h', - 120388 => 'i', - 120389 => 'j', - 120390 => 'k', - 120391 => 'l', - 120392 => 'm', - 120393 => 'n', - 120394 => 'o', - 120395 => 'p', - 120396 => 'q', - 120397 => 'r', - 120398 => 's', - 120399 => 't', - 120400 => 'u', - 120401 => 'v', - 120402 => 'w', - 120403 => 'x', - 120404 => 'y', - 120405 => 'z', - 120406 => 'a', - 120407 => 'b', - 120408 => 'c', - 120409 => 'd', - 120410 => 'e', - 120411 => 'f', - 120412 => 'g', - 120413 => 'h', - 120414 => 'i', - 120415 => 'j', - 120416 => 'k', - 120417 => 'l', - 120418 => 'm', - 120419 => 'n', - 120420 => 'o', - 120421 => 'p', - 120422 => 'q', - 120423 => 'r', - 120424 => 's', - 120425 => 't', - 120426 => 'u', - 120427 => 'v', - 120428 => 'w', - 120429 => 'x', - 120430 => 'y', - 120431 => 'z', - 120432 => 'a', - 120433 => 'b', - 120434 => 'c', - 120435 => 'd', - 120436 => 'e', - 120437 => 'f', - 120438 => 'g', - 120439 => 'h', - 120440 => 'i', - 120441 => 'j', - 120442 => 'k', - 120443 => 'l', - 120444 => 'm', - 120445 => 'n', - 120446 => 'o', - 120447 => 'p', - 120448 => 'q', - 120449 => 'r', - 120450 => 's', - 120451 => 't', - 120452 => 'u', - 120453 => 'v', - 120454 => 'w', - 120455 => 'x', - 120456 => 'y', - 120457 => 'z', - 120458 => 'a', - 120459 => 'b', - 120460 => 'c', - 120461 => 'd', - 120462 => 'e', - 120463 => 'f', - 120464 => 'g', - 120465 => 'h', - 120466 => 'i', - 120467 => 'j', - 120468 => 'k', - 120469 => 'l', - 120470 => 'm', - 120471 => 'n', - 120472 => 'o', - 120473 => 'p', - 120474 => 'q', - 120475 => 'r', - 120476 => 's', - 120477 => 't', - 120478 => 'u', - 120479 => 'v', - 120480 => 'w', - 120481 => 'x', - 120482 => 'y', - 120483 => 'z', - 120484 => 'ı', - 120485 => 'ȷ', - 120488 => 'α', - 120489 => 'β', - 120490 => 'γ', - 120491 => 'δ', - 120492 => 'ε', - 120493 => 'ζ', - 120494 => 'η', - 120495 => 'θ', - 120496 => 'ι', - 120497 => 'κ', - 120498 => 'λ', - 120499 => 'μ', - 120500 => 'ν', - 120501 => 'ξ', - 120502 => 'ο', - 120503 => 'π', - 120504 => 'ρ', - 120505 => 'θ', - 120506 => 'σ', - 120507 => 'τ', - 120508 => 'υ', - 120509 => 'φ', - 120510 => 'χ', - 120511 => 'ψ', - 120512 => 'ω', - 120513 => '∇', - 120514 => 'α', - 120515 => 'β', - 120516 => 'γ', - 120517 => 'δ', - 120518 => 'ε', - 120519 => 'ζ', - 120520 => 'η', - 120521 => 'θ', - 120522 => 'ι', - 120523 => 'κ', - 120524 => 'λ', - 120525 => 'μ', - 120526 => 'ν', - 120527 => 'ξ', - 120528 => 'ο', - 120529 => 'π', - 120530 => 'ρ', - 120531 => 'σ', - 120532 => 'σ', - 120533 => 'τ', - 120534 => 'υ', - 120535 => 'φ', - 120536 => 'χ', - 120537 => 'ψ', - 120538 => 'ω', - 120539 => '∂', - 120540 => 'ε', - 120541 => 'θ', - 120542 => 'κ', - 120543 => 'φ', - 120544 => 'ρ', - 120545 => 'π', - 120546 => 'α', - 120547 => 'β', - 120548 => 'γ', - 120549 => 'δ', - 120550 => 'ε', - 120551 => 'ζ', - 120552 => 'η', - 120553 => 'θ', - 120554 => 'ι', - 120555 => 'κ', - 120556 => 'λ', - 120557 => 'μ', - 120558 => 'ν', - 120559 => 'ξ', - 120560 => 'ο', - 120561 => 'π', - 120562 => 'ρ', - 120563 => 'θ', - 120564 => 'σ', - 120565 => 'τ', - 120566 => 'υ', - 120567 => 'φ', - 120568 => 'χ', - 120569 => 'ψ', - 120570 => 'ω', - 120571 => '∇', - 120572 => 'α', - 120573 => 'β', - 120574 => 'γ', - 120575 => 'δ', - 120576 => 'ε', - 120577 => 'ζ', - 120578 => 'η', - 120579 => 'θ', - 120580 => 'ι', - 120581 => 'κ', - 120582 => 'λ', - 120583 => 'μ', - 120584 => 'ν', - 120585 => 'ξ', - 120586 => 'ο', - 120587 => 'π', - 120588 => 'ρ', - 120589 => 'σ', - 120590 => 'σ', - 120591 => 'τ', - 120592 => 'υ', - 120593 => 'φ', - 120594 => 'χ', - 120595 => 'ψ', - 120596 => 'ω', - 120597 => '∂', - 120598 => 'ε', - 120599 => 'θ', - 120600 => 'κ', - 120601 => 'φ', - 120602 => 'ρ', - 120603 => 'π', - 120604 => 'α', - 120605 => 'β', - 120606 => 'γ', - 120607 => 'δ', - 120608 => 'ε', - 120609 => 'ζ', - 120610 => 'η', - 120611 => 'θ', - 120612 => 'ι', - 120613 => 'κ', - 120614 => 'λ', - 120615 => 'μ', - 120616 => 'ν', - 120617 => 'ξ', - 120618 => 'ο', - 120619 => 'π', - 120620 => 'ρ', - 120621 => 'θ', - 120622 => 'σ', - 120623 => 'τ', - 120624 => 'υ', - 120625 => 'φ', - 120626 => 'χ', - 120627 => 'ψ', - 120628 => 'ω', - 120629 => '∇', - 120630 => 'α', - 120631 => 'β', - 120632 => 'γ', - 120633 => 'δ', - 120634 => 'ε', - 120635 => 'ζ', - 120636 => 'η', - 120637 => 'θ', - 120638 => 'ι', - 120639 => 'κ', - 120640 => 'λ', - 120641 => 'μ', - 120642 => 'ν', - 120643 => 'ξ', - 120644 => 'ο', - 120645 => 'π', - 120646 => 'ρ', - 120647 => 'σ', - 120648 => 'σ', - 120649 => 'τ', - 120650 => 'υ', - 120651 => 'φ', - 120652 => 'χ', - 120653 => 'ψ', - 120654 => 'ω', - 120655 => '∂', - 120656 => 'ε', - 120657 => 'θ', - 120658 => 'κ', - 120659 => 'φ', - 120660 => 'ρ', - 120661 => 'π', - 120662 => 'α', - 120663 => 'β', - 120664 => 'γ', - 120665 => 'δ', - 120666 => 'ε', - 120667 => 'ζ', - 120668 => 'η', - 120669 => 'θ', - 120670 => 'ι', - 120671 => 'κ', - 120672 => 'λ', - 120673 => 'μ', - 120674 => 'ν', - 120675 => 'ξ', - 120676 => 'ο', - 120677 => 'π', - 120678 => 'ρ', - 120679 => 'θ', - 120680 => 'σ', - 120681 => 'τ', - 120682 => 'υ', - 120683 => 'φ', - 120684 => 'χ', - 120685 => 'ψ', - 120686 => 'ω', - 120687 => '∇', - 120688 => 'α', - 120689 => 'β', - 120690 => 'γ', - 120691 => 'δ', - 120692 => 'ε', - 120693 => 'ζ', - 120694 => 'η', - 120695 => 'θ', - 120696 => 'ι', - 120697 => 'κ', - 120698 => 'λ', - 120699 => 'μ', - 120700 => 'ν', - 120701 => 'ξ', - 120702 => 'ο', - 120703 => 'π', - 120704 => 'ρ', - 120705 => 'σ', - 120706 => 'σ', - 120707 => 'τ', - 120708 => 'υ', - 120709 => 'φ', - 120710 => 'χ', - 120711 => 'ψ', - 120712 => 'ω', - 120713 => '∂', - 120714 => 'ε', - 120715 => 'θ', - 120716 => 'κ', - 120717 => 'φ', - 120718 => 'ρ', - 120719 => 'π', - 120720 => 'α', - 120721 => 'β', - 120722 => 'γ', - 120723 => 'δ', - 120724 => 'ε', - 120725 => 'ζ', - 120726 => 'η', - 120727 => 'θ', - 120728 => 'ι', - 120729 => 'κ', - 120730 => 'λ', - 120731 => 'μ', - 120732 => 'ν', - 120733 => 'ξ', - 120734 => 'ο', - 120735 => 'π', - 120736 => 'ρ', - 120737 => 'θ', - 120738 => 'σ', - 120739 => 'τ', - 120740 => 'υ', - 120741 => 'φ', - 120742 => 'χ', - 120743 => 'ψ', - 120744 => 'ω', - 120745 => '∇', - 120746 => 'α', - 120747 => 'β', - 120748 => 'γ', - 120749 => 'δ', - 120750 => 'ε', - 120751 => 'ζ', - 120752 => 'η', - 120753 => 'θ', - 120754 => 'ι', - 120755 => 'κ', - 120756 => 'λ', - 120757 => 'μ', - 120758 => 'ν', - 120759 => 'ξ', - 120760 => 'ο', - 120761 => 'π', - 120762 => 'ρ', - 120763 => 'σ', - 120764 => 'σ', - 120765 => 'τ', - 120766 => 'υ', - 120767 => 'φ', - 120768 => 'χ', - 120769 => 'ψ', - 120770 => 'ω', - 120771 => '∂', - 120772 => 'ε', - 120773 => 'θ', - 120774 => 'κ', - 120775 => 'φ', - 120776 => 'ρ', - 120777 => 'π', - 120778 => 'ϝ', - 120779 => 'ϝ', - 120782 => '0', - 120783 => '1', - 120784 => '2', - 120785 => '3', - 120786 => '4', - 120787 => '5', - 120788 => '6', - 120789 => '7', - 120790 => '8', - 120791 => '9', - 120792 => '0', - 120793 => '1', - 120794 => '2', - 120795 => '3', - 120796 => '4', - 120797 => '5', - 120798 => '6', - 120799 => '7', - 120800 => '8', - 120801 => '9', - 120802 => '0', - 120803 => '1', - 120804 => '2', - 120805 => '3', - 120806 => '4', - 120807 => '5', - 120808 => '6', - 120809 => '7', - 120810 => '8', - 120811 => '9', - 120812 => '0', - 120813 => '1', - 120814 => '2', - 120815 => '3', - 120816 => '4', - 120817 => '5', - 120818 => '6', - 120819 => '7', - 120820 => '8', - 120821 => '9', - 120822 => '0', - 120823 => '1', - 120824 => '2', - 120825 => '3', - 120826 => '4', - 120827 => '5', - 120828 => '6', - 120829 => '7', - 120830 => '8', - 120831 => '9', - 125184 => '𞤢', - 125185 => '𞤣', - 125186 => '𞤤', - 125187 => '𞤥', - 125188 => '𞤦', - 125189 => '𞤧', - 125190 => '𞤨', - 125191 => '𞤩', - 125192 => '𞤪', - 125193 => '𞤫', - 125194 => '𞤬', - 125195 => '𞤭', - 125196 => '𞤮', - 125197 => '𞤯', - 125198 => '𞤰', - 125199 => '𞤱', - 125200 => '𞤲', - 125201 => '𞤳', - 125202 => '𞤴', - 125203 => '𞤵', - 125204 => '𞤶', - 125205 => '𞤷', - 125206 => '𞤸', - 125207 => '𞤹', - 125208 => '𞤺', - 125209 => '𞤻', - 125210 => '𞤼', - 125211 => '𞤽', - 125212 => '𞤾', - 125213 => '𞤿', - 125214 => '𞥀', - 125215 => '𞥁', - 125216 => '𞥂', - 125217 => '𞥃', - 126464 => 'ا', - 126465 => 'ب', - 126466 => 'ج', - 126467 => 'د', - 126469 => 'و', - 126470 => 'ز', - 126471 => 'ح', - 126472 => 'ط', - 126473 => 'ي', - 126474 => 'ك', - 126475 => 'ل', - 126476 => 'م', - 126477 => 'ن', - 126478 => 'س', - 126479 => 'ع', - 126480 => 'ف', - 126481 => 'ص', - 126482 => 'ق', - 126483 => 'ر', - 126484 => 'ش', - 126485 => 'ت', - 126486 => 'ث', - 126487 => 'خ', - 126488 => 'ذ', - 126489 => 'ض', - 126490 => 'ظ', - 126491 => 'غ', - 126492 => 'ٮ', - 126493 => 'ں', - 126494 => 'ڡ', - 126495 => 'ٯ', - 126497 => 'ب', - 126498 => 'ج', - 126500 => 'ه', - 126503 => 'ح', - 126505 => 'ي', - 126506 => 'ك', - 126507 => 'ل', - 126508 => 'م', - 126509 => 'ن', - 126510 => 'س', - 126511 => 'ع', - 126512 => 'ف', - 126513 => 'ص', - 126514 => 'ق', - 126516 => 'ش', - 126517 => 'ت', - 126518 => 'ث', - 126519 => 'خ', - 126521 => 'ض', - 126523 => 'غ', - 126530 => 'ج', - 126535 => 'ح', - 126537 => 'ي', - 126539 => 'ل', - 126541 => 'ن', - 126542 => 'س', - 126543 => 'ع', - 126545 => 'ص', - 126546 => 'ق', - 126548 => 'ش', - 126551 => 'خ', - 126553 => 'ض', - 126555 => 'غ', - 126557 => 'ں', - 126559 => 'ٯ', - 126561 => 'ب', - 126562 => 'ج', - 126564 => 'ه', - 126567 => 'ح', - 126568 => 'ط', - 126569 => 'ي', - 126570 => 'ك', - 126572 => 'م', - 126573 => 'ن', - 126574 => 'س', - 126575 => 'ع', - 126576 => 'ف', - 126577 => 'ص', - 126578 => 'ق', - 126580 => 'ش', - 126581 => 'ت', - 126582 => 'ث', - 126583 => 'خ', - 126585 => 'ض', - 126586 => 'ظ', - 126587 => 'غ', - 126588 => 'ٮ', - 126590 => 'ڡ', - 126592 => 'ا', - 126593 => 'ب', - 126594 => 'ج', - 126595 => 'د', - 126596 => 'ه', - 126597 => 'و', - 126598 => 'ز', - 126599 => 'ح', - 126600 => 'ط', - 126601 => 'ي', - 126603 => 'ل', - 126604 => 'م', - 126605 => 'ن', - 126606 => 'س', - 126607 => 'ع', - 126608 => 'ف', - 126609 => 'ص', - 126610 => 'ق', - 126611 => 'ر', - 126612 => 'ش', - 126613 => 'ت', - 126614 => 'ث', - 126615 => 'خ', - 126616 => 'ذ', - 126617 => 'ض', - 126618 => 'ظ', - 126619 => 'غ', - 126625 => 'ب', - 126626 => 'ج', - 126627 => 'د', - 126629 => 'و', - 126630 => 'ز', - 126631 => 'ح', - 126632 => 'ط', - 126633 => 'ي', - 126635 => 'ل', - 126636 => 'م', - 126637 => 'ن', - 126638 => 'س', - 126639 => 'ع', - 126640 => 'ف', - 126641 => 'ص', - 126642 => 'ق', - 126643 => 'ر', - 126644 => 'ش', - 126645 => 'ت', - 126646 => 'ث', - 126647 => 'خ', - 126648 => 'ذ', - 126649 => 'ض', - 126650 => 'ظ', - 126651 => 'غ', - 127274 => '〔s〕', - 127275 => 'c', - 127276 => 'r', - 127277 => 'cd', - 127278 => 'wz', - 127280 => 'a', - 127281 => 'b', - 127282 => 'c', - 127283 => 'd', - 127284 => 'e', - 127285 => 'f', - 127286 => 'g', - 127287 => 'h', - 127288 => 'i', - 127289 => 'j', - 127290 => 'k', - 127291 => 'l', - 127292 => 'm', - 127293 => 'n', - 127294 => 'o', - 127295 => 'p', - 127296 => 'q', - 127297 => 'r', - 127298 => 's', - 127299 => 't', - 127300 => 'u', - 127301 => 'v', - 127302 => 'w', - 127303 => 'x', - 127304 => 'y', - 127305 => 'z', - 127306 => 'hv', - 127307 => 'mv', - 127308 => 'sd', - 127309 => 'ss', - 127310 => 'ppv', - 127311 => 'wc', - 127338 => 'mc', - 127339 => 'md', - 127340 => 'mr', - 127376 => 'dj', - 127488 => 'ほか', - 127489 => 'ココ', - 127490 => 'サ', - 127504 => '手', - 127505 => '字', - 127506 => '双', - 127507 => 'デ', - 127508 => '二', - 127509 => '多', - 127510 => '解', - 127511 => '天', - 127512 => '交', - 127513 => '映', - 127514 => '無', - 127515 => '料', - 127516 => '前', - 127517 => '後', - 127518 => '再', - 127519 => '新', - 127520 => '初', - 127521 => '終', - 127522 => '生', - 127523 => '販', - 127524 => '声', - 127525 => '吹', - 127526 => '演', - 127527 => '投', - 127528 => '捕', - 127529 => '一', - 127530 => '三', - 127531 => '遊', - 127532 => '左', - 127533 => '中', - 127534 => '右', - 127535 => '指', - 127536 => '走', - 127537 => '打', - 127538 => '禁', - 127539 => '空', - 127540 => '合', - 127541 => '満', - 127542 => '有', - 127543 => '月', - 127544 => '申', - 127545 => '割', - 127546 => '営', - 127547 => '配', - 127552 => '〔本〕', - 127553 => '〔三〕', - 127554 => '〔二〕', - 127555 => '〔安〕', - 127556 => '〔点〕', - 127557 => '〔打〕', - 127558 => '〔盗〕', - 127559 => '〔勝〕', - 127560 => '〔敗〕', - 127568 => '得', - 127569 => '可', - 130032 => '0', - 130033 => '1', - 130034 => '2', - 130035 => '3', - 130036 => '4', - 130037 => '5', - 130038 => '6', - 130039 => '7', - 130040 => '8', - 130041 => '9', - 194560 => '丽', - 194561 => '丸', - 194562 => '乁', - 194563 => '𠄢', - 194564 => '你', - 194565 => '侮', - 194566 => '侻', - 194567 => '倂', - 194568 => '偺', - 194569 => '備', - 194570 => '僧', - 194571 => '像', - 194572 => '㒞', - 194573 => '𠘺', - 194574 => '免', - 194575 => '兔', - 194576 => '兤', - 194577 => '具', - 194578 => '𠔜', - 194579 => '㒹', - 194580 => '內', - 194581 => '再', - 194582 => '𠕋', - 194583 => '冗', - 194584 => '冤', - 194585 => '仌', - 194586 => '冬', - 194587 => '况', - 194588 => '𩇟', - 194589 => '凵', - 194590 => '刃', - 194591 => '㓟', - 194592 => '刻', - 194593 => '剆', - 194594 => '割', - 194595 => '剷', - 194596 => '㔕', - 194597 => '勇', - 194598 => '勉', - 194599 => '勤', - 194600 => '勺', - 194601 => '包', - 194602 => '匆', - 194603 => '北', - 194604 => '卉', - 194605 => '卑', - 194606 => '博', - 194607 => '即', - 194608 => '卽', - 194609 => '卿', - 194610 => '卿', - 194611 => '卿', - 194612 => '𠨬', - 194613 => '灰', - 194614 => '及', - 194615 => '叟', - 194616 => '𠭣', - 194617 => '叫', - 194618 => '叱', - 194619 => '吆', - 194620 => '咞', - 194621 => '吸', - 194622 => '呈', - 194623 => '周', - 194624 => '咢', - 194625 => '哶', - 194626 => '唐', - 194627 => '啓', - 194628 => '啣', - 194629 => '善', - 194630 => '善', - 194631 => '喙', - 194632 => '喫', - 194633 => '喳', - 194634 => '嗂', - 194635 => '圖', - 194636 => '嘆', - 194637 => '圗', - 194638 => '噑', - 194639 => '噴', - 194640 => '切', - 194641 => '壮', - 194642 => '城', - 194643 => '埴', - 194644 => '堍', - 194645 => '型', - 194646 => '堲', - 194647 => '報', - 194648 => '墬', - 194649 => '𡓤', - 194650 => '売', - 194651 => '壷', - 194652 => '夆', - 194653 => '多', - 194654 => '夢', - 194655 => '奢', - 194656 => '𡚨', - 194657 => '𡛪', - 194658 => '姬', - 194659 => '娛', - 194660 => '娧', - 194661 => '姘', - 194662 => '婦', - 194663 => '㛮', - 194665 => '嬈', - 194666 => '嬾', - 194667 => '嬾', - 194668 => '𡧈', - 194669 => '寃', - 194670 => '寘', - 194671 => '寧', - 194672 => '寳', - 194673 => '𡬘', - 194674 => '寿', - 194675 => '将', - 194677 => '尢', - 194678 => '㞁', - 194679 => '屠', - 194680 => '屮', - 194681 => '峀', - 194682 => '岍', - 194683 => '𡷤', - 194684 => '嵃', - 194685 => '𡷦', - 194686 => '嵮', - 194687 => '嵫', - 194688 => '嵼', - 194689 => '巡', - 194690 => '巢', - 194691 => '㠯', - 194692 => '巽', - 194693 => '帨', - 194694 => '帽', - 194695 => '幩', - 194696 => '㡢', - 194697 => '𢆃', - 194698 => '㡼', - 194699 => '庰', - 194700 => '庳', - 194701 => '庶', - 194702 => '廊', - 194703 => '𪎒', - 194704 => '廾', - 194705 => '𢌱', - 194706 => '𢌱', - 194707 => '舁', - 194708 => '弢', - 194709 => '弢', - 194710 => '㣇', - 194711 => '𣊸', - 194712 => '𦇚', - 194713 => '形', - 194714 => '彫', - 194715 => '㣣', - 194716 => '徚', - 194717 => '忍', - 194718 => '志', - 194719 => '忹', - 194720 => '悁', - 194721 => '㤺', - 194722 => '㤜', - 194723 => '悔', - 194724 => '𢛔', - 194725 => '惇', - 194726 => '慈', - 194727 => '慌', - 194728 => '慎', - 194729 => '慌', - 194730 => '慺', - 194731 => '憎', - 194732 => '憲', - 194733 => '憤', - 194734 => '憯', - 194735 => '懞', - 194736 => '懲', - 194737 => '懶', - 194738 => '成', - 194739 => '戛', - 194740 => '扝', - 194741 => '抱', - 194742 => '拔', - 194743 => '捐', - 194744 => '𢬌', - 194745 => '挽', - 194746 => '拼', - 194747 => '捨', - 194748 => '掃', - 194749 => '揤', - 194750 => '𢯱', - 194751 => '搢', - 194752 => '揅', - 194753 => '掩', - 194754 => '㨮', - 194755 => '摩', - 194756 => '摾', - 194757 => '撝', - 194758 => '摷', - 194759 => '㩬', - 194760 => '敏', - 194761 => '敬', - 194762 => '𣀊', - 194763 => '旣', - 194764 => '書', - 194765 => '晉', - 194766 => '㬙', - 194767 => '暑', - 194768 => '㬈', - 194769 => '㫤', - 194770 => '冒', - 194771 => '冕', - 194772 => '最', - 194773 => '暜', - 194774 => '肭', - 194775 => '䏙', - 194776 => '朗', - 194777 => '望', - 194778 => '朡', - 194779 => '杞', - 194780 => '杓', - 194781 => '𣏃', - 194782 => '㭉', - 194783 => '柺', - 194784 => '枅', - 194785 => '桒', - 194786 => '梅', - 194787 => '𣑭', - 194788 => '梎', - 194789 => '栟', - 194790 => '椔', - 194791 => '㮝', - 194792 => '楂', - 194793 => '榣', - 194794 => '槪', - 194795 => '檨', - 194796 => '𣚣', - 194797 => '櫛', - 194798 => '㰘', - 194799 => '次', - 194800 => '𣢧', - 194801 => '歔', - 194802 => '㱎', - 194803 => '歲', - 194804 => '殟', - 194805 => '殺', - 194806 => '殻', - 194807 => '𣪍', - 194808 => '𡴋', - 194809 => '𣫺', - 194810 => '汎', - 194811 => '𣲼', - 194812 => '沿', - 194813 => '泍', - 194814 => '汧', - 194815 => '洖', - 194816 => '派', - 194817 => '海', - 194818 => '流', - 194819 => '浩', - 194820 => '浸', - 194821 => '涅', - 194822 => '𣴞', - 194823 => '洴', - 194824 => '港', - 194825 => '湮', - 194826 => '㴳', - 194827 => '滋', - 194828 => '滇', - 194829 => '𣻑', - 194830 => '淹', - 194831 => '潮', - 194832 => '𣽞', - 194833 => '𣾎', - 194834 => '濆', - 194835 => '瀹', - 194836 => '瀞', - 194837 => '瀛', - 194838 => '㶖', - 194839 => '灊', - 194840 => '災', - 194841 => '灷', - 194842 => '炭', - 194843 => '𠔥', - 194844 => '煅', - 194845 => '𤉣', - 194846 => '熜', - 194848 => '爨', - 194849 => '爵', - 194850 => '牐', - 194851 => '𤘈', - 194852 => '犀', - 194853 => '犕', - 194854 => '𤜵', - 194855 => '𤠔', - 194856 => '獺', - 194857 => '王', - 194858 => '㺬', - 194859 => '玥', - 194860 => '㺸', - 194861 => '㺸', - 194862 => '瑇', - 194863 => '瑜', - 194864 => '瑱', - 194865 => '璅', - 194866 => '瓊', - 194867 => '㼛', - 194868 => '甤', - 194869 => '𤰶', - 194870 => '甾', - 194871 => '𤲒', - 194872 => '異', - 194873 => '𢆟', - 194874 => '瘐', - 194875 => '𤾡', - 194876 => '𤾸', - 194877 => '𥁄', - 194878 => '㿼', - 194879 => '䀈', - 194880 => '直', - 194881 => '𥃳', - 194882 => '𥃲', - 194883 => '𥄙', - 194884 => '𥄳', - 194885 => '眞', - 194886 => '真', - 194887 => '真', - 194888 => '睊', - 194889 => '䀹', - 194890 => '瞋', - 194891 => '䁆', - 194892 => '䂖', - 194893 => '𥐝', - 194894 => '硎', - 194895 => '碌', - 194896 => '磌', - 194897 => '䃣', - 194898 => '𥘦', - 194899 => '祖', - 194900 => '𥚚', - 194901 => '𥛅', - 194902 => '福', - 194903 => '秫', - 194904 => '䄯', - 194905 => '穀', - 194906 => '穊', - 194907 => '穏', - 194908 => '𥥼', - 194909 => '𥪧', - 194910 => '𥪧', - 194912 => '䈂', - 194913 => '𥮫', - 194914 => '篆', - 194915 => '築', - 194916 => '䈧', - 194917 => '𥲀', - 194918 => '糒', - 194919 => '䊠', - 194920 => '糨', - 194921 => '糣', - 194922 => '紀', - 194923 => '𥾆', - 194924 => '絣', - 194925 => '䌁', - 194926 => '緇', - 194927 => '縂', - 194928 => '繅', - 194929 => '䌴', - 194930 => '𦈨', - 194931 => '𦉇', - 194932 => '䍙', - 194933 => '𦋙', - 194934 => '罺', - 194935 => '𦌾', - 194936 => '羕', - 194937 => '翺', - 194938 => '者', - 194939 => '𦓚', - 194940 => '𦔣', - 194941 => '聠', - 194942 => '𦖨', - 194943 => '聰', - 194944 => '𣍟', - 194945 => '䏕', - 194946 => '育', - 194947 => '脃', - 194948 => '䐋', - 194949 => '脾', - 194950 => '媵', - 194951 => '𦞧', - 194952 => '𦞵', - 194953 => '𣎓', - 194954 => '𣎜', - 194955 => '舁', - 194956 => '舄', - 194957 => '辞', - 194958 => '䑫', - 194959 => '芑', - 194960 => '芋', - 194961 => '芝', - 194962 => '劳', - 194963 => '花', - 194964 => '芳', - 194965 => '芽', - 194966 => '苦', - 194967 => '𦬼', - 194968 => '若', - 194969 => '茝', - 194970 => '荣', - 194971 => '莭', - 194972 => '茣', - 194973 => '莽', - 194974 => '菧', - 194975 => '著', - 194976 => '荓', - 194977 => '菊', - 194978 => '菌', - 194979 => '菜', - 194980 => '𦰶', - 194981 => '𦵫', - 194982 => '𦳕', - 194983 => '䔫', - 194984 => '蓱', - 194985 => '蓳', - 194986 => '蔖', - 194987 => '𧏊', - 194988 => '蕤', - 194989 => '𦼬', - 194990 => '䕝', - 194991 => '䕡', - 194992 => '𦾱', - 194993 => '𧃒', - 194994 => '䕫', - 194995 => '虐', - 194996 => '虜', - 194997 => '虧', - 194998 => '虩', - 194999 => '蚩', - 195000 => '蚈', - 195001 => '蜎', - 195002 => '蛢', - 195003 => '蝹', - 195004 => '蜨', - 195005 => '蝫', - 195006 => '螆', - 195008 => '蟡', - 195009 => '蠁', - 195010 => '䗹', - 195011 => '衠', - 195012 => '衣', - 195013 => '𧙧', - 195014 => '裗', - 195015 => '裞', - 195016 => '䘵', - 195017 => '裺', - 195018 => '㒻', - 195019 => '𧢮', - 195020 => '𧥦', - 195021 => '䚾', - 195022 => '䛇', - 195023 => '誠', - 195024 => '諭', - 195025 => '變', - 195026 => '豕', - 195027 => '𧲨', - 195028 => '貫', - 195029 => '賁', - 195030 => '贛', - 195031 => '起', - 195032 => '𧼯', - 195033 => '𠠄', - 195034 => '跋', - 195035 => '趼', - 195036 => '跰', - 195037 => '𠣞', - 195038 => '軔', - 195039 => '輸', - 195040 => '𨗒', - 195041 => '𨗭', - 195042 => '邔', - 195043 => '郱', - 195044 => '鄑', - 195045 => '𨜮', - 195046 => '鄛', - 195047 => '鈸', - 195048 => '鋗', - 195049 => '鋘', - 195050 => '鉼', - 195051 => '鏹', - 195052 => '鐕', - 195053 => '𨯺', - 195054 => '開', - 195055 => '䦕', - 195056 => '閷', - 195057 => '𨵷', - 195058 => '䧦', - 195059 => '雃', - 195060 => '嶲', - 195061 => '霣', - 195062 => '𩅅', - 195063 => '𩈚', - 195064 => '䩮', - 195065 => '䩶', - 195066 => '韠', - 195067 => '𩐊', - 195068 => '䪲', - 195069 => '𩒖', - 195070 => '頋', - 195071 => '頋', - 195072 => '頩', - 195073 => '𩖶', - 195074 => '飢', - 195075 => '䬳', - 195076 => '餩', - 195077 => '馧', - 195078 => '駂', - 195079 => '駾', - 195080 => '䯎', - 195081 => '𩬰', - 195082 => '鬒', - 195083 => '鱀', - 195084 => '鳽', - 195085 => '䳎', - 195086 => '䳭', - 195087 => '鵧', - 195088 => '𪃎', - 195089 => '䳸', - 195090 => '𪄅', - 195091 => '𪈎', - 195092 => '𪊑', - 195093 => '麻', - 195094 => '䵖', - 195095 => '黹', - 195096 => '黾', - 195097 => '鼅', - 195098 => '鼏', - 195099 => '鼖', - 195100 => '鼻', - 195101 => '𪘀', -); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php deleted file mode 100644 index 1958e37..0000000 --- a/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php +++ /dev/null @@ -1,65 +0,0 @@ - 9, - 2509 => 9, - 2637 => 9, - 2765 => 9, - 2893 => 9, - 3021 => 9, - 3149 => 9, - 3277 => 9, - 3387 => 9, - 3388 => 9, - 3405 => 9, - 3530 => 9, - 3642 => 9, - 3770 => 9, - 3972 => 9, - 4153 => 9, - 4154 => 9, - 5908 => 9, - 5940 => 9, - 6098 => 9, - 6752 => 9, - 6980 => 9, - 7082 => 9, - 7083 => 9, - 7154 => 9, - 7155 => 9, - 11647 => 9, - 43014 => 9, - 43052 => 9, - 43204 => 9, - 43347 => 9, - 43456 => 9, - 43766 => 9, - 44013 => 9, - 68159 => 9, - 69702 => 9, - 69759 => 9, - 69817 => 9, - 69939 => 9, - 69940 => 9, - 70080 => 9, - 70197 => 9, - 70378 => 9, - 70477 => 9, - 70722 => 9, - 70850 => 9, - 71103 => 9, - 71231 => 9, - 71350 => 9, - 71467 => 9, - 71737 => 9, - 71997 => 9, - 71998 => 9, - 72160 => 9, - 72244 => 9, - 72263 => 9, - 72345 => 9, - 72767 => 9, - 73028 => 9, - 73029 => 9, - 73111 => 9, -); diff --git a/vendor/symfony/polyfill-intl-idn/bootstrap.php b/vendor/symfony/polyfill-intl-idn/bootstrap.php deleted file mode 100644 index 57c7835..0000000 --- a/vendor/symfony/polyfill-intl-idn/bootstrap.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Idn as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('U_IDNA_PROHIBITED_ERROR')) { - define('U_IDNA_PROHIBITED_ERROR', 66560); -} -if (!defined('U_IDNA_ERROR_START')) { - define('U_IDNA_ERROR_START', 66560); -} -if (!defined('U_IDNA_UNASSIGNED_ERROR')) { - define('U_IDNA_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { - define('U_IDNA_CHECK_BIDI_ERROR', 66562); -} -if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { - define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); -} -if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { - define('U_IDNA_ACE_PREFIX_ERROR', 66564); -} -if (!defined('U_IDNA_VERIFICATION_ERROR')) { - define('U_IDNA_VERIFICATION_ERROR', 66565); -} -if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { - define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); -} -if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { - define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); -} -if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { - define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); -} -if (!defined('U_IDNA_ERROR_LIMIT')) { - define('U_IDNA_ERROR_LIMIT', 66569); -} -if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { - define('U_STRINGPREP_PROHIBITED_ERROR', 66560); -} -if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { - define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { - define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); -} -if (!defined('IDNA_DEFAULT')) { - define('IDNA_DEFAULT', 0); -} -if (!defined('IDNA_ALLOW_UNASSIGNED')) { - define('IDNA_ALLOW_UNASSIGNED', 1); -} -if (!defined('IDNA_USE_STD3_RULES')) { - define('IDNA_USE_STD3_RULES', 2); -} -if (!defined('IDNA_CHECK_BIDI')) { - define('IDNA_CHECK_BIDI', 4); -} -if (!defined('IDNA_CHECK_CONTEXTJ')) { - define('IDNA_CHECK_CONTEXTJ', 8); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { - define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { - define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); -} -if (!defined('INTL_IDNA_VARIANT_2003')) { - define('INTL_IDNA_VARIANT_2003', 0); -} -if (!defined('INTL_IDNA_VARIANT_UTS46')) { - define('INTL_IDNA_VARIANT_UTS46', 1); -} -if (!defined('IDNA_ERROR_EMPTY_LABEL')) { - define('IDNA_ERROR_EMPTY_LABEL', 1); -} -if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { - define('IDNA_ERROR_LABEL_TOO_LONG', 2); -} -if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { - define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); -} -if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { - define('IDNA_ERROR_LEADING_HYPHEN', 8); -} -if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { - define('IDNA_ERROR_TRAILING_HYPHEN', 16); -} -if (!defined('IDNA_ERROR_HYPHEN_3_4')) { - define('IDNA_ERROR_HYPHEN_3_4', 32); -} -if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { - define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); -} -if (!defined('IDNA_ERROR_DISALLOWED')) { - define('IDNA_ERROR_DISALLOWED', 128); -} -if (!defined('IDNA_ERROR_PUNYCODE')) { - define('IDNA_ERROR_PUNYCODE', 256); -} -if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { - define('IDNA_ERROR_LABEL_HAS_DOT', 512); -} -if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { - define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); -} -if (!defined('IDNA_ERROR_BIDI')) { - define('IDNA_ERROR_BIDI', 2048); -} -if (!defined('IDNA_ERROR_CONTEXTJ')) { - define('IDNA_ERROR_CONTEXTJ', 4096); -} - -if (\PHP_VERSION_ID < 70400) { - if (!function_exists('idn_to_ascii')) { - function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } - } - if (!function_exists('idn_to_utf8')) { - function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } - } -} else { - if (!function_exists('idn_to_ascii')) { - function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } - } - if (!function_exists('idn_to_utf8')) { - function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } - } -} diff --git a/vendor/symfony/polyfill-intl-idn/bootstrap80.php b/vendor/symfony/polyfill-intl-idn/bootstrap80.php deleted file mode 100644 index 8965386..0000000 --- a/vendor/symfony/polyfill-intl-idn/bootstrap80.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Idn as p; - -if (!defined('U_IDNA_PROHIBITED_ERROR')) { - define('U_IDNA_PROHIBITED_ERROR', 66560); -} -if (!defined('U_IDNA_ERROR_START')) { - define('U_IDNA_ERROR_START', 66560); -} -if (!defined('U_IDNA_UNASSIGNED_ERROR')) { - define('U_IDNA_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { - define('U_IDNA_CHECK_BIDI_ERROR', 66562); -} -if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { - define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); -} -if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { - define('U_IDNA_ACE_PREFIX_ERROR', 66564); -} -if (!defined('U_IDNA_VERIFICATION_ERROR')) { - define('U_IDNA_VERIFICATION_ERROR', 66565); -} -if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { - define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); -} -if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { - define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); -} -if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { - define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); -} -if (!defined('U_IDNA_ERROR_LIMIT')) { - define('U_IDNA_ERROR_LIMIT', 66569); -} -if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { - define('U_STRINGPREP_PROHIBITED_ERROR', 66560); -} -if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { - define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { - define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); -} -if (!defined('IDNA_DEFAULT')) { - define('IDNA_DEFAULT', 0); -} -if (!defined('IDNA_ALLOW_UNASSIGNED')) { - define('IDNA_ALLOW_UNASSIGNED', 1); -} -if (!defined('IDNA_USE_STD3_RULES')) { - define('IDNA_USE_STD3_RULES', 2); -} -if (!defined('IDNA_CHECK_BIDI')) { - define('IDNA_CHECK_BIDI', 4); -} -if (!defined('IDNA_CHECK_CONTEXTJ')) { - define('IDNA_CHECK_CONTEXTJ', 8); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { - define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { - define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); -} -if (!defined('INTL_IDNA_VARIANT_2003')) { - define('INTL_IDNA_VARIANT_2003', 0); -} -if (!defined('INTL_IDNA_VARIANT_UTS46')) { - define('INTL_IDNA_VARIANT_UTS46', 1); -} -if (!defined('IDNA_ERROR_EMPTY_LABEL')) { - define('IDNA_ERROR_EMPTY_LABEL', 1); -} -if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { - define('IDNA_ERROR_LABEL_TOO_LONG', 2); -} -if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { - define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); -} -if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { - define('IDNA_ERROR_LEADING_HYPHEN', 8); -} -if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { - define('IDNA_ERROR_TRAILING_HYPHEN', 16); -} -if (!defined('IDNA_ERROR_HYPHEN_3_4')) { - define('IDNA_ERROR_HYPHEN_3_4', 32); -} -if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { - define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); -} -if (!defined('IDNA_ERROR_DISALLOWED')) { - define('IDNA_ERROR_DISALLOWED', 128); -} -if (!defined('IDNA_ERROR_PUNYCODE')) { - define('IDNA_ERROR_PUNYCODE', 256); -} -if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { - define('IDNA_ERROR_LABEL_HAS_DOT', 512); -} -if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { - define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); -} -if (!defined('IDNA_ERROR_BIDI')) { - define('IDNA_ERROR_BIDI', 2048); -} -if (!defined('IDNA_ERROR_CONTEXTJ')) { - define('IDNA_ERROR_CONTEXTJ', 4096); -} - -if (!function_exists('idn_to_ascii')) { - function idn_to_ascii(?string $domain, ?int $flags = 0, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); } -} -if (!function_exists('idn_to_utf8')) { - function idn_to_utf8(?string $domain, ?int $flags = 0, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); } -} diff --git a/vendor/symfony/polyfill-intl-idn/composer.json b/vendor/symfony/polyfill-intl-idn/composer.json deleted file mode 100644 index 450d1e7..0000000 --- a/vendor/symfony/polyfill-intl-idn/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "symfony/polyfill-intl-idn", - "type": "library", - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "idn"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/LICENSE b/vendor/symfony/polyfill-intl-normalizer/LICENSE deleted file mode 100644 index 4cd8bdd..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php deleted file mode 100644 index 4443c23..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ /dev/null @@ -1,310 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Normalizer; - -/** - * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. - * - * It has been validated with Unicode 6.3 Normalization Conformance Test. - * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. - * - * @author Nicolas Grekas - * - * @internal - */ -class Normalizer -{ - public const FORM_D = \Normalizer::FORM_D; - public const FORM_KD = \Normalizer::FORM_KD; - public const FORM_C = \Normalizer::FORM_C; - public const FORM_KC = \Normalizer::FORM_KC; - public const NFD = \Normalizer::NFD; - public const NFKD = \Normalizer::NFKD; - public const NFC = \Normalizer::NFC; - public const NFKC = \Normalizer::NFKC; - - private static $C; - private static $D; - private static $KD; - private static $cC; - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - public static function isNormalized(string $s, int $form = self::FORM_C) - { - if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; - } - if (!isset($s[strspn($s, self::$ASCII)])) { - return true; - } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { - return true; - } - - return self::normalize($s, $form) === $s; - } - - public static function normalize(string $s, int $form = self::FORM_C) - { - if (!preg_match('//u', $s)) { - return false; - } - - switch ($form) { - case self::NFC: $C = true; $K = false; break; - case self::NFD: $C = false; $K = false; break; - case self::NFKC: $C = true; $K = true; break; - case self::NFKD: $C = false; $K = true; break; - default: - if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); - } - - if ('' === $s) { - return ''; - } - - if ($K && null === self::$KD) { - self::$KD = self::getData('compatibilityDecomposition'); - } - - if (null === self::$D) { - self::$D = self::getData('canonicalDecomposition'); - self::$cC = self::getData('combiningClass'); - } - - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { - mb_internal_encoding('8bit'); - } - - $r = self::decompose($s, $K); - - if ($C) { - if (null === self::$C) { - self::$C = self::getData('canonicalComposition'); - } - - $r = self::recompose($r); - } - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return $r; - } - - private static function recompose($s) - { - $ASCII = self::$ASCII; - $compMap = self::$C; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - - $result = $tail = ''; - - $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; - $len = \strlen($s); - - $lastUchr = substr($s, 0, $i); - $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - if ($j = strspn($s, $ASCII, $i + 1)) { - $lastUchr .= substr($s, $i, $j); - $i += $j; - } - - $result .= $lastUchr; - $lastUchr = $s[$i]; - $lastUcls = 0; - ++$i; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - - if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr - || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr - || $lastUcls) { - // Table lookup and combining chars composition - - $ucls = $combClass[$uchr] ?? 0; - - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { - $lastUchr = $compMap[$lastUchr.$uchr]; - } elseif ($lastUcls = $ucls) { - $tail .= $uchr; - } else { - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - $result .= $lastUchr; - $lastUchr = $uchr; - } - } else { - // Hangul chars - - $L = \ord($lastUchr[2]) - 0x80; - $V = \ord($uchr[2]) - 0xA1; - $T = 0; - - $uchr = substr($s, $i + $ulen, 3); - - if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { - $T = \ord($uchr[2]) - 0xA7; - 0 > $T && $T += 0x40; - $ulen += 3; - } - - $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); - } - - $i += $ulen; - } - - return $result.$lastUchr.$tail; - } - - private static function decompose($s, $c) - { - $result = ''; - - $ASCII = self::$ASCII; - $decompMap = self::$D; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - if ($c) { - $compatMap = self::$KD; - } - - $c = []; - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $j = 1 + strspn($s, $ASCII, $i + 1); - $result .= substr($s, $i, $j); - $i += $j; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { - // Table lookup - - if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { - $uchr = $j; - - $j = \strlen($uchr); - $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; - - if ($ulen != $j) { - // Put trailing chars in $s - - $j -= $ulen; - $i -= $j; - - if (0 > $i) { - $s = str_repeat(' ', -$i).$s; - $len -= $i; - $i = 0; - } - - while ($j--) { - $s[$i + $j] = $uchr[$ulen + $j]; - } - - $uchr = substr($uchr, 0, $ulen); - } - } - if (isset($combClass[$uchr])) { - // Combining chars, for sorting - - if (!isset($c[$combClass[$uchr]])) { - $c[$combClass[$uchr]] = ''; - } - $c[$combClass[$uchr]] .= $uchr; - continue; - } - } else { - // Hangul chars - - $uchr = unpack('C*', $uchr); - $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; - - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); - - if ($j %= 28) { - $uchr .= $j < 25 - ? ("\xE1\x86".\chr(0xA7 + $j)) - : ("\xE1\x87".\chr(0x67 + $j)); - } - } - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $result .= $uchr; - } - - if ($c) { - ksort($c); - $result .= implode('', $c); - } - - return $result; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/README.md b/vendor/symfony/polyfill-intl-normalizer/README.md deleted file mode 100644 index 15060c5..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Intl: Normalizer -=================================== - -This component provides a fallback implementation for the -[`Normalizer`](https://php.net/Normalizer) class provided -by the [Intl](https://php.net/intl) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php deleted file mode 100644 index 0fdfc89..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php +++ /dev/null @@ -1,17 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '΅' => '΅', - 'Ά' => 'Ά', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ὲ' => 'ὲ', - 'ὴ' => 'ὴ', - 'ὶ' => 'ὶ', - 'ὸ' => 'ὸ', - 'ὺ' => 'ὺ', - 'ὼ' => 'ὼ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'ᾼ' => 'ᾼ', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Ὴ' => 'Ὴ', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ὼ' => 'Ὼ', - 'ῼ' => 'ῼ', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php deleted file mode 100644 index 5a3e8e0..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php +++ /dev/null @@ -1,2065 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '̀' => '̀', - '́' => '́', - '̓' => '̓', - '̈́' => '̈́', - 'ʹ' => 'ʹ', - ';' => ';', - '΅' => '΅', - 'Ά' => 'Ά', - '·' => '·', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'क़' => 'क़', - 'ख़' => 'ख़', - 'ग़' => 'ग़', - 'ज़' => 'ज़', - 'ड़' => 'ड़', - 'ढ़' => 'ढ़', - 'फ़' => 'फ़', - 'य़' => 'य़', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ড়' => 'ড়', - 'ঢ়' => 'ঢ়', - 'য়' => 'য়', - 'ਲ਼' => 'ਲ਼', - 'ਸ਼' => 'ਸ਼', - 'ਖ਼' => 'ਖ਼', - 'ਗ਼' => 'ਗ਼', - 'ਜ਼' => 'ਜ਼', - 'ਫ਼' => 'ਫ਼', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ଡ଼' => 'ଡ଼', - 'ଢ଼' => 'ଢ଼', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'གྷ' => 'གྷ', - 'ཌྷ' => 'ཌྷ', - 'དྷ' => 'དྷ', - 'བྷ' => 'བྷ', - 'ཛྷ' => 'ཛྷ', - 'ཀྵ' => 'ཀྵ', - 'ཱི' => 'ཱི', - 'ཱུ' => 'ཱུ', - 'ྲྀ' => 'ྲྀ', - 'ླྀ' => 'ླྀ', - 'ཱྀ' => 'ཱྀ', - 'ྒྷ' => 'ྒྷ', - 'ྜྷ' => 'ྜྷ', - 'ྡྷ' => 'ྡྷ', - 'ྦྷ' => 'ྦྷ', - 'ྫྷ' => 'ྫྷ', - 'ྐྵ' => 'ྐྵ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ά' => 'ά', - 'ὲ' => 'ὲ', - 'έ' => 'έ', - 'ὴ' => 'ὴ', - 'ή' => 'ή', - 'ὶ' => 'ὶ', - 'ί' => 'ί', - 'ὸ' => 'ὸ', - 'ό' => 'ό', - 'ὺ' => 'ὺ', - 'ύ' => 'ύ', - 'ὼ' => 'ὼ', - 'ώ' => 'ώ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'Ά' => 'Ά', - 'ᾼ' => 'ᾼ', - 'ι' => 'ι', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Έ' => 'Έ', - 'Ὴ' => 'Ὴ', - 'Ή' => 'Ή', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ΐ' => 'ΐ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - 'Ί' => 'Ί', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ΰ' => 'ΰ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ύ' => 'Ύ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - '΅' => '΅', - '`' => '`', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ό' => 'Ό', - 'Ὼ' => 'Ὼ', - 'Ώ' => 'Ώ', - 'ῼ' => 'ῼ', - '´' => '´', - ' ' => ' ', - ' ' => ' ', - 'Ω' => 'Ω', - 'K' => 'K', - 'Å' => 'Å', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - '〈' => '〈', - '〉' => '〉', - '⫝̸' => '⫝̸', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '塚' => '塚', - '晴' => '晴', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '蘒' => '蘒', - '諸' => '諸', - '逸' => '逸', - '都' => '都', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'יִ' => 'יִ', - 'ײַ' => 'ײַ', - 'שׁ' => 'שׁ', - 'שׂ' => 'שׂ', - 'שּׁ' => 'שּׁ', - 'שּׂ' => 'שּׂ', - 'אַ' => 'אַ', - 'אָ' => 'אָ', - 'אּ' => 'אּ', - 'בּ' => 'בּ', - 'גּ' => 'גּ', - 'דּ' => 'דּ', - 'הּ' => 'הּ', - 'וּ' => 'וּ', - 'זּ' => 'זּ', - 'טּ' => 'טּ', - 'יּ' => 'יּ', - 'ךּ' => 'ךּ', - 'כּ' => 'כּ', - 'לּ' => 'לּ', - 'מּ' => 'מּ', - 'נּ' => 'נּ', - 'סּ' => 'סּ', - 'ףּ' => 'ףּ', - 'פּ' => 'פּ', - 'צּ' => 'צּ', - 'קּ' => 'קּ', - 'רּ' => 'רּ', - 'שּ' => 'שּ', - 'תּ' => 'תּ', - 'וֹ' => 'וֹ', - 'בֿ' => 'בֿ', - 'כֿ' => 'כֿ', - 'פֿ' => 'פֿ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', - '𝅗𝅥' => '𝅗𝅥', - '𝅘𝅥' => '𝅘𝅥', - '𝅘𝅥𝅮' => '𝅘𝅥𝅮', - '𝅘𝅥𝅯' => '𝅘𝅥𝅯', - '𝅘𝅥𝅰' => '𝅘𝅥𝅰', - '𝅘𝅥𝅱' => '𝅘𝅥𝅱', - '𝅘𝅥𝅲' => '𝅘𝅥𝅲', - '𝆹𝅥' => '𝆹𝅥', - '𝆺𝅥' => '𝆺𝅥', - '𝆹𝅥𝅮' => '𝆹𝅥𝅮', - '𝆺𝅥𝅮' => '𝆺𝅥𝅮', - '𝆹𝅥𝅯' => '𝆹𝅥𝅯', - '𝆺𝅥𝅯' => '𝆺𝅥𝅯', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php deleted file mode 100644 index ec90f36..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php +++ /dev/null @@ -1,876 +0,0 @@ - 230, - '́' => 230, - '̂' => 230, - '̃' => 230, - '̄' => 230, - '̅' => 230, - '̆' => 230, - '̇' => 230, - '̈' => 230, - '̉' => 230, - '̊' => 230, - '̋' => 230, - '̌' => 230, - '̍' => 230, - '̎' => 230, - '̏' => 230, - '̐' => 230, - '̑' => 230, - '̒' => 230, - '̓' => 230, - '̔' => 230, - '̕' => 232, - '̖' => 220, - '̗' => 220, - '̘' => 220, - '̙' => 220, - '̚' => 232, - '̛' => 216, - '̜' => 220, - '̝' => 220, - '̞' => 220, - '̟' => 220, - '̠' => 220, - '̡' => 202, - '̢' => 202, - '̣' => 220, - '̤' => 220, - '̥' => 220, - '̦' => 220, - '̧' => 202, - '̨' => 202, - '̩' => 220, - '̪' => 220, - '̫' => 220, - '̬' => 220, - '̭' => 220, - '̮' => 220, - '̯' => 220, - '̰' => 220, - '̱' => 220, - '̲' => 220, - '̳' => 220, - '̴' => 1, - '̵' => 1, - '̶' => 1, - '̷' => 1, - '̸' => 1, - '̹' => 220, - '̺' => 220, - '̻' => 220, - '̼' => 220, - '̽' => 230, - '̾' => 230, - '̿' => 230, - '̀' => 230, - '́' => 230, - '͂' => 230, - '̓' => 230, - '̈́' => 230, - 'ͅ' => 240, - '͆' => 230, - '͇' => 220, - '͈' => 220, - '͉' => 220, - '͊' => 230, - '͋' => 230, - '͌' => 230, - '͍' => 220, - '͎' => 220, - '͐' => 230, - '͑' => 230, - '͒' => 230, - '͓' => 220, - '͔' => 220, - '͕' => 220, - '͖' => 220, - '͗' => 230, - '͘' => 232, - '͙' => 220, - '͚' => 220, - '͛' => 230, - '͜' => 233, - '͝' => 234, - '͞' => 234, - '͟' => 233, - '͠' => 234, - '͡' => 234, - '͢' => 233, - 'ͣ' => 230, - 'ͤ' => 230, - 'ͥ' => 230, - 'ͦ' => 230, - 'ͧ' => 230, - 'ͨ' => 230, - 'ͩ' => 230, - 'ͪ' => 230, - 'ͫ' => 230, - 'ͬ' => 230, - 'ͭ' => 230, - 'ͮ' => 230, - 'ͯ' => 230, - '҃' => 230, - '҄' => 230, - '҅' => 230, - '҆' => 230, - '҇' => 230, - '֑' => 220, - '֒' => 230, - '֓' => 230, - '֔' => 230, - '֕' => 230, - '֖' => 220, - '֗' => 230, - '֘' => 230, - '֙' => 230, - '֚' => 222, - '֛' => 220, - '֜' => 230, - '֝' => 230, - '֞' => 230, - '֟' => 230, - '֠' => 230, - '֡' => 230, - '֢' => 220, - '֣' => 220, - '֤' => 220, - '֥' => 220, - '֦' => 220, - '֧' => 220, - '֨' => 230, - '֩' => 230, - '֪' => 220, - '֫' => 230, - '֬' => 230, - '֭' => 222, - '֮' => 228, - '֯' => 230, - 'ְ' => 10, - 'ֱ' => 11, - 'ֲ' => 12, - 'ֳ' => 13, - 'ִ' => 14, - 'ֵ' => 15, - 'ֶ' => 16, - 'ַ' => 17, - 'ָ' => 18, - 'ֹ' => 19, - 'ֺ' => 19, - 'ֻ' => 20, - 'ּ' => 21, - 'ֽ' => 22, - 'ֿ' => 23, - 'ׁ' => 24, - 'ׂ' => 25, - 'ׄ' => 230, - 'ׅ' => 220, - 'ׇ' => 18, - 'ؐ' => 230, - 'ؑ' => 230, - 'ؒ' => 230, - 'ؓ' => 230, - 'ؔ' => 230, - 'ؕ' => 230, - 'ؖ' => 230, - 'ؗ' => 230, - 'ؘ' => 30, - 'ؙ' => 31, - 'ؚ' => 32, - 'ً' => 27, - 'ٌ' => 28, - 'ٍ' => 29, - 'َ' => 30, - 'ُ' => 31, - 'ِ' => 32, - 'ّ' => 33, - 'ْ' => 34, - 'ٓ' => 230, - 'ٔ' => 230, - 'ٕ' => 220, - 'ٖ' => 220, - 'ٗ' => 230, - '٘' => 230, - 'ٙ' => 230, - 'ٚ' => 230, - 'ٛ' => 230, - 'ٜ' => 220, - 'ٝ' => 230, - 'ٞ' => 230, - 'ٟ' => 220, - 'ٰ' => 35, - 'ۖ' => 230, - 'ۗ' => 230, - 'ۘ' => 230, - 'ۙ' => 230, - 'ۚ' => 230, - 'ۛ' => 230, - 'ۜ' => 230, - '۟' => 230, - '۠' => 230, - 'ۡ' => 230, - 'ۢ' => 230, - 'ۣ' => 220, - 'ۤ' => 230, - 'ۧ' => 230, - 'ۨ' => 230, - '۪' => 220, - '۫' => 230, - '۬' => 230, - 'ۭ' => 220, - 'ܑ' => 36, - 'ܰ' => 230, - 'ܱ' => 220, - 'ܲ' => 230, - 'ܳ' => 230, - 'ܴ' => 220, - 'ܵ' => 230, - 'ܶ' => 230, - 'ܷ' => 220, - 'ܸ' => 220, - 'ܹ' => 220, - 'ܺ' => 230, - 'ܻ' => 220, - 'ܼ' => 220, - 'ܽ' => 230, - 'ܾ' => 220, - 'ܿ' => 230, - '݀' => 230, - '݁' => 230, - '݂' => 220, - '݃' => 230, - '݄' => 220, - '݅' => 230, - '݆' => 220, - '݇' => 230, - '݈' => 220, - '݉' => 230, - '݊' => 230, - '߫' => 230, - '߬' => 230, - '߭' => 230, - '߮' => 230, - '߯' => 230, - '߰' => 230, - '߱' => 230, - '߲' => 220, - '߳' => 230, - '߽' => 220, - 'ࠖ' => 230, - 'ࠗ' => 230, - '࠘' => 230, - '࠙' => 230, - 'ࠛ' => 230, - 'ࠜ' => 230, - 'ࠝ' => 230, - 'ࠞ' => 230, - 'ࠟ' => 230, - 'ࠠ' => 230, - 'ࠡ' => 230, - 'ࠢ' => 230, - 'ࠣ' => 230, - 'ࠥ' => 230, - 'ࠦ' => 230, - 'ࠧ' => 230, - 'ࠩ' => 230, - 'ࠪ' => 230, - 'ࠫ' => 230, - 'ࠬ' => 230, - '࠭' => 230, - '࡙' => 220, - '࡚' => 220, - '࡛' => 220, - '࣓' => 220, - 'ࣔ' => 230, - 'ࣕ' => 230, - 'ࣖ' => 230, - 'ࣗ' => 230, - 'ࣘ' => 230, - 'ࣙ' => 230, - 'ࣚ' => 230, - 'ࣛ' => 230, - 'ࣜ' => 230, - 'ࣝ' => 230, - 'ࣞ' => 230, - 'ࣟ' => 230, - '࣠' => 230, - '࣡' => 230, - 'ࣣ' => 220, - 'ࣤ' => 230, - 'ࣥ' => 230, - 'ࣦ' => 220, - 'ࣧ' => 230, - 'ࣨ' => 230, - 'ࣩ' => 220, - '࣪' => 230, - '࣫' => 230, - '࣬' => 230, - '࣭' => 220, - '࣮' => 220, - '࣯' => 220, - 'ࣰ' => 27, - 'ࣱ' => 28, - 'ࣲ' => 29, - 'ࣳ' => 230, - 'ࣴ' => 230, - 'ࣵ' => 230, - 'ࣶ' => 220, - 'ࣷ' => 230, - 'ࣸ' => 230, - 'ࣹ' => 220, - 'ࣺ' => 220, - 'ࣻ' => 230, - 'ࣼ' => 230, - 'ࣽ' => 230, - 'ࣾ' => 230, - 'ࣿ' => 230, - '़' => 7, - '्' => 9, - '॑' => 230, - '॒' => 220, - '॓' => 230, - '॔' => 230, - '়' => 7, - '্' => 9, - '৾' => 230, - '਼' => 7, - '੍' => 9, - '઼' => 7, - '્' => 9, - '଼' => 7, - '୍' => 9, - '்' => 9, - '్' => 9, - 'ౕ' => 84, - 'ౖ' => 91, - '಼' => 7, - '್' => 9, - '഻' => 9, - '഼' => 9, - '്' => 9, - '්' => 9, - 'ุ' => 103, - 'ู' => 103, - 'ฺ' => 9, - '่' => 107, - '้' => 107, - '๊' => 107, - '๋' => 107, - 'ຸ' => 118, - 'ູ' => 118, - '຺' => 9, - '່' => 122, - '້' => 122, - '໊' => 122, - '໋' => 122, - '༘' => 220, - '༙' => 220, - '༵' => 220, - '༷' => 220, - '༹' => 216, - 'ཱ' => 129, - 'ི' => 130, - 'ུ' => 132, - 'ེ' => 130, - 'ཻ' => 130, - 'ོ' => 130, - 'ཽ' => 130, - 'ྀ' => 130, - 'ྂ' => 230, - 'ྃ' => 230, - '྄' => 9, - '྆' => 230, - '྇' => 230, - '࿆' => 220, - '့' => 7, - '္' => 9, - '်' => 9, - 'ႍ' => 220, - '፝' => 230, - '፞' => 230, - '፟' => 230, - '᜔' => 9, - '᜴' => 9, - '្' => 9, - '៝' => 230, - 'ᢩ' => 228, - '᤹' => 222, - '᤺' => 230, - '᤻' => 220, - 'ᨗ' => 230, - 'ᨘ' => 220, - '᩠' => 9, - '᩵' => 230, - '᩶' => 230, - '᩷' => 230, - '᩸' => 230, - '᩹' => 230, - '᩺' => 230, - '᩻' => 230, - '᩼' => 230, - '᩿' => 220, - '᪰' => 230, - '᪱' => 230, - '᪲' => 230, - '᪳' => 230, - '᪴' => 230, - '᪵' => 220, - '᪶' => 220, - '᪷' => 220, - '᪸' => 220, - '᪹' => 220, - '᪺' => 220, - '᪻' => 230, - '᪼' => 230, - '᪽' => 220, - 'ᪿ' => 220, - 'ᫀ' => 220, - '᬴' => 7, - '᭄' => 9, - '᭫' => 230, - '᭬' => 220, - '᭭' => 230, - '᭮' => 230, - '᭯' => 230, - '᭰' => 230, - '᭱' => 230, - '᭲' => 230, - '᭳' => 230, - '᮪' => 9, - '᮫' => 9, - '᯦' => 7, - '᯲' => 9, - '᯳' => 9, - '᰷' => 7, - '᳐' => 230, - '᳑' => 230, - '᳒' => 230, - '᳔' => 1, - '᳕' => 220, - '᳖' => 220, - '᳗' => 220, - '᳘' => 220, - '᳙' => 220, - '᳚' => 230, - '᳛' => 230, - '᳜' => 220, - '᳝' => 220, - '᳞' => 220, - '᳟' => 220, - '᳠' => 230, - '᳢' => 1, - '᳣' => 1, - '᳤' => 1, - '᳥' => 1, - '᳦' => 1, - '᳧' => 1, - '᳨' => 1, - '᳭' => 220, - '᳴' => 230, - '᳸' => 230, - '᳹' => 230, - '᷀' => 230, - '᷁' => 230, - '᷂' => 220, - '᷃' => 230, - '᷄' => 230, - '᷅' => 230, - '᷆' => 230, - '᷇' => 230, - '᷈' => 230, - '᷉' => 230, - '᷊' => 220, - '᷋' => 230, - '᷌' => 230, - '᷍' => 234, - '᷎' => 214, - '᷏' => 220, - '᷐' => 202, - '᷑' => 230, - '᷒' => 230, - 'ᷓ' => 230, - 'ᷔ' => 230, - 'ᷕ' => 230, - 'ᷖ' => 230, - 'ᷗ' => 230, - 'ᷘ' => 230, - 'ᷙ' => 230, - 'ᷚ' => 230, - 'ᷛ' => 230, - 'ᷜ' => 230, - 'ᷝ' => 230, - 'ᷞ' => 230, - 'ᷟ' => 230, - 'ᷠ' => 230, - 'ᷡ' => 230, - 'ᷢ' => 230, - 'ᷣ' => 230, - 'ᷤ' => 230, - 'ᷥ' => 230, - 'ᷦ' => 230, - 'ᷧ' => 230, - 'ᷨ' => 230, - 'ᷩ' => 230, - 'ᷪ' => 230, - 'ᷫ' => 230, - 'ᷬ' => 230, - 'ᷭ' => 230, - 'ᷮ' => 230, - 'ᷯ' => 230, - 'ᷰ' => 230, - 'ᷱ' => 230, - 'ᷲ' => 230, - 'ᷳ' => 230, - 'ᷴ' => 230, - '᷵' => 230, - '᷶' => 232, - '᷷' => 228, - '᷸' => 228, - '᷹' => 220, - '᷻' => 230, - '᷼' => 233, - '᷽' => 220, - '᷾' => 230, - '᷿' => 220, - '⃐' => 230, - '⃑' => 230, - '⃒' => 1, - '⃓' => 1, - '⃔' => 230, - '⃕' => 230, - '⃖' => 230, - '⃗' => 230, - '⃘' => 1, - '⃙' => 1, - '⃚' => 1, - '⃛' => 230, - '⃜' => 230, - '⃡' => 230, - '⃥' => 1, - '⃦' => 1, - '⃧' => 230, - '⃨' => 220, - '⃩' => 230, - '⃪' => 1, - '⃫' => 1, - '⃬' => 220, - '⃭' => 220, - '⃮' => 220, - '⃯' => 220, - '⃰' => 230, - '⳯' => 230, - '⳰' => 230, - '⳱' => 230, - '⵿' => 9, - 'ⷠ' => 230, - 'ⷡ' => 230, - 'ⷢ' => 230, - 'ⷣ' => 230, - 'ⷤ' => 230, - 'ⷥ' => 230, - 'ⷦ' => 230, - 'ⷧ' => 230, - 'ⷨ' => 230, - 'ⷩ' => 230, - 'ⷪ' => 230, - 'ⷫ' => 230, - 'ⷬ' => 230, - 'ⷭ' => 230, - 'ⷮ' => 230, - 'ⷯ' => 230, - 'ⷰ' => 230, - 'ⷱ' => 230, - 'ⷲ' => 230, - 'ⷳ' => 230, - 'ⷴ' => 230, - 'ⷵ' => 230, - 'ⷶ' => 230, - 'ⷷ' => 230, - 'ⷸ' => 230, - 'ⷹ' => 230, - 'ⷺ' => 230, - 'ⷻ' => 230, - 'ⷼ' => 230, - 'ⷽ' => 230, - 'ⷾ' => 230, - 'ⷿ' => 230, - '〪' => 218, - '〫' => 228, - '〬' => 232, - '〭' => 222, - '〮' => 224, - '〯' => 224, - '゙' => 8, - '゚' => 8, - '꙯' => 230, - 'ꙴ' => 230, - 'ꙵ' => 230, - 'ꙶ' => 230, - 'ꙷ' => 230, - 'ꙸ' => 230, - 'ꙹ' => 230, - 'ꙺ' => 230, - 'ꙻ' => 230, - '꙼' => 230, - '꙽' => 230, - 'ꚞ' => 230, - 'ꚟ' => 230, - '꛰' => 230, - '꛱' => 230, - '꠆' => 9, - '꠬' => 9, - '꣄' => 9, - '꣠' => 230, - '꣡' => 230, - '꣢' => 230, - '꣣' => 230, - '꣤' => 230, - '꣥' => 230, - '꣦' => 230, - '꣧' => 230, - '꣨' => 230, - '꣩' => 230, - '꣪' => 230, - '꣫' => 230, - '꣬' => 230, - '꣭' => 230, - '꣮' => 230, - '꣯' => 230, - '꣰' => 230, - '꣱' => 230, - '꤫' => 220, - '꤬' => 220, - '꤭' => 220, - '꥓' => 9, - '꦳' => 7, - '꧀' => 9, - 'ꪰ' => 230, - 'ꪲ' => 230, - 'ꪳ' => 230, - 'ꪴ' => 220, - 'ꪷ' => 230, - 'ꪸ' => 230, - 'ꪾ' => 230, - '꪿' => 230, - '꫁' => 230, - '꫶' => 9, - '꯭' => 9, - 'ﬞ' => 26, - '︠' => 230, - '︡' => 230, - '︢' => 230, - '︣' => 230, - '︤' => 230, - '︥' => 230, - '︦' => 230, - '︧' => 220, - '︨' => 220, - '︩' => 220, - '︪' => 220, - '︫' => 220, - '︬' => 220, - '︭' => 220, - '︮' => 230, - '︯' => 230, - '𐇽' => 220, - '𐋠' => 220, - '𐍶' => 230, - '𐍷' => 230, - '𐍸' => 230, - '𐍹' => 230, - '𐍺' => 230, - '𐨍' => 220, - '𐨏' => 230, - '𐨸' => 230, - '𐨹' => 1, - '𐨺' => 220, - '𐨿' => 9, - '𐫥' => 230, - '𐫦' => 220, - '𐴤' => 230, - '𐴥' => 230, - '𐴦' => 230, - '𐴧' => 230, - '𐺫' => 230, - '𐺬' => 230, - '𐽆' => 220, - '𐽇' => 220, - '𐽈' => 230, - '𐽉' => 230, - '𐽊' => 230, - '𐽋' => 220, - '𐽌' => 230, - '𐽍' => 220, - '𐽎' => 220, - '𐽏' => 220, - '𐽐' => 220, - '𑁆' => 9, - '𑁿' => 9, - '𑂹' => 9, - '𑂺' => 7, - '𑄀' => 230, - '𑄁' => 230, - '𑄂' => 230, - '𑄳' => 9, - '𑄴' => 9, - '𑅳' => 7, - '𑇀' => 9, - '𑇊' => 7, - '𑈵' => 9, - '𑈶' => 7, - '𑋩' => 7, - '𑋪' => 9, - '𑌻' => 7, - '𑌼' => 7, - '𑍍' => 9, - '𑍦' => 230, - '𑍧' => 230, - '𑍨' => 230, - '𑍩' => 230, - '𑍪' => 230, - '𑍫' => 230, - '𑍬' => 230, - '𑍰' => 230, - '𑍱' => 230, - '𑍲' => 230, - '𑍳' => 230, - '𑍴' => 230, - '𑑂' => 9, - '𑑆' => 7, - '𑑞' => 230, - '𑓂' => 9, - '𑓃' => 7, - '𑖿' => 9, - '𑗀' => 7, - '𑘿' => 9, - '𑚶' => 9, - '𑚷' => 7, - '𑜫' => 9, - '𑠹' => 9, - '𑠺' => 7, - '𑤽' => 9, - '𑤾' => 9, - '𑥃' => 7, - '𑧠' => 9, - '𑨴' => 9, - '𑩇' => 9, - '𑪙' => 9, - '𑰿' => 9, - '𑵂' => 7, - '𑵄' => 9, - '𑵅' => 9, - '𑶗' => 9, - '𖫰' => 1, - '𖫱' => 1, - '𖫲' => 1, - '𖫳' => 1, - '𖫴' => 1, - '𖬰' => 230, - '𖬱' => 230, - '𖬲' => 230, - '𖬳' => 230, - '𖬴' => 230, - '𖬵' => 230, - '𖬶' => 230, - '𖿰' => 6, - '𖿱' => 6, - '𛲞' => 1, - '𝅥' => 216, - '𝅦' => 216, - '𝅧' => 1, - '𝅨' => 1, - '𝅩' => 1, - '𝅭' => 226, - '𝅮' => 216, - '𝅯' => 216, - '𝅰' => 216, - '𝅱' => 216, - '𝅲' => 216, - '𝅻' => 220, - '𝅼' => 220, - '𝅽' => 220, - '𝅾' => 220, - '𝅿' => 220, - '𝆀' => 220, - '𝆁' => 220, - '𝆂' => 220, - '𝆅' => 230, - '𝆆' => 230, - '𝆇' => 230, - '𝆈' => 230, - '𝆉' => 230, - '𝆊' => 220, - '𝆋' => 220, - '𝆪' => 230, - '𝆫' => 230, - '𝆬' => 230, - '𝆭' => 230, - '𝉂' => 230, - '𝉃' => 230, - '𝉄' => 230, - '𞀀' => 230, - '𞀁' => 230, - '𞀂' => 230, - '𞀃' => 230, - '𞀄' => 230, - '𞀅' => 230, - '𞀆' => 230, - '𞀈' => 230, - '𞀉' => 230, - '𞀊' => 230, - '𞀋' => 230, - '𞀌' => 230, - '𞀍' => 230, - '𞀎' => 230, - '𞀏' => 230, - '𞀐' => 230, - '𞀑' => 230, - '𞀒' => 230, - '𞀓' => 230, - '𞀔' => 230, - '𞀕' => 230, - '𞀖' => 230, - '𞀗' => 230, - '𞀘' => 230, - '𞀛' => 230, - '𞀜' => 230, - '𞀝' => 230, - '𞀞' => 230, - '𞀟' => 230, - '𞀠' => 230, - '𞀡' => 230, - '𞀣' => 230, - '𞀤' => 230, - '𞀦' => 230, - '𞀧' => 230, - '𞀨' => 230, - '𞀩' => 230, - '𞀪' => 230, - '𞄰' => 230, - '𞄱' => 230, - '𞄲' => 230, - '𞄳' => 230, - '𞄴' => 230, - '𞄵' => 230, - '𞄶' => 230, - '𞋬' => 230, - '𞋭' => 230, - '𞋮' => 230, - '𞋯' => 230, - '𞣐' => 220, - '𞣑' => 220, - '𞣒' => 220, - '𞣓' => 220, - '𞣔' => 220, - '𞣕' => 220, - '𞣖' => 220, - '𞥄' => 230, - '𞥅' => 230, - '𞥆' => 230, - '𞥇' => 230, - '𞥈' => 230, - '𞥉' => 230, - '𞥊' => 7, -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php deleted file mode 100644 index 1574902..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php +++ /dev/null @@ -1,3695 +0,0 @@ - ' ', - '¨' => ' ̈', - 'ª' => 'a', - '¯' => ' ̄', - '²' => '2', - '³' => '3', - '´' => ' ́', - 'µ' => 'μ', - '¸' => ' ̧', - '¹' => '1', - 'º' => 'o', - '¼' => '1⁄4', - '½' => '1⁄2', - '¾' => '3⁄4', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ʰ' => 'h', - 'ʱ' => 'ɦ', - 'ʲ' => 'j', - 'ʳ' => 'r', - 'ʴ' => 'ɹ', - 'ʵ' => 'ɻ', - 'ʶ' => 'ʁ', - 'ʷ' => 'w', - 'ʸ' => 'y', - '˘' => ' ̆', - '˙' => ' ̇', - '˚' => ' ̊', - '˛' => ' ̨', - '˜' => ' ̃', - '˝' => ' ̋', - 'ˠ' => 'ɣ', - 'ˡ' => 'l', - 'ˢ' => 's', - 'ˣ' => 'x', - 'ˤ' => 'ʕ', - 'ͺ' => ' ͅ', - '΄' => ' ́', - '΅' => ' ̈́', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϓ' => 'Ύ', - 'ϔ' => 'Ϋ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - '༌' => '་', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ჼ' => 'ნ', - 'ᴬ' => 'A', - 'ᴭ' => 'Æ', - 'ᴮ' => 'B', - 'ᴰ' => 'D', - 'ᴱ' => 'E', - 'ᴲ' => 'Ǝ', - 'ᴳ' => 'G', - 'ᴴ' => 'H', - 'ᴵ' => 'I', - 'ᴶ' => 'J', - 'ᴷ' => 'K', - 'ᴸ' => 'L', - 'ᴹ' => 'M', - 'ᴺ' => 'N', - 'ᴼ' => 'O', - 'ᴽ' => 'Ȣ', - 'ᴾ' => 'P', - 'ᴿ' => 'R', - 'ᵀ' => 'T', - 'ᵁ' => 'U', - 'ᵂ' => 'W', - 'ᵃ' => 'a', - 'ᵄ' => 'ɐ', - 'ᵅ' => 'ɑ', - 'ᵆ' => 'ᴂ', - 'ᵇ' => 'b', - 'ᵈ' => 'd', - 'ᵉ' => 'e', - 'ᵊ' => 'ə', - 'ᵋ' => 'ɛ', - 'ᵌ' => 'ɜ', - 'ᵍ' => 'g', - 'ᵏ' => 'k', - 'ᵐ' => 'm', - 'ᵑ' => 'ŋ', - 'ᵒ' => 'o', - 'ᵓ' => 'ɔ', - 'ᵔ' => 'ᴖ', - 'ᵕ' => 'ᴗ', - 'ᵖ' => 'p', - 'ᵗ' => 't', - 'ᵘ' => 'u', - 'ᵙ' => 'ᴝ', - 'ᵚ' => 'ɯ', - 'ᵛ' => 'v', - 'ᵜ' => 'ᴥ', - 'ᵝ' => 'β', - 'ᵞ' => 'γ', - 'ᵟ' => 'δ', - 'ᵠ' => 'φ', - 'ᵡ' => 'χ', - 'ᵢ' => 'i', - 'ᵣ' => 'r', - 'ᵤ' => 'u', - 'ᵥ' => 'v', - 'ᵦ' => 'β', - 'ᵧ' => 'γ', - 'ᵨ' => 'ρ', - 'ᵩ' => 'φ', - 'ᵪ' => 'χ', - 'ᵸ' => 'н', - 'ᶛ' => 'ɒ', - 'ᶜ' => 'c', - 'ᶝ' => 'ɕ', - 'ᶞ' => 'ð', - 'ᶟ' => 'ɜ', - 'ᶠ' => 'f', - 'ᶡ' => 'ɟ', - 'ᶢ' => 'ɡ', - 'ᶣ' => 'ɥ', - 'ᶤ' => 'ɨ', - 'ᶥ' => 'ɩ', - 'ᶦ' => 'ɪ', - 'ᶧ' => 'ᵻ', - 'ᶨ' => 'ʝ', - 'ᶩ' => 'ɭ', - 'ᶪ' => 'ᶅ', - 'ᶫ' => 'ʟ', - 'ᶬ' => 'ɱ', - 'ᶭ' => 'ɰ', - 'ᶮ' => 'ɲ', - 'ᶯ' => 'ɳ', - 'ᶰ' => 'ɴ', - 'ᶱ' => 'ɵ', - 'ᶲ' => 'ɸ', - 'ᶳ' => 'ʂ', - 'ᶴ' => 'ʃ', - 'ᶵ' => 'ƫ', - 'ᶶ' => 'ʉ', - 'ᶷ' => 'ʊ', - 'ᶸ' => 'ᴜ', - 'ᶹ' => 'ʋ', - 'ᶺ' => 'ʌ', - 'ᶻ' => 'z', - 'ᶼ' => 'ʐ', - 'ᶽ' => 'ʑ', - 'ᶾ' => 'ʒ', - 'ᶿ' => 'θ', - 'ẚ' => 'aʾ', - 'ẛ' => 'ṡ', - '᾽' => ' ̓', - '᾿' => ' ̓', - '῀' => ' ͂', - '῁' => ' ̈͂', - '῍' => ' ̓̀', - '῎' => ' ̓́', - '῏' => ' ̓͂', - '῝' => ' ̔̀', - '῞' => ' ̔́', - '῟' => ' ̔͂', - '῭' => ' ̈̀', - '΅' => ' ̈́', - '´' => ' ́', - '῾' => ' ̔', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‑' => '‐', - '‗' => ' ̳', - '․' => '.', - '‥' => '..', - '…' => '...', - ' ' => ' ', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '‾' => ' ̅', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - ' ' => ' ', - '⁰' => '0', - 'ⁱ' => 'i', - '⁴' => '4', - '⁵' => '5', - '⁶' => '6', - '⁷' => '7', - '⁸' => '8', - '⁹' => '9', - '⁺' => '+', - '⁻' => '−', - '⁼' => '=', - '⁽' => '(', - '⁾' => ')', - 'ⁿ' => 'n', - '₀' => '0', - '₁' => '1', - '₂' => '2', - '₃' => '3', - '₄' => '4', - '₅' => '5', - '₆' => '6', - '₇' => '7', - '₈' => '8', - '₉' => '9', - '₊' => '+', - '₋' => '−', - '₌' => '=', - '₍' => '(', - '₎' => ')', - 'ₐ' => 'a', - 'ₑ' => 'e', - 'ₒ' => 'o', - 'ₓ' => 'x', - 'ₔ' => 'ə', - 'ₕ' => 'h', - 'ₖ' => 'k', - 'ₗ' => 'l', - 'ₘ' => 'm', - 'ₙ' => 'n', - 'ₚ' => 'p', - 'ₛ' => 's', - 'ₜ' => 't', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℠' => 'SM', - '℡' => 'TEL', - '™' => 'TM', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => '1⁄7', - '⅑' => '1⁄9', - '⅒' => '1⁄10', - '⅓' => '1⁄3', - '⅔' => '2⁄3', - '⅕' => '1⁄5', - '⅖' => '2⁄5', - '⅗' => '3⁄5', - '⅘' => '4⁄5', - '⅙' => '1⁄6', - '⅚' => '5⁄6', - '⅛' => '1⁄8', - '⅜' => '3⁄8', - '⅝' => '5⁄8', - '⅞' => '7⁄8', - '⅟' => '1⁄', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => '0⁄3', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '1', - '②' => '2', - '③' => '3', - '④' => '4', - '⑤' => '5', - '⑥' => '6', - '⑦' => '7', - '⑧' => '8', - '⑨' => '9', - '⑩' => '10', - '⑪' => '11', - '⑫' => '12', - '⑬' => '13', - '⑭' => '14', - '⑮' => '15', - '⑯' => '16', - '⑰' => '17', - '⑱' => '18', - '⑲' => '19', - '⑳' => '20', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => 'A', - 'Ⓑ' => 'B', - 'Ⓒ' => 'C', - 'Ⓓ' => 'D', - 'Ⓔ' => 'E', - 'Ⓕ' => 'F', - 'Ⓖ' => 'G', - 'Ⓗ' => 'H', - 'Ⓘ' => 'I', - 'Ⓙ' => 'J', - 'Ⓚ' => 'K', - 'Ⓛ' => 'L', - 'Ⓜ' => 'M', - 'Ⓝ' => 'N', - 'Ⓞ' => 'O', - 'Ⓟ' => 'P', - 'Ⓠ' => 'Q', - 'Ⓡ' => 'R', - 'Ⓢ' => 'S', - 'Ⓣ' => 'T', - 'Ⓤ' => 'U', - 'Ⓥ' => 'V', - 'Ⓦ' => 'W', - 'Ⓧ' => 'X', - 'Ⓨ' => 'Y', - 'Ⓩ' => 'Z', - 'ⓐ' => 'a', - 'ⓑ' => 'b', - 'ⓒ' => 'c', - 'ⓓ' => 'd', - 'ⓔ' => 'e', - 'ⓕ' => 'f', - 'ⓖ' => 'g', - 'ⓗ' => 'h', - 'ⓘ' => 'i', - 'ⓙ' => 'j', - 'ⓚ' => 'k', - 'ⓛ' => 'l', - 'ⓜ' => 'm', - 'ⓝ' => 'n', - 'ⓞ' => 'o', - 'ⓟ' => 'p', - 'ⓠ' => 'q', - 'ⓡ' => 'r', - 'ⓢ' => 's', - 'ⓣ' => 't', - 'ⓤ' => 'u', - 'ⓥ' => 'v', - 'ⓦ' => 'w', - 'ⓧ' => 'x', - 'ⓨ' => 'y', - 'ⓩ' => 'z', - '⓪' => '0', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - 'ⱼ' => 'j', - 'ⱽ' => 'V', - 'ⵯ' => 'ⵡ', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - '゛' => ' ゙', - '゜' => ' ゚', - 'ゟ' => 'より', - 'ヿ' => 'コト', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㆒' => '一', - '㆓' => '二', - '㆔' => '三', - '㆕' => '四', - '㆖' => '上', - '㆗' => '中', - '㆘' => '下', - '㆙' => '甲', - '㆚' => '乙', - '㆛' => '丙', - '㆜' => '丁', - '㆝' => '天', - '㆞' => '地', - '㆟' => '人', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '問', - '㉅' => '幼', - '㉆' => '文', - '㉇' => '箏', - '㉐' => 'PTE', - '㉑' => '21', - '㉒' => '22', - '㉓' => '23', - '㉔' => '24', - '㉕' => '25', - '㉖' => '26', - '㉗' => '27', - '㉘' => '28', - '㉙' => '29', - '㉚' => '30', - '㉛' => '31', - '㉜' => '32', - '㉝' => '33', - '㉞' => '34', - '㉟' => '35', - '㉠' => 'ᄀ', - '㉡' => 'ᄂ', - '㉢' => 'ᄃ', - '㉣' => 'ᄅ', - '㉤' => 'ᄆ', - '㉥' => 'ᄇ', - '㉦' => 'ᄉ', - '㉧' => 'ᄋ', - '㉨' => 'ᄌ', - '㉩' => 'ᄎ', - '㉪' => 'ᄏ', - '㉫' => 'ᄐ', - '㉬' => 'ᄑ', - '㉭' => 'ᄒ', - '㉮' => '가', - '㉯' => '나', - '㉰' => '다', - '㉱' => '라', - '㉲' => '마', - '㉳' => '바', - '㉴' => '사', - '㉵' => '아', - '㉶' => '자', - '㉷' => '차', - '㉸' => '카', - '㉹' => '타', - '㉺' => '파', - '㉻' => '하', - '㉼' => '참고', - '㉽' => '주의', - '㉾' => '우', - '㊀' => '一', - '㊁' => '二', - '㊂' => '三', - '㊃' => '四', - '㊄' => '五', - '㊅' => '六', - '㊆' => '七', - '㊇' => '八', - '㊈' => '九', - '㊉' => '十', - '㊊' => '月', - '㊋' => '火', - '㊌' => '水', - '㊍' => '木', - '㊎' => '金', - '㊏' => '土', - '㊐' => '日', - '㊑' => '株', - '㊒' => '有', - '㊓' => '社', - '㊔' => '名', - '㊕' => '特', - '㊖' => '財', - '㊗' => '祝', - '㊘' => '労', - '㊙' => '秘', - '㊚' => '男', - '㊛' => '女', - '㊜' => '適', - '㊝' => '優', - '㊞' => '印', - '㊟' => '注', - '㊠' => '項', - '㊡' => '休', - '㊢' => '写', - '㊣' => '正', - '㊤' => '上', - '㊥' => '中', - '㊦' => '下', - '㊧' => '左', - '㊨' => '右', - '㊩' => '医', - '㊪' => '宗', - '㊫' => '学', - '㊬' => '監', - '㊭' => '企', - '㊮' => '資', - '㊯' => '協', - '㊰' => '夜', - '㊱' => '36', - '㊲' => '37', - '㊳' => '38', - '㊴' => '39', - '㊵' => '40', - '㊶' => '41', - '㊷' => '42', - '㊸' => '43', - '㊹' => '44', - '㊺' => '45', - '㊻' => '46', - '㊼' => '47', - '㊽' => '48', - '㊾' => '49', - '㊿' => '50', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => 'ア', - '㋑' => 'イ', - '㋒' => 'ウ', - '㋓' => 'エ', - '㋔' => 'オ', - '㋕' => 'カ', - '㋖' => 'キ', - '㋗' => 'ク', - '㋘' => 'ケ', - '㋙' => 'コ', - '㋚' => 'サ', - '㋛' => 'シ', - '㋜' => 'ス', - '㋝' => 'セ', - '㋞' => 'ソ', - '㋟' => 'タ', - '㋠' => 'チ', - '㋡' => 'ツ', - '㋢' => 'テ', - '㋣' => 'ト', - '㋤' => 'ナ', - '㋥' => 'ニ', - '㋦' => 'ヌ', - '㋧' => 'ネ', - '㋨' => 'ノ', - '㋩' => 'ハ', - '㋪' => 'ヒ', - '㋫' => 'フ', - '㋬' => 'ヘ', - '㋭' => 'ホ', - '㋮' => 'マ', - '㋯' => 'ミ', - '㋰' => 'ム', - '㋱' => 'メ', - '㋲' => 'モ', - '㋳' => 'ヤ', - '㋴' => 'ユ', - '㋵' => 'ヨ', - '㋶' => 'ラ', - '㋷' => 'リ', - '㋸' => 'ル', - '㋹' => 'レ', - '㋺' => 'ロ', - '㋻' => 'ワ', - '㋼' => 'ヰ', - '㋽' => 'ヱ', - '㋾' => 'ヲ', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm2', - '㍹' => 'dm3', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μl', - '㎖' => 'ml', - '㎗' => 'dl', - '㎘' => 'kl', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm2', - '㎠' => 'cm2', - '㎡' => 'm2', - '㎢' => 'km2', - '㎣' => 'mm3', - '㎤' => 'cm3', - '㎥' => 'm3', - '㎦' => 'km3', - '㎧' => 'm∕s', - '㎨' => 'm∕s2', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s2', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - 'ꚜ' => 'ъ', - 'ꚝ' => 'ь', - 'ꝰ' => 'ꝯ', - 'ꟸ' => 'Ħ', - 'ꟹ' => 'œ', - 'ꭜ' => 'ꜧ', - 'ꭝ' => 'ꬷ', - 'ꭞ' => 'ɫ', - 'ꭟ' => 'ꭒ', - 'ꭩ' => 'ʍ', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', - 'ﬠ' => 'ע', - 'ﬡ' => 'א', - 'ﬢ' => 'ד', - 'ﬣ' => 'ה', - 'ﬤ' => 'כ', - 'ﬥ' => 'ל', - 'ﬦ' => 'ם', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ﭏ' => 'אל', - 'ﭐ' => 'ٱ', - 'ﭑ' => 'ٱ', - 'ﭒ' => 'ٻ', - 'ﭓ' => 'ٻ', - 'ﭔ' => 'ٻ', - 'ﭕ' => 'ٻ', - 'ﭖ' => 'پ', - 'ﭗ' => 'پ', - 'ﭘ' => 'پ', - 'ﭙ' => 'پ', - 'ﭚ' => 'ڀ', - 'ﭛ' => 'ڀ', - 'ﭜ' => 'ڀ', - 'ﭝ' => 'ڀ', - 'ﭞ' => 'ٺ', - 'ﭟ' => 'ٺ', - 'ﭠ' => 'ٺ', - 'ﭡ' => 'ٺ', - 'ﭢ' => 'ٿ', - 'ﭣ' => 'ٿ', - 'ﭤ' => 'ٿ', - 'ﭥ' => 'ٿ', - 'ﭦ' => 'ٹ', - 'ﭧ' => 'ٹ', - 'ﭨ' => 'ٹ', - 'ﭩ' => 'ٹ', - 'ﭪ' => 'ڤ', - 'ﭫ' => 'ڤ', - 'ﭬ' => 'ڤ', - 'ﭭ' => 'ڤ', - 'ﭮ' => 'ڦ', - 'ﭯ' => 'ڦ', - 'ﭰ' => 'ڦ', - 'ﭱ' => 'ڦ', - 'ﭲ' => 'ڄ', - 'ﭳ' => 'ڄ', - 'ﭴ' => 'ڄ', - 'ﭵ' => 'ڄ', - 'ﭶ' => 'ڃ', - 'ﭷ' => 'ڃ', - 'ﭸ' => 'ڃ', - 'ﭹ' => 'ڃ', - 'ﭺ' => 'چ', - 'ﭻ' => 'چ', - 'ﭼ' => 'چ', - 'ﭽ' => 'چ', - 'ﭾ' => 'ڇ', - 'ﭿ' => 'ڇ', - 'ﮀ' => 'ڇ', - 'ﮁ' => 'ڇ', - 'ﮂ' => 'ڍ', - 'ﮃ' => 'ڍ', - 'ﮄ' => 'ڌ', - 'ﮅ' => 'ڌ', - 'ﮆ' => 'ڎ', - 'ﮇ' => 'ڎ', - 'ﮈ' => 'ڈ', - 'ﮉ' => 'ڈ', - 'ﮊ' => 'ژ', - 'ﮋ' => 'ژ', - 'ﮌ' => 'ڑ', - 'ﮍ' => 'ڑ', - 'ﮎ' => 'ک', - 'ﮏ' => 'ک', - 'ﮐ' => 'ک', - 'ﮑ' => 'ک', - 'ﮒ' => 'گ', - 'ﮓ' => 'گ', - 'ﮔ' => 'گ', - 'ﮕ' => 'گ', - 'ﮖ' => 'ڳ', - 'ﮗ' => 'ڳ', - 'ﮘ' => 'ڳ', - 'ﮙ' => 'ڳ', - 'ﮚ' => 'ڱ', - 'ﮛ' => 'ڱ', - 'ﮜ' => 'ڱ', - 'ﮝ' => 'ڱ', - 'ﮞ' => 'ں', - 'ﮟ' => 'ں', - 'ﮠ' => 'ڻ', - 'ﮡ' => 'ڻ', - 'ﮢ' => 'ڻ', - 'ﮣ' => 'ڻ', - 'ﮤ' => 'ۀ', - 'ﮥ' => 'ۀ', - 'ﮦ' => 'ہ', - 'ﮧ' => 'ہ', - 'ﮨ' => 'ہ', - 'ﮩ' => 'ہ', - 'ﮪ' => 'ھ', - 'ﮫ' => 'ھ', - 'ﮬ' => 'ھ', - 'ﮭ' => 'ھ', - 'ﮮ' => 'ے', - 'ﮯ' => 'ے', - 'ﮰ' => 'ۓ', - 'ﮱ' => 'ۓ', - 'ﯓ' => 'ڭ', - 'ﯔ' => 'ڭ', - 'ﯕ' => 'ڭ', - 'ﯖ' => 'ڭ', - 'ﯗ' => 'ۇ', - 'ﯘ' => 'ۇ', - 'ﯙ' => 'ۆ', - 'ﯚ' => 'ۆ', - 'ﯛ' => 'ۈ', - 'ﯜ' => 'ۈ', - 'ﯝ' => 'ۇٴ', - 'ﯞ' => 'ۋ', - 'ﯟ' => 'ۋ', - 'ﯠ' => 'ۅ', - 'ﯡ' => 'ۅ', - 'ﯢ' => 'ۉ', - 'ﯣ' => 'ۉ', - 'ﯤ' => 'ې', - 'ﯥ' => 'ې', - 'ﯦ' => 'ې', - 'ﯧ' => 'ې', - 'ﯨ' => 'ى', - 'ﯩ' => 'ى', - 'ﯪ' => 'ئا', - 'ﯫ' => 'ئا', - 'ﯬ' => 'ئە', - 'ﯭ' => 'ئە', - 'ﯮ' => 'ئو', - 'ﯯ' => 'ئو', - 'ﯰ' => 'ئۇ', - 'ﯱ' => 'ئۇ', - 'ﯲ' => 'ئۆ', - 'ﯳ' => 'ئۆ', - 'ﯴ' => 'ئۈ', - 'ﯵ' => 'ئۈ', - 'ﯶ' => 'ئې', - 'ﯷ' => 'ئې', - 'ﯸ' => 'ئې', - 'ﯹ' => 'ئى', - 'ﯺ' => 'ئى', - 'ﯻ' => 'ئى', - 'ﯼ' => 'ی', - 'ﯽ' => 'ی', - 'ﯾ' => 'ی', - 'ﯿ' => 'ی', - 'ﰀ' => 'ئج', - 'ﰁ' => 'ئح', - 'ﰂ' => 'ئم', - 'ﰃ' => 'ئى', - 'ﰄ' => 'ئي', - 'ﰅ' => 'بج', - 'ﰆ' => 'بح', - 'ﰇ' => 'بخ', - 'ﰈ' => 'بم', - 'ﰉ' => 'بى', - 'ﰊ' => 'بي', - 'ﰋ' => 'تج', - 'ﰌ' => 'تح', - 'ﰍ' => 'تخ', - 'ﰎ' => 'تم', - 'ﰏ' => 'تى', - 'ﰐ' => 'تي', - 'ﰑ' => 'ثج', - 'ﰒ' => 'ثم', - 'ﰓ' => 'ثى', - 'ﰔ' => 'ثي', - 'ﰕ' => 'جح', - 'ﰖ' => 'جم', - 'ﰗ' => 'حج', - 'ﰘ' => 'حم', - 'ﰙ' => 'خج', - 'ﰚ' => 'خح', - 'ﰛ' => 'خم', - 'ﰜ' => 'سج', - 'ﰝ' => 'سح', - 'ﰞ' => 'سخ', - 'ﰟ' => 'سم', - 'ﰠ' => 'صح', - 'ﰡ' => 'صم', - 'ﰢ' => 'ضج', - 'ﰣ' => 'ضح', - 'ﰤ' => 'ضخ', - 'ﰥ' => 'ضم', - 'ﰦ' => 'طح', - 'ﰧ' => 'طم', - 'ﰨ' => 'ظم', - 'ﰩ' => 'عج', - 'ﰪ' => 'عم', - 'ﰫ' => 'غج', - 'ﰬ' => 'غم', - 'ﰭ' => 'فج', - 'ﰮ' => 'فح', - 'ﰯ' => 'فخ', - 'ﰰ' => 'فم', - 'ﰱ' => 'فى', - 'ﰲ' => 'في', - 'ﰳ' => 'قح', - 'ﰴ' => 'قم', - 'ﰵ' => 'قى', - 'ﰶ' => 'قي', - 'ﰷ' => 'كا', - 'ﰸ' => 'كج', - 'ﰹ' => 'كح', - 'ﰺ' => 'كخ', - 'ﰻ' => 'كل', - 'ﰼ' => 'كم', - 'ﰽ' => 'كى', - 'ﰾ' => 'كي', - 'ﰿ' => 'لج', - 'ﱀ' => 'لح', - 'ﱁ' => 'لخ', - 'ﱂ' => 'لم', - 'ﱃ' => 'لى', - 'ﱄ' => 'لي', - 'ﱅ' => 'مج', - 'ﱆ' => 'مح', - 'ﱇ' => 'مخ', - 'ﱈ' => 'مم', - 'ﱉ' => 'مى', - 'ﱊ' => 'مي', - 'ﱋ' => 'نج', - 'ﱌ' => 'نح', - 'ﱍ' => 'نخ', - 'ﱎ' => 'نم', - 'ﱏ' => 'نى', - 'ﱐ' => 'ني', - 'ﱑ' => 'هج', - 'ﱒ' => 'هم', - 'ﱓ' => 'هى', - 'ﱔ' => 'هي', - 'ﱕ' => 'يج', - 'ﱖ' => 'يح', - 'ﱗ' => 'يخ', - 'ﱘ' => 'يم', - 'ﱙ' => 'يى', - 'ﱚ' => 'يي', - 'ﱛ' => 'ذٰ', - 'ﱜ' => 'رٰ', - 'ﱝ' => 'ىٰ', - 'ﱞ' => ' ٌّ', - 'ﱟ' => ' ٍّ', - 'ﱠ' => ' َّ', - 'ﱡ' => ' ُّ', - 'ﱢ' => ' ِّ', - 'ﱣ' => ' ّٰ', - 'ﱤ' => 'ئر', - 'ﱥ' => 'ئز', - 'ﱦ' => 'ئم', - 'ﱧ' => 'ئن', - 'ﱨ' => 'ئى', - 'ﱩ' => 'ئي', - 'ﱪ' => 'بر', - 'ﱫ' => 'بز', - 'ﱬ' => 'بم', - 'ﱭ' => 'بن', - 'ﱮ' => 'بى', - 'ﱯ' => 'بي', - 'ﱰ' => 'تر', - 'ﱱ' => 'تز', - 'ﱲ' => 'تم', - 'ﱳ' => 'تن', - 'ﱴ' => 'تى', - 'ﱵ' => 'تي', - 'ﱶ' => 'ثر', - 'ﱷ' => 'ثز', - 'ﱸ' => 'ثم', - 'ﱹ' => 'ثن', - 'ﱺ' => 'ثى', - 'ﱻ' => 'ثي', - 'ﱼ' => 'فى', - 'ﱽ' => 'في', - 'ﱾ' => 'قى', - 'ﱿ' => 'قي', - 'ﲀ' => 'كا', - 'ﲁ' => 'كل', - 'ﲂ' => 'كم', - 'ﲃ' => 'كى', - 'ﲄ' => 'كي', - 'ﲅ' => 'لم', - 'ﲆ' => 'لى', - 'ﲇ' => 'لي', - 'ﲈ' => 'ما', - 'ﲉ' => 'مم', - 'ﲊ' => 'نر', - 'ﲋ' => 'نز', - 'ﲌ' => 'نم', - 'ﲍ' => 'نن', - 'ﲎ' => 'نى', - 'ﲏ' => 'ني', - 'ﲐ' => 'ىٰ', - 'ﲑ' => 'ير', - 'ﲒ' => 'يز', - 'ﲓ' => 'يم', - 'ﲔ' => 'ين', - 'ﲕ' => 'يى', - 'ﲖ' => 'يي', - 'ﲗ' => 'ئج', - 'ﲘ' => 'ئح', - 'ﲙ' => 'ئخ', - 'ﲚ' => 'ئم', - 'ﲛ' => 'ئه', - 'ﲜ' => 'بج', - 'ﲝ' => 'بح', - 'ﲞ' => 'بخ', - 'ﲟ' => 'بم', - 'ﲠ' => 'به', - 'ﲡ' => 'تج', - 'ﲢ' => 'تح', - 'ﲣ' => 'تخ', - 'ﲤ' => 'تم', - 'ﲥ' => 'ته', - 'ﲦ' => 'ثم', - 'ﲧ' => 'جح', - 'ﲨ' => 'جم', - 'ﲩ' => 'حج', - 'ﲪ' => 'حم', - 'ﲫ' => 'خج', - 'ﲬ' => 'خم', - 'ﲭ' => 'سج', - 'ﲮ' => 'سح', - 'ﲯ' => 'سخ', - 'ﲰ' => 'سم', - 'ﲱ' => 'صح', - 'ﲲ' => 'صخ', - 'ﲳ' => 'صم', - 'ﲴ' => 'ضج', - 'ﲵ' => 'ضح', - 'ﲶ' => 'ضخ', - 'ﲷ' => 'ضم', - 'ﲸ' => 'طح', - 'ﲹ' => 'ظم', - 'ﲺ' => 'عج', - 'ﲻ' => 'عم', - 'ﲼ' => 'غج', - 'ﲽ' => 'غم', - 'ﲾ' => 'فج', - 'ﲿ' => 'فح', - 'ﳀ' => 'فخ', - 'ﳁ' => 'فم', - 'ﳂ' => 'قح', - 'ﳃ' => 'قم', - 'ﳄ' => 'كج', - 'ﳅ' => 'كح', - 'ﳆ' => 'كخ', - 'ﳇ' => 'كل', - 'ﳈ' => 'كم', - 'ﳉ' => 'لج', - 'ﳊ' => 'لح', - 'ﳋ' => 'لخ', - 'ﳌ' => 'لم', - 'ﳍ' => 'له', - 'ﳎ' => 'مج', - 'ﳏ' => 'مح', - 'ﳐ' => 'مخ', - 'ﳑ' => 'مم', - 'ﳒ' => 'نج', - 'ﳓ' => 'نح', - 'ﳔ' => 'نخ', - 'ﳕ' => 'نم', - 'ﳖ' => 'نه', - 'ﳗ' => 'هج', - 'ﳘ' => 'هم', - 'ﳙ' => 'هٰ', - 'ﳚ' => 'يج', - 'ﳛ' => 'يح', - 'ﳜ' => 'يخ', - 'ﳝ' => 'يم', - 'ﳞ' => 'يه', - 'ﳟ' => 'ئم', - 'ﳠ' => 'ئه', - 'ﳡ' => 'بم', - 'ﳢ' => 'به', - 'ﳣ' => 'تم', - 'ﳤ' => 'ته', - 'ﳥ' => 'ثم', - 'ﳦ' => 'ثه', - 'ﳧ' => 'سم', - 'ﳨ' => 'سه', - 'ﳩ' => 'شم', - 'ﳪ' => 'شه', - 'ﳫ' => 'كل', - 'ﳬ' => 'كم', - 'ﳭ' => 'لم', - 'ﳮ' => 'نم', - 'ﳯ' => 'نه', - 'ﳰ' => 'يم', - 'ﳱ' => 'يه', - 'ﳲ' => 'ـَّ', - 'ﳳ' => 'ـُّ', - 'ﳴ' => 'ـِّ', - 'ﳵ' => 'طى', - 'ﳶ' => 'طي', - 'ﳷ' => 'عى', - 'ﳸ' => 'عي', - 'ﳹ' => 'غى', - 'ﳺ' => 'غي', - 'ﳻ' => 'سى', - 'ﳼ' => 'سي', - 'ﳽ' => 'شى', - 'ﳾ' => 'شي', - 'ﳿ' => 'حى', - 'ﴀ' => 'حي', - 'ﴁ' => 'جى', - 'ﴂ' => 'جي', - 'ﴃ' => 'خى', - 'ﴄ' => 'خي', - 'ﴅ' => 'صى', - 'ﴆ' => 'صي', - 'ﴇ' => 'ضى', - 'ﴈ' => 'ضي', - 'ﴉ' => 'شج', - 'ﴊ' => 'شح', - 'ﴋ' => 'شخ', - 'ﴌ' => 'شم', - 'ﴍ' => 'شر', - 'ﴎ' => 'سر', - 'ﴏ' => 'صر', - 'ﴐ' => 'ضر', - 'ﴑ' => 'طى', - 'ﴒ' => 'طي', - 'ﴓ' => 'عى', - 'ﴔ' => 'عي', - 'ﴕ' => 'غى', - 'ﴖ' => 'غي', - 'ﴗ' => 'سى', - 'ﴘ' => 'سي', - 'ﴙ' => 'شى', - 'ﴚ' => 'شي', - 'ﴛ' => 'حى', - 'ﴜ' => 'حي', - 'ﴝ' => 'جى', - 'ﴞ' => 'جي', - 'ﴟ' => 'خى', - 'ﴠ' => 'خي', - 'ﴡ' => 'صى', - 'ﴢ' => 'صي', - 'ﴣ' => 'ضى', - 'ﴤ' => 'ضي', - 'ﴥ' => 'شج', - 'ﴦ' => 'شح', - 'ﴧ' => 'شخ', - 'ﴨ' => 'شم', - 'ﴩ' => 'شر', - 'ﴪ' => 'سر', - 'ﴫ' => 'صر', - 'ﴬ' => 'ضر', - 'ﴭ' => 'شج', - 'ﴮ' => 'شح', - 'ﴯ' => 'شخ', - 'ﴰ' => 'شم', - 'ﴱ' => 'سه', - 'ﴲ' => 'شه', - 'ﴳ' => 'طم', - 'ﴴ' => 'سج', - 'ﴵ' => 'سح', - 'ﴶ' => 'سخ', - 'ﴷ' => 'شج', - 'ﴸ' => 'شح', - 'ﴹ' => 'شخ', - 'ﴺ' => 'طم', - 'ﴻ' => 'ظم', - 'ﴼ' => 'اً', - 'ﴽ' => 'اً', - 'ﵐ' => 'تجم', - 'ﵑ' => 'تحج', - 'ﵒ' => 'تحج', - 'ﵓ' => 'تحم', - 'ﵔ' => 'تخم', - 'ﵕ' => 'تمج', - 'ﵖ' => 'تمح', - 'ﵗ' => 'تمخ', - 'ﵘ' => 'جمح', - 'ﵙ' => 'جمح', - 'ﵚ' => 'حمي', - 'ﵛ' => 'حمى', - 'ﵜ' => 'سحج', - 'ﵝ' => 'سجح', - 'ﵞ' => 'سجى', - 'ﵟ' => 'سمح', - 'ﵠ' => 'سمح', - 'ﵡ' => 'سمج', - 'ﵢ' => 'سمم', - 'ﵣ' => 'سمم', - 'ﵤ' => 'صحح', - 'ﵥ' => 'صحح', - 'ﵦ' => 'صمم', - 'ﵧ' => 'شحم', - 'ﵨ' => 'شحم', - 'ﵩ' => 'شجي', - 'ﵪ' => 'شمخ', - 'ﵫ' => 'شمخ', - 'ﵬ' => 'شمم', - 'ﵭ' => 'شمم', - 'ﵮ' => 'ضحى', - 'ﵯ' => 'ضخم', - 'ﵰ' => 'ضخم', - 'ﵱ' => 'طمح', - 'ﵲ' => 'طمح', - 'ﵳ' => 'طمم', - 'ﵴ' => 'طمي', - 'ﵵ' => 'عجم', - 'ﵶ' => 'عمم', - 'ﵷ' => 'عمم', - 'ﵸ' => 'عمى', - 'ﵹ' => 'غمم', - 'ﵺ' => 'غمي', - 'ﵻ' => 'غمى', - 'ﵼ' => 'فخم', - 'ﵽ' => 'فخم', - 'ﵾ' => 'قمح', - 'ﵿ' => 'قمم', - 'ﶀ' => 'لحم', - 'ﶁ' => 'لحي', - 'ﶂ' => 'لحى', - 'ﶃ' => 'لجج', - 'ﶄ' => 'لجج', - 'ﶅ' => 'لخم', - 'ﶆ' => 'لخم', - 'ﶇ' => 'لمح', - 'ﶈ' => 'لمح', - 'ﶉ' => 'محج', - 'ﶊ' => 'محم', - 'ﶋ' => 'محي', - 'ﶌ' => 'مجح', - 'ﶍ' => 'مجم', - 'ﶎ' => 'مخج', - 'ﶏ' => 'مخم', - 'ﶒ' => 'مجخ', - 'ﶓ' => 'همج', - 'ﶔ' => 'همم', - 'ﶕ' => 'نحم', - 'ﶖ' => 'نحى', - 'ﶗ' => 'نجم', - 'ﶘ' => 'نجم', - 'ﶙ' => 'نجى', - 'ﶚ' => 'نمي', - 'ﶛ' => 'نمى', - 'ﶜ' => 'يمم', - 'ﶝ' => 'يمم', - 'ﶞ' => 'بخي', - 'ﶟ' => 'تجي', - 'ﶠ' => 'تجى', - 'ﶡ' => 'تخي', - 'ﶢ' => 'تخى', - 'ﶣ' => 'تمي', - 'ﶤ' => 'تمى', - 'ﶥ' => 'جمي', - 'ﶦ' => 'جحى', - 'ﶧ' => 'جمى', - 'ﶨ' => 'سخى', - 'ﶩ' => 'صحي', - 'ﶪ' => 'شحي', - 'ﶫ' => 'ضحي', - 'ﶬ' => 'لجي', - 'ﶭ' => 'لمي', - 'ﶮ' => 'يحي', - 'ﶯ' => 'يجي', - 'ﶰ' => 'يمي', - 'ﶱ' => 'ممي', - 'ﶲ' => 'قمي', - 'ﶳ' => 'نحي', - 'ﶴ' => 'قمح', - 'ﶵ' => 'لحم', - 'ﶶ' => 'عمي', - 'ﶷ' => 'كمي', - 'ﶸ' => 'نجح', - 'ﶹ' => 'مخي', - 'ﶺ' => 'لجم', - 'ﶻ' => 'كمم', - 'ﶼ' => 'لجم', - 'ﶽ' => 'نجح', - 'ﶾ' => 'جحي', - 'ﶿ' => 'حجي', - 'ﷀ' => 'مجي', - 'ﷁ' => 'فمي', - 'ﷂ' => 'بحي', - 'ﷃ' => 'كمم', - 'ﷄ' => 'عجم', - 'ﷅ' => 'صمم', - 'ﷆ' => 'سخي', - 'ﷇ' => 'نجي', - 'ﷰ' => 'صلے', - 'ﷱ' => 'قلے', - 'ﷲ' => 'الله', - 'ﷳ' => 'اكبر', - 'ﷴ' => 'محمد', - 'ﷵ' => 'صلعم', - 'ﷶ' => 'رسول', - 'ﷷ' => 'عليه', - 'ﷸ' => 'وسلم', - 'ﷹ' => 'صلى', - 'ﷺ' => 'صلى الله عليه وسلم', - 'ﷻ' => 'جل جلاله', - '﷼' => 'ریال', - '︐' => ',', - '︑' => '、', - '︒' => '。', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︗' => '〖', - '︘' => '〗', - '︙' => '...', - '︰' => '..', - '︱' => '—', - '︲' => '–', - '︳' => '_', - '︴' => '_', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '〔', - '︺' => '〕', - '︻' => '【', - '︼' => '】', - '︽' => '《', - '︾' => '》', - '︿' => '〈', - '﹀' => '〉', - '﹁' => '「', - '﹂' => '」', - '﹃' => '『', - '﹄' => '』', - '﹇' => '[', - '﹈' => ']', - '﹉' => ' ̅', - '﹊' => ' ̅', - '﹋' => ' ̅', - '﹌' => ' ̅', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - 'ﹰ' => ' ً', - 'ﹱ' => 'ـً', - 'ﹲ' => ' ٌ', - 'ﹴ' => ' ٍ', - 'ﹶ' => ' َ', - 'ﹷ' => 'ـَ', - 'ﹸ' => ' ُ', - 'ﹹ' => 'ـُ', - 'ﹺ' => ' ِ', - 'ﹻ' => 'ـِ', - 'ﹼ' => ' ّ', - 'ﹽ' => 'ـّ', - 'ﹾ' => ' ْ', - 'ﹿ' => 'ـْ', - 'ﺀ' => 'ء', - 'ﺁ' => 'آ', - 'ﺂ' => 'آ', - 'ﺃ' => 'أ', - 'ﺄ' => 'أ', - 'ﺅ' => 'ؤ', - 'ﺆ' => 'ؤ', - 'ﺇ' => 'إ', - 'ﺈ' => 'إ', - 'ﺉ' => 'ئ', - 'ﺊ' => 'ئ', - 'ﺋ' => 'ئ', - 'ﺌ' => 'ئ', - 'ﺍ' => 'ا', - 'ﺎ' => 'ا', - 'ﺏ' => 'ب', - 'ﺐ' => 'ب', - 'ﺑ' => 'ب', - 'ﺒ' => 'ب', - 'ﺓ' => 'ة', - 'ﺔ' => 'ة', - 'ﺕ' => 'ت', - 'ﺖ' => 'ت', - 'ﺗ' => 'ت', - 'ﺘ' => 'ت', - 'ﺙ' => 'ث', - 'ﺚ' => 'ث', - 'ﺛ' => 'ث', - 'ﺜ' => 'ث', - 'ﺝ' => 'ج', - 'ﺞ' => 'ج', - 'ﺟ' => 'ج', - 'ﺠ' => 'ج', - 'ﺡ' => 'ح', - 'ﺢ' => 'ح', - 'ﺣ' => 'ح', - 'ﺤ' => 'ح', - 'ﺥ' => 'خ', - 'ﺦ' => 'خ', - 'ﺧ' => 'خ', - 'ﺨ' => 'خ', - 'ﺩ' => 'د', - 'ﺪ' => 'د', - 'ﺫ' => 'ذ', - 'ﺬ' => 'ذ', - 'ﺭ' => 'ر', - 'ﺮ' => 'ر', - 'ﺯ' => 'ز', - 'ﺰ' => 'ز', - 'ﺱ' => 'س', - 'ﺲ' => 'س', - 'ﺳ' => 'س', - 'ﺴ' => 'س', - 'ﺵ' => 'ش', - 'ﺶ' => 'ش', - 'ﺷ' => 'ش', - 'ﺸ' => 'ش', - 'ﺹ' => 'ص', - 'ﺺ' => 'ص', - 'ﺻ' => 'ص', - 'ﺼ' => 'ص', - 'ﺽ' => 'ض', - 'ﺾ' => 'ض', - 'ﺿ' => 'ض', - 'ﻀ' => 'ض', - 'ﻁ' => 'ط', - 'ﻂ' => 'ط', - 'ﻃ' => 'ط', - 'ﻄ' => 'ط', - 'ﻅ' => 'ظ', - 'ﻆ' => 'ظ', - 'ﻇ' => 'ظ', - 'ﻈ' => 'ظ', - 'ﻉ' => 'ع', - 'ﻊ' => 'ع', - 'ﻋ' => 'ع', - 'ﻌ' => 'ع', - 'ﻍ' => 'غ', - 'ﻎ' => 'غ', - 'ﻏ' => 'غ', - 'ﻐ' => 'غ', - 'ﻑ' => 'ف', - 'ﻒ' => 'ف', - 'ﻓ' => 'ف', - 'ﻔ' => 'ف', - 'ﻕ' => 'ق', - 'ﻖ' => 'ق', - 'ﻗ' => 'ق', - 'ﻘ' => 'ق', - 'ﻙ' => 'ك', - 'ﻚ' => 'ك', - 'ﻛ' => 'ك', - 'ﻜ' => 'ك', - 'ﻝ' => 'ل', - 'ﻞ' => 'ل', - 'ﻟ' => 'ل', - 'ﻠ' => 'ل', - 'ﻡ' => 'م', - 'ﻢ' => 'م', - 'ﻣ' => 'م', - 'ﻤ' => 'م', - 'ﻥ' => 'ن', - 'ﻦ' => 'ن', - 'ﻧ' => 'ن', - 'ﻨ' => 'ن', - 'ﻩ' => 'ه', - 'ﻪ' => 'ه', - 'ﻫ' => 'ه', - 'ﻬ' => 'ه', - 'ﻭ' => 'و', - 'ﻮ' => 'و', - 'ﻯ' => 'ى', - 'ﻰ' => 'ى', - 'ﻱ' => 'ي', - 'ﻲ' => 'ي', - 'ﻳ' => 'ي', - 'ﻴ' => 'ي', - 'ﻵ' => 'لآ', - 'ﻶ' => 'لآ', - 'ﻷ' => 'لأ', - 'ﻸ' => 'لأ', - 'ﻹ' => 'لإ', - 'ﻺ' => 'لإ', - 'ﻻ' => 'لا', - 'ﻼ' => 'لا', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - 'A' => 'A', - 'B' => 'B', - 'C' => 'C', - 'D' => 'D', - 'E' => 'E', - 'F' => 'F', - 'G' => 'G', - 'H' => 'H', - 'I' => 'I', - 'J' => 'J', - 'K' => 'K', - 'L' => 'L', - 'M' => 'M', - 'N' => 'N', - 'O' => 'O', - 'P' => 'P', - 'Q' => 'Q', - 'R' => 'R', - 'S' => 'S', - 'T' => 'T', - 'U' => 'U', - 'V' => 'V', - 'W' => 'W', - 'X' => 'X', - 'Y' => 'Y', - 'Z' => 'Z', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - 'a' => 'a', - 'b' => 'b', - 'c' => 'c', - 'd' => 'd', - 'e' => 'e', - 'f' => 'f', - 'g' => 'g', - 'h' => 'h', - 'i' => 'i', - 'j' => 'j', - 'k' => 'k', - 'l' => 'l', - 'm' => 'm', - 'n' => 'n', - 'o' => 'o', - 'p' => 'p', - 'q' => 'q', - 'r' => 'r', - 's' => 's', - 't' => 't', - 'u' => 'u', - 'v' => 'v', - 'w' => 'w', - 'x' => 'x', - 'y' => 'y', - 'z' => 'z', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ᅠ', - 'ᄀ' => 'ᄀ', - 'ᄁ' => 'ᄁ', - 'ᆪ' => 'ᆪ', - 'ᄂ' => 'ᄂ', - 'ᆬ' => 'ᆬ', - 'ᆭ' => 'ᆭ', - 'ᄃ' => 'ᄃ', - 'ᄄ' => 'ᄄ', - 'ᄅ' => 'ᄅ', - 'ᆰ' => 'ᆰ', - 'ᆱ' => 'ᆱ', - 'ᆲ' => 'ᆲ', - 'ᆳ' => 'ᆳ', - 'ᆴ' => 'ᆴ', - 'ᆵ' => 'ᆵ', - 'ᄚ' => 'ᄚ', - 'ᄆ' => 'ᄆ', - 'ᄇ' => 'ᄇ', - 'ᄈ' => 'ᄈ', - 'ᄡ' => 'ᄡ', - 'ᄉ' => 'ᄉ', - 'ᄊ' => 'ᄊ', - 'ᄋ' => 'ᄋ', - 'ᄌ' => 'ᄌ', - 'ᄍ' => 'ᄍ', - 'ᄎ' => 'ᄎ', - 'ᄏ' => 'ᄏ', - 'ᄐ' => 'ᄐ', - 'ᄑ' => 'ᄑ', - 'ᄒ' => 'ᄒ', - 'ᅡ' => 'ᅡ', - 'ᅢ' => 'ᅢ', - 'ᅣ' => 'ᅣ', - 'ᅤ' => 'ᅤ', - 'ᅥ' => 'ᅥ', - 'ᅦ' => 'ᅦ', - 'ᅧ' => 'ᅧ', - 'ᅨ' => 'ᅨ', - 'ᅩ' => 'ᅩ', - 'ᅪ' => 'ᅪ', - 'ᅫ' => 'ᅫ', - 'ᅬ' => 'ᅬ', - 'ᅭ' => 'ᅭ', - 'ᅮ' => 'ᅮ', - 'ᅯ' => 'ᅯ', - 'ᅰ' => 'ᅰ', - 'ᅱ' => 'ᅱ', - 'ᅲ' => 'ᅲ', - 'ᅳ' => 'ᅳ', - 'ᅴ' => 'ᅴ', - 'ᅵ' => 'ᅵ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => ' ̄', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'Θ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ε', - '𝛝' => 'θ', - '𝛞' => 'κ', - '𝛟' => 'φ', - '𝛠' => 'ρ', - '𝛡' => 'π', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'Θ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ε', - '𝜗' => 'θ', - '𝜘' => 'κ', - '𝜙' => 'φ', - '𝜚' => 'ρ', - '𝜛' => 'π', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'Θ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ε', - '𝝑' => 'θ', - '𝝒' => 'κ', - '𝝓' => 'φ', - '𝝔' => 'ρ', - '𝝕' => 'π', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'Θ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ε', - '𝞋' => 'θ', - '𝞌' => 'κ', - '𝞍' => 'φ', - '𝞎' => 'ρ', - '𝞏' => 'π', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'Θ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ε', - '𝟅' => 'θ', - '𝟆' => 'κ', - '𝟇' => 'φ', - '𝟈' => 'ρ', - '𝟉' => 'π', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => 'C', - '🄬' => 'R', - '🄭' => 'CD', - '🄮' => 'WZ', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🅪' => 'MC', - '🅫' => 'MD', - '🅬' => 'MR', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '得', - '🉑' => '可', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap.php deleted file mode 100644 index 3608e5c..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php deleted file mode 100644 index e36d1a9..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/composer.json b/vendor/symfony/polyfill-intl-normalizer/composer.json deleted file mode 100644 index 8f4cfb4..0000000 --- a/vendor/symfony/polyfill-intl-normalizer/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "symfony/polyfill-intl-normalizer", - "type": "library", - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 4cd8bdd..0000000 --- a/vendor/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index 8b3b758..0000000 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,869 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas - * - * @internal - */ -final class Mbstring -{ - public const MB_CASE_FOLD = \PHP_INT_MAX; - - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - private static $caseFold = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { - $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); - } else { - $fromEncoding = self::getEncoding($fromEncoding); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); - } - - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) - { - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - public static function mb_decode_mimeheader($s) - { - return iconv_mime_decode($s, 2, self::$internalEncoding); - } - - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); - } - - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; // Instead of '' (cf. mb_decode_numericentity). - } - - if (null !== $is_hex && !is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - for ($j = 0; $j < $cnt; $j += 4) { - if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { - $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (\MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); - } else { - if (\MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - $normalizedEncoding = self::getEncoding($encoding); - - if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($normalizedLang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $normalizedLang; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); - } - - public static function mb_list_encodings() - { - return ['UTF-8']; - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return ['utf8']; - } - - return false; - } - - public static function mb_check_encoding($var = null, $encoding = null) - { - if (null === $encoding) { - if (null === $var) { - return false; - } - $encoding = self::$internalEncoding; - } - - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @iconv_strlen($s, $encoding); - } - - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return iconv_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - - if ($offset != (int) $offset) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - if (80000 > \PHP_VERSION_ID) { - trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - return false; - } - - throw new \ValueError('Argument #2 ($length) must be greater than 0'); - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); - } - - $result = []; - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - public static function mb_strtolower($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); - } - - public static function mb_strtoupper($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (null === $c) { - return 'none'; - } - if (0 === strcasecmp($c, 'none')) { - return true; - } - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) iconv_substr($s, $start, $length, $encoding); - } - - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = [ - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ]; - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$type]; - } - - return false; - } - - public static function mb_http_input($type = '') - { - return false; - } - - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; - } - - public static function mb_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; - } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); - } - - return self::mb_substr($haystack, $pos, null, $encoding); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } -} diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md deleted file mode 100644 index 4efb599..0000000 --- a/vendor/symfony/polyfill-mbstring/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Symfony Polyfill / Mbstring -=========================== - -This component provides a partial, native PHP implementation for the -[Mbstring](https://php.net/mbstring) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index a22eca5..0000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1397 +0,0 @@ - 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - 'Ŷ' => 'ŷ', - 'Ÿ' => 'ÿ', - 'Ź' => 'ź', - 'Ż' => 'ż', - 'Ž' => 'ž', - 'Ɓ' => 'ɓ', - 'Ƃ' => 'ƃ', - 'Ƅ' => 'ƅ', - 'Ɔ' => 'ɔ', - 'Ƈ' => 'ƈ', - 'Ɖ' => 'ɖ', - 'Ɗ' => 'ɗ', - 'Ƌ' => 'ƌ', - 'Ǝ' => 'ǝ', - 'Ə' => 'ə', - 'Ɛ' => 'ɛ', - 'Ƒ' => 'ƒ', - 'Ɠ' => 'ɠ', - 'Ɣ' => 'ɣ', - 'Ɩ' => 'ɩ', - 'Ɨ' => 'ɨ', - 'Ƙ' => 'ƙ', - 'Ɯ' => 'ɯ', - 'Ɲ' => 'ɲ', - 'Ɵ' => 'ɵ', - 'Ơ' => 'ơ', - 'Ƣ' => 'ƣ', - 'Ƥ' => 'ƥ', - 'Ʀ' => 'ʀ', - 'Ƨ' => 'ƨ', - 'Ʃ' => 'ʃ', - 'Ƭ' => 'ƭ', - 'Ʈ' => 'ʈ', - 'Ư' => 'ư', - 'Ʊ' => 'ʊ', - 'Ʋ' => 'ʋ', - 'Ƴ' => 'ƴ', - 'Ƶ' => 'ƶ', - 'Ʒ' => 'ʒ', - 'Ƹ' => 'ƹ', - 'Ƽ' => 'ƽ', - 'DŽ' => 'dž', - 'Dž' => 'dž', - 'LJ' => 'lj', - 'Lj' => 'lj', - 'NJ' => 'nj', - 'Nj' => 'nj', - 'Ǎ' => 'ǎ', - 'Ǐ' => 'ǐ', - 'Ǒ' => 'ǒ', - 'Ǔ' => 'ǔ', - 'Ǖ' => 'ǖ', - 'Ǘ' => 'ǘ', - 'Ǚ' => 'ǚ', - 'Ǜ' => 'ǜ', - 'Ǟ' => 'ǟ', - 'Ǡ' => 'ǡ', - 'Ǣ' => 'ǣ', - 'Ǥ' => 'ǥ', - 'Ǧ' => 'ǧ', - 'Ǩ' => 'ǩ', - 'Ǫ' => 'ǫ', - 'Ǭ' => 'ǭ', - 'Ǯ' => 'ǯ', - 'DZ' => 'dz', - 'Dz' => 'dz', - 'Ǵ' => 'ǵ', - 'Ƕ' => 'ƕ', - 'Ƿ' => 'ƿ', - 'Ǹ' => 'ǹ', - 'Ǻ' => 'ǻ', - 'Ǽ' => 'ǽ', - 'Ǿ' => 'ǿ', - 'Ȁ' => 'ȁ', - 'Ȃ' => 'ȃ', - 'Ȅ' => 'ȅ', - 'Ȇ' => 'ȇ', - 'Ȉ' => 'ȉ', - 'Ȋ' => 'ȋ', - 'Ȍ' => 'ȍ', - 'Ȏ' => 'ȏ', - 'Ȑ' => 'ȑ', - 'Ȓ' => 'ȓ', - 'Ȕ' => 'ȕ', - 'Ȗ' => 'ȗ', - 'Ș' => 'ș', - 'Ț' => 'ț', - 'Ȝ' => 'ȝ', - 'Ȟ' => 'ȟ', - 'Ƞ' => 'ƞ', - 'Ȣ' => 'ȣ', - 'Ȥ' => 'ȥ', - 'Ȧ' => 'ȧ', - 'Ȩ' => 'ȩ', - 'Ȫ' => 'ȫ', - 'Ȭ' => 'ȭ', - 'Ȯ' => 'ȯ', - 'Ȱ' => 'ȱ', - 'Ȳ' => 'ȳ', - 'Ⱥ' => 'ⱥ', - 'Ȼ' => 'ȼ', - 'Ƚ' => 'ƚ', - 'Ⱦ' => 'ⱦ', - 'Ɂ' => 'ɂ', - 'Ƀ' => 'ƀ', - 'Ʉ' => 'ʉ', - 'Ʌ' => 'ʌ', - 'Ɇ' => 'ɇ', - 'Ɉ' => 'ɉ', - 'Ɋ' => 'ɋ', - 'Ɍ' => 'ɍ', - 'Ɏ' => 'ɏ', - 'Ͱ' => 'ͱ', - 'Ͳ' => 'ͳ', - 'Ͷ' => 'ͷ', - 'Ϳ' => 'ϳ', - 'Ά' => 'ά', - 'Έ' => 'έ', - 'Ή' => 'ή', - 'Ί' => 'ί', - 'Ό' => 'ό', - 'Ύ' => 'ύ', - 'Ώ' => 'ώ', - 'Α' => 'α', - 'Β' => 'β', - 'Γ' => 'γ', - 'Δ' => 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о', - 'П' => 'п', - 'Р' => 'р', - 'С' => 'с', - 'Т' => 'т', - 'У' => 'у', - 'Ф' => 'ф', - 'Х' => 'х', - 'Ц' => 'ц', - 'Ч' => 'ч', - 'Ш' => 'ш', - 'Щ' => 'щ', - 'Ъ' => 'ъ', - 'Ы' => 'ы', - 'Ь' => 'ь', - 'Э' => 'э', - 'Ю' => 'ю', - 'Я' => 'я', - 'Ѡ' => 'ѡ', - 'Ѣ' => 'ѣ', - 'Ѥ' => 'ѥ', - 'Ѧ' => 'ѧ', - 'Ѩ' => 'ѩ', - 'Ѫ' => 'ѫ', - 'Ѭ' => 'ѭ', - 'Ѯ' => 'ѯ', - 'Ѱ' => 'ѱ', - 'Ѳ' => 'ѳ', - 'Ѵ' => 'ѵ', - 'Ѷ' => 'ѷ', - 'Ѹ' => 'ѹ', - 'Ѻ' => 'ѻ', - 'Ѽ' => 'ѽ', - 'Ѿ' => 'ѿ', - 'Ҁ' => 'ҁ', - 'Ҋ' => 'ҋ', - 'Ҍ' => 'ҍ', - 'Ҏ' => 'ҏ', - 'Ґ' => 'ґ', - 'Ғ' => 'ғ', - 'Ҕ' => 'ҕ', - 'Җ' => 'җ', - 'Ҙ' => 'ҙ', - 'Қ' => 'қ', - 'Ҝ' => 'ҝ', - 'Ҟ' => 'ҟ', - 'Ҡ' => 'ҡ', - 'Ң' => 'ң', - 'Ҥ' => 'ҥ', - 'Ҧ' => 'ҧ', - 'Ҩ' => 'ҩ', - 'Ҫ' => 'ҫ', - 'Ҭ' => 'ҭ', - 'Ү' => 'ү', - 'Ұ' => 'ұ', - 'Ҳ' => 'ҳ', - 'Ҵ' => 'ҵ', - 'Ҷ' => 'ҷ', - 'Ҹ' => 'ҹ', - 'Һ' => 'һ', - 'Ҽ' => 'ҽ', - 'Ҿ' => 'ҿ', - 'Ӏ' => 'ӏ', - 'Ӂ' => 'ӂ', - 'Ӄ' => 'ӄ', - 'Ӆ' => 'ӆ', - 'Ӈ' => 'ӈ', - 'Ӊ' => 'ӊ', - 'Ӌ' => 'ӌ', - 'Ӎ' => 'ӎ', - 'Ӑ' => 'ӑ', - 'Ӓ' => 'ӓ', - 'Ӕ' => 'ӕ', - 'Ӗ' => 'ӗ', - 'Ә' => 'ә', - 'Ӛ' => 'ӛ', - 'Ӝ' => 'ӝ', - 'Ӟ' => 'ӟ', - 'Ӡ' => 'ӡ', - 'Ӣ' => 'ӣ', - 'Ӥ' => 'ӥ', - 'Ӧ' => 'ӧ', - 'Ө' => 'ө', - 'Ӫ' => 'ӫ', - 'Ӭ' => 'ӭ', - 'Ӯ' => 'ӯ', - 'Ӱ' => 'ӱ', - 'Ӳ' => 'ӳ', - 'Ӵ' => 'ӵ', - 'Ӷ' => 'ӷ', - 'Ӹ' => 'ӹ', - 'Ӻ' => 'ӻ', - 'Ӽ' => 'ӽ', - 'Ӿ' => 'ӿ', - 'Ԁ' => 'ԁ', - 'Ԃ' => 'ԃ', - 'Ԅ' => 'ԅ', - 'Ԇ' => 'ԇ', - 'Ԉ' => 'ԉ', - 'Ԋ' => 'ԋ', - 'Ԍ' => 'ԍ', - 'Ԏ' => 'ԏ', - 'Ԑ' => 'ԑ', - 'Ԓ' => 'ԓ', - 'Ԕ' => 'ԕ', - 'Ԗ' => 'ԗ', - 'Ԙ' => 'ԙ', - 'Ԛ' => 'ԛ', - 'Ԝ' => 'ԝ', - 'Ԟ' => 'ԟ', - 'Ԡ' => 'ԡ', - 'Ԣ' => 'ԣ', - 'Ԥ' => 'ԥ', - 'Ԧ' => 'ԧ', - 'Ԩ' => 'ԩ', - 'Ԫ' => 'ԫ', - 'Ԭ' => 'ԭ', - 'Ԯ' => 'ԯ', - 'Ա' => 'ա', - 'Բ' => 'բ', - 'Գ' => 'գ', - 'Դ' => 'դ', - 'Ե' => 'ե', - 'Զ' => 'զ', - 'Է' => 'է', - 'Ը' => 'ը', - 'Թ' => 'թ', - 'Ժ' => 'ժ', - 'Ի' => 'ի', - 'Լ' => 'լ', - 'Խ' => 'խ', - 'Ծ' => 'ծ', - 'Կ' => 'կ', - 'Հ' => 'հ', - 'Ձ' => 'ձ', - 'Ղ' => 'ղ', - 'Ճ' => 'ճ', - 'Մ' => 'մ', - 'Յ' => 'յ', - 'Ն' => 'ն', - 'Շ' => 'շ', - 'Ո' => 'ո', - 'Չ' => 'չ', - 'Պ' => 'պ', - 'Ջ' => 'ջ', - 'Ռ' => 'ռ', - 'Ս' => 'ս', - 'Վ' => 'վ', - 'Տ' => 'տ', - 'Ր' => 'ր', - 'Ց' => 'ց', - 'Ւ' => 'ւ', - 'Փ' => 'փ', - 'Ք' => 'ք', - 'Օ' => 'օ', - 'Ֆ' => 'ֆ', - 'Ⴀ' => 'ⴀ', - 'Ⴁ' => 'ⴁ', - 'Ⴂ' => 'ⴂ', - 'Ⴃ' => 'ⴃ', - 'Ⴄ' => 'ⴄ', - 'Ⴅ' => 'ⴅ', - 'Ⴆ' => 'ⴆ', - 'Ⴇ' => 'ⴇ', - 'Ⴈ' => 'ⴈ', - 'Ⴉ' => 'ⴉ', - 'Ⴊ' => 'ⴊ', - 'Ⴋ' => 'ⴋ', - 'Ⴌ' => 'ⴌ', - 'Ⴍ' => 'ⴍ', - 'Ⴎ' => 'ⴎ', - 'Ⴏ' => 'ⴏ', - 'Ⴐ' => 'ⴐ', - 'Ⴑ' => 'ⴑ', - 'Ⴒ' => 'ⴒ', - 'Ⴓ' => 'ⴓ', - 'Ⴔ' => 'ⴔ', - 'Ⴕ' => 'ⴕ', - 'Ⴖ' => 'ⴖ', - 'Ⴗ' => 'ⴗ', - 'Ⴘ' => 'ⴘ', - 'Ⴙ' => 'ⴙ', - 'Ⴚ' => 'ⴚ', - 'Ⴛ' => 'ⴛ', - 'Ⴜ' => 'ⴜ', - 'Ⴝ' => 'ⴝ', - 'Ⴞ' => 'ⴞ', - 'Ⴟ' => 'ⴟ', - 'Ⴠ' => 'ⴠ', - 'Ⴡ' => 'ⴡ', - 'Ⴢ' => 'ⴢ', - 'Ⴣ' => 'ⴣ', - 'Ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ꭰ' => 'ꭰ', - 'Ꭱ' => 'ꭱ', - 'Ꭲ' => 'ꭲ', - 'Ꭳ' => 'ꭳ', - 'Ꭴ' => 'ꭴ', - 'Ꭵ' => 'ꭵ', - 'Ꭶ' => 'ꭶ', - 'Ꭷ' => 'ꭷ', - 'Ꭸ' => 'ꭸ', - 'Ꭹ' => 'ꭹ', - 'Ꭺ' => 'ꭺ', - 'Ꭻ' => 'ꭻ', - 'Ꭼ' => 'ꭼ', - 'Ꭽ' => 'ꭽ', - 'Ꭾ' => 'ꭾ', - 'Ꭿ' => 'ꭿ', - 'Ꮀ' => 'ꮀ', - 'Ꮁ' => 'ꮁ', - 'Ꮂ' => 'ꮂ', - 'Ꮃ' => 'ꮃ', - 'Ꮄ' => 'ꮄ', - 'Ꮅ' => 'ꮅ', - 'Ꮆ' => 'ꮆ', - 'Ꮇ' => 'ꮇ', - 'Ꮈ' => 'ꮈ', - 'Ꮉ' => 'ꮉ', - 'Ꮊ' => 'ꮊ', - 'Ꮋ' => 'ꮋ', - 'Ꮌ' => 'ꮌ', - 'Ꮍ' => 'ꮍ', - 'Ꮎ' => 'ꮎ', - 'Ꮏ' => 'ꮏ', - 'Ꮐ' => 'ꮐ', - 'Ꮑ' => 'ꮑ', - 'Ꮒ' => 'ꮒ', - 'Ꮓ' => 'ꮓ', - 'Ꮔ' => 'ꮔ', - 'Ꮕ' => 'ꮕ', - 'Ꮖ' => 'ꮖ', - 'Ꮗ' => 'ꮗ', - 'Ꮘ' => 'ꮘ', - 'Ꮙ' => 'ꮙ', - 'Ꮚ' => 'ꮚ', - 'Ꮛ' => 'ꮛ', - 'Ꮜ' => 'ꮜ', - 'Ꮝ' => 'ꮝ', - 'Ꮞ' => 'ꮞ', - 'Ꮟ' => 'ꮟ', - 'Ꮠ' => 'ꮠ', - 'Ꮡ' => 'ꮡ', - 'Ꮢ' => 'ꮢ', - 'Ꮣ' => 'ꮣ', - 'Ꮤ' => 'ꮤ', - 'Ꮥ' => 'ꮥ', - 'Ꮦ' => 'ꮦ', - 'Ꮧ' => 'ꮧ', - 'Ꮨ' => 'ꮨ', - 'Ꮩ' => 'ꮩ', - 'Ꮪ' => 'ꮪ', - 'Ꮫ' => 'ꮫ', - 'Ꮬ' => 'ꮬ', - 'Ꮭ' => 'ꮭ', - 'Ꮮ' => 'ꮮ', - 'Ꮯ' => 'ꮯ', - 'Ꮰ' => 'ꮰ', - 'Ꮱ' => 'ꮱ', - 'Ꮲ' => 'ꮲ', - 'Ꮳ' => 'ꮳ', - 'Ꮴ' => 'ꮴ', - 'Ꮵ' => 'ꮵ', - 'Ꮶ' => 'ꮶ', - 'Ꮷ' => 'ꮷ', - 'Ꮸ' => 'ꮸ', - 'Ꮹ' => 'ꮹ', - 'Ꮺ' => 'ꮺ', - 'Ꮻ' => 'ꮻ', - 'Ꮼ' => 'ꮼ', - 'Ꮽ' => 'ꮽ', - 'Ꮾ' => 'ꮾ', - 'Ꮿ' => 'ꮿ', - 'Ᏸ' => 'ᏸ', - 'Ᏹ' => 'ᏹ', - 'Ᏺ' => 'ᏺ', - 'Ᏻ' => 'ᏻ', - 'Ᏼ' => 'ᏼ', - 'Ᏽ' => 'ᏽ', - 'Ა' => 'ა', - 'Ბ' => 'ბ', - 'Გ' => 'გ', - 'Დ' => 'დ', - 'Ე' => 'ე', - 'Ვ' => 'ვ', - 'Ზ' => 'ზ', - 'Თ' => 'თ', - 'Ი' => 'ი', - 'Კ' => 'კ', - 'Ლ' => 'ლ', - 'Მ' => 'მ', - 'Ნ' => 'ნ', - 'Ო' => 'ო', - 'Პ' => 'პ', - 'Ჟ' => 'ჟ', - 'Რ' => 'რ', - 'Ს' => 'ს', - 'Ტ' => 'ტ', - 'Უ' => 'უ', - 'Ფ' => 'ფ', - 'Ქ' => 'ქ', - 'Ღ' => 'ღ', - 'Ყ' => 'ყ', - 'Შ' => 'შ', - 'Ჩ' => 'ჩ', - 'Ც' => 'ც', - 'Ძ' => 'ძ', - 'Წ' => 'წ', - 'Ჭ' => 'ჭ', - 'Ხ' => 'ხ', - 'Ჯ' => 'ჯ', - 'Ჰ' => 'ჰ', - 'Ჱ' => 'ჱ', - 'Ჲ' => 'ჲ', - 'Ჳ' => 'ჳ', - 'Ჴ' => 'ჴ', - 'Ჵ' => 'ჵ', - 'Ჶ' => 'ჶ', - 'Ჷ' => 'ჷ', - 'Ჸ' => 'ჸ', - 'Ჹ' => 'ჹ', - 'Ჺ' => 'ჺ', - 'Ჽ' => 'ჽ', - 'Ჾ' => 'ჾ', - 'Ჿ' => 'ჿ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ɪ' => 'ɪ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'Ʝ' => 'ʝ', - 'Ꭓ' => 'ꭓ', - 'Ꞵ' => 'ꞵ', - 'Ꞷ' => 'ꞷ', - 'Ꞹ' => 'ꞹ', - 'Ꞻ' => 'ꞻ', - 'Ꞽ' => 'ꞽ', - 'Ꞿ' => 'ꞿ', - 'Ꟃ' => 'ꟃ', - 'Ꞔ' => 'ꞔ', - 'Ʂ' => 'ʂ', - 'Ᶎ' => 'ᶎ', - 'Ꟈ' => 'ꟈ', - 'Ꟊ' => 'ꟊ', - 'Ꟶ' => 'ꟶ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𐒰' => '𐓘', - '𐒱' => '𐓙', - '𐒲' => '𐓚', - '𐒳' => '𐓛', - '𐒴' => '𐓜', - '𐒵' => '𐓝', - '𐒶' => '𐓞', - '𐒷' => '𐓟', - '𐒸' => '𐓠', - '𐒹' => '𐓡', - '𐒺' => '𐓢', - '𐒻' => '𐓣', - '𐒼' => '𐓤', - '𐒽' => '𐓥', - '𐒾' => '𐓦', - '𐒿' => '𐓧', - '𐓀' => '𐓨', - '𐓁' => '𐓩', - '𐓂' => '𐓪', - '𐓃' => '𐓫', - '𐓄' => '𐓬', - '𐓅' => '𐓭', - '𐓆' => '𐓮', - '𐓇' => '𐓯', - '𐓈' => '𐓰', - '𐓉' => '𐓱', - '𐓊' => '𐓲', - '𐓋' => '𐓳', - '𐓌' => '𐓴', - '𐓍' => '𐓵', - '𐓎' => '𐓶', - '𐓏' => '𐓷', - '𐓐' => '𐓸', - '𐓑' => '𐓹', - '𐓒' => '𐓺', - '𐓓' => '𐓻', - '𐲀' => '𐳀', - '𐲁' => '𐳁', - '𐲂' => '𐳂', - '𐲃' => '𐳃', - '𐲄' => '𐳄', - '𐲅' => '𐳅', - '𐲆' => '𐳆', - '𐲇' => '𐳇', - '𐲈' => '𐳈', - '𐲉' => '𐳉', - '𐲊' => '𐳊', - '𐲋' => '𐳋', - '𐲌' => '𐳌', - '𐲍' => '𐳍', - '𐲎' => '𐳎', - '𐲏' => '𐳏', - '𐲐' => '𐳐', - '𐲑' => '𐳑', - '𐲒' => '𐳒', - '𐲓' => '𐳓', - '𐲔' => '𐳔', - '𐲕' => '𐳕', - '𐲖' => '𐳖', - '𐲗' => '𐳗', - '𐲘' => '𐳘', - '𐲙' => '𐳙', - '𐲚' => '𐳚', - '𐲛' => '𐳛', - '𐲜' => '𐳜', - '𐲝' => '𐳝', - '𐲞' => '𐳞', - '𐲟' => '𐳟', - '𐲠' => '𐳠', - '𐲡' => '𐳡', - '𐲢' => '𐳢', - '𐲣' => '𐳣', - '𐲤' => '𐳤', - '𐲥' => '𐳥', - '𐲦' => '𐳦', - '𐲧' => '𐳧', - '𐲨' => '𐳨', - '𐲩' => '𐳩', - '𐲪' => '𐳪', - '𐲫' => '𐳫', - '𐲬' => '𐳬', - '𐲭' => '𐳭', - '𐲮' => '𐳮', - '𐲯' => '𐳯', - '𐲰' => '𐳰', - '𐲱' => '𐳱', - '𐲲' => '𐳲', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', - '𖹀' => '𖹠', - '𖹁' => '𖹡', - '𖹂' => '𖹢', - '𖹃' => '𖹣', - '𖹄' => '𖹤', - '𖹅' => '𖹥', - '𖹆' => '𖹦', - '𖹇' => '𖹧', - '𖹈' => '𖹨', - '𖹉' => '𖹩', - '𖹊' => '𖹪', - '𖹋' => '𖹫', - '𖹌' => '𖹬', - '𖹍' => '𖹭', - '𖹎' => '𖹮', - '𖹏' => '𖹯', - '𖹐' => '𖹰', - '𖹑' => '𖹱', - '𖹒' => '𖹲', - '𖹓' => '𖹳', - '𖹔' => '𖹴', - '𖹕' => '𖹵', - '𖹖' => '𖹶', - '𖹗' => '𖹷', - '𖹘' => '𖹸', - '𖹙' => '𖹹', - '𖹚' => '𖹺', - '𖹛' => '𖹻', - '𖹜' => '𖹼', - '𖹝' => '𖹽', - '𖹞' => '𖹾', - '𖹟' => '𖹿', - '𞤀' => '𞤢', - '𞤁' => '𞤣', - '𞤂' => '𞤤', - '𞤃' => '𞤥', - '𞤄' => '𞤦', - '𞤅' => '𞤧', - '𞤆' => '𞤨', - '𞤇' => '𞤩', - '𞤈' => '𞤪', - '𞤉' => '𞤫', - '𞤊' => '𞤬', - '𞤋' => '𞤭', - '𞤌' => '𞤮', - '𞤍' => '𞤯', - '𞤎' => '𞤰', - '𞤏' => '𞤱', - '𞤐' => '𞤲', - '𞤑' => '𞤳', - '𞤒' => '𞤴', - '𞤓' => '𞤵', - '𞤔' => '𞤶', - '𞤕' => '𞤷', - '𞤖' => '𞤸', - '𞤗' => '𞤹', - '𞤘' => '𞤺', - '𞤙' => '𞤻', - '𞤚' => '𞤼', - '𞤛' => '𞤽', - '𞤜' => '𞤾', - '𞤝' => '𞤿', - '𞤞' => '𞥀', - '𞤟' => '𞥁', - '𞤠' => '𞥂', - '𞤡' => '𞥃', -); diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e7..0000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ - 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů', - 'ű' => 'Ű', - 'ų' => 'Ų', - 'ŵ' => 'Ŵ', - 'ŷ' => 'Ŷ', - 'ź' => 'Ź', - 'ż' => 'Ż', - 'ž' => 'Ž', - 'ſ' => 'S', - 'ƀ' => 'Ƀ', - 'ƃ' => 'Ƃ', - 'ƅ' => 'Ƅ', - 'ƈ' => 'Ƈ', - 'ƌ' => 'Ƌ', - 'ƒ' => 'Ƒ', - 'ƕ' => 'Ƕ', - 'ƙ' => 'Ƙ', - 'ƚ' => 'Ƚ', - 'ƞ' => 'Ƞ', - 'ơ' => 'Ơ', - 'ƣ' => 'Ƣ', - 'ƥ' => 'Ƥ', - 'ƨ' => 'Ƨ', - 'ƭ' => 'Ƭ', - 'ư' => 'Ư', - 'ƴ' => 'Ƴ', - 'ƶ' => 'Ƶ', - 'ƹ' => 'Ƹ', - 'ƽ' => 'Ƽ', - 'ƿ' => 'Ƿ', - 'Dž' => 'DŽ', - 'dž' => 'DŽ', - 'Lj' => 'LJ', - 'lj' => 'LJ', - 'Nj' => 'NJ', - 'nj' => 'NJ', - 'ǎ' => 'Ǎ', - 'ǐ' => 'Ǐ', - 'ǒ' => 'Ǒ', - 'ǔ' => 'Ǔ', - 'ǖ' => 'Ǖ', - 'ǘ' => 'Ǘ', - 'ǚ' => 'Ǚ', - 'ǜ' => 'Ǜ', - 'ǝ' => 'Ǝ', - 'ǟ' => 'Ǟ', - 'ǡ' => 'Ǡ', - 'ǣ' => 'Ǣ', - 'ǥ' => 'Ǥ', - 'ǧ' => 'Ǧ', - 'ǩ' => 'Ǩ', - 'ǫ' => 'Ǫ', - 'ǭ' => 'Ǭ', - 'ǯ' => 'Ǯ', - 'Dz' => 'DZ', - 'dz' => 'DZ', - 'ǵ' => 'Ǵ', - 'ǹ' => 'Ǹ', - 'ǻ' => 'Ǻ', - 'ǽ' => 'Ǽ', - 'ǿ' => 'Ǿ', - 'ȁ' => 'Ȁ', - 'ȃ' => 'Ȃ', - 'ȅ' => 'Ȅ', - 'ȇ' => 'Ȇ', - 'ȉ' => 'Ȉ', - 'ȋ' => 'Ȋ', - 'ȍ' => 'Ȍ', - 'ȏ' => 'Ȏ', - 'ȑ' => 'Ȑ', - 'ȓ' => 'Ȓ', - 'ȕ' => 'Ȕ', - 'ȗ' => 'Ȗ', - 'ș' => 'Ș', - 'ț' => 'Ț', - 'ȝ' => 'Ȝ', - 'ȟ' => 'Ȟ', - 'ȣ' => 'Ȣ', - 'ȥ' => 'Ȥ', - 'ȧ' => 'Ȧ', - 'ȩ' => 'Ȩ', - 'ȫ' => 'Ȫ', - 'ȭ' => 'Ȭ', - 'ȯ' => 'Ȯ', - 'ȱ' => 'Ȱ', - 'ȳ' => 'Ȳ', - 'ȼ' => 'Ȼ', - 'ȿ' => 'Ȿ', - 'ɀ' => 'Ɀ', - 'ɂ' => 'Ɂ', - 'ɇ' => 'Ɇ', - 'ɉ' => 'Ɉ', - 'ɋ' => 'Ɋ', - 'ɍ' => 'Ɍ', - 'ɏ' => 'Ɏ', - 'ɐ' => 'Ɐ', - 'ɑ' => 'Ɑ', - 'ɒ' => 'Ɒ', - 'ɓ' => 'Ɓ', - 'ɔ' => 'Ɔ', - 'ɖ' => 'Ɖ', - 'ɗ' => 'Ɗ', - 'ə' => 'Ə', - 'ɛ' => 'Ɛ', - 'ɜ' => 'Ɜ', - 'ɠ' => 'Ɠ', - 'ɡ' => 'Ɡ', - 'ɣ' => 'Ɣ', - 'ɥ' => 'Ɥ', - 'ɦ' => 'Ɦ', - 'ɨ' => 'Ɨ', - 'ɩ' => 'Ɩ', - 'ɪ' => 'Ɪ', - 'ɫ' => 'Ɫ', - 'ɬ' => 'Ɬ', - 'ɯ' => 'Ɯ', - 'ɱ' => 'Ɱ', - 'ɲ' => 'Ɲ', - 'ɵ' => 'Ɵ', - 'ɽ' => 'Ɽ', - 'ʀ' => 'Ʀ', - 'ʂ' => 'Ʂ', - 'ʃ' => 'Ʃ', - 'ʇ' => 'Ʇ', - 'ʈ' => 'Ʈ', - 'ʉ' => 'Ʉ', - 'ʊ' => 'Ʊ', - 'ʋ' => 'Ʋ', - 'ʌ' => 'Ʌ', - 'ʒ' => 'Ʒ', - 'ʝ' => 'Ʝ', - 'ʞ' => 'Ʞ', - 'ͅ' => 'Ι', - 'ͱ' => 'Ͱ', - 'ͳ' => 'Ͳ', - 'ͷ' => 'Ͷ', - 'ͻ' => 'Ͻ', - 'ͼ' => 'Ͼ', - 'ͽ' => 'Ͽ', - 'ά' => 'Ά', - 'έ' => 'Έ', - 'ή' => 'Ή', - 'ί' => 'Ί', - 'α' => 'Α', - 'β' => 'Β', - 'γ' => 'Γ', - 'δ' => 'Δ', - 'ε' => 'Ε', - 'ζ' => 'Ζ', - 'η' => 'Η', - 'θ' => 'Θ', - 'ι' => 'Ι', - 'κ' => 'Κ', - 'λ' => 'Λ', - 'μ' => 'Μ', - 'ν' => 'Ν', - 'ξ' => 'Ξ', - 'ο' => 'Ο', - 'π' => 'Π', - 'ρ' => 'Ρ', - 'ς' => 'Σ', - 'σ' => 'Σ', - 'τ' => 'Τ', - 'υ' => 'Υ', - 'φ' => 'Φ', - 'χ' => 'Χ', - 'ψ' => 'Ψ', - 'ω' => 'Ω', - 'ϊ' => 'Ϊ', - 'ϋ' => 'Ϋ', - 'ό' => 'Ό', - 'ύ' => 'Ύ', - 'ώ' => 'Ώ', - 'ϐ' => 'Β', - 'ϑ' => 'Θ', - 'ϕ' => 'Φ', - 'ϖ' => 'Π', - 'ϗ' => 'Ϗ', - 'ϙ' => 'Ϙ', - 'ϛ' => 'Ϛ', - 'ϝ' => 'Ϝ', - 'ϟ' => 'Ϟ', - 'ϡ' => 'Ϡ', - 'ϣ' => 'Ϣ', - 'ϥ' => 'Ϥ', - 'ϧ' => 'Ϧ', - 'ϩ' => 'Ϩ', - 'ϫ' => 'Ϫ', - 'ϭ' => 'Ϭ', - 'ϯ' => 'Ϯ', - 'ϰ' => 'Κ', - 'ϱ' => 'Ρ', - 'ϲ' => 'Ϲ', - 'ϳ' => 'Ϳ', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => 'Ҕ', - 'җ' => 'Җ', - 'ҙ' => 'Ҙ', - 'қ' => 'Қ', - 'ҝ' => 'Ҝ', - 'ҟ' => 'Ҟ', - 'ҡ' => 'Ҡ', - 'ң' => 'Ң', - 'ҥ' => 'Ҥ', - 'ҧ' => 'Ҧ', - 'ҩ' => 'Ҩ', - 'ҫ' => 'Ҫ', - 'ҭ' => 'Ҭ', - 'ү' => 'Ү', - 'ұ' => 'Ұ', - 'ҳ' => 'Ҳ', - 'ҵ' => 'Ҵ', - 'ҷ' => 'Ҷ', - 'ҹ' => 'Ҹ', - 'һ' => 'Һ', - 'ҽ' => 'Ҽ', - 'ҿ' => 'Ҿ', - 'ӂ' => 'Ӂ', - 'ӄ' => 'Ӄ', - 'ӆ' => 'Ӆ', - 'ӈ' => 'Ӈ', - 'ӊ' => 'Ӊ', - 'ӌ' => 'Ӌ', - 'ӎ' => 'Ӎ', - 'ӏ' => 'Ӏ', - 'ӑ' => 'Ӑ', - 'ӓ' => 'Ӓ', - 'ӕ' => 'Ӕ', - 'ӗ' => 'Ӗ', - 'ә' => 'Ә', - 'ӛ' => 'Ӛ', - 'ӝ' => 'Ӝ', - 'ӟ' => 'Ӟ', - 'ӡ' => 'Ӡ', - 'ӣ' => 'Ӣ', - 'ӥ' => 'Ӥ', - 'ӧ' => 'Ӧ', - 'ө' => 'Ө', - 'ӫ' => 'Ӫ', - 'ӭ' => 'Ӭ', - 'ӯ' => 'Ӯ', - 'ӱ' => 'Ӱ', - 'ӳ' => 'Ӳ', - 'ӵ' => 'Ӵ', - 'ӷ' => 'Ӷ', - 'ӹ' => 'Ӹ', - 'ӻ' => 'Ӻ', - 'ӽ' => 'Ӽ', - 'ӿ' => 'Ӿ', - 'ԁ' => 'Ԁ', - 'ԃ' => 'Ԃ', - 'ԅ' => 'Ԅ', - 'ԇ' => 'Ԇ', - 'ԉ' => 'Ԉ', - 'ԋ' => 'Ԋ', - 'ԍ' => 'Ԍ', - 'ԏ' => 'Ԏ', - 'ԑ' => 'Ԑ', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ა' => 'Ა', - 'ბ' => 'Ბ', - 'გ' => 'Გ', - 'დ' => 'Დ', - 'ე' => 'Ე', - 'ვ' => 'Ვ', - 'ზ' => 'Ზ', - 'თ' => 'Თ', - 'ი' => 'Ი', - 'კ' => 'Კ', - 'ლ' => 'Ლ', - 'მ' => 'Მ', - 'ნ' => 'Ნ', - 'ო' => 'Ო', - 'პ' => 'Პ', - 'ჟ' => 'Ჟ', - 'რ' => 'Რ', - 'ს' => 'Ს', - 'ტ' => 'Ტ', - 'უ' => 'Უ', - 'ფ' => 'Ფ', - 'ქ' => 'Ქ', - 'ღ' => 'Ღ', - 'ყ' => 'Ყ', - 'შ' => 'Შ', - 'ჩ' => 'Ჩ', - 'ც' => 'Ც', - 'ძ' => 'Ძ', - 'წ' => 'Წ', - 'ჭ' => 'Ჭ', - 'ხ' => 'Ხ', - 'ჯ' => 'Ჯ', - 'ჰ' => 'Ჰ', - 'ჱ' => 'Ჱ', - 'ჲ' => 'Ჲ', - 'ჳ' => 'Ჳ', - 'ჴ' => 'Ჴ', - 'ჵ' => 'Ჵ', - 'ჶ' => 'Ჶ', - 'ჷ' => 'Ჷ', - 'ჸ' => 'Ჸ', - 'ჹ' => 'Ჹ', - 'ჺ' => 'Ჺ', - 'ჽ' => 'Ჽ', - 'ჾ' => 'Ჾ', - 'ჿ' => 'Ჿ', - 'ᏸ' => 'Ᏸ', - 'ᏹ' => 'Ᏹ', - 'ᏺ' => 'Ᏺ', - 'ᏻ' => 'Ᏻ', - 'ᏼ' => 'Ᏼ', - 'ᏽ' => 'Ᏽ', - 'ᲀ' => 'В', - 'ᲁ' => 'Д', - 'ᲂ' => 'О', - 'ᲃ' => 'С', - 'ᲄ' => 'Т', - 'ᲅ' => 'Т', - 'ᲆ' => 'Ъ', - 'ᲇ' => 'Ѣ', - 'ᲈ' => 'Ꙋ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ᶎ' => 'Ᶎ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ᾈ', - 'ᾁ' => 'ᾉ', - 'ᾂ' => 'ᾊ', - 'ᾃ' => 'ᾋ', - 'ᾄ' => 'ᾌ', - 'ᾅ' => 'ᾍ', - 'ᾆ' => 'ᾎ', - 'ᾇ' => 'ᾏ', - 'ᾐ' => 'ᾘ', - 'ᾑ' => 'ᾙ', - 'ᾒ' => 'ᾚ', - 'ᾓ' => 'ᾛ', - 'ᾔ' => 'ᾜ', - 'ᾕ' => 'ᾝ', - 'ᾖ' => 'ᾞ', - 'ᾗ' => 'ᾟ', - 'ᾠ' => 'ᾨ', - 'ᾡ' => 'ᾩ', - 'ᾢ' => 'ᾪ', - 'ᾣ' => 'ᾫ', - 'ᾤ' => 'ᾬ', - 'ᾥ' => 'ᾭ', - 'ᾦ' => 'ᾮ', - 'ᾧ' => 'ᾯ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ᾼ', - 'ι' => 'Ι', - 'ῃ' => 'ῌ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ῼ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞔ' => 'Ꞔ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'ꞵ' => 'Ꞵ', - 'ꞷ' => 'Ꞷ', - 'ꞹ' => 'Ꞹ', - 'ꞻ' => 'Ꞻ', - 'ꞽ' => 'Ꞽ', - 'ꞿ' => 'Ꞿ', - 'ꟃ' => 'Ꟃ', - 'ꟈ' => 'Ꟈ', - 'ꟊ' => 'Ꟊ', - 'ꟶ' => 'Ꟶ', - 'ꭓ' => 'Ꭓ', - 'ꭰ' => 'Ꭰ', - 'ꭱ' => 'Ꭱ', - 'ꭲ' => 'Ꭲ', - 'ꭳ' => 'Ꭳ', - 'ꭴ' => 'Ꭴ', - 'ꭵ' => 'Ꭵ', - 'ꭶ' => 'Ꭶ', - 'ꭷ' => 'Ꭷ', - 'ꭸ' => 'Ꭸ', - 'ꭹ' => 'Ꭹ', - 'ꭺ' => 'Ꭺ', - 'ꭻ' => 'Ꭻ', - 'ꭼ' => 'Ꭼ', - 'ꭽ' => 'Ꭽ', - 'ꭾ' => 'Ꭾ', - 'ꭿ' => 'Ꭿ', - 'ꮀ' => 'Ꮀ', - 'ꮁ' => 'Ꮁ', - 'ꮂ' => 'Ꮂ', - 'ꮃ' => 'Ꮃ', - 'ꮄ' => 'Ꮄ', - 'ꮅ' => 'Ꮅ', - 'ꮆ' => 'Ꮆ', - 'ꮇ' => 'Ꮇ', - 'ꮈ' => 'Ꮈ', - 'ꮉ' => 'Ꮉ', - 'ꮊ' => 'Ꮊ', - 'ꮋ' => 'Ꮋ', - 'ꮌ' => 'Ꮌ', - 'ꮍ' => 'Ꮍ', - 'ꮎ' => 'Ꮎ', - 'ꮏ' => 'Ꮏ', - 'ꮐ' => 'Ꮐ', - 'ꮑ' => 'Ꮑ', - 'ꮒ' => 'Ꮒ', - 'ꮓ' => 'Ꮓ', - 'ꮔ' => 'Ꮔ', - 'ꮕ' => 'Ꮕ', - 'ꮖ' => 'Ꮖ', - 'ꮗ' => 'Ꮗ', - 'ꮘ' => 'Ꮘ', - 'ꮙ' => 'Ꮙ', - 'ꮚ' => 'Ꮚ', - 'ꮛ' => 'Ꮛ', - 'ꮜ' => 'Ꮜ', - 'ꮝ' => 'Ꮝ', - 'ꮞ' => 'Ꮞ', - 'ꮟ' => 'Ꮟ', - 'ꮠ' => 'Ꮠ', - 'ꮡ' => 'Ꮡ', - 'ꮢ' => 'Ꮢ', - 'ꮣ' => 'Ꮣ', - 'ꮤ' => 'Ꮤ', - 'ꮥ' => 'Ꮥ', - 'ꮦ' => 'Ꮦ', - 'ꮧ' => 'Ꮧ', - 'ꮨ' => 'Ꮨ', - 'ꮩ' => 'Ꮩ', - 'ꮪ' => 'Ꮪ', - 'ꮫ' => 'Ꮫ', - 'ꮬ' => 'Ꮬ', - 'ꮭ' => 'Ꮭ', - 'ꮮ' => 'Ꮮ', - 'ꮯ' => 'Ꮯ', - 'ꮰ' => 'Ꮰ', - 'ꮱ' => 'Ꮱ', - 'ꮲ' => 'Ꮲ', - 'ꮳ' => 'Ꮳ', - 'ꮴ' => 'Ꮴ', - 'ꮵ' => 'Ꮵ', - 'ꮶ' => 'Ꮶ', - 'ꮷ' => 'Ꮷ', - 'ꮸ' => 'Ꮸ', - 'ꮹ' => 'Ꮹ', - 'ꮺ' => 'Ꮺ', - 'ꮻ' => 'Ꮻ', - 'ꮼ' => 'Ꮼ', - 'ꮽ' => 'Ꮽ', - 'ꮾ' => 'Ꮾ', - 'ꮿ' => 'Ꮿ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𐓘' => '𐒰', - '𐓙' => '𐒱', - '𐓚' => '𐒲', - '𐓛' => '𐒳', - '𐓜' => '𐒴', - '𐓝' => '𐒵', - '𐓞' => '𐒶', - '𐓟' => '𐒷', - '𐓠' => '𐒸', - '𐓡' => '𐒹', - '𐓢' => '𐒺', - '𐓣' => '𐒻', - '𐓤' => '𐒼', - '𐓥' => '𐒽', - '𐓦' => '𐒾', - '𐓧' => '𐒿', - '𐓨' => '𐓀', - '𐓩' => '𐓁', - '𐓪' => '𐓂', - '𐓫' => '𐓃', - '𐓬' => '𐓄', - '𐓭' => '𐓅', - '𐓮' => '𐓆', - '𐓯' => '𐓇', - '𐓰' => '𐓈', - '𐓱' => '𐓉', - '𐓲' => '𐓊', - '𐓳' => '𐓋', - '𐓴' => '𐓌', - '𐓵' => '𐓍', - '𐓶' => '𐓎', - '𐓷' => '𐓏', - '𐓸' => '𐓐', - '𐓹' => '𐓑', - '𐓺' => '𐓒', - '𐓻' => '𐓓', - '𐳀' => '𐲀', - '𐳁' => '𐲁', - '𐳂' => '𐲂', - '𐳃' => '𐲃', - '𐳄' => '𐲄', - '𐳅' => '𐲅', - '𐳆' => '𐲆', - '𐳇' => '𐲇', - '𐳈' => '𐲈', - '𐳉' => '𐲉', - '𐳊' => '𐲊', - '𐳋' => '𐲋', - '𐳌' => '𐲌', - '𐳍' => '𐲍', - '𐳎' => '𐲎', - '𐳏' => '𐲏', - '𐳐' => '𐲐', - '𐳑' => '𐲑', - '𐳒' => '𐲒', - '𐳓' => '𐲓', - '𐳔' => '𐲔', - '𐳕' => '𐲕', - '𐳖' => '𐲖', - '𐳗' => '𐲗', - '𐳘' => '𐲘', - '𐳙' => '𐲙', - '𐳚' => '𐲚', - '𐳛' => '𐲛', - '𐳜' => '𐲜', - '𐳝' => '𐲝', - '𐳞' => '𐲞', - '𐳟' => '𐲟', - '𐳠' => '𐲠', - '𐳡' => '𐲡', - '𐳢' => '𐲢', - '𐳣' => '𐲣', - '𐳤' => '𐲤', - '𐳥' => '𐲥', - '𐳦' => '𐲦', - '𐳧' => '𐲧', - '𐳨' => '𐲨', - '𐳩' => '𐲩', - '𐳪' => '𐲪', - '𐳫' => '𐲫', - '𐳬' => '𐲬', - '𐳭' => '𐲭', - '𐳮' => '𐲮', - '𐳯' => '𐲯', - '𐳰' => '𐲰', - '𐳱' => '𐲱', - '𐳲' => '𐲲', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', - '𖹠' => '𖹀', - '𖹡' => '𖹁', - '𖹢' => '𖹂', - '𖹣' => '𖹃', - '𖹤' => '𖹄', - '𖹥' => '𖹅', - '𖹦' => '𖹆', - '𖹧' => '𖹇', - '𖹨' => '𖹈', - '𖹩' => '𖹉', - '𖹪' => '𖹊', - '𖹫' => '𖹋', - '𖹬' => '𖹌', - '𖹭' => '𖹍', - '𖹮' => '𖹎', - '𖹯' => '𖹏', - '𖹰' => '𖹐', - '𖹱' => '𖹑', - '𖹲' => '𖹒', - '𖹳' => '𖹓', - '𖹴' => '𖹔', - '𖹵' => '𖹕', - '𖹶' => '𖹖', - '𖹷' => '𖹗', - '𖹸' => '𖹘', - '𖹹' => '𖹙', - '𖹺' => '𖹚', - '𖹻' => '𖹛', - '𖹼' => '𖹜', - '𖹽' => '𖹝', - '𖹾' => '𖹞', - '𖹿' => '𖹟', - '𞤢' => '𞤀', - '𞤣' => '𞤁', - '𞤤' => '𞤂', - '𞤥' => '𞤃', - '𞤦' => '𞤄', - '𞤧' => '𞤅', - '𞤨' => '𞤆', - '𞤩' => '𞤇', - '𞤪' => '𞤈', - '𞤫' => '𞤉', - '𞤬' => '𞤊', - '𞤭' => '𞤋', - '𞤮' => '𞤌', - '𞤯' => '𞤍', - '𞤰' => '𞤎', - '𞤱' => '𞤏', - '𞤲' => '𞤐', - '𞤳' => '𞤑', - '𞤴' => '𞤒', - '𞤵' => '𞤓', - '𞤶' => '𞤔', - '𞤷' => '𞤕', - '𞤸' => '𞤖', - '𞤹' => '𞤗', - '𞤺' => '𞤘', - '𞤻' => '𞤙', - '𞤼' => '𞤚', - '𞤽' => '𞤛', - '𞤾' => '𞤜', - '𞤿' => '𞤝', - '𞥀' => '𞤞', - '𞥁' => '𞤟', - '𞥂' => '𞤠', - '𞥃' => '𞤡', -); diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index c45624c..0000000 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index f404f5f..0000000 --- a/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order((string) $encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, $before_needle, (bool) $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json deleted file mode 100644 index ca82638..0000000 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-mbstring", - "type": "library", - "description": "Symfony polyfill for the Mbstring extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-php72/LICENSE b/vendor/symfony/polyfill-php72/LICENSE deleted file mode 100644 index 4cd8bdd..0000000 --- a/vendor/symfony/polyfill-php72/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php deleted file mode 100644 index 2b706d4..0000000 --- a/vendor/symfony/polyfill-php72/Php72.php +++ /dev/null @@ -1,217 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php72; - -/** - * @author Nicolas Grekas - * @author Dariusz Rumiński - * - * @internal - */ -final class Php72 -{ - private static $hashMask; - - public static function utf8_encode($s) - { - $s .= $s; - $len = \strlen($s); - - for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) { - switch (true) { - case $s[$i] < "\x80": $s[$j] = $s[$i]; break; - case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; - default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break; - } - } - - return substr($s, 0, $j); - } - - public static function utf8_decode($s) - { - $s = (string) $s; - $len = \strlen($s); - - for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) { - switch ($s[$i] & "\xF0") { - case "\xC0": - case "\xD0": - $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F"); - $s[$j] = $c < 256 ? \chr($c) : '?'; - break; - - case "\xF0": - ++$i; - // no break - - case "\xE0": - $s[$j] = '?'; - $i += 2; - break; - - default: - $s[$j] = $s[$i]; - } - } - - return substr($s, 0, $j); - } - - public static function php_os_family() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return 'Windows'; - } - - $map = [ - 'Darwin' => 'Darwin', - 'DragonFly' => 'BSD', - 'FreeBSD' => 'BSD', - 'NetBSD' => 'BSD', - 'OpenBSD' => 'BSD', - 'Linux' => 'Linux', - 'SunOS' => 'Solaris', - ]; - - return isset($map[\PHP_OS]) ? $map[\PHP_OS] : 'Unknown'; - } - - public static function spl_object_id($object) - { - if (null === self::$hashMask) { - self::initHashMask(); - } - if (null === $hash = spl_object_hash($object)) { - return; - } - - // On 32-bit systems, PHP_INT_SIZE is 4, - return self::$hashMask ^ hexdec(substr($hash, 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); - } - - public static function sapi_windows_vt100_support($stream, $enable = null) - { - if (!\is_resource($stream)) { - trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); - - return false; - } - - $meta = stream_get_meta_data($stream); - - if ('STDIO' !== $meta['stream_type']) { - trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', \E_USER_WARNING); - - return false; - } - - // We cannot actually disable vt100 support if it is set - if (false === $enable || !self::stream_isatty($stream)) { - return false; - } - - // The native function does not apply to stdin - $meta = array_map('strtolower', $meta); - $stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri']; - - return !$stdin - && (false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM')); - } - - public static function stream_isatty($stream) - { - if (!\is_resource($stream)) { - trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $stat = @fstat($stream); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - return \function_exists('posix_isatty') && @posix_isatty($stream); - } - - private static function initHashMask() - { - $obj = (object) []; - self::$hashMask = -1; - - // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below - $obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush']; - foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? \DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { - if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) { - $frame['line'] = 0; - break; - } - } - if (!empty($frame['line'])) { - ob_start(); - debug_zval_dump($obj); - self::$hashMask = (int) substr(ob_get_clean(), 17); - } - - self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if (null === $encoding) { - $s = mb_convert_encoding($s, 'UTF-8'); - } elseif ('UTF-8' !== $encoding) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } -} diff --git a/vendor/symfony/polyfill-php72/README.md b/vendor/symfony/polyfill-php72/README.md deleted file mode 100644 index 59dec8a..0000000 --- a/vendor/symfony/polyfill-php72/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Symfony Polyfill / Php72 -======================== - -This component provides functions added to PHP 7.2 core: - -- [`spl_object_id`](https://php.net/spl_object_id) -- [`stream_isatty`](https://php.net/stream_isatty) - -On Windows only: - -- [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support) - -Moved to core since 7.2 (was in the optional XML extension earlier): - -- [`utf8_encode`](https://php.net/utf8_encode) -- [`utf8_decode`](https://php.net/utf8_decode) - -Also, it provides constants added to PHP 7.2: -- [`PHP_FLOAT_*`](https://php.net/reserved.constants#constant.php-float-dig) -- [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php72/bootstrap.php b/vendor/symfony/polyfill-php72/bootstrap.php deleted file mode 100644 index b5c92d4..0000000 --- a/vendor/symfony/polyfill-php72/bootstrap.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php72 as p; - -if (\PHP_VERSION_ID >= 70200) { - return; -} - -if (!defined('PHP_FLOAT_DIG')) { - define('PHP_FLOAT_DIG', 15); -} -if (!defined('PHP_FLOAT_EPSILON')) { - define('PHP_FLOAT_EPSILON', 2.2204460492503E-16); -} -if (!defined('PHP_FLOAT_MIN')) { - define('PHP_FLOAT_MIN', 2.2250738585072E-308); -} -if (!defined('PHP_FLOAT_MAX')) { - define('PHP_FLOAT_MAX', 1.7976931348623157E+308); -} -if (!defined('PHP_OS_FAMILY')) { - define('PHP_OS_FAMILY', p\Php72::php_os_family()); -} - -if ('\\' === \DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) { - function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); } -} -if (!function_exists('stream_isatty')) { - function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } -} -if (!function_exists('utf8_encode')) { - function utf8_encode($string) { return p\Php72::utf8_encode($string); } -} -if (!function_exists('utf8_decode')) { - function utf8_decode($string) { return p\Php72::utf8_decode($string); } -} -if (!function_exists('spl_object_id')) { - function spl_object_id($object) { return p\Php72::spl_object_id($object); } -} -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} diff --git a/vendor/symfony/polyfill-php72/composer.json b/vendor/symfony/polyfill-php72/composer.json deleted file mode 100644 index 7946892..0000000 --- a/vendor/symfony/polyfill-php72/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/polyfill-php72", - "type": "library", - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, - "files": [ "bootstrap.php" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 5593b1d..0000000 --- a/vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 5fef511..0000000 --- a/vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle))); - } -} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md deleted file mode 100644 index eaa3050..0000000 --- a/vendor/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- `Stringable` interface -- [`fdiv`](https://php.net/fdiv) -- `ValueError` class -- `UnhandledMatchError` class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 7ea6d27..0000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,22 +0,0 @@ -flags = $flags; - } -} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php deleted file mode 100644 index 77e037c..0000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,11 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(string $haystack, string $needle): bool { return p\Php80::str_contains($haystack, $needle); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(string $haystack, string $needle): bool { return p\Php80::str_starts_with($haystack, $needle); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(string $haystack, string $needle): bool { return p\Php80::str_ends_with($haystack, $needle); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json deleted file mode 100644 index a9e6813..0000000 --- a/vendor/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/var-dumper/CHANGELOG.md b/vendor/symfony/var-dumper/CHANGELOG.md deleted file mode 100644 index 94b1c17..0000000 --- a/vendor/symfony/var-dumper/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -CHANGELOG -========= - -4.4.0 ------ - - * added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()` - to configure casters & flags to use in tests - * added `ImagineCaster` and infrastructure to dump images - * added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data - * added `UuidCaster` - * made all casters final - * added support for the `NO_COLOR` env var (https://no-color.org/) - -4.3.0 ------ - - * added `DsCaster` to support dumping the contents of data structures from the Ds extension - -4.2.0 ------ - - * support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli` - -4.1.0 ------ - - * added a `ServerDumper` to send serialized Data clones to a server - * added a `ServerDumpCommand` and `DumpServer` to run a server collecting - and displaying dumps on a single place with multiple formats support - * added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support - -4.0.0 ------ - - * support for passing `\ReflectionClass` instances to the `Caster::castObject()` - method has been dropped, pass class names as strings instead - * the `Data::getRawData()` method has been removed - * the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0` - argument and moves `$message = ''` argument at 4th position. - * the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0` - argument and moves `$message = ''` argument at 4th position. - -3.4.0 ------ - - * added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth - * deprecated `MongoCaster` - -2.7.0 ------ - - * deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead. diff --git a/vendor/symfony/var-dumper/Caster/AmqpCaster.php b/vendor/symfony/var-dumper/Caster/AmqpCaster.php deleted file mode 100644 index 60045ff..0000000 --- a/vendor/symfony/var-dumper/Caster/AmqpCaster.php +++ /dev/null @@ -1,212 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts Amqp related classes to array representation. - * - * @author Grégoire Pineau - * - * @final since Symfony 4.4 - */ -class AmqpCaster -{ - private const FLAGS = [ - \AMQP_DURABLE => 'AMQP_DURABLE', - \AMQP_PASSIVE => 'AMQP_PASSIVE', - \AMQP_EXCLUSIVE => 'AMQP_EXCLUSIVE', - \AMQP_AUTODELETE => 'AMQP_AUTODELETE', - \AMQP_INTERNAL => 'AMQP_INTERNAL', - \AMQP_NOLOCAL => 'AMQP_NOLOCAL', - \AMQP_AUTOACK => 'AMQP_AUTOACK', - \AMQP_IFEMPTY => 'AMQP_IFEMPTY', - \AMQP_IFUNUSED => 'AMQP_IFUNUSED', - \AMQP_MANDATORY => 'AMQP_MANDATORY', - \AMQP_IMMEDIATE => 'AMQP_IMMEDIATE', - \AMQP_MULTIPLE => 'AMQP_MULTIPLE', - \AMQP_NOWAIT => 'AMQP_NOWAIT', - \AMQP_REQUEUE => 'AMQP_REQUEUE', - ]; - - private const EXCHANGE_TYPES = [ - \AMQP_EX_TYPE_DIRECT => 'AMQP_EX_TYPE_DIRECT', - \AMQP_EX_TYPE_FANOUT => 'AMQP_EX_TYPE_FANOUT', - \AMQP_EX_TYPE_TOPIC => 'AMQP_EX_TYPE_TOPIC', - \AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS', - ]; - - public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'is_connected' => $c->isConnected(), - ]; - - // Recent version of the extension already expose private properties - if (isset($a["\x00AMQPConnection\x00login"])) { - return $a; - } - - // BC layer in the amqp lib - if (method_exists($c, 'getReadTimeout')) { - $timeout = $c->getReadTimeout(); - } else { - $timeout = $c->getTimeout(); - } - - $a += [ - $prefix.'is_connected' => $c->isConnected(), - $prefix.'login' => $c->getLogin(), - $prefix.'password' => $c->getPassword(), - $prefix.'host' => $c->getHost(), - $prefix.'vhost' => $c->getVhost(), - $prefix.'port' => $c->getPort(), - $prefix.'read_timeout' => $timeout, - ]; - - return $a; - } - - public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'is_connected' => $c->isConnected(), - $prefix.'channel_id' => $c->getChannelId(), - ]; - - // Recent version of the extension already expose private properties - if (isset($a["\x00AMQPChannel\x00connection"])) { - return $a; - } - - $a += [ - $prefix.'connection' => $c->getConnection(), - $prefix.'prefetch_size' => $c->getPrefetchSize(), - $prefix.'prefetch_count' => $c->getPrefetchCount(), - ]; - - return $a; - } - - public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'flags' => self::extractFlags($c->getFlags()), - ]; - - // Recent version of the extension already expose private properties - if (isset($a["\x00AMQPQueue\x00name"])) { - return $a; - } - - $a += [ - $prefix.'connection' => $c->getConnection(), - $prefix.'channel' => $c->getChannel(), - $prefix.'name' => $c->getName(), - $prefix.'arguments' => $c->getArguments(), - ]; - - return $a; - } - - public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'flags' => self::extractFlags($c->getFlags()), - ]; - - $type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType(); - - // Recent version of the extension already expose private properties - if (isset($a["\x00AMQPExchange\x00name"])) { - $a["\x00AMQPExchange\x00type"] = $type; - - return $a; - } - - $a += [ - $prefix.'connection' => $c->getConnection(), - $prefix.'channel' => $c->getChannel(), - $prefix.'name' => $c->getName(), - $prefix.'type' => $type, - $prefix.'arguments' => $c->getArguments(), - ]; - - return $a; - } - - public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, $isNested, $filter = 0) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $deliveryMode = new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode()); - - // Recent version of the extension already expose private properties - if (isset($a["\x00AMQPEnvelope\x00body"])) { - $a["\0AMQPEnvelope\0delivery_mode"] = $deliveryMode; - - return $a; - } - - if (!($filter & Caster::EXCLUDE_VERBOSE)) { - $a += [$prefix.'body' => $c->getBody()]; - } - - $a += [ - $prefix.'delivery_tag' => $c->getDeliveryTag(), - $prefix.'is_redelivery' => $c->isRedelivery(), - $prefix.'exchange_name' => $c->getExchangeName(), - $prefix.'routing_key' => $c->getRoutingKey(), - $prefix.'content_type' => $c->getContentType(), - $prefix.'content_encoding' => $c->getContentEncoding(), - $prefix.'headers' => $c->getHeaders(), - $prefix.'delivery_mode' => $deliveryMode, - $prefix.'priority' => $c->getPriority(), - $prefix.'correlation_id' => $c->getCorrelationId(), - $prefix.'reply_to' => $c->getReplyTo(), - $prefix.'expiration' => $c->getExpiration(), - $prefix.'message_id' => $c->getMessageId(), - $prefix.'timestamp' => $c->getTimeStamp(), - $prefix.'type' => $c->getType(), - $prefix.'user_id' => $c->getUserId(), - $prefix.'app_id' => $c->getAppId(), - ]; - - return $a; - } - - private static function extractFlags(int $flags): ConstStub - { - $flagsArray = []; - - foreach (self::FLAGS as $value => $name) { - if ($flags & $value) { - $flagsArray[] = $name; - } - } - - if (!$flagsArray) { - $flagsArray = ['AMQP_NOPARAM']; - } - - return new ConstStub(implode('|', $flagsArray), $flags); - } -} diff --git a/vendor/symfony/var-dumper/Caster/ArgsStub.php b/vendor/symfony/var-dumper/Caster/ArgsStub.php deleted file mode 100644 index f8b485b..0000000 --- a/vendor/symfony/var-dumper/Caster/ArgsStub.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Represents a list of function arguments. - * - * @author Nicolas Grekas - */ -class ArgsStub extends EnumStub -{ - private static $parameters = []; - - public function __construct(array $args, string $function, ?string $class) - { - [$variadic, $params] = self::getParameters($function, $class); - - $values = []; - foreach ($args as $k => $v) { - $values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v; - } - if (null === $params) { - parent::__construct($values, false); - - return; - } - if (\count($values) < \count($params)) { - $params = \array_slice($params, 0, \count($values)); - } elseif (\count($values) > \count($params)) { - $values[] = new EnumStub(array_splice($values, \count($params)), false); - $params[] = $variadic; - } - if (['...'] === $params) { - $this->dumpKeys = false; - $this->value = $values[0]->value; - } else { - $this->value = array_combine($params, $values); - } - } - - private static function getParameters(string $function, ?string $class): array - { - if (isset(self::$parameters[$k = $class.'::'.$function])) { - return self::$parameters[$k]; - } - - try { - $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function); - } catch (\ReflectionException $e) { - return [null, null]; - } - - $variadic = '...'; - $params = []; - foreach ($r->getParameters() as $v) { - $k = '$'.$v->name; - if ($v->isPassedByReference()) { - $k = '&'.$k; - } - if ($v->isVariadic()) { - $variadic .= $k; - } else { - $params[] = $k; - } - } - - return self::$parameters[$k] = [$variadic, $params]; - } -} diff --git a/vendor/symfony/var-dumper/Caster/Caster.php b/vendor/symfony/var-dumper/Caster/Caster.php deleted file mode 100644 index d35f323..0000000 --- a/vendor/symfony/var-dumper/Caster/Caster.php +++ /dev/null @@ -1,175 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Helper for filtering out properties in casters. - * - * @author Nicolas Grekas - * - * @final - */ -class Caster -{ - public const EXCLUDE_VERBOSE = 1; - public const EXCLUDE_VIRTUAL = 2; - public const EXCLUDE_DYNAMIC = 4; - public const EXCLUDE_PUBLIC = 8; - public const EXCLUDE_PROTECTED = 16; - public const EXCLUDE_PRIVATE = 32; - public const EXCLUDE_NULL = 64; - public const EXCLUDE_EMPTY = 128; - public const EXCLUDE_NOT_IMPORTANT = 256; - public const EXCLUDE_STRICT = 512; - - public const PREFIX_VIRTUAL = "\0~\0"; - public const PREFIX_DYNAMIC = "\0+\0"; - public const PREFIX_PROTECTED = "\0*\0"; - - /** - * Casts objects to arrays and adds the dynamic property prefix. - * - * @param object $obj The object to cast - * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not - * - * @return array The array-cast of the object, with prefixed dynamic properties - */ - public static function castObject($obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array - { - if ($hasDebugInfo) { - try { - $debugInfo = $obj->__debugInfo(); - } catch (\Exception $e) { - // ignore failing __debugInfo() - $hasDebugInfo = false; - } - } - - $a = $obj instanceof \Closure ? [] : (array) $obj; - - if ($obj instanceof \__PHP_Incomplete_Class) { - return $a; - } - - if ($a) { - static $publicProperties = []; - $debugClass = $debugClass ?? get_debug_type($obj); - - $i = 0; - $prefixedKeys = []; - foreach ($a as $k => $v) { - if (isset($k[0]) ? "\0" !== $k[0] : \PHP_VERSION_ID >= 70200) { - if (!isset($publicProperties[$class])) { - foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) { - $publicProperties[$class][$prop->name] = true; - } - } - if (!isset($publicProperties[$class][$k])) { - $prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k; - } - } elseif ($debugClass !== $class && 1 === strpos($k, $class)) { - $prefixedKeys[$i] = "\0".$debugClass.strrchr($k, "\0"); - } - ++$i; - } - if ($prefixedKeys) { - $keys = array_keys($a); - foreach ($prefixedKeys as $i => $k) { - $keys[$i] = $k; - } - $a = array_combine($keys, $a); - } - } - - if ($hasDebugInfo && \is_array($debugInfo)) { - foreach ($debugInfo as $k => $v) { - if (!isset($k[0]) || "\0" !== $k[0]) { - if (\array_key_exists(self::PREFIX_DYNAMIC.$k, $a)) { - continue; - } - $k = self::PREFIX_VIRTUAL.$k; - } - - unset($a[$k]); - $a[$k] = $v; - } - } - - return $a; - } - - /** - * Filters out the specified properties. - * - * By default, a single match in the $filter bit field filters properties out, following an "or" logic. - * When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed. - * - * @param array $a The array containing the properties to filter - * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out - * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set - * @param int &$count Set to the number of removed properties - * - * @return array The filtered array - */ - public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array - { - $count = 0; - - foreach ($a as $k => $v) { - $type = self::EXCLUDE_STRICT & $filter; - - if (null === $v) { - $type |= self::EXCLUDE_NULL & $filter; - $type |= self::EXCLUDE_EMPTY & $filter; - } elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) { - $type |= self::EXCLUDE_EMPTY & $filter; - } - if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) { - $type |= self::EXCLUDE_NOT_IMPORTANT; - } - if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) { - $type |= self::EXCLUDE_VERBOSE; - } - - if (!isset($k[1]) || "\0" !== $k[0]) { - $type |= self::EXCLUDE_PUBLIC & $filter; - } elseif ('~' === $k[1]) { - $type |= self::EXCLUDE_VIRTUAL & $filter; - } elseif ('+' === $k[1]) { - $type |= self::EXCLUDE_DYNAMIC & $filter; - } elseif ('*' === $k[1]) { - $type |= self::EXCLUDE_PROTECTED & $filter; - } else { - $type |= self::EXCLUDE_PRIVATE & $filter; - } - - if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) { - unset($a[$k]); - ++$count; - } - } - - return $a; - } - - public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, bool $isNested): array - { - if (isset($a['__PHP_Incomplete_Class_Name'])) { - $stub->class .= '('.$a['__PHP_Incomplete_Class_Name'].')'; - unset($a['__PHP_Incomplete_Class_Name']); - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/ClassStub.php b/vendor/symfony/var-dumper/Caster/ClassStub.php deleted file mode 100644 index 612a7ca..0000000 --- a/vendor/symfony/var-dumper/Caster/ClassStub.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Represents a PHP class identifier. - * - * @author Nicolas Grekas - */ -class ClassStub extends ConstStub -{ - /** - * @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name - * @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier - */ - public function __construct(string $identifier, $callable = null) - { - $this->value = $identifier; - - try { - if (null !== $callable) { - if ($callable instanceof \Closure) { - $r = new \ReflectionFunction($callable); - } elseif (\is_object($callable)) { - $r = [$callable, '__invoke']; - } elseif (\is_array($callable)) { - $r = $callable; - } elseif (false !== $i = strpos($callable, '::')) { - $r = [substr($callable, 0, $i), substr($callable, 2 + $i)]; - } else { - $r = new \ReflectionFunction($callable); - } - } elseif (0 < $i = strpos($identifier, '::') ?: strpos($identifier, '->')) { - $r = [substr($identifier, 0, $i), substr($identifier, 2 + $i)]; - } else { - $r = new \ReflectionClass($identifier); - } - - if (\is_array($r)) { - try { - $r = new \ReflectionMethod($r[0], $r[1]); - } catch (\ReflectionException $e) { - $r = new \ReflectionClass($r[0]); - } - } - - if (false !== strpos($identifier, "@anonymous\0")) { - $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $identifier); - } - - if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) { - $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE); - $s = ReflectionCaster::getSignature($s); - - if ('()' === substr($identifier, -2)) { - $this->value = substr_replace($identifier, $s, -2); - } else { - $this->value .= $s; - } - } - } catch (\ReflectionException $e) { - return; - } finally { - if (0 < $i = strrpos($this->value, '\\')) { - $this->attr['ellipsis'] = \strlen($this->value) - $i; - $this->attr['ellipsis-type'] = 'class'; - $this->attr['ellipsis-tail'] = 1; - } - } - - if ($f = $r->getFileName()) { - $this->attr['file'] = $f; - $this->attr['line'] = $r->getStartLine(); - } - } - - public static function wrapCallable($callable) - { - if (\is_object($callable) || !\is_callable($callable)) { - return $callable; - } - - if (!\is_array($callable)) { - $callable = new static($callable, $callable); - } elseif (\is_string($callable[0])) { - $callable[0] = new static($callable[0], $callable); - } else { - $callable[1] = new static($callable[1], $callable); - } - - return $callable; - } -} diff --git a/vendor/symfony/var-dumper/Caster/ConstStub.php b/vendor/symfony/var-dumper/Caster/ConstStub.php deleted file mode 100644 index 8b01797..0000000 --- a/vendor/symfony/var-dumper/Caster/ConstStub.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Represents a PHP constant and its value. - * - * @author Nicolas Grekas - */ -class ConstStub extends Stub -{ - public function __construct(string $name, $value = null) - { - $this->class = $name; - $this->value = 1 < \func_num_args() ? $value : $name; - } - - /** - * @return string - */ - public function __toString() - { - return (string) $this->value; - } -} diff --git a/vendor/symfony/var-dumper/Caster/CutArrayStub.php b/vendor/symfony/var-dumper/Caster/CutArrayStub.php deleted file mode 100644 index 0e4fb36..0000000 --- a/vendor/symfony/var-dumper/Caster/CutArrayStub.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -/** - * Represents a cut array. - * - * @author Nicolas Grekas - */ -class CutArrayStub extends CutStub -{ - public $preservedSubset; - - public function __construct(array $value, array $preservedKeys) - { - parent::__construct($value); - - $this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys)); - $this->cut -= \count($this->preservedSubset); - } -} diff --git a/vendor/symfony/var-dumper/Caster/CutStub.php b/vendor/symfony/var-dumper/Caster/CutStub.php deleted file mode 100644 index 464c6db..0000000 --- a/vendor/symfony/var-dumper/Caster/CutStub.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Represents the main properties of a PHP variable, pre-casted by a caster. - * - * @author Nicolas Grekas - */ -class CutStub extends Stub -{ - public function __construct($value) - { - $this->value = $value; - - switch (\gettype($value)) { - case 'object': - $this->type = self::TYPE_OBJECT; - $this->class = \get_class($value); - - if ($value instanceof \Closure) { - ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE); - } - - $this->cut = -1; - break; - - case 'array': - $this->type = self::TYPE_ARRAY; - $this->class = self::ARRAY_ASSOC; - $this->cut = $this->value = \count($value); - break; - - case 'resource': - case 'unknown type': - case 'resource (closed)': - $this->type = self::TYPE_RESOURCE; - $this->handle = (int) $value; - if ('Unknown' === $this->class = @get_resource_type($value)) { - $this->class = 'Closed'; - } - $this->cut = -1; - break; - - case 'string': - $this->type = self::TYPE_STRING; - $this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY; - $this->cut = self::STRING_BINARY === $this->class ? \strlen($value) : mb_strlen($value, 'UTF-8'); - $this->value = ''; - break; - } - } -} diff --git a/vendor/symfony/var-dumper/Caster/DOMCaster.php b/vendor/symfony/var-dumper/Caster/DOMCaster.php deleted file mode 100644 index 5f2b9cd..0000000 --- a/vendor/symfony/var-dumper/Caster/DOMCaster.php +++ /dev/null @@ -1,304 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts DOM related classes to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class DOMCaster -{ - private const ERROR_CODES = [ - \DOM_PHP_ERR => 'DOM_PHP_ERR', - \DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR', - \DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR', - \DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR', - \DOM_WRONG_DOCUMENT_ERR => 'DOM_WRONG_DOCUMENT_ERR', - \DOM_INVALID_CHARACTER_ERR => 'DOM_INVALID_CHARACTER_ERR', - \DOM_NO_DATA_ALLOWED_ERR => 'DOM_NO_DATA_ALLOWED_ERR', - \DOM_NO_MODIFICATION_ALLOWED_ERR => 'DOM_NO_MODIFICATION_ALLOWED_ERR', - \DOM_NOT_FOUND_ERR => 'DOM_NOT_FOUND_ERR', - \DOM_NOT_SUPPORTED_ERR => 'DOM_NOT_SUPPORTED_ERR', - \DOM_INUSE_ATTRIBUTE_ERR => 'DOM_INUSE_ATTRIBUTE_ERR', - \DOM_INVALID_STATE_ERR => 'DOM_INVALID_STATE_ERR', - \DOM_SYNTAX_ERR => 'DOM_SYNTAX_ERR', - \DOM_INVALID_MODIFICATION_ERR => 'DOM_INVALID_MODIFICATION_ERR', - \DOM_NAMESPACE_ERR => 'DOM_NAMESPACE_ERR', - \DOM_INVALID_ACCESS_ERR => 'DOM_INVALID_ACCESS_ERR', - \DOM_VALIDATION_ERR => 'DOM_VALIDATION_ERR', - ]; - - private const NODE_TYPES = [ - \XML_ELEMENT_NODE => 'XML_ELEMENT_NODE', - \XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE', - \XML_TEXT_NODE => 'XML_TEXT_NODE', - \XML_CDATA_SECTION_NODE => 'XML_CDATA_SECTION_NODE', - \XML_ENTITY_REF_NODE => 'XML_ENTITY_REF_NODE', - \XML_ENTITY_NODE => 'XML_ENTITY_NODE', - \XML_PI_NODE => 'XML_PI_NODE', - \XML_COMMENT_NODE => 'XML_COMMENT_NODE', - \XML_DOCUMENT_NODE => 'XML_DOCUMENT_NODE', - \XML_DOCUMENT_TYPE_NODE => 'XML_DOCUMENT_TYPE_NODE', - \XML_DOCUMENT_FRAG_NODE => 'XML_DOCUMENT_FRAG_NODE', - \XML_NOTATION_NODE => 'XML_NOTATION_NODE', - \XML_HTML_DOCUMENT_NODE => 'XML_HTML_DOCUMENT_NODE', - \XML_DTD_NODE => 'XML_DTD_NODE', - \XML_ELEMENT_DECL_NODE => 'XML_ELEMENT_DECL_NODE', - \XML_ATTRIBUTE_DECL_NODE => 'XML_ATTRIBUTE_DECL_NODE', - \XML_ENTITY_DECL_NODE => 'XML_ENTITY_DECL_NODE', - \XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE', - ]; - - public static function castException(\DOMException $e, array $a, Stub $stub, $isNested) - { - $k = Caster::PREFIX_PROTECTED.'code'; - if (isset($a[$k], self::ERROR_CODES[$a[$k]])) { - $a[$k] = new ConstStub(self::ERROR_CODES[$a[$k]], $a[$k]); - } - - return $a; - } - - public static function castLength($dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'length' => $dom->length, - ]; - - return $a; - } - - public static function castImplementation($dom, array $a, Stub $stub, $isNested) - { - $a += [ - Caster::PREFIX_VIRTUAL.'Core' => '1.0', - Caster::PREFIX_VIRTUAL.'XML' => '2.0', - ]; - - return $a; - } - - public static function castNode(\DOMNode $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'nodeName' => $dom->nodeName, - 'nodeValue' => new CutStub($dom->nodeValue), - 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType), - 'parentNode' => new CutStub($dom->parentNode), - 'childNodes' => $dom->childNodes, - 'firstChild' => new CutStub($dom->firstChild), - 'lastChild' => new CutStub($dom->lastChild), - 'previousSibling' => new CutStub($dom->previousSibling), - 'nextSibling' => new CutStub($dom->nextSibling), - 'attributes' => $dom->attributes, - 'ownerDocument' => new CutStub($dom->ownerDocument), - 'namespaceURI' => $dom->namespaceURI, - 'prefix' => $dom->prefix, - 'localName' => $dom->localName, - 'baseURI' => $dom->baseURI ? new LinkStub($dom->baseURI) : $dom->baseURI, - 'textContent' => new CutStub($dom->textContent), - ]; - - return $a; - } - - public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'nodeName' => $dom->nodeName, - 'nodeValue' => new CutStub($dom->nodeValue), - 'nodeType' => new ConstStub(self::NODE_TYPES[$dom->nodeType], $dom->nodeType), - 'prefix' => $dom->prefix, - 'localName' => $dom->localName, - 'namespaceURI' => $dom->namespaceURI, - 'ownerDocument' => new CutStub($dom->ownerDocument), - 'parentNode' => new CutStub($dom->parentNode), - ]; - - return $a; - } - - public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, $isNested, $filter = 0) - { - $a += [ - 'doctype' => $dom->doctype, - 'implementation' => $dom->implementation, - 'documentElement' => new CutStub($dom->documentElement), - 'actualEncoding' => $dom->actualEncoding, - 'encoding' => $dom->encoding, - 'xmlEncoding' => $dom->xmlEncoding, - 'standalone' => $dom->standalone, - 'xmlStandalone' => $dom->xmlStandalone, - 'version' => $dom->version, - 'xmlVersion' => $dom->xmlVersion, - 'strictErrorChecking' => $dom->strictErrorChecking, - 'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI, - 'config' => $dom->config, - 'formatOutput' => $dom->formatOutput, - 'validateOnParse' => $dom->validateOnParse, - 'resolveExternals' => $dom->resolveExternals, - 'preserveWhiteSpace' => $dom->preserveWhiteSpace, - 'recover' => $dom->recover, - 'substituteEntities' => $dom->substituteEntities, - ]; - - if (!($filter & Caster::EXCLUDE_VERBOSE)) { - $formatOutput = $dom->formatOutput; - $dom->formatOutput = true; - $a += [Caster::PREFIX_VIRTUAL.'xml' => $dom->saveXML()]; - $dom->formatOutput = $formatOutput; - } - - return $a; - } - - public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'data' => $dom->data, - 'length' => $dom->length, - ]; - - return $a; - } - - public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'name' => $dom->name, - 'specified' => $dom->specified, - 'value' => $dom->value, - 'ownerElement' => $dom->ownerElement, - 'schemaTypeInfo' => $dom->schemaTypeInfo, - ]; - - return $a; - } - - public static function castElement(\DOMElement $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'tagName' => $dom->tagName, - 'schemaTypeInfo' => $dom->schemaTypeInfo, - ]; - - return $a; - } - - public static function castText(\DOMText $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'wholeText' => $dom->wholeText, - ]; - - return $a; - } - - public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'typeName' => $dom->typeName, - 'typeNamespace' => $dom->typeNamespace, - ]; - - return $a; - } - - public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'severity' => $dom->severity, - 'message' => $dom->message, - 'type' => $dom->type, - 'relatedException' => $dom->relatedException, - 'related_data' => $dom->related_data, - 'location' => $dom->location, - ]; - - return $a; - } - - public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'lineNumber' => $dom->lineNumber, - 'columnNumber' => $dom->columnNumber, - 'offset' => $dom->offset, - 'relatedNode' => $dom->relatedNode, - 'uri' => $dom->uri ? new LinkStub($dom->uri, $dom->lineNumber) : $dom->uri, - ]; - - return $a; - } - - public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'name' => $dom->name, - 'entities' => $dom->entities, - 'notations' => $dom->notations, - 'publicId' => $dom->publicId, - 'systemId' => $dom->systemId, - 'internalSubset' => $dom->internalSubset, - ]; - - return $a; - } - - public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'publicId' => $dom->publicId, - 'systemId' => $dom->systemId, - ]; - - return $a; - } - - public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'publicId' => $dom->publicId, - 'systemId' => $dom->systemId, - 'notationName' => $dom->notationName, - 'actualEncoding' => $dom->actualEncoding, - 'encoding' => $dom->encoding, - 'version' => $dom->version, - ]; - - return $a; - } - - public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'target' => $dom->target, - 'data' => $dom->data, - ]; - - return $a; - } - - public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, $isNested) - { - $a += [ - 'document' => $dom->document, - ]; - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/DateCaster.php b/vendor/symfony/var-dumper/Caster/DateCaster.php deleted file mode 100644 index 6b264c7..0000000 --- a/vendor/symfony/var-dumper/Caster/DateCaster.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts DateTimeInterface related classes to array representation. - * - * @author Dany Maillard - * - * @final since Symfony 4.4 - */ -class DateCaster -{ - private const PERIOD_LIMIT = 3; - - public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter) - { - $prefix = Caster::PREFIX_VIRTUAL; - $location = $d->getTimezone()->getLocation(); - $fromNow = (new \DateTime())->diff($d); - - $title = $d->format('l, F j, Y') - ."\n".self::formatInterval($fromNow).' from now' - .($location ? ($d->format('I') ? "\nDST On" : "\nDST Off") : '') - ; - - unset( - $a[Caster::PREFIX_DYNAMIC.'date'], - $a[Caster::PREFIX_DYNAMIC.'timezone'], - $a[Caster::PREFIX_DYNAMIC.'timezone_type'] - ); - $a[$prefix.'date'] = new ConstStub(self::formatDateTime($d, $location ? ' e (P)' : ' P'), $title); - - $stub->class .= $d->format(' @U'); - - return $a; - } - - public static function castInterval(\DateInterval $interval, array $a, Stub $stub, $isNested, $filter) - { - $now = new \DateTimeImmutable(); - $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp(); - $title = number_format($numberOfSeconds, 0, '.', ' ').'s'; - - $i = [Caster::PREFIX_VIRTUAL.'interval' => new ConstStub(self::formatInterval($interval), $title)]; - - return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a; - } - - private static function formatInterval(\DateInterval $i): string - { - $format = '%R '; - - if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) { - $i = date_diff($d = new \DateTime(), date_add(clone $d, $i)); // recalculate carry over points - $format .= 0 < $i->days ? '%ad ' : ''; - } else { - $format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : ''); - } - - $format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : ''; - $format = '%R ' === $format ? '0s' : $format; - - return $i->format(rtrim($format)); - } - - public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, $isNested, $filter) - { - $location = $timeZone->getLocation(); - $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P'); - $title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : ''; - - $z = [Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)]; - - return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a; - } - - public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter) - { - $dates = []; - if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/74639 - foreach (clone $p as $i => $d) { - if (self::PERIOD_LIMIT === $i) { - $now = new \DateTimeImmutable(); - $dates[] = sprintf('%s more', ($end = $p->getEndDate()) - ? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u'))) - : $p->recurrences - $i - ); - break; - } - $dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d)); - } - } - - $period = sprintf( - 'every %s, from %s (%s) %s', - self::formatInterval($p->getDateInterval()), - self::formatDateTime($p->getStartDate()), - $p->include_start_date ? 'included' : 'excluded', - ($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end) : 'recurring '.$p->recurrences.' time/s' - ); - - $p = [Caster::PREFIX_VIRTUAL.'period' => new ConstStub($period, implode("\n", $dates))]; - - return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a; - } - - private static function formatDateTime(\DateTimeInterface $d, string $extra = ''): string - { - return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra); - } - - private static function formatSeconds(string $s, string $us): string - { - return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us)); - } -} diff --git a/vendor/symfony/var-dumper/Caster/DoctrineCaster.php b/vendor/symfony/var-dumper/Caster/DoctrineCaster.php deleted file mode 100644 index 7409508..0000000 --- a/vendor/symfony/var-dumper/Caster/DoctrineCaster.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Doctrine\Common\Proxy\Proxy as CommonProxy; -use Doctrine\ORM\PersistentCollection; -use Doctrine\ORM\Proxy\Proxy as OrmProxy; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts Doctrine related classes to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class DoctrineCaster -{ - public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, $isNested) - { - foreach (['__cloner__', '__initializer__'] as $k) { - if (\array_key_exists($k, $a)) { - unset($a[$k]); - ++$stub->cut; - } - } - - return $a; - } - - public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, $isNested) - { - foreach (['_entityPersister', '_identifier'] as $k) { - if (\array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { - unset($a[$k]); - ++$stub->cut; - } - } - - return $a; - } - - public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, $isNested) - { - foreach (['snapshot', 'association', 'typeClass'] as $k) { - if (\array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { - $a[$k] = new CutStub($a[$k]); - } - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/DsCaster.php b/vendor/symfony/var-dumper/Caster/DsCaster.php deleted file mode 100644 index 11423c9..0000000 --- a/vendor/symfony/var-dumper/Caster/DsCaster.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Ds\Collection; -use Ds\Map; -use Ds\Pair; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts Ds extension classes to array representation. - * - * @author Jáchym Toušek - * - * @final since Symfony 4.4 - */ -class DsCaster -{ - public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested): array - { - $a[Caster::PREFIX_VIRTUAL.'count'] = $c->count(); - $a[Caster::PREFIX_VIRTUAL.'capacity'] = $c->capacity(); - - if (!$c instanceof Map) { - $a += $c->toArray(); - } - - return $a; - } - - public static function castMap(Map $c, array $a, Stub $stub, bool $isNested): array - { - foreach ($c as $k => $v) { - $a[] = new DsPairStub($k, $v); - } - - return $a; - } - - public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested): array - { - foreach ($c->toArray() as $k => $v) { - $a[Caster::PREFIX_VIRTUAL.$k] = $v; - } - - return $a; - } - - public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested): array - { - if ($isNested) { - $stub->class = Pair::class; - $stub->value = null; - $stub->handle = 0; - - $a = $c->value; - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/DsPairStub.php b/vendor/symfony/var-dumper/Caster/DsPairStub.php deleted file mode 100644 index a1dcc15..0000000 --- a/vendor/symfony/var-dumper/Caster/DsPairStub.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @author Nicolas Grekas - */ -class DsPairStub extends Stub -{ - public function __construct($key, $value) - { - $this->value = [ - Caster::PREFIX_VIRTUAL.'key' => $key, - Caster::PREFIX_VIRTUAL.'value' => $value, - ]; - } -} diff --git a/vendor/symfony/var-dumper/Caster/EnumStub.php b/vendor/symfony/var-dumper/Caster/EnumStub.php deleted file mode 100644 index 7a4e98a..0000000 --- a/vendor/symfony/var-dumper/Caster/EnumStub.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Represents an enumeration of values. - * - * @author Nicolas Grekas - */ -class EnumStub extends Stub -{ - public $dumpKeys = true; - - public function __construct(array $values, bool $dumpKeys = true) - { - $this->value = $values; - $this->dumpKeys = $dumpKeys; - } -} diff --git a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php deleted file mode 100644 index 3ea1752..0000000 --- a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ /dev/null @@ -1,382 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext; -use Symfony\Component\VarDumper\Cloner\Stub; -use Symfony\Component\VarDumper\Exception\ThrowingCasterException; - -/** - * Casts common Exception classes to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class ExceptionCaster -{ - public static $srcContext = 1; - public static $traceArgs = true; - public static $errorTypes = [ - \E_DEPRECATED => 'E_DEPRECATED', - \E_USER_DEPRECATED => 'E_USER_DEPRECATED', - \E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', - \E_ERROR => 'E_ERROR', - \E_WARNING => 'E_WARNING', - \E_PARSE => 'E_PARSE', - \E_NOTICE => 'E_NOTICE', - \E_CORE_ERROR => 'E_CORE_ERROR', - \E_CORE_WARNING => 'E_CORE_WARNING', - \E_COMPILE_ERROR => 'E_COMPILE_ERROR', - \E_COMPILE_WARNING => 'E_COMPILE_WARNING', - \E_USER_ERROR => 'E_USER_ERROR', - \E_USER_WARNING => 'E_USER_WARNING', - \E_USER_NOTICE => 'E_USER_NOTICE', - \E_STRICT => 'E_STRICT', - ]; - - private static $framesCache = []; - - public static function castError(\Error $e, array $a, Stub $stub, $isNested, $filter = 0) - { - return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter); - } - - public static function castException(\Exception $e, array $a, Stub $stub, $isNested, $filter = 0) - { - return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter); - } - - public static function castErrorException(\ErrorException $e, array $a, Stub $stub, $isNested) - { - if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) { - $a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]); - } - - return $a; - } - - public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, $isNested) - { - $trace = Caster::PREFIX_VIRTUAL.'trace'; - $prefix = Caster::PREFIX_PROTECTED; - $xPrefix = "\0Exception\0"; - - if (isset($a[$xPrefix.'previous'], $a[$trace]) && $a[$xPrefix.'previous'] instanceof \Exception) { - $b = (array) $a[$xPrefix.'previous']; - $class = get_debug_type($a[$xPrefix.'previous']); - self::traceUnshift($b[$xPrefix.'trace'], $class, $b[$prefix.'file'], $b[$prefix.'line']); - $a[$trace] = new TraceStub($b[$xPrefix.'trace'], false, 0, -\count($a[$trace]->value)); - } - - unset($a[$xPrefix.'previous'], $a[$prefix.'code'], $a[$prefix.'file'], $a[$prefix.'line']); - - return $a; - } - - public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, $isNested) - { - $sPrefix = "\0".SilencedErrorContext::class."\0"; - - if (!isset($a[$s = $sPrefix.'severity'])) { - return $a; - } - - if (isset(self::$errorTypes[$a[$s]])) { - $a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]); - } - - $trace = [[ - 'file' => $a[$sPrefix.'file'], - 'line' => $a[$sPrefix.'line'], - ]]; - - if (isset($a[$sPrefix.'trace'])) { - $trace = array_merge($trace, $a[$sPrefix.'trace']); - } - - unset($a[$sPrefix.'file'], $a[$sPrefix.'line'], $a[$sPrefix.'trace']); - $a[Caster::PREFIX_VIRTUAL.'trace'] = new TraceStub($trace, self::$traceArgs); - - return $a; - } - - public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, $isNested) - { - if (!$isNested) { - return $a; - } - $stub->class = ''; - $stub->handle = 0; - $frames = $trace->value; - $prefix = Caster::PREFIX_VIRTUAL; - - $a = []; - $j = \count($frames); - if (0 > $i = $trace->sliceOffset) { - $i = max(0, $j + $i); - } - if (!isset($trace->value[$i])) { - return []; - } - $lastCall = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[0]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : ''; - $frames[] = ['function' => '']; - $collapse = false; - - for ($j += $trace->numberingOffset - $i++; isset($frames[$i]); ++$i, --$j) { - $f = $frames[$i]; - $call = isset($f['function']) ? (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'] : '???'; - - $frame = new FrameStub( - [ - 'object' => $f['object'] ?? null, - 'class' => $f['class'] ?? null, - 'type' => $f['type'] ?? null, - 'function' => $f['function'] ?? null, - ] + $frames[$i - 1], - false, - true - ); - $f = self::castFrameStub($frame, [], $frame, true); - if (isset($f[$prefix.'src'])) { - foreach ($f[$prefix.'src']->value as $label => $frame) { - if (0 === strpos($label, "\0~collapse=0")) { - if ($collapse) { - $label = substr_replace($label, '1', 11, 1); - } else { - $collapse = true; - } - } - $label = substr_replace($label, "title=Stack level $j.&", 2, 0); - } - $f = $frames[$i - 1]; - if ($trace->keepArgs && !empty($f['args']) && $frame instanceof EnumStub) { - $frame->value['arguments'] = new ArgsStub($f['args'], $f['function'] ?? null, $f['class'] ?? null); - } - } elseif ('???' !== $lastCall) { - $label = new ClassStub($lastCall); - if (isset($label->attr['ellipsis'])) { - $label->attr['ellipsis'] += 2; - $label = substr_replace($prefix, "ellipsis-type=class&ellipsis={$label->attr['ellipsis']}&ellipsis-tail=1&title=Stack level $j.", 2, 0).$label->value.'()'; - } else { - $label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$label->value.'()'; - } - } else { - $label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall; - } - $a[substr_replace($label, sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame; - - $lastCall = $call; - } - if (null !== $trace->sliceLength) { - $a = \array_slice($a, 0, $trace->sliceLength, true); - } - - return $a; - } - - public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, $isNested) - { - if (!$isNested) { - return $a; - } - $f = $frame->value; - $prefix = Caster::PREFIX_VIRTUAL; - - if (isset($f['file'], $f['line'])) { - $cacheKey = $f; - unset($cacheKey['object'], $cacheKey['args']); - $cacheKey[] = self::$srcContext; - $cacheKey = implode('-', $cacheKey); - - if (isset(self::$framesCache[$cacheKey])) { - $a[$prefix.'src'] = self::$framesCache[$cacheKey]; - } else { - if (preg_match('/\((\d+)\)(?:\([\da-f]{32}\))? : (?:eval\(\)\'d code|runtime-created function)$/', $f['file'], $match)) { - $f['file'] = substr($f['file'], 0, -\strlen($match[0])); - $f['line'] = (int) $match[1]; - } - $src = $f['line']; - $srcKey = $f['file']; - $ellipsis = new LinkStub($srcKey, 0); - $srcAttr = 'collapse='.(int) $ellipsis->inVendor; - $ellipsisTail = $ellipsis->attr['ellipsis-tail'] ?? 0; - $ellipsis = $ellipsis->attr['ellipsis'] ?? 0; - - if (file_exists($f['file']) && 0 <= self::$srcContext) { - if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) { - $template = $f['object'] ?? unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class'])); - - $ellipsis = 0; - $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); - $templateInfo = $template->getDebugInfo(); - if (isset($templateInfo[$f['line']])) { - if (!method_exists($template, 'getSourceContext') || !file_exists($templatePath = $template->getSourceContext()->getPath())) { - $templatePath = null; - } - if ($templateSrc) { - $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f); - $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']]; - } - } - } - if ($srcKey == $f['file']) { - $src = self::extractSource(file_get_contents($f['file']), $f['line'], self::$srcContext, 'php', $f['file'], $f); - $srcKey .= ':'.$f['line']; - if ($ellipsis) { - $ellipsis += 1 + \strlen($f['line']); - } - } - $srcAttr .= sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']); - } else { - $srcAttr .= '&separator=:'; - } - $srcAttr .= $ellipsis ? '&ellipsis-type=path&ellipsis='.$ellipsis.'&ellipsis-tail='.$ellipsisTail : ''; - self::$framesCache[$cacheKey] = $a[$prefix.'src'] = new EnumStub(["\0~$srcAttr\0$srcKey" => $src]); - } - } - - unset($a[$prefix.'args'], $a[$prefix.'line'], $a[$prefix.'file']); - if ($frame->inTraceStub) { - unset($a[$prefix.'class'], $a[$prefix.'type'], $a[$prefix.'function']); - } - foreach ($a as $k => $v) { - if (!$v) { - unset($a[$k]); - } - } - if ($frame->keepArgs && !empty($f['args'])) { - $a[$prefix.'arguments'] = new ArgsStub($f['args'], $f['function'], $f['class']); - } - - return $a; - } - - private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array - { - if (isset($a[$xPrefix.'trace'])) { - $trace = $a[$xPrefix.'trace']; - unset($a[$xPrefix.'trace']); // Ensures the trace is always last - } else { - $trace = []; - } - - if (!($filter & Caster::EXCLUDE_VERBOSE) && $trace) { - if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) { - self::traceUnshift($trace, $xClass, $a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']); - } - $a[Caster::PREFIX_VIRTUAL.'trace'] = new TraceStub($trace, self::$traceArgs); - } - if (empty($a[$xPrefix.'previous'])) { - unset($a[$xPrefix.'previous']); - } - unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); - - if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { - $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $a[Caster::PREFIX_PROTECTED.'message']); - } - - if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) { - $a[Caster::PREFIX_PROTECTED.'file'] = new LinkStub($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']); - } - - return $a; - } - - private static function traceUnshift(array &$trace, ?string $class, string $file, int $line): void - { - if (isset($trace[0]['file'], $trace[0]['line']) && $trace[0]['file'] === $file && $trace[0]['line'] === $line) { - return; - } - array_unshift($trace, [ - 'function' => $class ? 'new '.$class : null, - 'file' => $file, - 'line' => $line, - ]); - } - - private static function extractSource(string $srcLines, int $line, int $srcContext, string $lang, ?string $file, array $frame): EnumStub - { - $srcLines = explode("\n", $srcLines); - $src = []; - - for ($i = $line - 1 - $srcContext; $i <= $line - 1 + $srcContext; ++$i) { - $src[] = ($srcLines[$i] ?? '')."\n"; - } - - if ($frame['function'] ?? false) { - $stub = new CutStub(new \stdClass()); - $stub->class = (isset($frame['class']) ? $frame['class'].$frame['type'] : '').$frame['function']; - $stub->type = Stub::TYPE_OBJECT; - $stub->attr['cut_hash'] = true; - $stub->attr['file'] = $frame['file']; - $stub->attr['line'] = $frame['line']; - - try { - $caller = isset($frame['class']) ? new \ReflectionMethod($frame['class'], $frame['function']) : new \ReflectionFunction($frame['function']); - $stub->class .= ReflectionCaster::getSignature(ReflectionCaster::castFunctionAbstract($caller, [], $stub, true, Caster::EXCLUDE_VERBOSE)); - - if ($f = $caller->getFileName()) { - $stub->attr['file'] = $f; - $stub->attr['line'] = $caller->getStartLine(); - } - } catch (\ReflectionException $e) { - // ignore fake class/function - } - - $srcLines = ["\0~separator=\0" => $stub]; - } else { - $stub = null; - $srcLines = []; - } - - $ltrim = 0; - do { - $pad = null; - for ($i = $srcContext << 1; $i >= 0; --$i) { - if (isset($src[$i][$ltrim]) && "\r" !== ($c = $src[$i][$ltrim]) && "\n" !== $c) { - if (null === $pad) { - $pad = $c; - } - if ((' ' !== $c && "\t" !== $c) || $pad !== $c) { - break; - } - } - } - ++$ltrim; - } while (0 > $i && null !== $pad); - - --$ltrim; - - foreach ($src as $i => $c) { - if ($ltrim) { - $c = isset($c[$ltrim]) && "\r" !== $c[$ltrim] ? substr($c, $ltrim) : ltrim($c, " \t"); - } - $c = substr($c, 0, -1); - if ($i !== $srcContext) { - $c = new ConstStub('default', $c); - } else { - $c = new ConstStub($c, $stub ? 'in '.$stub->class : ''); - if (null !== $file) { - $c->attr['file'] = $file; - $c->attr['line'] = $line; - } - } - $c->attr['lang'] = $lang; - $srcLines[sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c; - } - - return new EnumStub($srcLines); - } -} diff --git a/vendor/symfony/var-dumper/Caster/FrameStub.php b/vendor/symfony/var-dumper/Caster/FrameStub.php deleted file mode 100644 index 8786755..0000000 --- a/vendor/symfony/var-dumper/Caster/FrameStub.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -/** - * Represents a single backtrace frame as returned by debug_backtrace() or Exception->getTrace(). - * - * @author Nicolas Grekas - */ -class FrameStub extends EnumStub -{ - public $keepArgs; - public $inTraceStub; - - public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false) - { - $this->value = $frame; - $this->keepArgs = $keepArgs; - $this->inTraceStub = $inTraceStub; - } -} diff --git a/vendor/symfony/var-dumper/Caster/GmpCaster.php b/vendor/symfony/var-dumper/Caster/GmpCaster.php deleted file mode 100644 index 2b20e15..0000000 --- a/vendor/symfony/var-dumper/Caster/GmpCaster.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts GMP objects to array representation. - * - * @author Hamza Amrouche - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class GmpCaster -{ - public static function castGmp(\GMP $gmp, array $a, Stub $stub, $isNested, $filter): array - { - $a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp)); - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/ImagineCaster.php b/vendor/symfony/var-dumper/Caster/ImagineCaster.php deleted file mode 100644 index d1289da..0000000 --- a/vendor/symfony/var-dumper/Caster/ImagineCaster.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Imagine\Image\ImageInterface; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @author Grégoire Pineau - */ -final class ImagineCaster -{ - public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested): array - { - $imgData = $c->get('png'); - if (\strlen($imgData) > 1 * 1000 * 1000) { - $a += [ - Caster::PREFIX_VIRTUAL.'image' => new ConstStub($c->getSize()), - ]; - } else { - $a += [ - Caster::PREFIX_VIRTUAL.'image' => new ImgStub($imgData, 'image/png', $c->getSize()), - ]; - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/ImgStub.php b/vendor/symfony/var-dumper/Caster/ImgStub.php deleted file mode 100644 index 05789fe..0000000 --- a/vendor/symfony/var-dumper/Caster/ImgStub.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -/** - * @author Grégoire Pineau - */ -class ImgStub extends ConstStub -{ - public function __construct(string $data, string $contentType, string $size) - { - $this->value = ''; - $this->attr['img-data'] = $data; - $this->attr['img-size'] = $size; - $this->attr['content-type'] = $contentType; - } -} diff --git a/vendor/symfony/var-dumper/Caster/IntlCaster.php b/vendor/symfony/var-dumper/Caster/IntlCaster.php deleted file mode 100644 index d7099cb..0000000 --- a/vendor/symfony/var-dumper/Caster/IntlCaster.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @author Nicolas Grekas - * @author Jan Schädlich - * - * @final since Symfony 4.4 - */ -class IntlCaster -{ - public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, $isNested) - { - $a += [ - Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), - Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(), - ]; - - return self::castError($c, $a); - } - - public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, $isNested, $filter = 0) - { - $a += [ - Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), - Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(), - ]; - - if ($filter & Caster::EXCLUDE_VERBOSE) { - $stub->cut += 3; - - return self::castError($c, $a); - } - - $a += [ - Caster::PREFIX_VIRTUAL.'attributes' => new EnumStub( - [ - 'PARSE_INT_ONLY' => $c->getAttribute(\NumberFormatter::PARSE_INT_ONLY), - 'GROUPING_USED' => $c->getAttribute(\NumberFormatter::GROUPING_USED), - 'DECIMAL_ALWAYS_SHOWN' => $c->getAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN), - 'MAX_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_INTEGER_DIGITS), - 'MIN_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_INTEGER_DIGITS), - 'INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::INTEGER_DIGITS), - 'MAX_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_FRACTION_DIGITS), - 'MIN_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_FRACTION_DIGITS), - 'FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::FRACTION_DIGITS), - 'MULTIPLIER' => $c->getAttribute(\NumberFormatter::MULTIPLIER), - 'GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::GROUPING_SIZE), - 'ROUNDING_MODE' => $c->getAttribute(\NumberFormatter::ROUNDING_MODE), - 'ROUNDING_INCREMENT' => $c->getAttribute(\NumberFormatter::ROUNDING_INCREMENT), - 'FORMAT_WIDTH' => $c->getAttribute(\NumberFormatter::FORMAT_WIDTH), - 'PADDING_POSITION' => $c->getAttribute(\NumberFormatter::PADDING_POSITION), - 'SECONDARY_GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::SECONDARY_GROUPING_SIZE), - 'SIGNIFICANT_DIGITS_USED' => $c->getAttribute(\NumberFormatter::SIGNIFICANT_DIGITS_USED), - 'MIN_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_SIGNIFICANT_DIGITS), - 'MAX_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_SIGNIFICANT_DIGITS), - 'LENIENT_PARSE' => $c->getAttribute(\NumberFormatter::LENIENT_PARSE), - ] - ), - Caster::PREFIX_VIRTUAL.'text_attributes' => new EnumStub( - [ - 'POSITIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_PREFIX), - 'POSITIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_SUFFIX), - 'NEGATIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_PREFIX), - 'NEGATIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_SUFFIX), - 'PADDING_CHARACTER' => $c->getTextAttribute(\NumberFormatter::PADDING_CHARACTER), - 'CURRENCY_CODE' => $c->getTextAttribute(\NumberFormatter::CURRENCY_CODE), - 'DEFAULT_RULESET' => $c->getTextAttribute(\NumberFormatter::DEFAULT_RULESET), - 'PUBLIC_RULESETS' => $c->getTextAttribute(\NumberFormatter::PUBLIC_RULESETS), - ] - ), - Caster::PREFIX_VIRTUAL.'symbols' => new EnumStub( - [ - 'DECIMAL_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL), - 'GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL), - 'PATTERN_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::PATTERN_SEPARATOR_SYMBOL), - 'PERCENT_SYMBOL' => $c->getSymbol(\NumberFormatter::PERCENT_SYMBOL), - 'ZERO_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::ZERO_DIGIT_SYMBOL), - 'DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::DIGIT_SYMBOL), - 'MINUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::MINUS_SIGN_SYMBOL), - 'PLUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::PLUS_SIGN_SYMBOL), - 'CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::CURRENCY_SYMBOL), - 'INTL_CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL), - 'MONETARY_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_SEPARATOR_SYMBOL), - 'EXPONENTIAL_SYMBOL' => $c->getSymbol(\NumberFormatter::EXPONENTIAL_SYMBOL), - 'PERMILL_SYMBOL' => $c->getSymbol(\NumberFormatter::PERMILL_SYMBOL), - 'PAD_ESCAPE_SYMBOL' => $c->getSymbol(\NumberFormatter::PAD_ESCAPE_SYMBOL), - 'INFINITY_SYMBOL' => $c->getSymbol(\NumberFormatter::INFINITY_SYMBOL), - 'NAN_SYMBOL' => $c->getSymbol(\NumberFormatter::NAN_SYMBOL), - 'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL), - 'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL), - ] - ), - ]; - - return self::castError($c, $a); - } - - public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, $isNested) - { - $a += [ - Caster::PREFIX_VIRTUAL.'display_name' => $c->getDisplayName(), - Caster::PREFIX_VIRTUAL.'id' => $c->getID(), - Caster::PREFIX_VIRTUAL.'raw_offset' => $c->getRawOffset(), - ]; - - if ($c->useDaylightTime()) { - $a += [ - Caster::PREFIX_VIRTUAL.'dst_savings' => $c->getDSTSavings(), - ]; - } - - return self::castError($c, $a); - } - - public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, $isNested, $filter = 0) - { - $a += [ - Caster::PREFIX_VIRTUAL.'type' => $c->getType(), - Caster::PREFIX_VIRTUAL.'first_day_of_week' => $c->getFirstDayOfWeek(), - Caster::PREFIX_VIRTUAL.'minimal_days_in_first_week' => $c->getMinimalDaysInFirstWeek(), - Caster::PREFIX_VIRTUAL.'repeated_wall_time_option' => $c->getRepeatedWallTimeOption(), - Caster::PREFIX_VIRTUAL.'skipped_wall_time_option' => $c->getSkippedWallTimeOption(), - Caster::PREFIX_VIRTUAL.'time' => $c->getTime(), - Caster::PREFIX_VIRTUAL.'in_daylight_time' => $c->inDaylightTime(), - Caster::PREFIX_VIRTUAL.'is_lenient' => $c->isLenient(), - Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(), - ]; - - return self::castError($c, $a); - } - - public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, $isNested, $filter = 0) - { - $a += [ - Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(), - Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(), - Caster::PREFIX_VIRTUAL.'calendar' => $c->getCalendar(), - Caster::PREFIX_VIRTUAL.'time_zone_id' => $c->getTimeZoneId(), - Caster::PREFIX_VIRTUAL.'time_type' => $c->getTimeType(), - Caster::PREFIX_VIRTUAL.'date_type' => $c->getDateType(), - Caster::PREFIX_VIRTUAL.'calendar_object' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getCalendarObject()) : $c->getCalendarObject(), - Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(), - ]; - - return self::castError($c, $a); - } - - private static function castError($c, array $a): array - { - if ($errorCode = $c->getErrorCode()) { - $a += [ - Caster::PREFIX_VIRTUAL.'error_code' => $errorCode, - Caster::PREFIX_VIRTUAL.'error_message' => $c->getErrorMessage(), - ]; - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/LinkStub.php b/vendor/symfony/var-dumper/Caster/LinkStub.php deleted file mode 100644 index 6360716..0000000 --- a/vendor/symfony/var-dumper/Caster/LinkStub.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -/** - * Represents a file or a URL. - * - * @author Nicolas Grekas - */ -class LinkStub extends ConstStub -{ - public $inVendor = false; - - private static $vendorRoots; - private static $composerRoots; - - public function __construct($label, int $line = 0, $href = null) - { - $this->value = $label; - - if (null === $href) { - $href = $label; - } - if (!\is_string($href)) { - return; - } - if (0 === strpos($href, 'file://')) { - if ($href === $label) { - $label = substr($label, 7); - } - $href = substr($href, 7); - } elseif (false !== strpos($href, '://')) { - $this->attr['href'] = $href; - - return; - } - if (!file_exists($href)) { - return; - } - if ($line) { - $this->attr['line'] = $line; - } - if ($label !== $this->attr['file'] = realpath($href) ?: $href) { - return; - } - if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) { - $this->attr['ellipsis'] = \strlen($href) - \strlen($composerRoot) + 1; - $this->attr['ellipsis-type'] = 'path'; - $this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + \strlen(implode('', \array_slice(explode(\DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0); - } elseif (3 < \count($ellipsis = explode(\DIRECTORY_SEPARATOR, $href))) { - $this->attr['ellipsis'] = 2 + \strlen(implode('', \array_slice($ellipsis, -2))); - $this->attr['ellipsis-type'] = 'path'; - $this->attr['ellipsis-tail'] = 1; - } - } - - private function getComposerRoot(string $file, bool &$inVendor) - { - if (null === self::$vendorRoots) { - self::$vendorRoots = []; - - foreach (get_declared_classes() as $class) { - if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { - $r = new \ReflectionClass($class); - $v = \dirname($r->getFileName(), 2); - if (file_exists($v.'/composer/installed.json')) { - self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR; - } - } - } - } - $inVendor = false; - - if (isset(self::$composerRoots[$dir = \dirname($file)])) { - return self::$composerRoots[$dir]; - } - - foreach (self::$vendorRoots as $root) { - if ($inVendor = 0 === strpos($file, $root)) { - return $root; - } - } - - $parent = $dir; - while (!@file_exists($parent.'/composer.json')) { - if (!@file_exists($parent)) { - // open_basedir restriction in effect - break; - } - if ($parent === \dirname($parent)) { - return self::$composerRoots[$dir] = false; - } - - $parent = \dirname($parent); - } - - return self::$composerRoots[$dir] = $parent.\DIRECTORY_SEPARATOR; - } -} diff --git a/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/vendor/symfony/var-dumper/Caster/MemcachedCaster.php deleted file mode 100644 index 942eecb..0000000 --- a/vendor/symfony/var-dumper/Caster/MemcachedCaster.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @author Jan Schädlich - * - * @final since Symfony 4.4 - */ -class MemcachedCaster -{ - private static $optionConstants; - private static $defaultOptions; - - public static function castMemcached(\Memcached $c, array $a, Stub $stub, $isNested) - { - $a += [ - Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(), - Caster::PREFIX_VIRTUAL.'options' => new EnumStub( - self::getNonDefaultOptions($c) - ), - ]; - - return $a; - } - - private static function getNonDefaultOptions(\Memcached $c): array - { - self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions(); - self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); - - $nonDefaultOptions = []; - foreach (self::$optionConstants as $constantKey => $value) { - if (self::$defaultOptions[$constantKey] !== $option = $c->getOption($value)) { - $nonDefaultOptions[$constantKey] = $option; - } - } - - return $nonDefaultOptions; - } - - private static function discoverDefaultOptions(): array - { - $defaultMemcached = new \Memcached(); - $defaultMemcached->addServer('127.0.0.1', 11211); - - $defaultOptions = []; - self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); - - foreach (self::$optionConstants as $constantKey => $value) { - $defaultOptions[$constantKey] = $defaultMemcached->getOption($value); - } - - return $defaultOptions; - } - - private static function getOptionConstants(): array - { - $reflectedMemcached = new \ReflectionClass(\Memcached::class); - - $optionConstants = []; - foreach ($reflectedMemcached->getConstants() as $constantKey => $value) { - if (0 === strpos($constantKey, 'OPT_')) { - $optionConstants[$constantKey] = $value; - } - } - - return $optionConstants; - } -} diff --git a/vendor/symfony/var-dumper/Caster/PdoCaster.php b/vendor/symfony/var-dumper/Caster/PdoCaster.php deleted file mode 100644 index 47b0a62..0000000 --- a/vendor/symfony/var-dumper/Caster/PdoCaster.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts PDO related classes to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class PdoCaster -{ - private const PDO_ATTRIBUTES = [ - 'CASE' => [ - \PDO::CASE_LOWER => 'LOWER', - \PDO::CASE_NATURAL => 'NATURAL', - \PDO::CASE_UPPER => 'UPPER', - ], - 'ERRMODE' => [ - \PDO::ERRMODE_SILENT => 'SILENT', - \PDO::ERRMODE_WARNING => 'WARNING', - \PDO::ERRMODE_EXCEPTION => 'EXCEPTION', - ], - 'TIMEOUT', - 'PREFETCH', - 'AUTOCOMMIT', - 'PERSISTENT', - 'DRIVER_NAME', - 'SERVER_INFO', - 'ORACLE_NULLS' => [ - \PDO::NULL_NATURAL => 'NATURAL', - \PDO::NULL_EMPTY_STRING => 'EMPTY_STRING', - \PDO::NULL_TO_STRING => 'TO_STRING', - ], - 'CLIENT_VERSION', - 'SERVER_VERSION', - 'STATEMENT_CLASS', - 'EMULATE_PREPARES', - 'CONNECTION_STATUS', - 'STRINGIFY_FETCHES', - 'DEFAULT_FETCH_MODE' => [ - \PDO::FETCH_ASSOC => 'ASSOC', - \PDO::FETCH_BOTH => 'BOTH', - \PDO::FETCH_LAZY => 'LAZY', - \PDO::FETCH_NUM => 'NUM', - \PDO::FETCH_OBJ => 'OBJ', - ], - ]; - - public static function castPdo(\PDO $c, array $a, Stub $stub, $isNested) - { - $attr = []; - $errmode = $c->getAttribute(\PDO::ATTR_ERRMODE); - $c->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - - foreach (self::PDO_ATTRIBUTES as $k => $v) { - if (!isset($k[0])) { - $k = $v; - $v = []; - } - - try { - $attr[$k] = 'ERRMODE' === $k ? $errmode : $c->getAttribute(\constant('PDO::ATTR_'.$k)); - if ($v && isset($v[$attr[$k]])) { - $attr[$k] = new ConstStub($v[$attr[$k]], $attr[$k]); - } - } catch (\Exception $e) { - } - } - if (isset($attr[$k = 'STATEMENT_CLASS'][1])) { - if ($attr[$k][1]) { - $attr[$k][1] = new ArgsStub($attr[$k][1], '__construct', $attr[$k][0]); - } - $attr[$k][0] = new ClassStub($attr[$k][0]); - } - - $prefix = Caster::PREFIX_VIRTUAL; - $a += [ - $prefix.'inTransaction' => method_exists($c, 'inTransaction'), - $prefix.'errorInfo' => $c->errorInfo(), - $prefix.'attributes' => new EnumStub($attr), - ]; - - if ($a[$prefix.'inTransaction']) { - $a[$prefix.'inTransaction'] = $c->inTransaction(); - } else { - unset($a[$prefix.'inTransaction']); - } - - if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) { - unset($a[$prefix.'errorInfo']); - } - - $c->setAttribute(\PDO::ATTR_ERRMODE, $errmode); - - return $a; - } - - public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - $a[$prefix.'errorInfo'] = $c->errorInfo(); - - if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) { - unset($a[$prefix.'errorInfo']); - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/PgSqlCaster.php b/vendor/symfony/var-dumper/Caster/PgSqlCaster.php deleted file mode 100644 index 3097c51..0000000 --- a/vendor/symfony/var-dumper/Caster/PgSqlCaster.php +++ /dev/null @@ -1,156 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts pqsql resources to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class PgSqlCaster -{ - private const PARAM_CODES = [ - 'server_encoding', - 'client_encoding', - 'is_superuser', - 'session_authorization', - 'DateStyle', - 'TimeZone', - 'IntervalStyle', - 'integer_datetimes', - 'application_name', - 'standard_conforming_strings', - ]; - - private const TRANSACTION_STATUS = [ - \PGSQL_TRANSACTION_IDLE => 'PGSQL_TRANSACTION_IDLE', - \PGSQL_TRANSACTION_ACTIVE => 'PGSQL_TRANSACTION_ACTIVE', - \PGSQL_TRANSACTION_INTRANS => 'PGSQL_TRANSACTION_INTRANS', - \PGSQL_TRANSACTION_INERROR => 'PGSQL_TRANSACTION_INERROR', - \PGSQL_TRANSACTION_UNKNOWN => 'PGSQL_TRANSACTION_UNKNOWN', - ]; - - private const RESULT_STATUS = [ - \PGSQL_EMPTY_QUERY => 'PGSQL_EMPTY_QUERY', - \PGSQL_COMMAND_OK => 'PGSQL_COMMAND_OK', - \PGSQL_TUPLES_OK => 'PGSQL_TUPLES_OK', - \PGSQL_COPY_OUT => 'PGSQL_COPY_OUT', - \PGSQL_COPY_IN => 'PGSQL_COPY_IN', - \PGSQL_BAD_RESPONSE => 'PGSQL_BAD_RESPONSE', - \PGSQL_NONFATAL_ERROR => 'PGSQL_NONFATAL_ERROR', - \PGSQL_FATAL_ERROR => 'PGSQL_FATAL_ERROR', - ]; - - private const DIAG_CODES = [ - 'severity' => \PGSQL_DIAG_SEVERITY, - 'sqlstate' => \PGSQL_DIAG_SQLSTATE, - 'message' => \PGSQL_DIAG_MESSAGE_PRIMARY, - 'detail' => \PGSQL_DIAG_MESSAGE_DETAIL, - 'hint' => \PGSQL_DIAG_MESSAGE_HINT, - 'statement position' => \PGSQL_DIAG_STATEMENT_POSITION, - 'internal position' => \PGSQL_DIAG_INTERNAL_POSITION, - 'internal query' => \PGSQL_DIAG_INTERNAL_QUERY, - 'context' => \PGSQL_DIAG_CONTEXT, - 'file' => \PGSQL_DIAG_SOURCE_FILE, - 'line' => \PGSQL_DIAG_SOURCE_LINE, - 'function' => \PGSQL_DIAG_SOURCE_FUNCTION, - ]; - - public static function castLargeObject($lo, array $a, Stub $stub, $isNested) - { - $a['seek position'] = pg_lo_tell($lo); - - return $a; - } - - public static function castLink($link, array $a, Stub $stub, $isNested) - { - $a['status'] = pg_connection_status($link); - $a['status'] = new ConstStub(\PGSQL_CONNECTION_OK === $a['status'] ? 'PGSQL_CONNECTION_OK' : 'PGSQL_CONNECTION_BAD', $a['status']); - $a['busy'] = pg_connection_busy($link); - - $a['transaction'] = pg_transaction_status($link); - if (isset(self::TRANSACTION_STATUS[$a['transaction']])) { - $a['transaction'] = new ConstStub(self::TRANSACTION_STATUS[$a['transaction']], $a['transaction']); - } - - $a['pid'] = pg_get_pid($link); - $a['last error'] = pg_last_error($link); - $a['last notice'] = pg_last_notice($link); - $a['host'] = pg_host($link); - $a['port'] = pg_port($link); - $a['dbname'] = pg_dbname($link); - $a['options'] = pg_options($link); - $a['version'] = pg_version($link); - - foreach (self::PARAM_CODES as $v) { - if (false !== $s = pg_parameter_status($link, $v)) { - $a['param'][$v] = $s; - } - } - - $a['param']['client_encoding'] = pg_client_encoding($link); - $a['param'] = new EnumStub($a['param']); - - return $a; - } - - public static function castResult($result, array $a, Stub $stub, $isNested) - { - $a['num rows'] = pg_num_rows($result); - $a['status'] = pg_result_status($result); - if (isset(self::RESULT_STATUS[$a['status']])) { - $a['status'] = new ConstStub(self::RESULT_STATUS[$a['status']], $a['status']); - } - $a['command-completion tag'] = pg_result_status($result, \PGSQL_STATUS_STRING); - - if (-1 === $a['num rows']) { - foreach (self::DIAG_CODES as $k => $v) { - $a['error'][$k] = pg_result_error_field($result, $v); - } - } - - $a['affected rows'] = pg_affected_rows($result); - $a['last OID'] = pg_last_oid($result); - - $fields = pg_num_fields($result); - - for ($i = 0; $i < $fields; ++$i) { - $field = [ - 'name' => pg_field_name($result, $i), - 'table' => sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)), - 'type' => sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)), - 'nullable' => (bool) pg_field_is_null($result, $i), - 'storage' => pg_field_size($result, $i).' bytes', - 'display' => pg_field_prtlen($result, $i).' chars', - ]; - if (' (OID: )' === $field['table']) { - $field['table'] = null; - } - if ('-1 bytes' === $field['storage']) { - $field['storage'] = 'variable size'; - } elseif ('1 bytes' === $field['storage']) { - $field['storage'] = '1 byte'; - } - if ('1 chars' === $field['display']) { - $field['display'] = '1 char'; - } - $a['fields'][] = new EnumStub($field); - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php b/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php deleted file mode 100644 index ec02f81..0000000 --- a/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use ProxyManager\Proxy\ProxyInterface; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class ProxyManagerCaster -{ - public static function castProxy(ProxyInterface $c, array $a, Stub $stub, $isNested) - { - if ($parent = get_parent_class($c)) { - $stub->class .= ' - '.$parent; - } - $stub->class .= '@proxy'; - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/RedisCaster.php b/vendor/symfony/var-dumper/Caster/RedisCaster.php deleted file mode 100644 index bd877cb..0000000 --- a/vendor/symfony/var-dumper/Caster/RedisCaster.php +++ /dev/null @@ -1,152 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts Redis class from ext-redis to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class RedisCaster -{ - private const SERIALIZERS = [ - \Redis::SERIALIZER_NONE => 'NONE', - \Redis::SERIALIZER_PHP => 'PHP', - 2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY - ]; - - private const MODES = [ - \Redis::ATOMIC => 'ATOMIC', - \Redis::MULTI => 'MULTI', - \Redis::PIPELINE => 'PIPELINE', - ]; - - private const COMPRESSION_MODES = [ - 0 => 'NONE', // Redis::COMPRESSION_NONE - 1 => 'LZF', // Redis::COMPRESSION_LZF - ]; - - private const FAILOVER_OPTIONS = [ - \RedisCluster::FAILOVER_NONE => 'NONE', - \RedisCluster::FAILOVER_ERROR => 'ERROR', - \RedisCluster::FAILOVER_DISTRIBUTE => 'DISTRIBUTE', - \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES', - ]; - - public static function castRedis(\Redis $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - if (!$connected = $c->isConnected()) { - return $a + [ - $prefix.'isConnected' => $connected, - ]; - } - - $mode = $c->getMode(); - - return $a + [ - $prefix.'isConnected' => $connected, - $prefix.'host' => $c->getHost(), - $prefix.'port' => $c->getPort(), - $prefix.'auth' => $c->getAuth(), - $prefix.'mode' => isset(self::MODES[$mode]) ? new ConstStub(self::MODES[$mode], $mode) : $mode, - $prefix.'dbNum' => $c->getDbNum(), - $prefix.'timeout' => $c->getTimeout(), - $prefix.'lastError' => $c->getLastError(), - $prefix.'persistentId' => $c->getPersistentID(), - $prefix.'options' => self::getRedisOptions($c), - ]; - } - - public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - return $a + [ - $prefix.'hosts' => $c->_hosts(), - $prefix.'function' => ClassStub::wrapCallable($c->_function()), - $prefix.'lastError' => $c->getLastError(), - $prefix.'options' => self::getRedisOptions($c), - ]; - } - - public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - $failover = $c->getOption(\RedisCluster::OPT_SLAVE_FAILOVER); - - $a += [ - $prefix.'_masters' => $c->_masters(), - $prefix.'_redir' => $c->_redir(), - $prefix.'mode' => new ConstStub($c->getMode() ? 'MULTI' : 'ATOMIC', $c->getMode()), - $prefix.'lastError' => $c->getLastError(), - $prefix.'options' => self::getRedisOptions($c, [ - 'SLAVE_FAILOVER' => isset(self::FAILOVER_OPTIONS[$failover]) ? new ConstStub(self::FAILOVER_OPTIONS[$failover], $failover) : $failover, - ]), - ]; - - return $a; - } - - /** - * @param \Redis|\RedisArray|\RedisCluster $redis - */ - private static function getRedisOptions($redis, array $options = []): EnumStub - { - $serializer = $redis->getOption(\Redis::OPT_SERIALIZER); - if (\is_array($serializer)) { - foreach ($serializer as &$v) { - if (isset(self::SERIALIZERS[$v])) { - $v = new ConstStub(self::SERIALIZERS[$v], $v); - } - } - } elseif (isset(self::SERIALIZERS[$serializer])) { - $serializer = new ConstStub(self::SERIALIZERS[$serializer], $serializer); - } - - $compression = \defined('Redis::OPT_COMPRESSION') ? $redis->getOption(\Redis::OPT_COMPRESSION) : 0; - if (\is_array($compression)) { - foreach ($compression as &$v) { - if (isset(self::COMPRESSION_MODES[$v])) { - $v = new ConstStub(self::COMPRESSION_MODES[$v], $v); - } - } - } elseif (isset(self::COMPRESSION_MODES[$compression])) { - $compression = new ConstStub(self::COMPRESSION_MODES[$compression], $compression); - } - - $retry = \defined('Redis::OPT_SCAN') ? $redis->getOption(\Redis::OPT_SCAN) : 0; - if (\is_array($retry)) { - foreach ($retry as &$v) { - $v = new ConstStub($v ? 'RETRY' : 'NORETRY', $v); - } - } else { - $retry = new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry); - } - - $options += [ - 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0, - 'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT), - 'COMPRESSION' => $compression, - 'SERIALIZER' => $serializer, - 'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX), - 'SCAN' => $retry, - ]; - - return new EnumStub($options); - } -} diff --git a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php deleted file mode 100644 index 8d5f428..0000000 --- a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ /dev/null @@ -1,392 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts Reflector related classes to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class ReflectionCaster -{ - public const UNSET_CLOSURE_FILE_INFO = ['Closure' => __CLASS__.'::unsetClosureFileInfo']; - - private const EXTRA_MAP = [ - 'docComment' => 'getDocComment', - 'extension' => 'getExtensionName', - 'isDisabled' => 'isDisabled', - 'isDeprecated' => 'isDeprecated', - 'isInternal' => 'isInternal', - 'isUserDefined' => 'isUserDefined', - 'isGenerator' => 'isGenerator', - 'isVariadic' => 'isVariadic', - ]; - - public static function castClosure(\Closure $c, array $a, Stub $stub, $isNested, $filter = 0) - { - $prefix = Caster::PREFIX_VIRTUAL; - $c = new \ReflectionFunction($c); - - $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter); - - if (false === strpos($c->name, '{closure}')) { - $stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name; - unset($a[$prefix.'class']); - } - unset($a[$prefix.'extra']); - - $stub->class .= self::getSignature($a); - - if ($f = $c->getFileName()) { - $stub->attr['file'] = $f; - $stub->attr['line'] = $c->getStartLine(); - } - - unset($a[$prefix.'parameters']); - - if ($filter & Caster::EXCLUDE_VERBOSE) { - $stub->cut += ($c->getFileName() ? 2 : 0) + \count($a); - - return []; - } - - if ($f) { - $a[$prefix.'file'] = new LinkStub($f, $c->getStartLine()); - $a[$prefix.'line'] = $c->getStartLine().' to '.$c->getEndLine(); - } - - return $a; - } - - public static function unsetClosureFileInfo(\Closure $c, array $a) - { - unset($a[Caster::PREFIX_VIRTUAL.'file'], $a[Caster::PREFIX_VIRTUAL.'line']); - - return $a; - } - - public static function castGenerator(\Generator $c, array $a, Stub $stub, $isNested) - { - // Cannot create ReflectionGenerator based on a terminated Generator - try { - $reflectionGenerator = new \ReflectionGenerator($c); - } catch (\Exception $e) { - $a[Caster::PREFIX_VIRTUAL.'closed'] = true; - - return $a; - } - - return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested); - } - - public static function castType(\ReflectionType $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - $a += [ - $prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c, - $prefix.'allowsNull' => $c->allowsNull(), - $prefix.'isBuiltin' => $c->isBuiltin(), - ]; - - return $a; - } - - public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - if ($c->getThis()) { - $a[$prefix.'this'] = new CutStub($c->getThis()); - } - $function = $c->getFunction(); - $frame = [ - 'class' => $function->class ?? null, - 'type' => isset($function->class) ? ($function->isStatic() ? '::' : '->') : null, - 'function' => $function->name, - 'file' => $c->getExecutingFile(), - 'line' => $c->getExecutingLine(), - ]; - if ($trace = $c->getTrace(\DEBUG_BACKTRACE_IGNORE_ARGS)) { - $function = new \ReflectionGenerator($c->getExecutingGenerator()); - array_unshift($trace, [ - 'function' => 'yield', - 'file' => $function->getExecutingFile(), - 'line' => $function->getExecutingLine() - 1, - ]); - $trace[] = $frame; - $a[$prefix.'trace'] = new TraceStub($trace, false, 0, -1, -1); - } else { - $function = new FrameStub($frame, false, true); - $function = ExceptionCaster::castFrameStub($function, [], $function, true); - $a[$prefix.'executing'] = $function[$prefix.'src']; - } - - $a[Caster::PREFIX_VIRTUAL.'closed'] = false; - - return $a; - } - - public static function castClass(\ReflectionClass $c, array $a, Stub $stub, $isNested, $filter = 0) - { - $prefix = Caster::PREFIX_VIRTUAL; - - if ($n = \Reflection::getModifierNames($c->getModifiers())) { - $a[$prefix.'modifiers'] = implode(' ', $n); - } - - self::addMap($a, $c, [ - 'extends' => 'getParentClass', - 'implements' => 'getInterfaceNames', - 'constants' => 'getConstants', - ]); - - foreach ($c->getProperties() as $n) { - $a[$prefix.'properties'][$n->name] = $n; - } - - foreach ($c->getMethods() as $n) { - $a[$prefix.'methods'][$n->name] = $n; - } - - if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) { - self::addExtra($a, $c); - } - - return $a; - } - - public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, $isNested, $filter = 0) - { - $prefix = Caster::PREFIX_VIRTUAL; - - self::addMap($a, $c, [ - 'returnsReference' => 'returnsReference', - 'returnType' => 'getReturnType', - 'class' => 'getClosureScopeClass', - 'this' => 'getClosureThis', - ]); - - if (isset($a[$prefix.'returnType'])) { - $v = $a[$prefix.'returnType']; - $v = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v; - $a[$prefix.'returnType'] = new ClassStub($a[$prefix.'returnType'] instanceof \ReflectionNamedType && $a[$prefix.'returnType']->allowsNull() && 'mixed' !== $v ? '?'.$v : $v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']); - } - if (isset($a[$prefix.'class'])) { - $a[$prefix.'class'] = new ClassStub($a[$prefix.'class']); - } - if (isset($a[$prefix.'this'])) { - $a[$prefix.'this'] = new CutStub($a[$prefix.'this']); - } - - foreach ($c->getParameters() as $v) { - $k = '$'.$v->name; - if ($v->isVariadic()) { - $k = '...'.$k; - } - if ($v->isPassedByReference()) { - $k = '&'.$k; - } - $a[$prefix.'parameters'][$k] = $v; - } - if (isset($a[$prefix.'parameters'])) { - $a[$prefix.'parameters'] = new EnumStub($a[$prefix.'parameters']); - } - - if (!($filter & Caster::EXCLUDE_VERBOSE) && $v = $c->getStaticVariables()) { - foreach ($v as $k => &$v) { - if (\is_object($v)) { - $a[$prefix.'use']['$'.$k] = new CutStub($v); - } else { - $a[$prefix.'use']['$'.$k] = &$v; - } - } - unset($v); - $a[$prefix.'use'] = new EnumStub($a[$prefix.'use']); - } - - if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) { - self::addExtra($a, $c); - } - - return $a; - } - - public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); - - return $a; - } - - public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - - self::addMap($a, $c, [ - 'position' => 'getPosition', - 'isVariadic' => 'isVariadic', - 'byReference' => 'isPassedByReference', - 'allowsNull' => 'allowsNull', - ]); - - if ($v = $c->getType()) { - $a[$prefix.'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : (string) $v; - } - - if (isset($a[$prefix.'typeHint'])) { - $v = $a[$prefix.'typeHint']; - $a[$prefix.'typeHint'] = new ClassStub($v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']); - } else { - unset($a[$prefix.'allowsNull']); - } - - try { - $a[$prefix.'default'] = $v = $c->getDefaultValue(); - if ($c->isDefaultValueConstant()) { - $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v); - } - if (null === $v) { - unset($a[$prefix.'allowsNull']); - } - } catch (\ReflectionException $e) { - } - - return $a; - } - - public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); - self::addExtra($a, $c); - - return $a; - } - - public static function castReference(\ReflectionReference $c, array $a, Stub $stub, $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId(); - - return $a; - } - - public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, $isNested) - { - self::addMap($a, $c, [ - 'version' => 'getVersion', - 'dependencies' => 'getDependencies', - 'iniEntries' => 'getIniEntries', - 'isPersistent' => 'isPersistent', - 'isTemporary' => 'isTemporary', - 'constants' => 'getConstants', - 'functions' => 'getFunctions', - 'classes' => 'getClasses', - ]); - - return $a; - } - - public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, $isNested) - { - self::addMap($a, $c, [ - 'version' => 'getVersion', - 'author' => 'getAuthor', - 'copyright' => 'getCopyright', - 'url' => 'getURL', - ]); - - return $a; - } - - public static function getSignature(array $a) - { - $prefix = Caster::PREFIX_VIRTUAL; - $signature = ''; - - if (isset($a[$prefix.'parameters'])) { - foreach ($a[$prefix.'parameters']->value as $k => $param) { - $signature .= ', '; - if ($type = $param->getType()) { - if (!$type instanceof \ReflectionNamedType) { - $signature .= $type.' '; - } else { - if (!$param->isOptional() && $param->allowsNull() && 'mixed' !== $type->getName()) { - $signature .= '?'; - } - $signature .= substr(strrchr('\\'.$type->getName(), '\\'), 1).' '; - } - } - $signature .= $k; - - if (!$param->isDefaultValueAvailable()) { - continue; - } - $v = $param->getDefaultValue(); - $signature .= ' = '; - - if ($param->isDefaultValueConstant()) { - $signature .= substr(strrchr('\\'.$param->getDefaultValueConstantName(), '\\'), 1); - } elseif (null === $v) { - $signature .= 'null'; - } elseif (\is_array($v)) { - $signature .= $v ? '[…'.\count($v).']' : '[]'; - } elseif (\is_string($v)) { - $signature .= 10 > \strlen($v) && false === strpos($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; - } elseif (\is_bool($v)) { - $signature .= $v ? 'true' : 'false'; - } else { - $signature .= $v; - } - } - } - $signature = (empty($a[$prefix.'returnsReference']) ? '' : '&').'('.substr($signature, 2).')'; - - if (isset($a[$prefix.'returnType'])) { - $signature .= ': '.substr(strrchr('\\'.$a[$prefix.'returnType'], '\\'), 1); - } - - return $signature; - } - - private static function addExtra(array &$a, \Reflector $c) - { - $x = isset($a[Caster::PREFIX_VIRTUAL.'extra']) ? $a[Caster::PREFIX_VIRTUAL.'extra']->value : []; - - if (method_exists($c, 'getFileName') && $m = $c->getFileName()) { - $x['file'] = new LinkStub($m, $c->getStartLine()); - $x['line'] = $c->getStartLine().' to '.$c->getEndLine(); - } - - self::addMap($x, $c, self::EXTRA_MAP, ''); - - if ($x) { - $a[Caster::PREFIX_VIRTUAL.'extra'] = new EnumStub($x); - } - } - - private static function addMap(array &$a, \Reflector $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL) - { - foreach ($map as $k => $m) { - if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) { - continue; - } - - if (method_exists($c, $m) && false !== ($m = $c->$m()) && null !== $m) { - $a[$prefix.$k] = $m instanceof \Reflector ? $m->name : $m; - } - } - } -} diff --git a/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/vendor/symfony/var-dumper/Caster/ResourceCaster.php deleted file mode 100644 index 5a7c428..0000000 --- a/vendor/symfony/var-dumper/Caster/ResourceCaster.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts common resource types to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class ResourceCaster -{ - /** - * @param \CurlHandle|resource $h - * - * @return array - */ - public static function castCurl($h, array $a, Stub $stub, $isNested) - { - return curl_getinfo($h); - } - - public static function castDba($dba, array $a, Stub $stub, $isNested) - { - $list = dba_list(); - $a['file'] = $list[(int) $dba]; - - return $a; - } - - public static function castProcess($process, array $a, Stub $stub, $isNested) - { - return proc_get_status($process); - } - - public static function castStream($stream, array $a, Stub $stub, $isNested) - { - $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); - if (isset($a['uri'])) { - $a['uri'] = new LinkStub($a['uri']); - } - - return $a; - } - - public static function castStreamContext($stream, array $a, Stub $stub, $isNested) - { - return @stream_context_get_params($stream) ?: $a; - } - - public static function castGd($gd, array $a, Stub $stub, $isNested) - { - $a['size'] = imagesx($gd).'x'.imagesy($gd); - $a['trueColor'] = imageistruecolor($gd); - - return $a; - } - - public static function castMysqlLink($h, array $a, Stub $stub, $isNested) - { - $a['host'] = mysql_get_host_info($h); - $a['protocol'] = mysql_get_proto_info($h); - $a['server'] = mysql_get_server_info($h); - - return $a; - } - - public static function castOpensslX509($h, array $a, Stub $stub, $isNested) - { - $stub->cut = -1; - $info = openssl_x509_parse($h, false); - - $pin = openssl_pkey_get_public($h); - $pin = openssl_pkey_get_details($pin)['key']; - $pin = \array_slice(explode("\n", $pin), 1, -2); - $pin = base64_decode(implode('', $pin)); - $pin = base64_encode(hash('sha256', $pin, true)); - - $a += [ - 'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])), - 'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])), - 'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']), - 'fingerprint' => new EnumStub([ - 'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)), - 'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)), - 'sha256' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha256')), 2, ':', true)), - 'pin-sha256' => new ConstStub($pin), - ]), - ]; - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/SplCaster.php b/vendor/symfony/var-dumper/Caster/SplCaster.php deleted file mode 100644 index 5abc51a..0000000 --- a/vendor/symfony/var-dumper/Caster/SplCaster.php +++ /dev/null @@ -1,245 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts SPL related classes to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class SplCaster -{ - private const SPL_FILE_OBJECT_FLAGS = [ - \SplFileObject::DROP_NEW_LINE => 'DROP_NEW_LINE', - \SplFileObject::READ_AHEAD => 'READ_AHEAD', - \SplFileObject::SKIP_EMPTY => 'SKIP_EMPTY', - \SplFileObject::READ_CSV => 'READ_CSV', - ]; - - public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, $isNested) - { - return self::castSplArray($c, $a, $stub, $isNested); - } - - public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, $isNested) - { - return self::castSplArray($c, $a, $stub, $isNested); - } - - public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested) - { - $a += [ - Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c), - ]; - - return $a; - } - - public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, $isNested) - { - $prefix = Caster::PREFIX_VIRTUAL; - $mode = $c->getIteratorMode(); - $c->setIteratorMode(\SplDoublyLinkedList::IT_MODE_KEEP | $mode & ~\SplDoublyLinkedList::IT_MODE_DELETE); - - $a += [ - $prefix.'mode' => new ConstStub((($mode & \SplDoublyLinkedList::IT_MODE_LIFO) ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO').' | '.(($mode & \SplDoublyLinkedList::IT_MODE_DELETE) ? 'IT_MODE_DELETE' : 'IT_MODE_KEEP'), $mode), - $prefix.'dllist' => iterator_to_array($c), - ]; - $c->setIteratorMode($mode); - - return $a; - } - - public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, $isNested) - { - static $map = [ - 'path' => 'getPath', - 'filename' => 'getFilename', - 'basename' => 'getBasename', - 'pathname' => 'getPathname', - 'extension' => 'getExtension', - 'realPath' => 'getRealPath', - 'aTime' => 'getATime', - 'mTime' => 'getMTime', - 'cTime' => 'getCTime', - 'inode' => 'getInode', - 'size' => 'getSize', - 'perms' => 'getPerms', - 'owner' => 'getOwner', - 'group' => 'getGroup', - 'type' => 'getType', - 'writable' => 'isWritable', - 'readable' => 'isReadable', - 'executable' => 'isExecutable', - 'file' => 'isFile', - 'dir' => 'isDir', - 'link' => 'isLink', - 'linkTarget' => 'getLinkTarget', - ]; - - $prefix = Caster::PREFIX_VIRTUAL; - unset($a["\0SplFileInfo\0fileName"]); - unset($a["\0SplFileInfo\0pathName"]); - - if (\PHP_VERSION_ID < 80000) { - if (false === $c->getPathname()) { - $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; - - return $a; - } - } else { - try { - $c->isReadable(); - } catch (\RuntimeException $e) { - if ('Object not initialized' !== $e->getMessage()) { - throw $e; - } - - $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; - - return $a; - } catch (\Error $e) { - if ('Object not initialized' !== $e->getMessage()) { - throw $e; - } - - $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; - - return $a; - } - } - - foreach ($map as $key => $accessor) { - try { - $a[$prefix.$key] = $c->$accessor(); - } catch (\Exception $e) { - } - } - - if (isset($a[$prefix.'realPath'])) { - $a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']); - } - - if (isset($a[$prefix.'perms'])) { - $a[$prefix.'perms'] = new ConstStub(sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']); - } - - static $mapDate = ['aTime', 'mTime', 'cTime']; - foreach ($mapDate as $key) { - if (isset($a[$prefix.$key])) { - $a[$prefix.$key] = new ConstStub(date('Y-m-d H:i:s', $a[$prefix.$key]), $a[$prefix.$key]); - } - } - - return $a; - } - - public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, $isNested) - { - static $map = [ - 'csvControl' => 'getCsvControl', - 'flags' => 'getFlags', - 'maxLineLen' => 'getMaxLineLen', - 'fstat' => 'fstat', - 'eof' => 'eof', - 'key' => 'key', - ]; - - $prefix = Caster::PREFIX_VIRTUAL; - - foreach ($map as $key => $accessor) { - try { - $a[$prefix.$key] = $c->$accessor(); - } catch (\Exception $e) { - } - } - - if (isset($a[$prefix.'flags'])) { - $flagsArray = []; - foreach (self::SPL_FILE_OBJECT_FLAGS as $value => $name) { - if ($a[$prefix.'flags'] & $value) { - $flagsArray[] = $name; - } - } - $a[$prefix.'flags'] = new ConstStub(implode('|', $flagsArray), $a[$prefix.'flags']); - } - - if (isset($a[$prefix.'fstat'])) { - $a[$prefix.'fstat'] = new CutArrayStub($a[$prefix.'fstat'], ['dev', 'ino', 'nlink', 'rdev', 'blksize', 'blocks']); - } - - return $a; - } - - public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, $isNested) - { - $storage = []; - unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967 - unset($a["\0SplObjectStorage\0storage"]); - - $clone = clone $c; - foreach ($clone as $obj) { - $storage[] = [ - 'object' => $obj, - 'info' => $clone->getInfo(), - ]; - } - - $a += [ - Caster::PREFIX_VIRTUAL.'storage' => $storage, - ]; - - return $a; - } - - public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator(); - - return $a; - } - - public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, $isNested) - { - $a[Caster::PREFIX_VIRTUAL.'object'] = $c->get(); - - return $a; - } - - private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array - { - $prefix = Caster::PREFIX_VIRTUAL; - $flags = $c->getFlags(); - - if (!($flags & \ArrayObject::STD_PROP_LIST)) { - $c->setFlags(\ArrayObject::STD_PROP_LIST); - $a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class); - $c->setFlags($flags); - } - if (\PHP_VERSION_ID < 70400) { - $a[$prefix.'storage'] = $c->getArrayCopy(); - } - $a += [ - $prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST), - $prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS), - ]; - if ($c instanceof \ArrayObject) { - $a[$prefix.'iteratorClass'] = new ClassStub($c->getIteratorClass()); - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/StubCaster.php b/vendor/symfony/var-dumper/Caster/StubCaster.php deleted file mode 100644 index b6332fb..0000000 --- a/vendor/symfony/var-dumper/Caster/StubCaster.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts a caster's Stub. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class StubCaster -{ - public static function castStub(Stub $c, array $a, Stub $stub, $isNested) - { - if ($isNested) { - $stub->type = $c->type; - $stub->class = $c->class; - $stub->value = $c->value; - $stub->handle = $c->handle; - $stub->cut = $c->cut; - $stub->attr = $c->attr; - - if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) { - $stub->type = Stub::TYPE_STRING; - $stub->class = Stub::STRING_BINARY; - } - - $a = []; - } - - return $a; - } - - public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, $isNested) - { - return $isNested ? $c->preservedSubset : $a; - } - - public static function cutInternals($obj, array $a, Stub $stub, $isNested) - { - if ($isNested) { - $stub->cut += \count($a); - - return []; - } - - return $a; - } - - public static function castEnum(EnumStub $c, array $a, Stub $stub, $isNested) - { - if ($isNested) { - $stub->class = $c->dumpKeys ? '' : null; - $stub->handle = 0; - $stub->value = null; - $stub->cut = $c->cut; - $stub->attr = $c->attr; - - $a = []; - - if ($c->value) { - foreach (array_keys($c->value) as $k) { - $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k; - } - // Preserve references with array_combine() - $a = array_combine($keys, $c->value); - } - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/SymfonyCaster.php b/vendor/symfony/var-dumper/Caster/SymfonyCaster.php deleted file mode 100644 index 06f213e..0000000 --- a/vendor/symfony/var-dumper/Caster/SymfonyCaster.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @final since Symfony 4.4 - */ -class SymfonyCaster -{ - private const REQUEST_GETTERS = [ - 'pathInfo' => 'getPathInfo', - 'requestUri' => 'getRequestUri', - 'baseUrl' => 'getBaseUrl', - 'basePath' => 'getBasePath', - 'method' => 'getMethod', - 'format' => 'getRequestFormat', - ]; - - public static function castRequest(Request $request, array $a, Stub $stub, $isNested) - { - $clone = null; - - foreach (self::REQUEST_GETTERS as $prop => $getter) { - $key = Caster::PREFIX_PROTECTED.$prop; - if (\array_key_exists($key, $a) && null === $a[$key]) { - if (null === $clone) { - $clone = clone $request; - } - $a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}(); - } - } - - return $a; - } - - public static function castHttpClient($client, array $a, Stub $stub, $isNested) - { - $multiKey = sprintf("\0%s\0multi", \get_class($client)); - if (isset($a[$multiKey])) { - $a[$multiKey] = new CutStub($a[$multiKey]); - } - - return $a; - } - - public static function castHttpClientResponse($response, array $a, Stub $stub, $isNested) - { - $stub->cut += \count($a); - $a = []; - - foreach ($response->getInfo() as $k => $v) { - $a[Caster::PREFIX_VIRTUAL.$k] = $v; - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/TraceStub.php b/vendor/symfony/var-dumper/Caster/TraceStub.php deleted file mode 100644 index 5eea1c8..0000000 --- a/vendor/symfony/var-dumper/Caster/TraceStub.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Represents a backtrace as returned by debug_backtrace() or Exception->getTrace(). - * - * @author Nicolas Grekas - */ -class TraceStub extends Stub -{ - public $keepArgs; - public $sliceOffset; - public $sliceLength; - public $numberingOffset; - - public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) - { - $this->value = $trace; - $this->keepArgs = $keepArgs; - $this->sliceOffset = $sliceOffset; - $this->sliceLength = $sliceLength; - $this->numberingOffset = $numberingOffset; - } -} diff --git a/vendor/symfony/var-dumper/Caster/UuidCaster.php b/vendor/symfony/var-dumper/Caster/UuidCaster.php deleted file mode 100644 index b102774..0000000 --- a/vendor/symfony/var-dumper/Caster/UuidCaster.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Ramsey\Uuid\UuidInterface; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @author Grégoire Pineau - */ -final class UuidCaster -{ - public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested): array - { - $a += [ - Caster::PREFIX_VIRTUAL.'uuid' => (string) $c, - ]; - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php deleted file mode 100644 index 19bf6a3..0000000 --- a/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts XmlReader class to array representation. - * - * @author Baptiste Clavié - * - * @final since Symfony 4.4 - */ -class XmlReaderCaster -{ - private const NODE_TYPES = [ - \XMLReader::NONE => 'NONE', - \XMLReader::ELEMENT => 'ELEMENT', - \XMLReader::ATTRIBUTE => 'ATTRIBUTE', - \XMLReader::TEXT => 'TEXT', - \XMLReader::CDATA => 'CDATA', - \XMLReader::ENTITY_REF => 'ENTITY_REF', - \XMLReader::ENTITY => 'ENTITY', - \XMLReader::PI => 'PI (Processing Instruction)', - \XMLReader::COMMENT => 'COMMENT', - \XMLReader::DOC => 'DOC', - \XMLReader::DOC_TYPE => 'DOC_TYPE', - \XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT', - \XMLReader::NOTATION => 'NOTATION', - \XMLReader::WHITESPACE => 'WHITESPACE', - \XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE', - \XMLReader::END_ELEMENT => 'END_ELEMENT', - \XMLReader::END_ENTITY => 'END_ENTITY', - \XMLReader::XML_DECLARATION => 'XML_DECLARATION', - ]; - - public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, $isNested) - { - $props = Caster::PREFIX_VIRTUAL.'parserProperties'; - $info = [ - 'localName' => $reader->localName, - 'prefix' => $reader->prefix, - 'nodeType' => new ConstStub(self::NODE_TYPES[$reader->nodeType], $reader->nodeType), - 'depth' => $reader->depth, - 'isDefault' => $reader->isDefault, - 'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement, - 'xmlLang' => $reader->xmlLang, - 'attributeCount' => $reader->attributeCount, - 'value' => $reader->value, - 'namespaceURI' => $reader->namespaceURI, - 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, - $props => [ - 'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD), - 'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS), - 'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE), - 'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES), - ], - ]; - - if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) { - $info[$props] = new EnumStub($info[$props]); - $info[$props]->cut = $count; - } - - $info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count); - // +2 because hasValue and hasAttributes are always filtered - $stub->cut += $count + 2; - - return $a + $info; - } -} diff --git a/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php b/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php deleted file mode 100644 index 455fc06..0000000 --- a/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Caster; - -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * Casts XML resources to array representation. - * - * @author Nicolas Grekas - * - * @final since Symfony 4.4 - */ -class XmlResourceCaster -{ - private const XML_ERRORS = [ - \XML_ERROR_NONE => 'XML_ERROR_NONE', - \XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY', - \XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX', - \XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS', - \XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN', - \XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN', - \XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR', - \XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH', - \XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE', - \XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT', - \XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF', - \XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY', - \XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF', - \XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY', - \XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF', - \XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF', - \XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', - \XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI', - \XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING', - \XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING', - \XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION', - \XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING', - ]; - - public static function castXml($h, array $a, Stub $stub, $isNested) - { - $a['current_byte_index'] = xml_get_current_byte_index($h); - $a['current_column_number'] = xml_get_current_column_number($h); - $a['current_line_number'] = xml_get_current_line_number($h); - $a['error_code'] = xml_get_error_code($h); - - if (isset(self::XML_ERRORS[$a['error_code']])) { - $a['error_code'] = new ConstStub(self::XML_ERRORS[$a['error_code']], $a['error_code']); - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php deleted file mode 100644 index 1782379..0000000 --- a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ /dev/null @@ -1,375 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Cloner; - -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Exception\ThrowingCasterException; - -/** - * AbstractCloner implements a generic caster mechanism for objects and resources. - * - * @author Nicolas Grekas - */ -abstract class AbstractCloner implements ClonerInterface -{ - public static $defaultCasters = [ - '__PHP_Incomplete_Class' => ['Symfony\Component\VarDumper\Caster\Caster', 'castPhpIncompleteClass'], - - 'Symfony\Component\VarDumper\Caster\CutStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'], - 'Symfony\Component\VarDumper\Caster\CutArrayStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castCutArray'], - 'Symfony\Component\VarDumper\Caster\ConstStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'], - 'Symfony\Component\VarDumper\Caster\EnumStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castEnum'], - - 'Closure' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClosure'], - 'Generator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castGenerator'], - 'ReflectionType' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castType'], - 'ReflectionGenerator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReflectionGenerator'], - 'ReflectionClass' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClass'], - 'ReflectionFunctionAbstract' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castFunctionAbstract'], - 'ReflectionMethod' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castMethod'], - 'ReflectionParameter' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castParameter'], - 'ReflectionProperty' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castProperty'], - 'ReflectionReference' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReference'], - 'ReflectionExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castExtension'], - 'ReflectionZendExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castZendExtension'], - - 'Doctrine\Common\Persistence\ObjectManager' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Doctrine\Common\Proxy\Proxy' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castCommonProxy'], - 'Doctrine\ORM\Proxy\Proxy' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castOrmProxy'], - 'Doctrine\ORM\PersistentCollection' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castPersistentCollection'], - 'Doctrine\Persistence\ObjectManager' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - - 'DOMException' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castException'], - 'DOMStringList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'], - 'DOMNameList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'], - 'DOMImplementation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castImplementation'], - 'DOMImplementationList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'], - 'DOMNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNode'], - 'DOMNameSpaceNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNameSpaceNode'], - 'DOMDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocument'], - 'DOMNodeList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'], - 'DOMNamedNodeMap' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'], - 'DOMCharacterData' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castCharacterData'], - 'DOMAttr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'], - 'DOMElement' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'], - 'DOMText' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'], - 'DOMTypeinfo' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castTypeinfo'], - 'DOMDomError' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDomError'], - 'DOMLocator' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLocator'], - 'DOMDocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'], - 'DOMNotation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'], - 'DOMEntity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'], - 'DOMProcessingInstruction' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castProcessingInstruction'], - 'DOMXPath' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castXPath'], - - 'XMLReader' => ['Symfony\Component\VarDumper\Caster\XmlReaderCaster', 'castXmlReader'], - - 'ErrorException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castErrorException'], - 'Exception' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castException'], - 'Error' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castError'], - 'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Symfony\Component\EventDispatcher\EventDispatcherInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], - 'Symfony\Component\HttpClient\NativeHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], - 'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], - 'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], - 'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'], - 'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'], - 'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'], - 'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'], - 'Symfony\Component\VarDumper\Cloner\AbstractCloner' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Symfony\Component\ErrorHandler\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'], - - 'Imagine\Image\ImageInterface' => ['Symfony\Component\VarDumper\Caster\ImagineCaster', 'castImage'], - - 'Ramsey\Uuid\UuidInterface' => ['Symfony\Component\VarDumper\Caster\UuidCaster', 'castRamseyUuid'], - - 'ProxyManager\Proxy\ProxyInterface' => ['Symfony\Component\VarDumper\Caster\ProxyManagerCaster', 'castProxy'], - 'PHPUnit_Framework_MockObject_MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'PHPUnit\Framework\MockObject\MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'PHPUnit\Framework\MockObject\Stub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Prophecy\Prophecy\ProphecySubjectInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - 'Mockery\MockInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], - - 'PDO' => ['Symfony\Component\VarDumper\Caster\PdoCaster', 'castPdo'], - 'PDOStatement' => ['Symfony\Component\VarDumper\Caster\PdoCaster', 'castPdoStatement'], - - 'AMQPConnection' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castConnection'], - 'AMQPChannel' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castChannel'], - 'AMQPQueue' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castQueue'], - 'AMQPExchange' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castExchange'], - 'AMQPEnvelope' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castEnvelope'], - - 'ArrayObject' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayObject'], - 'ArrayIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayIterator'], - 'SplDoublyLinkedList' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castDoublyLinkedList'], - 'SplFileInfo' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileInfo'], - 'SplFileObject' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileObject'], - 'SplHeap' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'], - 'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'], - 'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'], - 'OuterIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'], - 'WeakReference' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakReference'], - - 'Redis' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'], - 'RedisArray' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'], - 'RedisCluster' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisCluster'], - - 'DateTimeInterface' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castDateTime'], - 'DateInterval' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castInterval'], - 'DateTimeZone' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castTimeZone'], - 'DatePeriod' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castPeriod'], - - 'GMP' => ['Symfony\Component\VarDumper\Caster\GmpCaster', 'castGmp'], - - 'MessageFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castMessageFormatter'], - 'NumberFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castNumberFormatter'], - 'IntlTimeZone' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlTimeZone'], - 'IntlCalendar' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlCalendar'], - 'IntlDateFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlDateFormatter'], - - 'Memcached' => ['Symfony\Component\VarDumper\Caster\MemcachedCaster', 'castMemcached'], - - 'Ds\Collection' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castCollection'], - 'Ds\Map' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castMap'], - 'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'], - 'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'], - - 'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], - ':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], - - ':dba' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'], - ':dba persistent' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'], - - 'GdImage' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'], - ':gd' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'], - - ':mysql link' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castMysqlLink'], - ':pgsql large object' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLargeObject'], - ':pgsql link' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'], - ':pgsql link persistent' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'], - ':pgsql result' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castResult'], - ':process' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castProcess'], - ':stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'], - - 'OpenSSLCertificate' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castOpensslX509'], - ':OpenSSL X.509' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castOpensslX509'], - - ':persistent stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'], - ':stream-context' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStreamContext'], - - 'XmlParser' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'], - ':xml' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'], - ]; - - protected $maxItems = 2500; - protected $maxString = -1; - protected $minDepth = 1; - - private $casters = []; - private $prevErrorHandler; - private $classInfo = []; - private $filter = 0; - - /** - * @param callable[]|null $casters A map of casters - * - * @see addCasters - */ - public function __construct(array $casters = null) - { - if (null === $casters) { - $casters = static::$defaultCasters; - } - $this->addCasters($casters); - } - - /** - * Adds casters for resources and objects. - * - * Maps resources or objects types to a callback. - * Types are in the key, with a callable caster for value. - * Resource types are to be prefixed with a `:`, - * see e.g. static::$defaultCasters. - * - * @param callable[] $casters A map of casters - */ - public function addCasters(array $casters) - { - foreach ($casters as $type => $callback) { - $this->casters[$type][] = $callback; - } - } - - /** - * Sets the maximum number of items to clone past the minimum depth in nested structures. - * - * @param int $maxItems - */ - public function setMaxItems($maxItems) - { - $this->maxItems = (int) $maxItems; - } - - /** - * Sets the maximum cloned length for strings. - * - * @param int $maxString - */ - public function setMaxString($maxString) - { - $this->maxString = (int) $maxString; - } - - /** - * Sets the minimum tree depth where we are guaranteed to clone all the items. After this - * depth is reached, only setMaxItems items will be cloned. - * - * @param int $minDepth - */ - public function setMinDepth($minDepth) - { - $this->minDepth = (int) $minDepth; - } - - /** - * Clones a PHP variable. - * - * @param mixed $var Any PHP variable - * @param int $filter A bit field of Caster::EXCLUDE_* constants - * - * @return Data The cloned variable represented by a Data object - */ - public function cloneVar($var, $filter = 0) - { - $this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) { - if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) { - // Cloner never dies - throw new \ErrorException($msg, 0, $type, $file, $line); - } - - if ($this->prevErrorHandler) { - return ($this->prevErrorHandler)($type, $msg, $file, $line, $context); - } - - return false; - }); - $this->filter = $filter; - - if ($gc = gc_enabled()) { - gc_disable(); - } - try { - return new Data($this->doClone($var)); - } finally { - if ($gc) { - gc_enable(); - } - restore_error_handler(); - $this->prevErrorHandler = null; - } - } - - /** - * Effectively clones the PHP variable. - * - * @param mixed $var Any PHP variable - * - * @return array The cloned variable represented in an array - */ - abstract protected function doClone($var); - - /** - * Casts an object to an array representation. - * - * @param bool $isNested True if the object is nested in the dumped structure - * - * @return array The object casted as array - */ - protected function castObject(Stub $stub, $isNested) - { - $obj = $stub->value; - $class = $stub->class; - - if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : false !== strpos($class, "@anonymous\0")) { - $stub->class = get_debug_type($obj); - } - if (isset($this->classInfo[$class])) { - [$i, $parents, $hasDebugInfo, $fileInfo] = $this->classInfo[$class]; - } else { - $i = 2; - $parents = [$class]; - $hasDebugInfo = method_exists($class, '__debugInfo'); - - foreach (class_parents($class) as $p) { - $parents[] = $p; - ++$i; - } - foreach (class_implements($class) as $p) { - $parents[] = $p; - ++$i; - } - $parents[] = '*'; - - $r = new \ReflectionClass($class); - $fileInfo = $r->isInternal() || $r->isSubclassOf(Stub::class) ? [] : [ - 'file' => $r->getFileName(), - 'line' => $r->getStartLine(), - ]; - - $this->classInfo[$class] = [$i, $parents, $hasDebugInfo, $fileInfo]; - } - - $stub->attr += $fileInfo; - $a = Caster::castObject($obj, $class, $hasDebugInfo, $stub->class); - - try { - while ($i--) { - if (!empty($this->casters[$p = $parents[$i]])) { - foreach ($this->casters[$p] as $callback) { - $a = $callback($obj, $a, $stub, $isNested, $this->filter); - } - } - } - } catch (\Exception $e) { - $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)] + $a; - } - - return $a; - } - - /** - * Casts a resource to an array representation. - * - * @param bool $isNested True if the object is nested in the dumped structure - * - * @return array The resource casted as array - */ - protected function castResource(Stub $stub, $isNested) - { - $a = []; - $res = $stub->value; - $type = $stub->class; - - try { - if (!empty($this->casters[':'.$type])) { - foreach ($this->casters[':'.$type] as $callback) { - $a = $callback($res, $a, $stub, $isNested, $this->filter); - } - } - } catch (\Exception $e) { - $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)] + $a; - } - - return $a; - } -} diff --git a/vendor/symfony/var-dumper/Cloner/ClonerInterface.php b/vendor/symfony/var-dumper/Cloner/ClonerInterface.php deleted file mode 100644 index 7ed287a..0000000 --- a/vendor/symfony/var-dumper/Cloner/ClonerInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Cloner; - -/** - * @author Nicolas Grekas - */ -interface ClonerInterface -{ - /** - * Clones a PHP variable. - * - * @param mixed $var Any PHP variable - * - * @return Data The cloned variable represented by a Data object - */ - public function cloneVar($var); -} diff --git a/vendor/symfony/var-dumper/Cloner/Cursor.php b/vendor/symfony/var-dumper/Cloner/Cursor.php deleted file mode 100644 index 1fd796d..0000000 --- a/vendor/symfony/var-dumper/Cloner/Cursor.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Cloner; - -/** - * Represents the current state of a dumper while dumping. - * - * @author Nicolas Grekas - */ -class Cursor -{ - public const HASH_INDEXED = Stub::ARRAY_INDEXED; - public const HASH_ASSOC = Stub::ARRAY_ASSOC; - public const HASH_OBJECT = Stub::TYPE_OBJECT; - public const HASH_RESOURCE = Stub::TYPE_RESOURCE; - - public $depth = 0; - public $refIndex = 0; - public $softRefTo = 0; - public $softRefCount = 0; - public $softRefHandle = 0; - public $hardRefTo = 0; - public $hardRefCount = 0; - public $hardRefHandle = 0; - public $hashType; - public $hashKey; - public $hashKeyIsBinary; - public $hashIndex = 0; - public $hashLength = 0; - public $hashCut = 0; - public $stop = false; - public $attr = []; - public $skipChildren = false; -} diff --git a/vendor/symfony/var-dumper/Cloner/Data.php b/vendor/symfony/var-dumper/Cloner/Data.php deleted file mode 100644 index 21adb23..0000000 --- a/vendor/symfony/var-dumper/Cloner/Data.php +++ /dev/null @@ -1,455 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Cloner; - -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; - -/** - * @author Nicolas Grekas - */ -class Data implements \ArrayAccess, \Countable, \IteratorAggregate -{ - private $data; - private $position = 0; - private $key = 0; - private $maxDepth = 20; - private $maxItemsPerDepth = -1; - private $useRefHandles = -1; - private $context = []; - - /** - * @param array $data An array as returned by ClonerInterface::cloneVar() - */ - public function __construct(array $data) - { - $this->data = $data; - } - - /** - * @return string|null The type of the value - */ - public function getType() - { - $item = $this->data[$this->position][$this->key]; - - if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) { - $item = $item->value; - } - if (!$item instanceof Stub) { - return \gettype($item); - } - if (Stub::TYPE_STRING === $item->type) { - return 'string'; - } - if (Stub::TYPE_ARRAY === $item->type) { - return 'array'; - } - if (Stub::TYPE_OBJECT === $item->type) { - return $item->class; - } - if (Stub::TYPE_RESOURCE === $item->type) { - return $item->class.' resource'; - } - - return null; - } - - /** - * @param array|bool $recursive Whether values should be resolved recursively or not - * - * @return string|int|float|bool|array|Data[]|null A native representation of the original value - */ - public function getValue($recursive = false) - { - $item = $this->data[$this->position][$this->key]; - - if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) { - $item = $item->value; - } - if (!($item = $this->getStub($item)) instanceof Stub) { - return $item; - } - if (Stub::TYPE_STRING === $item->type) { - return $item->value; - } - - $children = $item->position ? $this->data[$item->position] : []; - - foreach ($children as $k => $v) { - if ($recursive && !($v = $this->getStub($v)) instanceof Stub) { - continue; - } - $children[$k] = clone $this; - $children[$k]->key = $k; - $children[$k]->position = $item->position; - - if ($recursive) { - if (Stub::TYPE_REF === $v->type && ($v = $this->getStub($v->value)) instanceof Stub) { - $recursive = (array) $recursive; - if (isset($recursive[$v->position])) { - continue; - } - $recursive[$v->position] = true; - } - $children[$k] = $children[$k]->getValue($recursive); - } - } - - return $children; - } - - /** - * @return int - */ - public function count() - { - return \count($this->getValue()); - } - - /** - * @return \Traversable - */ - public function getIterator() - { - if (!\is_array($value = $this->getValue())) { - throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, \gettype($value))); - } - - yield from $value; - } - - public function __get($key) - { - if (null !== $data = $this->seek($key)) { - $item = $this->getStub($data->data[$data->position][$data->key]); - - return $item instanceof Stub || [] === $item ? $data : $item; - } - - return null; - } - - /** - * @return bool - */ - public function __isset($key) - { - return null !== $this->seek($key); - } - - /** - * @return bool - */ - public function offsetExists($key) - { - return $this->__isset($key); - } - - public function offsetGet($key) - { - return $this->__get($key); - } - - public function offsetSet($key, $value) - { - throw new \BadMethodCallException(self::class.' objects are immutable.'); - } - - public function offsetUnset($key) - { - throw new \BadMethodCallException(self::class.' objects are immutable.'); - } - - /** - * @return string - */ - public function __toString() - { - $value = $this->getValue(); - - if (!\is_array($value)) { - return (string) $value; - } - - return sprintf('%s (count=%d)', $this->getType(), \count($value)); - } - - /** - * Returns a depth limited clone of $this. - * - * @param int $maxDepth The max dumped depth level - * - * @return static - */ - public function withMaxDepth($maxDepth) - { - $data = clone $this; - $data->maxDepth = (int) $maxDepth; - - return $data; - } - - /** - * Limits the number of elements per depth level. - * - * @param int $maxItemsPerDepth The max number of items dumped per depth level - * - * @return static - */ - public function withMaxItemsPerDepth($maxItemsPerDepth) - { - $data = clone $this; - $data->maxItemsPerDepth = (int) $maxItemsPerDepth; - - return $data; - } - - /** - * Enables/disables objects' identifiers tracking. - * - * @param bool $useRefHandles False to hide global ref. handles - * - * @return static - */ - public function withRefHandles($useRefHandles) - { - $data = clone $this; - $data->useRefHandles = $useRefHandles ? -1 : 0; - - return $data; - } - - /** - * @return static - */ - public function withContext(array $context) - { - $data = clone $this; - $data->context = $context; - - return $data; - } - - /** - * Seeks to a specific key in nested data structures. - * - * @param string|int $key The key to seek to - * - * @return static|null Null if the key is not set - */ - public function seek($key) - { - $item = $this->data[$this->position][$this->key]; - - if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) { - $item = $item->value; - } - if (!($item = $this->getStub($item)) instanceof Stub || !$item->position) { - return null; - } - $keys = [$key]; - - switch ($item->type) { - case Stub::TYPE_OBJECT: - $keys[] = Caster::PREFIX_DYNAMIC.$key; - $keys[] = Caster::PREFIX_PROTECTED.$key; - $keys[] = Caster::PREFIX_VIRTUAL.$key; - $keys[] = "\0$item->class\0$key"; - // no break - case Stub::TYPE_ARRAY: - case Stub::TYPE_RESOURCE: - break; - default: - return null; - } - - $data = null; - $children = $this->data[$item->position]; - - foreach ($keys as $key) { - if (isset($children[$key]) || \array_key_exists($key, $children)) { - $data = clone $this; - $data->key = $key; - $data->position = $item->position; - break; - } - } - - return $data; - } - - /** - * Dumps data with a DumperInterface dumper. - */ - public function dump(DumperInterface $dumper) - { - $refs = [0]; - $cursor = new Cursor(); - - if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) { - $cursor->attr['if_links'] = true; - $cursor->hashType = -1; - $dumper->dumpScalar($cursor, 'default', '^'); - $cursor->attr = ['if_links' => true]; - $dumper->dumpScalar($cursor, 'default', ' '); - $cursor->hashType = 0; - } - - $this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]); - } - - /** - * Depth-first dumping of items. - * - * @param mixed $item A Stub object or the original value being dumped - */ - private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, $item) - { - $cursor->refIndex = 0; - $cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0; - $cursor->hardRefTo = $cursor->hardRefHandle = $cursor->hardRefCount = 0; - $firstSeen = true; - - if (!$item instanceof Stub) { - $cursor->attr = []; - $type = \gettype($item); - if ($item && 'array' === $type) { - $item = $this->getStub($item); - } - } elseif (Stub::TYPE_REF === $item->type) { - if ($item->handle) { - if (!isset($refs[$r = $item->handle - (\PHP_INT_MAX >> 1)])) { - $cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0]; - } else { - $firstSeen = false; - } - $cursor->hardRefTo = $refs[$r]; - $cursor->hardRefHandle = $this->useRefHandles & $item->handle; - $cursor->hardRefCount = 0 < $item->handle ? $item->refCount : 0; - } - $cursor->attr = $item->attr; - $type = $item->class ?: \gettype($item->value); - $item = $this->getStub($item->value); - } - if ($item instanceof Stub) { - if ($item->refCount) { - if (!isset($refs[$r = $item->handle])) { - $cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0]; - } else { - $firstSeen = false; - } - $cursor->softRefTo = $refs[$r]; - } - $cursor->softRefHandle = $this->useRefHandles & $item->handle; - $cursor->softRefCount = $item->refCount; - $cursor->attr = $item->attr; - $cut = $item->cut; - - if ($item->position && $firstSeen) { - $children = $this->data[$item->position]; - - if ($cursor->stop) { - if ($cut >= 0) { - $cut += \count($children); - } - $children = []; - } - } else { - $children = []; - } - switch ($item->type) { - case Stub::TYPE_STRING: - $dumper->dumpString($cursor, $item->value, Stub::STRING_BINARY === $item->class, $cut); - break; - - case Stub::TYPE_ARRAY: - $item = clone $item; - $item->type = $item->class; - $item->class = $item->value; - // no break - case Stub::TYPE_OBJECT: - case Stub::TYPE_RESOURCE: - $withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth; - $dumper->enterHash($cursor, $item->type, $item->class, $withChildren); - if ($withChildren) { - if ($cursor->skipChildren) { - $withChildren = false; - $cut = -1; - } else { - $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class); - } - } elseif ($children && 0 <= $cut) { - $cut += \count($children); - } - $cursor->skipChildren = false; - $dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut); - break; - - default: - throw new \RuntimeException(sprintf('Unexpected Stub type: "%s".', $item->type)); - } - } elseif ('array' === $type) { - $dumper->enterHash($cursor, Cursor::HASH_INDEXED, 0, false); - $dumper->leaveHash($cursor, Cursor::HASH_INDEXED, 0, false, 0); - } elseif ('string' === $type) { - $dumper->dumpString($cursor, $item, false, 0); - } else { - $dumper->dumpScalar($cursor, $type, $item); - } - } - - /** - * Dumps children of hash structures. - * - * @return int The final number of removed items - */ - private function dumpChildren(DumperInterface $dumper, Cursor $parentCursor, array &$refs, array $children, int $hashCut, int $hashType, bool $dumpKeys): int - { - $cursor = clone $parentCursor; - ++$cursor->depth; - $cursor->hashType = $hashType; - $cursor->hashIndex = 0; - $cursor->hashLength = \count($children); - $cursor->hashCut = $hashCut; - foreach ($children as $key => $child) { - $cursor->hashKeyIsBinary = isset($key[0]) && !preg_match('//u', $key); - $cursor->hashKey = $dumpKeys ? $key : null; - $this->dumpItem($dumper, $cursor, $refs, $child); - if (++$cursor->hashIndex === $this->maxItemsPerDepth || $cursor->stop) { - $parentCursor->stop = true; - - return $hashCut >= 0 ? $hashCut + $cursor->hashLength - $cursor->hashIndex : $hashCut; - } - } - - return $hashCut; - } - - private function getStub($item) - { - if (!$item || !\is_array($item)) { - return $item; - } - - $stub = new Stub(); - $stub->type = Stub::TYPE_ARRAY; - foreach ($item as $stub->class => $stub->position) { - } - if (isset($item[0])) { - $stub->cut = $item[0]; - } - $stub->value = $stub->cut + ($stub->position ? \count($this->data[$stub->position]) : 0); - - return $stub; - } -} diff --git a/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/vendor/symfony/var-dumper/Cloner/DumperInterface.php deleted file mode 100644 index ec8ef27..0000000 --- a/vendor/symfony/var-dumper/Cloner/DumperInterface.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Cloner; - -/** - * DumperInterface used by Data objects. - * - * @author Nicolas Grekas - */ -interface DumperInterface -{ - /** - * Dumps a scalar value. - * - * @param string $type The PHP type of the value being dumped - * @param string|int|float|bool $value The scalar value being dumped - */ - public function dumpScalar(Cursor $cursor, $type, $value); - - /** - * Dumps a string. - * - * @param string $str The string being dumped - * @param bool $bin Whether $str is UTF-8 or binary encoded - * @param int $cut The number of characters $str has been cut by - */ - public function dumpString(Cursor $cursor, $str, $bin, $cut); - - /** - * Dumps while entering an hash. - * - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string|int $class The object class, resource type or array count - * @param bool $hasChild When the dump of the hash has child item - */ - public function enterHash(Cursor $cursor, $type, $class, $hasChild); - - /** - * Dumps while leaving an hash. - * - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string|int $class The object class, resource type or array count - * @param bool $hasChild When the dump of the hash has child item - * @param int $cut The number of items the hash has been cut by - */ - public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut); -} diff --git a/vendor/symfony/var-dumper/Cloner/Stub.php b/vendor/symfony/var-dumper/Cloner/Stub.php deleted file mode 100644 index 073c56e..0000000 --- a/vendor/symfony/var-dumper/Cloner/Stub.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Cloner; - -/** - * Represents the main properties of a PHP variable. - * - * @author Nicolas Grekas - */ -class Stub -{ - public const TYPE_REF = 1; - public const TYPE_STRING = 2; - public const TYPE_ARRAY = 3; - public const TYPE_OBJECT = 4; - public const TYPE_RESOURCE = 5; - - public const STRING_BINARY = 1; - public const STRING_UTF8 = 2; - - public const ARRAY_ASSOC = 1; - public const ARRAY_INDEXED = 2; - - public $type = self::TYPE_REF; - public $class = ''; - public $value; - public $cut = 0; - public $handle = 0; - public $refCount = 0; - public $position = 0; - public $attr = []; - - private static $defaultProperties = []; - - /** - * @internal - */ - public function __sleep(): array - { - $properties = []; - - if (!isset(self::$defaultProperties[$c = static::class])) { - self::$defaultProperties[$c] = get_class_vars($c); - - foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) { - unset(self::$defaultProperties[$c][$k]); - } - } - - foreach (self::$defaultProperties[$c] as $k => $v) { - if ($this->$k !== $v) { - $properties[] = $k; - } - } - - return $properties; - } -} diff --git a/vendor/symfony/var-dumper/Cloner/VarCloner.php b/vendor/symfony/var-dumper/Cloner/VarCloner.php deleted file mode 100644 index 6a90021..0000000 --- a/vendor/symfony/var-dumper/Cloner/VarCloner.php +++ /dev/null @@ -1,307 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Cloner; - -/** - * @author Nicolas Grekas - */ -class VarCloner extends AbstractCloner -{ - private static $gid; - private static $arrayCache = []; - - /** - * {@inheritdoc} - */ - protected function doClone($var) - { - $len = 1; // Length of $queue - $pos = 0; // Number of cloned items past the minimum depth - $refsCounter = 0; // Hard references counter - $queue = [[$var]]; // This breadth-first queue is the return value - $indexedArrays = []; // Map of queue indexes that hold numerically indexed arrays - $hardRefs = []; // Map of original zval ids to stub objects - $objRefs = []; // Map of original object handles to their stub object counterpart - $objects = []; // Keep a ref to objects to ensure their handle cannot be reused while cloning - $resRefs = []; // Map of original resource handles to their stub object counterpart - $values = []; // Map of stub objects' ids to original values - $maxItems = $this->maxItems; - $maxString = $this->maxString; - $minDepth = $this->minDepth; - $currentDepth = 0; // Current tree depth - $currentDepthFinalIndex = 0; // Final $queue index for current tree depth - $minimumDepthReached = 0 === $minDepth; // Becomes true when minimum tree depth has been reached - $cookie = (object) []; // Unique object used to detect hard references - $a = null; // Array cast for nested structures - $stub = null; // Stub capturing the main properties of an original item value - // or null if the original value is used directly - - if (!$gid = self::$gid) { - $gid = self::$gid = md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable - } - $arrayStub = new Stub(); - $arrayStub->type = Stub::TYPE_ARRAY; - $fromObjCast = false; - - for ($i = 0; $i < $len; ++$i) { - // Detect when we move on to the next tree depth - if ($i > $currentDepthFinalIndex) { - ++$currentDepth; - $currentDepthFinalIndex = $len - 1; - if ($currentDepth >= $minDepth) { - $minimumDepthReached = true; - } - } - - $refs = $vals = $queue[$i]; - if (\PHP_VERSION_ID < 70200 && empty($indexedArrays[$i])) { - // see https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts - foreach ($vals as $k => $v) { - if (\is_int($k)) { - continue; - } - foreach ([$k => true] as $gk => $gv) { - } - if ($gk !== $k) { - $fromObjCast = true; - $refs = $vals = array_values($queue[$i]); - break; - } - } - } - foreach ($vals as $k => $v) { - // $v is the original value or a stub object in case of hard references - - if (\PHP_VERSION_ID >= 70400) { - $zvalIsRef = null !== \ReflectionReference::fromArrayElement($vals, $k); - } else { - $refs[$k] = $cookie; - $zvalIsRef = $vals[$k] === $cookie; - } - - if ($zvalIsRef) { - $vals[$k] = &$stub; // Break hard references to make $queue completely - unset($stub); // independent from the original structure - if ($v instanceof Stub && isset($hardRefs[spl_object_id($v)])) { - $vals[$k] = $refs[$k] = $v; - if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) { - ++$v->value->refCount; - } - ++$v->refCount; - continue; - } - $refs[$k] = $vals[$k] = new Stub(); - $refs[$k]->value = $v; - $h = spl_object_id($refs[$k]); - $hardRefs[$h] = &$refs[$k]; - $values[$h] = $v; - $vals[$k]->handle = ++$refsCounter; - } - // Create $stub when the original value $v can not be used directly - // If $v is a nested structure, put that structure in array $a - switch (true) { - case null === $v: - case \is_bool($v): - case \is_int($v): - case \is_float($v): - continue 2; - case \is_string($v): - if ('' === $v) { - continue 2; - } - if (!preg_match('//u', $v)) { - $stub = new Stub(); - $stub->type = Stub::TYPE_STRING; - $stub->class = Stub::STRING_BINARY; - if (0 <= $maxString && 0 < $cut = \strlen($v) - $maxString) { - $stub->cut = $cut; - $stub->value = substr($v, 0, -$cut); - } else { - $stub->value = $v; - } - } elseif (0 <= $maxString && isset($v[1 + ($maxString >> 2)]) && 0 < $cut = mb_strlen($v, 'UTF-8') - $maxString) { - $stub = new Stub(); - $stub->type = Stub::TYPE_STRING; - $stub->class = Stub::STRING_UTF8; - $stub->cut = $cut; - $stub->value = mb_substr($v, 0, $maxString, 'UTF-8'); - } else { - continue 2; - } - $a = null; - break; - - case \is_array($v): - if (!$v) { - continue 2; - } - $stub = $arrayStub; - $stub->class = Stub::ARRAY_INDEXED; - - $j = -1; - foreach ($v as $gk => $gv) { - if ($gk !== ++$j) { - $stub->class = Stub::ARRAY_ASSOC; - break; - } - } - $a = $v; - - if (Stub::ARRAY_ASSOC === $stub->class) { - // Copies of $GLOBALS have very strange behavior, - // let's detect them with some black magic - if (\PHP_VERSION_ID < 80100 && ($a[$gid] = true) && isset($v[$gid])) { - unset($v[$gid]); - $a = []; - foreach ($v as $gk => &$gv) { - if ($v === $gv) { - unset($v); - $v = new Stub(); - $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0]; - $v->handle = -1; - $gv = &$hardRefs[spl_object_id($v)]; - $gv = $v; - } - - $a[$gk] = &$gv; - } - unset($gv); - } else { - $a = $v; - } - } elseif (\PHP_VERSION_ID < 70200) { - $indexedArrays[$len] = true; - } - break; - - case \is_object($v): - case $v instanceof \__PHP_Incomplete_Class: - if (empty($objRefs[$h = spl_object_id($v)])) { - $stub = new Stub(); - $stub->type = Stub::TYPE_OBJECT; - $stub->class = \get_class($v); - $stub->value = $v; - $stub->handle = $h; - $a = $this->castObject($stub, 0 < $i); - if ($v !== $stub->value) { - if (Stub::TYPE_OBJECT !== $stub->type || null === $stub->value) { - break; - } - $stub->handle = $h = spl_object_id($stub->value); - } - $stub->value = null; - if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) { - $stub->cut = \count($a); - $a = null; - } - } - if (empty($objRefs[$h])) { - $objRefs[$h] = $stub; - $objects[] = $v; - } else { - $stub = $objRefs[$h]; - ++$stub->refCount; - $a = null; - } - break; - - default: // resource - if (empty($resRefs[$h = (int) $v])) { - $stub = new Stub(); - $stub->type = Stub::TYPE_RESOURCE; - if ('Unknown' === $stub->class = @get_resource_type($v)) { - $stub->class = 'Closed'; - } - $stub->value = $v; - $stub->handle = $h; - $a = $this->castResource($stub, 0 < $i); - $stub->value = null; - if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) { - $stub->cut = \count($a); - $a = null; - } - } - if (empty($resRefs[$h])) { - $resRefs[$h] = $stub; - } else { - $stub = $resRefs[$h]; - ++$stub->refCount; - $a = null; - } - break; - } - - if ($a) { - if (!$minimumDepthReached || 0 > $maxItems) { - $queue[$len] = $a; - $stub->position = $len++; - } elseif ($pos < $maxItems) { - if ($maxItems < $pos += \count($a)) { - $a = \array_slice($a, 0, $maxItems - $pos, true); - if ($stub->cut >= 0) { - $stub->cut += $pos - $maxItems; - } - } - $queue[$len] = $a; - $stub->position = $len++; - } elseif ($stub->cut >= 0) { - $stub->cut += \count($a); - $stub->position = 0; - } - } - - if ($arrayStub === $stub) { - if ($arrayStub->cut) { - $stub = [$arrayStub->cut, $arrayStub->class => $arrayStub->position]; - $arrayStub->cut = 0; - } elseif (isset(self::$arrayCache[$arrayStub->class][$arrayStub->position])) { - $stub = self::$arrayCache[$arrayStub->class][$arrayStub->position]; - } else { - self::$arrayCache[$arrayStub->class][$arrayStub->position] = $stub = [$arrayStub->class => $arrayStub->position]; - } - } - - if ($zvalIsRef) { - $refs[$k]->value = $stub; - } else { - $vals[$k] = $stub; - } - } - - if ($fromObjCast) { - $fromObjCast = false; - $refs = $vals; - $vals = []; - $j = -1; - foreach ($queue[$i] as $k => $v) { - foreach ([$k => true] as $gk => $gv) { - } - if ($gk !== $k) { - $vals = (object) $vals; - $vals->{$k} = $refs[++$j]; - $vals = (array) $vals; - } else { - $vals[$k] = $refs[++$j]; - } - } - } - - $queue[$i] = $vals; - } - - foreach ($values as $h => $v) { - $hardRefs[$h] = $v; - } - - return $queue; - } -} diff --git a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php deleted file mode 100644 index dc77d03..0000000 --- a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Command\Descriptor; - -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * Describe collected data clones for cli output. - * - * @author Maxime Steinhausser - * - * @final - */ -class CliDescriptor implements DumpDescriptorInterface -{ - private $dumper; - private $lastIdentifier; - private $supportsHref; - - public function __construct(CliDumper $dumper) - { - $this->dumper = $dumper; - $this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref'); - } - - public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void - { - $io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output); - $this->dumper->setColors($output->isDecorated()); - - $rows = [['date', date('r', $context['timestamp'])]]; - $lastIdentifier = $this->lastIdentifier; - $this->lastIdentifier = $clientId; - - $section = "Received from client #$clientId"; - if (isset($context['request'])) { - $request = $context['request']; - $this->lastIdentifier = $request['identifier']; - $section = sprintf('%s %s', $request['method'], $request['uri']); - if ($controller = $request['controller']) { - $rows[] = ['controller', rtrim($this->dumper->dump($controller, true), "\n")]; - } - } elseif (isset($context['cli'])) { - $this->lastIdentifier = $context['cli']['identifier']; - $section = '$ '.$context['cli']['command_line']; - } - - if ($this->lastIdentifier !== $lastIdentifier) { - $io->section($section); - } - - if (isset($context['source'])) { - $source = $context['source']; - $sourceInfo = sprintf('%s on line %d', $source['name'], $source['line']); - $fileLink = $source['file_link'] ?? null; - if ($this->supportsHref && $fileLink) { - $sourceInfo = sprintf('%s', $fileLink, $sourceInfo); - } - $rows[] = ['source', $sourceInfo]; - $file = $source['file_relative'] ?? $source['file']; - $rows[] = ['file', $file]; - } - - $io->table([], $rows); - - if (!$this->supportsHref && isset($fileLink)) { - $io->writeln(['Open source in your IDE/browser:', $fileLink]); - $io->newLine(); - } - - $this->dumper->dump($data); - $io->newLine(); - } -} diff --git a/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php b/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php deleted file mode 100644 index 267d27b..0000000 --- a/vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Command\Descriptor; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\Data; - -/** - * @author Maxime Steinhausser - */ -interface DumpDescriptorInterface -{ - public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void; -} diff --git a/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php deleted file mode 100644 index 35a203b..0000000 --- a/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Command\Descriptor; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; - -/** - * Describe collected data clones for html output. - * - * @author Maxime Steinhausser - * - * @final - */ -class HtmlDescriptor implements DumpDescriptorInterface -{ - private $dumper; - private $initialized = false; - - public function __construct(HtmlDumper $dumper) - { - $this->dumper = $dumper; - } - - public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void - { - if (!$this->initialized) { - $styles = file_get_contents(__DIR__.'/../../Resources/css/htmlDescriptor.css'); - $scripts = file_get_contents(__DIR__.'/../../Resources/js/htmlDescriptor.js'); - $output->writeln(""); - $this->initialized = true; - } - - $title = '-'; - if (isset($context['request'])) { - $request = $context['request']; - $controller = "{$this->dumper->dump($request['controller'], true, ['maxDepth' => 0])}"; - $title = sprintf('%s %s', $request['method'], $uri = $request['uri'], $uri); - $dedupIdentifier = $request['identifier']; - } elseif (isset($context['cli'])) { - $title = '$ '.$context['cli']['command_line']; - $dedupIdentifier = $context['cli']['identifier']; - } else { - $dedupIdentifier = uniqid('', true); - } - - $sourceDescription = ''; - if (isset($context['source'])) { - $source = $context['source']; - $projectDir = $source['project_dir'] ?? null; - $sourceDescription = sprintf('%s on line %d', $source['name'], $source['line']); - if (isset($source['file_link'])) { - $sourceDescription = sprintf('%s', $source['file_link'], $sourceDescription); - } - } - - $isoDate = $this->extractDate($context, 'c'); - $tags = array_filter([ - 'controller' => $controller ?? null, - 'project dir' => $projectDir ?? null, - ]); - - $output->writeln(<< -
-
-

$title

- -
- {$this->renderTags($tags)} -
-
-

- $sourceDescription -

- {$this->dumper->dump($data, true)} -
- -HTML - ); - } - - private function extractDate(array $context, string $format = 'r'): string - { - return date($format, $context['timestamp']); - } - - private function renderTags(array $tags): string - { - if (!$tags) { - return ''; - } - - $renderedTags = ''; - foreach ($tags as $key => $value) { - $renderedTags .= sprintf('
  • %s%s
  • ', $key, $value); - } - - return << -
      - $renderedTags -
    - -HTML; - } -} diff --git a/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/vendor/symfony/var-dumper/Command/ServerDumpCommand.php deleted file mode 100644 index c8a61da..0000000 --- a/vendor/symfony/var-dumper/Command/ServerDumpCommand.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Command; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor; -use Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface; -use Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor; -use Symfony\Component\VarDumper\Dumper\CliDumper; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Symfony\Component\VarDumper\Server\DumpServer; - -/** - * Starts a dump server to collect and output dumps on a single place with multiple formats support. - * - * @author Maxime Steinhausser - * - * @final - */ -class ServerDumpCommand extends Command -{ - protected static $defaultName = 'server:dump'; - - private $server; - - /** @var DumpDescriptorInterface[] */ - private $descriptors; - - public function __construct(DumpServer $server, array $descriptors = []) - { - $this->server = $server; - $this->descriptors = $descriptors + [ - 'cli' => new CliDescriptor(new CliDumper()), - 'html' => new HtmlDescriptor(new HtmlDumper()), - ]; - - parent::__construct(); - } - - protected function configure() - { - $availableFormats = implode(', ', array_keys($this->descriptors)); - - $this - ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli') - ->setDescription('Starts a dump server that collects and displays dumps in a single place') - ->setHelp(<<<'EOF' -%command.name% starts a dump server that collects and displays -dumps in a single place for debugging you application: - - php %command.full_name% - -You can consult dumped data in HTML format in your browser by providing the --format=html option -and redirecting the output to a file: - - php %command.full_name% --format="html" > dump.html - -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output); - $format = $input->getOption('format'); - - if (!$descriptor = $this->descriptors[$format] ?? null) { - throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $format)); - } - - $errorIo = $io->getErrorStyle(); - $errorIo->title('Symfony Var Dumper Server'); - - $this->server->start(); - - $errorIo->success(sprintf('Server listening on %s', $this->server->getHost())); - $errorIo->comment('Quit the server with CONTROL-C.'); - - $this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) { - $descriptor->describe($io, $data, $context, $clientId); - }); - } -} diff --git a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php deleted file mode 100644 index eea56b5..0000000 --- a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ /dev/null @@ -1,212 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper; - -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Cloner\DumperInterface; - -/** - * Abstract mechanism for dumping a Data object. - * - * @author Nicolas Grekas - */ -abstract class AbstractDumper implements DataDumperInterface, DumperInterface -{ - public const DUMP_LIGHT_ARRAY = 1; - public const DUMP_STRING_LENGTH = 2; - public const DUMP_COMMA_SEPARATOR = 4; - public const DUMP_TRAILING_COMMA = 8; - - public static $defaultOutput = 'php://output'; - - protected $line = ''; - protected $lineDumper; - protected $outputStream; - protected $decimalPoint; // This is locale dependent - protected $indentPad = ' '; - protected $flags; - - private $charset = ''; - - /** - * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput - * @param string|null $charset The default character encoding to use for non-UTF8 strings - * @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation - */ - public function __construct($output = null, string $charset = null, int $flags = 0) - { - $this->flags = $flags; - $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'); - $this->decimalPoint = localeconv(); - $this->decimalPoint = $this->decimalPoint['decimal_point']; - $this->setOutput($output ?: static::$defaultOutput); - if (!$output && \is_string(static::$defaultOutput)) { - static::$defaultOutput = $this->outputStream; - } - } - - /** - * Sets the output destination of the dumps. - * - * @param callable|resource|string $output A line dumper callable, an opened stream or an output path - * - * @return callable|resource|string The previous output destination - */ - public function setOutput($output) - { - $prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper; - - if (\is_callable($output)) { - $this->outputStream = null; - $this->lineDumper = $output; - } else { - if (\is_string($output)) { - $output = fopen($output, 'w'); - } - $this->outputStream = $output; - $this->lineDumper = [$this, 'echoLine']; - } - - return $prev; - } - - /** - * Sets the default character encoding to use for non-UTF8 strings. - * - * @param string $charset The default character encoding to use for non-UTF8 strings - * - * @return string The previous charset - */ - public function setCharset($charset) - { - $prev = $this->charset; - - $charset = strtoupper($charset); - $charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset; - - $this->charset = $charset; - - return $prev; - } - - /** - * Sets the indentation pad string. - * - * @param string $pad A string that will be prepended to dumped lines, repeated by nesting level - * - * @return string The previous indent pad - */ - public function setIndentPad($pad) - { - $prev = $this->indentPad; - $this->indentPad = $pad; - - return $prev; - } - - /** - * Dumps a Data object. - * - * @param callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump - * - * @return string|null The dump as string when $output is true - */ - public function dump(Data $data, $output = null) - { - $this->decimalPoint = localeconv(); - $this->decimalPoint = $this->decimalPoint['decimal_point']; - - if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(\LC_NUMERIC, 0) : null) { - setlocale(\LC_NUMERIC, 'C'); - } - - if ($returnDump = true === $output) { - $output = fopen('php://memory', 'r+'); - } - if ($output) { - $prevOutput = $this->setOutput($output); - } - try { - $data->dump($this); - $this->dumpLine(-1); - - if ($returnDump) { - $result = stream_get_contents($output, -1, 0); - fclose($output); - - return $result; - } - } finally { - if ($output) { - $this->setOutput($prevOutput); - } - if ($locale) { - setlocale(\LC_NUMERIC, $locale); - } - } - - return null; - } - - /** - * Dumps the current line. - * - * @param int $depth The recursive depth in the dumped structure for the line being dumped, - * or -1 to signal the end-of-dump to the line dumper callable - */ - protected function dumpLine($depth) - { - ($this->lineDumper)($this->line, $depth, $this->indentPad); - $this->line = ''; - } - - /** - * Generic line dumper callback. - * - * @param string $line The line to write - * @param int $depth The recursive depth in the dumped structure - * @param string $indentPad The line indent pad - */ - protected function echoLine($line, $depth, $indentPad) - { - if (-1 !== $depth) { - fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n"); - } - } - - /** - * Converts a non-UTF-8 string to UTF-8. - * - * @param string|null $s The non-UTF-8 string to convert - * - * @return string|null The string converted to UTF-8 - */ - protected function utf8Encode($s) - { - if (null === $s || preg_match('//u', $s)) { - return $s; - } - - if (!\function_exists('iconv')) { - throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.'); - } - - if (false !== $c = @iconv($this->charset, 'UTF-8', $s)) { - return $c; - } - if ('CP1252' !== $this->charset && false !== $c = @iconv('CP1252', 'UTF-8', $s)) { - return $c; - } - - return iconv('CP850', 'UTF-8', $s); - } -} diff --git a/vendor/symfony/var-dumper/Dumper/CliDumper.php b/vendor/symfony/var-dumper/Dumper/CliDumper.php deleted file mode 100644 index 55484b0..0000000 --- a/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ /dev/null @@ -1,655 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper; - -use Symfony\Component\VarDumper\Cloner\Cursor; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * CliDumper dumps variables for command line output. - * - * @author Nicolas Grekas - */ -class CliDumper extends AbstractDumper -{ - public static $defaultColors; - public static $defaultOutput = 'php://stdout'; - - protected $colors; - protected $maxStringWidth = 0; - protected $styles = [ - // See http://en.wikipedia.org/wiki/ANSI_escape_code#graphics - 'default' => '0;38;5;208', - 'num' => '1;38;5;38', - 'const' => '1;38;5;208', - 'str' => '1;38;5;113', - 'note' => '38;5;38', - 'ref' => '38;5;247', - 'public' => '', - 'protected' => '', - 'private' => '', - 'meta' => '38;5;170', - 'key' => '38;5;113', - 'index' => '38;5;38', - ]; - - protected static $controlCharsRx = '/[\x00-\x1F\x7F]+/'; - protected static $controlCharsMap = [ - "\t" => '\t', - "\n" => '\n', - "\v" => '\v', - "\f" => '\f', - "\r" => '\r', - "\033" => '\e', - ]; - - protected $collapseNextHash = false; - protected $expandNextHash = false; - - private $displayOptions = [ - 'fileLinkFormat' => null, - ]; - - private $handlesHrefGracefully; - - /** - * {@inheritdoc} - */ - public function __construct($output = null, string $charset = null, int $flags = 0) - { - parent::__construct($output, $charset, $flags); - - if ('\\' === \DIRECTORY_SEPARATOR && !$this->isWindowsTrueColor()) { - // Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI - $this->setStyles([ - 'default' => '31', - 'num' => '1;34', - 'const' => '1;31', - 'str' => '1;32', - 'note' => '34', - 'ref' => '1;30', - 'meta' => '35', - 'key' => '32', - 'index' => '34', - ]); - } - - $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l'; - } - - /** - * Enables/disables colored output. - * - * @param bool $colors - */ - public function setColors($colors) - { - $this->colors = (bool) $colors; - } - - /** - * Sets the maximum number of characters per line for dumped strings. - * - * @param int $maxStringWidth - */ - public function setMaxStringWidth($maxStringWidth) - { - $this->maxStringWidth = (int) $maxStringWidth; - } - - /** - * Configures styles. - * - * @param array $styles A map of style names to style definitions - */ - public function setStyles(array $styles) - { - $this->styles = $styles + $this->styles; - } - - /** - * Configures display options. - * - * @param array $displayOptions A map of display options to customize the behavior - */ - public function setDisplayOptions(array $displayOptions) - { - $this->displayOptions = $displayOptions + $this->displayOptions; - } - - /** - * {@inheritdoc} - */ - public function dumpScalar(Cursor $cursor, $type, $value) - { - $this->dumpKey($cursor); - - $style = 'const'; - $attr = $cursor->attr; - - switch ($type) { - case 'default': - $style = 'default'; - break; - - case 'integer': - $style = 'num'; - break; - - case 'double': - $style = 'num'; - - switch (true) { - case \INF === $value: $value = 'INF'; break; - case -\INF === $value: $value = '-INF'; break; - case is_nan($value): $value = 'NAN'; break; - default: - $value = (string) $value; - if (false === strpos($value, $this->decimalPoint)) { - $value .= $this->decimalPoint.'0'; - } - break; - } - break; - - case 'NULL': - $value = 'null'; - break; - - case 'boolean': - $value = $value ? 'true' : 'false'; - break; - - default: - $attr += ['value' => $this->utf8Encode($value)]; - $value = $this->utf8Encode($type); - break; - } - - $this->line .= $this->style($style, $value, $attr); - - $this->endValue($cursor); - } - - /** - * {@inheritdoc} - */ - public function dumpString(Cursor $cursor, $str, $bin, $cut) - { - $this->dumpKey($cursor); - $attr = $cursor->attr; - - if ($bin) { - $str = $this->utf8Encode($str); - } - if ('' === $str) { - $this->line .= '""'; - $this->endValue($cursor); - } else { - $attr += [ - 'length' => 0 <= $cut ? mb_strlen($str, 'UTF-8') + $cut : 0, - 'binary' => $bin, - ]; - $str = explode("\n", $str); - if (isset($str[1]) && !isset($str[2]) && !isset($str[1][0])) { - unset($str[1]); - $str[0] .= "\n"; - } - $m = \count($str) - 1; - $i = $lineCut = 0; - - if (self::DUMP_STRING_LENGTH & $this->flags) { - $this->line .= '('.$attr['length'].') '; - } - if ($bin) { - $this->line .= 'b'; - } - - if ($m) { - $this->line .= '"""'; - $this->dumpLine($cursor->depth); - } else { - $this->line .= '"'; - } - - foreach ($str as $str) { - if ($i < $m) { - $str .= "\n"; - } - if (0 < $this->maxStringWidth && $this->maxStringWidth < $len = mb_strlen($str, 'UTF-8')) { - $str = mb_substr($str, 0, $this->maxStringWidth, 'UTF-8'); - $lineCut = $len - $this->maxStringWidth; - } - if ($m && 0 < $cursor->depth) { - $this->line .= $this->indentPad; - } - if ('' !== $str) { - $this->line .= $this->style('str', $str, $attr); - } - if ($i++ == $m) { - if ($m) { - if ('' !== $str) { - $this->dumpLine($cursor->depth); - if (0 < $cursor->depth) { - $this->line .= $this->indentPad; - } - } - $this->line .= '"""'; - } else { - $this->line .= '"'; - } - if ($cut < 0) { - $this->line .= '…'; - $lineCut = 0; - } elseif ($cut) { - $lineCut += $cut; - } - } - if ($lineCut) { - $this->line .= '…'.$lineCut; - $lineCut = 0; - } - - if ($i > $m) { - $this->endValue($cursor); - } else { - $this->dumpLine($cursor->depth); - } - } - } - } - - /** - * {@inheritdoc} - */ - public function enterHash(Cursor $cursor, $type, $class, $hasChild) - { - if (null === $this->colors) { - $this->colors = $this->supportsColors(); - } - - $this->dumpKey($cursor); - $attr = $cursor->attr; - - if ($this->collapseNextHash) { - $cursor->skipChildren = true; - $this->collapseNextHash = $hasChild = false; - } - - $class = $this->utf8Encode($class); - if (Cursor::HASH_OBJECT === $type) { - $prefix = $class && 'stdClass' !== $class ? $this->style('note', $class, $attr).(empty($attr['cut_hash']) ? ' {' : '') : '{'; - } elseif (Cursor::HASH_RESOURCE === $type) { - $prefix = $this->style('note', $class.' resource', $attr).($hasChild ? ' {' : ' '); - } else { - $prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class).' [' : '['; - } - - if (($cursor->softRefCount || 0 < $cursor->softRefHandle) && empty($attr['cut_hash'])) { - $prefix .= $this->style('ref', (Cursor::HASH_RESOURCE === $type ? '@' : '#').(0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->softRefTo), ['count' => $cursor->softRefCount]); - } elseif ($cursor->hardRefTo && !$cursor->refIndex && $class) { - $prefix .= $this->style('ref', '&'.$cursor->hardRefTo, ['count' => $cursor->hardRefCount]); - } elseif (!$hasChild && Cursor::HASH_RESOURCE === $type) { - $prefix = substr($prefix, 0, -1); - } - - $this->line .= $prefix; - - if ($hasChild) { - $this->dumpLine($cursor->depth); - } - } - - /** - * {@inheritdoc} - */ - public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut) - { - if (empty($cursor->attr['cut_hash'])) { - $this->dumpEllipsis($cursor, $hasChild, $cut); - $this->line .= Cursor::HASH_OBJECT === $type ? '}' : (Cursor::HASH_RESOURCE !== $type ? ']' : ($hasChild ? '}' : '')); - } - - $this->endValue($cursor); - } - - /** - * Dumps an ellipsis for cut children. - * - * @param bool $hasChild When the dump of the hash has child item - * @param int $cut The number of items the hash has been cut by - */ - protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut) - { - if ($cut) { - $this->line .= ' …'; - if (0 < $cut) { - $this->line .= $cut; - } - if ($hasChild) { - $this->dumpLine($cursor->depth + 1); - } - } - } - - /** - * Dumps a key in a hash structure. - */ - protected function dumpKey(Cursor $cursor) - { - if (null !== $key = $cursor->hashKey) { - if ($cursor->hashKeyIsBinary) { - $key = $this->utf8Encode($key); - } - $attr = ['binary' => $cursor->hashKeyIsBinary]; - $bin = $cursor->hashKeyIsBinary ? 'b' : ''; - $style = 'key'; - switch ($cursor->hashType) { - default: - case Cursor::HASH_INDEXED: - if (self::DUMP_LIGHT_ARRAY & $this->flags) { - break; - } - $style = 'index'; - // no break - case Cursor::HASH_ASSOC: - if (\is_int($key)) { - $this->line .= $this->style($style, $key).' => '; - } else { - $this->line .= $bin.'"'.$this->style($style, $key).'" => '; - } - break; - - case Cursor::HASH_RESOURCE: - $key = "\0~\0".$key; - // no break - case Cursor::HASH_OBJECT: - if (!isset($key[0]) || "\0" !== $key[0]) { - $this->line .= '+'.$bin.$this->style('public', $key).': '; - } elseif (0 < strpos($key, "\0", 1)) { - $key = explode("\0", substr($key, 1), 2); - - switch ($key[0][0]) { - case '+': // User inserted keys - $attr['dynamic'] = true; - $this->line .= '+'.$bin.'"'.$this->style('public', $key[1], $attr).'": '; - break 2; - case '~': - $style = 'meta'; - if (isset($key[0][1])) { - parse_str(substr($key[0], 1), $attr); - $attr += ['binary' => $cursor->hashKeyIsBinary]; - } - break; - case '*': - $style = 'protected'; - $bin = '#'.$bin; - break; - default: - $attr['class'] = $key[0]; - $style = 'private'; - $bin = '-'.$bin; - break; - } - - if (isset($attr['collapse'])) { - if ($attr['collapse']) { - $this->collapseNextHash = true; - } else { - $this->expandNextHash = true; - } - } - - $this->line .= $bin.$this->style($style, $key[1], $attr).($attr['separator'] ?? ': '); - } else { - // This case should not happen - $this->line .= '-'.$bin.'"'.$this->style('private', $key, ['class' => '']).'": '; - } - break; - } - - if ($cursor->hardRefTo) { - $this->line .= $this->style('ref', '&'.($cursor->hardRefCount ? $cursor->hardRefTo : ''), ['count' => $cursor->hardRefCount]).' '; - } - } - } - - /** - * Decorates a value with some style. - * - * @param string $style The type of style being applied - * @param string $value The value being styled - * @param array $attr Optional context information - * - * @return string The value with style decoration - */ - protected function style($style, $value, $attr = []) - { - if (null === $this->colors) { - $this->colors = $this->supportsColors(); - } - - if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); - } - - if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { - $prefix = substr($value, 0, -$attr['ellipsis']); - if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && 0 === strpos($prefix, $_SERVER[$pwd])) { - $prefix = '.'.substr($prefix, \strlen($_SERVER[$pwd])); - } - if (!empty($attr['ellipsis-tail'])) { - $prefix .= substr($value, -$attr['ellipsis'], $attr['ellipsis-tail']); - $value = substr($value, -$attr['ellipsis'] + $attr['ellipsis-tail']); - } else { - $value = substr($value, -$attr['ellipsis']); - } - - $value = $this->style('default', $prefix).$this->style($style, $value); - - goto href; - } - - $map = static::$controlCharsMap; - $startCchr = $this->colors ? "\033[m\033[{$this->styles['default']}m" : ''; - $endCchr = $this->colors ? "\033[m\033[{$this->styles[$style]}m" : ''; - $value = preg_replace_callback(static::$controlCharsRx, function ($c) use ($map, $startCchr, $endCchr) { - $s = $startCchr; - $c = $c[$i = 0]; - do { - $s .= $map[$c[$i]] ?? sprintf('\x%02X', \ord($c[$i])); - } while (isset($c[++$i])); - - return $s.$endCchr; - }, $value, -1, $cchrCount); - - if ($this->colors) { - if ($cchrCount && "\033" === $value[0]) { - $value = substr($value, \strlen($startCchr)); - } else { - $value = "\033[{$this->styles[$style]}m".$value; - } - if ($cchrCount && $endCchr === substr($value, -\strlen($endCchr))) { - $value = substr($value, 0, -\strlen($endCchr)); - } else { - $value .= "\033[{$this->styles['default']}m"; - } - } - - href: - if ($this->colors && $this->handlesHrefGracefully) { - if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) { - if ('note' === $style) { - $value .= "\033]8;;{$href}\033\\^\033]8;;\033\\"; - } else { - $attr['href'] = $href; - } - } - if (isset($attr['href'])) { - $value = "\033]8;;{$attr['href']}\033\\{$value}\033]8;;\033\\"; - } - } elseif ($attr['if_links'] ?? false) { - return ''; - } - - return $value; - } - - /** - * @return bool Tells if the current output stream supports ANSI colors or not - */ - protected function supportsColors() - { - if ($this->outputStream !== static::$defaultOutput) { - return $this->hasColorSupport($this->outputStream); - } - if (null !== static::$defaultColors) { - return static::$defaultColors; - } - if (isset($_SERVER['argv'][1])) { - $colors = $_SERVER['argv']; - $i = \count($colors); - while (--$i > 0) { - if (isset($colors[$i][5])) { - switch ($colors[$i]) { - case '--ansi': - case '--color': - case '--color=yes': - case '--color=force': - case '--color=always': - return static::$defaultColors = true; - - case '--no-ansi': - case '--color=no': - case '--color=none': - case '--color=never': - return static::$defaultColors = false; - } - } - } - } - - $h = stream_get_meta_data($this->outputStream) + ['wrapper_type' => null]; - $h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'w') : $this->outputStream; - - return static::$defaultColors = $this->hasColorSupport($h); - } - - /** - * {@inheritdoc} - */ - protected function dumpLine($depth, $endOfValue = false) - { - if ($this->colors) { - $this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line); - } - parent::dumpLine($depth); - } - - protected function endValue(Cursor $cursor) - { - if (-1 === $cursor->hashType) { - return; - } - - if (Stub::ARRAY_INDEXED === $cursor->hashType || Stub::ARRAY_ASSOC === $cursor->hashType) { - if (self::DUMP_TRAILING_COMMA & $this->flags && 0 < $cursor->depth) { - $this->line .= ','; - } elseif (self::DUMP_COMMA_SEPARATOR & $this->flags && 1 < $cursor->hashLength - $cursor->hashIndex) { - $this->line .= ','; - } - } - - $this->dumpLine($cursor->depth, true); - } - - /** - * Returns true if the stream supports colorization. - * - * Reference: Composer\XdebugHandler\Process::supportsColor - * https://github.com/composer/xdebug-handler - * - * @param mixed $stream A CLI output stream - */ - private function hasColorSupport($stream): bool - { - if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { - return false; - } - - // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { - return false; - } - - if ('Hyper' === getenv('TERM_PROGRAM')) { - return true; - } - - if (\DIRECTORY_SEPARATOR === '\\') { - return (\function_exists('sapi_windows_vt100_support') - && @sapi_windows_vt100_support($stream)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); - } - - if (\function_exists('stream_isatty')) { - return @stream_isatty($stream); - } - - if (\function_exists('posix_isatty')) { - return @posix_isatty($stream); - } - - $stat = @fstat($stream); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - /** - * Returns true if the Windows terminal supports true color. - * - * Note that this does not check an output stream, but relies on environment - * variables from known implementations, or a PHP and Windows version that - * supports true color. - */ - private function isWindowsTrueColor(): bool - { - $result = 183 <= getenv('ANSICON_VER') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM'); - - if (!$result && \PHP_VERSION_ID >= 70200) { - $version = sprintf( - '%s.%s.%s', - PHP_WINDOWS_VERSION_MAJOR, - PHP_WINDOWS_VERSION_MINOR, - PHP_WINDOWS_VERSION_BUILD - ); - $result = $version >= '10.0.15063'; - } - - return $result; - } - - private function getSourceLink(string $file, int $line) - { - if ($fmt = $this->displayOptions['fileLinkFormat']) { - return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://'.$file.'#L'.$line); - } - - return false; - } -} diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php deleted file mode 100644 index 38f8789..0000000 --- a/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper\ContextProvider; - -/** - * Tries to provide context on CLI. - * - * @author Maxime Steinhausser - */ -final class CliContextProvider implements ContextProviderInterface -{ - public function getContext(): ?array - { - if ('cli' !== \PHP_SAPI) { - return null; - } - - return [ - 'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []), - 'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']), - ]; - } -} diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php deleted file mode 100644 index 38ef3b0..0000000 --- a/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper\ContextProvider; - -/** - * Interface to provide contextual data about dump data clones sent to a server. - * - * @author Maxime Steinhausser - */ -interface ContextProviderInterface -{ - /** - * @return array|null Context data or null if unable to provide any context - */ - public function getContext(): ?array; -} diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php deleted file mode 100644 index 3684a47..0000000 --- a/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper\ContextProvider; - -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\VarDumper\Caster\ReflectionCaster; -use Symfony\Component\VarDumper\Cloner\VarCloner; - -/** - * Tries to provide context from a request. - * - * @author Maxime Steinhausser - */ -final class RequestContextProvider implements ContextProviderInterface -{ - private $requestStack; - private $cloner; - - public function __construct(RequestStack $requestStack) - { - $this->requestStack = $requestStack; - $this->cloner = new VarCloner(); - $this->cloner->setMaxItems(0); - $this->cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); - } - - public function getContext(): ?array - { - if (null === $request = $this->requestStack->getCurrentRequest()) { - return null; - } - - $controller = $request->attributes->get('_controller'); - - return [ - 'uri' => $request->getUri(), - 'method' => $request->getMethod(), - 'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller, - 'identifier' => spl_object_hash($request), - ]; - } -} diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php deleted file mode 100644 index c3cd322..0000000 --- a/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper\ContextProvider; - -use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; -use Symfony\Component\VarDumper\VarDumper; -use Twig\Template; - -/** - * Tries to provide context from sources (class name, file, line, code excerpt, ...). - * - * @author Nicolas Grekas - * @author Maxime Steinhausser - */ -final class SourceContextProvider implements ContextProviderInterface -{ - private $limit; - private $charset; - private $projectDir; - private $fileLinkFormatter; - - public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9) - { - $this->charset = $charset; - $this->projectDir = $projectDir; - $this->fileLinkFormatter = $fileLinkFormatter; - $this->limit = $limit; - } - - public function getContext(): ?array - { - $trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, $this->limit); - - $file = $trace[1]['file']; - $line = $trace[1]['line']; - $name = false; - $fileExcerpt = false; - - for ($i = 2; $i < $this->limit; ++$i) { - if (isset($trace[$i]['class'], $trace[$i]['function']) - && 'dump' === $trace[$i]['function'] - && VarDumper::class === $trace[$i]['class'] - ) { - $file = $trace[$i]['file'] ?? $file; - $line = $trace[$i]['line'] ?? $line; - - while (++$i < $this->limit) { - if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && 0 !== strpos($trace[$i]['function'], 'call_user_func')) { - $file = $trace[$i]['file']; - $line = $trace[$i]['line']; - - break; - } elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) { - $template = $trace[$i]['object']; - $name = $template->getTemplateName(); - $src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false); - $info = $template->getDebugInfo(); - if (isset($info[$trace[$i - 1]['line']])) { - $line = $info[$trace[$i - 1]['line']]; - $file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null; - - if ($src) { - $src = explode("\n", $src); - $fileExcerpt = []; - - for ($i = max($line - 3, 1), $max = min($line + 3, \count($src)); $i <= $max; ++$i) { - $fileExcerpt[] = ''.$this->htmlEncode($src[$i - 1]).''; - } - - $fileExcerpt = '
      '.implode("\n", $fileExcerpt).'
    '; - } - } - break; - } - } - break; - } - } - - if (false === $name) { - $name = str_replace('\\', '/', $file); - $name = substr($name, strrpos($name, '/') + 1); - } - - $context = ['name' => $name, 'file' => $file, 'line' => $line]; - $context['file_excerpt'] = $fileExcerpt; - - if (null !== $this->projectDir) { - $context['project_dir'] = $this->projectDir; - if (0 === strpos($file, $this->projectDir)) { - $context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR); - } - } - - if ($this->fileLinkFormatter && $fileLink = $this->fileLinkFormatter->format($context['file'], $context['line'])) { - $context['file_link'] = $fileLink; - } - - return $context; - } - - private function htmlEncode(string $s): string - { - $html = ''; - - $dumper = new HtmlDumper(function ($line) use (&$html) { $html .= $line; }, $this->charset); - $dumper->setDumpHeader(''); - $dumper->setDumpBoundaries('', ''); - - $cloner = new VarCloner(); - $dumper->dump($cloner->cloneVar($s)); - - return substr(strip_tags($html), 1, -1); - } -} diff --git a/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php deleted file mode 100644 index 7638417..0000000 --- a/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper; - -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; - -/** - * @author Kévin Thérage - */ -class ContextualizedDumper implements DataDumperInterface -{ - private $wrappedDumper; - private $contextProviders; - - /** - * @param ContextProviderInterface[] $contextProviders - */ - public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders) - { - $this->wrappedDumper = $wrappedDumper; - $this->contextProviders = $contextProviders; - } - - public function dump(Data $data) - { - $context = []; - foreach ($this->contextProviders as $contextProvider) { - $context[\get_class($contextProvider)] = $contextProvider->getContext(); - } - - $this->wrappedDumper->dump($data->withContext($context)); - } -} diff --git a/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php b/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php deleted file mode 100644 index b173bcc..0000000 --- a/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper; - -use Symfony\Component\VarDumper\Cloner\Data; - -/** - * DataDumperInterface for dumping Data objects. - * - * @author Nicolas Grekas - */ -interface DataDumperInterface -{ - public function dump(Data $data); -} diff --git a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php deleted file mode 100644 index 6b205a7..0000000 --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ /dev/null @@ -1,1004 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper; - -use Symfony\Component\VarDumper\Cloner\Cursor; -use Symfony\Component\VarDumper\Cloner\Data; - -/** - * HtmlDumper dumps variables as HTML. - * - * @author Nicolas Grekas - */ -class HtmlDumper extends CliDumper -{ - public static $defaultOutput = 'php://output'; - - protected static $themes = [ - 'dark' => [ - 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all', - 'num' => 'font-weight:bold; color:#1299DA', - 'const' => 'font-weight:bold', - 'str' => 'font-weight:bold; color:#56DB3A', - 'note' => 'color:#1299DA', - 'ref' => 'color:#A0A0A0', - 'public' => 'color:#FFFFFF', - 'protected' => 'color:#FFFFFF', - 'private' => 'color:#FFFFFF', - 'meta' => 'color:#B729D9', - 'key' => 'color:#56DB3A', - 'index' => 'color:#1299DA', - 'ellipsis' => 'color:#FF8400', - 'ns' => 'user-select:none;', - ], - 'light' => [ - 'default' => 'background:none; color:#CC7832; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all', - 'num' => 'font-weight:bold; color:#1299DA', - 'const' => 'font-weight:bold', - 'str' => 'font-weight:bold; color:#629755;', - 'note' => 'color:#6897BB', - 'ref' => 'color:#6E6E6E', - 'public' => 'color:#262626', - 'protected' => 'color:#262626', - 'private' => 'color:#262626', - 'meta' => 'color:#B729D9', - 'key' => 'color:#789339', - 'index' => 'color:#1299DA', - 'ellipsis' => 'color:#CC7832', - 'ns' => 'user-select:none;', - ], - ]; - - protected $dumpHeader; - protected $dumpPrefix = '
    ';
    -    protected $dumpSuffix = '
    '; - protected $dumpId = 'sf-dump'; - protected $colors = true; - protected $headerIsDumped = false; - protected $lastDepth = -1; - protected $styles; - - private $displayOptions = [ - 'maxDepth' => 1, - 'maxStringLength' => 160, - 'fileLinkFormat' => null, - ]; - private $extraDisplayOptions = []; - - /** - * {@inheritdoc} - */ - public function __construct($output = null, string $charset = null, int $flags = 0) - { - AbstractDumper::__construct($output, $charset, $flags); - $this->dumpId = 'sf-dump-'.mt_rand(); - $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); - $this->styles = static::$themes['dark'] ?? self::$themes['dark']; - } - - /** - * {@inheritdoc} - */ - public function setStyles(array $styles) - { - $this->headerIsDumped = false; - $this->styles = $styles + $this->styles; - } - - public function setTheme(string $themeName) - { - if (!isset(static::$themes[$themeName])) { - throw new \InvalidArgumentException(sprintf('Theme "%s" does not exist in class "%s".', $themeName, static::class)); - } - - $this->setStyles(static::$themes[$themeName]); - } - - /** - * Configures display options. - * - * @param array $displayOptions A map of display options to customize the behavior - */ - public function setDisplayOptions(array $displayOptions) - { - $this->headerIsDumped = false; - $this->displayOptions = $displayOptions + $this->displayOptions; - } - - /** - * Sets an HTML header that will be dumped once in the output stream. - * - * @param string $header An HTML string - */ - public function setDumpHeader($header) - { - $this->dumpHeader = $header; - } - - /** - * Sets an HTML prefix and suffix that will encapse every single dump. - * - * @param string $prefix The prepended HTML string - * @param string $suffix The appended HTML string - */ - public function setDumpBoundaries($prefix, $suffix) - { - $this->dumpPrefix = $prefix; - $this->dumpSuffix = $suffix; - } - - /** - * {@inheritdoc} - */ - public function dump(Data $data, $output = null, array $extraDisplayOptions = []) - { - $this->extraDisplayOptions = $extraDisplayOptions; - $result = parent::dump($data, $output); - $this->dumpId = 'sf-dump-'.mt_rand(); - - return $result; - } - - /** - * Dumps the HTML header. - */ - protected function getDumpHeader() - { - $this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper; - - if (null !== $this->dumpHeader) { - return $this->dumpHeader; - } - - $line = str_replace('{$options}', json_encode($this->displayOptions, \JSON_FORCE_OBJECT), <<<'EOHTML' -'.$this->dumpHeader; - } - - /** - * {@inheritdoc} - */ - public function dumpString(Cursor $cursor, $str, $bin, $cut) - { - if ('' === $str && isset($cursor->attr['img-data'], $cursor->attr['content-type'])) { - $this->dumpKey($cursor); - $this->line .= $this->style('default', $cursor->attr['img-size'] ?? '', []).' '; - $this->endValue($cursor); - $this->line .= $this->indentPad; - $this->line .= sprintf('', $cursor->attr['content-type'], base64_encode($cursor->attr['img-data'])); - $this->endValue($cursor); - } else { - parent::dumpString($cursor, $str, $bin, $cut); - } - } - - /** - * {@inheritdoc} - */ - public function enterHash(Cursor $cursor, $type, $class, $hasChild) - { - if (Cursor::HASH_OBJECT === $type) { - $cursor->attr['depth'] = $cursor->depth; - } - parent::enterHash($cursor, $type, $class, false); - - if ($cursor->skipChildren) { - $cursor->skipChildren = false; - $eol = ' class=sf-dump-compact>'; - } elseif ($this->expandNextHash) { - $this->expandNextHash = false; - $eol = ' class=sf-dump-expanded>'; - } else { - $eol = '>'; - } - - if ($hasChild) { - $this->line .= 'refIndex) { - $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2; - $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex; - - $this->line .= sprintf(' id=%s-ref%s', $this->dumpId, $r); - } - $this->line .= $eol; - $this->dumpLine($cursor->depth); - } - } - - /** - * {@inheritdoc} - */ - public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut) - { - $this->dumpEllipsis($cursor, $hasChild, $cut); - if ($hasChild) { - $this->line .= ''; - } - parent::leaveHash($cursor, $type, $class, $hasChild, 0); - } - - /** - * {@inheritdoc} - */ - protected function style($style, $value, $attr = []) - { - if ('' === $value) { - return ''; - } - - $v = esc($value); - - if ('ref' === $style) { - if (empty($attr['count'])) { - return sprintf('%s', $v); - } - $r = ('#' !== $v[0] ? 1 - ('@' !== $v[0]) : 2).substr($value, 1); - - return sprintf('%s', $this->dumpId, $r, 1 + $attr['count'], $v); - } - - if ('const' === $style && isset($attr['value'])) { - $style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value']))); - } elseif ('public' === $style) { - $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property'); - } elseif ('str' === $style && 1 < $attr['length']) { - $style .= sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : ''); - } elseif ('note' === $style && 0 < ($attr['depth'] ?? 0) && false !== $c = strrpos($value, '\\')) { - $style .= ' title=""'; - $attr += [ - 'ellipsis' => \strlen($value) - $c, - 'ellipsis-type' => 'note', - 'ellipsis-tail' => 1, - ]; - } elseif ('protected' === $style) { - $style .= ' title="Protected property"'; - } elseif ('meta' === $style && isset($attr['title'])) { - $style .= sprintf(' title="%s"', esc($this->utf8Encode($attr['title']))); - } elseif ('private' === $style) { - $style .= sprintf(' title="Private property defined in class: `%s`"', esc($this->utf8Encode($attr['class']))); - } - $map = static::$controlCharsMap; - - if (isset($attr['ellipsis'])) { - $class = 'sf-dump-ellipsis'; - if (isset($attr['ellipsis-type'])) { - $class = sprintf('"%s sf-dump-ellipsis-%s"', $class, $attr['ellipsis-type']); - } - $label = esc(substr($value, -$attr['ellipsis'])); - $style = str_replace(' title="', " title=\"$v\n", $style); - $v = sprintf('%s', $class, substr($v, 0, -\strlen($label))); - - if (!empty($attr['ellipsis-tail'])) { - $tail = \strlen(esc(substr($value, -$attr['ellipsis'], $attr['ellipsis-tail']))); - $v .= sprintf('%s%s', $class, substr($label, 0, $tail), substr($label, $tail)); - } else { - $v .= $label; - } - } - - $v = "".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) { - $s = $b = ''; - }, $v).''; - - if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) { - $attr['href'] = $href; - } - if (isset($attr['href'])) { - $target = isset($attr['file']) ? '' : ' target="_blank"'; - $v = sprintf('%s', esc($this->utf8Encode($attr['href'])), $target, $v); - } - if (isset($attr['lang'])) { - $v = sprintf('%s', esc($attr['lang']), $v); - } - - return $v; - } - - /** - * {@inheritdoc} - */ - protected function dumpLine($depth, $endOfValue = false) - { - if (-1 === $this->lastDepth) { - $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line; - } - if ($this->headerIsDumped !== (null !== $this->outputStream ? $this->outputStream : $this->lineDumper)) { - $this->line = $this->getDumpHeader().$this->line; - } - - if (-1 === $depth) { - $args = ['"'.$this->dumpId.'"']; - if ($this->extraDisplayOptions) { - $args[] = json_encode($this->extraDisplayOptions, \JSON_FORCE_OBJECT); - } - // Replace is for BC - $this->line .= sprintf(str_replace('"%s"', '%s', $this->dumpSuffix), implode(', ', $args)); - } - $this->lastDepth = $depth; - - $this->line = mb_convert_encoding($this->line, 'HTML-ENTITIES', 'UTF-8'); - - if (-1 === $depth) { - AbstractDumper::dumpLine(0); - } - AbstractDumper::dumpLine($depth); - } - - private function getSourceLink(string $file, int $line) - { - $options = $this->extraDisplayOptions + $this->displayOptions; - - if ($fmt = $options['fileLinkFormat']) { - return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line); - } - - return false; - } -} - -function esc($str) -{ - return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8'); -} diff --git a/vendor/symfony/var-dumper/Dumper/ServerDumper.php b/vendor/symfony/var-dumper/Dumper/ServerDumper.php deleted file mode 100644 index 94795bf..0000000 --- a/vendor/symfony/var-dumper/Dumper/ServerDumper.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Dumper; - -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; -use Symfony\Component\VarDumper\Server\Connection; - -/** - * ServerDumper forwards serialized Data clones to a server. - * - * @author Maxime Steinhausser - */ -class ServerDumper implements DataDumperInterface -{ - private $connection; - private $wrappedDumper; - - /** - * @param string $host The server host - * @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server - * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name - */ - public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = []) - { - $this->connection = new Connection($host, $contextProviders); - $this->wrappedDumper = $wrappedDumper; - } - - public function getContextProviders(): array - { - return $this->connection->getContextProviders(); - } - - /** - * {@inheritdoc} - */ - public function dump(Data $data) - { - if (!$this->connection->write($data) && $this->wrappedDumper) { - $this->wrappedDumper->dump($data); - } - } -} diff --git a/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php b/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php deleted file mode 100644 index 122f0d3..0000000 --- a/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Exception; - -/** - * @author Nicolas Grekas - */ -class ThrowingCasterException extends \Exception -{ - /** - * @param \Throwable $prev The exception thrown from the caster - */ - public function __construct(\Throwable $prev) - { - parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev); - } -} diff --git a/vendor/symfony/var-dumper/LICENSE b/vendor/symfony/var-dumper/LICENSE deleted file mode 100644 index c1f0aac..0000000 --- a/vendor/symfony/var-dumper/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/var-dumper/README.md b/vendor/symfony/var-dumper/README.md deleted file mode 100644 index 339f73e..0000000 --- a/vendor/symfony/var-dumper/README.md +++ /dev/null @@ -1,15 +0,0 @@ -VarDumper Component -=================== - -The VarDumper component provides mechanisms for walking through any arbitrary -PHP variable. It provides a better `dump()` function that you can use instead -of `var_dump`. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/var-dumper/Resources/bin/var-dump-server b/vendor/symfony/var-dumper/Resources/bin/var-dump-server deleted file mode 100644 index 98c813a..0000000 --- a/vendor/symfony/var-dumper/Resources/bin/var-dump-server +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Starts a dump server to collect and output dumps on a single place with multiple formats support. - * - * @author Maxime Steinhausser - */ - -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Logger\ConsoleLogger; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\VarDumper\Command\ServerDumpCommand; -use Symfony\Component\VarDumper\Server\DumpServer; - -function includeIfExists(string $file): bool -{ - return file_exists($file) && include $file; -} - -if ( - !includeIfExists(__DIR__ . '/../../../../autoload.php') && - !includeIfExists(__DIR__ . '/../../vendor/autoload.php') && - !includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php') -) { - fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL); - exit(1); -} - -if (!class_exists(Application::class)) { - fwrite(STDERR, 'You need the "symfony/console" component in order to run the VarDumper server.'.PHP_EOL); - exit(1); -} - -$input = new ArgvInput(); -$output = new ConsoleOutput(); -$defaultHost = '127.0.0.1:9912'; -$host = $input->getParameterOption(['--host'], $_SERVER['VAR_DUMPER_SERVER'] ?? $defaultHost, true); -$logger = interface_exists(LoggerInterface::class) ? new ConsoleLogger($output->getErrorOutput()) : null; - -$app = new Application(); - -$app->getDefinition()->addOption( - new InputOption('--host', null, InputOption::VALUE_REQUIRED, 'The address the server should listen to', $defaultHost) -); - -$app->add($command = new ServerDumpCommand(new DumpServer($host, $logger))) - ->getApplication() - ->setDefaultCommand($command->getName(), true) - ->run($input, $output) -; diff --git a/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css b/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css deleted file mode 100644 index 8f706d6..0000000 --- a/vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css +++ /dev/null @@ -1,130 +0,0 @@ -body { - display: flex; - flex-direction: column-reverse; - justify-content: flex-end; - max-width: 1140px; - margin: auto; - padding: 15px; - word-wrap: break-word; - background-color: #F9F9F9; - color: #222; - font-family: Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.4; -} -p { - margin: 0; -} -a { - color: #218BC3; - text-decoration: none; -} -a:hover { - text-decoration: underline; -} -.text-small { - font-size: 12px !important; -} -article { - margin: 5px; - margin-bottom: 10px; -} -article > header > .row { - display: flex; - flex-direction: row; - align-items: baseline; - margin-bottom: 10px; -} -article > header > .row > .col { - flex: 1; - display: flex; - align-items: baseline; -} -article > header > .row > h2 { - font-size: 14px; - color: #222; - font-weight: normal; - font-family: "Lucida Console", monospace, sans-serif; - word-break: break-all; - margin: 20px 5px 0 0; - user-select: all; -} -article > header > .row > h2 > code { - white-space: nowrap; - user-select: none; - color: #cc2255; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; - border-radius: 3px; - margin-right: 5px; - padding: 0 3px; -} -article > header > .row > time.col { - flex: 0; - text-align: right; - white-space: nowrap; - color: #999; - font-style: italic; -} -article > header ul.tags { - list-style: none; - padding: 0; - margin: 0; - font-size: 12px; -} -article > header ul.tags > li { - user-select: all; - margin-bottom: 2px; -} -article > header ul.tags > li > span.badge { - display: inline-block; - padding: .25em .4em; - margin-right: 5px; - border-radius: 4px; - background-color: #6c757d3b; - color: #524d4d; - font-size: 12px; - text-align: center; - font-weight: 700; - line-height: 1; - white-space: nowrap; - vertical-align: baseline; - user-select: none; -} -article > section.body { - border: 1px solid #d8d8d8; - background: #FFF; - padding: 10px; - border-radius: 3px; -} -pre.sf-dump { - border-radius: 3px; - margin-bottom: 0; -} -.hidden { - display: none !important; -} -.dumped-tag > .sf-dump { - display: inline-block; - margin: 0; - padding: 1px 5px; - line-height: 1.4; - vertical-align: top; - background-color: transparent; - user-select: auto; -} -.dumped-tag > pre.sf-dump, -.dumped-tag > .sf-dump-default { - color: #CC7832; - background: none; -} -.dumped-tag > .sf-dump .sf-dump-str { color: #629755; } -.dumped-tag > .sf-dump .sf-dump-private, -.dumped-tag > .sf-dump .sf-dump-protected, -.dumped-tag > .sf-dump .sf-dump-public { color: #262626; } -.dumped-tag > .sf-dump .sf-dump-note { color: #6897BB; } -.dumped-tag > .sf-dump .sf-dump-key { color: #789339; } -.dumped-tag > .sf-dump .sf-dump-ref { color: #6E6E6E; } -.dumped-tag > .sf-dump .sf-dump-ellipsis { color: #CC7832; max-width: 100em; } -.dumped-tag > .sf-dump .sf-dump-ellipsis-path { max-width: 5em; } -.dumped-tag > .sf-dump .sf-dump-ns { user-select: none; } diff --git a/vendor/symfony/var-dumper/Resources/functions/dump.php b/vendor/symfony/var-dumper/Resources/functions/dump.php deleted file mode 100644 index a485d57..0000000 --- a/vendor/symfony/var-dumper/Resources/functions/dump.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Component\VarDumper\VarDumper; - -if (!function_exists('dump')) { - /** - * @author Nicolas Grekas - */ - function dump($var, ...$moreVars) - { - VarDumper::dump($var); - - foreach ($moreVars as $v) { - VarDumper::dump($v); - } - - if (1 < func_num_args()) { - return func_get_args(); - } - - return $var; - } -} - -if (!function_exists('dd')) { - function dd(...$vars) - { - foreach ($vars as $v) { - VarDumper::dump($v); - } - - exit(1); - } -} diff --git a/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js b/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js deleted file mode 100644 index 63101e5..0000000 --- a/vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js +++ /dev/null @@ -1,10 +0,0 @@ -document.addEventListener('DOMContentLoaded', function() { - let prev = null; - Array.from(document.getElementsByTagName('article')).reverse().forEach(function (article) { - const dedupId = article.dataset.dedupId; - if (dedupId === prev) { - article.getElementsByTagName('header')[0].classList.add('hidden'); - } - prev = dedupId; - }); -}); diff --git a/vendor/symfony/var-dumper/Server/Connection.php b/vendor/symfony/var-dumper/Server/Connection.php deleted file mode 100644 index d8be235..0000000 --- a/vendor/symfony/var-dumper/Server/Connection.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Server; - -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; - -/** - * Forwards serialized Data clones to a server. - * - * @author Maxime Steinhausser - */ -class Connection -{ - private $host; - private $contextProviders; - private $socket; - - /** - * @param string $host The server host - * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name - */ - public function __construct(string $host, array $contextProviders = []) - { - if (false === strpos($host, '://')) { - $host = 'tcp://'.$host; - } - - $this->host = $host; - $this->contextProviders = $contextProviders; - } - - public function getContextProviders(): array - { - return $this->contextProviders; - } - - public function write(Data $data): bool - { - $socketIsFresh = !$this->socket; - if (!$this->socket = $this->socket ?: $this->createSocket()) { - return false; - } - - $context = ['timestamp' => microtime(true)]; - foreach ($this->contextProviders as $name => $provider) { - $context[$name] = $provider->getContext(); - } - $context = array_filter($context); - $encodedPayload = base64_encode(serialize([$data, $context]))."\n"; - - set_error_handler([self::class, 'nullErrorHandler']); - try { - if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { - return true; - } - if (!$socketIsFresh) { - stream_socket_shutdown($this->socket, \STREAM_SHUT_RDWR); - fclose($this->socket); - $this->socket = $this->createSocket(); - } - if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { - return true; - } - } finally { - restore_error_handler(); - } - - return false; - } - - private static function nullErrorHandler($t, $m) - { - // no-op - } - - private function createSocket() - { - set_error_handler([self::class, 'nullErrorHandler']); - try { - return stream_socket_client($this->host, $errno, $errstr, 3, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); - } finally { - restore_error_handler(); - } - } -} diff --git a/vendor/symfony/var-dumper/Server/DumpServer.php b/vendor/symfony/var-dumper/Server/DumpServer.php deleted file mode 100644 index 55510c0..0000000 --- a/vendor/symfony/var-dumper/Server/DumpServer.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Server; - -use Psr\Log\LoggerInterface; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * A server collecting Data clones sent by a ServerDumper. - * - * @author Maxime Steinhausser - * - * @final - */ -class DumpServer -{ - private $host; - private $socket; - private $logger; - - public function __construct(string $host, LoggerInterface $logger = null) - { - if (false === strpos($host, '://')) { - $host = 'tcp://'.$host; - } - - $this->host = $host; - $this->logger = $logger; - } - - public function start(): void - { - if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) { - throw new \RuntimeException(sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno); - } - } - - public function listen(callable $callback): void - { - if (null === $this->socket) { - $this->start(); - } - - foreach ($this->getMessages() as $clientId => $message) { - $payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]); - - // Impossible to decode the message, give up. - if (false === $payload) { - if ($this->logger) { - $this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]); - } - - continue; - } - - if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) { - if ($this->logger) { - $this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]); - } - - continue; - } - - [$data, $context] = $payload; - - $callback($data, $context, $clientId); - } - } - - public function getHost(): string - { - return $this->host; - } - - private function getMessages(): iterable - { - $sockets = [(int) $this->socket => $this->socket]; - $write = []; - - while (true) { - $read = $sockets; - stream_select($read, $write, $write, null); - - foreach ($read as $stream) { - if ($this->socket === $stream) { - $stream = stream_socket_accept($this->socket); - $sockets[(int) $stream] = $stream; - } elseif (feof($stream)) { - unset($sockets[(int) $stream]); - fclose($stream); - } else { - yield (int) $stream => fgets($stream); - } - } - } - } -} diff --git a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php b/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php deleted file mode 100644 index 3d3d18e..0000000 --- a/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper\Test; - -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Nicolas Grekas - */ -trait VarDumperTestTrait -{ - /** - * @internal - */ - private $varDumperConfig = [ - 'casters' => [], - 'flags' => null, - ]; - - protected function setUpVarDumper(array $casters, int $flags = null): void - { - $this->varDumperConfig['casters'] = $casters; - $this->varDumperConfig['flags'] = $flags; - } - - /** - * @after - */ - protected function tearDownVarDumper(): void - { - $this->varDumperConfig['casters'] = []; - $this->varDumperConfig['flags'] = null; - } - - public function assertDumpEquals($expected, $data, $filter = 0, $message = '') - { - $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); - } - - public function assertDumpMatchesFormat($expected, $data, $filter = 0, $message = '') - { - $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); - } - - /** - * @return string|null - */ - protected function getDump($data, $key = null, $filter = 0) - { - if (null === $flags = $this->varDumperConfig['flags']) { - $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; - $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; - $flags |= getenv('DUMP_COMMA_SEPARATOR') ? CliDumper::DUMP_COMMA_SEPARATOR : 0; - } - - $cloner = new VarCloner(); - $cloner->addCasters($this->varDumperConfig['casters']); - $cloner->setMaxItems(-1); - $dumper = new CliDumper(null, null, $flags); - $dumper->setColors(false); - $data = $cloner->cloneVar($data, $filter)->withRefHandles(false); - if (null !== $key && null === $data = $data->seek($key)) { - return null; - } - - return rtrim($dumper->dump($data, true)); - } - - private function prepareExpectation($expected, int $filter): string - { - if (!\is_string($expected)) { - $expected = $this->getDump($expected, null, $filter); - } - - return rtrim($expected); - } -} diff --git a/vendor/symfony/var-dumper/VarDumper.php b/vendor/symfony/var-dumper/VarDumper.php deleted file mode 100644 index febc1e0..0000000 --- a/vendor/symfony/var-dumper/VarDumper.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\VarDumper; - -use Symfony\Component\VarDumper\Caster\ReflectionCaster; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; -use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; -use Symfony\Component\VarDumper\Dumper\ContextualizedDumper; -use Symfony\Component\VarDumper\Dumper\HtmlDumper; - -// Load the global dump() function -require_once __DIR__.'/Resources/functions/dump.php'; - -/** - * @author Nicolas Grekas - */ -class VarDumper -{ - private static $handler; - - public static function dump($var) - { - if (null === self::$handler) { - $cloner = new VarCloner(); - $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); - - if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { - $dumper = 'html' === $_SERVER['VAR_DUMPER_FORMAT'] ? new HtmlDumper() : new CliDumper(); - } else { - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper() : new HtmlDumper(); - } - - $dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]); - - self::$handler = function ($var) use ($cloner, $dumper) { - $dumper->dump($cloner->cloneVar($var)); - }; - } - - return (self::$handler)($var); - } - - public static function setHandler(callable $callable = null) - { - $prevHandler = self::$handler; - - // Prevent replacing the handler with expected format as soon as the env var was set: - if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { - return $prevHandler; - } - - self::$handler = $callable; - - return $prevHandler; - } -} diff --git a/vendor/symfony/var-dumper/composer.json b/vendor/symfony/var-dumper/composer.json deleted file mode 100644 index 642ee62..0000000 --- a/vendor/symfony/var-dumper/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "symfony/var-dumper", - "type": "library", - "description": "Provides mechanisms for walking through any arbitrary PHP variable", - "keywords": ["dump", "debug"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php72": "~1.5", - "symfony/polyfill-php80": "^1.15" - }, - "require-dev": { - "ext-iconv": "*", - "symfony/console": "^3.4|^4.0|^5.0", - "symfony/process": "^4.4|^5.0", - "twig/twig": "^1.43|^2.13|^3.0.4" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", - "symfony/console": "<3.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, - "autoload": { - "files": [ "Resources/functions/dump.php" ], - "psr-4": { "Symfony\\Component\\VarDumper\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "bin": [ - "Resources/bin/var-dump-server" - ], - "minimum-stability": "dev" -} diff --git a/vendor/symfony/yaml/CHANGELOG.md b/vendor/symfony/yaml/CHANGELOG.md deleted file mode 100644 index d4f2b5d..0000000 --- a/vendor/symfony/yaml/CHANGELOG.md +++ /dev/null @@ -1,224 +0,0 @@ -CHANGELOG -========= - -5.1.0 ------ - - * Added support for parsing numbers prefixed with `0o` as octal numbers. - * Deprecated support for parsing numbers starting with `0` as octal numbers. They will be parsed as strings as of Symfony 6.0. Prefix numbers with `0o` - so that they are parsed as octal numbers. - - Before: - - ```yaml - Yaml::parse('072'); - ``` - - After: - - ```yaml - Yaml::parse('0o72'); - ``` - - * Added `yaml-lint` binary. - * Deprecated using the `!php/object` and `!php/const` tags without a value. - -5.0.0 ------ - - * Removed support for mappings inside multi-line strings. - * removed support for implicit STDIN usage in the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. - -4.4.0 ------ - - * Added support for parsing the inline notation spanning multiple lines. - * Added support to dump `null` as `~` by using the `Yaml::DUMP_NULL_AS_TILDE` flag. - * deprecated accepting STDIN implicitly when using the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. - -4.3.0 ------ - - * Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0. - -4.2.0 ------ - - * added support for multiple files or directories in `LintCommand` - -4.0.0 ------ - - * The behavior of the non-specific tag `!` is changed and now forces - non-evaluating your values. - * complex mappings will throw a `ParseException` - * support for the comma as a group separator for floats has been dropped, use - the underscore instead - * support for the `!!php/object` tag has been dropped, use the `!php/object` - tag instead - * duplicate mapping keys throw a `ParseException` - * non-string mapping keys throw a `ParseException`, use the `Yaml::PARSE_KEYS_AS_STRINGS` - flag to cast them to strings - * `%` at the beginning of an unquoted string throw a `ParseException` - * mappings with a colon (`:`) that is not followed by a whitespace throw a - `ParseException` - * the `Dumper::setIndentation()` method has been removed - * being able to pass boolean options to the `Yaml::parse()`, `Yaml::dump()`, - `Parser::parse()`, and `Dumper::dump()` methods to configure the behavior of - the parser and dumper is no longer supported, pass bitmask flags instead - * the constructor arguments of the `Parser` class have been removed - * the `Inline` class is internal and no longer part of the BC promise - * removed support for the `!str` tag, use the `!!str` tag instead - * added support for tagged scalars. - - ```yml - Yaml::parse('!foo bar', Yaml::PARSE_CUSTOM_TAGS); - // returns TaggedValue('foo', 'bar'); - ``` - -3.4.0 ------ - - * added support for parsing YAML files using the `Yaml::parseFile()` or `Parser::parseFile()` method - - * the `Dumper`, `Parser`, and `Yaml` classes are marked as final - - * Deprecated the `!php/object:` tag which will be replaced by the - `!php/object` tag (without the colon) in 4.0. - - * Deprecated the `!php/const:` tag which will be replaced by the - `!php/const` tag (without the colon) in 4.0. - - * Support for the `!str` tag is deprecated, use the `!!str` tag instead. - - * Deprecated using the non-specific tag `!` as its behavior will change in 4.0. - It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead. - -3.3.0 ------ - - * Starting an unquoted string with a question mark followed by a space is - deprecated and will throw a `ParseException` in Symfony 4.0. - - * Deprecated support for implicitly parsing non-string mapping keys as strings. - Mapping keys that are no strings will lead to a `ParseException` in Symfony - 4.0. Use quotes to opt-in for keys to be parsed as strings. - - Before: - - ```php - $yaml = << new A(), 'bar' => 1], 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT); - ``` - -3.0.0 ------ - - * Yaml::parse() now throws an exception when a blackslash is not escaped - in double-quoted strings - -2.8.0 ------ - - * Deprecated usage of a colon in an unquoted mapping value - * Deprecated usage of @, \`, | and > at the beginning of an unquoted string - * When surrounding strings with double-quotes, you must now escape `\` characters. Not - escaping those characters (when surrounded by double-quotes) is deprecated. - - Before: - - ```yml - class: "Foo\Var" - ``` - - After: - - ```yml - class: "Foo\\Var" - ``` - -2.1.0 ------ - - * Yaml::parse() does not evaluate loaded files as PHP files by default - anymore (call Yaml::enablePhpParsing() to get back the old behavior) diff --git a/vendor/symfony/yaml/Command/LintCommand.php b/vendor/symfony/yaml/Command/LintCommand.php deleted file mode 100644 index 83f36a9..0000000 --- a/vendor/symfony/yaml/Command/LintCommand.php +++ /dev/null @@ -1,248 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Command; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Parser; -use Symfony\Component\Yaml\Yaml; - -/** - * Validates YAML files syntax and outputs encountered errors. - * - * @author Grégoire Pineau - * @author Robin Chalas - */ -class LintCommand extends Command -{ - protected static $defaultName = 'lint:yaml'; - - private $parser; - private $format; - private $displayCorrectFiles; - private $directoryIteratorProvider; - private $isReadableProvider; - - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) - { - parent::__construct($name); - - $this->directoryIteratorProvider = $directoryIteratorProvider; - $this->isReadableProvider = $isReadableProvider; - } - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setDescription('Lints a file and outputs encountered errors') - ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') - ->addOption('parse-tags', null, InputOption::VALUE_NONE, 'Parse custom tags') - ->setHelp(<<%command.name% command lints a YAML file and outputs to STDOUT -the first encountered syntax error. - -You can validates YAML contents passed from STDIN: - - cat filename | php %command.full_name% - - -You can also validate the syntax of a file: - - php %command.full_name% filename - -Or of a whole directory: - - php %command.full_name% dirname - php %command.full_name% dirname --format=json - -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new SymfonyStyle($input, $output); - $filenames = (array) $input->getArgument('filename'); - $this->format = $input->getOption('format'); - $this->displayCorrectFiles = $output->isVerbose(); - $flags = $input->getOption('parse-tags') ? Yaml::PARSE_CUSTOM_TAGS : 0; - - if (['-'] === $filenames) { - return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]); - } - - if (!$filenames) { - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - - $filesInfo = []; - foreach ($filenames as $filename) { - if (!$this->isReadable($filename)) { - throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename)); - } - - foreach ($this->getFiles($filename) as $file) { - $filesInfo[] = $this->validate(file_get_contents($file), $flags, $file); - } - } - - return $this->display($io, $filesInfo); - } - - private function validate(string $content, int $flags, string $file = null) - { - $prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) { - if (\E_USER_DEPRECATED === $level) { - throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1); - } - - return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : false; - }); - - try { - $this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags); - } catch (ParseException $e) { - return ['file' => $file, 'line' => $e->getParsedLine(), 'valid' => false, 'message' => $e->getMessage()]; - } finally { - restore_error_handler(); - } - - return ['file' => $file, 'valid' => true]; - } - - private function display(SymfonyStyle $io, array $files): int - { - switch ($this->format) { - case 'txt': - return $this->displayTxt($io, $files); - case 'json': - return $this->displayJson($io, $files); - default: - throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); - } - } - - private function displayTxt(SymfonyStyle $io, array $filesInfo): int - { - $countFiles = \count($filesInfo); - $erroredFiles = 0; - $suggestTagOption = false; - - foreach ($filesInfo as $info) { - if ($info['valid'] && $this->displayCorrectFiles) { - $io->comment('OK'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - } elseif (!$info['valid']) { - ++$erroredFiles; - $io->text(' ERROR '.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->text(sprintf(' >> %s', $info['message'])); - - if (false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) { - $suggestTagOption = true; - } - } - } - - if (0 === $erroredFiles) { - $io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles)); - } else { - $io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : '')); - } - - return min($erroredFiles, 1); - } - - private function displayJson(SymfonyStyle $io, array $filesInfo): int - { - $errors = 0; - - array_walk($filesInfo, function (&$v) use (&$errors) { - $v['file'] = (string) $v['file']; - if (!$v['valid']) { - ++$errors; - } - - if (isset($v['message']) && false !== strpos($v['message'], 'PARSE_CUSTOM_TAGS')) { - $v['message'] .= ' Use the --parse-tags option if you want parse custom tags.'; - } - }); - - $io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); - - return min($errors, 1); - } - - private function getFiles(string $fileOrDirectory): iterable - { - if (is_file($fileOrDirectory)) { - yield new \SplFileInfo($fileOrDirectory); - - return; - } - - foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) { - if (!\in_array($file->getExtension(), ['yml', 'yaml'])) { - continue; - } - - yield $file; - } - } - - private function getParser(): Parser - { - if (!$this->parser) { - $this->parser = new Parser(); - } - - return $this->parser; - } - - private function getDirectoryIterator(string $directory): iterable - { - $default = function ($directory) { - return new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - }; - - if (null !== $this->directoryIteratorProvider) { - return ($this->directoryIteratorProvider)($directory, $default); - } - - return $default($directory); - } - - private function isReadable(string $fileOrDirectory): bool - { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; - - if (null !== $this->isReadableProvider) { - return ($this->isReadableProvider)($fileOrDirectory, $default); - } - - return $default($fileOrDirectory); - } -} diff --git a/vendor/symfony/yaml/Dumper.php b/vendor/symfony/yaml/Dumper.php deleted file mode 100644 index dcb104c..0000000 --- a/vendor/symfony/yaml/Dumper.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Dumper dumps PHP variables to YAML strings. - * - * @author Fabien Potencier - * - * @final - */ -class Dumper -{ - /** - * The amount of spaces to use for indentation of nested nodes. - * - * @var int - */ - protected $indentation; - - public function __construct(int $indentation = 4) - { - if ($indentation < 1) { - throw new \InvalidArgumentException('The indentation must be greater than zero.'); - } - - $this->indentation = $indentation; - } - - /** - * Dumps a PHP value to YAML. - * - * @param mixed $input The PHP value - * @param int $inline The level where you switch to inline YAML - * @param int $indent The level of indentation (used internally) - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - * - * @return string The YAML representation of the PHP value - */ - public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string - { - $output = ''; - $prefix = $indent ? str_repeat(' ', $indent) : ''; - $dumpObjectAsInlineMap = true; - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) { - $dumpObjectAsInlineMap = empty((array) $input); - } - - if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) { - $output .= $prefix.Inline::dump($input, $flags); - } else { - $dumpAsMap = Inline::isHash($input); - - foreach ($input as $key => $value) { - if ('' !== $output && "\n" !== $output[-1]) { - $output .= "\n"; - } - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && false !== strpos($value, "\n") && false === strpos($value, "\r")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value, 0, 1)) ? (string) $this->indentation : ''; - - if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) { - $blockChompingIndicator = '+'; - } elseif ("\n" === $value[-1]) { - $blockChompingIndicator = ''; - } else { - $blockChompingIndicator = '-'; - } - - $output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator); - - foreach (explode("\n", $value) as $row) { - if ('' === $row) { - $output .= "\n"; - } else { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - } - - continue; - } - - if ($value instanceof TaggedValue) { - $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag()); - - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : ''; - $output .= sprintf(' |%s', $blockIndentationIndicator); - - foreach (explode("\n", $value->getValue()) as $row) { - $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); - } - - continue; - } - - if ($inline - 1 <= 0 || null === $value->getValue() || is_scalar($value->getValue())) { - $output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; - } else { - $output .= "\n"; - $output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags); - } - - continue; - } - - $dumpObjectAsInlineMap = true; - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) { - $dumpObjectAsInlineMap = empty((array) $value); - } - - $willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value); - - $output .= sprintf('%s%s%s%s', - $prefix, - $dumpAsMap ? Inline::dump($key, $flags).':' : '-', - $willBeInlined ? ' ' : "\n", - $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags) - ).($willBeInlined ? "\n" : ''); - } - } - - return $output; - } -} diff --git a/vendor/symfony/yaml/Escaper.php b/vendor/symfony/yaml/Escaper.php deleted file mode 100644 index 9b809df..0000000 --- a/vendor/symfony/yaml/Escaper.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -/** - * Escaper encapsulates escaping rules for single and double-quoted - * YAML strings. - * - * @author Matthew Lewinski - * - * @internal - */ -class Escaper -{ - // Characters that would cause a dumped string to require double quoting. - public const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; - - // Mapping arrays for escaping a double quoted string. The backslash is - // first to ensure proper escaping because str_replace operates iteratively - // on the input arrays. This ordering of the characters avoids the use of strtr, - // which performs more slowly. - private const ESCAPEES = ['\\', '\\\\', '\\"', '"', - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", - "\x7f", - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", - ]; - private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"', - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', - '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', - '\\x7f', - '\\N', '\\_', '\\L', '\\P', - ]; - - /** - * Determines if a PHP value would require double quoting in YAML. - * - * @param string $value A PHP value - * - * @return bool True if the value would require double quotes - */ - public static function requiresDoubleQuoting(string $value): bool - { - return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); - } - - /** - * Escapes and surrounds a PHP value with double quotes. - * - * @param string $value A PHP value - * - * @return string The quoted, escaped string - */ - public static function escapeWithDoubleQuotes(string $value): string - { - return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value)); - } - - /** - * Determines if a PHP value would require single quoting in YAML. - * - * @param string $value A PHP value - * - * @return bool True if the value would require single quotes - */ - public static function requiresSingleQuoting(string $value): bool - { - // Determines if a PHP value is entirely composed of a value that would - // require single quoting in YAML. - if (\in_array(strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'])) { - return true; - } - - // Determines if the PHP value contains any single characters that would - // cause it to require single quoting in YAML. - return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value); - } - - /** - * Escapes and surrounds a PHP value with single quotes. - * - * @param string $value A PHP value - * - * @return string The quoted, escaped string - */ - public static function escapeWithSingleQuotes(string $value): string - { - return sprintf("'%s'", str_replace('\'', '\'\'', $value)); - } -} diff --git a/vendor/symfony/yaml/Exception/DumpException.php b/vendor/symfony/yaml/Exception/DumpException.php deleted file mode 100644 index cce972f..0000000 --- a/vendor/symfony/yaml/Exception/DumpException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during dumping. - * - * @author Fabien Potencier - */ -class DumpException extends RuntimeException -{ -} diff --git a/vendor/symfony/yaml/Exception/ExceptionInterface.php b/vendor/symfony/yaml/Exception/ExceptionInterface.php deleted file mode 100644 index 9091316..0000000 --- a/vendor/symfony/yaml/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception interface for all exceptions thrown by the component. - * - * @author Fabien Potencier - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/yaml/Exception/ParseException.php b/vendor/symfony/yaml/Exception/ParseException.php deleted file mode 100644 index 6d441e7..0000000 --- a/vendor/symfony/yaml/Exception/ParseException.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during parsing. - * - * @author Fabien Potencier - */ -class ParseException extends RuntimeException -{ - private $parsedFile; - private $parsedLine; - private $snippet; - private $rawMessage; - - /** - * @param string $message The error message - * @param int $parsedLine The line where the error occurred - * @param string|null $snippet The snippet of code near the problem - * @param string|null $parsedFile The file name where the error occurred - */ - public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null) - { - $this->parsedFile = $parsedFile; - $this->parsedLine = $parsedLine; - $this->snippet = $snippet; - $this->rawMessage = $message; - - $this->updateRepr(); - - parent::__construct($this->message, 0, $previous); - } - - /** - * Gets the snippet of code near the error. - * - * @return string The snippet of code - */ - public function getSnippet() - { - return $this->snippet; - } - - /** - * Sets the snippet of code near the error. - */ - public function setSnippet(string $snippet) - { - $this->snippet = $snippet; - - $this->updateRepr(); - } - - /** - * Gets the filename where the error occurred. - * - * This method returns null if a string is parsed. - * - * @return string The filename - */ - public function getParsedFile() - { - return $this->parsedFile; - } - - /** - * Sets the filename where the error occurred. - */ - public function setParsedFile(string $parsedFile) - { - $this->parsedFile = $parsedFile; - - $this->updateRepr(); - } - - /** - * Gets the line where the error occurred. - * - * @return int The file line - */ - public function getParsedLine() - { - return $this->parsedLine; - } - - /** - * Sets the line where the error occurred. - */ - public function setParsedLine(int $parsedLine) - { - $this->parsedLine = $parsedLine; - - $this->updateRepr(); - } - - private function updateRepr() - { - $this->message = $this->rawMessage; - - $dot = false; - if ('.' === substr($this->message, -1)) { - $this->message = substr($this->message, 0, -1); - $dot = true; - } - - if (null !== $this->parsedFile) { - $this->message .= sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - if ($this->parsedLine >= 0) { - $this->message .= sprintf(' at line %d', $this->parsedLine); - } - - if ($this->snippet) { - $this->message .= sprintf(' (near "%s")', $this->snippet); - } - - if ($dot) { - $this->message .= '.'; - } - } -} diff --git a/vendor/symfony/yaml/Exception/RuntimeException.php b/vendor/symfony/yaml/Exception/RuntimeException.php deleted file mode 100644 index 3f36b73..0000000 --- a/vendor/symfony/yaml/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Exception; - -/** - * Exception class thrown when an error occurs during parsing. - * - * @author Romain Neutron - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php deleted file mode 100644 index fe10287..0000000 --- a/vendor/symfony/yaml/Inline.php +++ /dev/null @@ -1,794 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\DumpException; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Inline implements a YAML parser/dumper for the YAML inline syntax. - * - * @author Fabien Potencier - * - * @internal - */ -class Inline -{ - public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'; - - public static $parsedLineNumber = -1; - public static $parsedFilename; - - private static $exceptionOnInvalidType = false; - private static $objectSupport = false; - private static $objectForMap = false; - private static $constantSupport = false; - - public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null) - { - self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags); - self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags); - self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags); - self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags); - self::$parsedFilename = $parsedFilename; - - if (null !== $parsedLineNumber) { - self::$parsedLineNumber = $parsedLineNumber; - } - } - - /** - * Converts a YAML string to a PHP value. - * - * @param string $value A YAML string - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * @param array $references Mapping of variable names to values - * - * @return mixed A PHP value - * - * @throws ParseException - */ - public static function parse(string $value = null, int $flags = 0, array $references = []) - { - self::initialize($flags); - - $value = trim($value); - - if ('' === $value) { - return ''; - } - - if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } - - try { - $i = 0; - $tag = self::parseTag($value, $i, $flags); - switch ($value[$i]) { - case '[': - $result = self::parseSequence($value, $flags, $i, $references); - ++$i; - break; - case '{': - $result = self::parseMapping($value, $flags, $i, $references); - ++$i; - break; - default: - $result = self::parseScalar($value, $flags, null, $i, null === $tag, $references); - } - - // some comments are allowed at the end - if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) { - throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if (null !== $tag && '' !== $tag) { - return new TaggedValue($tag, $result); - } - - return $result; - } finally { - if (isset($mbEncoding)) { - mb_internal_encoding($mbEncoding); - } - } - } - - /** - * Dumps a given PHP variable to a YAML string. - * - * @param mixed $value The PHP variable to convert - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - * - * @return string The YAML string representing the PHP value - * - * @throws DumpException When trying to dump PHP resource - */ - public static function dump($value, int $flags = 0): string - { - switch (true) { - case \is_resource($value): - if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { - throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); - } - - return self::dumpNull($flags); - case $value instanceof \DateTimeInterface: - return $value->format('c'); - case \is_object($value): - if ($value instanceof TaggedValue) { - return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags); - } - - if (Yaml::DUMP_OBJECT & $flags) { - return '!php/object '.self::dump(serialize($value)); - } - - if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { - $output = []; - - foreach ($value as $key => $val) { - $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); - } - - return sprintf('{ %s }', implode(', ', $output)); - } - - if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { - throw new DumpException('Object support when dumping a YAML file has been disabled.'); - } - - return self::dumpNull($flags); - case \is_array($value): - return self::dumpArray($value, $flags); - case null === $value: - return self::dumpNull($flags); - case true === $value: - return 'true'; - case false === $value: - return 'false'; - case ctype_digit($value): - return \is_string($value) ? "'$value'" : (int) $value; - case is_numeric($value) && false === strpos($value, "\f") && false === strpos($value, "\n") && false === strpos($value, "\r") && false === strpos($value, "\t") && false === strpos($value, "\v"): - $locale = setlocale(\LC_NUMERIC, 0); - if (false !== $locale) { - setlocale(\LC_NUMERIC, 'C'); - } - if (\is_float($value)) { - $repr = (string) $value; - if (is_infinite($value)) { - $repr = str_ireplace('INF', '.Inf', $repr); - } elseif (floor($value) == $value && $repr == $value) { - // Preserve float data type since storing a whole number will result in integer value. - $repr = '!!float '.$repr; - } - } else { - $repr = \is_string($value) ? "'$value'" : (string) $value; - } - if (false !== $locale) { - setlocale(\LC_NUMERIC, $locale); - } - - return $repr; - case '' == $value: - return "''"; - case self::isBinaryString($value): - return '!!binary '.base64_encode($value); - case Escaper::requiresDoubleQuoting($value): - return Escaper::escapeWithDoubleQuotes($value); - case Escaper::requiresSingleQuoting($value): - case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value): - case Parser::preg_match(self::getHexRegex(), $value): - case Parser::preg_match(self::getTimestampRegex(), $value): - return Escaper::escapeWithSingleQuotes($value); - default: - return $value; - } - } - - /** - * Check if given array is hash or just normal indexed array. - * - * @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check - * - * @return bool true if value is hash array, false otherwise - */ - public static function isHash($value): bool - { - if ($value instanceof \stdClass || $value instanceof \ArrayObject) { - return true; - } - - $expectedKey = 0; - - foreach ($value as $key => $val) { - if ($key !== $expectedKey++) { - return true; - } - } - - return false; - } - - /** - * Dumps a PHP array to a YAML string. - * - * @param array $value The PHP array to dump - * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string - * - * @return string The YAML string representing the PHP array - */ - private static function dumpArray(array $value, int $flags): string - { - // array - if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) { - $output = []; - foreach ($value as $val) { - $output[] = self::dump($val, $flags); - } - - return sprintf('[%s]', implode(', ', $output)); - } - - // hash - $output = []; - foreach ($value as $key => $val) { - $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); - } - - return sprintf('{ %s }', implode(', ', $output)); - } - - private static function dumpNull(int $flags): string - { - if (Yaml::DUMP_NULL_AS_TILDE & $flags) { - return '~'; - } - - return 'null'; - } - - /** - * Parses a YAML scalar. - * - * @return mixed - * - * @throws ParseException When malformed inline YAML string is parsed - */ - public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array $references = []) - { - if (\in_array($scalar[$i], ['"', "'"], true)) { - // quoted scalar - $output = self::parseQuotedScalar($scalar, $i); - - if (null !== $delimiters) { - $tmp = ltrim(substr($scalar, $i), " \n"); - if ('' === $tmp) { - throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - if (!\in_array($tmp[0], $delimiters)) { - throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - } - } else { - // "normal" string - if (!$delimiters) { - $output = substr($scalar, $i); - $i += \strlen($output); - - // remove comments - if (Parser::preg_match('/[ \t]+#/', $output, $match, \PREG_OFFSET_CAPTURE)) { - $output = substr($output, 0, $match[0][1]); - } - } elseif (Parser::preg_match('/^(.*?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { - $output = $match[1]; - $i += \strlen($output); - $output = trim($output); - } else { - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $scalar), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >) - if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0] || '%' === $output[0])) { - throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]), self::$parsedLineNumber + 1, $output, self::$parsedFilename); - } - - if ($evaluate) { - $output = self::evaluateScalar($output, $flags, $references); - } - } - - return $output; - } - - /** - * Parses a YAML quoted scalar. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseQuotedScalar(string $scalar, int &$i): string - { - if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - $output = substr($match[0], 1, -1); - - $unescaper = new Unescaper(); - if ('"' == $scalar[$i]) { - $output = $unescaper->unescapeDoubleQuotedString($output); - } else { - $output = $unescaper->unescapeSingleQuotedString($output); - } - - $i += \strlen($match[0]); - - return $output; - } - - /** - * Parses a YAML sequence. - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseSequence(string $sequence, int $flags, int &$i = 0, array $references = []): array - { - $output = []; - $len = \strlen($sequence); - ++$i; - - // [foo, bar, ...] - while ($i < $len) { - if (']' === $sequence[$i]) { - return $output; - } - if (',' === $sequence[$i] || ' ' === $sequence[$i]) { - ++$i; - - continue; - } - - $tag = self::parseTag($sequence, $i, $flags); - switch ($sequence[$i]) { - case '[': - // nested sequence - $value = self::parseSequence($sequence, $flags, $i, $references); - break; - case '{': - // nested mapping - $value = self::parseMapping($sequence, $flags, $i, $references); - break; - default: - $isQuoted = \in_array($sequence[$i], ['"', "'"], true); - $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references); - - // the value can be an array if a reference has been resolved to an array var - if (\is_string($value) && !$isQuoted && false !== strpos($value, ': ')) { - // embedded mapping? - try { - $pos = 0; - $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references); - } catch (\InvalidArgumentException $e) { - // no, it's not - } - } - - --$i; - } - - if (null !== $tag && '' !== $tag) { - $value = new TaggedValue($tag, $value); - } - - $output[] = $value; - - ++$i; - } - - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $sequence), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - /** - * Parses a YAML mapping. - * - * @return array|\stdClass - * - * @throws ParseException When malformed inline YAML string is parsed - */ - private static function parseMapping(string $mapping, int $flags, int &$i = 0, array $references = []) - { - $output = []; - $len = \strlen($mapping); - ++$i; - $allowOverwrite = false; - - // {foo: bar, bar:foo, ...} - while ($i < $len) { - switch ($mapping[$i]) { - case ' ': - case ',': - case "\n": - ++$i; - continue 2; - case '}': - if (self::$objectForMap) { - return (object) $output; - } - - return $output; - } - - // key - $offsetBeforeKeyParsing = $i; - $isKeyQuoted = \in_array($mapping[$i], ['"', "'"], true); - $key = self::parseScalar($mapping, $flags, [':', ' '], $i, false, []); - - if ($offsetBeforeKeyParsing === $i) { - throw new ParseException('Missing mapping key.', self::$parsedLineNumber + 1, $mapping); - } - - if ('!php/const' === $key) { - $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false, []); - $key = self::evaluateScalar($key, $flags); - } - - if (false === $i = strpos($mapping, ':', $i)) { - break; - } - - if (!$isKeyQuoted) { - $evaluatedKey = self::evaluateScalar($key, $flags, $references); - - if ('' !== $key && $evaluatedKey !== $key && !\is_string($evaluatedKey) && !\is_int($evaluatedKey)) { - throw new ParseException('Implicit casting of incompatible mapping keys to strings is not supported. Quote your evaluable mapping keys instead.', self::$parsedLineNumber + 1, $mapping); - } - } - - if (!$isKeyQuoted && (!isset($mapping[$i + 1]) || !\in_array($mapping[$i + 1], [' ', ',', '[', ']', '{', '}', "\n"], true))) { - throw new ParseException('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}").', self::$parsedLineNumber + 1, $mapping); - } - - if ('<<' === $key) { - $allowOverwrite = true; - } - - while ($i < $len) { - if (':' === $mapping[$i] || ' ' === $mapping[$i] || "\n" === $mapping[$i]) { - ++$i; - - continue; - } - - $tag = self::parseTag($mapping, $i, $flags); - switch ($mapping[$i]) { - case '[': - // nested sequence - $value = self::parseSequence($mapping, $flags, $i, $references); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - foreach ($value as $parsedValue) { - $output += $parsedValue; - } - } elseif ($allowOverwrite || !isset($output[$key])) { - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - break; - case '{': - // nested mapping - $value = self::parseMapping($mapping, $flags, $i, $references); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - $output += $value; - } elseif ($allowOverwrite || !isset($output[$key])) { - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - break; - default: - $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references); - // Spec: Keys MUST be unique; first one wins. - // Parser cannot abort this mapping earlier, since lines - // are processed sequentially. - // But overwriting is allowed when a merge node is used in current block. - if ('<<' === $key) { - $output += $value; - } elseif ($allowOverwrite || !isset($output[$key])) { - if (null !== $tag) { - $output[$key] = new TaggedValue($tag, $value); - } else { - $output[$key] = $value; - } - } elseif (isset($output[$key])) { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping); - } - --$i; - } - ++$i; - - continue 2; - } - } - - throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $mapping), self::$parsedLineNumber + 1, null, self::$parsedFilename); - } - - /** - * Evaluates scalars and replaces magic values. - * - * @return mixed The evaluated YAML string - * - * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved - */ - private static function evaluateScalar(string $scalar, int $flags, array $references = []) - { - $scalar = trim($scalar); - - if ('*' === ($scalar[0] ?? '')) { - if (false !== $pos = strpos($scalar, '#')) { - $value = substr($scalar, 1, $pos - 2); - } else { - $value = substr($scalar, 1); - } - - // an unquoted * - if (false === $value || '' === $value) { - throw new ParseException('A reference must contain at least one character.', self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if (!\array_key_exists($value, $references)) { - throw new ParseException(sprintf('Reference "%s" does not exist.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - return $references[$value]; - } - - $scalarLower = strtolower($scalar); - - switch (true) { - case 'null' === $scalarLower: - case '' === $scalar: - case '~' === $scalar: - return null; - case 'true' === $scalarLower: - return true; - case 'false' === $scalarLower: - return false; - case '!' === $scalar[0]: - switch (true) { - case 0 === strncmp($scalar, '!!str ', 6): - return (string) substr($scalar, 6); - case 0 === strncmp($scalar, '! ', 2): - return substr($scalar, 2); - case 0 === strncmp($scalar, '!php/object', 11): - if (self::$objectSupport) { - if (!isset($scalar[12])) { - trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/object tag without a value is deprecated.'); - - return false; - } - - return unserialize(self::parseScalar(substr($scalar, 12))); - } - - if (self::$exceptionOnInvalidType) { - throw new ParseException('Object support when parsing a YAML file has been disabled.', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return null; - case 0 === strncmp($scalar, '!php/const', 10): - if (self::$constantSupport) { - if (!isset($scalar[11])) { - trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/const tag without a value is deprecated.'); - - return ''; - } - - $i = 0; - if (\defined($const = self::parseScalar(substr($scalar, 11), 0, null, $i, false))) { - return \constant($const); - } - - throw new ParseException(sprintf('The constant "%s" is not defined.', $const), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - if (self::$exceptionOnInvalidType) { - throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return null; - case 0 === strncmp($scalar, '!!float ', 8): - return (float) substr($scalar, 8); - case 0 === strncmp($scalar, '!!binary ', 9): - return self::evaluateBinaryScalar(substr($scalar, 9)); - default: - throw new ParseException(sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.', $scalar), self::$parsedLineNumber, $scalar, self::$parsedFilename); - } - // no break - case preg_match('/^(?:\+|-)?0o(?P[0-7_]++)$/', $scalar, $matches): - $value = str_replace('_', '', $matches['value']); - - if ('-' === $scalar[0]) { - return -octdec($value); - } else { - return octdec($value); - } - - // Optimize for returning strings. - // no break - case \in_array($scalar[0], ['+', '-', '.'], true) || is_numeric($scalar[0]): - if (Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar)) { - $scalar = str_replace('_', '', (string) $scalar); - } - - switch (true) { - case ctype_digit($scalar): - if (preg_match('/^0[0-7]+$/', $scalar)) { - trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0.'); - - return octdec($scalar); - } - - $cast = (int) $scalar; - - return ($scalar === (string) $cast) ? $cast : $scalar; - case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): - if (preg_match('/^-0[0-7]+$/', $scalar)) { - trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0.'); - - return -octdec(substr($scalar, 1)); - } - - $cast = (int) $scalar; - - return ($scalar === (string) $cast) ? $cast : $scalar; - case is_numeric($scalar): - case Parser::preg_match(self::getHexRegex(), $scalar): - $scalar = str_replace('_', '', $scalar); - - return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; - case '.inf' === $scalarLower: - case '.nan' === $scalarLower: - return -log(0); - case '-.inf' === $scalarLower: - return log(0); - case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar): - return (float) str_replace('_', '', $scalar); - case Parser::preg_match(self::getTimestampRegex(), $scalar): - if (Yaml::PARSE_DATETIME & $flags) { - // When no timezone is provided in the parsed date, YAML spec says we must assume UTC. - return new \DateTime($scalar, new \DateTimeZone('UTC')); - } - - $timeZone = date_default_timezone_get(); - date_default_timezone_set('UTC'); - $time = strtotime($scalar); - date_default_timezone_set($timeZone); - - return $time; - } - } - - return (string) $scalar; - } - - private static function parseTag(string $value, int &$i, int $flags): ?string - { - if ('!' !== $value[$i]) { - return null; - } - - $tagLength = strcspn($value, " \t\n[]{},", $i + 1); - $tag = substr($value, $i + 1, $tagLength); - - $nextOffset = $i + $tagLength + 1; - $nextOffset += strspn($value, ' ', $nextOffset); - - if ('' === $tag && (!isset($value[$nextOffset]) || \in_array($value[$nextOffset], [']', '}', ','], true))) { - throw new ParseException(sprintf('Using the unquoted scalar value "!" is not supported. You must quote it.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - // Is followed by a scalar and is a built-in tag - if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || 'str' === $tag || 'php/const' === $tag || 'php/object' === $tag)) { - // Manage in {@link self::evaluateScalar()} - return null; - } - - $i = $nextOffset; - - // Built-in tags - if ('' !== $tag && '!' === $tag[0]) { - throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if ('' !== $tag && !isset($value[$i])) { - throw new ParseException(sprintf('Missing value for tag "%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - if ('' === $tag || Yaml::PARSE_CUSTOM_TAGS & $flags) { - return $tag; - } - - throw new ParseException(sprintf('Tags support is not enabled. Enable the "Yaml::PARSE_CUSTOM_TAGS" flag to use "!%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename); - } - - public static function evaluateBinaryScalar(string $scalar): string - { - $parsedBinaryData = self::parseScalar(preg_replace('/\s/', '', $scalar)); - - if (0 !== (\strlen($parsedBinaryData) % 4)) { - throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', \strlen($parsedBinaryData)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - if (!Parser::preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) { - throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); - } - - return base64_decode($parsedBinaryData, true); - } - - private static function isBinaryString(string $value): bool - { - return !preg_match('//u', $value) || preg_match('/[^\x00\x07-\x0d\x1B\x20-\xff]/', $value); - } - - /** - * Gets a regex that matches a YAML date. - * - * @return string The regular expression - * - * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 - */ - private static function getTimestampRegex(): string - { - return <<[0-9][0-9][0-9][0-9]) - -(?P[0-9][0-9]?) - -(?P[0-9][0-9]?) - (?:(?:[Tt]|[ \t]+) - (?P[0-9][0-9]?) - :(?P[0-9][0-9]) - :(?P[0-9][0-9]) - (?:\.(?P[0-9]*))? - (?:[ \t]*(?PZ|(?P[-+])(?P[0-9][0-9]?) - (?::(?P[0-9][0-9]))?))?)? - $~x -EOF; - } - - /** - * Gets a regex that matches a YAML number in hexadecimal notation. - */ - private static function getHexRegex(): string - { - return '~^0x[0-9a-f_]++$~i'; - } -} diff --git a/vendor/symfony/yaml/LICENSE b/vendor/symfony/yaml/LICENSE deleted file mode 100644 index 9ff2d0d..0000000 --- a/vendor/symfony/yaml/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/yaml/Parser.php b/vendor/symfony/yaml/Parser.php deleted file mode 100644 index 8a76b48..0000000 --- a/vendor/symfony/yaml/Parser.php +++ /dev/null @@ -1,1308 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Tag\TaggedValue; - -/** - * Parser parses YAML strings to convert them to PHP arrays. - * - * @author Fabien Potencier - * - * @final - */ -class Parser -{ - public const TAG_PATTERN = '(?P![\w!.\/:-]+)'; - public const BLOCK_SCALAR_HEADER_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?'; - - private $filename; - private $offset = 0; - private $numberOfParsedLines = 0; - private $totalNumberOfLines; - private $lines = []; - private $currentLineNb = -1; - private $currentLine = ''; - private $refs = []; - private $skippedLineNumbers = []; - private $locallySkippedLineNumbers = []; - private $refsBeingParsed = []; - - /** - * Parses a YAML file into a PHP value. - * - * @param string $filename The path to the YAML file to be parsed - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @return mixed The YAML converted to a PHP value - * - * @throws ParseException If the file could not be read or the YAML is not valid - */ - public function parseFile(string $filename, int $flags = 0) - { - if (!is_file($filename)) { - throw new ParseException(sprintf('File "%s" does not exist.', $filename)); - } - - if (!is_readable($filename)) { - throw new ParseException(sprintf('File "%s" cannot be read.', $filename)); - } - - $this->filename = $filename; - - try { - return $this->parse(file_get_contents($filename), $flags); - } finally { - $this->filename = null; - } - } - - /** - * Parses a YAML string to a PHP value. - * - * @param string $value A YAML string - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @return mixed A PHP value - * - * @throws ParseException If the YAML is not valid - */ - public function parse(string $value, int $flags = 0) - { - if (false === preg_match('//u', $value)) { - throw new ParseException('The YAML value does not appear to be valid UTF-8.', -1, null, $this->filename); - } - - $this->refs = []; - - $mbEncoding = null; - - if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { - $mbEncoding = mb_internal_encoding(); - mb_internal_encoding('UTF-8'); - } - - try { - $data = $this->doParse($value, $flags); - } finally { - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - $this->lines = []; - $this->currentLine = ''; - $this->numberOfParsedLines = 0; - $this->refs = []; - $this->skippedLineNumbers = []; - $this->locallySkippedLineNumbers = []; - $this->totalNumberOfLines = null; - } - - return $data; - } - - private function doParse(string $value, int $flags) - { - $this->currentLineNb = -1; - $this->currentLine = ''; - $value = $this->cleanup($value); - $this->lines = explode("\n", $value); - $this->numberOfParsedLines = \count($this->lines); - $this->locallySkippedLineNumbers = []; - - if (null === $this->totalNumberOfLines) { - $this->totalNumberOfLines = $this->numberOfParsedLines; - } - - if (!$this->moveToNextLine()) { - return null; - } - - $data = []; - $context = null; - $allowOverwrite = false; - - while ($this->isCurrentLineEmpty()) { - if (!$this->moveToNextLine()) { - return null; - } - } - - // Resolves the tag and returns if end of the document - if (null !== ($tag = $this->getLineTag($this->currentLine, $flags, false)) && !$this->moveToNextLine()) { - return new TaggedValue($tag, ''); - } - - do { - if ($this->isCurrentLineEmpty()) { - continue; - } - - // tab? - if ("\t" === $this->currentLine[0]) { - throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - Inline::initialize($flags, $this->getRealCurrentLineNb(), $this->filename); - - $isRef = $mergeNode = false; - if ('-' === $this->currentLine[0] && self::preg_match('#^\-((?P\s+)(?P.+))?$#u', rtrim($this->currentLine), $values)) { - if ($context && 'mapping' == $context) { - throw new ParseException('You cannot define a sequence item when in a mapping.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - $context = 'sequence'; - - if (isset($values['value']) && '&' === $values['value'][0] && self::preg_match('#^&(?P[^ ]+) *(?P.*)#u', $values['value'], $matches)) { - $isRef = $matches['ref']; - $this->refsBeingParsed[] = $isRef; - $values['value'] = $matches['value']; - } - - if (isset($values['value'][1]) && '?' === $values['value'][0] && ' ' === $values['value'][1]) { - throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // array - if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { - $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true) ?? '', $flags); - } elseif (null !== $subTag = $this->getLineTag(ltrim($values['value'], ' '), $flags)) { - $data[] = new TaggedValue( - $subTag, - $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $flags) - ); - } else { - if ( - isset($values['leadspaces']) - && ( - '!' === $values['value'][0] - || self::preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $this->trimTag($values['value']), $matches) - ) - ) { - // this is a compact notation element, add to next block and parse - $block = $values['value']; - if ($this->isNextLineIndented()) { - $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1); - } - - $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $flags); - } else { - $data[] = $this->parseValue($values['value'], $flags, $context); - } - } - if ($isRef) { - $this->refs[$isRef] = end($data); - array_pop($this->refsBeingParsed); - } - } elseif ( - self::preg_match('#^(?P(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:( ++(?P.+))?$#u', rtrim($this->currentLine), $values) - && (false === strpos($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"])) - ) { - if ($context && 'sequence' == $context) { - throw new ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - $context = 'mapping'; - - try { - $key = Inline::parseScalar($values['key']); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - - if (!\is_string($key) && !\is_int($key)) { - throw new ParseException(sprintf('%s keys are not supported. Quote your evaluable mapping keys instead.', is_numeric($key) ? 'Numeric' : 'Non-string'), $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // Convert float keys to strings, to avoid being converted to integers by PHP - if (\is_float($key)) { - $key = (string) $key; - } - - if ('<<' === $key && (!isset($values['value']) || '&' !== $values['value'][0] || !self::preg_match('#^&(?P[^ ]+)#u', $values['value'], $refMatches))) { - $mergeNode = true; - $allowOverwrite = true; - if (isset($values['value'][0]) && '*' === $values['value'][0]) { - $refName = substr(rtrim($values['value']), 1); - if (!\array_key_exists($refName, $this->refs)) { - if (false !== $pos = array_search($refName, $this->refsBeingParsed, true)) { - throw new ParseException(sprintf('Circular reference [%s, %s] detected for reference "%s".', implode(', ', \array_slice($this->refsBeingParsed, $pos)), $refName, $refName), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - $refValue = $this->refs[$refName]; - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $refValue instanceof \stdClass) { - $refValue = (array) $refValue; - } - - if (!\is_array($refValue)) { - throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - $data += $refValue; // array union - } else { - if (isset($values['value']) && '' !== $values['value']) { - $value = $values['value']; - } else { - $value = $this->getNextEmbedBlock(); - } - $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags); - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsed instanceof \stdClass) { - $parsed = (array) $parsed; - } - - if (!\is_array($parsed)) { - throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if (isset($parsed[0])) { - // If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes - // and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier - // in the sequence override keys specified in later mapping nodes. - foreach ($parsed as $parsedItem) { - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $parsedItem instanceof \stdClass) { - $parsedItem = (array) $parsedItem; - } - - if (!\is_array($parsedItem)) { - throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem, $this->filename); - } - - $data += $parsedItem; // array union - } - } else { - // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the - // current mapping, unless the key already exists in it. - $data += $parsed; // array union - } - } - } elseif ('<<' !== $key && isset($values['value']) && '&' === $values['value'][0] && self::preg_match('#^&(?P[^ ]++) *+(?P.*)#u', $values['value'], $matches)) { - $isRef = $matches['ref']; - $this->refsBeingParsed[] = $isRef; - $values['value'] = $matches['value']; - } - - $subTag = null; - if ($mergeNode) { - // Merge keys - } elseif (!isset($values['value']) || '' === $values['value'] || '#' === ($values['value'][0] ?? '') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) { - // hash - // if next line is less indented or equal, then it means that the current value is null - if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if ($allowOverwrite || !isset($data[$key])) { - if (null !== $subTag) { - $data[$key] = new TaggedValue($subTag, ''); - } else { - $data[$key] = null; - } - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - } else { - // remember the parsed line number here in case we need it to provide some contexts in error messages below - $realCurrentLineNbKey = $this->getRealCurrentLineNb(); - $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags); - if ('<<' === $key) { - $this->refs[$refMatches['ref']] = $value; - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) { - $value = (array) $value; - } - - $data += $value; - } elseif ($allowOverwrite || !isset($data[$key])) { - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if (null !== $subTag) { - $data[$key] = new TaggedValue($subTag, $value); - } else { - $data[$key] = $value; - } - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $realCurrentLineNbKey + 1, $this->currentLine); - } - } - } else { - $value = $this->parseValue(rtrim($values['value']), $flags, $context); - // Spec: Keys MUST be unique; first one wins. - // But overwriting is allowed when a merge node is used in current block. - if ($allowOverwrite || !isset($data[$key])) { - $data[$key] = $value; - } else { - throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - } - if ($isRef) { - $this->refs[$isRef] = $data[$key]; - array_pop($this->refsBeingParsed); - } - } elseif ('"' === $this->currentLine[0] || "'" === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - return Inline::parse($this->lexInlineQuotedString(), $flags, $this->refs); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } elseif ('{' === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - $parsedMapping = Inline::parse($this->lexInlineMapping(), $flags, $this->refs); - - while ($this->moveToNextLine()) { - if (!$this->isCurrentLineEmpty()) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return $parsedMapping; - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } elseif ('[' === $this->currentLine[0]) { - if (null !== $context) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - try { - $parsedSequence = Inline::parse($this->lexInlineSequence(), $flags, $this->refs); - - while ($this->moveToNextLine()) { - if (!$this->isCurrentLineEmpty()) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return $parsedSequence; - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } else { - // multiple documents are not supported - if ('---' === $this->currentLine) { - throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - if ($deprecatedUsage = (isset($this->currentLine[1]) && '?' === $this->currentLine[0] && ' ' === $this->currentLine[1])) { - throw new ParseException('Complex mappings are not supported.', $this->getRealCurrentLineNb() + 1, $this->currentLine); - } - - // 1-liner optionally followed by newline(s) - if (\is_string($value) && $this->lines[0] === trim($value)) { - try { - $value = Inline::parse($this->lines[0], $flags, $this->refs); - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - - return $value; - } - - // try to parse the value as a multi-line string as a last resort - if (0 === $this->currentLineNb) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - $value = ''; - - foreach ($this->lines as $line) { - $trimmedLine = trim($line); - if ('#' === ($trimmedLine[0] ?? '')) { - continue; - } - // If the indentation is not consistent at offset 0, it is to be considered as a ParseError - if (0 === $this->offset && !$deprecatedUsage && isset($line[0]) && ' ' === $line[0]) { - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if (false !== strpos($line, ': ')) { - throw new ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - - if ('' === $trimmedLine) { - $value .= "\n"; - } elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) { - $value .= ' '; - } - - if ('' !== $trimmedLine && '\\' === $line[-1]) { - $value .= ltrim(substr($line, 0, -1)); - } elseif ('' !== $trimmedLine) { - $value .= $trimmedLine; - } - - if ('' === $trimmedLine) { - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - } elseif ('\\' === $line[-1]) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = true; - } else { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - } - } - - try { - return Inline::parse(trim($value)); - } catch (ParseException $e) { - // fall-through to the ParseException thrown below - } - } - - throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } while ($this->moveToNextLine()); - - if (null !== $tag) { - $data = new TaggedValue($tag, $data); - } - - if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && 'mapping' === $context && !\is_object($data)) { - $object = new \stdClass(); - - foreach ($data as $key => $value) { - $object->$key = $value; - } - - $data = $object; - } - - return empty($data) ? null : $data; - } - - private function parseBlock(int $offset, string $yaml, int $flags) - { - $skippedLineNumbers = $this->skippedLineNumbers; - - foreach ($this->locallySkippedLineNumbers as $lineNumber) { - if ($lineNumber < $offset) { - continue; - } - - $skippedLineNumbers[] = $lineNumber; - } - - $parser = new self(); - $parser->offset = $offset; - $parser->totalNumberOfLines = $this->totalNumberOfLines; - $parser->skippedLineNumbers = $skippedLineNumbers; - $parser->refs = &$this->refs; - $parser->refsBeingParsed = $this->refsBeingParsed; - - return $parser->doParse($yaml, $flags); - } - - /** - * Returns the current line number (takes the offset into account). - * - * @internal - * - * @return int The current line number - */ - public function getRealCurrentLineNb(): int - { - $realCurrentLineNumber = $this->currentLineNb + $this->offset; - - foreach ($this->skippedLineNumbers as $skippedLineNumber) { - if ($skippedLineNumber > $realCurrentLineNumber) { - break; - } - - ++$realCurrentLineNumber; - } - - return $realCurrentLineNumber; - } - - /** - * Returns the current line indentation. - * - * @return int The current line indentation - */ - private function getCurrentLineIndentation(): int - { - if (' ' !== ($this->currentLine[0] ?? '')) { - return 0; - } - - return \strlen($this->currentLine) - \strlen(ltrim($this->currentLine, ' ')); - } - - /** - * Returns the next embed block of YAML. - * - * @param int|null $indentation The indent level at which the block is to be read, or null for default - * @param bool $inSequence True if the enclosing data structure is a sequence - * - * @return string A YAML string - * - * @throws ParseException When indentation problem are detected - */ - private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): string - { - $oldLineIndentation = $this->getCurrentLineIndentation(); - - if (!$this->moveToNextLine()) { - return ''; - } - - if (null === $indentation) { - $newIndent = null; - $movements = 0; - - do { - $EOF = false; - - // empty and comment-like lines do not influence the indentation depth - if ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } else { - $newIndent = $this->getCurrentLineIndentation(); - } - } while (!$EOF && null === $newIndent); - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem(); - - if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { - throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } else { - $newIndent = $indentation; - } - - $data = []; - if ($this->getCurrentLineIndentation() >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent); - } elseif ($this->isCurrentLineEmpty() || $this->isCurrentLineComment()) { - $data[] = $this->currentLine; - } else { - $this->moveToPreviousLine(); - - return ''; - } - - if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { - // the previous line contained a dash but no item content, this line is a sequence item with the same indentation - // and therefore no nested list or mapping - $this->moveToPreviousLine(); - - return ''; - } - - $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); - $isItComment = $this->isCurrentLineComment(); - - while ($this->moveToNextLine()) { - if ($isItComment && !$isItUnindentedCollection) { - $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem(); - $isItComment = $this->isCurrentLineComment(); - } - - $indent = $this->getCurrentLineIndentation(); - - if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) { - $this->moveToPreviousLine(); - break; - } - - if ($this->isCurrentLineBlank()) { - $data[] = substr($this->currentLine, $newIndent); - continue; - } - - if ($indent >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent); - } elseif ($this->isCurrentLineComment()) { - $data[] = $this->currentLine; - } elseif (0 == $indent) { - $this->moveToPreviousLine(); - - break; - } else { - throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); - } - } - - return implode("\n", $data); - } - - private function hasMoreLines(): bool - { - return (\count($this->lines) - 1) > $this->currentLineNb; - } - - /** - * Moves the parser to the next line. - */ - private function moveToNextLine(): bool - { - if ($this->currentLineNb >= $this->numberOfParsedLines - 1) { - return false; - } - - $this->currentLine = $this->lines[++$this->currentLineNb]; - - return true; - } - - /** - * Moves the parser to the previous line. - */ - private function moveToPreviousLine(): bool - { - if ($this->currentLineNb < 1) { - return false; - } - - $this->currentLine = $this->lines[--$this->currentLineNb]; - - return true; - } - - /** - * Parses a YAML value. - * - * @param string $value A YAML value - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * @param string $context The parser context (either sequence or mapping) - * - * @return mixed A PHP value - * - * @throws ParseException When reference does not exist - */ - private function parseValue(string $value, int $flags, string $context) - { - if ('*' === ($value[0] ?? '')) { - if (false !== $pos = strpos($value, '#')) { - $value = substr($value, 1, $pos - 2); - } else { - $value = substr($value, 1); - } - - if (!\array_key_exists($value, $this->refs)) { - if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) { - throw new ParseException(sprintf('Circular reference [%s, %s] detected for reference "%s".', implode(', ', \array_slice($this->refsBeingParsed, $pos)), $value, $value), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $this->filename); - } - - return $this->refs[$value]; - } - - if (\in_array($value[0], ['!', '|', '>'], true) && self::preg_match('/^(?:'.self::TAG_PATTERN.' +)?'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { - $modifiers = $matches['modifiers'] ?? ''; - - $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), abs((int) $modifiers)); - - if ('' !== $matches['tag'] && '!' !== $matches['tag']) { - if ('!!binary' === $matches['tag']) { - return Inline::evaluateBinaryScalar($data); - } - - return new TaggedValue(substr($matches['tag'], 1), $data); - } - - return $data; - } - - try { - if ('' !== $value && '{' === $value[0]) { - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - - return Inline::parse($this->lexInlineMapping($cursor), $flags, $this->refs); - } elseif ('' !== $value && '[' === $value[0]) { - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - - return Inline::parse($this->lexInlineSequence($cursor), $flags, $this->refs); - } - - switch ($value[0] ?? '') { - case '"': - case "'": - $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value)); - $parsedValue = Inline::parse($this->lexInlineQuotedString($cursor), $flags, $this->refs); - - if (isset($this->currentLine[$cursor]) && preg_replace('/\s*(#.*)?$/A', '', substr($this->currentLine, $cursor))) { - throw new ParseException(sprintf('Unexpected characters near "%s".', substr($this->currentLine, $cursor))); - } - - return $parsedValue; - default: - $lines = []; - - while ($this->moveToNextLine()) { - // unquoted strings end before the first unindented line - if (0 === $this->getCurrentLineIndentation()) { - $this->moveToPreviousLine(); - - break; - } - - $lines[] = trim($this->currentLine); - } - - for ($i = 0, $linesCount = \count($lines), $previousLineBlank = false; $i < $linesCount; ++$i) { - if ('' === $lines[$i]) { - $value .= "\n"; - $previousLineBlank = true; - } elseif ($previousLineBlank) { - $value .= $lines[$i]; - $previousLineBlank = false; - } else { - $value .= ' '.$lines[$i]; - $previousLineBlank = false; - } - } - - Inline::$parsedLineNumber = $this->getRealCurrentLineNb(); - - $parsedValue = Inline::parse($value, $flags, $this->refs); - - if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && false !== strpos($parsedValue, ': ')) { - throw new ParseException('A colon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - return $parsedValue; - } - } catch (ParseException $e) { - $e->setParsedLine($this->getRealCurrentLineNb() + 1); - $e->setSnippet($this->currentLine); - - throw $e; - } - } - - /** - * Parses a block scalar. - * - * @param string $style The style indicator that was used to begin this block scalar (| or >) - * @param string $chomping The chomping indicator that was used to begin this block scalar (+ or -) - * @param int $indentation The indentation indicator that was used to begin this block scalar - */ - private function parseBlockScalar(string $style, string $chomping = '', int $indentation = 0): string - { - $notEOF = $this->moveToNextLine(); - if (!$notEOF) { - return ''; - } - - $isCurrentLineBlank = $this->isCurrentLineBlank(); - $blockLines = []; - - // leading blank lines are consumed before determining indentation - while ($notEOF && $isCurrentLineBlank) { - // newline only if not EOF - if ($notEOF = $this->moveToNextLine()) { - $blockLines[] = ''; - $isCurrentLineBlank = $this->isCurrentLineBlank(); - } - } - - // determine indentation if not specified - if (0 === $indentation) { - $currentLineLength = \strlen($this->currentLine); - - for ($i = 0; $i < $currentLineLength && ' ' === $this->currentLine[$i]; ++$i) { - ++$indentation; - } - } - - if ($indentation > 0) { - $pattern = sprintf('/^ {%d}(.*)$/', $indentation); - - while ( - $notEOF && ( - $isCurrentLineBlank || - self::preg_match($pattern, $this->currentLine, $matches) - ) - ) { - if ($isCurrentLineBlank && \strlen($this->currentLine) > $indentation) { - $blockLines[] = substr($this->currentLine, $indentation); - } elseif ($isCurrentLineBlank) { - $blockLines[] = ''; - } else { - $blockLines[] = $matches[1]; - } - - // newline only if not EOF - if ($notEOF = $this->moveToNextLine()) { - $isCurrentLineBlank = $this->isCurrentLineBlank(); - } - } - } elseif ($notEOF) { - $blockLines[] = ''; - } - - if ($notEOF) { - $blockLines[] = ''; - $this->moveToPreviousLine(); - } elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) { - $blockLines[] = ''; - } - - // folded style - if ('>' === $style) { - $text = ''; - $previousLineIndented = false; - $previousLineBlank = false; - - for ($i = 0, $blockLinesCount = \count($blockLines); $i < $blockLinesCount; ++$i) { - if ('' === $blockLines[$i]) { - $text .= "\n"; - $previousLineIndented = false; - $previousLineBlank = true; - } elseif (' ' === $blockLines[$i][0]) { - $text .= "\n".$blockLines[$i]; - $previousLineIndented = true; - $previousLineBlank = false; - } elseif ($previousLineIndented) { - $text .= "\n".$blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } elseif ($previousLineBlank || 0 === $i) { - $text .= $blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } else { - $text .= ' '.$blockLines[$i]; - $previousLineIndented = false; - $previousLineBlank = false; - } - } - } else { - $text = implode("\n", $blockLines); - } - - // deal with trailing newlines - if ('' === $chomping) { - $text = preg_replace('/\n+$/', "\n", $text); - } elseif ('-' === $chomping) { - $text = preg_replace('/\n+$/', '', $text); - } - - return $text; - } - - /** - * Returns true if the next line is indented. - * - * @return bool Returns true if the next line is indented, false otherwise - */ - private function isNextLineIndented(): bool - { - $currentIndentation = $this->getCurrentLineIndentation(); - $movements = 0; - - do { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment())); - - if ($EOF) { - return false; - } - - $ret = $this->getCurrentLineIndentation() > $currentIndentation; - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - return $ret; - } - - /** - * Returns true if the current line is blank or if it is a comment line. - * - * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise - */ - private function isCurrentLineEmpty(): bool - { - return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); - } - - /** - * Returns true if the current line is blank. - * - * @return bool Returns true if the current line is blank, false otherwise - */ - private function isCurrentLineBlank(): bool - { - return '' === $this->currentLine || '' === trim($this->currentLine, ' '); - } - - /** - * Returns true if the current line is a comment line. - * - * @return bool Returns true if the current line is a comment line, false otherwise - */ - private function isCurrentLineComment(): bool - { - //checking explicitly the first char of the trim is faster than loops or strpos - $ltrimmedLine = '' !== $this->currentLine && ' ' === $this->currentLine[0] ? ltrim($this->currentLine, ' ') : $this->currentLine; - - return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0]; - } - - private function isCurrentLineLastLineInDocument(): bool - { - return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1); - } - - /** - * Cleanups a YAML string to be parsed. - * - * @param string $value The input YAML string - * - * @return string A cleaned up YAML string - */ - private function cleanup(string $value): string - { - $value = str_replace(["\r\n", "\r"], "\n", $value); - - // strip YAML header - $count = 0; - $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); - $this->offset += $count; - - // remove leading comments - $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); - if (1 === $count) { - // items have been removed, update the offset - $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); - $value = $trimmedValue; - } - - // remove start of the document marker (---) - $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); - if (1 === $count) { - // items have been removed, update the offset - $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); - $value = $trimmedValue; - - // remove end of the document marker (...) - $value = preg_replace('#\.\.\.\s*$#', '', $value); - } - - return $value; - } - - /** - * Returns true if the next line starts unindented collection. - * - * @return bool Returns true if the next line starts unindented collection, false otherwise - */ - private function isNextLineUnIndentedCollection(): bool - { - $currentIndentation = $this->getCurrentLineIndentation(); - $movements = 0; - - do { - $EOF = !$this->moveToNextLine(); - - if (!$EOF) { - ++$movements; - } - } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment())); - - if ($EOF) { - return false; - } - - $ret = $this->getCurrentLineIndentation() === $currentIndentation && $this->isStringUnIndentedCollectionItem(); - - for ($i = 0; $i < $movements; ++$i) { - $this->moveToPreviousLine(); - } - - return $ret; - } - - /** - * Returns true if the string is un-indented collection item. - * - * @return bool Returns true if the string is un-indented collection item, false otherwise - */ - private function isStringUnIndentedCollectionItem(): bool - { - return 0 === strncmp($this->currentLine, '- ', 2) || '-' === rtrim($this->currentLine); - } - - /** - * A local wrapper for "preg_match" which will throw a ParseException if there - * is an internal error in the PCRE engine. - * - * This avoids us needing to check for "false" every time PCRE is used - * in the YAML engine - * - * @throws ParseException on a PCRE internal error - * - * @see preg_last_error() - * - * @internal - */ - public static function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int - { - if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - $error = 'Internal PCRE error.'; - break; - case \PREG_BACKTRACK_LIMIT_ERROR: - $error = 'pcre.backtrack_limit reached.'; - break; - case \PREG_RECURSION_LIMIT_ERROR: - $error = 'pcre.recursion_limit reached.'; - break; - case \PREG_BAD_UTF8_ERROR: - $error = 'Malformed UTF-8 data.'; - break; - case \PREG_BAD_UTF8_OFFSET_ERROR: - $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; - break; - default: - $error = 'Error.'; - } - - throw new ParseException($error); - } - - return $ret; - } - - /** - * Trim the tag on top of the value. - * - * Prevent values such as "!foo {quz: bar}" to be considered as - * a mapping block. - */ - private function trimTag(string $value): string - { - if ('!' === $value[0]) { - return ltrim(substr($value, 1, strcspn($value, " \r\n", 1)), ' '); - } - - return $value; - } - - private function getLineTag(string $value, int $flags, bool $nextLineCheck = true): ?string - { - if ('' === $value || '!' !== $value[0] || 1 !== self::preg_match('/^'.self::TAG_PATTERN.' *( +#.*)?$/', $value, $matches)) { - return null; - } - - if ($nextLineCheck && !$this->isNextLineIndented()) { - return null; - } - - $tag = substr($matches['tag'], 1); - - // Built-in tags - if ($tag && '!' === $tag[0]) { - throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - if (Yaml::PARSE_CUSTOM_TAGS & $flags) { - return $tag; - } - - throw new ParseException(sprintf('Tags support is not enabled. You must use the flag "Yaml::PARSE_CUSTOM_TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename); - } - - private function lexInlineQuotedString(int &$cursor = 0): string - { - $quotation = $this->currentLine[$cursor]; - $value = $quotation; - ++$cursor; - - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - $lineNumber = 0; - - do { - if (++$lineNumber > 1) { - $cursor += strspn($this->currentLine, ' ', $cursor); - } - - if ($this->isCurrentLineBlank()) { - $value .= "\n"; - } elseif (!$previousLineWasNewline && !$previousLineWasTerminatedWithBackslash) { - $value .= ' '; - } - - for (; \strlen($this->currentLine) > $cursor; ++$cursor) { - switch ($this->currentLine[$cursor]) { - case '\\': - if ("'" === $quotation) { - $value .= '\\'; - } elseif (isset($this->currentLine[++$cursor])) { - $value .= '\\'.$this->currentLine[$cursor]; - } - - break; - case $quotation: - ++$cursor; - - if ("'" === $quotation && isset($this->currentLine[$cursor]) && "'" === $this->currentLine[$cursor]) { - $value .= "''"; - break; - } - - return $value.$quotation; - default: - $value .= $this->currentLine[$cursor]; - } - } - - if ($this->isCurrentLineBlank()) { - $previousLineWasNewline = true; - $previousLineWasTerminatedWithBackslash = false; - } elseif ('\\' === $this->currentLine[-1]) { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = true; - } else { - $previousLineWasNewline = false; - $previousLineWasTerminatedWithBackslash = false; - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - throw new ParseException('Malformed inline YAML string'); - } - - private function lexUnquotedString(int &$cursor): string - { - $offset = $cursor; - $cursor += strcspn($this->currentLine, '[]{},: ', $cursor); - - return substr($this->currentLine, $offset, $cursor - $offset); - } - - private function lexInlineMapping(int &$cursor = 0): string - { - return $this->lexInlineStructure($cursor, '}'); - } - - private function lexInlineSequence(int &$cursor = 0): string - { - return $this->lexInlineStructure($cursor, ']'); - } - - private function lexInlineStructure(int &$cursor, string $closingTag): string - { - $value = $this->currentLine[$cursor]; - ++$cursor; - - do { - $this->consumeWhitespaces($cursor); - - while (isset($this->currentLine[$cursor])) { - switch ($this->currentLine[$cursor]) { - case '"': - case "'": - $value .= $this->lexInlineQuotedString($cursor); - break; - case ':': - case ',': - $value .= $this->currentLine[$cursor]; - ++$cursor; - break; - case '{': - $value .= $this->lexInlineMapping($cursor); - break; - case '[': - $value .= $this->lexInlineSequence($cursor); - break; - case $closingTag: - $value .= $this->currentLine[$cursor]; - ++$cursor; - - return $value; - case '#': - break 2; - default: - $value .= $this->lexUnquotedString($cursor); - } - - if ($this->consumeWhitespaces($cursor)) { - $value .= ' '; - } - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - throw new ParseException('Malformed inline YAML string'); - } - - private function consumeWhitespaces(int &$cursor): bool - { - $whitespacesConsumed = 0; - - do { - $whitespaceOnlyTokenLength = strspn($this->currentLine, ' ', $cursor); - $whitespacesConsumed += $whitespaceOnlyTokenLength; - $cursor += $whitespaceOnlyTokenLength; - - if (isset($this->currentLine[$cursor])) { - return 0 < $whitespacesConsumed; - } - - if ($this->hasMoreLines()) { - $cursor = 0; - } - } while ($this->moveToNextLine()); - - return 0 < $whitespacesConsumed; - } -} diff --git a/vendor/symfony/yaml/README.md b/vendor/symfony/yaml/README.md deleted file mode 100644 index b914e78..0000000 --- a/vendor/symfony/yaml/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Yaml Component -============== - -The Yaml component loads and dumps YAML files. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/yaml.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/yaml/Resources/bin/yaml-lint b/vendor/symfony/yaml/Resources/bin/yaml-lint deleted file mode 100644 index 0ad73d7..0000000 --- a/vendor/symfony/yaml/Resources/bin/yaml-lint +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Runs the Yaml lint command. - * - * @author Jan Schädlich - */ - -use Symfony\Component\Console\Application; -use Symfony\Component\Yaml\Command\LintCommand; - -function includeIfExists(string $file): bool -{ - return file_exists($file) && include $file; -} - -if ( - !includeIfExists(__DIR__ . '/../../../../autoload.php') && - !includeIfExists(__DIR__ . '/../../vendor/autoload.php') && - !includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php') -) { - fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL); - exit(1); -} - -if (!class_exists(Application::class)) { - fwrite(STDERR, 'You need the "symfony/console" component in order to run the Yaml linter.'.PHP_EOL); - exit(1); -} - -(new Application())->add($command = new LintCommand()) - ->getApplication() - ->setDefaultCommand($command->getName(), true) - ->run() -; diff --git a/vendor/symfony/yaml/Tag/TaggedValue.php b/vendor/symfony/yaml/Tag/TaggedValue.php deleted file mode 100644 index 4ea3406..0000000 --- a/vendor/symfony/yaml/Tag/TaggedValue.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml\Tag; - -/** - * @author Nicolas Grekas - * @author Guilhem N. - */ -final class TaggedValue -{ - private $tag; - private $value; - - public function __construct(string $tag, $value) - { - $this->tag = $tag; - $this->value = $value; - } - - public function getTag(): string - { - return $this->tag; - } - - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/symfony/yaml/Unescaper.php b/vendor/symfony/yaml/Unescaper.php deleted file mode 100644 index 6bdf216..0000000 --- a/vendor/symfony/yaml/Unescaper.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; - -/** - * Unescaper encapsulates unescaping rules for single and double-quoted - * YAML strings. - * - * @author Matthew Lewinski - * - * @internal - */ -class Unescaper -{ - /** - * Regex fragment that matches an escaped character in a double quoted string. - */ - public const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)'; - - /** - * Unescapes a single quoted string. - * - * @param string $value A single quoted string - * - * @return string The unescaped string - */ - public function unescapeSingleQuotedString(string $value): string - { - return str_replace('\'\'', '\'', $value); - } - - /** - * Unescapes a double quoted string. - * - * @param string $value A double quoted string - * - * @return string The unescaped string - */ - public function unescapeDoubleQuotedString(string $value): string - { - $callback = function ($match) { - return $this->unescapeCharacter($match[0]); - }; - - // evaluate the string - return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); - } - - /** - * Unescapes a character that was found in a double-quoted string. - * - * @param string $value An escaped character - * - * @return string The unescaped character - */ - private function unescapeCharacter(string $value): string - { - switch ($value[1]) { - case '0': - return "\x0"; - case 'a': - return "\x7"; - case 'b': - return "\x8"; - case 't': - return "\t"; - case "\t": - return "\t"; - case 'n': - return "\n"; - case 'v': - return "\xB"; - case 'f': - return "\xC"; - case 'r': - return "\r"; - case 'e': - return "\x1B"; - case ' ': - return ' '; - case '"': - return '"'; - case '/': - return '/'; - case '\\': - return '\\'; - case 'N': - // U+0085 NEXT LINE - return "\xC2\x85"; - case '_': - // U+00A0 NO-BREAK SPACE - return "\xC2\xA0"; - case 'L': - // U+2028 LINE SEPARATOR - return "\xE2\x80\xA8"; - case 'P': - // U+2029 PARAGRAPH SEPARATOR - return "\xE2\x80\xA9"; - case 'x': - return self::utf8chr(hexdec(substr($value, 2, 2))); - case 'u': - return self::utf8chr(hexdec(substr($value, 2, 4))); - case 'U': - return self::utf8chr(hexdec(substr($value, 2, 8))); - default: - throw new ParseException(sprintf('Found unknown escape character "%s".', $value)); - } - } - - /** - * Get the UTF-8 character for the given code point. - */ - private static function utf8chr(int $c): string - { - if (0x80 > $c %= 0x200000) { - return \chr($c); - } - if (0x800 > $c) { - return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F); - } - if (0x10000 > $c) { - return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); - } - - return \chr(0xF0 | $c >> 18).\chr(0x80 | $c >> 12 & 0x3F).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); - } -} diff --git a/vendor/symfony/yaml/Yaml.php b/vendor/symfony/yaml/Yaml.php deleted file mode 100644 index 4fea47f..0000000 --- a/vendor/symfony/yaml/Yaml.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Yaml; - -use Symfony\Component\Yaml\Exception\ParseException; - -/** - * Yaml offers convenience methods to load and dump YAML. - * - * @author Fabien Potencier - * - * @final - */ -class Yaml -{ - public const DUMP_OBJECT = 1; - public const PARSE_EXCEPTION_ON_INVALID_TYPE = 2; - public const PARSE_OBJECT = 4; - public const PARSE_OBJECT_FOR_MAP = 8; - public const DUMP_EXCEPTION_ON_INVALID_TYPE = 16; - public const PARSE_DATETIME = 32; - public const DUMP_OBJECT_AS_MAP = 64; - public const DUMP_MULTI_LINE_LITERAL_BLOCK = 128; - public const PARSE_CONSTANT = 256; - public const PARSE_CUSTOM_TAGS = 512; - public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024; - public const DUMP_NULL_AS_TILDE = 2048; - - /** - * Parses a YAML file into a PHP value. - * - * Usage: - * - * $array = Yaml::parseFile('config.yml'); - * print_r($array); - * - * @param string $filename The path to the YAML file to be parsed - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @return mixed The YAML converted to a PHP value - * - * @throws ParseException If the file could not be read or the YAML is not valid - */ - public static function parseFile(string $filename, int $flags = 0) - { - $yaml = new Parser(); - - return $yaml->parseFile($filename, $flags); - } - - /** - * Parses YAML into a PHP value. - * - * Usage: - * - * $array = Yaml::parse(file_get_contents('config.yml')); - * print_r($array); - * - * - * @param string $input A string containing YAML - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * - * @return mixed The YAML converted to a PHP value - * - * @throws ParseException If the YAML is not valid - */ - public static function parse(string $input, int $flags = 0) - { - $yaml = new Parser(); - - return $yaml->parse($input, $flags); - } - - /** - * Dumps a PHP value to a YAML string. - * - * The dump method, when supplied with an array, will do its best - * to convert the array into friendly YAML. - * - * @param mixed $input The PHP value - * @param int $inline The level where you switch to inline YAML - * @param int $indent The amount of spaces to use for indentation of nested nodes - * @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string - * - * @return string A YAML string representing the original PHP value - */ - public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string - { - $yaml = new Dumper($indent); - - return $yaml->dump($input, $inline, 0, $flags); - } -} diff --git a/vendor/symfony/yaml/composer.json b/vendor/symfony/yaml/composer.json deleted file mode 100644 index 4aca5c8..0000000 --- a/vendor/symfony/yaml/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "symfony/yaml", - "type": "library", - "description": "Loads and dumps YAML files", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-ctype": "~1.8" - }, - "require-dev": { - "symfony/console": "^4.4|^5.0" - }, - "conflict": { - "symfony/console": "<4.4" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Yaml\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "minimum-stability": "dev" -} diff --git a/vendor/topthink/framework/.gitignore b/vendor/topthink/framework/.gitignore deleted file mode 100644 index b267fba..0000000 --- a/vendor/topthink/framework/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/vendor -composer.phar -composer.lock -.DS_Store -Thumbs.db -/.idea -/.vscode \ No newline at end of file diff --git a/vendor/topthink/framework/.travis.yml b/vendor/topthink/framework/.travis.yml deleted file mode 100644 index 28987af..0000000 --- a/vendor/topthink/framework/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -dist: xenial -language: php - -matrix: - fast_finish: true - include: - - php: 7.1 - - php: 7.2 - - php: 7.3 - -cache: - directories: - - $HOME/.composer/cache - -services: - - memcached - - redis-server - - mysql - -before_install: - - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo 'xdebug.mode = coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - printf "\n" | pecl install -f redis - - travis_retry composer self-update - - mysql -e 'CREATE DATABASE test;' - -install: - - travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest - -script: - - vendor/bin/phpunit --coverage-clover build/logs/coverage.xml - -after_script: - - travis_retry wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/logs/coverage.xml diff --git a/vendor/topthink/framework/CONTRIBUTING.md b/vendor/topthink/framework/CONTRIBUTING.md deleted file mode 100644 index efa3ad9..0000000 --- a/vendor/topthink/framework/CONTRIBUTING.md +++ /dev/null @@ -1,119 +0,0 @@ -如何贡献我的源代码 -=== - -此文档介绍了 ThinkPHP 团队的组成以及运转机制,您提交的代码将给 ThinkPHP 项目带来什么好处,以及如何才能加入我们的行列。 - -## 通过 Github 贡献代码 - -ThinkPHP 目前使用 Git 来控制程序版本,如果你想为 ThinkPHP 贡献源代码,请先大致了解 Git 的使用方法。我们目前把项目托管在 GitHub 上,任何 GitHub 用户都可以向我们贡献代码。 - -参与的方式很简单,`fork`一份 ThinkPHP 的代码到你的仓库中,修改后提交,并向我们发起`pull request`申请,我们会及时对代码进行审查并处理你的申请并。审查通过后,你的代码将被`merge`进我们的仓库中,这样你就会自动出现在贡献者名单里了,非常方便。 - -我们希望你贡献的代码符合: - -* ThinkPHP 的编码规范 -* 适当的注释,能让其他人读懂 -* 遵循 Apache2 开源协议 - -**如果想要了解更多细节或有任何疑问,请继续阅读下面的内容** - -### 注意事项 - -* 本项目代码格式化标准选用 [**PSR-2**](http://www.kancloud.cn/thinkphp/php-fig-psr/3141); -* 类名和类文件名遵循 [**PSR-4**](http://www.kancloud.cn/thinkphp/php-fig-psr/3144); -* 对于 Issues 的处理,请使用诸如 `fix #xxx(Issue ID)` 的 commit title 直接关闭 issue。 -* 系统会自动在 PHP 7.1 ~ 7.3 上测试修改,请确保你的修改符合 PHP 7.1 ~ 7.3 的语法规范; -* 管理员不会合并造成 CI faild 的修改,若出现 CI faild 请检查自己的源代码或修改相应的[单元测试文件](tests); - -## GitHub Issue - -GitHub 提供了 Issue 功能,该功能可以用于: - -* 提出 bug -* 提出功能改进 -* 反馈使用体验 - -该功能不应该用于: - - * 提出修改意见(涉及代码署名和修订追溯问题) - * 不友善的言论 - -## 快速修改 - -**GitHub 提供了快速编辑文件的功能** - -1. 登录 GitHub 帐号; -2. 浏览项目文件,找到要进行修改的文件; -3. 点击右上角铅笔图标进行修改; -4. 填写 `Commit changes` 相关内容(Title 必填); -5. 提交修改,等待 CI 验证和管理员合并。 - -**若您需要一次提交大量修改,请继续阅读下面的内容** - -## 完整流程 - -1. `fork`本项目; -2. 克隆(`clone`)你 `fork` 的项目到本地; -3. 新建分支(`branch`)并检出(`checkout`)新分支; -4. 添加本项目到你的本地 git 仓库作为上游(`upstream`); -5. 进行修改,若你的修改包含方法或函数的增减,请记得修改[单元测试文件](tests); -6. 变基(衍合 `rebase`)你的分支到上游 master 分支; -7. `push` 你的本地仓库到 GitHub; -8. 提交 `pull request`; -9. 等待 CI 验证(若不通过则重复 5~7,GitHub 会自动更新你的 `pull request`); -10. 等待管理员处理,并及时 `rebase` 你的分支到上游 master 分支(若上游 master 分支有修改)。 - -*若有必要,可以 `git push -f` 强行推送 rebase 后的分支到自己的 `fork`* - -*绝对不可以使用 `git push -f` 强行推送修改到上游* - -### 注意事项 - -* 若对上述流程有任何不清楚的地方,请查阅 GIT 教程,如 [这个](http://backlogtool.com/git-guide/cn/); -* 对于代码**不同方面**的修改,请在自己 `fork` 的项目中**创建不同的分支**(原因参见`完整流程`第9条备注部分); -* 变基及交互式变基操作参见 [Git 交互式变基](http://pakchoi.me/2015/03/17/git-interactive-rebase/) - -## 推荐资源 - -### 开发环境 - -* XAMPP for Windows 5.5.x -* WampServer (for Windows) -* upupw Apache PHP5.4 ( for Windows) - -或自行安装 - -- Apache / Nginx -- PHP 7.1 ~ 7.3 -- MySQL / MariaDB - -*Windows 用户推荐添加 PHP bin 目录到 PATH,方便使用 composer* - -*Linux 用户自行配置环境, Mac 用户推荐使用内置 Apache 配合 Homebrew 安装 PHP 和 MariaDB* - -### 编辑器 - -Sublime Text 3 + phpfmt 插件 - -phpfmt 插件参数 - -```json -{ - "autocomplete": true, - "enable_auto_align": true, - "format_on_save": true, - "indent_with_space": true, - "psr1_naming": false, - "psr2": true, - "version": 4 -} -``` - -或其他 编辑器 / IDE 配合 PSR2 自动格式化工具 - -### Git GUI - -* SourceTree -* GitHub Desktop - -或其他 Git 图形界面客户端 diff --git a/vendor/topthink/framework/LICENSE.txt b/vendor/topthink/framework/LICENSE.txt deleted file mode 100644 index 4e910bb..0000000 --- a/vendor/topthink/framework/LICENSE.txt +++ /dev/null @@ -1,32 +0,0 @@ - -ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 -版权所有Copyright © 2006-2019 by ThinkPHP (http://thinkphp.cn) -All rights reserved。 -ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 - -Apache Licence是著名的非盈利开源组织Apache采用的协议。 -该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, -允许代码修改,再作为开源或商业软件发布。需要满足 -的条件: -1. 需要给代码的用户一份Apache Licence ; -2. 如果你修改了代码,需要在被修改的文件中说明; -3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 -带有原来代码中的协议,商标,专利声明和其他原来作者规 -定需要包含的说明; -4. 如果再发布的产品中包含一个Notice文件,则在Notice文 -件中需要带有本协议内容。你可以在Notice中增加自己的 -许可,但不可以表现为对Apache Licence构成更改。 -具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/topthink/framework/README.md b/vendor/topthink/framework/README.md deleted file mode 100644 index 0ea03c9..0000000 --- a/vendor/topthink/framework/README.md +++ /dev/null @@ -1,86 +0,0 @@ -![](https://box.kancloud.cn/5a0aaa69a5ff42657b5c4715f3d49221) - -ThinkPHP 6.0 -=============== - -[![Build Status](https://travis-ci.org/top-think/framework.svg?branch=6.0)](https://travis-ci.org/top-think/framework) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/top-think/framework/badges/quality-score.png?b=6.0)](https://scrutinizer-ci.com/g/top-think/framework/?branch=6.0) -[![Code Coverage](https://scrutinizer-ci.com/g/top-think/framework/badges/coverage.png?b=6.0)](https://scrutinizer-ci.com/g/top-think/framework/?branch=6.0) -[![Total Downloads](https://poser.pugx.org/topthink/framework/downloads)](https://packagist.org/packages/topthink/framework) -[![Latest Stable Version](https://poser.pugx.org/topthink/framework/v/stable)](https://packagist.org/packages/topthink/framework) -[![PHP Version](https://img.shields.io/badge/php-%3E%3D7.1-8892BF.svg)](http://www.php.net/) -[![License](https://poser.pugx.org/topthink/framework/license)](https://packagist.org/packages/topthink/framework) - -ThinkPHP6.0底层架构采用PHP7.1改写和进一步优化。 - -[官方应用服务市场](https://market.topthink.com) | [`ThinkAPI`——官方统一API服务](https://docs.topthink.com/think-api/) - -## 主要新特性 - -* 采用`PHP7`强类型(严格模式) -* 支持更多的`PSR`规范 -* 原生多应用支持 -* 系统服务注入支持 -* ORM作为独立组件使用 -* 增加Filesystem -* 全新的事件系统 -* 模板引擎分离出核心 -* 内部功能中间件化 -* SESSION机制改进 -* 日志多通道支持 -* 规范扩展接口 -* 更强大的控制台 -* 对Swoole以及协程支持改进 -* 对IDE更加友好 -* 统一和精简大量用法 - - -> ThinkPHP6.0的运行环境要求PHP7.1+,兼容PHP8.0。 - -## 安装 - -~~~ -composer create-project topthink/think tp -~~~ - -启动服务 - -~~~ -cd tp -php think run -~~~ - -然后就可以在浏览器中访问 - -~~~ -http://localhost:8000 -~~~ - -如果需要更新框架使用 -~~~ -composer update topthink/framework -~~~ - -## 文档 - -[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content) - -## 命名规范 - -`ThinkPHP6`遵循PSR-2命名规范和PSR-4自动加载规范。 - -## 参与开发 - -直接提交PR或者Issue即可 - -## 版权信息 - -ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 - -本项目包含的第三方源码和二进制文件之版权信息另行标注。 - -版权所有Copyright © 2006-2021 by ThinkPHP (http://thinkphp.cn) All rights reserved。 - -ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 - -更多细节参阅 [LICENSE.txt](LICENSE.txt) diff --git a/vendor/topthink/framework/composer.json b/vendor/topthink/framework/composer.json deleted file mode 100644 index 9afc513..0000000 --- a/vendor/topthink/framework/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "topthink/framework", - "description": "The ThinkPHP Framework.", - "keywords": [ - "framework", - "thinkphp", - "ORM" - ], - "homepage": "http://thinkphp.cn/", - "license": "Apache-2.0", - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - }, - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "require": { - "php": ">=7.1.0", - "ext-json": "*", - "ext-mbstring": "*", - "league/flysystem": "^1.0", - "league/flysystem-cached-adapter": "^1.0", - "psr/log": "~1.0", - "psr/container": "~1.0", - "psr/simple-cache": "^1.0", - "topthink/think-orm": "^2.0", - "topthink/think-helper": "^3.1.1" - }, - "require-dev": { - "mikey179/vfsstream": "^1.6", - "mockery/mockery": "^1.2", - "phpunit/phpunit": "^7.0" - }, - "autoload": { - "files": [], - "psr-4": { - "think\\": "src/think/" - } - }, - "autoload-dev": { - "psr-4": { - "think\\tests\\": "tests/" - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "config": { - "sort-packages": true - } -} diff --git a/vendor/topthink/framework/logo.png b/vendor/topthink/framework/logo.png deleted file mode 100644 index 25fd059..0000000 Binary files a/vendor/topthink/framework/logo.png and /dev/null differ diff --git a/vendor/topthink/framework/phpunit.xml.dist b/vendor/topthink/framework/phpunit.xml.dist deleted file mode 100644 index e20a133..0000000 --- a/vendor/topthink/framework/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - ./tests - - - - - ./src/think - - - diff --git a/vendor/topthink/framework/src/helper.php b/vendor/topthink/framework/src/helper.php deleted file mode 100644 index 650edcb..0000000 --- a/vendor/topthink/framework/src/helper.php +++ /dev/null @@ -1,663 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -//------------------------ -// ThinkPHP 助手函数 -//------------------------- - -use think\App; -use think\Container; -use think\exception\HttpException; -use think\exception\HttpResponseException; -use think\facade\Cache; -use think\facade\Config; -use think\facade\Cookie; -use think\facade\Env; -use think\facade\Event; -use think\facade\Lang; -use think\facade\Log; -use think\facade\Request; -use think\facade\Route; -use think\facade\Session; -use think\Response; -use think\response\File; -use think\response\Json; -use think\response\Jsonp; -use think\response\Redirect; -use think\response\View; -use think\response\Xml; -use think\route\Url as UrlBuild; -use think\Validate; - -if (!function_exists('abort')) { - /** - * 抛出HTTP异常 - * @param integer|Response $code 状态码 或者 Response对象实例 - * @param string $message 错误信息 - * @param array $header 参数 - */ - function abort($code, string $message = '', array $header = []) - { - if ($code instanceof Response) { - throw new HttpResponseException($code); - } else { - throw new HttpException($code, $message, null, $header); - } - } -} - -if (!function_exists('app')) { - /** - * 快速获取容器中的实例 支持依赖注入 - * @param string $name 类名或标识 默认获取当前应用实例 - * @param array $args 参数 - * @param bool $newInstance 是否每次创建新的实例 - * @return object|App - */ - function app(string $name = '', array $args = [], bool $newInstance = false) - { - return Container::getInstance()->make($name ?: App::class, $args, $newInstance); - } -} - -if (!function_exists('bind')) { - /** - * 绑定一个类到容器 - * @param string|array $abstract 类标识、接口(支持批量绑定) - * @param mixed $concrete 要绑定的类、闭包或者实例 - * @return Container - */ - function bind($abstract, $concrete = null) - { - return Container::getInstance()->bind($abstract, $concrete); - } -} - -if (!function_exists('cache')) { - /** - * 缓存管理 - * @param string $name 缓存名称 - * @param mixed $value 缓存值 - * @param mixed $options 缓存参数 - * @param string $tag 缓存标签 - * @return mixed - */ - function cache(string $name = null, $value = '', $options = null, $tag = null) - { - if (is_null($name)) { - return app('cache'); - } - - if ('' === $value) { - // 获取缓存 - return 0 === strpos($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name); - } elseif (is_null($value)) { - // 删除缓存 - return Cache::delete($name); - } - - // 缓存数据 - if (is_array($options)) { - $expire = $options['expire'] ?? null; //修复查询缓存无法设置过期时间 - } else { - $expire = $options; - } - - if (is_null($tag)) { - return Cache::set($name, $value, $expire); - } else { - return Cache::tag($tag)->set($name, $value, $expire); - } - } -} - -if (!function_exists('config')) { - /** - * 获取和设置配置参数 - * @param string|array $name 参数名 - * @param mixed $value 参数值 - * @return mixed - */ - function config($name = '', $value = null) - { - if (is_array($name)) { - return Config::set($name, $value); - } - - return 0 === strpos($name, '?') ? Config::has(substr($name, 1)) : Config::get($name, $value); - } -} - -if (!function_exists('cookie')) { - /** - * Cookie管理 - * @param string $name cookie名称 - * @param mixed $value cookie值 - * @param mixed $option 参数 - * @return mixed - */ - function cookie(string $name, $value = '', $option = null) - { - if (is_null($value)) { - // 删除 - Cookie::delete($name); - } elseif ('' === $value) { - // 获取 - return 0 === strpos($name, '?') ? Cookie::has(substr($name, 1)) : Cookie::get($name); - } else { - // 设置 - return Cookie::set($name, $value, $option); - } - } -} - -if (!function_exists('download')) { - /** - * 获取\think\response\Download对象实例 - * @param string $filename 要下载的文件 - * @param string $name 显示文件名 - * @param bool $content 是否为内容 - * @param int $expire 有效期(秒) - * @return \think\response\File - */ - function download(string $filename, string $name = '', bool $content = false, int $expire = 180): File - { - return Response::create($filename, 'file')->name($name)->isContent($content)->expire($expire); - } -} - -if (!function_exists('dump')) { - /** - * 浏览器友好的变量输出 - * @param mixed $vars 要输出的变量 - * @return void - */ - function dump(...$vars) - { - ob_start(); - var_dump(...$vars); - - $output = ob_get_clean(); - $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output); - - if (PHP_SAPI == 'cli') { - $output = PHP_EOL . $output . PHP_EOL; - } else { - if (!extension_loaded('xdebug')) { - $output = htmlspecialchars($output, ENT_SUBSTITUTE); - } - $output = '
    ' . $output . '
    '; - } - - echo $output; - } -} - -if (!function_exists('env')) { - /** - * 获取环境变量值 - * @access public - * @param string $name 环境变量名(支持二级 .号分割) - * @param string $default 默认值 - * @return mixed - */ - function env(string $name = null, $default = null) - { - return Env::get($name, $default); - } -} - -if (!function_exists('event')) { - /** - * 触发事件 - * @param mixed $event 事件名(或者类名) - * @param mixed $args 参数 - * @return mixed - */ - function event($event, $args = null) - { - return Event::trigger($event, $args); - } -} - -if (!function_exists('halt')) { - /** - * 调试变量并且中断输出 - * @param mixed $vars 调试变量或者信息 - */ - function halt(...$vars) - { - dump(...$vars); - - throw new HttpResponseException(Response::create()); - } -} - -if (!function_exists('input')) { - /** - * 获取输入数据 支持默认值和过滤 - * @param string $key 获取的变量名 - * @param mixed $default 默认值 - * @param string $filter 过滤方法 - * @return mixed - */ - function input(string $key = '', $default = null, $filter = '') - { - if (0 === strpos($key, '?')) { - $key = substr($key, 1); - $has = true; - } - - if ($pos = strpos($key, '.')) { - // 指定参数来源 - $method = substr($key, 0, $pos); - if (in_array($method, ['get', 'post', 'put', 'patch', 'delete', 'route', 'param', 'request', 'session', 'cookie', 'server', 'env', 'path', 'file'])) { - $key = substr($key, $pos + 1); - if ('server' == $method && is_null($default)) { - $default = ''; - } - } else { - $method = 'param'; - } - } else { - // 默认为自动判断 - $method = 'param'; - } - - return isset($has) ? - request()->has($key, $method) : - request()->$method($key, $default, $filter); - } -} - -if (!function_exists('invoke')) { - /** - * 调用反射实例化对象或者执行方法 支持依赖注入 - * @param mixed $call 类名或者callable - * @param array $args 参数 - * @return mixed - */ - function invoke($call, array $args = []) - { - if (is_callable($call)) { - return Container::getInstance()->invoke($call, $args); - } - - return Container::getInstance()->invokeClass($call, $args); - } -} - -if (!function_exists('json')) { - /** - * 获取\think\response\Json对象实例 - * @param mixed $data 返回的数据 - * @param int $code 状态码 - * @param array $header 头部 - * @param array $options 参数 - * @return \think\response\Json - */ - function json($data = [], $code = 200, $header = [], $options = []): Json - { - return Response::create($data, 'json', $code)->header($header)->options($options); - } -} - -if (!function_exists('jsonp')) { - /** - * 获取\think\response\Jsonp对象实例 - * @param mixed $data 返回的数据 - * @param int $code 状态码 - * @param array $header 头部 - * @param array $options 参数 - * @return \think\response\Jsonp - */ - function jsonp($data = [], $code = 200, $header = [], $options = []): Jsonp - { - return Response::create($data, 'jsonp', $code)->header($header)->options($options); - } -} - -if (!function_exists('lang')) { - /** - * 获取语言变量值 - * @param string $name 语言变量名 - * @param array $vars 动态变量值 - * @param string $lang 语言 - * @return mixed - */ - function lang(string $name, array $vars = [], string $lang = '') - { - return Lang::get($name, $vars, $lang); - } -} - -if (!function_exists('parse_name')) { - /** - * 字符串命名风格转换 - * type 0 将Java风格转换为C的风格 1 将C风格转换为Java的风格 - * @param string $name 字符串 - * @param int $type 转换类型 - * @param bool $ucfirst 首字母是否大写(驼峰规则) - * @return string - */ - function parse_name(string $name, int $type = 0, bool $ucfirst = true): string - { - if ($type) { - $name = preg_replace_callback('/_([a-zA-Z])/', function ($match) { - return strtoupper($match[1]); - }, $name); - - return $ucfirst ? ucfirst($name) : lcfirst($name); - } - - return strtolower(trim(preg_replace('/[A-Z]/', '_\\0', $name), '_')); - } -} - -if (!function_exists('redirect')) { - /** - * 获取\think\response\Redirect对象实例 - * @param string $url 重定向地址 - * @param int $code 状态码 - * @return \think\response\Redirect - */ - function redirect(string $url = '', int $code = 302): Redirect - { - return Response::create($url, 'redirect', $code); - } -} - -if (!function_exists('request')) { - /** - * 获取当前Request对象实例 - * @return Request - */ - function request(): \think\Request - { - return app('request'); - } -} - -if (!function_exists('response')) { - /** - * 创建普通 Response 对象实例 - * @param mixed $data 输出数据 - * @param int|string $code 状态码 - * @param array $header 头信息 - * @param string $type - * @return Response - */ - function response($data = '', $code = 200, $header = [], $type = 'html'): Response - { - return Response::create($data, $type, $code)->header($header); - } -} - -if (!function_exists('session')) { - /** - * Session管理 - * @param string $name session名称 - * @param mixed $value session值 - * @return mixed - */ - function session($name = '', $value = '') - { - if (is_null($name)) { - // 清除 - Session::clear(); - } elseif ('' === $name) { - return Session::all(); - } elseif (is_null($value)) { - // 删除 - Session::delete($name); - } elseif ('' === $value) { - // 判断或获取 - return 0 === strpos($name, '?') ? Session::has(substr($name, 1)) : Session::get($name); - } else { - // 设置 - Session::set($name, $value); - } - } -} - -if (!function_exists('token')) { - /** - * 获取Token令牌 - * @param string $name 令牌名称 - * @param mixed $type 令牌生成方法 - * @return string - */ - function token(string $name = '__token__', string $type = 'md5'): string - { - return Request::buildToken($name, $type); - } -} - -if (!function_exists('token_field')) { - /** - * 生成令牌隐藏表单 - * @param string $name 令牌名称 - * @param mixed $type 令牌生成方法 - * @return string - */ - function token_field(string $name = '__token__', string $type = 'md5'): string - { - $token = Request::buildToken($name, $type); - - return ''; - } -} - -if (!function_exists('token_meta')) { - /** - * 生成令牌meta - * @param string $name 令牌名称 - * @param mixed $type 令牌生成方法 - * @return string - */ - function token_meta(string $name = '__token__', string $type = 'md5'): string - { - $token = Request::buildToken($name, $type); - - return ''; - } -} - -if (!function_exists('trace')) { - /** - * 记录日志信息 - * @param mixed $log log信息 支持字符串和数组 - * @param string $level 日志级别 - * @return array|void - */ - function trace($log = '[think]', string $level = 'log') - { - if ('[think]' === $log) { - return Log::getLog(); - } - - Log::record($log, $level); - } -} - -if (!function_exists('url')) { - /** - * Url生成 - * @param string $url 路由地址 - * @param array $vars 变量 - * @param bool|string $suffix 生成的URL后缀 - * @param bool|string $domain 域名 - * @return UrlBuild - */ - function url(string $url = '', array $vars = [], $suffix = true, $domain = false): UrlBuild - { - return Route::buildUrl($url, $vars)->suffix($suffix)->domain($domain); - } -} - -if (!function_exists('validate')) { - /** - * 生成验证对象 - * @param string|array $validate 验证器类名或者验证规则数组 - * @param array $message 错误提示信息 - * @param bool $batch 是否批量验证 - * @param bool $failException 是否抛出异常 - * @return Validate - */ - function validate($validate = '', array $message = [], bool $batch = false, bool $failException = true): Validate - { - if (is_array($validate) || '' === $validate) { - $v = new Validate(); - if (is_array($validate)) { - $v->rule($validate); - } - } else { - if (strpos($validate, '.')) { - // 支持场景 - [$validate, $scene] = explode('.', $validate); - } - - $class = false !== strpos($validate, '\\') ? $validate : app()->parseClass('validate', $validate); - - $v = new $class(); - - if (!empty($scene)) { - $v->scene($scene); - } - } - - return $v->message($message)->batch($batch)->failException($failException); - } -} - -if (!function_exists('view')) { - /** - * 渲染模板输出 - * @param string $template 模板文件 - * @param array $vars 模板变量 - * @param int $code 状态码 - * @param callable $filter 内容过滤 - * @return \think\response\View - */ - function view(string $template = '', $vars = [], $code = 200, $filter = null): View - { - return Response::create($template, 'view', $code)->assign($vars)->filter($filter); - } -} - -if (!function_exists('display')) { - /** - * 渲染模板输出 - * @param string $content 渲染内容 - * @param array $vars 模板变量 - * @param int $code 状态码 - * @param callable $filter 内容过滤 - * @return \think\response\View - */ - function display(string $content, $vars = [], $code = 200, $filter = null): View - { - return Response::create($content, 'view', $code)->isContent(true)->assign($vars)->filter($filter); - } -} - -if (!function_exists('xml')) { - /** - * 获取\think\response\Xml对象实例 - * @param mixed $data 返回的数据 - * @param int $code 状态码 - * @param array $header 头部 - * @param array $options 参数 - * @return \think\response\Xml - */ - function xml($data = [], $code = 200, $header = [], $options = []): Xml - { - return Response::create($data, 'xml', $code)->header($header)->options($options); - } -} - -if (!function_exists('app_path')) { - /** - * 获取当前应用目录 - * - * @param string $path - * @return string - */ - function app_path($path = '') - { - return app()->getAppPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); - } -} - -if (!function_exists('base_path')) { - /** - * 获取应用基础目录 - * - * @param string $path - * @return string - */ - function base_path($path = '') - { - return app()->getBasePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); - } -} - -if (!function_exists('config_path')) { - /** - * 获取应用配置目录 - * - * @param string $path - * @return string - */ - function config_path($path = '') - { - return app()->getConfigPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); - } -} - -if (!function_exists('public_path')) { - /** - * 获取web根目录 - * - * @param string $path - * @return string - */ - function public_path($path = '') - { - return app()->getRootPath() . 'public' . DIRECTORY_SEPARATOR . ($path ? ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $path); - } -} - -if (!function_exists('runtime_path')) { - /** - * 获取应用运行时目录 - * - * @param string $path - * @return string - */ - function runtime_path($path = '') - { - return app()->getRuntimePath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); - } -} - -if (!function_exists('root_path')) { - /** - * 获取项目根目录 - * - * @param string $path - * @return string - */ - function root_path($path = '') - { - return app()->getRootPath() . ($path ? $path . DIRECTORY_SEPARATOR : $path); - } -} diff --git a/vendor/topthink/framework/src/lang/zh-cn.php b/vendor/topthink/framework/src/lang/zh-cn.php deleted file mode 100644 index a546330..0000000 --- a/vendor/topthink/framework/src/lang/zh-cn.php +++ /dev/null @@ -1,148 +0,0 @@ - -// +---------------------------------------------------------------------- - -// 核心中文语言包 -return [ - // 系统错误提示 - 'Undefined variable' => '未定义变量', - 'Undefined index' => '未定义数组索引', - 'Undefined offset' => '未定义数组下标', - 'Parse error' => '语法解析错误', - 'Type error' => '类型错误', - 'Fatal error' => '致命错误', - 'syntax error' => '语法错误', - - // 框架核心错误提示 - 'dispatch type not support' => '不支持的调度类型', - 'method param miss' => '方法参数错误', - 'method not exists' => '方法不存在', - 'function not exists' => '函数不存在', - 'app not exists' => '应用不存在', - 'controller not exists' => '控制器不存在', - 'class not exists' => '类不存在', - 'property not exists' => '类的属性不存在', - 'template not exists' => '模板文件不存在', - 'illegal controller name' => '非法的控制器名称', - 'illegal action name' => '非法的操作名称', - 'url suffix deny' => '禁止的URL后缀访问', - 'Undefined cache config' => '缓存配置未定义', - 'Route Not Found' => '当前访问路由未定义或不匹配', - 'Undefined db config' => '数据库配置未定义', - 'Undefined log config' => '日志配置未定义', - 'Undefined db type' => '未定义数据库类型', - 'variable type error' => '变量类型错误', - 'PSR-4 error' => 'PSR-4 规范错误', - 'not support type' => '不支持的分页索引字段类型', - 'not support total' => '简洁模式下不能获取数据总数', - 'not support last' => '简洁模式下不能获取最后一页', - 'error session handler' => '错误的SESSION处理器类', - 'not allow php tag' => '模板不允许使用PHP语法', - 'not support' => '不支持', - 'database config error' => '数据库配置信息错误', - 'redisd master' => 'Redisd 主服务器错误', - 'redisd slave' => 'Redisd 从服务器错误', - 'must run at sae' => '必须在SAE运行', - 'memcache init error' => '未开通Memcache服务,请在SAE管理平台初始化Memcache服务', - 'KVDB init error' => '没有初始化KVDB,请在SAE管理平台初始化KVDB服务', - 'fields not exists' => '数据表字段不存在', - 'where express error' => '查询表达式错误', - 'no data to update' => '没有任何数据需要更新', - 'miss data to insert' => '缺少需要写入的数据', - 'miss complex primary data' => '缺少复合主键数据', - 'miss update condition' => '缺少更新条件', - 'model data Not Found' => '模型数据不存在', - 'table data not Found' => '表数据不存在', - 'delete without condition' => '没有条件不会执行删除操作', - 'miss relation data' => '缺少关联表数据', - 'tag attr must' => '模板标签属性必须', - 'tag error' => '模板标签错误', - 'cache write error' => '缓存写入失败', - 'sae mc write error' => 'SAE mc 写入错误', - 'route name not exists' => '路由标识不存在(或参数不够)', - 'invalid request' => '非法请求', - 'bind attr has exists' => '模型的属性已经存在', - 'relation data not exists' => '关联数据不存在', - 'relation not support' => '关联不支持', - 'chunk not support order' => 'Chunk不支持调用order方法', - 'route pattern error' => '路由变量规则定义错误', - 'route behavior will not support' => '路由行为废弃(使用中间件替代)', - 'closure not support cache(true)' => '使用闭包查询不支持cache(true),请指定缓存Key', - - // 上传错误信息 - 'unknown upload error' => '未知上传错误!', - 'file write error' => '文件写入失败!', - 'upload temp dir not found' => '找不到临时文件夹!', - 'no file to uploaded' => '没有文件被上传!', - 'only the portion of file is uploaded' => '文件只有部分被上传!', - 'upload File size exceeds the maximum value' => '上传文件大小超过了最大值!', - 'upload write error' => '文件上传保存错误!', - 'has the same filename: {:filename}' => '存在同名文件:{:filename}', - 'upload illegal files' => '非法上传文件', - 'illegal image files' => '非法图片文件', - 'extensions to upload is not allowed' => '上传文件后缀不允许', - 'mimetype to upload is not allowed' => '上传文件MIME类型不允许!', - 'filesize not match' => '上传文件大小不符!', - 'directory {:path} creation failed' => '目录 {:path} 创建失败!', - - 'The middleware must return Response instance' => '中间件方法必须返回Response对象实例', - 'The queue was exhausted, with no response returned' => '中间件队列为空', - // Validate Error Message - ':attribute require' => ':attribute不能为空', - ':attribute must' => ':attribute必须', - ':attribute must be numeric' => ':attribute必须是数字', - ':attribute must be integer' => ':attribute必须是整数', - ':attribute must be float' => ':attribute必须是浮点数', - ':attribute must be bool' => ':attribute必须是布尔值', - ':attribute not a valid email address' => ':attribute格式不符', - ':attribute not a valid mobile' => ':attribute格式不符', - ':attribute must be a array' => ':attribute必须是数组', - ':attribute must be yes,on or 1' => ':attribute必须是yes、on或者1', - ':attribute not a valid datetime' => ':attribute不是一个有效的日期或时间格式', - ':attribute not a valid file' => ':attribute不是有效的上传文件', - ':attribute not a valid image' => ':attribute不是有效的图像文件', - ':attribute must be alpha' => ':attribute只能是字母', - ':attribute must be alpha-numeric' => ':attribute只能是字母和数字', - ':attribute must be alpha-numeric, dash, underscore' => ':attribute只能是字母、数字和下划线_及破折号-', - ':attribute not a valid domain or ip' => ':attribute不是有效的域名或者IP', - ':attribute must be chinese' => ':attribute只能是汉字', - ':attribute must be chinese or alpha' => ':attribute只能是汉字、字母', - ':attribute must be chinese,alpha-numeric' => ':attribute只能是汉字、字母和数字', - ':attribute must be chinese,alpha-numeric,underscore, dash' => ':attribute只能是汉字、字母、数字和下划线_及破折号-', - ':attribute not a valid url' => ':attribute不是有效的URL地址', - ':attribute not a valid ip' => ':attribute不是有效的IP地址', - ':attribute must be dateFormat of :rule' => ':attribute必须使用日期格式 :rule', - ':attribute must be in :rule' => ':attribute必须在 :rule 范围内', - ':attribute be notin :rule' => ':attribute不能在 :rule 范围内', - ':attribute must between :1 - :2' => ':attribute只能在 :1 - :2 之间', - ':attribute not between :1 - :2' => ':attribute不能在 :1 - :2 之间', - 'size of :attribute must be :rule' => ':attribute长度不符合要求 :rule', - 'max size of :attribute must be :rule' => ':attribute长度不能超过 :rule', - 'min size of :attribute must be :rule' => ':attribute长度不能小于 :rule', - ':attribute cannot be less than :rule' => ':attribute日期不能小于 :rule', - ':attribute cannot exceed :rule' => ':attribute日期不能超过 :rule', - ':attribute not within :rule' => '不在有效期内 :rule', - 'access IP is not allowed' => '不允许的IP访问', - 'access IP denied' => '禁止的IP访问', - ':attribute out of accord with :2' => ':attribute和确认字段:2不一致', - ':attribute cannot be same with :2' => ':attribute和比较字段:2不能相同', - ':attribute must greater than or equal :rule' => ':attribute必须大于等于 :rule', - ':attribute must greater than :rule' => ':attribute必须大于 :rule', - ':attribute must less than or equal :rule' => ':attribute必须小于等于 :rule', - ':attribute must less than :rule' => ':attribute必须小于 :rule', - ':attribute must equal :rule' => ':attribute必须等于 :rule', - ':attribute has exists' => ':attribute已存在', - ':attribute not conform to the rules' => ':attribute不符合指定规则', - 'invalid Request method' => '无效的请求类型', - 'invalid token' => '令牌数据无效', - 'not conform to the rules' => '规则错误', - - 'record has update' => '记录已经被更新了', -]; diff --git a/vendor/topthink/framework/src/think/App.php b/vendor/topthink/framework/src/think/App.php deleted file mode 100644 index 69e9b95..0000000 --- a/vendor/topthink/framework/src/think/App.php +++ /dev/null @@ -1,608 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use think\event\AppInit; -use think\helper\Str; -use think\initializer\BootService; -use think\initializer\Error; -use think\initializer\RegisterService; - -/** - * App 基础类 - * @property Route $route - * @property Config $config - * @property Cache $cache - * @property Request $request - * @property Http $http - * @property Console $console - * @property Env $env - * @property Event $event - * @property Middleware $middleware - * @property Log $log - * @property Lang $lang - * @property Db $db - * @property Cookie $cookie - * @property Session $session - * @property Validate $validate - * @property Filesystem $filesystem - */ -class App extends Container -{ - const VERSION = '6.0.7'; - - /** - * 应用调试模式 - * @var bool - */ - protected $appDebug = false; - - /** - * 应用开始时间 - * @var float - */ - protected $beginTime; - - /** - * 应用内存初始占用 - * @var integer - */ - protected $beginMem; - - /** - * 当前应用类库命名空间 - * @var string - */ - protected $namespace = 'app'; - - /** - * 应用根目录 - * @var string - */ - protected $rootPath = ''; - - /** - * 框架目录 - * @var string - */ - protected $thinkPath = ''; - - /** - * 应用目录 - * @var string - */ - protected $appPath = ''; - - /** - * Runtime目录 - * @var string - */ - protected $runtimePath = ''; - - /** - * 路由定义目录 - * @var string - */ - protected $routePath = ''; - - /** - * 配置后缀 - * @var string - */ - protected $configExt = '.php'; - - /** - * 应用初始化器 - * @var array - */ - protected $initializers = [ - Error::class, - RegisterService::class, - BootService::class, - ]; - - /** - * 注册的系统服务 - * @var array - */ - protected $services = []; - - /** - * 初始化 - * @var bool - */ - protected $initialized = false; - - /** - * 容器绑定标识 - * @var array - */ - protected $bind = [ - 'app' => App::class, - 'cache' => Cache::class, - 'config' => Config::class, - 'console' => Console::class, - 'cookie' => Cookie::class, - 'db' => Db::class, - 'env' => Env::class, - 'event' => Event::class, - 'http' => Http::class, - 'lang' => Lang::class, - 'log' => Log::class, - 'middleware' => Middleware::class, - 'request' => Request::class, - 'response' => Response::class, - 'route' => Route::class, - 'session' => Session::class, - 'validate' => Validate::class, - 'view' => View::class, - 'filesystem' => Filesystem::class, - 'think\DbManager' => Db::class, - 'think\LogManager' => Log::class, - 'think\CacheManager' => Cache::class, - - // 接口依赖注入 - 'Psr\Log\LoggerInterface' => Log::class, - ]; - - /** - * 架构方法 - * @access public - * @param string $rootPath 应用根目录 - */ - public function __construct(string $rootPath = '') - { - $this->thinkPath = dirname(__DIR__) . DIRECTORY_SEPARATOR; - $this->rootPath = $rootPath ? rtrim($rootPath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : $this->getDefaultRootPath(); - $this->appPath = $this->rootPath . 'app' . DIRECTORY_SEPARATOR; - $this->runtimePath = $this->rootPath . 'runtime' . DIRECTORY_SEPARATOR; - - if (is_file($this->appPath . 'provider.php')) { - $this->bind(include $this->appPath . 'provider.php'); - } - - static::setInstance($this); - - $this->instance('app', $this); - $this->instance('think\Container', $this); - } - - /** - * 注册服务 - * @access public - * @param Service|string $service 服务 - * @param bool $force 强制重新注册 - * @return Service|null - */ - public function register($service, bool $force = false) - { - $registered = $this->getService($service); - - if ($registered && !$force) { - return $registered; - } - - if (is_string($service)) { - $service = new $service($this); - } - - if (method_exists($service, 'register')) { - $service->register(); - } - - if (property_exists($service, 'bind')) { - $this->bind($service->bind); - } - - $this->services[] = $service; - } - - /** - * 执行服务 - * @access public - * @param Service $service 服务 - * @return mixed - */ - public function bootService($service) - { - if (method_exists($service, 'boot')) { - return $this->invoke([$service, 'boot']); - } - } - - /** - * 获取服务 - * @param string|Service $service - * @return Service|null - */ - public function getService($service) - { - $name = is_string($service) ? $service : get_class($service); - return array_values(array_filter($this->services, function ($value) use ($name) { - return $value instanceof $name; - }, ARRAY_FILTER_USE_BOTH))[0] ?? null; - } - - /** - * 开启应用调试模式 - * @access public - * @param bool $debug 开启应用调试模式 - * @return $this - */ - public function debug(bool $debug = true) - { - $this->appDebug = $debug; - return $this; - } - - /** - * 是否为调试模式 - * @access public - * @return bool - */ - public function isDebug(): bool - { - return $this->appDebug; - } - - /** - * 设置应用命名空间 - * @access public - * @param string $namespace 应用命名空间 - * @return $this - */ - public function setNamespace(string $namespace) - { - $this->namespace = $namespace; - return $this; - } - - /** - * 获取应用类库命名空间 - * @access public - * @return string - */ - public function getNamespace(): string - { - return $this->namespace; - } - - /** - * 获取框架版本 - * @access public - * @return string - */ - public function version(): string - { - return static::VERSION; - } - - /** - * 获取应用根目录 - * @access public - * @return string - */ - public function getRootPath(): string - { - return $this->rootPath; - } - - /** - * 获取应用基础目录 - * @access public - * @return string - */ - public function getBasePath(): string - { - return $this->rootPath . 'app' . DIRECTORY_SEPARATOR; - } - - /** - * 获取当前应用目录 - * @access public - * @return string - */ - public function getAppPath(): string - { - return $this->appPath; - } - - /** - * 设置应用目录 - * @param string $path 应用目录 - */ - public function setAppPath(string $path) - { - $this->appPath = $path; - } - - /** - * 获取应用运行时目录 - * @access public - * @return string - */ - public function getRuntimePath(): string - { - return $this->runtimePath; - } - - /** - * 设置runtime目录 - * @param string $path 定义目录 - */ - public function setRuntimePath(string $path): void - { - $this->runtimePath = $path; - } - - /** - * 获取核心框架目录 - * @access public - * @return string - */ - public function getThinkPath(): string - { - return $this->thinkPath; - } - - /** - * 获取应用配置目录 - * @access public - * @return string - */ - public function getConfigPath(): string - { - return $this->rootPath . 'config' . DIRECTORY_SEPARATOR; - } - - /** - * 获取配置后缀 - * @access public - * @return string - */ - public function getConfigExt(): string - { - return $this->configExt; - } - - /** - * 获取应用开启时间 - * @access public - * @return float - */ - public function getBeginTime(): float - { - return $this->beginTime; - } - - /** - * 获取应用初始内存占用 - * @access public - * @return integer - */ - public function getBeginMem(): int - { - return $this->beginMem; - } - - /** - * 初始化应用 - * @access public - * @return $this - */ - public function initialize() - { - $this->initialized = true; - - $this->beginTime = microtime(true); - $this->beginMem = memory_get_usage(); - - // 加载环境变量 - if (is_file($this->rootPath . '.env')) { - $this->env->load($this->rootPath . '.env'); - } - - $this->configExt = $this->env->get('config_ext', '.php'); - - $this->debugModeInit(); - - // 加载全局初始化文件 - $this->load(); - - // 加载框架默认语言包 - $langSet = $this->lang->defaultLangSet(); - - $this->lang->load($this->thinkPath . 'lang' . DIRECTORY_SEPARATOR . $langSet . '.php'); - - // 加载应用默认语言包 - $this->loadLangPack($langSet); - - // 监听AppInit - $this->event->trigger(AppInit::class); - - date_default_timezone_set($this->config->get('app.default_timezone', 'Asia/Shanghai')); - - // 初始化 - foreach ($this->initializers as $initializer) { - $this->make($initializer)->init($this); - } - - return $this; - } - - /** - * 是否初始化过 - * @return bool - */ - public function initialized() - { - return $this->initialized; - } - - /** - * 加载语言包 - * @param string $langset 语言 - * @return void - */ - public function loadLangPack($langset) - { - if (empty($langset)) { - return; - } - - // 加载系统语言包 - $files = glob($this->appPath . 'lang' . DIRECTORY_SEPARATOR . $langset . '.*'); - $this->lang->load($files); - - // 加载扩展(自定义)语言包 - $list = $this->config->get('lang.extend_list', []); - - if (isset($list[$langset])) { - $this->lang->load($list[$langset]); - } - } - - /** - * 引导应用 - * @access public - * @return void - */ - public function boot(): void - { - array_walk($this->services, function ($service) { - $this->bootService($service); - }); - } - - /** - * 加载应用文件和配置 - * @access protected - * @return void - */ - protected function load(): void - { - $appPath = $this->getAppPath(); - - if (is_file($appPath . 'common.php')) { - include_once $appPath . 'common.php'; - } - - include_once $this->thinkPath . 'helper.php'; - - $configPath = $this->getConfigPath(); - - $files = []; - - if (is_dir($configPath)) { - $files = glob($configPath . '*' . $this->configExt); - } - - foreach ($files as $file) { - $this->config->load($file, pathinfo($file, PATHINFO_FILENAME)); - } - - if (is_file($appPath . 'event.php')) { - $this->loadEvent(include $appPath . 'event.php'); - } - - if (is_file($appPath . 'service.php')) { - $services = include $appPath . 'service.php'; - foreach ($services as $service) { - $this->register($service); - } - } - } - - /** - * 调试模式设置 - * @access protected - * @return void - */ - protected function debugModeInit(): void - { - // 应用调试模式 - if (!$this->appDebug) { - $this->appDebug = $this->env->get('app_debug') ? true : false; - ini_set('display_errors', 'Off'); - } - - if (!$this->runningInConsole()) { - //重新申请一块比较大的buffer - if (ob_get_level() > 0) { - $output = ob_get_clean(); - } - ob_start(); - if (!empty($output)) { - echo $output; - } - } - } - - /** - * 注册应用事件 - * @access protected - * @param array $event 事件数据 - * @return void - */ - public function loadEvent(array $event): void - { - if (isset($event['bind'])) { - $this->event->bind($event['bind']); - } - - if (isset($event['listen'])) { - $this->event->listenEvents($event['listen']); - } - - if (isset($event['subscribe'])) { - $this->event->subscribe($event['subscribe']); - } - } - - /** - * 解析应用类的类名 - * @access public - * @param string $layer 层名 controller model ... - * @param string $name 类名 - * @return string - */ - public function parseClass(string $layer, string $name): string - { - $name = str_replace(['/', '.'], '\\', $name); - $array = explode('\\', $name); - $class = Str::studly(array_pop($array)); - $path = $array ? implode('\\', $array) . '\\' : ''; - - return $this->namespace . '\\' . $layer . '\\' . $path . $class; - } - - /** - * 是否运行在命令行下 - * @return bool - */ - public function runningInConsole() - { - return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; - } - - /** - * 获取应用根目录 - * @access protected - * @return string - */ - protected function getDefaultRootPath(): string - { - return dirname($this->thinkPath, 4) . DIRECTORY_SEPARATOR; - } - -} diff --git a/vendor/topthink/framework/src/think/Cache.php b/vendor/topthink/framework/src/think/Cache.php deleted file mode 100644 index f802b55..0000000 --- a/vendor/topthink/framework/src/think/Cache.php +++ /dev/null @@ -1,197 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use Psr\SimpleCache\CacheInterface; -use think\cache\Driver; -use think\cache\TagSet; -use think\exception\InvalidArgumentException; -use think\helper\Arr; - -/** - * 缓存管理类 - * @mixin Driver - * @mixin \think\cache\driver\File - */ -class Cache extends Manager implements CacheInterface -{ - - protected $namespace = '\\think\\cache\\driver\\'; - - /** - * 默认驱动 - * @return string|null - */ - public function getDefaultDriver() - { - return $this->getConfig('default'); - } - - /** - * 获取缓存配置 - * @access public - * @param null|string $name 名称 - * @param mixed $default 默认值 - * @return mixed - */ - public function getConfig(string $name = null, $default = null) - { - if (!is_null($name)) { - return $this->app->config->get('cache.' . $name, $default); - } - - return $this->app->config->get('cache'); - } - - /** - * 获取驱动配置 - * @param string $store - * @param string $name - * @param null $default - * @return array - */ - public function getStoreConfig(string $store, string $name = null, $default = null) - { - if ($config = $this->getConfig("stores.{$store}")) { - return Arr::get($config, $name, $default); - } - - throw new \InvalidArgumentException("Store [$store] not found."); - } - - protected function resolveType(string $name) - { - return $this->getStoreConfig($name, 'type', 'file'); - } - - protected function resolveConfig(string $name) - { - return $this->getStoreConfig($name); - } - - /** - * 连接或者切换缓存 - * @access public - * @param string $name 连接配置名 - * @return Driver - */ - public function store(string $name = null) - { - return $this->driver($name); - } - - /** - * 清空缓冲池 - * @access public - * @return bool - */ - public function clear(): bool - { - return $this->store()->clear(); - } - - /** - * 读取缓存 - * @access public - * @param string $key 缓存变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get($key, $default = null) - { - return $this->store()->get($key, $default); - } - - /** - * 写入缓存 - * @access public - * @param string $key 缓存变量名 - * @param mixed $value 存储数据 - * @param int|\DateTime $ttl 有效时间 0为永久 - * @return bool - */ - public function set($key, $value, $ttl = null): bool - { - return $this->store()->set($key, $value, $ttl); - } - - /** - * 删除缓存 - * @access public - * @param string $key 缓存变量名 - * @return bool - */ - public function delete($key): bool - { - return $this->store()->delete($key); - } - - /** - * 读取缓存 - * @access public - * @param iterable $keys 缓存变量名 - * @param mixed $default 默认值 - * @return iterable - * @throws InvalidArgumentException - */ - public function getMultiple($keys, $default = null): iterable - { - return $this->store()->getMultiple($keys, $default); - } - - /** - * 写入缓存 - * @access public - * @param iterable $values 缓存数据 - * @param null|int|\DateInterval $ttl 有效时间 0为永久 - * @return bool - */ - public function setMultiple($values, $ttl = null): bool - { - return $this->store()->setMultiple($values, $ttl); - } - - /** - * 删除缓存 - * @access public - * @param iterable $keys 缓存变量名 - * @return bool - * @throws InvalidArgumentException - */ - public function deleteMultiple($keys): bool - { - return $this->store()->deleteMultiple($keys); - } - - /** - * 判断缓存是否存在 - * @access public - * @param string $key 缓存变量名 - * @return bool - */ - public function has($key): bool - { - return $this->store()->has($key); - } - - /** - * 缓存标签 - * @access public - * @param string|array $name 标签名 - * @return TagSet - */ - public function tag($name): TagSet - { - return $this->store()->tag($name); - } -} diff --git a/vendor/topthink/framework/src/think/Config.php b/vendor/topthink/framework/src/think/Config.php deleted file mode 100644 index 9162e82..0000000 --- a/vendor/topthink/framework/src/think/Config.php +++ /dev/null @@ -1,197 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -/** - * 配置管理类 - * @package think - */ -class Config -{ - /** - * 配置参数 - * @var array - */ - protected $config = []; - - /** - * 配置文件目录 - * @var string - */ - protected $path; - - /** - * 配置文件后缀 - * @var string - */ - protected $ext; - - /** - * 构造方法 - * @access public - */ - public function __construct(string $path = null, string $ext = '.php') - { - $this->path = $path ?: ''; - $this->ext = $ext; - } - - public static function __make(App $app) - { - $path = $app->getConfigPath(); - $ext = $app->getConfigExt(); - - return new static($path, $ext); - } - - /** - * 加载配置文件(多种格式) - * @access public - * @param string $file 配置文件名 - * @param string $name 一级配置名 - * @return array - */ - public function load(string $file, string $name = ''): array - { - if (is_file($file)) { - $filename = $file; - } elseif (is_file($this->path . $file . $this->ext)) { - $filename = $this->path . $file . $this->ext; - } - - if (isset($filename)) { - return $this->parse($filename, $name); - } - - return $this->config; - } - - /** - * 解析配置文件 - * @access public - * @param string $file 配置文件名 - * @param string $name 一级配置名 - * @return array - */ - protected function parse(string $file, string $name): array - { - $type = pathinfo($file, PATHINFO_EXTENSION); - $config = []; - switch ($type) { - case 'php': - $config = include $file; - break; - case 'yml': - case 'yaml': - if (function_exists('yaml_parse_file')) { - $config = yaml_parse_file($file); - } - break; - case 'ini': - $config = parse_ini_file($file, true, INI_SCANNER_TYPED) ?: []; - break; - case 'json': - $config = json_decode(file_get_contents($file), true); - break; - } - - return is_array($config) ? $this->set($config, strtolower($name)) : []; - } - - /** - * 检测配置是否存在 - * @access public - * @param string $name 配置参数名(支持多级配置 .号分割) - * @return bool - */ - public function has(string $name): bool - { - if (false === strpos($name, '.') && !isset($this->config[strtolower($name)])) { - return false; - } - - return !is_null($this->get($name)); - } - - /** - * 获取一级配置 - * @access protected - * @param string $name 一级配置名 - * @return array - */ - protected function pull(string $name): array - { - $name = strtolower($name); - - return $this->config[$name] ?? []; - } - - /** - * 获取配置参数 为空则获取所有配置 - * @access public - * @param string $name 配置参数名(支持多级配置 .号分割) - * @param mixed $default 默认值 - * @return mixed - */ - public function get(string $name = null, $default = null) - { - // 无参数时获取所有 - if (empty($name)) { - return $this->config; - } - - if (false === strpos($name, '.')) { - return $this->pull($name); - } - - $name = explode('.', $name); - $name[0] = strtolower($name[0]); - $config = $this->config; - - // 按.拆分成多维数组进行判断 - foreach ($name as $val) { - if (isset($config[$val])) { - $config = $config[$val]; - } else { - return $default; - } - } - - return $config; - } - - /** - * 设置配置参数 name为数组则为批量设置 - * @access public - * @param array $config 配置参数 - * @param string $name 配置名 - * @return array - */ - public function set(array $config, string $name = null): array - { - if (!empty($name)) { - if (isset($this->config[$name])) { - $result = array_merge($this->config[$name], $config); - } else { - $result = $config; - } - - $this->config[$name] = $result; - } else { - $result = $this->config = array_merge($this->config, array_change_key_case($config)); - } - - return $result; - } - -} diff --git a/vendor/topthink/framework/src/think/Console.php b/vendor/topthink/framework/src/think/Console.php deleted file mode 100644 index 389d104..0000000 --- a/vendor/topthink/framework/src/think/Console.php +++ /dev/null @@ -1,787 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use Closure; -use InvalidArgumentException; -use LogicException; -use think\console\Command; -use think\console\command\Clear; -use think\console\command\Help; -use think\console\command\Help as HelpCommand; -use think\console\command\Lists; -use think\console\command\make\Command as MakeCommand; -use think\console\command\make\Controller; -use think\console\command\make\Event; -use think\console\command\make\Listener; -use think\console\command\make\Middleware; -use think\console\command\make\Model; -use think\console\command\make\Service; -use think\console\command\make\Subscribe; -use think\console\command\make\Validate; -use think\console\command\optimize\Route; -use think\console\command\optimize\Schema; -use think\console\command\RouteList; -use think\console\command\RunServer; -use think\console\command\ServiceDiscover; -use think\console\command\VendorPublish; -use think\console\command\Version; -use think\console\Input; -use think\console\input\Argument as InputArgument; -use think\console\input\Definition as InputDefinition; -use think\console\input\Option as InputOption; -use think\console\Output; -use think\console\output\driver\Buffer; - -/** - * 控制台应用管理类 - */ -class Console -{ - - protected $app; - - /** @var Command[] */ - protected $commands = []; - - protected $wantHelps = false; - - protected $catchExceptions = true; - protected $autoExit = true; - protected $definition; - protected $defaultCommand = 'list'; - - protected $defaultCommands = [ - 'help' => Help::class, - 'list' => Lists::class, - 'clear' => Clear::class, - 'make:command' => MakeCommand::class, - 'make:controller' => Controller::class, - 'make:model' => Model::class, - 'make:middleware' => Middleware::class, - 'make:validate' => Validate::class, - 'make:event' => Event::class, - 'make:listener' => Listener::class, - 'make:service' => Service::class, - 'make:subscribe' => Subscribe::class, - 'optimize:route' => Route::class, - 'optimize:schema' => Schema::class, - 'run' => RunServer::class, - 'version' => Version::class, - 'route:list' => RouteList::class, - 'service:discover' => ServiceDiscover::class, - 'vendor:publish' => VendorPublish::class, - ]; - - /** - * 启动器 - * @var array - */ - protected static $startCallbacks = []; - - public function __construct(App $app) - { - $this->app = $app; - - $this->initialize(); - - $this->definition = $this->getDefaultInputDefinition(); - - //加载指令 - $this->loadCommands(); - - $this->start(); - } - - /** - * 初始化 - */ - protected function initialize() - { - if (!$this->app->initialized()) { - $this->app->initialize(); - } - $this->makeRequest(); - } - - /** - * 构造request - */ - protected function makeRequest() - { - $uri = $this->app->config->get('app.url', 'http://localhost'); - - $components = parse_url($uri); - - $server = $_SERVER; - - if (isset($components['path'])) { - $server = array_merge($server, [ - 'SCRIPT_FILENAME' => $components['path'], - 'SCRIPT_NAME' => $components['path'], - ]); - } - - if (isset($components['host'])) { - $server['SERVER_NAME'] = $components['host']; - $server['HTTP_HOST'] = $components['host']; - } - - if (isset($components['scheme'])) { - if ('https' === $components['scheme']) { - $server['HTTPS'] = 'on'; - $server['SERVER_PORT'] = 443; - } else { - unset($server['HTTPS']); - $server['SERVER_PORT'] = 80; - } - } - - if (isset($components['port'])) { - $server['SERVER_PORT'] = $components['port']; - $server['HTTP_HOST'] .= ':' . $components['port']; - } - - $server['REQUEST_URI'] = $uri; - - /** @var Request $request */ - $request = $this->app->make('request'); - - $request->withServer($server); - } - - /** - * 添加初始化器 - * @param Closure $callback - */ - public static function starting(Closure $callback): void - { - static::$startCallbacks[] = $callback; - } - - /** - * 清空启动器 - */ - public static function flushStartCallbacks(): void - { - static::$startCallbacks = []; - } - - /** - * 设置执行用户 - * @param $user - */ - public static function setUser(string $user): void - { - if (extension_loaded('posix')) { - $user = posix_getpwnam($user); - - if (!empty($user)) { - posix_setgid($user['gid']); - posix_setuid($user['uid']); - } - } - } - - /** - * 启动 - */ - protected function start(): void - { - foreach (static::$startCallbacks as $callback) { - $callback($this); - } - } - - /** - * 加载指令 - * @access protected - */ - protected function loadCommands(): void - { - $commands = $this->app->config->get('console.commands', []); - $commands = array_merge($this->defaultCommands, $commands); - - $this->addCommands($commands); - } - - /** - * @access public - * @param string $command - * @param array $parameters - * @param string $driver - * @return Output|Buffer - */ - public function call(string $command, array $parameters = [], string $driver = 'buffer') - { - array_unshift($parameters, $command); - - $input = new Input($parameters); - $output = new Output($driver); - - $this->setCatchExceptions(false); - $this->find($command)->run($input, $output); - - return $output; - } - - /** - * 执行当前的指令 - * @access public - * @return int - * @throws \Exception - * @api - */ - public function run() - { - $input = new Input(); - $output = new Output(); - - $this->configureIO($input, $output); - - try { - $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { - throw $e; - } - - $output->renderException($e); - - $exitCode = $e->getCode(); - if (is_numeric($exitCode)) { - $exitCode = (int) $exitCode; - if (0 === $exitCode) { - $exitCode = 1; - } - } else { - $exitCode = 1; - } - } - - if ($this->autoExit) { - if ($exitCode > 255) { - $exitCode = 255; - } - - exit($exitCode); - } - - return $exitCode; - } - - /** - * 执行指令 - * @access public - * @param Input $input - * @param Output $output - * @return int - */ - public function doRun(Input $input, Output $output) - { - if (true === $input->hasParameterOption(['--version', '-V'])) { - $output->writeln($this->getLongVersion()); - - return 0; - } - - $name = $this->getCommandName($input); - - if (true === $input->hasParameterOption(['--help', '-h'])) { - if (!$name) { - $name = 'help'; - $input = new Input(['help']); - } else { - $this->wantHelps = true; - } - } - - if (!$name) { - $name = $this->defaultCommand; - $input = new Input([$this->defaultCommand]); - } - - $command = $this->find($name); - - return $this->doRunCommand($command, $input, $output); - } - - /** - * 设置输入参数定义 - * @access public - * @param InputDefinition $definition - */ - public function setDefinition(InputDefinition $definition): void - { - $this->definition = $definition; - } - - /** - * 获取输入参数定义 - * @access public - * @return InputDefinition The InputDefinition instance - */ - public function getDefinition(): InputDefinition - { - return $this->definition; - } - - /** - * Gets the help message. - * @access public - * @return string A help message. - */ - public function getHelp(): string - { - return $this->getLongVersion(); - } - - /** - * 是否捕获异常 - * @access public - * @param bool $boolean - * @api - */ - public function setCatchExceptions(bool $boolean): void - { - $this->catchExceptions = $boolean; - } - - /** - * 是否自动退出 - * @access public - * @param bool $boolean - * @api - */ - public function setAutoExit(bool $boolean): void - { - $this->autoExit = $boolean; - } - - /** - * 获取完整的版本号 - * @access public - * @return string - */ - public function getLongVersion(): string - { - if ($this->app->version()) { - return sprintf('version %s', $this->app->version()); - } - - return 'Console Tool'; - } - - /** - * 添加指令集 - * @access public - * @param array $commands - */ - public function addCommands(array $commands): void - { - foreach ($commands as $key => $command) { - if (is_subclass_of($command, Command::class)) { - // 注册指令 - $this->addCommand($command, is_numeric($key) ? '' : $key); - } - } - } - - /** - * 添加一个指令 - * @access public - * @param string|Command $command 指令对象或者指令类名 - * @param string $name 指令名 留空则自动获取 - * @return Command|void - */ - public function addCommand($command, string $name = '') - { - if ($name) { - $this->commands[$name] = $command; - return; - } - - if (is_string($command)) { - $command = $this->app->invokeClass($command); - } - - $command->setConsole($this); - - if (!$command->isEnabled()) { - $command->setConsole(null); - return; - } - - $command->setApp($this->app); - - if (null === $command->getDefinition()) { - throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command))); - } - - $this->commands[$command->getName()] = $command; - - foreach ($command->getAliases() as $alias) { - $this->commands[$alias] = $command; - } - - return $command; - } - - /** - * 获取指令 - * @access public - * @param string $name 指令名称 - * @return Command - * @throws InvalidArgumentException - */ - public function getCommand(string $name): Command - { - if (!isset($this->commands[$name])) { - throw new InvalidArgumentException(sprintf('The command "%s" does not exist.', $name)); - } - - $command = $this->commands[$name]; - - if (is_string($command)) { - $command = $this->app->invokeClass($command); - /** @var Command $command */ - $command->setConsole($this); - $command->setApp($this->app); - } - - if ($this->wantHelps) { - $this->wantHelps = false; - - /** @var HelpCommand $helpCommand */ - $helpCommand = $this->getCommand('help'); - $helpCommand->setCommand($command); - - return $helpCommand; - } - - return $command; - } - - /** - * 某个指令是否存在 - * @access public - * @param string $name 指令名称 - * @return bool - */ - public function hasCommand(string $name): bool - { - return isset($this->commands[$name]); - } - - /** - * 获取所有的命名空间 - * @access public - * @return array - */ - public function getNamespaces(): array - { - $namespaces = []; - foreach ($this->commands as $key => $command) { - if (is_string($command)) { - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($key)); - } else { - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName())); - - foreach ($command->getAliases() as $alias) { - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias)); - } - } - } - - return array_values(array_unique(array_filter($namespaces))); - } - - /** - * 查找注册命名空间中的名称或缩写。 - * @access public - * @param string $namespace - * @return string - * @throws InvalidArgumentException - */ - public function findNamespace(string $namespace): string - { - $allNamespaces = $this->getNamespaces(); - $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { - return preg_quote($matches[1]) . '[^:]*'; - }, $namespace); - $namespaces = preg_grep('{^' . $expr . '}', $allNamespaces); - - if (empty($namespaces)) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); - - if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { - if (1 == count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - - $message .= implode("\n ", $alternatives); - } - - throw new InvalidArgumentException($message); - } - - $exact = in_array($namespace, $namespaces, true); - if (count($namespaces) > 1 && !$exact) { - throw new InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces)))); - } - - return $exact ? $namespace : reset($namespaces); - } - - /** - * 查找指令 - * @access public - * @param string $name 名称或者别名 - * @return Command - * @throws InvalidArgumentException - */ - public function find(string $name): Command - { - $allCommands = array_keys($this->commands); - - $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { - return preg_quote($matches[1]) . '[^:]*'; - }, $name); - - $commands = preg_grep('{^' . $expr . '}', $allCommands); - - if (empty($commands) || count(preg_grep('{^' . $expr . '$}', $commands)) < 1) { - if (false !== $pos = strrpos($name, ':')) { - $this->findNamespace(substr($name, 0, $pos)); - } - - $message = sprintf('Command "%s" is not defined.', $name); - - if ($alternatives = $this->findAlternatives($name, $allCommands)) { - if (1 == count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - $message .= implode("\n ", $alternatives); - } - - throw new InvalidArgumentException($message); - } - - $exact = in_array($name, $commands, true); - if (count($commands) > 1 && !$exact) { - $suggestions = $this->getAbbreviationSuggestions(array_values($commands)); - - throw new InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions)); - } - - return $this->getCommand($exact ? $name : reset($commands)); - } - - /** - * 获取所有的指令 - * @access public - * @param string $namespace 命名空间 - * @return Command[] - * @api - */ - public function all(string $namespace = null): array - { - if (null === $namespace) { - return $this->commands; - } - - $commands = []; - foreach ($this->commands as $name => $command) { - if ($this->extractNamespace($name, substr_count($namespace, ':') + 1) === $namespace) { - $commands[$name] = $command; - } - } - - return $commands; - } - - /** - * 配置基于用户的参数和选项的输入和输出实例。 - * @access protected - * @param Input $input 输入实例 - * @param Output $output 输出实例 - */ - protected function configureIO(Input $input, Output $output): void - { - if (true === $input->hasParameterOption(['--ansi'])) { - $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(['--no-ansi'])) { - $output->setDecorated(false); - } - - if (true === $input->hasParameterOption(['--no-interaction', '-n'])) { - $input->setInteractive(false); - } - - if (true === $input->hasParameterOption(['--quiet', '-q'])) { - $output->setVerbosity(Output::VERBOSITY_QUIET); - } elseif ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) { - $output->setVerbosity(Output::VERBOSITY_DEBUG); - } elseif ($input->hasParameterOption('-vv') || $input->hasParameterOption('--verbose=2') || $input->getParameterOption('--verbose') === 2) { - $output->setVerbosity(Output::VERBOSITY_VERY_VERBOSE); - } elseif ($input->hasParameterOption('-v') || $input->hasParameterOption('--verbose=1') || $input->hasParameterOption('--verbose') || $input->getParameterOption('--verbose')) { - $output->setVerbosity(Output::VERBOSITY_VERBOSE); - } - } - - /** - * 执行指令 - * @access protected - * @param Command $command 指令实例 - * @param Input $input 输入实例 - * @param Output $output 输出实例 - * @return int - * @throws \Exception - */ - protected function doRunCommand(Command $command, Input $input, Output $output) - { - return $command->run($input, $output); - } - - /** - * 获取指令的基础名称 - * @access protected - * @param Input $input - * @return string - */ - protected function getCommandName(Input $input): string - { - return $input->getFirstArgument() ?: ''; - } - - /** - * 获取默认输入定义 - * @access protected - * @return InputDefinition - */ - protected function getDefaultInputDefinition(): InputDefinition - { - return new InputDefinition([ - new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this console version'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), - new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), - new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), - ]); - } - - /** - * 获取可能的建议 - * @access private - * @param array $abbrevs - * @return string - */ - private function getAbbreviationSuggestions(array $abbrevs): string - { - return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : ''); - } - - /** - * 返回命名空间部分 - * @access public - * @param string $name 指令 - * @param int $limit 部分的命名空间的最大数量 - * @return string - */ - public function extractNamespace(string $name, int $limit = 0): string - { - $parts = explode(':', $name); - array_pop($parts); - - return implode(':', 0 === $limit ? $parts : array_slice($parts, 0, $limit)); - } - - /** - * 查找可替代的建议 - * @access private - * @param string $name - * @param array|\Traversable $collection - * @return array - */ - private function findAlternatives(string $name, $collection): array - { - $threshold = 1e3; - $alternatives = []; - - $collectionParts = []; - foreach ($collection as $item) { - $collectionParts[$item] = explode(':', $item); - } - - foreach (explode(':', $name) as $i => $subname) { - foreach ($collectionParts as $collectionName => $parts) { - $exists = isset($alternatives[$collectionName]); - if (!isset($parts[$i]) && $exists) { - $alternatives[$collectionName] += $threshold; - continue; - } elseif (!isset($parts[$i])) { - continue; - } - - $lev = levenshtein($subname, $parts[$i]); - if ($lev <= strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) { - $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; - } elseif ($exists) { - $alternatives[$collectionName] += $threshold; - } - } - } - - foreach ($collection as $item) { - $lev = levenshtein($name, $item); - if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) { - $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; - } - } - - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { - return $lev < 2 * $threshold; - }); - asort($alternatives); - - return array_keys($alternatives); - } - - /** - * 返回所有的命名空间 - * @access private - * @param string $name - * @return array - */ - private function extractAllNamespaces(string $name): array - { - $parts = explode(':', $name, -1); - $namespaces = []; - - foreach ($parts as $part) { - if (count($namespaces)) { - $namespaces[] = end($namespaces) . ':' . $part; - } else { - $namespaces[] = $part; - } - } - - return $namespaces; - } - -} diff --git a/vendor/topthink/framework/src/think/Container.php b/vendor/topthink/framework/src/think/Container.php deleted file mode 100644 index 74026bb..0000000 --- a/vendor/topthink/framework/src/think/Container.php +++ /dev/null @@ -1,554 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use ArrayAccess; -use ArrayIterator; -use Closure; -use Countable; -use InvalidArgumentException; -use IteratorAggregate; -use Psr\Container\ContainerInterface; -use ReflectionClass; -use ReflectionException; -use ReflectionFunction; -use ReflectionFunctionAbstract; -use ReflectionMethod; -use think\exception\ClassNotFoundException; -use think\exception\FuncNotFoundException; -use think\helper\Str; - -/** - * 容器管理类 支持PSR-11 - */ -class Container implements ContainerInterface, ArrayAccess, IteratorAggregate, Countable -{ - /** - * 容器对象实例 - * @var Container|Closure - */ - protected static $instance; - - /** - * 容器中的对象实例 - * @var array - */ - protected $instances = []; - - /** - * 容器绑定标识 - * @var array - */ - protected $bind = []; - - /** - * 容器回调 - * @var array - */ - protected $invokeCallback = []; - - /** - * 获取当前容器的实例(单例) - * @access public - * @return static - */ - public static function getInstance() - { - if (is_null(static::$instance)) { - static::$instance = new static; - } - - if (static::$instance instanceof Closure) { - return (static::$instance)(); - } - - return static::$instance; - } - - /** - * 设置当前容器的实例 - * @access public - * @param object|Closure $instance - * @return void - */ - public static function setInstance($instance): void - { - static::$instance = $instance; - } - - /** - * 注册一个容器对象回调 - * - * @param string|Closure $abstract - * @param Closure|null $callback - * @return void - */ - public function resolving($abstract, Closure $callback = null): void - { - if ($abstract instanceof Closure) { - $this->invokeCallback['*'][] = $abstract; - return; - } - - $abstract = $this->getAlias($abstract); - - $this->invokeCallback[$abstract][] = $callback; - } - - /** - * 获取容器中的对象实例 不存在则创建 - * @access public - * @param string $abstract 类名或者标识 - * @param array|true $vars 变量 - * @param bool $newInstance 是否每次创建新的实例 - * @return object - */ - public static function pull(string $abstract, array $vars = [], bool $newInstance = false) - { - return static::getInstance()->make($abstract, $vars, $newInstance); - } - - /** - * 获取容器中的对象实例 - * @access public - * @param string $abstract 类名或者标识 - * @return object - */ - public function get($abstract) - { - if ($this->has($abstract)) { - return $this->make($abstract); - } - - throw new ClassNotFoundException('class not exists: ' . $abstract, $abstract); - } - - /** - * 绑定一个类、闭包、实例、接口实现到容器 - * @access public - * @param string|array $abstract 类标识、接口 - * @param mixed $concrete 要绑定的类、闭包或者实例 - * @return $this - */ - public function bind($abstract, $concrete = null) - { - if (is_array($abstract)) { - foreach ($abstract as $key => $val) { - $this->bind($key, $val); - } - } elseif ($concrete instanceof Closure) { - $this->bind[$abstract] = $concrete; - } elseif (is_object($concrete)) { - $this->instance($abstract, $concrete); - } else { - $abstract = $this->getAlias($abstract); - if ($abstract != $concrete) { - $this->bind[$abstract] = $concrete; - } - } - - return $this; - } - - /** - * 根据别名获取真实类名 - * @param string $abstract - * @return string - */ - public function getAlias(string $abstract): string - { - if (isset($this->bind[$abstract])) { - $bind = $this->bind[$abstract]; - - if (is_string($bind)) { - return $this->getAlias($bind); - } - } - - return $abstract; - } - - /** - * 绑定一个类实例到容器 - * @access public - * @param string $abstract 类名或者标识 - * @param object $instance 类的实例 - * @return $this - */ - public function instance(string $abstract, $instance) - { - $abstract = $this->getAlias($abstract); - - $this->instances[$abstract] = $instance; - - return $this; - } - - /** - * 判断容器中是否存在类及标识 - * @access public - * @param string $abstract 类名或者标识 - * @return bool - */ - public function bound(string $abstract): bool - { - return isset($this->bind[$abstract]) || isset($this->instances[$abstract]); - } - - /** - * 判断容器中是否存在类及标识 - * @access public - * @param string $name 类名或者标识 - * @return bool - */ - public function has($name): bool - { - return $this->bound($name); - } - - /** - * 判断容器中是否存在对象实例 - * @access public - * @param string $abstract 类名或者标识 - * @return bool - */ - public function exists(string $abstract): bool - { - $abstract = $this->getAlias($abstract); - - return isset($this->instances[$abstract]); - } - - /** - * 创建类的实例 已经存在则直接获取 - * @access public - * @param string $abstract 类名或者标识 - * @param array $vars 变量 - * @param bool $newInstance 是否每次创建新的实例 - * @return mixed - */ - public function make(string $abstract, array $vars = [], bool $newInstance = false) - { - $abstract = $this->getAlias($abstract); - - if (isset($this->instances[$abstract]) && !$newInstance) { - return $this->instances[$abstract]; - } - - if (isset($this->bind[$abstract]) && $this->bind[$abstract] instanceof Closure) { - $object = $this->invokeFunction($this->bind[$abstract], $vars); - } else { - $object = $this->invokeClass($abstract, $vars); - } - - if (!$newInstance) { - $this->instances[$abstract] = $object; - } - - return $object; - } - - /** - * 删除容器中的对象实例 - * @access public - * @param string $name 类名或者标识 - * @return void - */ - public function delete($name) - { - $name = $this->getAlias($name); - - if (isset($this->instances[$name])) { - unset($this->instances[$name]); - } - } - - /** - * 执行函数或者闭包方法 支持参数调用 - * @access public - * @param string|Closure $function 函数或者闭包 - * @param array $vars 参数 - * @return mixed - */ - public function invokeFunction($function, array $vars = []) - { - try { - $reflect = new ReflectionFunction($function); - } catch (ReflectionException $e) { - throw new FuncNotFoundException("function not exists: {$function}()", $function, $e); - } - - $args = $this->bindParams($reflect, $vars); - - return $function(...$args); - } - - /** - * 调用反射执行类的方法 支持参数绑定 - * @access public - * @param mixed $method 方法 - * @param array $vars 参数 - * @param bool $accessible 设置是否可访问 - * @return mixed - */ - public function invokeMethod($method, array $vars = [], bool $accessible = false) - { - if (is_array($method)) { - [$class, $method] = $method; - - $class = is_object($class) ? $class : $this->invokeClass($class); - } else { - // 静态方法 - [$class, $method] = explode('::', $method); - } - - try { - $reflect = new ReflectionMethod($class, $method); - } catch (ReflectionException $e) { - $class = is_object($class) ? get_class($class) : $class; - throw new FuncNotFoundException('method not exists: ' . $class . '::' . $method . '()', "{$class}::{$method}", $e); - } - - $args = $this->bindParams($reflect, $vars); - - if ($accessible) { - $reflect->setAccessible($accessible); - } - - return $reflect->invokeArgs(is_object($class) ? $class : null, $args); - } - - /** - * 调用反射执行类的方法 支持参数绑定 - * @access public - * @param object $instance 对象实例 - * @param mixed $reflect 反射类 - * @param array $vars 参数 - * @return mixed - */ - public function invokeReflectMethod($instance, $reflect, array $vars = []) - { - $args = $this->bindParams($reflect, $vars); - - return $reflect->invokeArgs($instance, $args); - } - - /** - * 调用反射执行callable 支持参数绑定 - * @access public - * @param mixed $callable - * @param array $vars 参数 - * @param bool $accessible 设置是否可访问 - * @return mixed - */ - public function invoke($callable, array $vars = [], bool $accessible = false) - { - if ($callable instanceof Closure) { - return $this->invokeFunction($callable, $vars); - } elseif (is_string($callable) && false === strpos($callable, '::')) { - return $this->invokeFunction($callable, $vars); - } else { - return $this->invokeMethod($callable, $vars, $accessible); - } - } - - /** - * 调用反射执行类的实例化 支持依赖注入 - * @access public - * @param string $class 类名 - * @param array $vars 参数 - * @return mixed - */ - public function invokeClass(string $class, array $vars = []) - { - try { - $reflect = new ReflectionClass($class); - } catch (ReflectionException $e) { - throw new ClassNotFoundException('class not exists: ' . $class, $class, $e); - } - - if ($reflect->hasMethod('__make')) { - $method = $reflect->getMethod('__make'); - if ($method->isPublic() && $method->isStatic()) { - $args = $this->bindParams($method, $vars); - $object = $method->invokeArgs(null, $args); - $this->invokeAfter($class, $object); - return $object; - } - } - - $constructor = $reflect->getConstructor(); - - $args = $constructor ? $this->bindParams($constructor, $vars) : []; - - $object = $reflect->newInstanceArgs($args); - - $this->invokeAfter($class, $object); - - return $object; - } - - /** - * 执行invokeClass回调 - * @access protected - * @param string $class 对象类名 - * @param object $object 容器对象实例 - * @return void - */ - protected function invokeAfter(string $class, $object): void - { - if (isset($this->invokeCallback['*'])) { - foreach ($this->invokeCallback['*'] as $callback) { - $callback($object, $this); - } - } - - if (isset($this->invokeCallback[$class])) { - foreach ($this->invokeCallback[$class] as $callback) { - $callback($object, $this); - } - } - } - - /** - * 绑定参数 - * @access protected - * @param ReflectionFunctionAbstract $reflect 反射类 - * @param array $vars 参数 - * @return array - */ - protected function bindParams(ReflectionFunctionAbstract $reflect, array $vars = []): array - { - if ($reflect->getNumberOfParameters() == 0) { - return []; - } - - // 判断数组类型 数字数组时按顺序绑定参数 - reset($vars); - $type = key($vars) === 0 ? 1 : 0; - $params = $reflect->getParameters(); - $args = []; - - foreach ($params as $param) { - $name = $param->getName(); - $lowerName = Str::snake($name); - $reflectionType = $param->getType(); - - if ($reflectionType && $reflectionType->isBuiltin() === false) { - $args[] = $this->getObjectParam($reflectionType->getName(), $vars); - } elseif (1 == $type && !empty($vars)) { - $args[] = array_shift($vars); - } elseif (0 == $type && array_key_exists($name, $vars)) { - $args[] = $vars[$name]; - } elseif (0 == $type && array_key_exists($lowerName, $vars)) { - $args[] = $vars[$lowerName]; - } elseif ($param->isDefaultValueAvailable()) { - $args[] = $param->getDefaultValue(); - } else { - throw new InvalidArgumentException('method param miss:' . $name); - } - } - - return $args; - } - - /** - * 创建工厂对象实例 - * @param string $name 工厂类名 - * @param string $namespace 默认命名空间 - * @param array $args - * @return mixed - * @deprecated - * @access public - */ - public static function factory(string $name, string $namespace = '', ...$args) - { - $class = false !== strpos($name, '\\') ? $name : $namespace . ucwords($name); - - return Container::getInstance()->invokeClass($class, $args); - } - - /** - * 获取对象类型的参数值 - * @access protected - * @param string $className 类名 - * @param array $vars 参数 - * @return mixed - */ - protected function getObjectParam(string $className, array &$vars) - { - $array = $vars; - $value = array_shift($array); - - if ($value instanceof $className) { - $result = $value; - array_shift($vars); - } else { - $result = $this->make($className); - } - - return $result; - } - - public function __set($name, $value) - { - $this->bind($name, $value); - } - - public function __get($name) - { - return $this->get($name); - } - - public function __isset($name): bool - { - return $this->exists($name); - } - - public function __unset($name) - { - $this->delete($name); - } - - public function offsetExists($key) - { - return $this->exists($key); - } - - public function offsetGet($key) - { - return $this->make($key); - } - - public function offsetSet($key, $value) - { - $this->bind($key, $value); - } - - public function offsetUnset($key) - { - $this->delete($key); - } - - //Countable - public function count() - { - return count($this->instances); - } - - //IteratorAggregate - public function getIterator() - { - return new ArrayIterator($this->instances); - } -} diff --git a/vendor/topthink/framework/src/think/Cookie.php b/vendor/topthink/framework/src/think/Cookie.php deleted file mode 100644 index ebbfd64..0000000 --- a/vendor/topthink/framework/src/think/Cookie.php +++ /dev/null @@ -1,230 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use DateTimeInterface; - -/** - * Cookie管理类 - * @package think - */ -class Cookie -{ - /** - * 配置参数 - * @var array - */ - protected $config = [ - // cookie 保存时间 - 'expire' => 0, - // cookie 保存路径 - 'path' => '/', - // cookie 有效域名 - 'domain' => '', - // cookie 启用安全传输 - 'secure' => false, - // httponly设置 - 'httponly' => false, - // samesite 设置,支持 'strict' 'lax' - 'samesite' => '', - ]; - - /** - * Cookie写入数据 - * @var array - */ - protected $cookie = []; - - /** - * 当前Request对象 - * @var Request - */ - protected $request; - - /** - * 构造方法 - * @access public - */ - public function __construct(Request $request, array $config = []) - { - $this->request = $request; - $this->config = array_merge($this->config, array_change_key_case($config)); - } - - public static function __make(Request $request, Config $config) - { - return new static($request, $config->get('cookie')); - } - - /** - * 获取cookie - * @access public - * @param mixed $name 数据名称 - * @param string $default 默认值 - * @return mixed - */ - public function get(string $name = '', $default = null) - { - return $this->request->cookie($name, $default); - } - - /** - * 是否存在Cookie参数 - * @access public - * @param string $name 变量名 - * @return bool - */ - public function has(string $name): bool - { - return $this->request->has($name, 'cookie'); - } - - /** - * Cookie 设置 - * - * @access public - * @param string $name cookie名称 - * @param string $value cookie值 - * @param mixed $option 可选参数 - * @return void - */ - public function set(string $name, string $value, $option = null): void - { - // 参数设置(会覆盖黙认设置) - if (!is_null($option)) { - if (is_numeric($option) || $option instanceof DateTimeInterface) { - $option = ['expire' => $option]; - } - - $config = array_merge($this->config, array_change_key_case($option)); - } else { - $config = $this->config; - } - - if ($config['expire'] instanceof DateTimeInterface) { - $expire = $config['expire']->getTimestamp(); - } else { - $expire = !empty($config['expire']) ? time() + intval($config['expire']) : 0; - } - - $this->setCookie($name, $value, $expire, $config); - } - - /** - * Cookie 保存 - * - * @access public - * @param string $name cookie名称 - * @param string $value cookie值 - * @param int $expire 有效期 - * @param array $option 可选参数 - * @return void - */ - protected function setCookie(string $name, string $value, int $expire, array $option = []): void - { - $this->cookie[$name] = [$value, $expire, $option]; - } - - /** - * 永久保存Cookie数据 - * @access public - * @param string $name cookie名称 - * @param string $value cookie值 - * @param mixed $option 可选参数 可能会是 null|integer|string - * @return void - */ - public function forever(string $name, string $value = '', $option = null): void - { - if (is_null($option) || is_numeric($option)) { - $option = []; - } - - $option['expire'] = 315360000; - - $this->set($name, $value, $option); - } - - /** - * Cookie删除 - * @access public - * @param string $name cookie名称 - * @return void - */ - public function delete(string $name): void - { - $this->setCookie($name, '', time() - 3600, $this->config); - } - - /** - * 获取cookie保存数据 - * @access public - * @return array - */ - public function getCookie(): array - { - return $this->cookie; - } - - /** - * 保存Cookie - * @access public - * @return void - */ - public function save(): void - { - foreach ($this->cookie as $name => $val) { - [$value, $expire, $option] = $val; - - $this->saveCookie( - $name, - $value, - $expire, - $option['path'], - $option['domain'], - $option['secure'] ? true : false, - $option['httponly'] ? true : false, - $option['samesite'] - ); - } - } - - /** - * 保存Cookie - * @access public - * @param string $name cookie名称 - * @param string $value cookie值 - * @param int $expire cookie过期时间 - * @param string $path 有效的服务器路径 - * @param string $domain 有效域名/子域名 - * @param bool $secure 是否仅仅通过HTTPS - * @param bool $httponly 仅可通过HTTP访问 - * @param string $samesite 防止CSRF攻击和用户追踪 - * @return void - */ - protected function saveCookie(string $name, string $value, int $expire, string $path, string $domain, bool $secure, bool $httponly, string $samesite): void - { - if (version_compare(PHP_VERSION, '7.3.0', '>=')) { - setcookie($name, $value, [ - 'expires' => $expire, - 'path' => $path, - 'domain' => $domain, - 'secure' => $secure, - 'httponly' => $httponly, - 'samesite' => $samesite, - ]); - } else { - setcookie($name, $value, $expire, $path, $domain, $secure, $httponly); - } - } - -} diff --git a/vendor/topthink/framework/src/think/Db.php b/vendor/topthink/framework/src/think/Db.php deleted file mode 100644 index 0048874..0000000 --- a/vendor/topthink/framework/src/think/Db.php +++ /dev/null @@ -1,117 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -/** - * 数据库管理类 - * @package think - * @property Config $config - */ -class Db extends DbManager -{ - /** - * @param Event $event - * @param Config $config - * @param Log $log - * @param Cache $cache - * @return Db - * @codeCoverageIgnore - */ - public static function __make(Event $event, Config $config, Log $log, Cache $cache) - { - $db = new static(); - $db->setConfig($config); - $db->setEvent($event); - $db->setLog($log); - - $store = $db->getConfig('cache_store'); - $db->setCache($cache->store($store)); - $db->triggerSql(); - - return $db; - } - - /** - * 注入模型对象 - * @access public - * @return void - */ - protected function modelMaker() - { - } - - /** - * 设置配置对象 - * @access public - * @param Config $config 配置对象 - * @return void - */ - public function setConfig($config): void - { - $this->config = $config; - } - - /** - * 获取配置参数 - * @access public - * @param string $name 配置参数 - * @param mixed $default 默认值 - * @return mixed - */ - public function getConfig(string $name = '', $default = null) - { - if ('' !== $name) { - return $this->config->get('database.' . $name, $default); - } - - return $this->config->get('database', []); - } - - /** - * 设置Event对象 - * @param Event $event - */ - public function setEvent(Event $event): void - { - $this->event = $event; - } - - /** - * 注册回调方法 - * @access public - * @param string $event 事件名 - * @param callable $callback 回调方法 - * @return void - */ - public function event(string $event, callable $callback): void - { - if ($this->event) { - $this->event->listen('db.' . $event, $callback); - } - } - - /** - * 触发事件 - * @access public - * @param string $event 事件名 - * @param mixed $params 传入参数 - * @param bool $once - * @return mixed - */ - public function trigger(string $event, $params = null, bool $once = false) - { - if ($this->event) { - return $this->event->trigger('db.' . $event, $params, $once); - } - } -} diff --git a/vendor/topthink/framework/src/think/Env.php b/vendor/topthink/framework/src/think/Env.php deleted file mode 100644 index 4c26b33..0000000 --- a/vendor/topthink/framework/src/think/Env.php +++ /dev/null @@ -1,181 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use ArrayAccess; - -/** - * Env管理类 - * @package think - */ -class Env implements ArrayAccess -{ - /** - * 环境变量数据 - * @var array - */ - protected $data = []; - - public function __construct() - { - $this->data = $_ENV; - } - - /** - * 读取环境变量定义文件 - * @access public - * @param string $file 环境变量定义文件 - * @return void - */ - public function load(string $file): void - { - $env = parse_ini_file($file, true) ?: []; - $this->set($env); - } - - /** - * 获取环境变量值 - * @access public - * @param string $name 环境变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get(string $name = null, $default = null) - { - if (is_null($name)) { - return $this->data; - } - - $name = strtoupper(str_replace('.', '_', $name)); - - if (isset($this->data[$name])) { - return $this->data[$name]; - } - - return $this->getEnv($name, $default); - } - - protected function getEnv(string $name, $default = null) - { - $result = getenv('PHP_' . $name); - - if (false === $result) { - return $default; - } - - if ('false' === $result) { - $result = false; - } elseif ('true' === $result) { - $result = true; - } - - if (!isset($this->data[$name])) { - $this->data[$name] = $result; - } - - return $result; - } - - /** - * 设置环境变量值 - * @access public - * @param string|array $env 环境变量 - * @param mixed $value 值 - * @return void - */ - public function set($env, $value = null): void - { - if (is_array($env)) { - $env = array_change_key_case($env, CASE_UPPER); - - foreach ($env as $key => $val) { - if (is_array($val)) { - foreach ($val as $k => $v) { - $this->data[$key . '_' . strtoupper($k)] = $v; - } - } else { - $this->data[$key] = $val; - } - } - } else { - $name = strtoupper(str_replace('.', '_', $env)); - - $this->data[$name] = $value; - } - } - - /** - * 检测是否存在环境变量 - * @access public - * @param string $name 参数名 - * @return bool - */ - public function has(string $name): bool - { - return !is_null($this->get($name)); - } - - /** - * 设置环境变量 - * @access public - * @param string $name 参数名 - * @param mixed $value 值 - */ - public function __set(string $name, $value): void - { - $this->set($name, $value); - } - - /** - * 获取环境变量 - * @access public - * @param string $name 参数名 - * @return mixed - */ - public function __get(string $name) - { - return $this->get($name); - } - - /** - * 检测是否存在环境变量 - * @access public - * @param string $name 参数名 - * @return bool - */ - public function __isset(string $name): bool - { - return $this->has($name); - } - - // ArrayAccess - public function offsetSet($name, $value): void - { - $this->set($name, $value); - } - - public function offsetExists($name): bool - { - return $this->__isset($name); - } - - public function offsetUnset($name) - { - throw new Exception('not support: unset'); - } - - public function offsetGet($name) - { - return $this->get($name); - } -} diff --git a/vendor/topthink/framework/src/think/Event.php b/vendor/topthink/framework/src/think/Event.php deleted file mode 100644 index 6a0eb1f..0000000 --- a/vendor/topthink/framework/src/think/Event.php +++ /dev/null @@ -1,263 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use ReflectionClass; -use ReflectionMethod; - -/** - * 事件管理类 - * @package think - */ -class Event -{ - /** - * 监听者 - * @var array - */ - protected $listener = []; - - /** - * 事件别名 - * @var array - */ - protected $bind = [ - 'AppInit' => event\AppInit::class, - 'HttpRun' => event\HttpRun::class, - 'HttpEnd' => event\HttpEnd::class, - 'RouteLoaded' => event\RouteLoaded::class, - 'LogWrite' => event\LogWrite::class, - ]; - - /** - * 应用对象 - * @var App - */ - protected $app; - - public function __construct(App $app) - { - $this->app = $app; - } - - /** - * 批量注册事件监听 - * @access public - * @param array $events 事件定义 - * @return $this - */ - public function listenEvents(array $events) - { - foreach ($events as $event => $listeners) { - if (isset($this->bind[$event])) { - $event = $this->bind[$event]; - } - - $this->listener[$event] = array_merge($this->listener[$event] ?? [], $listeners); - } - - return $this; - } - - /** - * 注册事件监听 - * @access public - * @param string $event 事件名称 - * @param mixed $listener 监听操作(或者类名) - * @param bool $first 是否优先执行 - * @return $this - */ - public function listen(string $event, $listener, bool $first = false) - { - if (isset($this->bind[$event])) { - $event = $this->bind[$event]; - } - - if ($first && isset($this->listener[$event])) { - array_unshift($this->listener[$event], $listener); - } else { - $this->listener[$event][] = $listener; - } - - return $this; - } - - /** - * 是否存在事件监听 - * @access public - * @param string $event 事件名称 - * @return bool - */ - public function hasListener(string $event): bool - { - if (isset($this->bind[$event])) { - $event = $this->bind[$event]; - } - - return isset($this->listener[$event]); - } - - /** - * 移除事件监听 - * @access public - * @param string $event 事件名称 - * @return void - */ - public function remove(string $event): void - { - if (isset($this->bind[$event])) { - $event = $this->bind[$event]; - } - - unset($this->listener[$event]); - } - - /** - * 指定事件别名标识 便于调用 - * @access public - * @param array $events 事件别名 - * @return $this - */ - public function bind(array $events) - { - $this->bind = array_merge($this->bind, $events); - - return $this; - } - - /** - * 注册事件订阅者 - * @access public - * @param mixed $subscriber 订阅者 - * @return $this - */ - public function subscribe($subscriber) - { - $subscribers = (array) $subscriber; - - foreach ($subscribers as $subscriber) { - if (is_string($subscriber)) { - $subscriber = $this->app->make($subscriber); - } - - if (method_exists($subscriber, 'subscribe')) { - // 手动订阅 - $subscriber->subscribe($this); - } else { - // 智能订阅 - $this->observe($subscriber); - } - } - - return $this; - } - - /** - * 自动注册事件观察者 - * @access public - * @param string|object $observer 观察者 - * @param null|string $prefix 事件名前缀 - * @return $this - */ - public function observe($observer, string $prefix = '') - { - if (is_string($observer)) { - $observer = $this->app->make($observer); - } - - $reflect = new ReflectionClass($observer); - $methods = $reflect->getMethods(ReflectionMethod::IS_PUBLIC); - - if (empty($prefix) && $reflect->hasProperty('eventPrefix')) { - $reflectProperty = $reflect->getProperty('eventPrefix'); - $reflectProperty->setAccessible(true); - $prefix = $reflectProperty->getValue($observer); - } - - foreach ($methods as $method) { - $name = $method->getName(); - if (0 === strpos($name, 'on')) { - $this->listen($prefix . substr($name, 2), [$observer, $name]); - } - } - - return $this; - } - - /** - * 触发事件 - * @access public - * @param string|object $event 事件名称 - * @param mixed $params 传入参数 - * @param bool $once 只获取一个有效返回值 - * @return mixed - */ - public function trigger($event, $params = null, bool $once = false) - { - if (is_object($event)) { - $params = $event; - $event = get_class($event); - } - - if (isset($this->bind[$event])) { - $event = $this->bind[$event]; - } - - $result = []; - $listeners = $this->listener[$event] ?? []; - $listeners = array_unique($listeners, SORT_REGULAR); - - foreach ($listeners as $key => $listener) { - $result[$key] = $this->dispatch($listener, $params); - - if (false === $result[$key] || (!is_null($result[$key]) && $once)) { - break; - } - } - - return $once ? end($result) : $result; - } - - /** - * 触发事件(只获取一个有效返回值) - * @param $event - * @param null $params - * @return mixed - */ - public function until($event, $params = null) - { - return $this->trigger($event, $params, true); - } - - /** - * 执行事件调度 - * @access protected - * @param mixed $event 事件方法 - * @param mixed $params 参数 - * @return mixed - */ - protected function dispatch($event, $params = null) - { - if (!is_string($event)) { - $call = $event; - } elseif (strpos($event, '::')) { - $call = $event; - } else { - $obj = $this->app->make($event); - $call = [$obj, 'handle']; - } - - return $this->app->invoke($call, [$params]); - } - -} diff --git a/vendor/topthink/framework/src/think/Exception.php b/vendor/topthink/framework/src/think/Exception.php deleted file mode 100644 index 5cf7954..0000000 --- a/vendor/topthink/framework/src/think/Exception.php +++ /dev/null @@ -1,60 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -/** - * 异常基础类 - * @package think - */ -class Exception extends \Exception -{ - /** - * 保存异常页面显示的额外Debug数据 - * @var array - */ - protected $data = []; - - /** - * 设置异常额外的Debug数据 - * 数据将会显示为下面的格式 - * - * Exception Data - * -------------------------------------------------- - * Label 1 - * key1 value1 - * key2 value2 - * Label 2 - * key1 value1 - * key2 value2 - * - * @access protected - * @param string $label 数据分类,用于异常页面显示 - * @param array $data 需要显示的数据,必须为关联数组 - */ - final protected function setData(string $label, array $data) - { - $this->data[$label] = $data; - } - - /** - * 获取异常额外Debug数据 - * 主要用于输出到异常页面便于调试 - * @access public - * @return array 由setData设置的Debug数据 - */ - final public function getData() - { - return $this->data; - } - -} diff --git a/vendor/topthink/framework/src/think/Facade.php b/vendor/topthink/framework/src/think/Facade.php deleted file mode 100644 index 9a0e333..0000000 --- a/vendor/topthink/framework/src/think/Facade.php +++ /dev/null @@ -1,98 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think; - -/** - * Facade管理类 - */ -class Facade -{ - /** - * 始终创建新的对象实例 - * @var bool - */ - protected static $alwaysNewInstance; - - /** - * 创建Facade实例 - * @static - * @access protected - * @param string $class 类名或标识 - * @param array $args 变量 - * @param bool $newInstance 是否每次创建新的实例 - * @return object - */ - protected static function createFacade(string $class = '', array $args = [], bool $newInstance = false) - { - $class = $class ?: static::class; - - $facadeClass = static::getFacadeClass(); - - if ($facadeClass) { - $class = $facadeClass; - } - - if (static::$alwaysNewInstance) { - $newInstance = true; - } - - return Container::getInstance()->make($class, $args, $newInstance); - } - - /** - * 获取当前Facade对应类名 - * @access protected - * @return string - */ - protected static function getFacadeClass() - {} - - /** - * 带参数实例化当前Facade类 - * @access public - * @return object - */ - public static function instance(...$args) - { - if (__CLASS__ != static::class) { - return self::createFacade('', $args); - } - } - - /** - * 调用类的实例 - * @access public - * @param string $class 类名或者标识 - * @param array|true $args 变量 - * @param bool $newInstance 是否每次创建新的实例 - * @return object - */ - public static function make(string $class, $args = [], $newInstance = false) - { - if (__CLASS__ != static::class) { - return self::__callStatic('make', func_get_args()); - } - - if (true === $args) { - // 总是创建新的实例化对象 - $newInstance = true; - $args = []; - } - - return self::createFacade($class, $args, $newInstance); - } - - // 调用实际类的方法 - public static function __callStatic($method, $params) - { - return call_user_func_array([static::createFacade(), $method], $params); - } -} diff --git a/vendor/topthink/framework/src/think/File.php b/vendor/topthink/framework/src/think/File.php deleted file mode 100644 index f7c37bd..0000000 --- a/vendor/topthink/framework/src/think/File.php +++ /dev/null @@ -1,187 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use SplFileInfo; -use think\exception\FileException; - -/** - * 文件上传类 - * @package think - */ -class File extends SplFileInfo -{ - - /** - * 文件hash规则 - * @var array - */ - protected $hash = []; - - protected $hashName; - - public function __construct(string $path, bool $checkPath = true) - { - if ($checkPath && !is_file($path)) { - throw new FileException(sprintf('The file "%s" does not exist', $path)); - } - - parent::__construct($path); - } - - /** - * 获取文件的哈希散列值 - * @access public - * @param string $type - * @return string - */ - public function hash(string $type = 'sha1'): string - { - if (!isset($this->hash[$type])) { - $this->hash[$type] = hash_file($type, $this->getPathname()); - } - - return $this->hash[$type]; - } - - /** - * 获取文件的MD5值 - * @access public - * @return string - */ - public function md5(): string - { - return $this->hash('md5'); - } - - /** - * 获取文件的SHA1值 - * @access public - * @return string - */ - public function sha1(): string - { - return $this->hash('sha1'); - } - - /** - * 获取文件类型信息 - * @access public - * @return string - */ - public function getMime(): string - { - $finfo = finfo_open(FILEINFO_MIME_TYPE); - - return finfo_file($finfo, $this->getPathname()); - } - - /** - * 移动文件 - * @access public - * @param string $directory 保存路径 - * @param string|null $name 保存的文件名 - * @return File - */ - public function move(string $directory, string $name = null): File - { - $target = $this->getTargetFile($directory, $name); - - set_error_handler(function ($type, $msg) use (&$error) { - $error = $msg; - }); - $renamed = rename($this->getPathname(), (string) $target); - restore_error_handler(); - if (!$renamed) { - throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error))); - } - - @chmod((string) $target, 0666 & ~umask()); - - return $target; - } - - /** - * 实例化一个新文件 - * @param string $directory - * @param null|string $name - * @return File - */ - protected function getTargetFile(string $directory, string $name = null): File - { - if (!is_dir($directory)) { - if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { - throw new FileException(sprintf('Unable to create the "%s" directory', $directory)); - } - } elseif (!is_writable($directory)) { - throw new FileException(sprintf('Unable to write in the "%s" directory', $directory)); - } - - $target = rtrim($directory, '/\\') . \DIRECTORY_SEPARATOR . (null === $name ? $this->getBasename() : $this->getName($name)); - - return new self($target, false); - } - - /** - * 获取文件名 - * @param string $name - * @return string - */ - protected function getName(string $name): string - { - $originalName = str_replace('\\', '/', $name); - $pos = strrpos($originalName, '/'); - $originalName = false === $pos ? $originalName : substr($originalName, $pos + 1); - - return $originalName; - } - - /** - * 文件扩展名 - * @return string - */ - public function extension(): string - { - return $this->getExtension(); - } - - /** - * 自动生成文件名 - * @access public - * @param string|\Closure $rule - * @return string - */ - public function hashName($rule = ''): string - { - if (!$this->hashName) { - if ($rule instanceof \Closure) { - $this->hashName = call_user_func_array($rule, [$this]); - } else { - switch (true) { - case in_array($rule, hash_algos()): - $hash = $this->hash($rule); - $this->hashName = substr($hash, 0, 2) . DIRECTORY_SEPARATOR . substr($hash, 2); - break; - case is_callable($rule): - $this->hashName = call_user_func($rule); - break; - default: - $this->hashName = date('Ymd') . DIRECTORY_SEPARATOR . md5((string) microtime(true)); - break; - } - } - } - - return $this->hashName . '.' . $this->extension(); - } -} diff --git a/vendor/topthink/framework/src/think/Filesystem.php b/vendor/topthink/framework/src/think/Filesystem.php deleted file mode 100644 index 0aee929..0000000 --- a/vendor/topthink/framework/src/think/Filesystem.php +++ /dev/null @@ -1,89 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use InvalidArgumentException; -use think\filesystem\Driver; -use think\filesystem\driver\Local; -use think\helper\Arr; - -/** - * Class Filesystem - * @package think - * @mixin Driver - * @mixin Local - */ -class Filesystem extends Manager -{ - protected $namespace = '\\think\\filesystem\\driver\\'; - - /** - * @param null|string $name - * @return Driver - */ - public function disk(string $name = null): Driver - { - return $this->driver($name); - } - - protected function resolveType(string $name) - { - return $this->getDiskConfig($name, 'type', 'local'); - } - - protected function resolveConfig(string $name) - { - return $this->getDiskConfig($name); - } - - /** - * 获取缓存配置 - * @access public - * @param null|string $name 名称 - * @param mixed $default 默认值 - * @return mixed - */ - public function getConfig(string $name = null, $default = null) - { - if (!is_null($name)) { - return $this->app->config->get('filesystem.' . $name, $default); - } - - return $this->app->config->get('filesystem'); - } - - /** - * 获取磁盘配置 - * @param string $disk - * @param null $name - * @param null $default - * @return array - */ - public function getDiskConfig($disk, $name = null, $default = null) - { - if ($config = $this->getConfig("disks.{$disk}")) { - return Arr::get($config, $name, $default); - } - - throw new InvalidArgumentException("Disk [$disk] not found."); - } - - /** - * 默认驱动 - * @return string|null - */ - public function getDefaultDriver() - { - return $this->getConfig('default'); - } -} diff --git a/vendor/topthink/framework/src/think/Http.php b/vendor/topthink/framework/src/think/Http.php deleted file mode 100644 index 4e49c88..0000000 --- a/vendor/topthink/framework/src/think/Http.php +++ /dev/null @@ -1,288 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use think\event\HttpEnd; -use think\event\HttpRun; -use think\event\RouteLoaded; -use think\exception\Handle; -use Throwable; - -/** - * Web应用管理类 - * @package think - */ -class Http -{ - - /** - * @var App - */ - protected $app; - - /** - * 应用名称 - * @var string - */ - protected $name; - - /** - * 应用路径 - * @var string - */ - protected $path; - - /** - * 路由路径 - * @var string - */ - protected $routePath; - - /** - * 是否绑定应用 - * @var bool - */ - protected $isBind = false; - - public function __construct(App $app) - { - $this->app = $app; - - $this->routePath = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR; - } - - /** - * 设置应用名称 - * @access public - * @param string $name 应用名称 - * @return $this - */ - public function name(string $name) - { - $this->name = $name; - return $this; - } - - /** - * 获取应用名称 - * @access public - * @return string - */ - public function getName(): string - { - return $this->name ?: ''; - } - - /** - * 设置应用目录 - * @access public - * @param string $path 应用目录 - * @return $this - */ - public function path(string $path) - { - if (substr($path, -1) != DIRECTORY_SEPARATOR) { - $path .= DIRECTORY_SEPARATOR; - } - - $this->path = $path; - return $this; - } - - /** - * 获取应用路径 - * @access public - * @return string - */ - public function getPath(): string - { - return $this->path ?: ''; - } - - /** - * 获取路由目录 - * @access public - * @return string - */ - public function getRoutePath(): string - { - return $this->routePath; - } - - /** - * 设置路由目录 - * @access public - * @param string $path 路由定义目录 - */ - public function setRoutePath(string $path): void - { - $this->routePath = $path; - } - - /** - * 设置应用绑定 - * @access public - * @param bool $bind 是否绑定 - * @return $this - */ - public function setBind(bool $bind = true) - { - $this->isBind = $bind; - return $this; - } - - /** - * 是否绑定应用 - * @access public - * @return bool - */ - public function isBind(): bool - { - return $this->isBind; - } - - /** - * 执行应用程序 - * @access public - * @param Request|null $request - * @return Response - */ - public function run(Request $request = null): Response - { - //初始化 - $this->initialize(); - - //自动创建request对象 - $request = $request ?? $this->app->make('request', [], true); - $this->app->instance('request', $request); - - try { - $response = $this->runWithRequest($request); - } catch (Throwable $e) { - $this->reportException($e); - - $response = $this->renderException($request, $e); - } - - return $response; - } - - /** - * 初始化 - */ - protected function initialize() - { - if (!$this->app->initialized()) { - $this->app->initialize(); - } - } - - /** - * 执行应用程序 - * @param Request $request - * @return mixed - */ - protected function runWithRequest(Request $request) - { - // 加载全局中间件 - $this->loadMiddleware(); - - // 监听HttpRun - $this->app->event->trigger(HttpRun::class); - - return $this->app->middleware->pipeline() - ->send($request) - ->then(function ($request) { - return $this->dispatchToRoute($request); - }); - } - - protected function dispatchToRoute($request) - { - $withRoute = $this->app->config->get('app.with_route', true) ? function () { - $this->loadRoutes(); - } : null; - - return $this->app->route->dispatch($request, $withRoute); - } - - /** - * 加载全局中间件 - */ - protected function loadMiddleware(): void - { - if (is_file($this->app->getBasePath() . 'middleware.php')) { - $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php'); - } - } - - /** - * 加载路由 - * @access protected - * @return void - */ - protected function loadRoutes(): void - { - // 加载路由定义 - $routePath = $this->getRoutePath(); - - if (is_dir($routePath)) { - $files = glob($routePath . '*.php'); - foreach ($files as $file) { - include $file; - } - } - - $this->app->event->trigger(RouteLoaded::class); - } - - /** - * Report the exception to the exception handler. - * - * @param Throwable $e - * @return void - */ - protected function reportException(Throwable $e) - { - $this->app->make(Handle::class)->report($e); - } - - /** - * Render the exception to a response. - * - * @param Request $request - * @param Throwable $e - * @return Response - */ - protected function renderException($request, Throwable $e) - { - return $this->app->make(Handle::class)->render($request, $e); - } - - /** - * HttpEnd - * @param Response $response - * @return void - */ - public function end(Response $response): void - { - $this->app->event->trigger(HttpEnd::class, $response); - - //执行中间件 - $this->app->middleware->end($response); - - // 写入日志 - $this->app->log->save(); - } - -} diff --git a/vendor/topthink/framework/src/think/Lang.php b/vendor/topthink/framework/src/think/Lang.php deleted file mode 100644 index 0b79b76..0000000 --- a/vendor/topthink/framework/src/think/Lang.php +++ /dev/null @@ -1,294 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -/** - * 多语言管理类 - * @package think - */ -class Lang -{ - /** - * 配置参数 - * @var array - */ - protected $config = [ - // 默认语言 - 'default_lang' => 'zh-cn', - // 允许的语言列表 - 'allow_lang_list' => [], - // 是否使用Cookie记录 - 'use_cookie' => true, - // 扩展语言包 - 'extend_list' => [], - // 多语言cookie变量 - 'cookie_var' => 'think_lang', - // 多语言header变量 - 'header_var' => 'think-lang', - // 多语言自动侦测变量名 - 'detect_var' => 'lang', - // Accept-Language转义为对应语言包名称 - 'accept_language' => [ - 'zh-hans-cn' => 'zh-cn', - ], - // 是否支持语言分组 - 'allow_group' => false, - ]; - - /** - * 多语言信息 - * @var array - */ - private $lang = []; - - /** - * 当前语言 - * @var string - */ - private $range = 'zh-cn'; - - /** - * 构造方法 - * @access public - * @param array $config - */ - public function __construct(array $config = []) - { - $this->config = array_merge($this->config, array_change_key_case($config)); - $this->range = $this->config['default_lang']; - } - - public static function __make(Config $config) - { - return new static($config->get('lang')); - } - - /** - * 设置当前语言 - * @access public - * @param string $lang 语言 - * @return void - */ - public function setLangSet(string $lang): void - { - $this->range = $lang; - } - - /** - * 获取当前语言 - * @access public - * @return string - */ - public function getLangSet(): string - { - return $this->range; - } - - /** - * 获取默认语言 - * @access public - * @return string - */ - public function defaultLangSet() - { - return $this->config['default_lang']; - } - - /** - * 加载语言定义(不区分大小写) - * @access public - * @param string|array $file 语言文件 - * @param string $range 语言作用域 - * @return array - */ - public function load($file, $range = ''): array - { - $range = $range ?: $this->range; - if (!isset($this->lang[$range])) { - $this->lang[$range] = []; - } - - $lang = []; - - foreach ((array) $file as $name) { - if (is_file($name)) { - $result = $this->parse($name); - $lang = array_change_key_case($result) + $lang; - } - } - - if (!empty($lang)) { - $this->lang[$range] = $lang + $this->lang[$range]; - } - - return $this->lang[$range]; - } - - /** - * 解析语言文件 - * @access protected - * @param string $file 语言文件名 - * @return array - */ - protected function parse(string $file): array - { - $type = pathinfo($file, PATHINFO_EXTENSION); - - switch ($type) { - case 'php': - $result = include $file; - break; - case 'yml': - case 'yaml': - if (function_exists('yaml_parse_file')) { - $result = yaml_parse_file($file); - } - break; - case 'json': - $data = file_get_contents($file); - - if (false !== $data) { - $data = json_decode($data, true); - - if (json_last_error() === JSON_ERROR_NONE) { - $result = $data; - } - } - - break; - } - - return isset($result) && is_array($result) ? $result : []; - } - - /** - * 判断是否存在语言定义(不区分大小写) - * @access public - * @param string|null $name 语言变量 - * @param string $range 语言作用域 - * @return bool - */ - public function has(string $name, string $range = ''): bool - { - $range = $range ?: $this->range; - - if ($this->config['allow_group'] && strpos($name, '.')) { - [$name1, $name2] = explode('.', $name, 2); - return isset($this->lang[$range][strtolower($name1)][$name2]); - } - - return isset($this->lang[$range][strtolower($name)]); - } - - /** - * 获取语言定义(不区分大小写) - * @access public - * @param string|null $name 语言变量 - * @param array $vars 变量替换 - * @param string $range 语言作用域 - * @return mixed - */ - public function get(string $name = null, array $vars = [], string $range = '') - { - $range = $range ?: $this->range; - - // 空参数返回所有定义 - if (is_null($name)) { - return $this->lang[$range] ?? []; - } - - if ($this->config['allow_group'] && strpos($name, '.')) { - [$name1, $name2] = explode('.', $name, 2); - - $value = $this->lang[$range][strtolower($name1)][$name2] ?? $name; - } else { - $value = $this->lang[$range][strtolower($name)] ?? $name; - } - - // 变量解析 - if (!empty($vars) && is_array($vars)) { - /** - * Notes: - * 为了检测的方便,数字索引的判断仅仅是参数数组的第一个元素的key为数字0 - * 数字索引采用的是系统的 sprintf 函数替换,用法请参考 sprintf 函数 - */ - if (key($vars) === 0) { - // 数字索引解析 - array_unshift($vars, $value); - $value = call_user_func_array('sprintf', $vars); - } else { - // 关联索引解析 - $replace = array_keys($vars); - foreach ($replace as &$v) { - $v = "{:{$v}}"; - } - $value = str_replace($replace, $vars, $value); - } - } - - return $value; - } - - /** - * 自动侦测设置获取语言选择 - * @access public - * @param Request $request - * @return string - */ - public function detect(Request $request): string - { - // 自动侦测设置获取语言选择 - $langSet = ''; - - if ($request->get($this->config['detect_var'])) { - // url中设置了语言变量 - $langSet = strtolower($request->get($this->config['detect_var'])); - } elseif ($request->header($this->config['header_var'])) { - // Header中设置了语言变量 - $langSet = strtolower($request->header($this->config['header_var'])); - } elseif ($request->cookie($this->config['cookie_var'])) { - // Cookie中设置了语言变量 - $langSet = strtolower($request->cookie($this->config['cookie_var'])); - } elseif ($request->server('HTTP_ACCEPT_LANGUAGE')) { - // 自动侦测浏览器语言 - $match = preg_match('/^([a-z\d\-]+)/i', $request->server('HTTP_ACCEPT_LANGUAGE'), $matches); - if ($match) { - $langSet = strtolower($matches[1]); - if (isset($this->config['accept_language'][$langSet])) { - $langSet = $this->config['accept_language'][$langSet]; - } - } - } - - if (empty($this->config['allow_lang_list']) || in_array($langSet, $this->config['allow_lang_list'])) { - // 合法的语言 - $this->range = $langSet; - } - - return $this->range; - } - - /** - * 保存当前语言到Cookie - * @access public - * @param Cookie $cookie Cookie对象 - * @return void - */ - public function saveToCookie(Cookie $cookie) - { - if ($this->config['use_cookie']) { - $cookie->set($this->config['cookie_var'], $this->range); - } - } - -} diff --git a/vendor/topthink/framework/src/think/Log.php b/vendor/topthink/framework/src/think/Log.php deleted file mode 100644 index c31210c..0000000 --- a/vendor/topthink/framework/src/think/Log.php +++ /dev/null @@ -1,342 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use InvalidArgumentException; -use Psr\Log\LoggerInterface; -use think\event\LogWrite; -use think\helper\Arr; -use think\log\Channel; -use think\log\ChannelSet; - -/** - * 日志管理类 - * @package think - * @mixin Channel - */ -class Log extends Manager implements LoggerInterface -{ - const EMERGENCY = 'emergency'; - const ALERT = 'alert'; - const CRITICAL = 'critical'; - const ERROR = 'error'; - const WARNING = 'warning'; - const NOTICE = 'notice'; - const INFO = 'info'; - const DEBUG = 'debug'; - const SQL = 'sql'; - - protected $namespace = '\\think\\log\\driver\\'; - - /** - * 默认驱动 - * @return string|null - */ - public function getDefaultDriver() - { - return $this->getConfig('default'); - } - - /** - * 获取日志配置 - * @access public - * @param null|string $name 名称 - * @param mixed $default 默认值 - * @return mixed - */ - public function getConfig(string $name = null, $default = null) - { - if (!is_null($name)) { - return $this->app->config->get('log.' . $name, $default); - } - - return $this->app->config->get('log'); - } - - /** - * 获取渠道配置 - * @param string $channel - * @param null $name - * @param null $default - * @return array - */ - public function getChannelConfig($channel, $name = null, $default = null) - { - if ($config = $this->getConfig("channels.{$channel}")) { - return Arr::get($config, $name, $default); - } - - throw new InvalidArgumentException("Channel [$channel] not found."); - } - - /** - * driver()的别名 - * @param string|array $name 渠道名 - * @return Channel|ChannelSet - */ - public function channel($name = null) - { - if (is_array($name)) { - return new ChannelSet($this, $name); - } - - return $this->driver($name); - } - - protected function resolveType(string $name) - { - return $this->getChannelConfig($name, 'type', 'file'); - } - - public function createDriver(string $name) - { - $driver = parent::createDriver($name); - - $lazy = !$this->getChannelConfig($name, "realtime_write", false) && !$this->app->runningInConsole(); - $allow = array_merge($this->getConfig("level", []), $this->getChannelConfig($name, "level", [])); - - return new Channel($name, $driver, $allow, $lazy, $this->app->event); - } - - protected function resolveConfig(string $name) - { - return $this->getChannelConfig($name); - } - - /** - * 清空日志信息 - * @access public - * @param string|array $channel 日志通道名 - * @return $this - */ - public function clear($channel = '*') - { - if ('*' == $channel) { - $channel = array_keys($this->drivers); - } - - $this->channel($channel)->clear(); - - return $this; - } - - /** - * 关闭本次请求日志写入 - * @access public - * @param string|array $channel 日志通道名 - * @return $this - */ - public function close($channel = '*') - { - if ('*' == $channel) { - $channel = array_keys($this->drivers); - } - - $this->channel($channel)->close(); - - return $this; - } - - /** - * 获取日志信息 - * @access public - * @param string $channel 日志通道名 - * @return array - */ - public function getLog(string $channel = null): array - { - return $this->channel($channel)->getLog(); - } - - /** - * 保存日志信息 - * @access public - * @return bool - */ - public function save(): bool - { - /** @var Channel $channel */ - foreach ($this->drivers as $channel) { - $channel->save(); - } - - return true; - } - - /** - * 记录日志信息 - * @access public - * @param mixed $msg 日志信息 - * @param string $type 日志级别 - * @param array $context 替换内容 - * @param bool $lazy - * @return $this - */ - public function record($msg, string $type = 'info', array $context = [], bool $lazy = true) - { - $channel = $this->getConfig('type_channel.' . $type); - - $this->channel($channel)->record($msg, $type, $context, $lazy); - - return $this; - } - - /** - * 实时写入日志信息 - * @access public - * @param mixed $msg 调试信息 - * @param string $type 日志级别 - * @param array $context 替换内容 - * @return $this - */ - public function write($msg, string $type = 'info', array $context = []) - { - return $this->record($msg, $type, $context, false); - } - - /** - * 注册日志写入事件监听 - * @param $listener - * @return Event - */ - public function listen($listener) - { - return $this->app->event->listen(LogWrite::class, $listener); - } - - /** - * 记录日志信息 - * @access public - * @param string $level 日志级别 - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function log($level, $message, array $context = []): void - { - $this->record($message, $level, $context); - } - - /** - * 记录emergency信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function emergency($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录警报信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function alert($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录紧急情况 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function critical($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录错误信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function error($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录warning信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function warning($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录notice信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function notice($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录一般信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function info($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录调试信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function debug($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * 记录sql信息 - * @access public - * @param mixed $message 日志信息 - * @param array $context 替换内容 - * @return void - */ - public function sql($message, array $context = []): void - { - $this->log(__FUNCTION__, $message, $context); - } - - public function __call($method, $parameters) - { - $this->log($method, ...$parameters); - } -} diff --git a/vendor/topthink/framework/src/think/Manager.php b/vendor/topthink/framework/src/think/Manager.php deleted file mode 100644 index ca3f6a5..0000000 --- a/vendor/topthink/framework/src/think/Manager.php +++ /dev/null @@ -1,177 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use InvalidArgumentException; -use think\helper\Str; - -abstract class Manager -{ - /** @var App */ - protected $app; - - /** - * 驱动 - * @var array - */ - protected $drivers = []; - - /** - * 驱动的命名空间 - * @var string - */ - protected $namespace = null; - - public function __construct(App $app) - { - $this->app = $app; - } - - /** - * 获取驱动实例 - * @param null|string $name - * @return mixed - */ - protected function driver(string $name = null) - { - $name = $name ?: $this->getDefaultDriver(); - - if (is_null($name)) { - throw new InvalidArgumentException(sprintf( - 'Unable to resolve NULL driver for [%s].', - static::class - )); - } - - return $this->drivers[$name] = $this->getDriver($name); - } - - /** - * 获取驱动实例 - * @param string $name - * @return mixed - */ - protected function getDriver(string $name) - { - return $this->drivers[$name] ?? $this->createDriver($name); - } - - /** - * 获取驱动类型 - * @param string $name - * @return mixed - */ - protected function resolveType(string $name) - { - return $name; - } - - /** - * 获取驱动配置 - * @param string $name - * @return mixed - */ - protected function resolveConfig(string $name) - { - return $name; - } - - /** - * 获取驱动类 - * @param string $type - * @return string - */ - protected function resolveClass(string $type): string - { - if ($this->namespace || false !== strpos($type, '\\')) { - $class = false !== strpos($type, '\\') ? $type : $this->namespace . Str::studly($type); - - if (class_exists($class)) { - return $class; - } - } - - throw new InvalidArgumentException("Driver [$type] not supported."); - } - - /** - * 获取驱动参数 - * @param $name - * @return array - */ - protected function resolveParams($name): array - { - $config = $this->resolveConfig($name); - return [$config]; - } - - /** - * 创建驱动 - * - * @param string $name - * @return mixed - * - */ - protected function createDriver(string $name) - { - $type = $this->resolveType($name); - - $method = 'create' . Str::studly($type) . 'Driver'; - - $params = $this->resolveParams($name); - - if (method_exists($this, $method)) { - return $this->$method(...$params); - } - - $class = $this->resolveClass($type); - - return $this->app->invokeClass($class, $params); - } - - /** - * 移除一个驱动实例 - * - * @param array|string|null $name - * @return $this - */ - public function forgetDriver($name = null) - { - $name = $name ?? $this->getDefaultDriver(); - - foreach ((array) $name as $cacheName) { - if (isset($this->drivers[$cacheName])) { - unset($this->drivers[$cacheName]); - } - } - - return $this; - } - - /** - * 默认驱动 - * @return string|null - */ - abstract public function getDefaultDriver(); - - /** - * 动态调用 - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->driver()->$method(...$parameters); - } -} diff --git a/vendor/topthink/framework/src/think/Middleware.php b/vendor/topthink/framework/src/think/Middleware.php deleted file mode 100644 index a3db0f2..0000000 --- a/vendor/topthink/framework/src/think/Middleware.php +++ /dev/null @@ -1,257 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use Closure; -use InvalidArgumentException; -use LogicException; -use think\exception\Handle; -use Throwable; - -/** - * 中间件管理类 - * @package think - */ -class Middleware -{ - /** - * 中间件执行队列 - * @var array - */ - protected $queue = []; - - /** - * 应用对象 - * @var App - */ - protected $app; - - public function __construct(App $app) - { - $this->app = $app; - } - - /** - * 导入中间件 - * @access public - * @param array $middlewares - * @param string $type 中间件类型 - * @return void - */ - public function import(array $middlewares = [], string $type = 'global'): void - { - foreach ($middlewares as $middleware) { - $this->add($middleware, $type); - } - } - - /** - * 注册中间件 - * @access public - * @param mixed $middleware - * @param string $type 中间件类型 - * @return void - */ - public function add($middleware, string $type = 'global'): void - { - $middleware = $this->buildMiddleware($middleware, $type); - - if (!empty($middleware)) { - $this->queue[$type][] = $middleware; - $this->queue[$type] = array_unique($this->queue[$type], SORT_REGULAR); - } - } - - /** - * 注册路由中间件 - * @access public - * @param mixed $middleware - * @return void - */ - public function route($middleware): void - { - $this->add($middleware, 'route'); - } - - /** - * 注册控制器中间件 - * @access public - * @param mixed $middleware - * @return void - */ - public function controller($middleware): void - { - $this->add($middleware, 'controller'); - } - - /** - * 注册中间件到开始位置 - * @access public - * @param mixed $middleware - * @param string $type 中间件类型 - */ - public function unshift($middleware, string $type = 'global') - { - $middleware = $this->buildMiddleware($middleware, $type); - - if (!empty($middleware)) { - if (!isset($this->queue[$type])) { - $this->queue[$type] = []; - } - - array_unshift($this->queue[$type], $middleware); - } - } - - /** - * 获取注册的中间件 - * @access public - * @param string $type 中间件类型 - * @return array - */ - public function all(string $type = 'global'): array - { - return $this->queue[$type] ?? []; - } - - /** - * 调度管道 - * @access public - * @param string $type 中间件类型 - * @return Pipeline - */ - public function pipeline(string $type = 'global') - { - return (new Pipeline()) - ->through(array_map(function ($middleware) { - return function ($request, $next) use ($middleware) { - [$call, $params] = $middleware; - if (is_array($call) && is_string($call[0])) { - $call = [$this->app->make($call[0]), $call[1]]; - } - $response = call_user_func($call, $request, $next, ...$params); - - if (!$response instanceof Response) { - throw new LogicException('The middleware must return Response instance'); - } - return $response; - }; - }, $this->sortMiddleware($this->queue[$type] ?? []))) - ->whenException([$this, 'handleException']); - } - - /** - * 结束调度 - * @param Response $response - */ - public function end(Response $response) - { - foreach ($this->queue as $queue) { - foreach ($queue as $middleware) { - [$call] = $middleware; - if (is_array($call) && is_string($call[0])) { - $instance = $this->app->make($call[0]); - if (method_exists($instance, 'end')) { - $instance->end($response); - } - } - } - } - } - - /** - * 异常处理 - * @param Request $passable - * @param Throwable $e - * @return Response - */ - public function handleException($passable, Throwable $e) - { - /** @var Handle $handler */ - $handler = $this->app->make(Handle::class); - - $handler->report($e); - - return $handler->render($passable, $e); - } - - /** - * 解析中间件 - * @access protected - * @param mixed $middleware - * @param string $type 中间件类型 - * @return array - */ - protected function buildMiddleware($middleware, string $type): array - { - if (is_array($middleware)) { - [$middleware, $params] = $middleware; - } - - if ($middleware instanceof Closure) { - return [$middleware, $params ?? []]; - } - - if (!is_string($middleware)) { - throw new InvalidArgumentException('The middleware is invalid'); - } - - //中间件别名检查 - $alias = $this->app->config->get('middleware.alias', []); - - if (isset($alias[$middleware])) { - $middleware = $alias[$middleware]; - } - - if (is_array($middleware)) { - $this->import($middleware, $type); - return []; - } - - return [[$middleware, 'handle'], $params ?? []]; - } - - /** - * 中间件排序 - * @param array $middlewares - * @return array - */ - protected function sortMiddleware(array $middlewares) - { - $priority = $this->app->config->get('middleware.priority', []); - uasort($middlewares, function ($a, $b) use ($priority) { - $aPriority = $this->getMiddlewarePriority($priority, $a); - $bPriority = $this->getMiddlewarePriority($priority, $b); - return $bPriority - $aPriority; - }); - - return $middlewares; - } - - /** - * 获取中间件优先级 - * @param $priority - * @param $middleware - * @return int - */ - protected function getMiddlewarePriority($priority, $middleware) - { - [$call] = $middleware; - if (is_array($call) && is_string($call[0])) { - $index = array_search($call[0], array_reverse($priority)); - return false === $index ? -1 : $index; - } - return -1; - } - -} diff --git a/vendor/topthink/framework/src/think/Pipeline.php b/vendor/topthink/framework/src/think/Pipeline.php deleted file mode 100644 index 77151f3..0000000 --- a/vendor/topthink/framework/src/think/Pipeline.php +++ /dev/null @@ -1,107 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think; - -use Closure; -use Exception; -use Throwable; - -class Pipeline -{ - protected $passable; - - protected $pipes = []; - - protected $exceptionHandler; - - /** - * 初始数据 - * @param $passable - * @return $this - */ - public function send($passable) - { - $this->passable = $passable; - return $this; - } - - /** - * 调用栈 - * @param $pipes - * @return $this - */ - public function through($pipes) - { - $this->pipes = is_array($pipes) ? $pipes : func_get_args(); - return $this; - } - - /** - * 执行 - * @param Closure $destination - * @return mixed - */ - public function then(Closure $destination) - { - $pipeline = array_reduce( - array_reverse($this->pipes), - $this->carry(), - function ($passable) use ($destination) { - try { - return $destination($passable); - } catch (Throwable | Exception $e) { - return $this->handleException($passable, $e); - } - } - ); - - return $pipeline($this->passable); - } - - /** - * 设置异常处理器 - * @param callable $handler - * @return $this - */ - public function whenException($handler) - { - $this->exceptionHandler = $handler; - return $this; - } - - protected function carry() - { - return function ($stack, $pipe) { - return function ($passable) use ($stack, $pipe) { - try { - return $pipe($passable, $stack); - } catch (Throwable | Exception $e) { - return $this->handleException($passable, $e); - } - }; - }; - } - - /** - * 异常处理 - * @param $passable - * @param $e - * @return mixed - */ - protected function handleException($passable, Throwable $e) - { - if ($this->exceptionHandler) { - return call_user_func($this->exceptionHandler, $passable, $e); - } - throw $e; - } - -} diff --git a/vendor/topthink/framework/src/think/Request.php b/vendor/topthink/framework/src/think/Request.php deleted file mode 100644 index 2787b99..0000000 --- a/vendor/topthink/framework/src/think/Request.php +++ /dev/null @@ -1,2149 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use ArrayAccess; -use think\file\UploadedFile; -use think\route\Rule; - -/** - * 请求管理类 - * @package think - */ -class Request implements ArrayAccess -{ - /** - * 兼容PATH_INFO获取 - * @var array - */ - protected $pathinfoFetch = ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL']; - - /** - * PATHINFO变量名 用于兼容模式 - * @var string - */ - protected $varPathinfo = 's'; - - /** - * 请求类型 - * @var string - */ - protected $varMethod = '_method'; - - /** - * 表单ajax伪装变量 - * @var string - */ - protected $varAjax = '_ajax'; - - /** - * 表单pjax伪装变量 - * @var string - */ - protected $varPjax = '_pjax'; - - /** - * 域名根 - * @var string - */ - protected $rootDomain = ''; - - /** - * HTTPS代理标识 - * @var string - */ - protected $httpsAgentName = ''; - - /** - * 前端代理服务器IP - * @var array - */ - protected $proxyServerIp = []; - - /** - * 前端代理服务器真实IP头 - * @var array - */ - protected $proxyServerIpHeader = ['HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP']; - - /** - * 请求类型 - * @var string - */ - protected $method; - - /** - * 域名(含协议及端口) - * @var string - */ - protected $domain; - - /** - * HOST(含端口) - * @var string - */ - protected $host; - - /** - * 子域名 - * @var string - */ - protected $subDomain; - - /** - * 泛域名 - * @var string - */ - protected $panDomain; - - /** - * 当前URL地址 - * @var string - */ - protected $url; - - /** - * 基础URL - * @var string - */ - protected $baseUrl; - - /** - * 当前执行的文件 - * @var string - */ - protected $baseFile; - - /** - * 访问的ROOT地址 - * @var string - */ - protected $root; - - /** - * pathinfo - * @var string - */ - protected $pathinfo; - - /** - * pathinfo(不含后缀) - * @var string - */ - protected $path; - - /** - * 当前请求的IP地址 - * @var string - */ - protected $realIP; - - /** - * 当前控制器名 - * @var string - */ - protected $controller; - - /** - * 当前操作名 - * @var string - */ - protected $action; - - /** - * 当前请求参数 - * @var array - */ - protected $param = []; - - /** - * 当前GET参数 - * @var array - */ - protected $get = []; - - /** - * 当前POST参数 - * @var array - */ - protected $post = []; - - /** - * 当前REQUEST参数 - * @var array - */ - protected $request = []; - - /** - * 当前路由对象 - * @var Rule - */ - protected $rule; - - /** - * 当前ROUTE参数 - * @var array - */ - protected $route = []; - - /** - * 中间件传递的参数 - * @var array - */ - protected $middleware = []; - - /** - * 当前PUT参数 - * @var array - */ - protected $put; - - /** - * SESSION对象 - * @var Session - */ - protected $session; - - /** - * COOKIE数据 - * @var array - */ - protected $cookie = []; - - /** - * ENV对象 - * @var Env - */ - protected $env; - - /** - * 当前SERVER参数 - * @var array - */ - protected $server = []; - - /** - * 当前FILE参数 - * @var array - */ - protected $file = []; - - /** - * 当前HEADER参数 - * @var array - */ - protected $header = []; - - /** - * 资源类型定义 - * @var array - */ - protected $mimeType = [ - 'xml' => 'application/xml,text/xml,application/x-xml', - 'json' => 'application/json,text/x-json,application/jsonrequest,text/json', - 'js' => 'text/javascript,application/javascript,application/x-javascript', - 'css' => 'text/css', - 'rss' => 'application/rss+xml', - 'yaml' => 'application/x-yaml,text/yaml', - 'atom' => 'application/atom+xml', - 'pdf' => 'application/pdf', - 'text' => 'text/plain', - 'image' => 'image/png,image/jpg,image/jpeg,image/pjpeg,image/gif,image/webp,image/*', - 'csv' => 'text/csv', - 'html' => 'text/html,application/xhtml+xml,*/*', - ]; - - /** - * 当前请求内容 - * @var string - */ - protected $content; - - /** - * 全局过滤规则 - * @var array - */ - protected $filter; - - /** - * php://input内容 - * @var string - */ - // php://input - protected $input; - - /** - * 请求安全Key - * @var string - */ - protected $secureKey; - - /** - * 是否合并Param - * @var bool - */ - protected $mergeParam = false; - - /** - * 架构函数 - * @access public - */ - public function __construct() - { - // 保存 php://input - $this->input = file_get_contents('php://input'); - } - - public static function __make(App $app) - { - $request = new static(); - - if (function_exists('apache_request_headers') && $result = apache_request_headers()) { - $header = $result; - } else { - $header = []; - $server = $_SERVER; - foreach ($server as $key => $val) { - if (0 === strpos($key, 'HTTP_')) { - $key = str_replace('_', '-', strtolower(substr($key, 5))); - $header[$key] = $val; - } - } - if (isset($server['CONTENT_TYPE'])) { - $header['content-type'] = $server['CONTENT_TYPE']; - } - if (isset($server['CONTENT_LENGTH'])) { - $header['content-length'] = $server['CONTENT_LENGTH']; - } - } - - $request->header = array_change_key_case($header); - $request->server = $_SERVER; - $request->env = $app->env; - - $inputData = $request->getInputData($request->input); - - $request->get = $_GET; - $request->post = $_POST ?: $inputData; - $request->put = $inputData; - $request->request = $_REQUEST; - $request->cookie = $_COOKIE; - $request->file = $_FILES ?? []; - - return $request; - } - - /** - * 设置当前包含协议的域名 - * @access public - * @param string $domain 域名 - * @return $this - */ - public function setDomain(string $domain) - { - $this->domain = $domain; - return $this; - } - - /** - * 获取当前包含协议的域名 - * @access public - * @param bool $port 是否需要去除端口号 - * @return string - */ - public function domain(bool $port = false): string - { - return $this->scheme() . '://' . $this->host($port); - } - - /** - * 获取当前根域名 - * @access public - * @return string - */ - public function rootDomain(): string - { - $root = $this->rootDomain; - - if (!$root) { - $item = explode('.', $this->host()); - $count = count($item); - $root = $count > 1 ? $item[$count - 2] . '.' . $item[$count - 1] : $item[0]; - } - - return $root; - } - - /** - * 设置当前泛域名的值 - * @access public - * @param string $domain 域名 - * @return $this - */ - public function setSubDomain(string $domain) - { - $this->subDomain = $domain; - return $this; - } - - /** - * 获取当前子域名 - * @access public - * @return string - */ - public function subDomain(): string - { - if (is_null($this->subDomain)) { - // 获取当前主域名 - $rootDomain = $this->rootDomain(); - - if ($rootDomain) { - $this->subDomain = rtrim(stristr($this->host(), $rootDomain, true), '.'); - } else { - $this->subDomain = ''; - } - } - - return $this->subDomain; - } - - /** - * 设置当前泛域名的值 - * @access public - * @param string $domain 域名 - * @return $this - */ - public function setPanDomain(string $domain) - { - $this->panDomain = $domain; - return $this; - } - - /** - * 获取当前泛域名的值 - * @access public - * @return string - */ - public function panDomain(): string - { - return $this->panDomain ?: ''; - } - - /** - * 设置当前完整URL 包括QUERY_STRING - * @access public - * @param string $url URL地址 - * @return $this - */ - public function setUrl(string $url) - { - $this->url = $url; - return $this; - } - - /** - * 获取当前完整URL 包括QUERY_STRING - * @access public - * @param bool $complete 是否包含完整域名 - * @return string - */ - public function url(bool $complete = false): string - { - if ($this->url) { - $url = $this->url; - } elseif ($this->server('HTTP_X_REWRITE_URL')) { - $url = $this->server('HTTP_X_REWRITE_URL'); - } elseif ($this->server('REQUEST_URI')) { - $url = $this->server('REQUEST_URI'); - } elseif ($this->server('ORIG_PATH_INFO')) { - $url = $this->server('ORIG_PATH_INFO') . (!empty($this->server('QUERY_STRING')) ? '?' . $this->server('QUERY_STRING') : ''); - } elseif (isset($_SERVER['argv'][1])) { - $url = $_SERVER['argv'][1]; - } else { - $url = ''; - } - - return $complete ? $this->domain() . $url : $url; - } - - /** - * 设置当前URL 不含QUERY_STRING - * @access public - * @param string $url URL地址 - * @return $this - */ - public function setBaseUrl(string $url) - { - $this->baseUrl = $url; - return $this; - } - - /** - * 获取当前URL 不含QUERY_STRING - * @access public - * @param bool $complete 是否包含完整域名 - * @return string - */ - public function baseUrl(bool $complete = false): string - { - if (!$this->baseUrl) { - $str = $this->url(); - $this->baseUrl = strpos($str, '?') ? strstr($str, '?', true) : $str; - } - - return $complete ? $this->domain() . $this->baseUrl : $this->baseUrl; - } - - /** - * 获取当前执行的文件 SCRIPT_NAME - * @access public - * @param bool $complete 是否包含完整域名 - * @return string - */ - public function baseFile(bool $complete = false): string - { - if (!$this->baseFile) { - $url = ''; - if (!$this->isCli()) { - $script_name = basename($this->server('SCRIPT_FILENAME')); - if (basename($this->server('SCRIPT_NAME')) === $script_name) { - $url = $this->server('SCRIPT_NAME'); - } elseif (basename($this->server('PHP_SELF')) === $script_name) { - $url = $this->server('PHP_SELF'); - } elseif (basename($this->server('ORIG_SCRIPT_NAME')) === $script_name) { - $url = $this->server('ORIG_SCRIPT_NAME'); - } elseif (($pos = strpos($this->server('PHP_SELF'), '/' . $script_name)) !== false) { - $url = substr($this->server('SCRIPT_NAME'), 0, $pos) . '/' . $script_name; - } elseif ($this->server('DOCUMENT_ROOT') && strpos($this->server('SCRIPT_FILENAME'), $this->server('DOCUMENT_ROOT')) === 0) { - $url = str_replace('\\', '/', str_replace($this->server('DOCUMENT_ROOT'), '', $this->server('SCRIPT_FILENAME'))); - } - } - $this->baseFile = $url; - } - - return $complete ? $this->domain() . $this->baseFile : $this->baseFile; - } - - /** - * 设置URL访问根地址 - * @access public - * @param string $url URL地址 - * @return $this - */ - public function setRoot(string $url) - { - $this->root = $url; - return $this; - } - - /** - * 获取URL访问根地址 - * @access public - * @param bool $complete 是否包含完整域名 - * @return string - */ - public function root(bool $complete = false): string - { - if (!$this->root) { - $file = $this->baseFile(); - if ($file && 0 !== strpos($this->url(), $file)) { - $file = str_replace('\\', '/', dirname($file)); - } - $this->root = rtrim($file, '/'); - } - - return $complete ? $this->domain() . $this->root : $this->root; - } - - /** - * 获取URL访问根目录 - * @access public - * @return string - */ - public function rootUrl(): string - { - $base = $this->root(); - $root = strpos($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base; - - if ('' != $root) { - $root = '/' . ltrim($root, '/'); - } - - return $root; - } - - /** - * 设置当前请求的pathinfo - * @access public - * @param string $pathinfo - * @return $this - */ - public function setPathinfo(string $pathinfo) - { - $this->pathinfo = $pathinfo; - return $this; - } - - /** - * 获取当前请求URL的pathinfo信息(含URL后缀) - * @access public - * @return string - */ - public function pathinfo(): string - { - if (is_null($this->pathinfo)) { - if (isset($_GET[$this->varPathinfo])) { - // 判断URL里面是否有兼容模式参数 - $pathinfo = $_GET[$this->varPathinfo]; - unset($_GET[$this->varPathinfo]); - unset($this->get[$this->varPathinfo]); - } elseif ($this->server('PATH_INFO')) { - $pathinfo = $this->server('PATH_INFO'); - } elseif (false !== strpos(PHP_SAPI, 'cli')) { - $pathinfo = strpos($this->server('REQUEST_URI'), '?') ? strstr($this->server('REQUEST_URI'), '?', true) : $this->server('REQUEST_URI'); - } - - // 分析PATHINFO信息 - if (!isset($pathinfo)) { - foreach ($this->pathinfoFetch as $type) { - if ($this->server($type)) { - $pathinfo = (0 === strpos($this->server($type), $this->server('SCRIPT_NAME'))) ? - substr($this->server($type), strlen($this->server('SCRIPT_NAME'))) : $this->server($type); - break; - } - } - } - - if (!empty($pathinfo)) { - unset($this->get[$pathinfo], $this->request[$pathinfo]); - } - - $this->pathinfo = empty($pathinfo) || '/' == $pathinfo ? '' : ltrim($pathinfo, '/'); - } - - return $this->pathinfo; - } - - /** - * 当前URL的访问后缀 - * @access public - * @return string - */ - public function ext(): string - { - return pathinfo($this->pathinfo(), PATHINFO_EXTENSION); - } - - /** - * 获取当前请求的时间 - * @access public - * @param bool $float 是否使用浮点类型 - * @return integer|float - */ - public function time(bool $float = false) - { - return $float ? $this->server('REQUEST_TIME_FLOAT') : $this->server('REQUEST_TIME'); - } - - /** - * 当前请求的资源类型 - * @access public - * @return string - */ - public function type(): string - { - $accept = $this->server('HTTP_ACCEPT'); - - if (empty($accept)) { - return ''; - } - - foreach ($this->mimeType as $key => $val) { - $array = explode(',', $val); - foreach ($array as $k => $v) { - if (stristr($accept, $v)) { - return $key; - } - } - } - - return ''; - } - - /** - * 设置资源类型 - * @access public - * @param string|array $type 资源类型名 - * @param string $val 资源类型 - * @return void - */ - public function mimeType($type, $val = ''): void - { - if (is_array($type)) { - $this->mimeType = array_merge($this->mimeType, $type); - } else { - $this->mimeType[$type] = $val; - } - } - - /** - * 设置请求类型 - * @access public - * @param string $method 请求类型 - * @return $this - */ - public function setMethod(string $method) - { - $this->method = strtoupper($method); - return $this; - } - - /** - * 当前的请求类型 - * @access public - * @param bool $origin 是否获取原始请求类型 - * @return string - */ - public function method(bool $origin = false): string - { - if ($origin) { - // 获取原始请求类型 - return $this->server('REQUEST_METHOD') ?: 'GET'; - } elseif (!$this->method) { - if (isset($this->post[$this->varMethod])) { - $method = strtolower($this->post[$this->varMethod]); - if (in_array($method, ['get', 'post', 'put', 'patch', 'delete'])) { - $this->method = strtoupper($method); - $this->{$method} = $this->post; - } else { - $this->method = 'POST'; - } - unset($this->post[$this->varMethod]); - } elseif ($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')) { - $this->method = strtoupper($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')); - } else { - $this->method = $this->server('REQUEST_METHOD') ?: 'GET'; - } - } - - return $this->method; - } - - /** - * 是否为GET请求 - * @access public - * @return bool - */ - public function isGet(): bool - { - return $this->method() == 'GET'; - } - - /** - * 是否为POST请求 - * @access public - * @return bool - */ - public function isPost(): bool - { - return $this->method() == 'POST'; - } - - /** - * 是否为PUT请求 - * @access public - * @return bool - */ - public function isPut(): bool - { - return $this->method() == 'PUT'; - } - - /** - * 是否为DELTE请求 - * @access public - * @return bool - */ - public function isDelete(): bool - { - return $this->method() == 'DELETE'; - } - - /** - * 是否为HEAD请求 - * @access public - * @return bool - */ - public function isHead(): bool - { - return $this->method() == 'HEAD'; - } - - /** - * 是否为PATCH请求 - * @access public - * @return bool - */ - public function isPatch(): bool - { - return $this->method() == 'PATCH'; - } - - /** - * 是否为OPTIONS请求 - * @access public - * @return bool - */ - public function isOptions(): bool - { - return $this->method() == 'OPTIONS'; - } - - /** - * 是否为cli - * @access public - * @return bool - */ - public function isCli(): bool - { - return PHP_SAPI == 'cli'; - } - - /** - * 是否为cgi - * @access public - * @return bool - */ - public function isCgi(): bool - { - return strpos(PHP_SAPI, 'cgi') === 0; - } - - /** - * 获取当前请求的参数 - * @access public - * @param string|array $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function param($name = '', $default = null, $filter = '') - { - if (empty($this->mergeParam)) { - $method = $this->method(true); - - // 自动获取请求变量 - switch ($method) { - case 'POST': - $vars = $this->post(false); - break; - case 'PUT': - case 'DELETE': - case 'PATCH': - $vars = $this->put(false); - break; - default: - $vars = []; - } - - // 当前请求参数和URL地址中的参数合并 - $this->param = array_merge($this->param, $this->get(false), $vars, $this->route(false)); - - $this->mergeParam = true; - } - - if (is_array($name)) { - return $this->only($name, $this->param, $filter); - } - - return $this->input($this->param, $name, $default, $filter); - } - - /** - * 设置路由变量 - * @access public - * @param Rule $rule 路由对象 - * @return $this - */ - public function setRule(Rule $rule) - { - $this->rule = $rule; - return $this; - } - - /** - * 获取当前路由对象 - * @access public - * @return Rule|null - */ - public function rule() - { - return $this->rule; - } - - /** - * 设置路由变量 - * @access public - * @param array $route 路由变量 - * @return $this - */ - public function setRoute(array $route) - { - $this->route = array_merge($this->route, $route); - $this->mergeParam = false; - return $this; - } - - /** - * 获取路由参数 - * @access public - * @param string|array $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function route($name = '', $default = null, $filter = '') - { - if (is_array($name)) { - return $this->only($name, $this->route, $filter); - } - - return $this->input($this->route, $name, $default, $filter); - } - - /** - * 获取GET参数 - * @access public - * @param string|array $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function get($name = '', $default = null, $filter = '') - { - if (is_array($name)) { - return $this->only($name, $this->get, $filter); - } - - return $this->input($this->get, $name, $default, $filter); - } - - /** - * 获取中间件传递的参数 - * @access public - * @param mixed $name 变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function middleware($name, $default = null) - { - return $this->middleware[$name] ?? $default; - } - - /** - * 获取POST参数 - * @access public - * @param string|array $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function post($name = '', $default = null, $filter = '') - { - if (is_array($name)) { - return $this->only($name, $this->post, $filter); - } - - return $this->input($this->post, $name, $default, $filter); - } - - /** - * 获取PUT参数 - * @access public - * @param string|array $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function put($name = '', $default = null, $filter = '') - { - if (is_array($name)) { - return $this->only($name, $this->put, $filter); - } - - return $this->input($this->put, $name, $default, $filter); - } - - protected function getInputData($content): array - { - $contentType = $this->contentType(); - if ('application/x-www-form-urlencoded' == $contentType) { - parse_str($content, $data); - return $data; - } elseif (false !== strpos($contentType, 'json')) { - return (array) json_decode($content, true); - } - - return []; - } - - /** - * 设置获取DELETE参数 - * @access public - * @param mixed $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function delete($name = '', $default = null, $filter = '') - { - return $this->put($name, $default, $filter); - } - - /** - * 设置获取PATCH参数 - * @access public - * @param mixed $name 变量名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function patch($name = '', $default = null, $filter = '') - { - return $this->put($name, $default, $filter); - } - - /** - * 获取request变量 - * @access public - * @param string|array $name 数据名称 - * @param mixed $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function request($name = '', $default = null, $filter = '') - { - if (is_array($name)) { - return $this->only($name, $this->request, $filter); - } - - return $this->input($this->request, $name, $default, $filter); - } - - /** - * 获取环境变量 - * @access public - * @param string $name 数据名称 - * @param string $default 默认值 - * @return mixed - */ - public function env(string $name = '', string $default = null) - { - if (empty($name)) { - return $this->env->get(); - } else { - $name = strtoupper($name); - } - - return $this->env->get($name, $default); - } - - /** - * 获取session数据 - * @access public - * @param string $name 数据名称 - * @param string $default 默认值 - * @return mixed - */ - public function session(string $name = '', $default = null) - { - if ('' === $name) { - return $this->session->all(); - } - return $this->session->get($name, $default); - } - - /** - * 获取cookie参数 - * @access public - * @param mixed $name 数据名称 - * @param string $default 默认值 - * @param string|array $filter 过滤方法 - * @return mixed - */ - public function cookie(string $name = '', $default = null, $filter = '') - { - if (!empty($name)) { - $data = $this->getData($this->cookie, $name, $default); - } else { - $data = $this->cookie; - } - - // 解析过滤器 - $filter = $this->getFilter($filter, $default); - - if (is_array($data)) { - array_walk_recursive($data, [$this, 'filterValue'], $filter); - } else { - $this->filterValue($data, $name, $filter); - } - - return $data; - } - - /** - * 获取server参数 - * @access public - * @param string $name 数据名称 - * @param string $default 默认值 - * @return mixed - */ - public function server(string $name = '', string $default = '') - { - if (empty($name)) { - return $this->server; - } else { - $name = strtoupper($name); - } - - return $this->server[$name] ?? $default; - } - - /** - * 获取上传的文件信息 - * @access public - * @param string $name 名称 - * @return null|array|UploadedFile - */ - public function file(string $name = '') - { - $files = $this->file; - if (!empty($files)) { - - if (strpos($name, '.')) { - [$name, $sub] = explode('.', $name); - } - - // 处理上传文件 - $array = $this->dealUploadFile($files, $name); - - if ('' === $name) { - // 获取全部文件 - return $array; - } elseif (isset($sub) && isset($array[$name][$sub])) { - return $array[$name][$sub]; - } elseif (isset($array[$name])) { - return $array[$name]; - } - } - } - - protected function dealUploadFile(array $files, string $name): array - { - $array = []; - foreach ($files as $key => $file) { - if (is_array($file['name'])) { - $item = []; - $keys = array_keys($file); - $count = count($file['name']); - - for ($i = 0; $i < $count; $i++) { - if ($file['error'][$i] > 0) { - if ($name == $key) { - $this->throwUploadFileError($file['error'][$i]); - } else { - continue; - } - } - - $temp['key'] = $key; - - foreach ($keys as $_key) { - $temp[$_key] = $file[$_key][$i]; - } - - $item[] = new UploadedFile($temp['tmp_name'], $temp['name'], $temp['type'], $temp['error']); - } - - $array[$key] = $item; - } else { - if ($file instanceof File) { - $array[$key] = $file; - } else { - if ($file['error'] > 0) { - if ($key == $name) { - $this->throwUploadFileError($file['error']); - } else { - continue; - } - } - - $array[$key] = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['error']); - } - } - } - - return $array; - } - - protected function throwUploadFileError($error) - { - static $fileUploadErrors = [ - 1 => 'upload File size exceeds the maximum value', - 2 => 'upload File size exceeds the maximum value', - 3 => 'only the portion of file is uploaded', - 4 => 'no file to uploaded', - 6 => 'upload temp dir not found', - 7 => 'file write error', - ]; - - $msg = $fileUploadErrors[$error]; - throw new Exception($msg, $error); - } - - /** - * 设置或者获取当前的Header - * @access public - * @param string $name header名称 - * @param string $default 默认值 - * @return string|array - */ - public function header(string $name = '', string $default = null) - { - if ('' === $name) { - return $this->header; - } - - $name = str_replace('_', '-', strtolower($name)); - - return $this->header[$name] ?? $default; - } - - /** - * 获取变量 支持过滤和默认值 - * @access public - * @param array $data 数据源 - * @param string|false $name 字段名 - * @param mixed $default 默认值 - * @param string|array $filter 过滤函数 - * @return mixed - */ - public function input(array $data = [], $name = '', $default = null, $filter = '') - { - if (false === $name) { - // 获取原始数据 - return $data; - } - - $name = (string) $name; - if ('' != $name) { - // 解析name - if (strpos($name, '/')) { - [$name, $type] = explode('/', $name); - } - - $data = $this->getData($data, $name); - - if (is_null($data)) { - return $default; - } - - if (is_object($data)) { - return $data; - } - } - - $data = $this->filterData($data, $filter, $name, $default); - - if (isset($type) && $data !== $default) { - // 强制类型转换 - $this->typeCast($data, $type); - } - - return $data; - } - - protected function filterData($data, $filter, $name, $default) - { - // 解析过滤器 - $filter = $this->getFilter($filter, $default); - - if (is_array($data)) { - array_walk_recursive($data, [$this, 'filterValue'], $filter); - } else { - $this->filterValue($data, $name, $filter); - } - - return $data; - } - - /** - * 强制类型转换 - * @access public - * @param mixed $data - * @param string $type - * @return mixed - */ - private function typeCast(&$data, string $type) - { - switch (strtolower($type)) { - // 数组 - case 'a': - $data = (array) $data; - break; - // 数字 - case 'd': - $data = (int) $data; - break; - // 浮点 - case 'f': - $data = (float) $data; - break; - // 布尔 - case 'b': - $data = (boolean) $data; - break; - // 字符串 - case 's': - if (is_scalar($data)) { - $data = (string) $data; - } else { - throw new \InvalidArgumentException('variable type error:' . gettype($data)); - } - break; - } - } - - /** - * 获取数据 - * @access public - * @param array $data 数据源 - * @param string $name 字段名 - * @param mixed $default 默认值 - * @return mixed - */ - protected function getData(array $data, string $name, $default = null) - { - foreach (explode('.', $name) as $val) { - if (isset($data[$val])) { - $data = $data[$val]; - } else { - return $default; - } - } - - return $data; - } - - /** - * 设置或获取当前的过滤规则 - * @access public - * @param mixed $filter 过滤规则 - * @return mixed - */ - public function filter($filter = null) - { - if (is_null($filter)) { - return $this->filter; - } - - $this->filter = $filter; - - return $this; - } - - protected function getFilter($filter, $default): array - { - if (is_null($filter)) { - $filter = []; - } else { - $filter = $filter ?: $this->filter; - if (is_string($filter) && false === strpos($filter, '/')) { - $filter = explode(',', $filter); - } else { - $filter = (array) $filter; - } - } - - $filter[] = $default; - - return $filter; - } - - /** - * 递归过滤给定的值 - * @access public - * @param mixed $value 键值 - * @param mixed $key 键名 - * @param array $filters 过滤方法+默认值 - * @return mixed - */ - public function filterValue(&$value, $key, $filters) - { - $default = array_pop($filters); - - foreach ($filters as $filter) { - if (is_callable($filter)) { - // 调用函数或者方法过滤 - $value = call_user_func($filter, $value); - } elseif (is_scalar($value)) { - if (is_string($filter) && false !== strpos($filter, '/')) { - // 正则过滤 - if (!preg_match($filter, $value)) { - // 匹配不成功返回默认值 - $value = $default; - break; - } - } elseif (!empty($filter)) { - // filter函数不存在时, 则使用filter_var进行过滤 - // filter为非整形值时, 调用filter_id取得过滤id - $value = filter_var($value, is_int($filter) ? $filter : filter_id($filter)); - if (false === $value) { - $value = $default; - break; - } - } - } - } - - return $value; - } - - /** - * 是否存在某个请求参数 - * @access public - * @param string $name 变量名 - * @param string $type 变量类型 - * @param bool $checkEmpty 是否检测空值 - * @return bool - */ - public function has(string $name, string $type = 'param', bool $checkEmpty = false): bool - { - if (!in_array($type, ['param', 'get', 'post', 'put', 'patch', 'route', 'delete', 'cookie', 'session', 'env', 'request', 'server', 'header', 'file'])) { - return false; - } - - $param = empty($this->$type) ? $this->$type() : $this->$type; - - if (is_object($param)) { - return $param->has($name); - } - - // 按.拆分成多维数组进行判断 - foreach (explode('.', $name) as $val) { - if (isset($param[$val])) { - $param = $param[$val]; - } else { - return false; - } - } - - return ($checkEmpty && '' === $param) ? false : true; - } - - /** - * 获取指定的参数 - * @access public - * @param array $name 变量名 - * @param mixed $data 数据或者变量类型 - * @param string|array $filter 过滤方法 - * @return array - */ - public function only(array $name, $data = 'param', $filter = ''): array - { - $data = is_array($data) ? $data : $this->$data(); - - $item = []; - foreach ($name as $key => $val) { - - if (is_int($key)) { - $default = null; - $key = $val; - if (!isset($data[$key])) { - continue; - } - } else { - $default = $val; - } - - $item[$key] = $this->filterData($data[$key] ?? $default, $filter, $key, $default); - } - - return $item; - } - - /** - * 排除指定参数获取 - * @access public - * @param array $name 变量名 - * @param string $type 变量类型 - * @return mixed - */ - public function except(array $name, string $type = 'param'): array - { - $param = $this->$type(); - - foreach ($name as $key) { - if (isset($param[$key])) { - unset($param[$key]); - } - } - - return $param; - } - - /** - * 当前是否ssl - * @access public - * @return bool - */ - public function isSsl(): bool - { - if ($this->server('HTTPS') && ('1' == $this->server('HTTPS') || 'on' == strtolower($this->server('HTTPS')))) { - return true; - } elseif ('https' == $this->server('REQUEST_SCHEME')) { - return true; - } elseif ('443' == $this->server('SERVER_PORT')) { - return true; - } elseif ('https' == $this->server('HTTP_X_FORWARDED_PROTO')) { - return true; - } elseif ($this->httpsAgentName && $this->server($this->httpsAgentName)) { - return true; - } - - return false; - } - - /** - * 当前是否JSON请求 - * @access public - * @return bool - */ - public function isJson(): bool - { - $acceptType = $this->type(); - - return false !== strpos($acceptType, 'json'); - } - - /** - * 当前是否Ajax请求 - * @access public - * @param bool $ajax true 获取原始ajax请求 - * @return bool - */ - public function isAjax(bool $ajax = false): bool - { - $value = $this->server('HTTP_X_REQUESTED_WITH'); - $result = $value && 'xmlhttprequest' == strtolower($value) ? true : false; - - if (true === $ajax) { - return $result; - } - - return $this->param($this->varAjax) ? true : $result; - } - - /** - * 当前是否Pjax请求 - * @access public - * @param bool $pjax true 获取原始pjax请求 - * @return bool - */ - public function isPjax(bool $pjax = false): bool - { - $result = !empty($this->server('HTTP_X_PJAX')) ? true : false; - - if (true === $pjax) { - return $result; - } - - return $this->param($this->varPjax) ? true : $result; - } - - /** - * 获取客户端IP地址 - * @access public - * @return string - */ - public function ip(): string - { - if (!empty($this->realIP)) { - return $this->realIP; - } - - $this->realIP = $this->server('REMOTE_ADDR', ''); - - // 如果指定了前端代理服务器IP以及其会发送的IP头 - // 则尝试获取前端代理服务器发送过来的真实IP - $proxyIp = $this->proxyServerIp; - $proxyIpHeader = $this->proxyServerIpHeader; - - if (count($proxyIp) > 0 && count($proxyIpHeader) > 0) { - // 从指定的HTTP头中依次尝试获取IP地址 - // 直到获取到一个合法的IP地址 - foreach ($proxyIpHeader as $header) { - $tempIP = $this->server($header); - - if (empty($tempIP)) { - continue; - } - - $tempIP = trim(explode(',', $tempIP)[0]); - - if (!$this->isValidIP($tempIP)) { - $tempIP = null; - } else { - break; - } - } - - // tempIP不为空,说明获取到了一个IP地址 - // 这时我们检查 REMOTE_ADDR 是不是指定的前端代理服务器之一 - // 如果是的话说明该 IP头 是由前端代理服务器设置的 - // 否则则是伪装的 - if (!empty($tempIP)) { - $realIPBin = $this->ip2bin($this->realIP); - - foreach ($proxyIp as $ip) { - $serverIPElements = explode('/', $ip); - $serverIP = $serverIPElements[0]; - $serverIPPrefix = $serverIPElements[1] ?? 128; - $serverIPBin = $this->ip2bin($serverIP); - - // IP类型不符 - if (strlen($realIPBin) !== strlen($serverIPBin)) { - continue; - } - - if (strncmp($realIPBin, $serverIPBin, (int) $serverIPPrefix) === 0) { - $this->realIP = $tempIP; - break; - } - } - } - } - - if (!$this->isValidIP($this->realIP)) { - $this->realIP = '0.0.0.0'; - } - - return $this->realIP; - } - - /** - * 检测是否是合法的IP地址 - * - * @param string $ip IP地址 - * @param string $type IP地址类型 (ipv4, ipv6) - * - * @return boolean - */ - public function isValidIP(string $ip, string $type = ''): bool - { - switch (strtolower($type)) { - case 'ipv4': - $flag = FILTER_FLAG_IPV4; - break; - case 'ipv6': - $flag = FILTER_FLAG_IPV6; - break; - default: - $flag = 0; - break; - } - - return boolval(filter_var($ip, FILTER_VALIDATE_IP, $flag)); - } - - /** - * 将IP地址转换为二进制字符串 - * - * @param string $ip - * - * @return string - */ - public function ip2bin(string $ip): string - { - if ($this->isValidIP($ip, 'ipv6')) { - $IPHex = str_split(bin2hex(inet_pton($ip)), 4); - foreach ($IPHex as $key => $value) { - $IPHex[$key] = intval($value, 16); - } - $IPBin = vsprintf('%016b%016b%016b%016b%016b%016b%016b%016b', $IPHex); - } else { - $IPHex = str_split(bin2hex(inet_pton($ip)), 2); - foreach ($IPHex as $key => $value) { - $IPHex[$key] = intval($value, 16); - } - $IPBin = vsprintf('%08b%08b%08b%08b', $IPHex); - } - - return $IPBin; - } - - /** - * 检测是否使用手机访问 - * @access public - * @return bool - */ - public function isMobile(): bool - { - if ($this->server('HTTP_VIA') && stristr($this->server('HTTP_VIA'), "wap")) { - return true; - } elseif ($this->server('HTTP_ACCEPT') && strpos(strtoupper($this->server('HTTP_ACCEPT')), "VND.WAP.WML")) { - return true; - } elseif ($this->server('HTTP_X_WAP_PROFILE') || $this->server('HTTP_PROFILE')) { - return true; - } elseif ($this->server('HTTP_USER_AGENT') && preg_match('/(blackberry|configuration\/cldc|hp |hp-|htc |htc_|htc-|iemobile|kindle|midp|mmp|motorola|mobile|nokia|opera mini|opera |Googlebot-Mobile|YahooSeeker\/M1A1-R2D2|android|iphone|ipod|mobi|palm|palmos|pocket|portalmmm|ppc;|smartphone|sonyericsson|sqh|spv|symbian|treo|up.browser|up.link|vodafone|windows ce|xda |xda_)/i', $this->server('HTTP_USER_AGENT'))) { - return true; - } - - return false; - } - - /** - * 当前URL地址中的scheme参数 - * @access public - * @return string - */ - public function scheme(): string - { - return $this->isSsl() ? 'https' : 'http'; - } - - /** - * 当前请求URL地址中的query参数 - * @access public - * @return string - */ - public function query(): string - { - return $this->server('QUERY_STRING', ''); - } - - /** - * 设置当前请求的host(包含端口) - * @access public - * @param string $host 主机名(含端口) - * @return $this - */ - public function setHost(string $host) - { - $this->host = $host; - - return $this; - } - - /** - * 当前请求的host - * @access public - * @param bool $strict true 仅仅获取HOST - * @return string - */ - public function host(bool $strict = false): string - { - if ($this->host) { - $host = $this->host; - } else { - $host = strval($this->server('HTTP_X_FORWARDED_HOST') ?: $this->server('HTTP_HOST')); - } - - return true === $strict && strpos($host, ':') ? strstr($host, ':', true) : $host; - } - - /** - * 当前请求URL地址中的port参数 - * @access public - * @return int - */ - public function port(): int - { - return (int) ($this->server('HTTP_X_FORWARDED_PORT') ?: $this->server('SERVER_PORT', '')); - } - - /** - * 当前请求 SERVER_PROTOCOL - * @access public - * @return string - */ - public function protocol(): string - { - return $this->server('SERVER_PROTOCOL', ''); - } - - /** - * 当前请求 REMOTE_PORT - * @access public - * @return int - */ - public function remotePort(): int - { - return (int) $this->server('REMOTE_PORT', ''); - } - - /** - * 当前请求 HTTP_CONTENT_TYPE - * @access public - * @return string - */ - public function contentType(): string - { - $contentType = $this->header('Content-Type'); - - if ($contentType) { - if (strpos($contentType, ';')) { - [$type] = explode(';', $contentType); - } else { - $type = $contentType; - } - return trim($type); - } - - return ''; - } - - /** - * 获取当前请求的安全Key - * @access public - * @return string - */ - public function secureKey(): string - { - if (is_null($this->secureKey)) { - $this->secureKey = uniqid('', true); - } - - return $this->secureKey; - } - - /** - * 设置当前的控制器名 - * @access public - * @param string $controller 控制器名 - * @return $this - */ - public function setController(string $controller) - { - $this->controller = $controller; - return $this; - } - - /** - * 设置当前的操作名 - * @access public - * @param string $action 操作名 - * @return $this - */ - public function setAction(string $action) - { - $this->action = $action; - return $this; - } - - /** - * 获取当前的控制器名 - * @access public - * @param bool $convert 转换为小写 - * @return string - */ - public function controller(bool $convert = false): string - { - $name = $this->controller ?: ''; - return $convert ? strtolower($name) : $name; - } - - /** - * 获取当前的操作名 - * @access public - * @param bool $convert 转换为小写 - * @return string - */ - public function action(bool $convert = false): string - { - $name = $this->action ?: ''; - return $convert ? strtolower($name) : $name; - } - - /** - * 设置或者获取当前请求的content - * @access public - * @return string - */ - public function getContent(): string - { - if (is_null($this->content)) { - $this->content = $this->input; - } - - return $this->content; - } - - /** - * 获取当前请求的php://input - * @access public - * @return string - */ - public function getInput(): string - { - return $this->input; - } - - /** - * 生成请求令牌 - * @access public - * @param string $name 令牌名称 - * @param mixed $type 令牌生成方法 - * @return string - */ - public function buildToken(string $name = '__token__', $type = 'md5'): string - { - $type = is_callable($type) ? $type : 'md5'; - $token = call_user_func($type, $this->server('REQUEST_TIME_FLOAT')); - - $this->session->set($name, $token); - - return $token; - } - - /** - * 检查请求令牌 - * @access public - * @param string $token 令牌名称 - * @param array $data 表单数据 - * @return bool - */ - public function checkToken(string $token = '__token__', array $data = []): bool - { - if (in_array($this->method(), ['GET', 'HEAD', 'OPTIONS'], true)) { - return true; - } - - if (!$this->session->has($token)) { - // 令牌数据无效 - return false; - } - - // Header验证 - if ($this->header('X-CSRF-TOKEN') && $this->session->get($token) === $this->header('X-CSRF-TOKEN')) { - // 防止重复提交 - $this->session->delete($token); // 验证完成销毁session - return true; - } - - if (empty($data)) { - $data = $this->post(); - } - - // 令牌验证 - if (isset($data[$token]) && $this->session->get($token) === $data[$token]) { - // 防止重复提交 - $this->session->delete($token); // 验证完成销毁session - return true; - } - - // 开启TOKEN重置 - $this->session->delete($token); - return false; - } - - /** - * 设置在中间件传递的数据 - * @access public - * @param array $middleware 数据 - * @return $this - */ - public function withMiddleware(array $middleware) - { - $this->middleware = array_merge($this->middleware, $middleware); - return $this; - } - - /** - * 设置GET数据 - * @access public - * @param array $get 数据 - * @return $this - */ - public function withGet(array $get) - { - $this->get = $get; - return $this; - } - - /** - * 设置POST数据 - * @access public - * @param array $post 数据 - * @return $this - */ - public function withPost(array $post) - { - $this->post = $post; - return $this; - } - - /** - * 设置COOKIE数据 - * @access public - * @param array $cookie 数据 - * @return $this - */ - public function withCookie(array $cookie) - { - $this->cookie = $cookie; - return $this; - } - - /** - * 设置SESSION数据 - * @access public - * @param Session $session 数据 - * @return $this - */ - public function withSession(Session $session) - { - $this->session = $session; - return $this; - } - - /** - * 设置SERVER数据 - * @access public - * @param array $server 数据 - * @return $this - */ - public function withServer(array $server) - { - $this->server = array_change_key_case($server, CASE_UPPER); - return $this; - } - - /** - * 设置HEADER数据 - * @access public - * @param array $header 数据 - * @return $this - */ - public function withHeader(array $header) - { - $this->header = array_change_key_case($header); - return $this; - } - - /** - * 设置ENV数据 - * @access public - * @param Env $env 数据 - * @return $this - */ - public function withEnv(Env $env) - { - $this->env = $env; - return $this; - } - - /** - * 设置php://input数据 - * @access public - * @param string $input RAW数据 - * @return $this - */ - public function withInput(string $input) - { - $this->input = $input; - if (!empty($input)) { - $inputData = $this->getInputData($input); - if (!empty($inputData)) { - $this->post = $inputData; - $this->put = $inputData; - } - } - return $this; - } - - /** - * 设置文件上传数据 - * @access public - * @param array $files 上传信息 - * @return $this - */ - public function withFiles(array $files) - { - $this->file = $files; - return $this; - } - - /** - * 设置ROUTE变量 - * @access public - * @param array $route 数据 - * @return $this - */ - public function withRoute(array $route) - { - $this->route = $route; - return $this; - } - - /** - * 设置中间传递数据 - * @access public - * @param string $name 参数名 - * @param mixed $value 值 - */ - public function __set(string $name, $value) - { - $this->middleware[$name] = $value; - } - - /** - * 获取中间传递数据的值 - * @access public - * @param string $name 名称 - * @return mixed - */ - public function __get(string $name) - { - return $this->middleware($name); - } - - /** - * 检测中间传递数据的值 - * @access public - * @param string $name 名称 - * @return boolean - */ - public function __isset(string $name): bool - { - return isset($this->middleware[$name]); - } - - // ArrayAccess - public function offsetExists($name): bool - { - return $this->has($name); - } - - public function offsetGet($name) - { - return $this->param($name); - } - - public function offsetSet($name, $value) - {} - - public function offsetUnset($name) - {} - -} diff --git a/vendor/topthink/framework/src/think/Response.php b/vendor/topthink/framework/src/think/Response.php deleted file mode 100644 index 2c07f53..0000000 --- a/vendor/topthink/framework/src/think/Response.php +++ /dev/null @@ -1,410 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -/** - * 响应输出基础类 - * @package think - */ -abstract class Response -{ - /** - * 原始数据 - * @var mixed - */ - protected $data; - - /** - * 当前contentType - * @var string - */ - protected $contentType = 'text/html'; - - /** - * 字符集 - * @var string - */ - protected $charset = 'utf-8'; - - /** - * 状态码 - * @var integer - */ - protected $code = 200; - - /** - * 是否允许请求缓存 - * @var bool - */ - protected $allowCache = true; - - /** - * 输出参数 - * @var array - */ - protected $options = []; - - /** - * header参数 - * @var array - */ - protected $header = []; - - /** - * 输出内容 - * @var string - */ - protected $content = null; - - /** - * Cookie对象 - * @var Cookie - */ - protected $cookie; - - /** - * Session对象 - * @var Session - */ - protected $session; - - /** - * 初始化 - * @access protected - * @param mixed $data 输出数据 - * @param int $code 状态码 - */ - protected function init($data = '', int $code = 200) - { - $this->data($data); - $this->code = $code; - - $this->contentType($this->contentType, $this->charset); - } - - /** - * 创建Response对象 - * @access public - * @param mixed $data 输出数据 - * @param string $type 输出类型 - * @param int $code 状态码 - * @return Response - */ - public static function create($data = '', string $type = 'html', int $code = 200): Response - { - $class = false !== strpos($type, '\\') ? $type : '\\think\\response\\' . ucfirst(strtolower($type)); - - return Container::getInstance()->invokeClass($class, [$data, $code]); - } - - /** - * 设置Session对象 - * @access public - * @param Session $session Session对象 - * @return $this - */ - public function setSession(Session $session) - { - $this->session = $session; - return $this; - } - - /** - * 发送数据到客户端 - * @access public - * @return void - * @throws \InvalidArgumentException - */ - public function send(): void - { - // 处理输出数据 - $data = $this->getContent(); - - if (!headers_sent() && !empty($this->header)) { - // 发送状态码 - http_response_code($this->code); - // 发送头部信息 - foreach ($this->header as $name => $val) { - header($name . (!is_null($val) ? ':' . $val : '')); - } - } - if ($this->cookie) { - $this->cookie->save(); - } - - $this->sendData($data); - - if (function_exists('fastcgi_finish_request')) { - // 提高页面响应 - fastcgi_finish_request(); - } - } - - /** - * 处理数据 - * @access protected - * @param mixed $data 要处理的数据 - * @return mixed - */ - protected function output($data) - { - return $data; - } - - /** - * 输出数据 - * @access protected - * @param string $data 要处理的数据 - * @return void - */ - protected function sendData(string $data): void - { - echo $data; - } - - /** - * 输出的参数 - * @access public - * @param mixed $options 输出参数 - * @return $this - */ - public function options(array $options = []) - { - $this->options = array_merge($this->options, $options); - - return $this; - } - - /** - * 输出数据设置 - * @access public - * @param mixed $data 输出数据 - * @return $this - */ - public function data($data) - { - $this->data = $data; - - return $this; - } - - /** - * 是否允许请求缓存 - * @access public - * @param bool $cache 允许请求缓存 - * @return $this - */ - public function allowCache(bool $cache) - { - $this->allowCache = $cache; - - return $this; - } - - /** - * 是否允许请求缓存 - * @access public - * @return $this - */ - public function isAllowCache() - { - return $this->allowCache; - } - - /** - * 设置Cookie - * @access public - * @param string $name cookie名称 - * @param string $value cookie值 - * @param mixed $option 可选参数 - * @return $this - */ - public function cookie(string $name, string $value, $option = null) - { - $this->cookie->set($name, $value, $option); - - return $this; - } - - /** - * 设置响应头 - * @access public - * @param array $header 参数 - * @return $this - */ - public function header(array $header = []) - { - $this->header = array_merge($this->header, $header); - - return $this; - } - - /** - * 设置页面输出内容 - * @access public - * @param mixed $content - * @return $this - */ - public function content($content) - { - if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([ - $content, - '__toString', - ]) - ) { - throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content))); - } - - $this->content = (string) $content; - - return $this; - } - - /** - * 发送HTTP状态 - * @access public - * @param integer $code 状态码 - * @return $this - */ - public function code(int $code) - { - $this->code = $code; - - return $this; - } - - /** - * LastModified - * @access public - * @param string $time - * @return $this - */ - public function lastModified(string $time) - { - $this->header['Last-Modified'] = $time; - - return $this; - } - - /** - * Expires - * @access public - * @param string $time - * @return $this - */ - public function expires(string $time) - { - $this->header['Expires'] = $time; - - return $this; - } - - /** - * ETag - * @access public - * @param string $eTag - * @return $this - */ - public function eTag(string $eTag) - { - $this->header['ETag'] = $eTag; - - return $this; - } - - /** - * 页面缓存控制 - * @access public - * @param string $cache 状态码 - * @return $this - */ - public function cacheControl(string $cache) - { - $this->header['Cache-control'] = $cache; - - return $this; - } - - /** - * 页面输出类型 - * @access public - * @param string $contentType 输出类型 - * @param string $charset 输出编码 - * @return $this - */ - public function contentType(string $contentType, string $charset = 'utf-8') - { - $this->header['Content-Type'] = $contentType . '; charset=' . $charset; - - return $this; - } - - /** - * 获取头部信息 - * @access public - * @param string $name 头部名称 - * @return mixed - */ - public function getHeader(string $name = '') - { - if (!empty($name)) { - return $this->header[$name] ?? null; - } - - return $this->header; - } - - /** - * 获取原始数据 - * @access public - * @return mixed - */ - public function getData() - { - return $this->data; - } - - /** - * 获取输出数据 - * @access public - * @return string - */ - public function getContent(): string - { - if (null == $this->content) { - $content = $this->output($this->data); - - if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([ - $content, - '__toString', - ]) - ) { - throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content))); - } - - $this->content = (string) $content; - } - - return $this->content; - } - - /** - * 获取状态码 - * @access public - * @return integer - */ - public function getCode(): int - { - return $this->code; - } -} diff --git a/vendor/topthink/framework/src/think/Route.php b/vendor/topthink/framework/src/think/Route.php deleted file mode 100644 index a3acf85..0000000 --- a/vendor/topthink/framework/src/think/Route.php +++ /dev/null @@ -1,926 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use Closure; -use think\exception\RouteNotFoundException; -use think\route\Dispatch; -use think\route\dispatch\Callback; -use think\route\dispatch\Url as UrlDispatch; -use think\route\Domain; -use think\route\Resource; -use think\route\Rule; -use think\route\RuleGroup; -use think\route\RuleItem; -use think\route\RuleName; -use think\route\Url as UrlBuild; - -/** - * 路由管理类 - * @package think - */ -class Route -{ - /** - * REST定义 - * @var array - */ - protected $rest = [ - 'index' => ['get', '', 'index'], - 'create' => ['get', '/create', 'create'], - 'edit' => ['get', '//edit', 'edit'], - 'read' => ['get', '/', 'read'], - 'save' => ['post', '', 'save'], - 'update' => ['put', '/', 'update'], - 'delete' => ['delete', '/', 'delete'], - ]; - - /** - * 配置参数 - * @var array - */ - protected $config = [ - // pathinfo分隔符 - 'pathinfo_depr' => '/', - // 是否开启路由延迟解析 - 'url_lazy_route' => false, - // 是否强制使用路由 - 'url_route_must' => false, - // 合并路由规则 - 'route_rule_merge' => false, - // 路由是否完全匹配 - 'route_complete_match' => false, - // 去除斜杠 - 'remove_slash' => false, - // 使用注解路由 - 'route_annotation' => false, - // 默认的路由变量规则 - 'default_route_pattern' => '[\w\.]+', - // URL伪静态后缀 - 'url_html_suffix' => 'html', - // 访问控制器层名称 - 'controller_layer' => 'controller', - // 空控制器名 - 'empty_controller' => 'Error', - // 是否使用控制器后缀 - 'controller_suffix' => false, - // 默认控制器名 - 'default_controller' => 'Index', - // 默认操作名 - 'default_action' => 'index', - // 操作方法后缀 - 'action_suffix' => '', - // 非路由变量是否使用普通参数方式(用于URL生成) - 'url_common_param' => true, - ]; - - /** - * 当前应用 - * @var App - */ - protected $app; - - /** - * 请求对象 - * @var Request - */ - protected $request; - - /** - * @var RuleName - */ - protected $ruleName; - - /** - * 当前HOST - * @var string - */ - protected $host; - - /** - * 当前分组对象 - * @var RuleGroup - */ - protected $group; - - /** - * 路由绑定 - * @var array - */ - protected $bind = []; - - /** - * 域名对象 - * @var Domain[] - */ - protected $domains = []; - - /** - * 跨域路由规则 - * @var RuleGroup - */ - protected $cross; - - /** - * 路由是否延迟解析 - * @var bool - */ - protected $lazy = false; - - /** - * 路由是否测试模式 - * @var bool - */ - protected $isTest = false; - - /** - * (分组)路由规则是否合并解析 - * @var bool - */ - protected $mergeRuleRegex = false; - - /** - * 是否去除URL最后的斜线 - * @var bool - */ - protected $removeSlash = false; - - public function __construct(App $app) - { - $this->app = $app; - $this->ruleName = new RuleName(); - $this->setDefaultDomain(); - - if (is_file($this->app->getRuntimePath() . 'route.php')) { - // 读取路由映射文件 - $this->import(include $this->app->getRuntimePath() . 'route.php'); - } - - $this->config = array_merge($this->config, $this->app->config->get('route')); - } - - protected function init() - { - if (!empty($this->config['middleware'])) { - $this->app->middleware->import($this->config['middleware'], 'route'); - } - - $this->lazy($this->config['url_lazy_route']); - $this->mergeRuleRegex = $this->config['route_rule_merge']; - $this->removeSlash = $this->config['remove_slash']; - - $this->group->removeSlash($this->removeSlash); - } - - public function config(string $name = null) - { - if (is_null($name)) { - return $this->config; - } - - return $this->config[$name] ?? null; - } - - /** - * 设置路由域名及分组(包括资源路由)是否延迟解析 - * @access public - * @param bool $lazy 路由是否延迟解析 - * @return $this - */ - public function lazy(bool $lazy = true) - { - $this->lazy = $lazy; - return $this; - } - - /** - * 设置路由为测试模式 - * @access public - * @param bool $test 路由是否测试模式 - * @return void - */ - public function setTestMode(bool $test): void - { - $this->isTest = $test; - } - - /** - * 检查路由是否为测试模式 - * @access public - * @return bool - */ - public function isTest(): bool - { - return $this->isTest; - } - - /** - * 设置路由域名及分组(包括资源路由)是否合并解析 - * @access public - * @param bool $merge 路由是否合并解析 - * @return $this - */ - public function mergeRuleRegex(bool $merge = true) - { - $this->mergeRuleRegex = $merge; - $this->group->mergeRuleRegex($merge); - - return $this; - } - - /** - * 初始化默认域名 - * @access protected - * @return void - */ - protected function setDefaultDomain(): void - { - // 注册默认域名 - $domain = new Domain($this); - - $this->domains['-'] = $domain; - - // 默认分组 - $this->group = $domain; - } - - /** - * 设置当前分组 - * @access public - * @param RuleGroup $group 域名 - * @return void - */ - public function setGroup(RuleGroup $group): void - { - $this->group = $group; - } - - /** - * 获取指定标识的路由分组 不指定则获取当前分组 - * @access public - * @param string $name 分组标识 - * @return RuleGroup - */ - public function getGroup(string $name = null) - { - return $name ? $this->ruleName->getGroup($name) : $this->group; - } - - /** - * 注册变量规则 - * @access public - * @param array $pattern 变量规则 - * @return $this - */ - public function pattern(array $pattern) - { - $this->group->pattern($pattern); - - return $this; - } - - /** - * 注册路由参数 - * @access public - * @param array $option 参数 - * @return $this - */ - public function option(array $option) - { - $this->group->option($option); - - return $this; - } - - /** - * 注册域名路由 - * @access public - * @param string|array $name 子域名 - * @param mixed $rule 路由规则 - * @return Domain - */ - public function domain($name, $rule = null): Domain - { - // 支持多个域名使用相同路由规则 - $domainName = is_array($name) ? array_shift($name) : $name; - - if (!isset($this->domains[$domainName])) { - $domain = (new Domain($this, $domainName, $rule)) - ->lazy($this->lazy) - ->removeSlash($this->removeSlash) - ->mergeRuleRegex($this->mergeRuleRegex); - - $this->domains[$domainName] = $domain; - } else { - $domain = $this->domains[$domainName]; - $domain->parseGroupRule($rule); - } - - if (is_array($name) && !empty($name)) { - foreach ($name as $item) { - $this->domains[$item] = $domainName; - } - } - - // 返回域名对象 - return $domain; - } - - /** - * 获取域名 - * @access public - * @return array - */ - public function getDomains(): array - { - return $this->domains; - } - - /** - * 获取RuleName对象 - * @access public - * @return RuleName - */ - public function getRuleName(): RuleName - { - return $this->ruleName; - } - - /** - * 设置路由绑定 - * @access public - * @param string $bind 绑定信息 - * @param string $domain 域名 - * @return $this - */ - public function bind(string $bind, string $domain = null) - { - $domain = is_null($domain) ? '-' : $domain; - - $this->bind[$domain] = $bind; - - return $this; - } - - /** - * 读取路由绑定信息 - * @access public - * @return array - */ - public function getBind(): array - { - return $this->bind; - } - - /** - * 读取路由绑定 - * @access public - * @param string $domain 域名 - * @return string|null - */ - public function getDomainBind(string $domain = null) - { - if (is_null($domain)) { - $domain = $this->host; - } elseif (false === strpos($domain, '.') && $this->request) { - $domain .= '.' . $this->request->rootDomain(); - } - - if ($this->request) { - $subDomain = $this->request->subDomain(); - - if (strpos($subDomain, '.')) { - $name = '*' . strstr($subDomain, '.'); - } - } - - if (isset($this->bind[$domain])) { - $result = $this->bind[$domain]; - } elseif (isset($name) && isset($this->bind[$name])) { - $result = $this->bind[$name]; - } elseif (!empty($subDomain) && isset($this->bind['*'])) { - $result = $this->bind['*']; - } else { - $result = null; - } - - return $result; - } - - /** - * 读取路由标识 - * @access public - * @param string $name 路由标识 - * @param string $domain 域名 - * @param string $method 请求类型 - * @return array - */ - public function getName(string $name = null, string $domain = null, string $method = '*'): array - { - return $this->ruleName->getName($name, $domain, $method); - } - - /** - * 批量导入路由标识 - * @access public - * @param array $name 路由标识 - * @return void - */ - public function import(array $name): void - { - $this->ruleName->import($name); - } - - /** - * 注册路由标识 - * @access public - * @param string $name 路由标识 - * @param RuleItem $ruleItem 路由规则 - * @param bool $first 是否优先 - * @return void - */ - public function setName(string $name, RuleItem $ruleItem, bool $first = false): void - { - $this->ruleName->setName($name, $ruleItem, $first); - } - - /** - * 保存路由规则 - * @access public - * @param string $rule 路由规则 - * @param RuleItem $ruleItem RuleItem对象 - * @return void - */ - public function setRule(string $rule, RuleItem $ruleItem = null): void - { - $this->ruleName->setRule($rule, $ruleItem); - } - - /** - * 读取路由 - * @access public - * @param string $rule 路由规则 - * @return RuleItem[] - */ - public function getRule(string $rule): array - { - return $this->ruleName->getRule($rule); - } - - /** - * 读取路由列表 - * @access public - * @return array - */ - public function getRuleList(): array - { - return $this->ruleName->getRuleList(); - } - - /** - * 清空路由规则 - * @access public - * @return void - */ - public function clear(): void - { - $this->ruleName->clear(); - - if ($this->group) { - $this->group->clear(); - } - } - - /** - * 注册路由规则 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @param string $method 请求类型 - * @return RuleItem - */ - public function rule(string $rule, $route = null, string $method = '*'): RuleItem - { - if ($route instanceof Response) { - // 兼容之前的路由到响应对象,感觉不需要,使用场景很少,闭包就能实现 - $route = function () use ($route) { - return $route; - }; - } - return $this->group->addRule($rule, $route, $method); - } - - /** - * 设置跨域有效路由规则 - * @access public - * @param Rule $rule 路由规则 - * @param string $method 请求类型 - * @return $this - */ - public function setCrossDomainRule(Rule $rule, string $method = '*') - { - if (!isset($this->cross)) { - $this->cross = (new RuleGroup($this))->mergeRuleRegex($this->mergeRuleRegex); - } - - $this->cross->addRuleItem($rule, $method); - - return $this; - } - - /** - * 注册路由分组 - * @access public - * @param string|\Closure $name 分组名称或者参数 - * @param mixed $route 分组路由 - * @return RuleGroup - */ - public function group($name, $route = null): RuleGroup - { - if ($name instanceof Closure) { - $route = $name; - $name = ''; - } - - return (new RuleGroup($this, $this->group, $name, $route)) - ->lazy($this->lazy) - ->removeSlash($this->removeSlash) - ->mergeRuleRegex($this->mergeRuleRegex); - } - - /** - * 注册路由 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @return RuleItem - */ - public function any(string $rule, $route): RuleItem - { - return $this->rule($rule, $route, '*'); - } - - /** - * 注册GET路由 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @return RuleItem - */ - public function get(string $rule, $route): RuleItem - { - return $this->rule($rule, $route, 'GET'); - } - - /** - * 注册POST路由 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @return RuleItem - */ - public function post(string $rule, $route): RuleItem - { - return $this->rule($rule, $route, 'POST'); - } - - /** - * 注册PUT路由 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @return RuleItem - */ - public function put(string $rule, $route): RuleItem - { - return $this->rule($rule, $route, 'PUT'); - } - - /** - * 注册DELETE路由 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @return RuleItem - */ - public function delete(string $rule, $route): RuleItem - { - return $this->rule($rule, $route, 'DELETE'); - } - - /** - * 注册PATCH路由 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @return RuleItem - */ - public function patch(string $rule, $route): RuleItem - { - return $this->rule($rule, $route, 'PATCH'); - } - - /** - * 注册OPTIONS路由 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @return RuleItem - */ - public function options(string $rule, $route): RuleItem - { - return $this->rule($rule, $route, 'OPTIONS'); - } - - /** - * 注册资源路由 - * @access public - * @param string $rule 路由规则 - * @param string $route 路由地址 - * @return Resource - */ - public function resource(string $rule, string $route): Resource - { - return (new Resource($this, $this->group, $rule, $route, $this->rest)) - ->lazy($this->lazy); - } - - /** - * 注册视图路由 - * @access public - * @param string $rule 路由规则 - * @param string $template 路由模板地址 - * @param array $vars 模板变量 - * @return RuleItem - */ - public function view(string $rule, string $template = '', array $vars = []): RuleItem - { - return $this->rule($rule, function () use ($vars, $template) { - return Response::create($template, 'view')->assign($vars); - }, 'GET'); - } - - /** - * 注册重定向路由 - * @access public - * @param string $rule 路由规则 - * @param string $route 路由地址 - * @param int $status 状态码 - * @return RuleItem - */ - public function redirect(string $rule, string $route = '', int $status = 301): RuleItem - { - return $this->rule($rule, function (Request $request) use ($status, $route) { - $search = $replace = []; - $matches = $request->rule()->getVars(); - - foreach ($matches as $key => $value) { - $search[] = '<' . $key . '>'; - $replace[] = $value; - - $search[] = ':' . $key; - $replace[] = $value; - } - - $route = str_replace($search, $replace, $route); - return Response::create($route, 'redirect')->code($status); - }, '*'); - } - - /** - * rest方法定义和修改 - * @access public - * @param string|array $name 方法名称 - * @param array|bool $resource 资源 - * @return $this - */ - public function rest($name, $resource = []) - { - if (is_array($name)) { - $this->rest = $resource ? $name : array_merge($this->rest, $name); - } else { - $this->rest[$name] = $resource; - } - - return $this; - } - - /** - * 获取rest方法定义的参数 - * @access public - * @param string $name 方法名称 - * @return array|null - */ - public function getRest(string $name = null) - { - if (is_null($name)) { - return $this->rest; - } - - return $this->rest[$name] ?? null; - } - - /** - * 注册未匹配路由规则后的处理 - * @access public - * @param string|Closure $route 路由地址 - * @param string $method 请求类型 - * @return RuleItem - */ - public function miss($route, string $method = '*'): RuleItem - { - return $this->group->miss($route, $method); - } - - /** - * 路由调度 - * @param Request $request - * @param Closure|bool $withRoute - * @return Response - */ - public function dispatch(Request $request, $withRoute = true) - { - $this->request = $request; - $this->host = $this->request->host(true); - $this->init(); - - if ($withRoute) { - //加载路由 - if ($withRoute instanceof Closure) { - $withRoute(); - } - $dispatch = $this->check(); - } else { - $dispatch = $this->url($this->path()); - } - - $dispatch->init($this->app); - - return $this->app->middleware->pipeline('route') - ->send($request) - ->then(function () use ($dispatch) { - return $dispatch->run(); - }); - } - - /** - * 检测URL路由 - * @access public - * @return Dispatch|false - * @throws RouteNotFoundException - */ - public function check() - { - // 自动检测域名路由 - $url = str_replace($this->config['pathinfo_depr'], '|', $this->path()); - - $completeMatch = $this->config['route_complete_match']; - - $result = $this->checkDomain()->check($this->request, $url, $completeMatch); - - if (false === $result && !empty($this->cross)) { - // 检测跨域路由 - $result = $this->cross->check($this->request, $url, $completeMatch); - } - - if (false !== $result) { - return $result; - } elseif ($this->config['url_route_must']) { - throw new RouteNotFoundException(); - } - - return $this->url($url); - } - - /** - * 获取当前请求URL的pathinfo信息(不含URL后缀) - * @access protected - * @return string - */ - protected function path(): string - { - $suffix = $this->config['url_html_suffix']; - $pathinfo = $this->request->pathinfo(); - - if (false === $suffix) { - // 禁止伪静态访问 - $path = $pathinfo; - } elseif ($suffix) { - // 去除正常的URL后缀 - $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo); - } else { - // 允许任何后缀访问 - $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo); - } - - return $path; - } - - /** - * 默认URL解析 - * @access public - * @param string $url URL地址 - * @return Dispatch - */ - public function url(string $url): Dispatch - { - if ($this->request->method() == 'OPTIONS') { - // 自动响应options请求 - return new Callback($this->request, $this->group, function () { - return Response::create('', 'html', 204)->header(['Allow' => 'GET, POST, PUT, DELETE']); - }); - } - - return new UrlDispatch($this->request, $this->group, $url); - } - - /** - * 检测域名的路由规则 - * @access protected - * @return Domain - */ - protected function checkDomain(): Domain - { - $item = false; - - if (count($this->domains) > 1) { - // 获取当前子域名 - $subDomain = $this->request->subDomain(); - - $domain = $subDomain ? explode('.', $subDomain) : []; - $domain2 = $domain ? array_pop($domain) : ''; - - if ($domain) { - // 存在三级域名 - $domain3 = array_pop($domain); - } - - if (isset($this->domains[$this->host])) { - // 子域名配置 - $item = $this->domains[$this->host]; - } elseif (isset($this->domains[$subDomain])) { - $item = $this->domains[$subDomain]; - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { - // 泛三级域名 - $item = $this->domains['*.' . $domain2]; - $panDomain = $domain3; - } elseif (isset($this->domains['*']) && !empty($domain2)) { - // 泛二级域名 - if ('www' != $domain2) { - $item = $this->domains['*']; - $panDomain = $domain2; - } - } - - if (isset($panDomain)) { - // 保存当前泛域名 - $this->request->setPanDomain($panDomain); - } - } - - if (false === $item) { - // 检测全局域名规则 - $item = $this->domains['-']; - } - - if (is_string($item)) { - $item = $this->domains[$item]; - } - - return $item; - } - - /** - * URL生成 支持路由反射 - * @access public - * @param string $url 路由地址 - * @param array $vars 参数 ['a'=>'val1', 'b'=>'val2'] - * @return UrlBuild - */ - public function buildUrl(string $url = '', array $vars = []): UrlBuild - { - return $this->app->make(UrlBuild::class, [$this, $this->app, $url, $vars], true); - } - - /** - * 设置全局的路由分组参数 - * @access public - * @param string $method 方法名 - * @param array $args 调用参数 - * @return RuleGroup - */ - public function __call($method, $args) - { - return call_user_func_array([$this->group, $method], $args); - } -} diff --git a/vendor/topthink/framework/src/think/Service.php b/vendor/topthink/framework/src/think/Service.php deleted file mode 100644 index d9e8960..0000000 --- a/vendor/topthink/framework/src/think/Service.php +++ /dev/null @@ -1,66 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use Closure; -use think\event\RouteLoaded; - -/** - * 系统服务基础类 - * @method void register() - * @method void boot() - */ -abstract class Service -{ - protected $app; - - public function __construct(App $app) - { - $this->app = $app; - } - - /** - * 加载路由 - * @access protected - * @param string $path 路由路径 - */ - protected function loadRoutesFrom($path) - { - $this->registerRoutes(function () use ($path) { - include $path; - }); - } - - /** - * 注册路由 - * @param Closure $closure - */ - protected function registerRoutes(Closure $closure) - { - $this->app->event->listen(RouteLoaded::class, $closure); - } - - /** - * 添加指令 - * @access protected - * @param array|string $commands 指令 - */ - protected function commands($commands) - { - $commands = is_array($commands) ? $commands : func_get_args(); - - Console::starting(function (Console $console) use ($commands) { - $console->addCommands($commands); - }); - } -} diff --git a/vendor/topthink/framework/src/think/Session.php b/vendor/topthink/framework/src/think/Session.php deleted file mode 100644 index 6c84faf..0000000 --- a/vendor/topthink/framework/src/think/Session.php +++ /dev/null @@ -1,65 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use think\helper\Arr; -use think\session\Store; - -/** - * Session管理类 - * @package think - * @mixin Store - */ -class Session extends Manager -{ - protected $namespace = '\\think\\session\\driver\\'; - - protected function createDriver(string $name) - { - $handler = parent::createDriver($name); - - return new Store($this->getConfig('name') ?: 'PHPSESSID', $handler, $this->getConfig('serialize')); - } - - /** - * 获取Session配置 - * @access public - * @param null|string $name 名称 - * @param mixed $default 默认值 - * @return mixed - */ - public function getConfig(string $name = null, $default = null) - { - if (!is_null($name)) { - return $this->app->config->get('session.' . $name, $default); - } - - return $this->app->config->get('session'); - } - - protected function resolveConfig(string $name) - { - $config = $this->app->config->get('session', []); - Arr::forget($config, 'type'); - return $config; - } - - /** - * 默认驱动 - * @return string|null - */ - public function getDefaultDriver() - { - return $this->app->config->get('session.type', 'file'); - } -} diff --git a/vendor/topthink/framework/src/think/Validate.php b/vendor/topthink/framework/src/think/Validate.php deleted file mode 100644 index b7033cc..0000000 --- a/vendor/topthink/framework/src/think/Validate.php +++ /dev/null @@ -1,1688 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use Closure; -use think\exception\ValidateException; -use think\helper\Str; -use think\validate\ValidateRule; - -/** - * 数据验证类 - * @package think - */ -class Validate -{ - /** - * 自定义验证类型 - * @var array - */ - protected $type = []; - - /** - * 验证类型别名 - * @var array - */ - protected $alias = [ - '>' => 'gt', '>=' => 'egt', '<' => 'lt', '<=' => 'elt', '=' => 'eq', 'same' => 'eq', - ]; - - /** - * 当前验证规则 - * @var array - */ - protected $rule = []; - - /** - * 验证提示信息 - * @var array - */ - protected $message = []; - - /** - * 验证字段描述 - * @var array - */ - protected $field = []; - - /** - * 默认规则提示 - * @var array - */ - protected $typeMsg = [ - 'require' => ':attribute require', - 'must' => ':attribute must', - 'number' => ':attribute must be numeric', - 'integer' => ':attribute must be integer', - 'float' => ':attribute must be float', - 'boolean' => ':attribute must be bool', - 'email' => ':attribute not a valid email address', - 'mobile' => ':attribute not a valid mobile', - 'array' => ':attribute must be a array', - 'accepted' => ':attribute must be yes,on or 1', - 'date' => ':attribute not a valid datetime', - 'file' => ':attribute not a valid file', - 'image' => ':attribute not a valid image', - 'alpha' => ':attribute must be alpha', - 'alphaNum' => ':attribute must be alpha-numeric', - 'alphaDash' => ':attribute must be alpha-numeric, dash, underscore', - 'activeUrl' => ':attribute not a valid domain or ip', - 'chs' => ':attribute must be chinese', - 'chsAlpha' => ':attribute must be chinese or alpha', - 'chsAlphaNum' => ':attribute must be chinese,alpha-numeric', - 'chsDash' => ':attribute must be chinese,alpha-numeric,underscore, dash', - 'url' => ':attribute not a valid url', - 'ip' => ':attribute not a valid ip', - 'dateFormat' => ':attribute must be dateFormat of :rule', - 'in' => ':attribute must be in :rule', - 'notIn' => ':attribute be notin :rule', - 'between' => ':attribute must between :1 - :2', - 'notBetween' => ':attribute not between :1 - :2', - 'length' => 'size of :attribute must be :rule', - 'max' => 'max size of :attribute must be :rule', - 'min' => 'min size of :attribute must be :rule', - 'after' => ':attribute cannot be less than :rule', - 'before' => ':attribute cannot exceed :rule', - 'expire' => ':attribute not within :rule', - 'allowIp' => 'access IP is not allowed', - 'denyIp' => 'access IP denied', - 'confirm' => ':attribute out of accord with :2', - 'different' => ':attribute cannot be same with :2', - 'egt' => ':attribute must greater than or equal :rule', - 'gt' => ':attribute must greater than :rule', - 'elt' => ':attribute must less than or equal :rule', - 'lt' => ':attribute must less than :rule', - 'eq' => ':attribute must equal :rule', - 'unique' => ':attribute has exists', - 'regex' => ':attribute not conform to the rules', - 'method' => 'invalid Request method', - 'token' => 'invalid token', - 'fileSize' => 'filesize not match', - 'fileExt' => 'extensions to upload is not allowed', - 'fileMime' => 'mimetype to upload is not allowed', - ]; - - /** - * 当前验证场景 - * @var string - */ - protected $currentScene; - - /** - * 内置正则验证规则 - * @var array - */ - protected $defaultRegex = [ - 'alpha' => '/^[A-Za-z]+$/', - 'alphaNum' => '/^[A-Za-z0-9]+$/', - 'alphaDash' => '/^[A-Za-z0-9\-\_]+$/', - 'chs' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}]+$/u', - 'chsAlpha' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}a-zA-Z]+$/u', - 'chsAlphaNum' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}a-zA-Z0-9]+$/u', - 'chsDash' => '/^[\x{4e00}-\x{9fa5}\x{9fa6}-\x{9fef}\x{3400}-\x{4db5}\x{20000}-\x{2ebe0}a-zA-Z0-9\_\-]+$/u', - 'mobile' => '/^1[3-9]\d{9}$/', - 'idCard' => '/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/', - 'zip' => '/\d{6}/', - ]; - - /** - * Filter_var 规则 - * @var array - */ - protected $filter = [ - 'email' => FILTER_VALIDATE_EMAIL, - 'ip' => [FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6], - 'integer' => FILTER_VALIDATE_INT, - 'url' => FILTER_VALIDATE_URL, - 'macAddr' => FILTER_VALIDATE_MAC, - 'float' => FILTER_VALIDATE_FLOAT, - ]; - - /** - * 验证场景定义 - * @var array - */ - protected $scene = []; - - /** - * 验证失败错误信息 - * @var string|array - */ - protected $error = []; - - /** - * 是否批量验证 - * @var bool - */ - protected $batch = false; - - /** - * 验证失败是否抛出异常 - * @var bool - */ - protected $failException = false; - - /** - * 场景需要验证的规则 - * @var array - */ - protected $only = []; - - /** - * 场景需要移除的验证规则 - * @var array - */ - protected $remove = []; - - /** - * 场景需要追加的验证规则 - * @var array - */ - protected $append = []; - - /** - * 验证正则定义 - * @var array - */ - protected $regex = []; - - /** - * Db对象 - * @var Db - */ - protected $db; - - /** - * 语言对象 - * @var Lang - */ - protected $lang; - - /** - * 请求对象 - * @var Request - */ - protected $request; - - /** - * @var Closure[] - */ - protected static $maker = []; - - /** - * 构造方法 - * @access public - */ - public function __construct() - { - if (!empty(static::$maker)) { - foreach (static::$maker as $maker) { - call_user_func($maker, $this); - } - } - } - - /** - * 设置服务注入 - * @access public - * @param Closure $maker - * @return void - */ - public static function maker(Closure $maker) - { - static::$maker[] = $maker; - } - - /** - * 设置Lang对象 - * @access public - * @param Lang $lang Lang对象 - * @return void - */ - public function setLang(Lang $lang) - { - $this->lang = $lang; - } - - /** - * 设置Db对象 - * @access public - * @param Db $db Db对象 - * @return void - */ - public function setDb(Db $db) - { - $this->db = $db; - } - - /** - * 设置Request对象 - * @access public - * @param Request $request Request对象 - * @return void - */ - public function setRequest(Request $request) - { - $this->request = $request; - } - - /** - * 添加字段验证规则 - * @access protected - * @param string|array $name 字段名称或者规则数组 - * @param mixed $rule 验证规则或者字段描述信息 - * @return $this - */ - public function rule($name, $rule = '') - { - if (is_array($name)) { - $this->rule = $name + $this->rule; - if (is_array($rule)) { - $this->field = array_merge($this->field, $rule); - } - } else { - $this->rule[$name] = $rule; - } - - return $this; - } - - /** - * 注册验证(类型)规则 - * @access public - * @param string $type 验证规则类型 - * @param callable $callback callback方法(或闭包) - * @param string $message 验证失败提示信息 - * @return $this - */ - public function extend(string $type, callable $callback = null, string $message = null) - { - $this->type[$type] = $callback; - - if ($message) { - $this->typeMsg[$type] = $message; - } - - return $this; - } - - /** - * 设置验证规则的默认提示信息 - * @access public - * @param string|array $type 验证规则类型名称或者数组 - * @param string $msg 验证提示信息 - * @return void - */ - public function setTypeMsg($type, string $msg = null): void - { - if (is_array($type)) { - $this->typeMsg = array_merge($this->typeMsg, $type); - } else { - $this->typeMsg[$type] = $msg; - } - } - - /** - * 设置提示信息 - * @access public - * @param array $message 错误信息 - * @return Validate - */ - public function message(array $message) - { - $this->message = array_merge($this->message, $message); - - return $this; - } - - /** - * 设置验证场景 - * @access public - * @param string $name 场景名 - * @return $this - */ - public function scene(string $name) - { - // 设置当前场景 - $this->currentScene = $name; - - return $this; - } - - /** - * 判断是否存在某个验证场景 - * @access public - * @param string $name 场景名 - * @return bool - */ - public function hasScene(string $name): bool - { - return isset($this->scene[$name]) || method_exists($this, 'scene' . $name); - } - - /** - * 设置批量验证 - * @access public - * @param bool $batch 是否批量验证 - * @return $this - */ - public function batch(bool $batch = true) - { - $this->batch = $batch; - - return $this; - } - - /** - * 设置验证失败后是否抛出异常 - * @access protected - * @param bool $fail 是否抛出异常 - * @return $this - */ - public function failException(bool $fail = true) - { - $this->failException = $fail; - - return $this; - } - - /** - * 指定需要验证的字段列表 - * @access public - * @param array $fields 字段名 - * @return $this - */ - public function only(array $fields) - { - $this->only = $fields; - - return $this; - } - - /** - * 移除某个字段的验证规则 - * @access public - * @param string|array $field 字段名 - * @param mixed $rule 验证规则 true 移除所有规则 - * @return $this - */ - public function remove($field, $rule = null) - { - if (is_array($field)) { - foreach ($field as $key => $rule) { - if (is_int($key)) { - $this->remove($rule); - } else { - $this->remove($key, $rule); - } - } - } else { - if (is_string($rule)) { - $rule = explode('|', $rule); - } - - $this->remove[$field] = $rule; - } - - return $this; - } - - /** - * 追加某个字段的验证规则 - * @access public - * @param string|array $field 字段名 - * @param mixed $rule 验证规则 - * @return $this - */ - public function append($field, $rule = null) - { - if (is_array($field)) { - foreach ($field as $key => $rule) { - $this->append($key, $rule); - } - } else { - if (is_string($rule)) { - $rule = explode('|', $rule); - } - - $this->append[$field] = $rule; - } - - return $this; - } - - /** - * 数据自动验证 - * @access public - * @param array $data 数据 - * @param array $rules 验证规则 - * @return bool - */ - public function check(array $data, array $rules = []): bool - { - $this->error = []; - - if ($this->currentScene) { - $this->getScene($this->currentScene); - } - - if (empty($rules)) { - // 读取验证规则 - $rules = $this->rule; - } - - foreach ($this->append as $key => $rule) { - if (!isset($rules[$key])) { - $rules[$key] = $rule; - unset($this->append[$key]); - } - } - - foreach ($rules as $key => $rule) { - // field => 'rule1|rule2...' field => ['rule1','rule2',...] - if (strpos($key, '|')) { - // 字段|描述 用于指定属性名称 - [$key, $title] = explode('|', $key); - } else { - $title = $this->field[$key] ?? $key; - } - - // 场景检测 - if (!empty($this->only) && !in_array($key, $this->only)) { - continue; - } - - // 获取数据 支持二维数组 - $value = $this->getDataValue($data, $key); - - // 字段验证 - if ($rule instanceof Closure) { - $result = call_user_func_array($rule, [$value, $data]); - } elseif ($rule instanceof ValidateRule) { - // 验证因子 - $result = $this->checkItem($key, $value, $rule->getRule(), $data, $rule->getTitle() ?: $title, $rule->getMsg()); - } else { - $result = $this->checkItem($key, $value, $rule, $data, $title); - } - - if (true !== $result) { - // 没有返回true 则表示验证失败 - if (!empty($this->batch)) { - // 批量验证 - $this->error[$key] = $result; - } elseif ($this->failException) { - throw new ValidateException($result); - } else { - $this->error = $result; - return false; - } - } - } - - if (!empty($this->error)) { - if ($this->failException) { - throw new ValidateException($this->error); - } - return false; - } - - return true; - } - - /** - * 根据验证规则验证数据 - * @access public - * @param mixed $value 字段值 - * @param mixed $rules 验证规则 - * @return bool - */ - public function checkRule($value, $rules): bool - { - if ($rules instanceof Closure) { - return call_user_func_array($rules, [$value]); - } elseif ($rules instanceof ValidateRule) { - $rules = $rules->getRule(); - } elseif (is_string($rules)) { - $rules = explode('|', $rules); - } - - foreach ($rules as $key => $rule) { - if ($rule instanceof Closure) { - $result = call_user_func_array($rule, [$value]); - } else { - // 判断验证类型 - [$type, $rule] = $this->getValidateType($key, $rule); - - $callback = $this->type[$type] ?? [$this, $type]; - - $result = call_user_func_array($callback, [$value, $rule]); - } - - if (true !== $result) { - if ($this->failException) { - throw new ValidateException($result); - } - - return $result; - } - } - - return true; - } - - /** - * 验证单个字段规则 - * @access protected - * @param string $field 字段名 - * @param mixed $value 字段值 - * @param mixed $rules 验证规则 - * @param array $data 数据 - * @param string $title 字段描述 - * @param array $msg 提示信息 - * @return mixed - */ - protected function checkItem(string $field, $value, $rules, $data, string $title = '', array $msg = []) - { - if (isset($this->remove[$field]) && true === $this->remove[$field] && empty($this->append[$field])) { - // 字段已经移除 无需验证 - return true; - } - - // 支持多规则验证 require|in:a,b,c|... 或者 ['require','in'=>'a,b,c',...] - if (is_string($rules)) { - $rules = explode('|', $rules); - } - - if (isset($this->append[$field])) { - // 追加额外的验证规则 - $rules = array_unique(array_merge($rules, $this->append[$field]), SORT_REGULAR); - unset($this->append[$field]); - } - - if (empty($rules)) { - return true; - } - - $i = 0; - foreach ($rules as $key => $rule) { - if ($rule instanceof Closure) { - $result = call_user_func_array($rule, [$value, $data]); - $info = is_numeric($key) ? '' : $key; - } else { - // 判断验证类型 - [$type, $rule, $info] = $this->getValidateType($key, $rule); - - if (isset($this->append[$field]) && in_array($info, $this->append[$field])) { - } elseif (isset($this->remove[$field]) && in_array($info, $this->remove[$field])) { - // 规则已经移除 - $i++; - continue; - } - - if (isset($this->type[$type])) { - $result = call_user_func_array($this->type[$type], [$value, $rule, $data, $field, $title]); - } elseif ('must' == $info || 0 === strpos($info, 'require') || (!is_null($value) && '' !== $value)) { - $result = call_user_func_array([$this, $type], [$value, $rule, $data, $field, $title]); - } else { - $result = true; - } - } - - if (false === $result) { - // 验证失败 返回错误信息 - if (!empty($msg[$i])) { - $message = $msg[$i]; - if (is_string($message) && strpos($message, '{%') === 0) { - $message = $this->lang->get(substr($message, 2, -1)); - } - } else { - $message = $this->getRuleMsg($field, $title, $info, $rule); - } - - return $message; - } elseif (true !== $result) { - // 返回自定义错误信息 - if (is_string($result) && false !== strpos($result, ':')) { - $result = str_replace(':attribute', $title, $result); - - if (strpos($result, ':rule') && is_scalar($rule)) { - $result = str_replace(':rule', (string) $rule, $result); - } - } - - return $result; - } - $i++; - } - - return $result ?? true; - } - - /** - * 获取当前验证类型及规则 - * @access public - * @param mixed $key - * @param mixed $rule - * @return array - */ - protected function getValidateType($key, $rule): array - { - // 判断验证类型 - if (!is_numeric($key)) { - if (isset($this->alias[$key])) { - // 判断别名 - $key = $this->alias[$key]; - } - return [$key, $rule, $key]; - } - - if (strpos($rule, ':')) { - [$type, $rule] = explode(':', $rule, 2); - if (isset($this->alias[$type])) { - // 判断别名 - $type = $this->alias[$type]; - } - $info = $type; - } elseif (method_exists($this, $rule)) { - $type = $rule; - $info = $rule; - $rule = ''; - } else { - $type = 'is'; - $info = $rule; - } - - return [$type, $rule, $info]; - } - - /** - * 验证是否和某个字段的值一致 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @param string $field 字段名 - * @return bool - */ - public function confirm($value, $rule, array $data = [], string $field = ''): bool - { - if ('' == $rule) { - if (strpos($field, '_confirm')) { - $rule = strstr($field, '_confirm', true); - } else { - $rule = $field . '_confirm'; - } - } - - return $this->getDataValue($data, $rule) === $value; - } - - /** - * 验证是否和某个字段的值是否不同 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function different($value, $rule, array $data = []): bool - { - return $this->getDataValue($data, $rule) != $value; - } - - /** - * 验证是否大于等于某个值 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function egt($value, $rule, array $data = []): bool - { - return $value >= $this->getDataValue($data, $rule); - } - - /** - * 验证是否大于某个值 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function gt($value, $rule, array $data = []): bool - { - return $value > $this->getDataValue($data, $rule); - } - - /** - * 验证是否小于等于某个值 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function elt($value, $rule, array $data = []): bool - { - return $value <= $this->getDataValue($data, $rule); - } - - /** - * 验证是否小于某个值 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function lt($value, $rule, array $data = []): bool - { - return $value < $this->getDataValue($data, $rule); - } - - /** - * 验证是否等于某个值 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function eq($value, $rule): bool - { - return $value == $rule; - } - - /** - * 必须验证 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function must($value, $rule = null): bool - { - return !empty($value) || '0' == $value; - } - - /** - * 验证字段值是否为有效格式 - * @access public - * @param mixed $value 字段值 - * @param string $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function is($value, string $rule, array $data = []): bool - { - switch (Str::camel($rule)) { - case 'require': - // 必须 - $result = !empty($value) || '0' == $value; - break; - case 'accepted': - // 接受 - $result = in_array($value, ['1', 'on', 'yes']); - break; - case 'date': - // 是否是一个有效日期 - $result = false !== strtotime($value); - break; - case 'activeUrl': - // 是否为有效的网址 - $result = checkdnsrr($value); - break; - case 'boolean': - case 'bool': - // 是否为布尔值 - $result = in_array($value, [true, false, 0, 1, '0', '1'], true); - break; - case 'number': - $result = ctype_digit((string) $value); - break; - case 'alphaNum': - $result = ctype_alnum($value); - break; - case 'array': - // 是否为数组 - $result = is_array($value); - break; - case 'file': - $result = $value instanceof File; - break; - case 'image': - $result = $value instanceof File && in_array($this->getImageType($value->getRealPath()), [1, 2, 3, 6]); - break; - case 'token': - $result = $this->token($value, '__token__', $data); - break; - default: - if (isset($this->type[$rule])) { - // 注册的验证规则 - $result = call_user_func_array($this->type[$rule], [$value]); - } elseif (function_exists('ctype_' . $rule)) { - // ctype验证规则 - $ctypeFun = 'ctype_' . $rule; - $result = $ctypeFun($value); - } elseif (isset($this->filter[$rule])) { - // Filter_var验证规则 - $result = $this->filter($value, $this->filter[$rule]); - } else { - // 正则验证 - $result = $this->regex($value, $rule); - } - } - - return $result; - } - - // 判断图像类型 - protected function getImageType($image) - { - if (function_exists('exif_imagetype')) { - return exif_imagetype($image); - } - - try { - $info = getimagesize($image); - return $info ? $info[2] : false; - } catch (\Exception $e) { - return false; - } - } - - /** - * 验证表单令牌 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function token($value, string $rule, array $data): bool - { - $rule = !empty($rule) ? $rule : '__token__'; - return $this->request->checkToken($rule, $data); - } - - /** - * 验证是否为合格的域名或者IP 支持A,MX,NS,SOA,PTR,CNAME,AAAA,A6, SRV,NAPTR,TXT 或者 ANY类型 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function activeUrl(string $value, string $rule = 'MX'): bool - { - if (!in_array($rule, ['A', 'MX', 'NS', 'SOA', 'PTR', 'CNAME', 'AAAA', 'A6', 'SRV', 'NAPTR', 'TXT', 'ANY'])) { - $rule = 'MX'; - } - - return checkdnsrr($value, $rule); - } - - /** - * 验证是否有效IP - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 ipv4 ipv6 - * @return bool - */ - public function ip($value, string $rule = 'ipv4'): bool - { - if (!in_array($rule, ['ipv4', 'ipv6'])) { - $rule = 'ipv4'; - } - - return $this->filter($value, [FILTER_VALIDATE_IP, 'ipv6' == $rule ? FILTER_FLAG_IPV6 : FILTER_FLAG_IPV4]); - } - - /** - * 检测上传文件后缀 - * @access public - * @param File $file - * @param array|string $ext 允许后缀 - * @return bool - */ - protected function checkExt(File $file, $ext): bool - { - if (is_string($ext)) { - $ext = explode(',', $ext); - } - - return in_array(strtolower($file->extension()), $ext); - } - - /** - * 检测上传文件大小 - * @access public - * @param File $file - * @param integer $size 最大大小 - * @return bool - */ - protected function checkSize(File $file, $size): bool - { - return $file->getSize() <= (int) $size; - } - - /** - * 检测上传文件类型 - * @access public - * @param File $file - * @param array|string $mime 允许类型 - * @return bool - */ - protected function checkMime(File $file, $mime): bool - { - if (is_string($mime)) { - $mime = explode(',', $mime); - } - - return in_array(strtolower($file->getMime()), $mime); - } - - /** - * 验证上传文件后缀 - * @access public - * @param mixed $file 上传文件 - * @param mixed $rule 验证规则 - * @return bool - */ - public function fileExt($file, $rule): bool - { - if (is_array($file)) { - foreach ($file as $item) { - if (!($item instanceof File) || !$this->checkExt($item, $rule)) { - return false; - } - } - return true; - } elseif ($file instanceof File) { - return $this->checkExt($file, $rule); - } - - return false; - } - - /** - * 验证上传文件类型 - * @access public - * @param mixed $file 上传文件 - * @param mixed $rule 验证规则 - * @return bool - */ - public function fileMime($file, $rule): bool - { - if (is_array($file)) { - foreach ($file as $item) { - if (!($item instanceof File) || !$this->checkMime($item, $rule)) { - return false; - } - } - return true; - } elseif ($file instanceof File) { - return $this->checkMime($file, $rule); - } - - return false; - } - - /** - * 验证上传文件大小 - * @access public - * @param mixed $file 上传文件 - * @param mixed $rule 验证规则 - * @return bool - */ - public function fileSize($file, $rule): bool - { - if (is_array($file)) { - foreach ($file as $item) { - if (!($item instanceof File) || !$this->checkSize($item, $rule)) { - return false; - } - } - return true; - } elseif ($file instanceof File) { - return $this->checkSize($file, $rule); - } - - return false; - } - - /** - * 验证图片的宽高及类型 - * @access public - * @param mixed $file 上传文件 - * @param mixed $rule 验证规则 - * @return bool - */ - public function image($file, $rule): bool - { - if (!($file instanceof File)) { - return false; - } - - if ($rule) { - $rule = explode(',', $rule); - - [$width, $height, $type] = getimagesize($file->getRealPath()); - - if (isset($rule[2])) { - $imageType = strtolower($rule[2]); - - if ('jpg' == $imageType) { - $imageType = 'jpeg'; - } - - if (image_type_to_extension($type, false) != $imageType) { - return false; - } - } - - [$w, $h] = $rule; - - return $w == $width && $h == $height; - } - - return in_array($this->getImageType($file->getRealPath()), [1, 2, 3, 6]); - } - - /** - * 验证时间和日期是否符合指定格式 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function dateFormat($value, $rule): bool - { - $info = date_parse_from_format($rule, $value); - return 0 == $info['warning_count'] && 0 == $info['error_count']; - } - - /** - * 验证是否唯一 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 格式:数据表,字段名,排除ID,主键名 - * @param array $data 数据 - * @param string $field 验证字段名 - * @return bool - */ - public function unique($value, $rule, array $data = [], string $field = ''): bool - { - if (is_string($rule)) { - $rule = explode(',', $rule); - } - - if (false !== strpos($rule[0], '\\')) { - // 指定模型类 - $db = new $rule[0]; - } else { - $db = $this->db->name($rule[0]); - } - - $key = $rule[1] ?? $field; - $map = []; - - if (strpos($key, '^')) { - // 支持多个字段验证 - $fields = explode('^', $key); - foreach ($fields as $key) { - if (isset($data[$key])) { - $map[] = [$key, '=', $data[$key]]; - } - } - } elseif (isset($data[$field])) { - $map[] = [$key, '=', $data[$field]]; - } else { - $map = []; - } - - $pk = !empty($rule[3]) ? $rule[3] : $db->getPk(); - - if (is_string($pk)) { - if (isset($rule[2])) { - $map[] = [$pk, '<>', $rule[2]]; - } elseif (isset($data[$pk])) { - $map[] = [$pk, '<>', $data[$pk]]; - } - } - - if ($db->where($map)->field($pk)->find()) { - return false; - } - - return true; - } - - /** - * 使用filter_var方式验证 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function filter($value, $rule): bool - { - if (is_string($rule) && strpos($rule, ',')) { - [$rule, $param] = explode(',', $rule); - } elseif (is_array($rule)) { - $param = $rule[1] ?? 0; - $rule = $rule[0]; - } else { - $param = 0; - } - - return false !== filter_var($value, is_int($rule) ? $rule : filter_id($rule), $param); - } - - /** - * 验证某个字段等于某个值的时候必须 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function requireIf($value, $rule, array $data = []): bool - { - [$field, $val] = explode(',', $rule); - - if ($this->getDataValue($data, $field) == $val) { - return !empty($value) || '0' == $value; - } - - return true; - } - - /** - * 通过回调方法验证某个字段是否必须 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function requireCallback($value, $rule, array $data = []): bool - { - $result = call_user_func_array([$this, $rule], [$value, $data]); - - if ($result) { - return !empty($value) || '0' == $value; - } - - return true; - } - - /** - * 验证某个字段有值的情况下必须 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function requireWith($value, $rule, array $data = []): bool - { - $val = $this->getDataValue($data, $rule); - - if (!empty($val)) { - return !empty($value) || '0' == $value; - } - - return true; - } - - /** - * 验证某个字段没有值的情况下必须 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function requireWithout($value, $rule, array $data = []): bool - { - $val = $this->getDataValue($data, $rule); - - if (empty($val)) { - return !empty($value) || '0' == $value; - } - - return true; - } - - /** - * 验证是否在范围内 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function in($value, $rule): bool - { - return in_array($value, is_array($rule) ? $rule : explode(',', $rule)); - } - - /** - * 验证是否不在某个范围 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function notIn($value, $rule): bool - { - return !in_array($value, is_array($rule) ? $rule : explode(',', $rule)); - } - - /** - * between验证数据 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function between($value, $rule): bool - { - if (is_string($rule)) { - $rule = explode(',', $rule); - } - [$min, $max] = $rule; - - return $value >= $min && $value <= $max; - } - - /** - * 使用notbetween验证数据 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function notBetween($value, $rule): bool - { - if (is_string($rule)) { - $rule = explode(',', $rule); - } - [$min, $max] = $rule; - - return $value < $min || $value > $max; - } - - /** - * 验证数据长度 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function length($value, $rule): bool - { - if (is_array($value)) { - $length = count($value); - } elseif ($value instanceof File) { - $length = $value->getSize(); - } else { - $length = mb_strlen((string) $value); - } - - if (is_string($rule) && strpos($rule, ',')) { - // 长度区间 - [$min, $max] = explode(',', $rule); - return $length >= $min && $length <= $max; - } - - // 指定长度 - return $length == $rule; - } - - /** - * 验证数据最大长度 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function max($value, $rule): bool - { - if (is_array($value)) { - $length = count($value); - } elseif ($value instanceof File) { - $length = $value->getSize(); - } else { - $length = mb_strlen((string) $value); - } - - return $length <= $rule; - } - - /** - * 验证数据最小长度 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function min($value, $rule): bool - { - if (is_array($value)) { - $length = count($value); - } elseif ($value instanceof File) { - $length = $value->getSize(); - } else { - $length = mb_strlen((string) $value); - } - - return $length >= $rule; - } - - /** - * 验证日期 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function after($value, $rule, array $data = []): bool - { - return strtotime($value) >= strtotime($rule); - } - - /** - * 验证日期 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function before($value, $rule, array $data = []): bool - { - return strtotime($value) <= strtotime($rule); - } - - /** - * 验证日期 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function afterWith($value, $rule, array $data = []): bool - { - $rule = $this->getDataValue($data, $rule); - return !is_null($rule) && strtotime($value) >= strtotime($rule); - } - - /** - * 验证日期 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @param array $data 数据 - * @return bool - */ - public function beforeWith($value, $rule, array $data = []): bool - { - $rule = $this->getDataValue($data, $rule); - return !is_null($rule) && strtotime($value) <= strtotime($rule); - } - - /** - * 验证有效期 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function expire($value, $rule): bool - { - if (is_string($rule)) { - $rule = explode(',', $rule); - } - - [$start, $end] = $rule; - - if (!is_numeric($start)) { - $start = strtotime($start); - } - - if (!is_numeric($end)) { - $end = strtotime($end); - } - - return time() >= $start && time() <= $end; - } - - /** - * 验证IP许可 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function allowIp($value, $rule): bool - { - return in_array($value, is_array($rule) ? $rule : explode(',', $rule)); - } - - /** - * 验证IP禁用 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 - * @return bool - */ - public function denyIp($value, $rule): bool - { - return !in_array($value, is_array($rule) ? $rule : explode(',', $rule)); - } - - /** - * 使用正则验证数据 - * @access public - * @param mixed $value 字段值 - * @param mixed $rule 验证规则 正则规则或者预定义正则名 - * @return bool - */ - public function regex($value, $rule): bool - { - if (isset($this->regex[$rule])) { - $rule = $this->regex[$rule]; - } elseif (isset($this->defaultRegex[$rule])) { - $rule = $this->defaultRegex[$rule]; - } - - if (is_string($rule) && 0 !== strpos($rule, '/') && !preg_match('/\/[imsU]{0,4}$/', $rule)) { - // 不是正则表达式则两端补上/ - $rule = '/^' . $rule . '$/'; - } - - return is_scalar($value) && 1 === preg_match($rule, (string) $value); - } - - /** - * 获取错误信息 - * @return array|string - */ - public function getError() - { - return $this->error; - } - - /** - * 获取数据值 - * @access protected - * @param array $data 数据 - * @param string $key 数据标识 支持二维 - * @return mixed - */ - protected function getDataValue(array $data, $key) - { - if (is_numeric($key)) { - $value = $key; - } elseif (is_string($key) && strpos($key, '.')) { - // 支持多维数组验证 - foreach (explode('.', $key) as $key) { - if (!isset($data[$key])) { - $value = null; - break; - } - $value = $data = $data[$key]; - } - } else { - $value = $data[$key] ?? null; - } - - return $value; - } - - /** - * 获取验证规则的错误提示信息 - * @access protected - * @param string $attribute 字段英文名 - * @param string $title 字段描述名 - * @param string $type 验证规则名称 - * @param mixed $rule 验证规则数据 - * @return string|array - */ - protected function getRuleMsg(string $attribute, string $title, string $type, $rule) - { - if (isset($this->message[$attribute . '.' . $type])) { - $msg = $this->message[$attribute . '.' . $type]; - } elseif (isset($this->message[$attribute][$type])) { - $msg = $this->message[$attribute][$type]; - } elseif (isset($this->message[$attribute])) { - $msg = $this->message[$attribute]; - } elseif (isset($this->typeMsg[$type])) { - $msg = $this->typeMsg[$type]; - } elseif (0 === strpos($type, 'require')) { - $msg = $this->typeMsg['require']; - } else { - $msg = $title . $this->lang->get('not conform to the rules'); - } - - if (is_array($msg)) { - return $this->errorMsgIsArray($msg, $rule, $title); - } - - return $this->parseErrorMsg($msg, $rule, $title); - } - - /** - * 获取验证规则的错误提示信息 - * @access protected - * @param string $msg 错误信息 - * @param mixed $rule 验证规则数据 - * @param string $title 字段描述名 - * @return string - */ - protected function parseErrorMsg(string $msg, $rule, string $title) - { - if (0 === strpos($msg, '{%')) { - $msg = $this->lang->get(substr($msg, 2, -1)); - } elseif ($this->lang->has($msg)) { - $msg = $this->lang->get($msg); - } - - if (is_array($msg)) { - return $this->errorMsgIsArray($msg, $rule, $title); - } - - // rule若是数组则转为字符串 - if (is_array($rule)) { - $rule = implode(',', $rule); - } - - if (is_scalar($rule) && false !== strpos($msg, ':')) { - // 变量替换 - if (is_string($rule) && strpos($rule, ',')) { - $array = array_pad(explode(',', $rule), 3, ''); - } else { - $array = array_pad([], 3, ''); - } - - $msg = str_replace( - [':attribute', ':1', ':2', ':3'], - [$title, $array[0], $array[1], $array[2]], - $msg - ); - - if (strpos($msg, ':rule')) { - $msg = str_replace(':rule', (string) $rule, $msg); - } - } - - return $msg; - } - - /** - * 错误信息数组处理 - * @access protected - * @param array $msg 错误信息 - * @param mixed $rule 验证规则数据 - * @param string $title 字段描述名 - * @return array - */ - protected function errorMsgIsArray(array $msg, $rule, string $title) - { - foreach ($msg as $key => $val) { - if (is_string($val)) { - $msg[$key] = $this->parseErrorMsg($val, $rule, $title); - } - } - return $msg; - } - - /** - * 获取数据验证的场景 - * @access protected - * @param string $scene 验证场景 - * @return void - */ - protected function getScene(string $scene): void - { - $this->only = $this->append = $this->remove = []; - - if (method_exists($this, 'scene' . $scene)) { - call_user_func([$this, 'scene' . $scene]); - } elseif (isset($this->scene[$scene])) { - // 如果设置了验证适用场景 - $this->only = $this->scene[$scene]; - } - } - - /** - * 动态方法 直接调用is方法进行验证 - * @access public - * @param string $method 方法名 - * @param array $args 调用参数 - * @return bool - */ - public function __call($method, $args) - { - if ('is' == strtolower(substr($method, 0, 2))) { - $method = substr($method, 2); - } - - array_push($args, lcfirst($method)); - - return call_user_func_array([$this, 'is'], $args); - } -} diff --git a/vendor/topthink/framework/src/think/View.php b/vendor/topthink/framework/src/think/View.php deleted file mode 100644 index 2e71088..0000000 --- a/vendor/topthink/framework/src/think/View.php +++ /dev/null @@ -1,191 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use think\helper\Arr; - -/** - * 视图类 - * @package think - */ -class View extends Manager -{ - - protected $namespace = '\\think\\view\\driver\\'; - - /** - * 模板变量 - * @var array - */ - protected $data = []; - - /** - * 内容过滤 - * @var mixed - */ - protected $filter; - - /** - * 获取模板引擎 - * @access public - * @param string $type 模板引擎类型 - * @return $this - */ - public function engine(string $type = null) - { - return $this->driver($type); - } - - /** - * 模板变量赋值 - * @access public - * @param string|array $name 模板变量 - * @param mixed $value 变量值 - * @return $this - */ - public function assign($name, $value = null) - { - if (is_array($name)) { - $this->data = array_merge($this->data, $name); - } else { - $this->data[$name] = $value; - } - - return $this; - } - - /** - * 视图过滤 - * @access public - * @param Callable $filter 过滤方法或闭包 - * @return $this - */ - public function filter(callable $filter = null) - { - $this->filter = $filter; - return $this; - } - - /** - * 解析和获取模板内容 用于输出 - * @access public - * @param string $template 模板文件名或者内容 - * @param array $vars 模板变量 - * @return string - * @throws \Exception - */ - public function fetch(string $template = '', array $vars = []): string - { - return $this->getContent(function () use ($vars, $template) { - $this->engine()->fetch($template, array_merge($this->data, $vars)); - }); - } - - /** - * 渲染内容输出 - * @access public - * @param string $content 内容 - * @param array $vars 模板变量 - * @return string - */ - public function display(string $content, array $vars = []): string - { - return $this->getContent(function () use ($vars, $content) { - $this->engine()->display($content, array_merge($this->data, $vars)); - }); - } - - /** - * 获取模板引擎渲染内容 - * @param $callback - * @return string - * @throws \Exception - */ - protected function getContent($callback): string - { - // 页面缓存 - ob_start(); - if (PHP_VERSION > 8.0) { - ob_implicit_flush(false); - } else { - ob_implicit_flush(0); - } - - // 渲染输出 - try { - $callback(); - } catch (\Exception $e) { - ob_end_clean(); - throw $e; - } - - // 获取并清空缓存 - $content = ob_get_clean(); - - if ($this->filter) { - $content = call_user_func_array($this->filter, [$content]); - } - - return $content; - } - - /** - * 模板变量赋值 - * @access public - * @param string $name 变量名 - * @param mixed $value 变量值 - */ - public function __set($name, $value) - { - $this->data[$name] = $value; - } - - /** - * 取得模板显示变量的值 - * @access protected - * @param string $name 模板变量 - * @return mixed - */ - public function __get($name) - { - return $this->data[$name]; - } - - /** - * 检测模板变量是否设置 - * @access public - * @param string $name 模板变量名 - * @return bool - */ - public function __isset($name) - { - return isset($this->data[$name]); - } - - protected function resolveConfig(string $name) - { - $config = $this->app->config->get('view', []); - Arr::forget($config, 'type'); - return $config; - } - - /** - * 默认驱动 - * @return string|null - */ - public function getDefaultDriver() - { - return $this->app->config->get('view.type', 'php'); - } - -} diff --git a/vendor/topthink/framework/src/think/cache/Driver.php b/vendor/topthink/framework/src/think/cache/Driver.php deleted file mode 100644 index 5813c7b..0000000 --- a/vendor/topthink/framework/src/think/cache/Driver.php +++ /dev/null @@ -1,357 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\cache; - -use Closure; -use DateInterval; -use DateTime; -use DateTimeInterface; -use Exception; -use Psr\SimpleCache\CacheInterface; -use think\Container; -use think\contract\CacheHandlerInterface; -use think\exception\InvalidArgumentException; -use throwable; - -/** - * 缓存基础类 - */ -abstract class Driver implements CacheInterface, CacheHandlerInterface -{ - /** - * 驱动句柄 - * @var object - */ - protected $handler = null; - - /** - * 缓存读取次数 - * @var integer - */ - protected $readTimes = 0; - - /** - * 缓存写入次数 - * @var integer - */ - protected $writeTimes = 0; - - /** - * 缓存参数 - * @var array - */ - protected $options = []; - - /** - * 缓存标签 - * @var array - */ - protected $tag = []; - - /** - * 获取有效期 - * @access protected - * @param integer|DateTimeInterface|DateInterval $expire 有效期 - * @return int - */ - protected function getExpireTime($expire): int - { - if ($expire instanceof DateTimeInterface) { - $expire = $expire->getTimestamp() - time(); - } elseif ($expire instanceof DateInterval) { - $expire = DateTime::createFromFormat('U', (string) time()) - ->add($expire) - ->format('U') - time(); - } - - return (int) $expire; - } - - /** - * 获取实际的缓存标识 - * @access public - * @param string $name 缓存名 - * @return string - */ - public function getCacheKey(string $name): string - { - return $this->options['prefix'] . $name; - } - - /** - * 读取缓存并删除 - * @access public - * @param string $name 缓存变量名 - * @return mixed - */ - public function pull(string $name) - { - $result = $this->get($name, false); - - if ($result) { - $this->delete($name); - return $result; - } - } - - /** - * 追加(数组)缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @return void - */ - public function push(string $name, $value): void - { - $item = $this->get($name, []); - - if (!is_array($item)) { - throw new InvalidArgumentException('only array cache can be push'); - } - - $item[] = $value; - - if (count($item) > 1000) { - array_shift($item); - } - - $item = array_unique($item); - - $this->set($name, $item); - } - - /** - * 追加TagSet数据 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @return void - */ - public function append(string $name, $value): void - { - $this->push($name, $value); - } - - /** - * 如果不存在则写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param int $expire 有效时间 0为永久 - * @return mixed - */ - public function remember(string $name, $value, $expire = null) - { - if ($this->has($name)) { - return $this->get($name); - } - - $time = time(); - - while ($time + 5 > time() && $this->has($name . '_lock')) { - // 存在锁定则等待 - usleep(200000); - } - - try { - // 锁定 - $this->set($name . '_lock', true); - - if ($value instanceof Closure) { - // 获取缓存数据 - $value = Container::getInstance()->invokeFunction($value); - } - - // 缓存数据 - $this->set($name, $value, $expire); - - // 解锁 - $this->delete($name . '_lock'); - } catch (Exception | throwable $e) { - $this->delete($name . '_lock'); - throw $e; - } - - return $value; - } - - /** - * 缓存标签 - * @access public - * @param string|array $name 标签名 - * @return TagSet - */ - public function tag($name): TagSet - { - $name = (array) $name; - $key = implode('-', $name); - - if (!isset($this->tag[$key])) { - $this->tag[$key] = new TagSet($name, $this); - } - - return $this->tag[$key]; - } - - /** - * 获取标签包含的缓存标识 - * @access public - * @param string $tag 标签标识 - * @return array - */ - public function getTagItems(string $tag): array - { - $name = $this->getTagKey($tag); - return $this->get($name, []); - } - - /** - * 获取实际标签名 - * @access public - * @param string $tag 标签名 - * @return string - */ - public function getTagKey(string $tag): string - { - return $this->options['tag_prefix'] . md5($tag); - } - - /** - * 序列化数据 - * @access protected - * @param mixed $data 缓存数据 - * @return string - */ - protected function serialize($data): string - { - if (is_numeric($data)) { - return (string) $data; - } - - $serialize = $this->options['serialize'][0] ?? "serialize"; - - return $serialize($data); - } - - /** - * 反序列化数据 - * @access protected - * @param string $data 缓存数据 - * @return mixed - */ - protected function unserialize(string $data) - { - if (is_numeric($data)) { - return $data; - } - - $unserialize = $this->options['serialize'][1] ?? "unserialize"; - - return $unserialize($data); - } - - /** - * 返回句柄对象,可执行其它高级方法 - * - * @access public - * @return object - */ - public function handler() - { - return $this->handler; - } - - /** - * 返回缓存读取次数 - * @access public - * @return int - */ - public function getReadTimes(): int - { - return $this->readTimes; - } - - /** - * 返回缓存写入次数 - * @access public - * @return int - */ - public function getWriteTimes(): int - { - return $this->writeTimes; - } - - /** - * 读取缓存 - * @access public - * @param iterable $keys 缓存变量名 - * @param mixed $default 默认值 - * @return iterable - * @throws InvalidArgumentException - */ - public function getMultiple($keys, $default = null): iterable - { - $result = []; - - foreach ($keys as $key) { - $result[$key] = $this->get($key, $default); - } - - return $result; - } - - /** - * 写入缓存 - * @access public - * @param iterable $values 缓存数据 - * @param null|int|\DateInterval $ttl 有效时间 0为永久 - * @return bool - */ - public function setMultiple($values, $ttl = null): bool - { - foreach ($values as $key => $val) { - $result = $this->set($key, $val, $ttl); - - if (false === $result) { - return false; - } - } - - return true; - } - - /** - * 删除缓存 - * @access public - * @param iterable $keys 缓存变量名 - * @return bool - * @throws InvalidArgumentException - */ - public function deleteMultiple($keys): bool - { - foreach ($keys as $key) { - $result = $this->delete($key); - - if (false === $result) { - return false; - } - } - - return true; - } - - public function __call($method, $args) - { - return call_user_func_array([$this->handler, $method], $args); - } -} diff --git a/vendor/topthink/framework/src/think/cache/TagSet.php b/vendor/topthink/framework/src/think/cache/TagSet.php deleted file mode 100644 index 5ba2076..0000000 --- a/vendor/topthink/framework/src/think/cache/TagSet.php +++ /dev/null @@ -1,132 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\cache; - -/** - * 标签集合 - */ -class TagSet -{ - /** - * 标签的缓存Key - * @var array - */ - protected $tag; - - /** - * 缓存句柄 - * @var Driver - */ - protected $handler; - - /** - * 架构函数 - * @access public - * @param array $tag 缓存标签 - * @param Driver $cache 缓存对象 - */ - public function __construct(array $tag, Driver $cache) - { - $this->tag = $tag; - $this->handler = $cache; - } - - /** - * 写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param integer|\DateTime $expire 有效时间(秒) - * @return bool - */ - public function set(string $name, $value, $expire = null): bool - { - $this->handler->set($name, $value, $expire); - - $this->append($name); - - return true; - } - - /** - * 追加缓存标识到标签 - * @access public - * @param string $name 缓存变量名 - * @return void - */ - public function append(string $name): void - { - $name = $this->handler->getCacheKey($name); - - foreach ($this->tag as $tag) { - $key = $this->handler->getTagKey($tag); - $this->handler->append($key, $name); - } - } - - /** - * 写入缓存 - * @access public - * @param iterable $values 缓存数据 - * @param null|int|\DateInterval $ttl 有效时间 0为永久 - * @return bool - */ - public function setMultiple($values, $ttl = null): bool - { - foreach ($values as $key => $val) { - $result = $this->set($key, $val, $ttl); - - if (false === $result) { - return false; - } - } - - return true; - } - - /** - * 如果不存在则写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param int $expire 有效时间 0为永久 - * @return mixed - */ - public function remember(string $name, $value, $expire = null) - { - $result = $this->handler->remember($name, $value, $expire); - - $this->append($name); - - return $result; - } - - /** - * 清除缓存 - * @access public - * @return bool - */ - public function clear(): bool - { - // 指定标签清除 - foreach ($this->tag as $tag) { - $names = $this->handler->getTagItems($tag); - $this->handler->clearTag($names); - - $key = $this->handler->getTagKey($tag); - $this->handler->delete($key); - } - - return true; - } -} diff --git a/vendor/topthink/framework/src/think/cache/driver/File.php b/vendor/topthink/framework/src/think/cache/driver/File.php deleted file mode 100644 index b36b069..0000000 --- a/vendor/topthink/framework/src/think/cache/driver/File.php +++ /dev/null @@ -1,304 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\cache\driver; - -use FilesystemIterator; -use think\App; -use think\cache\Driver; - -/** - * 文件缓存类 - */ -class File extends Driver -{ - /** - * 配置参数 - * @var array - */ - protected $options = [ - 'expire' => 0, - 'cache_subdir' => true, - 'prefix' => '', - 'path' => '', - 'hash_type' => 'md5', - 'data_compress' => false, - 'tag_prefix' => 'tag:', - 'serialize' => [], - ]; - - /** - * 架构函数 - * @param App $app - * @param array $options 参数 - */ - public function __construct(App $app, array $options = []) - { - if (!empty($options)) { - $this->options = array_merge($this->options, $options); - } - - if (empty($this->options['path'])) { - $this->options['path'] = $app->getRuntimePath() . 'cache'; - } - - if (substr($this->options['path'], -1) != DIRECTORY_SEPARATOR) { - $this->options['path'] .= DIRECTORY_SEPARATOR; - } - } - - /** - * 取得变量的存储文件名 - * @access public - * @param string $name 缓存变量名 - * @return string - */ - public function getCacheKey(string $name): string - { - $name = hash($this->options['hash_type'], $name); - - if ($this->options['cache_subdir']) { - // 使用子目录 - $name = substr($name, 0, 2) . DIRECTORY_SEPARATOR . substr($name, 2); - } - - if ($this->options['prefix']) { - $name = $this->options['prefix'] . DIRECTORY_SEPARATOR . $name; - } - - return $this->options['path'] . $name . '.php'; - } - - /** - * 获取缓存数据 - * @param string $name 缓存标识名 - * @return array|null - */ - protected function getRaw(string $name) - { - $filename = $this->getCacheKey($name); - - if (!is_file($filename)) { - return; - } - - $content = @file_get_contents($filename); - - if (false !== $content) { - $expire = (int) substr($content, 8, 12); - if (0 != $expire && time() - $expire > filemtime($filename)) { - //缓存过期删除缓存文件 - $this->unlink($filename); - return; - } - - $content = substr($content, 32); - - if ($this->options['data_compress'] && function_exists('gzcompress')) { - //启用数据压缩 - $content = gzuncompress($content); - } - - return is_string($content) ? ['content' => $content, 'expire' => $expire] : null; - } - } - - /** - * 判断缓存是否存在 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function has($name): bool - { - return $this->getRaw($name) !== null; - } - - /** - * 读取缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get($name, $default = null) - { - $this->readTimes++; - - $raw = $this->getRaw($name); - - return is_null($raw) ? $default : $this->unserialize($raw['content']); - } - - /** - * 写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param int|\DateTime $expire 有效时间 0为永久 - * @return bool - */ - public function set($name, $value, $expire = null): bool - { - $this->writeTimes++; - - if (is_null($expire)) { - $expire = $this->options['expire']; - } - - $expire = $this->getExpireTime($expire); - $filename = $this->getCacheKey($name); - - $dir = dirname($filename); - - if (!is_dir($dir)) { - try { - mkdir($dir, 0755, true); - } catch (\Exception $e) { - // 创建失败 - } - } - - $data = $this->serialize($value); - - if ($this->options['data_compress'] && function_exists('gzcompress')) { - //数据压缩 - $data = gzcompress($data, 3); - } - - $data = "\n" . $data; - $result = file_put_contents($filename, $data); - - if ($result) { - clearstatcache(); - return true; - } - - return false; - } - - /** - * 自增缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function inc(string $name, int $step = 1) - { - if ($raw = $this->getRaw($name)) { - $value = $this->unserialize($raw['content']) + $step; - $expire = $raw['expire']; - } else { - $value = $step; - $expire = 0; - } - - return $this->set($name, $value, $expire) ? $value : false; - } - - /** - * 自减缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function dec(string $name, int $step = 1) - { - return $this->inc($name, -$step); - } - - /** - * 删除缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function delete($name): bool - { - $this->writeTimes++; - - return $this->unlink($this->getCacheKey($name)); - } - - /** - * 清除缓存 - * @access public - * @return bool - */ - public function clear(): bool - { - $this->writeTimes++; - - $dirname = $this->options['path'] . $this->options['prefix']; - - $this->rmdir($dirname); - - return true; - } - - /** - * 删除缓存标签 - * @access public - * @param array $keys 缓存标识列表 - * @return void - */ - public function clearTag(array $keys): void - { - foreach ($keys as $key) { - $this->unlink($key); - } - } - - /** - * 判断文件是否存在后,删除 - * @access private - * @param string $path - * @return bool - */ - private function unlink(string $path): bool - { - try { - return is_file($path) && unlink($path); - } catch (\Exception $e) { - return false; - } - } - - /** - * 删除文件夹 - * @param $dirname - * @return bool - */ - private function rmdir($dirname) - { - if (!is_dir($dirname)) { - return false; - } - - $items = new FilesystemIterator($dirname); - - foreach ($items as $item) { - if ($item->isDir() && !$item->isLink()) { - $this->rmdir($item->getPathname()); - } else { - $this->unlink($item->getPathname()); - } - } - - @rmdir($dirname); - - return true; - } - -} diff --git a/vendor/topthink/framework/src/think/cache/driver/Memcache.php b/vendor/topthink/framework/src/think/cache/driver/Memcache.php deleted file mode 100644 index 2fbbb9c..0000000 --- a/vendor/topthink/framework/src/think/cache/driver/Memcache.php +++ /dev/null @@ -1,209 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\cache\driver; - -use think\cache\Driver; - -/** - * Memcache缓存类 - */ -class Memcache extends Driver -{ - /** - * 配置参数 - * @var array - */ - protected $options = [ - 'host' => '127.0.0.1', - 'port' => 11211, - 'expire' => 0, - 'timeout' => 0, // 超时时间(单位:毫秒) - 'persistent' => true, - 'prefix' => '', - 'tag_prefix' => 'tag:', - 'serialize' => [], - ]; - - /** - * 架构函数 - * @access public - * @param array $options 缓存参数 - * @throws \BadFunctionCallException - */ - public function __construct(array $options = []) - { - if (!extension_loaded('memcache')) { - throw new \BadFunctionCallException('not support: memcache'); - } - - if (!empty($options)) { - $this->options = array_merge($this->options, $options); - } - - $this->handler = new \Memcache; - - // 支持集群 - $hosts = (array) $this->options['host']; - $ports = (array) $this->options['port']; - - if (empty($ports[0])) { - $ports[0] = 11211; - } - - // 建立连接 - foreach ($hosts as $i => $host) { - $port = $ports[$i] ?? $ports[0]; - $this->options['timeout'] > 0 ? - $this->handler->addServer($host, (int) $port, $this->options['persistent'], 1, (int) $this->options['timeout']) : - $this->handler->addServer($host, (int) $port, $this->options['persistent'], 1); - } - } - - /** - * 判断缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function has($name): bool - { - $key = $this->getCacheKey($name); - - return false !== $this->handler->get($key); - } - - /** - * 读取缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get($name, $default = null) - { - $this->readTimes++; - - $result = $this->handler->get($this->getCacheKey($name)); - - return false !== $result ? $this->unserialize($result) : $default; - } - - /** - * 写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param int|\DateTime $expire 有效时间(秒) - * @return bool - */ - public function set($name, $value, $expire = null): bool - { - $this->writeTimes++; - - if (is_null($expire)) { - $expire = $this->options['expire']; - } - - $key = $this->getCacheKey($name); - $expire = $this->getExpireTime($expire); - $value = $this->serialize($value); - - if ($this->handler->set($key, $value, 0, $expire)) { - return true; - } - - return false; - } - - /** - * 自增缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function inc(string $name, int $step = 1) - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - - if ($this->handler->get($key)) { - return $this->handler->increment($key, $step); - } - - return $this->handler->set($key, $step); - } - - /** - * 自减缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function dec(string $name, int $step = 1) - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - $value = $this->handler->get($key) - $step; - $res = $this->handler->set($key, $value); - - return !$res ? false : $value; - } - - /** - * 删除缓存 - * @access public - * @param string $name 缓存变量名 - * @param bool|false $ttl - * @return bool - */ - public function delete($name, $ttl = false): bool - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - - return false === $ttl ? - $this->handler->delete($key) : - $this->handler->delete($key, $ttl); - } - - /** - * 清除缓存 - * @access public - * @return bool - */ - public function clear(): bool - { - $this->writeTimes++; - - return $this->handler->flush(); - } - - /** - * 删除缓存标签 - * @access public - * @param array $keys 缓存标识列表 - * @return void - */ - public function clearTag(array $keys): void - { - foreach ($keys as $key) { - $this->handler->delete($key); - } - } - -} diff --git a/vendor/topthink/framework/src/think/cache/driver/Memcached.php b/vendor/topthink/framework/src/think/cache/driver/Memcached.php deleted file mode 100644 index 71edb05..0000000 --- a/vendor/topthink/framework/src/think/cache/driver/Memcached.php +++ /dev/null @@ -1,221 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\cache\driver; - -use think\cache\Driver; - -/** - * Memcached缓存类 - */ -class Memcached extends Driver -{ - /** - * 配置参数 - * @var array - */ - protected $options = [ - 'host' => '127.0.0.1', - 'port' => 11211, - 'expire' => 0, - 'timeout' => 0, // 超时时间(单位:毫秒) - 'prefix' => '', - 'username' => '', //账号 - 'password' => '', //密码 - 'option' => [], - 'tag_prefix' => 'tag:', - 'serialize' => [], - ]; - - /** - * 架构函数 - * @access public - * @param array $options 缓存参数 - */ - public function __construct(array $options = []) - { - if (!extension_loaded('memcached')) { - throw new \BadFunctionCallException('not support: memcached'); - } - - if (!empty($options)) { - $this->options = array_merge($this->options, $options); - } - - $this->handler = new \Memcached; - - if (!empty($this->options['option'])) { - $this->handler->setOptions($this->options['option']); - } - - // 设置连接超时时间(单位:毫秒) - if ($this->options['timeout'] > 0) { - $this->handler->setOption(\Memcached::OPT_CONNECT_TIMEOUT, $this->options['timeout']); - } - - // 支持集群 - $hosts = (array) $this->options['host']; - $ports = (array) $this->options['port']; - if (empty($ports[0])) { - $ports[0] = 11211; - } - - // 建立连接 - $servers = []; - foreach ($hosts as $i => $host) { - $servers[] = [$host, $ports[$i] ?? $ports[0], 1]; - } - - $this->handler->addServers($servers); - - if ('' != $this->options['username']) { - $this->handler->setOption(\Memcached::OPT_BINARY_PROTOCOL, true); - $this->handler->setSaslAuthData($this->options['username'], $this->options['password']); - } - } - - /** - * 判断缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function has($name): bool - { - $key = $this->getCacheKey($name); - - return $this->handler->get($key) ? true : false; - } - - /** - * 读取缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get($name, $default = null) - { - $this->readTimes++; - - $result = $this->handler->get($this->getCacheKey($name)); - - return false !== $result ? $this->unserialize($result) : $default; - } - - /** - * 写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param integer|\DateTime $expire 有效时间(秒) - * @return bool - */ - public function set($name, $value, $expire = null): bool - { - $this->writeTimes++; - - if (is_null($expire)) { - $expire = $this->options['expire']; - } - - $key = $this->getCacheKey($name); - $expire = $this->getExpireTime($expire); - $value = $this->serialize($value); - - if ($this->handler->set($key, $value, $expire)) { - return true; - } - - return false; - } - - /** - * 自增缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function inc(string $name, int $step = 1) - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - - if ($this->handler->get($key)) { - return $this->handler->increment($key, $step); - } - - return $this->handler->set($key, $step); - } - - /** - * 自减缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function dec(string $name, int $step = 1) - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - $value = $this->handler->get($key) - $step; - $res = $this->handler->set($key, $value); - - return !$res ? false : $value; - } - - /** - * 删除缓存 - * @access public - * @param string $name 缓存变量名 - * @param bool|false $ttl - * @return bool - */ - public function delete($name, $ttl = false): bool - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - - return false === $ttl ? - $this->handler->delete($key) : - $this->handler->delete($key, $ttl); - } - - /** - * 清除缓存 - * @access public - * @return bool - */ - public function clear(): bool - { - $this->writeTimes++; - - return $this->handler->flush(); - } - - /** - * 删除缓存标签 - * @access public - * @param array $keys 缓存标识列表 - * @return void - */ - public function clearTag(array $keys): void - { - $this->handler->deleteMulti($keys); - } - -} diff --git a/vendor/topthink/framework/src/think/cache/driver/Redis.php b/vendor/topthink/framework/src/think/cache/driver/Redis.php deleted file mode 100644 index 791b27b..0000000 --- a/vendor/topthink/framework/src/think/cache/driver/Redis.php +++ /dev/null @@ -1,249 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\cache\driver; - -use think\cache\Driver; - -/** - * Redis缓存驱动,适合单机部署、有前端代理实现高可用的场景,性能最好 - * 有需要在业务层实现读写分离、或者使用RedisCluster的需求,请使用Redisd驱动 - * - * 要求安装phpredis扩展:https://github.com/nicolasff/phpredis - * @author 尘缘 <130775@qq.com> - */ -class Redis extends Driver -{ - /** @var \Predis\Client|\Redis */ - protected $handler; - - /** - * 配置参数 - * @var array - */ - protected $options = [ - 'host' => '127.0.0.1', - 'port' => 6379, - 'password' => '', - 'select' => 0, - 'timeout' => 0, - 'expire' => 0, - 'persistent' => false, - 'prefix' => '', - 'tag_prefix' => 'tag:', - 'serialize' => [], - ]; - - /** - * 架构函数 - * @access public - * @param array $options 缓存参数 - */ - public function __construct(array $options = []) - { - if (!empty($options)) { - $this->options = array_merge($this->options, $options); - } - - if (extension_loaded('redis')) { - $this->handler = new \Redis; - - if ($this->options['persistent']) { - $this->handler->pconnect($this->options['host'], (int) $this->options['port'], (int) $this->options['timeout'], 'persistent_id_' . $this->options['select']); - } else { - $this->handler->connect($this->options['host'], (int) $this->options['port'], (int) $this->options['timeout']); - } - - if ('' != $this->options['password']) { - $this->handler->auth($this->options['password']); - } - } elseif (class_exists('\Predis\Client')) { - $params = []; - foreach ($this->options as $key => $val) { - if (in_array($key, ['aggregate', 'cluster', 'connections', 'exceptions', 'prefix', 'profile', 'replication', 'parameters'])) { - $params[$key] = $val; - unset($this->options[$key]); - } - } - - if ('' == $this->options['password']) { - unset($this->options['password']); - } - - $this->handler = new \Predis\Client($this->options, $params); - - $this->options['prefix'] = ''; - } else { - throw new \BadFunctionCallException('not support: redis'); - } - - if (0 != $this->options['select']) { - $this->handler->select((int) $this->options['select']); - } - } - - /** - * 判断缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function has($name): bool - { - return $this->handler->exists($this->getCacheKey($name)) ? true : false; - } - - /** - * 读取缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get($name, $default = null) - { - $this->readTimes++; - $key = $this->getCacheKey($name); - $value = $this->handler->get($key); - - if (false === $value || is_null($value)) { - return $default; - } - - return $this->unserialize($value); - } - - /** - * 写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param integer|\DateTime $expire 有效时间(秒) - * @return bool - */ - public function set($name, $value, $expire = null): bool - { - $this->writeTimes++; - - if (is_null($expire)) { - $expire = $this->options['expire']; - } - - $key = $this->getCacheKey($name); - $expire = $this->getExpireTime($expire); - $value = $this->serialize($value); - - if ($expire) { - $this->handler->setex($key, $expire, $value); - } else { - $this->handler->set($key, $value); - } - - return true; - } - - /** - * 自增缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function inc(string $name, int $step = 1) - { - $this->writeTimes++; - $key = $this->getCacheKey($name); - - return $this->handler->incrby($key, $step); - } - - /** - * 自减缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function dec(string $name, int $step = 1) - { - $this->writeTimes++; - $key = $this->getCacheKey($name); - - return $this->handler->decrby($key, $step); - } - - /** - * 删除缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function delete($name): bool - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - $result = $this->handler->del($key); - return $result > 0; - } - - /** - * 清除缓存 - * @access public - * @return bool - */ - public function clear(): bool - { - $this->writeTimes++; - $this->handler->flushDB(); - return true; - } - - /** - * 删除缓存标签 - * @access public - * @param array $keys 缓存标识列表 - * @return void - */ - public function clearTag(array $keys): void - { - // 指定标签清除 - $this->handler->del($keys); - } - - /** - * 追加TagSet数据 - * @access public - * @param string $name 缓存标识 - * @param mixed $value 数据 - * @return void - */ - public function append(string $name, $value): void - { - $key = $this->getCacheKey($name); - $this->handler->sAdd($key, $value); - } - - /** - * 获取标签包含的缓存标识 - * @access public - * @param string $tag 缓存标签 - * @return array - */ - public function getTagItems(string $tag): array - { - $name = $this->getTagKey($tag); - $key = $this->getCacheKey($name); - return $this->handler->sMembers($key); - } - -} diff --git a/vendor/topthink/framework/src/think/cache/driver/Wincache.php b/vendor/topthink/framework/src/think/cache/driver/Wincache.php deleted file mode 100644 index 8b3e8b8..0000000 --- a/vendor/topthink/framework/src/think/cache/driver/Wincache.php +++ /dev/null @@ -1,175 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\cache\driver; - -use think\cache\Driver; - -/** - * Wincache缓存驱动 - */ -class Wincache extends Driver -{ - /** - * 配置参数 - * @var array - */ - protected $options = [ - 'prefix' => '', - 'expire' => 0, - 'tag_prefix' => 'tag:', - 'serialize' => [], - ]; - - /** - * 架构函数 - * @access public - * @param array $options 缓存参数 - * @throws \BadFunctionCallException - */ - public function __construct(array $options = []) - { - if (!function_exists('wincache_ucache_info')) { - throw new \BadFunctionCallException('not support: WinCache'); - } - - if (!empty($options)) { - $this->options = array_merge($this->options, $options); - } - } - - /** - * 判断缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function has($name): bool - { - $this->readTimes++; - - $key = $this->getCacheKey($name); - - return wincache_ucache_exists($key); - } - - /** - * 读取缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get($name, $default = null) - { - $this->readTimes++; - - $key = $this->getCacheKey($name); - - return wincache_ucache_exists($key) ? $this->unserialize(wincache_ucache_get($key)) : $default; - } - - /** - * 写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param integer|\DateTime $expire 有效时间(秒) - * @return bool - */ - public function set($name, $value, $expire = null): bool - { - $this->writeTimes++; - - if (is_null($expire)) { - $expire = $this->options['expire']; - } - - $key = $this->getCacheKey($name); - $expire = $this->getExpireTime($expire); - $value = $this->serialize($value); - - if (wincache_ucache_set($key, $value, $expire)) { - return true; - } - - return false; - } - - /** - * 自增缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function inc(string $name, int $step = 1) - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - - return wincache_ucache_inc($key, $step); - } - - /** - * 自减缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function dec(string $name, int $step = 1) - { - $this->writeTimes++; - - $key = $this->getCacheKey($name); - - return wincache_ucache_dec($key, $step); - } - - /** - * 删除缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function delete($name): bool - { - $this->writeTimes++; - - return wincache_ucache_delete($this->getCacheKey($name)); - } - - /** - * 清除缓存 - * @access public - * @return bool - */ - public function clear(): bool - { - $this->writeTimes++; - return wincache_ucache_clear(); - } - - /** - * 删除缓存标签 - * @access public - * @param array $keys 缓存标识列表 - * @return void - */ - public function clearTag(array $keys): void - { - wincache_ucache_delete($keys); - } - -} diff --git a/vendor/topthink/framework/src/think/console/Command.php b/vendor/topthink/framework/src/think/console/Command.php deleted file mode 100644 index bd3fb20..0000000 --- a/vendor/topthink/framework/src/think/console/Command.php +++ /dev/null @@ -1,504 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console; - -use Exception; -use InvalidArgumentException; -use LogicException; -use think\App; -use think\Console; -use think\console\input\Argument; -use think\console\input\Definition; -use think\console\input\Option; - -abstract class Command -{ - - /** @var Console */ - private $console; - private $name; - private $processTitle; - private $aliases = []; - private $definition; - private $help; - private $description; - private $ignoreValidationErrors = false; - private $consoleDefinitionMerged = false; - private $consoleDefinitionMergedWithArgs = false; - private $synopsis = []; - private $usages = []; - - /** @var Input */ - protected $input; - - /** @var Output */ - protected $output; - - /** @var App */ - protected $app; - - /** - * 构造方法 - * @throws LogicException - * @api - */ - public function __construct() - { - $this->definition = new Definition(); - - $this->configure(); - - if (!$this->name) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this))); - } - } - - /** - * 忽略验证错误 - */ - public function ignoreValidationErrors(): void - { - $this->ignoreValidationErrors = true; - } - - /** - * 设置控制台 - * @param Console $console - */ - public function setConsole(Console $console = null): void - { - $this->console = $console; - } - - /** - * 获取控制台 - * @return Console - * @api - */ - public function getConsole(): Console - { - return $this->console; - } - - /** - * 设置app - * @param App $app - */ - public function setApp(App $app) - { - $this->app = $app; - } - - /** - * 获取app - * @return App - */ - public function getApp() - { - return $this->app; - } - - /** - * 是否有效 - * @return bool - */ - public function isEnabled(): bool - { - return true; - } - - /** - * 配置指令 - */ - protected function configure() - { - } - - /** - * 执行指令 - * @param Input $input - * @param Output $output - * @return null|int - * @throws LogicException - * @see setCode() - */ - protected function execute(Input $input, Output $output) - { - return $this->app->invoke([$this, 'handle']); - } - - /** - * 用户验证 - * @param Input $input - * @param Output $output - */ - protected function interact(Input $input, Output $output) - { - } - - /** - * 初始化 - * @param Input $input An InputInterface instance - * @param Output $output An OutputInterface instance - */ - protected function initialize(Input $input, Output $output) - { - } - - /** - * 执行 - * @param Input $input - * @param Output $output - * @return int - * @throws Exception - * @see setCode() - * @see execute() - */ - public function run(Input $input, Output $output): int - { - $this->input = $input; - $this->output = $output; - - $this->getSynopsis(true); - $this->getSynopsis(false); - - $this->mergeConsoleDefinition(); - - try { - $input->bind($this->definition); - } catch (Exception $e) { - if (!$this->ignoreValidationErrors) { - throw $e; - } - } - - $this->initialize($input, $output); - - if (null !== $this->processTitle) { - if (function_exists('cli_set_process_title')) { - if (false === @cli_set_process_title($this->processTitle)) { - if ('Darwin' === PHP_OS) { - $output->writeln('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.'); - } else { - $error = error_get_last(); - trigger_error($error['message'], E_USER_WARNING); - } - } - } elseif (function_exists('setproctitle')) { - setproctitle($this->processTitle); - } elseif (Output::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { - $output->writeln('Install the proctitle PECL to be able to change the process title.'); - } - } - - if ($input->isInteractive()) { - $this->interact($input, $output); - } - - $input->validate(); - - $statusCode = $this->execute($input, $output); - - return is_numeric($statusCode) ? (int) $statusCode : 0; - } - - /** - * 合并参数定义 - * @param bool $mergeArgs - */ - public function mergeConsoleDefinition(bool $mergeArgs = true) - { - if (null === $this->console - || (true === $this->consoleDefinitionMerged - && ($this->consoleDefinitionMergedWithArgs || !$mergeArgs)) - ) { - return; - } - - if ($mergeArgs) { - $currentArguments = $this->definition->getArguments(); - $this->definition->setArguments($this->console->getDefinition()->getArguments()); - $this->definition->addArguments($currentArguments); - } - - $this->definition->addOptions($this->console->getDefinition()->getOptions()); - - $this->consoleDefinitionMerged = true; - if ($mergeArgs) { - $this->consoleDefinitionMergedWithArgs = true; - } - } - - /** - * 设置参数定义 - * @param array|Definition $definition - * @return Command - * @api - */ - public function setDefinition($definition) - { - if ($definition instanceof Definition) { - $this->definition = $definition; - } else { - $this->definition->setDefinition($definition); - } - - $this->consoleDefinitionMerged = false; - - return $this; - } - - /** - * 获取参数定义 - * @return Definition - * @api - */ - public function getDefinition(): Definition - { - return $this->definition; - } - - /** - * 获取当前指令的参数定义 - * @return Definition - */ - public function getNativeDefinition(): Definition - { - return $this->getDefinition(); - } - - /** - * 添加参数 - * @param string $name 名称 - * @param int $mode 类型 - * @param string $description 描述 - * @param mixed $default 默认值 - * @return Command - */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null) - { - $this->definition->addArgument(new Argument($name, $mode, $description, $default)); - - return $this; - } - - /** - * 添加选项 - * @param string $name 选项名称 - * @param string $shortcut 别名 - * @param int $mode 类型 - * @param string $description 描述 - * @param mixed $default 默认值 - * @return Command - */ - public function addOption(string $name, string $shortcut = null, int $mode = null, string $description = '', $default = null) - { - $this->definition->addOption(new Option($name, $shortcut, $mode, $description, $default)); - - return $this; - } - - /** - * 设置指令名称 - * @param string $name - * @return Command - * @throws InvalidArgumentException - */ - public function setName(string $name) - { - $this->validateName($name); - - $this->name = $name; - - return $this; - } - - /** - * 设置进程名称 - * - * PHP 5.5+ or the proctitle PECL library is required - * - * @param string $title The process title - * - * @return $this - */ - public function setProcessTitle($title) - { - $this->processTitle = $title; - - return $this; - } - - /** - * 获取指令名称 - * @return string - */ - public function getName(): string - { - return $this->name ?: ''; - } - - /** - * 设置描述 - * @param string $description - * @return Command - */ - public function setDescription(string $description) - { - $this->description = $description; - - return $this; - } - - /** - * 获取描述 - * @return string - */ - public function getDescription(): string - { - return $this->description ?: ''; - } - - /** - * 设置帮助信息 - * @param string $help - * @return Command - */ - public function setHelp(string $help) - { - $this->help = $help; - - return $this; - } - - /** - * 获取帮助信息 - * @return string - */ - public function getHelp(): string - { - return $this->help ?: ''; - } - - /** - * 描述信息 - * @return string - */ - public function getProcessedHelp(): string - { - $name = $this->name; - - $placeholders = [ - '%command.name%', - '%command.full_name%', - ]; - $replacements = [ - $name, - $_SERVER['PHP_SELF'] . ' ' . $name, - ]; - - return str_replace($placeholders, $replacements, $this->getHelp()); - } - - /** - * 设置别名 - * @param string[] $aliases - * @return Command - * @throws InvalidArgumentException - */ - public function setAliases(iterable $aliases) - { - foreach ($aliases as $alias) { - $this->validateName($alias); - } - - $this->aliases = $aliases; - - return $this; - } - - /** - * 获取别名 - * @return array - */ - public function getAliases(): array - { - return $this->aliases; - } - - /** - * 获取简介 - * @param bool $short 是否简单的 - * @return string - */ - public function getSynopsis(bool $short = false): string - { - $key = $short ? 'short' : 'long'; - - if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); - } - - return $this->synopsis[$key]; - } - - /** - * 添加用法介绍 - * @param string $usage - * @return $this - */ - public function addUsage(string $usage) - { - if (0 !== strpos($usage, $this->name)) { - $usage = sprintf('%s %s', $this->name, $usage); - } - - $this->usages[] = $usage; - - return $this; - } - - /** - * 获取用法介绍 - * @return array - */ - public function getUsages(): array - { - return $this->usages; - } - - /** - * 验证指令名称 - * @param string $name - * @throws InvalidArgumentException - */ - private function validateName(string $name) - { - if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); - } - } - - /** - * 输出表格 - * @param Table $table - * @return string - */ - protected function table(Table $table): string - { - $content = $table->render(); - $this->output->writeln($content); - return $content; - } - -} diff --git a/vendor/topthink/framework/src/think/console/Input.php b/vendor/topthink/framework/src/think/console/Input.php deleted file mode 100644 index 9ae9077..0000000 --- a/vendor/topthink/framework/src/think/console/Input.php +++ /dev/null @@ -1,465 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console; - -use think\console\input\Argument; -use think\console\input\Definition; -use think\console\input\Option; - -class Input -{ - - /** - * @var Definition - */ - protected $definition; - - /** - * @var Option[] - */ - protected $options = []; - - /** - * @var Argument[] - */ - protected $arguments = []; - - protected $interactive = true; - - private $tokens; - private $parsed; - - public function __construct($argv = null) - { - if (null === $argv) { - $argv = $_SERVER['argv']; - // 去除命令名 - array_shift($argv); - } - - $this->tokens = $argv; - - $this->definition = new Definition(); - } - - protected function setTokens(array $tokens) - { - $this->tokens = $tokens; - } - - /** - * 绑定实例 - * @param Definition $definition A InputDefinition instance - */ - public function bind(Definition $definition): void - { - $this->arguments = []; - $this->options = []; - $this->definition = $definition; - - $this->parse(); - } - - /** - * 解析参数 - */ - protected function parse(): void - { - $parseOptions = true; - $this->parsed = $this->tokens; - while (null !== $token = array_shift($this->parsed)) { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - $parseOptions = false; - } elseif ($parseOptions && 0 === strpos($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } - } - } - - /** - * 解析短选项 - * @param string $token 当前的指令. - */ - private function parseShortOption(string $token): void - { - $name = substr($token, 1); - - if (strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) - && $this->definition->getOptionForShortcut($name[0])->acceptValue() - ) { - $this->addShortOption($name[0], substr($name, 1)); - } else { - $this->parseShortOptionSet($name); - } - } else { - $this->addShortOption($name, null); - } - } - - /** - * 解析短选项 - * @param string $name 当前指令 - * @throws \RuntimeException - */ - private function parseShortOptionSet(string $name): void - { - $len = strlen($name); - for ($i = 0; $i < $len; ++$i) { - if (!$this->definition->hasShortcut($name[$i])) { - throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); - } - - $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptValue()) { - $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); - - break; - } else { - $this->addLongOption($option->getName(), null); - } - } - } - - /** - * 解析完整选项 - * @param string $token 当前指令 - */ - private function parseLongOption(string $token): void - { - $name = substr($token, 2); - - if (false !== $pos = strpos($name, '=')) { - $this->addLongOption(substr($name, 0, $pos), substr($name, $pos + 1)); - } else { - $this->addLongOption($name, null); - } - } - - /** - * 解析参数 - * @param string $token 当前指令 - * @throws \RuntimeException - */ - private function parseArgument(string $token): void - { - $c = count($this->arguments); - - if ($this->definition->hasArgument($c)) { - $arg = $this->definition->getArgument($c); - - $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; - - } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { - $arg = $this->definition->getArgument($c - 1); - - $this->arguments[$arg->getName()][] = $token; - } else { - throw new \RuntimeException('Too many arguments.'); - } - } - - /** - * 添加一个短选项的值 - * @param string $shortcut 短名称 - * @param mixed $value 值 - * @throws \RuntimeException - */ - private function addShortOption(string $shortcut, $value): void - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * 添加一个完整选项的值 - * @param string $name 选项名 - * @param mixed $value 值 - * @throws \RuntimeException - */ - private function addLongOption(string $name, $value): void - { - if (!$this->definition->hasOption($name)) { - throw new \RuntimeException(sprintf('The "--%s" option does not exist.', $name)); - } - - $option = $this->definition->getOption($name); - - if (false === $value) { - $value = null; - } - - if (null !== $value && !$option->acceptValue()) { - throw new \RuntimeException(sprintf('The "--%s" option does not accept a value.', $name, $value)); - } - - if (null === $value && $option->acceptValue() && count($this->parsed)) { - $next = array_shift($this->parsed); - if (isset($next[0]) && '-' !== $next[0]) { - $value = $next; - } elseif (empty($next)) { - $value = ''; - } else { - array_unshift($this->parsed, $next); - } - } - - if (null === $value) { - if ($option->isValueRequired()) { - throw new \RuntimeException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isArray()) { - $value = $option->isValueOptional() ? $option->getDefault() : true; - } - } - - if ($option->isArray()) { - $this->options[$name][] = $value; - } else { - $this->options[$name] = $value; - } - } - - /** - * 获取第一个参数 - * @return string|null - */ - public function getFirstArgument() - { - foreach ($this->tokens as $token) { - if ($token && '-' === $token[0]) { - continue; - } - - return $token; - } - return; - } - - /** - * 检查原始参数是否包含某个值 - * @param string|array $values 需要检查的值 - * @return bool - */ - public function hasParameterOption($values): bool - { - $values = (array) $values; - - foreach ($this->tokens as $token) { - foreach ($values as $value) { - if ($token === $value || 0 === strpos($token, $value . '=')) { - return true; - } - } - } - - return false; - } - - /** - * 获取原始选项的值 - * @param string|array $values 需要检查的值 - * @param mixed $default 默认值 - * @return mixed The option value - */ - public function getParameterOption($values, $default = false) - { - $values = (array) $values; - $tokens = $this->tokens; - - while (0 < count($tokens)) { - $token = array_shift($tokens); - - foreach ($values as $value) { - if ($token === $value || 0 === strpos($token, $value . '=')) { - if (false !== $pos = strpos($token, '=')) { - return substr($token, $pos + 1); - } - - return array_shift($tokens); - } - } - } - - return $default; - } - - /** - * 验证输入 - * @throws \RuntimeException - */ - public function validate() - { - if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) { - throw new \RuntimeException('Not enough arguments.'); - } - } - - /** - * 检查输入是否是交互的 - * @return bool - */ - public function isInteractive(): bool - { - return $this->interactive; - } - - /** - * 设置输入的交互 - * @param bool - */ - public function setInteractive(bool $interactive): void - { - $this->interactive = $interactive; - } - - /** - * 获取所有的参数 - * @return Argument[] - */ - public function getArguments(): array - { - return array_merge($this->definition->getArgumentDefaults(), $this->arguments); - } - - /** - * 根据名称获取参数 - * @param string $name 参数名 - * @return mixed - * @throws \InvalidArgumentException - */ - public function getArgument(string $name) - { - if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - return $this->arguments[$name] ?? $this->definition->getArgument($name) - ->getDefault(); - } - - /** - * 设置参数的值 - * @param string $name 参数名 - * @param string $value 值 - * @throws \InvalidArgumentException - */ - public function setArgument(string $name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } - - /** - * 检查是否存在某个参数 - * @param string|int $name 参数名或位置 - * @return bool - */ - public function hasArgument($name): bool - { - return $this->definition->hasArgument($name); - } - - /** - * 获取所有的选项 - * @return Option[] - */ - public function getOptions(): array - { - return array_merge($this->definition->getOptionDefaults(), $this->options); - } - - /** - * 获取选项值 - * @param string $name 选项名称 - * @return mixed - * @throws \InvalidArgumentException - */ - public function getOption(string $name) - { - if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - return $this->options[$name] ?? $this->definition->getOption($name)->getDefault(); - } - - /** - * 设置选项值 - * @param string $name 选项名 - * @param string|bool $value 值 - * @throws \InvalidArgumentException - */ - public function setOption(string $name, $value): void - { - if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - $this->options[$name] = $value; - } - - /** - * 是否有某个选项 - * @param string $name 选项名 - * @return bool - */ - public function hasOption(string $name): bool - { - return $this->definition->hasOption($name) && isset($this->options[$name]); - } - - /** - * 转义指令 - * @param string $token - * @return string - */ - public function escapeToken(string $token): string - { - return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); - } - - /** - * 返回传递给命令的参数的字符串 - * @return string - */ - public function __toString() - { - $tokens = array_map(function ($token) { - if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1] . $this->escapeToken($match[2]); - } - - if ($token && '-' !== $token[0]) { - return $this->escapeToken($token); - } - - return $token; - }, $this->tokens); - - return implode(' ', $tokens); - } -} diff --git a/vendor/topthink/framework/src/think/console/LICENSE b/vendor/topthink/framework/src/think/console/LICENSE deleted file mode 100644 index 0abe056..0000000 --- a/vendor/topthink/framework/src/think/console/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2016 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/vendor/topthink/framework/src/think/console/Output.php b/vendor/topthink/framework/src/think/console/Output.php deleted file mode 100644 index 294c4b8..0000000 --- a/vendor/topthink/framework/src/think/console/Output.php +++ /dev/null @@ -1,231 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console; - -use Exception; -use think\console\output\Ask; -use think\console\output\Descriptor; -use think\console\output\driver\Buffer; -use think\console\output\driver\Console; -use think\console\output\driver\Nothing; -use think\console\output\Question; -use think\console\output\question\Choice; -use think\console\output\question\Confirmation; -use Throwable; - -/** - * Class Output - * @package think\console - * - * @see \think\console\output\driver\Console::setDecorated - * @method void setDecorated($decorated) - * - * @see \think\console\output\driver\Buffer::fetch - * @method string fetch() - * - * @method void info($message) - * @method void error($message) - * @method void comment($message) - * @method void warning($message) - * @method void highlight($message) - * @method void question($message) - */ -class Output -{ - // 不显示信息(静默) - const VERBOSITY_QUIET = 0; - // 正常信息 - const VERBOSITY_NORMAL = 1; - // 详细信息 - const VERBOSITY_VERBOSE = 2; - // 非常详细的信息 - const VERBOSITY_VERY_VERBOSE = 3; - // 调试信息 - const VERBOSITY_DEBUG = 4; - - const OUTPUT_NORMAL = 0; - const OUTPUT_RAW = 1; - const OUTPUT_PLAIN = 2; - - // 输出信息级别 - private $verbosity = self::VERBOSITY_NORMAL; - - /** @var Buffer|Console|Nothing */ - private $handle = null; - - protected $styles = [ - 'info', - 'error', - 'comment', - 'question', - 'highlight', - 'warning', - ]; - - public function __construct($driver = 'console') - { - $class = '\\think\\console\\output\\driver\\' . ucwords($driver); - - $this->handle = new $class($this); - } - - public function ask(Input $input, $question, $default = null, $validator = null) - { - $question = new Question($question, $default); - $question->setValidator($validator); - - return $this->askQuestion($input, $question); - } - - public function askHidden(Input $input, $question, $validator = null) - { - $question = new Question($question); - - $question->setHidden(true); - $question->setValidator($validator); - - return $this->askQuestion($input, $question); - } - - public function confirm(Input $input, $question, $default = true) - { - return $this->askQuestion($input, new Confirmation($question, $default)); - } - - /** - * {@inheritdoc} - */ - public function choice(Input $input, $question, array $choices, $default = null) - { - if (null !== $default) { - $values = array_flip($choices); - $default = $values[$default]; - } - - return $this->askQuestion($input, new Choice($question, $choices, $default)); - } - - protected function askQuestion(Input $input, Question $question) - { - $ask = new Ask($input, $this, $question); - $answer = $ask->run(); - - if ($input->isInteractive()) { - $this->newLine(); - } - - return $answer; - } - - protected function block(string $style, string $message): void - { - $this->writeln("<{$style}>{$message}"); - } - - /** - * 输出空行 - * @param int $count - */ - public function newLine(int $count = 1): void - { - $this->write(str_repeat(PHP_EOL, $count)); - } - - /** - * 输出信息并换行 - * @param string $messages - * @param int $type - */ - public function writeln(string $messages, int $type = 0): void - { - $this->write($messages, true, $type); - } - - /** - * 输出信息 - * @param string $messages - * @param bool $newline - * @param int $type - */ - public function write(string $messages, bool $newline = false, int $type = 0): void - { - $this->handle->write($messages, $newline, $type); - } - - public function renderException(Throwable $e): void - { - $this->handle->renderException($e); - } - - /** - * 设置输出信息级别 - * @param int $level 输出信息级别 - */ - public function setVerbosity(int $level) - { - $this->verbosity = $level; - } - - /** - * 获取输出信息级别 - * @return int - */ - public function getVerbosity(): int - { - return $this->verbosity; - } - - public function isQuiet(): bool - { - return self::VERBOSITY_QUIET === $this->verbosity; - } - - public function isVerbose(): bool - { - return self::VERBOSITY_VERBOSE <= $this->verbosity; - } - - public function isVeryVerbose(): bool - { - return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; - } - - public function isDebug(): bool - { - return self::VERBOSITY_DEBUG <= $this->verbosity; - } - - public function describe($object, array $options = []): void - { - $descriptor = new Descriptor(); - $options = array_merge([ - 'raw_text' => false, - ], $options); - - $descriptor->describe($this, $object, $options); - } - - public function __call($method, $args) - { - if (in_array($method, $this->styles)) { - array_unshift($args, $method); - return call_user_func_array([$this, 'block'], $args); - } - - if ($this->handle && method_exists($this->handle, $method)) { - return call_user_func_array([$this->handle, $method], $args); - } else { - throw new Exception('method not exists:' . __CLASS__ . '->' . $method); - } - } -} diff --git a/vendor/topthink/framework/src/think/console/Table.php b/vendor/topthink/framework/src/think/console/Table.php deleted file mode 100644 index 5a861d7..0000000 --- a/vendor/topthink/framework/src/think/console/Table.php +++ /dev/null @@ -1,300 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console; - -class Table -{ - const ALIGN_LEFT = 1; - const ALIGN_RIGHT = 0; - const ALIGN_CENTER = 2; - - /** - * 头信息数据 - * @var array - */ - protected $header = []; - - /** - * 头部对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER - * @var int - */ - protected $headerAlign = 1; - - /** - * 表格数据(二维数组) - * @var array - */ - protected $rows = []; - - /** - * 单元格对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER - * @var int - */ - protected $cellAlign = 1; - - /** - * 单元格宽度信息 - * @var array - */ - protected $colWidth = []; - - /** - * 表格输出样式 - * @var string - */ - protected $style = 'default'; - - /** - * 表格样式定义 - * @var array - */ - protected $format = [ - 'compact' => [], - 'default' => [ - 'top' => ['+', '-', '+', '+'], - 'cell' => ['|', ' ', '|', '|'], - 'middle' => ['+', '-', '+', '+'], - 'bottom' => ['+', '-', '+', '+'], - 'cross-top' => ['+', '-', '-', '+'], - 'cross-bottom' => ['+', '-', '-', '+'], - ], - 'markdown' => [ - 'top' => [' ', ' ', ' ', ' '], - 'cell' => ['|', ' ', '|', '|'], - 'middle' => ['|', '-', '|', '|'], - 'bottom' => [' ', ' ', ' ', ' '], - 'cross-top' => ['|', ' ', ' ', '|'], - 'cross-bottom' => ['|', ' ', ' ', '|'], - ], - 'borderless' => [ - 'top' => ['=', '=', ' ', '='], - 'cell' => [' ', ' ', ' ', ' '], - 'middle' => ['=', '=', ' ', '='], - 'bottom' => ['=', '=', ' ', '='], - 'cross-top' => ['=', '=', ' ', '='], - 'cross-bottom' => ['=', '=', ' ', '='], - ], - 'box' => [ - 'top' => ['┌', '─', '┬', '┐'], - 'cell' => ['│', ' ', '│', '│'], - 'middle' => ['├', '─', '┼', '┤'], - 'bottom' => ['└', '─', '┴', '┘'], - 'cross-top' => ['├', '─', '┴', '┤'], - 'cross-bottom' => ['├', '─', '┬', '┤'], - ], - 'box-double' => [ - 'top' => ['╔', '═', '╤', '╗'], - 'cell' => ['║', ' ', '│', '║'], - 'middle' => ['╠', '─', '╪', '╣'], - 'bottom' => ['╚', '═', '╧', '╝'], - 'cross-top' => ['╠', '═', '╧', '╣'], - 'cross-bottom' => ['╠', '═', '╤', '╣'], - ], - ]; - - /** - * 设置表格头信息 以及对齐方式 - * @access public - * @param array $header 要输出的Header信息 - * @param int $align 对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER - * @return void - */ - public function setHeader(array $header, int $align = 1): void - { - $this->header = $header; - $this->headerAlign = $align; - - $this->checkColWidth($header); - } - - /** - * 设置输出表格数据 及对齐方式 - * @access public - * @param array $rows 要输出的表格数据(二维数组) - * @param int $align 对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER - * @return void - */ - public function setRows(array $rows, int $align = 1): void - { - $this->rows = $rows; - $this->cellAlign = $align; - - foreach ($rows as $row) { - $this->checkColWidth($row); - } - } - - /** - * 设置全局单元格对齐方式 - * @param int $align 对齐方式 默认1 ALGIN_LEFT 0 ALIGN_RIGHT 2 ALIGN_CENTER - * @return $this - */ - public function setCellAlign(int $align = 1) - { - $this->cellAlign = $align; - return $this; - } - - /** - * 检查列数据的显示宽度 - * @access public - * @param mixed $row 行数据 - * @return void - */ - protected function checkColWidth($row): void - { - if (is_array($row)) { - foreach ($row as $key => $cell) { - $width = mb_strwidth((string) $cell); - if (!isset($this->colWidth[$key]) || $width > $this->colWidth[$key]) { - $this->colWidth[$key] = $width; - } - } - } - } - - /** - * 增加一行表格数据 - * @access public - * @param mixed $row 行数据 - * @param bool $first 是否在开头插入 - * @return void - */ - public function addRow($row, bool $first = false): void - { - if ($first) { - array_unshift($this->rows, $row); - } else { - $this->rows[] = $row; - } - - $this->checkColWidth($row); - } - - /** - * 设置输出表格的样式 - * @access public - * @param string $style 样式名 - * @return void - */ - public function setStyle(string $style): void - { - $this->style = isset($this->format[$style]) ? $style : 'default'; - } - - /** - * 输出分隔行 - * @access public - * @param string $pos 位置 - * @return string - */ - protected function renderSeparator(string $pos): string - { - $style = $this->getStyle($pos); - $array = []; - - foreach ($this->colWidth as $width) { - $array[] = str_repeat($style[1], $width + 2); - } - - return $style[0] . implode($style[2], $array) . $style[3] . PHP_EOL; - } - - /** - * 输出表格头部 - * @access public - * @return string - */ - protected function renderHeader(): string - { - $style = $this->getStyle('cell'); - $content = $this->renderSeparator('top'); - - foreach ($this->header as $key => $header) { - $array[] = ' ' . str_pad($header, $this->colWidth[$key], $style[1], $this->headerAlign); - } - - if (!empty($array)) { - $content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL; - - if (!empty($this->rows)) { - $content .= $this->renderSeparator('middle'); - } - } - - return $content; - } - - protected function getStyle(string $style): array - { - if ($this->format[$this->style]) { - $style = $this->format[$this->style][$style]; - } else { - $style = [' ', ' ', ' ', ' ']; - } - - return $style; - } - - /** - * 输出表格 - * @access public - * @param array $dataList 表格数据 - * @return string - */ - public function render(array $dataList = []): string - { - if (!empty($dataList)) { - $this->setRows($dataList); - } - - // 输出头部 - $content = $this->renderHeader(); - $style = $this->getStyle('cell'); - - if (!empty($this->rows)) { - foreach ($this->rows as $row) { - if (is_string($row) && '-' === $row) { - $content .= $this->renderSeparator('middle'); - } elseif (is_scalar($row)) { - $content .= $this->renderSeparator('cross-top'); - $width = 3 * (count($this->colWidth) - 1) + array_reduce($this->colWidth, function ($a, $b) { - return $a + $b; - }); - $array = str_pad($row, $width); - - $content .= $style[0] . ' ' . $array . ' ' . $style[3] . PHP_EOL; - $content .= $this->renderSeparator('cross-bottom'); - } else { - $array = []; - - foreach ($row as $key => $val) { - $width = $this->colWidth[$key]; - // form https://github.com/symfony/console/blob/20c9821c8d1c2189f287dcee709b2f86353ea08f/Helper/Table.php#L467 - // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (false !== $encoding = mb_detect_encoding((string) $val, null, true)) { - $width += strlen((string) $val) - mb_strwidth((string) $val, $encoding); - } - $array[] = ' ' . str_pad((string) $val, $width, ' ', $this->cellAlign); - } - - $content .= $style[0] . implode(' ' . $style[2], $array) . ' ' . $style[3] . PHP_EOL; - } - } - } - - $content .= $this->renderSeparator('bottom'); - - return $content; - } -} diff --git a/vendor/topthink/framework/src/think/console/bin/README.md b/vendor/topthink/framework/src/think/console/bin/README.md deleted file mode 100644 index 9acc52f..0000000 --- a/vendor/topthink/framework/src/think/console/bin/README.md +++ /dev/null @@ -1 +0,0 @@ -console 工具使用 hiddeninput.exe 在 windows 上隐藏密码输入,该二进制文件由第三方提供,相关源码和其他细节可以在 [Hidden Input](https://github.com/Seldaek/hidden-input) 找到。 diff --git a/vendor/topthink/framework/src/think/console/bin/hiddeninput.exe b/vendor/topthink/framework/src/think/console/bin/hiddeninput.exe deleted file mode 100644 index c8cf65e..0000000 Binary files a/vendor/topthink/framework/src/think/console/bin/hiddeninput.exe and /dev/null differ diff --git a/vendor/topthink/framework/src/think/console/command/Clear.php b/vendor/topthink/framework/src/think/console/command/Clear.php deleted file mode 100644 index da70b35..0000000 --- a/vendor/topthink/framework/src/think/console/command/Clear.php +++ /dev/null @@ -1,85 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Option; -use think\console\Output; - -class Clear extends Command -{ - protected function configure() - { - // 指令配置 - $this->setName('clear') - ->addOption('path', 'd', Option::VALUE_OPTIONAL, 'path to clear', null) - ->addOption('cache', 'c', Option::VALUE_NONE, 'clear cache file') - ->addOption('log', 'l', Option::VALUE_NONE, 'clear log file') - ->addOption('dir', 'r', Option::VALUE_NONE, 'clear empty dir') - ->addOption('expire', 'e', Option::VALUE_NONE, 'clear cache file if cache has expired') - ->setDescription('Clear runtime file'); - } - - protected function execute(Input $input, Output $output) - { - $runtimePath = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR; - - if ($input->getOption('cache')) { - $path = $runtimePath . 'cache'; - } elseif ($input->getOption('log')) { - $path = $runtimePath . 'log'; - } else { - $path = $input->getOption('path') ?: $runtimePath; - } - - $rmdir = $input->getOption('dir') ? true : false; - // --expire 仅当 --cache 时生效 - $cache_expire = $input->getOption('expire') && $input->getOption('cache') ? true : false; - $this->clear(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $rmdir, $cache_expire); - - $output->writeln("Clear Successed"); - } - - protected function clear(string $path, bool $rmdir, bool $cache_expire): void - { - $files = is_dir($path) ? scandir($path) : []; - - foreach ($files as $file) { - if ('.' != $file && '..' != $file && is_dir($path . $file)) { - $this->clear($path . $file . DIRECTORY_SEPARATOR, $rmdir, $cache_expire); - if ($rmdir) { - @rmdir($path . $file); - } - } elseif ('.gitignore' != $file && is_file($path . $file)) { - if ($cache_expire) { - if ($this->cacheHasExpired($path . $file)) { - unlink($path . $file); - } - } else { - unlink($path . $file); - } - } - } - } - - /** - * 缓存文件是否已过期 - * @param $filename string 文件路径 - * @return bool - */ - protected function cacheHasExpired($filename) { - $content = file_get_contents($filename); - $expire = (int) substr($content, 8, 12); - return 0 != $expire && time() - $expire > filemtime($filename); - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/Help.php b/vendor/topthink/framework/src/think/console/command/Help.php deleted file mode 100644 index 2e4f2ca..0000000 --- a/vendor/topthink/framework/src/think/console/command/Help.php +++ /dev/null @@ -1,70 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Argument as InputArgument; -use think\console\input\Option as InputOption; -use think\console\Output; - -class Help extends Command -{ - - private $command; - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->ignoreValidationErrors(); - - $this->setName('help')->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), - ])->setDescription('Displays help for a command')->setHelp( - <<%command.name% command displays help for a given command: - - php %command.full_name% list - -To display the list of available commands, please use the list command. -EOF - ); - } - - /** - * Sets the command. - * @param Command $command The command to set - */ - public function setCommand(Command $command): void - { - $this->command = $command; - } - - /** - * {@inheritdoc} - */ - protected function execute(Input $input, Output $output) - { - if (null === $this->command) { - $this->command = $this->getConsole()->find($input->getArgument('command_name')); - } - - $output->describe($this->command, [ - 'raw_text' => $input->getOption('raw'), - ]); - - $this->command = null; - } -} diff --git a/vendor/topthink/framework/src/think/console/command/Lists.php b/vendor/topthink/framework/src/think/console/command/Lists.php deleted file mode 100644 index d20fc75..0000000 --- a/vendor/topthink/framework/src/think/console/command/Lists.php +++ /dev/null @@ -1,74 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Argument as InputArgument; -use think\console\input\Definition as InputDefinition; -use think\console\input\Option as InputOption; -use think\console\Output; - -class Lists extends Command -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('list')->setDefinition($this->createDefinition())->setDescription('Lists commands')->setHelp( - <<%command.name% command lists all commands: - - php %command.full_name% - -You can also display the commands for a specific namespace: - - php %command.full_name% test - -It's also possible to get raw list of commands (useful for embedding command runner): - - php %command.full_name% --raw -EOF - ); - } - - /** - * {@inheritdoc} - */ - public function getNativeDefinition(): InputDefinition - { - return $this->createDefinition(); - } - - /** - * {@inheritdoc} - */ - protected function execute(Input $input, Output $output) - { - $output->describe($this->getConsole(), [ - 'raw_text' => $input->getOption('raw'), - 'namespace' => $input->getArgument('namespace'), - ]); - } - - /** - * {@inheritdoc} - */ - private function createDefinition(): InputDefinition - { - return new InputDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - ]); - } -} diff --git a/vendor/topthink/framework/src/think/console/command/Make.php b/vendor/topthink/framework/src/think/console/command/Make.php deleted file mode 100644 index 662b337..0000000 --- a/vendor/topthink/framework/src/think/console/command/Make.php +++ /dev/null @@ -1,99 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Argument; -use think\console\Output; - -abstract class Make extends Command -{ - protected $type; - - abstract protected function getStub(); - - protected function configure() - { - $this->addArgument('name', Argument::REQUIRED, "The name of the class"); - } - - protected function execute(Input $input, Output $output) - { - $name = trim($input->getArgument('name')); - - $classname = $this->getClassName($name); - - $pathname = $this->getPathName($classname); - - if (is_file($pathname)) { - $output->writeln('' . $this->type . ':' . $classname . ' already exists!'); - return false; - } - - if (!is_dir(dirname($pathname))) { - mkdir(dirname($pathname), 0755, true); - } - - file_put_contents($pathname, $this->buildClass($classname)); - - $output->writeln('' . $this->type . ':' . $classname . ' created successfully.'); - } - - protected function buildClass(string $name) - { - $stub = file_get_contents($this->getStub()); - - $namespace = trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); - - $class = str_replace($namespace . '\\', '', $name); - - return str_replace(['{%className%}', '{%actionSuffix%}', '{%namespace%}', '{%app_namespace%}'], [ - $class, - $this->app->config->get('route.action_suffix'), - $namespace, - $this->app->getNamespace(), - ], $stub); - } - - protected function getPathName(string $name): string - { - $name = str_replace('app\\', '', $name); - - return $this->app->getBasePath() . ltrim(str_replace('\\', '/', $name), '/') . '.php'; - } - - protected function getClassName(string $name): string - { - if (strpos($name, '\\') !== false) { - return $name; - } - - if (strpos($name, '@')) { - [$app, $name] = explode('@', $name); - } else { - $app = ''; - } - - if (strpos($name, '/') !== false) { - $name = str_replace('/', '\\', $name); - } - - return $this->getNamespace($app) . '\\' . $name; - } - - protected function getNamespace(string $app): string - { - return 'app' . ($app ? '\\' . $app : ''); - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/RouteList.php b/vendor/topthink/framework/src/think/console/command/RouteList.php deleted file mode 100644 index ed579b8..0000000 --- a/vendor/topthink/framework/src/think/console/command/RouteList.php +++ /dev/null @@ -1,129 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Argument; -use think\console\input\Option; -use think\console\Output; -use think\console\Table; -use think\event\RouteLoaded; - -class RouteList extends Command -{ - protected $sortBy = [ - 'rule' => 0, - 'route' => 1, - 'method' => 2, - 'name' => 3, - 'domain' => 4, - ]; - - protected function configure() - { - $this->setName('route:list') - ->addArgument('dir', Argument::OPTIONAL, 'dir name .') - ->addArgument('style', Argument::OPTIONAL, "the style of the table.", 'default') - ->addOption('sort', 's', Option::VALUE_OPTIONAL, 'order by rule name.', 0) - ->addOption('more', 'm', Option::VALUE_NONE, 'show route options.') - ->setDescription('show route list.'); - } - - protected function execute(Input $input, Output $output) - { - $dir = $input->getArgument('dir') ?: ''; - - $filename = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($dir ? $dir . DIRECTORY_SEPARATOR : '') . 'route_list.php'; - - if (is_file($filename)) { - unlink($filename); - } elseif (!is_dir(dirname($filename))) { - mkdir(dirname($filename), 0755); - } - - $content = $this->getRouteList($dir); - file_put_contents($filename, 'Route List' . PHP_EOL . $content); - } - - protected function getRouteList(string $dir = null): string - { - $this->app->route->setTestMode(true); - $this->app->route->clear(); - - if ($dir) { - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR; - } else { - $path = $this->app->getRootPath() . 'route' . DIRECTORY_SEPARATOR; - } - - $files = is_dir($path) ? scandir($path) : []; - - foreach ($files as $file) { - if (strpos($file, '.php')) { - include $path . $file; - } - } - - //触发路由载入完成事件 - $this->app->event->trigger(RouteLoaded::class); - - $table = new Table(); - - if ($this->input->hasOption('more')) { - $header = ['Rule', 'Route', 'Method', 'Name', 'Domain', 'Option', 'Pattern']; - } else { - $header = ['Rule', 'Route', 'Method', 'Name']; - } - - $table->setHeader($header); - - $routeList = $this->app->route->getRuleList(); - $rows = []; - - foreach ($routeList as $item) { - $item['route'] = $item['route'] instanceof \Closure ? '' : $item['route']; - - if ($this->input->hasOption('more')) { - $item = [$item['rule'], $item['route'], $item['method'], $item['name'], $item['domain'], json_encode($item['option']), json_encode($item['pattern'])]; - } else { - $item = [$item['rule'], $item['route'], $item['method'], $item['name']]; - } - - $rows[] = $item; - } - - if ($this->input->getOption('sort')) { - $sort = strtolower($this->input->getOption('sort')); - - if (isset($this->sortBy[$sort])) { - $sort = $this->sortBy[$sort]; - } - - uasort($rows, function ($a, $b) use ($sort) { - $itemA = $a[$sort] ?? null; - $itemB = $b[$sort] ?? null; - - return strcasecmp($itemA, $itemB); - }); - } - - $table->setRows($rows); - - if ($this->input->getArgument('style')) { - $style = $this->input->getArgument('style'); - $table->setStyle($style); - } - - return $this->table($table); - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/RunServer.php b/vendor/topthink/framework/src/think/console/command/RunServer.php deleted file mode 100644 index 20a2466..0000000 --- a/vendor/topthink/framework/src/think/console/command/RunServer.php +++ /dev/null @@ -1,72 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Option; -use think\console\Output; - -class RunServer extends Command -{ - public function configure() - { - $this->setName('run') - ->addOption( - 'host', - 'H', - Option::VALUE_OPTIONAL, - 'The host to server the application on', - '0.0.0.0' - ) - ->addOption( - 'port', - 'p', - Option::VALUE_OPTIONAL, - 'The port to server the application on', - 8000 - ) - ->addOption( - 'root', - 'r', - Option::VALUE_OPTIONAL, - 'The document root of the application', - '' - ) - ->setDescription('PHP Built-in Server for ThinkPHP'); - } - - public function execute(Input $input, Output $output) - { - $host = $input->getOption('host'); - $port = $input->getOption('port'); - $root = $input->getOption('root'); - if (empty($root)) { - $root = $this->app->getRootPath() . 'public'; - } - - $command = sprintf( - 'php -S %s:%d -t %s %s', - $host, - $port, - escapeshellarg($root), - escapeshellarg($root . DIRECTORY_SEPARATOR . 'router.php') - ); - - $output->writeln(sprintf('ThinkPHP Development server is started On ', '0.0.0.0' == $host ? '127.0.0.1' : $host, $port)); - $output->writeln(sprintf('You can exit with `CTRL-C`')); - $output->writeln(sprintf('Document root is: %s', $root)); - passthru($command); - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php b/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php deleted file mode 100644 index e90f433..0000000 --- a/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php +++ /dev/null @@ -1,52 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\Output; - -class ServiceDiscover extends Command -{ - public function configure() - { - $this->setName('service:discover') - ->setDescription('Discover Services for ThinkPHP'); - } - - public function execute(Input $input, Output $output) - { - if (is_file($path = $this->app->getRootPath() . 'vendor/composer/installed.json')) { - $packages = json_decode(@file_get_contents($path), true); - // Compatibility with Composer 2.0 - if (isset($packages['packages'])) { - $packages = $packages['packages']; - } - - $services = []; - foreach ($packages as $package) { - if (!empty($package['extra']['think']['services'])) { - $services = array_merge($services, (array) $package['extra']['think']['services']); - } - } - - $header = '// This file is automatically generated at:' . date('Y-m-d H:i:s') . PHP_EOL . 'declare (strict_types = 1);' . PHP_EOL; - - $content = 'app->getRootPath() . 'vendor/services.php', $content); - - $output->writeln('Succeed!'); - } - } -} diff --git a/vendor/topthink/framework/src/think/console/command/VendorPublish.php b/vendor/topthink/framework/src/think/console/command/VendorPublish.php deleted file mode 100644 index 3998765..0000000 --- a/vendor/topthink/framework/src/think/console/command/VendorPublish.php +++ /dev/null @@ -1,69 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console\command; - -use think\console\Command; -use think\console\input\Option; - -class VendorPublish extends Command -{ - public function configure() - { - $this->setName('vendor:publish') - ->addOption('force', 'f', Option::VALUE_NONE, 'Overwrite any existing files') - ->setDescription('Publish any publishable assets from vendor packages'); - } - - public function handle() - { - - $force = $this->input->getOption('force'); - - if (is_file($path = $this->app->getRootPath() . 'vendor/composer/installed.json')) { - $packages = json_decode(@file_get_contents($path), true); - // Compatibility with Composer 2.0 - if (isset($packages['packages'])) { - $packages = $packages['packages']; - } - foreach ($packages as $package) { - //配置 - $configDir = $this->app->getConfigPath(); - - if (!empty($package['extra']['think']['config'])) { - - $installPath = $this->app->getRootPath() . 'vendor/' . $package['name'] . DIRECTORY_SEPARATOR; - - foreach ((array) $package['extra']['think']['config'] as $name => $file) { - - $target = $configDir . $name . '.php'; - $source = $installPath . $file; - - if (is_file($target) && !$force) { - $this->output->info("File {$target} exist!"); - continue; - } - - if (!is_file($source)) { - $this->output->info("File {$source} not exist!"); - continue; - } - - copy($source, $target); - } - } - } - - $this->output->writeln('Succeed!'); - } - } -} diff --git a/vendor/topthink/framework/src/think/console/command/Version.php b/vendor/topthink/framework/src/think/console/command/Version.php deleted file mode 100644 index beb49d2..0000000 --- a/vendor/topthink/framework/src/think/console/command/Version.php +++ /dev/null @@ -1,33 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\console\command; - -use think\console\Command; -use think\console\Input; -use think\console\Output; - -class Version extends Command -{ - protected function configure() - { - // 指令配置 - $this->setName('version') - ->setDescription('show thinkphp framework version'); - } - - protected function execute(Input $input, Output $output) - { - $output->writeln('v' . $this->app->version()); - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Command.php b/vendor/topthink/framework/src/think/console/command/make/Command.php deleted file mode 100644 index 9549a02..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Command.php +++ /dev/null @@ -1,55 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command\make; - -use think\console\command\Make; -use think\console\input\Argument; - -class Command extends Make -{ - protected $type = "Command"; - - protected function configure() - { - parent::configure(); - $this->setName('make:command') - ->addArgument('commandName', Argument::OPTIONAL, "The name of the command") - ->setDescription('Create a new command class'); - } - - protected function buildClass(string $name): string - { - $commandName = $this->input->getArgument('commandName') ?: strtolower(basename($name)); - $namespace = trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); - - $class = str_replace($namespace . '\\', '', $name); - $stub = file_get_contents($this->getStub()); - - return str_replace(['{%commandName%}', '{%className%}', '{%namespace%}', '{%app_namespace%}'], [ - $commandName, - $class, - $namespace, - $this->app->getNamespace(), - ], $stub); - } - - protected function getStub(): string - { - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'command.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\command'; - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Controller.php b/vendor/topthink/framework/src/think/console/command/make/Controller.php deleted file mode 100644 index 4a8d226..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Controller.php +++ /dev/null @@ -1,56 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command\make; - -use think\console\command\Make; -use think\console\input\Option; - -class Controller extends Make -{ - - protected $type = "Controller"; - - protected function configure() - { - parent::configure(); - $this->setName('make:controller') - ->addOption('api', null, Option::VALUE_NONE, 'Generate an api controller class.') - ->addOption('plain', null, Option::VALUE_NONE, 'Generate an empty controller class.') - ->setDescription('Create a new resource controller class'); - } - - protected function getStub(): string - { - $stubPath = __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR; - - if ($this->input->getOption('api')) { - return $stubPath . 'controller.api.stub'; - } - - if ($this->input->getOption('plain')) { - return $stubPath . 'controller.plain.stub'; - } - - return $stubPath . 'controller.stub'; - } - - protected function getClassName(string $name): string - { - return parent::getClassName($name) . ($this->app->config->get('route.controller_suffix') ? 'Controller' : ''); - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\controller'; - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Event.php b/vendor/topthink/framework/src/think/console/command/make/Event.php deleted file mode 100644 index 6b16689..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Event.php +++ /dev/null @@ -1,35 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\console\command\make; - -use think\console\command\Make; - -class Event extends Make -{ - protected $type = "Event"; - - protected function configure() - { - parent::configure(); - $this->setName('make:event') - ->setDescription('Create a new event class'); - } - - protected function getStub(): string - { - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'event.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\event'; - } -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Listener.php b/vendor/topthink/framework/src/think/console/command/make/Listener.php deleted file mode 100644 index 5c92673..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Listener.php +++ /dev/null @@ -1,35 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\console\command\make; - -use think\console\command\Make; - -class Listener extends Make -{ - protected $type = "Listener"; - - protected function configure() - { - parent::configure(); - $this->setName('make:listener') - ->setDescription('Create a new listener class'); - } - - protected function getStub(): string - { - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'listener.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\listener'; - } -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Middleware.php b/vendor/topthink/framework/src/think/console/command/make/Middleware.php deleted file mode 100644 index 3b68b4a..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Middleware.php +++ /dev/null @@ -1,36 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command\make; - -use think\console\command\Make; - -class Middleware extends Make -{ - protected $type = "Middleware"; - - protected function configure() - { - parent::configure(); - $this->setName('make:middleware') - ->setDescription('Create a new middleware class'); - } - - protected function getStub(): string - { - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'middleware.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\middleware'; - } -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Model.php b/vendor/topthink/framework/src/think/console/command/make/Model.php deleted file mode 100644 index cb7a23c..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Model.php +++ /dev/null @@ -1,36 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command\make; - -use think\console\command\Make; - -class Model extends Make -{ - protected $type = "Model"; - - protected function configure() - { - parent::configure(); - $this->setName('make:model') - ->setDescription('Create a new model class'); - } - - protected function getStub(): string - { - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'model.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\model'; - } -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Service.php b/vendor/topthink/framework/src/think/console/command/make/Service.php deleted file mode 100644 index c4bbaa0..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Service.php +++ /dev/null @@ -1,36 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command\make; - -use think\console\command\Make; - -class Service extends Make -{ - protected $type = "Service"; - - protected function configure() - { - parent::configure(); - $this->setName('make:service') - ->setDescription('Create a new Service class'); - } - - protected function getStub(): string - { - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'service.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\service'; - } -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Subscribe.php b/vendor/topthink/framework/src/think/console/command/make/Subscribe.php deleted file mode 100644 index a1dc2a8..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Subscribe.php +++ /dev/null @@ -1,35 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\console\command\make; - -use think\console\command\Make; - -class Subscribe extends Make -{ - protected $type = "Subscribe"; - - protected function configure() - { - parent::configure(); - $this->setName('make:subscribe') - ->setDescription('Create a new subscribe class'); - } - - protected function getStub(): string - { - return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'subscribe.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\subscribe'; - } -} diff --git a/vendor/topthink/framework/src/think/console/command/make/Validate.php b/vendor/topthink/framework/src/think/console/command/make/Validate.php deleted file mode 100644 index 8d36431..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/Validate.php +++ /dev/null @@ -1,39 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\command\make; - -use think\console\command\Make; - -class Validate extends Make -{ - protected $type = "Validate"; - - protected function configure() - { - parent::configure(); - $this->setName('make:validate') - ->setDescription('Create a validate class'); - } - - protected function getStub(): string - { - $stubPath = __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR; - - return $stubPath . 'validate.stub'; - } - - protected function getNamespace(string $app): string - { - return parent::getNamespace($app) . '\\validate'; - } - -} diff --git a/vendor/topthink/framework/src/think/console/command/make/stubs/command.stub b/vendor/topthink/framework/src/think/console/command/make/stubs/command.stub deleted file mode 100644 index 3ee2b1c..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/stubs/command.stub +++ /dev/null @@ -1,26 +0,0 @@ -setName('{%commandName%}') - ->setDescription('the {%commandName%} command'); - } - - protected function execute(Input $input, Output $output) - { - // 指令输出 - $output->writeln('{%commandName%}'); - } -} diff --git a/vendor/topthink/framework/src/think/console/command/make/stubs/controller.api.stub b/vendor/topthink/framework/src/think/console/command/make/stubs/controller.api.stub deleted file mode 100644 index 5d3383d..0000000 --- a/vendor/topthink/framework/src/think/console/command/make/stubs/controller.api.stub +++ /dev/null @@ -1,64 +0,0 @@ - ['规则1','规则2'...] - * - * @var array - */ - protected $rule = []; - - /** - * 定义错误信息 - * 格式:'字段名.规则名' => '错误信息' - * - * @var array - */ - protected $message = []; -} diff --git a/vendor/topthink/framework/src/think/console/command/optimize/Route.php b/vendor/topthink/framework/src/think/console/command/optimize/Route.php deleted file mode 100644 index 56f7f5a..0000000 --- a/vendor/topthink/framework/src/think/console/command/optimize/Route.php +++ /dev/null @@ -1,66 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\console\command\optimize; - -use think\console\Command; -use think\console\Input; -use think\console\input\Argument; -use think\console\Output; -use think\event\RouteLoaded; - -class Route extends Command -{ - protected function configure() - { - $this->setName('optimize:route') - ->addArgument('dir', Argument::OPTIONAL, 'dir name .') - ->setDescription('Build app route cache.'); - } - - protected function execute(Input $input, Output $output) - { - $dir = $input->getArgument('dir') ?: ''; - - $path = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($dir ? $dir . DIRECTORY_SEPARATOR : ''); - - $filename = $path . 'route.php'; - if (is_file($filename)) { - unlink($filename); - } - - file_put_contents($filename, $this->buildRouteCache($dir)); - $output->writeln('Succeed!'); - } - - protected function buildRouteCache(string $dir = null): string - { - $this->app->route->clear(); - $this->app->route->lazy(false); - - // 路由检测 - $path = $this->app->getRootPath() . ($dir ? 'app' . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR : '') . 'route' . DIRECTORY_SEPARATOR; - - $files = is_dir($path) ? scandir($path) : []; - - foreach ($files as $file) { - if (strpos($file, '.php')) { - include $path . $file; - } - } - - //触发路由载入完成事件 - $this->app->event->trigger(RouteLoaded::class); - $rules = $this->app->route->getName(); - - return ' -// +---------------------------------------------------------------------- -namespace think\console\command\optimize; - -use Exception; -use think\console\Command; -use think\console\Input; -use think\console\input\Argument; -use think\console\input\Option; -use think\console\Output; -use think\db\PDOConnection; - -class Schema extends Command -{ - protected function configure() - { - $this->setName('optimize:schema') - ->addArgument('dir', Argument::OPTIONAL, 'dir name .') - ->addOption('connection', null, Option::VALUE_REQUIRED, 'connection name .') - ->addOption('table', null, Option::VALUE_REQUIRED, 'table name .') - ->setDescription('Build database schema cache.'); - } - - protected function execute(Input $input, Output $output) - { - $dir = $input->getArgument('dir') ?: ''; - - if ($input->hasOption('table')) { - $connection = $this->app->db->connect($input->getOption('connection')); - if (!$connection instanceof PDOConnection) { - $output->error("only PDO connection support schema cache!"); - return; - } - $table = $input->getOption('table'); - if (false === strpos($table, '.')) { - $dbName = $connection->getConfig('database'); - } else { - [$dbName, $table] = explode('.', $table); - } - - if ($table == '*') { - $table = $connection->getTables($dbName); - } - - $this->buildDataBaseSchema($connection, (array) $table, $dbName); - } else { - if ($dir) { - $appPath = $this->app->getBasePath() . $dir . DIRECTORY_SEPARATOR; - $namespace = 'app\\' . $dir; - } else { - $appPath = $this->app->getBasePath(); - $namespace = 'app'; - } - - $path = $appPath . 'model'; - $list = is_dir($path) ? scandir($path) : []; - - foreach ($list as $file) { - if (0 === strpos($file, '.')) { - continue; - } - $class = '\\' . $namespace . '\\model\\' . pathinfo($file, PATHINFO_FILENAME); - $this->buildModelSchema($class); - } - } - - $output->writeln('Succeed!'); - } - - protected function buildModelSchema(string $class): void - { - $reflect = new \ReflectionClass($class); - if (!$reflect->isAbstract() && $reflect->isSubclassOf('\think\Model')) { - try { - /** @var \think\Model $model */ - $model = new $class; - $connection = $model->db()->getConnection(); - if ($connection instanceof PDOConnection) { - $table = $model->getTable(); - //预读字段信息 - $connection->getSchemaInfo($table, true); - } - } catch (Exception $e) { - - } - } - } - - protected function buildDataBaseSchema(PDOConnection $connection, array $tables, string $dbName): void - { - foreach ($tables as $table) { - //预读字段信息 - $connection->getSchemaInfo("{$dbName}.{$table}", true); - } - } -} diff --git a/vendor/topthink/framework/src/think/console/input/Argument.php b/vendor/topthink/framework/src/think/console/input/Argument.php deleted file mode 100644 index 4fa3e3c..0000000 --- a/vendor/topthink/framework/src/think/console/input/Argument.php +++ /dev/null @@ -1,115 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\input; - -class Argument -{ - - const REQUIRED = 1; - const OPTIONAL = 2; - const IS_ARRAY = 4; - - private $name; - private $mode; - private $default; - private $description; - - /** - * 构造方法 - * @param string $name 参数名 - * @param int $mode 参数类型: self::REQUIRED 或者 self::OPTIONAL - * @param string $description 描述 - * @param mixed $default 默认值 (仅 self::OPTIONAL 类型有效) - * @throws \InvalidArgumentException - */ - public function __construct(string $name, int $mode = null, string $description = '', $default = null) - { - if (null === $mode) { - $mode = self::OPTIONAL; - } elseif (!is_int($mode) || $mode > 7 || $mode < 1) { - throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->mode = $mode; - $this->description = $description; - - $this->setDefault($default); - } - - /** - * 获取参数名 - * @return string - */ - public function getName(): string - { - return $this->name; - } - - /** - * 是否必须 - * @return bool - */ - public function isRequired(): bool - { - return self::REQUIRED === (self::REQUIRED & $this->mode); - } - - /** - * 该参数是否接受数组 - * @return bool - */ - public function isArray(): bool - { - return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); - } - - /** - * 设置默认值 - * @param mixed $default 默认值 - * @throws \LogicException - */ - public function setDefault($default = null): void - { - if (self::REQUIRED === $this->mode && null !== $default) { - throw new \LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!is_array($default)) { - throw new \LogicException('A default value for an array argument must be an array.'); - } - } - - $this->default = $default; - } - - /** - * 获取默认值 - * @return mixed - */ - public function getDefault() - { - return $this->default; - } - - /** - * 获取描述 - * @return string - */ - public function getDescription(): string - { - return $this->description; - } -} diff --git a/vendor/topthink/framework/src/think/console/input/Definition.php b/vendor/topthink/framework/src/think/console/input/Definition.php deleted file mode 100644 index ccf02a0..0000000 --- a/vendor/topthink/framework/src/think/console/input/Definition.php +++ /dev/null @@ -1,375 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\input; - -class Definition -{ - - /** - * @var Argument[] - */ - private $arguments; - - private $requiredCount; - private $hasAnArrayArgument = false; - private $hasOptional; - - /** - * @var Option[] - */ - private $options; - private $shortcuts; - - /** - * 构造方法 - * @param array $definition - * @api - */ - public function __construct(array $definition = []) - { - $this->setDefinition($definition); - } - - /** - * 设置指令的定义 - * @param array $definition 定义的数组 - */ - public function setDefinition(array $definition): void - { - $arguments = []; - $options = []; - foreach ($definition as $item) { - if ($item instanceof Option) { - $options[] = $item; - } else { - $arguments[] = $item; - } - } - - $this->setArguments($arguments); - $this->setOptions($options); - } - - /** - * 设置参数 - * @param Argument[] $arguments 参数数组 - */ - public function setArguments(array $arguments = []): void - { - $this->arguments = []; - $this->requiredCount = 0; - $this->hasOptional = false; - $this->hasAnArrayArgument = false; - $this->addArguments($arguments); - } - - /** - * 添加参数 - * @param Argument[] $arguments 参数数组 - * @api - */ - public function addArguments(array $arguments = []): void - { - if (null !== $arguments) { - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - } - - /** - * 添加一个参数 - * @param Argument $argument 参数 - * @throws \LogicException - */ - public function addArgument(Argument $argument): void - { - if (isset($this->arguments[$argument->getName()])) { - throw new \LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); - } - - if ($this->hasAnArrayArgument) { - throw new \LogicException('Cannot add an argument after an array argument.'); - } - - if ($argument->isRequired() && $this->hasOptional) { - throw new \LogicException('Cannot add a required argument after an optional one.'); - } - - if ($argument->isArray()) { - $this->hasAnArrayArgument = true; - } - - if ($argument->isRequired()) { - ++$this->requiredCount; - } else { - $this->hasOptional = true; - } - - $this->arguments[$argument->getName()] = $argument; - } - - /** - * 根据名称或者位置获取参数 - * @param string|int $name 参数名或者位置 - * @return Argument 参数 - * @throws \InvalidArgumentException - */ - public function getArgument($name): Argument - { - if (!$this->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; - - return $arguments[$name]; - } - - /** - * 根据名称或位置检查是否具有某个参数 - * @param string|int $name 参数名或者位置 - * @return bool - * @api - */ - public function hasArgument($name): bool - { - $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; - - return isset($arguments[$name]); - } - - /** - * 获取所有的参数 - * @return Argument[] 参数数组 - */ - public function getArguments(): array - { - return $this->arguments; - } - - /** - * 获取参数数量 - * @return int - */ - public function getArgumentCount(): int - { - return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments); - } - - /** - * 获取必填的参数的数量 - * @return int - */ - public function getArgumentRequiredCount(): int - { - return $this->requiredCount; - } - - /** - * 获取参数默认值 - * @return array - */ - public function getArgumentDefaults(): array - { - $values = []; - foreach ($this->arguments as $argument) { - $values[$argument->getName()] = $argument->getDefault(); - } - - return $values; - } - - /** - * 设置选项 - * @param Option[] $options 选项数组 - */ - public function setOptions(array $options = []): void - { - $this->options = []; - $this->shortcuts = []; - $this->addOptions($options); - } - - /** - * 添加选项 - * @param Option[] $options 选项数组 - * @api - */ - public function addOptions(array $options = []): void - { - foreach ($options as $option) { - $this->addOption($option); - } - } - - /** - * 添加一个选项 - * @param Option $option 选项 - * @throws \LogicException - * @api - */ - public function addOption(Option $option): void - { - if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new \LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - if (isset($this->shortcuts[$shortcut]) - && !$option->equals($this->options[$this->shortcuts[$shortcut]]) - ) { - throw new \LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); - } - } - } - - $this->options[$option->getName()] = $option; - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - $this->shortcuts[$shortcut] = $option->getName(); - } - } - } - - /** - * 根据名称获取选项 - * @param string $name 选项名 - * @return Option - * @throws \InvalidArgumentException - * @api - */ - public function getOption(string $name): Option - { - if (!$this->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); - } - - return $this->options[$name]; - } - - /** - * 根据名称检查是否有这个选项 - * @param string $name 选项名 - * @return bool - * @api - */ - public function hasOption(string $name): bool - { - return isset($this->options[$name]); - } - - /** - * 获取所有选项 - * @return Option[] - * @api - */ - public function getOptions(): array - { - return $this->options; - } - - /** - * 根据名称检查某个选项是否有短名称 - * @param string $name 短名称 - * @return bool - */ - public function hasShortcut(string $name): bool - { - return isset($this->shortcuts[$name]); - } - - /** - * 根据短名称获取选项 - * @param string $shortcut 短名称 - * @return Option - */ - public function getOptionForShortcut(string $shortcut): Option - { - return $this->getOption($this->shortcutToName($shortcut)); - } - - /** - * 获取所有选项的默认值 - * @return array - */ - public function getOptionDefaults(): array - { - $values = []; - foreach ($this->options as $option) { - $values[$option->getName()] = $option->getDefault(); - } - - return $values; - } - - /** - * 根据短名称获取选项名 - * @param string $shortcut 短名称 - * @return string - * @throws \InvalidArgumentException - */ - private function shortcutToName(string $shortcut): string - { - if (!isset($this->shortcuts[$shortcut])) { - throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - return $this->shortcuts[$shortcut]; - } - - /** - * 获取该指令的介绍 - * @param bool $short 是否简洁介绍 - * @return string - */ - public function getSynopsis(bool $short = false): string - { - $elements = []; - - if ($short && $this->getOptions()) { - $elements[] = '[options]'; - } elseif (!$short) { - foreach ($this->getOptions() as $option) { - $value = ''; - if ($option->acceptValue()) { - $value = sprintf(' %s%s%s', $option->isValueOptional() ? '[' : '', strtoupper($option->getName()), $option->isValueOptional() ? ']' : ''); - } - - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $elements[] = sprintf('[%s--%s%s]', $shortcut, $option->getName(), $value); - } - } - - if (count($elements) && $this->getArguments()) { - $elements[] = '[--]'; - } - - foreach ($this->getArguments() as $argument) { - $element = '<' . $argument->getName() . '>'; - if (!$argument->isRequired()) { - $element = '[' . $element . ']'; - } elseif ($argument->isArray()) { - $element .= ' (' . $element . ')'; - } - - if ($argument->isArray()) { - $element .= '...'; - } - - $elements[] = $element; - } - - return implode(' ', $elements); - } -} diff --git a/vendor/topthink/framework/src/think/console/input/Option.php b/vendor/topthink/framework/src/think/console/input/Option.php deleted file mode 100644 index 19c7e1e..0000000 --- a/vendor/topthink/framework/src/think/console/input/Option.php +++ /dev/null @@ -1,221 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\input; - -/** - * 命令行选项 - * @package think\console\input - */ -class Option -{ - // 无需传值 - const VALUE_NONE = 1; - // 必须传值 - const VALUE_REQUIRED = 2; - // 可选传值 - const VALUE_OPTIONAL = 4; - // 传数组值 - const VALUE_IS_ARRAY = 8; - - /** - * 选项名 - * @var string - */ - private $name; - - /** - * 选项短名称 - * @var string - */ - private $shortcut; - - /** - * 选项类型 - * @var int - */ - private $mode; - - /** - * 选项默认值 - * @var mixed - */ - private $default; - - /** - * 选项描述 - * @var string - */ - private $description; - - /** - * 构造方法 - * @param string $name 选项名 - * @param string|array $shortcut 短名称,多个用|隔开或者使用数组 - * @param int $mode 选项类型(可选类型为 self::VALUE_*) - * @param string $description 描述 - * @param mixed $default 默认值 (类型为 self::VALUE_REQUIRED 或者 self::VALUE_NONE 的时候必须为null) - * @throws \InvalidArgumentException - */ - public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null) - { - if (0 === strpos($name, '--')) { - $name = substr($name, 2); - } - - if (empty($name)) { - throw new \InvalidArgumentException('An option name cannot be empty.'); - } - - if (empty($shortcut)) { - $shortcut = null; - } - - if (null !== $shortcut) { - if (is_array($shortcut)) { - $shortcut = implode('|', $shortcut); - } - $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts); - $shortcut = implode('|', $shortcuts); - - if (empty($shortcut)) { - throw new \InvalidArgumentException('An option shortcut cannot be empty.'); - } - } - - if (null === $mode) { - $mode = self::VALUE_NONE; - } elseif (!is_int($mode) || $mode > 15 || $mode < 1) { - throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->shortcut = $shortcut; - $this->mode = $mode; - $this->description = $description; - - if ($this->isArray() && !$this->acceptValue()) { - throw new \InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); - } - - $this->setDefault($default); - } - - /** - * 获取短名称 - * @return string - */ - public function getShortcut() - { - return $this->shortcut; - } - - /** - * 获取选项名 - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * 是否可以设置值 - * @return bool 类型不是 self::VALUE_NONE 的时候返回true,其他均返回false - */ - public function acceptValue() - { - return $this->isValueRequired() || $this->isValueOptional(); - } - - /** - * 是否必须 - * @return bool 类型是 self::VALUE_REQUIRED 的时候返回true,其他均返回false - */ - public function isValueRequired() - { - return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); - } - - /** - * 是否可选 - * @return bool 类型是 self::VALUE_OPTIONAL 的时候返回true,其他均返回false - */ - public function isValueOptional() - { - return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); - } - - /** - * 选项值是否接受数组 - * @return bool 类型是 self::VALUE_IS_ARRAY 的时候返回true,其他均返回false - */ - public function isArray() - { - return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); - } - - /** - * 设置默认值 - * @param mixed $default 默认值 - * @throws \LogicException - */ - public function setDefault($default = null) - { - if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new \LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!is_array($default)) { - throw new \LogicException('A default value for an array option must be an array.'); - } - } - - $this->default = $this->acceptValue() ? $default : false; - } - - /** - * 获取默认值 - * @return mixed - */ - public function getDefault() - { - return $this->default; - } - - /** - * 获取描述文字 - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * 检查所给选项是否是当前这个 - * @param Option $option - * @return bool - */ - public function equals(Option $option) - { - return $option->getName() === $this->getName() - && $option->getShortcut() === $this->getShortcut() - && $option->getDefault() === $this->getDefault() - && $option->isArray() === $this->isArray() - && $option->isValueRequired() === $this->isValueRequired() - && $option->isValueOptional() === $this->isValueOptional(); - } -} diff --git a/vendor/topthink/framework/src/think/console/output/Ask.php b/vendor/topthink/framework/src/think/console/output/Ask.php deleted file mode 100644 index 56821c7..0000000 --- a/vendor/topthink/framework/src/think/console/output/Ask.php +++ /dev/null @@ -1,336 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output; - -use think\console\Input; -use think\console\Output; -use think\console\output\question\Choice; -use think\console\output\question\Confirmation; - -class Ask -{ - private static $stty; - - private static $shell; - - /** @var Input */ - protected $input; - - /** @var Output */ - protected $output; - - /** @var Question */ - protected $question; - - public function __construct(Input $input, Output $output, Question $question) - { - $this->input = $input; - $this->output = $output; - $this->question = $question; - } - - public function run() - { - if (!$this->input->isInteractive()) { - return $this->question->getDefault(); - } - - if (!$this->question->getValidator()) { - return $this->doAsk(); - } - - $that = $this; - - $interviewer = function () use ($that) { - return $that->doAsk(); - }; - - return $this->validateAttempts($interviewer); - } - - protected function doAsk() - { - $this->writePrompt(); - - $inputStream = STDIN; - $autocomplete = $this->question->getAutocompleterValues(); - - if (null === $autocomplete || !$this->hasSttyAvailable()) { - $ret = false; - if ($this->question->isHidden()) { - try { - $ret = trim($this->getHiddenResponse($inputStream)); - } catch (\RuntimeException $e) { - if (!$this->question->isHiddenFallback()) { - throw $e; - } - } - } - - if (false === $ret) { - $ret = fgets($inputStream, 4096); - if (false === $ret) { - throw new \RuntimeException('Aborted'); - } - $ret = trim($ret); - } - } else { - $ret = trim($this->autocomplete($inputStream)); - } - - $ret = strlen($ret) > 0 ? $ret : $this->question->getDefault(); - - if ($normalizer = $this->question->getNormalizer()) { - return $normalizer($ret); - } - - return $ret; - } - - private function autocomplete($inputStream) - { - $autocomplete = $this->question->getAutocompleterValues(); - $ret = ''; - - $i = 0; - $ofs = -1; - $matches = $autocomplete; - $numMatches = count($matches); - - $sttyMode = shell_exec('stty -g'); - - shell_exec('stty -icanon -echo'); - - while (!feof($inputStream)) { - $c = fread($inputStream, 1); - - if ("\177" === $c) { - if (0 === $numMatches && 0 !== $i) { - --$i; - $this->output->write("\033[1D"); - } - - if ($i === 0) { - $ofs = -1; - $matches = $autocomplete; - $numMatches = count($matches); - } else { - $numMatches = 0; - } - - $ret = substr($ret, 0, $i); - } elseif ("\033" === $c) { - $c .= fread($inputStream, 2); - - if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { - if ('A' === $c[2] && -1 === $ofs) { - $ofs = 0; - } - - if (0 === $numMatches) { - continue; - } - - $ofs += ('A' === $c[2]) ? -1 : 1; - $ofs = ($numMatches + $ofs) % $numMatches; - } - } elseif (ord($c) < 32) { - if ("\t" === $c || "\n" === $c) { - if ($numMatches > 0 && -1 !== $ofs) { - $ret = $matches[$ofs]; - $this->output->write(substr($ret, $i)); - $i = strlen($ret); - } - - if ("\n" === $c) { - $this->output->write($c); - break; - } - - $numMatches = 0; - } - - continue; - } else { - $this->output->write($c); - $ret .= $c; - ++$i; - - $numMatches = 0; - $ofs = 0; - - foreach ($autocomplete as $value) { - if (0 === strpos($value, $ret) && $i !== strlen($value)) { - $matches[$numMatches++] = $value; - } - } - } - - $this->output->write("\033[K"); - - if ($numMatches > 0 && -1 !== $ofs) { - $this->output->write("\0337"); - $this->output->highlight(substr($matches[$ofs], $i)); - $this->output->write("\0338"); - } - } - - shell_exec(sprintf('stty %s', $sttyMode)); - - return $ret; - } - - protected function getHiddenResponse($inputStream) - { - if ('\\' === DIRECTORY_SEPARATOR) { - $exe = __DIR__ . '/../bin/hiddeninput.exe'; - - $value = rtrim(shell_exec($exe)); - $this->output->writeln(''); - - return $value; - } - - if ($this->hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - - shell_exec('stty -echo'); - $value = fgets($inputStream, 4096); - shell_exec(sprintf('stty %s', $sttyMode)); - - if (false === $value) { - throw new \RuntimeException('Aborted'); - } - - $value = trim($value); - $this->output->writeln(''); - - return $value; - } - - if (false !== $shell = $this->getShell()) { - $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword'; - $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); - $value = rtrim(shell_exec($command)); - $this->output->writeln(''); - - return $value; - } - - throw new \RuntimeException('Unable to hide the response.'); - } - - protected function validateAttempts($interviewer) - { - /** @var \Exception $error */ - $error = null; - $attempts = $this->question->getMaxAttempts(); - while (null === $attempts || $attempts--) { - if (null !== $error) { - $this->output->error($error->getMessage()); - } - - try { - return call_user_func($this->question->getValidator(), $interviewer()); - } catch (\Exception $error) { - } - } - - throw $error; - } - - /** - * 显示问题的提示信息 - */ - protected function writePrompt() - { - $text = $this->question->getQuestion(); - $default = $this->question->getDefault(); - - switch (true) { - case null === $default: - $text = sprintf(' %s:', $text); - - break; - - case $this->question instanceof Confirmation: - $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); - - break; - - case $this->question instanceof Choice && $this->question->isMultiselect(): - $choices = $this->question->getChoices(); - $default = explode(',', $default); - - foreach ($default as $key => $value) { - $default[$key] = $choices[trim($value)]; - } - - $text = sprintf(' %s [%s]:', $text, implode(', ', $default)); - - break; - - case $this->question instanceof Choice: - $choices = $this->question->getChoices(); - $text = sprintf(' %s [%s]:', $text, $choices[$default]); - - break; - - default: - $text = sprintf(' %s [%s]:', $text, $default); - } - - $this->output->writeln($text); - - if ($this->question instanceof Choice) { - $width = max(array_map('strlen', array_keys($this->question->getChoices()))); - - foreach ($this->question->getChoices() as $key => $value) { - $this->output->writeln(sprintf(" [%-${width}s] %s", $key, $value)); - } - } - - $this->output->write(' > '); - } - - private function getShell() - { - if (null !== self::$shell) { - return self::$shell; - } - - self::$shell = false; - - if (file_exists('/usr/bin/env')) { - $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null"; - foreach (['bash', 'zsh', 'ksh', 'csh'] as $sh) { - if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) { - self::$shell = $sh; - break; - } - } - } - - return self::$shell; - } - - private function hasSttyAvailable() - { - if (null !== self::$stty) { - return self::$stty; - } - - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = $exitcode === 0; - } -} diff --git a/vendor/topthink/framework/src/think/console/output/Descriptor.php b/vendor/topthink/framework/src/think/console/output/Descriptor.php deleted file mode 100644 index e4a9e61..0000000 --- a/vendor/topthink/framework/src/think/console/output/Descriptor.php +++ /dev/null @@ -1,323 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output; - -use think\Console; -use think\console\Command; -use think\console\input\Argument as InputArgument; -use think\console\input\Definition as InputDefinition; -use think\console\input\Option as InputOption; -use think\console\Output; -use think\console\output\descriptor\Console as ConsoleDescription; - -class Descriptor -{ - - /** - * @var Output - */ - protected $output; - - /** - * {@inheritdoc} - */ - public function describe(Output $output, $object, array $options = []) - { - $this->output = $output; - - switch (true) { - case $object instanceof InputArgument: - $this->describeInputArgument($object, $options); - break; - case $object instanceof InputOption: - $this->describeInputOption($object, $options); - break; - case $object instanceof InputDefinition: - $this->describeInputDefinition($object, $options); - break; - case $object instanceof Command: - $this->describeCommand($object, $options); - break; - case $object instanceof Console: - $this->describeConsole($object, $options); - break; - default: - throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object))); - } - } - - /** - * 输出内容 - * @param string $content - * @param bool $decorated - */ - protected function write($content, $decorated = false) - { - $this->output->write($content, false, $decorated ? Output::OUTPUT_NORMAL : Output::OUTPUT_RAW); - } - - /** - * 描述参数 - * @param InputArgument $argument - * @param array $options - * @return string|mixed - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - if (null !== $argument->getDefault() - && (!is_array($argument->getDefault()) - || count($argument->getDefault())) - ) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $totalWidth = $options['total_width'] ?? strlen($argument->getName()); - $spacingWidth = $totalWidth - strlen($argument->getName()) + 2; - - $this->writeText(sprintf(" %s%s%s%s", $argument->getName(), str_repeat(' ', $spacingWidth), // + 17 = 2 spaces + + + 2 spaces - preg_replace('/\s*\R\s*/', PHP_EOL . str_repeat(' ', $totalWidth + 17), $argument->getDescription()), $default), $options); - } - - /** - * 描述选项 - * @param InputOption $option - * @param array $options - * @return string|mixed - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - if ($option->acceptValue() && null !== $option->getDefault() - && (!is_array($option->getDefault()) - || count($option->getDefault())) - ) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - $value = ''; - if ($option->acceptValue()) { - $value = '=' . strtoupper($option->getName()); - - if ($option->isValueOptional()) { - $value = '[' . $value . ']'; - } - } - - $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = sprintf('%s%s', $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', sprintf('--%s%s', $option->getName(), $value)); - - $spacingWidth = $totalWidth - strlen($synopsis) + 2; - - $this->writeText(sprintf(" %s%s%s%s%s", $synopsis, str_repeat(' ', $spacingWidth), // + 17 = 2 spaces + + + 2 spaces - preg_replace('/\s*\R\s*/', "\n" . str_repeat(' ', $totalWidth + 17), $option->getDescription()), $default, $option->isArray() ? ' (multiple values allowed)' : ''), $options); - } - - /** - * 描述输入 - * @param InputDefinition $definition - * @param array $options - * @return string|mixed - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); - foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, strlen($argument->getName())); - } - - if ($definition->getArguments()) { - $this->writeText('Arguments:', $options); - $this->writeText("\n"); - foreach ($definition->getArguments() as $argument) { - $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); - $this->writeText("\n"); - } - } - - if ($definition->getArguments() && $definition->getOptions()) { - $this->writeText("\n"); - } - - if ($definition->getOptions()) { - $laterOptions = []; - - $this->writeText('Options:', $options); - foreach ($definition->getOptions() as $option) { - if (strlen($option->getShortcut()) > 1) { - $laterOptions[] = $option; - continue; - } - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - foreach ($laterOptions as $option) { - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - } - } - - /** - * 描述指令 - * @param Command $command - * @param array $options - * @return string|mixed - */ - protected function describeCommand(Command $command, array $options = []) - { - $command->getSynopsis(true); - $command->getSynopsis(false); - $command->mergeConsoleDefinition(false); - - $this->writeText('Usage:', $options); - foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { - $this->writeText("\n"); - $this->writeText(' ' . $usage, $options); - } - $this->writeText("\n"); - - $definition = $command->getNativeDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->writeText("\n"); - $this->describeInputDefinition($definition, $options); - $this->writeText("\n"); - } - - if ($help = $command->getProcessedHelp()) { - $this->writeText("\n"); - $this->writeText('Help:', $options); - $this->writeText("\n"); - $this->writeText(' ' . str_replace("\n", "\n ", $help), $options); - $this->writeText("\n"); - } - } - - /** - * 描述控制台 - * @param Console $console - * @param array $options - * @return string|mixed - */ - protected function describeConsole(Console $console, array $options = []) - { - $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; - $description = new ConsoleDescription($console, $describedNamespace); - - if (isset($options['raw_text']) && $options['raw_text']) { - $width = $this->getColumnWidth($description->getNamespaces()); - - foreach ($description->getCommands() as $command) { - $this->writeText(sprintf("%-${width}s %s", $command->getName(), $command->getDescription()), $options); - $this->writeText("\n"); - } - } else { - if ('' != $help = $console->getHelp()) { - $this->writeText("$help\n\n", $options); - } - - $this->writeText("Usage:\n", $options); - $this->writeText(" command [options] [arguments]\n\n", $options); - - $this->describeInputDefinition(new InputDefinition($console->getDefinition()->getOptions()), $options); - - $this->writeText("\n"); - $this->writeText("\n"); - - $width = $this->getColumnWidth($description->getNamespaces()); - - if ($describedNamespace) { - $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); - } else { - $this->writeText('Available commands:', $options); - } - - // add commands by namespace - foreach ($description->getNamespaces() as $namespace) { - if (!$describedNamespace && ConsoleDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->writeText("\n"); - $this->writeText(' ' . $namespace['id'] . '', $options); - } - - foreach ($namespace['commands'] as $name) { - $this->writeText("\n"); - $spacingWidth = $width - strlen($name); - $this->writeText(sprintf(" %s%s%s", $name, str_repeat(' ', $spacingWidth), $description->getCommand($name) - ->getDescription()), $options); - } - } - - $this->writeText("\n"); - } - } - - /** - * {@inheritdoc} - */ - private function writeText($content, array $options = []) - { - $this->write(isset($options['raw_text']) - && $options['raw_text'] ? strip_tags($content) : $content, isset($options['raw_output']) ? !$options['raw_output'] : true); - } - - /** - * 格式化 - * @param mixed $default - * @return string - */ - private function formatDefaultValue($default) - { - return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - /** - * @param Namespaces[] $namespaces - * @return int - */ - private function getColumnWidth(array $namespaces) - { - $width = 0; - foreach ($namespaces as $namespace) { - foreach ($namespace['commands'] as $name) { - if (strlen($name) > $width) { - $width = strlen($name); - } - } - } - - return $width + 2; - } - - /** - * @param InputOption[] $options - * @return int - */ - private function calculateTotalWidthForOptions($options) - { - $totalWidth = 0; - foreach ($options as $option) { - $nameLength = 4 + strlen($option->getName()) + 2; // - + shortcut + , + whitespace + name + -- - - if ($option->acceptValue()) { - $valueLength = 1 + strlen($option->getName()); // = + value - $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] - - $nameLength += $valueLength; - } - $totalWidth = max($totalWidth, $nameLength); - } - - return $totalWidth; - } -} diff --git a/vendor/topthink/framework/src/think/console/output/Formatter.php b/vendor/topthink/framework/src/think/console/output/Formatter.php deleted file mode 100644 index 1b97ca3..0000000 --- a/vendor/topthink/framework/src/think/console/output/Formatter.php +++ /dev/null @@ -1,198 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\console\output; - -use think\console\output\formatter\Stack as StyleStack; -use think\console\output\formatter\Style; - -class Formatter -{ - - private $decorated = false; - private $styles = []; - private $styleStack; - - /** - * 转义 - * @param string $text - * @return string - */ - public static function escape($text) - { - return preg_replace('/([^\\\\]?)setStyle('error', new Style('white', 'red')); - $this->setStyle('info', new Style('green')); - $this->setStyle('comment', new Style('yellow')); - $this->setStyle('question', new Style('black', 'cyan')); - $this->setStyle('highlight', new Style('red')); - $this->setStyle('warning', new Style('black', 'yellow')); - - $this->styleStack = new StyleStack(); - } - - /** - * 设置外观标识 - * @param bool $decorated 是否美化文字 - */ - public function setDecorated($decorated) - { - $this->decorated = (bool) $decorated; - } - - /** - * 获取外观标识 - * @return bool - */ - public function isDecorated() - { - return $this->decorated; - } - - /** - * 添加一个新样式 - * @param string $name 样式名 - * @param Style $style 样式实例 - */ - public function setStyle($name, Style $style) - { - $this->styles[strtolower($name)] = $style; - } - - /** - * 是否有这个样式 - * @param string $name - * @return bool - */ - public function hasStyle($name) - { - return isset($this->styles[strtolower($name)]); - } - - /** - * 获取样式 - * @param string $name - * @return Style - * @throws \InvalidArgumentException - */ - public function getStyle($name) - { - if (!$this->hasStyle($name)) { - throw new \InvalidArgumentException(sprintf('Undefined style: %s', $name)); - } - - return $this->styles[strtolower($name)]; - } - - /** - * 使用所给的样式格式化文字 - * @param string $message 文字 - * @return string - */ - public function format($message) - { - $offset = 0; - $output = ''; - $tagRegex = '[a-z][a-z0-9_=;-]*'; - preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE); - foreach ($matches[0] as $i => $match) { - $pos = $match[1]; - $text = $match[0]; - - if (0 != $pos && '\\' == $message[$pos - 1]) { - continue; - } - - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset)); - $offset = $pos + strlen($text); - - if ($open = '/' != $text[1]) { - $tag = $matches[1][$i][0]; - } else { - $tag = $matches[3][$i][0] ?? ''; - } - - if (!$open && !$tag) { - // - $this->styleStack->pop(); - } elseif (false === $style = $this->createStyleFromString(strtolower($tag))) { - $output .= $this->applyCurrentStyle($text); - } elseif ($open) { - $this->styleStack->push($style); - } else { - $this->styleStack->pop($style); - } - } - - $output .= $this->applyCurrentStyle(substr($message, $offset)); - - return str_replace('\\<', '<', $output); - } - - /** - * @return StyleStack - */ - public function getStyleStack() - { - return $this->styleStack; - } - - /** - * 根据字符串创建新的样式实例 - * @param string $string - * @return Style|bool - */ - private function createStyleFromString($string) - { - if (isset($this->styles[$string])) { - return $this->styles[$string]; - } - - if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) { - return false; - } - - $style = new Style(); - foreach ($matches as $match) { - array_shift($match); - - if ('fg' == $match[0]) { - $style->setForeground($match[1]); - } elseif ('bg' == $match[0]) { - $style->setBackground($match[1]); - } else { - try { - $style->setOption($match[1]); - } catch (\InvalidArgumentException $e) { - return false; - } - } - } - - return $style; - } - - /** - * 从堆栈应用样式到文字 - * @param string $text 文字 - * @return string - */ - private function applyCurrentStyle($text) - { - return $this->isDecorated() && strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text; - } -} diff --git a/vendor/topthink/framework/src/think/console/output/Question.php b/vendor/topthink/framework/src/think/console/output/Question.php deleted file mode 100644 index 03975f2..0000000 --- a/vendor/topthink/framework/src/think/console/output/Question.php +++ /dev/null @@ -1,211 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output; - -class Question -{ - - private $question; - private $attempts; - private $hidden = false; - private $hiddenFallback = true; - private $autocompleterValues; - private $validator; - private $default; - private $normalizer; - - /** - * 构造方法 - * @param string $question 问题 - * @param mixed $default 默认答案 - */ - public function __construct($question, $default = null) - { - $this->question = $question; - $this->default = $default; - } - - /** - * 获取问题 - * @return string - */ - public function getQuestion() - { - return $this->question; - } - - /** - * 获取默认答案 - * @return mixed - */ - public function getDefault() - { - return $this->default; - } - - /** - * 是否隐藏答案 - * @return bool - */ - public function isHidden() - { - return $this->hidden; - } - - /** - * 隐藏答案 - * @param bool $hidden - * @return Question - */ - public function setHidden($hidden) - { - if ($this->autocompleterValues) { - throw new \LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->hidden = (bool) $hidden; - - return $this; - } - - /** - * 不能被隐藏是否撤销 - * @return bool - */ - public function isHiddenFallback() - { - return $this->hiddenFallback; - } - - /** - * 设置不能被隐藏的时候的操作 - * @param bool $fallback - * @return Question - */ - public function setHiddenFallback($fallback) - { - $this->hiddenFallback = (bool) $fallback; - - return $this; - } - - /** - * 获取自动完成 - * @return null|array|\Traversable - */ - public function getAutocompleterValues() - { - return $this->autocompleterValues; - } - - /** - * 设置自动完成的值 - * @param null|array|\Traversable $values - * @return Question - * @throws \InvalidArgumentException - * @throws \LogicException - */ - public function setAutocompleterValues($values) - { - if (is_array($values) && $this->isAssoc($values)) { - $values = array_merge(array_keys($values), array_values($values)); - } - - if (null !== $values && !is_array($values)) { - if (!$values instanceof \Traversable || $values instanceof \Countable) { - throw new \InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.'); - } - } - - if ($this->hidden) { - throw new \LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->autocompleterValues = $values; - - return $this; - } - - /** - * 设置答案的验证器 - * @param null|callable $validator - * @return Question The current instance - */ - public function setValidator($validator) - { - $this->validator = $validator; - - return $this; - } - - /** - * 获取验证器 - * @return null|callable - */ - public function getValidator() - { - return $this->validator; - } - - /** - * 设置最大重试次数 - * @param null|int $attempts - * @return Question - * @throws \InvalidArgumentException - */ - public function setMaxAttempts($attempts) - { - if (null !== $attempts && $attempts < 1) { - throw new \InvalidArgumentException('Maximum number of attempts must be a positive value.'); - } - - $this->attempts = $attempts; - - return $this; - } - - /** - * 获取最大重试次数 - * @return null|int - */ - public function getMaxAttempts() - { - return $this->attempts; - } - - /** - * 设置响应的回调 - * @param string|\Closure $normalizer - * @return Question - */ - public function setNormalizer($normalizer) - { - $this->normalizer = $normalizer; - - return $this; - } - - /** - * 获取响应回调 - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. - * @return string|\Closure - */ - public function getNormalizer() - { - return $this->normalizer; - } - - protected function isAssoc($array) - { - return (bool) count(array_filter(array_keys($array), 'is_string')); - } -} diff --git a/vendor/topthink/framework/src/think/console/output/descriptor/Console.php b/vendor/topthink/framework/src/think/console/output/descriptor/Console.php deleted file mode 100644 index ff9f464..0000000 --- a/vendor/topthink/framework/src/think/console/output/descriptor/Console.php +++ /dev/null @@ -1,153 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\descriptor; - -use think\Console as ThinkConsole; -use think\console\Command; - -class Console -{ - - const GLOBAL_NAMESPACE = '_global'; - - /** - * @var ThinkConsole - */ - private $console; - - /** - * @var null|string - */ - private $namespace; - - /** - * @var array - */ - private $namespaces; - - /** - * @var Command[] - */ - private $commands; - - /** - * @var Command[] - */ - private $aliases; - - /** - * 构造方法 - * @param ThinkConsole $console - * @param string|null $namespace - */ - public function __construct(ThinkConsole $console, $namespace = null) - { - $this->console = $console; - $this->namespace = $namespace; - } - - /** - * @return array - */ - public function getNamespaces(): array - { - if (null === $this->namespaces) { - $this->inspectConsole(); - } - - return $this->namespaces; - } - - /** - * @return Command[] - */ - public function getCommands(): array - { - if (null === $this->commands) { - $this->inspectConsole(); - } - - return $this->commands; - } - - /** - * @param string $name - * @return Command - * @throws \InvalidArgumentException - */ - public function getCommand(string $name): Command - { - if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new \InvalidArgumentException(sprintf('Command %s does not exist.', $name)); - } - - return $this->commands[$name] ?? $this->aliases[$name]; - } - - private function inspectConsole(): void - { - $this->commands = []; - $this->namespaces = []; - - $all = $this->console->all($this->namespace ? $this->console->findNamespace($this->namespace) : null); - foreach ($this->sortCommands($all) as $namespace => $commands) { - $names = []; - - /** @var Command $command */ - foreach ($commands as $name => $command) { - if (is_string($command)) { - $command = new $command(); - } - - if (!$command->getName()) { - continue; - } - - if ($command->getName() === $name) { - $this->commands[$name] = $command; - } else { - $this->aliases[$name] = $command; - } - - $names[] = $name; - } - - $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; - } - } - - /** - * @param array $commands - * @return array - */ - private function sortCommands(array $commands): array - { - $namespacedCommands = []; - foreach ($commands as $name => $command) { - $key = $this->console->extractNamespace($name, 1); - if (!$key) { - $key = self::GLOBAL_NAMESPACE; - } - - $namespacedCommands[$key][$name] = $command; - } - ksort($namespacedCommands); - - foreach ($namespacedCommands as &$commandsSet) { - ksort($commandsSet); - } - // unset reference to keep scope clear - unset($commandsSet); - - return $namespacedCommands; - } -} diff --git a/vendor/topthink/framework/src/think/console/output/driver/Buffer.php b/vendor/topthink/framework/src/think/console/output/driver/Buffer.php deleted file mode 100644 index 576f31a..0000000 --- a/vendor/topthink/framework/src/think/console/output/driver/Buffer.php +++ /dev/null @@ -1,52 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\driver; - -use think\console\Output; - -class Buffer -{ - /** - * @var string - */ - private $buffer = ''; - - public function __construct(Output $output) - { - // do nothing - } - - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - return $content; - } - - public function write($messages, bool $newline = false, int $options = 0) - { - $messages = (array) $messages; - - foreach ($messages as $message) { - $this->buffer .= $message; - } - if ($newline) { - $this->buffer .= "\n"; - } - } - - public function renderException(\Throwable $e) - { - // do nothing - } - -} diff --git a/vendor/topthink/framework/src/think/console/output/driver/Console.php b/vendor/topthink/framework/src/think/console/output/driver/Console.php deleted file mode 100644 index 31bdf1f..0000000 --- a/vendor/topthink/framework/src/think/console/output/driver/Console.php +++ /dev/null @@ -1,368 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\driver; - -use think\console\Output; -use think\console\output\Formatter; - -class Console -{ - - /** @var Resource */ - private $stdout; - - /** @var Formatter */ - private $formatter; - - private $terminalDimensions; - - /** @var Output */ - private $output; - - public function __construct(Output $output) - { - $this->output = $output; - $this->formatter = new Formatter(); - $this->stdout = $this->openOutputStream(); - $decorated = $this->hasColorSupport($this->stdout); - $this->formatter->setDecorated($decorated); - } - - public function setDecorated($decorated) - { - $this->formatter->setDecorated($decorated); - } - - public function write($messages, bool $newline = false, int $type = 0, $stream = null) - { - if (Output::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - $messages = (array) $messages; - - foreach ($messages as $message) { - switch ($type) { - case Output::OUTPUT_NORMAL: - $message = $this->formatter->format($message); - break; - case Output::OUTPUT_RAW: - break; - case Output::OUTPUT_PLAIN: - $message = strip_tags($this->formatter->format($message)); - break; - default: - throw new \InvalidArgumentException(sprintf('Unknown output type given (%s)', $type)); - } - - $this->doWrite($message, $newline, $stream); - } - } - - public function renderException(\Throwable $e) - { - $stderr = $this->openErrorStream(); - $decorated = $this->hasColorSupport($stderr); - $this->formatter->setDecorated($decorated); - - do { - $title = sprintf(' [%s] ', get_class($e)); - - $len = $this->stringWidth($title); - - $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX; - - if (defined('HHVM_VERSION') && $width > 1 << 31) { - $width = 1 << 31; - } - $lines = []; - foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) { - foreach ($this->splitStringByWidth($line, $width - 4) as $line) { - - $lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $line)) + 4; - $lines[] = [$line, $lineLength]; - - $len = max($lineLength, $len); - } - } - - $messages = ['', '']; - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title)))); - foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', $line[0], str_repeat(' ', $len - $line[1])); - } - $messages[] = $emptyLine; - $messages[] = ''; - $messages[] = ''; - - $this->write($messages, true, Output::OUTPUT_NORMAL, $stderr); - - if (Output::VERBOSITY_VERBOSE <= $this->output->getVerbosity()) { - $this->write('Exception trace:', true, Output::OUTPUT_NORMAL, $stderr); - - // exception related properties - $trace = $e->getTrace(); - array_unshift($trace, [ - 'function' => '', - 'file' => $e->getFile() !== null ? $e->getFile() : 'n/a', - 'line' => $e->getLine() !== null ? $e->getLine() : 'n/a', - 'args' => [], - ]); - - for ($i = 0, $count = count($trace); $i < $count; ++$i) { - $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : ''; - $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : ''; - $function = $trace[$i]['function']; - $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a'; - $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a'; - - $this->write(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line), true, Output::OUTPUT_NORMAL, $stderr); - } - - $this->write('', true, Output::OUTPUT_NORMAL, $stderr); - $this->write('', true, Output::OUTPUT_NORMAL, $stderr); - } - } while ($e = $e->getPrevious()); - - } - - /** - * 获取终端宽度 - * @return int|null - */ - protected function getTerminalWidth() - { - $dimensions = $this->getTerminalDimensions(); - - return $dimensions[0]; - } - - /** - * 获取终端高度 - * @return int|null - */ - protected function getTerminalHeight() - { - $dimensions = $this->getTerminalDimensions(); - - return $dimensions[1]; - } - - /** - * 获取当前终端的尺寸 - * @return array - */ - public function getTerminalDimensions(): array - { - if ($this->terminalDimensions) { - return $this->terminalDimensions; - } - - if ('\\' === DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) { - return [(int) $matches[1], (int) $matches[2]]; - } - if (preg_match('/^(\d+)x(\d+)$/', $this->getMode(), $matches)) { - return [(int) $matches[1], (int) $matches[2]]; - } - } - - if ($sttyString = $this->getSttyColumns()) { - if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { - return [(int) $matches[2], (int) $matches[1]]; - } - if (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) { - return [(int) $matches[2], (int) $matches[1]]; - } - } - - return [null, null]; - } - - /** - * 获取stty列数 - * @return string - */ - private function getSttyColumns() - { - if (!function_exists('proc_open')) { - return; - } - - $descriptorspec = [1 => ['pipe', 'w'], 2 => ['pipe', 'w']]; - $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (is_resource($process)) { - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - return $info; - } - return; - } - - /** - * 获取终端模式 - * @return string x 或 null - */ - private function getMode() - { - if (!function_exists('proc_open')) { - return; - } - - $descriptorspec = [1 => ['pipe', 'w'], 2 => ['pipe', 'w']]; - $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (is_resource($process)) { - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - return $matches[2] . 'x' . $matches[1]; - } - } - return; - } - - private function stringWidth(string $string): int - { - if (!function_exists('mb_strwidth')) { - return strlen($string); - } - - if (false === $encoding = mb_detect_encoding($string)) { - return strlen($string); - } - - return mb_strwidth($string, $encoding); - } - - private function splitStringByWidth(string $string, int $width): array - { - if (!function_exists('mb_strwidth')) { - return str_split($string, $width); - } - - if (false === $encoding = mb_detect_encoding($string)) { - return str_split($string, $width); - } - - $utf8String = mb_convert_encoding($string, 'utf8', $encoding); - $lines = []; - $line = ''; - foreach (preg_split('//u', $utf8String) as $char) { - if (mb_strwidth($line . $char, 'utf8') <= $width) { - $line .= $char; - continue; - } - $lines[] = str_pad($line, $width); - $line = $char; - } - if (strlen($line)) { - $lines[] = count($lines) ? str_pad($line, $width) : $line; - } - - mb_convert_variables($encoding, 'utf8', $lines); - - return $lines; - } - - private function isRunningOS400(): bool - { - $checks = [ - function_exists('php_uname') ? php_uname('s') : '', - getenv('OSTYPE'), - PHP_OS, - ]; - return false !== stripos(implode(';', $checks), 'OS400'); - } - - /** - * 当前环境是否支持写入控制台输出到stdout. - * - * @return bool - */ - protected function hasStdoutSupport(): bool - { - return false === $this->isRunningOS400(); - } - - /** - * 当前环境是否支持写入控制台输出到stderr. - * - * @return bool - */ - protected function hasStderrSupport(): bool - { - return false === $this->isRunningOS400(); - } - - /** - * @return resource - */ - private function openOutputStream() - { - if (!$this->hasStdoutSupport()) { - return fopen('php://output', 'w'); - } - return @fopen('php://stdout', 'w') ?: fopen('php://output', 'w'); - } - - /** - * @return resource - */ - private function openErrorStream() - { - return fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w'); - } - - /** - * 将消息写入到输出。 - * @param string $message 消息 - * @param bool $newline 是否另起一行 - * @param null $stream - */ - protected function doWrite($message, $newline, $stream = null) - { - if (null === $stream) { - $stream = $this->stdout; - } - if (false === @fwrite($stream, $message . ($newline ? PHP_EOL : ''))) { - throw new \RuntimeException('Unable to write output.'); - } - - fflush($stream); - } - - /** - * 是否支持着色 - * @param $stream - * @return bool - */ - protected function hasColorSupport($stream): bool - { - if (DIRECTORY_SEPARATOR === '\\') { - return - '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); - } - - return function_exists('posix_isatty') && @posix_isatty($stream); - } - -} diff --git a/vendor/topthink/framework/src/think/console/output/driver/Nothing.php b/vendor/topthink/framework/src/think/console/output/driver/Nothing.php deleted file mode 100644 index a7cc49e..0000000 --- a/vendor/topthink/framework/src/think/console/output/driver/Nothing.php +++ /dev/null @@ -1,33 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\driver; - -use think\console\Output; - -class Nothing -{ - - public function __construct(Output $output) - { - // do nothing - } - - public function write($messages, bool $newline = false, int $options = 0) - { - // do nothing - } - - public function renderException(\Throwable $e) - { - // do nothing - } -} diff --git a/vendor/topthink/framework/src/think/console/output/formatter/Stack.php b/vendor/topthink/framework/src/think/console/output/formatter/Stack.php deleted file mode 100644 index 5366259..0000000 --- a/vendor/topthink/framework/src/think/console/output/formatter/Stack.php +++ /dev/null @@ -1,116 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\formatter; - -class Stack -{ - - /** - * @var Style[] - */ - private $styles; - - /** - * @var Style - */ - private $emptyStyle; - - /** - * 构造方法 - * @param Style|null $emptyStyle - */ - public function __construct(Style $emptyStyle = null) - { - $this->emptyStyle = $emptyStyle ?: new Style(); - $this->reset(); - } - - /** - * 重置堆栈 - */ - public function reset(): void - { - $this->styles = []; - } - - /** - * 推一个样式进入堆栈 - * @param Style $style - */ - public function push(Style $style): void - { - $this->styles[] = $style; - } - - /** - * 从堆栈中弹出一个样式 - * @param Style|null $style - * @return Style - * @throws \InvalidArgumentException - */ - public function pop(Style $style = null): Style - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - if (null === $style) { - return array_pop($this->styles); - } - - /** - * @var int $index - * @var Style $stackedStyle - */ - foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { - if ($style->apply('') === $stackedStyle->apply('')) { - $this->styles = array_slice($this->styles, 0, $index); - - return $stackedStyle; - } - } - - throw new \InvalidArgumentException('Incorrectly nested style tag found.'); - } - - /** - * 计算堆栈的当前样式。 - * @return Style - */ - public function getCurrent(): Style - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - return $this->styles[count($this->styles) - 1]; - } - - /** - * @param Style $emptyStyle - * @return Stack - */ - public function setEmptyStyle(Style $emptyStyle) - { - $this->emptyStyle = $emptyStyle; - - return $this; - } - - /** - * @return Style - */ - public function getEmptyStyle(): Style - { - return $this->emptyStyle; - } -} diff --git a/vendor/topthink/framework/src/think/console/output/formatter/Style.php b/vendor/topthink/framework/src/think/console/output/formatter/Style.php deleted file mode 100644 index 2aae768..0000000 --- a/vendor/topthink/framework/src/think/console/output/formatter/Style.php +++ /dev/null @@ -1,190 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\formatter; - -class Style -{ - protected static $availableForegroundColors = [ - 'black' => ['set' => 30, 'unset' => 39], - 'red' => ['set' => 31, 'unset' => 39], - 'green' => ['set' => 32, 'unset' => 39], - 'yellow' => ['set' => 33, 'unset' => 39], - 'blue' => ['set' => 34, 'unset' => 39], - 'magenta' => ['set' => 35, 'unset' => 39], - 'cyan' => ['set' => 36, 'unset' => 39], - 'white' => ['set' => 37, 'unset' => 39], - ]; - - protected static $availableBackgroundColors = [ - 'black' => ['set' => 40, 'unset' => 49], - 'red' => ['set' => 41, 'unset' => 49], - 'green' => ['set' => 42, 'unset' => 49], - 'yellow' => ['set' => 43, 'unset' => 49], - 'blue' => ['set' => 44, 'unset' => 49], - 'magenta' => ['set' => 45, 'unset' => 49], - 'cyan' => ['set' => 46, 'unset' => 49], - 'white' => ['set' => 47, 'unset' => 49], - ]; - - protected static $availableOptions = [ - 'bold' => ['set' => 1, 'unset' => 22], - 'underscore' => ['set' => 4, 'unset' => 24], - 'blink' => ['set' => 5, 'unset' => 25], - 'reverse' => ['set' => 7, 'unset' => 27], - 'conceal' => ['set' => 8, 'unset' => 28], - ]; - - private $foreground; - private $background; - private $options = []; - - /** - * 初始化输出的样式 - * @param string|null $foreground 字体颜色 - * @param string|null $background 背景色 - * @param array $options 格式 - * @api - */ - public function __construct($foreground = null, $background = null, array $options = []) - { - if (null !== $foreground) { - $this->setForeground($foreground); - } - if (null !== $background) { - $this->setBackground($background); - } - if (count($options)) { - $this->setOptions($options); - } - } - - /** - * 设置字体颜色 - * @param string|null $color 颜色名 - * @throws \InvalidArgumentException - * @api - */ - public function setForeground($color = null) - { - if (null === $color) { - $this->foreground = null; - - return; - } - - if (!isset(static::$availableForegroundColors[$color])) { - throw new \InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableForegroundColors)))); - } - - $this->foreground = static::$availableForegroundColors[$color]; - } - - /** - * 设置背景色 - * @param string|null $color 颜色名 - * @throws \InvalidArgumentException - * @api - */ - public function setBackground($color = null) - { - if (null === $color) { - $this->background = null; - - return; - } - - if (!isset(static::$availableBackgroundColors[$color])) { - throw new \InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableBackgroundColors)))); - } - - $this->background = static::$availableBackgroundColors[$color]; - } - - /** - * 设置字体格式 - * @param string $option 格式名 - * @throws \InvalidArgumentException When the option name isn't defined - * @api - */ - public function setOption(string $option): void - { - if (!isset(static::$availableOptions[$option])) { - throw new \InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions)))); - } - - if (!in_array(static::$availableOptions[$option], $this->options)) { - $this->options[] = static::$availableOptions[$option]; - } - } - - /** - * 重置字体格式 - * @param string $option 格式名 - * @throws \InvalidArgumentException - */ - public function unsetOption(string $option): void - { - if (!isset(static::$availableOptions[$option])) { - throw new \InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions)))); - } - - $pos = array_search(static::$availableOptions[$option], $this->options); - if (false !== $pos) { - unset($this->options[$pos]); - } - } - - /** - * 批量设置字体格式 - * @param array $options - */ - public function setOptions(array $options) - { - $this->options = []; - - foreach ($options as $option) { - $this->setOption($option); - } - } - - /** - * 应用样式到文字 - * @param string $text 文字 - * @return string - */ - public function apply(string $text): string - { - $setCodes = []; - $unsetCodes = []; - - if (null !== $this->foreground) { - $setCodes[] = $this->foreground['set']; - $unsetCodes[] = $this->foreground['unset']; - } - if (null !== $this->background) { - $setCodes[] = $this->background['set']; - $unsetCodes[] = $this->background['unset']; - } - if (count($this->options)) { - foreach ($this->options as $option) { - $setCodes[] = $option['set']; - $unsetCodes[] = $option['unset']; - } - } - - if (0 === count($setCodes)) { - return $text; - } - - return sprintf("\033[%sm%s\033[%sm", implode(';', $setCodes), $text, implode(';', $unsetCodes)); - } -} diff --git a/vendor/topthink/framework/src/think/console/output/question/Choice.php b/vendor/topthink/framework/src/think/console/output/question/Choice.php deleted file mode 100644 index 1da1750..0000000 --- a/vendor/topthink/framework/src/think/console/output/question/Choice.php +++ /dev/null @@ -1,163 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\question; - -use think\console\output\Question; - -class Choice extends Question -{ - - private $choices; - private $multiselect = false; - private $prompt = ' > '; - private $errorMessage = 'Value "%s" is invalid'; - - /** - * 构造方法 - * @param string $question 问题 - * @param array $choices 选项 - * @param mixed $default 默认答案 - */ - public function __construct($question, array $choices, $default = null) - { - parent::__construct($question, $default); - - $this->choices = $choices; - $this->setValidator($this->getDefaultValidator()); - $this->setAutocompleterValues($choices); - } - - /** - * 可选项 - * @return array - */ - public function getChoices(): array - { - return $this->choices; - } - - /** - * 设置可否多选 - * @param bool $multiselect - * @return self - */ - public function setMultiselect(bool $multiselect) - { - $this->multiselect = $multiselect; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - public function isMultiselect(): bool - { - return $this->multiselect; - } - - /** - * 获取提示 - * @return string - */ - public function getPrompt(): string - { - return $this->prompt; - } - - /** - * 设置提示 - * @param string $prompt - * @return self - */ - public function setPrompt(string $prompt) - { - $this->prompt = $prompt; - - return $this; - } - - /** - * 设置错误提示信息 - * @param string $errorMessage - * @return self - */ - public function setErrorMessage(string $errorMessage) - { - $this->errorMessage = $errorMessage; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - /** - * 获取默认的验证方法 - * @return callable - */ - private function getDefaultValidator() - { - $choices = $this->choices; - $errorMessage = $this->errorMessage; - $multiselect = $this->multiselect; - $isAssoc = $this->isAssoc($choices); - - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { - // Collapse all spaces. - $selectedChoices = str_replace(' ', '', $selected); - - if ($multiselect) { - // Check for a separated comma values - if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { - throw new \InvalidArgumentException(sprintf($errorMessage, $selected)); - } - $selectedChoices = explode(',', $selectedChoices); - } else { - $selectedChoices = [$selected]; - } - - $multiselectChoices = []; - foreach ($selectedChoices as $value) { - $results = []; - foreach ($choices as $key => $choice) { - if ($choice === $value) { - $results[] = $key; - } - } - - if (count($results) > 1) { - throw new \InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results))); - } - - $result = array_search($value, $choices); - - if (!$isAssoc) { - if (!empty($result)) { - $result = $choices[$result]; - } elseif (isset($choices[$value])) { - $result = $choices[$value]; - } - } elseif (empty($result) && array_key_exists($value, $choices)) { - $result = $value; - } - - if (false === $result) { - throw new \InvalidArgumentException(sprintf($errorMessage, $value)); - } - array_push($multiselectChoices, $result); - } - - if ($multiselect) { - return $multiselectChoices; - } - - return current($multiselectChoices); - }; - } -} diff --git a/vendor/topthink/framework/src/think/console/output/question/Confirmation.php b/vendor/topthink/framework/src/think/console/output/question/Confirmation.php deleted file mode 100644 index bf71b5d..0000000 --- a/vendor/topthink/framework/src/think/console/output/question/Confirmation.php +++ /dev/null @@ -1,57 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\console\output\question; - -use think\console\output\Question; - -class Confirmation extends Question -{ - - private $trueAnswerRegex; - - /** - * 构造方法 - * @param string $question 问题 - * @param bool $default 默认答案 - * @param string $trueAnswerRegex 验证正则 - */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') - { - parent::__construct($question, (bool) $default); - - $this->trueAnswerRegex = $trueAnswerRegex; - $this->setNormalizer($this->getDefaultNormalizer()); - } - - /** - * 获取默认的答案回调 - * @return callable - */ - private function getDefaultNormalizer() - { - $default = $this->getDefault(); - $regex = $this->trueAnswerRegex; - - return function ($answer) use ($default, $regex) { - if (is_bool($answer)) { - return $answer; - } - - $answerIsTrue = (bool) preg_match($regex, $answer); - if (false === $default) { - return $answer && $answerIsTrue; - } - - return !$answer || $answerIsTrue; - }; - } -} diff --git a/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php b/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php deleted file mode 100644 index da5e696..0000000 --- a/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php +++ /dev/null @@ -1,88 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\contract; - -/** - * 缓存驱动接口 - */ -interface CacheHandlerInterface -{ - /** - * 判断缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function has($name); - - /** - * 读取缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $default 默认值 - * @return mixed - */ - public function get($name, $default = null); - - /** - * 写入缓存 - * @access public - * @param string $name 缓存变量名 - * @param mixed $value 存储数据 - * @param integer|\DateTime $expire 有效时间(秒) - * @return bool - */ - public function set($name, $value, $expire = null); - - /** - * 自增缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function inc(string $name, int $step = 1); - - /** - * 自减缓存(针对数值缓存) - * @access public - * @param string $name 缓存变量名 - * @param int $step 步长 - * @return false|int - */ - public function dec(string $name, int $step = 1); - - /** - * 删除缓存 - * @access public - * @param string $name 缓存变量名 - * @return bool - */ - public function delete($name); - - /** - * 清除缓存 - * @access public - * @return bool - */ - public function clear(); - - /** - * 删除缓存标签 - * @access public - * @param array $keys 缓存标识列表 - * @return void - */ - public function clearTag(array $keys); - -} diff --git a/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php b/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php deleted file mode 100644 index 896ac29..0000000 --- a/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\contract; - -/** - * 日志驱动接口 - */ -interface LogHandlerInterface -{ - /** - * 日志写入接口 - * @access public - * @param array $log 日志信息 - * @return bool - */ - public function save(array $log): bool; - -} diff --git a/vendor/topthink/framework/src/think/contract/ModelRelationInterface.php b/vendor/topthink/framework/src/think/contract/ModelRelationInterface.php deleted file mode 100644 index 1f6f994..0000000 --- a/vendor/topthink/framework/src/think/contract/ModelRelationInterface.php +++ /dev/null @@ -1,99 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\contract; - -use Closure; -use think\Collection; -use think\db\Query; -use think\Model; - -/** - * 模型关联接口 - */ -interface ModelRelationInterface -{ - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联 - * @param Closure $closure 闭包查询条件 - * @return Collection - */ - public function getRelation(array $subRelation = [], Closure $closure = null): Collection; - - /** - * 预载入关联查询 - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包条件 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation, Closure $closure = null): void; - - /** - * 预载入关联查询 - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包条件 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null): void; - - /** - * 关联统计 - * @access public - * @param Model $result 模型对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return integer - */ - public function relationCount(Model $result, Closure $closure, string $aggregate = 'count', string $field = '*', string &$name = null); - - /** - * 创建关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string; - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = 'INNER'): Query; - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @return Query - */ - public function hasWhere($where = [], $fields = null, string $joinType = ''): Query; -} diff --git a/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php b/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php deleted file mode 100644 index 0b2e414..0000000 --- a/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\contract; - -/** - * Session驱动接口 - */ -interface SessionHandlerInterface -{ - public function read(string $sessionId): string; - public function delete(string $sessionId): bool; - public function write(string $sessionId, string $data): bool; -} diff --git a/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php b/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php deleted file mode 100644 index 9be93d2..0000000 --- a/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php +++ /dev/null @@ -1,61 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\contract; - -/** - * 视图驱动接口 - */ -interface TemplateHandlerInterface -{ - /** - * 检测是否存在模板文件 - * @access public - * @param string $template 模板文件或者模板规则 - * @return bool - */ - public function exists(string $template): bool; - - /** - * 渲染模板文件 - * @access public - * @param string $template 模板文件 - * @param array $data 模板变量 - * @return void - */ - public function fetch(string $template, array $data = []): void; - - /** - * 渲染模板内容 - * @access public - * @param string $content 模板内容 - * @param array $data 模板变量 - * @return void - */ - public function display(string $content, array $data = []): void; - - /** - * 配置模板引擎 - * @access private - * @param array $config 参数 - * @return void - */ - public function config(array $config): void; - - /** - * 获取模板引擎配置 - * @access public - * @param string $name 参数名 - * @return void - */ - public function getConfig(string $name); -} diff --git a/vendor/topthink/framework/src/think/event/AppInit.php b/vendor/topthink/framework/src/think/event/AppInit.php deleted file mode 100644 index dda820b..0000000 --- a/vendor/topthink/framework/src/think/event/AppInit.php +++ /dev/null @@ -1,19 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\event; - -/** - * AppInit事件类 - */ -class AppInit -{} diff --git a/vendor/topthink/framework/src/think/event/HttpEnd.php b/vendor/topthink/framework/src/think/event/HttpEnd.php deleted file mode 100644 index c40da57..0000000 --- a/vendor/topthink/framework/src/think/event/HttpEnd.php +++ /dev/null @@ -1,19 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\event; - -/** - * HttpEnd事件类 - */ -class HttpEnd -{} diff --git a/vendor/topthink/framework/src/think/event/HttpRun.php b/vendor/topthink/framework/src/think/event/HttpRun.php deleted file mode 100644 index ce67e93..0000000 --- a/vendor/topthink/framework/src/think/event/HttpRun.php +++ /dev/null @@ -1,19 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\event; - -/** - * HttpRun事件类 - */ -class HttpRun -{} diff --git a/vendor/topthink/framework/src/think/event/LogWrite.php b/vendor/topthink/framework/src/think/event/LogWrite.php deleted file mode 100644 index a787301..0000000 --- a/vendor/topthink/framework/src/think/event/LogWrite.php +++ /dev/null @@ -1,31 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\event; - -/** - * LogWrite事件类 - */ -class LogWrite -{ - /** @var string */ - public $channel; - - /** @var array */ - public $log; - - public function __construct($channel, $log) - { - $this->channel = $channel; - $this->log = $log; - } -} diff --git a/vendor/topthink/framework/src/think/event/RouteLoaded.php b/vendor/topthink/framework/src/think/event/RouteLoaded.php deleted file mode 100644 index ace7992..0000000 --- a/vendor/topthink/framework/src/think/event/RouteLoaded.php +++ /dev/null @@ -1,21 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\event; - -/** - * 路由加载完成事件 - */ -class RouteLoaded -{ - -} diff --git a/vendor/topthink/framework/src/think/exception/ClassNotFoundException.php b/vendor/topthink/framework/src/think/exception/ClassNotFoundException.php deleted file mode 100644 index c4cda77..0000000 --- a/vendor/topthink/framework/src/think/exception/ClassNotFoundException.php +++ /dev/null @@ -1,39 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\exception; - -use Psr\Container\NotFoundExceptionInterface; -use RuntimeException; -use Throwable; - -class ClassNotFoundException extends RuntimeException implements NotFoundExceptionInterface -{ - protected $class; - - public function __construct(string $message, string $class = '', Throwable $previous = null) - { - $this->message = $message; - $this->class = $class; - - parent::__construct($message, 0, $previous); - } - - /** - * 获取类名 - * @access public - * @return string - */ - public function getClass() - { - return $this->class; - } -} diff --git a/vendor/topthink/framework/src/think/exception/ErrorException.php b/vendor/topthink/framework/src/think/exception/ErrorException.php deleted file mode 100644 index d1a2378..0000000 --- a/vendor/topthink/framework/src/think/exception/ErrorException.php +++ /dev/null @@ -1,57 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\exception; - -use think\Exception; - -/** - * ThinkPHP错误异常 - * 主要用于封装 set_error_handler 和 register_shutdown_function 得到的错误 - * 除开从 think\Exception 继承的功能 - * 其他和PHP系统\ErrorException功能基本一样 - */ -class ErrorException extends Exception -{ - /** - * 用于保存错误级别 - * @var integer - */ - protected $severity; - - /** - * 错误异常构造函数 - * @access public - * @param integer $severity 错误级别 - * @param string $message 错误详细信息 - * @param string $file 出错文件路径 - * @param integer $line 出错行号 - */ - public function __construct(int $severity, string $message, string $file, int $line) - { - $this->severity = $severity; - $this->message = $message; - $this->file = $file; - $this->line = $line; - $this->code = 0; - } - - /** - * 获取错误级别 - * @access public - * @return integer 错误级别 - */ - final public function getSeverity() - { - return $this->severity; - } -} diff --git a/vendor/topthink/framework/src/think/exception/FileException.php b/vendor/topthink/framework/src/think/exception/FileException.php deleted file mode 100644 index 228a189..0000000 --- a/vendor/topthink/framework/src/think/exception/FileException.php +++ /dev/null @@ -1,17 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\exception; - -class FileException extends \RuntimeException -{ -} diff --git a/vendor/topthink/framework/src/think/exception/FuncNotFoundException.php b/vendor/topthink/framework/src/think/exception/FuncNotFoundException.php deleted file mode 100644 index ee2bcad..0000000 --- a/vendor/topthink/framework/src/think/exception/FuncNotFoundException.php +++ /dev/null @@ -1,30 +0,0 @@ -message = $message; - $this->func = $func; - - parent::__construct($message, 0, $previous); - } - - /** - * 获取方法名 - * @access public - * @return string - */ - public function getFunc() - { - return $this->func; - } -} diff --git a/vendor/topthink/framework/src/think/exception/Handle.php b/vendor/topthink/framework/src/think/exception/Handle.php deleted file mode 100644 index 1f783bc..0000000 --- a/vendor/topthink/framework/src/think/exception/Handle.php +++ /dev/null @@ -1,332 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\exception; - -use Exception; -use think\App; -use think\console\Output; -use think\db\exception\DataNotFoundException; -use think\db\exception\ModelNotFoundException; -use think\Request; -use think\Response; -use Throwable; - -/** - * 系统异常处理类 - */ -class Handle -{ - /** @var App */ - protected $app; - - protected $ignoreReport = [ - HttpException::class, - HttpResponseException::class, - ModelNotFoundException::class, - DataNotFoundException::class, - ValidateException::class, - ]; - - protected $isJson = false; - - public function __construct(App $app) - { - $this->app = $app; - } - - /** - * Report or log an exception. - * - * @access public - * @param Throwable $exception - * @return void - */ - public function report(Throwable $exception): void - { - if (!$this->isIgnoreReport($exception)) { - // 收集异常数据 - if ($this->app->isDebug()) { - $data = [ - 'file' => $exception->getFile(), - 'line' => $exception->getLine(), - 'message' => $this->getMessage($exception), - 'code' => $this->getCode($exception), - ]; - $log = "[{$data['code']}]{$data['message']}[{$data['file']}:{$data['line']}]"; - } else { - $data = [ - 'code' => $this->getCode($exception), - 'message' => $this->getMessage($exception), - ]; - $log = "[{$data['code']}]{$data['message']}"; - } - - if ($this->app->config->get('log.record_trace')) { - $log .= PHP_EOL . $exception->getTraceAsString(); - } - - try { - $this->app->log->record($log, 'error'); - } catch (Exception $e) {} - } - } - - protected function isIgnoreReport(Throwable $exception): bool - { - foreach ($this->ignoreReport as $class) { - if ($exception instanceof $class) { - return true; - } - } - - return false; - } - - /** - * Render an exception into an HTTP response. - * - * @access public - * @param Request $request - * @param Throwable $e - * @return Response - */ - public function render($request, Throwable $e): Response - { - $this->isJson = $request->isJson(); - if ($e instanceof HttpResponseException) { - return $e->getResponse(); - } elseif ($e instanceof HttpException) { - return $this->renderHttpException($e); - } else { - return $this->convertExceptionToResponse($e); - } - } - - /** - * @access public - * @param Output $output - * @param Throwable $e - */ - public function renderForConsole(Output $output, Throwable $e): void - { - if ($this->app->isDebug()) { - $output->setVerbosity(Output::VERBOSITY_DEBUG); - } - - $output->renderException($e); - } - - /** - * @access protected - * @param HttpException $e - * @return Response - */ - protected function renderHttpException(HttpException $e): Response - { - $status = $e->getStatusCode(); - $template = $this->app->config->get('app.http_exception_template'); - - if (!$this->app->isDebug() && !empty($template[$status])) { - return Response::create($template[$status], 'view', $status)->assign(['e' => $e]); - } else { - return $this->convertExceptionToResponse($e); - } - } - - /** - * 收集异常数据 - * @param Throwable $exception - * @return array - */ - protected function convertExceptionToArray(Throwable $exception): array - { - if ($this->app->isDebug()) { - // 调试模式,获取详细的错误信息 - $traces = []; - $nextException = $exception; - do { - $traces[] = [ - 'name' => get_class($nextException), - 'file' => $nextException->getFile(), - 'line' => $nextException->getLine(), - 'code' => $this->getCode($nextException), - 'message' => $this->getMessage($nextException), - 'trace' => $nextException->getTrace(), - 'source' => $this->getSourceCode($nextException), - ]; - } while ($nextException = $nextException->getPrevious()); - $data = [ - 'code' => $this->getCode($exception), - 'message' => $this->getMessage($exception), - 'traces' => $traces, - 'datas' => $this->getExtendData($exception), - 'tables' => [ - 'GET Data' => $this->app->request->get(), - 'POST Data' => $this->app->request->post(), - 'Files' => $this->app->request->file(), - 'Cookies' => $this->app->request->cookie(), - 'Session' => $this->app->exists('session') ? $this->app->session->all() : [], - 'Server/Request Data' => $this->app->request->server(), - ], - ]; - } else { - // 部署模式仅显示 Code 和 Message - $data = [ - 'code' => $this->getCode($exception), - 'message' => $this->getMessage($exception), - ]; - - if (!$this->app->config->get('app.show_error_msg')) { - // 不显示详细错误信息 - $data['message'] = $this->app->config->get('app.error_message'); - } - } - - return $data; - } - - /** - * @access protected - * @param Throwable $exception - * @return Response - */ - protected function convertExceptionToResponse(Throwable $exception): Response - { - if (!$this->isJson) { - $response = Response::create($this->renderExceptionContent($exception)); - } else { - $response = Response::create($this->convertExceptionToArray($exception), 'json'); - } - - if ($exception instanceof HttpException) { - $statusCode = $exception->getStatusCode(); - $response->header($exception->getHeaders()); - } - - return $response->code($statusCode ?? 500); - } - - protected function renderExceptionContent(Throwable $exception): string - { - ob_start(); - $data = $this->convertExceptionToArray($exception); - extract($data); - include $this->app->config->get('app.exception_tmpl') ?: __DIR__ . '/../../tpl/think_exception.tpl'; - - return ob_get_clean(); - } - - /** - * 获取错误编码 - * ErrorException则使用错误级别作为错误编码 - * @access protected - * @param Throwable $exception - * @return integer 错误编码 - */ - protected function getCode(Throwable $exception) - { - $code = $exception->getCode(); - - if (!$code && $exception instanceof ErrorException) { - $code = $exception->getSeverity(); - } - - return $code; - } - - /** - * 获取错误信息 - * ErrorException则使用错误级别作为错误编码 - * @access protected - * @param Throwable $exception - * @return string 错误信息 - */ - protected function getMessage(Throwable $exception): string - { - $message = $exception->getMessage(); - - if ($this->app->runningInConsole()) { - return $message; - } - - $lang = $this->app->lang; - - if (strpos($message, ':')) { - $name = strstr($message, ':', true); - $message = $lang->has($name) ? $lang->get($name) . strstr($message, ':') : $message; - } elseif (strpos($message, ',')) { - $name = strstr($message, ',', true); - $message = $lang->has($name) ? $lang->get($name) . ':' . substr(strstr($message, ','), 1) : $message; - } elseif ($lang->has($message)) { - $message = $lang->get($message); - } - - return $message; - } - - /** - * 获取出错文件内容 - * 获取错误的前9行和后9行 - * @access protected - * @param Throwable $exception - * @return array 错误文件内容 - */ - protected function getSourceCode(Throwable $exception): array - { - // 读取前9行和后9行 - $line = $exception->getLine(); - $first = ($line - 9 > 0) ? $line - 9 : 1; - - try { - $contents = file($exception->getFile()) ?: []; - $source = [ - 'first' => $first, - 'source' => array_slice($contents, $first - 1, 19), - ]; - } catch (Exception $e) { - $source = []; - } - - return $source; - } - - /** - * 获取异常扩展信息 - * 用于非调试模式html返回类型显示 - * @access protected - * @param Throwable $exception - * @return array 异常类定义的扩展数据 - */ - protected function getExtendData(Throwable $exception): array - { - $data = []; - - if ($exception instanceof \think\Exception) { - $data = $exception->getData(); - } - - return $data; - } - - /** - * 获取常量列表 - * @access protected - * @return array 常量列表 - */ - protected function getConst(): array - { - $const = get_defined_constants(true); - - return $const['user'] ?? []; - } -} diff --git a/vendor/topthink/framework/src/think/exception/HttpException.php b/vendor/topthink/framework/src/think/exception/HttpException.php deleted file mode 100644 index 45302e5..0000000 --- a/vendor/topthink/framework/src/think/exception/HttpException.php +++ /dev/null @@ -1,42 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\exception; - -use Exception; - -/** - * HTTP异常 - */ -class HttpException extends \RuntimeException -{ - private $statusCode; - private $headers; - - public function __construct(int $statusCode, string $message = '', Exception $previous = null, array $headers = [], $code = 0) - { - $this->statusCode = $statusCode; - $this->headers = $headers; - - parent::__construct($message, $code, $previous); - } - - public function getStatusCode() - { - return $this->statusCode; - } - - public function getHeaders() - { - return $this->headers; - } -} diff --git a/vendor/topthink/framework/src/think/exception/HttpResponseException.php b/vendor/topthink/framework/src/think/exception/HttpResponseException.php deleted file mode 100644 index 607813d..0000000 --- a/vendor/topthink/framework/src/think/exception/HttpResponseException.php +++ /dev/null @@ -1,37 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\exception; - -use think\Response; - -/** - * HTTP响应异常 - */ -class HttpResponseException extends \RuntimeException -{ - /** - * @var Response - */ - protected $response; - - public function __construct(Response $response) - { - $this->response = $response; - } - - public function getResponse() - { - return $this->response; - } - -} diff --git a/vendor/topthink/framework/src/think/exception/InvalidArgumentException.php b/vendor/topthink/framework/src/think/exception/InvalidArgumentException.php deleted file mode 100644 index 8ccd6f6..0000000 --- a/vendor/topthink/framework/src/think/exception/InvalidArgumentException.php +++ /dev/null @@ -1,22 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); -namespace think\exception; - -use Psr\Cache\InvalidArgumentException as Psr6CacheInvalidArgumentInterface; -use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInvalidArgumentInterface; - -/** - * 非法数据异常 - */ -class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInvalidArgumentInterface, SimpleCacheInvalidArgumentInterface -{ -} diff --git a/vendor/topthink/framework/src/think/exception/RouteNotFoundException.php b/vendor/topthink/framework/src/think/exception/RouteNotFoundException.php deleted file mode 100644 index 7a2ee87..0000000 --- a/vendor/topthink/framework/src/think/exception/RouteNotFoundException.php +++ /dev/null @@ -1,26 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\exception; - -/** - * 路由未定义异常 - */ -class RouteNotFoundException extends HttpException -{ - - public function __construct() - { - parent::__construct(404, 'Route Not Found'); - } - -} diff --git a/vendor/topthink/framework/src/think/exception/ValidateException.php b/vendor/topthink/framework/src/think/exception/ValidateException.php deleted file mode 100644 index 89b4e4d..0000000 --- a/vendor/topthink/framework/src/think/exception/ValidateException.php +++ /dev/null @@ -1,37 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\exception; - -/** - * 数据验证异常 - */ -class ValidateException extends \RuntimeException -{ - protected $error; - - public function __construct($error) - { - $this->error = $error; - $this->message = is_array($error) ? implode(PHP_EOL, $error) : $error; - } - - /** - * 获取验证错误信息 - * @access public - * @return array|string - */ - public function getError() - { - return $this->error; - } -} diff --git a/vendor/topthink/framework/src/think/facade/App.php b/vendor/topthink/framework/src/think/facade/App.php deleted file mode 100644 index e9f8105..0000000 --- a/vendor/topthink/framework/src/think/facade/App.php +++ /dev/null @@ -1,59 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\App - * @package think\facade - * @mixin \think\App - * @method static \think\Service|null register(\think\Service|string $service, bool $force = false) 注册服务 - * @method static mixed bootService(\think\Service $service) 执行服务 - * @method static \think\Service|null getService(string|\think\Service $service) 获取服务 - * @method static \think\App debug(bool $debug = true) 开启应用调试模式 - * @method static bool isDebug() 是否为调试模式 - * @method static \think\App setNamespace(string $namespace) 设置应用命名空间 - * @method static string getNamespace() 获取应用类库命名空间 - * @method static string version() 获取框架版本 - * @method static string getRootPath() 获取应用根目录 - * @method static string getBasePath() 获取应用基础目录 - * @method static string getAppPath() 获取当前应用目录 - * @method static mixed setAppPath(string $path) 设置应用目录 - * @method static string getRuntimePath() 获取应用运行时目录 - * @method static void setRuntimePath(string $path) 设置runtime目录 - * @method static string getThinkPath() 获取核心框架目录 - * @method static string getConfigPath() 获取应用配置目录 - * @method static string getConfigExt() 获取配置后缀 - * @method static float getBeginTime() 获取应用开启时间 - * @method static integer getBeginMem() 获取应用初始内存占用 - * @method static \think\App initialize() 初始化应用 - * @method static bool initialized() 是否初始化过 - * @method static void loadLangPack(string $langset) 加载语言包 - * @method static void boot() 引导应用 - * @method static void loadEvent(array $event) 注册应用事件 - * @method static string parseClass(string $layer, string $name) 解析应用类的类名 - * @method static bool runningInConsole() 是否运行在命令行下 - */ -class App extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'app'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Cache.php b/vendor/topthink/framework/src/think/facade/Cache.php deleted file mode 100644 index aac105d..0000000 --- a/vendor/topthink/framework/src/think/facade/Cache.php +++ /dev/null @@ -1,48 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\cache\Driver; -use think\cache\TagSet; -use think\Facade; - -/** - * @see \think\Cache - * @package think\facade - * @mixin \think\Cache - * @method static string|null getDefaultDriver() 默认驱动 - * @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取缓存配置 - * @method static array getStoreConfig(string $store, string $name = null, null $default = null) 获取驱动配置 - * @method static Driver store(string $name = null) 连接或者切换缓存 - * @method static bool clear() 清空缓冲池 - * @method static mixed get(string $key, mixed $default = null) 读取缓存 - * @method static bool set(string $key, mixed $value, int|\DateTime $ttl = null) 写入缓存 - * @method static bool delete(string $key) 删除缓存 - * @method static iterable getMultiple(iterable $keys, mixed $default = null) 读取缓存 - * @method static bool setMultiple(iterable $values, null|int|\DateInterval $ttl = null) 写入缓存 - * @method static bool deleteMultiple(iterable $keys) 删除缓存 - * @method static bool has(string $key) 判断缓存是否存在 - * @method static TagSet tag(string|array $name) 缓存标签 - */ -class Cache extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'cache'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Config.php b/vendor/topthink/framework/src/think/facade/Config.php deleted file mode 100644 index 4ce73dd..0000000 --- a/vendor/topthink/framework/src/think/facade/Config.php +++ /dev/null @@ -1,37 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Config - * @package think\facade - * @mixin \think\Config - * @method static array load(string $file, string $name = '') 加载配置文件(多种格式) - * @method static bool has(string $name) 检测配置是否存在 - * @method static mixed get(string $name = null, mixed $default = null) 获取配置参数 为空则获取所有配置 - * @method static array set(array $config, string $name = null) 设置配置参数 name为数组则为批量设置 - */ -class Config extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'config'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Console.php b/vendor/topthink/framework/src/think/facade/Console.php deleted file mode 100644 index 30dd935..0000000 --- a/vendor/topthink/framework/src/think/facade/Console.php +++ /dev/null @@ -1,56 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\console\Command; -use think\console\Input; -use think\console\input\Definition as InputDefinition; -use think\console\Output; -use think\console\output\driver\Buffer; -use think\Facade; - -/** - * Class Console - * @package think\facade - * @mixin \think\Console - * @method static Output|Buffer call(string $command, array $parameters = [], string $driver = 'buffer') - * @method static int run() 执行当前的指令 - * @method static int doRun(Input $input, Output $output) 执行指令 - * @method static void setDefinition(InputDefinition $definition) 设置输入参数定义 - * @method static InputDefinition The InputDefinition instance getDefinition() 获取输入参数定义 - * @method static string A help message. getHelp() Gets the help message. - * @method static void setCatchExceptions(bool $boolean) 是否捕获异常 - * @method static void setAutoExit(bool $boolean) 是否自动退出 - * @method static string getLongVersion() 获取完整的版本号 - * @method static void addCommands(array $commands) 添加指令集 - * @method static Command|void addCommand(string|Command $command, string $name = '') 添加一个指令 - * @method static Command getCommand(string $name) 获取指令 - * @method static bool hasCommand(string $name) 某个指令是否存在 - * @method static array getNamespaces() 获取所有的命名空间 - * @method static string findNamespace(string $namespace) 查找注册命名空间中的名称或缩写。 - * @method static Command find(string $name) 查找指令 - * @method static Command[] all(string $namespace = null) 获取所有的指令 - * @method static string extractNamespace(string $name, int $limit = 0) 返回命名空间部分 - */ -class Console extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'console'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Cookie.php b/vendor/topthink/framework/src/think/facade/Cookie.php deleted file mode 100644 index 960f4a3..0000000 --- a/vendor/topthink/framework/src/think/facade/Cookie.php +++ /dev/null @@ -1,40 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Cookie - * @package think\facade - * @mixin \think\Cookie - * @method static mixed get(mixed $name = '', string $default = null) 获取cookie - * @method static bool has(string $name) 是否存在Cookie参数 - * @method static void set(string $name, string $value, mixed $option = null) Cookie 设置 - * @method static void forever(string $name, string $value = '', mixed $option = null) 永久保存Cookie数据 - * @method static void delete(string $name) Cookie删除 - * @method static array getCookie() 获取cookie保存数据 - * @method static void save() 保存Cookie - */ -class Cookie extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'cookie'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Env.php b/vendor/topthink/framework/src/think/facade/Env.php deleted file mode 100644 index bed2538..0000000 --- a/vendor/topthink/framework/src/think/facade/Env.php +++ /dev/null @@ -1,44 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Env - * @package think\facade - * @mixin \think\Env - * @method static void load(string $file) 读取环境变量定义文件 - * @method static mixed get(string $name = null, mixed $default = null) 获取环境变量值 - * @method static void set(string|array $env, mixed $value = null) 设置环境变量值 - * @method static bool has(string $name) 检测是否存在环境变量 - * @method static void __set(string $name, mixed $value) 设置环境变量 - * @method static mixed __get(string $name) 获取环境变量 - * @method static bool __isset(string $name) 检测是否存在环境变量 - * @method static void offsetSet($name, $value) - * @method static bool offsetExists($name) - * @method static mixed offsetUnset($name) - * @method static mixed offsetGet($name) - */ -class Env extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'env'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Event.php b/vendor/topthink/framework/src/think/facade/Event.php deleted file mode 100644 index c09d816..0000000 --- a/vendor/topthink/framework/src/think/facade/Event.php +++ /dev/null @@ -1,42 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Event - * @package think\facade - * @mixin \think\Event - * @method static \think\Event listenEvents(array $events) 批量注册事件监听 - * @method static \think\Event listen(string $event, mixed $listener, bool $first = false) 注册事件监听 - * @method static bool hasListener(string $event) 是否存在事件监听 - * @method static void remove(string $event) 移除事件监听 - * @method static \think\Event bind(array $events) 指定事件别名标识 便于调用 - * @method static \think\Event subscribe(mixed $subscriber) 注册事件订阅者 - * @method static \think\Event observe(string|object $observer, null|string $prefix = '') 自动注册事件观察者 - * @method static mixed trigger(string|object $event, mixed $params = null, bool $once = false) 触发事件 - * @method static mixed until($event, $params = null) 触发事件(只获取一个有效返回值) - */ -class Event extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'event'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Filesystem.php b/vendor/topthink/framework/src/think/facade/Filesystem.php deleted file mode 100644 index 53706a8..0000000 --- a/vendor/topthink/framework/src/think/facade/Filesystem.php +++ /dev/null @@ -1,33 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; -use think\filesystem\Driver; - -/** - * Class Filesystem - * @package think\facade - * @mixin \think\Filesystem - * @method static Driver disk(string $name = null) ,null|string - * @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取缓存配置 - * @method static array getDiskConfig(string $disk, null $name = null, null $default = null) 获取磁盘配置 - * @method static string|null getDefaultDriver() 默认驱动 - */ -class Filesystem extends Facade -{ - protected static function getFacadeClass() - { - return 'filesystem'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Lang.php b/vendor/topthink/framework/src/think/facade/Lang.php deleted file mode 100644 index b460fe2..0000000 --- a/vendor/topthink/framework/src/think/facade/Lang.php +++ /dev/null @@ -1,41 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Lang - * @package think\facade - * @mixin \think\Lang - * @method static void setLangSet(string $lang) 设置当前语言 - * @method static string getLangSet() 获取当前语言 - * @method static string defaultLangSet() 获取默认语言 - * @method static array load(string|array $file, string $range = '') 加载语言定义(不区分大小写) - * @method static bool has(string|null $name, string $range = '') 判断是否存在语言定义(不区分大小写) - * @method static mixed get(string|null $name = null, array $vars = [], string $range = '') 获取语言定义(不区分大小写) - * @method static string detect(\think\Request $request) 自动侦测设置获取语言选择 - * @method static void saveToCookie(\think\Cookie $cookie) 保存当前语言到Cookie - */ -class Lang extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'lang'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Log.php b/vendor/topthink/framework/src/think/facade/Log.php deleted file mode 100644 index 7c43d37..0000000 --- a/vendor/topthink/framework/src/think/facade/Log.php +++ /dev/null @@ -1,58 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; -use think\log\Channel; -use think\log\ChannelSet; - -/** - * @see \think\Log - * @package think\facade - * @mixin \think\Log - * @method static string|null getDefaultDriver() 默认驱动 - * @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取日志配置 - * @method static array getChannelConfig(string $channel, null $name = null, null $default = null) 获取渠道配置 - * @method static Channel|ChannelSet channel(string|array $name = null) driver() 的别名 - * @method static mixed createDriver(string $name) - * @method static \think\Log clear(string|array $channel = '*') 清空日志信息 - * @method static \think\Log close(string|array $channel = '*') 关闭本次请求日志写入 - * @method static array getLog(string $channel = null) 获取日志信息 - * @method static bool save() 保存日志信息 - * @method static \think\Log record(mixed $msg, string $type = 'info', array $context = [], bool $lazy = true) 记录日志信息 - * @method static \think\Log write(mixed $msg, string $type = 'info', array $context = []) 实时写入日志信息 - * @method static Event listen($listener) 注册日志写入事件监听 - * @method static void log(string $level, mixed $message, array $context = []) 记录日志信息 - * @method static void emergency(mixed $message, array $context = []) 记录emergency信息 - * @method static void alert(mixed $message, array $context = []) 记录警报信息 - * @method static void critical(mixed $message, array $context = []) 记录紧急情况 - * @method static void error(mixed $message, array $context = []) 记录错误信息 - * @method static void warning(mixed $message, array $context = []) 记录warning信息 - * @method static void notice(mixed $message, array $context = []) 记录notice信息 - * @method static void info(mixed $message, array $context = []) 记录一般信息 - * @method static void debug(mixed $message, array $context = []) 记录调试信息 - * @method static void sql(mixed $message, array $context = []) 记录sql信息 - * @method static mixed __call($method, $parameters) - */ -class Log extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'log'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Middleware.php b/vendor/topthink/framework/src/think/facade/Middleware.php deleted file mode 100644 index 4203f82..0000000 --- a/vendor/topthink/framework/src/think/facade/Middleware.php +++ /dev/null @@ -1,42 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Middleware - * @package think\facade - * @mixin \think\Middleware - * @method static void import(array $middlewares = [], string $type = 'global') 导入中间件 - * @method static void add(mixed $middleware, string $type = 'global') 注册中间件 - * @method static void route(mixed $middleware) 注册路由中间件 - * @method static void controller(mixed $middleware) 注册控制器中间件 - * @method static mixed unshift(mixed $middleware, string $type = 'global') 注册中间件到开始位置 - * @method static array all(string $type = 'global') 获取注册的中间件 - * @method static Pipeline pipeline(string $type = 'global') 调度管道 - * @method static mixed end(\think\Response $response) 结束调度 - * @method static \think\Response handleException(\think\Request $passable, \Throwable $e) 异常处理 - */ -class Middleware extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'middleware'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Request.php b/vendor/topthink/framework/src/think/facade/Request.php deleted file mode 100644 index 6531f46..0000000 --- a/vendor/topthink/framework/src/think/facade/Request.php +++ /dev/null @@ -1,134 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; -use think\file\UploadedFile; -use think\route\Rule; - -/** - * @see \think\Request - * @package think\facade - * @mixin \think\Request - * @method static \think\Request setDomain(string $domain) 设置当前包含协议的域名 - * @method static string domain(bool $port = false) 获取当前包含协议的域名 - * @method static string rootDomain() 获取当前根域名 - * @method static \think\Request setSubDomain(string $domain) 设置当前泛域名的值 - * @method static string subDomain() 获取当前子域名 - * @method static \think\Request setPanDomain(string $domain) 设置当前泛域名的值 - * @method static string panDomain() 获取当前泛域名的值 - * @method static \think\Request setUrl(string $url) 设置当前完整URL 包括QUERY_STRING - * @method static string url(bool $complete = false) 获取当前完整URL 包括QUERY_STRING - * @method static \think\Request setBaseUrl(string $url) 设置当前URL 不含QUERY_STRING - * @method static string baseUrl(bool $complete = false) 获取当前URL 不含QUERY_STRING - * @method static string baseFile(bool $complete = false) 获取当前执行的文件 SCRIPT_NAME - * @method static \think\Request setRoot(string $url) 设置URL访问根地址 - * @method static string root(bool $complete = false) 获取URL访问根地址 - * @method static string rootUrl() 获取URL访问根目录 - * @method static \think\Request setPathinfo(string $pathinfo) 设置当前请求的pathinfo - * @method static string pathinfo() 获取当前请求URL的pathinfo信息(含URL后缀) - * @method static string ext() 当前URL的访问后缀 - * @method static integer|float time(bool $float = false) 获取当前请求的时间 - * @method static string type() 当前请求的资源类型 - * @method static void mimeType(string|array $type, string $val = '') 设置资源类型 - * @method static \think\Request setMethod(string $method) 设置请求类型 - * @method static string method(bool $origin = false) 当前的请求类型 - * @method static bool isGet() 是否为GET请求 - * @method static bool isPost() 是否为POST请求 - * @method static bool isPut() 是否为PUT请求 - * @method static bool isDelete() 是否为DELTE请求 - * @method static bool isHead() 是否为HEAD请求 - * @method static bool isPatch() 是否为PATCH请求 - * @method static bool isOptions() 是否为OPTIONS请求 - * @method static bool isCli() 是否为cli - * @method static bool isCgi() 是否为cgi - * @method static mixed param(string|array $name = '', mixed $default = null, string|array $filter = '') 获取当前请求的参数 - * @method static \think\Request setRule(Rule $rule) 设置路由变量 - * @method static Rule|null rule() 获取当前路由对象 - * @method static \think\Request setRoute(array $route) 设置路由变量 - * @method static mixed route(string|array $name = '', mixed $default = null, string|array $filter = '') 获取路由参数 - * @method static mixed get(string|array $name = '', mixed $default = null, string|array $filter = '') 获取GET参数 - * @method static mixed middleware(mixed $name, mixed $default = null) 获取中间件传递的参数 - * @method static mixed post(string|array $name = '', mixed $default = null, string|array $filter = '') 获取POST参数 - * @method static mixed put(string|array $name = '', mixed $default = null, string|array $filter = '') 获取PUT参数 - * @method static mixed delete(mixed $name = '', mixed $default = null, string|array $filter = '') 设置获取DELETE参数 - * @method static mixed patch(mixed $name = '', mixed $default = null, string|array $filter = '') 设置获取PATCH参数 - * @method static mixed request(string|array $name = '', mixed $default = null, string|array $filter = '') 获取request变量 - * @method static mixed env(string $name = '', string $default = null) 获取环境变量 - * @method static mixed session(string $name = '', string $default = null) 获取session数据 - * @method static mixed cookie(mixed $name = '', string $default = null, string|array $filter = '') 获取cookie参数 - * @method static mixed server(string $name = '', string $default = '') 获取server参数 - * @method static null|array|UploadedFile file(string $name = '') 获取上传的文件信息 - * @method static string|array header(string $name = '', string $default = null) 设置或者获取当前的Header - * @method static mixed input(array $data = [], string|false $name = '', mixed $default = null, string|array $filter = '') 获取变量 支持过滤和默认值 - * @method static mixed filter(mixed $filter = null) 设置或获取当前的过滤规则 - * @method static mixed filterValue(mixed &$value, mixed $key, array $filters) 递归过滤给定的值 - * @method static bool has(string $name, string $type = 'param', bool $checkEmpty = false) 是否存在某个请求参数 - * @method static array only(array $name, mixed $data = 'param', string|array $filter = '') 获取指定的参数 - * @method static mixed except(array $name, string $type = 'param') 排除指定参数获取 - * @method static bool isSsl() 当前是否ssl - * @method static bool isJson() 当前是否JSON请求 - * @method static bool isAjax(bool $ajax = false) 当前是否Ajax请求 - * @method static bool isPjax(bool $pjax = false) 当前是否Pjax请求 - * @method static string ip() 获取客户端IP地址 - * @method static boolean isValidIP(string $ip, string $type = '') 检测是否是合法的IP地址 - * @method static string ip2bin(string $ip) 将IP地址转换为二进制字符串 - * @method static bool isMobile() 检测是否使用手机访问 - * @method static string scheme() 当前URL地址中的scheme参数 - * @method static string query() 当前请求URL地址中的query参数 - * @method static \think\Request setHost(string $host) 设置当前请求的host(包含端口) - * @method static string host(bool $strict = false) 当前请求的host - * @method static int port() 当前请求URL地址中的port参数 - * @method static string protocol() 当前请求 SERVER_PROTOCOL - * @method static int remotePort() 当前请求 REMOTE_PORT - * @method static string contentType() 当前请求 HTTP_CONTENT_TYPE - * @method static string secureKey() 获取当前请求的安全Key - * @method static \think\Request setController(string $controller) 设置当前的控制器名 - * @method static \think\Request setAction(string $action) 设置当前的操作名 - * @method static string controller(bool $convert = false) 获取当前的控制器名 - * @method static string action(bool $convert = false) 获取当前的操作名 - * @method static string getContent() 设置或者获取当前请求的content - * @method static string getInput() 获取当前请求的php://input - * @method static string buildToken(string $name = '__token__', mixed $type = 'md5') 生成请求令牌 - * @method static bool checkToken(string $token = '__token__', array $data = []) 检查请求令牌 - * @method static \think\Request withMiddleware(array $middleware) 设置在中间件传递的数据 - * @method static \think\Request withGet(array $get) 设置GET数据 - * @method static \think\Request withPost(array $post) 设置POST数据 - * @method static \think\Request withCookie(array $cookie) 设置COOKIE数据 - * @method static \think\Request withSession(Session $session) 设置SESSION数据 - * @method static \think\Request withServer(array $server) 设置SERVER数据 - * @method static \think\Request withHeader(array $header) 设置HEADER数据 - * @method static \think\Request withEnv(Env $env) 设置ENV数据 - * @method static \think\Request withInput(string $input) 设置php://input数据 - * @method static \think\Request withFiles(array $files) 设置文件上传数据 - * @method static \think\Request withRoute(array $route) 设置ROUTE变量 - * @method static mixed __set(string $name, mixed $value) 设置中间传递数据 - * @method static mixed __get(string $name) 获取中间传递数据的值 - * @method static boolean __isset(string $name) 检测中间传递数据的值 - * @method static bool offsetExists($name) - * @method static mixed offsetGet($name) - * @method static mixed offsetSet($name, $value) - * @method static mixed offsetUnset($name) - */ -class Request extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'request'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Route.php b/vendor/topthink/framework/src/think/facade/Route.php deleted file mode 100644 index 46bd746..0000000 --- a/vendor/topthink/framework/src/think/facade/Route.php +++ /dev/null @@ -1,83 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; -use think\route\Dispatch; -use think\route\Domain; -use think\route\Rule; -use think\route\RuleGroup; -use think\route\RuleItem; -use think\route\RuleName; -use think\route\Url as UrlBuild; - -/** - * @see \think\Route - * @package think\facade - * @mixin \think\Route - * @method static mixed config(string $name = null) - * @method static \think\Route lazy(bool $lazy = true) 设置路由域名及分组(包括资源路由)是否延迟解析 - * @method static void setTestMode(bool $test) 设置路由为测试模式 - * @method static bool isTest() 检查路由是否为测试模式 - * @method static \think\Route mergeRuleRegex(bool $merge = true) 设置路由域名及分组(包括资源路由)是否合并解析 - * @method static void setGroup(RuleGroup $group) 设置当前分组 - * @method static RuleGroup getGroup(string $name = null) 获取指定标识的路由分组 不指定则获取当前分组 - * @method static \think\Route pattern(array $pattern) 注册变量规则 - * @method static \think\Route option(array $option) 注册路由参数 - * @method static Domain domain(string|array $name, mixed $rule = null) 注册域名路由 - * @method static array getDomains() 获取域名 - * @method static RuleName getRuleName() 获取RuleName对象 - * @method static \think\Route bind(string $bind, string $domain = null) 设置路由绑定 - * @method static array getBind() 读取路由绑定信息 - * @method static string|null getDomainBind(string $domain = null) 读取路由绑定 - * @method static RuleItem[] getName(string $name = null, string $domain = null, string $method = '*') 读取路由标识 - * @method static void import(array $name) 批量导入路由标识 - * @method static void setName(string $name, RuleItem $ruleItem, bool $first = false) 注册路由标识 - * @method static void setRule(string $rule, RuleItem $ruleItem = null) 保存路由规则 - * @method static RuleItem[] getRule(string $rule) 读取路由 - * @method static array getRuleList() 读取路由列表 - * @method static void clear() 清空路由规则 - * @method static RuleItem rule(string $rule, mixed $route = null, string $method = '*') 注册路由规则 - * @method static \think\Route setCrossDomainRule(Rule $rule, string $method = '*') 设置跨域有效路由规则 - * @method static RuleGroup group(string|\Closure $name, mixed $route = null) 注册路由分组 - * @method static RuleItem any(string $rule, mixed $route) 注册路由 - * @method static RuleItem get(string $rule, mixed $route) 注册GET路由 - * @method static RuleItem post(string $rule, mixed $route) 注册POST路由 - * @method static RuleItem put(string $rule, mixed $route) 注册PUT路由 - * @method static RuleItem delete(string $rule, mixed $route) 注册DELETE路由 - * @method static RuleItem patch(string $rule, mixed $route) 注册PATCH路由 - * @method static RuleItem options(string $rule, mixed $route) 注册OPTIONS路由 - * @method static Resource resource(string $rule, string $route) 注册资源路由 - * @method static RuleItem view(string $rule, string $template = '', array $vars = []) 注册视图路由 - * @method static RuleItem redirect(string $rule, string $route = '', int $status = 301) 注册重定向路由 - * @method static \think\Route rest(string|array $name, array|bool $resource = []) rest方法定义和修改 - * @method static array|null getRest(string $name = null) 获取rest方法定义的参数 - * @method static RuleItem miss(string|Closure $route, string $method = '*') 注册未匹配路由规则后的处理 - * @method static Response dispatch(\think\Request $request, Closure|bool $withRoute = true) 路由调度 - * @method static Dispatch|false check() 检测URL路由 - * @method static Dispatch url(string $url) 默认URL解析 - * @method static UrlBuild buildUrl(string $url = '', array $vars = []) URL生成 支持路由反射 - * @method static RuleGroup __call(string $method, array $args) 设置全局的路由分组参数 - */ -class Route extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'route'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Session.php b/vendor/topthink/framework/src/think/facade/Session.php deleted file mode 100644 index 68bf993..0000000 --- a/vendor/topthink/framework/src/think/facade/Session.php +++ /dev/null @@ -1,35 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Session - * @package think\facade - * @mixin \think\Session - * @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取Session配置 - * @method static string|null getDefaultDriver() 默认驱动 - */ -class Session extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'session'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/Validate.php b/vendor/topthink/framework/src/think/facade/Validate.php deleted file mode 100644 index 6db6d34..0000000 --- a/vendor/topthink/framework/src/think/facade/Validate.php +++ /dev/null @@ -1,95 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\Validate - * @package think\facade - * @mixin \think\Validate - * @method static void setLang(\think\Lang $lang) 设置Lang对象 - * @method static void setDb(\think\Db $db) 设置Db对象 - * @method static void setRequest(\think\Request $request) 设置Request对象 - * @method static \think\Validate rule(string|array $name, mixed $rule = '') 添加字段验证规则 - * @method static \think\Validate extend(string $type, callable $callback = null, string $message = null) 注册验证(类型)规则 - * @method static void setTypeMsg(string|array $type, string $msg = null) 设置验证规则的默认提示信息 - * @method static Validate message(array $message) 设置提示信息 - * @method static \think\Validate scene(string $name) 设置验证场景 - * @method static bool hasScene(string $name) 判断是否存在某个验证场景 - * @method static \think\Validate batch(bool $batch = true) 设置批量验证 - * @method static \think\Validate failException(bool $fail = true) 设置验证失败后是否抛出异常 - * @method static \think\Validate only(array $fields) 指定需要验证的字段列表 - * @method static \think\Validate remove(string|array $field, mixed $rule = null) 移除某个字段的验证规则 - * @method static \think\Validate append(string|array $field, mixed $rule = null) 追加某个字段的验证规则 - * @method static bool check(array $data, array $rules = []) 数据自动验证 - * @method static bool checkRule(mixed $value, mixed $rules) 根据验证规则验证数据 - * @method static bool confirm(mixed $value, mixed $rule, array $data = [], string $field = '') 验证是否和某个字段的值一致 - * @method static bool different(mixed $value, mixed $rule, array $data = []) 验证是否和某个字段的值是否不同 - * @method static bool egt(mixed $value, mixed $rule, array $data = []) 验证是否大于等于某个值 - * @method static bool gt(mixed $value, mixed $rule, array $data = []) 验证是否大于某个值 - * @method static bool elt(mixed $value, mixed $rule, array $data = []) 验证是否小于等于某个值 - * @method static bool lt(mixed $value, mixed $rule, array $data = []) 验证是否小于某个值 - * @method static bool eq(mixed $value, mixed $rule) 验证是否等于某个值 - * @method static bool must(mixed $value, mixed $rule = null) 必须验证 - * @method static bool is(mixed $value, string $rule, array $data = []) 验证字段值是否为有效格式 - * @method static bool token(mixed $value, mixed $rule, array $data) 验证表单令牌 - * @method static bool activeUrl(mixed $value, mixed $rule = 'MX') 验证是否为合格的域名或者IP 支持A,MX,NS,SOA,PTR,CNAME,AAAA,A6, SRV,NAPTR,TXT 或者 ANY类型 - * @method static bool ip(mixed $value, mixed $rule = 'ipv4') 验证是否有效IP - * @method static bool fileExt(mixed $file, mixed $rule) 验证上传文件后缀 - * @method static bool fileMime(mixed $file, mixed $rule) 验证上传文件类型 - * @method static bool fileSize(mixed $file, mixed $rule) 验证上传文件大小 - * @method static bool image(mixed $file, mixed $rule) 验证图片的宽高及类型 - * @method static bool dateFormat(mixed $value, mixed $rule) 验证时间和日期是否符合指定格式 - * @method static bool unique(mixed $value, mixed $rule, array $data = [], string $field = '') 验证是否唯一 - * @method static bool filter(mixed $value, mixed $rule) 使用filter_var方式验证 - * @method static bool requireIf(mixed $value, mixed $rule, array $data = []) 验证某个字段等于某个值的时候必须 - * @method static bool requireCallback(mixed $value, mixed $rule, array $data = []) 通过回调方法验证某个字段是否必须 - * @method static bool requireWith(mixed $value, mixed $rule, array $data = []) 验证某个字段有值的情况下必须 - * @method static bool requireWithout(mixed $value, mixed $rule, array $data = []) 验证某个字段没有值的情况下必须 - * @method static bool in(mixed $value, mixed $rule) 验证是否在范围内 - * @method static bool notIn(mixed $value, mixed $rule) 验证是否不在某个范围 - * @method static bool between(mixed $value, mixed $rule) between验证数据 - * @method static bool notBetween(mixed $value, mixed $rule) 使用notbetween验证数据 - * @method static bool length(mixed $value, mixed $rule) 验证数据长度 - * @method static bool max(mixed $value, mixed $rule) 验证数据最大长度 - * @method static bool min(mixed $value, mixed $rule) 验证数据最小长度 - * @method static bool after(mixed $value, mixed $rule, array $data = []) 验证日期 - * @method static bool before(mixed $value, mixed $rule, array $data = []) 验证日期 - * @method static bool afterWith(mixed $value, mixed $rule, array $data = []) 验证日期 - * @method static bool beforeWith(mixed $value, mixed $rule, array $data = []) 验证日期 - * @method static bool expire(mixed $value, mixed $rule) 验证有效期 - * @method static bool allowIp(mixed $value, mixed $rule) 验证IP许可 - * @method static bool denyIp(mixed $value, mixed $rule) 验证IP禁用 - * @method static bool regex(mixed $value, mixed $rule) 使用正则验证数据 - * @method static array|string getError() 获取错误信息 - * @method static bool __call(string $method, array $args) 动态方法 直接调用is方法进行验证 - */ -class Validate extends Facade -{ - /** - * 始终创建新的对象实例 - * @var bool - */ - protected static $alwaysNewInstance = true; - - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'validate'; - } -} diff --git a/vendor/topthink/framework/src/think/facade/View.php b/vendor/topthink/framework/src/think/facade/View.php deleted file mode 100644 index acde3b5..0000000 --- a/vendor/topthink/framework/src/think/facade/View.php +++ /dev/null @@ -1,42 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\View - * @package think\facade - * @mixin \think\View - * @method static \think\View engine(string $type = null) 获取模板引擎 - * @method static \think\View assign(string|array $name, mixed $value = null) 模板变量赋值 - * @method static \think\View filter(\think\Callable $filter = null) 视图过滤 - * @method static string fetch(string $template = '', array $vars = []) 解析和获取模板内容 用于输出 - * @method static string display(string $content, array $vars = []) 渲染内容输出 - * @method static mixed __set(string $name, mixed $value) 模板变量赋值 - * @method static mixed __get(string $name) 取得模板显示变量的值 - * @method static bool __isset(string $name) 检测模板变量是否设置 - * @method static string|null getDefaultDriver() 默认驱动 - */ -class View extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'view'; - } -} diff --git a/vendor/topthink/framework/src/think/file/UploadedFile.php b/vendor/topthink/framework/src/think/file/UploadedFile.php deleted file mode 100644 index 7dff766..0000000 --- a/vendor/topthink/framework/src/think/file/UploadedFile.php +++ /dev/null @@ -1,143 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\file; - -use think\exception\FileException; -use think\File; - -class UploadedFile extends File -{ - - private $test = false; - private $originalName; - private $mimeType; - private $error; - - public function __construct(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false) - { - $this->originalName = $originalName; - $this->mimeType = $mimeType ?: 'application/octet-stream'; - $this->test = $test; - $this->error = $error ?: UPLOAD_ERR_OK; - - parent::__construct($path, UPLOAD_ERR_OK === $this->error); - } - - public function isValid(): bool - { - $isOk = UPLOAD_ERR_OK === $this->error; - - return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname()); - } - - /** - * 上传文件 - * @access public - * @param string $directory 保存路径 - * @param string|null $name 保存的文件名 - * @return File - */ - public function move(string $directory, string $name = null): File - { - if ($this->isValid()) { - if ($this->test) { - return parent::move($directory, $name); - } - - $target = $this->getTargetFile($directory, $name); - - set_error_handler(function ($type, $msg) use (&$error) { - $error = $msg; - }); - - $moved = move_uploaded_file($this->getPathname(), (string) $target); - restore_error_handler(); - if (!$moved) { - throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error))); - } - - @chmod((string) $target, 0666 & ~umask()); - - return $target; - } - - throw new FileException($this->getErrorMessage()); - } - - /** - * 获取错误信息 - * @access public - * @return string - */ - protected function getErrorMessage(): string - { - switch ($this->error) { - case 1: - case 2: - $message = 'upload File size exceeds the maximum value'; - break; - case 3: - $message = 'only the portion of file is uploaded'; - break; - case 4: - $message = 'no file to uploaded'; - break; - case 6: - $message = 'upload temp dir not found'; - break; - case 7: - $message = 'file write error'; - break; - default: - $message = 'unknown upload error'; - } - - return $message; - } - - /** - * 获取上传文件类型信息 - * @return string - */ - public function getOriginalMime(): string - { - return $this->mimeType; - } - - /** - * 上传文件名 - * @return string - */ - public function getOriginalName(): string - { - return $this->originalName; - } - - /** - * 获取上传文件扩展名 - * @return string - */ - public function getOriginalExtension(): string - { - return pathinfo($this->originalName, PATHINFO_EXTENSION); - } - - /** - * 获取文件扩展名 - * @return string - */ - public function extension(): string - { - return $this->getOriginalExtension(); - } -} diff --git a/vendor/topthink/framework/src/think/filesystem/CacheStore.php b/vendor/topthink/framework/src/think/filesystem/CacheStore.php deleted file mode 100644 index 0a62399..0000000 --- a/vendor/topthink/framework/src/think/filesystem/CacheStore.php +++ /dev/null @@ -1,54 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\filesystem; - -use League\Flysystem\Cached\Storage\AbstractCache; -use Psr\SimpleCache\CacheInterface; - -class CacheStore extends AbstractCache -{ - protected $store; - - protected $key; - - protected $expire; - - public function __construct(CacheInterface $store, $key = 'flysystem', $expire = null) - { - $this->key = $key; - $this->store = $store; - $this->expire = $expire; - } - - /** - * Store the cache. - */ - public function save() - { - $contents = $this->getForStorage(); - - $this->store->set($this->key, $contents, $this->expire); - } - - /** - * Load the cache. - */ - public function load() - { - $contents = $this->store->get($this->key); - - if (!is_null($contents)) { - $this->setFromStorage($contents); - } - } -} diff --git a/vendor/topthink/framework/src/think/filesystem/Driver.php b/vendor/topthink/framework/src/think/filesystem/Driver.php deleted file mode 100644 index 6712959..0000000 --- a/vendor/topthink/framework/src/think/filesystem/Driver.php +++ /dev/null @@ -1,133 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\filesystem; - -use League\Flysystem\AdapterInterface; -use League\Flysystem\Adapter\AbstractAdapter; -use League\Flysystem\Cached\CachedAdapter; -use League\Flysystem\Cached\Storage\Memory as MemoryStore; -use League\Flysystem\Filesystem; -use think\Cache; -use think\File; - -/** - * Class Driver - * @package think\filesystem - * @mixin Filesystem - */ -abstract class Driver -{ - - /** @var Cache */ - protected $cache; - - /** @var Filesystem */ - protected $filesystem; - - /** - * 配置参数 - * @var array - */ - protected $config = []; - - public function __construct(Cache $cache, array $config) - { - $this->cache = $cache; - $this->config = array_merge($this->config, $config); - - $adapter = $this->createAdapter(); - $this->filesystem = $this->createFilesystem($adapter); - } - - protected function createCacheStore($config) - { - if (true === $config) { - return new MemoryStore; - } - - return new CacheStore( - $this->cache->store($config['store']), - $config['prefix'] ?? 'flysystem', - $config['expire'] ?? null - ); - } - - abstract protected function createAdapter(): AdapterInterface; - - protected function createFilesystem(AdapterInterface $adapter): Filesystem - { - if (!empty($this->config['cache'])) { - $adapter = new CachedAdapter($adapter, $this->createCacheStore($this->config['cache'])); - } - - $config = array_intersect_key($this->config, array_flip(['visibility', 'disable_asserts', 'url'])); - - return new Filesystem($adapter, count($config) > 0 ? $config : null); - } - - /** - * 获取文件完整路径 - * @param string $path - * @return string - */ - public function path(string $path): string - { - $adapter = $this->filesystem->getAdapter(); - - if ($adapter instanceof AbstractAdapter) { - return $adapter->applyPathPrefix($path); - } - - return $path; - } - - /** - * 保存文件 - * @param string $path 路径 - * @param File $file 文件 - * @param null|string|\Closure $rule 文件名规则 - * @param array $options 参数 - * @return bool|string - */ - public function putFile(string $path, File $file, $rule = null, array $options = []) - { - return $this->putFileAs($path, $file, $file->hashName($rule), $options); - } - - /** - * 指定文件名保存文件 - * @param string $path 路径 - * @param File $file 文件 - * @param string $name 文件名 - * @param array $options 参数 - * @return bool|string - */ - public function putFileAs(string $path, File $file, string $name, array $options = []) - { - $stream = fopen($file->getRealPath(), 'r'); - $path = trim($path . '/' . $name, '/'); - - $result = $this->putStream($path, $stream, $options); - - if (is_resource($stream)) { - fclose($stream); - } - - return $result ? $path : false; - } - - public function __call($method, $parameters) - { - return $this->filesystem->$method(...$parameters); - } -} diff --git a/vendor/topthink/framework/src/think/filesystem/driver/Local.php b/vendor/topthink/framework/src/think/filesystem/driver/Local.php deleted file mode 100644 index c10ccc3..0000000 --- a/vendor/topthink/framework/src/think/filesystem/driver/Local.php +++ /dev/null @@ -1,44 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\filesystem\driver; - -use League\Flysystem\AdapterInterface; -use League\Flysystem\Adapter\Local as LocalAdapter; -use think\filesystem\Driver; - -class Local extends Driver -{ - /** - * 配置参数 - * @var array - */ - protected $config = [ - 'root' => '', - ]; - - protected function createAdapter(): AdapterInterface - { - $permissions = $this->config['permissions'] ?? []; - - $links = ($this->config['links'] ?? null) === 'skip' - ? LocalAdapter::SKIP_LINKS - : LocalAdapter::DISALLOW_LINKS; - - return new LocalAdapter( - $this->config['root'], - LOCK_EX, - $links, - $permissions - ); - } -} diff --git a/vendor/topthink/framework/src/think/initializer/BootService.php b/vendor/topthink/framework/src/think/initializer/BootService.php deleted file mode 100644 index bab6d39..0000000 --- a/vendor/topthink/framework/src/think/initializer/BootService.php +++ /dev/null @@ -1,26 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\initializer; - -use think\App; - -/** - * 启动系统服务 - */ -class BootService -{ - public function init(App $app) - { - $app->boot(); - } -} diff --git a/vendor/topthink/framework/src/think/initializer/Error.php b/vendor/topthink/framework/src/think/initializer/Error.php deleted file mode 100644 index 201d947..0000000 --- a/vendor/topthink/framework/src/think/initializer/Error.php +++ /dev/null @@ -1,117 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\initializer; - -use think\App; -use think\console\Output as ConsoleOutput; -use think\exception\ErrorException; -use think\exception\Handle; -use Throwable; - -/** - * 错误和异常处理 - */ -class Error -{ - /** @var App */ - protected $app; - - /** - * 注册异常处理 - * @access public - * @param App $app - * @return void - */ - public function init(App $app) - { - $this->app = $app; - error_reporting(E_ALL); - set_error_handler([$this, 'appError']); - set_exception_handler([$this, 'appException']); - register_shutdown_function([$this, 'appShutdown']); - } - - /** - * Exception Handler - * @access public - * @param \Throwable $e - */ - public function appException(Throwable $e): void - { - $handler = $this->getExceptionHandler(); - - $handler->report($e); - - if ($this->app->runningInConsole()) { - $handler->renderForConsole(new ConsoleOutput, $e); - } else { - $handler->render($this->app->request, $e)->send(); - } - } - - /** - * Error Handler - * @access public - * @param integer $errno 错误编号 - * @param string $errstr 详细错误信息 - * @param string $errfile 出错的文件 - * @param integer $errline 出错行号 - * @throws ErrorException - */ - public function appError(int $errno, string $errstr, string $errfile = '', int $errline = 0): void - { - $exception = new ErrorException($errno, $errstr, $errfile, $errline); - - if (error_reporting() & $errno) { - // 将错误信息托管至 think\exception\ErrorException - throw $exception; - } - } - - /** - * Shutdown Handler - * @access public - */ - public function appShutdown(): void - { - if (!is_null($error = error_get_last()) && $this->isFatal($error['type'])) { - // 将错误信息托管至think\ErrorException - $exception = new ErrorException($error['type'], $error['message'], $error['file'], $error['line']); - - $this->appException($exception); - } - } - - /** - * 确定错误类型是否致命 - * - * @access protected - * @param int $type - * @return bool - */ - protected function isFatal(int $type): bool - { - return in_array($type, [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE]); - } - - /** - * Get an instance of the exception handler. - * - * @access protected - * @return Handle - */ - protected function getExceptionHandler() - { - return $this->app->make(Handle::class); - } -} diff --git a/vendor/topthink/framework/src/think/initializer/RegisterService.php b/vendor/topthink/framework/src/think/initializer/RegisterService.php deleted file mode 100644 index b682a0b..0000000 --- a/vendor/topthink/framework/src/think/initializer/RegisterService.php +++ /dev/null @@ -1,48 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\initializer; - -use think\App; -use think\service\ModelService; -use think\service\PaginatorService; -use think\service\ValidateService; - -/** - * 注册系统服务 - */ -class RegisterService -{ - - protected $services = [ - PaginatorService::class, - ValidateService::class, - ModelService::class, - ]; - - public function init(App $app) - { - $file = $app->getRootPath() . 'vendor/services.php'; - - $services = $this->services; - - if (is_file($file)) { - $services = array_merge($services, include $file); - } - - foreach ($services as $service) { - if (class_exists($service)) { - $app->register($service); - } - } - } -} diff --git a/vendor/topthink/framework/src/think/log/Channel.php b/vendor/topthink/framework/src/think/log/Channel.php deleted file mode 100644 index 505d838..0000000 --- a/vendor/topthink/framework/src/think/log/Channel.php +++ /dev/null @@ -1,282 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\log; - -use Psr\Log\LoggerInterface; -use think\contract\LogHandlerInterface; -use think\Event; -use think\event\LogWrite; - -class Channel implements LoggerInterface -{ - protected $name; - protected $logger; - protected $event; - - protected $lazy = true; - /** - * 日志信息 - * @var array - */ - protected $log = []; - - /** - * 关闭日志 - * @var array - */ - protected $close = false; - - /** - * 允许写入类型 - * @var array - */ - protected $allow = []; - - public function __construct(string $name, LogHandlerInterface $logger, array $allow, bool $lazy = true, Event $event = null) - { - $this->name = $name; - $this->logger = $logger; - $this->allow = $allow; - $this->lazy = $lazy; - $this->event = $event; - } - - /** - * 关闭通道 - */ - public function close() - { - $this->clear(); - $this->close = true; - } - - /** - * 清空日志 - */ - public function clear() - { - $this->log = []; - } - - /** - * 记录日志信息 - * @access public - * @param mixed $msg 日志信息 - * @param string $type 日志级别 - * @param array $context 替换内容 - * @param bool $lazy - * @return $this - */ - public function record($msg, string $type = 'info', array $context = [], bool $lazy = true) - { - if ($this->close || (!empty($this->allow) && !in_array($type, $this->allow))) { - return $this; - } - - if (is_string($msg) && !empty($context)) { - $replace = []; - foreach ($context as $key => $val) { - $replace['{' . $key . '}'] = $val; - } - - $msg = strtr($msg, $replace); - } - - if (!empty($msg) || 0 === $msg) { - $this->log[$type][] = $msg; - } - - if (!$this->lazy || !$lazy) { - $this->save(); - } - - return $this; - } - - /** - * 实时写入日志信息 - * @access public - * @param mixed $msg 调试信息 - * @param string $type 日志级别 - * @param array $context 替换内容 - * @return $this - */ - public function write($msg, string $type = 'info', array $context = []) - { - return $this->record($msg, $type, $context, false); - } - - /** - * 获取日志信息 - * @return array - */ - public function getLog(): array - { - return $this->log; - } - - /** - * 保存日志 - * @return bool - */ - public function save(): bool - { - $log = $this->log; - if ($this->event) { - $event = new LogWrite($this->name, $log); - $this->event->trigger($event); - $log = $event->log; - } - - if ($this->logger->save($log)) { - $this->clear(); - return true; - } - - return false; - } - - /** - * System is unusable. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function emergency($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function alert($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function critical($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function error($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function warning($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function notice($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function info($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function debug($message, array $context = []) - { - $this->log(__FUNCTION__, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void - */ - public function log($level, $message, array $context = []) - { - $this->record($message, $level, $context); - } - - public function __call($method, $parameters) - { - $this->log($method, ...$parameters); - } -} diff --git a/vendor/topthink/framework/src/think/log/ChannelSet.php b/vendor/topthink/framework/src/think/log/ChannelSet.php deleted file mode 100644 index 6dcb0bd..0000000 --- a/vendor/topthink/framework/src/think/log/ChannelSet.php +++ /dev/null @@ -1,39 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\log; - -use think\Log; - -/** - * Class ChannelSet - * @package think\log - * @mixin Channel - */ -class ChannelSet -{ - protected $log; - protected $channels; - - public function __construct(Log $log, array $channels) - { - $this->log = $log; - $this->channels = $channels; - } - - public function __call($method, $arguments) - { - foreach ($this->channels as $channel) { - $this->log->channel($channel)->{$method}(...$arguments); - } - } -} diff --git a/vendor/topthink/framework/src/think/log/driver/File.php b/vendor/topthink/framework/src/think/log/driver/File.php deleted file mode 100644 index e5682fc..0000000 --- a/vendor/topthink/framework/src/think/log/driver/File.php +++ /dev/null @@ -1,205 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\log\driver; - -use think\App; -use think\contract\LogHandlerInterface; - -/** - * 本地化调试输出到文件 - */ -class File implements LogHandlerInterface -{ - /** - * 配置参数 - * @var array - */ - protected $config = [ - 'time_format' => 'c', - 'single' => false, - 'file_size' => 2097152, - 'path' => '', - 'apart_level' => [], - 'max_files' => 0, - 'json' => false, - 'json_options' => JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES, - 'format' => '[%s][%s] %s', - ]; - - // 实例化并传入参数 - public function __construct(App $app, $config = []) - { - if (is_array($config)) { - $this->config = array_merge($this->config, $config); - } - - if (empty($this->config['format'])) { - $this->config['format'] = '[%s][%s] %s'; - } - - if (empty($this->config['path'])) { - $this->config['path'] = $app->getRuntimePath() . 'log'; - } - - if (substr($this->config['path'], -1) != DIRECTORY_SEPARATOR) { - $this->config['path'] .= DIRECTORY_SEPARATOR; - } - } - - /** - * 日志写入接口 - * @access public - * @param array $log 日志信息 - * @return bool - */ - public function save(array $log): bool - { - $destination = $this->getMasterLogFile(); - - $path = dirname($destination); - !is_dir($path) && mkdir($path, 0755, true); - - $info = []; - - // 日志信息封装 - $time = \DateTime::createFromFormat('0.u00 U', microtime())->setTimezone(new \DateTimeZone(date_default_timezone_get()))->format($this->config['time_format']); - - foreach ($log as $type => $val) { - $message = []; - foreach ($val as $msg) { - if (!is_string($msg)) { - $msg = var_export($msg, true); - } - - $message[] = $this->config['json'] ? - json_encode(['time' => $time, 'type' => $type, 'msg' => $msg], $this->config['json_options']) : - sprintf($this->config['format'], $time, $type, $msg); - } - - if (true === $this->config['apart_level'] || in_array($type, $this->config['apart_level'])) { - // 独立记录的日志级别 - $filename = $this->getApartLevelFile($path, $type); - $this->write($message, $filename); - continue; - } - - $info[$type] = $message; - } - - if ($info) { - return $this->write($info, $destination); - } - - return true; - } - - /** - * 日志写入 - * @access protected - * @param array $message 日志信息 - * @param string $destination 日志文件 - * @return bool - */ - protected function write(array $message, string $destination): bool - { - // 检测日志文件大小,超过配置大小则备份日志文件重新生成 - $this->checkLogSize($destination); - - $info = []; - - foreach ($message as $type => $msg) { - $info[$type] = is_array($msg) ? implode(PHP_EOL, $msg) : $msg; - } - - $message = implode(PHP_EOL, $info) . PHP_EOL; - - return error_log($message, 3, $destination); - } - - /** - * 获取主日志文件名 - * @access public - * @return string - */ - protected function getMasterLogFile(): string - { - - if ($this->config['max_files']) { - $files = glob($this->config['path'] . '*.log'); - - try { - if (count($files) > $this->config['max_files']) { - unlink($files[0]); - } - } catch (\Exception $e) { - // - } - } - - if ($this->config['single']) { - $name = is_string($this->config['single']) ? $this->config['single'] : 'single'; - $destination = $this->config['path'] . $name . '.log'; - } else { - - if ($this->config['max_files']) { - $filename = date('Ymd') . '.log'; - } else { - $filename = date('Ym') . DIRECTORY_SEPARATOR . date('d') . '.log'; - } - - $destination = $this->config['path'] . $filename; - } - - return $destination; - } - - /** - * 获取独立日志文件名 - * @access public - * @param string $path 日志目录 - * @param string $type 日志类型 - * @return string - */ - protected function getApartLevelFile(string $path, string $type): string - { - - if ($this->config['single']) { - $name = is_string($this->config['single']) ? $this->config['single'] : 'single'; - - $name .= '_' . $type; - } elseif ($this->config['max_files']) { - $name = date('Ymd') . '_' . $type; - } else { - $name = date('d') . '_' . $type; - } - - return $path . DIRECTORY_SEPARATOR . $name . '.log'; - } - - /** - * 检查日志文件大小并自动生成备份文件 - * @access protected - * @param string $destination 日志文件 - * @return void - */ - protected function checkLogSize(string $destination): void - { - if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) { - try { - rename($destination, dirname($destination) . DIRECTORY_SEPARATOR . time() . '-' . basename($destination)); - } catch (\Exception $e) { - // - } - } - } -} diff --git a/vendor/topthink/framework/src/think/log/driver/Socket.php b/vendor/topthink/framework/src/think/log/driver/Socket.php deleted file mode 100644 index 2cfb943..0000000 --- a/vendor/topthink/framework/src/think/log/driver/Socket.php +++ /dev/null @@ -1,311 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\log\driver; - -use Psr\Container\NotFoundExceptionInterface; -use think\App; -use think\contract\LogHandlerInterface; - -/** - * github: https://github.com/luofei614/SocketLog - * @author luofei614 - */ -class Socket implements LogHandlerInterface -{ - protected $app; - - protected $config = [ - // socket服务器地址 - 'host' => 'localhost', - // socket服务器端口 - 'port' => 1116, - // 是否显示加载的文件列表 - 'show_included_files' => false, - // 日志强制记录到配置的client_id - 'force_client_ids' => [], - // 限制允许读取日志的client_id - 'allow_client_ids' => [], - // 调试开关 - 'debug' => false, - // 输出到浏览器时默认展开的日志级别 - 'expand_level' => ['debug'], - // 日志头渲染回调 - 'format_head' => null, - // curl opt - 'curl_opt' => [ - CURLOPT_CONNECTTIMEOUT => 1, - CURLOPT_TIMEOUT => 10, - ], - ]; - - protected $css = [ - 'sql' => 'color:#009bb4;', - 'sql_warn' => 'color:#009bb4;font-size:14px;', - 'error' => 'color:#f4006b;font-size:14px;', - 'page' => 'color:#40e2ff;background:#171717;', - 'big' => 'font-size:20px;color:red;', - ]; - - protected $allowForceClientIds = []; //配置强制推送且被授权的client_id - - protected $clientArg = []; - - /** - * 架构函数 - * @access public - * @param App $app - * @param array $config 缓存参数 - */ - public function __construct(App $app, array $config = []) - { - $this->app = $app; - - if (!empty($config)) { - $this->config = array_merge($this->config, $config); - } - - if (!isset($config['debug'])) { - $this->config['debug'] = $app->isDebug(); - } - } - - /** - * 调试输出接口 - * @access public - * @param array $log 日志信息 - * @return bool - */ - public function save(array $log = []): bool - { - if (!$this->check()) { - return false; - } - - $trace = []; - - if ($this->config['debug']) { - if ($this->app->exists('request')) { - $currentUri = $this->app->request->url(true); - } else { - $currentUri = 'cmd:' . implode(' ', $_SERVER['argv'] ?? []); - } - - if (!empty($this->config['format_head'])) { - try { - $currentUri = $this->app->invoke($this->config['format_head'], [$currentUri]); - } catch (NotFoundExceptionInterface $notFoundException) { - // Ignore exception - } - } - - // 基本信息 - $trace[] = [ - 'type' => 'group', - 'msg' => $currentUri, - 'css' => $this->css['page'], - ]; - } - - $expandLevel = array_flip($this->config['expand_level']); - - foreach ($log as $type => $val) { - $trace[] = [ - 'type' => isset($expandLevel[$type]) ? 'group' : 'groupCollapsed', - 'msg' => '[ ' . $type . ' ]', - 'css' => $this->css[$type] ?? '', - ]; - - foreach ($val as $msg) { - if (!is_string($msg)) { - $msg = var_export($msg, true); - } - $trace[] = [ - 'type' => 'log', - 'msg' => $msg, - 'css' => '', - ]; - } - - $trace[] = [ - 'type' => 'groupEnd', - 'msg' => '', - 'css' => '', - ]; - } - - if ($this->config['show_included_files']) { - $trace[] = [ - 'type' => 'groupCollapsed', - 'msg' => '[ file ]', - 'css' => '', - ]; - - $trace[] = [ - 'type' => 'log', - 'msg' => implode("\n", get_included_files()), - 'css' => '', - ]; - - $trace[] = [ - 'type' => 'groupEnd', - 'msg' => '', - 'css' => '', - ]; - } - - $trace[] = [ - 'type' => 'groupEnd', - 'msg' => '', - 'css' => '', - ]; - - $tabid = $this->getClientArg('tabid'); - - if (!$clientId = $this->getClientArg('client_id')) { - $clientId = ''; - } - - if (!empty($this->allowForceClientIds)) { - //强制推送到多个client_id - foreach ($this->allowForceClientIds as $forceClientId) { - $clientId = $forceClientId; - $this->sendToClient($tabid, $clientId, $trace, $forceClientId); - } - } else { - $this->sendToClient($tabid, $clientId, $trace, ''); - } - - return true; - } - - /** - * 发送给指定客户端 - * @access protected - * @author Zjmainstay - * @param $tabid - * @param $clientId - * @param $logs - * @param $forceClientId - */ - protected function sendToClient($tabid, $clientId, $logs, $forceClientId) - { - $logs = [ - 'tabid' => $tabid, - 'client_id' => $clientId, - 'logs' => $logs, - 'force_client_id' => $forceClientId, - ]; - - $msg = json_encode($logs, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR); - $address = '/' . $clientId; //将client_id作为地址, server端通过地址判断将日志发布给谁 - - $this->send($this->config['host'], $this->config['port'], $msg, $address); - } - - /** - * 检测客户授权 - * @access protected - * @return bool - */ - protected function check() - { - $tabid = $this->getClientArg('tabid'); - - //是否记录日志的检查 - if (!$tabid && !$this->config['force_client_ids']) { - return false; - } - - //用户认证 - $allowClientIds = $this->config['allow_client_ids']; - - if (!empty($allowClientIds)) { - //通过数组交集得出授权强制推送的client_id - $this->allowForceClientIds = array_intersect($allowClientIds, $this->config['force_client_ids']); - if (!$tabid && count($this->allowForceClientIds)) { - return true; - } - - $clientId = $this->getClientArg('client_id'); - if (!in_array($clientId, $allowClientIds)) { - return false; - } - } else { - $this->allowForceClientIds = $this->config['force_client_ids']; - } - - return true; - } - - /** - * 获取客户参数 - * @access protected - * @param string $name - * @return string - */ - protected function getClientArg(string $name) - { - if (!$this->app->exists('request')) { - return ''; - } - - if (empty($this->clientArg)) { - if (empty($socketLog = $this->app->request->header('socketlog'))) { - if (empty($socketLog = $this->app->request->header('User-Agent'))) { - return ''; - } - } - - if (!preg_match('/SocketLog\((.*?)\)/', $socketLog, $match)) { - $this->clientArg = ['tabid' => null, 'client_id' => null]; - return ''; - } - parse_str($match[1] ?? '', $this->clientArg); - } - - if (isset($this->clientArg[$name])) { - return $this->clientArg[$name]; - } - - return ''; - } - - /** - * @access protected - * @param string $host - $host of socket server - * @param int $port - $port of socket server - * @param string $message - 发送的消息 - * @param string $address - 地址 - * @return bool - */ - protected function send($host, $port, $message = '', $address = '/') - { - $url = 'http://' . $host . ':' . $port . $address; - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $message); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->config['curl_opt'][CURLOPT_CONNECTTIMEOUT] ?? 1); - curl_setopt($ch, CURLOPT_TIMEOUT, $this->config['curl_opt'][CURLOPT_TIMEOUT] ?? 10); - - $headers = [ - "Content-Type: application/json;charset=UTF-8", - ]; - - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //设置header - - return curl_exec($ch); - } -} diff --git a/vendor/topthink/framework/src/think/middleware/AllowCrossDomain.php b/vendor/topthink/framework/src/think/middleware/AllowCrossDomain.php deleted file mode 100644 index b7ab842..0000000 --- a/vendor/topthink/framework/src/think/middleware/AllowCrossDomain.php +++ /dev/null @@ -1,63 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\middleware; - -use Closure; -use think\Config; -use think\Request; -use think\Response; - -/** - * 跨域请求支持 - */ -class AllowCrossDomain -{ - protected $cookieDomain; - - protected $header = [ - 'Access-Control-Allow-Credentials' => 'true', - 'Access-Control-Max-Age' => 1800, - 'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, DELETE, OPTIONS', - 'Access-Control-Allow-Headers' => 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-CSRF-TOKEN, X-Requested-With', - ]; - - public function __construct(Config $config) - { - $this->cookieDomain = $config->get('cookie.domain', ''); - } - - /** - * 允许跨域请求 - * @access public - * @param Request $request - * @param Closure $next - * @param array $header - * @return Response - */ - public function handle($request, Closure $next, ? array $header = []) - { - $header = !empty($header) ? array_merge($this->header, $header) : $this->header; - - if (!isset($header['Access-Control-Allow-Origin'])) { - $origin = $request->header('origin'); - - if ($origin && ('' == $this->cookieDomain || strpos($origin, $this->cookieDomain))) { - $header['Access-Control-Allow-Origin'] = $origin; - } else { - $header['Access-Control-Allow-Origin'] = '*'; - } - } - - return $next($request)->header($header); - } -} diff --git a/vendor/topthink/framework/src/think/middleware/CheckRequestCache.php b/vendor/topthink/framework/src/think/middleware/CheckRequestCache.php deleted file mode 100644 index b114351..0000000 --- a/vendor/topthink/framework/src/think/middleware/CheckRequestCache.php +++ /dev/null @@ -1,183 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\middleware; - -use Closure; -use think\Cache; -use think\Config; -use think\Request; -use think\Response; - -/** - * 请求缓存处理 - */ -class CheckRequestCache -{ - /** - * 缓存对象 - * @var Cache - */ - protected $cache; - - /** - * 配置参数 - * @var array - */ - protected $config = [ - // 请求缓存规则 true为自动规则 - 'request_cache_key' => true, - // 请求缓存有效期 - 'request_cache_expire' => null, - // 全局请求缓存排除规则 - 'request_cache_except' => [], - // 请求缓存的Tag - 'request_cache_tag' => '', - ]; - - public function __construct(Cache $cache, Config $config) - { - $this->cache = $cache; - $this->config = array_merge($this->config, $config->get('route')); - } - - /** - * 设置当前地址的请求缓存 - * @access public - * @param Request $request - * @param Closure $next - * @param mixed $cache - * @return Response - */ - public function handle($request, Closure $next, $cache = null) - { - if ($request->isGet() && false !== $cache) { - if (false === $this->config['request_cache_key']) { - // 关闭当前缓存 - $cache = false; - } - - $cache = $cache ?? $this->getRequestCache($request); - - if ($cache) { - if (is_array($cache)) { - [$key, $expire, $tag] = array_pad($cache, 3, null); - } else { - $key = md5($request->url(true)); - $expire = $cache; - $tag = null; - } - - $key = $this->parseCacheKey($request, $key); - - if (strtotime($request->server('HTTP_IF_MODIFIED_SINCE', '')) + $expire > $request->server('REQUEST_TIME')) { - // 读取缓存 - return Response::create()->code(304); - } elseif (($hit = $this->cache->get($key)) !== null) { - [$content, $header, $when] = $hit; - if (null === $expire || $when + $expire > $request->server('REQUEST_TIME')) { - return Response::create($content)->header($header); - } - } - } - } - - $response = $next($request); - - if (isset($key) && 200 == $response->getCode() && $response->isAllowCache()) { - $header = $response->getHeader(); - $header['Cache-Control'] = 'max-age=' . $expire . ',must-revalidate'; - $header['Last-Modified'] = gmdate('D, d M Y H:i:s') . ' GMT'; - $header['Expires'] = gmdate('D, d M Y H:i:s', time() + $expire) . ' GMT'; - - $this->cache->tag($tag)->set($key, [$response->getContent(), $header, time()], $expire); - } - - return $response; - } - - /** - * 读取当前地址的请求缓存信息 - * @access protected - * @param Request $request - * @return mixed - */ - protected function getRequestCache($request) - { - $key = $this->config['request_cache_key']; - $expire = $this->config['request_cache_expire']; - $except = $this->config['request_cache_except']; - $tag = $this->config['request_cache_tag']; - - foreach ($except as $rule) { - if (0 === stripos($request->url(), $rule)) { - return; - } - } - - return [$key, $expire, $tag]; - } - - /** - * 读取当前地址的请求缓存信息 - * @access protected - * @param Request $request - * @param mixed $key - * @return null|string - */ - protected function parseCacheKey($request, $key) - { - if ($key instanceof \Closure) { - $key = call_user_func($key, $request); - } - - if (false === $key) { - // 关闭当前缓存 - return; - } - - if (true === $key) { - // 自动缓存功能 - $key = '__URL__'; - } elseif (strpos($key, '|')) { - [$key, $fun] = explode('|', $key); - } - - // 特殊规则替换 - if (false !== strpos($key, '__')) { - $key = str_replace(['__CONTROLLER__', '__ACTION__', '__URL__'], [$request->controller(), $request->action(), md5($request->url(true))], $key); - } - - if (false !== strpos($key, ':')) { - $param = $request->param(); - - foreach ($param as $item => $val) { - if (is_string($val) && false !== strpos($key, ':' . $item)) { - $key = str_replace(':' . $item, (string) $val, $key); - } - } - } elseif (strpos($key, ']')) { - if ('[' . $request->ext() . ']' == $key) { - // 缓存某个后缀的请求 - $key = md5($request->url()); - } else { - return; - } - } - - if (isset($fun)) { - $key = $fun($key); - } - - return $key; - } -} diff --git a/vendor/topthink/framework/src/think/middleware/FormTokenCheck.php b/vendor/topthink/framework/src/think/middleware/FormTokenCheck.php deleted file mode 100644 index efbb77b..0000000 --- a/vendor/topthink/framework/src/think/middleware/FormTokenCheck.php +++ /dev/null @@ -1,45 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\middleware; - -use Closure; -use think\exception\ValidateException; -use think\Request; -use think\Response; - -/** - * 表单令牌支持 - */ -class FormTokenCheck -{ - - /** - * 表单令牌检测 - * @access public - * @param Request $request - * @param Closure $next - * @param string $token 表单令牌Token名称 - * @return Response - */ - public function handle(Request $request, Closure $next, string $token = null) - { - $check = $request->checkToken($token ?: '__token__'); - - if (false === $check) { - throw new ValidateException('invalid token'); - } - - return $next($request); - } - -} diff --git a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php b/vendor/topthink/framework/src/think/middleware/LoadLangPack.php deleted file mode 100644 index 478e29c..0000000 --- a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php +++ /dev/null @@ -1,61 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\middleware; - -use Closure; -use think\App; -use think\Lang; -use think\Request; -use think\Response; - -/** - * 多语言加载 - */ -class LoadLangPack -{ - protected $app; - - protected $lang; - - public function __construct(App $app, Lang $lang) - { - $this->app = $app; - $this->lang = $lang; - } - - /** - * 路由初始化(路由规则注册) - * @access public - * @param Request $request - * @param Closure $next - * @return Response - */ - public function handle($request, Closure $next) - { - // 自动侦测当前语言 - $langset = $this->lang->detect($request); - - if ($this->lang->defaultLangSet() != $langset) { - // 加载系统语言包 - $this->lang->load([ - $this->app->getThinkPath() . 'lang' . DIRECTORY_SEPARATOR . $langset . '.php', - ]); - - $this->app->LoadLangPack($langset); - } - - $this->lang->saveToCookie($this->app->cookie); - - return $next($request); - } -} diff --git a/vendor/topthink/framework/src/think/middleware/SessionInit.php b/vendor/topthink/framework/src/think/middleware/SessionInit.php deleted file mode 100644 index 3cb2fad..0000000 --- a/vendor/topthink/framework/src/think/middleware/SessionInit.php +++ /dev/null @@ -1,80 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\middleware; - -use Closure; -use think\App; -use think\Request; -use think\Response; -use think\Session; - -/** - * Session初始化 - */ -class SessionInit -{ - - /** @var App */ - protected $app; - - /** @var Session */ - protected $session; - - public function __construct(App $app, Session $session) - { - $this->app = $app; - $this->session = $session; - } - - /** - * Session初始化 - * @access public - * @param Request $request - * @param Closure $next - * @return Response - */ - public function handle($request, Closure $next) - { - // Session初始化 - $varSessionId = $this->app->config->get('session.var_session_id'); - $cookieName = $this->session->getName(); - - if ($varSessionId && $request->request($varSessionId)) { - $sessionId = $request->request($varSessionId); - } else { - $sessionId = $request->cookie($cookieName); - } - - if ($sessionId) { - $this->session->setId($sessionId); - } - - $this->session->init(); - - $request->withSession($this->session); - - /** @var Response $response */ - $response = $next($request); - - $response->setSession($this->session); - - $this->app->cookie->set($cookieName, $this->session->getId()); - - return $response; - } - - public function end(Response $response) - { - $this->session->save(); - } -} diff --git a/vendor/topthink/framework/src/think/response/File.php b/vendor/topthink/framework/src/think/response/File.php deleted file mode 100644 index 1e45f2f..0000000 --- a/vendor/topthink/framework/src/think/response/File.php +++ /dev/null @@ -1,160 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\response; - -use think\Exception; -use think\Response; - -/** - * File Response - */ -class File extends Response -{ - protected $expire = 360; - protected $name; - protected $mimeType; - protected $isContent = false; - protected $force = true; - - public function __construct($data = '', int $code = 200) - { - $this->init($data, $code); - } - - /** - * 处理数据 - * @access protected - * @param mixed $data 要处理的数据 - * @return mixed - * @throws \Exception - */ - protected function output($data) - { - if (!$this->isContent && !is_file($data)) { - throw new Exception('file not exists:' . $data); - } - - while (ob_get_level() > 0) { - ob_end_clean(); - } - - if (!empty($this->name)) { - $name = $this->name; - } else { - $name = !$this->isContent ? pathinfo($data, PATHINFO_BASENAME) : ''; - } - - if ($this->isContent) { - $mimeType = $this->mimeType; - $size = strlen($data); - } else { - $mimeType = $this->getMimeType($data); - $size = filesize($data); - } - - $this->header['Pragma'] = 'public'; - $this->header['Content-Type'] = $mimeType ?: 'application/octet-stream'; - $this->header['Cache-control'] = 'max-age=' . $this->expire; - $this->header['Content-Disposition'] = ($this->force ? 'attachment; ' : '') . 'filename="' . $name . '"'; - $this->header['Content-Length'] = $size; - $this->header['Content-Transfer-Encoding'] = 'binary'; - $this->header['Expires'] = gmdate("D, d M Y H:i:s", time() + $this->expire) . ' GMT'; - - $this->lastModified(gmdate('D, d M Y H:i:s', time()) . ' GMT'); - - return $this->isContent ? $data : file_get_contents($data); - } - - /** - * 设置是否为内容 必须配合mimeType方法使用 - * @access public - * @param bool $content - * @return $this - */ - public function isContent(bool $content = true) - { - $this->isContent = $content; - return $this; - } - - /** - * 设置有效期 - * @access public - * @param integer $expire 有效期 - * @return $this - */ - public function expire(int $expire) - { - $this->expire = $expire; - return $this; - } - - /** - * 设置文件类型 - * @access public - * @param string $filename 文件名 - * @return $this - */ - public function mimeType(string $mimeType) - { - $this->mimeType = $mimeType; - return $this; - } - - /** - * 设置文件强制下载 - * @access public - * @param bool $force 强制浏览器下载 - * @return $this - */ - public function force(bool $force) - { - $this->force = $force; - return $this; - } - - /** - * 获取文件类型信息 - * @access public - * @param string $filename 文件名 - * @return string - */ - protected function getMimeType(string $filename): string - { - if (!empty($this->mimeType)) { - return $this->mimeType; - } - - $finfo = finfo_open(FILEINFO_MIME_TYPE); - - return finfo_file($finfo, $filename); - } - - /** - * 设置下载文件的显示名称 - * @access public - * @param string $filename 文件名 - * @param bool $extension 后缀自动识别 - * @return $this - */ - public function name(string $filename, bool $extension = true) - { - $this->name = $filename; - - if ($extension && false === strpos($filename, '.')) { - $this->name .= '.' . pathinfo($this->data, PATHINFO_EXTENSION); - } - - return $this; - } -} diff --git a/vendor/topthink/framework/src/think/response/Html.php b/vendor/topthink/framework/src/think/response/Html.php deleted file mode 100644 index c158f78..0000000 --- a/vendor/topthink/framework/src/think/response/Html.php +++ /dev/null @@ -1,34 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\response; - -use think\Cookie; -use think\Response; - -/** - * Html Response - */ -class Html extends Response -{ - /** - * 输出type - * @var string - */ - protected $contentType = 'text/html'; - - public function __construct(Cookie $cookie, $data = '', int $code = 200) - { - $this->init($data, $code); - $this->cookie = $cookie; - } -} diff --git a/vendor/topthink/framework/src/think/response/Json.php b/vendor/topthink/framework/src/think/response/Json.php deleted file mode 100644 index a84501f..0000000 --- a/vendor/topthink/framework/src/think/response/Json.php +++ /dev/null @@ -1,62 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\response; - -use think\Cookie; -use think\Response; - -/** - * Json Response - */ -class Json extends Response -{ - // 输出参数 - protected $options = [ - 'json_encode_param' => JSON_UNESCAPED_UNICODE, - ]; - - protected $contentType = 'application/json'; - - public function __construct(Cookie $cookie, $data = '', int $code = 200) - { - $this->init($data, $code); - $this->cookie = $cookie; - } - - /** - * 处理数据 - * @access protected - * @param mixed $data 要处理的数据 - * @return string - * @throws \Exception - */ - protected function output($data): string - { - try { - // 返回JSON数据格式到客户端 包含状态信息 - $data = json_encode($data, $this->options['json_encode_param']); - - if (false === $data) { - throw new \InvalidArgumentException(json_last_error_msg()); - } - - return $data; - } catch (\Exception $e) { - if ($e->getPrevious()) { - throw $e->getPrevious(); - } - throw $e; - } - } - -} diff --git a/vendor/topthink/framework/src/think/response/Jsonp.php b/vendor/topthink/framework/src/think/response/Jsonp.php deleted file mode 100644 index 81d3a06..0000000 --- a/vendor/topthink/framework/src/think/response/Jsonp.php +++ /dev/null @@ -1,74 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\response; - -use think\Cookie; -use think\Request; -use think\Response; - -/** - * Jsonp Response - */ -class Jsonp extends Response -{ - // 输出参数 - protected $options = [ - 'var_jsonp_handler' => 'callback', - 'default_jsonp_handler' => 'jsonpReturn', - 'json_encode_param' => JSON_UNESCAPED_UNICODE, - ]; - - protected $contentType = 'application/javascript'; - - protected $request; - - public function __construct(Cookie $cookie, Request $request, $data = '', int $code = 200) - { - $this->init($data, $code); - - $this->cookie = $cookie; - $this->request = $request; - } - - /** - * 处理数据 - * @access protected - * @param mixed $data 要处理的数据 - * @return string - * @throws \Exception - */ - protected function output($data): string - { - try { - // 返回JSON数据格式到客户端 包含状态信息 [当url_common_param为false时是无法获取到$_GET的数据的,故使用Request来获取] - $varJsonpHandler = $this->request->param($this->options['var_jsonp_handler'], ""); - $handler = !empty($varJsonpHandler) ? $varJsonpHandler : $this->options['default_jsonp_handler']; - - $data = json_encode($data, $this->options['json_encode_param']); - - if (false === $data) { - throw new \InvalidArgumentException(json_last_error_msg()); - } - - $data = $handler . '(' . $data . ');'; - - return $data; - } catch (\Exception $e) { - if ($e->getPrevious()) { - throw $e->getPrevious(); - } - throw $e; - } - } - -} diff --git a/vendor/topthink/framework/src/think/response/Redirect.php b/vendor/topthink/framework/src/think/response/Redirect.php deleted file mode 100644 index 1f38764..0000000 --- a/vendor/topthink/framework/src/think/response/Redirect.php +++ /dev/null @@ -1,98 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\response; - -use think\Cookie; -use think\Request; -use think\Response; -use think\Session; - -/** - * Redirect Response - */ -class Redirect extends Response -{ - - protected $request; - - public function __construct(Cookie $cookie, Request $request, Session $session, $data = '', int $code = 302) - { - $this->init((string) $data, $code); - - $this->cookie = $cookie; - $this->request = $request; - $this->session = $session; - - $this->cacheControl('no-cache,must-revalidate'); - } - - /** - * 处理数据 - * @access protected - * @param mixed $data 要处理的数据 - * @return string - */ - protected function output($data): string - { - $this->header['Location'] = $data; - - return ''; - } - - /** - * 重定向传值(通过Session) - * @access protected - * @param string|array $name 变量名或者数组 - * @param mixed $value 值 - * @return $this - */ - public function with($name, $value = null) - { - if (is_array($name)) { - foreach ($name as $key => $val) { - $this->session->flash($key, $val); - } - } else { - $this->session->flash($name, $value); - } - - return $this; - } - - /** - * 记住当前url后跳转 - * @access public - * @return $this - */ - public function remember() - { - $this->session->set('redirect_url', $this->request->url()); - - return $this; - } - - /** - * 跳转到上次记住的url - * @access public - * @return $this - */ - public function restore() - { - if ($this->session->has('redirect_url')) { - $this->data = $this->session->get('redirect_url'); - $this->session->delete('redirect_url'); - } - - return $this; - } -} diff --git a/vendor/topthink/framework/src/think/response/View.php b/vendor/topthink/framework/src/think/response/View.php deleted file mode 100644 index 2c116c7..0000000 --- a/vendor/topthink/framework/src/think/response/View.php +++ /dev/null @@ -1,151 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\response; - -use think\Cookie; -use think\Response; -use think\View as BaseView; - -/** - * View Response - */ -class View extends Response -{ - /** - * 输出参数 - * @var array - */ - protected $options = []; - - /** - * 输出变量 - * @var array - */ - protected $vars = []; - - /** - * 输出过滤 - * @var mixed - */ - protected $filter; - - /** - * 输出type - * @var string - */ - protected $contentType = 'text/html'; - - /** - * View对象 - * @var BaseView - */ - protected $view; - - /** - * 是否内容渲染 - * @var bool - */ - protected $isContent = false; - - public function __construct(Cookie $cookie, BaseView $view, $data = '', int $code = 200) - { - $this->init($data, $code); - - $this->cookie = $cookie; - $this->view = $view; - } - - /** - * 设置是否为内容渲染 - * @access public - * @param bool $content - * @return $this - */ - public function isContent(bool $content = true) - { - $this->isContent = $content; - return $this; - } - - /** - * 处理数据 - * @access protected - * @param mixed $data 要处理的数据 - * @return string - */ - protected function output($data): string - { - // 渲染模板输出 - $this->view->filter($this->filter); - return $this->isContent ? - $this->view->display($data, $this->vars) : - $this->view->fetch($data, $this->vars); - } - - /** - * 获取视图变量 - * @access public - * @param string $name 模板变量 - * @return mixed - */ - public function getVars(string $name = null) - { - if (is_null($name)) { - return $this->vars; - } else { - return $this->vars[$name] ?? null; - } - } - - /** - * 模板变量赋值 - * @access public - * @param string|array $name 模板变量 - * @param mixed $value 变量值 - * @return $this - */ - public function assign($name, $value = null) - { - if (is_array($name)) { - $this->vars = array_merge($this->vars, $name); - } else { - $this->vars[$name] = $value; - } - - return $this; - } - - /** - * 视图内容过滤 - * @access public - * @param callable $filter - * @return $this - */ - public function filter(callable $filter = null) - { - $this->filter = $filter; - return $this; - } - - /** - * 检查模板是否存在 - * @access public - * @param string $name 模板名 - * @return bool - */ - public function exists(string $name): bool - { - return $this->view->exists($name); - } - -} diff --git a/vendor/topthink/framework/src/think/response/Xml.php b/vendor/topthink/framework/src/think/response/Xml.php deleted file mode 100644 index bddbb48..0000000 --- a/vendor/topthink/framework/src/think/response/Xml.php +++ /dev/null @@ -1,127 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\response; - -use think\Collection; -use think\Cookie; -use think\Model; -use think\Response; - -/** - * XML Response - */ -class Xml extends Response -{ - // 输出参数 - protected $options = [ - // 根节点名 - 'root_node' => 'think', - // 根节点属性 - 'root_attr' => '', - //数字索引的子节点名 - 'item_node' => 'item', - // 数字索引子节点key转换的属性名 - 'item_key' => 'id', - // 数据编码 - 'encoding' => 'utf-8', - ]; - - protected $contentType = 'text/xml'; - - public function __construct(Cookie $cookie, $data = '', int $code = 200) - { - $this->init($data, $code); - $this->cookie = $cookie; - } - - /** - * 处理数据 - * @access protected - * @param mixed $data 要处理的数据 - * @return mixed - */ - protected function output($data): string - { - if (is_string($data)) { - if (0 !== strpos($data, 'options['encoding']; - $xml = ""; - $data = $xml . $data; - } - return $data; - } - - // XML数据转换 - return $this->xmlEncode($data, $this->options['root_node'], $this->options['item_node'], $this->options['root_attr'], $this->options['item_key'], $this->options['encoding']); - } - - /** - * XML编码 - * @access protected - * @param mixed $data 数据 - * @param string $root 根节点名 - * @param string $item 数字索引的子节点名 - * @param mixed $attr 根节点属性 - * @param string $id 数字索引子节点key转换的属性名 - * @param string $encoding 数据编码 - * @return string - */ - protected function xmlEncode($data, string $root, string $item, $attr, string $id, string $encoding): string - { - if (is_array($attr)) { - $array = []; - foreach ($attr as $key => $value) { - $array[] = "{$key}=\"{$value}\""; - } - $attr = implode(' ', $array); - } - - $attr = trim($attr); - $attr = empty($attr) ? '' : " {$attr}"; - $xml = ""; - $xml .= "<{$root}{$attr}>"; - $xml .= $this->dataToXml($data, $item, $id); - $xml .= ""; - - return $xml; - } - - /** - * 数据XML编码 - * @access protected - * @param mixed $data 数据 - * @param string $item 数字索引时的节点名称 - * @param string $id 数字索引key转换为的属性名 - * @return string - */ - protected function dataToXml($data, string $item, string $id): string - { - $xml = $attr = ''; - - if ($data instanceof Collection || $data instanceof Model) { - $data = $data->toArray(); - } - - foreach ($data as $key => $val) { - if (is_numeric($key)) { - $id && $attr = " {$id}=\"{$key}\""; - $key = $item; - } - $xml .= "<{$key}{$attr}>"; - $xml .= (is_array($val) || is_object($val)) ? $this->dataToXml($val, $item, $id) : $val; - $xml .= ""; - } - - return $xml; - } -} diff --git a/vendor/topthink/framework/src/think/route/Dispatch.php b/vendor/topthink/framework/src/think/route/Dispatch.php deleted file mode 100644 index e77e299..0000000 --- a/vendor/topthink/framework/src/think/route/Dispatch.php +++ /dev/null @@ -1,257 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -use think\App; -use think\Container; -use think\Request; -use think\Response; -use think\Validate; - -/** - * 路由调度基础类 - */ -abstract class Dispatch -{ - /** - * 应用对象 - * @var \think\App - */ - protected $app; - - /** - * 请求对象 - * @var Request - */ - protected $request; - - /** - * 路由规则 - * @var Rule - */ - protected $rule; - - /** - * 调度信息 - * @var mixed - */ - protected $dispatch; - - /** - * 路由变量 - * @var array - */ - protected $param; - - public function __construct(Request $request, Rule $rule, $dispatch, array $param = []) - { - $this->request = $request; - $this->rule = $rule; - $this->dispatch = $dispatch; - $this->param = $param; - } - - public function init(App $app) - { - $this->app = $app; - - // 执行路由后置操作 - $this->doRouteAfter(); - } - - /** - * 执行路由调度 - * @access public - * @return mixed - */ - public function run(): Response - { - if ($this->rule instanceof RuleItem && $this->request->method() == 'OPTIONS' && $this->rule->isAutoOptions()) { - $rules = $this->rule->getRouter()->getRule($this->rule->getRule()); - $allow = []; - foreach ($rules as $item) { - $allow[] = strtoupper($item->getMethod()); - } - - return Response::create('', 'html', 204)->header(['Allow' => implode(', ', $allow)]); - } - - $data = $this->exec(); - return $this->autoResponse($data); - } - - protected function autoResponse($data): Response - { - if ($data instanceof Response) { - $response = $data; - } elseif (!is_null($data)) { - // 默认自动识别响应输出类型 - $type = $this->request->isJson() ? 'json' : 'html'; - $response = Response::create($data, $type); - } else { - $data = ob_get_clean(); - - $content = false === $data ? '' : $data; - $status = '' === $content && $this->request->isJson() ? 204 : 200; - $response = Response::create($content, 'html', $status); - } - - return $response; - } - - /** - * 检查路由后置操作 - * @access protected - * @return void - */ - protected function doRouteAfter(): void - { - $option = $this->rule->getOption(); - - // 添加中间件 - if (!empty($option['middleware'])) { - $this->app->middleware->import($option['middleware'], 'route'); - } - - if (!empty($option['append'])) { - $this->param = array_merge($this->param, $option['append']); - } - - // 绑定模型数据 - if (!empty($option['model'])) { - $this->createBindModel($option['model'], $this->param); - } - - // 记录当前请求的路由规则 - $this->request->setRule($this->rule); - - // 记录路由变量 - $this->request->setRoute($this->param); - - // 数据自动验证 - if (isset($option['validate'])) { - $this->autoValidate($option['validate']); - } - } - - /** - * 路由绑定模型实例 - * @access protected - * @param array $bindModel 绑定模型 - * @param array $matches 路由变量 - * @return void - */ - protected function createBindModel(array $bindModel, array $matches): void - { - foreach ($bindModel as $key => $val) { - if ($val instanceof \Closure) { - $result = $this->app->invokeFunction($val, $matches); - } else { - $fields = explode('&', $key); - - if (is_array($val)) { - [$model, $exception] = $val; - } else { - $model = $val; - $exception = true; - } - - $where = []; - $match = true; - - foreach ($fields as $field) { - if (!isset($matches[$field])) { - $match = false; - break; - } else { - $where[] = [$field, '=', $matches[$field]]; - } - } - - if ($match) { - $result = $model::where($where)->failException($exception)->find(); - } - } - - if (!empty($result)) { - // 注入容器 - $this->app->instance(get_class($result), $result); - } - } - } - - /** - * 验证数据 - * @access protected - * @param array $option - * @return void - * @throws \think\exception\ValidateException - */ - protected function autoValidate(array $option): void - { - [$validate, $scene, $message, $batch] = $option; - - if (is_array($validate)) { - // 指定验证规则 - $v = new Validate(); - $v->rule($validate); - } else { - // 调用验证器 - $class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate); - - $v = new $class(); - - if (!empty($scene)) { - $v->scene($scene); - } - } - - /** @var Validate $v */ - $v->message($message) - ->batch($batch) - ->failException(true) - ->check($this->request->param()); - } - - public function getDispatch() - { - return $this->dispatch; - } - - public function getParam(): array - { - return $this->param; - } - - abstract public function exec(); - - public function __sleep() - { - return ['rule', 'dispatch', 'param', 'controller', 'actionName']; - } - - public function __wakeup() - { - $this->app = Container::pull('app'); - $this->request = $this->app->request; - } - - public function __debugInfo() - { - return [ - 'dispatch' => $this->dispatch, - 'param' => $this->param, - 'rule' => $this->rule, - ]; - } -} diff --git a/vendor/topthink/framework/src/think/route/Domain.php b/vendor/topthink/framework/src/think/route/Domain.php deleted file mode 100644 index 84f1d46..0000000 --- a/vendor/topthink/framework/src/think/route/Domain.php +++ /dev/null @@ -1,183 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -use think\helper\Str; -use think\Request; -use think\Route; -use think\route\dispatch\Callback as CallbackDispatch; -use think\route\dispatch\Controller as ControllerDispatch; - -/** - * 域名路由 - */ -class Domain extends RuleGroup -{ - /** - * 架构函数 - * @access public - * @param Route $router 路由对象 - * @param string $name 路由域名 - * @param mixed $rule 域名路由 - */ - public function __construct(Route $router, string $name = null, $rule = null) - { - $this->router = $router; - $this->domain = $name; - $this->rule = $rule; - } - - /** - * 检测域名路由 - * @access public - * @param Request $request 请求对象 - * @param string $url 访问地址 - * @param bool $completeMatch 路由是否完全匹配 - * @return Dispatch|false - */ - public function check(Request $request, string $url, bool $completeMatch = false) - { - // 检测URL绑定 - $result = $this->checkUrlBind($request, $url); - - if (!empty($this->option['append'])) { - $request->setRoute($this->option['append']); - unset($this->option['append']); - } - - if (false !== $result) { - return $result; - } - - return parent::check($request, $url, $completeMatch); - } - - /** - * 设置路由绑定 - * @access public - * @param string $bind 绑定信息 - * @return $this - */ - public function bind(string $bind) - { - $this->router->bind($bind, $this->domain); - - return $this; - } - - /** - * 检测URL绑定 - * @access private - * @param Request $request - * @param string $url URL地址 - * @return Dispatch|false - */ - private function checkUrlBind(Request $request, string $url) - { - $bind = $this->router->getDomainBind($this->domain); - - if ($bind) { - $this->parseBindAppendParam($bind); - - // 如果有URL绑定 则进行绑定检测 - $type = substr($bind, 0, 1); - $bind = substr($bind, 1); - - $bindTo = [ - '\\' => 'bindToClass', - '@' => 'bindToController', - ':' => 'bindToNamespace', - ]; - - if (isset($bindTo[$type])) { - return $this->{$bindTo[$type]}($request, $url, $bind); - } - } - - return false; - } - - protected function parseBindAppendParam(string &$bind): void - { - if (false !== strpos($bind, '?')) { - [$bind, $query] = explode('?', $bind); - parse_str($query, $vars); - $this->append($vars); - } - } - - /** - * 绑定到类 - * @access protected - * @param Request $request - * @param string $url URL地址 - * @param string $class 类名(带命名空间) - * @return CallbackDispatch - */ - protected function bindToClass(Request $request, string $url, string $class): CallbackDispatch - { - $array = explode('|', $url, 2); - $action = !empty($array[0]) ? $array[0] : $this->router->config('default_action'); - $param = []; - - if (!empty($array[1])) { - $this->parseUrlParams($array[1], $param); - } - - return new CallbackDispatch($request, $this, [$class, $action], $param); - } - - /** - * 绑定到命名空间 - * @access protected - * @param Request $request - * @param string $url URL地址 - * @param string $namespace 命名空间 - * @return CallbackDispatch - */ - protected function bindToNamespace(Request $request, string $url, string $namespace): CallbackDispatch - { - $array = explode('|', $url, 3); - $class = !empty($array[0]) ? $array[0] : $this->router->config('default_controller'); - $method = !empty($array[1]) ? $array[1] : $this->router->config('default_action'); - $param = []; - - if (!empty($array[2])) { - $this->parseUrlParams($array[2], $param); - } - - return new CallbackDispatch($request, $this, [$namespace . '\\' . Str::studly($class), $method], $param); - } - - /** - * 绑定到控制器 - * @access protected - * @param Request $request - * @param string $url URL地址 - * @param string $controller 控制器名 - * @return ControllerDispatch - */ - protected function bindToController(Request $request, string $url, string $controller): ControllerDispatch - { - $array = explode('|', $url, 2); - $action = !empty($array[0]) ? $array[0] : $this->router->config('default_action'); - $param = []; - - if (!empty($array[1])) { - $this->parseUrlParams($array[1], $param); - } - - return new ControllerDispatch($request, $this, $controller . '/' . $action, $param); - } - -} diff --git a/vendor/topthink/framework/src/think/route/Resource.php b/vendor/topthink/framework/src/think/route/Resource.php deleted file mode 100644 index bb37cb6..0000000 --- a/vendor/topthink/framework/src/think/route/Resource.php +++ /dev/null @@ -1,251 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -use think\Route; - -/** - * 资源路由类 - */ -class Resource extends RuleGroup -{ - /** - * 资源路由名称 - * @var string - */ - protected $resource; - - /** - * 资源路由地址 - * @var string - */ - protected $route; - - /** - * REST方法定义 - * @var array - */ - protected $rest = []; - - /** - * 模型绑定 - * @var array - */ - protected $model = []; - - /** - * 数据验证 - * @var array - */ - protected $validate = []; - - /** - * 中间件 - * @var array - */ - protected $middleware = []; - - /** - * 架构函数 - * @access public - * @param Route $router 路由对象 - * @param RuleGroup $parent 上级对象 - * @param string $name 资源名称 - * @param string $route 路由地址 - * @param array $rest 资源定义 - */ - public function __construct(Route $router, RuleGroup $parent = null, string $name = '', string $route = '', array $rest = []) - { - $name = ltrim($name, '/'); - $this->router = $router; - $this->parent = $parent; - $this->resource = $name; - $this->route = $route; - $this->name = strpos($name, '.') ? strstr($name, '.', true) : $name; - - $this->setFullName(); - - // 资源路由默认为完整匹配 - $this->option['complete_match'] = true; - - $this->rest = $rest; - - if ($this->parent) { - $this->domain = $this->parent->getDomain(); - $this->parent->addRuleItem($this); - } - - if ($router->isTest()) { - $this->buildResourceRule(); - } - } - - /** - * 生成资源路由规则 - * @access protected - * @return void - */ - protected function buildResourceRule(): void - { - $rule = $this->resource; - $option = $this->option; - $origin = $this->router->getGroup(); - $this->router->setGroup($this); - - if (strpos($rule, '.')) { - // 注册嵌套资源路由 - $array = explode('.', $rule); - $last = array_pop($array); - $item = []; - - foreach ($array as $val) { - $item[] = $val . '/<' . ($option['var'][$val] ?? $val . '_id') . '>'; - } - - $rule = implode('/', $item) . '/' . $last; - } - - $prefix = substr($rule, strlen($this->name) + 1); - - // 注册资源路由 - foreach ($this->rest as $key => $val) { - if ((isset($option['only']) && !in_array($key, $option['only'])) - || (isset($option['except']) && in_array($key, $option['except']))) { - continue; - } - - if (isset($last) && strpos($val[1], '') && isset($option['var'][$last])) { - $val[1] = str_replace('', '<' . $option['var'][$last] . '>', $val[1]); - } elseif (strpos($val[1], '') && isset($option['var'][$rule])) { - $val[1] = str_replace('', '<' . $option['var'][$rule] . '>', $val[1]); - } - - $ruleItem = $this->addRule(trim($prefix . $val[1], '/'), $this->route . '/' . $val[2], $val[0]); - - foreach (['model', 'validate', 'middleware', 'pattern'] as $name) { - if (isset($this->$name[$key])) { - call_user_func_array([$ruleItem, $name], (array) $this->$name[$key]); - } - - } - } - - $this->router->setGroup($origin); - } - - /** - * 设置资源允许 - * @access public - * @param array $only 资源允许 - * @return $this - */ - public function only(array $only) - { - return $this->setOption('only', $only); - } - - /** - * 设置资源排除 - * @access public - * @param array $except 排除资源 - * @return $this - */ - public function except(array $except) - { - return $this->setOption('except', $except); - } - - /** - * 设置资源路由的变量 - * @access public - * @param array $vars 资源变量 - * @return $this - */ - public function vars(array $vars) - { - return $this->setOption('var', $vars); - } - - /** - * 绑定资源验证 - * @access public - * @param array|string $name 资源类型或者验证信息 - * @param array|string $validate 验证信息 - * @return $this - */ - public function withValidate($name, $validate = []) - { - if (is_array($name)) { - $this->validate = array_merge($this->validate, $name); - } else { - $this->validate[$name] = $validate; - } - - return $this; - } - - /** - * 绑定资源模型 - * @access public - * @param array|string $name 资源类型或者模型绑定 - * @param array|string $model 模型绑定 - * @return $this - */ - public function withModel($name, $model = []) - { - if (is_array($name)) { - $this->model = array_merge($this->model, $name); - } else { - $this->model[$name] = $model; - } - - return $this; - } - - /** - * 绑定资源模型 - * @access public - * @param array|string $name 资源类型或者中间件定义 - * @param array|string $middleware 中间件定义 - * @return $this - */ - public function withMiddleware($name, $middleware = []) - { - if (is_array($name)) { - $this->middleware = array_merge($this->middleware, $name); - } else { - $this->middleware[$name] = $middleware; - } - - return $this; - } - - /** - * rest方法定义和修改 - * @access public - * @param array|string $name 方法名称 - * @param array|bool $resource 资源 - * @return $this - */ - public function rest($name, $resource = []) - { - if (is_array($name)) { - $this->rest = $resource ? $name : array_merge($this->rest, $name); - } else { - $this->rest[$name] = $resource; - } - - return $this; - } - -} diff --git a/vendor/topthink/framework/src/think/route/Rule.php b/vendor/topthink/framework/src/think/route/Rule.php deleted file mode 100644 index 31b2e0e..0000000 --- a/vendor/topthink/framework/src/think/route/Rule.php +++ /dev/null @@ -1,905 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -use Closure; -use think\Container; -use think\middleware\AllowCrossDomain; -use think\middleware\CheckRequestCache; -use think\middleware\FormTokenCheck; -use think\Request; -use think\Route; -use think\route\dispatch\Callback as CallbackDispatch; -use think\route\dispatch\Controller as ControllerDispatch; - -/** - * 路由规则基础类 - */ -abstract class Rule -{ - /** - * 路由标识 - * @var string - */ - protected $name; - - /** - * 所在域名 - * @var string - */ - protected $domain; - - /** - * 路由对象 - * @var Route - */ - protected $router; - - /** - * 路由所属分组 - * @var RuleGroup - */ - protected $parent; - - /** - * 路由规则 - * @var mixed - */ - protected $rule; - - /** - * 路由地址 - * @var string|Closure - */ - protected $route; - - /** - * 请求类型 - * @var string - */ - protected $method; - - /** - * 路由变量 - * @var array - */ - protected $vars = []; - - /** - * 路由参数 - * @var array - */ - protected $option = []; - - /** - * 路由变量规则 - * @var array - */ - protected $pattern = []; - - /** - * 需要和分组合并的路由参数 - * @var array - */ - protected $mergeOptions = ['model', 'append', 'middleware']; - - abstract public function check(Request $request, string $url, bool $completeMatch = false); - - /** - * 设置路由参数 - * @access public - * @param array $option 参数 - * @return $this - */ - public function option(array $option) - { - $this->option = array_merge($this->option, $option); - - return $this; - } - - /** - * 设置单个路由参数 - * @access public - * @param string $name 参数名 - * @param mixed $value 值 - * @return $this - */ - public function setOption(string $name, $value) - { - $this->option[$name] = $value; - - return $this; - } - - /** - * 注册变量规则 - * @access public - * @param array $pattern 变量规则 - * @return $this - */ - public function pattern(array $pattern) - { - $this->pattern = array_merge($this->pattern, $pattern); - - return $this; - } - - /** - * 设置标识 - * @access public - * @param string $name 标识名 - * @return $this - */ - public function name(string $name) - { - $this->name = $name; - - return $this; - } - - /** - * 获取路由对象 - * @access public - * @return Route - */ - public function getRouter(): Route - { - return $this->router; - } - - /** - * 获取Name - * @access public - * @return string - */ - public function getName(): string - { - return $this->name ?: ''; - } - - /** - * 获取当前路由规则 - * @access public - * @return mixed - */ - public function getRule() - { - return $this->rule; - } - - /** - * 获取当前路由地址 - * @access public - * @return mixed - */ - public function getRoute() - { - return $this->route; - } - - /** - * 获取当前路由的变量 - * @access public - * @return array - */ - public function getVars(): array - { - return $this->vars; - } - - /** - * 获取Parent对象 - * @access public - * @return $this|null - */ - public function getParent() - { - return $this->parent; - } - - /** - * 获取路由所在域名 - * @access public - * @return string - */ - public function getDomain(): string - { - return $this->domain ?: $this->parent->getDomain(); - } - - /** - * 获取路由参数 - * @access public - * @param string $name 变量名 - * @return mixed - */ - public function config(string $name = '') - { - return $this->router->config($name); - } - - /** - * 获取变量规则定义 - * @access public - * @param string $name 变量名 - * @return mixed - */ - public function getPattern(string $name = '') - { - $pattern = $this->pattern; - - if ($this->parent) { - $pattern = array_merge($this->parent->getPattern(), $pattern); - } - - if ('' === $name) { - return $pattern; - } - - return $pattern[$name] ?? null; - } - - /** - * 获取路由参数定义 - * @access public - * @param string $name 参数名 - * @param mixed $default 默认值 - * @return mixed - */ - public function getOption(string $name = '', $default = null) - { - $option = $this->option; - - if ($this->parent) { - $parentOption = $this->parent->getOption(); - - // 合并分组参数 - foreach ($this->mergeOptions as $item) { - if (isset($parentOption[$item]) && isset($option[$item])) { - $option[$item] = array_merge($parentOption[$item], $option[$item]); - } - } - - $option = array_merge($parentOption, $option); - } - - if ('' === $name) { - return $option; - } - - return $option[$name] ?? $default; - } - - /** - * 获取当前路由的请求类型 - * @access public - * @return string - */ - public function getMethod(): string - { - return strtolower($this->method); - } - - /** - * 设置路由请求类型 - * @access public - * @param string $method 请求类型 - * @return $this - */ - public function method(string $method) - { - return $this->setOption('method', strtolower($method)); - } - - /** - * 检查后缀 - * @access public - * @param string $ext URL后缀 - * @return $this - */ - public function ext(string $ext = '') - { - return $this->setOption('ext', $ext); - } - - /** - * 检查禁止后缀 - * @access public - * @param string $ext URL后缀 - * @return $this - */ - public function denyExt(string $ext = '') - { - return $this->setOption('deny_ext', $ext); - } - - /** - * 检查域名 - * @access public - * @param string $domain 域名 - * @return $this - */ - public function domain(string $domain) - { - $this->domain = $domain; - return $this->setOption('domain', $domain); - } - - /** - * 设置参数过滤检查 - * @access public - * @param array $filter 参数过滤 - * @return $this - */ - public function filter(array $filter) - { - $this->option['filter'] = $filter; - - return $this; - } - - /** - * 绑定模型 - * @access public - * @param array|string|Closure $var 路由变量名 多个使用 & 分割 - * @param string|Closure $model 绑定模型类 - * @param bool $exception 是否抛出异常 - * @return $this - */ - public function model($var, $model = null, bool $exception = true) - { - if ($var instanceof Closure) { - $this->option['model'][] = $var; - } elseif (is_array($var)) { - $this->option['model'] = $var; - } elseif (is_null($model)) { - $this->option['model']['id'] = [$var, true]; - } else { - $this->option['model'][$var] = [$model, $exception]; - } - - return $this; - } - - /** - * 附加路由隐式参数 - * @access public - * @param array $append 追加参数 - * @return $this - */ - public function append(array $append = []) - { - $this->option['append'] = $append; - - return $this; - } - - /** - * 绑定验证 - * @access public - * @param mixed $validate 验证器类 - * @param string $scene 验证场景 - * @param array $message 验证提示 - * @param bool $batch 批量验证 - * @return $this - */ - public function validate($validate, string $scene = null, array $message = [], bool $batch = false) - { - $this->option['validate'] = [$validate, $scene, $message, $batch]; - - return $this; - } - - /** - * 指定路由中间件 - * @access public - * @param string|array|Closure $middleware 中间件 - * @param mixed $params 参数 - * @return $this - */ - public function middleware($middleware, ...$params) - { - if (empty($params) && is_array($middleware)) { - $this->option['middleware'] = $middleware; - } else { - foreach ((array) $middleware as $item) { - $this->option['middleware'][] = [$item, $params]; - } - } - - return $this; - } - - /** - * 允许跨域 - * @access public - * @param array $header 自定义Header - * @return $this - */ - public function allowCrossDomain(array $header = []) - { - return $this->middleware(AllowCrossDomain::class, $header); - } - - /** - * 表单令牌验证 - * @access public - * @param string $token 表单令牌token名称 - * @return $this - */ - public function token(string $token = '__token__') - { - return $this->middleware(FormTokenCheck::class, $token); - } - - /** - * 设置路由缓存 - * @access public - * @param array|string $cache 缓存 - * @return $this - */ - public function cache($cache) - { - return $this->middleware(CheckRequestCache::class, $cache); - } - - /** - * 检查URL分隔符 - * @access public - * @param string $depr URL分隔符 - * @return $this - */ - public function depr(string $depr) - { - return $this->setOption('param_depr', $depr); - } - - /** - * 设置需要合并的路由参数 - * @access public - * @param array $option 路由参数 - * @return $this - */ - public function mergeOptions(array $option = []) - { - $this->mergeOptions = array_merge($this->mergeOptions, $option); - return $this; - } - - /** - * 检查是否为HTTPS请求 - * @access public - * @param bool $https 是否为HTTPS - * @return $this - */ - public function https(bool $https = true) - { - return $this->setOption('https', $https); - } - - /** - * 检查是否为JSON请求 - * @access public - * @param bool $json 是否为JSON - * @return $this - */ - public function json(bool $json = true) - { - return $this->setOption('json', $json); - } - - /** - * 检查是否为AJAX请求 - * @access public - * @param bool $ajax 是否为AJAX - * @return $this - */ - public function ajax(bool $ajax = true) - { - return $this->setOption('ajax', $ajax); - } - - /** - * 检查是否为PJAX请求 - * @access public - * @param bool $pjax 是否为PJAX - * @return $this - */ - public function pjax(bool $pjax = true) - { - return $this->setOption('pjax', $pjax); - } - - /** - * 路由到一个模板地址 需要额外传入的模板变量 - * @access public - * @param array $view 视图 - * @return $this - */ - public function view(array $view = []) - { - return $this->setOption('view', $view); - } - - /** - * 设置路由完整匹配 - * @access public - * @param bool $match 是否完整匹配 - * @return $this - */ - public function completeMatch(bool $match = true) - { - return $this->setOption('complete_match', $match); - } - - /** - * 是否去除URL最后的斜线 - * @access public - * @param bool $remove 是否去除最后斜线 - * @return $this - */ - public function removeSlash(bool $remove = true) - { - return $this->setOption('remove_slash', $remove); - } - - /** - * 设置路由规则全局有效 - * @access public - * @return $this - */ - public function crossDomainRule() - { - if ($this instanceof RuleGroup) { - $method = '*'; - } else { - $method = $this->method; - } - - $this->router->setCrossDomainRule($this, $method); - - return $this; - } - - /** - * 解析匹配到的规则路由 - * @access public - * @param Request $request 请求对象 - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @param string $url URL地址 - * @param array $option 路由参数 - * @param array $matches 匹配的变量 - * @return Dispatch - */ - public function parseRule(Request $request, string $rule, $route, string $url, array $option = [], array $matches = []): Dispatch - { - if (is_string($route) && isset($option['prefix'])) { - // 路由地址前缀 - $route = $option['prefix'] . $route; - } - - // 替换路由地址中的变量 - $extraParams = true; - $search = $replace = []; - $depr = $this->router->config('pathinfo_depr'); - foreach ($matches as $key => $value) { - $search[] = '<' . $key . '>'; - $replace[] = $value; - - $search[] = ':' . $key; - $replace[] = $value; - - if (strpos($value, $depr)) { - $extraParams = false; - } - } - - if (is_string($route)) { - $route = str_replace($search, $replace, $route); - } - - // 解析额外参数 - if ($extraParams) { - $count = substr_count($rule, '/'); - $url = array_slice(explode('|', $url), $count + 1); - $this->parseUrlParams(implode('|', $url), $matches); - } - - $this->vars = $matches; - - // 发起路由调度 - return $this->dispatch($request, $route, $option); - } - - /** - * 发起路由调度 - * @access protected - * @param Request $request Request对象 - * @param mixed $route 路由地址 - * @param array $option 路由参数 - * @return Dispatch - */ - protected function dispatch(Request $request, $route, array $option): Dispatch - { - if (is_subclass_of($route, Dispatch::class)) { - $result = new $route($request, $this, $route, $this->vars); - } elseif ($route instanceof Closure) { - // 执行闭包 - $result = new CallbackDispatch($request, $this, $route, $this->vars); - } elseif (false !== strpos($route, '@') || false !== strpos($route, '::') || false !== strpos($route, '\\')) { - // 路由到类的方法 - $route = str_replace('::', '@', $route); - $result = $this->dispatchMethod($request, $route); - } else { - // 路由到控制器/操作 - $result = $this->dispatchController($request, $route); - } - - return $result; - } - - /** - * 解析URL地址为 模块/控制器/操作 - * @access protected - * @param Request $request Request对象 - * @param string $route 路由地址 - * @return CallbackDispatch - */ - protected function dispatchMethod(Request $request, string $route): CallbackDispatch - { - $path = $this->parseUrlPath($route); - - $route = str_replace('/', '@', implode('/', $path)); - $method = strpos($route, '@') ? explode('@', $route) : $route; - - return new CallbackDispatch($request, $this, $method, $this->vars); - } - - /** - * 解析URL地址为 模块/控制器/操作 - * @access protected - * @param Request $request Request对象 - * @param string $route 路由地址 - * @return ControllerDispatch - */ - protected function dispatchController(Request $request, string $route): ControllerDispatch - { - $path = $this->parseUrlPath($route); - - $action = array_pop($path); - $controller = !empty($path) ? array_pop($path) : null; - - // 路由到模块/控制器/操作 - return new ControllerDispatch($request, $this, [$controller, $action], $this->vars); - } - - /** - * 路由检查 - * @access protected - * @param array $option 路由参数 - * @param Request $request Request对象 - * @return bool - */ - protected function checkOption(array $option, Request $request): bool - { - // 请求类型检测 - if (!empty($option['method'])) { - if (is_string($option['method']) && false === stripos($option['method'], $request->method())) { - return false; - } - } - - // AJAX PJAX 请求检查 - foreach (['ajax', 'pjax', 'json'] as $item) { - if (isset($option[$item])) { - $call = 'is' . $item; - if ($option[$item] && !$request->$call() || !$option[$item] && $request->$call()) { - return false; - } - } - } - - // 伪静态后缀检测 - if ($request->url() != '/' && ((isset($option['ext']) && false === stripos('|' . $option['ext'] . '|', '|' . $request->ext() . '|')) - || (isset($option['deny_ext']) && false !== stripos('|' . $option['deny_ext'] . '|', '|' . $request->ext() . '|')))) { - return false; - } - - // 域名检查 - if ((isset($option['domain']) && !in_array($option['domain'], [$request->host(true), $request->subDomain()]))) { - return false; - } - - // HTTPS检查 - if ((isset($option['https']) && $option['https'] && !$request->isSsl()) - || (isset($option['https']) && !$option['https'] && $request->isSsl())) { - return false; - } - - // 请求参数检查 - if (isset($option['filter'])) { - foreach ($option['filter'] as $name => $value) { - if ($request->param($name, '', null) != $value) { - return false; - } - } - } - - return true; - } - - /** - * 解析URL地址中的参数Request对象 - * @access protected - * @param string $rule 路由规则 - * @param array $var 变量 - * @return void - */ - protected function parseUrlParams(string $url, array &$var = []): void - { - if ($url) { - preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) { - $var[$match[1]] = strip_tags($match[2]); - }, $url); - } - } - - /** - * 解析URL的pathinfo参数 - * @access public - * @param string $url URL地址 - * @return array - */ - public function parseUrlPath(string $url): array - { - // 分隔符替换 确保路由定义使用统一的分隔符 - $url = str_replace('|', '/', $url); - $url = trim($url, '/'); - - if (strpos($url, '/')) { - // [控制器/操作] - $path = explode('/', $url); - } else { - $path = [$url]; - } - - return $path; - } - - /** - * 生成路由的正则规则 - * @access protected - * @param string $rule 路由规则 - * @param array $match 匹配的变量 - * @param array $pattern 路由变量规则 - * @param array $option 路由参数 - * @param bool $completeMatch 路由是否完全匹配 - * @param string $suffix 路由正则变量后缀 - * @return string - */ - protected function buildRuleRegex(string $rule, array $match, array $pattern = [], array $option = [], bool $completeMatch = false, string $suffix = ''): string - { - foreach ($match as $name) { - $value = $this->buildNameRegex($name, $pattern, $suffix); - if ($value) { - $origin[] = $name; - $replace[] = $value; - } - } - - // 是否区分 / 地址访问 - if ('/' != $rule) { - if (!empty($option['remove_slash'])) { - $rule = rtrim($rule, '/'); - } elseif (substr($rule, -1) == '/') { - $rule = rtrim($rule, '/'); - $hasSlash = true; - } - } - - $regex = isset($replace) ? str_replace($origin, $replace, $rule) : $rule; - $regex = str_replace([')?/', ')?-'], [')/', ')-'], $regex); - - if (isset($hasSlash)) { - $regex .= '/'; - } - - return $regex . ($completeMatch ? '$' : ''); - } - - /** - * 生成路由变量的正则规则 - * @access protected - * @param string $name 路由变量 - * @param array $pattern 变量规则 - * @param string $suffix 路由正则变量后缀 - * @return string - */ - protected function buildNameRegex(string $name, array $pattern, string $suffix): string - { - $optional = ''; - $slash = substr($name, 0, 1); - - if (in_array($slash, ['/', '-'])) { - $prefix = $slash; - $name = substr($name, 1); - $slash = substr($name, 0, 1); - } else { - $prefix = ''; - } - - if ('<' != $slash) { - return ''; - } - - if (strpos($name, '?')) { - $name = substr($name, 1, -2); - $optional = '?'; - } elseif (strpos($name, '>')) { - $name = substr($name, 1, -1); - } - - if (isset($pattern[$name])) { - $nameRule = $pattern[$name]; - if (0 === strpos($nameRule, '/') && '/' == substr($nameRule, -1)) { - $nameRule = substr($nameRule, 1, -1); - } - } else { - $nameRule = $this->router->config('default_route_pattern'); - } - - return '(' . $prefix . '(?<' . $name . $suffix . '>' . $nameRule . '))' . $optional; - } - - /** - * 设置路由参数 - * @access public - * @param string $method 方法名 - * @param array $args 调用参数 - * @return $this - */ - public function __call($method, $args) - { - if (count($args) > 1) { - $args[0] = $args; - } - array_unshift($args, $method); - - return call_user_func_array([$this, 'setOption'], $args); - } - - public function __sleep() - { - return ['name', 'rule', 'route', 'method', 'vars', 'option', 'pattern']; - } - - public function __wakeup() - { - $this->router = Container::pull('route'); - } - - public function __debugInfo() - { - return [ - 'name' => $this->name, - 'rule' => $this->rule, - 'route' => $this->route, - 'method' => $this->method, - 'vars' => $this->vars, - 'option' => $this->option, - 'pattern' => $this->pattern, - ]; - } -} diff --git a/vendor/topthink/framework/src/think/route/RuleGroup.php b/vendor/topthink/framework/src/think/route/RuleGroup.php deleted file mode 100644 index 7b9deea..0000000 --- a/vendor/topthink/framework/src/think/route/RuleGroup.php +++ /dev/null @@ -1,505 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -use Closure; -use think\Container; -use think\Exception; -use think\Request; -use think\Route; - -/** - * 路由分组类 - */ -class RuleGroup extends Rule -{ - /** - * 分组路由(包括子分组) - * @var array - */ - protected $rules = []; - - /** - * 分组路由规则 - * @var mixed - */ - protected $rule; - - /** - * MISS路由 - * @var RuleItem - */ - protected $miss; - - /** - * 完整名称 - * @var string - */ - protected $fullName; - - /** - * 分组别名 - * @var string - */ - protected $alias; - - /** - * 架构函数 - * @access public - * @param Route $router 路由对象 - * @param RuleGroup $parent 上级对象 - * @param string $name 分组名称 - * @param mixed $rule 分组路由 - */ - public function __construct(Route $router, RuleGroup $parent = null, string $name = '', $rule = null) - { - $this->router = $router; - $this->parent = $parent; - $this->rule = $rule; - $this->name = trim($name, '/'); - - $this->setFullName(); - - if ($this->parent) { - $this->domain = $this->parent->getDomain(); - $this->parent->addRuleItem($this); - } - - if ($router->isTest()) { - $this->lazy(false); - } - } - - /** - * 设置分组的路由规则 - * @access public - * @return void - */ - protected function setFullName(): void - { - if (false !== strpos($this->name, ':')) { - $this->name = preg_replace(['/\[\:(\w+)\]/', '/\:(\w+)/'], ['<\1?>', '<\1>'], $this->name); - } - - if ($this->parent && $this->parent->getFullName()) { - $this->fullName = $this->parent->getFullName() . ($this->name ? '/' . $this->name : ''); - } else { - $this->fullName = $this->name; - } - - if ($this->name) { - $this->router->getRuleName()->setGroup($this->name, $this); - } - } - - /** - * 获取所属域名 - * @access public - * @return string - */ - public function getDomain(): string - { - return $this->domain ?: '-'; - } - - /** - * 获取分组别名 - * @access public - * @return string - */ - public function getAlias(): string - { - return $this->alias ?: ''; - } - - /** - * 检测分组路由 - * @access public - * @param Request $request 请求对象 - * @param string $url 访问地址 - * @param bool $completeMatch 路由是否完全匹配 - * @return Dispatch|false - */ - public function check(Request $request, string $url, bool $completeMatch = false) - { - // 检查分组有效性 - if (!$this->checkOption($this->option, $request) || !$this->checkUrl($url)) { - return false; - } - - // 解析分组路由 - if ($this instanceof Resource) { - $this->buildResourceRule(); - } else { - $this->parseGroupRule($this->rule); - } - - // 获取当前路由规则 - $method = strtolower($request->method()); - $rules = $this->getRules($method); - $option = $this->getOption(); - - if (isset($option['complete_match'])) { - $completeMatch = $option['complete_match']; - } - - if (!empty($option['merge_rule_regex'])) { - // 合并路由正则规则进行路由匹配检查 - $result = $this->checkMergeRuleRegex($request, $rules, $url, $completeMatch); - - if (false !== $result) { - return $result; - } - } - - // 检查分组路由 - foreach ($rules as $key => $item) { - $result = $item[1]->check($request, $url, $completeMatch); - - if (false !== $result) { - return $result; - } - } - - if ($this->miss && in_array($this->miss->getMethod(), ['*', $method])) { - // 未匹配所有路由的路由规则处理 - $result = $this->parseRule($request, '', $this->miss->getRoute(), $url, $this->miss->getOption()); - } else { - $result = false; - } - - return $result; - } - - /** - * 分组URL匹配检查 - * @access protected - * @param string $url URL - * @return bool - */ - protected function checkUrl(string $url): bool - { - if ($this->fullName) { - $pos = strpos($this->fullName, '<'); - - if (false !== $pos) { - $str = substr($this->fullName, 0, $pos); - } else { - $str = $this->fullName; - } - - if ($str && 0 !== stripos(str_replace('|', '/', $url), $str)) { - return false; - } - } - - return true; - } - - /** - * 设置路由分组别名 - * @access public - * @param string $alias 路由分组别名 - * @return $this - */ - public function alias(string $alias) - { - $this->alias = $alias; - $this->router->getRuleName()->setGroup($alias, $this); - - return $this; - } - - /** - * 延迟解析分组的路由规则 - * @access public - * @param bool $lazy 路由是否延迟解析 - * @return $this - */ - public function lazy(bool $lazy = true) - { - if (!$lazy) { - $this->parseGroupRule($this->rule); - $this->rule = null; - } - - return $this; - } - - /** - * 解析分组和域名的路由规则及绑定 - * @access public - * @param mixed $rule 路由规则 - * @return void - */ - public function parseGroupRule($rule): void - { - $origin = $this->router->getGroup(); - $this->router->setGroup($this); - - if ($rule instanceof \Closure) { - Container::getInstance()->invokeFunction($rule); - } elseif (is_string($rule) && $rule) { - $this->router->bind($rule, $this->domain); - } - - $this->router->setGroup($origin); - } - - /** - * 检测分组路由 - * @access public - * @param Request $request 请求对象 - * @param array $rules 路由规则 - * @param string $url 访问地址 - * @param bool $completeMatch 路由是否完全匹配 - * @return Dispatch|false - */ - protected function checkMergeRuleRegex(Request $request, array &$rules, string $url, bool $completeMatch) - { - $depr = $this->router->config('pathinfo_depr'); - $url = $depr . str_replace('|', $depr, $url); - $regex = []; - $items = []; - - foreach ($rules as $key => $val) { - $item = $val[1]; - if ($item instanceof RuleItem) { - $rule = $depr . str_replace('/', $depr, $item->getRule()); - if ($depr == $rule && $depr != $url) { - unset($rules[$key]); - continue; - } - - $complete = $item->getOption('complete_match', $completeMatch); - - if (false === strpos($rule, '<')) { - if (0 === strcasecmp($rule, $url) || (!$complete && 0 === strncasecmp($rule, $url, strlen($rule)))) { - return $item->checkRule($request, $url, []); - } - - unset($rules[$key]); - continue; - } - - $slash = preg_quote('/-' . $depr, '/'); - - if ($matchRule = preg_split('/[' . $slash . ']<\w+\??>/', $rule, 2)) { - if ($matchRule[0] && 0 !== strncasecmp($rule, $url, strlen($matchRule[0]))) { - unset($rules[$key]); - continue; - } - } - - if (preg_match_all('/[' . $slash . ']??/', $rule, $matches)) { - unset($rules[$key]); - $pattern = array_merge($this->getPattern(), $item->getPattern()); - $option = array_merge($this->getOption(), $item->getOption()); - - $regex[$key] = $this->buildRuleRegex($rule, $matches[0], $pattern, $option, $complete, '_THINK_' . $key); - $items[$key] = $item; - } - } - } - - if (empty($regex)) { - return false; - } - - try { - $result = preg_match('~^(?:' . implode('|', $regex) . ')~u', $url, $match); - } catch (\Exception $e) { - throw new Exception('route pattern error'); - } - - if ($result) { - $var = []; - foreach ($match as $key => $val) { - if (is_string($key) && '' !== $val) { - [$name, $pos] = explode('_THINK_', $key); - - $var[$name] = $val; - } - } - - if (!isset($pos)) { - foreach ($regex as $key => $item) { - if (0 === strpos(str_replace(['\/', '\-', '\\' . $depr], ['/', '-', $depr], $item), $match[0])) { - $pos = $key; - break; - } - } - } - - $rule = $items[$pos]->getRule(); - $array = $this->router->getRule($rule); - - foreach ($array as $item) { - if (in_array($item->getMethod(), ['*', strtolower($request->method())])) { - $result = $item->checkRule($request, $url, $var); - - if (false !== $result) { - return $result; - } - } - } - } - - return false; - } - - /** - * 获取分组的MISS路由 - * @access public - * @return RuleItem|null - */ - public function getMissRule(): ? RuleItem - { - return $this->miss; - } - - /** - * 注册MISS路由 - * @access public - * @param string|Closure $route 路由地址 - * @param string $method 请求类型 - * @return RuleItem - */ - public function miss($route, string $method = '*') : RuleItem - { - // 创建路由规则实例 - $ruleItem = new RuleItem($this->router, $this, null, '', $route, strtolower($method)); - - $ruleItem->setMiss(); - $this->miss = $ruleItem; - - return $ruleItem; - } - - /** - * 添加分组下的路由规则 - * @access public - * @param string $rule 路由规则 - * @param mixed $route 路由地址 - * @param string $method 请求类型 - * @return RuleItem - */ - public function addRule(string $rule, $route = null, string $method = '*'): RuleItem - { - // 读取路由标识 - if (is_string($route)) { - $name = $route; - } else { - $name = null; - } - - $method = strtolower($method); - - if ('' === $rule || '/' === $rule) { - $rule .= '$'; - } - - // 创建路由规则实例 - $ruleItem = new RuleItem($this->router, $this, $name, $rule, $route, $method); - - $this->addRuleItem($ruleItem, $method); - - return $ruleItem; - } - - /** - * 注册分组下的路由规则 - * @access public - * @param Rule $rule 路由规则 - * @param string $method 请求类型 - * @return $this - */ - public function addRuleItem(Rule $rule, string $method = '*') - { - if (strpos($method, '|')) { - $rule->method($method); - $method = '*'; - } - - $this->rules[] = [$method, $rule]; - - if ($rule instanceof RuleItem && 'options' != $method) { - $this->rules[] = ['options', $rule->setAutoOptions()]; - } - - return $this; - } - - /** - * 设置分组的路由前缀 - * @access public - * @param string $prefix 路由前缀 - * @return $this - */ - public function prefix(string $prefix) - { - if ($this->parent && $this->parent->getOption('prefix')) { - $prefix = $this->parent->getOption('prefix') . $prefix; - } - - return $this->setOption('prefix', $prefix); - } - - /** - * 合并分组的路由规则正则 - * @access public - * @param bool $merge 是否合并 - * @return $this - */ - public function mergeRuleRegex(bool $merge = true) - { - return $this->setOption('merge_rule_regex', $merge); - } - - /** - * 获取完整分组Name - * @access public - * @return string - */ - public function getFullName(): string - { - return $this->fullName ?: ''; - } - - /** - * 获取分组的路由规则 - * @access public - * @param string $method 请求类型 - * @return array - */ - public function getRules(string $method = ''): array - { - if ('' === $method) { - return $this->rules; - } - - return array_filter($this->rules, function ($item) use ($method) { - return $method == $item[0] || '*' == $item[0]; - }); - } - - /** - * 清空分组下的路由规则 - * @access public - * @return void - */ - public function clear(): void - { - $this->rules = []; - } -} diff --git a/vendor/topthink/framework/src/think/route/RuleItem.php b/vendor/topthink/framework/src/think/route/RuleItem.php deleted file mode 100644 index 1f9aa52..0000000 --- a/vendor/topthink/framework/src/think/route/RuleItem.php +++ /dev/null @@ -1,330 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -use think\Exception; -use think\Request; -use think\Route; - -/** - * 路由规则类 - */ -class RuleItem extends Rule -{ - /** - * 是否为MISS规则 - * @var bool - */ - protected $miss = false; - - /** - * 是否为额外自动注册的OPTIONS规则 - * @var bool - */ - protected $autoOption = false; - - /** - * 架构函数 - * @access public - * @param Route $router 路由实例 - * @param RuleGroup $parent 上级对象 - * @param string $name 路由标识 - * @param string $rule 路由规则 - * @param string|\Closure $route 路由地址 - * @param string $method 请求类型 - */ - public function __construct(Route $router, RuleGroup $parent, string $name = null, string $rule = '', $route = null, string $method = '*') - { - $this->router = $router; - $this->parent = $parent; - $this->name = $name; - $this->route = $route; - $this->method = $method; - - $this->setRule($rule); - - $this->router->setRule($this->rule, $this); - } - - /** - * 设置当前路由规则为MISS路由 - * @access public - * @return $this - */ - public function setMiss() - { - $this->miss = true; - return $this; - } - - /** - * 判断当前路由规则是否为MISS路由 - * @access public - * @return bool - */ - public function isMiss(): bool - { - return $this->miss; - } - - /** - * 设置当前路由为自动注册OPTIONS - * @access public - * @return $this - */ - public function setAutoOptions() - { - $this->autoOption = true; - return $this; - } - - /** - * 判断当前路由规则是否为自动注册的OPTIONS路由 - * @access public - * @return bool - */ - public function isAutoOptions(): bool - { - return $this->autoOption; - } - - /** - * 获取当前路由的URL后缀 - * @access public - * @return string|null - */ - public function getSuffix() - { - if (isset($this->option['ext'])) { - $suffix = $this->option['ext']; - } elseif ($this->parent->getOption('ext')) { - $suffix = $this->parent->getOption('ext'); - } else { - $suffix = null; - } - - return $suffix; - } - - /** - * 路由规则预处理 - * @access public - * @param string $rule 路由规则 - * @return void - */ - public function setRule(string $rule): void - { - if ('$' == substr($rule, -1, 1)) { - // 是否完整匹配 - $rule = substr($rule, 0, -1); - - $this->option['complete_match'] = true; - } - - $rule = '/' != $rule ? ltrim($rule, '/') : ''; - - if ($this->parent && $prefix = $this->parent->getFullName()) { - $rule = $prefix . ($rule ? '/' . ltrim($rule, '/') : ''); - } - - if (false !== strpos($rule, ':')) { - $this->rule = preg_replace(['/\[\:(\w+)\]/', '/\:(\w+)/'], ['<\1?>', '<\1>'], $rule); - } else { - $this->rule = $rule; - } - - // 生成路由标识的快捷访问 - $this->setRuleName(); - } - - /** - * 设置别名 - * @access public - * @param string $name - * @return $this - */ - public function name(string $name) - { - $this->name = $name; - $this->setRuleName(true); - - return $this; - } - - /** - * 设置路由标识 用于URL反解生成 - * @access protected - * @param bool $first 是否插入开头 - * @return void - */ - protected function setRuleName(bool $first = false): void - { - if ($this->name) { - $this->router->setName($this->name, $this, $first); - } - } - - /** - * 检测路由 - * @access public - * @param Request $request 请求对象 - * @param string $url 访问地址 - * @param array $match 匹配路由变量 - * @param bool $completeMatch 路由是否完全匹配 - * @return Dispatch|false - */ - public function checkRule(Request $request, string $url, $match = null, bool $completeMatch = false) - { - // 检查参数有效性 - if (!$this->checkOption($this->option, $request)) { - return false; - } - - // 合并分组参数 - $option = $this->getOption(); - $pattern = $this->getPattern(); - $url = $this->urlSuffixCheck($request, $url, $option); - - if (is_null($match)) { - $match = $this->match($url, $option, $pattern, $completeMatch); - } - - if (false !== $match) { - return $this->parseRule($request, $this->rule, $this->route, $url, $option, $match); - } - - return false; - } - - /** - * 检测路由(含路由匹配) - * @access public - * @param Request $request 请求对象 - * @param string $url 访问地址 - * @param bool $completeMatch 路由是否完全匹配 - * @return Dispatch|false - */ - public function check(Request $request, string $url, bool $completeMatch = false) - { - return $this->checkRule($request, $url, null, $completeMatch); - } - - /** - * URL后缀及Slash检查 - * @access protected - * @param Request $request 请求对象 - * @param string $url 访问地址 - * @param array $option 路由参数 - * @return string - */ - protected function urlSuffixCheck(Request $request, string $url, array $option = []): string - { - // 是否区分 / 地址访问 - if (!empty($option['remove_slash']) && '/' != $this->rule) { - $this->rule = rtrim($this->rule, '/'); - $url = rtrim($url, '|'); - } - - if (isset($option['ext'])) { - // 路由ext参数 优先于系统配置的URL伪静态后缀参数 - $url = preg_replace('/\.(' . $request->ext() . ')$/i', '', $url); - } - - return $url; - } - - /** - * 检测URL和规则路由是否匹配 - * @access private - * @param string $url URL地址 - * @param array $option 路由参数 - * @param array $pattern 变量规则 - * @param bool $completeMatch 是否完全匹配 - * @return array|false - */ - private function match(string $url, array $option, array $pattern, bool $completeMatch) - { - if (isset($option['complete_match'])) { - $completeMatch = $option['complete_match']; - } - - $depr = $this->router->config('pathinfo_depr'); - - // 检查完整规则定义 - if (isset($pattern['__url__']) && !preg_match(0 === strpos($pattern['__url__'], '/') ? $pattern['__url__'] : '/^' . $pattern['__url__'] . ($completeMatch ? '$' : '') . '/', str_replace('|', $depr, $url))) { - return false; - } - - $var = []; - $url = $depr . str_replace('|', $depr, $url); - $rule = $depr . str_replace('/', $depr, $this->rule); - - if ($depr == $rule && $depr != $url) { - return false; - } - - if (false === strpos($rule, '<')) { - if (0 === strcasecmp($rule, $url) || (!$completeMatch && 0 === strncasecmp($rule . $depr, $url . $depr, strlen($rule . $depr)))) { - return $var; - } - return false; - } - - $slash = preg_quote('/-' . $depr, '/'); - - if ($matchRule = preg_split('/[' . $slash . ']?<\w+\??>/', $rule, 2)) { - if ($matchRule[0] && 0 !== strncasecmp($rule, $url, strlen($matchRule[0]))) { - return false; - } - } - - if (preg_match_all('/[' . $slash . ']??/', $rule, $matches)) { - $regex = $this->buildRuleRegex($rule, $matches[0], $pattern, $option, $completeMatch); - - try { - if (!preg_match('~^' . $regex . '~u', $url, $match)) { - return false; - } - } catch (\Exception $e) { - throw new Exception('route pattern error'); - } - - foreach ($match as $key => $val) { - if (is_string($key)) { - $var[$key] = $val; - } - } - } - - // 成功匹配后返回URL中的动态变量数组 - return $var; - } - - /** - * 设置路由所属分组(用于注解路由) - * @access public - * @param string $name 分组名称或者标识 - * @return $this - */ - public function group(string $name) - { - $group = $this->router->getRuleName()->getGroup($name); - - if ($group) { - $this->parent = $group; - $this->setRule($this->rule); - } - - return $this; - } -} diff --git a/vendor/topthink/framework/src/think/route/RuleName.php b/vendor/topthink/framework/src/think/route/RuleName.php deleted file mode 100644 index 0684367..0000000 --- a/vendor/topthink/framework/src/think/route/RuleName.php +++ /dev/null @@ -1,211 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -/** - * 路由标识管理类 - */ -class RuleName -{ - /** - * 路由标识 - * @var array - */ - protected $item = []; - - /** - * 路由规则 - * @var array - */ - protected $rule = []; - - /** - * 路由分组 - * @var array - */ - protected $group = []; - - /** - * 注册路由标识 - * @access public - * @param string $name 路由标识 - * @param RuleItem $ruleItem 路由规则 - * @param bool $first 是否优先 - * @return void - */ - public function setName(string $name, RuleItem $ruleItem, bool $first = false): void - { - $name = strtolower($name); - $item = $this->getRuleItemInfo($ruleItem); - if ($first && isset($this->item[$name])) { - array_unshift($this->item[$name], $item); - } else { - $this->item[$name][] = $item; - } - } - - /** - * 注册路由分组标识 - * @access public - * @param string $name 路由分组标识 - * @param RuleGroup $group 路由分组 - * @return void - */ - public function setGroup(string $name, RuleGroup $group): void - { - $this->group[strtolower($name)] = $group; - } - - /** - * 注册路由规则 - * @access public - * @param string $rule 路由规则 - * @param RuleItem $ruleItem 路由 - * @return void - */ - public function setRule(string $rule, RuleItem $ruleItem): void - { - $route = $ruleItem->getRoute(); - - if (is_string($route)) { - $this->rule[$rule][$route] = $ruleItem; - } else { - $this->rule[$rule][] = $ruleItem; - } - } - - /** - * 根据路由规则获取路由对象(列表) - * @access public - * @param string $rule 路由标识 - * @return RuleItem[] - */ - public function getRule(string $rule): array - { - return $this->rule[$rule] ?? []; - } - - /** - * 根据路由分组标识获取分组 - * @access public - * @param string $name 路由分组标识 - * @return RuleGroup|null - */ - public function getGroup(string $name) - { - return $this->group[strtolower($name)] ?? null; - } - - /** - * 清空路由规则 - * @access public - * @return void - */ - public function clear(): void - { - $this->item = []; - $this->rule = []; - } - - /** - * 获取全部路由列表 - * @access public - * @return array - */ - public function getRuleList(): array - { - $list = []; - - foreach ($this->rule as $rule => $rules) { - foreach ($rules as $item) { - $val = []; - - foreach (['method', 'rule', 'name', 'route', 'domain', 'pattern', 'option'] as $param) { - $call = 'get' . $param; - $val[$param] = $item->$call(); - } - - if ($item->isMiss()) { - $val['rule'] .= ''; - } - - $list[] = $val; - } - } - - return $list; - } - - /** - * 导入路由标识 - * @access public - * @param array $item 路由标识 - * @return void - */ - public function import(array $item): void - { - $this->item = $item; - } - - /** - * 根据路由标识获取路由信息(用于URL生成) - * @access public - * @param string $name 路由标识 - * @param string $domain 域名 - * @param string $method 请求类型 - * @return array - */ - public function getName(string $name = null, string $domain = null, string $method = '*'): array - { - if (is_null($name)) { - return $this->item; - } - - $name = strtolower($name); - $method = strtolower($method); - $result = []; - - if (isset($this->item[$name])) { - if (is_null($domain)) { - $result = $this->item[$name]; - } else { - foreach ($this->item[$name] as $item) { - $itemDomain = $item['domain']; - $itemMethod = $item['method']; - - if (($itemDomain == $domain || '-' == $itemDomain) && ('*' == $itemMethod || '*' == $method || $method == $itemMethod)) { - $result[] = $item; - } - } - } - } - - return $result; - } - - /** - * 获取路由信息 - * @access protected - * @param RuleItem $item 路由规则 - * @return array - */ - protected function getRuleItemInfo(RuleItem $item): array - { - return [ - 'rule' => $item->getRule(), - 'domain' => $item->getDomain(), - 'method' => $item->getMethod(), - 'suffix' => $item->getSuffix(), - ]; - } -} diff --git a/vendor/topthink/framework/src/think/route/Url.php b/vendor/topthink/framework/src/think/route/Url.php deleted file mode 100644 index 8dd410c..0000000 --- a/vendor/topthink/framework/src/think/route/Url.php +++ /dev/null @@ -1,517 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route; - -use think\App; -use think\Route; - -/** - * 路由地址生成 - */ -class Url -{ - /** - * 应用对象 - * @var App - */ - protected $app; - - /** - * 路由对象 - * @var Route - */ - protected $route; - - /** - * URL变量 - * @var array - */ - protected $vars = []; - - /** - * 路由URL - * @var string - */ - protected $url; - - /** - * URL 根地址 - * @var string - */ - protected $root = ''; - - /** - * HTTPS - * @var bool - */ - protected $https; - - /** - * URL后缀 - * @var string|bool - */ - protected $suffix = true; - - /** - * URL域名 - * @var string|bool - */ - protected $domain = false; - - /** - * 架构函数 - * @access public - * @param string $url URL地址 - * @param array $vars 参数 - */ - public function __construct(Route $route, App $app, string $url = '', array $vars = []) - { - $this->route = $route; - $this->app = $app; - $this->url = $url; - $this->vars = $vars; - } - - /** - * 设置URL参数 - * @access public - * @param array $vars URL参数 - * @return $this - */ - public function vars(array $vars = []) - { - $this->vars = $vars; - return $this; - } - - /** - * 设置URL后缀 - * @access public - * @param string|bool $suffix URL后缀 - * @return $this - */ - public function suffix($suffix) - { - $this->suffix = $suffix; - return $this; - } - - /** - * 设置URL域名(或者子域名) - * @access public - * @param string|bool $domain URL域名 - * @return $this - */ - public function domain($domain) - { - $this->domain = $domain; - return $this; - } - - /** - * 设置URL 根地址 - * @access public - * @param string $root URL root - * @return $this - */ - public function root(string $root) - { - $this->root = $root; - return $this; - } - - /** - * 设置是否使用HTTPS - * @access public - * @param bool $https - * @return $this - */ - public function https(bool $https = true) - { - $this->https = $https; - return $this; - } - - /** - * 检测域名 - * @access protected - * @param string $url URL - * @param string|true $domain 域名 - * @return string - */ - protected function parseDomain(string &$url, $domain): string - { - if (!$domain) { - return ''; - } - - $request = $this->app->request; - $rootDomain = $request->rootDomain(); - - if (true === $domain) { - // 自动判断域名 - $domain = $request->host(); - $domains = $this->route->getDomains(); - - if (!empty($domains)) { - $routeDomain = array_keys($domains); - foreach ($routeDomain as $domainPrefix) { - if (0 === strpos($domainPrefix, '*.') && strpos($domain, ltrim($domainPrefix, '*.')) !== false) { - foreach ($domains as $key => $rule) { - $rule = is_array($rule) ? $rule[0] : $rule; - if (is_string($rule) && false === strpos($key, '*') && 0 === strpos($url, $rule)) { - $url = ltrim($url, $rule); - $domain = $key; - - // 生成对应子域名 - if (!empty($rootDomain)) { - $domain .= $rootDomain; - } - break; - } elseif (false !== strpos($key, '*')) { - if (!empty($rootDomain)) { - $domain .= $rootDomain; - } - - break; - } - } - } - } - } - } elseif (false === strpos($domain, '.') && 0 !== strpos($domain, $rootDomain)) { - $domain .= '.' . $rootDomain; - } - - if (false !== strpos($domain, '://')) { - $scheme = ''; - } else { - $scheme = $this->https || $request->isSsl() ? 'https://' : 'http://'; - } - - return $scheme . $domain; - } - - /** - * 解析URL后缀 - * @access protected - * @param string|bool $suffix 后缀 - * @return string - */ - protected function parseSuffix($suffix): string - { - if ($suffix) { - $suffix = true === $suffix ? $this->route->config('url_html_suffix') : $suffix; - - if (is_string($suffix) && $pos = strpos($suffix, '|')) { - $suffix = substr($suffix, 0, $pos); - } - } - - return (empty($suffix) || 0 === strpos($suffix, '.')) ? (string) $suffix : '.' . $suffix; - } - - /** - * 直接解析URL地址 - * @access protected - * @param string $url URL - * @param string|bool $domain Domain - * @return string - */ - protected function parseUrl(string $url, &$domain): string - { - $request = $this->app->request; - - if (0 === strpos($url, '/')) { - // 直接作为路由地址解析 - $url = substr($url, 1); - } elseif (false !== strpos($url, '\\')) { - // 解析到类 - $url = ltrim(str_replace('\\', '/', $url), '/'); - } elseif (0 === strpos($url, '@')) { - // 解析到控制器 - $url = substr($url, 1); - } elseif ('' === $url) { - $url = $request->controller() . '/' . $request->action(); - } else { - $controller = $request->controller(); - - $path = explode('/', $url); - $action = array_pop($path); - $controller = empty($path) ? $controller : array_pop($path); - - $url = $controller . '/' . $action; - } - - return $url; - } - - /** - * 分析路由规则中的变量 - * @access protected - * @param string $rule 路由规则 - * @return array - */ - protected function parseVar(string $rule): array - { - // 提取路由规则中的变量 - $var = []; - - if (preg_match_all('/<\w+\??>/', $rule, $matches)) { - foreach ($matches[0] as $name) { - $optional = false; - - if (strpos($name, '?')) { - $name = substr($name, 1, -2); - $optional = true; - } else { - $name = substr($name, 1, -1); - } - - $var[$name] = $optional ? 2 : 1; - } - } - - return $var; - } - - /** - * 匹配路由地址 - * @access protected - * @param array $rule 路由规则 - * @param array $vars 路由变量 - * @param mixed $allowDomain 允许域名 - * @return array - */ - protected function getRuleUrl(array $rule, array &$vars = [], $allowDomain = ''): array - { - $request = $this->app->request; - if (is_string($allowDomain) && false === strpos($allowDomain, '.')) { - $allowDomain .= '.' . $request->rootDomain(); - } - $port = $request->port(); - - foreach ($rule as $item) { - $url = $item['rule']; - $pattern = $this->parseVar($url); - $domain = $item['domain']; - $suffix = $item['suffix']; - - if ('-' == $domain) { - $domain = is_string($allowDomain) ? $allowDomain : $request->host(true); - } - - if (is_string($allowDomain) && $domain != $allowDomain) { - continue; - } - - if ($port && !in_array($port, [80, 443])) { - $domain .= ':' . $port; - } - - if (empty($pattern)) { - return [rtrim($url, '?/-'), $domain, $suffix]; - } - - $type = $this->route->config('url_common_param'); - $keys = []; - - foreach ($pattern as $key => $val) { - if (isset($vars[$key])) { - $url = str_replace(['[:' . $key . ']', '<' . $key . '?>', ':' . $key, '<' . $key . '>'], $type ? (string) $vars[$key] : urlencode((string) $vars[$key]), $url); - $keys[] = $key; - $url = str_replace(['/?', '-?'], ['/', '-'], $url); - $result = [rtrim($url, '?/-'), $domain, $suffix]; - } elseif (2 == $val) { - $url = str_replace(['/[:' . $key . ']', '[:' . $key . ']', '<' . $key . '?>'], '', $url); - $url = str_replace(['/?', '-?'], ['/', '-'], $url); - $result = [rtrim($url, '?/-'), $domain, $suffix]; - } else { - $result = null; - $keys = []; - break; - } - } - - $vars = array_diff_key($vars, array_flip($keys)); - - if (isset($result)) { - return $result; - } - } - - return []; - } - - /** - * 生成URL地址 - * @access public - * @return string - */ - public function build() - { - // 解析URL - $url = $this->url; - $suffix = $this->suffix; - $domain = $this->domain; - $request = $this->app->request; - $vars = $this->vars; - - if (0 === strpos($url, '[') && $pos = strpos($url, ']')) { - // [name] 表示使用路由命名标识生成URL - $name = substr($url, 1, $pos - 1); - $url = 'name' . substr($url, $pos + 1); - } - - if (false === strpos($url, '://') && 0 !== strpos($url, '/')) { - $info = parse_url($url); - $url = !empty($info['path']) ? $info['path'] : ''; - - if (isset($info['fragment'])) { - // 解析锚点 - $anchor = $info['fragment']; - - if (false !== strpos($anchor, '?')) { - // 解析参数 - [$anchor, $info['query']] = explode('?', $anchor, 2); - } - - if (false !== strpos($anchor, '@')) { - // 解析域名 - [$anchor, $domain] = explode('@', $anchor, 2); - } - } elseif (strpos($url, '@') && false === strpos($url, '\\')) { - // 解析域名 - [$url, $domain] = explode('@', $url, 2); - } - } - - if ($url) { - $checkName = isset($name) ? $name : $url . (isset($info['query']) ? '?' . $info['query'] : ''); - $checkDomain = $domain && is_string($domain) ? $domain : null; - - $rule = $this->route->getName($checkName, $checkDomain); - - if (empty($rule) && isset($info['query'])) { - $rule = $this->route->getName($url, $checkDomain); - // 解析地址里面参数 合并到vars - parse_str($info['query'], $params); - $vars = array_merge($params, $vars); - unset($info['query']); - } - } - - if (!empty($rule) && $match = $this->getRuleUrl($rule, $vars, $domain)) { - // 匹配路由命名标识 - $url = $match[0]; - - if ($domain && !empty($match[1])) { - $domain = $match[1]; - } - - if (!is_null($match[2])) { - $suffix = $match[2]; - } - } elseif (!empty($rule) && isset($name)) { - throw new \InvalidArgumentException('route name not exists:' . $name); - } else { - // 检测URL绑定 - $bind = $this->route->getDomainBind($domain && is_string($domain) ? $domain : null); - - if ($bind && 0 === strpos($url, $bind)) { - $url = substr($url, strlen($bind) + 1); - } else { - $binds = $this->route->getBind(); - - foreach ($binds as $key => $val) { - if (is_string($val) && 0 === strpos($url, $val) && substr_count($val, '/') > 1) { - $url = substr($url, strlen($val) + 1); - $domain = $key; - break; - } - } - } - - // 路由标识不存在 直接解析 - $url = $this->parseUrl($url, $domain); - - if (isset($info['query'])) { - // 解析地址里面参数 合并到vars - parse_str($info['query'], $params); - $vars = array_merge($params, $vars); - } - } - - // 还原URL分隔符 - $depr = $this->route->config('pathinfo_depr'); - $url = str_replace('/', $depr, $url); - - $file = $request->baseFile(); - if ($file && 0 !== strpos($request->url(), $file)) { - $file = str_replace('\\', '/', dirname($file)); - } - - $url = rtrim($file, '/') . '/' . $url; - - // URL后缀 - if ('/' == substr($url, -1) || '' == $url) { - $suffix = ''; - } else { - $suffix = $this->parseSuffix($suffix); - } - - // 锚点 - $anchor = !empty($anchor) ? '#' . $anchor : ''; - - // 参数组装 - if (!empty($vars)) { - // 添加参数 - if ($this->route->config('url_common_param')) { - $vars = http_build_query($vars); - $url .= $suffix . ($vars ? '?' . $vars : '') . $anchor; - } else { - foreach ($vars as $var => $val) { - $val = (string) $val; - if ('' !== $val) { - $url .= $depr . $var . $depr . urlencode($val); - } - } - - $url .= $suffix . $anchor; - } - } else { - $url .= $suffix . $anchor; - } - - // 检测域名 - $domain = $this->parseDomain($url, $domain); - - // URL组装 - return $domain . rtrim($this->root, '/') . '/' . ltrim($url, '/'); - } - - public function __toString() - { - return $this->build(); - } - - public function __debugInfo() - { - return [ - 'url' => $this->url, - 'vars' => $this->vars, - 'suffix' => $this->suffix, - 'domain' => $this->domain, - ]; - } -} diff --git a/vendor/topthink/framework/src/think/route/dispatch/Callback.php b/vendor/topthink/framework/src/think/route/dispatch/Callback.php deleted file mode 100644 index 2044ef8..0000000 --- a/vendor/topthink/framework/src/think/route/dispatch/Callback.php +++ /dev/null @@ -1,30 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route\dispatch; - -use think\route\Dispatch; - -/** - * Callback Dispatcher - */ -class Callback extends Dispatch -{ - public function exec() - { - // 执行回调方法 - $vars = array_merge($this->request->param(), $this->param); - - return $this->app->invoke($this->dispatch, $vars); - } - -} diff --git a/vendor/topthink/framework/src/think/route/dispatch/Controller.php b/vendor/topthink/framework/src/think/route/dispatch/Controller.php deleted file mode 100644 index 611101b..0000000 --- a/vendor/topthink/framework/src/think/route/dispatch/Controller.php +++ /dev/null @@ -1,183 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route\dispatch; - -use ReflectionClass; -use ReflectionException; -use ReflectionMethod; -use think\App; -use think\exception\ClassNotFoundException; -use think\exception\HttpException; -use think\helper\Str; -use think\route\Dispatch; - -/** - * Controller Dispatcher - */ -class Controller extends Dispatch -{ - /** - * 控制器名 - * @var string - */ - protected $controller; - - /** - * 操作名 - * @var string - */ - protected $actionName; - - public function init(App $app) - { - parent::init($app); - - $result = $this->dispatch; - - if (is_string($result)) { - $result = explode('/', $result); - } - - // 获取控制器名 - $controller = strip_tags($result[0] ?: $this->rule->config('default_controller')); - - if (strpos($controller, '.')) { - $pos = strrpos($controller, '.'); - $this->controller = substr($controller, 0, $pos) . '.' . Str::studly(substr($controller, $pos + 1)); - } else { - $this->controller = Str::studly($controller); - } - - // 获取操作名 - $this->actionName = strip_tags($result[1] ?: $this->rule->config('default_action')); - - // 设置当前请求的控制器、操作 - $this->request - ->setController($this->controller) - ->setAction($this->actionName); - } - - public function exec() - { - try { - // 实例化控制器 - $instance = $this->controller($this->controller); - } catch (ClassNotFoundException $e) { - throw new HttpException(404, 'controller not exists:' . $e->getClass()); - } - - // 注册控制器中间件 - $this->registerControllerMiddleware($instance); - - return $this->app->middleware->pipeline('controller') - ->send($this->request) - ->then(function () use ($instance) { - // 获取当前操作名 - $suffix = $this->rule->config('action_suffix'); - $action = $this->actionName . $suffix; - - if (is_callable([$instance, $action])) { - $vars = $this->request->param(); - try { - $reflect = new ReflectionMethod($instance, $action); - // 严格获取当前操作方法名 - $actionName = $reflect->getName(); - if ($suffix) { - $actionName = substr($actionName, 0, -strlen($suffix)); - } - - $this->request->setAction($actionName); - } catch (ReflectionException $e) { - $reflect = new ReflectionMethod($instance, '__call'); - $vars = [$action, $vars]; - $this->request->setAction($action); - } - } else { - // 操作不存在 - throw new HttpException(404, 'method not exists:' . get_class($instance) . '->' . $action . '()'); - } - - $data = $this->app->invokeReflectMethod($instance, $reflect, $vars); - - return $this->autoResponse($data); - }); - } - - /** - * 使用反射机制注册控制器中间件 - * @access public - * @param object $controller 控制器实例 - * @return void - */ - protected function registerControllerMiddleware($controller): void - { - $class = new ReflectionClass($controller); - - if ($class->hasProperty('middleware')) { - $reflectionProperty = $class->getProperty('middleware'); - $reflectionProperty->setAccessible(true); - - $middlewares = $reflectionProperty->getValue($controller); - - foreach ($middlewares as $key => $val) { - if (!is_int($key)) { - if (isset($val['only']) && !in_array($this->request->action(true), array_map(function ($item) { - return strtolower($item); - }, is_string($val['only']) ? explode(",", $val['only']) : $val['only']))) { - continue; - } elseif (isset($val['except']) && in_array($this->request->action(true), array_map(function ($item) { - return strtolower($item); - }, is_string($val['except']) ? explode(',', $val['except']) : $val['except']))) { - continue; - } else { - $val = $key; - } - } - - if (is_string($val) && strpos($val, ':')) { - $val = explode(':', $val); - if (count($val) > 1) { - $val = [$val[0], array_slice($val, 1)]; - } - } - - $this->app->middleware->controller($val); - } - } - } - - /** - * 实例化访问控制器 - * @access public - * @param string $name 资源地址 - * @return object - * @throws ClassNotFoundException - */ - public function controller(string $name) - { - $suffix = $this->rule->config('controller_suffix') ? 'Controller' : ''; - - $controllerLayer = $this->rule->config('controller_layer') ?: 'controller'; - $emptyController = $this->rule->config('empty_controller') ?: 'Error'; - - $class = $this->app->parseClass($controllerLayer, $name . $suffix); - - if (class_exists($class)) { - return $this->app->make($class, [], true); - } elseif ($emptyController && class_exists($emptyClass = $this->app->parseClass($controllerLayer, $emptyController . $suffix))) { - return $this->app->make($emptyClass, [], true); - } - - throw new ClassNotFoundException('class not exists:' . $class, $class); - } -} diff --git a/vendor/topthink/framework/src/think/route/dispatch/Url.php b/vendor/topthink/framework/src/think/route/dispatch/Url.php deleted file mode 100644 index 147f5cb..0000000 --- a/vendor/topthink/framework/src/think/route/dispatch/Url.php +++ /dev/null @@ -1,118 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\route\dispatch; - -use think\exception\HttpException; -use think\helper\Str; -use think\Request; -use think\route\Rule; - -/** - * Url Dispatcher - */ -class Url extends Controller -{ - - public function __construct(Request $request, Rule $rule, $dispatch) - { - $this->request = $request; - $this->rule = $rule; - // 解析默认的URL规则 - $dispatch = $this->parseUrl($dispatch); - - parent::__construct($request, $rule, $dispatch, $this->param); - } - - /** - * 解析URL地址 - * @access protected - * @param string $url URL - * @return array - */ - protected function parseUrl(string $url): array - { - $depr = $this->rule->config('pathinfo_depr'); - $bind = $this->rule->getRouter()->getDomainBind(); - - if ($bind && preg_match('/^[a-z]/is', $bind)) { - $bind = str_replace('/', $depr, $bind); - // 如果有域名绑定 - $url = $bind . ('.' != substr($bind, -1) ? $depr : '') . ltrim($url, $depr); - } - - $path = $this->rule->parseUrlPath($url); - if (empty($path)) { - return [null, null]; - } - - // 解析控制器 - $controller = !empty($path) ? array_shift($path) : null; - - if ($controller && !preg_match('/^[A-Za-z0-9][\w|\.]*$/', $controller)) { - throw new HttpException(404, 'controller not exists:' . $controller); - } - - // 解析操作 - $action = !empty($path) ? array_shift($path) : null; - $var = []; - - // 解析额外参数 - if ($path) { - preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) { - $var[$match[1]] = strip_tags($match[2]); - }, implode('|', $path)); - } - - $panDomain = $this->request->panDomain(); - if ($panDomain && $key = array_search('*', $var)) { - // 泛域名赋值 - $var[$key] = $panDomain; - } - - // 设置当前请求的参数 - $this->param = $var; - - // 封装路由 - $route = [$controller, $action]; - - if ($this->hasDefinedRoute($route)) { - throw new HttpException(404, 'invalid request:' . str_replace('|', $depr, $url)); - } - - return $route; - } - - /** - * 检查URL是否已经定义过路由 - * @access protected - * @param array $route 路由信息 - * @return bool - */ - protected function hasDefinedRoute(array $route): bool - { - [$controller, $action] = $route; - - // 检查地址是否被定义过路由 - $name = strtolower(Str::studly($controller) . '/' . $action); - - $host = $this->request->host(true); - $method = $this->request->method(); - - if ($this->rule->getRouter()->getName($name, $host, $method)) { - return true; - } - - return false; - } - -} diff --git a/vendor/topthink/framework/src/think/service/ModelService.php b/vendor/topthink/framework/src/think/service/ModelService.php deleted file mode 100644 index 87cfaf9..0000000 --- a/vendor/topthink/framework/src/think/service/ModelService.php +++ /dev/null @@ -1,47 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\service; - -use think\Model; -use think\Service; - -/** - * 模型服务类 - */ -class ModelService extends Service -{ - public function boot() - { - Model::setDb($this->app->db); - Model::setEvent($this->app->event); - Model::setInvoker([$this->app, 'invoke']); - Model::maker(function (Model $model) { - $config = $this->app->config; - - $isAutoWriteTimestamp = $model->getAutoWriteTimestamp(); - - if (is_null($isAutoWriteTimestamp)) { - // 自动写入时间戳 - $model->isAutoWriteTimestamp($config->get('database.auto_timestamp', 'timestamp')); - } - - $dateFormat = $model->getDateFormat(); - - if (is_null($dateFormat)) { - // 设置时间戳格式 - $model->setDateFormat($config->get('database.datetime_format', 'Y-m-d H:i:s')); - } - - }); - } -} diff --git a/vendor/topthink/framework/src/think/service/PaginatorService.php b/vendor/topthink/framework/src/think/service/PaginatorService.php deleted file mode 100644 index a01977d..0000000 --- a/vendor/topthink/framework/src/think/service/PaginatorService.php +++ /dev/null @@ -1,52 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\service; - -use think\Paginator; -use think\paginator\driver\Bootstrap; -use think\Service; - -/** - * 分页服务类 - */ -class PaginatorService extends Service -{ - public function register() - { - if (!$this->app->bound(Paginator::class)) { - $this->app->bind(Paginator::class, Bootstrap::class); - } - } - - public function boot() - { - Paginator::maker(function (...$args) { - return $this->app->make(Paginator::class, $args, true); - }); - - Paginator::currentPathResolver(function () { - return $this->app->request->baseUrl(); - }); - - Paginator::currentPageResolver(function ($varPage = 'page') { - - $page = $this->app->request->param($varPage); - - if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { - return (int) $page; - } - - return 1; - }); - } -} diff --git a/vendor/topthink/framework/src/think/service/ValidateService.php b/vendor/topthink/framework/src/think/service/ValidateService.php deleted file mode 100644 index 94d7638..0000000 --- a/vendor/topthink/framework/src/think/service/ValidateService.php +++ /dev/null @@ -1,31 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\service; - -use think\Service; -use think\Validate; - -/** - * 验证服务类 - */ -class ValidateService extends Service -{ - public function boot() - { - Validate::maker(function (Validate $validate) { - $validate->setLang($this->app->lang); - $validate->setDb($this->app->db); - $validate->setRequest($this->app->request); - }); - } -} diff --git a/vendor/topthink/framework/src/think/session/Store.php b/vendor/topthink/framework/src/think/session/Store.php deleted file mode 100644 index 49e1ba9..0000000 --- a/vendor/topthink/framework/src/think/session/Store.php +++ /dev/null @@ -1,340 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\session; - -use think\contract\SessionHandlerInterface; -use think\helper\Arr; - -class Store -{ - - /** - * Session数据 - * @var array - */ - protected $data = []; - - /** - * 是否初始化 - * @var bool - */ - protected $init = null; - - /** - * 记录Session name - * @var string - */ - protected $name = 'PHPSESSID'; - - /** - * 记录Session Id - * @var string - */ - protected $id; - - /** - * @var SessionHandlerInterface - */ - protected $handler; - - /** @var array */ - protected $serialize = []; - - public function __construct($name, SessionHandlerInterface $handler, array $serialize = null) - { - $this->name = $name; - $this->handler = $handler; - - if (!empty($serialize)) { - $this->serialize = $serialize; - } - - $this->setId(); - } - - /** - * 设置数据 - * @access public - * @param array $data - * @return void - */ - public function setData(array $data): void - { - $this->data = $data; - } - - /** - * session初始化 - * @access public - * @return void - */ - public function init(): void - { - // 读取缓存数据 - $data = $this->handler->read($this->getId()); - - if (!empty($data)) { - $this->data = array_merge($this->data, $this->unserialize($data)); - } - - $this->init = true; - } - - /** - * 设置SessionName - * @access public - * @param string $name session_name - * @return void - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * 获取sessionName - * @access public - * @return string - */ - public function getName(): string - { - return $this->name; - } - - /** - * session_id设置 - * @access public - * @param string $id session_id - * @return void - */ - public function setId($id = null): void - { - $this->id = is_string($id) && strlen($id) === 32 && ctype_alnum($id) ? $id : md5(microtime(true) . session_create_id()); - } - - /** - * 获取session_id - * @access public - * @return string - */ - public function getId(): string - { - return $this->id; - } - - /** - * 获取所有数据 - * @return array - */ - public function all(): array - { - return $this->data; - } - - /** - * session设置 - * @access public - * @param string $name session名称 - * @param mixed $value session值 - * @return void - */ - public function set(string $name, $value): void - { - Arr::set($this->data, $name, $value); - } - - /** - * session获取 - * @access public - * @param string $name session名称 - * @param mixed $default 默认值 - * @return mixed - */ - public function get(string $name, $default = null) - { - return Arr::get($this->data, $name, $default); - } - - /** - * session获取并删除 - * @access public - * @param string $name session名称 - * @return mixed - */ - public function pull(string $name) - { - return Arr::pull($this->data, $name); - } - - /** - * 添加数据到一个session数组 - * @access public - * @param string $key - * @param mixed $value - * @return void - */ - public function push(string $key, $value): void - { - $array = $this->get($key, []); - - $array[] = $value; - - $this->set($key, $array); - } - - /** - * 判断session数据 - * @access public - * @param string $name session名称 - * @return bool - */ - public function has(string $name): bool - { - return Arr::has($this->data, $name); - } - - /** - * 删除session数据 - * @access public - * @param string $name session名称 - * @return void - */ - public function delete(string $name): void - { - Arr::forget($this->data, $name); - } - - /** - * 清空session数据 - * @access public - * @return void - */ - public function clear(): void - { - $this->data = []; - } - - /** - * 销毁session - */ - public function destroy(): void - { - $this->clear(); - - $this->regenerate(true); - } - - /** - * 重新生成session id - * @param bool $destroy - */ - public function regenerate(bool $destroy = false): void - { - if ($destroy) { - $this->handler->delete($this->getId()); - } - - $this->setId(); - } - - /** - * 保存session数据 - * @access public - * @return void - */ - public function save(): void - { - $this->clearFlashData(); - - $sessionId = $this->getId(); - - if (!empty($this->data)) { - $data = $this->serialize($this->data); - - $this->handler->write($sessionId, $data); - } else { - $this->handler->delete($sessionId); - } - - $this->init = false; - } - - /** - * session设置 下一次请求有效 - * @access public - * @param string $name session名称 - * @param mixed $value session值 - * @return void - */ - public function flash(string $name, $value): void - { - $this->set($name, $value); - $this->push('__flash__.__next__', $name); - $this->set('__flash__.__current__', Arr::except($this->get('__flash__.__current__', []), $name)); - } - - /** - * 将本次闪存数据推迟到下次请求 - * - * @return void - */ - public function reflash(): void - { - $keys = $this->get('__flash__.__current__', []); - $values = array_unique(array_merge($this->get('__flash__.__next__', []), $keys)); - $this->set('__flash__.__next__', $values); - $this->set('__flash__.__current__', []); - } - - /** - * 清空当前请求的session数据 - * @access public - * @return void - */ - public function clearFlashData(): void - { - Arr::forget($this->data, $this->get('__flash__.__current__', [])); - if (!empty($next = $this->get('__flash__.__next__', []))) { - $this->set('__flash__.__current__', $next); - } else { - $this->delete('__flash__.__current__'); - } - $this->delete('__flash__.__next__'); - } - - /** - * 序列化数据 - * @access protected - * @param mixed $data - * @return string - */ - protected function serialize($data): string - { - $serialize = $this->serialize[0] ?? 'serialize'; - - return $serialize($data); - } - - /** - * 反序列化数据 - * @access protected - * @param string $data - * @return array - */ - protected function unserialize(string $data): array - { - $unserialize = $this->serialize[1] ?? 'unserialize'; - - return (array) $unserialize($data); - } - -} diff --git a/vendor/topthink/framework/src/think/session/driver/Cache.php b/vendor/topthink/framework/src/think/session/driver/Cache.php deleted file mode 100644 index 4fabc79..0000000 --- a/vendor/topthink/framework/src/think/session/driver/Cache.php +++ /dev/null @@ -1,50 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\session\driver; - -use Psr\SimpleCache\CacheInterface; -use think\contract\SessionHandlerInterface; -use think\helper\Arr; - -class Cache implements SessionHandlerInterface -{ - - /** @var CacheInterface */ - protected $handler; - - /** @var integer */ - protected $expire; - - /** @var string */ - protected $prefix; - - public function __construct(\think\Cache $cache, array $config = []) - { - $this->handler = $cache->store(Arr::get($config, 'store')); - $this->expire = Arr::get($config, 'expire', 1440); - $this->prefix = Arr::get($config, 'prefix', ''); - } - - public function read(string $sessionId): string - { - return (string) $this->handler->get($this->prefix . $sessionId); - } - - public function delete(string $sessionId): bool - { - return $this->handler->delete($this->prefix . $sessionId); - } - - public function write(string $sessionId, string $data): bool - { - return $this->handler->set($this->prefix . $sessionId, $data, $this->expire); - } -} diff --git a/vendor/topthink/framework/src/think/session/driver/File.php b/vendor/topthink/framework/src/think/session/driver/File.php deleted file mode 100644 index 1a0734e..0000000 --- a/vendor/topthink/framework/src/think/session/driver/File.php +++ /dev/null @@ -1,249 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\session\driver; - -use Closure; -use Exception; -use FilesystemIterator; -use Generator; -use SplFileInfo; -use think\App; -use think\contract\SessionHandlerInterface; - -/** - * Session 文件驱动 - */ -class File implements SessionHandlerInterface -{ - protected $config = [ - 'path' => '', - 'expire' => 1440, - 'prefix' => '', - 'data_compress' => false, - 'gc_probability' => 1, - 'gc_divisor' => 100, - ]; - - public function __construct(App $app, array $config = []) - { - $this->config = array_merge($this->config, $config); - - if (empty($this->config['path'])) { - $this->config['path'] = $app->getRuntimePath() . 'session' . DIRECTORY_SEPARATOR; - } elseif (substr($this->config['path'], -1) != DIRECTORY_SEPARATOR) { - $this->config['path'] .= DIRECTORY_SEPARATOR; - } - - $this->init(); - } - - /** - * 打开Session - * @access protected - * @throws Exception - */ - protected function init(): void - { - try { - !is_dir($this->config['path']) && mkdir($this->config['path'], 0755, true); - } catch (\Exception $e) { - // 写入失败 - } - - // 垃圾回收 - if (random_int(1, $this->config['gc_divisor']) <= $this->config['gc_probability']) { - $this->gc(); - } - } - - /** - * Session 垃圾回收 - * @access public - * @return void - */ - public function gc(): void - { - $lifetime = $this->config['expire']; - $now = time(); - - $files = $this->findFiles($this->config['path'], function (SplFileInfo $item) use ($lifetime, $now) { - return $now - $lifetime > $item->getMTime(); - }); - - foreach ($files as $file) { - $this->unlink($file->getPathname()); - } - } - - /** - * 查找文件 - * @param string $root - * @param Closure $filter - * @return Generator - */ - protected function findFiles(string $root, Closure $filter) - { - $items = new FilesystemIterator($root); - - /** @var SplFileInfo $item */ - foreach ($items as $item) { - if ($item->isDir() && !$item->isLink()) { - yield from$this->findFiles($item->getPathname(), $filter); - } else { - if ($filter($item)) { - yield $item; - } - } - } - } - - /** - * 取得变量的存储文件名 - * @access protected - * @param string $name 缓存变量名 - * @param bool $auto 是否自动创建目录 - * @return string - */ - protected function getFileName(string $name, bool $auto = false): string - { - if ($this->config['prefix']) { - // 使用子目录 - $name = $this->config['prefix'] . DIRECTORY_SEPARATOR . 'sess_' . $name; - } else { - $name = 'sess_' . $name; - } - - $filename = $this->config['path'] . $name; - $dir = dirname($filename); - - if ($auto && !is_dir($dir)) { - try { - mkdir($dir, 0755, true); - } catch (\Exception $e) { - // 创建失败 - } - } - - return $filename; - } - - /** - * 读取Session - * @access public - * @param string $sessID - * @return string - */ - public function read(string $sessID): string - { - $filename = $this->getFileName($sessID); - - if (is_file($filename) && filemtime($filename) >= time() - $this->config['expire']) { - $content = $this->readFile($filename); - - if ($this->config['data_compress'] && function_exists('gzcompress')) { - //启用数据压缩 - $content = (string) gzuncompress($content); - } - - return $content; - } - - return ''; - } - - /** - * 写文件(加锁) - * @param $path - * @param $content - * @return bool - */ - protected function writeFile($path, $content): bool - { - return (bool) file_put_contents($path, $content, LOCK_EX); - } - - /** - * 读取文件内容(加锁) - * @param $path - * @return string - */ - protected function readFile($path): string - { - $contents = ''; - - $handle = fopen($path, 'rb'); - - if ($handle) { - try { - if (flock($handle, LOCK_SH)) { - clearstatcache(true, $path); - - $contents = fread($handle, filesize($path) ?: 1); - - flock($handle, LOCK_UN); - } - } finally { - fclose($handle); - } - } - - return $contents; - } - - /** - * 写入Session - * @access public - * @param string $sessID - * @param string $sessData - * @return bool - */ - public function write(string $sessID, string $sessData): bool - { - $filename = $this->getFileName($sessID, true); - $data = $sessData; - - if ($this->config['data_compress'] && function_exists('gzcompress')) { - //数据压缩 - $data = gzcompress($data, 3); - } - - return $this->writeFile($filename, $data); - } - - /** - * 删除Session - * @access public - * @param string $sessID - * @return bool - */ - public function delete(string $sessID): bool - { - try { - return $this->unlink($this->getFileName($sessID)); - } catch (\Exception $e) { - return false; - } - } - - /** - * 判断文件是否存在后,删除 - * @access private - * @param string $file - * @return bool - */ - private function unlink(string $file): bool - { - return is_file($file) && unlink($file); - } - -} diff --git a/vendor/topthink/framework/src/think/validate/ValidateRule.php b/vendor/topthink/framework/src/think/validate/ValidateRule.php deleted file mode 100644 index b741f53..0000000 --- a/vendor/topthink/framework/src/think/validate/ValidateRule.php +++ /dev/null @@ -1,172 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\validate; - -/** - * Class ValidateRule - * @package think\validate - * @method ValidateRule confirm(mixed $rule, string $msg = '') static 验证是否和某个字段的值一致 - * @method ValidateRule different(mixed $rule, string $msg = '') static 验证是否和某个字段的值是否不同 - * @method ValidateRule egt(mixed $rule, string $msg = '') static 验证是否大于等于某个值 - * @method ValidateRule gt(mixed $rule, string $msg = '') static 验证是否大于某个值 - * @method ValidateRule elt(mixed $rule, string $msg = '') static 验证是否小于等于某个值 - * @method ValidateRule lt(mixed $rule, string $msg = '') static 验证是否小于某个值 - * @method ValidateRule eg(mixed $rule, string $msg = '') static 验证是否等于某个值 - * @method ValidateRule in(mixed $rule, string $msg = '') static 验证是否在范围内 - * @method ValidateRule notIn(mixed $rule, string $msg = '') static 验证是否不在某个范围 - * @method ValidateRule between(mixed $rule, string $msg = '') static 验证是否在某个区间 - * @method ValidateRule notBetween(mixed $rule, string $msg = '') static 验证是否不在某个区间 - * @method ValidateRule length(mixed $rule, string $msg = '') static 验证数据长度 - * @method ValidateRule max(mixed $rule, string $msg = '') static 验证数据最大长度 - * @method ValidateRule min(mixed $rule, string $msg = '') static 验证数据最小长度 - * @method ValidateRule after(mixed $rule, string $msg = '') static 验证日期 - * @method ValidateRule before(mixed $rule, string $msg = '') static 验证日期 - * @method ValidateRule expire(mixed $rule, string $msg = '') static 验证有效期 - * @method ValidateRule allowIp(mixed $rule, string $msg = '') static 验证IP许可 - * @method ValidateRule denyIp(mixed $rule, string $msg = '') static 验证IP禁用 - * @method ValidateRule regex(mixed $rule, string $msg = '') static 使用正则验证数据 - * @method ValidateRule token(mixed $rule='__token__', string $msg = '') static 验证表单令牌 - * @method ValidateRule is(mixed $rule, string $msg = '') static 验证字段值是否为有效格式 - * @method ValidateRule isRequire(mixed $rule = null, string $msg = '') static 验证字段必须 - * @method ValidateRule isNumber(mixed $rule = null, string $msg = '') static 验证字段值是否为数字 - * @method ValidateRule isArray(mixed $rule = null, string $msg = '') static 验证字段值是否为数组 - * @method ValidateRule isInteger(mixed $rule = null, string $msg = '') static 验证字段值是否为整形 - * @method ValidateRule isFloat(mixed $rule = null, string $msg = '') static 验证字段值是否为浮点数 - * @method ValidateRule isMobile(mixed $rule = null, string $msg = '') static 验证字段值是否为手机 - * @method ValidateRule isIdCard(mixed $rule = null, string $msg = '') static 验证字段值是否为身份证号码 - * @method ValidateRule isChs(mixed $rule = null, string $msg = '') static 验证字段值是否为中文 - * @method ValidateRule isChsDash(mixed $rule = null, string $msg = '') static 验证字段值是否为中文字母及下划线 - * @method ValidateRule isChsAlpha(mixed $rule = null, string $msg = '') static 验证字段值是否为中文和字母 - * @method ValidateRule isChsAlphaNum(mixed $rule = null, string $msg = '') static 验证字段值是否为中文字母和数字 - * @method ValidateRule isDate(mixed $rule = null, string $msg = '') static 验证字段值是否为有效格式 - * @method ValidateRule isBool(mixed $rule = null, string $msg = '') static 验证字段值是否为布尔值 - * @method ValidateRule isAlpha(mixed $rule = null, string $msg = '') static 验证字段值是否为字母 - * @method ValidateRule isAlphaDash(mixed $rule = null, string $msg = '') static 验证字段值是否为字母和下划线 - * @method ValidateRule isAlphaNum(mixed $rule = null, string $msg = '') static 验证字段值是否为字母和数字 - * @method ValidateRule isAccepted(mixed $rule = null, string $msg = '') static 验证字段值是否为yes, on, 或是 1 - * @method ValidateRule isEmail(mixed $rule = null, string $msg = '') static 验证字段值是否为有效邮箱格式 - * @method ValidateRule isUrl(mixed $rule = null, string $msg = '') static 验证字段值是否为有效URL地址 - * @method ValidateRule activeUrl(mixed $rule, string $msg = '') static 验证是否为合格的域名或者IP - * @method ValidateRule ip(mixed $rule, string $msg = '') static 验证是否有效IP - * @method ValidateRule fileExt(mixed $rule, string $msg = '') static 验证文件后缀 - * @method ValidateRule fileMime(mixed $rule, string $msg = '') static 验证文件类型 - * @method ValidateRule fileSize(mixed $rule, string $msg = '') static 验证文件大小 - * @method ValidateRule image(mixed $rule, string $msg = '') static 验证图像文件 - * @method ValidateRule method(mixed $rule, string $msg = '') static 验证请求类型 - * @method ValidateRule dateFormat(mixed $rule, string $msg = '') static 验证时间和日期是否符合指定格式 - * @method ValidateRule unique(mixed $rule, string $msg = '') static 验证是否唯一 - * @method ValidateRule behavior(mixed $rule, string $msg = '') static 使用行为类验证 - * @method ValidateRule filter(mixed $rule, string $msg = '') static 使用filter_var方式验证 - * @method ValidateRule requireIf(mixed $rule, string $msg = '') static 验证某个字段等于某个值的时候必须 - * @method ValidateRule requireCallback(mixed $rule, string $msg = '') static 通过回调方法验证某个字段是否必须 - * @method ValidateRule requireWith(mixed $rule, string $msg = '') static 验证某个字段有值的情况下必须 - * @method ValidateRule must(mixed $rule = null, string $msg = '') static 必须验证 - */ -class ValidateRule -{ - // 验证字段的名称 - protected $title; - - // 当前验证规则 - protected $rule = []; - - // 验证提示信息 - protected $message = []; - - /** - * 添加验证因子 - * @access protected - * @param string $name 验证名称 - * @param mixed $rule 验证规则 - * @param string $msg 提示信息 - * @return $this - */ - protected function addItem(string $name, $rule = null, string $msg = '') - { - if ($rule || 0 === $rule) { - $this->rule[$name] = $rule; - } else { - $this->rule[] = $name; - } - - $this->message[] = $msg; - - return $this; - } - - /** - * 获取验证规则 - * @access public - * @return array - */ - public function getRule(): array - { - return $this->rule; - } - - /** - * 获取验证字段名称 - * @access public - * @return string - */ - public function getTitle(): string - { - return $this->title ?: ''; - } - - /** - * 获取验证提示 - * @access public - * @return array - */ - public function getMsg(): array - { - return $this->message; - } - - /** - * 设置验证字段名称 - * @access public - * @return $this - */ - public function title(string $title) - { - $this->title = $title; - - return $this; - } - - public function __call($method, $args) - { - if ('is' == strtolower(substr($method, 0, 2))) { - $method = substr($method, 2); - } - - array_unshift($args, lcfirst($method)); - - return call_user_func_array([$this, 'addItem'], $args); - } - - public static function __callStatic($method, $args) - { - $rule = new static(); - - if ('is' == strtolower(substr($method, 0, 2))) { - $method = substr($method, 2); - } - - array_unshift($args, lcfirst($method)); - - return call_user_func_array([$rule, 'addItem'], $args); - } -} diff --git a/vendor/topthink/framework/src/think/view/driver/Php.php b/vendor/topthink/framework/src/think/view/driver/Php.php deleted file mode 100644 index 9e6e54a..0000000 --- a/vendor/topthink/framework/src/think/view/driver/Php.php +++ /dev/null @@ -1,191 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\view\driver; - -use RuntimeException; -use think\App; -use think\contract\TemplateHandlerInterface; -use think\helper\Str; - -/** - * PHP原生模板驱动 - */ -class Php implements TemplateHandlerInterface -{ - protected $template; - protected $content; - protected $app; - - // 模板引擎参数 - protected $config = [ - // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法 - 'auto_rule' => 1, - // 视图目录名 - 'view_dir_name' => 'view', - // 应用模板路径 - 'view_path' => '', - // 模板文件后缀 - 'view_suffix' => 'php', - // 模板文件名分隔符 - 'view_depr' => DIRECTORY_SEPARATOR, - ]; - - public function __construct(App $app, array $config = []) - { - $this->app = $app; - $this->config = array_merge($this->config, (array) $config); - } - - /** - * 检测是否存在模板文件 - * @access public - * @param string $template 模板文件或者模板规则 - * @return bool - */ - public function exists(string $template): bool - { - if ('' == pathinfo($template, PATHINFO_EXTENSION)) { - // 获取模板文件名 - $template = $this->parseTemplate($template); - } - - return is_file($template); - } - - /** - * 渲染模板文件 - * @access public - * @param string $template 模板文件 - * @param array $data 模板变量 - * @return void - */ - public function fetch(string $template, array $data = []): void - { - if ('' == pathinfo($template, PATHINFO_EXTENSION)) { - // 获取模板文件名 - $template = $this->parseTemplate($template); - } - - // 模板不存在 抛出异常 - if (!is_file($template)) { - throw new RuntimeException('template not exists:' . $template); - } - - $this->template = $template; - - extract($data, EXTR_OVERWRITE); - - include $this->template; - } - - /** - * 渲染模板内容 - * @access public - * @param string $content 模板内容 - * @param array $data 模板变量 - * @return void - */ - public function display(string $content, array $data = []): void - { - $this->content = $content; - - extract($data, EXTR_OVERWRITE); - eval('?>' . $this->content); - } - - /** - * 自动定位模板文件 - * @access private - * @param string $template 模板文件规则 - * @return string - */ - private function parseTemplate(string $template): string - { - $request = $this->app->request; - - // 获取视图根目录 - if (strpos($template, '@')) { - // 跨应用调用 - [$app, $template] = explode('@', $template); - } - - if ($this->config['view_path'] && !isset($app)) { - $path = $this->config['view_path']; - } else { - $appName = isset($app) ? $app : $this->app->http->getName(); - $view = $this->config['view_dir_name']; - - if (is_dir($this->app->getAppPath() . $view)) { - $path = isset($app) ? $this->app->getBasePath() . ($appName ? $appName . DIRECTORY_SEPARATOR : '') . $view . DIRECTORY_SEPARATOR : $this->app->getAppPath() . $view . DIRECTORY_SEPARATOR; - } else { - $path = $this->app->getRootPath() . $view . DIRECTORY_SEPARATOR . ($appName ? $appName . DIRECTORY_SEPARATOR : ''); - } - } - - $depr = $this->config['view_depr']; - - if (0 !== strpos($template, '/')) { - $template = str_replace(['/', ':'], $depr, $template); - $controller = $request->controller(); - if (strpos($controller, '.')) { - $pos = strrpos($controller, '.'); - $controller = substr($controller, 0, $pos) . '.' . Str::snake(substr($controller, $pos + 1)); - } else { - $controller = Str::snake($controller); - } - - if ($controller) { - if ('' == $template) { - // 如果模板文件名为空 按照默认规则定位 - if (2 == $this->config['auto_rule']) { - $template = $request->action(true); - } elseif (3 == $this->config['auto_rule']) { - $template = $request->action(); - } else { - $template = Str::snake($request->action()); - } - - $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template; - } elseif (false === strpos($template, $depr)) { - $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template; - } - } - } else { - $template = str_replace(['/', ':'], $depr, substr($template, 1)); - } - - return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.'); - } - - /** - * 配置模板引擎 - * @access private - * @param array $config 参数 - * @return void - */ - public function config(array $config): void - { - $this->config = array_merge($this->config, $config); - } - - /** - * 获取模板引擎配置 - * @access public - * @param string $name 参数名 - * @return mixed - */ - public function getConfig(string $name) - { - return $this->config[$name] ?? null; - } -} diff --git a/vendor/topthink/framework/src/tpl/think_exception.tpl b/vendor/topthink/framework/src/tpl/think_exception.tpl deleted file mode 100644 index 7766caf..0000000 --- a/vendor/topthink/framework/src/tpl/think_exception.tpl +++ /dev/null @@ -1,502 +0,0 @@ -'.end($names).''; - } -} - -if (!function_exists('parse_file')) { - function parse_file($file, $line) - { - return ''.basename($file)." line {$line}".''; - } -} - -if (!function_exists('parse_args')) { - function parse_args($args) - { - $result = []; - foreach ($args as $key => $item) { - switch (true) { - case is_object($item): - $value = sprintf('object(%s)', parse_class(get_class($item))); - break; - case is_array($item): - if (count($item) > 3) { - $value = sprintf('[%s, ...]', parse_args(array_slice($item, 0, 3))); - } else { - $value = sprintf('[%s]', parse_args($item)); - } - break; - case is_string($item): - if (strlen($item) > 20) { - $value = sprintf( - '\'%s...\'', - htmlentities($item), - htmlentities(substr($item, 0, 20)) - ); - } else { - $value = sprintf("'%s'", htmlentities($item)); - } - break; - case is_int($item): - case is_float($item): - $value = $item; - break; - case is_null($item): - $value = 'null'; - break; - case is_bool($item): - $value = '' . ($item ? 'true' : 'false') . ''; - break; - case is_resource($item): - $value = 'resource'; - break; - default: - $value = htmlentities(str_replace("\n", '', var_export(strval($item), true))); - break; - } - - $result[] = is_int($key) ? $value : "'{$key}' => {$value}"; - } - - return implode(', ', $result); - } -} -if (!function_exists('echo_value')) { - function echo_value($val) - { - if (is_array($val) || is_object($val)) { - echo htmlentities(json_encode($val, JSON_PRETTY_PRINT)); - } elseif (is_bool($val)) { - echo $val ? 'true' : 'false'; - } elseif (is_scalar($val)) { - echo htmlentities($val); - } else { - echo 'Resource'; - } - } -} -?> - - - - - 系统发生错误 - - - - - - $trace) { ?> -
    -
    -
    -
    -

    -
    -

    -
    -
    - -
    -
      $value) { ?>
    1. ">
    -
    - -
    -

    Call Stack

    -
      -
    1. - -
    2. - -
    3. - -
    -
    -
    - - -
    -

    -
    - - - -
    -

    Exception Datas

    - $value) { ?> - - - - - - - $val) { ?> - - - - - - - -
    empty
    - -
    - - - -
    -

    Environment Variables

    - $value) { ?> - - - - - - - $val) { ?> - - - - - - - -
    empty
    - -
    - - - - - - - - diff --git a/vendor/topthink/framework/tests/AppTest.php b/vendor/topthink/framework/tests/AppTest.php deleted file mode 100644 index 6b86015..0000000 --- a/vendor/topthink/framework/tests/AppTest.php +++ /dev/null @@ -1,215 +0,0 @@ - 'class', - ]; - - public function register() - { - - } - - public function boot() - { - - } -} - -/** - * @property array initializers - */ -class AppTest extends TestCase -{ - /** @var App */ - protected $app; - - protected function setUp() - { - $this->app = new App(); - } - - protected function tearDown(): void - { - m::close(); - } - - public function testService() - { - $this->app->register(stdClass::class); - - $this->assertInstanceOf(stdClass::class, $this->app->getService(stdClass::class)); - - $service = m::mock(SomeService::class); - - $service->shouldReceive('register')->once(); - - $this->app->register($service); - - $this->assertEquals($service, $this->app->getService(SomeService::class)); - - $service2 = m::mock(SomeService::class); - - $service2->shouldReceive('register')->once(); - - $this->app->register($service2); - - $this->assertEquals($service, $this->app->getService(SomeService::class)); - - $this->app->register($service2, true); - - $this->assertEquals($service2, $this->app->getService(SomeService::class)); - - $service->shouldReceive('boot')->once(); - $service2->shouldReceive('boot')->once(); - - $this->app->boot(); - } - - public function testDebug() - { - $this->app->debug(false); - - $this->assertFalse($this->app->isDebug()); - - $this->app->debug(true); - - $this->assertTrue($this->app->isDebug()); - } - - public function testNamespace() - { - $namespace = 'test'; - - $this->app->setNamespace($namespace); - - $this->assertEquals($namespace, $this->app->getNamespace()); - } - - public function testVersion() - { - $this->assertEquals(App::VERSION, $this->app->version()); - } - - public function testPath() - { - $rootPath = __DIR__ . DIRECTORY_SEPARATOR; - - $app = new App($rootPath); - - $this->assertEquals($rootPath, $app->getRootPath()); - - $this->assertEquals(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR, $app->getThinkPath()); - - $this->assertEquals($rootPath . 'app' . DIRECTORY_SEPARATOR, $app->getAppPath()); - - $appPath = $rootPath . 'app' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR; - $app->setAppPath($appPath); - $this->assertEquals($appPath, $app->getAppPath()); - - $this->assertEquals($rootPath . 'app' . DIRECTORY_SEPARATOR, $app->getBasePath()); - - $this->assertEquals($rootPath . 'config' . DIRECTORY_SEPARATOR, $app->getConfigPath()); - - $this->assertEquals($rootPath . 'runtime' . DIRECTORY_SEPARATOR, $app->getRuntimePath()); - - $runtimePath = $rootPath . 'runtime' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR; - $app->setRuntimePath($runtimePath); - $this->assertEquals($runtimePath, $app->getRuntimePath()); - } - - /** - * @param vfsStreamDirectory $root - * @param bool $debug - * @return App - */ - protected function prepareAppForInitialize(vfsStreamDirectory $root, $debug = true) - { - $rootPath = $root->url() . DIRECTORY_SEPARATOR; - - $app = new App($rootPath); - - $initializer = m::mock(); - $initializer->shouldReceive('init')->once()->with($app); - - $app->instance($initializer->mockery_getName(), $initializer); - - (function () use ($initializer) { - $this->initializers = [$initializer->mockery_getName()]; - })->call($app); - - $env = m::mock(Env::class); - $env->shouldReceive('load')->once()->with($rootPath . '.env'); - $env->shouldReceive('get')->once()->with('config_ext', '.php')->andReturn('.php'); - $env->shouldReceive('get')->once()->with('app_debug')->andReturn($debug); - - $event = m::mock(Event::class); - $event->shouldReceive('trigger')->once()->with(AppInit::class); - $event->shouldReceive('bind')->once()->with([]); - $event->shouldReceive('listenEvents')->once()->with([]); - $event->shouldReceive('subscribe')->once()->with([]); - - $app->instance('env', $env); - $app->instance('event', $event); - - return $app; - } - - public function testInitialize() - { - $root = vfsStream::setup('rootDir', null, [ - '.env' => '', - 'app' => [ - 'common.php' => '', - 'event.php' => '[],"listen"=>[],"subscribe"=>[]];', - 'provider.php' => ' [ - 'app.php' => 'prepareAppForInitialize($root, true); - - $app->debug(false); - - $app->initialize(); - - $this->assertIsInt($app->getBeginMem()); - $this->assertIsFloat($app->getBeginTime()); - - $this->assertTrue($app->initialized()); - } - - public function testFactory() - { - $this->assertInstanceOf(stdClass::class, App::factory(stdClass::class)); - - $this->expectException(ClassNotFoundException::class); - - App::factory('SomeClass'); - } - - public function testParseClass() - { - $this->assertEquals('app\\controller\\SomeClass', $this->app->parseClass('controller', 'some_class')); - $this->app->setNamespace('app2'); - $this->assertEquals('app2\\controller\\SomeClass', $this->app->parseClass('controller', 'some_class')); - } - -} diff --git a/vendor/topthink/framework/tests/CacheTest.php b/vendor/topthink/framework/tests/CacheTest.php deleted file mode 100644 index 5b5a13c..0000000 --- a/vendor/topthink/framework/tests/CacheTest.php +++ /dev/null @@ -1,149 +0,0 @@ -app = m::mock(App::class)->makePartial(); - - Container::setInstance($this->app); - $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); - $this->config = m::mock(Config::class)->makePartial(); - $this->app->shouldReceive('get')->with('config')->andReturn($this->config); - - $this->cache = new Cache($this->app); - } - - public function testGetConfig() - { - $config = [ - 'default' => 'file', - ]; - - $this->config->shouldReceive('get')->with('cache')->andReturn($config); - - $this->assertEquals($config, $this->cache->getConfig()); - - $this->expectException(InvalidArgumentException::class); - $this->cache->getStoreConfig('foo'); - } - - public function testCacheManagerInstances() - { - $this->config->shouldReceive('get')->with("cache.stores.single", null)->andReturn(['type' => 'file']); - - $channel1 = $this->cache->store('single'); - $channel2 = $this->cache->store('single'); - - $this->assertSame($channel1, $channel2); - } - - public function testFileCache() - { - $root = vfsStream::setup(); - - $this->config->shouldReceive('get')->with("cache.default", null)->andReturn('file'); - - $this->config->shouldReceive('get')->with("cache.stores.file", null)->andReturn(['type' => 'file', 'path' => $root->url()]); - - $this->cache->set('foo', 5); - $this->cache->inc('foo'); - $this->assertEquals(6, $this->cache->get('foo')); - $this->cache->dec('foo', 2); - $this->assertEquals(4, $this->cache->get('foo')); - - $this->cache->set('bar', true); - $this->assertTrue($this->cache->get('bar')); - - $this->cache->set('baz', null); - $this->assertNull($this->cache->get('baz')); - - $this->assertTrue($this->cache->has('baz')); - $this->cache->delete('baz'); - $this->assertFalse($this->cache->has('baz')); - $this->assertNull($this->cache->get('baz')); - $this->assertFalse($this->cache->get('baz', false)); - - $this->assertTrue($root->hasChildren()); - $this->cache->clear(); - $this->assertFalse($root->hasChildren()); - - //tags - $this->cache->tag('foo')->set('bar', 'foobar'); - $this->assertEquals('foobar', $this->cache->get('bar')); - $this->cache->tag('foo')->clear(); - $this->assertFalse($this->cache->has('bar')); - - //multiple - $this->cache->setMultiple(['foo' => ['foobar', 'bar'], 'foobar' => ['foo', 'bar']]); - $this->assertEquals(['foo' => ['foobar', 'bar'], 'foobar' => ['foo', 'bar']], $this->cache->getMultiple(['foo', 'foobar'])); - $this->assertTrue($this->cache->deleteMultiple(['foo', 'foobar'])); - } - - public function testRedisCache() - { - if (extension_loaded('redis')) { - return; - } - $this->config->shouldReceive('get')->with("cache.default", null)->andReturn('redis'); - $this->config->shouldReceive('get')->with("cache.stores.redis", null)->andReturn(['type' => 'redis']); - - $redis = m::mock('overload:\Predis\Client'); - - $redis->shouldReceive("set")->once()->with('foo', 5)->andReturnTrue(); - $redis->shouldReceive("incrby")->once()->with('foo', 1)->andReturnTrue(); - $redis->shouldReceive("decrby")->once()->with('foo', 2)->andReturnTrue(); - $redis->shouldReceive("get")->once()->with('foo')->andReturn('6'); - $redis->shouldReceive("get")->once()->with('foo')->andReturn('4'); - $redis->shouldReceive("set")->once()->with('bar', serialize(true))->andReturnTrue(); - $redis->shouldReceive("set")->once()->with('baz', serialize(null))->andReturnTrue(); - $redis->shouldReceive("del")->once()->with('baz')->andReturnTrue(); - $redis->shouldReceive("flushDB")->once()->andReturnTrue(); - $redis->shouldReceive("set")->once()->with('bar', serialize('foobar'))->andReturnTrue(); - $redis->shouldReceive("sAdd")->once()->with('tag:' . md5('foo'), 'bar')->andReturnTrue(); - $redis->shouldReceive("sMembers")->once()->with('tag:' . md5('foo'))->andReturn(['bar']); - $redis->shouldReceive("del")->once()->with(['bar'])->andReturnTrue(); - $redis->shouldReceive("del")->once()->with('tag:' . md5('foo'))->andReturnTrue(); - - $this->cache->set('foo', 5); - $this->cache->inc('foo'); - $this->assertEquals(6, $this->cache->get('foo')); - $this->cache->dec('foo', 2); - $this->assertEquals(4, $this->cache->get('foo')); - - $this->cache->set('bar', true); - $this->cache->set('baz', null); - $this->cache->delete('baz'); - $this->cache->clear(); - - //tags - $this->cache->tag('foo')->set('bar', 'foobar'); - $this->cache->tag('foo')->clear(); - } -} diff --git a/vendor/topthink/framework/tests/ConfigTest.php b/vendor/topthink/framework/tests/ConfigTest.php deleted file mode 100644 index 271a34f..0000000 --- a/vendor/topthink/framework/tests/ConfigTest.php +++ /dev/null @@ -1,46 +0,0 @@ -setContent(" 'value1','key2'=>'value2'];"); - $root->addChild($file); - - $config = new Config(); - - $config->load($file->url(), 'test'); - - $this->assertEquals('value1', $config->get('test.key1')); - $this->assertEquals('value2', $config->get('test.key2')); - - $this->assertSame(['key1' => 'value1', 'key2' => 'value2'], $config->get('test')); - } - - public function testSetAndGet() - { - $config = new Config(); - - $config->set([ - 'key1' => 'value1', - 'key2' => [ - 'key3' => 'value3', - ], - ], 'test'); - - $this->assertTrue($config->has('test.key1')); - $this->assertEquals('value1', $config->get('test.key1')); - $this->assertEquals('value3', $config->get('test.key2.key3')); - - $this->assertEquals(['key3' => 'value3'], $config->get('test.key2')); - $this->assertFalse($config->has('test.key3')); - $this->assertEquals('none', $config->get('test.key3', 'none')); - } -} diff --git a/vendor/topthink/framework/tests/ContainerTest.php b/vendor/topthink/framework/tests/ContainerTest.php deleted file mode 100644 index e27deb0..0000000 --- a/vendor/topthink/framework/tests/ContainerTest.php +++ /dev/null @@ -1,314 +0,0 @@ -name = $name; - } - - public function some(Container $container) - { - } - - protected function protectionFun() - { - return true; - } - - public static function test(Container $container) - { - return $container; - } - - public static function __make() - { - return new self('Taylor'); - } -} - -class SomeClass -{ - public $container; - - public $count = 0; - - public function __construct(Container $container) - { - $this->container = $container; - } -} - -class ContainerTest extends TestCase -{ - protected function tearDown(): void - { - Container::setInstance(null); - } - - public function testClosureResolution() - { - $container = new Container; - - Container::setInstance($container); - - $container->bind('name', function () { - return 'Taylor'; - }); - - $this->assertEquals('Taylor', $container->make('name')); - - $this->assertEquals('Taylor', Container::pull('name')); - } - - public function testGet() - { - $container = new Container; - - $this->expectException(ClassNotFoundException::class); - $this->expectExceptionMessage('class not exists: name'); - $container->get('name'); - - $container->bind('name', function () { - return 'Taylor'; - }); - - $this->assertSame('Taylor', $container->get('name')); - } - - public function testExist() - { - $container = new Container; - - $container->bind('name', function () { - return 'Taylor'; - }); - - $this->assertFalse($container->exists("name")); - - $container->make('name'); - - $this->assertTrue($container->exists('name')); - } - - public function testInstance() - { - $container = new Container; - - $container->bind('name', function () { - return 'Taylor'; - }); - - $this->assertEquals('Taylor', $container->get('name')); - - $container->bind('name2', Taylor::class); - - $object = new stdClass(); - - $this->assertFalse($container->exists('name2')); - - $container->instance('name2', $object); - - $this->assertTrue($container->exists('name2')); - - $this->assertTrue($container->exists(Taylor::class)); - - $this->assertEquals($object, $container->make(Taylor::class)); - - unset($container->name1); - - $this->assertFalse($container->exists('name1')); - - $container->delete('name2'); - - $this->assertFalse($container->exists('name2')); - - foreach ($container as $class => $instance) { - - } - } - - public function testBind() - { - $container = new Container; - - $object = new stdClass(); - - $container->bind(['name' => Taylor::class]); - - $container->bind('name2', $object); - - $container->bind('name3', Taylor::class); - $container->bind('name3', Taylor::class); - - $container->name4 = $object; - - $container['name5'] = $object; - - $this->assertTrue(isset($container->name4)); - - $this->assertTrue(isset($container['name5'])); - - $this->assertInstanceOf(Taylor::class, $container->get('name')); - - $this->assertSame($object, $container->get('name2')); - - $this->assertSame($object, $container->name4); - - $this->assertSame($object, $container['name5']); - - $this->assertInstanceOf(Taylor::class, $container->get('name3')); - - unset($container['name']); - - $this->assertFalse(isset($container['name'])); - - unset($container->name3); - - $this->assertFalse(isset($container->name3)); - } - - public function testAutoConcreteResolution() - { - $container = new Container; - - $taylor = $container->make(Taylor::class); - - $this->assertInstanceOf(Taylor::class, $taylor); - $this->assertAttributeSame('Taylor', 'name', $taylor); - } - - public function testGetAndSetInstance() - { - $this->assertInstanceOf(Container::class, Container::getInstance()); - - $object = new stdClass(); - - Container::setInstance($object); - - $this->assertSame($object, Container::getInstance()); - - Container::setInstance(function () { - return $this; - }); - - $this->assertSame($this, Container::getInstance()); - } - - public function testResolving() - { - $container = new Container(); - $container->bind(Container::class, $container); - - $container->resolving(function (SomeClass $taylor, Container $container) { - $taylor->count++; - }); - $container->resolving(SomeClass::class, function (SomeClass $taylor, Container $container) { - $taylor->count++; - }); - - /** @var SomeClass $someClass */ - $someClass = $container->invokeClass(SomeClass::class); - $this->assertEquals(2, $someClass->count); - } - - public function testInvokeFunctionWithoutMethodThrowsException() - { - $this->expectException(FuncNotFoundException::class); - $this->expectExceptionMessage('function not exists: ContainerTestCallStub()'); - $container = new Container(); - $container->invokeFunction('ContainerTestCallStub', []); - } - - public function testInvokeProtectionMethod() - { - $container = new Container(); - $this->assertTrue($container->invokeMethod([Taylor::class, 'protectionFun'], [], true)); - } - - public function testInvoke() - { - $container = new Container(); - - Container::setInstance($container); - - $container->bind(Container::class, $container); - - $stub = $this->createMock(Taylor::class); - - $stub->expects($this->once())->method('some')->with($container)->will($this->returnSelf()); - - $container->invokeMethod([$stub, 'some']); - - $this->assertEquals('48', $container->invoke('ord', ['0'])); - - $this->assertSame($container, $container->invoke(Taylor::class . '::test', [])); - - $this->assertSame($container, $container->invokeMethod(Taylor::class . '::test')); - - $reflect = new ReflectionMethod($container, 'exists'); - - $this->assertTrue($container->invokeReflectMethod($container, $reflect, [Container::class])); - - $this->assertSame($container, $container->invoke(function (Container $container) { - return $container; - })); - - $this->assertSame($container, $container->invoke(Taylor::class . '::test')); - - $object = $container->invokeClass(SomeClass::class); - $this->assertInstanceOf(SomeClass::class, $object); - $this->assertSame($container, $object->container); - - $stdClass = new stdClass(); - - $container->invoke(function (Container $container, stdClass $stdObject, $key1, $lowKey, $key2 = 'default') use ($stdClass) { - $this->assertEquals('value1', $key1); - $this->assertEquals('default', $key2); - $this->assertEquals('value2', $lowKey); - $this->assertSame($stdClass, $stdObject); - return $container; - }, ['some' => $stdClass, 'key1' => 'value1', 'low_key' => 'value2']); - } - - public function testInvokeMethodNotExists() - { - $container = $this->resolveContainer(); - $this->expectException(FuncNotFoundException::class); - - $container->invokeMethod([SomeClass::class, 'any']); - } - - public function testInvokeClassNotExists() - { - $container = new Container(); - - Container::setInstance($container); - - $container->bind(Container::class, $container); - - $this->expectExceptionObject(new ClassNotFoundException('class not exists: SomeClass')); - - $container->invokeClass('SomeClass'); - } - - protected function resolveContainer() - { - $container = new Container(); - - Container::setInstance($container); - return $container; - } - -} diff --git a/vendor/topthink/framework/tests/DbTest.php b/vendor/topthink/framework/tests/DbTest.php deleted file mode 100644 index 3bd0c1e..0000000 --- a/vendor/topthink/framework/tests/DbTest.php +++ /dev/null @@ -1,49 +0,0 @@ -shouldReceive('get')->with('database.cache_store', null)->andReturn(null); - $cache->shouldReceive('store')->with(null)->andReturn($store); - - $db = Db::__make($event, $config, $log, $cache); - - $config->shouldReceive('get')->with('database.foo', null)->andReturn('foo'); - $this->assertEquals('foo', $db->getConfig('foo')); - - $config->shouldReceive('get')->with('database', [])->andReturn([]); - $this->assertEquals([], $db->getConfig()); - - $callback = function () { - }; - $event->shouldReceive('listen')->with('db.some', $callback); - $db->event('some', $callback); - - $event->shouldReceive('trigger')->with('db.some', null, false); - $db->trigger('some'); - } - -} diff --git a/vendor/topthink/framework/tests/EnvTest.php b/vendor/topthink/framework/tests/EnvTest.php deleted file mode 100644 index cf2e65f..0000000 --- a/vendor/topthink/framework/tests/EnvTest.php +++ /dev/null @@ -1,82 +0,0 @@ -setContent("key1=value1\nkey2=value2"); - $root->addChild($envFile); - - $env = new Env(); - - $env->load($envFile->url()); - - $this->assertEquals('value1', $env->get('key1')); - $this->assertEquals('value2', $env->get('key2')); - - $this->assertSame(['KEY1' => 'value1', 'KEY2' => 'value2'], $env->get()); - } - - public function testServerEnv() - { - $env = new Env(); - - $this->assertEquals('value2', $env->get('key2', 'value2')); - - putenv('PHP_KEY7=value7'); - putenv('PHP_KEY8=false'); - putenv('PHP_KEY9=true'); - - $this->assertEquals('value7', $env->get('key7')); - $this->assertFalse($env->get('KEY8')); - $this->assertTrue($env->get('key9')); - } - - public function testSetEnv() - { - $env = new Env(); - - $env->set([ - 'key1' => 'value1', - 'key2' => [ - 'key1' => 'value1-2', - ], - ]); - - $env->set('key3', 'value3'); - - $env->key4 = 'value4'; - - $env['key5'] = 'value5'; - - $this->assertEquals('value1', $env->get('key1')); - $this->assertEquals('value1-2', $env->get('key2.key1')); - - $this->assertEquals('value3', $env->get('key3')); - - $this->assertEquals('value4', $env->key4); - - $this->assertEquals('value5', $env['key5']); - - $this->expectException(Exception::class); - - unset($env['key5']); - } - - public function testHasEnv() - { - $env = new Env(); - $env->set(['foo' => 'bar']); - $this->assertTrue($env->has('foo')); - $this->assertTrue(isset($env->foo)); - $this->assertTrue($env->offsetExists('foo')); - } -} diff --git a/vendor/topthink/framework/tests/EventTest.php b/vendor/topthink/framework/tests/EventTest.php deleted file mode 100644 index ded5a36..0000000 --- a/vendor/topthink/framework/tests/EventTest.php +++ /dev/null @@ -1,134 +0,0 @@ -app = m::mock(App::class)->makePartial(); - - Container::setInstance($this->app); - $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); - $this->config = m::mock(Config::class)->makePartial(); - $this->app->shouldReceive('get')->with('config')->andReturn($this->config); - - $this->event = new Event($this->app); - } - - public function testBasic() - { - $this->event->bind(['foo' => 'baz']); - - $this->event->listen('foo', function ($bar) { - $this->assertEquals('bar', $bar); - }); - - $this->assertTrue($this->event->hasListener('foo')); - - $this->event->trigger('baz', 'bar'); - - $this->event->remove('foo'); - - $this->assertFalse($this->event->hasListener('foo')); - } - - public function testOnceEvent() - { - $this->event->listen('AppInit', function ($bar) { - $this->assertEquals('bar', $bar); - return 'foo'; - }); - - $this->assertEquals('foo', $this->event->trigger('AppInit', 'bar', true)); - $this->assertEquals(['foo'], $this->event->trigger('AppInit', 'bar')); - } - - public function testClassListener() - { - $listener = m::mock("overload:SomeListener", TestListener::class); - - $listener->shouldReceive('handle')->andReturnTrue(); - - $this->event->listen('some', "SomeListener"); - - $this->assertTrue($this->event->until('some')); - } - - public function testSubscribe() - { - $listener = m::mock("overload:SomeListener", TestListener::class); - - $listener->shouldReceive('subscribe')->andReturnUsing(function (Event $event) use ($listener) { - - $listener->shouldReceive('onBar')->once()->andReturnFalse(); - - $event->listenEvents(['SomeListener::onBar' => [[$listener, 'onBar']]]); - }); - - $this->event->subscribe('SomeListener'); - - $this->assertTrue($this->event->hasListener('SomeListener::onBar')); - - $this->event->trigger('SomeListener::onBar'); - } - - public function testAutoObserve() - { - $listener = m::mock("overload:SomeListener", TestListener::class); - - $listener->shouldReceive('onBar')->once(); - - $this->app->shouldReceive('make')->with('SomeListener')->andReturn($listener); - - $this->event->observe('SomeListener'); - - $this->event->trigger('bar'); - } - -} - -class TestListener -{ - public function handle() - { - - } - - public function onBar() - { - - } - - public function onFoo() - { - - } - - public function subscribe() - { - - } -} diff --git a/vendor/topthink/framework/tests/FilesystemTest.php b/vendor/topthink/framework/tests/FilesystemTest.php deleted file mode 100644 index df5ffe2..0000000 --- a/vendor/topthink/framework/tests/FilesystemTest.php +++ /dev/null @@ -1,131 +0,0 @@ -app = m::mock(App::class)->makePartial(); - Container::setInstance($this->app); - $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); - $this->config = m::mock(Config::class); - $this->config->shouldReceive('get')->with('filesystem.default', null)->andReturn('local'); - $this->app->shouldReceive('get')->with('config')->andReturn($this->config); - $this->filesystem = new Filesystem($this->app); - - $this->root = vfsStream::setup('rootDir'); - } - - protected function tearDown(): void - { - m::close(); - } - - public function testDisk() - { - $this->config->shouldReceive('get')->with('filesystem.disks.local', null)->andReturn([ - 'type' => 'local', - 'root' => $this->root->url(), - ]); - - $this->config->shouldReceive('get')->with('filesystem.disks.foo', null)->andReturn([ - 'type' => 'local', - 'root' => $this->root->url(), - ]); - - $this->assertInstanceOf(Local::class, $this->filesystem->disk()); - - $this->assertInstanceOf(Local::class, $this->filesystem->disk('foo')); - } - - public function testCache() - { - $this->config->shouldReceive('get')->with('filesystem.disks.local', null)->andReturn([ - 'type' => 'local', - 'root' => $this->root->url(), - 'cache' => true, - ]); - - $this->assertInstanceOf(Local::class, $this->filesystem->disk()); - - $this->config->shouldReceive('get')->with('filesystem.disks.cache', null)->andReturn([ - 'type' => NullDriver::class, - 'root' => $this->root->url(), - 'cache' => [ - 'store' => 'flysystem', - ], - ]); - - $cache = m::mock(Cache::class); - - $cacheDriver = m::mock(File::class); - - $cache->shouldReceive('store')->once()->with('flysystem')->andReturn($cacheDriver); - - $this->app->shouldReceive('make')->with(Cache::class)->andReturn($cache); - - $cacheDriver->shouldReceive('get')->with('flysystem')->once()->andReturn(null); - - $cacheDriver->shouldReceive('set')->withAnyArgs(); - - $this->filesystem->disk('cache')->put('test.txt', 'aa'); - } - - public function testPutFile() - { - $root = vfsStream::setup('rootDir', null, [ - 'foo.jpg' => 'hello', - ]); - - $this->config->shouldReceive('get')->with('filesystem.disks.local', null)->andReturn([ - 'type' => NullDriver::class, - 'root' => $root->url(), - 'cache' => true, - ]); - - $file = m::mock(\think\File::class); - - $file->shouldReceive('hashName')->with(null)->once()->andReturn('foo.jpg'); - - $file->shouldReceive('getRealPath')->once()->andReturn($root->getChild('foo.jpg')->url()); - - $this->filesystem->putFile('test', $file); - } -} - -class NullDriver extends Driver -{ - protected function createAdapter(): AdapterInterface - { - return new NullAdapter(); - } -} diff --git a/vendor/topthink/framework/tests/HttpTest.php b/vendor/topthink/framework/tests/HttpTest.php deleted file mode 100644 index c3e0abd..0000000 --- a/vendor/topthink/framework/tests/HttpTest.php +++ /dev/null @@ -1,155 +0,0 @@ -app = m::mock(App::class)->makePartial(); - - $this->http = m::mock(Http::class, [$this->app])->shouldAllowMockingProtectedMethods()->makePartial(); - } - - protected function prepareApp($request, $response) - { - $this->app->shouldReceive('instance')->once()->with('request', $request); - $this->app->shouldReceive('initialized')->once()->andReturnFalse(); - $this->app->shouldReceive('initialize')->once(); - $this->app->shouldReceive('get')->with('request')->andReturn($request); - - $route = m::mock(Route::class); - - $route->shouldReceive('dispatch')->withArgs(function ($req, $withRoute) use ($request) { - if ($withRoute) { - $withRoute(); - } - return $req === $request; - })->andReturn($response); - - $route->shouldReceive('config')->with('route_annotation')->andReturn(true); - - $this->app->shouldReceive('get')->with('route')->andReturn($route); - - $console = m::mock(Console::class); - - $console->shouldReceive('call'); - - $this->app->shouldReceive('get')->with('console')->andReturn($console); - } - - public function testRun() - { - $root = vfsStream::setup('rootDir', null, [ - 'app' => [ - 'controller' => [], - 'middleware.php' => ' [ - 'route.php' => 'app->shouldReceive('getBasePath')->andReturn($root->getChild('app')->url() . DIRECTORY_SEPARATOR); - $this->app->shouldReceive('getRootPath')->andReturn($root->url() . DIRECTORY_SEPARATOR); - - $request = m::mock(Request::class)->makePartial(); - $response = m::mock(Response::class)->makePartial(); - - $this->prepareApp($request, $response); - - $this->assertEquals($response, $this->http->run($request)); - } - - public function multiAppRunProvider() - { - $request1 = m::mock(Request::class)->makePartial(); - $request1->shouldReceive('subDomain')->andReturn('www'); - $request1->shouldReceive('host')->andReturn('www.domain.com'); - - $request2 = m::mock(Request::class)->makePartial(); - $request2->shouldReceive('subDomain')->andReturn('app2'); - $request2->shouldReceive('host')->andReturn('app2.domain.com'); - - $request3 = m::mock(Request::class)->makePartial(); - $request3->shouldReceive('pathinfo')->andReturn('some1/a/b/c'); - - $request4 = m::mock(Request::class)->makePartial(); - $request4->shouldReceive('pathinfo')->andReturn('app3/a/b/c'); - - $request5 = m::mock(Request::class)->makePartial(); - $request5->shouldReceive('pathinfo')->andReturn('some2/a/b/c'); - - return [ - [$request1, true, 'app1'], - [$request2, true, 'app2'], - [$request3, true, 'app3'], - [$request4, true, null], - [$request5, true, 'some2', 'path'], - [$request1, false, 'some3'], - ]; - } - - public function testRunWithException() - { - $request = m::mock(Request::class); - $response = m::mock(Response::class); - - $this->app->shouldReceive('instance')->once()->with('request', $request); - $this->app->shouldReceive('initialize')->once(); - - $exception = new Exception(); - - $this->http->shouldReceive('runWithRequest')->once()->with($request)->andThrow($exception); - - $handle = m::mock(Handle::class); - - $handle->shouldReceive('report')->once()->with($exception); - $handle->shouldReceive('render')->once()->with($request, $exception)->andReturn($response); - - $this->app->shouldReceive('make')->with(Handle::class)->andReturn($handle); - - $this->assertEquals($response, $this->http->run($request)); - } - - public function testEnd() - { - $response = m::mock(Response::class); - $event = m::mock(Event::class); - $event->shouldReceive('trigger')->once()->with(HttpEnd::class, $response); - $this->app->shouldReceive('get')->once()->with('event')->andReturn($event); - $log = m::mock(Log::class); - $log->shouldReceive('save')->once(); - $this->app->shouldReceive('get')->once()->with('log')->andReturn($log); - - $this->http->end($response); - } - -} diff --git a/vendor/topthink/framework/tests/InteractsWithApp.php b/vendor/topthink/framework/tests/InteractsWithApp.php deleted file mode 100644 index f4fcf73..0000000 --- a/vendor/topthink/framework/tests/InteractsWithApp.php +++ /dev/null @@ -1,30 +0,0 @@ -app = m::mock(App::class)->makePartial(); - Container::setInstance($this->app); - $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); - $this->app->shouldReceive('isDebug')->andReturnTrue(); - $this->config = m::mock(Config::class)->makePartial(); - $this->config->shouldReceive('get')->with('app.show_error_msg')->andReturnTrue(); - $this->app->shouldReceive('get')->with('config')->andReturn($this->config); - $this->app->shouldReceive('runningInConsole')->andReturn(false); - } -} diff --git a/vendor/topthink/framework/tests/LogTest.php b/vendor/topthink/framework/tests/LogTest.php deleted file mode 100644 index 981110f..0000000 --- a/vendor/topthink/framework/tests/LogTest.php +++ /dev/null @@ -1,130 +0,0 @@ -prepareApp(); - - $this->log = new Log($this->app); - } - - public function testGetConfig() - { - $config = [ - 'default' => 'file', - ]; - - $this->config->shouldReceive('get')->with('log')->andReturn($config); - - $this->assertEquals($config, $this->log->getConfig()); - - $this->expectException(InvalidArgumentException::class); - $this->log->getChannelConfig('foo'); - } - - public function testChannel() - { - $this->assertInstanceOf(ChannelSet::class, $this->log->channel(['file', 'mail'])); - } - - public function testLogManagerInstances() - { - $this->config->shouldReceive('get')->with("log.channels.single", null)->andReturn(['type' => 'file']); - - $channel1 = $this->log->channel('single'); - $channel2 = $this->log->channel('single'); - - $this->assertSame($channel1, $channel2); - } - - public function testFileLog() - { - $root = vfsStream::setup(); - - $this->config->shouldReceive('get')->with("log.default", null)->andReturn('file'); - - $this->config->shouldReceive('get')->with("log.channels.file", null)->andReturn(['type' => 'file', 'path' => $root->url()]); - - $this->log->info('foo'); - - $this->assertEquals($this->log->getLog(), ['info' => ['foo']]); - - $this->log->clear(); - - $this->assertEmpty($this->log->getLog()); - - $this->log->error('foo'); - $this->assertArrayHasKey('error', $this->log->getLog()); - - $this->log->emergency('foo'); - $this->assertArrayHasKey('emergency', $this->log->getLog()); - - $this->log->alert('foo'); - $this->assertArrayHasKey('alert', $this->log->getLog()); - - $this->log->critical('foo'); - $this->assertArrayHasKey('critical', $this->log->getLog()); - - $this->log->warning('foo'); - $this->assertArrayHasKey('warning', $this->log->getLog()); - - $this->log->notice('foo'); - $this->assertArrayHasKey('notice', $this->log->getLog()); - - $this->log->debug('foo'); - $this->assertArrayHasKey('debug', $this->log->getLog()); - - $this->log->sql('foo'); - $this->assertArrayHasKey('sql', $this->log->getLog()); - - $this->log->custom('foo'); - $this->assertArrayHasKey('custom', $this->log->getLog()); - - $this->log->write('foo'); - $this->assertTrue($root->hasChildren()); - $this->assertEmpty($this->log->getLog()); - - $this->log->close(); - - $this->log->info('foo'); - - $this->assertEmpty($this->log->getLog()); - } - - public function testSave() - { - $root = vfsStream::setup(); - - $this->config->shouldReceive('get')->with("log.default", null)->andReturn('file'); - - $this->config->shouldReceive('get')->with("log.channels.file", null)->andReturn(['type' => 'file', 'path' => $root->url()]); - - $this->log->info('foo'); - - $this->log->save(); - - $this->assertTrue($root->hasChildren()); - } - -} diff --git a/vendor/topthink/framework/tests/MiddlewareTest.php b/vendor/topthink/framework/tests/MiddlewareTest.php deleted file mode 100644 index aa53059..0000000 --- a/vendor/topthink/framework/tests/MiddlewareTest.php +++ /dev/null @@ -1,108 +0,0 @@ -prepareApp(); - - $this->middleware = new Middleware($this->app); - } - - public function testSetMiddleware() - { - $this->middleware->add('BarMiddleware', 'bar'); - - $this->assertEquals(1, count($this->middleware->all('bar'))); - - $this->middleware->controller('BarMiddleware'); - $this->assertEquals(1, count($this->middleware->all('controller'))); - - $this->middleware->import(['FooMiddleware']); - $this->assertEquals(1, count($this->middleware->all())); - - $this->middleware->unshift(['BazMiddleware', 'baz']); - $this->assertEquals(2, count($this->middleware->all())); - $this->assertEquals([['BazMiddleware', 'handle'], 'baz'], $this->middleware->all()[0]); - - $this->config->shouldReceive('get')->with('middleware.alias', [])->andReturn(['foo' => ['FooMiddleware', 'FarMiddleware']]); - - $this->middleware->add('foo'); - $this->assertEquals(3, count($this->middleware->all())); - $this->middleware->add(function () { - }); - $this->middleware->add(function () { - }); - $this->assertEquals(5, count($this->middleware->all())); - } - - public function testPipelineAndEnd() - { - $bar = m::mock("overload:BarMiddleware"); - $foo = m::mock("overload:FooMiddleware", Foo::class); - - $request = m::mock(Request::class); - $response = m::mock(Response::class); - - $e = new Exception(); - - $handle = m::mock(Handle::class); - $handle->shouldReceive('report')->with($e)->andReturnNull(); - $handle->shouldReceive('render')->with($request, $e)->andReturn($response); - - $foo->shouldReceive('handle')->once()->andReturnUsing(function ($request, $next) { - return $next($request); - }); - $bar->shouldReceive('handle')->once()->andReturnUsing(function ($request, $next) use ($e) { - $next($request); - throw $e; - }); - - $foo->shouldReceive('end')->once()->with($response)->andReturnNull(); - - $this->app->shouldReceive('make')->with(Handle::class)->andReturn($handle); - - $this->config->shouldReceive('get')->once()->with('middleware.priority', [])->andReturn(['FooMiddleware', 'BarMiddleware']); - - $this->middleware->import([function ($request, $next) { - return $next($request); - }, 'BarMiddleware', 'FooMiddleware']); - - $this->assertInstanceOf(Pipeline::class, $pipeline = $this->middleware->pipeline()); - - $pipeline->send($request)->then(function ($request) use ($e, $response) { - throw $e; - }); - - $this->middleware->end($response); - } -} - -class Foo -{ - public function end(Response $response) - { - } -} diff --git a/vendor/topthink/framework/tests/RouteTest.php b/vendor/topthink/framework/tests/RouteTest.php deleted file mode 100644 index e992d0f..0000000 --- a/vendor/topthink/framework/tests/RouteTest.php +++ /dev/null @@ -1,286 +0,0 @@ -prepareApp(); - $this->route = new Route($this->app); - } - - /** - * @param $path - * @param string $method - * @param string $host - * @return m\Mock|Request - */ - protected function makeRequest($path, $method = 'GET', $host = 'localhost') - { - $request = m::mock(Request::class)->makePartial(); - $request->shouldReceive('host')->andReturn($host); - $request->shouldReceive('pathinfo')->andReturn($path); - $request->shouldReceive('url')->andReturn('/' . $path); - $request->shouldReceive('method')->andReturn(strtoupper($method)); - return $request; - } - - public function testSimpleRequest() - { - $this->route->get('foo', function () { - return 'get-foo'; - }); - - $this->route->put('foo', function () { - return 'put-foo'; - }); - - $this->route->group(function () { - $this->route->post('foo', function () { - return 'post-foo'; - }); - }); - - $request = $this->makeRequest('foo', 'post'); - $response = $this->route->dispatch($request); - $this->assertEquals(200, $response->getCode()); - $this->assertEquals('post-foo', $response->getContent()); - - $request = $this->makeRequest('foo', 'get'); - $response = $this->route->dispatch($request); - $this->assertEquals(200, $response->getCode()); - $this->assertEquals('get-foo', $response->getContent()); - } - - public function testOptionsRequest() - { - $this->route->get('foo', function () { - return 'get-foo'; - }); - - $this->route->put('foo', function () { - return 'put-foo'; - }); - - $this->route->group(function () { - $this->route->post('foo', function () { - return 'post-foo'; - }); - }); - $this->route->group('abc', function () { - $this->route->post('foo/:id', function () { - return 'post-abc-foo'; - }); - }); - - $this->route->post('foo/:id', function () { - return 'post-abc-foo'; - }); - - $this->route->resource('bar', 'SomeClass'); - - $request = $this->makeRequest('foo', 'options'); - $response = $this->route->dispatch($request); - $this->assertEquals(204, $response->getCode()); - $this->assertEquals('GET, PUT, POST', $response->getHeader('Allow')); - - $request = $this->makeRequest('bar', 'options'); - $response = $this->route->dispatch($request); - $this->assertEquals(204, $response->getCode()); - $this->assertEquals('GET, POST', $response->getHeader('Allow')); - - $request = $this->makeRequest('bar/1', 'options'); - $response = $this->route->dispatch($request); - $this->assertEquals(204, $response->getCode()); - $this->assertEquals('GET, PUT, DELETE', $response->getHeader('Allow')); - - $request = $this->makeRequest('xxxx', 'options'); - $response = $this->route->dispatch($request); - $this->assertEquals(204, $response->getCode()); - $this->assertEquals('GET, POST, PUT, DELETE', $response->getHeader('Allow')); - } - - public function testAllowCrossDomain() - { - $this->route->get('foo', function () { - return 'get-foo'; - })->allowCrossDomain(['some' => 'bar']); - - $request = $this->makeRequest('foo', 'get'); - $response = $this->route->dispatch($request); - - $this->assertEquals('bar', $response->getHeader('some')); - $this->assertArrayHasKey('Access-Control-Allow-Credentials', $response->getHeader()); - - $request = $this->makeRequest('foo2', 'options'); - $response = $this->route->dispatch($request); - - $this->assertEquals(204, $response->getCode()); - $this->assertArrayHasKey('Access-Control-Allow-Credentials', $response->getHeader()); - $this->assertEquals('GET, POST, PUT, DELETE', $response->getHeader('Allow')); - } - - public function testControllerDispatch() - { - $this->route->get('foo', 'foo/bar'); - - $controller = m::Mock(\stdClass::class); - - $this->app->shouldReceive('parseClass')->with('controller', 'Foo')->andReturn($controller->mockery_getName()); - $this->app->shouldReceive('make')->with($controller->mockery_getName(), [], true)->andReturn($controller); - - $controller->shouldReceive('bar')->andReturn('bar'); - - $request = $this->makeRequest('foo'); - $response = $this->route->dispatch($request); - $this->assertEquals('bar', $response->getContent()); - } - - public function testEmptyControllerDispatch() - { - $this->route->get('foo', 'foo/bar'); - - $controller = m::Mock(\stdClass::class); - - $this->app->shouldReceive('parseClass')->with('controller', 'Error')->andReturn($controller->mockery_getName()); - $this->app->shouldReceive('make')->with($controller->mockery_getName(), [], true)->andReturn($controller); - - $controller->shouldReceive('bar')->andReturn('bar'); - - $request = $this->makeRequest('foo'); - $response = $this->route->dispatch($request); - $this->assertEquals('bar', $response->getContent()); - } - - protected function createMiddleware($times = 1) - { - $middleware = m::mock(Str::random(5)); - $middleware->shouldReceive('handle')->times($times)->andReturnUsing(function ($request, Closure $next) { - return $next($request); - }); - $this->app->shouldReceive('make')->with($middleware->mockery_getName())->andReturn($middleware); - - return $middleware; - } - - public function testControllerWithMiddleware() - { - $this->route->get('foo', 'foo/bar'); - - $controller = m::mock(FooClass::class); - - $controller->middleware = [ - $this->createMiddleware()->mockery_getName() . ":params1:params2", - $this->createMiddleware(0)->mockery_getName() => ['except' => 'bar'], - $this->createMiddleware()->mockery_getName() => ['only' => 'bar'], - ]; - - $this->app->shouldReceive('parseClass')->with('controller', 'Foo')->andReturn($controller->mockery_getName()); - $this->app->shouldReceive('make')->with($controller->mockery_getName(), [], true)->andReturn($controller); - - $controller->shouldReceive('bar')->once()->andReturn('bar'); - - $request = $this->makeRequest('foo'); - $response = $this->route->dispatch($request); - $this->assertEquals('bar', $response->getContent()); - } - - public function testUrlDispatch() - { - $controller = m::mock(FooClass::class); - $controller->shouldReceive('index')->andReturn('bar'); - - $this->app->shouldReceive('parseClass')->once()->with('controller', 'Foo')->andReturn($controller->mockery_getName()); - $this->app->shouldReceive('make')->with($controller->mockery_getName(), [], true)->andReturn($controller); - - $request = $this->makeRequest('foo'); - $response = $this->route->dispatch($request); - $this->assertEquals('bar', $response->getContent()); - } - - public function testRedirectDispatch() - { - $this->route->redirect('foo', 'http://localhost', 302); - - $request = $this->makeRequest('foo'); - $this->app->shouldReceive('make')->with(Request::class)->andReturn($request); - $response = $this->route->dispatch($request); - - $this->assertInstanceOf(Redirect::class, $response); - $this->assertEquals(302, $response->getCode()); - $this->assertEquals('http://localhost', $response->getData()); - } - - public function testViewDispatch() - { - $this->route->view('foo', 'index/hello', ['city' => 'shanghai']); - - $request = $this->makeRequest('foo'); - $response = $this->route->dispatch($request); - - $this->assertInstanceOf(View::class, $response); - $this->assertEquals(['city' => 'shanghai'], $response->getVars()); - $this->assertEquals('index/hello', $response->getData()); - } - - public function testResponseDispatch() - { - $this->route->get('hello/:name', response() - ->data('Hello,ThinkPHP') - ->code(200) - ->contentType('text/plain')); - - $request = $this->makeRequest('hello/some'); - $response = $this->route->dispatch($request); - - $this->assertEquals('Hello,ThinkPHP', $response->getContent()); - $this->assertEquals(200, $response->getCode()); - } - - public function testDomainBindResponse() - { - $this->route->domain('test', function () { - $this->route->get('/', function () { - return 'Hello,ThinkPHP'; - }); - }); - - $request = $this->makeRequest('', 'get', 'test.domain.com'); - $response = $this->route->dispatch($request); - - $this->assertEquals('Hello,ThinkPHP', $response->getContent()); - $this->assertEquals(200, $response->getCode()); - } - -} - -class FooClass -{ - public $middleware = []; - - public function bar() - { - - } -} diff --git a/vendor/topthink/framework/tests/SessionTest.php b/vendor/topthink/framework/tests/SessionTest.php deleted file mode 100644 index b3b48a7..0000000 --- a/vendor/topthink/framework/tests/SessionTest.php +++ /dev/null @@ -1,225 +0,0 @@ -app = m::mock(App::class)->makePartial(); - Container::setInstance($this->app); - - $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); - $this->config = m::mock(Config::class)->makePartial(); - - $this->app->shouldReceive('get')->with('config')->andReturn($this->config); - $handlerClass = "\\think\\session\\driver\\Test" . Str::random(10); - $this->config->shouldReceive("get")->with("session.type", "file")->andReturn($handlerClass); - $this->session = new Session($this->app); - - $this->handler = m::mock('overload:' . $handlerClass, SessionHandlerInterface::class); - } - - public function testLoadData() - { - $data = [ - "bar" => 'foo', - ]; - - $id = md5(uniqid()); - - $this->handler->shouldReceive("read")->once()->with($id)->andReturn(serialize($data)); - - $this->session->setId($id); - $this->session->init(); - - $this->assertEquals('foo', $this->session->get('bar')); - $this->assertTrue($this->session->has('bar')); - $this->assertFalse($this->session->has('foo')); - - $this->session->set('foo', 'bar'); - $this->assertTrue($this->session->has('foo')); - - $this->assertEquals('bar', $this->session->pull('foo')); - $this->assertFalse($this->session->has('foo')); - } - - public function testSave() - { - - $id = md5(uniqid()); - - $this->handler->shouldReceive('read')->once()->with($id)->andReturn(""); - - $this->handler->shouldReceive('write')->once()->with($id, serialize([ - "bar" => 'foo', - ]))->andReturnTrue(); - - $this->session->setId($id); - $this->session->init(); - - $this->session->set('bar', 'foo'); - - $this->session->save(); - } - - public function testFlash() - { - $this->session->flash('foo', 'bar'); - $this->session->flash('bar', 0); - $this->session->flash('baz', true); - - $this->assertTrue($this->session->has('foo')); - $this->assertEquals('bar', $this->session->get('foo')); - $this->assertEquals(0, $this->session->get('bar')); - $this->assertTrue($this->session->get('baz')); - - $this->session->clearFlashData(); - - $this->assertTrue($this->session->has('foo')); - $this->assertEquals('bar', $this->session->get('foo')); - $this->assertEquals(0, $this->session->get('bar')); - - $this->session->clearFlashData(); - - $this->assertFalse($this->session->has('foo')); - $this->assertNull($this->session->get('foo')); - - $this->session->flash('foo', 'bar'); - $this->assertTrue($this->session->has('foo')); - $this->session->clearFlashData(); - $this->session->reflash(); - $this->session->clearFlashData(); - - $this->assertTrue($this->session->has('foo')); - } - - public function testClear() - { - $this->session->set('bar', 'foo'); - $this->assertEquals('foo', $this->session->get('bar')); - $this->session->clear(); - $this->assertFalse($this->session->has('foo')); - } - - public function testSetName() - { - $this->session->setName('foo'); - $this->assertEquals('foo', $this->session->getName()); - } - - public function testDestroy() - { - $id = md5(uniqid()); - - $this->handler->shouldReceive('read')->once()->with($id)->andReturn(""); - $this->handler->shouldReceive('delete')->once()->with($id)->andReturnTrue(); - - $this->session->setId($id); - $this->session->init(); - - $this->session->set('bar', 'foo'); - - $this->session->destroy(); - - $this->assertFalse($this->session->has('bar')); - - $this->assertNotEquals($id, $this->session->getId()); - } - - public function testFileHandler() - { - $root = vfsStream::setup(); - - vfsStream::newFile('bar') - ->at($root) - ->lastModified(time()); - - vfsStream::newFile('bar') - ->at(vfsStream::newDirectory("foo")->at($root)) - ->lastModified(100); - - $this->assertTrue($root->hasChild("bar")); - $this->assertTrue($root->hasChild("foo/bar")); - - $handler = new TestFileHandle($this->app, [ - 'path' => $root->url(), - 'gc_probability' => 1, - 'gc_divisor' => 1, - ]); - - $this->assertTrue($root->hasChild("bar")); - $this->assertFalse($root->hasChild("foo/bar")); - - $id = md5(uniqid()); - $handler->write($id, "bar"); - - $this->assertTrue($root->hasChild("sess_{$id}")); - - $this->assertEquals("bar", $handler->read($id)); - - $handler->delete($id); - - $this->assertFalse($root->hasChild("sess_{$id}")); - } - - public function testCacheHandler() - { - $id = md5(uniqid()); - - $cache = m::mock(\think\Cache::class); - - $store = m::mock(Driver::class); - - $cache->shouldReceive('store')->once()->with('redis')->andReturn($store); - - $handler = new Cache($cache, ['store' => 'redis']); - - $store->shouldReceive("set")->with($id, "bar", 1440)->once()->andReturnTrue(); - $handler->write($id, "bar"); - - $store->shouldReceive("get")->with($id)->once()->andReturn("bar"); - $this->assertEquals("bar", $handler->read($id)); - - $store->shouldReceive("delete")->with($id)->once()->andReturnTrue(); - $handler->delete($id); - } -} - -class TestFileHandle extends File -{ - protected function writeFile($path, $content): bool - { - return (bool) file_put_contents($path, $content); - } -} diff --git a/vendor/topthink/framework/tests/ViewTest.php b/vendor/topthink/framework/tests/ViewTest.php deleted file mode 100644 index e413510..0000000 --- a/vendor/topthink/framework/tests/ViewTest.php +++ /dev/null @@ -1,127 +0,0 @@ -app = m::mock(App::class)->makePartial(); - Container::setInstance($this->app); - - $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); - $this->config = m::mock(Config::class)->makePartial(); - $this->app->shouldReceive('get')->with('config')->andReturn($this->config); - - $this->view = new View($this->app); - } - - public function testAssignData() - { - $this->view->assign('foo', 'bar'); - $this->view->assign(['baz' => 'boom']); - $this->view->qux = "corge"; - - $this->assertEquals('bar', $this->view->foo); - $this->assertEquals('boom', $this->view->baz); - $this->assertEquals('corge', $this->view->qux); - $this->assertTrue(isset($this->view->qux)); - } - - public function testRender() - { - $this->config->shouldReceive("get")->with("view.type", 'php')->andReturn(TestTemplate::class); - - $this->view->filter(function ($content) { - return $content; - }); - - $this->assertEquals("fetch", $this->view->fetch('foo')); - $this->assertEquals("display", $this->view->display('foo')); - } - -} - -class TestTemplate implements TemplateHandlerInterface -{ - - /** - * 检测是否存在模板文件 - * @access public - * @param string $template 模板文件或者模板规则 - * @return bool - */ - public function exists(string $template): bool - { - return true; - } - - /** - * 渲染模板文件 - * @access public - * @param string $template 模板文件 - * @param array $data 模板变量 - * @return void - */ - public function fetch(string $template, array $data = []): void - { - echo "fetch"; - } - - /** - * 渲染模板内容 - * @access public - * @param string $content 模板内容 - * @param array $data 模板变量 - * @return void - */ - public function display(string $content, array $data = []): void - { - echo "display"; - } - - /** - * 配置模板引擎 - * @access private - * @param array $config 参数 - * @return void - */ - public function config(array $config): void - { - // TODO: Implement config() method. - } - - /** - * 获取模板引擎配置 - * @access public - * @param string $name 参数名 - * @return void - */ - public function getConfig(string $name) - { - // TODO: Implement getConfig() method. - } -} diff --git a/vendor/topthink/framework/tests/bootstrap.php b/vendor/topthink/framework/tests/bootstrap.php deleted file mode 100644 index 3459061..0000000 --- a/vendor/topthink/framework/tests/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ - 以下类库都在`\\think\\helper`命名空间下 - -## Str - -> 字符串操作 - -``` -// 检查字符串中是否包含某些字符串 -Str::contains($haystack, $needles) - -// 检查字符串是否以某些字符串结尾 -Str::endsWith($haystack, $needles) - -// 获取指定长度的随机字母数字组合的字符串 -Str::random($length = 16) - -// 字符串转小写 -Str::lower($value) - -// 字符串转大写 -Str::upper($value) - -// 获取字符串的长度 -Str::length($value) - -// 截取字符串 -Str::substr($string, $start, $length = null) - -``` \ No newline at end of file diff --git a/vendor/topthink/think-helper/composer.json b/vendor/topthink/think-helper/composer.json deleted file mode 100644 index b68c43b..0000000 --- a/vendor/topthink/think-helper/composer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "topthink/think-helper", - "description": "The ThinkPHP6 Helper Package", - "license": "Apache-2.0", - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "require": { - "php": ">=7.1.0" - }, - "autoload": { - "psr-4": { - "think\\": "src" - }, - "files": [ - "src/helper.php" - ] - } -} diff --git a/vendor/topthink/think-helper/src/Collection.php b/vendor/topthink/think-helper/src/Collection.php deleted file mode 100644 index 905f3f8..0000000 --- a/vendor/topthink/think-helper/src/Collection.php +++ /dev/null @@ -1,651 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use ArrayAccess; -use ArrayIterator; -use Countable; -use IteratorAggregate; -use JsonSerializable; -use think\contract\Arrayable; -use think\contract\Jsonable; -use think\helper\Arr; - -/** - * 数据集管理类 - */ -class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSerializable, Arrayable, Jsonable -{ - /** - * 数据集数据 - * @var array - */ - protected $items = []; - - public function __construct($items = []) - { - $this->items = $this->convertToArray($items); - } - - public static function make($items = []) - { - return new static($items); - } - - /** - * 是否为空 - * @access public - * @return bool - */ - public function isEmpty(): bool - { - return empty($this->items); - } - - public function toArray(): array - { - return array_map(function ($value) { - return $value instanceof Arrayable ? $value->toArray() : $value; - }, $this->items); - } - - public function all(): array - { - return $this->items; - } - - /** - * 合并数组 - * - * @access public - * @param mixed $items 数据 - * @return static - */ - public function merge($items) - { - return new static(array_merge($this->items, $this->convertToArray($items))); - } - - /** - * 按指定键整理数据 - * - * @access public - * @param mixed $items 数据 - * @param string $indexKey 键名 - * @return array - */ - public function dictionary($items = null, string &$indexKey = null) - { - if ($items instanceof self) { - $items = $items->all(); - } - - $items = is_null($items) ? $this->items : $items; - - if ($items && empty($indexKey)) { - $indexKey = is_array($items[0]) ? 'id' : $items[0]->getPk(); - } - - if (isset($indexKey) && is_string($indexKey)) { - return array_column($items, null, $indexKey); - } - - return $items; - } - - /** - * 比较数组,返回差集 - * - * @access public - * @param mixed $items 数据 - * @param string $indexKey 指定比较的键名 - * @return static - */ - public function diff($items, string $indexKey = null) - { - if ($this->isEmpty() || is_scalar($this->items[0])) { - return new static(array_diff($this->items, $this->convertToArray($items))); - } - - $diff = []; - $dictionary = $this->dictionary($items, $indexKey); - - if (is_string($indexKey)) { - foreach ($this->items as $item) { - if (!isset($dictionary[$item[$indexKey]])) { - $diff[] = $item; - } - } - } - - return new static($diff); - } - - /** - * 比较数组,返回交集 - * - * @access public - * @param mixed $items 数据 - * @param string $indexKey 指定比较的键名 - * @return static - */ - public function intersect($items, string $indexKey = null) - { - if ($this->isEmpty() || is_scalar($this->items[0])) { - return new static(array_diff($this->items, $this->convertToArray($items))); - } - - $intersect = []; - $dictionary = $this->dictionary($items, $indexKey); - - if (is_string($indexKey)) { - foreach ($this->items as $item) { - if (isset($dictionary[$item[$indexKey]])) { - $intersect[] = $item; - } - } - } - - return new static($intersect); - } - - /** - * 交换数组中的键和值 - * - * @access public - * @return static - */ - public function flip() - { - return new static(array_flip($this->items)); - } - - /** - * 返回数组中所有的键名 - * - * @access public - * @return static - */ - public function keys() - { - return new static(array_keys($this->items)); - } - - /** - * 返回数组中所有的值组成的新 Collection 实例 - * @access public - * @return static - */ - public function values() - { - return new static(array_values($this->items)); - } - - /** - * 删除数组的最后一个元素(出栈) - * - * @access public - * @return mixed - */ - public function pop() - { - return array_pop($this->items); - } - - /** - * 通过使用用户自定义函数,以字符串返回数组 - * - * @access public - * @param callable $callback 调用方法 - * @param mixed $initial - * @return mixed - */ - public function reduce(callable $callback, $initial = null) - { - return array_reduce($this->items, $callback, $initial); - } - - /** - * 以相反的顺序返回数组。 - * - * @access public - * @return static - */ - public function reverse() - { - return new static(array_reverse($this->items)); - } - - /** - * 删除数组中首个元素,并返回被删除元素的值 - * - * @access public - * @return mixed - */ - public function shift() - { - return array_shift($this->items); - } - - /** - * 在数组结尾插入一个元素 - * @access public - * @param mixed $value 元素 - * @param string $key KEY - * @return void - */ - public function push($value, string $key = null): void - { - if (is_null($key)) { - $this->items[] = $value; - } else { - $this->items[$key] = $value; - } - } - - /** - * 把一个数组分割为新的数组块. - * - * @access public - * @param int $size 块大小 - * @param bool $preserveKeys - * @return static - */ - public function chunk(int $size, bool $preserveKeys = false) - { - $chunks = []; - - foreach (array_chunk($this->items, $size, $preserveKeys) as $chunk) { - $chunks[] = new static($chunk); - } - - return new static($chunks); - } - - /** - * 在数组开头插入一个元素 - * @access public - * @param mixed $value 元素 - * @param string $key KEY - * @return void - */ - public function unshift($value, string $key = null): void - { - if (is_null($key)) { - array_unshift($this->items, $value); - } else { - $this->items = [$key => $value] + $this->items; - } - } - - /** - * 给每个元素执行个回调 - * - * @access public - * @param callable $callback 回调 - * @return $this - */ - public function each(callable $callback) - { - foreach ($this->items as $key => $item) { - $result = $callback($item, $key); - - if (false === $result) { - break; - } elseif (!is_object($item)) { - $this->items[$key] = $result; - } - } - - return $this; - } - - /** - * 用回调函数处理数组中的元素 - * @access public - * @param callable|null $callback 回调 - * @return static - */ - public function map(callable $callback) - { - return new static(array_map($callback, $this->items)); - } - - /** - * 用回调函数过滤数组中的元素 - * @access public - * @param callable|null $callback 回调 - * @return static - */ - public function filter(callable $callback = null) - { - if ($callback) { - return new static(array_filter($this->items, $callback)); - } - - return new static(array_filter($this->items)); - } - - /** - * 根据字段条件过滤数组中的元素 - * @access public - * @param string $field 字段名 - * @param mixed $operator 操作符 - * @param mixed $value 数据 - * @return static - */ - public function where(string $field, $operator, $value = null) - { - if (is_null($value)) { - $value = $operator; - $operator = '='; - } - - return $this->filter(function ($data) use ($field, $operator, $value) { - if (strpos($field, '.')) { - [$field, $relation] = explode('.', $field); - - $result = $data[$field][$relation] ?? null; - } else { - $result = $data[$field] ?? null; - } - - switch (strtolower($operator)) { - case '===': - return $result === $value; - case '!==': - return $result !== $value; - case '!=': - case '<>': - return $result != $value; - case '>': - return $result > $value; - case '>=': - return $result >= $value; - case '<': - return $result < $value; - case '<=': - return $result <= $value; - case 'like': - return is_string($result) && false !== strpos($result, $value); - case 'not like': - return is_string($result) && false === strpos($result, $value); - case 'in': - return is_scalar($result) && in_array($result, $value, true); - case 'not in': - return is_scalar($result) && !in_array($result, $value, true); - case 'between': - [$min, $max] = is_string($value) ? explode(',', $value) : $value; - return is_scalar($result) && $result >= $min && $result <= $max; - case 'not between': - [$min, $max] = is_string($value) ? explode(',', $value) : $value; - return is_scalar($result) && $result > $max || $result < $min; - case '==': - case '=': - default: - return $result == $value; - } - }); - } - - /** - * LIKE过滤 - * @access public - * @param string $field 字段名 - * @param string $value 数据 - * @return static - */ - public function whereLike(string $field, string $value) - { - return $this->where($field, 'like', $value); - } - - /** - * NOT LIKE过滤 - * @access public - * @param string $field 字段名 - * @param string $value 数据 - * @return static - */ - public function whereNotLike(string $field, string $value) - { - return $this->where($field, 'not like', $value); - } - - /** - * IN过滤 - * @access public - * @param string $field 字段名 - * @param array $value 数据 - * @return static - */ - public function whereIn(string $field, array $value) - { - return $this->where($field, 'in', $value); - } - - /** - * NOT IN过滤 - * @access public - * @param string $field 字段名 - * @param array $value 数据 - * @return static - */ - public function whereNotIn(string $field, array $value) - { - return $this->where($field, 'not in', $value); - } - - /** - * BETWEEN 过滤 - * @access public - * @param string $field 字段名 - * @param mixed $value 数据 - * @return static - */ - public function whereBetween(string $field, $value) - { - return $this->where($field, 'between', $value); - } - - /** - * NOT BETWEEN 过滤 - * @access public - * @param string $field 字段名 - * @param mixed $value 数据 - * @return static - */ - public function whereNotBetween(string $field, $value) - { - return $this->where($field, 'not between', $value); - } - - /** - * 返回数据中指定的一列 - * @access public - * @param string|null $columnKey 键名 - * @param string|null $indexKey 作为索引值的列 - * @return array - */ - public function column(?string $columnKey, string $indexKey = null) - { - return array_column($this->items, $columnKey, $indexKey); - } - - /** - * 对数组排序 - * - * @access public - * @param callable|null $callback 回调 - * @return static - */ - public function sort(callable $callback = null) - { - $items = $this->items; - - $callback = $callback ?: function ($a, $b) { - return $a == $b ? 0 : (($a < $b) ? -1 : 1); - }; - - uasort($items, $callback); - - return new static($items); - } - - /** - * 指定字段排序 - * @access public - * @param string $field 排序字段 - * @param string $order 排序 - * @return $this - */ - public function order(string $field, string $order = 'asc') - { - return $this->sort(function ($a, $b) use ($field, $order) { - $fieldA = $a[$field] ?? null; - $fieldB = $b[$field] ?? null; - - return 'desc' == strtolower($order) ? $fieldB > $fieldA : $fieldA > $fieldB; - }); - } - - /** - * 将数组打乱 - * - * @access public - * @return static - */ - public function shuffle() - { - $items = $this->items; - - shuffle($items); - - return new static($items); - } - - /** - * 获取最第一个单元数据 - * - * @access public - * @param callable|null $callback - * @param null $default - * @return mixed - */ - public function first(callable $callback = null, $default = null) - { - return Arr::first($this->items, $callback, $default); - } - - /** - * 获取最后一个单元数据 - * - * @access public - * @param callable|null $callback - * @param null $default - * @return mixed - */ - public function last(callable $callback = null, $default = null) - { - return Arr::last($this->items, $callback, $default); - } - - /** - * 截取数组 - * - * @access public - * @param int $offset 起始位置 - * @param int $length 截取长度 - * @param bool $preserveKeys preserveKeys - * @return static - */ - public function slice(int $offset, int $length = null, bool $preserveKeys = false) - { - return new static(array_slice($this->items, $offset, $length, $preserveKeys)); - } - - // ArrayAccess - public function offsetExists($offset) - { - return array_key_exists($offset, $this->items); - } - - public function offsetGet($offset) - { - return $this->items[$offset]; - } - - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->items[] = $value; - } else { - $this->items[$offset] = $value; - } - } - - public function offsetUnset($offset) - { - unset($this->items[$offset]); - } - - //Countable - public function count() - { - return count($this->items); - } - - //IteratorAggregate - public function getIterator() - { - return new ArrayIterator($this->items); - } - - //JsonSerializable - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * 转换当前数据集为JSON字符串 - * @access public - * @param integer $options json参数 - * @return string - */ - public function toJson(int $options = JSON_UNESCAPED_UNICODE): string - { - return json_encode($this->toArray(), $options); - } - - public function __toString() - { - return $this->toJson(); - } - - /** - * 转换成数组 - * - * @access public - * @param mixed $items 数据 - * @return array - */ - protected function convertToArray($items): array - { - if ($items instanceof self) { - return $items->all(); - } - - return (array) $items; - } -} diff --git a/vendor/topthink/think-helper/src/contract/Arrayable.php b/vendor/topthink/think-helper/src/contract/Arrayable.php deleted file mode 100644 index 7c6b992..0000000 --- a/vendor/topthink/think-helper/src/contract/Arrayable.php +++ /dev/null @@ -1,8 +0,0 @@ - -// +---------------------------------------------------------------------- - -use think\Collection; -use think\helper\Arr; - -if (!function_exists('throw_if')) { - /** - * 按条件抛异常 - * - * @param mixed $condition - * @param Throwable|string $exception - * @param array ...$parameters - * @return mixed - * - * @throws Throwable - */ - function throw_if($condition, $exception, ...$parameters) - { - if ($condition) { - throw (is_string($exception) ? new $exception(...$parameters) : $exception); - } - - return $condition; - } -} - -if (!function_exists('throw_unless')) { - /** - * 按条件抛异常 - * - * @param mixed $condition - * @param Throwable|string $exception - * @param array ...$parameters - * @return mixed - * @throws Throwable - */ - function throw_unless($condition, $exception, ...$parameters) - { - if (!$condition) { - throw (is_string($exception) ? new $exception(...$parameters) : $exception); - } - - return $condition; - } -} - -if (!function_exists('tap')) { - /** - * 对一个值调用给定的闭包,然后返回该值 - * - * @param mixed $value - * @param callable|null $callback - * @return mixed - */ - function tap($value, $callback = null) - { - if (is_null($callback)) { - return $value; - } - - $callback($value); - - return $value; - } -} - -if (!function_exists('value')) { - /** - * Return the default value of the given value. - * - * @param mixed $value - * @return mixed - */ - function value($value) - { - return $value instanceof Closure ? $value() : $value; - } -} - -if (!function_exists('collect')) { - /** - * Create a collection from the given value. - * - * @param mixed $value - * @return Collection - */ - function collect($value = null) - { - return new Collection($value); - } -} - -if (!function_exists('data_fill')) { - /** - * Fill in data where it's missing. - * - * @param mixed $target - * @param string|array $key - * @param mixed $value - * @return mixed - */ - function data_fill(&$target, $key, $value) - { - return data_set($target, $key, $value, false); - } -} - -if (!function_exists('data_get')) { - /** - * Get an item from an array or object using "dot" notation. - * - * @param mixed $target - * @param string|array|int $key - * @param mixed $default - * @return mixed - */ - function data_get($target, $key, $default = null) - { - if (is_null($key)) { - return $target; - } - - $key = is_array($key) ? $key : explode('.', $key); - - while (!is_null($segment = array_shift($key))) { - if ('*' === $segment) { - if ($target instanceof Collection) { - $target = $target->all(); - } elseif (!is_array($target)) { - return value($default); - } - - $result = []; - - foreach ($target as $item) { - $result[] = data_get($item, $key); - } - - return in_array('*', $key) ? Arr::collapse($result) : $result; - } - - if (Arr::accessible($target) && Arr::exists($target, $segment)) { - $target = $target[$segment]; - } elseif (is_object($target) && isset($target->{$segment})) { - $target = $target->{$segment}; - } else { - return value($default); - } - } - - return $target; - } -} - -if (!function_exists('data_set')) { - /** - * Set an item on an array or object using dot notation. - * - * @param mixed $target - * @param string|array $key - * @param mixed $value - * @param bool $overwrite - * @return mixed - */ - function data_set(&$target, $key, $value, $overwrite = true) - { - $segments = is_array($key) ? $key : explode('.', $key); - - if (($segment = array_shift($segments)) === '*') { - if (!Arr::accessible($target)) { - $target = []; - } - - if ($segments) { - foreach ($target as &$inner) { - data_set($inner, $segments, $value, $overwrite); - } - } elseif ($overwrite) { - foreach ($target as &$inner) { - $inner = $value; - } - } - } elseif (Arr::accessible($target)) { - if ($segments) { - if (!Arr::exists($target, $segment)) { - $target[$segment] = []; - } - - data_set($target[$segment], $segments, $value, $overwrite); - } elseif ($overwrite || !Arr::exists($target, $segment)) { - $target[$segment] = $value; - } - } elseif (is_object($target)) { - if ($segments) { - if (!isset($target->{$segment})) { - $target->{$segment} = []; - } - - data_set($target->{$segment}, $segments, $value, $overwrite); - } elseif ($overwrite || !isset($target->{$segment})) { - $target->{$segment} = $value; - } - } else { - $target = []; - - if ($segments) { - data_set($target[$segment], $segments, $value, $overwrite); - } elseif ($overwrite) { - $target[$segment] = $value; - } - } - - return $target; - } -} - -if (!function_exists('trait_uses_recursive')) { - /** - * 获取一个trait里所有引用到的trait - * - * @param string $trait Trait - * @return array - */ - function trait_uses_recursive(string $trait): array - { - $traits = class_uses($trait); - foreach ($traits as $trait) { - $traits += trait_uses_recursive($trait); - } - - return $traits; - } -} - -if (!function_exists('class_basename')) { - /** - * 获取类名(不包含命名空间) - * - * @param mixed $class 类名 - * @return string - */ - function class_basename($class): string - { - $class = is_object($class) ? get_class($class) : $class; - return basename(str_replace('\\', '/', $class)); - } -} - -if (!function_exists('class_uses_recursive')) { - /** - *获取一个类里所有用到的trait,包括父类的 - * - * @param mixed $class 类名 - * @return array - */ - function class_uses_recursive($class): array - { - if (is_object($class)) { - $class = get_class($class); - } - - $results = []; - $classes = array_merge([$class => $class], class_parents($class)); - foreach ($classes as $class) { - $results += trait_uses_recursive($class); - } - - return array_unique($results); - } -} diff --git a/vendor/topthink/think-helper/src/helper/Arr.php b/vendor/topthink/think-helper/src/helper/Arr.php deleted file mode 100644 index ed4d6a9..0000000 --- a/vendor/topthink/think-helper/src/helper/Arr.php +++ /dev/null @@ -1,634 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\helper; - -use ArrayAccess; -use InvalidArgumentException; -use think\Collection; - -class Arr -{ - - /** - * Determine whether the given value is array accessible. - * - * @param mixed $value - * @return bool - */ - public static function accessible($value) - { - return is_array($value) || $value instanceof ArrayAccess; - } - - /** - * Add an element to an array using "dot" notation if it doesn't exist. - * - * @param array $array - * @param string $key - * @param mixed $value - * @return array - */ - public static function add($array, $key, $value) - { - if (is_null(static::get($array, $key))) { - static::set($array, $key, $value); - } - - return $array; - } - - /** - * Collapse an array of arrays into a single array. - * - * @param array $array - * @return array - */ - public static function collapse($array) - { - $results = []; - - foreach ($array as $values) { - if ($values instanceof Collection) { - $values = $values->all(); - } elseif (!is_array($values)) { - continue; - } - - $results = array_merge($results, $values); - } - - return $results; - } - - /** - * Cross join the given arrays, returning all possible permutations. - * - * @param array ...$arrays - * @return array - */ - public static function crossJoin(...$arrays) - { - $results = [[]]; - - foreach ($arrays as $index => $array) { - $append = []; - - foreach ($results as $product) { - foreach ($array as $item) { - $product[$index] = $item; - - $append[] = $product; - } - } - - $results = $append; - } - - return $results; - } - - /** - * Divide an array into two arrays. One with keys and the other with values. - * - * @param array $array - * @return array - */ - public static function divide($array) - { - return [array_keys($array), array_values($array)]; - } - - /** - * Flatten a multi-dimensional associative array with dots. - * - * @param array $array - * @param string $prepend - * @return array - */ - public static function dot($array, $prepend = '') - { - $results = []; - - foreach ($array as $key => $value) { - if (is_array($value) && !empty($value)) { - $results = array_merge($results, static::dot($value, $prepend . $key . '.')); - } else { - $results[$prepend . $key] = $value; - } - } - - return $results; - } - - /** - * Get all of the given array except for a specified array of keys. - * - * @param array $array - * @param array|string $keys - * @return array - */ - public static function except($array, $keys) - { - static::forget($array, $keys); - - return $array; - } - - /** - * Determine if the given key exists in the provided array. - * - * @param \ArrayAccess|array $array - * @param string|int $key - * @return bool - */ - public static function exists($array, $key) - { - if ($array instanceof ArrayAccess) { - return $array->offsetExists($key); - } - - return array_key_exists($key, $array); - } - - /** - * Return the first element in an array passing a given truth test. - * - * @param array $array - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - public static function first($array, callable $callback = null, $default = null) - { - if (is_null($callback)) { - if (empty($array)) { - return value($default); - } - - foreach ($array as $item) { - return $item; - } - } - - foreach ($array as $key => $value) { - if (call_user_func($callback, $value, $key)) { - return $value; - } - } - - return value($default); - } - - /** - * Return the last element in an array passing a given truth test. - * - * @param array $array - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - public static function last($array, callable $callback = null, $default = null) - { - if (is_null($callback)) { - return empty($array) ? value($default) : end($array); - } - - return static::first(array_reverse($array, true), $callback, $default); - } - - /** - * Flatten a multi-dimensional array into a single level. - * - * @param array $array - * @param int $depth - * @return array - */ - public static function flatten($array, $depth = INF) - { - $result = []; - - foreach ($array as $item) { - $item = $item instanceof Collection ? $item->all() : $item; - - if (!is_array($item)) { - $result[] = $item; - } elseif ($depth === 1) { - $result = array_merge($result, array_values($item)); - } else { - $result = array_merge($result, static::flatten($item, $depth - 1)); - } - } - - return $result; - } - - /** - * Remove one or many array items from a given array using "dot" notation. - * - * @param array $array - * @param array|string $keys - * @return void - */ - public static function forget(&$array, $keys) - { - $original = &$array; - - $keys = (array) $keys; - - if (count($keys) === 0) { - return; - } - - foreach ($keys as $key) { - // if the exact key exists in the top-level, remove it - if (static::exists($array, $key)) { - unset($array[$key]); - - continue; - } - - $parts = explode('.', $key); - - // clean up before each pass - $array = &$original; - - while (count($parts) > 1) { - $part = array_shift($parts); - - if (isset($array[$part]) && is_array($array[$part])) { - $array = &$array[$part]; - } else { - continue 2; - } - } - - unset($array[array_shift($parts)]); - } - } - - /** - * Get an item from an array using "dot" notation. - * - * @param \ArrayAccess|array $array - * @param string $key - * @param mixed $default - * @return mixed - */ - public static function get($array, $key, $default = null) - { - if (!static::accessible($array)) { - return value($default); - } - - if (is_null($key)) { - return $array; - } - - if (static::exists($array, $key)) { - return $array[$key]; - } - - if (strpos($key, '.') === false) { - return $array[$key] ?? value($default); - } - - foreach (explode('.', $key) as $segment) { - if (static::accessible($array) && static::exists($array, $segment)) { - $array = $array[$segment]; - } else { - return value($default); - } - } - - return $array; - } - - /** - * Check if an item or items exist in an array using "dot" notation. - * - * @param \ArrayAccess|array $array - * @param string|array $keys - * @return bool - */ - public static function has($array, $keys) - { - $keys = (array) $keys; - - if (!$array || $keys === []) { - return false; - } - - foreach ($keys as $key) { - $subKeyArray = $array; - - if (static::exists($array, $key)) { - continue; - } - - foreach (explode('.', $key) as $segment) { - if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) { - $subKeyArray = $subKeyArray[$segment]; - } else { - return false; - } - } - } - - return true; - } - - /** - * Determines if an array is associative. - * - * An array is "associative" if it doesn't have sequential numerical keys beginning with zero. - * - * @param array $array - * @return bool - */ - public static function isAssoc(array $array) - { - $keys = array_keys($array); - - return array_keys($keys) !== $keys; - } - - /** - * Get a subset of the items from the given array. - * - * @param array $array - * @param array|string $keys - * @return array - */ - public static function only($array, $keys) - { - return array_intersect_key($array, array_flip((array) $keys)); - } - - /** - * Pluck an array of values from an array. - * - * @param array $array - * @param string|array $value - * @param string|array|null $key - * @return array - */ - public static function pluck($array, $value, $key = null) - { - $results = []; - - [$value, $key] = static::explodePluckParameters($value, $key); - - foreach ($array as $item) { - $itemValue = data_get($item, $value); - - // If the key is "null", we will just append the value to the array and keep - // looping. Otherwise we will key the array using the value of the key we - // received from the developer. Then we'll return the final array form. - if (is_null($key)) { - $results[] = $itemValue; - } else { - $itemKey = data_get($item, $key); - - if (is_object($itemKey) && method_exists($itemKey, '__toString')) { - $itemKey = (string) $itemKey; - } - - $results[$itemKey] = $itemValue; - } - } - - return $results; - } - - /** - * Explode the "value" and "key" arguments passed to "pluck". - * - * @param string|array $value - * @param string|array|null $key - * @return array - */ - protected static function explodePluckParameters($value, $key) - { - $value = is_string($value) ? explode('.', $value) : $value; - - $key = is_null($key) || is_array($key) ? $key : explode('.', $key); - - return [$value, $key]; - } - - /** - * Push an item onto the beginning of an array. - * - * @param array $array - * @param mixed $value - * @param mixed $key - * @return array - */ - public static function prepend($array, $value, $key = null) - { - if (is_null($key)) { - array_unshift($array, $value); - } else { - $array = [$key => $value] + $array; - } - - return $array; - } - - /** - * Get a value from the array, and remove it. - * - * @param array $array - * @param string $key - * @param mixed $default - * @return mixed - */ - public static function pull(&$array, $key, $default = null) - { - $value = static::get($array, $key, $default); - - static::forget($array, $key); - - return $value; - } - - /** - * Get one or a specified number of random values from an array. - * - * @param array $array - * @param int|null $number - * @return mixed - * - * @throws \InvalidArgumentException - */ - public static function random($array, $number = null) - { - $requested = is_null($number) ? 1 : $number; - - $count = count($array); - - if ($requested > $count) { - throw new InvalidArgumentException( - "You requested {$requested} items, but there are only {$count} items available." - ); - } - - if (is_null($number)) { - return $array[array_rand($array)]; - } - - if ((int) $number === 0) { - return []; - } - - $keys = array_rand($array, $number); - - $results = []; - - foreach ((array) $keys as $key) { - $results[] = $array[$key]; - } - - return $results; - } - - /** - * Set an array item to a given value using "dot" notation. - * - * If no key is given to the method, the entire array will be replaced. - * - * @param array $array - * @param string $key - * @param mixed $value - * @return array - */ - public static function set(&$array, $key, $value) - { - if (is_null($key)) { - return $array = $value; - } - - $keys = explode('.', $key); - - while (count($keys) > 1) { - $key = array_shift($keys); - - // If the key doesn't exist at this depth, we will just create an empty array - // to hold the next value, allowing us to create the arrays to hold final - // values at the correct depth. Then we'll keep digging into the array. - if (!isset($array[$key]) || !is_array($array[$key])) { - $array[$key] = []; - } - - $array = &$array[$key]; - } - - $array[array_shift($keys)] = $value; - - return $array; - } - - /** - * Shuffle the given array and return the result. - * - * @param array $array - * @param int|null $seed - * @return array - */ - public static function shuffle($array, $seed = null) - { - if (is_null($seed)) { - shuffle($array); - } else { - srand($seed); - - usort($array, function () { - return rand(-1, 1); - }); - } - - return $array; - } - - /** - * Sort the array using the given callback or "dot" notation. - * - * @param array $array - * @param callable|string|null $callback - * @return array - */ - public static function sort($array, $callback = null) - { - return Collection::make($array)->sort($callback)->all(); - } - - /** - * Recursively sort an array by keys and values. - * - * @param array $array - * @return array - */ - public static function sortRecursive($array) - { - foreach ($array as &$value) { - if (is_array($value)) { - $value = static::sortRecursive($value); - } - } - - if (static::isAssoc($array)) { - ksort($array); - } else { - sort($array); - } - - return $array; - } - - /** - * Convert the array into a query string. - * - * @param array $array - * @return string - */ - public static function query($array) - { - return http_build_query($array, null, '&', PHP_QUERY_RFC3986); - } - - /** - * Filter the array using the given callback. - * - * @param array $array - * @param callable $callback - * @return array - */ - public static function where($array, callable $callback) - { - return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH); - } - - /** - * If the given value is not an array and not null, wrap it in one. - * - * @param mixed $value - * @return array - */ - public static function wrap($value) - { - if (is_null($value)) { - return []; - } - - return is_array($value) ? $value : [$value]; - } -} \ No newline at end of file diff --git a/vendor/topthink/think-helper/src/helper/Str.php b/vendor/topthink/think-helper/src/helper/Str.php deleted file mode 100644 index 7391fbd..0000000 --- a/vendor/topthink/think-helper/src/helper/Str.php +++ /dev/null @@ -1,234 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\helper; - -class Str -{ - - protected static $snakeCache = []; - - protected static $camelCache = []; - - protected static $studlyCache = []; - - /** - * 检查字符串中是否包含某些字符串 - * @param string $haystack - * @param string|array $needles - * @return bool - */ - public static function contains(string $haystack, $needles): bool - { - foreach ((array) $needles as $needle) { - if ('' != $needle && mb_strpos($haystack, $needle) !== false) { - return true; - } - } - - return false; - } - - /** - * 检查字符串是否以某些字符串结尾 - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - public static function endsWith(string $haystack, $needles): bool - { - foreach ((array) $needles as $needle) { - if ((string) $needle === static::substr($haystack, -static::length($needle))) { - return true; - } - } - - return false; - } - - /** - * 检查字符串是否以某些字符串开头 - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - public static function startsWith(string $haystack, $needles): bool - { - foreach ((array) $needles as $needle) { - if ('' != $needle && mb_strpos($haystack, $needle) === 0) { - return true; - } - } - - return false; - } - - /** - * 获取指定长度的随机字母数字组合的字符串 - * - * @param int $length - * @param int $type - * @param string $addChars - * @return string - */ - public static function random(int $length = 6, int $type = null, string $addChars = ''): string - { - $str = ''; - switch ($type) { - case 0: - $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' . $addChars; - break; - case 1: - $chars = str_repeat('0123456789', 3); - break; - case 2: - $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . $addChars; - break; - case 3: - $chars = 'abcdefghijklmnopqrstuvwxyz' . $addChars; - break; - case 4: - $chars = "们以我到他会作时要动国产的一是工就年阶义发成部民可出能方进在了不和有大这主中人上为来分生对于学下级地个用同行面说种过命度革而多子后自社加小机也经力线本电高量长党得实家定深法表着水理化争现所二起政三好十战无农使性前等反体合斗路图把结第里正新开论之物从当两些还天资事队批点育重其思与间内去因件日利相由压员气业代全组数果期导平各基或月毛然如应形想制心样干都向变关问比展那它最及外没看治提五解系林者米群头意只明四道马认次文通但条较克又公孔领军流入接席位情运器并飞原油放立题质指建区验活众很教决特此常石强极土少已根共直团统式转别造切九你取西持总料连任志观调七么山程百报更见必真保热委手改管处己将修支识病象几先老光专什六型具示复安带每东增则完风回南广劳轮科北打积车计给节做务被整联步类集号列温装即毫知轴研单色坚据速防史拉世设达尔场织历花受求传口断况采精金界品判参层止边清至万确究书" . $addChars; - break; - default: - $chars = 'ABCDEFGHIJKMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789' . $addChars; - break; - } - if ($length > 10) { - $chars = $type == 1 ? str_repeat($chars, $length) : str_repeat($chars, 5); - } - if ($type != 4) { - $chars = str_shuffle($chars); - $str = substr($chars, 0, $length); - } else { - for ($i = 0; $i < $length; $i++) { - $str .= mb_substr($chars, floor(mt_rand(0, mb_strlen($chars, 'utf-8') - 1)), 1); - } - } - return $str; - } - - /** - * 字符串转小写 - * - * @param string $value - * @return string - */ - public static function lower(string $value): string - { - return mb_strtolower($value, 'UTF-8'); - } - - /** - * 字符串转大写 - * - * @param string $value - * @return string - */ - public static function upper(string $value): string - { - return mb_strtoupper($value, 'UTF-8'); - } - - /** - * 获取字符串的长度 - * - * @param string $value - * @return int - */ - public static function length(string $value): int - { - return mb_strlen($value); - } - - /** - * 截取字符串 - * - * @param string $string - * @param int $start - * @param int|null $length - * @return string - */ - public static function substr(string $string, int $start, int $length = null): string - { - return mb_substr($string, $start, $length, 'UTF-8'); - } - - /** - * 驼峰转下划线 - * - * @param string $value - * @param string $delimiter - * @return string - */ - public static function snake(string $value, string $delimiter = '_'): string - { - $key = $value; - - if (isset(static::$snakeCache[$key][$delimiter])) { - return static::$snakeCache[$key][$delimiter]; - } - - if (!ctype_lower($value)) { - $value = preg_replace('/\s+/u', '', $value); - - $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1' . $delimiter, $value)); - } - - return static::$snakeCache[$key][$delimiter] = $value; - } - - /** - * 下划线转驼峰(首字母小写) - * - * @param string $value - * @return string - */ - public static function camel(string $value): string - { - if (isset(static::$camelCache[$value])) { - return static::$camelCache[$value]; - } - - return static::$camelCache[$value] = lcfirst(static::studly($value)); - } - - /** - * 下划线转驼峰(首字母大写) - * - * @param string $value - * @return string - */ - public static function studly(string $value): string - { - $key = $value; - - if (isset(static::$studlyCache[$key])) { - return static::$studlyCache[$key]; - } - - $value = ucwords(str_replace(['-', '_'], ' ', $value)); - - return static::$studlyCache[$key] = str_replace(' ', '', $value); - } - - /** - * 转为首字母大写的标题格式 - * - * @param string $value - * @return string - */ - public static function title(string $value): string - { - return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8'); - } -} diff --git a/vendor/topthink/think-migration/.gitignore b/vendor/topthink/think-migration/.gitignore deleted file mode 100644 index 30babff..0000000 --- a/vendor/topthink/think-migration/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/vendor/ -.idea -composer.lock diff --git a/vendor/topthink/think-migration/LICENSE b/vendor/topthink/think-migration/LICENSE deleted file mode 100644 index 2c76a5a..0000000 --- a/vendor/topthink/think-migration/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ - -ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 -版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn) -All rights reserved。 -ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 - -Apache Licence是著名的非盈利开源组织Apache采用的协议。 -该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, -允许代码修改,再作为开源或商业软件发布。需要满足 -的条件: -1. 需要给代码的用户一份Apache Licence ; -2. 如果你修改了代码,需要在被修改的文件中说明; -3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 -带有原来代码中的协议,商标,专利声明和其他原来作者规 -定需要包含的说明; -4. 如果再发布的产品中包含一个Notice文件,则在Notice文 -件中需要带有本协议内容。你可以在Notice中增加自己的 -许可,但不可以表现为对Apache Licence构成更改。 -具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/topthink/think-migration/README.md b/vendor/topthink/think-migration/README.md deleted file mode 100644 index 39e6584..0000000 --- a/vendor/topthink/think-migration/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# thinkphp6 数据库迁移工具 - -## 安装 -~~~ -composer require topthink/think-migration -~~~ diff --git a/vendor/topthink/think-migration/composer.json b/vendor/topthink/think-migration/composer.json deleted file mode 100644 index 34b1339..0000000 --- a/vendor/topthink/think-migration/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "topthink/think-migration", - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "license": "Apache-2.0", - "autoload": { - "psr-4": { - "Phinx\\": "phinx/src/Phinx", - "think\\migration\\": "src" - } - }, - "extra": { - "think": { - "services": [ - "think\\migration\\Service" - ] - } - }, - "require": { - "topthink/framework": "^6.0.0", - "topthink/think-helper": "^3.0.3" - }, - "minimum-stability": "dev", - "suggest": { - "fzaninotto/faker": "Required to use the factory builder (^1.8)." - }, - "require-dev": { - "fzaninotto/faker": "^1.8" - } -} diff --git a/vendor/topthink/think-migration/phinx/CHANGELOG.md b/vendor/topthink/think-migration/phinx/CHANGELOG.md deleted file mode 100644 index df1c2e4..0000000 --- a/vendor/topthink/think-migration/phinx/CHANGELOG.md +++ /dev/null @@ -1,370 +0,0 @@ -# Version History - -**0.6.5** (Thursday, 27 October 2016) - -* Documentation updates -* Pull requests - * [#831](https://github.com/robmorgan/phinx/pull/831) Typos - * [#929](https://github.com/robmorgan/phinx/pull/929) Support glob brace for seed paths - * [#949](https://github.com/robmorgan/phinx/pull/949) Fix for Config::getMigrationBaseClassName - * [#958](https://github.com/robmorgan/phinx/pull/958) Allow console input to be used within adapters - -**0.6.4** (Wednesday, 27th July 2016) - -* Documentation updates -* Pull requests - * [#909](https://github.com/robmorgan/phinx/pull/909) Declare test class properties - * [#910](https://github.com/robmorgan/phinx/pull/910), [#916](https://github.com/robmorgan/phinx/pull/916) Remove unused variables - * [#912](https://github.com/robmorgan/phinx/pull/912) ConfigInterface usage consistency - * [#914](https://github.com/robmorgan/phinx/pull/914) Set return values and @return documentation - * [#918](https://github.com/robmorgan/phinx/pull/918) Docblock correction for Phinx\Migration\Manager::executeSeed() - * [#921](https://github.com/robmorgan/phinx/pull/921) Add Phinx\Wrapper\TextWrapper::getSeed() -* Bug fixes - * [#908](https://github.com/robmorgan/phinx/pull/908) Fix setting options for Column, ForeignKey and Index - * [#922](https://github.com/robmorgan/phinx/pull/922) SQLite adapter drops table on changeColumn if there's a foreign key - -**0.6.3** (Monday, 18th July 2016) - -* New features - * [#707](https://github.com/robmorgan/phinx/pull/707/files) Add arguments for timestamps columns names -* Documentation cleanup -* Bug fixes - * [#884](https://github.com/robmorgan/phinx/pull/884) Only rollback 1 migration when only 2 migrations exist - * Input and Output are now correctly supplied to migration template creation classes - -**0.6.2** (Thursday, 23rd June 2016) - -* Fix breakpoint support for Postgres -* HHVM now passes all tests - -**0.6.1** (Tuesday, 21st June 2016) - -* Fix rollback when only 1 migration - -**0.6.0** (Tuesday, 21st June 2016) - -* Backward incompatibility - see [UPGRADE_0.6](UPGRADE_0.6.md) document -* Introduce Input and Output access to migrations and template creation -* New breakpoint command -* Moved version history to this CHANGELOG.md document -* More tests - -**0.5.5** (Friday, 17th May 2016) - -* Fix support for running multiple seeders -* Bug fix for migration template source - defaults and command line -* Bug fixes - -**0.5.4** (Monday, 25th April 2016) - -* Added support for running multiple seeders -* Use `GLOB_BRACE` when finding migrations only if its available -* Added support for MySQL `VARBINARY` column type -* Minor bug fixes - -**0.5.3** (Monday, 7th March 2016) - -* Critical fix: allow `migration_name` to be `null`. Introduced in 0.5.2 -* Status command now shows migration start and end times -* Bug fix for rolling back by date -* Documentation improvements - -**0.5.2** (Tuesday, 1st March 2016) - -* Status command now includes missing migration names -* Added support for Postgres table comments -* Added `insert()` for the TablePrefixAdapter -* Fixed the migration verbosity flag -* Added MySQL 5.7 JSON support -* Added support for MySQL `FULLTEXT` indexes -* Postgres now supports `BIGSERIAL` for primary keys -* Added support for MySQL index limits -* Initial support for multiple migration paths (using glob) -* Documentation improvements -* Unit test enhancements - -**0.5.1** (Wednesday, 30th December 2015) - -* **PHP 5.3 is no longer supported!** -* Add support for Symfony 3.0 components -* Ensure that the `status` command returns the correct exit code -* Allow `$version` to be passed into templates -* Support for MySQL `YEAR` column type -* Multiple documentation updates and corrections - -**0.5.0** (Monday, 30th November 2015) - -* Support for seeding data after database creation -* The migration and seed directories are now nested under `db` by default -* Moved `Phinx\Migration\Util` to `Phinx\Util\Util` -* All `insert()` methods now have a slightly different method signature -* Fixed key/insert operations for MySQL -* Introduced `AdapterInterface::hasIndexByName()` -* Improved `dropForeignKey()` handling for SQLite -* Added support for the MySQL `binary` datatype. BLOBs now use the proper type. -* The status command shows a count of pending migrations in JSON output -* We are now testing against PHP 7 - -**0.4.6** (Friday, 11th September 2015) - -* You can now set custom migration templates in the config files -* Support for MySQL unsigned booleans -* Support for Postgres `smallint` column types -* Support for `AFTER` when using `changeColumn()` with MySQL -* Support for `precision` and `scale` when using the Postgres `decimal` type -* Fixed a bug where duplicate migration names could be used -* The schema table is now created with a primary key -* Fixed issues when using the MySQL `STRICT_TRANS_TABLE` mode -* Improved the docs in the default migration template -* Made Box PHAR ignore the bundled `phinx.yml` configuration file -* Updated Box installer URL -* Internal code improvements -* Documentation improvements - -**0.4.5** (Tuesday, 1st September 2015) - -* The rollback command now supports a date argument -* Fixed DBLIB DSN strings for Microsoft SQL Server -* Postgres support for `jsonb` columns added -* The `addTimestamps()` helper method no longer updates the `created_at` column -* Fix for Postgres named foreign keys -* Unit test improvements (including strict warnings) -* Documentation improvements - -**0.4.4** (Sunday, 14th June 2015) - -* The `change` method is now the default -* Added a generic adapter insert method. Warning: The implementation will change! -* Updated Symfony depdencies to ~2.7 -* Support for MySQL `BLOB` column types -* SQLite migration fixes -* Documentation improvements - -**0.4.3** (Monday, 23rd Feburary 2015) - -* Postgres bugfix for modifying column DEFAULTs -* MySQL bugfix for setting column INTEGER lengths -* SQLite bugfix for creating multiple indexes with similar names - -**0.4.2.1** (Saturday, 7th Feburary 2015) - -* Proper release, updated docs - -**0.4.2** (Friday, 6th Feburary 2015) - -* Postgres support for `json` columns added -* MySQL support for `enum` and `set` columns added -* Allow setting `identity` option on columns -* Template configuration and generation made more extensible -* Created a base class for `ProxyAdapter` and `TablePrefixAdapter` -* Switched to PSR-4 - -**0.4.1** (Tuesday, 23rd December 2014) - -* MySQL support for reserved words in hasColumn and getColumns methods -* Better MySQL Adapter test coverage and performance fixes -* Updated dependent Symfony components to 2.6.x - -**0.4.0** (Sunday, 14th December 2014) - -* Adding initial support for running Phinx via a web interface -* Support for table prefixes and suffixes -* Bugfix for foreign key options -* MySQL keeps column default when renaming columns -* MySQL support for tiny/medium and longtext columns added -* Changed SQL Server binary columns to varbinary -* MySQL supports table comments -* Postgres supports column comments -* Empty strings are now supported for default column values -* Booleans are now supported for default column values -* Fixed SQL Server default constraint error when changing column types -* Migration timestamps are now created in UTC -* Locked Symfony Components to 2.5.0 -* Support for custom migration base classes -* Cleaned up source code formatting -* Migrations have access to the output stream -* Support for custom PDO connections when a PHP config -* Added support for Postgres UUID type -* Fixed issue with Postgres dropping foreign keys - -**0.3.8** (Sunday, 5th October 2014) - -* Added new CHAR & Geospatial column types -* Added MySQL unix socket support -* Added precision & scale support for SQL Server -* Several bug fixes for SQLite -* Improved error messages -* Overall code optimizations -* Optimizations to MySQL hasTable method - -**0.3.7** (Tuesday, 12th August 2014) - -* Smarter configuration file support -* Support for Postgres Schemas -* Fixed charset support for Microsoft SQL Server -* Fix for Unique indexes in all adapters -* Improvements for MySQL foreign key migration syntax -* Allow MySQL column types with extra info -* Fixed SQLite autoincrement behaviour -* PHPDoc improvements -* Documentation improvements -* Unit test improvements -* Removing primary_key as a type - -**0.3.6** (Sunday, 29th June 2014) - -* Add custom adapter support -* Fix PHP 5.3 compatibility for SQL Server - -**0.3.5** (Saturday, 21st June 2014) - -* Added Microsoft SQL Server support -* Removed Primary Key column type -* Cleaned up and optimized many methods -* Updated Symfony dependencies to v2.5.0 -* PHPDoc improvements - -**0.3.4** (Sunday, 27th April 2014) - -* Added support MySQL unsigned integer, biginteger, float and decimal types -* Added JSON output support for the status command -* Fix a bug where Postgres couldnt rollback foreign keys -* Moved Phinx type references to interface constants -* Fixed a bug with SQLite in-memory databases - -**0.3.3** (Saturday, 22nd March 2014) - -* Added support for JSON configuration -* Named index support for all adapters (thanks @archer308) -* Updated Composer dependencies -* Fix for SQLite Integer Type -* Fix for MySQL port option - -**0.3.2** (Monday, 24th February 2014) - -* Adding better Postgres type support - -**0.3.1** (Sunday, 23rd February 2014) - -* Adding MySQL charset support to the YAML config -* Removing trailing spaces - -**0.3.0** (Sunday, 2nd February 2014) - -* PSR-2 support -* Method to add timestamps easily to tables -* Support for column comments in the Postgres adapter -* Fixes for MySQL driver options -* Fixes for MySQL biginteger type - -**0.2.9** (Saturday, 16th November 2013) - -* Added SQLite Support -* Improving the unit tests, especially on Windows - -**0.2.8** (Sunday, 25th August 2013) - -* Added PostgresSQL Support - -**0.2.7** (Saturday, 24th August 2013) - -* Critical fix for a token parsing bug -* Removed legacy build system -* Improving docs - -**0.2.6** (Saturday, 24th August 2013) - -* Added support for environment vars in config files -* Added support for environment vars to set the Phinx Env -* Improving docs -* Fixed a bug with column names in indexes -* Changes for developers in regards to the unit tests - -**0.2.5** (Sunday, 26th May 2013) - -* Added support for Box Phar Archive Packaging -* Added support for MYSQL_ATTR driver options -* Fixed a bug where foreign keys cannot be removed -* Added support for MySQL table collation -* Updated Composer dependencies -* Removed verbosity options, now relies on Symfony instead -* Improved unit tests - -**0.2.4** (Saturday, 20th April 2013) - -* The Rollback command supports the verbosity parameter -* The Rollback command has more detailed output -* Table::dropForeignKey now returns the table instance - -**0.2.3** (Saturday, 6th April 2013) - -* Fixed a reporting bug when Phinx couldn't connect to a database -* Added support for the MySQL 'ON UPDATE' function -* Phinx timestamp is now mapped to MySQL timestamp instead of datetime -* Fixed a docs typo for the minimum PHP version -* Added UTF8 support for migrations -* Changed regex to handle migration names differently -* Added support for custom MySQL table engines such as MyISAM -* Added the change method to the migration template - -**0.2.2** (Sunday, 3rd March 2013) - -* Added a new verbosity parameter to see more output when migrating -* Support for PHP config files - -**0.2.1** (Sunday, 3rd March 2013) - -* Broken Release. Do not use! -* Unit tests no longer rely on the default phinx.yml file -* Running migrate for the first time does not give php warnings -* `default_migration_table` is now actually supported -* Updated docblocks to 2013. - -**0.2.0** (Sunday, 13th January 2013) - -* First Birthday Release -* Added Reversible Migrations -* Removed options parameter from AdapterInterface::hasColumn() - -**0.1.7** (Tuesday, 8th January 2013) - -* Improved documentation on the YAML configuration file -* Removed options parameter from AdapterInterface::dropIndex() - -**0.1.6** (Sunday, 9th December 2012) - -* Added foreign key support -* Removed PEAR support -* Support for auto_increment on custom id columns -* Bugfix for column default value 0 -* Documentation improvements - -**0.1.5** (Sunday, 4th November 2012) - -* Added a test command -* Added transactions for adapters that support it -* Changing the Table API to use pending column methods -* Fixed a bug when defining multiple indexes on a table - -**0.1.4** (Sunday, 21st October 2012) - -* Documentation Improvements - -**0.1.3** (Saturday, 20th October 2012) - -* Fixed broken composer support - -**0.1.2** (Saturday, 20th October 2012) - -* Added composer support -* Now forces migrations to be in CamelCase format -* Now specifies the database name when migrating -* Creates the internal log table using its API instead of raw SQL - -**0.1.1** (Wednesday, 13th June 2012) - -* First point release. Ready for limited production use. - -**0.1.0** (Friday, 13th January 2012) - -* Initial public release. diff --git a/vendor/topthink/think-migration/phinx/CONTRIBUTING.md b/vendor/topthink/think-migration/phinx/CONTRIBUTING.md deleted file mode 100644 index 73b54ac..0000000 --- a/vendor/topthink/think-migration/phinx/CONTRIBUTING.md +++ /dev/null @@ -1,66 +0,0 @@ -# How to contribute to Phinx - -Phinx relies heavily on external contributions in order to make it the best database migration -tool possible. Without the support of our 115+ contributors we wouldn't be where we are today! -We encourage anyone to submit documentation enhancements and code. - -Issues, feature requests and bugs should be submitted using the Github issue tool: -https://github.com/robmorgan/phinx/issues. - -This document briefly outlines the requirements to contribute code to Phinx. - -## Considerations - -Before you submit your pull request take a moment to answer the following questions. - -Answering '**YES**' to all questions will increase the likelihood of your PR being accepted! - -* Have I implemented my feature for as many database adapters as possible? -* Does my new feature improve Phinx's performance or keep it consistent? -* Does my feature fit within the database migration space? -* Is the code entirely my own and free from any commercial licensing? -* Am I happy to release my code under the MIT license? -* Is my code formatted using the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standard? - -**Note:** We accept bug fixes much faster into our development branch than features. - -## Getting Started - -Great, so you want to contribute. Let's get started: - -1. Start by forking Phinx on GitHub: https://github.com/robmorgan/phinx - -1. Clone your repository to a local directory on your development box. - -1. If you do not have Composer set up already, install it: - - ``` - curl -sS https://getcomposer.org/installer | php - ``` - -1. Change to your Phinx clone directory and pull the necessary dependencies: - - ``` - php composer.phar install - ``` - -1. Copy the `phpunit.xml.dist` template to `phpunit.xml` and change the configuration to suit your environment. If you are not using any particular adapter you can disable it in the `phpunit.xml` file. - -1. Run the unit tests locally to ensure they pass: - - ``` - php vendor/bin/phpunit --config phpunit.xml - ``` - -1. Write the code and unit tests for your bug fix or feature. - -1. Add any relevant documentation. - -1. Run the unit tests again and ensure they pass. - -1. Open a pull request on the Github project page. Ensure the code is being merged into the latest development branch (e.g: `0.5.x-dev`) and not `master`. - -## Documentation - -The Phinx documentation is stored in the **docs** directory using the [RestructedText](http://docutils.sourceforge.net/rst.html) format. All documentation merged to `master` is automatically published to the Phinx documentation site available -at: http://docs.phinx.org. Keep this in mind when submitting your PR, or ask someone to merge the development branch back down to master. diff --git a/vendor/topthink/think-migration/phinx/LICENSE b/vendor/topthink/think-migration/phinx/LICENSE deleted file mode 100644 index 26ade90..0000000 --- a/vendor/topthink/think-migration/phinx/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -(The MIT license) - -Copyright (c) 2014 Rob Morgan - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/topthink/think-migration/phinx/README.md b/vendor/topthink/think-migration/phinx/README.md deleted file mode 100644 index ed1badc..0000000 --- a/vendor/topthink/think-migration/phinx/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# [Phinx](https://phinx.org): Simple PHP Database Migrations - -[![Build Status](https://travis-ci.org/robmorgan/phinx.png?branch=master)](https://travis-ci.org/robmorgan/phinx) -[![Build status](https://ci.appveyor.com/api/projects/status/9vag4892hfq6effr)](https://ci.appveyor.com/project/robmorgan/phinx) -[![Code Coverage](https://scrutinizer-ci.com/g/robmorgan/phinx/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/robmorgan/phinx/) -[![Latest Stable Version](https://poser.pugx.org/robmorgan/phinx/version.png)](https://packagist.org/packages/robmorgan/phinx) -[![Total Downloads](https://poser.pugx.org/robmorgan/phinx/d/total.png)](https://packagist.org/packages/robmorgan/phinx) - -Phinx makes it ridiculously easy to manage the database migrations for your PHP app. In less than 5 minutes you can install Phinx and create your first database migration. Phinx is just about migrations without all the bloat of a database ORM system or framework. - -**Check out http://docs.phinx.org for the comprehensive documentation.** - -![phinxterm](https://cloud.githubusercontent.com/assets/178939/3887559/e6b5e524-21f2-11e4-8256-0ba6040725fc.gif) - -### Features - -* Write database migrations using database agnostic PHP code. -* Migrate up and down. -* Migrate on deployment. -* Seed data after database creation. -* Get going in less than 5 minutes. -* Stop worrying about the state of your database. -* Take advantage of SCM features such as branching. -* Integrate with any app. - -### Supported Adapters - -Phinx natively supports the following database adapters: - -* MySQL -* PostgreSQL -* SQLite -* Microsoft SQL Server - -## Install & Run - -### Composer - -The fastest way to install Phinx is to add it to your project using Composer (http://getcomposer.org/). - -1. Install Composer: - - ``` - curl -sS https://getcomposer.org/installer | php - ``` - -1. Require Phinx as a dependency using Composer: - - ``` - php composer.phar require robmorgan/phinx - ``` - -1. Install Phinx: - - ``` - php composer.phar install - ``` - -1. Execute Phinx: - - ``` - php vendor/bin/phinx - ``` - -### As a Phar - -You can also use the Box application to build Phinx as a Phar archive (https://box-project.github.io/box2/). - -1. Clone Phinx from GitHub - - ``` - git clone git://github.com/robmorgan/phinx.git - cd phinx - ``` - -1. Install Composer - - ``` - curl -s https://getcomposer.org/installer | php - ``` - -1. Install the Phinx dependencies - - ``` - php composer.phar install - ``` - -1. Install Box: - - ``` - curl -LSs https://box-project.github.io/box2/installer.php | php - ``` - -1. Create a Phar archive - - ``` - php box.phar build - ``` - -## Documentation - -Check out http://docs.phinx.org for the comprehensive documentation. - -## Contributing - -Please read the [CONTRIBUTING](CONTRIBUTING.md) document. - -## News & Updates - -Follow Rob (@\_rjm\_) on Twitter to stay up to date (http://twitter.com/_rjm_) - -## Misc - -### Version History - -Please read the [CHANGELOG](CHANGELOG.md) document. - -### License - -(The MIT license) - -Copyright (c) 2016 Rob Morgan - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterFactory.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterFactory.php deleted file mode 100644 index 90674f9..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterFactory.php +++ /dev/null @@ -1,181 +0,0 @@ - - */ -class AdapterFactory -{ - /** - * @var AdapterFactory - */ - protected static $instance; - - /** - * Get the factory singleton instance. - * - * @return AdapterFactory - */ - public static function instance() - { - if (!static::$instance) { - static::$instance = new static(); - } - return static::$instance; - } - - /** - * Class map of database adapters, indexed by PDO::ATTR_DRIVER_NAME. - * - * @var array - */ - protected $adapters = array( - 'mysql' => 'Phinx\Db\Adapter\MysqlAdapter', - 'pgsql' => 'Phinx\Db\Adapter\PostgresAdapter', - 'sqlite' => 'Phinx\Db\Adapter\SQLiteAdapter', - 'sqlsrv' => 'Phinx\Db\Adapter\SqlServerAdapter', - ); - - /** - * Class map of adapters wrappers, indexed by name. - * - * @var array - */ - protected $wrappers = array( - 'prefix' => 'Phinx\Db\Adapter\TablePrefixAdapter', - 'proxy' => 'Phinx\Db\Adapter\ProxyAdapter', - ); - - /** - * Add or replace an adapter with a fully qualified class name. - * - * @throws \RuntimeException - * @param string $name - * @param string $class - * @return $this - */ - public function registerAdapter($name, $class) - { - if (!is_subclass_of($class, 'Phinx\Db\Adapter\AdapterInterface')) { - throw new \RuntimeException(sprintf( - 'Adapter class "%s" must implement Phinx\\Db\\Adapter\\AdapterInterface', - $class - )); - } - $this->adapters[$name] = $class; - return $this; - } - - /** - * Get an adapter class by name. - * - * @throws \RuntimeException - * @param string $name - * @return string - */ - protected function getClass($name) - { - if (empty($this->adapters[$name])) { - throw new \RuntimeException(sprintf( - 'Adapter "%s" has not been registered', - $name - )); - } - return $this->adapters[$name]; - } - - /** - * Get an adapter instance by name. - * - * @param string $name - * @param array $options - * @return AdapterInterface - */ - public function getAdapter($name, array $options) - { - $class = $this->getClass($name); - return new $class($options); - } - - /** - * Add or replace a wrapper with a fully qualified class name. - * - * @throws \RuntimeException - * @param string $name - * @param string $class - * @return $this - */ - public function registerWrapper($name, $class) - { - if (!is_subclass_of($class, 'Phinx\Db\Adapter\WrapperInterface')) { - throw new \RuntimeException(sprintf( - 'Wrapper class "%s" must be implement Phinx\\Db\\Adapter\\WrapperInterface', - $class - )); - } - $this->wrappers[$name] = $class; - return $this; - } - - /** - * Get a wrapper class by name. - * - * @throws \RuntimeException - * @param string $name - * @return string - */ - protected function getWrapperClass($name) - { - if (empty($this->wrappers[$name])) { - throw new \RuntimeException(sprintf( - 'Wrapper "%s" has not been registered', - $name - )); - } - return $this->wrappers[$name]; - } - - /** - * Get a wrapper instance by name. - * - * @param string $name - * @param AdapterInterface $adapter - * @return AdapterInterface - */ - public function getWrapper($name, AdapterInterface $adapter) - { - $class = $this->getWrapperClass($name); - return new $class($adapter); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterInterface.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterInterface.php deleted file mode 100644 index f2e9fe1..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterInterface.php +++ /dev/null @@ -1,510 +0,0 @@ - - */ -interface AdapterInterface -{ - const PHINX_TYPE_STRING = 'string'; - const PHINX_TYPE_CHAR = 'char'; - const PHINX_TYPE_TEXT = 'text'; - const PHINX_TYPE_INTEGER = 'integer'; - const PHINX_TYPE_BIG_INTEGER = 'biginteger'; - const PHINX_TYPE_FLOAT = 'float'; - const PHINX_TYPE_DECIMAL = 'decimal'; - const PHINX_TYPE_DATETIME = 'datetime'; - const PHINX_TYPE_TIMESTAMP = 'timestamp'; - const PHINX_TYPE_TIME = 'time'; - const PHINX_TYPE_DATE = 'date'; - const PHINX_TYPE_BINARY = 'binary'; - const PHINX_TYPE_VARBINARY = 'varbinary'; - const PHINX_TYPE_BLOB = 'blob'; - const PHINX_TYPE_BOOLEAN = 'boolean'; - const PHINX_TYPE_JSON = 'json'; - const PHINX_TYPE_JSONB = 'jsonb'; - const PHINX_TYPE_UUID = 'uuid'; - const PHINX_TYPE_FILESTREAM = 'filestream'; - - // Geospatial database types - const PHINX_TYPE_GEOMETRY = 'geometry'; - const PHINX_TYPE_POINT = 'point'; - const PHINX_TYPE_LINESTRING = 'linestring'; - const PHINX_TYPE_POLYGON = 'polygon'; - - // only for mysql so far - const PHINX_TYPE_ENUM = 'enum'; - const PHINX_TYPE_SET = 'set'; - - /** - * Get all migrated version numbers. - * - * @return array - */ - public function getVersions(); - - /** - * Get all migration log entries, indexed by version number. - * - * @return array - */ - public function getVersionLog(); - - /** - * Set adapter configuration options. - * - * @param array $options - * @return AdapterInterface - */ - public function setOptions(array $options); - - /** - * Get all adapter options. - * - * @return array - */ - public function getOptions(); - - /** - * Check if an option has been set. - * - * @param string $name - * @return boolean - */ - public function hasOption($name); - - /** - * Get a single adapter option, or null if the option does not exist. - * - * @param string $name - * @return mixed - */ - public function getOption($name); - - /** - * Sets the console input. - * - * @param InputInterface $input Input - * @return AdapterInterface - */ - public function setInput(InputInterface $input); - - /** - * Gets the console input. - * - * @return InputInterface - */ - public function getInput(); - - /** - * Sets the console output. - * - * @param OutputInterface $output Output - * @return AdapterInterface - */ - public function setOutput(OutputInterface $output); - - /** - * Gets the console output. - * - * @return OutputInterface - */ - public function getOutput(); - - /** - * Records a migration being run. - * - * @param MigrationInterface $migration Migration - * @param string $direction Direction - * @param int $startTime Start Time - * @param int $endTime End Time - * @return AdapterInterface - */ - public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime); - - /** - * Toggle a migration breakpoint. - * - * @param MigrationInterface $migration - * - * @return AdapterInterface - */ - public function toggleBreakpoint(MigrationInterface $migration); - - /** - * Reset all migration breakpoints. - * - * @return int The number of breakpoints reset - */ - public function resetAllBreakpoints(); - - /** - * Does the schema table exist? - * - * @deprecated use hasTable instead. - * @return boolean - */ - public function hasSchemaTable(); - - /** - * Creates the schema table. - * - * @return void - */ - public function createSchemaTable(); - - /** - * Returns the adapter type. - * - * @return string - */ - public function getAdapterType(); - - /** - * Initializes the database connection. - * - * @throws \RuntimeException When the requested database driver is not installed. - * @return void - */ - public function connect(); - - /** - * Closes the database connection. - * - * @return void - */ - public function disconnect(); - - /** - * Does the adapter support transactions? - * - * @return boolean - */ - public function hasTransactions(); - - /** - * Begin a transaction. - * - * @return void - */ - public function beginTransaction(); - - /** - * Commit a transaction. - * - * @return void - */ - public function commitTransaction(); - - /** - * Rollback a transaction. - * - * @return void - */ - public function rollbackTransaction(); - - /** - * Executes a SQL statement and returns the number of affected rows. - * - * @param string $sql SQL - * @return int - */ - public function execute($sql); - - /** - * Executes a SQL statement and returns the result as an array. - * - * @param string $sql SQL - * @return array - */ - public function query($sql); - - /** - * Executes a query and returns only one row as an array. - * - * @param string $sql SQL - * @return array - */ - public function fetchRow($sql); - - /** - * Executes a query and returns an array of rows. - * - * @param string $sql SQL - * @return array - */ - public function fetchAll($sql); - - /** - * Inserts data into a table. - * - * @param Table $table where to insert data - * @param array $row - * @return void - */ - public function insert(Table $table, $row); - - /** - * Quotes a table name for use in a query. - * - * @param string $tableName Table Name - * @return string - */ - public function quoteTableName($tableName); - - /** - * Quotes a column name for use in a query. - * - * @param string $columnName Table Name - * @return string - */ - public function quoteColumnName($columnName); - - /** - * Checks to see if a table exists. - * - * @param string $tableName Table Name - * @return boolean - */ - public function hasTable($tableName); - - /** - * Creates the specified database table. - * - * @param Table $table Table - * @return void - */ - public function createTable(Table $table); - - /** - * Renames the specified database table. - * - * @param string $tableName Table Name - * @param string $newName New Name - * @return void - */ - public function renameTable($tableName, $newName); - - /** - * Drops the specified database table. - * - * @param string $tableName Table Name - * @return void - */ - public function dropTable($tableName); - - /** - * Returns table columns - * - * @param string $tableName Table Name - * @return Column[] - */ - public function getColumns($tableName); - - /** - * Checks to see if a column exists. - * - * @param string $tableName Table Name - * @param string $columnName Column Name - * @return boolean - */ - public function hasColumn($tableName, $columnName); - - /** - * Adds the specified column to a database table. - * - * @param Table $table Table - * @param Column $column Column - * @return void - */ - public function addColumn(Table $table, Column $column); - - /** - * Renames the specified column. - * - * @param string $tableName Table Name - * @param string $columnName Column Name - * @param string $newColumnName New Column Name - * @return void - */ - public function renameColumn($tableName, $columnName, $newColumnName); - - /** - * Change a table column type. - * - * @param string $tableName Table Name - * @param string $columnName Column Name - * @param Column $newColumn New Column - * @return Table - */ - public function changeColumn($tableName, $columnName, Column $newColumn); - - /** - * Drops the specified column. - * - * @param string $tableName Table Name - * @param string $columnName Column Name - * @return void - */ - public function dropColumn($tableName, $columnName); - - /** - * Checks to see if an index exists. - * - * @param string $tableName Table Name - * @param mixed $columns Column(s) - * @return boolean - */ - public function hasIndex($tableName, $columns); - - /** - * Checks to see if an index specified by name exists. - * - * @param string $tableName Table Name - * @param string $indexName - * @return boolean - */ - public function hasIndexByName($tableName, $indexName); - - /** - * Adds the specified index to a database table. - * - * @param Table $table Table - * @param Index $index Index - * @return void - */ - public function addIndex(Table $table, Index $index); - - /** - * Drops the specified index from a database table. - * - * @param string $tableName - * @param mixed $columns Column(s) - * @return void - */ - public function dropIndex($tableName, $columns); - - /** - * Drops the index specified by name from a database table. - * - * @param string $tableName - * @param string $indexName - * @return void - */ - public function dropIndexByName($tableName, $indexName); - - /** - * Checks to see if a foreign key exists. - * - * @param string $tableName - * @param string[] $columns Column(s) - * @param string $constraint Constraint name - * @return boolean - */ - public function hasForeignKey($tableName, $columns, $constraint = null); - - /** - * Adds the specified foreign key to a database table. - * - * @param Table $table - * @param ForeignKey $foreignKey - * @return void - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey); - - /** - * Drops the specified foreign key from a database table. - * - * @param string $tableName - * @param string[] $columns Column(s) - * @param string $constraint Constraint name - * @return void - */ - public function dropForeignKey($tableName, $columns, $constraint = null); - - /** - * Returns an array of the supported Phinx column types. - * - * @return array - */ - public function getColumnTypes(); - - /** - * Checks that the given column is of a supported type. - * - * @param Column $column - * @return boolean - */ - public function isValidColumnType(Column $column); - - /** - * Converts the Phinx logical type to the adapter's SQL type. - * - * @param string $type - * @param integer $limit - * @return string - */ - public function getSqlType($type, $limit = null); - - /** - * Creates a new database. - * - * @param string $name Database Name - * @param array $options Options - * @return void - */ - public function createDatabase($name, $options = array()); - - /** - * Checks to see if a database exists. - * - * @param string $name Database Name - * @return boolean - */ - public function hasDatabase($name); - - /** - * Drops the specified database. - * - * @param string $name Database Name - * @return void - */ - public function dropDatabase($name); -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php deleted file mode 100644 index ae5ec39..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php +++ /dev/null @@ -1,507 +0,0 @@ - - */ -abstract class AdapterWrapper implements AdapterInterface, WrapperInterface -{ - /** - * @var AdapterInterface - */ - protected $adapter; - - /** - * {@inheritdoc} - */ - public function __construct(AdapterInterface $adapter) - { - $this->setAdapter($adapter); - } - - /** - * {@inheritdoc} - */ - public function setAdapter(AdapterInterface $adapter) - { - $this->adapter = $adapter; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options) - { - $this->adapter->setOptions($options); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOptions() - { - return $this->adapter->getOptions(); - } - - /** - * {@inheritdoc} - */ - public function hasOption($name) - { - return $this->adapter->hasOption($name); - } - - /** - * {@inheritdoc} - */ - public function getOption($name) - { - return $this->adapter->getOption($name); - } - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->adapter->setInput($input); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getInput() - { - return $this->adapter->getInput(); - } - - /** - * {@inheritdoc} - */ - public function setOutput(OutputInterface $output) - { - $this->adapter->setOutput($output); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOutput() - { - return $this->adapter->getOutput(); - } - - /** - * {@inheritdoc} - */ - public function connect() - { - return $this->getAdapter()->connect(); - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - return $this->getAdapter()->disconnect(); - } - - /** - * {@inheritdoc} - */ - public function execute($sql) - { - return $this->getAdapter()->execute($sql); - } - - /** - * {@inheritdoc} - */ - public function query($sql) - { - return $this->getAdapter()->query($sql); - } - - /** - * {@inheritdoc} - */ - public function insert(Table $table, $row) - { - return $this->getAdapter()->insert($table, $row); - } - - /** - * {@inheritdoc} - */ - public function fetchRow($sql) - { - return $this->getAdapter()->fetchRow($sql); - } - - /** - * {@inheritdoc} - */ - public function fetchAll($sql) - { - return $this->getAdapter()->fetchAll($sql); - } - - /** - * {@inheritdoc} - */ - public function getVersions() - { - return $this->getAdapter()->getVersions(); - } - - /** - * {@inheritdoc} - */ - public function getVersionLog() - { - return $this->getAdapter()->getVersionLog(); - } - - /** - * {@inheritdoc} - */ - public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime) - { - $this->getAdapter()->migrated($migration, $direction, $startTime, $endTime); - return $this; - } - - /** - * @inheritDoc - */ - public function toggleBreakpoint(MigrationInterface $migration) - { - $this->getAdapter()->toggleBreakpoint($migration); - return $this; - } - - /** - * @inheritDoc - */ - public function resetAllBreakpoints() - { - return $this->getAdapter()->resetAllBreakpoints(); - } - - /** - * {@inheritdoc} - */ - public function hasSchemaTable() - { - return $this->getAdapter()->hasSchemaTable(); - } - - /** - * {@inheritdoc} - */ - public function createSchemaTable() - { - return $this->getAdapter()->createSchemaTable(); - } - - /** - * {@inheritdoc} - */ - public function getColumnTypes() - { - return $this->getAdapter()->getColumnTypes(); - } - - /** - * {@inheritdoc} - */ - public function isValidColumnType(Column $column) - { - return $this->getAdapter()->isValidColumnType($column); - } - - /** - * {@inheritdoc} - */ - public function hasTransactions() - { - return $this->getAdapter()->hasTransactions(); - } - - /** - * {@inheritdoc} - */ - public function beginTransaction() - { - return $this->getAdapter()->beginTransaction(); - } - - /** - * {@inheritdoc} - */ - public function commitTransaction() - { - return $this->getAdapter()->commitTransaction(); - } - - /** - * {@inheritdoc} - */ - public function rollbackTransaction() - { - return $this->getAdapter()->rollbackTransaction(); - } - - /** - * {@inheritdoc} - */ - public function quoteTableName($tableName) - { - return $this->getAdapter()->quoteTableName($tableName); - } - - /** - * {@inheritdoc} - */ - public function quoteColumnName($columnName) - { - return $this->getAdapter()->quoteColumnName($columnName); - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - return $this->getAdapter()->hasTable($tableName); - } - - /** - * {@inheritdoc} - */ - public function createTable(Table $table) - { - return $this->getAdapter()->createTable($table); - } - - /** - * {@inheritdoc} - */ - public function renameTable($tableName, $newTableName) - { - return $this->getAdapter()->renameTable($tableName, $newTableName); - } - - /** - * {@inheritdoc} - */ - public function dropTable($tableName) - { - return $this->getAdapter()->dropTable($tableName); - } - - /** - * {@inheritdoc} - */ - public function getColumns($tableName) - { - return $this->getAdapter()->getColumns($tableName); - } - - /** - * {@inheritdoc} - */ - public function hasColumn($tableName, $columnName) - { - return $this->getAdapter()->hasColumn($tableName, $columnName); - } - - /** - * {@inheritdoc} - */ - public function addColumn(Table $table, Column $column) - { - return $this->getAdapter()->addColumn($table, $column); - } - - /** - * {@inheritdoc} - */ - public function renameColumn($tableName, $columnName, $newColumnName) - { - return $this->getAdapter()->renameColumn($tableName, $columnName, $newColumnName); - } - - /** - * {@inheritdoc} - */ - public function changeColumn($tableName, $columnName, Column $newColumn) - { - return $this->getAdapter()->changeColumn($tableName, $columnName, $newColumn); - } - - /** - * {@inheritdoc} - */ - public function dropColumn($tableName, $columnName) - { - return $this->getAdapter()->dropColumn($tableName, $columnName); - } - - /** - * {@inheritdoc} - */ - public function hasIndex($tableName, $columns) - { - return $this->getAdapter()->hasIndex($tableName, $columns); - } - - /** - * {@inheritdoc} - */ - public function hasIndexByName($tableName, $indexName) - { - return $this->getAdapter()->hasIndexByName($tableName, $indexName); - } - - /** - * {@inheritdoc} - */ - public function addIndex(Table $table, Index $index) - { - return $this->getAdapter()->addIndex($table, $index); - } - - /** - * {@inheritdoc} - */ - public function dropIndex($tableName, $columns, $options = array()) - { - return $this->getAdapter()->dropIndex($tableName, $columns, $options); - } - - /** - * {@inheritdoc} - */ - public function dropIndexByName($tableName, $indexName) - { - return $this->getAdapter()->dropIndexByName($tableName, $indexName); - } - - /** - * {@inheritdoc} - */ - public function hasForeignKey($tableName, $columns, $constraint = null) - { - return $this->getAdapter()->hasForeignKey($tableName, $columns, $constraint); - } - - /** - * {@inheritdoc} - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey) - { - return $this->getAdapter()->addForeignKey($table, $foreignKey); - } - - /** - * {@inheritdoc} - */ - public function dropForeignKey($tableName, $columns, $constraint = null) - { - return $this->getAdapter()->dropForeignKey($tableName, $columns, $constraint); - } - - /** - * {@inheritdoc} - */ - public function getSqlType($type, $limit = null) - { - return $this->getAdapter()->getSqlType($type, $limit); - } - - /** - * {@inheritdoc} - */ - public function createDatabase($name, $options = array()) - { - return $this->getAdapter()->createDatabase($name, $options); - } - - /** - * {@inheritdoc} - */ - public function hasDatabase($name) - { - return $this->getAdapter()->hasDatabase($name); - } - - /** - * {@inheritdoc} - */ - public function dropDatabase($name) - { - return $this->getAdapter()->dropDatabase($name); - } - - /** - * @inheritDoc - */ - public function castToBool($value) - { - return $this->getAdapter()->castToBool($value); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php deleted file mode 100644 index f882fb5..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php +++ /dev/null @@ -1,1145 +0,0 @@ - - */ -class MysqlAdapter extends PdoAdapter implements AdapterInterface -{ - - protected $signedColumnTypes = array('integer' => true, 'biginteger' => true, 'float' => true, 'decimal' => true, 'boolean' => true); - - const TEXT_TINY = 255; - const TEXT_SMALL = 255; /* deprecated, alias of TEXT_TINY */ - const TEXT_REGULAR = 65535; - const TEXT_MEDIUM = 16777215; - const TEXT_LONG = 4294967295; - - // According to https://dev.mysql.com/doc/refman/5.0/en/blob.html BLOB sizes are the same as TEXT - const BLOB_TINY = 255; - const BLOB_SMALL = 255; /* deprecated, alias of BLOB_TINY */ - const BLOB_REGULAR = 65535; - const BLOB_MEDIUM = 16777215; - const BLOB_LONG = 4294967295; - - const INT_TINY = 255; - const INT_SMALL = 65535; - const INT_MEDIUM = 16777215; - const INT_REGULAR = 4294967295; - const INT_BIG = 18446744073709551615; - - const TYPE_YEAR = 'year'; - - /** - * {@inheritdoc} - */ - public function connect() - { - if (null === $this->connection) { - if (!class_exists('PDO') || !in_array('mysql', \PDO::getAvailableDrivers(), true)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('You need to enable the PDO_Mysql extension for Phinx to run properly.'); - // @codeCoverageIgnoreEnd - } - - $db = null; - $options = $this->getOptions(); - - $dsn = 'mysql:'; - - if (!empty($options['unix_socket'])) { - // use socket connection - $dsn .= 'unix_socket=' . $options['unix_socket']; - } else { - // use network connection - $dsn .= 'host=' . $options['host']; - if (!empty($options['port'])) { - $dsn .= ';port=' . $options['port']; - } - } - - $dsn .= ';dbname=' . $options['name']; - - // charset support - if (!empty($options['charset'])) { - $dsn .= ';charset=' . $options['charset']; - } - - $driverOptions = array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION); - - // support arbitrary \PDO::MYSQL_ATTR_* driver options and pass them to PDO - // http://php.net/manual/en/ref.pdo-mysql.php#pdo-mysql.constants - foreach ($options as $key => $option) { - if (strpos($key, 'mysql_attr_') === 0) { - $driverOptions[constant('\PDO::' . strtoupper($key))] = $option; - } - } - - try { - $db = new \PDO($dsn, $options['user'], $options['pass'], $driverOptions); - } catch (\PDOException $exception) { - throw new \InvalidArgumentException(sprintf( - 'There was a problem connecting to the database: %s', - $exception->getMessage() - )); - } - - $this->setConnection($db); - } - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - $this->connection = null; - } - - /** - * {@inheritdoc} - */ - public function hasTransactions() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function beginTransaction() - { - $this->execute('START TRANSACTION'); - } - - /** - * {@inheritdoc} - */ - public function commitTransaction() - { - $this->execute('COMMIT'); - } - - /** - * {@inheritdoc} - */ - public function rollbackTransaction() - { - $this->execute('ROLLBACK'); - } - - /** - * {@inheritdoc} - */ - public function quoteTableName($tableName) - { - return str_replace('.', '`.`', $this->quoteColumnName($tableName)); - } - - /** - * {@inheritdoc} - */ - public function quoteColumnName($columnName) - { - return '`' . str_replace('`', '``', $columnName) . '`'; - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - $options = $this->getOptions(); - - $exists = $this->fetchRow(sprintf( - "SELECT TABLE_NAME - FROM INFORMATION_SCHEMA.TABLES - WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'", - $options['name'], $tableName - )); - - return !empty($exists); - } - - /** - * {@inheritdoc} - */ - public function createTable(Table $table) - { - $this->startCommandTimer(); - - // This method is based on the MySQL docs here: http://dev.mysql.com/doc/refman/5.1/en/create-index.html - $defaultOptions = array( - 'engine' => 'InnoDB', - 'collation' => 'utf8_general_ci' - ); - $options = array_merge($defaultOptions, $table->getOptions()); - - // Add the default primary key - $columns = $table->getPendingColumns(); - - if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) { - $options['id'] = 'id'; - } - - if (isset($options['id']) && is_string($options['id'])) { - // Handle id => "field_name" to support AUTO_INCREMENT - $column = new Column(); - $column->setName($options['id']) - ->setType('integer') - ->setSigned(isset($options['signed']) ? $options['signed'] : true) - ->setIdentity(true); - - array_unshift($columns, $column); - $options['primary_key'] = $options['id']; - } - - // TODO - process table options like collation etc - - // process table engine (default to InnoDB) - $optionsStr = 'ENGINE = InnoDB'; - if (isset($options['engine'])) { - $optionsStr = sprintf('ENGINE = %s', $options['engine']); - } - - // process table collation - if (isset($options['collation'])) { - $charset = explode('_', $options['collation']); - $optionsStr .= sprintf(' CHARACTER SET %s', $charset[0]); - $optionsStr .= sprintf(' COLLATE %s', $options['collation']); - } - - // set the table comment - if (isset($options['comment'])) { - $optionsStr .= sprintf(" COMMENT=%s ", $this->getConnection()->quote($options['comment'])); - } - - $sql = 'CREATE TABLE '; - $sql .= $this->quoteTableName($table->getName()) . ' ('; - foreach ($columns as $column) { - $sql .= $this->quoteColumnName($column->getName()) . ' ' . $this->getColumnSqlDefinition($column) . ', '; - } - - // set the primary key(s) - if (isset($options['primary_key'])) { - $sql = rtrim($sql); - $sql .= ' PRIMARY KEY ('; - if (is_string($options['primary_key'])) { // handle primary_key => 'id' - $sql .= $this->quoteColumnName($options['primary_key']); - } elseif (is_array($options['primary_key'])) { // handle primary_key => array('tag_id', 'resource_id') - // PHP 5.4 will allow access of $this, so we can call quoteColumnName() directly in the - // anonymous function, but for now just hard-code the adapter quotes - $sql .= implode( - ',', - array_map( - function ($v) { - return '`' . $v . '`'; - }, - $options['primary_key'] - ) - ); - } - $sql .= ')'; - } else { - $sql = substr(rtrim($sql), 0, -1); // no primary keys - } - - // set the indexes - $indexes = $table->getIndexes(); - if (!empty($indexes)) { - foreach ($indexes as $index) { - $sql .= ', ' . $this->getIndexSqlDefinition($index); - } - } - - // set the foreign keys - $foreignKeys = $table->getForeignKeys(); - if (!empty($foreignKeys)) { - foreach ($foreignKeys as $foreignKey) { - $sql .= ', ' . $this->getForeignKeySqlDefinition($foreignKey); - } - } - - $sql .= ') ' . $optionsStr; - $sql = rtrim($sql) . ';'; - - // execute the sql - $this->writeCommand('createTable', array($table->getName())); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function renameTable($tableName, $newTableName) - { - $this->startCommandTimer(); - $this->writeCommand('renameTable', array($tableName, $newTableName)); - $this->execute(sprintf('RENAME TABLE %s TO %s', $this->quoteTableName($tableName), $this->quoteTableName($newTableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropTable($tableName) - { - $this->startCommandTimer(); - $this->writeCommand('dropTable', array($tableName)); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getColumns($tableName) - { - $columns = array(); - $rows = $this->fetchAll(sprintf('SHOW COLUMNS FROM %s', $this->quoteTableName($tableName))); - foreach ($rows as $columnInfo) { - - $phinxType = $this->getPhinxType($columnInfo['Type']); - - $column = new Column(); - $column->setName($columnInfo['Field']) - ->setNull($columnInfo['Null'] !== 'NO') - ->setDefault($columnInfo['Default']) - ->setType($phinxType['name']) - ->setLimit($phinxType['limit']); - - if ($columnInfo['Extra'] === 'auto_increment') { - $column->setIdentity(true); - } - - $columns[] = $column; - } - - return $columns; - } - - /** - * {@inheritdoc} - */ - public function hasColumn($tableName, $columnName) - { - $rows = $this->fetchAll(sprintf('SHOW COLUMNS FROM %s', $this->quoteTableName($tableName))); - foreach ($rows as $column) { - if (strcasecmp($column['Field'], $columnName) === 0) { - return true; - } - } - - return false; - } - - /** - * Get the defintion for a `DEFAULT` statement. - * - * @param mixed $default - * @return string - */ - protected function getDefaultValueDefinition($default) - { - if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { - $default = $this->getConnection()->quote($default); - } elseif (is_bool($default)) { - $default = $this->castToBool($default); - } - return isset($default) ? ' DEFAULT ' . $default : ''; - } - - /** - * {@inheritdoc} - */ - public function addColumn(Table $table, Column $column) - { - $this->startCommandTimer(); - $sql = sprintf( - 'ALTER TABLE %s ADD %s %s', - $this->quoteTableName($table->getName()), - $this->quoteColumnName($column->getName()), - $this->getColumnSqlDefinition($column) - ); - - if ($column->getAfter()) { - $sql .= ' AFTER ' . $this->quoteColumnName($column->getAfter()); - } - - $this->writeCommand('addColumn', array($table->getName(), $column->getName(), $column->getType())); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function renameColumn($tableName, $columnName, $newColumnName) - { - $this->startCommandTimer(); - $rows = $this->fetchAll(sprintf('DESCRIBE %s', $this->quoteTableName($tableName))); - foreach ($rows as $row) { - if (strcasecmp($row['Field'], $columnName) === 0) { - $null = ($row['Null'] == 'NO') ? 'NOT NULL' : 'NULL'; - $extra = ' ' . strtoupper($row['Extra']); - if (!is_null($row['Default'])) { - $extra .= $this->getDefaultValueDefinition($row['Default']); - } - $definition = $row['Type'] . ' ' . $null . $extra; - - $this->writeCommand('renameColumn', array($tableName, $columnName, $newColumnName)); - $this->execute( - sprintf( - 'ALTER TABLE %s CHANGE COLUMN %s %s %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName), - $this->quoteColumnName($newColumnName), - $definition - ) - ); - $this->endCommandTimer(); - return; - } - } - - throw new \InvalidArgumentException(sprintf( - 'The specified column doesn\'t exist: ' - . $columnName - )); - } - - /** - * {@inheritdoc} - */ - public function changeColumn($tableName, $columnName, Column $newColumn) - { - $this->startCommandTimer(); - $this->writeCommand('changeColumn', array($tableName, $columnName, $newColumn->getType())); - $after = $newColumn->getAfter() ? ' AFTER ' . $this->quoteColumnName($newColumn->getAfter()) : ''; - $this->execute( - sprintf( - 'ALTER TABLE %s CHANGE %s %s %s%s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName), - $this->quoteColumnName($newColumn->getName()), - $this->getColumnSqlDefinition($newColumn), - $after - ) - ); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropColumn($tableName, $columnName) - { - $this->startCommandTimer(); - $this->writeCommand('dropColumn', array($tableName, $columnName)); - $this->execute( - sprintf( - 'ALTER TABLE %s DROP COLUMN %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName) - ) - ); - $this->endCommandTimer(); - } - - /** - * Get an array of indexes from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - protected function getIndexes($tableName) - { - $indexes = array(); - $rows = $this->fetchAll(sprintf('SHOW INDEXES FROM %s', $this->quoteTableName($tableName))); - foreach ($rows as $row) { - if (!isset($indexes[$row['Key_name']])) { - $indexes[$row['Key_name']] = array('columns' => array()); - } - $indexes[$row['Key_name']]['columns'][] = strtolower($row['Column_name']); - } - return $indexes; - } - - /** - * {@inheritdoc} - */ - public function hasIndex($tableName, $columns) - { - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $columns = array_map('strtolower', $columns); - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $index) { - if ($columns == $index['columns']) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function hasIndexByName($tableName, $indexName) - { - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $name => $index) { - if ($name === $indexName) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function addIndex(Table $table, Index $index) - { - $this->startCommandTimer(); - $this->writeCommand('addIndex', array($table->getName(), $index->getColumns())); - $this->execute( - sprintf( - 'ALTER TABLE %s ADD %s', - $this->quoteTableName($table->getName()), - $this->getIndexSqlDefinition($index) - ) - ); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropIndex($tableName, $columns) - { - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $this->writeCommand('dropIndex', array($tableName, $columns)); - $indexes = $this->getIndexes($tableName); - $columns = array_map('strtolower', $columns); - - foreach ($indexes as $indexName => $index) { - if ($columns == $index['columns']) { - $this->execute( - sprintf( - 'ALTER TABLE %s DROP INDEX %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($indexName) - ) - ); - $this->endCommandTimer(); - return; - } - } - } - - /** - * {@inheritdoc} - */ - public function dropIndexByName($tableName, $indexName) - { - $this->startCommandTimer(); - $this->writeCommand('dropIndexByName', array($tableName, $indexName)); - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $name => $index) { - //$a = array_diff($columns, $index['columns']); - if ($name === $indexName) { - $this->execute( - sprintf( - 'ALTER TABLE %s DROP INDEX %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($indexName) - ) - ); - $this->endCommandTimer(); - return; - } - } - } - - /** - * {@inheritdoc} - */ - public function hasForeignKey($tableName, $columns, $constraint = null) - { - if (is_string($columns)) { - $columns = array($columns); // str to array - } - $foreignKeys = $this->getForeignKeys($tableName); - if ($constraint) { - if (isset($foreignKeys[$constraint])) { - return !empty($foreignKeys[$constraint]); - } - return false; - } else { - foreach ($foreignKeys as $key) { - $a = array_diff($columns, $key['columns']); - if ($columns == $key['columns']) { - return true; - } - } - return false; - } - } - - /** - * Get an array of foreign keys from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - protected function getForeignKeys($tableName) - { - $foreignKeys = array(); - $rows = $this->fetchAll(sprintf( - "SELECT - CONSTRAINT_NAME, - TABLE_NAME, - COLUMN_NAME, - REFERENCED_TABLE_NAME, - REFERENCED_COLUMN_NAME - FROM information_schema.KEY_COLUMN_USAGE - WHERE REFERENCED_TABLE_SCHEMA = DATABASE() - AND REFERENCED_TABLE_NAME IS NOT NULL - AND TABLE_NAME = '%s' - ORDER BY POSITION_IN_UNIQUE_CONSTRAINT", - $tableName - )); - foreach ($rows as $row) { - $foreignKeys[$row['CONSTRAINT_NAME']]['table'] = $row['TABLE_NAME']; - $foreignKeys[$row['CONSTRAINT_NAME']]['columns'][] = $row['COLUMN_NAME']; - $foreignKeys[$row['CONSTRAINT_NAME']]['referenced_table'] = $row['REFERENCED_TABLE_NAME']; - $foreignKeys[$row['CONSTRAINT_NAME']]['referenced_columns'][] = $row['REFERENCED_COLUMN_NAME']; - } - return $foreignKeys; - } - - /** - * {@inheritdoc} - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey) - { - $this->startCommandTimer(); - $this->writeCommand('addForeignKey', array($table->getName(), $foreignKey->getColumns())); - $this->execute( - sprintf( - 'ALTER TABLE %s ADD %s', - $this->quoteTableName($table->getName()), - $this->getForeignKeySqlDefinition($foreignKey) - ) - ); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropForeignKey($tableName, $columns, $constraint = null) - { - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $this->writeCommand('dropForeignKey', array($tableName, $columns)); - - if ($constraint) { - $this->execute( - sprintf( - 'ALTER TABLE %s DROP FOREIGN KEY %s', - $this->quoteTableName($tableName), - $constraint - ) - ); - $this->endCommandTimer(); - return; - } else { - foreach ($columns as $column) { - $rows = $this->fetchAll(sprintf( - "SELECT - CONSTRAINT_NAME - FROM information_schema.KEY_COLUMN_USAGE - WHERE REFERENCED_TABLE_SCHEMA = DATABASE() - AND REFERENCED_TABLE_NAME IS NOT NULL - AND TABLE_NAME = '%s' - AND COLUMN_NAME = '%s' - ORDER BY POSITION_IN_UNIQUE_CONSTRAINT", - $tableName, - $column - )); - foreach ($rows as $row) { - $this->dropForeignKey($tableName, $columns, $row['CONSTRAINT_NAME']); - } - } - } - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getSqlType($type, $limit = null) - { - switch ($type) { - case static::PHINX_TYPE_STRING: - return array('name' => 'varchar', 'limit' => $limit ? $limit : 255); - break; - case static::PHINX_TYPE_CHAR: - return array('name' => 'char', 'limit' => $limit ? $limit : 255); - break; - case static::PHINX_TYPE_TEXT: - if ($limit) { - $sizes = array( - // Order matters! Size must always be tested from longest to shortest! - 'longtext' => static::TEXT_LONG, - 'mediumtext' => static::TEXT_MEDIUM, - 'text' => static::TEXT_REGULAR, - 'tinytext' => static::TEXT_SMALL, - ); - foreach ($sizes as $name => $length) { - if ($limit >= $length) { - return array('name' => $name); - } - } - } - return array('name' => 'text'); - break; - case static::PHINX_TYPE_BINARY: - return array('name' => 'binary', 'limit' => $limit ? $limit : 255); - break; - case static::PHINX_TYPE_VARBINARY: - return array('name' => 'varbinary', 'limit' => $limit ? $limit : 255); - break; - case static::PHINX_TYPE_BLOB: - if ($limit) { - $sizes = array( - // Order matters! Size must always be tested from longest to shortest! - 'longblob' => static::BLOB_LONG, - 'mediumblob' => static::BLOB_MEDIUM, - 'blob' => static::BLOB_REGULAR, - 'tinyblob' => static::BLOB_SMALL, - ); - foreach ($sizes as $name => $length) { - if ($limit >= $length) { - return array('name' => $name); - } - } - } - return array('name' => 'blob'); - break; - case static::PHINX_TYPE_INTEGER: - if ($limit && $limit >= static::INT_TINY) { - $sizes = array( - // Order matters! Size must always be tested from longest to shortest! - 'bigint' => static::INT_BIG, - 'int' => static::INT_REGULAR, - 'mediumint' => static::INT_MEDIUM, - 'smallint' => static::INT_SMALL, - 'tinyint' => static::INT_TINY, - ); - $limits = array( - 'int' => 11, - 'bigint' => 20, - ); - foreach ($sizes as $name => $length) { - if ($limit >= $length) { - $def = array('name' => $name); - if (isset($limits[$name])) { - $def['limit'] = $limits[$name]; - } - return $def; - } - } - } elseif (!$limit) { - $limit = 11; - } - return array('name' => 'int', 'limit' => $limit); - break; - case static::PHINX_TYPE_BIG_INTEGER: - return array('name' => 'bigint', 'limit' => 20); - break; - case static::PHINX_TYPE_FLOAT: - return array('name' => 'float'); - break; - case static::PHINX_TYPE_DECIMAL: - return array('name' => 'decimal'); - break; - case static::PHINX_TYPE_DATETIME: - return array('name' => 'datetime'); - break; - case static::PHINX_TYPE_TIMESTAMP: - return array('name' => 'timestamp'); - break; - case static::PHINX_TYPE_TIME: - return array('name' => 'time'); - break; - case static::PHINX_TYPE_DATE: - return array('name' => 'date'); - break; - case static::PHINX_TYPE_BOOLEAN: - return array('name' => 'tinyint', 'limit' => 1); - break; - case static::PHINX_TYPE_UUID: - return array('name' => 'char', 'limit' => 36); - // Geospatial database types - case static::PHINX_TYPE_GEOMETRY: - case static::PHINX_TYPE_POINT: - case static::PHINX_TYPE_LINESTRING: - case static::PHINX_TYPE_POLYGON: - return array('name' => $type); - case static::PHINX_TYPE_ENUM: - return array('name' => 'enum'); - break; - case static::PHINX_TYPE_SET: - return array('name' => 'set'); - break; - case static::TYPE_YEAR: - if (!$limit || in_array($limit, array(2, 4))) - $limit = 4; - return array('name' => 'year', 'limit' => $limit); - break; - case static::PHINX_TYPE_JSON: - return array('name' => 'json'); - break; - default: - throw new \RuntimeException('The type: "' . $type . '" is not supported.'); - } - } - - /** - * Returns Phinx type by SQL type - * - * @param string $sqlTypeDef - * @throws \RuntimeException - * @internal param string $sqlType SQL type - * @returns string Phinx type - */ - public function getPhinxType($sqlTypeDef) - { - if (!preg_match('/^([\w]+)(\(([\d]+)*(,([\d]+))*\))*(.+)*$/', $sqlTypeDef, $matches)) { - throw new \RuntimeException('Column type ' . $sqlTypeDef . ' is not supported'); - } else { - $limit = null; - $precision = null; - $type = $matches[1]; - if (count($matches) > 2) { - $limit = $matches[3] ? (int) $matches[3] : null; - } - if (count($matches) > 4) { - $precision = (int) $matches[5]; - } - if ($type === 'tinyint' && $limit === 1) { - $type = static::PHINX_TYPE_BOOLEAN; - $limit = null; - } - switch ($type) { - case 'varchar': - $type = static::PHINX_TYPE_STRING; - if ($limit === 255) { - $limit = null; - } - break; - case 'char': - $type = static::PHINX_TYPE_CHAR; - if ($limit === 255) { - $limit = null; - } - if ($limit === 36) { - $type = static::PHINX_TYPE_UUID; - } - break; - case 'tinyint': - $type = static::PHINX_TYPE_INTEGER; - $limit = static::INT_TINY; - break; - case 'smallint': - $type = static::PHINX_TYPE_INTEGER; - $limit = static::INT_SMALL; - break; - case 'mediumint': - $type = static::PHINX_TYPE_INTEGER; - $limit = static::INT_MEDIUM; - break; - case 'int': - $type = static::PHINX_TYPE_INTEGER; - if ($limit === 11) { - $limit = null; - } - break; - case 'bigint': - if ($limit === 20) { - $limit = null; - } - $type = static::PHINX_TYPE_BIG_INTEGER; - break; - case 'blob': - $type = static::PHINX_TYPE_BINARY; - break; - case 'tinyblob': - $type = static::PHINX_TYPE_BINARY; - $limit = static::BLOB_TINY; - break; - case 'mediumblob': - $type = static::PHINX_TYPE_BINARY; - $limit = static::BLOB_MEDIUM; - break; - case 'longblob': - $type = static::PHINX_TYPE_BINARY; - $limit = static::BLOB_LONG; - break; - case 'tinytext': - $type = static::PHINX_TYPE_TEXT; - $limit = static::TEXT_TINY; - break; - case 'mediumtext': - $type = static::PHINX_TYPE_TEXT; - $limit = static::TEXT_MEDIUM; - break; - case 'longtext': - $type = static::PHINX_TYPE_TEXT; - $limit = static::TEXT_LONG; - break; - } - - $this->getSqlType($type, $limit); - - return array( - 'name' => $type, - 'limit' => $limit, - 'precision' => $precision - ); - } - } - - /** - * {@inheritdoc} - */ - public function createDatabase($name, $options = array()) - { - $this->startCommandTimer(); - $this->writeCommand('createDatabase', array($name)); - $charset = isset($options['charset']) ? $options['charset'] : 'utf8'; - - if (isset($options['collation'])) { - $this->execute(sprintf('CREATE DATABASE `%s` DEFAULT CHARACTER SET `%s` COLLATE `%s`', $name, $charset, $options['collation'])); - } else { - $this->execute(sprintf('CREATE DATABASE `%s` DEFAULT CHARACTER SET `%s`', $name, $charset)); - } - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function hasDatabase($name) - { - $rows = $this->fetchAll( - sprintf( - 'SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = \'%s\'', - $name - ) - ); - - foreach ($rows as $row) { - if (!empty($row)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function dropDatabase($name) - { - $this->startCommandTimer(); - $this->writeCommand('dropDatabase', array($name)); - $this->execute(sprintf('DROP DATABASE IF EXISTS `%s`', $name)); - $this->endCommandTimer(); - } - - /** - * Gets the MySQL Column Definition for a Column object. - * - * @param Column $column Column - * @return string - */ - protected function getColumnSqlDefinition(Column $column) - { - $sqlType = $this->getSqlType($column->getType(), $column->getLimit()); - - $def = ''; - $def .= strtoupper($sqlType['name']); - if ($column->getPrecision() && $column->getScale()) { - $def .= '(' . $column->getPrecision() . ',' . $column->getScale() . ')'; - } elseif (isset($sqlType['limit'])) { - $def .= '(' . $sqlType['limit'] . ')'; - } - if (($values = $column->getValues()) && is_array($values)) { - $def .= "('" . implode("', '", $values) . "')"; - } - $def .= (!$column->isSigned() && isset($this->signedColumnTypes[$column->getType()])) ? ' unsigned' : '' ; - $def .= ($column->isNull() == false) ? ' NOT NULL' : ' NULL'; - $def .= ($column->isIdentity()) ? ' AUTO_INCREMENT' : ''; - $def .= $this->getDefaultValueDefinition($column->getDefault()); - - if ($column->getComment()) { - $def .= ' COMMENT ' . $this->getConnection()->quote($column->getComment()); - } - - if ($column->getUpdate()) { - $def .= ' ON UPDATE ' . $column->getUpdate(); - } - - return $def; - } - - /** - * Gets the MySQL Index Definition for an Index object. - * - * @param Index $index Index - * @return string - */ - protected function getIndexSqlDefinition(Index $index) - { - $def = ''; - $limit = ''; - if ($index->getLimit()) { - $limit = '(' . $index->getLimit() . ')'; - } - - if ($index->getType() == Index::UNIQUE) { - $def .= ' UNIQUE'; - } - - if ($index->getType() == Index::FULLTEXT) { - $def .= ' FULLTEXT'; - } - - $def .= ' KEY'; - - if (is_string($index->getName())) { - $def .= ' `' . $index->getName() . '`'; - } - - $def .= ' (`' . implode('`,`', $index->getColumns()) . '`' . $limit . ')'; - - return $def; - } - - /** - * Gets the MySQL Foreign Key Definition for an ForeignKey object. - * - * @param ForeignKey $foreignKey - * @return string - */ - protected function getForeignKeySqlDefinition(ForeignKey $foreignKey) - { - $def = ''; - if ($foreignKey->getConstraint()) { - $def .= ' CONSTRAINT ' . $this->quoteColumnName($foreignKey->getConstraint()); - } - $columnNames = array(); - foreach ($foreignKey->getColumns() as $column) { - $columnNames[] = $this->quoteColumnName($column); - } - $def .= ' FOREIGN KEY (' . implode(',', $columnNames) . ')'; - $refColumnNames = array(); - foreach ($foreignKey->getReferencedColumns() as $column) { - $refColumnNames[] = $this->quoteColumnName($column); - } - $def .= ' REFERENCES ' . $this->quoteTableName($foreignKey->getReferencedTable()->getName()) . ' (' . implode(',', $refColumnNames) . ')'; - if ($foreignKey->getOnDelete()) { - $def .= ' ON DELETE ' . $foreignKey->getOnDelete(); - } - if ($foreignKey->getOnUpdate()) { - $def .= ' ON UPDATE ' . $foreignKey->getOnUpdate(); - } - return $def; - } - - /** - * Describes a database table. This is a MySQL adapter specific method. - * - * @param string $tableName Table name - * @return array - */ - public function describeTable($tableName) - { - $options = $this->getOptions(); - - // mysql specific - $sql = sprintf( - "SELECT * - FROM information_schema.tables - WHERE table_schema = '%s' - AND table_name = '%s'", - $options['name'], - $tableName - ); - - return $this->fetchRow($sql); - } - - /** - * Returns MySQL column types (inherited and MySQL specified). - * @return array - */ - public function getColumnTypes() - { - return array_merge(parent::getColumnTypes(), array('enum', 'set', 'year', 'json')); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/PdoAdapter.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/PdoAdapter.php deleted file mode 100644 index 9924c3a..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/PdoAdapter.php +++ /dev/null @@ -1,587 +0,0 @@ - - */ -abstract class PdoAdapter implements AdapterInterface -{ - /** - * @var array - */ - protected $options = array(); - - /** - * @var InputInterface - */ - protected $input; - - /** - * @var OutputInterface - */ - protected $output; - - /** - * @var string - */ - protected $schemaTableName = 'migrations'; - - /** - * @var \PDO - */ - protected $connection; - - /** - * @var float - */ - protected $commandStartTime; - - /** - * Class Constructor. - * - * @param array $options Options - * @param InputInterface $input Input Interface - * @param OutputInterface $output Output Interface - */ - public function __construct(array $options, InputInterface $input = null, OutputInterface $output = null) - { - $this->setOptions($options); - if (null !== $input) { - $this->setInput($input); - } - if (null !== $output) { - $this->setOutput($output); - } - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options) - { - $this->options = $options; - - if (isset($options['default_migration_table'])) { - $this->setSchemaTableName($options['default_migration_table']); - } - - if (isset($options['connection'])) { - $this->setConnection($options['connection']); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOptions() - { - return $this->options; - } - - /** - * {@inheritdoc} - */ - public function hasOption($name) - { - return isset($this->options[$name]); - } - - /** - * {@inheritdoc} - */ - public function getOption($name) - { - if (!$this->hasOption($name)) { - return; - } - return $this->options[$name]; - } - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getInput() - { - return $this->input; - } - - /** - * {@inheritdoc} - */ - public function setOutput(OutputInterface $output) - { - $this->output = $output; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOutput() - { - if (null === $this->output) { - $output = new OutputInterface('nothing'); - $this->setOutput($output); - } - return $this->output; - } - - /** - * Sets the schema table name. - * - * @param string $schemaTableName Schema Table Name - * @return PdoAdapter - */ - public function setSchemaTableName($schemaTableName) - { - $this->schemaTableName = $schemaTableName; - return $this; - } - - /** - * Gets the schema table name. - * - * @return string - */ - public function getSchemaTableName() - { - return $this->schemaTableName; - } - - /** - * Sets the database connection. - * - * @param \PDO $connection Connection - * @return AdapterInterface - */ - public function setConnection(\PDO $connection) - { - $this->connection = $connection; - - // Create the schema table if it doesn't already exist - if (!$this->hasSchemaTable()) { - $this->createSchemaTable(); - } else { - $table = new Table($this->getSchemaTableName(), array(), $this); - if (!$table->hasColumn('migration_name')) { - $table - ->addColumn('migration_name', 'string', - array('limit' => 100, 'after' => 'version', 'default' => null, 'null' => true) - ) - ->save(); - } - if (!$table->hasColumn('breakpoint')) { - $table - ->addColumn('breakpoint', 'boolean', array('default' => false)) - ->save(); - } - } - - return $this; - } - - /** - * Gets the database connection - * - * @return \PDO - */ - public function getConnection() - { - if (null === $this->connection) { - $this->connect(); - } - return $this->connection; - } - - /** - * Sets the command start time - * - * @param int $time - * @return AdapterInterface - */ - public function setCommandStartTime($time) - { - $this->commandStartTime = $time; - return $this; - } - - /** - * Gets the command start time - * - * @return int - */ - public function getCommandStartTime() - { - return $this->commandStartTime; - } - - /** - * Start timing a command. - * - * @return void - */ - public function startCommandTimer() - { - $this->setCommandStartTime(microtime(true)); - } - - /** - * Stop timing the current command and write the elapsed time to the - * output. - * - * @return void - */ - public function endCommandTimer() - { - $end = microtime(true); - if (OutputInterface::VERBOSITY_VERBOSE <= $this->getOutput()->getVerbosity()) { - $this->getOutput()->writeln(' -> ' . sprintf('%.4fs', $end - $this->getCommandStartTime())); - } - } - - /** - * Write a Phinx command to the output. - * - * @param string $command Command Name - * @param array $args Command Args - * @return void - */ - public function writeCommand($command, $args = array()) - { - if (OutputInterface::VERBOSITY_VERBOSE <= $this->getOutput()->getVerbosity()) { - if (count($args)) { - $outArr = array(); - foreach ($args as $arg) { - if (is_array($arg)) { - $arg = array_map(function ($value) { - return '\'' . $value . '\''; - }, $arg); - $outArr[] = '[' . implode(', ', $arg) . ']'; - continue; - } - - $outArr[] = '\'' . $arg . '\''; - } - $this->getOutput()->writeln(' -- ' . $command . '(' . implode(', ', $outArr) . ')'); - return; - } - $this->getOutput()->writeln(' -- ' . $command); - } - } - - /** - * {@inheritdoc} - */ - public function connect() - { - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - } - - /** - * {@inheritdoc} - */ - public function execute($sql) - { - return $this->getConnection()->exec($sql); - } - - /** - * {@inheritdoc} - */ - public function query($sql) - { - return $this->getConnection()->query($sql); - } - - /** - * {@inheritdoc} - */ - public function fetchRow($sql) - { - $result = $this->query($sql); - return $result->fetch(); - } - - /** - * {@inheritdoc} - */ - public function fetchAll($sql) - { - $rows = array(); - $result = $this->query($sql); - while ($row = $result->fetch()) { - $rows[] = $row; - } - return $rows; - } - - /** - * {@inheritdoc} - */ - public function insert(Table $table, $row) - { - $this->startCommandTimer(); - $this->writeCommand('insert', array($table->getName())); - - $sql = sprintf( - "INSERT INTO %s ", - $this->quoteTableName($table->getName()) - ); - - $columns = array_keys($row); - $sql .= "(". implode(', ', array_map(array($this, 'quoteColumnName'), $columns)) . ")"; - $sql .= " VALUES (" . implode(', ', array_fill(0, count($columns), '?')) . ")"; - - $stmt = $this->getConnection()->prepare($sql); - $stmt->execute(array_values($row)); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getVersions() - { - $rows = $this->getVersionLog(); - - return array_keys($rows); - } - - /** - * {@inheritdoc} - */ - public function getVersionLog() - { - $result = array(); - $rows = $this->fetchAll(sprintf('SELECT * FROM %s ORDER BY version ASC', $this->getSchemaTableName())); - foreach ($rows as $version) { - $result[$version['version']] = $version; - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime) - { - if (strcasecmp($direction, MigrationInterface::UP) === 0) { - // up - $sql = sprintf( - "INSERT INTO %s (%s, %s, %s, %s, %s) VALUES ('%s', '%s', '%s', '%s', %s);", - $this->getSchemaTableName(), - $this->quoteColumnName('version'), - $this->quoteColumnName('migration_name'), - $this->quoteColumnName('start_time'), - $this->quoteColumnName('end_time'), - $this->quoteColumnName('breakpoint'), - $migration->getVersion(), - substr($migration->getName(), 0, 100), - $startTime, - $endTime, - $this->castToBool(false) - ); - - $this->query($sql); - } else { - // down - $sql = sprintf( - "DELETE FROM %s WHERE %s = '%s'", - $this->getSchemaTableName(), - $this->quoteColumnName('version'), - $migration->getVersion() - ); - - $this->query($sql); - } - - return $this; - } - - /** - * @inheritDoc - */ - public function toggleBreakpoint(MigrationInterface $migration) - { - $this->query( - sprintf( - 'UPDATE %1$s SET %2$s = CASE %2$s WHEN %3$s THEN %4$s ELSE %3$s END WHERE %5$s = \'%6$s\';', - $this->getSchemaTableName(), - $this->quoteColumnName('breakpoint'), - $this->castToBool(true), - $this->castToBool(false), - $this->quoteColumnName('version'), - $migration->getVersion() - ) - ); - - return $this; - } - - /** - * @inheritDoc - */ - public function resetAllBreakpoints() - { - return $this->execute( - sprintf( - 'UPDATE %1$s SET %2$s = %3$s WHERE %2$s <> %3$s;', - $this->getSchemaTableName(), - $this->quoteColumnName('breakpoint'), - $this->castToBool(false) - ) - ); - } - - /** - * {@inheritdoc} - */ - public function hasSchemaTable() - { - return $this->hasTable($this->getSchemaTableName()); - } - - /** - * {@inheritdoc} - */ - public function createSchemaTable() - { - try { - $options = array( - 'id' => false, - 'primary_key' => 'version' - ); - - $table = new Table($this->getSchemaTableName(), $options, $this); - - if ($this->getConnection()->getAttribute(\PDO::ATTR_DRIVER_NAME) === 'mysql' - && version_compare($this->getConnection()->getAttribute(\PDO::ATTR_SERVER_VERSION), '5.6.0', '>=')) { - $table->addColumn('version', 'biginteger', array('limit' => 14)) - ->addColumn('migration_name', 'string', array('limit' => 100, 'default' => null, 'null' => true)) - ->addColumn('start_time', 'timestamp', array('default' => 'CURRENT_TIMESTAMP')) - ->addColumn('end_time', 'timestamp', array('default' => 'CURRENT_TIMESTAMP')) - ->addColumn('breakpoint', 'boolean', array('default' => false)) - ->save(); - } else { - $table->addColumn('version', 'biginteger') - ->addColumn('migration_name', 'string', array('limit' => 100, 'default' => null, 'null' => true)) - ->addColumn('start_time', 'timestamp') - ->addColumn('end_time', 'timestamp') - ->addColumn('breakpoint', 'boolean', array('default' => false)) - ->save(); - } - } catch (\Exception $exception) { - throw new \InvalidArgumentException('There was a problem creating the schema table: ' . $exception->getMessage()); - } - } - - /** - * {@inheritdoc} - */ - public function getAdapterType() - { - return $this->getOption('adapter'); - } - - /** - * {@inheritdoc} - */ - public function getColumnTypes() - { - return array( - 'string', - 'char', - 'text', - 'integer', - 'biginteger', - 'float', - 'decimal', - 'datetime', - 'timestamp', - 'time', - 'date', - 'blob', - 'binary', - 'varbinary', - 'boolean', - 'uuid', - // Geospatial data types - 'geometry', - 'point', - 'linestring', - 'polygon', - ); - } - - /** - * {@inheritdoc} - */ - public function isValidColumnType(Column $column) { - return in_array($column->getType(), $this->getColumnTypes()); - } - - /** - * Cast a value to a boolean appropriate for the adapter. - * - * @param mixed $value The value to be cast - * - * @return mixed - */ - public function castToBool($value) - { - return (bool) $value ? 1 : 0; - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/PostgresAdapter.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/PostgresAdapter.php deleted file mode 100644 index 3c506bd..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/PostgresAdapter.php +++ /dev/null @@ -1,1182 +0,0 @@ -connection) { - if (!class_exists('PDO') || !in_array('pgsql', \PDO::getAvailableDrivers(), true)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('You need to enable the PDO_Pgsql extension for Phinx to run properly.'); - // @codeCoverageIgnoreEnd - } - - $db = null; - $options = $this->getOptions(); - - // if port is specified use it, otherwise use the PostgreSQL default - if (isset($options['port'])) { - $dsn = 'pgsql:host=' . $options['host'] . ';port=' . $options['port'] . ';dbname=' . $options['name']; - } else { - $dsn = 'pgsql:host=' . $options['host'] . ';dbname=' . $options['name']; - } - - try { - $db = new \PDO($dsn, $options['user'], $options['pass'], array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION)); - } catch (\PDOException $exception) { - throw new \InvalidArgumentException(sprintf( - 'There was a problem connecting to the database: %s', - $exception->getMessage() - )); - } - - $this->setConnection($db); - } - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - $this->connection = null; - } - - /** - * {@inheritdoc} - */ - public function hasTransactions() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function beginTransaction() - { - $this->execute('BEGIN'); - } - - /** - * {@inheritdoc} - */ - public function commitTransaction() - { - $this->execute('COMMIT'); - } - - /** - * {@inheritdoc} - */ - public function rollbackTransaction() - { - $this->execute('ROLLBACK'); - } - - /** - * Quotes a schema name for use in a query. - * - * @param string $schemaName Schema Name - * @return string - */ - public function quoteSchemaName($schemaName) - { - return $this->quoteColumnName($schemaName); - } - - /** - * {@inheritdoc} - */ - public function quoteTableName($tableName) - { - return $this->quoteSchemaName($this->getSchemaName()) . '.' . $this->quoteColumnName($tableName); - } - - /** - * {@inheritdoc} - */ - public function quoteColumnName($columnName) - { - return '"'. $columnName . '"'; - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - $result = $this->getConnection()->query( - sprintf( - 'SELECT * - FROM information_schema.tables - WHERE table_schema = %s - AND lower(table_name) = lower(%s)', - $this->getConnection()->quote($this->getSchemaName()), - $this->getConnection()->quote($tableName) - ) - ); - - return $result->rowCount() === 1; - } - - /** - * {@inheritdoc} - */ - public function createTable(Table $table) - { - $this->startCommandTimer(); - $options = $table->getOptions(); - - // Add the default primary key - $columns = $table->getPendingColumns(); - if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) { - $column = new Column(); - $column->setName('id') - ->setType('integer') - ->setIdentity(true); - - array_unshift($columns, $column); - $options['primary_key'] = 'id'; - - } elseif (isset($options['id']) && is_string($options['id'])) { - // Handle id => "field_name" to support AUTO_INCREMENT - $column = new Column(); - $column->setName($options['id']) - ->setType('integer') - ->setIdentity(true); - - array_unshift($columns, $column); - $options['primary_key'] = $options['id']; - } - - // TODO - process table options like collation etc - $sql = 'CREATE TABLE '; - $sql .= $this->quoteTableName($table->getName()) . ' ('; - - $this->columnsWithComments = array(); - foreach ($columns as $column) { - $sql .= $this->quoteColumnName($column->getName()) . ' ' . $this->getColumnSqlDefinition($column) . ', '; - - // set column comments, if needed - if ($column->getComment()) { - $this->columnsWithComments[] = $column; - } - } - - // set the primary key(s) - if (isset($options['primary_key'])) { - $sql = rtrim($sql); - $sql .= sprintf(' CONSTRAINT %s_pkey PRIMARY KEY (', $table->getName()); - if (is_string($options['primary_key'])) { // handle primary_key => 'id' - $sql .= $this->quoteColumnName($options['primary_key']); - } elseif (is_array($options['primary_key'])) { // handle primary_key => array('tag_id', 'resource_id') - // PHP 5.4 will allow access of $this, so we can call quoteColumnName() directly in the anonymous function, - // but for now just hard-code the adapter quotes - $sql .= implode( - ',', - array_map( - function ($v) { - return '"' . $v . '"'; - }, - $options['primary_key'] - ) - ); - } - $sql .= ')'; - } else { - $sql = substr(rtrim($sql), 0, -1); // no primary keys - } - - // set the foreign keys - $foreignKeys = $table->getForeignKeys(); - if (!empty($foreignKeys)) { - foreach ($foreignKeys as $foreignKey) { - $sql .= ', ' . $this->getForeignKeySqlDefinition($foreignKey, $table->getName()); - } - } - - $sql .= ');'; - - // process column comments - if (!empty($this->columnsWithComments)) { - foreach ($this->columnsWithComments as $column) { - $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName()); - } - } - - // set the indexes - $indexes = $table->getIndexes(); - if (!empty($indexes)) { - foreach ($indexes as $index) { - $sql .= $this->getIndexSqlDefinition($index, $table->getName()); - } - } - - // execute the sql - $this->writeCommand('createTable', array($table->getName())); - $this->execute($sql); - - // process table comments - if (isset($options['comment'])) { - $sql = sprintf( - 'COMMENT ON TABLE %s IS %s', - $this->quoteTableName($table->getName()), - $this->getConnection()->quote($options['comment']) - ); - $this->execute($sql); - } - - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function renameTable($tableName, $newTableName) - { - $this->startCommandTimer(); - $this->writeCommand('renameTable', array($tableName, $newTableName)); - $sql = sprintf( - 'ALTER TABLE %s RENAME TO %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($newTableName) - ); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropTable($tableName) - { - $this->startCommandTimer(); - $this->writeCommand('dropTable', array($tableName)); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getColumns($tableName) - { - $columns = array(); - $sql = sprintf( - "SELECT column_name, data_type, is_identity, is_nullable, - column_default, character_maximum_length, numeric_precision, numeric_scale - FROM information_schema.columns - WHERE table_name ='%s'", - $tableName - ); - $columnsInfo = $this->fetchAll($sql); - - foreach ($columnsInfo as $columnInfo) { - $column = new Column(); - $column->setName($columnInfo['column_name']) - ->setType($this->getPhinxType($columnInfo['data_type'])) - ->setNull($columnInfo['is_nullable'] === 'YES') - ->setDefault($columnInfo['column_default']) - ->setIdentity($columnInfo['is_identity'] === 'YES') - ->setPrecision($columnInfo['numeric_precision']) - ->setScale($columnInfo['numeric_scale']); - - if (preg_match('/\bwith time zone$/', $columnInfo['data_type'])) { - $column->setTimezone(true); - } - - if (isset($columnInfo['character_maximum_length'])) { - $column->setLimit($columnInfo['character_maximum_length']); - } - $columns[] = $column; - } - return $columns; - } - - /** - * {@inheritdoc} - */ - public function hasColumn($tableName, $columnName, $options = array()) - { - $sql = sprintf("SELECT count(*) - FROM information_schema.columns - WHERE table_schema = '%s' AND table_name = '%s' AND column_name = '%s'", - $this->getSchemaName(), - $tableName, - $columnName - ); - - $result = $this->fetchRow($sql); - return $result['count'] > 0; - } - - /** - * {@inheritdoc} - */ - public function addColumn(Table $table, Column $column) - { - $this->startCommandTimer(); - $this->writeCommand('addColumn', array($table->getName(), $column->getName(), $column->getType())); - $sql = sprintf( - 'ALTER TABLE %s ADD %s %s', - $this->quoteTableName($table->getName()), - $this->quoteColumnName($column->getName()), - $this->getColumnSqlDefinition($column) - ); - - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function renameColumn($tableName, $columnName, $newColumnName) - { - $this->startCommandTimer(); - $sql = sprintf( - "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END AS column_exists - FROM information_schema.columns - WHERE table_name ='%s' AND column_name = '%s'", - $tableName, - $columnName - ); - $result = $this->fetchRow($sql); - if (!(bool) $result['column_exists']) { - throw new \InvalidArgumentException("The specified column does not exist: $columnName"); - } - $this->writeCommand('renameColumn', array($tableName, $columnName, $newColumnName)); - $this->execute( - sprintf( - 'ALTER TABLE %s RENAME COLUMN %s TO %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName), - $newColumnName - ) - ); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function changeColumn($tableName, $columnName, Column $newColumn) - { - // TODO - is it possible to merge these 3 queries into less? - $this->startCommandTimer(); - $this->writeCommand('changeColumn', array($tableName, $columnName, $newColumn->getType())); - // change data type - $sql = sprintf( - 'ALTER TABLE %s ALTER COLUMN %s TYPE %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName), - $this->getColumnSqlDefinition($newColumn) - ); - //NULL and DEFAULT cannot be set while changing column type - $sql = preg_replace('/ NOT NULL/', '', $sql); - $sql = preg_replace('/ NULL/', '', $sql); - //If it is set, DEFAULT is the last definition - $sql = preg_replace('/DEFAULT .*/', '', $sql); - $this->execute($sql); - // process null - $sql = sprintf( - 'ALTER TABLE %s ALTER COLUMN %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName) - ); - if ($newColumn->isNull()) { - $sql .= ' DROP NOT NULL'; - } else { - $sql .= ' SET NOT NULL'; - } - $this->execute($sql); - if (!is_null($newColumn->getDefault())) { - //change default - $this->execute( - sprintf( - 'ALTER TABLE %s ALTER COLUMN %s SET %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName), - $this->getDefaultValueDefinition($newColumn->getDefault()) - ) - ); - } - else { - //drop default - $this->execute( - sprintf( - 'ALTER TABLE %s ALTER COLUMN %s DROP DEFAULT', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName) - ) - ); - } - // rename column - if ($columnName !== $newColumn->getName()) { - $this->execute( - sprintf( - 'ALTER TABLE %s RENAME COLUMN %s TO %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName), - $this->quoteColumnName($newColumn->getName()) - ) - ); - } - - // change column comment if needed - if ($newColumn->getComment()) { - $sql = $this->getColumnCommentSqlDefinition($newColumn, $tableName); - $this->execute($sql); - } - - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropColumn($tableName, $columnName) - { - $this->startCommandTimer(); - $this->writeCommand('dropColumn', array($tableName, $columnName)); - $this->execute( - sprintf( - 'ALTER TABLE %s DROP COLUMN %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName) - ) - ); - $this->endCommandTimer(); - } - - /** - * Get an array of indexes from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - protected function getIndexes($tableName) - { - $indexes = array(); - $sql = "SELECT - i.relname AS index_name, - a.attname AS column_name - FROM - pg_class t, - pg_class i, - pg_index ix, - pg_attribute a - WHERE - t.oid = ix.indrelid - AND i.oid = ix.indexrelid - AND a.attrelid = t.oid - AND a.attnum = ANY(ix.indkey) - AND t.relkind = 'r' - AND t.relname = '$tableName' - ORDER BY - t.relname, - i.relname;"; - $rows = $this->fetchAll($sql); - foreach ($rows as $row) { - if (!isset($indexes[$row['index_name']])) { - $indexes[$row['index_name']] = array('columns' => array()); - } - $indexes[$row['index_name']]['columns'][] = strtolower($row['column_name']); - } - return $indexes; - } - - /** - * {@inheritdoc} - */ - public function hasIndex($tableName, $columns) - { - if (is_string($columns)) { - $columns = array($columns); - } - $columns = array_map('strtolower', $columns); - $indexes = $this->getIndexes($tableName); - foreach ($indexes as $index) { - if (array_diff($index['columns'], $columns) === array_diff($columns, $index['columns'])) { - return true; - } - } - return false; - } - - /** - * {@inheritdoc} - */ - public function hasIndexByName($tableName, $indexName) - { - $indexes = $this->getIndexes($tableName); - foreach ($indexes as $name => $index) { - if ($name === $indexName) { - return true; - } - } - return false; - } - - /** - * {@inheritdoc} - */ - public function addIndex(Table $table, Index $index) - { - $this->startCommandTimer(); - $this->writeCommand('addIndex', array($table->getName(), $index->getColumns())); - $sql = $this->getIndexSqlDefinition($index, $table->getName()); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropIndex($tableName, $columns) - { - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $this->writeCommand('dropIndex', array($tableName, $columns)); - $indexes = $this->getIndexes($tableName); - $columns = array_map('strtolower', $columns); - - foreach ($indexes as $indexName => $index) { - $a = array_diff($columns, $index['columns']); - if (empty($a)) { - $this->execute( - sprintf( - 'DROP INDEX IF EXISTS %s', - $this->quoteColumnName($indexName) - ) - ); - $this->endCommandTimer(); - return; - } - } - } - - /** - * {@inheritdoc} - */ - public function dropIndexByName($tableName, $indexName) - { - $this->startCommandTimer(); - $this->writeCommand('dropIndexByName', array($tableName, $indexName)); - $sql = sprintf( - 'DROP INDEX IF EXISTS %s', - $indexName - ); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function hasForeignKey($tableName, $columns, $constraint = null) - { - if (is_string($columns)) { - $columns = array($columns); // str to array - } - $foreignKeys = $this->getForeignKeys($tableName); - if ($constraint) { - if (isset($foreignKeys[$constraint])) { - return !empty($foreignKeys[$constraint]); - } - return false; - } else { - foreach ($foreignKeys as $key) { - $a = array_diff($columns, $key['columns']); - if (empty($a)) { - return true; - } - } - return false; - } - } - - /** - * Get an array of foreign keys from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - protected function getForeignKeys($tableName) - { - $foreignKeys = array(); - $rows = $this->fetchAll(sprintf( - "SELECT - tc.constraint_name, - tc.table_name, kcu.column_name, - ccu.table_name AS referenced_table_name, - ccu.column_name AS referenced_column_name - FROM - information_schema.table_constraints AS tc - JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name - JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name - WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name = '%s' - ORDER BY kcu.position_in_unique_constraint", - $tableName - )); - foreach ($rows as $row) { - $foreignKeys[$row['constraint_name']]['table'] = $row['table_name']; - $foreignKeys[$row['constraint_name']]['columns'][] = $row['column_name']; - $foreignKeys[$row['constraint_name']]['referenced_table'] = $row['referenced_table_name']; - $foreignKeys[$row['constraint_name']]['referenced_columns'][] = $row['referenced_column_name']; - } - return $foreignKeys; - } - - /** - * {@inheritdoc} - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey) - { - $this->startCommandTimer(); - $this->writeCommand('addForeignKey', array($table->getName(), $foreignKey->getColumns())); - $sql = sprintf( - 'ALTER TABLE %s ADD %s', - $this->quoteTableName($table->getName()), - $this->getForeignKeySqlDefinition($foreignKey, $table->getName()) - ); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropForeignKey($tableName, $columns, $constraint = null) - { - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - $this->writeCommand('dropForeignKey', array($tableName, $columns)); - - if ($constraint) { - $this->execute( - sprintf( - 'ALTER TABLE %s DROP CONSTRAINT %s', - $this->quoteTableName($tableName), - $constraint - ) - ); - } else { - foreach ($columns as $column) { - $rows = $this->fetchAll(sprintf( - "SELECT CONSTRAINT_NAME - FROM information_schema.KEY_COLUMN_USAGE - WHERE TABLE_SCHEMA = CURRENT_SCHEMA() - AND TABLE_NAME IS NOT NULL - AND TABLE_NAME = '%s' - AND COLUMN_NAME = '%s' - ORDER BY POSITION_IN_UNIQUE_CONSTRAINT", - $tableName, - $column - )); - - foreach ($rows as $row) { - $this->dropForeignKey($tableName, $columns, $row['constraint_name']); - } - } - } - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getSqlType($type, $limit = null) - { - switch ($type) { - case static::PHINX_TYPE_INTEGER: - if ($limit && $limit == static::INT_SMALL) { - return array( - 'name' => 'smallint', - 'limit' => static::INT_SMALL - ); - } - return array('name' => $type); - case static::PHINX_TYPE_TEXT: - case static::PHINX_TYPE_TIME: - case static::PHINX_TYPE_DATE: - case static::PHINX_TYPE_BOOLEAN: - case static::PHINX_TYPE_JSON: - case static::PHINX_TYPE_JSONB: - case static::PHINX_TYPE_UUID: - return array('name' => $type); - case static::PHINX_TYPE_DECIMAL: - return array('name' => $type, 'precision' => 18, 'scale' => 0); - case static::PHINX_TYPE_STRING: - return array('name' => 'character varying', 'limit' => 255); - case static::PHINX_TYPE_CHAR: - return array('name' => 'character', 'limit' => 255); - case static::PHINX_TYPE_BIG_INTEGER: - return array('name' => 'bigint'); - case static::PHINX_TYPE_FLOAT: - return array('name' => 'real'); - case static::PHINX_TYPE_DATETIME: - case static::PHINX_TYPE_TIMESTAMP: - return array('name' => 'timestamp'); - case static::PHINX_TYPE_BLOB: - case static::PHINX_TYPE_BINARY: - return array('name' => 'bytea'); - // Geospatial database types - // Spatial storage in Postgres is done via the PostGIS extension, - // which enables the use of the "geography" type in combination - // with SRID 4326. - case static::PHINX_TYPE_GEOMETRY: - return array('name' => 'geography', 'geometry', 4326); - break; - case static::PHINX_TYPE_POINT: - return array('name' => 'geography', 'point', 4326); - break; - case static::PHINX_TYPE_LINESTRING: - return array('name' => 'geography', 'linestring', 4326); - break; - case static::PHINX_TYPE_POLYGON: - return array('name' => 'geography', 'polygon', 4326); - break; - default: - if ($this->isArrayType($type)) { - return array('name' => $type); - } - // Return array type - throw new \RuntimeException('The type: "' . $type . '" is not supported'); - } - } - - /** - * Returns Phinx type by SQL type - * - * @param string $sqlType SQL type - * @returns string Phinx type - */ - public function getPhinxType($sqlType) - { - switch ($sqlType) { - case 'character varying': - case 'varchar': - return static::PHINX_TYPE_STRING; - case 'character': - case 'char': - return static::PHINX_TYPE_CHAR; - case 'text': - return static::PHINX_TYPE_TEXT; - case 'json': - return static::PHINX_TYPE_JSON; - case 'jsonb': - return static::PHINX_TYPE_JSONB; - case 'smallint': - return array( - 'name' => 'smallint', - 'limit' => static::INT_SMALL - ); - case 'int': - case 'int4': - case 'integer': - return static::PHINX_TYPE_INTEGER; - case 'decimal': - case 'numeric': - return static::PHINX_TYPE_DECIMAL; - case 'bigint': - case 'int8': - return static::PHINX_TYPE_BIG_INTEGER; - case 'real': - case 'float4': - return static::PHINX_TYPE_FLOAT; - case 'bytea': - return static::PHINX_TYPE_BINARY; - break; - case 'time': - case 'timetz': - case 'time with time zone': - case 'time without time zone': - return static::PHINX_TYPE_TIME; - case 'date': - return static::PHINX_TYPE_DATE; - case 'timestamp': - case 'timestamptz': - case 'timestamp with time zone': - case 'timestamp without time zone': - return static::PHINX_TYPE_DATETIME; - case 'bool': - case 'boolean': - return static::PHINX_TYPE_BOOLEAN; - case 'uuid': - return static::PHINX_TYPE_UUID; - default: - throw new \RuntimeException('The PostgreSQL type: "' . $sqlType . '" is not supported'); - } - } - - /** - * {@inheritdoc} - */ - public function createDatabase($name, $options = array()) - { - $this->startCommandTimer(); - $this->writeCommand('createDatabase', array($name)); - $charset = isset($options['charset']) ? $options['charset'] : 'utf8'; - $this->execute(sprintf("CREATE DATABASE %s WITH ENCODING = '%s'", $name, $charset)); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function hasDatabase($databaseName) - { - $sql = sprintf("SELECT count(*) FROM pg_database WHERE datname = '%s'", $databaseName); - $result = $this->fetchRow($sql); - return $result['count'] > 0; - } - - /** - * {@inheritdoc} - */ - public function dropDatabase($name) - { - $this->startCommandTimer(); - $this->writeCommand('dropDatabase', array($name)); - $this->disconnect(); - $this->execute(sprintf('DROP DATABASE IF EXISTS %s', $name)); - $this->connect(); - $this->endCommandTimer(); - } - - /** - * Get the defintion for a `DEFAULT` statement. - * - * @param mixed $default - * @return string - */ - protected function getDefaultValueDefinition($default) - { - if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { - $default = $this->getConnection()->quote($default); - } elseif (is_bool($default)) { - $default = $this->castToBool($default); - } - return isset($default) ? 'DEFAULT ' . $default : ''; - } - - /** - * Gets the PostgreSQL Column Definition for a Column object. - * - * @param Column $column Column - * @return string - */ - protected function getColumnSqlDefinition(Column $column) - { - $buffer = array(); - if ($column->isIdentity()) { - $buffer[] = $column->getType() == 'biginteger' ? 'BIGSERIAL' : 'SERIAL'; - } else { - $sqlType = $this->getSqlType($column->getType(), $column->getLimit()); - $buffer[] = strtoupper($sqlType['name']); - // integers cant have limits in postgres - if (static::PHINX_TYPE_DECIMAL === $sqlType['name'] && ($column->getPrecision() || $column->getScale())) { - $buffer[] = sprintf( - '(%s, %s)', - $column->getPrecision() ? $column->getPrecision() : $sqlType['precision'], - $column->getScale() ? $column->getScale() : $sqlType['scale'] - ); - } elseif (!in_array($sqlType['name'], array('integer', 'smallint'))) { - if ($column->getLimit() || isset($sqlType['limit'])) { - $buffer[] = sprintf('(%s)', $column->getLimit() ? $column->getLimit() : $sqlType['limit']); - } - } - - $timeTypes = array( - 'time', - 'timestamp', - ); - if (in_array($sqlType['name'], $timeTypes) && $column->isTimezone()) { - $buffer[] = strtoupper('with time zone'); - } - } - - $buffer[] = $column->isNull() ? 'NULL' : 'NOT NULL'; - - if (!is_null($column->getDefault())) { - $buffer[] = $this->getDefaultValueDefinition($column->getDefault()); - } - - return implode(' ', $buffer); - } - - /** - * Gets the PostgreSQL Column Comment Defininition for a column object. - * - * @param Column $column Column - * @param string $tableName Table name - * @return string - */ - protected function getColumnCommentSqlDefinition(Column $column, $tableName) - { - // passing 'null' is to remove column comment - $comment = (strcasecmp($column->getComment(), 'NULL') !== 0) - ? $this->getConnection()->quote($column->getComment()) - : 'NULL'; - - return sprintf( - 'COMMENT ON COLUMN %s.%s IS %s;', - $tableName, - $column->getName(), - $comment - ); - } - - /** - * Gets the PostgreSQL Index Definition for an Index object. - * - * @param Index $index Index - * @param string $tableName Table name - * @return string - */ - protected function getIndexSqlDefinition(Index $index, $tableName) - { - if (is_string($index->getName())) { - $indexName = $index->getName(); - } else { - $columnNames = $index->getColumns(); - if (is_string($columnNames)) { - $columnNames = array($columnNames); - } - $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames)); - } - $def = sprintf( - "CREATE %s INDEX %s ON %s (%s);", - ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''), - $indexName, - $this->quoteTableName($tableName), - implode(',', $index->getColumns()) - ); - return $def; - } - - /** - * Gets the MySQL Foreign Key Definition for an ForeignKey object. - * - * @param ForeignKey $foreignKey - * @param string $tableName Table name - * @return string - */ - protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName) - { - $constraintName = $foreignKey->getConstraint() ?: $tableName . '_' . implode('_', $foreignKey->getColumns()); - $def = ' CONSTRAINT "' . $constraintName . '" FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")'; - $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")'; - if ($foreignKey->getOnDelete()) { - $def .= " ON DELETE {$foreignKey->getOnDelete()}"; - } - if ($foreignKey->getOnUpdate()) { - $def .= " ON UPDATE {$foreignKey->getOnUpdate()}"; - } - return $def; - } - - /** - * {@inheritdoc} - */ - public function createSchemaTable() - { - // Create the public/custom schema if it doesn't already exist - if (false === $this->hasSchema($this->getSchemaName())) { - $this->createSchema($this->getSchemaName()); - } - - $this->fetchAll(sprintf('SET search_path TO %s', $this->getSchemaName())); - - return parent::createSchemaTable(); - } - - /** - * Creates the specified schema. - * - * @param string $schemaName Schema Name - * @return void - */ - public function createSchema($schemaName = 'public') - { - $this->startCommandTimer(); - $this->writeCommand('addSchema', array($schemaName)); - $sql = sprintf('CREATE SCHEMA %s;', $this->quoteSchemaName($schemaName)); // from postgres 9.3 we can use "CREATE SCHEMA IF NOT EXISTS schema_name" - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * Checks to see if a schema exists. - * - * @param string $schemaName Schema Name - * @return boolean - */ - public function hasSchema($schemaName) - { - $sql = sprintf( - "SELECT count(*) - FROM pg_namespace - WHERE nspname = '%s'", - $schemaName - ); - $result = $this->fetchRow($sql); - return $result['count'] > 0; - } - - /** - * Drops the specified schema table. - * - * @param string $schemaName Schema name - * @return void - */ - public function dropSchema($schemaName) - { - $this->startCommandTimer(); - $this->writeCommand('dropSchema', array($schemaName)); - $sql = sprintf("DROP SCHEMA IF EXISTS %s CASCADE;", $this->quoteSchemaName($schemaName)); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * Drops all schemas. - * - * @return void - */ - public function dropAllSchemas() - { - $this->startCommandTimer(); - $this->writeCommand('dropAllSchemas'); - foreach ($this->getAllSchemas() as $schema) { - $this->dropSchema($schema); - } - $this->endCommandTimer(); - } - - /** - * Returns schemas. - * - * @return array - */ - public function getAllSchemas() - { - $sql = "SELECT schema_name - FROM information_schema.schemata - WHERE schema_name <> 'information_schema' AND schema_name !~ '^pg_'"; - $items = $this->fetchAll($sql); - $schemaNames = array(); - foreach ($items as $item) { - $schemaNames[] = $item['schema_name']; - } - return $schemaNames; - } - - /** - * {@inheritdoc} - */ - public function getColumnTypes() - { - return array_merge(parent::getColumnTypes(), array('json', 'jsonb')); - } - - /** - * {@inheritdoc} - */ - public function isValidColumnType(Column $column) - { - // If not a standard column type, maybe it is array type? - return (parent::isValidColumnType($column) || $this->isArrayType($column->getType())); - } - - /** - * Check if the given column is an array of a valid type. - * - * @param string $columnType - * @return bool - */ - protected function isArrayType($columnType) - { - if (!preg_match('/^([a-z]+)(?:\[\]){1,}$/', $columnType, $matches)) { - return false; - } - - $baseType = $matches[1]; - return in_array($baseType, $this->getColumnTypes()); - } - - /** - * Gets the schema name. - * - * @return string - */ - private function getSchemaName() - { - $options = $this->getOptions(); - return empty($options['schema']) ? 'public' : $options['schema']; - } - - /** - * Cast a value to a boolean appropriate for the adapter. - * - * @param mixed $value The value to be cast - * - * @return mixed - */ - public function castToBool($value) - { - return (bool) $value ? 'TRUE' : 'FALSE'; - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php deleted file mode 100644 index 1236031..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php +++ /dev/null @@ -1,325 +0,0 @@ - - */ -class ProxyAdapter extends AdapterWrapper -{ - /** - * @var array - */ - protected $commands; - - /** - * {@inheritdoc} - */ - public function getAdapterType() - { - return 'ProxyAdapter'; - } - /** - * {@inheritdoc} - */ - public function createTable(Table $table) - { - $this->recordCommand('createTable', array($table->getName())); - } - - /** - * {@inheritdoc} - */ - public function renameTable($tableName, $newTableName) - { - $this->recordCommand('renameTable', array($tableName, $newTableName)); - } - - /** - * {@inheritdoc} - */ - public function dropTable($tableName) - { - $this->recordCommand('dropTable', array($tableName)); - } - - /** - * {@inheritdoc} - */ - public function addColumn(Table $table, Column $column) - { - $this->recordCommand('addColumn', array($table, $column)); - } - - /** - * {@inheritdoc} - */ - public function renameColumn($tableName, $columnName, $newColumnName) - { - $this->recordCommand('renameColumn', array($tableName, $columnName, $newColumnName)); - } - - /** - * {@inheritdoc} - */ - public function changeColumn($tableName, $columnName, Column $newColumn) - { - $this->recordCommand('changeColumn', array($tableName, $columnName, $newColumn)); - } - - /** - * {@inheritdoc} - */ - public function dropColumn($tableName, $columnName) - { - $this->recordCommand('dropColumn', array($tableName, $columnName)); - } - - /** - * {@inheritdoc} - */ - public function addIndex(Table $table, Index $index) - { - $this->recordCommand('addIndex', array($table, $index)); - } - - /** - * {@inheritdoc} - */ - public function dropIndex($tableName, $columns, $options = array()) - { - $this->recordCommand('dropIndex', array($tableName, $columns, $options)); - } - - /** - * {@inheritdoc} - */ - public function dropIndexByName($tableName, $indexName) - { - $this->recordCommand('dropIndexByName', array($tableName, $indexName)); - } - - /** - * {@inheritdoc} - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey) - { - $this->recordCommand('addForeignKey', array($table, $foreignKey)); - } - - /** - * {@inheritdoc} - */ - public function dropForeignKey($tableName, $columns, $constraint = null) - { - $this->recordCommand('dropForeignKey', array($columns, $constraint)); - } - - /** - * {@inheritdoc} - */ - public function createDatabase($name, $options = array()) - { - $this->recordCommand('createDatabase', array($name, $options)); - } - - /** - * Record a command for execution later. - * - * @param string $name Command Name - * @param array $arguments Command Arguments - * @return void - */ - public function recordCommand($name, $arguments) - { - $this->commands[] = array( - 'name' => $name, - 'arguments' => $arguments - ); - } - - /** - * Sets an array of recorded commands. - * - * @param array $commands Commands - * @return ProxyAdapter - */ - public function setCommands($commands) - { - $this->commands = $commands; - return $this; - } - - /** - * Gets an array of the recorded commands. - * - * @return array - */ - public function getCommands() - { - return $this->commands; - } - - /** - * Gets an array of the recorded commands in reverse. - * - * @throws IrreversibleMigrationException if a command cannot be reversed. - * @return array - */ - public function getInvertedCommands() - { - if (null === $this->getCommands()) { - return array(); - } - - $invCommands = array(); - $supportedCommands = array( - 'createTable', 'renameTable', 'addColumn', - 'renameColumn', 'addIndex', 'addForeignKey' - ); - foreach (array_reverse($this->getCommands()) as $command) { - if (!in_array($command['name'], $supportedCommands)) { - throw new IrreversibleMigrationException(sprintf( - 'Cannot reverse a "%s" command', - $command['name'] - )); - } - $invertMethod = 'invert' . ucfirst($command['name']); - $invertedCommand = $this->$invertMethod($command['arguments']); - $invCommands[] = array( - 'name' => $invertedCommand['name'], - 'arguments' => $invertedCommand['arguments'] - ); - } - - return $invCommands; - } - - /** - * Execute the recorded commands. - * - * @return void - */ - public function executeCommands() - { - $commands = $this->getCommands(); - foreach ($commands as $command) { - call_user_func_array(array($this->getAdapter(), $command['name']), $command['arguments']); - } - } - - /** - * Execute the recorded commands in reverse. - * - * @return void - */ - public function executeInvertedCommands() - { - $commands = $this->getInvertedCommands(); - foreach ($commands as $command) { - call_user_func_array(array($this->getAdapter(), $command['name']), $command['arguments']); - } - } - - /** - * Returns the reverse of a createTable command. - * - * @param array $args Method Arguments - * @return array - */ - public function invertCreateTable($args) - { - return array('name' => 'dropTable', 'arguments' => array($args[0])); - } - - /** - * Returns the reverse of a renameTable command. - * - * @param array $args Method Arguments - * @return array - */ - public function invertRenameTable($args) - { - return array('name' => 'renameTable', 'arguments' => array($args[1], $args[0])); - } - - /** - * Returns the reverse of a addColumn command. - * - * @param array $args Method Arguments - * @return array - */ - public function invertAddColumn($args) - { - return array('name' => 'dropColumn', 'arguments' => array($args[0]->getName(), $args[1]->getName())); - } - - /** - * Returns the reverse of a renameColumn command. - * - * @param array $args Method Arguments - * @return array - */ - public function invertRenameColumn($args) - { - return array('name' => 'renameColumn', 'arguments' => array($args[0], $args[2], $args[1])); - } - - /** - * Returns the reverse of a addIndex command. - * - * @param array $args Method Arguments - * @return array - */ - public function invertAddIndex($args) - { - return array('name' => 'dropIndex', 'arguments' => array($args[0]->getName(), $args[1]->getColumns())); - } - - /** - * Returns the reverse of a addForeignKey command. - * - * @param array $args Method Arguments - * @return array - */ - public function invertAddForeignKey($args) - { - return array('name' => 'dropForeignKey', 'arguments' => array($args[0]->getName(), $args[1]->getColumns())); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php deleted file mode 100644 index 4ff7b74..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php +++ /dev/null @@ -1,1136 +0,0 @@ - - * @author Richard McIntyre - */ -class SQLiteAdapter extends PdoAdapter implements AdapterInterface -{ - protected $definitionsWithLimits = array( - 'CHARACTER', - 'VARCHAR', - 'VARYING CHARACTER', - 'NCHAR', - 'NATIVE CHARACTER', - 'NVARCHAR' - ); - - /** - * {@inheritdoc} - */ - public function connect() - { - if (null === $this->connection) { - if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers(), true)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('You need to enable the PDO_SQLITE extension for Phinx to run properly.'); - // @codeCoverageIgnoreEnd - } - - $db = null; - $options = $this->getOptions(); - - // if port is specified use it, otherwise use the MySQL default - if (isset($options['memory'])) { - $dsn = 'sqlite::memory:'; - } else { - $dsn = 'sqlite:' . $options['name']; - if (file_exists($options['name'] . '.sqlite3')) { - $dsn = 'sqlite:' . $options['name'] . '.sqlite3'; - } - } - - try { - $db = new \PDO($dsn); - } catch (\PDOException $exception) { - throw new \InvalidArgumentException(sprintf( - 'There was a problem connecting to the database: %s', - $exception->getMessage() - )); - } - - $this->setConnection($db); - } - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - $this->connection = null; - } - - /** - * {@inheritdoc} - */ - public function hasTransactions() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function beginTransaction() - { - $this->execute('BEGIN TRANSACTION'); - } - - /** - * {@inheritdoc} - */ - public function commitTransaction() - { - $this->execute('COMMIT'); - } - - /** - * {@inheritdoc} - */ - public function rollbackTransaction() - { - $this->execute('ROLLBACK'); - } - - /** - * {@inheritdoc} - */ - public function quoteTableName($tableName) - { - return str_replace('.', '`.`', $this->quoteColumnName($tableName)); - } - - /** - * {@inheritdoc} - */ - public function quoteColumnName($columnName) - { - return '`' . str_replace('`', '``', $columnName) . '`'; - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - $tables = array(); - $rows = $this->fetchAll(sprintf('SELECT name FROM sqlite_master WHERE type=\'table\' AND name=\'%s\'', $tableName)); - foreach ($rows as $row) { - $tables[] = strtolower($row[0]); - } - - return in_array(strtolower($tableName), $tables); - } - - /** - * {@inheritdoc} - */ - public function createTable(Table $table) - { - $this->startCommandTimer(); - - // Add the default primary key - $columns = $table->getPendingColumns(); - $options = $table->getOptions(); - if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) { - $column = new Column(); - $column->setName('id') - ->setType('integer') - ->setIdentity(true); - - array_unshift($columns, $column); - - } elseif (isset($options['id']) && is_string($options['id'])) { - // Handle id => "field_name" to support AUTO_INCREMENT - $column = new Column(); - $column->setName($options['id']) - ->setType('integer') - ->setIdentity(true); - - array_unshift($columns, $column); - } - - $sql = 'CREATE TABLE '; - $sql .= $this->quoteTableName($table->getName()) . ' ('; - foreach ($columns as $column) { - $sql .= $this->quoteColumnName($column->getName()) . ' ' . $this->getColumnSqlDefinition($column) . ', '; - } - - // set the primary key(s) - if (isset($options['primary_key'])) { - $sql = rtrim($sql); - $sql .= ' PRIMARY KEY ('; - if (is_string($options['primary_key'])) { // handle primary_key => 'id' - $sql .= $this->quoteColumnName($options['primary_key']); - } elseif (is_array($options['primary_key'])) { // handle primary_key => array('tag_id', 'resource_id') - // PHP 5.4 will allow access of $this, so we can call quoteColumnName() directly in the anonymous function, - // but for now just hard-code the adapter quotes - $sql .= implode( - ',', - array_map( - function ($v) { - return '`' . $v . '`'; - }, - $options['primary_key'] - ) - ); - } - $sql .= ')'; - } else { - $sql = substr(rtrim($sql), 0, -1); // no primary keys - } - - // set the foreign keys - $foreignKeys = $table->getForeignKeys(); - if (!empty($foreignKeys)) { - foreach ($foreignKeys as $foreignKey) { - $sql .= ', ' . $this->getForeignKeySqlDefinition($foreignKey); - } - } - - $sql = rtrim($sql) . ');'; - // execute the sql - $this->writeCommand('createTable', array($table->getName())); - $this->execute($sql); - $this->endCommandTimer(); - - foreach ($table->getIndexes() as $index) { - $this->addIndex($table, $index); - } - } - - /** - * {@inheritdoc} - */ - public function renameTable($tableName, $newTableName) - { - $this->startCommandTimer(); - $this->writeCommand('renameTable', array($tableName, $newTableName)); - $this->execute(sprintf('ALTER TABLE %s RENAME TO %s', $this->quoteTableName($tableName), $this->quoteTableName($newTableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropTable($tableName) - { - $this->startCommandTimer(); - $this->writeCommand('dropTable', array($tableName)); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getColumns($tableName) - { - $columns = array(); - $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); - - foreach ($rows as $columnInfo) { - $column = new Column(); - $type = strtolower($columnInfo['type']); - $column->setName($columnInfo['name']) - ->setNull($columnInfo['notnull'] !== '1') - ->setDefault($columnInfo['dflt_value']); - - $phinxType = $this->getPhinxType($type); - $column->setType($phinxType['name']) - ->setLimit($phinxType['limit']); - - if ($columnInfo['pk'] == 1) { - $column->setIdentity(true); - } - - $columns[] = $column; - } - - return $columns; - } - - /** - * {@inheritdoc} - */ - public function hasColumn($tableName, $columnName) - { - $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); - foreach ($rows as $column) { - if (strcasecmp($column['name'], $columnName) === 0) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function addColumn(Table $table, Column $column) - { - $this->startCommandTimer(); - - $sql = sprintf( - 'ALTER TABLE %s ADD COLUMN %s %s', - $this->quoteTableName($table->getName()), - $this->quoteColumnName($column->getName()), - $this->getColumnSqlDefinition($column) - ); - - $this->writeCommand('addColumn', array($table->getName(), $column->getName(), $column->getType())); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function renameColumn($tableName, $columnName, $newColumnName) - { - $tmpTableName = 'tmp_' . $tableName; - - $rows = $this->fetchAll('select * from sqlite_master where `type` = \'table\''); - - $sql = ''; - foreach ($rows as $table) { - if ($table['tbl_name'] === $tableName) { - $sql = $table['sql']; - } - } - - $columns = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); - $selectColumns = array(); - $writeColumns = array(); - foreach ($columns as $column) { - $selectName = $column['name']; - $writeName = ($selectName == $columnName) ? $newColumnName : $selectName; - $selectColumns[] = $this->quoteColumnName($selectName); - $writeColumns[] = $this->quoteColumnName($writeName); - } - - if (!in_array($this->quoteColumnName($columnName), $selectColumns)) { - throw new \InvalidArgumentException(sprintf( - 'The specified column doesn\'t exist: ' . $columnName - )); - } - - $this->execute(sprintf('ALTER TABLE %s RENAME TO %s', $tableName, $tmpTableName)); - - $sql = str_replace( - $this->quoteColumnName($columnName), - $this->quoteColumnName($newColumnName), - $sql - ); - $this->execute($sql); - - $sql = sprintf( - 'INSERT INTO %s(%s) SELECT %s FROM %s', - $tableName, - implode(', ', $writeColumns), - implode(', ', $selectColumns), - $tmpTableName - ); - - $this->execute($sql); - - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tmpTableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function changeColumn($tableName, $columnName, Column $newColumn) - { - - // TODO: DRY this up.... - - $this->startCommandTimer(); - $this->writeCommand('changeColumn', array($tableName, $columnName, $newColumn->getType())); - - $tmpTableName = 'tmp_' . $tableName; - - $rows = $this->fetchAll('select * from sqlite_master where `type` = \'table\''); - - $sql = ''; - foreach ($rows as $table) { - if ($table['tbl_name'] === $tableName) { - $sql = $table['sql']; - } - } - - $columns = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); - $selectColumns = array(); - $writeColumns = array(); - foreach ($columns as $column) { - $selectName = $column['name']; - $writeName = ($selectName === $columnName) ? $newColumn->getName() : $selectName; - $selectColumns[] = $this->quoteColumnName($selectName); - $writeColumns[] = $this->quoteColumnName($writeName); - } - - if (!in_array($this->quoteColumnName($columnName), $selectColumns)) { - throw new \InvalidArgumentException(sprintf( - 'The specified column doesn\'t exist: ' . $columnName - )); - } - - $this->execute(sprintf('ALTER TABLE %s RENAME TO %s', $tableName, $tmpTableName)); - - $sql = preg_replace( - sprintf("/%s[^,]+([,)])/", $this->quoteColumnName($columnName)), - sprintf('%s %s$1', $this->quoteColumnName($newColumn->getName()), $this->getColumnSqlDefinition($newColumn)), - $sql, - 1 - ); - - $this->execute($sql); - - $sql = sprintf( - 'INSERT INTO %s(%s) SELECT %s FROM %s', - $tableName, - implode(', ', $writeColumns), - implode(', ', $selectColumns), - $tmpTableName - ); - - $this->execute($sql); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tmpTableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropColumn($tableName, $columnName) - { - // TODO: DRY this up.... - - $this->startCommandTimer(); - $this->writeCommand('dropColumn', array($tableName, $columnName)); - - $tmpTableName = 'tmp_' . $tableName; - - $rows = $this->fetchAll('select * from sqlite_master where `type` = \'table\''); - - $sql = ''; - foreach ($rows as $table) { - if ($table['tbl_name'] === $tableName) { - $sql = $table['sql']; - } - } - - $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); - $columns = array(); - $columnType = null; - foreach ($rows as $row) { - if ($row['name'] !== $columnName) { - $columns[] = $row['name']; - } else { - $found = true; - $columnType = $row['type']; - } - } - - if (!isset($found)) { - throw new \InvalidArgumentException(sprintf( - 'The specified column doesn\'t exist: ' . $columnName - )); - } - - $this->execute(sprintf('ALTER TABLE %s RENAME TO %s', $tableName, $tmpTableName)); - - $sql = preg_replace( - sprintf("/%s\s%s[^,)]*(,\s|\))/", preg_quote($this->quoteColumnName($columnName)), preg_quote($columnType)), - "", - $sql - ); - - if (substr($sql, -2) === ', ') { - $sql = substr($sql, 0, -2) . ')'; - } - - $this->execute($sql); - - $sql = sprintf( - 'INSERT INTO %s(%s) SELECT %s FROM %s', - $tableName, - implode(', ', $columns), - implode(', ', $columns), - $tmpTableName - ); - - $this->execute($sql); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tmpTableName))); - $this->endCommandTimer(); - } - - /** - * Get an array of indexes from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - protected function getIndexes($tableName) - { - $indexes = array(); - $rows = $this->fetchAll(sprintf('pragma index_list(%s)', $tableName)); - - foreach ($rows as $row) { - $indexData = $this->fetchAll(sprintf('pragma index_info(%s)', $row['name'])); - if (!isset($indexes[$tableName])) { - $indexes[$tableName] = array('index' => $row['name'], 'columns' => array()); - } - foreach ($indexData as $indexItem) { - $indexes[$tableName]['columns'][] = strtolower($indexItem['name']); - } - } - return $indexes; - } - - /** - * {@inheritdoc} - */ - public function hasIndex($tableName, $columns) - { - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $columns = array_map('strtolower', $columns); - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $index) { - $a = array_diff($columns, $index['columns']); - if (empty($a)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function hasIndexByName($tableName, $indexName) - { - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $index) { - if ($indexName === $index['index']) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function addIndex(Table $table, Index $index) - { - $this->startCommandTimer(); - $this->writeCommand('addIndex', array($table->getName(), $index->getColumns())); - $indexColumnArray = array(); - foreach ($index->getColumns() as $column) { - $indexColumnArray []= sprintf('`%s` ASC', $column); - } - $indexColumns = implode(',', $indexColumnArray); - $this->execute( - sprintf( - 'CREATE %s ON %s (%s)', - $this->getIndexSqlDefinition($table, $index), - $this->quoteTableName($table->getName()), - $indexColumns - ) - ); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropIndex($tableName, $columns) - { - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $this->writeCommand('dropIndex', array($tableName, $columns)); - $indexes = $this->getIndexes($tableName); - $columns = array_map('strtolower', $columns); - - foreach ($indexes as $index) { - $a = array_diff($columns, $index['columns']); - if (empty($a)) { - $this->execute( - sprintf( - 'DROP INDEX %s', - $this->quoteColumnName($index['index']) - ) - ); - $this->endCommandTimer(); - return; - } - } - } - - /** - * {@inheritdoc} - */ - public function dropIndexByName($tableName, $indexName) - { - $this->startCommandTimer(); - - $this->writeCommand('dropIndexByName', array($tableName, $indexName)); - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $index) { - if ($indexName === $index['index']) { - $this->execute( - sprintf( - 'DROP INDEX %s', - $this->quoteColumnName($indexName) - ) - ); - $this->endCommandTimer(); - return; - } - } - } - - /** - * {@inheritdoc} - */ - public function hasForeignKey($tableName, $columns, $constraint = null) - { - if (is_string($columns)) { - $columns = array($columns); // str to array - } - $foreignKeys = $this->getForeignKeys($tableName); - - $a = array_diff($columns, $foreignKeys); - if (empty($a)) { - return true; - } - return false; - } - - /** - * Get an array of foreign keys from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - protected function getForeignKeys($tableName) - { - $foreignKeys = array(); - $rows = $this->fetchAll( - "SELECT sql, tbl_name - FROM ( - SELECT sql sql, type type, tbl_name tbl_name, name name - FROM sqlite_master - UNION ALL - SELECT sql, type, tbl_name, name - FROM sqlite_temp_master - ) - WHERE type != 'meta' - AND sql NOTNULL - AND name NOT LIKE 'sqlite_%' - ORDER BY substr(type, 2, 1), name" - ); - - foreach ($rows as $row) { - if ($row['tbl_name'] === $tableName) { - - if (strpos($row['sql'], 'REFERENCES') !== false) { - preg_match_all("/\(`([^`]*)`\) REFERENCES/", $row['sql'], $matches); - foreach ($matches[1] as $match) { - $foreignKeys[] = $match; - } - } - } - } - return $foreignKeys; - } - - /** - * {@inheritdoc} - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey) - { - // TODO: DRY this up.... - $this->startCommandTimer(); - $this->writeCommand('addForeignKey', array($table->getName(), $foreignKey->getColumns())); - $this->execute('pragma foreign_keys = ON'); - - $tmpTableName = 'tmp_' . $table->getName(); - $rows = $this->fetchAll('select * from sqlite_master where `type` = \'table\''); - - $sql = ''; - foreach ($rows as $row) { - if ($row['tbl_name'] === $table->getName()) { - $sql = $row['sql']; - } - } - - $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($table->getName()))); - $columns = array(); - foreach ($rows as $column) { - $columns[] = $this->quoteColumnName($column['name']); - } - - $this->execute(sprintf('ALTER TABLE %s RENAME TO %s', $this->quoteTableName($table->getName()), $tmpTableName)); - - $sql = substr($sql, 0, -1) . ',' . $this->getForeignKeySqlDefinition($foreignKey) . ')'; - $this->execute($sql); - - $sql = sprintf( - 'INSERT INTO %s(%s) SELECT %s FROM %s', - $this->quoteTableName($table->getName()), - implode(', ', $columns), - implode(', ', $columns), - $this->quoteTableName($tmpTableName) - ); - - $this->execute($sql); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tmpTableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropForeignKey($tableName, $columns, $constraint = null) - { - // TODO: DRY this up.... - - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $this->writeCommand('dropForeignKey', array($tableName, $columns)); - - $tmpTableName = 'tmp_' . $tableName; - - $rows = $this->fetchAll('select * from sqlite_master where `type` = \'table\''); - - $sql = ''; - foreach ($rows as $table) { - if ($table['tbl_name'] === $tableName) { - $sql = $table['sql']; - } - } - - $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); - $replaceColumns = array(); - foreach ($rows as $row) { - if (!in_array($row['name'], $columns)) { - $replaceColumns[] = $row['name']; - } else { - $found = true; - } - } - - if (!isset($found)) { - throw new \InvalidArgumentException(sprintf( - 'The specified column doesn\'t exist: ' - )); - } - - $this->execute(sprintf('ALTER TABLE %s RENAME TO %s', $this->quoteTableName($tableName), $tmpTableName)); - - foreach ($columns as $columnName) { - $search = sprintf( - "/,[^,]*\(%s(?:,`?(.*)`?)?\) REFERENCES[^,]*\([^\)]*\)[^,)]*/", - $this->quoteColumnName($columnName) - ); - $sql = preg_replace($search, '', $sql, 1); - } - - $this->execute($sql); - - $sql = sprintf( - 'INSERT INTO %s(%s) SELECT %s FROM %s', - $tableName, - implode(', ', $columns), - implode(', ', $columns), - $tmpTableName - ); - - $this->execute($sql); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tmpTableName))); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function insert(Table $table, $row) - { - $this->startCommandTimer(); - $this->writeCommand('insert', array($table->getName())); - - $sql = sprintf( - "INSERT INTO %s ", - $this->quoteTableName($table->getName()) - ); - - $columns = array_keys($row); - $sql .= "(". implode(', ', array_map(array($this, 'quoteColumnName'), $columns)) . ")"; - $sql .= " VALUES "; - - $sql .= "(" . implode(', ', array_map(function ($value) { - if (is_numeric($value)) { - return $value; - } - return "'{$value}'"; - }, $row)) . ")"; - - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getSqlType($type, $limit = null) - { - switch ($type) { - case static::PHINX_TYPE_STRING: - return array('name' => 'varchar', 'limit' => 255); - break; - case static::PHINX_TYPE_CHAR: - return array('name' => 'char', 'limit' => 255); - break; - case static::PHINX_TYPE_TEXT: - return array('name' => 'text'); - break; - case static::PHINX_TYPE_INTEGER: - return array('name' => 'integer'); - break; - case static::PHINX_TYPE_BIG_INTEGER: - return array('name' => 'bigint'); - break; - case static::PHINX_TYPE_FLOAT: - return array('name' => 'float'); - break; - case static::PHINX_TYPE_DECIMAL: - return array('name' => 'decimal'); - break; - case static::PHINX_TYPE_DATETIME: - return array('name' => 'datetime'); - break; - case static::PHINX_TYPE_TIMESTAMP: - return array('name' => 'datetime'); - break; - case static::PHINX_TYPE_TIME: - return array('name' => 'time'); - break; - case static::PHINX_TYPE_DATE: - return array('name' => 'date'); - break; - case static::PHINX_TYPE_BLOB: - case static::PHINX_TYPE_BINARY: - return array('name' => 'blob'); - break; - case static::PHINX_TYPE_BOOLEAN: - return array('name' => 'boolean'); - break; - case static::PHINX_TYPE_UUID: - return array('name' => 'char', 'limit' => 36); - case static::PHINX_TYPE_ENUM: - return array('name' => 'enum'); - // Geospatial database types - // No specific data types exist in SQLite, instead all geospatial - // functionality is handled in the client. See also: SpatiaLite. - case static::PHINX_TYPE_GEOMETRY: - case static::PHINX_TYPE_POLYGON: - return array('name' => 'text'); - return; - case static::PHINX_TYPE_LINESTRING: - return array('name' => 'varchar', 'limit' => 255); - break; - case static::PHINX_TYPE_POINT: - return array('name' => 'float'); - default: - throw new \RuntimeException('The type: "' . $type . '" is not supported.'); - } - } - - /** - * Returns Phinx type by SQL type - * - * @param string $sqlTypeDef SQL type - * @returns string Phinx type - */ - public function getPhinxType($sqlTypeDef) - { - if (!preg_match('/^([\w]+)(\(([\d]+)*(,([\d]+))*\))*$/', $sqlTypeDef, $matches)) { - throw new \RuntimeException('Column type ' . $sqlTypeDef . ' is not supported'); - } else { - $limit = null; - $precision = null; - $type = $matches[1]; - if (count($matches) > 2) { - $limit = $matches[3] ? $matches[3] : null; - } - if (count($matches) > 4) { - $precision = $matches[5]; - } - switch ($matches[1]) { - case 'varchar': - $type = static::PHINX_TYPE_STRING; - if ($limit === 255) { - $limit = null; - } - break; - case 'char': - $type = static::PHINX_TYPE_CHAR; - if ($limit === 255) { - $limit = null; - } - if ($limit === 36) { - $type = static::PHINX_TYPE_UUID; - } - break; - case 'int': - $type = static::PHINX_TYPE_INTEGER; - if ($limit === 11) { - $limit = null; - } - break; - case 'bigint': - if ($limit === 11) { - $limit = null; - } - $type = static::PHINX_TYPE_BIG_INTEGER; - break; - case 'blob': - $type = static::PHINX_TYPE_BINARY; - break; - } - if ($type === 'tinyint') { - if ($matches[3] === 1) { - $type = static::PHINX_TYPE_BOOLEAN; - $limit = null; - } - } - - $this->getSqlType($type); - - return array( - 'name' => $type, - 'limit' => $limit, - 'precision' => $precision - ); - } - } - - /** - * {@inheritdoc} - */ - public function createDatabase($name, $options = array()) - { - $this->startCommandTimer(); - $this->writeCommand('createDatabase', array($name)); - touch($name . '.sqlite3'); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function hasDatabase($name) - { - return is_file($name . '.sqlite3'); - } - - /** - * {@inheritdoc} - */ - public function dropDatabase($name) - { - $this->startCommandTimer(); - $this->writeCommand('dropDatabase', array($name)); - if (file_exists($name . '.sqlite3')) { - unlink($name . '.sqlite3'); - } - $this->endCommandTimer(); - } - - /** - * Get the definition for a `DEFAULT` statement. - * - * @param mixed $default - * @return string - */ - protected function getDefaultValueDefinition($default) - { - if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { - $default = $this->getConnection()->quote($default); - } elseif (is_bool($default)) { - $default = $this->castToBool($default); - } - return isset($default) ? ' DEFAULT ' . $default : ''; - } - - /** - * Gets the SQLite Column Definition for a Column object. - * - * @param Column $column Column - * @return string - */ - protected function getColumnSqlDefinition(Column $column) - { - $sqlType = $this->getSqlType($column->getType()); - $def = ''; - $def .= strtoupper($sqlType['name']); - if ($column->getPrecision() && $column->getScale()) { - $def .= '(' . $column->getPrecision() . ',' . $column->getScale() . ')'; - } - $limitable = in_array(strtoupper($sqlType['name']), $this->definitionsWithLimits); - if (($column->getLimit() || isset($sqlType['limit'])) && $limitable) { - $def .= '(' . ($column->getLimit() ? $column->getLimit() : $sqlType['limit']) . ')'; - } - if (($values = $column->getValues()) && is_array($values)) { - $def .= " CHECK({$column->getName()} IN ('" . implode("', '", $values) . "'))"; - } - - $default = $column->getDefault(); - - $def .= ($column->isNull() || is_null($default)) ? ' NULL' : ' NOT NULL'; - $def .= $this->getDefaultValueDefinition($default); - $def .= ($column->isIdentity()) ? ' PRIMARY KEY AUTOINCREMENT' : ''; - - if ($column->getUpdate()) { - $def .= ' ON UPDATE ' . $column->getUpdate(); - } - - $def .= $this->getCommentDefinition($column); - - return $def; - } - - /** - * Gets the comment Definition for a Column object. - * - * @param Column $column Column - * @return string - */ - protected function getCommentDefinition(Column $column) - { - if ($column->getComment()) { - return ' /* ' . $column->getComment() . ' */ '; - } - return ''; - } - - /** - * Gets the SQLite Index Definition for an Index object. - * - * @param Index $index Index - * @return string - */ - protected function getIndexSqlDefinition(Table $table, Index $index) - { - if ($index->getType() === Index::UNIQUE) { - $def = 'UNIQUE INDEX'; - } else { - $def = 'INDEX'; - } - if (is_string($index->getName())) { - $indexName = $index->getName(); - } else { - $indexName = $table->getName() . '_'; - foreach ($index->getColumns() as $column) { - $indexName .= $column . '_'; - } - $indexName .= 'index'; - } - $def .= ' `' . $indexName . '`'; - return $def; - } - - /** - * {@inheritdoc} - */ - public function getColumnTypes() - { - return array_merge(parent::getColumnTypes(), array('enum')); - } - - /** - * Gets the SQLite Foreign Key Definition for an ForeignKey object. - * - * @param ForeignKey $foreignKey - * @return string - */ - protected function getForeignKeySqlDefinition(ForeignKey $foreignKey) - { - $def = ''; - if ($foreignKey->getConstraint()) { - $def .= ' CONSTRAINT ' . $this->quoteColumnName($foreignKey->getConstraint()); - } else { - $columnNames = array(); - foreach ($foreignKey->getColumns() as $column) { - $columnNames[] = $this->quoteColumnName($column); - } - $def .= ' FOREIGN KEY (' . implode(',', $columnNames) . ')'; - $refColumnNames = array(); - foreach ($foreignKey->getReferencedColumns() as $column) { - $refColumnNames[] = $this->quoteColumnName($column); - } - $def .= ' REFERENCES ' . $this->quoteTableName($foreignKey->getReferencedTable()->getName()) . ' (' . implode(',', $refColumnNames) . ')'; - if ($foreignKey->getOnDelete()) { - $def .= ' ON DELETE ' . $foreignKey->getOnDelete(); - } - if ($foreignKey->getOnUpdate()) { - $def .= ' ON UPDATE ' . $foreignKey->getOnUpdate(); - } - } - return $def; - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/SqlServerAdapter.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/SqlServerAdapter.php deleted file mode 100644 index 99f8a82..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/SqlServerAdapter.php +++ /dev/null @@ -1,1165 +0,0 @@ - - */ -class SqlServerAdapter extends PdoAdapter implements AdapterInterface -{ - protected $schema = 'dbo'; - - protected $signedColumnTypes = array('integer' => true, 'biginteger' => true, 'float' => true, 'decimal' => true); - - /** - * {@inheritdoc} - */ - public function connect() - { - if (null === $this->connection) { - if (!class_exists('PDO') || !in_array('sqlsrv', \PDO::getAvailableDrivers(), true)) { - // try our connection via freetds (Mac/Linux) - return $this->connectDblib(); - } - - $db = null; - $options = $this->getOptions(); - - // if port is specified use it, otherwise use the SqlServer default - if (empty($options['port'])) { - $dsn = 'sqlsrv:server=' . $options['host'] . ';database=' . $options['name']; - } else { - $dsn = 'sqlsrv:server=' . $options['host'] . ',' . $options['port'] . ';database=' . $options['name']; - } - $dsn .= ';MultipleActiveResultSets=false'; - - $driverOptions = array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION); - - // charset support - if (isset($options['charset'])) { - $driverOptions[\PDO::SQLSRV_ATTR_ENCODING] = $options['charset']; - } - - // support arbitrary \PDO::SQLSRV_ATTR_* driver options and pass them to PDO - // http://php.net/manual/en/ref.pdo-sqlsrv.php#pdo-sqlsrv.constants - foreach ($options as $key => $option) { - if (strpos($key, 'sqlsrv_attr_') === 0) { - $driverOptions[constant('\PDO::' . strtoupper($key))] = $option; - } - } - - try { - $db = new \PDO($dsn, $options['user'], $options['pass'], $driverOptions); - } catch (\PDOException $exception) { - throw new \InvalidArgumentException(sprintf( - 'There was a problem connecting to the database: %s', - $exception->getMessage() - )); - } - - $this->setConnection($db); - } - } - - /** - * Connect to MSSQL using dblib/freetds. - * - * The "sqlsrv" driver is not available on Unix machines. - * - * @throws \InvalidArgumentException - */ - protected function connectDblib() - { - if (!class_exists('PDO') || !in_array('dblib', \PDO::getAvailableDrivers(), true)) { - // @codeCoverageIgnoreStart - throw new \RuntimeException('You need to enable the PDO_Dblib extension for Phinx to run properly.'); - // @codeCoverageIgnoreEnd - } - - $options = $this->getOptions(); - - // if port is specified use it, otherwise use the SqlServer default - if (empty($options['port'])) { - $dsn = 'dblib:host=' . $options['host'] . ';dbname=' . $options['name']; - } else { - $dsn = 'dblib:host=' . $options['host'] . ':' . $options['port'] . ';dbname=' . $options['name']; - } - - $driverOptions = array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION); - - try { - $db = new \PDO($dsn, $options['user'], $options['pass'], $driverOptions); - } catch (\PDOException $exception) { - throw new \InvalidArgumentException(sprintf( - 'There was a problem connecting to the database: %s', - $exception->getMessage() - )); - } - - $this->setConnection($db); - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - $this->connection = null; - } - - /** - * {@inheritdoc} - */ - public function hasTransactions() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function beginTransaction() - { - $this->execute('BEGIN TRANSACTION'); - } - - /** - * {@inheritdoc} - */ - public function commitTransaction() - { - $this->execute('COMMIT TRANSACTION'); - } - - /** - * {@inheritdoc} - */ - public function rollbackTransaction() - { - $this->execute('ROLLBACK TRANSACTION'); - } - - /** - * {@inheritdoc} - */ - public function quoteTableName($tableName) - { - return str_replace('.', '].[', $this->quoteColumnName($tableName)); - } - - /** - * {@inheritdoc} - */ - public function quoteColumnName($columnName) - { - return '[' . str_replace(']', '\]', $columnName) . ']'; - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - $result = $this->fetchRow(sprintf('SELECT count(*) as [count] FROM information_schema.tables WHERE table_name = \'%s\';', $tableName)); - return $result['count'] > 0; - } - - /** - * {@inheritdoc} - */ - public function createTable(Table $table) - { - $this->startCommandTimer(); - - $options = $table->getOptions(); - - // Add the default primary key - $columns = $table->getPendingColumns(); - if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) { - $column = new Column(); - $column->setName('id') - ->setType('integer') - ->setIdentity(true); - - array_unshift($columns, $column); - $options['primary_key'] = 'id'; - - } elseif (isset($options['id']) && is_string($options['id'])) { - // Handle id => "field_name" to support AUTO_INCREMENT - $column = new Column(); - $column->setName($options['id']) - ->setType('integer') - ->setIdentity(true); - - array_unshift($columns, $column); - $options['primary_key'] = $options['id']; - } - - $sql = 'CREATE TABLE '; - $sql .= $this->quoteTableName($table->getName()) . ' ('; - $sqlBuffer = array(); - $columnsWithComments = array(); - foreach ($columns as $column) { - $sqlBuffer[] = $this->quoteColumnName($column->getName()) . ' ' . $this->getColumnSqlDefinition($column); - - // set column comments, if needed - if ($column->getComment()) { - $columnsWithComments[] = $column; - } - } - - // set the primary key(s) - if (isset($options['primary_key'])) { - $pkSql = sprintf('CONSTRAINT PK_%s PRIMARY KEY (', $table->getName()); - if (is_string($options['primary_key'])) { // handle primary_key => 'id' - $pkSql .= $this->quoteColumnName($options['primary_key']); - } elseif (is_array($options['primary_key'])) { // handle primary_key => array('tag_id', 'resource_id') - // PHP 5.4 will allow access of $this, so we can call quoteColumnName() directly in the anonymous function, - // but for now just hard-code the adapter quotes - $pkSql .= implode( - ',', - array_map( - function ($v) { - return '[' . $v . ']'; - }, - $options['primary_key'] - ) - ); - } - $pkSql .= ')'; - $sqlBuffer[] = $pkSql; - } - - // set the foreign keys - $foreignKeys = $table->getForeignKeys(); - if (!empty($foreignKeys)) { - foreach ($foreignKeys as $foreignKey) { - $sqlBuffer[] = $this->getForeignKeySqlDefinition($foreignKey, $table->getName()); - } - } - - $sql .= implode(', ', $sqlBuffer); - $sql .= ');'; - - // process column comments - if (!empty($columnsWithComments)) { - foreach ($columnsWithComments as $column) { - $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName()); - } - } - - // set the indexes - $indexes = $table->getIndexes(); - if (!empty($indexes)) { - foreach ($indexes as $index) { - $sql .= $this->getIndexSqlDefinition($index, $table->getName()); - } - } - - // execute the sql - $this->writeCommand('createTable', array($table->getName())); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * Gets the SqlServer Column Comment Defininition for a column object. - * - * @param Column $column Column - * @param string $tableName Table name - * - * @return string - */ - protected function getColumnCommentSqlDefinition(Column $column, $tableName) - { - // passing 'null' is to remove column comment - $currentComment = $this->getColumnComment($tableName, $column->getName()); - - $comment = (strcasecmp($column->getComment(), 'NULL') !== 0) ? $this->getConnection()->quote($column->getComment()) : '\'\''; - $command = $currentComment === false ? 'sp_addextendedproperty' : 'sp_updateextendedproperty'; - return sprintf( - "EXECUTE %s N'MS_Description', N%s, N'SCHEMA', N'%s', N'TABLE', N'%s', N'COLUMN', N'%s';", - $command, - $comment, - $this->schema, - $tableName, - $column->getName() - ); - } - - /** - * {@inheritdoc} - */ - public function renameTable($tableName, $newTableName) - { - $this->startCommandTimer(); - $this->writeCommand('renameTable', array($tableName, $newTableName)); - $this->execute(sprintf('EXEC sp_rename \'%s\', \'%s\'', $tableName, $newTableName)); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropTable($tableName) - { - $this->startCommandTimer(); - $this->writeCommand('dropTable', array($tableName)); - $this->execute(sprintf('DROP TABLE %s', $this->quoteTableName($tableName))); - $this->endCommandTimer(); - } - - public function getColumnComment($tableName, $columnName) - { - $sql = sprintf("SELECT cast(extended_properties.[value] as nvarchar(4000)) comment - FROM sys.schemas - INNER JOIN sys.tables - ON schemas.schema_id = tables.schema_id - INNER JOIN sys.columns - ON tables.object_id = columns.object_id - INNER JOIN sys.extended_properties - ON tables.object_id = extended_properties.major_id - AND columns.column_id = extended_properties.minor_id - AND extended_properties.name = 'MS_Description' - WHERE schemas.[name] = '%s' AND tables.[name] = '%s' AND columns.[name] = '%s'", $this->schema, $tableName, $columnName); - $row = $this->fetchRow($sql); - - if ($row) { - return $row['comment']; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getColumns($tableName) - { - $columns = array(); - $sql = sprintf( - "SELECT DISTINCT TABLE_SCHEMA AS [schema], TABLE_NAME as [table_name], COLUMN_NAME AS [name], DATA_TYPE AS [type], - IS_NULLABLE AS [null], COLUMN_DEFAULT AS [default], - CHARACTER_MAXIMUM_LENGTH AS [char_length], - NUMERIC_PRECISION AS [precision], - NUMERIC_SCALE AS [scale], ORDINAL_POSITION AS [ordinal_position], - COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') as [identity] - FROM INFORMATION_SCHEMA.COLUMNS - WHERE TABLE_NAME = '%s' - ORDER BY ordinal_position", - $tableName - ); - $rows = $this->fetchAll($sql); - foreach ($rows as $columnInfo) { - $column = new Column(); - $column->setName($columnInfo['name']) - ->setType($this->getPhinxType($columnInfo['type'])) - ->setNull($columnInfo['null'] !== 'NO') - ->setDefault($this->parseDefault($columnInfo['default'])) - ->setIdentity($columnInfo['identity'] === '1') - ->setComment($this->getColumnComment($columnInfo['table_name'], $columnInfo['name'])); - - if (!empty($columnInfo['char_length'])) { - $column->setLimit($columnInfo['char_length']); - } - - $columns[$columnInfo['name']] = $column; - } - - return $columns; - } - - protected function parseDefault($default) - { - $default = preg_replace(array("/\('(.*)'\)/", "/\(\((.*)\)\)/", "/\((.*)\)/"), '$1', $default); - - if (strtoupper($default) === 'NULL') { - $default = null; - } elseif (is_numeric($default)) { - $default = (int) $default; - } - - return $default; - } - - /** - * {@inheritdoc} - */ - public function hasColumn($tableName, $columnName, $options = array()) - { - $sql = sprintf( - "SELECT count(*) as [count] - FROM information_schema.columns - WHERE table_name = '%s' AND column_name = '%s'", - $tableName, - $columnName - ); - $result = $this->fetchRow($sql); - - return $result['count'] > 0; - } - - /** - * {@inheritdoc} - */ - public function addColumn(Table $table, Column $column) - { - $this->startCommandTimer(); - $sql = sprintf( - 'ALTER TABLE %s ADD %s %s', - $this->quoteTableName($table->getName()), - $this->quoteColumnName($column->getName()), - $this->getColumnSqlDefinition($column) - ); - - $this->writeCommand('addColumn', array($table->getName(), $column->getName(), $column->getType())); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function renameColumn($tableName, $columnName, $newColumnName) - { - $this->startCommandTimer(); - - if (!$this->hasColumn($tableName, $columnName)) { - throw new \InvalidArgumentException("The specified column does not exist: $columnName"); - } - $this->writeCommand('renameColumn', array($tableName, $columnName, $newColumnName)); - $this->renameDefault($tableName, $columnName, $newColumnName); - $this->execute( - sprintf( - "EXECUTE sp_rename N'%s.%s', N'%s', 'COLUMN' ", - $tableName, - $columnName, - $newColumnName - ) - ); - $this->endCommandTimer(); - } - - protected function renameDefault($tableName, $columnName, $newColumnName) - { - $oldConstraintName = "DF_{$tableName}_{$columnName}"; - $newConstraintName = "DF_{$tableName}_{$newColumnName}"; - $sql = <<execute(sprintf( - $sql, - $oldConstraintName, - $newConstraintName - )); - } - - public function changeDefault($tableName, Column $newColumn) - { - $constraintName = "DF_{$tableName}_{$newColumn->getName()}"; - $default = $newColumn->getDefault(); - - if ($default === null) { - $default = 'DEFAULT NULL'; - } else { - $default = $this->getDefaultValueDefinition($default); - } - - if (empty($default)) { - return; - } - - $this->execute(sprintf( - 'ALTER TABLE %s ADD CONSTRAINT %s %s FOR %s', - $this->quoteTableName($tableName), - $constraintName, - $default, - $this->quoteColumnName($newColumn->getName()) - )); - } - - /** - * {@inheritdoc} - */ - public function changeColumn($tableName, $columnName, Column $newColumn) - { - $this->startCommandTimer(); - $this->writeCommand('changeColumn', array($tableName, $columnName, $newColumn->getType())); - $columns = $this->getColumns($tableName); - $changeDefault = $newColumn->getDefault() !== $columns[$columnName]->getDefault() || $newColumn->getType() !== $columns[$columnName]->getType(); - if ($columnName !== $newColumn->getName()) { - $this->renameColumn($tableName, $columnName, $newColumn->getName()); - } - - if ($changeDefault) { - $this->dropDefaultConstraint($tableName, $newColumn->getName()); - } - - $this->execute( - sprintf( - 'ALTER TABLE %s ALTER COLUMN %s %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($newColumn->getName()), - $this->getColumnSqlDefinition($newColumn, false) - ) - ); - // change column comment if needed - if ($newColumn->getComment()) { - $sql = $this->getColumnCommentSqlDefinition($newColumn, $tableName); - $this->execute($sql); - } - - if ($changeDefault) { - $this->changeDefault($tableName, $newColumn); - } - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropColumn($tableName, $columnName) - { - $this->startCommandTimer(); - $this->writeCommand('dropColumn', array($tableName, $columnName)); - $this->dropDefaultConstraint($tableName, $columnName); - - $this->execute( - sprintf( - 'ALTER TABLE %s DROP COLUMN %s', - $this->quoteTableName($tableName), - $this->quoteColumnName($columnName) - ) - ); - $this->endCommandTimer(); - } - - protected function dropDefaultConstraint($tableName, $columnName) - { - $defaultConstraint = $this->getDefaultConstraint($tableName, $columnName); - - if (!$defaultConstraint) { - return; - } - - $this->dropForeignKey($tableName, $columnName, $defaultConstraint); - } - - protected function getDefaultConstraint($tableName, $columnName) - { - $sql = "SELECT - default_constraints.name -FROM - sys.all_columns - - INNER JOIN - sys.tables - ON all_columns.object_id = tables.object_id - - INNER JOIN - sys.schemas - ON tables.schema_id = schemas.schema_id - - INNER JOIN - sys.default_constraints - ON all_columns.default_object_id = default_constraints.object_id - -WHERE - schemas.name = 'dbo' - AND tables.name = '{$tableName}' - AND all_columns.name = '{$columnName}'"; - - $rows = $this->fetchAll($sql); - return empty($rows) ? false : $rows[0]['name']; - } - - protected function getIndexColums($tableId, $indexId) - { - $sql = "SELECT AC.[name] AS [column_name] -FROM sys.[index_columns] IC - INNER JOIN sys.[all_columns] AC ON IC.[column_id] = AC.[column_id] -WHERE AC.[object_id] = {$tableId} AND IC.[index_id] = {$indexId} AND IC.[object_id] = {$tableId} -ORDER BY IC.[key_ordinal];"; - - $rows = $this->fetchAll($sql); - $columns = array(); - foreach($rows as $row) { - $columns[] = strtolower($row['column_name']); - } - return $columns; - } - - /** - * Get an array of indexes from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - public function getIndexes($tableName) - { - $indexes = array(); - $sql = "SELECT I.[name] AS [index_name], I.[index_id] as [index_id], T.[object_id] as [table_id] -FROM sys.[tables] AS T - INNER JOIN sys.[indexes] I ON T.[object_id] = I.[object_id] -WHERE T.[is_ms_shipped] = 0 AND I.[type_desc] <> 'HEAP' AND T.[name] = '{$tableName}' -ORDER BY T.[name], I.[index_id];"; - - $rows = $this->fetchAll($sql); - foreach ($rows as $row) { - $columns = $this->getIndexColums($row['table_id'], $row['index_id']); - $indexes[$row['index_name']] = array('columns' => $columns); - } - - return $indexes; - } - - /** - * {@inheritdoc} - */ - public function hasIndex($tableName, $columns) - { - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $columns = array_map('strtolower', $columns); - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $index) { - $a = array_diff($columns, $index['columns']); - - if (empty($a)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function hasIndexByName($tableName, $indexName) - { - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $name => $index) { - if ($name === $indexName) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function addIndex(Table $table, Index $index) - { - $this->startCommandTimer(); - $this->writeCommand('addIndex', array($table->getName(), $index->getColumns())); - $sql = $this->getIndexSqlDefinition($index, $table->getName()); - $this->execute($sql); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropIndex($tableName, $columns) - { - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $this->writeCommand('dropIndex', array($tableName, $columns)); - $indexes = $this->getIndexes($tableName); - $columns = array_map('strtolower', $columns); - - foreach ($indexes as $indexName => $index) { - $a = array_diff($columns, $index['columns']); - if (empty($a)) { - $this->execute( - sprintf( - 'DROP INDEX %s ON %s', - $this->quoteColumnName($indexName), - $this->quoteTableName($tableName) - ) - ); - $this->endCommandTimer(); - return; - } - } - } - - /** - * {@inheritdoc} - */ - public function dropIndexByName($tableName, $indexName) - { - $this->startCommandTimer(); - - $this->writeCommand('dropIndexByName', array($tableName, $indexName)); - $indexes = $this->getIndexes($tableName); - - foreach ($indexes as $name => $index) { - if ($name === $indexName) { - $this->execute( - sprintf( - 'DROP INDEX %s ON %s', - $this->quoteColumnName($indexName), - $this->quoteTableName($tableName) - ) - ); - $this->endCommandTimer(); - return; - } - } - } - - /** - * {@inheritdoc} - */ - public function hasForeignKey($tableName, $columns, $constraint = null) - { - if (is_string($columns)) { - $columns = array($columns); // str to array - } - $foreignKeys = $this->getForeignKeys($tableName); - if ($constraint) { - if (isset($foreignKeys[$constraint])) { - return !empty($foreignKeys[$constraint]); - } - return false; - } else { - foreach ($foreignKeys as $key) { - $a = array_diff($columns, $key['columns']); - if (empty($a)) { - return true; - } - } - return false; - } - } - - /** - * Get an array of foreign keys from a particular table. - * - * @param string $tableName Table Name - * @return array - */ - protected function getForeignKeys($tableName) - { - $foreignKeys = array(); - $rows = $this->fetchAll(sprintf( - "SELECT - tc.constraint_name, - tc.table_name, kcu.column_name, - ccu.table_name AS referenced_table_name, - ccu.column_name AS referenced_column_name - FROM - information_schema.table_constraints AS tc - JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name - JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name - WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name = '%s' - ORDER BY kcu.ordinal_position", - $tableName - )); - foreach ($rows as $row) { - $foreignKeys[$row['constraint_name']]['table'] = $row['table_name']; - $foreignKeys[$row['constraint_name']]['columns'][] = $row['column_name']; - $foreignKeys[$row['constraint_name']]['referenced_table'] = $row['referenced_table_name']; - $foreignKeys[$row['constraint_name']]['referenced_columns'][] = $row['referenced_column_name']; - } - - return $foreignKeys; - } - - /** - * {@inheritdoc} - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey) - { - $this->startCommandTimer(); - $this->writeCommand('addForeignKey', array($table->getName(), $foreignKey->getColumns())); - $this->execute( - sprintf( - 'ALTER TABLE %s ADD %s', - $this->quoteTableName($table->getName()), - $this->getForeignKeySqlDefinition($foreignKey, $table->getName()) - ) - ); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function dropForeignKey($tableName, $columns, $constraint = null) - { - $this->startCommandTimer(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - - $this->writeCommand('dropForeignKey', array($tableName, $columns)); - - if ($constraint) { - $this->execute( - sprintf( - 'ALTER TABLE %s DROP CONSTRAINT %s', - $this->quoteTableName($tableName), - $constraint - ) - ); - $this->endCommandTimer(); - return; - } else { - foreach ($columns as $column) { - $rows = $this->fetchAll(sprintf( - "SELECT - tc.constraint_name, - tc.table_name, kcu.column_name, - ccu.table_name AS referenced_table_name, - ccu.column_name AS referenced_column_name - FROM - information_schema.table_constraints AS tc - JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name - JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name - WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name = '%s' and ccu.column_name='%s' - ORDER BY kcu.ordinal_position", - $tableName, - $column - )); - foreach ($rows as $row) { - $this->dropForeignKey($tableName, $columns, $row['constraint_name']); - } - } - } - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function getSqlType($type, $limit = null) - { - switch ($type) { - case static::PHINX_TYPE_STRING: - return array('name' => 'nvarchar', 'limit' => 255); - break; - case static::PHINX_TYPE_CHAR: - return array('name' => 'nchar', 'limit' => 255); - break; - case static::PHINX_TYPE_TEXT: - return array('name' => 'ntext'); - break; - case static::PHINX_TYPE_INTEGER: - return array('name' => 'int'); - break; - case static::PHINX_TYPE_BIG_INTEGER: - return array('name' => 'bigint'); - break; - case static::PHINX_TYPE_FLOAT: - return array('name' => 'float'); - break; - case static::PHINX_TYPE_DECIMAL: - return array('name' => 'decimal'); - break; - case static::PHINX_TYPE_DATETIME: - case static::PHINX_TYPE_TIMESTAMP: - return array('name' => 'datetime'); - break; - case static::PHINX_TYPE_TIME: - return array('name' => 'time'); - break; - case static::PHINX_TYPE_DATE: - return array('name' => 'date'); - break; - case static::PHINX_TYPE_BLOB: - case static::PHINX_TYPE_BINARY: - return array('name' => 'varbinary'); - break; - case static::PHINX_TYPE_BOOLEAN: - return array('name' => 'bit'); - break; - case static::PHINX_TYPE_UUID: - return array('name' => 'uniqueidentifier'); - case static::PHINX_TYPE_FILESTREAM: - return array('name' => 'varbinary', 'limit' => 'max'); - // Geospatial database types - case static::PHINX_TYPE_GEOMETRY: - case static::PHINX_TYPE_POINT: - case static::PHINX_TYPE_LINESTRING: - case static::PHINX_TYPE_POLYGON: - // SQL Server stores all spatial data using a single data type. - // Specific types (point, polygon, etc) are set at insert time. - return array('name' => 'geography'); - break; - default: - throw new \RuntimeException('The type: "' . $type . '" is not supported.'); - } - } - - /** - * Returns Phinx type by SQL type - * - * @param $sqlTypeDef - * @throws \RuntimeException - * @internal param string $sqlType SQL type - * @returns string Phinx type - */ - public function getPhinxType($sqlType) - { - switch ($sqlType) { - case 'nvarchar': - case 'varchar': - return static::PHINX_TYPE_STRING; - case 'char': - case 'nchar': - return static::PHINX_TYPE_CHAR; - case 'text': - case 'ntext': - return static::PHINX_TYPE_TEXT; - case 'int': - case 'integer': - return static::PHINX_TYPE_INTEGER; - case 'decimal': - case 'numeric': - case 'money': - return static::PHINX_TYPE_DECIMAL; - case 'bigint': - return static::PHINX_TYPE_BIG_INTEGER; - case 'real': - case 'float': - return static::PHINX_TYPE_FLOAT; - case 'binary': - case 'image': - case 'varbinary': - return static::PHINX_TYPE_BINARY; - break; - case 'time': - return static::PHINX_TYPE_TIME; - case 'date': - return static::PHINX_TYPE_DATE; - case 'datetime': - case 'timestamp': - return static::PHINX_TYPE_DATETIME; - case 'bit': - return static::PHINX_TYPE_BOOLEAN; - case 'uniqueidentifier': - return static::PHINX_TYPE_UUID; - case 'filestream': - return static::PHINX_TYPE_FILESTREAM; - default: - throw new \RuntimeException('The SqlServer type: "' . $sqlType . '" is not supported'); - } - } - - /** - * {@inheritdoc} - */ - public function createDatabase($name, $options = array()) - { - $this->startCommandTimer(); - $this->writeCommand('createDatabase', array($name)); - - if (isset($options['collation'])) { - $this->execute(sprintf('CREATE DATABASE [%s] COLLATE [%s]', $name, $options['collation'])); - } else { - $this->execute(sprintf('CREATE DATABASE [%s]', $name)); - } - $this->execute(sprintf('USE [%s]', $name)); - $this->endCommandTimer(); - } - - /** - * {@inheritdoc} - */ - public function hasDatabase($name) - { - $result = $this->fetchRow( - sprintf( - 'SELECT count(*) as [count] FROM master.dbo.sysdatabases WHERE [name] = \'%s\'', - $name - ) - ); - - return $result['count'] > 0; - } - - /** - * {@inheritdoc} - */ - public function dropDatabase($name) - { - $this->startCommandTimer(); - $this->writeCommand('dropDatabase', array($name)); - $sql = <<execute($sql); - $this->endCommandTimer(); - } - - /** - * Get the defintion for a `DEFAULT` statement. - * - * @param mixed $default - * @return string - */ - protected function getDefaultValueDefinition($default) - { - if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { - $default = $this->getConnection()->quote($default); - } elseif (is_bool($default)) { - $default = $this->castToBool($default); - } - return isset($default) ? ' DEFAULT ' . $default : ''; - } - - /** - * Gets the SqlServer Column Definition for a Column object. - * - * @param Column $column Column - * @return string - */ - protected function getColumnSqlDefinition(Column $column, $create = true) - { - $buffer = array(); - - $sqlType = $this->getSqlType($column->getType()); - $buffer[] = strtoupper($sqlType['name']); - // integers cant have limits in SQlServer - $noLimits = array( - 'bigint', - 'int', - 'tinyint' - ); - if (!in_array($sqlType['name'], $noLimits) && ($column->getLimit() || isset($sqlType['limit']))) { - $buffer[] = sprintf('(%s)', $column->getLimit() ? $column->getLimit() : $sqlType['limit']); - } - if ($column->getPrecision() && $column->getScale()) { - $buffer[] = '(' . $column->getPrecision() . ',' . $column->getScale() . ')'; - } - - $properties = $column->getProperties(); - $buffer[] = $column->getType() === 'filestream' ? 'FILESTREAM' : ''; - $buffer[] = isset($properties['rowguidcol']) ? 'ROWGUIDCOL' : ''; - - $buffer[] = $column->isNull() ? 'NULL' : 'NOT NULL'; - - if ($create === true) { - if ($column->getDefault() === null && $column->isNull()) { - $buffer[] = ' DEFAULT NULL'; - } else { - $buffer[] = $this->getDefaultValueDefinition($column->getDefault()); - } - } - - if ($column->isIdentity()) { - $buffer[] = 'IDENTITY(1, 1)'; - } - - return implode(' ', $buffer); - } - - /** - * Gets the SqlServer Index Definition for an Index object. - * - * @param Index $index Index - * @return string - */ - protected function getIndexSqlDefinition(Index $index, $tableName) - { - if (is_string($index->getName())) { - $indexName = $index->getName(); - } else { - $columnNames = $index->getColumns(); - if (is_string($columnNames)) { - $columnNames = array($columnNames); - } - $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames)); - } - $def = sprintf( - "CREATE %s INDEX %s ON %s (%s);", - ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''), - $indexName, - $this->quoteTableName($tableName), - '[' . implode('],[', $index->getColumns()) . ']' - ); - - return $def; - } - - /** - * Gets the SqlServer Foreign Key Definition for an ForeignKey object. - * - * @param ForeignKey $foreignKey - * @return string - */ - protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName) - { - $def = ' CONSTRAINT "'; - $def .= $tableName . '_' . implode('_', $foreignKey->getColumns()); - $def .= '" FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")'; - $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")'; - if ($foreignKey->getOnDelete()) { - $def .= " ON DELETE {$foreignKey->getOnDelete()}"; - } - if ($foreignKey->getOnUpdate()) { - $def .= " ON UPDATE {$foreignKey->getOnUpdate()}"; - } - - return $def; - } - - /** - * {@inheritdoc} - */ - public function getColumnTypes() - { - return array_merge(parent::getColumnTypes(), array('filestream')); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php deleted file mode 100644 index 66a850c..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php +++ /dev/null @@ -1,272 +0,0 @@ - - */ -class TablePrefixAdapter extends AdapterWrapper -{ - /** - * {@inheritdoc} - */ - public function getAdapterType() - { - return 'TablePrefixAdapter'; - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::hasTable($adapterTableName); - } - - /** - * {@inheritdoc} - */ - public function createTable(Table $table) - { - $adapterTable = clone $table; - $adapterTableName = $this->getAdapterTableName($table->getName()); - $adapterTable->setName($adapterTableName); - - foreach ($adapterTable->getForeignKeys() as $fk) { - $adapterReferenceTable = $fk->getReferencedTable(); - $adapterReferenceTableName = $this->getAdapterTableName($adapterReferenceTable->getName()); - $adapterReferenceTable->setName($adapterReferenceTableName); - } - - return parent::createTable($adapterTable); - } - - /** - * {@inheritdoc} - */ - public function renameTable($tableName, $newTableName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - $adapterNewTableName = $this->getAdapterTableName($newTableName); - return parent::renameTable($adapterTableName, $adapterNewTableName); - } - - /** - * {@inheritdoc} - */ - public function dropTable($tableName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::dropTable($adapterTableName); - } - - /** - * {@inheritdoc} - */ - public function getColumns($tableName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::getColumns($adapterTableName); - } - - /** - * {@inheritdoc} - */ - public function hasColumn($tableName, $columnName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::hasColumn($adapterTableName, $columnName); - } - - /** - * {@inheritdoc} - */ - public function addColumn(Table $table, Column $column) - { - $adapterTable = clone $table; - $adapterTableName = $this->getAdapterTableName($table->getName()); - $adapterTable->setName($adapterTableName); - return parent::addColumn($adapterTable, $column); - } - - /** - * {@inheritdoc} - */ - public function renameColumn($tableName, $columnName, $newColumnName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::renameColumn($adapterTableName, $columnName, $newColumnName); - } - - /** - * {@inheritdoc} - */ - public function changeColumn($tableName, $columnName, Column $newColumn) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::changeColumn($adapterTableName, $columnName, $newColumn); - } - - /** - * {@inheritdoc} - */ - public function dropColumn($tableName, $columnName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::dropColumn($adapterTableName, $columnName); - } - - /** - * {@inheritdoc} - */ - public function hasIndex($tableName, $columns) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::hasIndex($adapterTableName, $columns); - } - - /** - * {@inheritdoc} - */ - public function hasIndexByName($tableName, $indexName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::hasIndexByName($adapterTableName, $indexName); - } - - /** - * {@inheritdoc} - */ - public function addIndex(Table $table, Index $index) - { - $adapterTable = clone $table; - $adapterTableName = $this->getAdapterTableName($table->getName()); - $adapterTable->setName($adapterTableName); - return parent::addIndex($adapterTable, $index); - } - - /** - * {@inheritdoc} - */ - public function dropIndex($tableName, $columns, $options = array()) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::dropIndex($adapterTableName, $columns, $options); - } - - /** - * {@inheritdoc} - */ - public function dropIndexByName($tableName, $indexName) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::dropIndexByName($adapterTableName, $indexName); - } - - /** - * {@inheritdoc} - */ - public function hasForeignKey($tableName, $columns, $constraint = null) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::hasForeignKey($adapterTableName, $columns, $constraint); - } - - /** - * {@inheritdoc} - */ - public function addForeignKey(Table $table, ForeignKey $foreignKey) - { - $adapterTable = clone $table; - $adapterTableName = $this->getAdapterTableName($table->getName()); - $adapterTable->setName($adapterTableName); - return parent::addForeignKey($adapterTable, $foreignKey); - } - - /** - * {@inheritdoc} - */ - public function dropForeignKey($tableName, $columns, $constraint = null) - { - $adapterTableName = $this->getAdapterTableName($tableName); - return parent::dropForeignKey($adapterTableName, $columns, $constraint); - } - - /** - * {@inheritdoc} - */ - public function insert(Table $table, $row) - { - $adapterTable = clone $table; - $adapterTableName = $this->getAdapterTableName($table->getName()); - $adapterTable->setName($adapterTableName); - return parent::insert($adapterTable, $row); - } - - /** - * Gets the table prefix. - * - * @return string - */ - public function getPrefix() - { - return (string) $this->getOption('table_prefix'); - } - - /** - * Gets the table suffix. - * - * @return string - */ - public function getSuffix() - { - return (string) $this->getOption('table_suffix'); - } - - /** - * Applies the prefix and suffix to the table name. - * - * @param string $tableName - * @return string - */ - public function getAdapterTableName($tableName) - { - return $this->getPrefix() . $tableName . $this->getSuffix(); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/WrapperInterface.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/WrapperInterface.php deleted file mode 100644 index b8181d4..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/WrapperInterface.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ -interface WrapperInterface -{ - /** - * Class constructor, must always wrap another adapter. - * - * @param AdapterInterface $adapter - */ - public function __construct(AdapterInterface $adapter); - - /** - * Sets the database adapter to proxy commands to. - * - * @param AdapterInterface $adapter - * @return AdapterInterface - */ - public function setAdapter(AdapterInterface $adapter); - - /** - * Gets the database adapter. - * - * @throws \RuntimeException if the adapter has not been set - * @return AdapterInterface - */ - public function getAdapter(); -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table.php deleted file mode 100644 index b0e7202..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table.php +++ /dev/null @@ -1,674 +0,0 @@ -setName($name); - $this->setOptions($options); - - if (null !== $adapter) { - $this->setAdapter($adapter); - } - } - - /** - * Sets the table name. - * - * @param string $name Table Name - * @return Table - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Gets the table name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the table options. - * - * @param array $options - * @return Table - */ - public function setOptions($options) - { - $this->options = $options; - return $this; - } - - /** - * Gets the table options. - * - * @return array - */ - public function getOptions() - { - return $this->options; - } - - /** - * Sets the database adapter. - * - * @param AdapterInterface $adapter Database Adapter - * @return Table - */ - public function setAdapter(AdapterInterface $adapter) - { - $this->adapter = $adapter; - return $this; - } - - /** - * Gets the database adapter. - * - * @return AdapterInterface - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * Does the table exist? - * - * @return boolean - */ - public function exists() - { - return $this->getAdapter()->hasTable($this->getName()); - } - - /** - * Drops the database table. - * - * @return void - */ - public function drop() - { - $this->getAdapter()->dropTable($this->getName()); - } - - /** - * Renames the database table. - * - * @param string $newTableName New Table Name - * @return Table - */ - public function rename($newTableName) - { - $this->getAdapter()->renameTable($this->getName(), $newTableName); - $this->setName($newTableName); - return $this; - } - - /** - * Sets an array of columns waiting to be committed. - * Use setPendingColumns - * - * @deprecated - * @param array $columns Columns - * @return Table - */ - public function setColumns($columns) - { - $this->setPendingColumns($columns); - } - - /** - * Gets an array of the table columns. - * - * @return Column[] - */ - public function getColumns() - { - return $this->getAdapter()->getColumns($this->getName()); - } - - /** - * Sets an array of columns waiting to be committed. - * - * @param array $columns Columns - * @return Table - */ - public function setPendingColumns($columns) - { - $this->columns = $columns; - return $this; - } - - /** - * Gets an array of columns waiting to be committed. - * - * @return Column[] - */ - public function getPendingColumns() - { - return $this->columns; - } - - /** - * Sets an array of columns waiting to be indexed. - * - * @param array $indexes Indexes - * @return Table - */ - public function setIndexes($indexes) - { - $this->indexes = $indexes; - return $this; - } - - /** - * Gets an array of indexes waiting to be committed. - * - * @return array - */ - public function getIndexes() - { - return $this->indexes; - } - - /** - * Sets an array of foreign keys waiting to be commited. - * - * @param ForeignKey[] $foreignKeys foreign keys - * @return Table - */ - public function setForeignKeys($foreignKeys) - { - $this->foreignKeys = $foreignKeys; - return $this; - } - - /** - * Gets an array of foreign keys waiting to be commited. - * - * @return array|ForeignKey[] - */ - public function getForeignKeys() - { - return $this->foreignKeys; - } - - /** - * Sets an array of data to be inserted. - * - * @param array $data Data - * @return Table - */ - public function setData($data) - { - $this->data = $data; - return $this; - } - - /** - * Gets the data waiting to be inserted. - * - * @return array - */ - public function getData() - { - return $this->data; - } - - /** - * Resets all of the pending table changes. - * - * @return void - */ - public function reset() - { - $this->setPendingColumns(array()); - $this->setIndexes(array()); - $this->setForeignKeys(array()); - $this->setData(array()); - } - - /** - * Add a table column. - * - * Type can be: string, text, integer, float, decimal, datetime, timestamp, - * time, date, binary, boolean. - * - * Valid options can be: limit, default, null, precision or scale. - * - * @param string|Column $columnName Column Name - * @param string $type Column Type - * @param array $options Column Options - * @throws \RuntimeException - * @throws \InvalidArgumentException - * @return Table - */ - public function addColumn($columnName, $type = null, $options = array()) - { - // we need an adapter set to add a column - if (null === $this->getAdapter()) { - throw new \RuntimeException('An adapter must be specified to add a column.'); - } - - // create a new column object if only strings were supplied - if (!$columnName instanceof Column) { - $column = new Column(); - $column->setName($columnName); - $column->setType($type); - $column->setOptions($options); // map options to column methods - } else { - $column = $columnName; - } - - // Delegate to Adapters to check column type - if (!$this->getAdapter()->isValidColumnType($column)) { - throw new \InvalidArgumentException(sprintf( - 'An invalid column type "%s" was specified for column "%s".', - $column->getType(), - $column->getName() - )); - } - - $this->columns[] = $column; - return $this; - } - - /** - * Remove a table column. - * - * @param string $columnName Column Name - * @return Table - */ - public function removeColumn($columnName) - { - $this->getAdapter()->dropColumn($this->getName(), $columnName); - return $this; - } - - /** - * Rename a table column. - * - * @param string $oldName Old Column Name - * @param string $newName New Column Name - * @return Table - */ - public function renameColumn($oldName, $newName) - { - $this->getAdapter()->renameColumn($this->getName(), $oldName, $newName); - return $this; - } - - /** - * Change a table column type. - * - * @param string $columnName Column Name - * @param string|Column $newColumnType New Column Type - * @param array $options Options - * @return Table - */ - public function changeColumn($columnName, $newColumnType, $options = array()) - { - // create a column object if one wasn't supplied - if (!$newColumnType instanceof Column) { - $newColumn = new Column(); - $newColumn->setType($newColumnType); - $newColumn->setOptions($options); - } else { - $newColumn = $newColumnType; - } - - // if the name was omitted use the existing column name - if (null === $newColumn->getName() || strlen($newColumn->getName()) === 0) { - $newColumn->setName($columnName); - } - - $this->getAdapter()->changeColumn($this->getName(), $columnName, $newColumn); - return $this; - } - - /** - * Checks to see if a column exists. - * - * @param string $columnName Column Name - * @param array $options Options - * @return boolean - */ - public function hasColumn($columnName, $options = array()) - { - return $this->getAdapter()->hasColumn($this->getName(), $columnName, $options); - } - - /** - * Add an index to a database table. - * - * In $options you can specific unique = true/false or name (index name). - * - * @param string|array|Index $columns Table Column(s) - * @param array $options Index Options - * @return Table - */ - public function addIndex($columns, $options = array()) - { - // create a new index object if strings or an array of strings were supplied - if (!$columns instanceof Index) { - $index = new Index(); - if (is_string($columns)) { - $columns = array($columns); // str to array - } - $index->setColumns($columns); - $index->setOptions($options); - } else { - $index = $columns; - } - - $this->indexes[] = $index; - return $this; - } - - /** - * Removes the given index from a table. - * - * @param array $columns Columns - * @param array $options Options - * @return Table - */ - public function removeIndex($columns, $options = array()) - { - $this->getAdapter()->dropIndex($this->getName(), $columns, $options); - return $this; - } - - /** - * Removes the given index identified by its name from a table. - * - * @param string $name Index name - * @return Table - */ - public function removeIndexByName($name) - { - $this->getAdapter()->dropIndexByName($this->getName(), $name); - return $this; - } - - /** - * Checks to see if an index exists. - * - * @param string|array $columns Columns - * @param array $options Options - * @return boolean - */ - public function hasIndex($columns, $options = array()) - { - return $this->getAdapter()->hasIndex($this->getName(), $columns, $options); - } - - /** - * Add a foreign key to a database table. - * - * In $options you can specify on_delete|on_delete = cascade|no_action .., - * on_update, constraint = constraint name. - * - * @param string|array $columns Columns - * @param string|Table $referencedTable Referenced Table - * @param string|array $referencedColumns Referenced Columns - * @param array $options Options - * @return Table - */ - public function addForeignKey($columns, $referencedTable, $referencedColumns = array('id'), $options = array()) - { - if (is_string($referencedColumns)) { - $referencedColumns = array($referencedColumns); // str to array - } - $fk = new ForeignKey(); - if ($referencedTable instanceof Table) { - $fk->setReferencedTable($referencedTable); - } else { - $fk->setReferencedTable(new Table($referencedTable, array(), $this->adapter)); - } - $fk->setColumns($columns) - ->setReferencedColumns($referencedColumns) - ->setOptions($options); - $this->foreignKeys[] = $fk; - - return $this; - } - - /** - * Removes the given foreign key from the table. - * - * @param string|array $columns Column(s) - * @param null|string $constraint Constraint names - * @return Table - */ - public function dropForeignKey($columns, $constraint = null) - { - if (is_string($columns)) { - $columns = array($columns); - } - if ($constraint) { - $this->getAdapter()->dropForeignKey($this->getName(), array(), $constraint); - } else { - $this->getAdapter()->dropForeignKey($this->getName(), $columns); - } - - return $this; - } - - /** - * Checks to see if a foreign key exists. - * - * @param string|array $columns Column(s) - * @param null|string $constraint Constraint names - * @return boolean - */ - public function hasForeignKey($columns, $constraint = null) - { - return $this->getAdapter()->hasForeignKey($this->getName(), $columns, $constraint); - } - - /** - * Add timestamp columns created_at and updated_at to the table. - * - * @param string $createdAtColumnName - * @param string $updatedAtColumnName - * - * @return Table - */ - public function addTimestamps($createdAtColumnName = 'created_at', $updatedAtColumnName = 'updated_at') - { - $createdAtColumnName = is_null($createdAtColumnName) ? 'created_at' : $createdAtColumnName; - $updatedAtColumnName = is_null($updatedAtColumnName) ? 'updated_at' : $updatedAtColumnName; - $this->addColumn($createdAtColumnName, 'timestamp', array( - 'default' => 'CURRENT_TIMESTAMP', - 'update' => '' - )) - ->addColumn($updatedAtColumnName, 'timestamp', array( - 'null' => true, - 'default' => null - )); - - return $this; - } - - /** - * Insert data into the table. - * - * @param $data array of data in the form: - * array( - * array("col1" => "value1", "col2" => "anotherValue1"), - * array("col2" => "value2", "col2" => "anotherValue2"), - * ) - * or array("col1" => "value1", "col2" => "anotherValue1") - * - * @return Table - */ - public function insert($data) - { - // handle array of array situations - if (isset($data[0]) && is_array($data[0])) { - foreach ($data as $row) { - $this->data[] = $row; - } - return $this; - } - $this->data[] = $data; - return $this; - } - - /** - * Creates a table from the object instance. - * - * @return void - */ - public function create() - { - $this->getAdapter()->createTable($this); - $this->saveData(); - $this->reset(); // reset pending changes - } - - /** - * Updates a table from the object instance. - * - * @throws \RuntimeException - * @return void - */ - public function update() - { - if (!$this->exists()) { - throw new \RuntimeException('Cannot update a table that doesn\'t exist!'); - } - - // update table - foreach ($this->getPendingColumns() as $column) { - $this->getAdapter()->addColumn($this, $column); - } - - foreach ($this->getIndexes() as $index) { - $this->getAdapter()->addIndex($this, $index); - } - - foreach ($this->getForeignKeys() as $foreignKey) { - $this->getAdapter()->addForeignKey($this, $foreignKey); - } - - $this->saveData(); - $this->reset(); // reset pending changes - } - - /** - * Commit the pending data waiting for insertion. - * - * @return void - */ - public function saveData() - { - foreach ($this->getData() as $row) { - $this->getAdapter()->insert($this, $row); - } - } - - /** - * Commits the table changes. - * - * If the table doesn't exist it is created otherwise it is updated. - * - * @return void - */ - public function save() - { - if ($this->exists()) { - $this->update(); // update the table - } else { - $this->create(); // create the table - } - - $this->reset(); // reset pending changes - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/Column.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/Column.php deleted file mode 100644 index 874341e..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/Column.php +++ /dev/null @@ -1,550 +0,0 @@ -name = $name; - return $this; - } - - /** - * Gets the column name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the column type. - * - * @param string $type - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Gets the column type. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Sets the column limit. - * - * @param integer $limit - * @return $this - */ - public function setLimit($limit) - { - $this->limit = $limit; - return $this; - } - - /** - * Gets the column limit. - * - * @return integer - */ - public function getLimit() - { - return $this->limit; - } - - /** - * Sets whether the column allows nulls. - * - * @param boolean $null - * @return $this - */ - public function setNull($null) - { - $this->null = (bool) $null; - return $this; - } - - /** - * Gets whether the column allows nulls. - * - * @return boolean - */ - public function getNull() - { - return $this->null; - } - - /** - * Does the column allow nulls? - * - * @return boolean - */ - public function isNull() - { - return $this->getNull(); - } - - /** - * Sets the default column value. - * - * @param mixed $default - * @return $this - */ - public function setDefault($default) - { - $this->default = $default; - return $this; - } - - /** - * Gets the default column value. - * - * @return mixed - */ - public function getDefault() - { - return $this->default; - } - - /** - * Sets whether or not the column is an identity column. - * - * @param boolean $identity - * @return $this - */ - public function setIdentity($identity) - { - $this->identity = $identity; - return $this; - } - - /** - * Gets whether or not the column is an identity column. - * - * @return boolean - */ - public function getIdentity() - { - return $this->identity; - } - - /** - * Is the column an identity column? - * - * @return boolean - */ - public function isIdentity() - { - return $this->getIdentity(); - } - - /** - * Sets the name of the column to add this column after. - * - * @param string $after After - * @return $this - */ - public function setAfter($after) - { - $this->after = $after; - return $this; - } - - /** - * Returns the name of the column to add this column after. - * - * @return string - */ - public function getAfter() - { - return $this->after; - } - - /** - * Sets the 'ON UPDATE' mysql column function. - * - * @param string $update On Update function - * @return $this - */ - public function setUpdate($update) - { - $this->update = $update; - return $this; - } - - /** - * Returns the value of the ON UPDATE column function. - * - * @return string - */ - public function getUpdate() - { - return $this->update; - } - - /** - * Sets the column precision for decimal. - * - * @param integer $precision - * @return $this - */ - public function setPrecision($precision) - { - $this->precision = $precision; - return $this; - } - - /** - * Gets the column precision for decimal. - * - * @return integer - */ - public function getPrecision() - { - return $this->precision; - } - - /** - * Sets the column scale for decimal. - * - * @param integer $scale - * @return $this - */ - public function setScale($scale) - { - $this->scale = $scale; - return $this; - } - - /** - * Gets the column scale for decimal. - * - * @return integer - */ - public function getScale() - { - return $this->scale; - } - - /** - * Sets the column comment. - * - * @param string $comment - * @return $this - */ - public function setComment($comment) - { - $this->comment = $comment; - return $this; - } - - /** - * Gets the column comment. - * - * @return string - */ - public function getComment() - { - return $this->comment; - } - - /** - * Sets whether field should be signed. - * - * @param bool $signed - * @return $this - */ - public function setSigned($signed) - { - $this->signed = (bool) $signed; - return $this; - } - - /** - * Gets whether field should be signed. - * - * @return string - */ - public function getSigned() - { - return $this->signed; - } - - /** - * Should the column be signed? - * - * @return boolean - */ - public function isSigned() - { - return $this->getSigned(); - } - - /** - * Sets whether the field should have a timezone identifier. - * Used for date/time columns only! - * - * @param bool $timezone - * @return $this - */ - public function setTimezone($timezone) - { - $this->timezone = (bool) $timezone; - return $this; - } - - /** - * Gets whether field has a timezone identifier. - * - * @return boolean - */ - public function getTimezone() - { - return $this->timezone; - } - - /** - * Should the column have a timezone? - * - * @return boolean - */ - public function isTimezone() - { - return $this->getTimezone(); - } - - /** - * Sets field properties. - * - * @param array $properties - * - * @return $this - */ - public function setProperties($properties) - { - $this->properties = $properties; - return $this; - } - - /** - * Gets field properties - * - * @return array - */ - public function getProperties() - { - return $this->properties; - } - - /** - * Sets field values. - * - * @param mixed (array|string) $values - * - * @return $this - */ - public function setValues($values) - { - if (!is_array($values)) { - $values = preg_split('/,\s*/', $values); - } - $this->values = $values; - return $this; - } - - /** - * Gets field values - * - * @return string - */ - public function getValues() - { - return $this->values; - } - - /** - * Gets all allowed options. Each option must have a corresponding `setFoo` method. - * - * @return array - */ - protected function getValidOptions() - { - return array( - 'limit', - 'default', - 'null', - 'identity', - 'precision', - 'scale', - 'after', - 'update', - 'comment', - 'signed', - 'timezone', - 'properties', - 'values', - ); - } - - /** - * Gets all aliased options. Each alias must reference a valid option. - * - * @return array - */ - protected function getAliasedOptions() - { - return array( - 'length' => 'limit', - ); - } - - /** - * Utility method that maps an array of column options to this objects methods. - * - * @param array $options Options - * @return $this - */ - public function setOptions($options) - { - $validOptions = $this->getValidOptions(); - $aliasOptions = $this->getAliasedOptions(); - - foreach ($options as $option => $value) { - if (isset($aliasOptions[$option])) { - // proxy alias -> option - $option = $aliasOptions[$option]; - } - - if (!in_array($option, $validOptions, true)) { - throw new \RuntimeException(sprintf('"%s" is not a valid column option.', $option)); - } - - $method = 'set' . ucfirst($option); - $this->$method($value); - } - return $this; - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/ForeignKey.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/ForeignKey.php deleted file mode 100644 index 3033503..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/ForeignKey.php +++ /dev/null @@ -1,252 +0,0 @@ - - */ -namespace Phinx\Db\Table; - -use Phinx\Db\Table; - -class ForeignKey -{ - const CASCADE = 'CASCADE'; - const RESTRICT = 'RESTRICT'; - const SET_NULL = 'SET NULL'; - const NO_ACTION = 'NO ACTION'; - - /** - * @var array - */ - protected $columns = array(); - - /** - * @var Table - */ - protected $referencedTable; - - /** - * @var array - */ - protected $referencedColumns = array(); - - /** - * @var string - */ - protected $onDelete; - - /** - * @var string - */ - protected $onUpdate; - - /** - * @var string|boolean - */ - protected $constraint; - - /** - * Sets the foreign key columns. - * - * @param array|string $columns - * @return ForeignKey - */ - public function setColumns($columns) - { - if (is_string($columns)) { - $columns = array($columns); - } - $this->columns = $columns; - return $this; - } - - /** - * Gets the foreign key columns. - * - * @return array - */ - public function getColumns() - { - return $this->columns; - } - - /** - * Sets the foreign key referenced table. - * - * @param Table $table - * @return ForeignKey - */ - public function setReferencedTable(Table $table) - { - $this->referencedTable = $table; - return $this; - } - - /** - * Gets the foreign key referenced table. - * - * @return Table - */ - public function getReferencedTable() - { - return $this->referencedTable; - } - - /** - * Sets the foreign key referenced columns. - * - * @param array $referencedColumns - * @return ForeignKey - */ - public function setReferencedColumns(array $referencedColumns) - { - $this->referencedColumns = $referencedColumns; - return $this; - } - - /** - * Gets the foreign key referenced columns. - * - * @return array - */ - public function getReferencedColumns() - { - return $this->referencedColumns; - } - - /** - * Sets ON DELETE action for the foreign key. - * - * @param string $onDelete - * @return ForeignKey - */ - public function setOnDelete($onDelete) - { - $this->onDelete = $this->normalizeAction($onDelete); - return $this; - } - - /** - * Gets ON DELETE action for the foreign key. - * - * @return string - */ - public function getOnDelete() - { - return $this->onDelete; - } - - /** - * Gets ON UPDATE action for the foreign key. - * - * @return string - */ - public function getOnUpdate() - { - return $this->onUpdate; - } - - /** - * Sets ON UPDATE action for the foreign key. - * - * @param string $onUpdate - * @return ForeignKey - */ - public function setOnUpdate($onUpdate) - { - $this->onUpdate = $this->normalizeAction($onUpdate); - return $this; - } - - /** - * Sets constraint for the foreign key. - * - * @param string $constraint - * @return ForeignKey - */ - public function setConstraint($constraint) - { - $this->constraint = $constraint; - return $this; - } - - /** - * Gets constraint name for the foreign key. - * - * @return string - */ - public function getConstraint() - { - return $this->constraint; - } - - /** - * Utility method that maps an array of index options to this objects methods. - * - * @param array $options Options - * @throws \RuntimeException - * @throws \InvalidArgumentException - * @return ForeignKey - */ - public function setOptions($options) - { - // Valid Options - $validOptions = array('delete', 'update', 'constraint'); - foreach ($options as $option => $value) { - if (!in_array($option, $validOptions, true)) { - throw new \RuntimeException(sprintf('"%s" is not a valid foreign key option.', $option)); - } - - // handle $options['delete'] as $options['update'] - if ('delete' === $option) { - $this->setOnDelete($value); - } elseif ('update' === $option) { - $this->setOnUpdate($value); - } else { - $method = 'set' . ucfirst($option); - $this->$method($value); - } - } - - return $this; - } - - /** - * From passed value checks if it's correct and fixes if needed - * - * @param string $action - * @throws \InvalidArgumentException - * @return string - */ - protected function normalizeAction($action) - { - $constantName = 'static::' . str_replace(' ', '_', strtoupper(trim($action))); - if (!defined($constantName)) { - throw new \InvalidArgumentException('Unknown action passed: ' . $action); - } - return constant($constantName); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/Index.php b/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/Index.php deleted file mode 100644 index 82404cb..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Db/Table/Index.php +++ /dev/null @@ -1,185 +0,0 @@ -columns = $columns; - return $this; - } - - /** - * Gets the index columns. - * - * @return array - */ - public function getColumns() - { - return $this->columns; - } - - /** - * Sets the index type. - * - * @param string $type - * @return Index - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Gets the index type. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Sets the index name. - * - * @param string $name - * @return Index - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Gets the index name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the index limit. - * - * @param integer $limit - * @return Index - */ - public function setLimit($limit) - { - $this->limit = $limit; - return $this; - } - - /** - * Gets the index limit. - * - * @return integer - */ - public function getLimit() - { - return $this->limit; - } - - /** - * Utility method that maps an array of index options to this objects methods. - * - * @param array $options Options - * @throws \RuntimeException - * @return Index - */ - public function setOptions($options) - { - // Valid Options - $validOptions = array('type', 'unique', 'name', 'limit'); - foreach ($options as $option => $value) { - if (!in_array($option, $validOptions, true)) { - throw new \RuntimeException(sprintf('"%s" is not a valid index option.', $option)); - } - - // handle $options['unique'] - if (strcasecmp($option, self::UNIQUE) === 0) { - if ((bool) $value) { - $this->setType(self::UNIQUE); - } - continue; - } - - $method = 'set' . ucfirst($option); - $this->$method($value); - } - return $this; - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/AbstractMigration.php b/vendor/topthink/think-migration/phinx/src/Phinx/Migration/AbstractMigration.php deleted file mode 100644 index 1598cfb..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/AbstractMigration.php +++ /dev/null @@ -1,273 +0,0 @@ - - */ -abstract class AbstractMigration implements MigrationInterface -{ - /** - * @var float - */ - protected $version; - - /** - * @var AdapterInterface - */ - protected $adapter; - - /** - * @var OutputInterface - */ - protected $output; - - /** - * @var InputInterface - */ - protected $input; - - /** - * Class Constructor. - * - * @param int $version Migration Version - * @param InputInterface|null $input - * @param OutputInterface|null $output - */ - final public function __construct($version, InputInterface $input = null, OutputInterface $output = null) - { - $this->version = $version; - if (!is_null($input)){ - $this->setInput($input); - } - if (!is_null($output)){ - $this->setOutput($output); - } - - $this->init(); - } - - /** - * Initialize method. - * - * @return void - */ - protected function init() - { - } - - /** - * {@inheritdoc} - */ - public function up() - { - } - - /** - * {@inheritdoc} - */ - public function down() - { - } - - /** - * {@inheritdoc} - */ - public function setAdapter(AdapterInterface $adapter) - { - $this->adapter = $adapter; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getInput() - { - return $this->input; - } - - /** - * {@inheritdoc} - */ - public function setOutput(OutputInterface $output) - { - $this->output = $output; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOutput() - { - return $this->output; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return get_class($this); - } - - /** - * {@inheritdoc} - */ - public function setVersion($version) - { - $this->version = $version; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getVersion() - { - return $this->version; - } - - /** - * {@inheritdoc} - */ - public function execute($sql) - { - return $this->getAdapter()->execute($sql); - } - - /** - * {@inheritdoc} - */ - public function query($sql) - { - return $this->getAdapter()->query($sql); - } - - /** - * {@inheritdoc} - */ - public function fetchRow($sql) - { - return $this->getAdapter()->fetchRow($sql); - } - - /** - * {@inheritdoc} - */ - public function fetchAll($sql) - { - return $this->getAdapter()->fetchAll($sql); - } - - /** - * {@inheritdoc} - */ - public function insert($table, $data) - { - // convert to table object - if (is_string($table)) { - $table = new Table($table, array(), $this->getAdapter()); - } - return $table->insert($data)->save(); - } - - /** - * {@inheritdoc} - */ - public function createDatabase($name, $options) - { - $this->getAdapter()->createDatabase($name, $options); - } - - /** - * {@inheritdoc} - */ - public function dropDatabase($name) - { - $this->getAdapter()->dropDatabase($name); - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - return $this->getAdapter()->hasTable($tableName); - } - - /** - * {@inheritdoc} - */ - public function table($tableName, $options = array()) - { - return new Table($tableName, $options, $this->getAdapter()); - } - - /** - * A short-hand method to drop the given database table. - * - * @param string $tableName Table Name - * @return void - */ - public function dropTable($tableName) - { - $this->table($tableName)->drop(); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/AbstractTemplateCreation.php b/vendor/topthink/think-migration/phinx/src/Phinx/Migration/AbstractTemplateCreation.php deleted file mode 100644 index 589a5f7..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/AbstractTemplateCreation.php +++ /dev/null @@ -1,97 +0,0 @@ -setInput($input); - } - if (!is_null($output)) { - $this->setOutput($output); - } - } - - /** - * {@inheritdoc} - */ - public function getInput() - { - return $this->input; - } - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOutput() - { - return $this->output; - } - - /** - * {@inheritdoc} - */ - public function setOutput(OutputInterface $output) - { - $this->output = $output; - - return $this; - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/CreationInterface.php b/vendor/topthink/think-migration/phinx/src/Phinx/Migration/CreationInterface.php deleted file mode 100644 index b60c889..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/CreationInterface.php +++ /dev/null @@ -1,94 +0,0 @@ - - */ -interface CreationInterface -{ - /** - * CreationInterface constructor. - * - * @param InputInterface|null $input - * @param OutputInterface|null $output - */ - public function __construct(InputInterface $input = null, OutputInterface $output = null); - - /** - * @param InputInterface $input - * - * @return CreationInterface - */ - public function setInput(InputInterface $input); - - /** - * @param OutputInterface $output - * - * @return CreationInterface - */ - public function setOutput(OutputInterface $output); - - /** - * @return InputInterface - */ - public function getInput(); - - /** - * @return OutputInterface - */ - public function getOutput(); - - /** - * Get the migration template. - * - * This will be the content that Phinx will amend to generate the migration file. - * - * @return string The content of the template for Phinx to amend. - */ - public function getMigrationTemplate(); - - /** - * Post Migration Creation. - * - * Once the migration file has been created, this method will be called, allowing any additional - * processing, specific to the template to be performed. - * - * @param string $migrationFilename The name of the newly created migration. - * @param string $className The class name. - * @param string $baseClassName The name of the base class. - * @return void - */ - public function postMigrationCreation($migrationFilename, $className, $baseClassName); -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/IrreversibleMigrationException.php b/vendor/topthink/think-migration/phinx/src/Phinx/Migration/IrreversibleMigrationException.php deleted file mode 100644 index 9c2a8d2..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/IrreversibleMigrationException.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class IrreversibleMigrationException extends \Exception -{ -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/Migration.template.php.dist b/vendor/topthink/think-migration/phinx/src/Phinx/Migration/Migration.template.php.dist deleted file mode 100644 index 80ac0c1..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Migration/Migration.template.php.dist +++ /dev/null @@ -1,32 +0,0 @@ - - */ -interface MigrationInterface -{ - /** - * @var string - */ - const CHANGE = 'change'; - - /** - * @var string - */ - const UP = 'up'; - - /** - * @var string - */ - const DOWN = 'down'; - - /** - * Migrate Up - * - * @return void - */ - public function up(); - - /** - * Migrate Down - * - * @return void - */ - public function down(); - - /** - * Sets the database adapter. - * - * @param AdapterInterface $adapter Database Adapter - * @return MigrationInterface - */ - public function setAdapter(AdapterInterface $adapter); - - /** - * Gets the database adapter. - * - * @return AdapterInterface - */ - public function getAdapter(); - - /** - * Sets the input object to be used in migration object - * - * @param InputInterface $input - * @return MigrationInterface - */ - public function setInput(InputInterface $input); - - /** - * Gets the input object to be used in migration object - * - * @return InputInterface - */ - public function getInput(); - - /** - * Sets the output object to be used in migration object - * - * @param OutputInterface $output - * @return MigrationInterface - */ - public function setOutput(OutputInterface $output); - - /** - * Gets the output object to be used in migration object - * - * @return OutputInterface - */ - public function getOutput(); - - /** - * Gets the name. - * - * @return string - */ - public function getName(); - - /** - * Sets the migration version number. - * - * @param float $version Version - * @return MigrationInterface - */ - public function setVersion($version); - - /** - * Gets the migration version number. - * - * @return float - */ - public function getVersion(); - - /** - * Executes a SQL statement and returns the number of affected rows. - * - * @param string $sql SQL - * @return int - */ - public function execute($sql); - - /** - * Executes a SQL statement and returns the result as an array. - * - * @param string $sql SQL - * @return array - */ - public function query($sql); - - /** - * Executes a query and returns only one row as an array. - * - * @param string $sql SQL - * @return array - */ - public function fetchRow($sql); - - /** - * Executes a query and returns an array of rows. - * - * @param string $sql SQL - * @return array - */ - public function fetchAll($sql); - - /** - * Insert data into a table. - * - * @param string $tableName - * @param array $data - * @return void - */ - public function insert($tableName, $data); - - /** - * Create a new database. - * - * @param string $name Database Name - * @param array $options Options - * @return void - */ - public function createDatabase($name, $options); - - /** - * Drop a database. - * - * @param string $name Database Name - * @return void - */ - public function dropDatabase($name); - - /** - * Checks to see if a table exists. - * - * @param string $tableName Table Name - * @return boolean - */ - public function hasTable($tableName); - - /** - * Returns an instance of the \Table class. - * - * You can use this class to create and manipulate tables. - * - * @param string $tableName Table Name - * @param array $options Options - * @return Table - */ - public function table($tableName, $options); -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Seed/AbstractSeed.php b/vendor/topthink/think-migration/phinx/src/Phinx/Seed/AbstractSeed.php deleted file mode 100644 index 4d631f5..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Seed/AbstractSeed.php +++ /dev/null @@ -1,215 +0,0 @@ - - */ -abstract class AbstractSeed implements SeedInterface -{ - /** - * @var AdapterInterface - */ - protected $adapter; - - /** - * @var InputInterface - */ - protected $input; - - /** - * @var OutputInterface - */ - protected $output; - - /** - * Class Constructor. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - final public function __construct(InputInterface $input = null, OutputInterface $output = null) - { - if (!is_null($input)){ - $this->setInput($input); - } - if (!is_null($output)){ - $this->setOutput($output); - } - - $this->init(); - } - - /** - * Initialize method. - * - * @return void - */ - protected function init() - { - } - - /** - * {@inheritdoc} - */ - public function run() - { - } - - /** - * {@inheritdoc} - */ - public function setAdapter(AdapterInterface $adapter) - { - $this->adapter = $adapter; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getInput() - { - return $this->input; - } - - /** - * {@inheritdoc} - */ - public function setOutput(OutputInterface $output) - { - $this->output = $output; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOutput() - { - return $this->output; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return get_class($this); - } - - /** - * {@inheritdoc} - */ - public function execute($sql) - { - return $this->getAdapter()->execute($sql); - } - - /** - * {@inheritdoc} - */ - public function query($sql) - { - return $this->getAdapter()->query($sql); - } - - /** - * {@inheritdoc} - */ - public function fetchRow($sql) - { - return $this->getAdapter()->fetchRow($sql); - } - - /** - * {@inheritdoc} - */ - public function fetchAll($sql) - { - return $this->getAdapter()->fetchAll($sql); - } - - /** - * {@inheritdoc} - */ - public function insert($table, $data) - { - // convert to table object - if (is_string($table)) { - $table = new Table($table, array(), $this->getAdapter()); - } - return $table->insert($data)->save(); - } - - /** - * {@inheritdoc} - */ - public function hasTable($tableName) - { - return $this->getAdapter()->hasTable($tableName); - } - - /** - * {@inheritdoc} - */ - public function table($tableName, $options = array()) - { - return new Table($tableName, $options, $this->getAdapter()); - } -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Seed/Seed.template.php.dist b/vendor/topthink/think-migration/phinx/src/Phinx/Seed/Seed.template.php.dist deleted file mode 100644 index 698ae26..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Seed/Seed.template.php.dist +++ /dev/null @@ -1,19 +0,0 @@ - - */ -interface SeedInterface -{ - /** - * @var string - */ - const RUN = 'run'; - - /** - * Run the seeder. - * - * @return void - */ - public function run(); - - /** - * Sets the database adapter. - * - * @param AdapterInterface $adapter Database Adapter - * @return MigrationInterface - */ - public function setAdapter(AdapterInterface $adapter); - - /** - * Gets the database adapter. - * - * @return AdapterInterface - */ - public function getAdapter(); - - /** - * Sets the input object to be used in migration object - * - * @param InputInterface $input - * @return MigrationInterface - */ - public function setInput(InputInterface $input); - - /** - * Gets the input object to be used in migration object - * - * @return InputInterface - */ - public function getInput(); - - /** - * Sets the output object to be used in migration object - * - * @param OutputInterface $output - * @return MigrationInterface - */ - public function setOutput(OutputInterface $output); - - /** - * Gets the output object to be used in migration object - * - * @return OutputInterface - */ - public function getOutput(); - - /** - * Gets the name. - * - * @return string - */ - public function getName(); - - /** - * Executes a SQL statement and returns the number of affected rows. - * - * @param string $sql SQL - * @return int - */ - public function execute($sql); - - /** - * Executes a SQL statement and returns the result as an array. - * - * @param string $sql SQL - * @return array - */ - public function query($sql); - - /** - * Executes a query and returns only one row as an array. - * - * @param string $sql SQL - * @return array - */ - public function fetchRow($sql); - - /** - * Executes a query and returns an array of rows. - * - * @param string $sql SQL - * @return array - */ - public function fetchAll($sql); - - /** - * Insert data into a table. - * - * @param string $tableName - * @param array $data - * @return void - */ - public function insert($tableName, $data); - - /** - * Checks to see if a table exists. - * - * @param string $tableName Table Name - * @return boolean - */ - public function hasTable($tableName); - - /** - * Returns an instance of the \Table class. - * - * You can use this class to create and manipulate tables. - * - * @param string $tableName Table Name - * @param array $options Options - * @return Table - */ - public function table($tableName, $options); -} diff --git a/vendor/topthink/think-migration/phinx/src/Phinx/Util/Util.php b/vendor/topthink/think-migration/phinx/src/Phinx/Util/Util.php deleted file mode 100644 index 9b8edf2..0000000 --- a/vendor/topthink/think-migration/phinx/src/Phinx/Util/Util.php +++ /dev/null @@ -1,190 +0,0 @@ -format(static::DATE_FORMAT); - } - - /** - * Gets an array of all the existing migration class names. - * - * @return string - */ - public static function getExistingMigrationClassNames($path) - { - $classNames = array(); - - if (!is_dir($path)) { - return $classNames; - } - - // filter the files to only get the ones that match our naming scheme - $phpFiles = glob($path . DIRECTORY_SEPARATOR . '*.php'); - - foreach ($phpFiles as $filePath) { - if (preg_match('/([0-9]+)_([_a-z0-9]*).php/', basename($filePath))) { - $classNames[] = static::mapFileNameToClassName(basename($filePath)); - } - } - - return $classNames; - } - - /** - * Get the version from the beginning of a file name. - * - * @param string $fileName File Name - * @return string - */ - public static function getVersionFromFileName($fileName) - { - $matches = array(); - preg_match('/^[0-9]+/', basename($fileName), $matches); - return $matches[0]; - } - - /** - * Turn migration names like 'CreateUserTable' into file names like - * '12345678901234_create_user_table.php' or 'LimitResourceNamesTo30Chars' into - * '12345678901234_limit_resource_names_to_30_chars.php'. - * - * @param string $className Class Name - * @return string - */ - public static function mapClassNameToFileName($className) - { - $arr = preg_split('/(?=[A-Z])/', $className); - unset($arr[0]); // remove the first element ('') - $fileName = static::getCurrentTimestamp() . '_' . strtolower(implode('_', $arr)) . '.php'; - return $fileName; - } - - /** - * Turn file names like '12345678901234_create_user_table.php' into class - * names like 'CreateUserTable'. - * - * @param string $fileName File Name - * @return string - */ - public static function mapFileNameToClassName($fileName) - { - $matches = array(); - if (preg_match(static::MIGRATION_FILE_NAME_PATTERN, $fileName, $matches)) { - $fileName = $matches[1]; - } - - return str_replace(' ', '', ucwords(str_replace('_', ' ', $fileName))); - } - - /** - * Check if a migration class name is unique regardless of the - * timestamp. - * - * This method takes a class name and a path to a migrations directory. - * - * Migration class names must be in CamelCase format. - * e.g: CreateUserTable or AddIndexToPostsTable. - * - * Single words are not allowed on their own. - * - * @param string $className Class Name - * @param string $path Path - * @return boolean - */ - public static function isUniqueMigrationClassName($className, $path) - { - $existingClassNames = static::getExistingMigrationClassNames($path); - return !(in_array($className, $existingClassNames)); - } - - /** - * Check if a migration/seed class name is valid. - * - * Migration & Seed class names must be in CamelCase format. - * e.g: CreateUserTable, AddIndexToPostsTable or UserSeeder. - * - * Single words are not allowed on their own. - * - * @param string $className Class Name - * @return boolean - */ - public static function isValidPhinxClassName($className) - { - return (bool) preg_match('/^([A-Z][a-z0-9]+)+$/', $className); - } - - /** - * Check if a migration file name is valid. - * - * @param string $fileName File Name - * @return boolean - */ - public static function isValidMigrationFileName($fileName) - { - $matches = array(); - return preg_match(static::MIGRATION_FILE_NAME_PATTERN, $fileName, $matches); - } - - /** - * Check if a seed file name is valid. - * - * @param string $fileName File Name - * @return boolean - */ - public static function isValidSeedFileName($fileName) - { - $matches = array(); - return preg_match(static::SEED_FILE_NAME_PATTERN, $fileName, $matches); - } -} diff --git a/vendor/topthink/think-migration/src/Command.php b/vendor/topthink/think-migration/src/Command.php deleted file mode 100644 index b4db21f..0000000 --- a/vendor/topthink/think-migration/src/Command.php +++ /dev/null @@ -1,89 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\migration; - -use InvalidArgumentException; -use Phinx\Db\Adapter\AdapterFactory; - -abstract class Command extends \think\console\Command -{ - - public function getAdapter() - { - if (isset($this->adapter)) { - return $this->adapter; - } - - $options = $this->getDbConfig(); - - $adapter = AdapterFactory::instance()->getAdapter($options['adapter'], $options); - - if ($adapter->hasOption('table_prefix') || $adapter->hasOption('table_suffix')) { - $adapter = AdapterFactory::instance()->getWrapper('prefix', $adapter); - } - - $this->adapter = $adapter; - - return $adapter; - } - - /** - * 获取数据库配置 - * @return array - */ - protected function getDbConfig(): array - { - $default = $this->app->config->get('database.default'); - - $config = $this->app->config->get("database.connections.{$default}"); - - if (0 == $config['deploy']) { - $dbConfig = [ - 'adapter' => $config['type'], - 'host' => $config['hostname'], - 'name' => $config['database'], - 'user' => $config['username'], - 'pass' => $config['password'], - 'port' => $config['hostport'], - 'charset' => $config['charset'], - 'table_prefix' => $config['prefix'], - ]; - } else { - $dbConfig = [ - 'adapter' => explode(',', $config['type'])[0], - 'host' => explode(',', $config['hostname'])[0], - 'name' => explode(',', $config['database'])[0], - 'user' => explode(',', $config['username'])[0], - 'pass' => explode(',', $config['password'])[0], - 'port' => explode(',', $config['hostport'])[0], - 'charset' => explode(',', $config['charset'])[0], - 'table_prefix' => explode(',', $config['prefix'])[0], - ]; - } - - $table = $this->app->config->get('database.migration_table', 'migrations'); - - $dbConfig['default_migration_table'] = $dbConfig['table_prefix'] . $table; - - return $dbConfig; - } - - protected function verifyMigrationDirectory(string $path) - { - if (!is_dir($path)) { - throw new InvalidArgumentException(sprintf('Migration directory "%s" does not exist', $path)); - } - - if (!is_writable($path)) { - throw new InvalidArgumentException(sprintf('Migration directory "%s" is not writable', $path)); - } - } -} diff --git a/vendor/topthink/think-migration/src/Creator.php b/vendor/topthink/think-migration/src/Creator.php deleted file mode 100644 index f4bc804..0000000 --- a/vendor/topthink/think-migration/src/Creator.php +++ /dev/null @@ -1,77 +0,0 @@ -app = $app; - } - - public function create(string $className) - { - $path = $this->ensureDirectory(); - - if (!Util::isValidPhinxClassName($className)) { - throw new InvalidArgumentException(sprintf('The migration class name "%s" is invalid. Please use CamelCase format.', $className)); - } - - if (!Util::isUniqueMigrationClassName($className, $path)) { - throw new InvalidArgumentException(sprintf('The migration class name "%s" already exists', $className)); - } - - // Compute the file path - $fileName = Util::mapClassNameToFileName($className); - $filePath = $path . DIRECTORY_SEPARATOR . $fileName; - - if (is_file($filePath)) { - throw new InvalidArgumentException(sprintf('The file "%s" already exists', $filePath)); - } - - // Verify that the template creation class (or the aliased class) exists and that it implements the required interface. - $aliasedClassName = null; - - // Load the alternative template if it is defined. - $contents = file_get_contents($this->getTemplate()); - - // inject the class names appropriate to this migration - $contents = strtr($contents, [ - 'MigratorClass' => $className, - ]); - - if (false === file_put_contents($filePath, $contents)) { - throw new RuntimeException(sprintf('The file "%s" could not be written to', $path)); - } - - return $filePath; - } - - protected function ensureDirectory() - { - $path = $this->app->getRootPath() . 'database' . DIRECTORY_SEPARATOR . 'migrations'; - - if (!is_dir($path) && !mkdir($path, 0755, true)) { - throw new InvalidArgumentException(sprintf('directory "%s" does not exist', $path)); - } - - if (!is_writable($path)) { - throw new InvalidArgumentException(sprintf('directory "%s" is not writable', $path)); - } - - return $path; - } - - protected function getTemplate() - { - return __DIR__ . '/command/stubs/migrate.stub'; - } -} diff --git a/vendor/topthink/think-migration/src/Factory.php b/vendor/topthink/think-migration/src/Factory.php deleted file mode 100644 index 976a999..0000000 --- a/vendor/topthink/think-migration/src/Factory.php +++ /dev/null @@ -1,313 +0,0 @@ -faker = $faker; - } - - /** - * Define a class with a given short-name. - * - * @param string $class - * @param string $name - * @param callable $attributes - * @return $this - */ - public function defineAs(string $class, string $name, callable $attributes) - { - return $this->define($class, $attributes, $name); - } - - /** - * Define a class with a given set of attributes. - * - * @param string $class - * @param callable $attributes - * @param string $name - * @return $this - */ - public function define(string $class, callable $attributes, string $name = 'default') - { - $this->definitions[$class][$name] = $attributes; - - return $this; - } - - /** - * Define a state with a given set of attributes. - * - * @param string $class - * @param string $state - * @param callable|array $attributes - * @return $this - */ - public function state(string $class, string $state, $attributes) - { - $this->states[$class][$state] = $attributes; - - return $this; - } - - /** - * Define a callback to run after making a model. - * - * @param string $class - * @param callable $callback - * @param string $name - * @return $this - */ - public function afterMaking(string $class, callable $callback, string $name = 'default') - { - $this->afterMaking[$class][$name][] = $callback; - - return $this; - } - - /** - * Define a callback to run after making a model with given state. - * - * @param string $class - * @param string $state - * @param callable $callback - * @return $this - */ - public function afterMakingState(string $class, string $state, callable $callback) - { - return $this->afterMaking($class, $callback, $state); - } - - /** - * Define a callback to run after creating a model. - * - * @param string $class - * @param callable $callback - * @param string $name - * @return $this - */ - public function afterCreating(string $class, callable $callback, string $name = 'default') - { - $this->afterCreating[$class][$name][] = $callback; - - return $this; - } - - /** - * Define a callback to run after creating a model with given state. - * - * @param string $class - * @param string $state - * @param callable $callback - * @return $this - */ - public function afterCreatingState(string $class, string $state, callable $callback) - { - return $this->afterCreating($class, $callback, $state); - } - - /** - * Create an instance of the given model and persist it to the database. - * - * @param string $class - * @param array $attributes - * @return mixed - */ - public function create(string $class, array $attributes = []) - { - return $this->of($class)->create($attributes); - } - - /** - * Create an instance of the given model and type and persist it to the database. - * - * @param string $class - * @param string $name - * @param array $attributes - * @return mixed - */ - public function createAs(string $class, string $name, array $attributes = []) - { - return $this->of($class, $name)->create($attributes); - } - - /** - * Create an instance of the given model. - * - * @param string $class - * @param array $attributes - * @return mixed - */ - public function make(string $class, array $attributes = []) - { - return $this->of($class)->make($attributes); - } - - /** - * Create an instance of the given model and type. - * - * @param string $class - * @param string $name - * @param array $attributes - * @return mixed - */ - public function makeAs(string $class, string $name, array $attributes = []) - { - return $this->of($class, $name)->make($attributes); - } - - /** - * Get the raw attribute array for a given named model. - * - * @param string $class - * @param string $name - * @param array $attributes - * @return array - */ - public function rawOf(string $class, string $name, array $attributes = []) - { - return $this->raw($class, $attributes, $name); - } - - /** - * Get the raw attribute array for a given model. - * - * @param string $class - * @param array $attributes - * @param string $name - * @return array - */ - public function raw(string $class, array $attributes = [], string $name = 'default') - { - return array_merge( - call_user_func($this->definitions[$class][$name], $this->faker), $attributes - ); - } - - /** - * Create a builder for the given model. - * - * @param string $class - * @param string $name - * @return FactoryBuilder - */ - public function of(string $class, string $name = 'default') - { - return new FactoryBuilder( - $class, $name, $this->definitions, $this->states, - $this->afterMaking, $this->afterCreating, $this->faker - ); - } - - /** - * Load factories from path. - * - * @param string $path - * @return $this - */ - public function load(string $path) - { - $factory = $this; - - if (is_dir($path)) { - foreach (glob($path . '*.php') as $file) { - require $file; - } - } - - return $factory; - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->definitions[$offset]); - } - - /** - * Get the value of the given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset) - { - return $this->make($offset); - } - - /** - * Set the given offset to the given value. - * - * @param string $offset - * @param callable $value - * @return void - */ - public function offsetSet($offset, $value) - { - $this->define($offset, $value); - } - - /** - * Unset the value at the given offset. - * - * @param string $offset - * @return void - */ - public function offsetUnset($offset) - { - unset($this->definitions[$offset]); - } - -} diff --git a/vendor/topthink/think-migration/src/FactoryBuilder.php b/vendor/topthink/think-migration/src/FactoryBuilder.php deleted file mode 100644 index d192ba1..0000000 --- a/vendor/topthink/think-migration/src/FactoryBuilder.php +++ /dev/null @@ -1,434 +0,0 @@ -name = $name; - $this->class = $class; - $this->faker = $faker; - $this->states = $states; - $this->definitions = $definitions; - $this->afterMaking = $afterMaking; - $this->afterCreating = $afterCreating; - } - - /** - * Set the amount of models you wish to create / make. - * - * @param int $amount - * @return $this - */ - public function times($amount) - { - $this->amount = $amount; - - return $this; - } - - /** - * Set the state to be applied to the model. - * - * @param string $state - * @return $this - */ - public function state($state) - { - return $this->states([$state]); - } - - /** - * Set the states to be applied to the model. - * - * @param array|mixed $states - * @return $this - */ - public function states($states) - { - $this->activeStates = is_array($states) ? $states : func_get_args(); - - return $this; - } - - /** - * Set the database connection on which the model instance should be persisted. - * - * @param string $name - * @return $this - */ - public function connection($name) - { - $this->connection = $name; - - return $this; - } - - /** - * Create a model and persist it in the database if requested. - * - * @param array $attributes - * @return \Closure - */ - public function lazy(array $attributes = []) - { - return function () use ($attributes) { - return $this->create($attributes); - }; - } - - /** - * Create a collection of models and persist them to the database. - * - * @param array $attributes - * @return mixed - */ - public function create(array $attributes = []) - { - $results = $this->make($attributes); - - if ($results instanceof Model) { - $this->store(new Collection([$results])); - - $this->callAfterCreating(new Collection([$results])); - } else { - $this->store($results); - - $this->callAfterCreating($results); - } - - return $results; - } - - /** - * Set the connection name on the results and store them. - * - * @param Collection $results - * @return void - */ - protected function store($results) - { - $results->each(function (Model $model) { - $model->save(); - }); - } - - /** - * Create a collection of models. - * - * @param array $attributes - * @return mixed - */ - public function make(array $attributes = []) - { - if ($this->amount === null) { - return tap($this->makeInstance($attributes), function ($instance) { - $this->callAfterMaking(new Collection([$instance])); - }); - } - - if ($this->amount < 1) { - return (new $this->class)->toCollection(); - } - - $instances = (new $this->class)->toCollection(array_map(function () use ($attributes) { - return $this->makeInstance($attributes); - }, range(1, $this->amount))); - - $this->callAfterMaking($instances); - - return $instances; - } - - /** - * Create an array of raw attribute arrays. - * - * @param array $attributes - * @return mixed - */ - public function raw(array $attributes = []) - { - if ($this->amount === null) { - return $this->getRawAttributes($attributes); - } - - if ($this->amount < 1) { - return []; - } - - return array_map(function () use ($attributes) { - return $this->getRawAttributes($attributes); - }, range(1, $this->amount)); - } - - /** - * Get a raw attributes array for the model. - * - * @param array $attributes - * @return mixed - * - * @throws \InvalidArgumentException - */ - protected function getRawAttributes(array $attributes = []) - { - if (!isset($this->definitions[$this->class][$this->name])) { - throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}]."); - } - - $definition = call_user_func( - $this->definitions[$this->class][$this->name], - $this->faker, $attributes - ); - - return $this->expandAttributes( - array_merge($this->applyStates($definition, $attributes), $attributes) - ); - } - - /** - * Make an instance of the model with the given attributes. - * - * @param array $attributes - * @return Model - */ - protected function makeInstance(array $attributes = []) - { - return new $this->class( - $this->getRawAttributes($attributes) - ); - } - - /** - * Apply the active states to the model definition array. - * - * @param array $definition - * @param array $attributes - * @return array - */ - protected function applyStates(array $definition, array $attributes = []) - { - foreach ($this->activeStates as $state) { - if (!isset($this->states[$this->class][$state])) { - if ($this->stateHasAfterCallback($state)) { - continue; - } - - throw new InvalidArgumentException("Unable to locate [{$state}] state for [{$this->class}]."); - } - - $definition = array_merge( - $definition, - $this->stateAttributes($state, $attributes) - ); - } - - return $definition; - } - - /** - * Get the state attributes. - * - * @param string $state - * @param array $attributes - * @return array - */ - protected function stateAttributes($state, array $attributes) - { - $stateAttributes = $this->states[$this->class][$state]; - - if (!is_callable($stateAttributes)) { - return $stateAttributes; - } - - return call_user_func( - $stateAttributes, - $this->faker, $attributes - ); - } - - /** - * Expand all attributes to their underlying values. - * - * @param array $attributes - * @return array - */ - protected function expandAttributes(array $attributes) - { - foreach ($attributes as &$attribute) { - if (is_callable($attribute) && !is_string($attribute) && !is_array($attribute)) { - $attribute = $attribute($attributes); - } - - if ($attribute instanceof static) { - $attribute = $attribute->create()->getKey(); - } - - if ($attribute instanceof Model) { - $attribute = $attribute->getKey(); - } - } - - return $attributes; - } - - /** - * Run after making callbacks on a collection of models. - * - * @param Collection $models - * @return void - */ - public function callAfterMaking($models) - { - $this->callAfter($this->afterMaking, $models); - } - - /** - * Run after creating callbacks on a collection of models. - * - * @param Collection $models - * @return void - */ - public function callAfterCreating($models) - { - $this->callAfter($this->afterCreating, $models); - } - - /** - * Call after callbacks for each model and state. - * - * @param array $afterCallbacks - * @param Collection $models - * @return void - */ - protected function callAfter(array $afterCallbacks, $models) - { - $states = array_merge([$this->name], $this->activeStates); - - $models->each(function ($model) use ($states, $afterCallbacks) { - foreach ($states as $state) { - $this->callAfterCallbacks($afterCallbacks, $model, $state); - } - }); - } - - /** - * Call after callbacks for each model and state. - * - * @param array $afterCallbacks - * @param Model $model - * @param string $state - * @return void - */ - protected function callAfterCallbacks(array $afterCallbacks, $model, $state) - { - if (!isset($afterCallbacks[$this->class][$state])) { - return; - } - - foreach ($afterCallbacks[$this->class][$state] as $callback) { - $callback($model, $this->faker); - } - } - - /** - * Determine if the given state has an "after" callback. - * - * @param string $state - * @return bool - */ - protected function stateHasAfterCallback($state) - { - return isset($this->afterMaking[$this->class][$state]) || - isset($this->afterCreating[$this->class][$state]); - } -} diff --git a/vendor/topthink/think-migration/src/Migrator.php b/vendor/topthink/think-migration/src/Migrator.php deleted file mode 100644 index 1965953..0000000 --- a/vendor/topthink/think-migration/src/Migrator.php +++ /dev/null @@ -1,27 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\migration; - -use Phinx\Migration\AbstractMigration; -use think\migration\db\Table; - -class Migrator extends AbstractMigration -{ - /** - * @param string $tableName - * @param array $options - * @return Table - */ - public function table($tableName, $options = []) - { - return new Table($tableName, $options, $this->getAdapter()); - } -} diff --git a/vendor/topthink/think-migration/src/Seeder.php b/vendor/topthink/think-migration/src/Seeder.php deleted file mode 100644 index a1c46db..0000000 --- a/vendor/topthink/think-migration/src/Seeder.php +++ /dev/null @@ -1,18 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\migration; - -use Phinx\Seed\AbstractSeed; - -class Seeder extends AbstractSeed -{ - -} diff --git a/vendor/topthink/think-migration/src/Service.php b/vendor/topthink/think-migration/src/Service.php deleted file mode 100644 index 614e9e0..0000000 --- a/vendor/topthink/think-migration/src/Service.php +++ /dev/null @@ -1,51 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration; - -use Faker\Factory as FakerFactory; -use Faker\Generator as FakerGenerator; -use think\migration\command\factory\Create as FactoryCreate; -use think\migration\command\migrate\Breakpoint as MigrateBreakpoint; -use think\migration\command\migrate\Create as MigrateCreate; -use think\migration\command\migrate\Rollback as MigrateRollback; -use think\migration\command\migrate\Run as MigrateRun; -use think\migration\command\migrate\Status as MigrateStatus; -use think\migration\command\seed\Create as SeedCreate; -use think\migration\command\seed\Run as SeedRun; - -class Service extends \think\Service -{ - - public function boot() - { - $this->app->bind(FakerGenerator::class, function () { - return FakerFactory::create($this->app->config->get('app.faker_locale', 'zh_CN')); - }); - - $this->app->bind(Factory::class, function () { - return (new Factory($this->app->make(FakerGenerator::class)))->load($this->app->getRootPath() . 'database/factories/'); - }); - - $this->app->bind('migration.creator', Creator::class); - - $this->commands([ - MigrateCreate::class, - MigrateRun::class, - MigrateRollback::class, - MigrateBreakpoint::class, - MigrateStatus::class, - SeedCreate::class, - SeedRun::class, - FactoryCreate::class, - ]); - } -} diff --git a/vendor/topthink/think-migration/src/command/Migrate.php b/vendor/topthink/think-migration/src/command/Migrate.php deleted file mode 100644 index 1d97973..0000000 --- a/vendor/topthink/think-migration/src/command/Migrate.php +++ /dev/null @@ -1,146 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command; - -use Phinx\Db\Adapter\AdapterFactory; -use Phinx\Db\Adapter\ProxyAdapter; -use Phinx\Migration\AbstractMigration; -use Phinx\Migration\MigrationInterface; -use Phinx\Util\Util; -use think\migration\Command; -use think\migration\Migrator; - -abstract class Migrate extends Command -{ - /** - * @var array - */ - protected $migrations; - - protected function getPath() - { - return $this->app->getRootPath() . 'database' . DIRECTORY_SEPARATOR . 'migrations'; - } - - protected function executeMigration(MigrationInterface $migration, $direction = MigrationInterface::UP) - { - $this->output->writeln(''); - $this->output->writeln(' ==' . ' ' . $migration->getVersion() . ' ' . $migration->getName() . ':' . ' ' . (MigrationInterface::UP === $direction ? 'migrating' : 'reverting') . ''); - - // Execute the migration and log the time elapsed. - $start = microtime(true); - - $startTime = time(); - $direction = (MigrationInterface::UP === $direction) ? MigrationInterface::UP : MigrationInterface::DOWN; - $migration->setAdapter($this->getAdapter()); - - // begin the transaction if the adapter supports it - if ($this->getAdapter()->hasTransactions()) { - $this->getAdapter()->beginTransaction(); - } - - // Run the migration - if (method_exists($migration, MigrationInterface::CHANGE)) { - if (MigrationInterface::DOWN === $direction) { - // Create an instance of the ProxyAdapter so we can record all - // of the migration commands for reverse playback - /** @var ProxyAdapter $proxyAdapter */ - $proxyAdapter = AdapterFactory::instance()->getWrapper('proxy', $this->getAdapter()); - $migration->setAdapter($proxyAdapter); - /** @noinspection PhpUndefinedMethodInspection */ - $migration->change(); - $proxyAdapter->executeInvertedCommands(); - $migration->setAdapter($this->getAdapter()); - } else { - /** @noinspection PhpUndefinedMethodInspection */ - $migration->change(); - } - } else { - $migration->{$direction}(); - } - - // commit the transaction if the adapter supports it - if ($this->getAdapter()->hasTransactions()) { - $this->getAdapter()->commitTransaction(); - } - - // Record it in the database - $this->getAdapter() - ->migrated($migration, $direction, date('Y-m-d H:i:s', $startTime), date('Y-m-d H:i:s', time())); - - $end = microtime(true); - - $this->output->writeln(' ==' . ' ' . $migration->getVersion() . ' ' . $migration->getName() . ':' . ' ' . (MigrationInterface::UP === $direction ? 'migrated' : 'reverted') . ' ' . sprintf('%.4fs', $end - $start) . ''); - } - - protected function getVersionLog() - { - return $this->getAdapter()->getVersionLog(); - } - - protected function getVersions() - { - return $this->getAdapter()->getVersions(); - } - - protected function getMigrations() - { - if (null === $this->migrations) { - $phpFiles = glob($this->getPath() . DIRECTORY_SEPARATOR . '*.php', defined('GLOB_BRACE') ? GLOB_BRACE : 0); - - // filter the files to only get the ones that match our naming scheme - $fileNames = []; - /** @var Migrator[] $versions */ - $versions = []; - - foreach ($phpFiles as $filePath) { - if (Util::isValidMigrationFileName(basename($filePath))) { - $version = Util::getVersionFromFileName(basename($filePath)); - - if (isset($versions[$version])) { - throw new \InvalidArgumentException(sprintf('Duplicate migration - "%s" has the same version as "%s"', $filePath, $versions[$version]->getVersion())); - } - - // convert the filename to a class name - $class = Util::mapFileNameToClassName(basename($filePath)); - - if (isset($fileNames[$class])) { - throw new \InvalidArgumentException(sprintf('Migration "%s" has the same name as "%s"', basename($filePath), $fileNames[$class])); - } - - $fileNames[$class] = basename($filePath); - - // load the migration file - /** @noinspection PhpIncludeInspection */ - require_once $filePath; - if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf('Could not find class "%s" in file "%s"', $class, $filePath)); - } - - // instantiate it - $migration = new $class($version, $this->input, $this->output); - - if (!($migration instanceof AbstractMigration)) { - throw new \InvalidArgumentException(sprintf('The class "%s" in file "%s" must extend \Phinx\Migration\AbstractMigration', $class, $filePath)); - } - - $versions[$version] = $migration; - } - } - - ksort($versions); - $this->migrations = $versions; - } - - return $this->migrations; - } -} diff --git a/vendor/topthink/think-migration/src/command/Seed.php b/vendor/topthink/think-migration/src/command/Seed.php deleted file mode 100644 index e7a2c06..0000000 --- a/vendor/topthink/think-migration/src/command/Seed.php +++ /dev/null @@ -1,73 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command; - -use InvalidArgumentException; -use Phinx\Seed\AbstractSeed; -use Phinx\Util\Util; -use think\migration\Command; -use think\migration\Seeder; - -abstract class Seed extends Command -{ - - /** - * @var array - */ - protected $seeds; - - protected function getPath() - { - return $this->app->getRootPath() . 'database' . DIRECTORY_SEPARATOR . 'seeds'; - } - - public function getSeeds() - { - if (null === $this->seeds) { - $phpFiles = glob($this->getPath() . DIRECTORY_SEPARATOR . '*.php', defined('GLOB_BRACE') ? GLOB_BRACE : 0); - - // filter the files to only get the ones that match our naming scheme - $fileNames = []; - /** @var Seeder[] $seeds */ - $seeds = []; - - foreach ($phpFiles as $filePath) { - if (Util::isValidSeedFileName(basename($filePath))) { - // convert the filename to a class name - $class = pathinfo($filePath, PATHINFO_FILENAME); - $fileNames[$class] = basename($filePath); - - // load the seed file - /** @noinspection PhpIncludeInspection */ - require_once $filePath; - if (!class_exists($class)) { - throw new InvalidArgumentException(sprintf('Could not find class "%s" in file "%s"', $class, $filePath)); - } - - // instantiate it - $seed = new $class($this->input, $this->output); - - if (!($seed instanceof AbstractSeed)) { - throw new InvalidArgumentException(sprintf('The class "%s" in file "%s" must extend \Phinx\Seed\AbstractSeed', $class, $filePath)); - } - - $seeds[$class] = $seed; - } - } - - ksort($seeds); - $this->seeds = $seeds; - } - - return $this->seeds; - } -} diff --git a/vendor/topthink/think-migration/src/command/factory/Create.php b/vendor/topthink/think-migration/src/command/factory/Create.php deleted file mode 100644 index 3db6497..0000000 --- a/vendor/topthink/think-migration/src/command/factory/Create.php +++ /dev/null @@ -1,82 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\factory; - -use InvalidArgumentException; -use Phinx\Util\Util; -use RuntimeException; -use think\console\Command; -use think\console\input\Argument as InputArgument; - -class Create extends Command -{ - protected function configure() - { - $this->setName('factory:create') - ->setDescription('Create a new model factory') - ->addArgument('name', InputArgument::REQUIRED, 'What is the name of the model?'); - } - - protected function handle() - { - $path = $this->getPath(); - - if (!file_exists($path)) { - mkdir($path, 0755, true); - } - - if (!is_dir($path)) { - throw new InvalidArgumentException(sprintf('Factory directory "%s" does not exist', $path)); - } - - if (!is_writable($path)) { - throw new InvalidArgumentException(sprintf('Factory directory "%s" is not writable', $path)); - } - - $path = realpath($path); - $className = $this->input->getArgument('name'); - - if (!Util::isValidPhinxClassName($className)) { - throw new InvalidArgumentException(sprintf('The migration class name "%s" is invalid. Please use CamelCase format.', $className)); - } - - $filePath = $path . DIRECTORY_SEPARATOR . $className . '.php'; - - if (is_file($filePath)) { - throw new InvalidArgumentException(sprintf('The file "%s" already exists', $filePath)); - } - - // Load the alternative template if it is defined. - $contents = file_get_contents($this->getTemplate()); - - // inject the class names appropriate to this migration - $contents = strtr($contents, [ - '"ModelClass"' => "\\app\\model\\" . $className . '::class', - ]); - - if (false === file_put_contents($filePath, $contents)) { - throw new RuntimeException(sprintf('The file "%s" could not be written to', $path)); - } - - $this->output->writeln('created .' . str_replace(getcwd(), '', $filePath)); - } - - protected function getTemplate() - { - return __DIR__ . '/../stubs/factory.stub'; - } - - protected function getPath() - { - return $this->app->getRootPath() . 'database' . DIRECTORY_SEPARATOR . 'factories'; - } -} diff --git a/vendor/topthink/think-migration/src/command/migrate/Breakpoint.php b/vendor/topthink/think-migration/src/command/migrate/Breakpoint.php deleted file mode 100644 index cfb2d32..0000000 --- a/vendor/topthink/think-migration/src/command/migrate/Breakpoint.php +++ /dev/null @@ -1,92 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\migrate; - -use think\console\Input; -use think\console\input\Option as InputOption; -use think\console\Output; -use think\migration\command\Migrate; - -class Breakpoint extends Migrate -{ - protected function configure() - { - $this->setName('migrate:breakpoint') - ->setDescription('Manage breakpoints') - ->addOption('--target', '-t', InputOption::VALUE_REQUIRED, 'The version number to set or clear a breakpoint against') - ->addOption('--remove-all', '-r', InputOption::VALUE_NONE, 'Remove all breakpoints') - ->setHelp(<<breakpoint command allows you to set or clear a breakpoint against a specific target to inhibit rollbacks beyond a certain target. -If no target is supplied then the most recent migration will be used. -You cannot specify un-migrated targets - -php think migrate:breakpoint -php think migrate:breakpoint -t 20110103081132 -php think migrate:breakpoint -r -EOT - ); - } - - protected function execute(Input $input, Output $output) - { - $version = $input->getOption('target'); - $removeAll = $input->getOption('remove-all'); - - if ($version && $removeAll) { - throw new \InvalidArgumentException('Cannot toggle a breakpoint and remove all breakpoints at the same time.'); - } - - // Remove all breakpoints - if ($removeAll) { - $this->removeBreakpoints(); - } else { - // Toggle the breakpoint. - $this->toggleBreakpoint($version); - } - } - - protected function toggleBreakpoint($version) - { - $migrations = $this->getMigrations(); - $versions = $this->getVersionLog(); - - if (empty($versions) || empty($migrations)) { - return; - } - - if (null === $version) { - $lastVersion = end($versions); - $version = $lastVersion['version']; - } - - if (0 != $version && !isset($migrations[$version])) { - $this->output->writeln(sprintf('warning %s is not a valid version', $version)); - return; - } - - $this->getAdapter()->toggleBreakpoint($migrations[$version]); - - $versions = $this->getVersionLog(); - - $this->output->writeln(' Breakpoint ' . ($versions[$version]['breakpoint'] ? 'set' : 'cleared') . ' for ' . $version . '' . ' ' . $migrations[$version]->getName() . ''); - } - - /** - * Remove all breakpoints - * - * @return void - */ - protected function removeBreakpoints() - { - $this->output->writeln(sprintf(' %d breakpoints cleared.', $this->getAdapter()->resetAllBreakpoints())); - } -} diff --git a/vendor/topthink/think-migration/src/command/migrate/Create.php b/vendor/topthink/think-migration/src/command/migrate/Create.php deleted file mode 100644 index 8f96de7..0000000 --- a/vendor/topthink/think-migration/src/command/migrate/Create.php +++ /dev/null @@ -1,55 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\migrate; - -use InvalidArgumentException; -use RuntimeException; -use think\console\Command; -use think\console\Input; -use think\console\input\Argument as InputArgument; -use think\console\Output; -use think\migration\Creator; - -class Create extends Command -{ - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('migrate:create') - ->setDescription('Create a new migration') - ->addArgument('name', InputArgument::REQUIRED, 'What is the name of the migration?') - ->setHelp(sprintf('%sCreates a new database migration%s', PHP_EOL, PHP_EOL)); - } - - /** - * Create the new migration. - * - * @param Input $input - * @param Output $output - * @return void - * @throws InvalidArgumentException - * @throws RuntimeException - */ - protected function execute(Input $input, Output $output) - { - /** @var Creator $creator */ - $creator = $this->app->get('migration.creator'); - - $className = $input->getArgument('name'); - - $path = $creator->create($className); - - $output->writeln('created .' . str_replace(getcwd(), '', realpath($path))); - } - -} diff --git a/vendor/topthink/think-migration/src/command/migrate/Rollback.php b/vendor/topthink/think-migration/src/command/migrate/Rollback.php deleted file mode 100644 index e668ac7..0000000 --- a/vendor/topthink/think-migration/src/command/migrate/Rollback.php +++ /dev/null @@ -1,146 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\migrate; - -use Phinx\Migration\MigrationInterface; -use think\console\input\Option as InputOption; -use think\console\Input; -use think\console\Output; -use think\migration\command\Migrate; - -class Rollback extends Migrate -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('migrate:rollback') - ->setDescription('Rollback the last or to a specific migration') - ->addOption('--target', '-t', InputOption::VALUE_REQUIRED, 'The version number to rollback to') - ->addOption('--date', '-d', InputOption::VALUE_REQUIRED, 'The date to rollback to') - ->addOption('--force', '-f', InputOption::VALUE_NONE, 'Force rollback to ignore breakpoints') - ->setHelp(<<migrate:rollback command reverts the last migration, or optionally up to a specific version - -php think migrate:rollback -php think migrate:rollback -t 20111018185412 -php think migrate:rollback -d 20111018 -php think migrate:rollback -v - -EOT - ); - } - - /** - * Rollback the migration. - * - * @param Input $input - * @param Output $output - * @return void - */ - protected function execute(Input $input, Output $output) - { - $version = $input->getOption('target'); - $date = $input->getOption('date'); - $force = !!$input->getOption('force'); - - // rollback the specified environment - $start = microtime(true); - if (null !== $date) { - $this->rollbackToDateTime(new \DateTime($date), $force); - } else { - $this->rollback($version, $force); - } - $end = microtime(true); - - $output->writeln(''); - $output->writeln('All Done. Took ' . sprintf('%.4fs', $end - $start) . ''); - } - - protected function rollback($version = null, $force = false) - { - $migrations = $this->getMigrations(); - $versionLog = $this->getVersionLog(); - $versions = array_keys($versionLog); - - ksort($migrations); - sort($versions); - - // Check we have at least 1 migration to revert - if (empty($versions) || $version == end($versions)) { - $this->output->writeln('No migrations to rollback'); - return; - } - - // If no target version was supplied, revert the last migration - if (null === $version) { - // Get the migration before the last run migration - $prev = count($versions) - 2; - $version = $prev < 0 ? 0 : $versions[$prev]; - } else { - // Get the first migration number - $first = $versions[0]; - - // If the target version is before the first migration, revert all migrations - if ($version < $first) { - $version = 0; - } - } - - // Check the target version exists - if (0 !== $version && !isset($migrations[$version])) { - $this->output->writeln("Target version ($version) not found"); - return; - } - - // Revert the migration(s) - krsort($migrations); - foreach ($migrations as $migration) { - if ($migration->getVersion() <= $version) { - break; - } - - if (in_array($migration->getVersion(), $versions)) { - if (isset($versionLog[$migration->getVersion()]) && 0 != $versionLog[$migration->getVersion()]['breakpoint'] && !$force) { - $this->output->writeln('Breakpoint reached. Further rollbacks inhibited.'); - break; - } - $this->executeMigration($migration, MigrationInterface::DOWN); - } - } - } - - protected function rollbackToDateTime(\DateTime $dateTime, $force = false) - { - $versions = $this->getVersions(); - $dateString = $dateTime->format('YmdHis'); - sort($versions); - - $earlierVersion = null; - $availableMigrations = array_filter($versions, function ($version) use ($dateString, &$earlierVersion) { - if ($version <= $dateString) { - $earlierVersion = $version; - } - return $version >= $dateString; - }); - - if (count($availableMigrations) > 0) { - if (is_null($earlierVersion)) { - $this->output->writeln('Rolling back all migrations'); - $migration = 0; - } else { - $this->output->writeln('Rolling back to version ' . $earlierVersion); - $migration = $earlierVersion; - } - $this->rollback($migration, $force); - } - } -} diff --git a/vendor/topthink/think-migration/src/command/migrate/Run.php b/vendor/topthink/think-migration/src/command/migrate/Run.php deleted file mode 100644 index 4714f02..0000000 --- a/vendor/topthink/think-migration/src/command/migrate/Run.php +++ /dev/null @@ -1,140 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\migrate; - -use Phinx\Migration\MigrationInterface; -use think\console\Input; -use think\console\input\Option as InputOption; -use think\console\Output; -use think\migration\command\Migrate; - -class Run extends Migrate -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('migrate:run') - ->setDescription('Migrate the database') - ->addOption('--target', '-t', InputOption::VALUE_REQUIRED, 'The version number to migrate to') - ->addOption('--date', '-d', InputOption::VALUE_REQUIRED, 'The date to migrate to') - ->setHelp(<<migrate:run command runs all available migrations, optionally up to a specific version - -php think migrate:run -php think migrate:run -t 20110103081132 -php think migrate:run -d 20110103 -php think migrate:run -v - -EOT - ); - } - - /** - * Migrate the database. - * - * @param Input $input - * @param Output $output - */ - protected function execute(Input $input, Output $output) - { - $version = $input->getOption('target'); - $date = $input->getOption('date'); - - // run the migrations - $start = microtime(true); - if (null !== $date) { - $this->migrateToDateTime(new \DateTime($date)); - } else { - $this->migrate($version); - } - $end = microtime(true); - - $output->writeln(''); - $output->writeln('All Done. Took ' . sprintf('%.4fs', $end - $start) . ''); - } - - public function migrateToDateTime(\DateTime $dateTime) - { - $versions = array_keys($this->getMigrations()); - $dateString = $dateTime->format('YmdHis'); - - $outstandingMigrations = array_filter($versions, function ($version) use ($dateString) { - return $version <= $dateString; - }); - - if (count($outstandingMigrations) > 0) { - $migration = max($outstandingMigrations); - $this->output->writeln('Migrating to version ' . $migration); - $this->migrate($migration); - } - } - - protected function migrate($version = null) - { - $migrations = $this->getMigrations(); - $versions = $this->getVersions(); - $current = $this->getCurrentVersion(); - - if (empty($versions) && empty($migrations)) { - return; - } - - if (null === $version) { - $version = max(array_merge($versions, array_keys($migrations))); - } else { - if (0 != $version && !isset($migrations[$version])) { - $this->output->writeln(sprintf('warning %s is not a valid version', $version)); - return; - } - } - - // are we migrating up or down? - $direction = $version > $current ? MigrationInterface::UP : MigrationInterface::DOWN; - - if ($direction === MigrationInterface::DOWN) { - // run downs first - krsort($migrations); - foreach ($migrations as $migration) { - if ($migration->getVersion() <= $version) { - break; - } - - if (in_array($migration->getVersion(), $versions)) { - $this->executeMigration($migration, MigrationInterface::DOWN); - } - } - } - - ksort($migrations); - foreach ($migrations as $migration) { - if ($migration->getVersion() > $version) { - break; - } - - if (!in_array($migration->getVersion(), $versions)) { - $this->executeMigration($migration, MigrationInterface::UP); - } - } - } - - protected function getCurrentVersion() - { - $versions = $this->getVersions(); - $version = 0; - - if (!empty($versions)) { - $version = end($versions); - } - - return $version; - } -} diff --git a/vendor/topthink/think-migration/src/command/migrate/Status.php b/vendor/topthink/think-migration/src/command/migrate/Status.php deleted file mode 100644 index 1b5f8d4..0000000 --- a/vendor/topthink/think-migration/src/command/migrate/Status.php +++ /dev/null @@ -1,124 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\migrate; - -use think\console\input\Option as InputOption; -use think\console\Input; -use think\console\Output; -use think\migration\command\Migrate; - -class Status extends Migrate -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('migrate:status') - ->setDescription('Show migration status') - ->addOption('--format', '-f', InputOption::VALUE_REQUIRED, 'The output format: text or json. Defaults to text.') - ->setHelp(<<migrate:status command prints a list of all migrations, along with their current status - -php think migrate:status -php think migrate:status -f json -EOT - ); - } - - /** - * Show the migration status. - * - * @param Input $input - * @param Output $output - * @return integer 0 if all migrations are up, or an error code - */ - protected function execute(Input $input, Output $output) - { - $format = $input->getOption('format'); - - if (null !== $format) { - $output->writeln('using format ' . $format); - } - - // print the status - return $this->printStatus($format); - } - - protected function printStatus($format = null) - { - $output = $this->output; - $migrations = []; - if (count($this->getMigrations())) { - // TODO - rewrite using Symfony Table Helper as we already have this library - // included and it will fix formatting issues (e.g drawing the lines) - $output->writeln(''); - $output->writeln(' Status Migration ID Started Finished Migration Name '); - $output->writeln('----------------------------------------------------------------------------------'); - - $versions = $this->getVersionLog(); - $maxNameLength = $versions ? max(array_map(function ($version) { - return strlen($version['migration_name']); - }, $versions)) : 0; - - foreach ($this->getMigrations() as $migration) { - $version = array_key_exists($migration->getVersion(), $versions) ? $versions[$migration->getVersion()] : false; - if ($version) { - $status = ' up '; - } else { - $status = ' down '; - } - $maxNameLength = max($maxNameLength, strlen($migration->getName())); - - $output->writeln(sprintf('%s %14.0f %19s %19s %s', $status, $migration->getVersion(), $version['start_time'], $version['end_time'], $migration->getName())); - - if ($version && $version['breakpoint']) { - $output->writeln(' BREAKPOINT SET'); - } - - $migrations[] = [ - 'migration_status' => trim(strip_tags($status)), - 'migration_id' => sprintf('%14.0f', $migration->getVersion()), - 'migration_name' => $migration->getName() - ]; - unset($versions[$migration->getVersion()]); - } - - if (count($versions)) { - foreach ($versions as $missing => $version) { - $output->writeln(sprintf(' up %14.0f %19s %19s %s ** MISSING **', $missing, $version['start_time'], $version['end_time'], str_pad($version['migration_name'], $maxNameLength, ' '))); - - if ($version && $version['breakpoint']) { - $output->writeln(' BREAKPOINT SET'); - } - } - } - } else { - // there are no migrations - $output->writeln(''); - $output->writeln('There are no available migrations. Try creating one using the create command.'); - } - - // write an empty line - $output->writeln(''); - if ($format !== null) { - switch ($format) { - case 'json': - $output->writeln(json_encode([ - 'pending_count' => count($this->getMigrations()), - 'migrations' => $migrations - ])); - break; - default: - $output->writeln('Unsupported format: ' . $format . ''); - } - } - } -} diff --git a/vendor/topthink/think-migration/src/command/seed/Create.php b/vendor/topthink/think-migration/src/command/seed/Create.php deleted file mode 100644 index 6873980..0000000 --- a/vendor/topthink/think-migration/src/command/seed/Create.php +++ /dev/null @@ -1,83 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\seed; - -use Phinx\Util\Util; -use think\console\Input; -use think\console\input\Argument as InputArgument; -use think\console\Output; -use think\migration\command\Seed; - -class Create extends Seed -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('seed:create') - ->setDescription('Create a new database seeder') - ->addArgument('name', InputArgument::REQUIRED, 'What is the name of the seeder?') - ->setHelp(sprintf('%sCreates a new database seeder%s', PHP_EOL, PHP_EOL)); - } - - /** - * Create the new seeder. - * - * @param Input $input - * @param Output $output - * @return void - * @throws \InvalidArgumentException - * @throws \RuntimeException - */ - protected function execute(Input $input, Output $output) - { - $path = $this->getPath(); - - if (!file_exists($path)) { - mkdir($path, 0755, true); - } - - $this->verifyMigrationDirectory($path); - - $path = realpath($path); - - $className = $input->getArgument('name'); - - if (!Util::isValidPhinxClassName($className)) { - throw new \InvalidArgumentException(sprintf('The seed class name "%s" is invalid. Please use CamelCase format', $className)); - } - - // Compute the file path - $filePath = $path . DIRECTORY_SEPARATOR . $className . '.php'; - - if (is_file($filePath)) { - throw new \InvalidArgumentException(sprintf('The file "%s" already exists', basename($filePath))); - } - - // inject the class names appropriate to this seeder - $contents = file_get_contents($this->getTemplate()); - $classes = [ - 'SeederClass' => $className, - ]; - $contents = strtr($contents, $classes); - - if (false === file_put_contents($filePath, $contents)) { - throw new \RuntimeException(sprintf('The file "%s" could not be written to', $path)); - } - - $output->writeln('created .' . str_replace(getcwd(), '', $filePath)); - } - - protected function getTemplate() - { - return __DIR__ . '/../stubs/seed.stub'; - } -} diff --git a/vendor/topthink/think-migration/src/command/seed/Run.php b/vendor/topthink/think-migration/src/command/seed/Run.php deleted file mode 100644 index a0ac8f9..0000000 --- a/vendor/topthink/think-migration/src/command/seed/Run.php +++ /dev/null @@ -1,107 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\command\seed; - -use Phinx\Seed\SeedInterface; -use think\console\Input; -use think\console\input\Option as InputOption; -use think\console\Output; -use think\migration\command\Seed; - -class Run extends Seed -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('seed:run') - ->setDescription('Run database seeders') - ->addOption('--seed', '-s', InputOption::VALUE_REQUIRED, 'What is the name of the seeder?') - ->setHelp(<<seed:run command runs all available or individual seeders - -php think seed:run -php think seed:run -s UserSeeder -php think seed:run -v - -EOT - ); - } - - /** - * Run database seeders. - * - * @param Input $input - * @param Output $output - * @return void - */ - protected function execute(Input $input, Output $output) - { - $seed = $input->getOption('seed'); - - // run the seed(ers) - $start = microtime(true); - $this->seed($seed); - $end = microtime(true); - - $output->writeln(''); - $output->writeln('All Done. Took ' . sprintf('%.4fs', $end - $start) . ''); - } - - public function seed($seed = null) - { - $seeds = $this->getSeeds(); - - if (null === $seed) { - // run all seeders - foreach ($seeds as $seeder) { - if (array_key_exists($seeder->getName(), $seeds)) { - $this->executeSeed($seeder); - } - } - } else { - // run only one seeder - if (array_key_exists($seed, $seeds)) { - $this->executeSeed($seeds[$seed]); - } else { - throw new \InvalidArgumentException(sprintf('The seed class "%s" does not exist', $seed)); - } - } - } - - protected function executeSeed(SeedInterface $seed) - { - $this->output->writeln(''); - $this->output->writeln(' ==' . ' ' . $seed->getName() . ':' . ' seeding'); - - // Execute the seeder and log the time elapsed. - $start = microtime(true); - $seed->setAdapter($this->getAdapter()); - - // begin the transaction if the adapter supports it - if ($this->getAdapter()->hasTransactions()) { - $this->getAdapter()->beginTransaction(); - } - - // Run the seeder - if (method_exists($seed, SeedInterface::RUN)) { - $seed->run(); - } - - // commit the transaction if the adapter supports it - if ($this->getAdapter()->hasTransactions()) { - $this->getAdapter()->commitTransaction(); - } - $end = microtime(true); - - $this->output->writeln(' ==' . ' ' . $seed->getName() . ':' . ' seeded' . ' ' . sprintf('%.4fs', $end - $start) . ''); - } -} diff --git a/vendor/topthink/think-migration/src/command/stubs/factory.stub b/vendor/topthink/think-migration/src/command/stubs/factory.stub deleted file mode 100644 index eef91dc..0000000 --- a/vendor/topthink/think-migration/src/command/stubs/factory.stub +++ /dev/null @@ -1,11 +0,0 @@ -define("ModelClass", function (Faker $faker) { - return [ - // - ]; -}); diff --git a/vendor/topthink/think-migration/src/command/stubs/migrate.stub b/vendor/topthink/think-migration/src/command/stubs/migrate.stub deleted file mode 100644 index f11d29a..0000000 --- a/vendor/topthink/think-migration/src/command/stubs/migrate.stub +++ /dev/null @@ -1,33 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\db; - -use Phinx\Db\Adapter\AdapterInterface; -use Phinx\Db\Adapter\MysqlAdapter; - -class Column extends \Phinx\Db\Table\Column -{ - protected $unique = false; - - public function setNullable() - { - return $this->setNull(true); - } - - public function setUnsigned() - { - return $this->setSigned(false); - } - - public function setUnique() - { - $this->unique = true; - return $this; - } - - public function getUnique() - { - return $this->unique; - } - - public function isUnique() - { - return $this->getUnique(); - } - - public static function make($name, $type, $options = []) - { - $column = new self(); - $column->setName($name); - $column->setType($type); - $column->setOptions($options); - return $column; - } - - public static function bigInteger($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_BIG_INTEGER); - } - - public static function binary($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_BLOB); - } - - public static function boolean($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_BOOLEAN); - } - - public static function char($name, $length = 255) - { - return self::make($name, AdapterInterface::PHINX_TYPE_CHAR, compact('length')); - } - - public static function date($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_DATE); - } - - public static function dateTime($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_DATETIME); - } - - public static function decimal($name, $precision = 8, $scale = 2) - { - return self::make($name, AdapterInterface::PHINX_TYPE_DECIMAL, compact('precision', 'scale')); - } - - public static function enum($name, array $values) - { - return self::make($name, AdapterInterface::PHINX_TYPE_ENUM, compact('values')); - } - - public static function float($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_FLOAT); - } - - public static function integer($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_INTEGER); - } - - public static function json($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_JSON); - } - - public static function jsonb($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_JSONB); - } - - public static function longText($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_TEXT, ['length' => MysqlAdapter::TEXT_LONG]); - } - - public static function mediumInteger($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_INTEGER, ['length' => MysqlAdapter::INT_MEDIUM]); - } - - public static function mediumText($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_TEXT, ['length' => MysqlAdapter::TEXT_MEDIUM]); - } - - public static function smallInteger($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_INTEGER, ['length' => MysqlAdapter::INT_SMALL]); - } - - public static function string($name, $length = 255) - { - return self::make($name, AdapterInterface::PHINX_TYPE_STRING, compact('length')); - } - - public static function text($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_TEXT); - } - - public static function time($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_TIME); - } - - public static function tinyInteger($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_INTEGER, ['length' => MysqlAdapter::INT_TINY]); - } - - public static function unsignedInteger($name) - { - return self::integer($name)->setUnSigned(); - } - - public static function timestamp($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_TIMESTAMP); - } - - public static function uuid($name) - { - return self::make($name, AdapterInterface::PHINX_TYPE_UUID); - } - -} diff --git a/vendor/topthink/think-migration/src/db/Table.php b/vendor/topthink/think-migration/src/db/Table.php deleted file mode 100644 index cf4daa9..0000000 --- a/vendor/topthink/think-migration/src/db/Table.php +++ /dev/null @@ -1,135 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\migration\db; - -use Phinx\Db\Table\Index; - -class Table extends \Phinx\Db\Table -{ - /** - * 设置id - * @param $id - * @return $this - */ - public function setId($id) - { - $this->options['id'] = $id; - return $this; - } - - /** - * 设置主键 - * @param $key - * @return $this - */ - public function setPrimaryKey($key) - { - $this->options['primary_key'] = $key; - return $this; - } - - /** - * 设置引擎 - * @param $engine - * @return $this - */ - public function setEngine($engine) - { - $this->options['engine'] = $engine; - return $this; - } - - /** - * 设置表注释 - * @param $comment - * @return $this - */ - public function setComment($comment) - { - $this->options['comment'] = $comment; - return $this; - } - - /** - * 设置排序比对方法 - * @param $collation - * @return $this - */ - public function setCollation($collation) - { - $this->options['collation'] = $collation; - return $this; - } - - public function addSoftDelete() - { - $this->addColumn(Column::timestamp('delete_time')->setNullable()); - return $this; - } - - public function addMorphs($name, $indexName = null) - { - $this->addColumn(Column::unsignedInteger("{$name}_id")); - $this->addColumn(Column::string("{$name}_type")); - $this->addIndex(["{$name}_id", "{$name}_type"], ['name' => $indexName]); - return $this; - } - - public function addNullableMorphs($name, $indexName = null) - { - $this->addColumn(Column::unsignedInteger("{$name}_id")->setNullable()); - $this->addColumn(Column::string("{$name}_type")->setNullable()); - $this->addIndex(["{$name}_id", "{$name}_type"], ['name' => $indexName]); - return $this; - } - - /** - * @param string $createdAtColumnName - * @param string $updatedAtColumnName - * @return \Phinx\Db\Table|Table - */ - public function addTimestamps($createdAtColumnName = 'create_time', $updatedAtColumnName = 'update_time') - { - return parent::addTimestamps($createdAtColumnName, $updatedAtColumnName); - } - - /** - * @param \Phinx\Db\Table\Column|string $columnName - * @param null $type - * @param array $options - * @return \Phinx\Db\Table|Table - */ - public function addColumn($columnName, $type = null, $options = []) - { - if ($columnName instanceof Column && $columnName->getUnique()) { - $index = new Index(); - $index->setColumns([$columnName->getName()]); - $index->setType(Index::UNIQUE); - $this->addIndex($index); - } - return parent::addColumn($columnName, $type, $options); - } - - /** - * @param string $columnName - * @param null $newColumnType - * @param array $options - * @return \Phinx\Db\Table|Table - */ - public function changeColumn($columnName, $newColumnType = null, $options = []) - { - if ($columnName instanceof \Phinx\Db\Table\Column) { - return parent::changeColumn($columnName->getName(), $columnName, $options); - } - return parent::changeColumn($columnName, $newColumnType, $options); - } -} diff --git a/vendor/topthink/think-migration/src/helper.php b/vendor/topthink/think-migration/src/helper.php deleted file mode 100644 index 6dc47ab..0000000 --- a/vendor/topthink/think-migration/src/helper.php +++ /dev/null @@ -1,40 +0,0 @@ -of($arguments[0], $arguments[1])->times($arguments[2] ?? null); - } elseif (isset($arguments[1])) { - return $factory->of($arguments[0])->times($arguments[1]); - } - - return $factory->of($arguments[0]); - } -} - -if (!function_exists('database_path')) { - /** - * 获取数据迁移脚本地址 - * @param string $path - * @return string - */ - function database_path($path = '') - { - return app()->getRootPath() . 'database' . DIRECTORY_SEPARATOR . $path; - } -} diff --git a/vendor/topthink/think-multi-app/LICENSE b/vendor/topthink/think-multi-app/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/vendor/topthink/think-multi-app/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/topthink/think-multi-app/README.md b/vendor/topthink/think-multi-app/README.md deleted file mode 100644 index a746fa7..0000000 --- a/vendor/topthink/think-multi-app/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# think-multi-app - -用于ThinkPHP6+的多应用支持 - -## 安装 - -~~~ -composer require topthink/think-multi-app -~~~ - -## 使用 - -用法参考ThinkPHP6完全开发手册[多应用模式](https://www.kancloud.cn/manual/thinkphp6_0/1297876)章节。 - diff --git a/vendor/topthink/think-multi-app/composer.json b/vendor/topthink/think-multi-app/composer.json deleted file mode 100644 index 92d620e..0000000 --- a/vendor/topthink/think-multi-app/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "topthink/think-multi-app", - "description": "thinkphp6 multi app support", - "license": "Apache-2.0", - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - } - ], - "require": { - "php": ">=7.1.0", - "topthink/framework": "^6.0.0" - }, - "autoload": { - "psr-4": { - "think\\app\\": "src" - } - }, - "extra": { - "think":{ - "services":[ - "think\\app\\Service" - ] - } - }, - "minimum-stability": "dev" -} diff --git a/vendor/topthink/think-multi-app/src/MultiApp.php b/vendor/topthink/think-multi-app/src/MultiApp.php deleted file mode 100644 index b0ac260..0000000 --- a/vendor/topthink/think-multi-app/src/MultiApp.php +++ /dev/null @@ -1,245 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\app; - -use Closure; -use think\App; -use think\exception\HttpException; -use think\Request; -use think\Response; - -/** - * 多应用模式支持 - */ -class MultiApp -{ - - /** @var App */ - protected $app; - - /** - * 应用名称 - * @var string - */ - protected $name; - - /** - * 应用名称 - * @var string - */ - protected $appName; - - /** - * 应用路径 - * @var string - */ - protected $path; - - public function __construct(App $app) - { - $this->app = $app; - $this->name = $this->app->http->getName(); - $this->path = $this->app->http->getPath(); - } - - /** - * 多应用解析 - * @access public - * @param Request $request - * @param Closure $next - * @return Response - */ - public function handle($request, Closure $next) - { - if (!$this->parseMultiApp()) { - return $next($request); - } - - return $this->app->middleware->pipeline('app') - ->send($request) - ->then(function ($request) use ($next) { - return $next($request); - }); - } - - /** - * 获取路由目录 - * @access protected - * @return string - */ - protected function getRoutePath(): string - { - return $this->app->getAppPath() . 'route' . DIRECTORY_SEPARATOR; - } - - /** - * 解析多应用 - * @return bool - */ - protected function parseMultiApp(): bool - { - $scriptName = $this->getScriptName(); - $defaultApp = $this->app->config->get('app.default_app') ?: 'index'; - - if ($this->name || ($scriptName && !in_array($scriptName, ['index', 'router', 'think']))) { - $appName = $this->name ?: $scriptName; - $this->app->http->setBind(); - } else { - // 自动多应用识别 - $this->app->http->setBind(false); - $appName = null; - $this->appName = ''; - - $bind = $this->app->config->get('app.domain_bind', []); - - if (!empty($bind)) { - // 获取当前子域名 - $subDomain = $this->app->request->subDomain(); - $domain = $this->app->request->host(true); - - if (isset($bind[$domain])) { - $appName = $bind[$domain]; - $this->app->http->setBind(); - } elseif (isset($bind[$subDomain])) { - $appName = $bind[$subDomain]; - $this->app->http->setBind(); - } elseif (isset($bind['*'])) { - $appName = $bind['*']; - $this->app->http->setBind(); - } - } - - if (!$this->app->http->isBind()) { - $path = $this->app->request->pathinfo(); - $map = $this->app->config->get('app.app_map', []); - $deny = $this->app->config->get('app.deny_app_list', []); - $name = current(explode('/', $path)); - - if (strpos($name, '.')) { - $name = strstr($name, '.', true); - } - - if (isset($map[$name])) { - if ($map[$name] instanceof Closure) { - $result = call_user_func_array($map[$name], [$this->app]); - $appName = $result ?: $name; - } else { - $appName = $map[$name]; - } - } elseif ($name && (false !== array_search($name, $map) || in_array($name, $deny))) { - throw new HttpException(404, 'app not exists:' . $name); - } elseif ($name && isset($map['*'])) { - $appName = $map['*']; - } else { - $appName = $name ?: $defaultApp; - $appPath = $this->path ?: $this->app->getBasePath() . $appName . DIRECTORY_SEPARATOR; - - if (!is_dir($appPath)) { - $express = $this->app->config->get('app.app_express', false); - if ($express) { - $this->setApp($defaultApp); - return true; - } else { - return false; - } - } - } - - if ($name) { - $this->app->request->setRoot('/' . $name); - $this->app->request->setPathinfo(strpos($path, '/') ? ltrim(strstr($path, '/'), '/') : ''); - } - } - } - - $this->setApp($appName ?: $defaultApp); - return true; - } - - /** - * 获取当前运行入口名称 - * @access protected - * @codeCoverageIgnore - * @return string - */ - protected function getScriptName(): string - { - if (isset($_SERVER['SCRIPT_FILENAME'])) { - $file = $_SERVER['SCRIPT_FILENAME']; - } elseif (isset($_SERVER['argv'][0])) { - $file = realpath($_SERVER['argv'][0]); - } - - return isset($file) ? pathinfo($file, PATHINFO_FILENAME) : ''; - } - - /** - * 设置应用 - * @param string $appName - */ - protected function setApp(string $appName): void - { - $this->appName = $appName; - $this->app->http->name($appName); - - $appPath = $this->path ?: $this->app->getBasePath() . $appName . DIRECTORY_SEPARATOR; - - $this->app->setAppPath($appPath); - // 设置应用命名空间 - $this->app->setNamespace($this->app->config->get('app.app_namespace') ?: 'app\\' . $appName); - - if (is_dir($appPath)) { - $this->app->setRuntimePath($this->app->getRuntimePath() . $appName . DIRECTORY_SEPARATOR); - $this->app->http->setRoutePath($this->getRoutePath()); - - //加载应用 - $this->loadApp($appName, $appPath); - } - } - - /** - * 加载应用文件 - * @param string $appName 应用名 - * @return void - */ - protected function loadApp(string $appName, string $appPath): void - { - if (is_file($appPath . 'common.php')) { - include_once $appPath . 'common.php'; - } - - $files = []; - - $files = array_merge($files, glob($appPath . 'config' . DIRECTORY_SEPARATOR . '*' . $this->app->getConfigExt())); - - foreach ($files as $file) { - $this->app->config->load($file, pathinfo($file, PATHINFO_FILENAME)); - } - - if (is_file($appPath . 'event.php')) { - $this->app->loadEvent(include $appPath . 'event.php'); - } - - if (is_file($appPath . 'middleware.php')) { - $this->app->middleware->import(include $appPath . 'middleware.php', 'app'); - } - - if (is_file($appPath . 'provider.php')) { - $this->app->bind(include $appPath . 'provider.php'); - } - - // 加载应用默认语言包 - $this->app->loadLangPack($this->app->lang->defaultLangSet()); - } - -} diff --git a/vendor/topthink/think-multi-app/src/Service.php b/vendor/topthink/think-multi-app/src/Service.php deleted file mode 100644 index cdc90b4..0000000 --- a/vendor/topthink/think-multi-app/src/Service.php +++ /dev/null @@ -1,32 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\app; - -use think\Service as BaseService; - -class Service extends BaseService -{ - public function boot() - { - $this->app->event->listen('HttpRun', function () { - $this->app->middleware->add(MultiApp::class); - }); - - $this->commands([ - 'build' => command\Build::class, - 'clear' => command\Clear::class, - ]); - - $this->app->bind([ - 'think\route\Url' => Url::class, - ]); - } -} diff --git a/vendor/topthink/think-multi-app/src/Url.php b/vendor/topthink/think-multi-app/src/Url.php deleted file mode 100644 index 7bd6057..0000000 --- a/vendor/topthink/think-multi-app/src/Url.php +++ /dev/null @@ -1,232 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\app; - -use think\App; -use think\Route; -use think\route\Url as UrlBuild; - -/** - * 路由地址生成 - */ -class Url extends UrlBuild -{ - /** - * 直接解析URL地址 - * @access protected - * @param string $url URL - * @param string|bool $domain Domain - * @return string - */ - protected function parseUrl(string $url, &$domain): string - { - $request = $this->app->request; - - if (0 === strpos($url, '/')) { - // 直接作为路由地址解析 - $url = substr($url, 1); - } elseif (false !== strpos($url, '\\')) { - // 解析到类 - $url = ltrim(str_replace('\\', '/', $url), '/'); - } elseif (0 === strpos($url, '@')) { - // 解析到控制器 - $url = substr($url, 1); - } elseif ('' === $url) { - $url = $this->getAppName() . '/' . $request->controller() . '/' . $request->action(); - } else { - // 解析到 应用/控制器/操作 - $controller = $request->controller(); - $app = $this->getAppName(); - $path = explode('/', $url); - $action = array_pop($path); - $controller = empty($path) ? $controller : array_pop($path); - $app = empty($path) ? $app : array_pop($path); - $url = $controller . '/' . $action; - $bind = $this->app->config->get('app.domain_bind', []); - - if ($key = array_search($this->app->http->getName(), $bind)) { - isset($bind[$_SERVER['SERVER_NAME']]) && $domain = $_SERVER['SERVER_NAME']; - - $domain = is_bool($domain) ? $key : $domain; - } else { - $url = $app . '/' . $url; - } - } - - return $url; - } - - public function build() - { - // 解析URL - $url = $this->url; - $suffix = $this->suffix; - $domain = $this->domain; - $request = $this->app->request; - $vars = $this->vars; - - if (0 === strpos($url, '[') && $pos = strpos($url, ']')) { - // [name] 表示使用路由命名标识生成URL - $name = substr($url, 1, $pos - 1); - $url = 'name' . substr($url, $pos + 1); - } - - if (false === strpos($url, '://') && 0 !== strpos($url, '/')) { - $info = parse_url($url); - $url = !empty($info['path']) ? $info['path'] : ''; - - if (isset($info['fragment'])) { - // 解析锚点 - $anchor = $info['fragment']; - - if (false !== strpos($anchor, '?')) { - // 解析参数 - list($anchor, $info['query']) = explode('?', $anchor, 2); - } - - if (false !== strpos($anchor, '@')) { - // 解析域名 - list($anchor, $domain) = explode('@', $anchor, 2); - } - } elseif (strpos($url, '@') && false === strpos($url, '\\')) { - // 解析域名 - list($url, $domain) = explode('@', $url, 2); - } - } - - if ($url) { - $checkName = isset($name) ? $name : $url . (isset($info['query']) ? '?' . $info['query'] : ''); - $checkDomain = $domain && is_string($domain) ? $domain : null; - - $rule = $this->route->getName($checkName, $checkDomain); - - if (empty($rule) && isset($info['query'])) { - $rule = $this->route->getName($url, $checkDomain); - // 解析地址里面参数 合并到vars - parse_str($info['query'], $params); - $vars = array_merge($params, $vars); - unset($info['query']); - } - } - - if (!empty($rule) && $match = $this->getRuleUrl($rule, $vars, $domain)) { - // 匹配路由命名标识 - $url = $match[0]; - - if ($domain && !empty($match[1])) { - $domain = $match[1]; - } - - if (!is_null($match[2])) { - $suffix = $match[2]; - } - - if (!$this->app->http->isBind()) { - $app = $this->getAppName(); - $url = $app . '/' . $url; - } - } elseif (!empty($rule) && isset($name)) { - throw new \InvalidArgumentException('route name not exists:' . $name); - } else { - // 检测URL绑定 - $bind = $this->route->getDomainBind($domain && is_string($domain) ? $domain : null); - - if ($bind && 0 === strpos($url, $bind)) { - $url = substr($url, strlen($bind) + 1); - } else { - $binds = $this->route->getBind(); - - foreach ($binds as $key => $val) { - if (is_string($val) && 0 === strpos($url, $val) && substr_count($val, '/') > 1) { - $url = substr($url, strlen($val) + 1); - $domain = $key; - break; - } - } - } - - // 路由标识不存在 直接解析 - $url = $this->parseUrl($url, $domain); - - if (isset($info['query'])) { - // 解析地址里面参数 合并到vars - parse_str($info['query'], $params); - $vars = array_merge($params, $vars); - } - } - - // 还原URL分隔符 - $depr = $this->route->config('pathinfo_depr'); - $url = str_replace('/', $depr, $url); - - $file = $request->baseFile(); - if ($file && 0 !== strpos($request->url(), $file)) { - $file = str_replace('\\', '/', dirname($file)); - } - - $url = rtrim($file, '/') . '/' . ltrim($url, '/'); - - // URL后缀 - if ('/' == substr($url, -1) || '' == $url) { - $suffix = ''; - } else { - $suffix = $this->parseSuffix($suffix); - } - - // 锚点 - $anchor = !empty($anchor) ? '#' . $anchor : ''; - - // 参数组装 - if (!empty($vars)) { - // 添加参数 - if ($this->route->config('url_common_param')) { - $vars = http_build_query($vars); - $url .= $suffix . '?' . $vars . $anchor; - } else { - foreach ($vars as $var => $val) { - $val = (string) $val; - if ('' !== $val) { - $url .= $depr . $var . $depr . urlencode($val); - } - } - - $url .= $suffix . $anchor; - } - } else { - $url .= $suffix . $anchor; - } - - // 检测域名 - $domain = $this->parseDomain($url, $domain); - - // URL组装 - return $domain . rtrim($this->root, '/') . '/' . ltrim($url, '/'); - } - - /** - * 获取URL的应用名 - * @access protected - * @return string - */ - protected function getAppName() - { - $app = $this->app->http->getName(); - $map = $this->app->config->get('app.app_map', []); - - if ($key = array_search($app, $map)) { - $app = $key; - } - - return $app; - } -} diff --git a/vendor/topthink/think-multi-app/src/command/Build.php b/vendor/topthink/think-multi-app/src/command/Build.php deleted file mode 100644 index 65b2f87..0000000 --- a/vendor/topthink/think-multi-app/src/command/Build.php +++ /dev/null @@ -1,180 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\app\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Argument; -use think\console\Output; - -class Build extends Command -{ - /** - * 应用基础目录 - * @var string - */ - protected $basePath; - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->setName('build') - ->addArgument('app', Argument::OPTIONAL, 'app name .') - ->setDescription('Build App Dirs'); - } - - protected function execute(Input $input, Output $output) - { - $this->basePath = $this->app->getBasePath(); - $app = $input->getArgument('app') ?: ''; - - if (is_file($this->basePath . 'build.php')) { - $list = include $this->basePath . 'build.php'; - } else { - $list = [ - '__dir__' => ['controller', 'model', 'view'], - ]; - } - - $this->buildApp($app, $list); - $output->writeln("Successed"); - - } - - /** - * 创建应用 - * @access protected - * @param string $app 应用名 - * @param array $list 目录结构 - * @return void - */ - protected function buildApp(string $app, array $list = []): void - { - if (!is_dir($this->basePath . $app)) { - // 创建应用目录 - mkdir($this->basePath . $app); - } - - $appPath = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : ''); - $namespace = 'app' . ($app ? '\\' . $app : ''); - - // 创建配置文件和公共文件 - $this->buildCommon($app); - // 创建模块的默认页面 - $this->buildHello($app, $namespace); - - foreach ($list as $path => $file) { - if ('__dir__' == $path) { - // 生成子目录 - foreach ($file as $dir) { - $this->checkDirBuild($appPath . $dir); - } - } elseif ('__file__' == $path) { - // 生成(空白)文件 - foreach ($file as $name) { - if (!is_file($appPath . $name)) { - file_put_contents($appPath . $name, 'php' == pathinfo($name, PATHINFO_EXTENSION) ? 'app->config->get('route.controller_suffix')) { - $filename = $appPath . $path . DIRECTORY_SEPARATOR . $val . 'Controller.php'; - $class = $val . 'Controller'; - } - $content = "checkDirBuild(dirname($filename)); - $content = ''; - break; - default: - // 其他文件 - $content = "app->config->get('route.controller_suffix') ? 'Controller' : ''; - $filename = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : '') . 'controller' . DIRECTORY_SEPARATOR . 'Index' . $suffix . '.php'; - - if (!is_file($filename)) { - $content = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'controller.stub'); - $content = str_replace(['{%name%}', '{%app%}', '{%layer%}', '{%suffix%}'], [$app, $namespace, 'controller', $suffix], $content); - $this->checkDirBuild(dirname($filename)); - - file_put_contents($filename, $content); - } - } - - /** - * 创建应用的公共文件 - * @access protected - * @param string $app 目录 - * @return void - */ - protected function buildCommon(string $app): void - { - $appPath = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : ''); - - if (!is_file($appPath . 'common.php')) { - file_put_contents($appPath . 'common.php', " -// +---------------------------------------------------------------------- -namespace think\app\command; - -use think\console\Command; -use think\console\Input; -use think\console\input\Argument; -use think\console\input\Option; -use think\console\Output; - -class Clear extends Command -{ - protected function configure() - { - // 指令配置 - $this->setName('clear') - ->addArgument('app', Argument::OPTIONAL, 'app name .') - ->addOption('cache', 'c', Option::VALUE_NONE, 'clear cache file') - ->addOption('log', 'l', Option::VALUE_NONE, 'clear log file') - ->addOption('dir', 'r', Option::VALUE_NONE, 'clear empty dir') - ->setDescription('Clear runtime file'); - } - - protected function execute(Input $input, Output $output) - { - $app = $input->getArgument('app') ?: ''; - $runtimePath = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . ($app ? $app . DIRECTORY_SEPARATOR : ''); - - if ($input->getOption('cache')) { - $path = $runtimePath . 'cache'; - } elseif ($input->getOption('log')) { - $path = $runtimePath . 'log'; - } else { - $path = $runtimePath; - } - - $rmdir = $input->getOption('dir') ? true : false; - $this->clear(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $rmdir); - - $output->writeln("Clear Successed"); - } - - protected function clear(string $path, bool $rmdir): void - { - $files = is_dir($path) ? scandir($path) : []; - - foreach ($files as $file) { - if ('.' != $file && '..' != $file && is_dir($path . $file)) { - array_map('unlink', glob($path . $file . DIRECTORY_SEPARATOR . '*.*')); - if ($rmdir) { - rmdir($path . $file); - } - } elseif ('.gitignore' != $file && is_file($path . $file)) { - unlink($path . $file); - } - } - } -} diff --git a/vendor/topthink/think-multi-app/src/command/stubs/controller.stub b/vendor/topthink/think-multi-app/src/command/stubs/controller.stub deleted file mode 100644 index 263c4c6..0000000 --- a/vendor/topthink/think-multi-app/src/command/stubs/controller.stub +++ /dev/null @@ -1,12 +0,0 @@ -=7.1.0", - "ext-json": "*", - "ext-pdo": "*", - "psr/simple-cache": "^1.0", - "psr/log": "~1.0", - "topthink/think-helper":"^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7|^8|^9.5" - }, - "autoload": { - "psr-4": { - "think\\": "src" - }, - "files": [ - "stubs/load_stubs.php" - ] - }, - "autoload-dev": { - "psr-4": { - "tests\\": "tests" - } - }, - "config": { - "sort-packages": true - } -} diff --git a/vendor/topthink/think-orm/src/DbManager.php b/vendor/topthink/think-orm/src/DbManager.php deleted file mode 100644 index 147d9f6..0000000 --- a/vendor/topthink/think-orm/src/DbManager.php +++ /dev/null @@ -1,376 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use InvalidArgumentException; -use Psr\Log\LoggerInterface; -use Psr\SimpleCache\CacheInterface; -use think\db\BaseQuery; -use think\db\ConnectionInterface; -use think\db\Query; -use think\db\Raw; - -/** - * Class DbManager - * @package think - * @mixin BaseQuery - * @mixin Query - */ -class DbManager -{ - /** - * 数据库连接实例 - * @var array - */ - protected $instance = []; - - /** - * 数据库配置 - * @var array - */ - protected $config = []; - - /** - * Event对象或者数组 - * @var array|object - */ - protected $event; - - /** - * SQL监听 - * @var array - */ - protected $listen = []; - - /** - * SQL日志 - * @var array - */ - protected $dbLog = []; - - /** - * 查询次数 - * @var int - */ - protected $queryTimes = 0; - - /** - * 查询缓存对象 - * @var CacheInterface - */ - protected $cache; - - /** - * 查询日志对象 - * @var LoggerInterface - */ - protected $log; - - /** - * 架构函数 - * @access public - */ - public function __construct() - { - $this->modelMaker(); - } - - /** - * 注入模型对象 - * @access public - * @return void - */ - protected function modelMaker() - { - Model::setDb($this); - - if (is_object($this->event)) { - Model::setEvent($this->event); - } - - Model::maker(function (Model $model) { - $isAutoWriteTimestamp = $model->getAutoWriteTimestamp(); - - if (is_null($isAutoWriteTimestamp)) { - // 自动写入时间戳 - $model->isAutoWriteTimestamp($this->getConfig('auto_timestamp', true)); - } - - $dateFormat = $model->getDateFormat(); - - if (is_null($dateFormat)) { - // 设置时间戳格式 - $model->setDateFormat($this->getConfig('datetime_format', 'Y-m-d H:i:s')); - } - }); - } - - /** - * 监听SQL - * @access protected - * @return void - */ - public function triggerSql(): void - {} - - /** - * 初始化配置参数 - * @access public - * @param array $config 连接配置 - * @return void - */ - public function setConfig($config): void - { - $this->config = $config; - } - - /** - * 设置缓存对象 - * @access public - * @param CacheInterface $cache 缓存对象 - * @return void - */ - public function setCache(CacheInterface $cache): void - { - $this->cache = $cache; - } - - /** - * 设置日志对象 - * @access public - * @param LoggerInterface $log 日志对象 - * @return void - */ - public function setLog(LoggerInterface $log): void - { - $this->log = $log; - } - - /** - * 记录SQL日志 - * @access protected - * @param string $log SQL日志信息 - * @param string $type 日志类型 - * @return void - */ - public function log(string $log, string $type = 'sql') - { - if ($this->log) { - $this->log->log($type, $log); - } else { - $this->dbLog[$type][] = $log; - } - } - - /** - * 获得查询日志(没有设置日志对象使用) - * @access public - * @param bool $clear 是否清空 - * @return array - */ - public function getDbLog(bool $clear = false): array - { - $logs = $this->dbLog; - if ($clear) { - $this->dbLog = []; - } - - return $logs; - } - - /** - * 获取配置参数 - * @access public - * @param string $name 配置参数 - * @param mixed $default 默认值 - * @return mixed - */ - public function getConfig(string $name = '', $default = null) - { - if ('' === $name) { - return $this->config; - } - - return $this->config[$name] ?? $default; - } - - /** - * 创建/切换数据库连接查询 - * @access public - * @param string|null $name 连接配置标识 - * @param bool $force 强制重新连接 - * @return ConnectionInterface - */ - public function connect(string $name = null, bool $force = false) - { - return $this->instance($name, $force); - } - - /** - * 创建数据库连接实例 - * @access protected - * @param string|null $name 连接标识 - * @param bool $force 强制重新连接 - * @return ConnectionInterface - */ - protected function instance(string $name = null, bool $force = false): ConnectionInterface - { - if (empty($name)) { - $name = $this->getConfig('default', 'mysql'); - } - - if ($force || !isset($this->instance[$name])) { - $this->instance[$name] = $this->createConnection($name); - } - - return $this->instance[$name]; - } - - /** - * 获取连接配置 - * @param string $name - * @return array - */ - protected function getConnectionConfig(string $name): array - { - $connections = $this->getConfig('connections'); - if (!isset($connections[$name])) { - throw new InvalidArgumentException('Undefined db config:' . $name); - } - - return $connections[$name]; - } - - /** - * 创建连接 - * @param $name - * @return ConnectionInterface - */ - protected function createConnection(string $name): ConnectionInterface - { - $config = $this->getConnectionConfig($name); - - $type = !empty($config['type']) ? $config['type'] : 'mysql'; - - if (false !== strpos($type, '\\')) { - $class = $type; - } else { - $class = '\\think\\db\\connector\\' . ucfirst($type); - } - - /** @var ConnectionInterface $connection */ - $connection = new $class($config); - $connection->setDb($this); - - if ($this->cache) { - $connection->setCache($this->cache); - } - - return $connection; - } - - /** - * 使用表达式设置数据 - * @access public - * @param string $value 表达式 - * @return Raw - */ - public function raw(string $value): Raw - { - return new Raw($value); - } - - /** - * 更新查询次数 - * @access public - * @return void - */ - public function updateQueryTimes(): void - { - $this->queryTimes++; - } - - /** - * 重置查询次数 - * @access public - * @return void - */ - public function clearQueryTimes(): void - { - $this->queryTimes = 0; - } - - /** - * 获得查询次数 - * @access public - * @return integer - */ - public function getQueryTimes(): int - { - return $this->queryTimes; - } - - /** - * 监听SQL执行 - * @access public - * @param callable $callback 回调方法 - * @return void - */ - public function listen(callable $callback): void - { - $this->listen[] = $callback; - } - - /** - * 获取监听SQL执行 - * @access public - * @return array - */ - public function getListen(): array - { - return $this->listen; - } - - /** - * 注册回调方法 - * @access public - * @param string $event 事件名 - * @param callable $callback 回调方法 - * @return void - */ - public function event(string $event, callable $callback): void - { - $this->event[$event][] = $callback; - } - - /** - * 触发事件 - * @access public - * @param string $event 事件名 - * @param mixed $params 传入参数 - * @return mixed - */ - public function trigger(string $event, $params = null) - { - if (isset($this->event[$event])) { - foreach ($this->event[$event] as $callback) { - call_user_func_array($callback, [$this]); - } - } - } - - public function __call($method, $args) - { - return call_user_func_array([$this->connect(), $method], $args); - } -} diff --git a/vendor/topthink/think-orm/src/Model.php b/vendor/topthink/think-orm/src/Model.php deleted file mode 100644 index 0cb74e9..0000000 --- a/vendor/topthink/think-orm/src/Model.php +++ /dev/null @@ -1,1072 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use ArrayAccess; -use Closure; -use JsonSerializable; -use think\contract\Arrayable; -use think\contract\Jsonable; -use think\db\BaseQuery as Query; - -/** - * Class Model - * @package think - * @mixin Query - * @method void onAfterRead(Model $model) static after_read事件定义 - * @method mixed onBeforeInsert(Model $model) static before_insert事件定义 - * @method void onAfterInsert(Model $model) static after_insert事件定义 - * @method mixed onBeforeUpdate(Model $model) static before_update事件定义 - * @method void onAfterUpdate(Model $model) static after_update事件定义 - * @method mixed onBeforeWrite(Model $model) static before_write事件定义 - * @method void onAfterWrite(Model $model) static after_write事件定义 - * @method mixed onBeforeDelete(Model $model) static before_write事件定义 - * @method void onAfterDelete(Model $model) static after_delete事件定义 - * @method void onBeforeRestore(Model $model) static before_restore事件定义 - * @method void onAfterRestore(Model $model) static after_restore事件定义 - */ -abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonable -{ - use model\concern\Attribute; - use model\concern\RelationShip; - use model\concern\ModelEvent; - use model\concern\TimeStamp; - use model\concern\Conversion; - - /** - * 数据是否存在 - * @var bool - */ - private $exists = false; - - /** - * 是否强制更新所有数据 - * @var bool - */ - private $force = false; - - /** - * 是否Replace - * @var bool - */ - private $replace = false; - - /** - * 数据表后缀 - * @var string - */ - protected $suffix; - - /** - * 更新条件 - * @var array - */ - private $updateWhere; - - /** - * 数据库配置 - * @var string - */ - protected $connection; - - /** - * 模型名称 - * @var string - */ - protected $name; - - /** - * 主键值 - * @var string - */ - protected $key; - - /** - * 数据表名称 - * @var string - */ - protected $table; - - /** - * 初始化过的模型. - * @var array - */ - protected static $initialized = []; - - /** - * 软删除字段默认值 - * @var mixed - */ - protected $defaultSoftDelete; - - /** - * 全局查询范围 - * @var array - */ - protected $globalScope = []; - - /** - * 延迟保存信息 - * @var bool - */ - private $lazySave = false; - - /** - * Db对象 - * @var DbManager - */ - protected static $db; - - /** - * 容器对象的依赖注入方法 - * @var callable - */ - protected static $invoker; - - /** - * 服务注入 - * @var Closure[] - */ - protected static $maker = []; - - /** - * 方法注入 - * @var Closure[][] - */ - protected static $macro = []; - - /** - * 设置服务注入 - * @access public - * @param Closure $maker - * @return void - */ - public static function maker(Closure $maker) - { - static::$maker[] = $maker; - } - - /** - * 设置方法注入 - * @access public - * @param string $method - * @param Closure $closure - * @return void - */ - public static function macro(string $method, Closure $closure) - { - if (!isset(static::$macro[static::class])) { - static::$macro[static::class] = []; - } - static::$macro[static::class][$method] = $closure; - } - - /** - * 设置Db对象 - * @access public - * @param DbManager $db Db对象 - * @return void - */ - public static function setDb(DbManager $db) - { - self::$db = $db; - } - - /** - * 设置容器对象的依赖注入方法 - * @access public - * @param callable $callable 依赖注入方法 - * @return void - */ - public static function setInvoker(callable $callable): void - { - self::$invoker = $callable; - } - - /** - * 调用反射执行模型方法 支持参数绑定 - * @access public - * @param mixed $method - * @param array $vars 参数 - * @return mixed - */ - public function invoke($method, array $vars = []) - { - if (self::$invoker) { - $call = self::$invoker; - return $call($method instanceof Closure ? $method : Closure::fromCallable([$this, $method]), $vars); - } - - return call_user_func_array($method instanceof Closure ? $method : [$this, $method], $vars); - } - - /** - * 架构函数 - * @access public - * @param array $data 数据 - */ - public function __construct(array $data = []) - { - $this->data = $data; - - if (!empty($this->data)) { - // 废弃字段 - foreach ((array) $this->disuse as $key) { - if (array_key_exists($key, $this->data)) { - unset($this->data[$key]); - } - } - } - - // 记录原始数据 - $this->origin = $this->data; - - if (empty($this->name)) { - // 当前模型名 - $name = str_replace('\\', '/', static::class); - $this->name = basename($name); - } - - if (!empty(static::$maker)) { - foreach (static::$maker as $maker) { - call_user_func($maker, $this); - } - } - - // 执行初始化操作 - $this->initialize(); - } - - /** - * 获取当前模型名称 - * @access public - * @return string - */ - public function getName(): string - { - return $this->name; - } - - /** - * 创建新的模型实例 - * @access public - * @param array $data 数据 - * @param mixed $where 更新条件 - * @return Model - */ - public function newInstance(array $data = [], $where = null): Model - { - $model = new static($data); - $model->readDataType(); - - if ($this->connection) { - $model->setConnection($this->connection); - } - - if ($this->suffix) { - $model->setSuffix($this->suffix); - } - - if (empty($data)) { - return $model; - } - - $model->exists(true); - - $model->setUpdateWhere($where); - - $model->trigger('AfterRead'); - - return $model; - } - - /** - * 设置模型的更新条件 - * @access protected - * @param mixed $where 更新条件 - * @return void - */ - protected function setUpdateWhere($where): void - { - $this->updateWhere = $where; - } - - /** - * 设置当前模型的数据库连接 - * @access public - * @param string $connection 数据表连接标识 - * @return $this - */ - public function setConnection(string $connection) - { - $this->connection = $connection; - return $this; - } - - /** - * 获取当前模型的数据库连接标识 - * @access public - * @return string - */ - public function getConnection(): string - { - return $this->connection ?: ''; - } - - /** - * 设置当前模型数据表的后缀 - * @access public - * @param string $suffix 数据表后缀 - * @return $this - */ - public function setSuffix(string $suffix) - { - $this->suffix = $suffix; - return $this; - } - - /** - * 获取当前模型的数据表后缀 - * @access public - * @return string - */ - public function getSuffix(): string - { - return $this->suffix ?: ''; - } - - /** - * 获取当前模型的数据库查询对象 - * @access public - * @param array $scope 设置不使用的全局查询范围 - * @return Query - */ - public function db($scope = []): Query - { - /** @var Query $query */ - $query = self::$db->connect($this->connection) - ->name($this->name . $this->suffix) - ->pk($this->pk); - - if (!empty($this->table)) { - $query->table($this->table . $this->suffix); - } - - $query->model($this) - ->json($this->json, $this->jsonAssoc) - ->setFieldType(array_merge($this->schema, $this->jsonType)); - - // 软删除 - if (property_exists($this, 'withTrashed') && !$this->withTrashed) { - $this->withNoTrashed($query); - } - - // 全局作用域 - if (is_array($scope)) { - $globalScope = array_diff($this->globalScope, $scope); - $query->scope($globalScope); - } - - // 返回当前模型的数据库查询对象 - return $query; - } - - /** - * 初始化模型 - * @access private - * @return void - */ - private function initialize(): void - { - if (!isset(static::$initialized[static::class])) { - static::$initialized[static::class] = true; - static::init(); - } - } - - /** - * 初始化处理 - * @access protected - * @return void - */ - protected static function init() - { - } - - protected function checkData(): void - { - } - - protected function checkResult($result): void - { - } - - /** - * 更新是否强制写入数据 而不做比较(亦可用于软删除的强制删除) - * @access public - * @param bool $force - * @return $this - */ - public function force(bool $force = true) - { - $this->force = $force; - return $this; - } - - /** - * 判断force - * @access public - * @return bool - */ - public function isForce(): bool - { - return $this->force; - } - - /** - * 新增数据是否使用Replace - * @access public - * @param bool $replace - * @return $this - */ - public function replace(bool $replace = true) - { - $this->replace = $replace; - return $this; - } - - /** - * 刷新模型数据 - * @access public - * @param bool $relation 是否刷新关联数据 - * @return $this - */ - public function refresh(bool $relation = false) - { - if ($this->exists) { - $this->data = $this->db()->find($this->getKey())->getData(); - $this->origin = $this->data; - $this->get = []; - $this->set = []; - $this->readDataType(); - - if ($relation) { - $this->relation = []; - } - } - - return $this; - } - - /** - * 设置数据是否存在 - * @access public - * @param bool $exists - * @return $this - */ - public function exists(bool $exists = true) - { - $this->exists = $exists; - return $this; - } - - /** - * 判断数据是否存在数据库 - * @access public - * @return bool - */ - public function isExists(): bool - { - return $this->exists; - } - - /** - * 判断模型是否为空 - * @access public - * @return bool - */ - public function isEmpty(): bool - { - return empty($this->data); - } - - /** - * 延迟保存当前数据对象 - * @access public - * @param array|bool $data 数据 - * @return void - */ - public function lazySave($data = []): void - { - if (false === $data) { - $this->lazySave = false; - } else { - if (is_array($data)) { - $this->setAttrs($data); - } - - $this->lazySave = true; - } - } - - /** - * 保存当前数据对象 - * @access public - * @param array $data 数据 - * @param string $sequence 自增序列名 - * @return bool - */ - public function save(array $data = [], string $sequence = null): bool - { - // 数据对象赋值 - $this->setAttrs($data); - - if ($this->isEmpty() || false === $this->trigger('BeforeWrite')) { - return false; - } - - $result = $this->exists ? $this->updateData() : $this->insertData($sequence); - - if (false === $result) { - return false; - } - - // 写入回调 - $this->trigger('AfterWrite'); - - // 重新记录原始数据 - $this->origin = $this->data; - $this->set = []; - $this->lazySave = false; - - return true; - } - - /** - * 检查数据是否允许写入 - * @access protected - * @return array - */ - protected function checkAllowFields(): array - { - // 检测字段 - if (empty($this->field)) { - if (!empty($this->schema)) { - $this->field = array_keys(array_merge($this->schema, $this->jsonType)); - } else { - $query = $this->db(); - $table = $this->table ? $this->table . $this->suffix : $query->getTable(); - - $this->field = $query->getConnection()->getTableFields($table); - } - - return $this->field; - } - - $field = $this->field; - - if ($this->autoWriteTimestamp) { - array_push($field, $this->createTime, $this->updateTime); - } - - if (!empty($this->disuse)) { - // 废弃字段 - $field = array_diff($field, $this->disuse); - } - - return $field; - } - - /** - * 保存写入数据 - * @access protected - * @return bool - */ - protected function updateData(): bool - { - // 事件回调 - if (false === $this->trigger('BeforeUpdate')) { - return false; - } - - $this->checkData(); - - // 获取有更新的数据 - $data = $this->getChangedData(); - - if (empty($data)) { - // 关联更新 - if (!empty($this->relationWrite)) { - $this->autoRelationUpdate(); - } - - return true; - } - - $data = $this->writeDataType($data); - - if ($this->autoWriteTimestamp && $this->updateTime) { - // 自动写入更新时间 - $data[$this->updateTime] = $this->autoWriteTimestamp(); - $this->data[$this->updateTime] = $this->getTimestampValue($data[$this->updateTime]); - } - - // 检查允许字段 - $allowFields = $this->checkAllowFields(); - - foreach ($this->relationWrite as $name => $val) { - if (!is_array($val)) { - continue; - } - - foreach ($val as $key) { - if (isset($data[$key])) { - unset($data[$key]); - } - } - } - - // 模型更新 - $db = $this->db(); - - $db->transaction(function () use ($data, $allowFields, $db) { - $this->key = null; - $where = $this->getWhere(); - - $result = $db->where($where) - ->strict(false) - ->cache(true) - ->setOption('key', $this->key) - ->field($allowFields) - ->update($data); - - $this->checkResult($result); - - // 关联更新 - if (!empty($this->relationWrite)) { - $this->autoRelationUpdate(); - } - }); - - // 更新回调 - $this->trigger('AfterUpdate'); - - return true; - } - - /** - * 新增写入数据 - * @access protected - * @param string $sequence 自增名 - * @return bool - */ - protected function insertData(string $sequence = null): bool - { - if (false === $this->trigger('BeforeInsert')) { - return false; - } - - $this->checkData(); - $data = $this->writeDataType($this->data); - - // 时间戳自动写入 - if ($this->autoWriteTimestamp) { - if ($this->createTime && !isset($data[$this->createTime])) { - $data[$this->createTime] = $this->autoWriteTimestamp(); - $this->data[$this->createTime] = $this->getTimestampValue($data[$this->createTime]); - } - - if ($this->updateTime && !isset($data[$this->updateTime])) { - $data[$this->updateTime] = $this->autoWriteTimestamp(); - $this->data[$this->updateTime] = $this->getTimestampValue($data[$this->updateTime]); - } - } - - // 检查允许字段 - $allowFields = $this->checkAllowFields(); - - $db = $this->db(); - - $db->transaction(function () use ($data, $sequence, $allowFields, $db) { - $result = $db->strict(false) - ->field($allowFields) - ->replace($this->replace) - ->sequence($sequence) - ->insert($data, true); - - // 获取自动增长主键 - if ($result) { - $pk = $this->getPk(); - - if (is_string($pk) && (!isset($this->data[$pk]) || '' == $this->data[$pk])) { - $this->data[$pk] = $result; - } - } - - // 关联写入 - if (!empty($this->relationWrite)) { - $this->autoRelationInsert(); - } - }); - - // 标记数据已经存在 - $this->exists = true; - - // 新增回调 - $this->trigger('AfterInsert'); - - return true; - } - - /** - * 获取当前的更新条件 - * @access public - * @return mixed - */ - public function getWhere() - { - $pk = $this->getPk(); - - if (is_string($pk) && isset($this->origin[$pk])) { - $where = [[$pk, '=', $this->origin[$pk]]]; - $this->key = $this->origin[$pk]; - } elseif (is_array($pk)) { - foreach ($pk as $field) { - if (isset($this->origin[$field])) { - $where[] = [$field, '=', $this->origin[$field]]; - } - } - } - - if (empty($where)) { - $where = empty($this->updateWhere) ? null : $this->updateWhere; - } - - return $where; - } - - /** - * 保存多个数据到当前数据对象 - * @access public - * @param iterable $dataSet 数据 - * @param boolean $replace 是否自动识别更新和写入 - * @return Collection - * @throws \Exception - */ - public function saveAll(iterable $dataSet, bool $replace = true): Collection - { - $db = $this->db(); - - $result = $db->transaction(function () use ($replace, $dataSet) { - - $pk = $this->getPk(); - - if (is_string($pk) && $replace) { - $auto = true; - } - - $result = []; - - $suffix = $this->getSuffix(); - - foreach ($dataSet as $key => $data) { - if ($this->exists || (!empty($auto) && isset($data[$pk]))) { - $result[$key] = static::update($data, [], [], $suffix); - } else { - $result[$key] = static::create($data, $this->field, $this->replace, $suffix); - } - } - - return $result; - }); - - return $this->toCollection($result); - } - - /** - * 删除当前的记录 - * @access public - * @return bool - */ - public function delete(): bool - { - if (!$this->exists || $this->isEmpty() || false === $this->trigger('BeforeDelete')) { - return false; - } - - // 读取更新条件 - $where = $this->getWhere(); - - $db = $this->db(); - - $db->transaction(function () use ($where, $db) { - // 删除当前模型数据 - $db->where($where)->delete(); - - // 关联删除 - if (!empty($this->relationWrite)) { - $this->autoRelationDelete(); - } - }); - - $this->trigger('AfterDelete'); - - $this->exists = false; - $this->lazySave = false; - - return true; - } - - /** - * 写入数据 - * @access public - * @param array $data 数据数组 - * @param array $allowField 允许字段 - * @param bool $replace 使用Replace - * @param string $suffix 数据表后缀 - * @return static - */ - public static function create(array $data, array $allowField = [], bool $replace = false, string $suffix = ''): Model - { - $model = new static(); - - if (!empty($allowField)) { - $model->allowField($allowField); - } - - if (!empty($suffix)) { - $model->setSuffix($suffix); - } - - $model->replace($replace)->save($data); - - return $model; - } - - /** - * 更新数据 - * @access public - * @param array $data 数据数组 - * @param mixed $where 更新条件 - * @param array $allowField 允许字段 - * @param string $suffix 数据表后缀 - * @return static - */ - public static function update(array $data, $where = [], array $allowField = [], string $suffix = '') - { - $model = new static(); - - if (!empty($allowField)) { - $model->allowField($allowField); - } - - if (!empty($where)) { - $model->setUpdateWhere($where); - } - - if (!empty($suffix)) { - $model->setSuffix($suffix); - } - - $model->exists(true)->save($data); - - return $model; - } - - /** - * 删除记录 - * @access public - * @param mixed $data 主键列表 支持闭包查询条件 - * @param bool $force 是否强制删除 - * @return bool - */ - public static function destroy($data, bool $force = false): bool - { - if (empty($data) && 0 !== $data) { - return false; - } - - $model = new static(); - - $query = $model->db(); - - if (is_array($data) && key($data) !== 0) { - $query->where($data); - $data = null; - } elseif ($data instanceof \Closure) { - $data($query); - $data = null; - } - - $resultSet = $query->select($data); - - foreach ($resultSet as $result) { - $result->force($force)->delete(); - } - - return true; - } - - /** - * 解序列化后处理 - */ - public function __wakeup() - { - $this->initialize(); - } - - /** - * 修改器 设置数据对象的值 - * @access public - * @param string $name 名称 - * @param mixed $value 值 - * @return void - */ - public function __set(string $name, $value): void - { - $this->setAttr($name, $value); - } - - /** - * 获取器 获取数据对象的值 - * @access public - * @param string $name 名称 - * @return mixed - */ - public function __get(string $name) - { - return $this->getAttr($name); - } - - /** - * 检测数据对象的值 - * @access public - * @param string $name 名称 - * @return bool - */ - public function __isset(string $name): bool - { - return !is_null($this->getAttr($name)); - } - - /** - * 销毁数据对象的值 - * @access public - * @param string $name 名称 - * @return void - */ - public function __unset(string $name): void - { - unset($this->data[$name], - $this->get[$name], - $this->set[$name], - $this->relation[$name]); - } - - // ArrayAccess - public function offsetSet($name, $value) - { - $this->setAttr($name, $value); - } - - public function offsetExists($name): bool - { - return $this->__isset($name); - } - - public function offsetUnset($name) - { - $this->__unset($name); - } - - public function offsetGet($name) - { - return $this->getAttr($name); - } - - /** - * 设置不使用的全局查询范围 - * @access public - * @param array $scope 不启用的全局查询范围 - * @return Query - */ - public static function withoutGlobalScope(array $scope = null) - { - $model = new static(); - - return $model->db($scope); - } - - /** - * 切换后缀进行查询 - * @access public - * @param string $suffix 切换的表后缀 - * @return Model - */ - public static function suffix(string $suffix) - { - $model = new static(); - $model->setSuffix($suffix); - - return $model; - } - - /** - * 切换数据库连接进行查询 - * @access public - * @param string $connection 数据库连接标识 - * @return Model - */ - public static function connect(string $connection) - { - $model = new static(); - $model->setConnection($connection); - - return $model; - } - - public function __call($method, $args) - { - if (isset(static::$macro[static::class][$method])) { - return call_user_func_array(static::$macro[static::class][$method]->bindTo($this, static::class), $args); - } - - if ('withattr' == strtolower($method)) { - return call_user_func_array([$this, 'withAttribute'], $args); - } - - return call_user_func_array([$this->db(), $method], $args); - } - - public static function __callStatic($method, $args) - { - if (isset(static::$macro[static::class][$method])) { - return call_user_func_array(static::$macro[static::class][$method]->bindTo(null, static::class), $args); - } - - $model = new static(); - - return call_user_func_array([$model->db(), $method], $args); - } - - /** - * 析构方法 - * @access public - */ - public function __destruct() - { - if ($this->lazySave) { - $this->save(); - } - } -} diff --git a/vendor/topthink/think-orm/src/Paginator.php b/vendor/topthink/think-orm/src/Paginator.php deleted file mode 100644 index f5d8006..0000000 --- a/vendor/topthink/think-orm/src/Paginator.php +++ /dev/null @@ -1,518 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use ArrayAccess; -use ArrayIterator; -use Closure; -use Countable; -use DomainException; -use IteratorAggregate; -use JsonSerializable; -use think\paginator\driver\Bootstrap; -use Traversable; - -/** - * 分页基础类 - * @mixin Collection - */ -abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, JsonSerializable -{ - /** - * 是否简洁模式 - * @var bool - */ - protected $simple = false; - - /** - * 数据集 - * @var Collection - */ - protected $items; - - /** - * 当前页 - * @var int - */ - protected $currentPage; - - /** - * 最后一页 - * @var int - */ - protected $lastPage; - - /** - * 数据总数 - * @var integer|null - */ - protected $total; - - /** - * 每页数量 - * @var int - */ - protected $listRows; - - /** - * 是否有下一页 - * @var bool - */ - protected $hasMore; - - /** - * 分页配置 - * @var array - */ - protected $options = [ - 'var_page' => 'page', - 'path' => '/', - 'query' => [], - 'fragment' => '', - ]; - - /** - * 获取当前页码 - * @var Closure - */ - protected static $currentPageResolver; - - /** - * 获取当前路径 - * @var Closure - */ - protected static $currentPathResolver; - - /** - * @var Closure - */ - protected static $maker; - - public function __construct($items, int $listRows, int $currentPage = 1, int $total = null, bool $simple = false, array $options = []) - { - $this->options = array_merge($this->options, $options); - - $this->options['path'] = '/' != $this->options['path'] ? rtrim($this->options['path'], '/') : $this->options['path']; - - $this->simple = $simple; - $this->listRows = $listRows; - - if (!$items instanceof Collection) { - $items = Collection::make($items); - } - - if ($simple) { - $this->currentPage = $this->setCurrentPage($currentPage); - $this->hasMore = count($items) > ($this->listRows); - $items = $items->slice(0, $this->listRows); - } else { - $this->total = $total; - $this->lastPage = (int) ceil($total / $listRows); - $this->currentPage = $this->setCurrentPage($currentPage); - $this->hasMore = $this->currentPage < $this->lastPage; - } - $this->items = $items; - } - - /** - * @access public - * @param mixed $items - * @param int $listRows - * @param int $currentPage - * @param int $total - * @param bool $simple - * @param array $options - * @return Paginator - */ - public static function make($items, int $listRows, int $currentPage = 1, int $total = null, bool $simple = false, array $options = []) - { - if (isset(static::$maker)) { - return call_user_func(static::$maker, $items, $listRows, $currentPage, $total, $simple, $options); - } - - return new Bootstrap($items, $listRows, $currentPage, $total, $simple, $options); - } - - public static function maker(Closure $resolver) - { - static::$maker = $resolver; - } - - protected function setCurrentPage(int $currentPage): int - { - if (!$this->simple && $currentPage > $this->lastPage) { - return $this->lastPage > 0 ? $this->lastPage : 1; - } - - return $currentPage; - } - - /** - * 获取页码对应的链接 - * - * @access protected - * @param int $page - * @return string - */ - protected function url(int $page): string - { - if ($page <= 0) { - $page = 1; - } - - if (strpos($this->options['path'], '[PAGE]') === false) { - $parameters = [$this->options['var_page'] => $page]; - $path = $this->options['path']; - } else { - $parameters = []; - $path = str_replace('[PAGE]', $page, $this->options['path']); - } - - if (count($this->options['query']) > 0) { - $parameters = array_merge($this->options['query'], $parameters); - } - - $url = $path; - if (!empty($parameters)) { - $url .= '?' . http_build_query($parameters, '', '&'); - } - - return $url . $this->buildFragment(); - } - - /** - * 自动获取当前页码 - * @access public - * @param string $varPage - * @param int $default - * @return int - */ - public static function getCurrentPage(string $varPage = 'page', int $default = 1): int - { - if (isset(static::$currentPageResolver)) { - return call_user_func(static::$currentPageResolver, $varPage); - } - - return $default; - } - - /** - * 设置获取当前页码闭包 - * @param Closure $resolver - */ - public static function currentPageResolver(Closure $resolver) - { - static::$currentPageResolver = $resolver; - } - - /** - * 自动获取当前的path - * @access public - * @param string $default - * @return string - */ - public static function getCurrentPath($default = '/'): string - { - if (isset(static::$currentPathResolver)) { - return call_user_func(static::$currentPathResolver); - } - - return $default; - } - - /** - * 设置获取当前路径闭包 - * @param Closure $resolver - */ - public static function currentPathResolver(Closure $resolver) - { - static::$currentPathResolver = $resolver; - } - - /** - * 获取数据总条数 - * @return int - */ - public function total(): int - { - if ($this->simple) { - throw new DomainException('not support total'); - } - - return $this->total; - } - - /** - * 获取每页数量 - * @return int - */ - public function listRows(): int - { - return $this->listRows; - } - - /** - * 获取当前页页码 - * @return int - */ - public function currentPage(): int - { - return $this->currentPage; - } - - /** - * 获取最后一页页码 - * @return int - */ - public function lastPage(): int - { - if ($this->simple) { - throw new DomainException('not support last'); - } - - return $this->lastPage; - } - - /** - * 数据是否足够分页 - * @access public - * @return bool - */ - public function hasPages(): bool - { - return !(1 == $this->currentPage && !$this->hasMore); - } - - /** - * 创建一组分页链接 - * - * @access public - * @param int $start - * @param int $end - * @return array - */ - public function getUrlRange(int $start, int $end): array - { - $urls = []; - - for ($page = $start; $page <= $end; $page++) { - $urls[$page] = $this->url($page); - } - - return $urls; - } - - /** - * 设置URL锚点 - * - * @access public - * @param string|null $fragment - * @return $this - */ - public function fragment(string $fragment = null) - { - $this->options['fragment'] = $fragment; - - return $this; - } - - /** - * 添加URL参数 - * - * @access public - * @param array $append - * @return $this - */ - public function appends(array $append) - { - foreach ($append as $k => $v) { - if ($k !== $this->options['var_page']) { - $this->options['query'][$k] = $v; - } - } - - return $this; - } - - /** - * 构造锚点字符串 - * - * @access public - * @return string - */ - protected function buildFragment(): string - { - return $this->options['fragment'] ? '#' . $this->options['fragment'] : ''; - } - - /** - * 渲染分页html - * @access public - * @return mixed - */ - abstract public function render(); - - public function items() - { - return $this->items->all(); - } - - /** - * 获取数据集 - * - * @return Collection|\think\model\Collection - */ - public function getCollection() - { - return $this->items; - } - - public function isEmpty(): bool - { - return $this->items->isEmpty(); - } - - /** - * 给每个元素执行个回调 - * - * @access public - * @param callable $callback - * @return $this - */ - public function each(callable $callback) - { - foreach ($this->items as $key => $item) { - $result = $callback($item, $key); - - if (false === $result) { - break; - } elseif (!is_object($item)) { - $this->items[$key] = $result; - } - } - - return $this; - } - - /** - * Retrieve an external iterator - * @access public - * @return Traversable An instance of an object implementing Iterator or - * Traversable - */ - public function getIterator() - { - return new ArrayIterator($this->items->all()); - } - - /** - * Whether a offset exists - * @access public - * @param mixed $offset - * @return bool - */ - public function offsetExists($offset) - { - return $this->items->offsetExists($offset); - } - - /** - * Offset to retrieve - * @access public - * @param mixed $offset - * @return mixed - */ - public function offsetGet($offset) - { - return $this->items->offsetGet($offset); - } - - /** - * Offset to set - * @access public - * @param mixed $offset - * @param mixed $value - */ - public function offsetSet($offset, $value) - { - $this->items->offsetSet($offset, $value); - } - - /** - * Offset to unset - * @access public - * @param mixed $offset - * @return void - * @since 5.0.0 - */ - public function offsetUnset($offset) - { - $this->items->offsetUnset($offset); - } - - /** - * 统计数据集条数 - * @return int - */ - public function count(): int - { - return $this->items->count(); - } - - public function __toString() - { - return (string) $this->render(); - } - - /** - * 转换为数组 - * @return array - */ - public function toArray(): array - { - try { - $total = $this->total(); - } catch (DomainException $e) { - $total = null; - } - - return [ - 'total' => $total, - 'per_page' => $this->listRows(), - 'current_page' => $this->currentPage(), - 'last_page' => $this->lastPage, - 'data' => $this->items->toArray(), - ]; - } - - /** - * Specify data which should be serialized to JSON - */ - public function jsonSerialize() - { - return $this->toArray(); - } - - public function __call($name, $arguments) - { - $result = call_user_func_array([$this->items, $name], $arguments); - - if ($result instanceof Collection) { - $this->items = $result; - return $this; - } - - return $result; - } - -} diff --git a/vendor/topthink/think-orm/src/db/BaseQuery.php b/vendor/topthink/think-orm/src/db/BaseQuery.php deleted file mode 100644 index 741ef33..0000000 --- a/vendor/topthink/think-orm/src/db/BaseQuery.php +++ /dev/null @@ -1,1282 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use think\Collection; -use think\db\exception\DataNotFoundException; -use think\db\exception\DbException as Exception; -use think\db\exception\ModelNotFoundException; -use think\helper\Str; -use think\Model; -use think\Paginator; - -/** - * 数据查询基础类 - */ -abstract class BaseQuery -{ - use concern\TimeFieldQuery; - use concern\AggregateQuery; - use concern\ModelRelationQuery; - use concern\ResultOperation; - use concern\Transaction; - use concern\WhereQuery; - - /** - * 当前数据库连接对象 - * @var Connection - */ - protected $connection; - - /** - * 当前数据表名称(不含前缀) - * @var string - */ - protected $name = ''; - - /** - * 当前数据表主键 - * @var string|array - */ - protected $pk; - - /** - * 当前数据表自增主键 - * @var string - */ - protected $autoinc; - - /** - * 当前数据表前缀 - * @var string - */ - protected $prefix = ''; - - /** - * 当前查询参数 - * @var array - */ - protected $options = []; - - /** - * 架构函数 - * @access public - * @param ConnectionInterface $connection 数据库连接对象 - */ - public function __construct(ConnectionInterface $connection) - { - $this->connection = $connection; - - $this->prefix = $this->connection->getConfig('prefix'); - } - - /** - * 利用__call方法实现一些特殊的Model方法 - * @access public - * @param string $method 方法名称 - * @param array $args 调用参数 - * @return mixed - * @throws Exception - */ - public function __call(string $method, array $args) - { - if (strtolower(substr($method, 0, 5)) == 'getby') { - // 根据某个字段获取记录 - $field = Str::snake(substr($method, 5)); - return $this->where($field, '=', $args[0])->find(); - } elseif (strtolower(substr($method, 0, 10)) == 'getfieldby') { - // 根据某个字段获取记录的某个值 - $name = Str::snake(substr($method, 10)); - return $this->where($name, '=', $args[0])->value($args[1]); - } elseif (strtolower(substr($method, 0, 7)) == 'whereor') { - $name = Str::snake(substr($method, 7)); - array_unshift($args, $name); - return call_user_func_array([$this, 'whereOr'], $args); - } elseif (strtolower(substr($method, 0, 5)) == 'where') { - $name = Str::snake(substr($method, 5)); - array_unshift($args, $name); - return call_user_func_array([$this, 'where'], $args); - } elseif ($this->model && method_exists($this->model, 'scope' . $method)) { - // 动态调用命名范围 - $method = 'scope' . $method; - array_unshift($args, $this); - - call_user_func_array([$this->model, $method], $args); - return $this; - } else { - throw new Exception('method not exist:' . static::class . '->' . $method); - } - } - - /** - * 创建一个新的查询对象 - * @access public - * @return BaseQuery - */ - public function newQuery(): BaseQuery - { - $query = new static($this->connection); - - if ($this->model) { - $query->model($this->model); - } - - if (isset($this->options['table'])) { - $query->table($this->options['table']); - } else { - $query->name($this->name); - } - - if (isset($this->options['json'])) { - $query->json($this->options['json'], $this->options['json_assoc']); - } - - if (isset($this->options['field_type'])) { - $query->setFieldType($this->options['field_type']); - } - - return $query; - } - - /** - * 获取当前的数据库Connection对象 - * @access public - * @return ConnectionInterface - */ - public function getConnection() - { - return $this->connection; - } - - /** - * 指定当前数据表名(不含前缀) - * @access public - * @param string $name 不含前缀的数据表名字 - * @return $this - */ - public function name(string $name) - { - $this->name = $name; - return $this; - } - - /** - * 获取当前的数据表名称 - * @access public - * @return string - */ - public function getName(): string - { - return $this->name ?: $this->model->getName(); - } - - /** - * 获取数据库的配置参数 - * @access public - * @param string $name 参数名称 - * @return mixed - */ - public function getConfig(string $name = '') - { - return $this->connection->getConfig($name); - } - - /** - * 得到当前或者指定名称的数据表 - * @access public - * @param string $name 不含前缀的数据表名字 - * @return mixed - */ - public function getTable(string $name = '') - { - if (empty($name) && isset($this->options['table'])) { - return $this->options['table']; - } - - $name = $name ?: $this->name; - - return $this->prefix . Str::snake($name); - } - - /** - * 设置字段类型信息 - * @access public - * @param array $type 字段类型信息 - * @return $this - */ - public function setFieldType(array $type) - { - $this->options['field_type'] = $type; - return $this; - } - - /** - * 获取最近一次查询的sql语句 - * @access public - * @return string - */ - public function getLastSql(): string - { - return $this->connection->getLastSql(); - } - - /** - * 获取返回或者影响的记录数 - * @access public - * @return integer - */ - public function getNumRows(): int - { - return $this->connection->getNumRows(); - } - - /** - * 获取最近插入的ID - * @access public - * @param string $sequence 自增序列名 - * @return mixed - */ - public function getLastInsID(string $sequence = null) - { - return $this->connection->getLastInsID($this, $sequence); - } - - /** - * 得到某个字段的值 - * @access public - * @param string $field 字段名 - * @param mixed $default 默认值 - * @return mixed - */ - public function value(string $field, $default = null) - { - return $this->connection->value($this, $field, $default); - } - - /** - * 得到某个列的数组 - * @access public - * @param string|array $field 字段名 多个字段用逗号分隔 - * @param string $key 索引 - * @return array - */ - public function column($field, string $key = ''): array - { - return $this->connection->column($this, $field, $key); - } - - /** - * 查询SQL组装 union - * @access public - * @param mixed $union UNION - * @param boolean $all 是否适用UNION ALL - * @return $this - */ - public function union($union, bool $all = false) - { - $this->options['union']['type'] = $all ? 'UNION ALL' : 'UNION'; - - if (is_array($union)) { - $this->options['union'] = array_merge($this->options['union'], $union); - } else { - $this->options['union'][] = $union; - } - - return $this; - } - - /** - * 查询SQL组装 union all - * @access public - * @param mixed $union UNION数据 - * @return $this - */ - public function unionAll($union) - { - return $this->union($union, true); - } - - /** - * 指定查询字段 - * @access public - * @param mixed $field 字段信息 - * @return $this - */ - public function field($field) - { - if (empty($field)) { - return $this; - } elseif ($field instanceof Raw) { - $this->options['field'][] = $field; - return $this; - } - - if (is_string($field)) { - if (preg_match('/[\<\'\"\(]/', $field)) { - return $this->fieldRaw($field); - } - - $field = array_map('trim', explode(',', $field)); - } - - if (true === $field) { - // 获取全部字段 - $fields = $this->getTableFields(); - $field = $fields ?: ['*']; - } - - if (isset($this->options['field'])) { - $field = array_merge((array) $this->options['field'], $field); - } - - $this->options['field'] = array_unique($field); - - return $this; - } - - /** - * 指定要排除的查询字段 - * @access public - * @param array|string $field 要排除的字段 - * @return $this - */ - public function withoutField($field) - { - if (empty($field)) { - return $this; - } - - if (is_string($field)) { - $field = array_map('trim', explode(',', $field)); - } - - // 字段排除 - $fields = $this->getTableFields(); - $field = $fields ? array_diff($fields, $field) : $field; - - if (isset($this->options['field'])) { - $field = array_merge((array) $this->options['field'], $field); - } - - $this->options['field'] = array_unique($field); - - return $this; - } - - /** - * 指定其它数据表的查询字段 - * @access public - * @param mixed $field 字段信息 - * @param string $tableName 数据表名 - * @param string $prefix 字段前缀 - * @param string $alias 别名前缀 - * @return $this - */ - public function tableField($field, string $tableName, string $prefix = '', string $alias = '') - { - if (empty($field)) { - return $this; - } - - if (is_string($field)) { - $field = array_map('trim', explode(',', $field)); - } - - if (true === $field) { - // 获取全部字段 - $fields = $this->getTableFields($tableName); - $field = $fields ?: ['*']; - } - - // 添加统一的前缀 - $prefix = $prefix ?: $tableName; - foreach ($field as $key => &$val) { - if (is_numeric($key) && $alias) { - $field[$prefix . '.' . $val] = $alias . $val; - unset($field[$key]); - } elseif (is_numeric($key)) { - $val = $prefix . '.' . $val; - } - } - - if (isset($this->options['field'])) { - $field = array_merge((array) $this->options['field'], $field); - } - - $this->options['field'] = array_unique($field); - - return $this; - } - - /** - * 设置数据 - * @access public - * @param array $data 数据 - * @return $this - */ - public function data(array $data) - { - $this->options['data'] = $data; - - return $this; - } - - /** - * 去除查询参数 - * @access public - * @param string $option 参数名 留空去除所有参数 - * @return $this - */ - public function removeOption(string $option = '') - { - if ('' === $option) { - $this->options = []; - $this->bind = []; - } elseif (isset($this->options[$option])) { - unset($this->options[$option]); - } - - return $this; - } - - /** - * 指定查询数量 - * @access public - * @param int $offset 起始位置 - * @param int $length 查询数量 - * @return $this - */ - public function limit(int $offset, int $length = null) - { - $this->options['limit'] = $offset . ($length ? ',' . $length : ''); - - return $this; - } - - /** - * 指定分页 - * @access public - * @param int $page 页数 - * @param int $listRows 每页数量 - * @return $this - */ - public function page(int $page, int $listRows = null) - { - $this->options['page'] = [$page, $listRows]; - - return $this; - } - - /** - * 指定当前操作的数据表 - * @access public - * @param mixed $table 表名 - * @return $this - */ - public function table($table) - { - if (is_string($table)) { - if (strpos($table, ')')) { - // 子查询 - } elseif (false === strpos($table, ',')) { - if (strpos($table, ' ')) { - [$item, $alias] = explode(' ', $table); - $table = []; - $this->alias([$item => $alias]); - $table[$item] = $alias; - } - } else { - $tables = explode(',', $table); - $table = []; - - foreach ($tables as $item) { - $item = trim($item); - if (strpos($item, ' ')) { - [$item, $alias] = explode(' ', $item); - $this->alias([$item => $alias]); - $table[$item] = $alias; - } else { - $table[] = $item; - } - } - } - } elseif (is_array($table)) { - $tables = $table; - $table = []; - - foreach ($tables as $key => $val) { - if (is_numeric($key)) { - $table[] = $val; - } else { - $this->alias([$key => $val]); - $table[$key] = $val; - } - } - } - - $this->options['table'] = $table; - - return $this; - } - - /** - * 指定排序 order('id','desc') 或者 order(['id'=>'desc','create_time'=>'desc']) - * @access public - * @param string|array|Raw $field 排序字段 - * @param string $order 排序 - * @return $this - */ - public function order($field, string $order = '') - { - if (empty($field)) { - return $this; - } elseif ($field instanceof Raw) { - $this->options['order'][] = $field; - return $this; - } - - if (is_string($field)) { - if (!empty($this->options['via'])) { - $field = $this->options['via'] . '.' . $field; - } - if (strpos($field, ',')) { - $field = array_map('trim', explode(',', $field)); - } else { - $field = empty($order) ? $field : [$field => $order]; - } - } elseif (!empty($this->options['via'])) { - foreach ($field as $key => $val) { - if (is_numeric($key)) { - $field[$key] = $this->options['via'] . '.' . $val; - } else { - $field[$this->options['via'] . '.' . $key] = $val; - unset($field[$key]); - } - } - } - - if (!isset($this->options['order'])) { - $this->options['order'] = []; - } - - if (is_array($field)) { - $this->options['order'] = array_merge($this->options['order'], $field); - } else { - $this->options['order'][] = $field; - } - - return $this; - } - - /** - * 分页查询 - * @access public - * @param int|array $listRows 每页数量 数组表示配置参数 - * @param int|bool $simple 是否简洁模式或者总记录数 - * @return Paginator - * @throws Exception - */ - public function paginate($listRows = null, $simple = false): Paginator - { - if (is_int($simple)) { - $total = $simple; - $simple = false; - } - - $defaultConfig = [ - 'query' => [], //url额外参数 - 'fragment' => '', //url锚点 - 'var_page' => 'page', //分页变量 - 'list_rows' => 15, //每页数量 - ]; - - if (is_array($listRows)) { - $config = array_merge($defaultConfig, $listRows); - $listRows = intval($config['list_rows']); - } else { - $config = $defaultConfig; - $listRows = intval($listRows ?: $config['list_rows']); - } - - $page = isset($config['page']) ? (int) $config['page'] : Paginator::getCurrentPage($config['var_page']); - - $page = $page < 1 ? 1 : $page; - - $config['path'] = $config['path'] ?? Paginator::getCurrentPath(); - - if (!isset($total) && !$simple) { - $options = $this->getOptions(); - - unset($this->options['order'], $this->options['limit'], $this->options['page'], $this->options['field']); - - $bind = $this->bind; - $total = $this->count(); - $results = $this->options($options)->bind($bind)->page($page, $listRows)->select(); - } elseif ($simple) { - $results = $this->limit(($page - 1) * $listRows, $listRows + 1)->select(); - $total = null; - } else { - $results = $this->page($page, $listRows)->select(); - } - - $this->removeOption('limit'); - $this->removeOption('page'); - - return Paginator::make($results, $listRows, $page, $total, $simple, $config); - } - - /** - * 根据数字类型字段进行分页查询(大数据) - * @access public - * @param int|array $listRows 每页数量或者分页配置 - * @param string $key 分页索引键 - * @param string $sort 索引键排序 asc|desc - * @return Paginator - * @throws Exception - */ - public function paginateX($listRows = null, string $key = null, string $sort = null): Paginator - { - $defaultConfig = [ - 'query' => [], //url额外参数 - 'fragment' => '', //url锚点 - 'var_page' => 'page', //分页变量 - 'list_rows' => 15, //每页数量 - ]; - - $config = is_array($listRows) ? array_merge($defaultConfig, $listRows) : $defaultConfig; - $listRows = is_int($listRows) ? $listRows : (int) $config['list_rows']; - $page = isset($config['page']) ? (int) $config['page'] : Paginator::getCurrentPage($config['var_page']); - $page = $page < 1 ? 1 : $page; - - $config['path'] = $config['path'] ?? Paginator::getCurrentPath(); - - $key = $key ?: $this->getPk(); - $options = $this->getOptions(); - - if (is_null($sort)) { - $order = $options['order'] ?? ''; - if (!empty($order)) { - $sort = $order[$key] ?? 'desc'; - } else { - $this->order($key, 'desc'); - $sort = 'desc'; - } - } else { - $this->order($key, $sort); - } - - $newOption = $options; - unset($newOption['field'], $newOption['page']); - - $data = $this->newQuery() - ->options($newOption) - ->field($key) - ->where(true) - ->order($key, $sort) - ->limit(1) - ->find(); - - $result = $data[$key]; - - if (is_numeric($result)) { - $lastId = 'asc' == $sort ? ($result - 1) + ($page - 1) * $listRows : ($result + 1) - ($page - 1) * $listRows; - } else { - throw new Exception('not support type'); - } - - $results = $this->when($lastId, function ($query) use ($key, $sort, $lastId) { - $query->where($key, 'asc' == $sort ? '>' : '<', $lastId); - }) - ->limit($listRows) - ->select(); - - $this->options($options); - - return Paginator::make($results, $listRows, $page, null, true, $config); - } - - /** - * 根据最后ID查询更多N个数据 - * @access public - * @param int $limit LIMIT - * @param int|string $lastId LastId - * @param string $key 分页索引键 默认为主键 - * @param string $sort 索引键排序 asc|desc - * @return array - * @throws Exception - */ - public function more(int $limit, $lastId = null, string $key = null, string $sort = null): array - { - $key = $key ?: $this->getPk(); - - if (is_null($sort)) { - $order = $this->getOptions('order'); - if (!empty($order)) { - $sort = $order[$key] ?? 'desc'; - } else { - $this->order($key, 'desc'); - $sort = 'desc'; - } - } else { - $this->order($key, $sort); - } - - $result = $this->when($lastId, function ($query) use ($key, $sort, $lastId) { - $query->where($key, 'asc' == $sort ? '>' : '<', $lastId); - })->limit($limit)->select(); - - $last = $result->last(); - - $result->first(); - - return [ - 'data' => $result, - 'lastId' => $last[$key], - ]; - } - - /** - * 查询缓存 - * @access public - * @param mixed $key 缓存key - * @param integer|\DateTime $expire 缓存有效期 - * @param string|array $tag 缓存标签 - * @return $this - */ - public function cache($key = true, $expire = null, $tag = null) - { - if (false === $key || !$this->getConnection()->getCache()) { - return $this; - } - - if ($key instanceof \DateTimeInterface || $key instanceof \DateInterval || (is_int($key) && is_null($expire))) { - $expire = $key; - $key = true; - } - - $this->options['cache'] = [$key, $expire, $tag]; - - return $this; - } - - /** - * 指定查询lock - * @access public - * @param bool|string $lock 是否lock - * @return $this - */ - public function lock($lock = false) - { - $this->options['lock'] = $lock; - - if ($lock) { - $this->options['master'] = true; - } - - return $this; - } - - /** - * 指定数据表别名 - * @access public - * @param array|string $alias 数据表别名 - * @return $this - */ - public function alias($alias) - { - if (is_array($alias)) { - $this->options['alias'] = $alias; - } else { - $table = $this->getTable(); - - $this->options['alias'][$table] = $alias; - } - - return $this; - } - - /** - * 设置从主服务器读取数据 - * @access public - * @param bool $readMaster 是否从主服务器读取 - * @return $this - */ - public function master(bool $readMaster = true) - { - $this->options['master'] = $readMaster; - return $this; - } - - /** - * 设置是否严格检查字段名 - * @access public - * @param bool $strict 是否严格检查字段 - * @return $this - */ - public function strict(bool $strict = true) - { - $this->options['strict'] = $strict; - return $this; - } - - /** - * 设置自增序列名 - * @access public - * @param string $sequence 自增序列名 - * @return $this - */ - public function sequence(string $sequence = null) - { - $this->options['sequence'] = $sequence; - return $this; - } - - /** - * 设置JSON字段信息 - * @access public - * @param array $json JSON字段 - * @param bool $assoc 是否取出数组 - * @return $this - */ - public function json(array $json = [], bool $assoc = false) - { - $this->options['json'] = $json; - $this->options['json_assoc'] = $assoc; - return $this; - } - - /** - * 指定数据表主键 - * @access public - * @param string|array $pk 主键 - * @return $this - */ - public function pk($pk) - { - $this->pk = $pk; - return $this; - } - - /** - * 查询参数批量赋值 - * @access protected - * @param array $options 表达式参数 - * @return $this - */ - protected function options(array $options) - { - $this->options = $options; - return $this; - } - - /** - * 获取当前的查询参数 - * @access public - * @param string $name 参数名 - * @return mixed - */ - public function getOptions(string $name = '') - { - if ('' === $name) { - return $this->options; - } - - return $this->options[$name] ?? null; - } - - /** - * 设置当前的查询参数 - * @access public - * @param string $option 参数名 - * @param mixed $value 参数值 - * @return $this - */ - public function setOption(string $option, $value) - { - $this->options[$option] = $value; - return $this; - } - - /** - * 设置当前字段添加的表别名 - * @access public - * @param string $via 临时表别名 - * @return $this - */ - public function via(string $via = '') - { - $this->options['via'] = $via; - - return $this; - } - - /** - * 保存记录 自动判断insert或者update - * @access public - * @param array $data 数据 - * @param bool $forceInsert 是否强制insert - * @return integer - */ - public function save(array $data = [], bool $forceInsert = false) - { - if ($forceInsert) { - return $this->insert($data); - } - - $this->options['data'] = array_merge($this->options['data'] ?? [], $data); - - if (!empty($this->options['where'])) { - $isUpdate = true; - } else { - $isUpdate = $this->parseUpdateData($this->options['data']); - } - - return $isUpdate ? $this->update() : $this->insert(); - } - - /** - * 插入记录 - * @access public - * @param array $data 数据 - * @param boolean $getLastInsID 返回自增主键 - * @return integer|string - */ - public function insert(array $data = [], bool $getLastInsID = false) - { - if (!empty($data)) { - $this->options['data'] = $data; - } - - return $this->connection->insert($this, $getLastInsID); - } - - /** - * 插入记录并获取自增ID - * @access public - * @param array $data 数据 - * @return integer|string - */ - public function insertGetId(array $data) - { - return $this->insert($data, true); - } - - /** - * 批量插入记录 - * @access public - * @param array $dataSet 数据集 - * @param integer $limit 每次写入数据限制 - * @return integer - */ - public function insertAll(array $dataSet = [], int $limit = 0): int - { - if (empty($dataSet)) { - $dataSet = $this->options['data'] ?? []; - } - - if (empty($limit) && !empty($this->options['limit']) && is_numeric($this->options['limit'])) { - $limit = (int) $this->options['limit']; - } - - return $this->connection->insertAll($this, $dataSet, $limit); - } - - /** - * 通过Select方式插入记录 - * @access public - * @param array $fields 要插入的数据表字段名 - * @param string $table 要插入的数据表名 - * @return integer - */ - public function selectInsert(array $fields, string $table): int - { - return $this->connection->selectInsert($this, $fields, $table); - } - - /** - * 更新记录 - * @access public - * @param mixed $data 数据 - * @return integer - * @throws Exception - */ - public function update(array $data = []): int - { - if (!empty($data)) { - $this->options['data'] = array_merge($this->options['data'] ?? [], $data); - } - - if (empty($this->options['where'])) { - $this->parseUpdateData($this->options['data']); - } - - if (empty($this->options['where']) && $this->model) { - $this->where($this->model->getWhere()); - } - - if (empty($this->options['where'])) { - // 如果没有任何更新条件则不执行 - throw new Exception('miss update condition'); - } - - return $this->connection->update($this); - } - - /** - * 删除记录 - * @access public - * @param mixed $data 表达式 true 表示强制删除 - * @return int - * @throws Exception - */ - public function delete($data = null): int - { - if (!is_null($data) && true !== $data) { - // AR模式分析主键条件 - $this->parsePkWhere($data); - } - - if (empty($this->options['where']) && $this->model) { - $this->where($this->model->getWhere()); - } - - if (true !== $data && empty($this->options['where'])) { - // 如果条件为空 不进行删除操作 除非设置 1=1 - throw new Exception('delete without condition'); - } - - if (!empty($this->options['soft_delete'])) { - // 软删除 - list($field, $condition) = $this->options['soft_delete']; - if ($condition) { - unset($this->options['soft_delete']); - $this->options['data'] = [$field => $condition]; - - return $this->connection->update($this); - } - } - - $this->options['data'] = $data; - - return $this->connection->delete($this); - } - - /** - * 查找记录 - * @access public - * @param mixed $data 数据 - * @return Collection - * @throws Exception - * @throws ModelNotFoundException - * @throws DataNotFoundException - */ - public function select($data = null): Collection - { - if (!is_null($data)) { - // 主键条件分析 - $this->parsePkWhere($data); - } - - $resultSet = $this->connection->select($this); - - // 返回结果处理 - if (!empty($this->options['fail']) && count($resultSet) == 0) { - $this->throwNotFound(); - } - - // 数据列表读取后的处理 - if (!empty($this->model)) { - // 生成模型对象 - $resultSet = $this->resultSetToModelCollection($resultSet); - } else { - $this->resultSet($resultSet); - } - - return $resultSet; - } - - /** - * 查找单条记录 - * @access public - * @param mixed $data 查询数据 - * @return array|Model|null - * @throws Exception - * @throws ModelNotFoundException - * @throws DataNotFoundException - */ - public function find($data = null) - { - if (!is_null($data)) { - // AR模式分析主键条件 - $this->parsePkWhere($data); - } - - if (empty($this->options['where']) && empty($this->options['order'])) { - $result = []; - } else { - $result = $this->connection->find($this); - } - - // 数据处理 - if (empty($result)) { - return $this->resultToEmpty(); - } - - if (!empty($this->model)) { - // 返回模型对象 - $this->resultToModel($result, $this->options); - } else { - $this->result($result); - } - - return $result; - } - - /** - * 分析表达式(可用于查询或者写入操作) - * @access public - * @return array - */ - public function parseOptions(): array - { - $options = $this->getOptions(); - - // 获取数据表 - if (empty($options['table'])) { - $options['table'] = $this->getTable(); - } - - if (!isset($options['where'])) { - $options['where'] = []; - } elseif (isset($options['view'])) { - // 视图查询条件处理 - $this->parseView($options); - } - - if (!isset($options['field'])) { - $options['field'] = '*'; - } - - foreach (['data', 'order', 'join', 'union'] as $name) { - if (!isset($options[$name])) { - $options[$name] = []; - } - } - - if (!isset($options['strict'])) { - $options['strict'] = $this->connection->getConfig('fields_strict'); - } - - foreach (['master', 'lock', 'fetch_sql', 'array', 'distinct', 'procedure'] as $name) { - if (!isset($options[$name])) { - $options[$name] = false; - } - } - - foreach (['group', 'having', 'limit', 'force', 'comment', 'partition', 'duplicate', 'extra'] as $name) { - if (!isset($options[$name])) { - $options[$name] = ''; - } - } - - if (isset($options['page'])) { - // 根据页数计算limit - [$page, $listRows] = $options['page']; - $page = $page > 0 ? $page : 1; - $listRows = $listRows ?: (is_numeric($options['limit']) ? $options['limit'] : 20); - $offset = $listRows * ($page - 1); - $options['limit'] = $offset . ',' . $listRows; - } - - $this->options = $options; - - return $options; - } - - /** - * 分析数据是否存在更新条件 - * @access public - * @param array $data 数据 - * @return bool - * @throws Exception - */ - public function parseUpdateData(&$data): bool - { - $pk = $this->getPk(); - $isUpdate = false; - // 如果存在主键数据 则自动作为更新条件 - if (is_string($pk) && isset($data[$pk])) { - $this->where($pk, '=', $data[$pk]); - $this->options['key'] = $data[$pk]; - unset($data[$pk]); - $isUpdate = true; - } elseif (is_array($pk)) { - foreach ($pk as $field) { - if (isset($data[$field])) { - $this->where($field, '=', $data[$field]); - $isUpdate = true; - } else { - // 如果缺少复合主键数据则不执行 - throw new Exception('miss complex primary data'); - } - unset($data[$field]); - } - } - - return $isUpdate; - } - - /** - * 把主键值转换为查询条件 支持复合主键 - * @access public - * @param array|string $data 主键数据 - * @return void - * @throws Exception - */ - public function parsePkWhere($data): void - { - $pk = $this->getPk(); - - if (is_string($pk)) { - // 获取数据表 - if (empty($this->options['table'])) { - $this->options['table'] = $this->getTable(); - } - - $table = is_array($this->options['table']) ? key($this->options['table']) : $this->options['table']; - - if (!empty($this->options['alias'][$table])) { - $alias = $this->options['alias'][$table]; - } - - $key = isset($alias) ? $alias . '.' . $pk : $pk; - // 根据主键查询 - if (is_array($data)) { - $this->where($key, 'in', $data); - } else { - $this->where($key, '=', $data); - $this->options['key'] = $data; - } - } - } - - /** - * 获取模型的更新条件 - * @access protected - * @param array $options 查询参数 - */ - protected function getModelUpdateCondition(array $options) - { - return $options['where']['AND'] ?? null; - } -} diff --git a/vendor/topthink/think-orm/src/db/Builder.php b/vendor/topthink/think-orm/src/db/Builder.php deleted file mode 100644 index 914dd70..0000000 --- a/vendor/topthink/think-orm/src/db/Builder.php +++ /dev/null @@ -1,1305 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use Closure; -use PDO; -use think\db\exception\DbException as Exception; - -/** - * Db Builder - */ -abstract class Builder -{ - /** - * Connection对象 - * @var ConnectionInterface - */ - protected $connection; - - /** - * 查询表达式映射 - * @var array - */ - protected $exp = ['NOTLIKE' => 'NOT LIKE', 'NOTIN' => 'NOT IN', 'NOTBETWEEN' => 'NOT BETWEEN', 'NOTEXISTS' => 'NOT EXISTS', 'NOTNULL' => 'NOT NULL', 'NOTBETWEEN TIME' => 'NOT BETWEEN TIME']; - - /** - * 查询表达式解析 - * @var array - */ - protected $parser = [ - 'parseCompare' => ['=', '<>', '>', '>=', '<', '<='], - 'parseLike' => ['LIKE', 'NOT LIKE'], - 'parseBetween' => ['NOT BETWEEN', 'BETWEEN'], - 'parseIn' => ['NOT IN', 'IN'], - 'parseExp' => ['EXP'], - 'parseNull' => ['NOT NULL', 'NULL'], - 'parseBetweenTime' => ['BETWEEN TIME', 'NOT BETWEEN TIME'], - 'parseTime' => ['< TIME', '> TIME', '<= TIME', '>= TIME'], - 'parseExists' => ['NOT EXISTS', 'EXISTS'], - 'parseColumn' => ['COLUMN'], - ]; - - /** - * SELECT SQL表达式 - * @var string - */ - protected $selectSql = 'SELECT%DISTINCT%%EXTRA% %FIELD% FROM %TABLE%%FORCE%%JOIN%%WHERE%%GROUP%%HAVING%%UNION%%ORDER%%LIMIT% %LOCK%%COMMENT%'; - - /** - * INSERT SQL表达式 - * @var string - */ - protected $insertSql = '%INSERT%%EXTRA% INTO %TABLE% (%FIELD%) VALUES (%DATA%) %COMMENT%'; - - /** - * INSERT ALL SQL表达式 - * @var string - */ - protected $insertAllSql = '%INSERT%%EXTRA% INTO %TABLE% (%FIELD%) %DATA% %COMMENT%'; - - /** - * UPDATE SQL表达式 - * @var string - */ - protected $updateSql = 'UPDATE%EXTRA% %TABLE% SET %SET%%JOIN%%WHERE%%ORDER%%LIMIT% %LOCK%%COMMENT%'; - - /** - * DELETE SQL表达式 - * @var string - */ - protected $deleteSql = 'DELETE%EXTRA% FROM %TABLE%%USING%%JOIN%%WHERE%%ORDER%%LIMIT% %LOCK%%COMMENT%'; - - /** - * 架构函数 - * @access public - * @param ConnectionInterface $connection 数据库连接对象实例 - */ - public function __construct(ConnectionInterface $connection) - { - $this->connection = $connection; - } - - /** - * 获取当前的连接对象实例 - * @access public - * @return ConnectionInterface - */ - public function getConnection(): ConnectionInterface - { - return $this->connection; - } - - /** - * 注册查询表达式解析 - * @access public - * @param string $name 解析方法 - * @param array $parser 匹配表达式数据 - * @return $this - */ - public function bindParser(string $name, array $parser) - { - $this->parser[$name] = $parser; - return $this; - } - - /** - * 数据分析 - * @access protected - * @param Query $query 查询对象 - * @param array $data 数据 - * @param array $fields 字段信息 - * @param array $bind 参数绑定 - * @return array - */ - protected function parseData(Query $query, array $data = [], array $fields = [], array $bind = []): array - { - if (empty($data)) { - return []; - } - - $options = $query->getOptions(); - - // 获取绑定信息 - if (empty($bind)) { - $bind = $query->getFieldsBindType(); - } - - if (empty($fields)) { - if ('*' == $options['field']) { - $fields = array_keys($bind); - } else { - $fields = $options['field']; - } - } - - $result = []; - - foreach ($data as $key => $val) { - $item = $this->parseKey($query, $key, true); - - if ($val instanceof Raw) { - $result[$item] = $this->parseRaw($query, $val); - continue; - } elseif (!is_scalar($val) && (in_array($key, (array) $query->getOptions('json')) || 'json' == $query->getFieldType($key))) { - $val = json_encode($val); - } - - if (false !== strpos($key, '->')) { - [$key, $name] = explode('->', $key, 2); - $item = $this->parseKey($query, $key); - $result[$item] = 'json_set(' . $item . ', \'$.' . $name . '\', ' . $this->parseDataBind($query, $key . '->' . $name, $val, $bind) . ')'; - } elseif (false === strpos($key, '.') && !in_array($key, $fields, true)) { - if ($options['strict']) { - throw new Exception('fields not exists:[' . $key . ']'); - } - } elseif (is_null($val)) { - $result[$item] = 'NULL'; - } elseif (is_array($val) && !empty($val) && is_string($val[0])) { - switch (strtoupper($val[0])) { - case 'INC': - $result[$item] = $item . ' + ' . floatval($val[1]); - break; - case 'DEC': - $result[$item] = $item . ' - ' . floatval($val[1]); - break; - } - } elseif (is_scalar($val)) { - // 过滤非标量数据 - $result[$item] = $this->parseDataBind($query, $key, $val, $bind); - } - } - - return $result; - } - - /** - * 数据绑定处理 - * @access protected - * @param Query $query 查询对象 - * @param string $key 字段名 - * @param mixed $data 数据 - * @param array $bind 绑定数据 - * @return string - */ - protected function parseDataBind(Query $query, string $key, $data, array $bind = []): string - { - if ($data instanceof Raw) { - return $this->parseRaw($query, $data); - } - - $name = $query->bindValue($data, $bind[$key] ?? PDO::PARAM_STR); - - return ':' . $name; - } - - /** - * 字段名分析 - * @access public - * @param Query $query 查询对象 - * @param mixed $key 字段名 - * @param bool $strict 严格检测 - * @return string - */ - public function parseKey(Query $query, $key, bool $strict = false): string - { - return $key; - } - - /** - * 查询额外参数分析 - * @access protected - * @param Query $query 查询对象 - * @param string $extra 额外参数 - * @return string - */ - protected function parseExtra(Query $query, string $extra): string - { - return preg_match('/^[\w]+$/i', $extra) ? ' ' . strtoupper($extra) : ''; - } - - /** - * field分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $fields 字段名 - * @return string - */ - protected function parseField(Query $query, $fields): string - { - if (is_array($fields)) { - // 支持 'field1'=>'field2' 这样的字段别名定义 - $array = []; - - foreach ($fields as $key => $field) { - if ($field instanceof Raw) { - $array[] = $this->parseRaw($query, $field); - } elseif (!is_numeric($key)) { - $array[] = $this->parseKey($query, $key) . ' AS ' . $this->parseKey($query, $field, true); - } else { - $array[] = $this->parseKey($query, $field); - } - } - - $fieldsStr = implode(',', $array); - } else { - $fieldsStr = '*'; - } - - return $fieldsStr; - } - - /** - * table分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $tables 表名 - * @return string - */ - protected function parseTable(Query $query, $tables): string - { - $item = []; - $options = $query->getOptions(); - - foreach ((array) $tables as $key => $table) { - if ($table instanceof Raw) { - $item[] = $this->parseRaw($query, $table); - } elseif (!is_numeric($key)) { - $item[] = $this->parseKey($query, $key) . ' ' . $this->parseKey($query, $table); - } elseif (isset($options['alias'][$table])) { - $item[] = $this->parseKey($query, $table) . ' ' . $this->parseKey($query, $options['alias'][$table]); - } else { - $item[] = $this->parseKey($query, $table); - } - } - - return implode(',', $item); - } - - /** - * where分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $where 查询条件 - * @return string - */ - protected function parseWhere(Query $query, array $where): string - { - $options = $query->getOptions(); - $whereStr = $this->buildWhere($query, $where); - - if (!empty($options['soft_delete'])) { - // 附加软删除条件 - [$field, $condition] = $options['soft_delete']; - - $binds = $query->getFieldsBindType(); - $whereStr = $whereStr ? '( ' . $whereStr . ' ) AND ' : ''; - $whereStr = $whereStr . $this->parseWhereItem($query, $field, $condition, $binds); - } - - return empty($whereStr) ? '' : ' WHERE ' . $whereStr; - } - - /** - * 生成查询条件SQL - * @access public - * @param Query $query 查询对象 - * @param mixed $where 查询条件 - * @return string - */ - public function buildWhere(Query $query, array $where): string - { - if (empty($where)) { - $where = []; - } - - $whereStr = ''; - - $binds = $query->getFieldsBindType(); - - foreach ($where as $logic => $val) { - $str = $this->parseWhereLogic($query, $logic, $val, $binds); - - $whereStr .= empty($whereStr) ? substr(implode(' ', $str), strlen($logic) + 1) : implode(' ', $str); - } - - return $whereStr; - } - - /** - * 不同字段使用相同查询条件(AND) - * @access protected - * @param Query $query 查询对象 - * @param string $logic Logic - * @param array $val 查询条件 - * @param array $binds 参数绑定 - * @return array - */ - protected function parseWhereLogic(Query $query, string $logic, array $val, array $binds = []): array - { - $where = []; - foreach ($val as $value) { - if ($value instanceof Raw) { - $where[] = ' ' . $logic . ' ( ' . $this->parseRaw($query, $value) . ' )'; - continue; - } - - if (is_array($value)) { - if (key($value) !== 0) { - throw new Exception('where express error:' . var_export($value, true)); - } - $field = array_shift($value); - } elseif (true === $value) { - $where[] = ' ' . $logic . ' 1 '; - continue; - } elseif (!($value instanceof Closure)) { - throw new Exception('where express error:' . var_export($value, true)); - } - - if ($value instanceof Closure) { - // 使用闭包查询 - $whereClosureStr = $this->parseClosureWhere($query, $value, $logic); - if ($whereClosureStr) { - $where[] = $whereClosureStr; - } - } elseif (is_array($field)) { - $where[] = $this->parseMultiWhereField($query, $value, $field, $logic, $binds); - } elseif ($field instanceof Raw) { - $where[] = ' ' . $logic . ' ' . $this->parseWhereItem($query, $field, $value, $binds); - } elseif (strpos($field, '|')) { - $where[] = $this->parseFieldsOr($query, $value, $field, $logic, $binds); - } elseif (strpos($field, '&')) { - $where[] = $this->parseFieldsAnd($query, $value, $field, $logic, $binds); - } else { - // 对字段使用表达式查询 - $field = is_string($field) ? $field : ''; - $where[] = ' ' . $logic . ' ' . $this->parseWhereItem($query, $field, $value, $binds); - } - } - - return $where; - } - - /** - * 不同字段使用相同查询条件(AND) - * @access protected - * @param Query $query 查询对象 - * @param mixed $value 查询条件 - * @param string $field 查询字段 - * @param string $logic Logic - * @param array $binds 参数绑定 - * @return string - */ - protected function parseFieldsAnd(Query $query, $value, string $field, string $logic, array $binds): string - { - $item = []; - - foreach (explode('&', $field) as $k) { - $item[] = $this->parseWhereItem($query, $k, $value, $binds); - } - - return ' ' . $logic . ' ( ' . implode(' AND ', $item) . ' )'; - } - - /** - * 不同字段使用相同查询条件(OR) - * @access protected - * @param Query $query 查询对象 - * @param mixed $value 查询条件 - * @param string $field 查询字段 - * @param string $logic Logic - * @param array $binds 参数绑定 - * @return string - */ - protected function parseFieldsOr(Query $query, $value, string $field, string $logic, array $binds): string - { - $item = []; - - foreach (explode('|', $field) as $k) { - $item[] = $this->parseWhereItem($query, $k, $value, $binds); - } - - return ' ' . $logic . ' ( ' . implode(' OR ', $item) . ' )'; - } - - /** - * 闭包查询 - * @access protected - * @param Query $query 查询对象 - * @param Closure $value 查询条件 - * @param string $logic Logic - * @return string - */ - protected function parseClosureWhere(Query $query, Closure $value, string $logic): string - { - $newQuery = $query->newQuery(); - $value($newQuery); - $whereClosure = $this->buildWhere($newQuery, $newQuery->getOptions('where') ?: []); - - if (!empty($whereClosure)) { - $query->bind($newQuery->getBind(false)); - $where = ' ' . $logic . ' ( ' . $whereClosure . ' )'; - } - - return $where ?? ''; - } - - /** - * 复合条件查询 - * @access protected - * @param Query $query 查询对象 - * @param mixed $value 查询条件 - * @param mixed $field 查询字段 - * @param string $logic Logic - * @param array $binds 参数绑定 - * @return string - */ - protected function parseMultiWhereField(Query $query, $value, $field, string $logic, array $binds): string - { - array_unshift($value, $field); - - $where = []; - foreach ($value as $item) { - $where[] = $this->parseWhereItem($query, array_shift($item), $item, $binds); - } - - return ' ' . $logic . ' ( ' . implode(' AND ', $where) . ' )'; - } - - /** - * where子单元分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $field 查询字段 - * @param array $val 查询条件 - * @param array $binds 参数绑定 - * @return string - */ - protected function parseWhereItem(Query $query, $field, array $val, array $binds = []): string - { - // 字段分析 - $key = $field ? $this->parseKey($query, $field, true) : ''; - - [$exp, $value] = $val; - - // 检测操作符 - if (!is_string($exp)) { - throw new Exception('where express error:' . var_export($exp, true)); - } - - $exp = strtoupper($exp); - if (isset($this->exp[$exp])) { - $exp = $this->exp[$exp]; - } - - if (is_string($field) && 'LIKE' != $exp) { - $bindType = $binds[$field] ?? PDO::PARAM_STR; - } else { - $bindType = PDO::PARAM_STR; - } - - if ($value instanceof Raw) { - - } elseif (is_object($value) && method_exists($value, '__toString')) { - // 对象数据写入 - $value = $value->__toString(); - } - - if (is_scalar($value) && !in_array($exp, ['EXP', 'NOT NULL', 'NULL', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN']) && strpos($exp, 'TIME') === false) { - if (is_string($value) && 0 === strpos($value, ':') && $query->isBind(substr($value, 1))) { - } else { - $name = $query->bindValue($value, $bindType); - $value = ':' . $name; - } - } - - // 解析查询表达式 - foreach ($this->parser as $fun => $parse) { - if (in_array($exp, $parse)) { - return $this->$fun($query, $key, $exp, $value, $field, $bindType, $val[2] ?? 'AND'); - } - } - - throw new Exception('where express error:' . $exp); - } - - /** - * 模糊查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param array $value - * @param string $field - * @param integer $bindType - * @param string $logic - * @return string - */ - protected function parseLike(Query $query, string $key, string $exp, $value, $field, int $bindType, string $logic): string - { - // 模糊匹配 - if (is_array($value)) { - $array = []; - foreach ($value as $item) { - $name = $query->bindValue($item, PDO::PARAM_STR); - $array[] = $key . ' ' . $exp . ' :' . $name; - } - - $whereStr = '(' . implode(' ' . strtoupper($logic) . ' ', $array) . ')'; - } else { - $whereStr = $key . ' ' . $exp . ' ' . $value; - } - - return $whereStr; - } - - /** - * 表达式查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param array $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseExp(Query $query, string $key, string $exp, Raw $value, string $field, int $bindType): string - { - // 表达式查询 - return '( ' . $key . ' ' . $this->parseRaw($query, $value) . ' )'; - } - - /** - * 表达式查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param array $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseColumn(Query $query, string $key, $exp, array $value, string $field, int $bindType): string - { - // 字段比较查询 - [$op, $field] = $value; - - if (!in_array(trim($op), ['=', '<>', '>', '>=', '<', '<='])) { - throw new Exception('where express error:' . var_export($value, true)); - } - - return '( ' . $key . ' ' . $op . ' ' . $this->parseKey($query, $field, true) . ' )'; - } - - /** - * Null查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseNull(Query $query, string $key, string $exp, $value, $field, int $bindType): string - { - // NULL 查询 - return $key . ' IS ' . $exp; - } - - /** - * 范围查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseBetween(Query $query, string $key, string $exp, $value, $field, int $bindType): string - { - // BETWEEN 查询 - $data = is_array($value) ? $value : explode(',', $value); - - $min = $query->bindValue($data[0], $bindType); - $max = $query->bindValue($data[1], $bindType); - - return $key . ' ' . $exp . ' :' . $min . ' AND :' . $max . ' '; - } - - /** - * Exists查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseExists(Query $query, string $key, string $exp, $value, string $field, int $bindType): string - { - // EXISTS 查询 - if ($value instanceof Closure) { - $value = $this->parseClosure($query, $value, false); - } elseif ($value instanceof Raw) { - $value = $this->parseRaw($query, $value); - } else { - throw new Exception('where express error:' . $value); - } - - return $exp . ' ( ' . $value . ' )'; - } - - /** - * 时间比较查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseTime(Query $query, string $key, string $exp, $value, $field, int $bindType): string - { - return $key . ' ' . substr($exp, 0, 2) . ' ' . $this->parseDateTime($query, $value, $field, $bindType); - } - - /** - * 大小比较查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseCompare(Query $query, string $key, string $exp, $value, $field, int $bindType): string - { - if (is_array($value)) { - throw new Exception('where express error:' . $exp . var_export($value, true)); - } - - // 比较运算 - if ($value instanceof Closure) { - $value = $this->parseClosure($query, $value); - } - - if ('=' == $exp && is_null($value)) { - return $key . ' IS NULL'; - } - - return $key . ' ' . $exp . ' ' . $value; - } - - /** - * 时间范围查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseBetweenTime(Query $query, string $key, string $exp, $value, $field, int $bindType): string - { - if (is_string($value)) { - $value = explode(',', $value); - } - - return $key . ' ' . substr($exp, 0, -4) - . $this->parseDateTime($query, $value[0], $field, $bindType) - . ' AND ' - . $this->parseDateTime($query, $value[1], $field, $bindType); - - } - - /** - * IN查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @param integer $bindType - * @return string - */ - protected function parseIn(Query $query, string $key, string $exp, $value, $field, int $bindType): string - { - // IN 查询 - if ($value instanceof Closure) { - $value = $this->parseClosure($query, $value, false); - } elseif ($value instanceof Raw) { - $value = $this->parseRaw($query, $value); - } else { - $value = array_unique(is_array($value) ? $value : explode(',', $value)); - if (count($value) === 0) { - return 'IN' == $exp ? '0 = 1' : '1 = 1'; - } - $array = []; - - foreach ($value as $v) { - $name = $query->bindValue($v, $bindType); - $array[] = ':' . $name; - } - - if (count($array) == 1) { - return $key . ('IN' == $exp ? ' = ' : ' <> ') . $array[0]; - } else { - $value = implode(',', $array); - } - } - - return $key . ' ' . $exp . ' (' . $value . ')'; - } - - /** - * 闭包子查询 - * @access protected - * @param Query $query 查询对象 - * @param \Closure $call - * @param bool $show - * @return string - */ - protected function parseClosure(Query $query, Closure $call, bool $show = true): string - { - $newQuery = $query->newQuery()->removeOption(); - $call($newQuery); - - return $newQuery->buildSql($show); - } - - /** - * 日期时间条件解析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $value - * @param string $key - * @param integer $bindType - * @return string - */ - protected function parseDateTime(Query $query, $value, string $key, int $bindType): string - { - $options = $query->getOptions(); - - // 获取时间字段类型 - if (strpos($key, '.')) { - [$table, $key] = explode('.', $key); - - if (isset($options['alias']) && $pos = array_search($table, $options['alias'])) { - $table = $pos; - } - } else { - $table = $options['table']; - } - - $type = $query->getFieldType($key); - - if ($type) { - if (is_string($value)) { - $value = strtotime($value) ?: $value; - } - - if (is_int($value)) { - if (preg_match('/(datetime|timestamp)/is', $type)) { - // 日期及时间戳类型 - $value = date('Y-m-d H:i:s', $value); - } elseif (preg_match('/(date)/is', $type)) { - // 日期及时间戳类型 - $value = date('Y-m-d', $value); - } - } - } - - $name = $query->bindValue($value, $bindType); - - return ':' . $name; - } - - /** - * limit分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $limit - * @return string - */ - protected function parseLimit(Query $query, string $limit): string - { - return (!empty($limit) && false === strpos($limit, '(')) ? ' LIMIT ' . $limit . ' ' : ''; - } - - /** - * join分析 - * @access protected - * @param Query $query 查询对象 - * @param array $join - * @return string - */ - protected function parseJoin(Query $query, array $join): string - { - $joinStr = ''; - - foreach ($join as $item) { - [$table, $type, $on] = $item; - - if (strpos($on, '=')) { - [$val1, $val2] = explode('=', $on, 2); - - $condition = $this->parseKey($query, $val1) . '=' . $this->parseKey($query, $val2); - } else { - $condition = $on; - } - - $table = $this->parseTable($query, $table); - - $joinStr .= ' ' . $type . ' JOIN ' . $table . ' ON ' . $condition; - } - - return $joinStr; - } - - /** - * order分析 - * @access protected - * @param Query $query 查询对象 - * @param array $order - * @return string - */ - protected function parseOrder(Query $query, array $order): string - { - $array = []; - foreach ($order as $key => $val) { - if ($val instanceof Raw) { - $array[] = $this->parseRaw($query, $val); - } elseif (is_array($val) && preg_match('/^[\w\.]+$/', $key)) { - $array[] = $this->parseOrderField($query, $key, $val); - } elseif ('[rand]' == $val) { - $array[] = $this->parseRand($query); - } elseif (is_string($val)) { - if (is_numeric($key)) { - [$key, $sort] = explode(' ', strpos($val, ' ') ? $val : $val . ' '); - } else { - $sort = $val; - } - - if (preg_match('/^[\w\.]+$/', $key)) { - $sort = strtoupper($sort); - $sort = in_array($sort, ['ASC', 'DESC'], true) ? ' ' . $sort : ''; - $array[] = $this->parseKey($query, $key, true) . $sort; - } else { - throw new Exception('order express error:' . $key); - } - } - } - - return empty($array) ? '' : ' ORDER BY ' . implode(',', $array); - } - - /** - * 分析Raw对象 - * @access protected - * @param Query $query 查询对象 - * @param Raw $raw Raw对象 - * @return string - */ - protected function parseRaw(Query $query, Raw $raw): string - { - $sql = $raw->getValue(); - $bind = $raw->getBind(); - - if ($bind) { - $query->bindParams($sql, $bind); - } - - return $sql; - } - - /** - * 随机排序 - * @access protected - * @param Query $query 查询对象 - * @return string - */ - protected function parseRand(Query $query): string - { - return ''; - } - - /** - * orderField分析 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param array $val - * @return string - */ - protected function parseOrderField(Query $query, string $key, array $val): string - { - if (isset($val['sort'])) { - $sort = $val['sort']; - unset($val['sort']); - } else { - $sort = ''; - } - - $sort = strtoupper($sort); - $sort = in_array($sort, ['ASC', 'DESC'], true) ? ' ' . $sort : ''; - $bind = $query->getFieldsBindType(); - - foreach ($val as $item) { - $val[] = $this->parseDataBind($query, $key, $item, $bind); - } - - return 'field(' . $this->parseKey($query, $key, true) . ',' . implode(',', $val) . ')' . $sort; - } - - /** - * group分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $group - * @return string - */ - protected function parseGroup(Query $query, $group): string - { - if (empty($group)) { - return ''; - } - - if (is_string($group)) { - $group = explode(',', $group); - } - - $val = []; - foreach ($group as $key) { - $val[] = $this->parseKey($query, $key); - } - - return ' GROUP BY ' . implode(',', $val); - } - - /** - * having分析 - * @access protected - * @param Query $query 查询对象 - * @param string $having - * @return string - */ - protected function parseHaving(Query $query, string $having): string - { - return !empty($having) ? ' HAVING ' . $having : ''; - } - - /** - * comment分析 - * @access protected - * @param Query $query 查询对象 - * @param string $comment - * @return string - */ - protected function parseComment(Query $query, string $comment): string - { - if (false !== strpos($comment, '*/')) { - $comment = strstr($comment, '*/', true); - } - - return !empty($comment) ? ' /* ' . $comment . ' */' : ''; - } - - /** - * distinct分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $distinct - * @return string - */ - protected function parseDistinct(Query $query, bool $distinct): string - { - return !empty($distinct) ? ' DISTINCT ' : ''; - } - - /** - * union分析 - * @access protected - * @param Query $query 查询对象 - * @param array $union - * @return string - */ - protected function parseUnion(Query $query, array $union): string - { - if (empty($union)) { - return ''; - } - - $type = $union['type']; - unset($union['type']); - - foreach ($union as $u) { - if ($u instanceof Closure) { - $sql[] = $type . ' ' . $this->parseClosure($query, $u); - } elseif (is_string($u)) { - $sql[] = $type . ' ( ' . $u . ' )'; - } - } - - return ' ' . implode(' ', $sql); - } - - /** - * index分析,可在操作链中指定需要强制使用的索引 - * @access protected - * @param Query $query 查询对象 - * @param mixed $index - * @return string - */ - protected function parseForce(Query $query, $index): string - { - if (empty($index)) { - return ''; - } - - if (is_array($index)) { - $index = join(',', $index); - } - - return sprintf(" FORCE INDEX ( %s ) ", $index); - } - - /** - * 设置锁机制 - * @access protected - * @param Query $query 查询对象 - * @param bool|string $lock - * @return string - */ - protected function parseLock(Query $query, $lock = false): string - { - if (is_bool($lock)) { - return $lock ? ' FOR UPDATE ' : ''; - } - - if (is_string($lock) && !empty($lock)) { - return ' ' . trim($lock) . ' '; - } else { - return ''; - } - } - - /** - * 生成查询SQL - * @access public - * @param Query $query 查询对象 - * @param bool $one 是否仅获取一个记录 - * @return string - */ - public function select(Query $query, bool $one = false): string - { - $options = $query->getOptions(); - - return str_replace( - ['%TABLE%', '%DISTINCT%', '%EXTRA%', '%FIELD%', '%JOIN%', '%WHERE%', '%GROUP%', '%HAVING%', '%ORDER%', '%LIMIT%', '%UNION%', '%LOCK%', '%COMMENT%', '%FORCE%'], - [ - $this->parseTable($query, $options['table']), - $this->parseDistinct($query, $options['distinct']), - $this->parseExtra($query, $options['extra']), - $this->parseField($query, $options['field']), - $this->parseJoin($query, $options['join']), - $this->parseWhere($query, $options['where']), - $this->parseGroup($query, $options['group']), - $this->parseHaving($query, $options['having']), - $this->parseOrder($query, $options['order']), - $this->parseLimit($query, $one ? '1' : $options['limit']), - $this->parseUnion($query, $options['union']), - $this->parseLock($query, $options['lock']), - $this->parseComment($query, $options['comment']), - $this->parseForce($query, $options['force']), - ], - $this->selectSql); - } - - /** - * 生成Insert SQL - * @access public - * @param Query $query 查询对象 - * @return string - */ - public function insert(Query $query): string - { - $options = $query->getOptions(); - - // 分析并处理数据 - $data = $this->parseData($query, $options['data']); - if (empty($data)) { - return ''; - } - - $fields = array_keys($data); - $values = array_values($data); - - return str_replace( - ['%INSERT%', '%TABLE%', '%EXTRA%', '%FIELD%', '%DATA%', '%COMMENT%'], - [ - !empty($options['replace']) ? 'REPLACE' : 'INSERT', - $this->parseTable($query, $options['table']), - $this->parseExtra($query, $options['extra']), - implode(' , ', $fields), - implode(' , ', $values), - $this->parseComment($query, $options['comment']), - ], - $this->insertSql); - } - - /** - * 生成insertall SQL - * @access public - * @param Query $query 查询对象 - * @param array $dataSet 数据集 - * @return string - */ - public function insertAll(Query $query, array $dataSet): string - { - $options = $query->getOptions(); - - // 获取绑定信息 - $bind = $query->getFieldsBindType(); - - // 获取合法的字段 - if ('*' == $options['field']) { - $allowFields = array_keys($bind); - } else { - $allowFields = $options['field']; - } - - $fields = []; - $values = []; - - foreach ($dataSet as $k => $data) { - $data = $this->parseData($query, $data, $allowFields, $bind); - - $values[] = 'SELECT ' . implode(',', array_values($data)); - - if (!isset($insertFields)) { - $insertFields = array_keys($data); - } - } - - foreach ($insertFields as $field) { - $fields[] = $this->parseKey($query, $field); - } - - return str_replace( - ['%INSERT%', '%TABLE%', '%EXTRA%', '%FIELD%', '%DATA%', '%COMMENT%'], - [ - !empty($options['replace']) ? 'REPLACE' : 'INSERT', - $this->parseTable($query, $options['table']), - $this->parseExtra($query, $options['extra']), - implode(' , ', $fields), - implode(' UNION ALL ', $values), - $this->parseComment($query, $options['comment']), - ], - $this->insertAllSql); - } - - /** - * 生成slect insert SQL - * @access public - * @param Query $query 查询对象 - * @param array $fields 数据 - * @param string $table 数据表 - * @return string - */ - public function selectInsert(Query $query, array $fields, string $table): string - { - foreach ($fields as &$field) { - $field = $this->parseKey($query, $field, true); - } - - return 'INSERT INTO ' . $this->parseTable($query, $table) . ' (' . implode(',', $fields) . ') ' . $this->select($query); - } - - /** - * 生成update SQL - * @access public - * @param Query $query 查询对象 - * @return string - */ - public function update(Query $query): string - { - $options = $query->getOptions(); - - $data = $this->parseData($query, $options['data']); - - if (empty($data)) { - return ''; - } - - $set = []; - foreach ($data as $key => $val) { - $set[] = $key . ' = ' . $val; - } - - return str_replace( - ['%TABLE%', '%EXTRA%', '%SET%', '%JOIN%', '%WHERE%', '%ORDER%', '%LIMIT%', '%LOCK%', '%COMMENT%'], - [ - $this->parseTable($query, $options['table']), - $this->parseExtra($query, $options['extra']), - implode(' , ', $set), - $this->parseJoin($query, $options['join']), - $this->parseWhere($query, $options['where']), - $this->parseOrder($query, $options['order']), - $this->parseLimit($query, $options['limit']), - $this->parseLock($query, $options['lock']), - $this->parseComment($query, $options['comment']), - ], - $this->updateSql); - } - - /** - * 生成delete SQL - * @access public - * @param Query $query 查询对象 - * @return string - */ - public function delete(Query $query): string - { - $options = $query->getOptions(); - - return str_replace( - ['%TABLE%', '%EXTRA%', '%USING%', '%JOIN%', '%WHERE%', '%ORDER%', '%LIMIT%', '%LOCK%', '%COMMENT%'], - [ - $this->parseTable($query, $options['table']), - $this->parseExtra($query, $options['extra']), - !empty($options['using']) ? ' USING ' . $this->parseTable($query, $options['using']) . ' ' : '', - $this->parseJoin($query, $options['join']), - $this->parseWhere($query, $options['where']), - $this->parseOrder($query, $options['order']), - $this->parseLimit($query, $options['limit']), - $this->parseLock($query, $options['lock']), - $this->parseComment($query, $options['comment']), - ], - $this->deleteSql); - } -} diff --git a/vendor/topthink/think-orm/src/db/CacheItem.php b/vendor/topthink/think-orm/src/db/CacheItem.php deleted file mode 100644 index 839f384..0000000 --- a/vendor/topthink/think-orm/src/db/CacheItem.php +++ /dev/null @@ -1,209 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use DateInterval; -use DateTime; -use DateTimeInterface; -use think\db\exception\InvalidArgumentException; - -/** - * CacheItem实现类 - */ -class CacheItem -{ - /** - * 缓存Key - * @var string - */ - protected $key; - - /** - * 缓存内容 - * @var mixed - */ - protected $value; - - /** - * 过期时间 - * @var int|DateTimeInterface - */ - protected $expire; - - /** - * 缓存tag - * @var string - */ - protected $tag; - - /** - * 缓存是否命中 - * @var bool - */ - protected $isHit = false; - - public function __construct(string $key = null) - { - $this->key = $key; - } - - /** - * 为此缓存项设置「键」 - * @access public - * @param string $key - * @return $this - */ - public function setKey(string $key) - { - $this->key = $key; - return $this; - } - - /** - * 返回当前缓存项的「键」 - * @access public - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * 返回当前缓存项的有效期 - * @access public - * @return DateTimeInterface|int|null - */ - public function getExpire() - { - if ($this->expire instanceof DateTimeInterface) { - return $this->expire; - } - - return $this->expire ? $this->expire - time() : null; - } - - /** - * 获取缓存Tag - * @access public - * @return string|array - */ - public function getTag() - { - return $this->tag; - } - - /** - * 凭借此缓存项的「键」从缓存系统里面取出缓存项 - * @access public - * @return mixed - */ - public function get() - { - return $this->value; - } - - /** - * 确认缓存项的检查是否命中 - * @access public - * @return bool - */ - public function isHit(): bool - { - return $this->isHit; - } - - /** - * 为此缓存项设置「值」 - * @access public - * @param mixed $value - * @return $this - */ - public function set($value) - { - $this->value = $value; - $this->isHit = true; - return $this; - } - - /** - * 为此缓存项设置所属标签 - * @access public - * @param string|array $tag - * @return $this - */ - public function tag($tag = null) - { - $this->tag = $tag; - return $this; - } - - /** - * 设置缓存项的有效期 - * @access public - * @param mixed $expire - * @return $this - */ - public function expire($expire) - { - if (is_null($expire)) { - $this->expire = null; - } elseif (is_numeric($expire) || $expire instanceof DateInterval) { - $this->expiresAfter($expire); - } elseif ($expire instanceof DateTimeInterface) { - $this->expire = $expire; - } else { - throw new InvalidArgumentException('not support datetime'); - } - - return $this; - } - - /** - * 设置缓存项的准确过期时间点 - * @access public - * @param DateTimeInterface $expiration - * @return $this - */ - public function expiresAt($expiration) - { - if ($expiration instanceof DateTimeInterface) { - $this->expire = $expiration; - } else { - throw new InvalidArgumentException('not support datetime'); - } - - return $this; - } - - /** - * 设置缓存项的过期时间 - * @access public - * @param int|DateInterval $timeInterval - * @return $this - * @throws InvalidArgumentException - */ - public function expiresAfter($timeInterval) - { - if ($timeInterval instanceof DateInterval) { - $this->expire = (int) DateTime::createFromFormat('U', (string) time())->add($timeInterval)->format('U'); - } elseif (is_numeric($timeInterval)) { - $this->expire = $timeInterval + time(); - } else { - throw new InvalidArgumentException('not support datetime'); - } - - return $this; - } - -} diff --git a/vendor/topthink/think-orm/src/db/Connection.php b/vendor/topthink/think-orm/src/db/Connection.php deleted file mode 100644 index 4400ece..0000000 --- a/vendor/topthink/think-orm/src/db/Connection.php +++ /dev/null @@ -1,347 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use Psr\SimpleCache\CacheInterface; -use think\DbManager; - -/** - * 数据库连接基础类 - */ -abstract class Connection implements ConnectionInterface -{ - - /** - * 当前SQL指令 - * @var string - */ - protected $queryStr = ''; - - /** - * 返回或者影响记录数 - * @var int - */ - protected $numRows = 0; - - /** - * 事务指令数 - * @var int - */ - protected $transTimes = 0; - - /** - * 错误信息 - * @var string - */ - protected $error = ''; - - /** - * 数据库连接ID 支持多个连接 - * @var array - */ - protected $links = []; - - /** - * 当前连接ID - * @var object - */ - protected $linkID; - - /** - * 当前读连接ID - * @var object - */ - protected $linkRead; - - /** - * 当前写连接ID - * @var object - */ - protected $linkWrite; - - /** - * 数据表信息 - * @var array - */ - protected $info = []; - - /** - * 查询开始时间 - * @var float - */ - protected $queryStartTime; - - /** - * Builder对象 - * @var Builder - */ - protected $builder; - - /** - * Db对象 - * @var DbManager - */ - protected $db; - - /** - * 是否读取主库 - * @var bool - */ - protected $readMaster = false; - - /** - * 数据库连接参数配置 - * @var array - */ - protected $config = []; - - /** - * 缓存对象 - * @var CacheInterface - */ - protected $cache; - - /** - * 架构函数 读取数据库配置信息 - * @access public - * @param array $config 数据库配置数组 - */ - public function __construct(array $config = []) - { - if (!empty($config)) { - $this->config = array_merge($this->config, $config); - } - - // 创建Builder对象 - $class = $this->getBuilderClass(); - - $this->builder = new $class($this); - } - - /** - * 获取当前的builder实例对象 - * @access public - * @return Builder - */ - public function getBuilder() - { - return $this->builder; - } - - /** - * 创建查询对象 - */ - public function newQuery() - { - $class = $this->getQueryClass(); - - /** @var BaseQuery $query */ - $query = new $class($this); - - $timeRule = $this->db->getConfig('time_query_rule'); - if (!empty($timeRule)) { - $query->timeRule($timeRule); - } - - return $query; - } - - /** - * 指定表名开始查询 - * @param $table - * @return BaseQuery - */ - public function table($table) - { - return $this->newQuery()->table($table); - } - - /** - * 指定表名开始查询(不带前缀) - * @param $name - * @return BaseQuery - */ - public function name($name) - { - return $this->newQuery()->name($name); - } - - /** - * 设置当前的数据库Db对象 - * @access public - * @param DbManager $db - * @return void - */ - public function setDb(DbManager $db) - { - $this->db = $db; - } - - /** - * 设置当前的缓存对象 - * @access public - * @param CacheInterface $cache - * @return void - */ - public function setCache(CacheInterface $cache) - { - $this->cache = $cache; - } - - /** - * 获取当前的缓存对象 - * @access public - * @return CacheInterface|null - */ - public function getCache() - { - return $this->cache; - } - - /** - * 获取数据库的配置参数 - * @access public - * @param string $config 配置名称 - * @return mixed - */ - public function getConfig(string $config = '') - { - if ('' === $config) { - return $this->config; - } - - return $this->config[$config] ?? null; - } - - /** - * 数据库SQL监控 - * @access protected - * @param string $sql 执行的SQL语句 留空自动获取 - * @param bool $master 主从标记 - * @return void - */ - protected function trigger(string $sql = '', bool $master = false): void - { - $listen = $this->db->getListen(); - if (empty($listen)) { - $listen[] = function ($sql, $time, $master) { - if (0 === strpos($sql, 'CONNECT:')) { - $this->db->log($sql); - return; - } - - // 记录SQL - if (is_bool($master)) { - // 分布式记录当前操作的主从 - $master = $master ? 'master|' : 'slave|'; - } else { - $master = ''; - } - - $this->db->log($sql . ' [ ' . $master . 'RunTime:' . $time . 's ]'); - }; - } - - $runtime = number_format((microtime(true) - $this->queryStartTime), 6); - $sql = $sql ?: $this->getLastsql(); - - if (empty($this->config['deploy'])) { - $master = null; - } - - foreach ($listen as $callback) { - if (is_callable($callback)) { - $callback($sql, $runtime, $master); - } - } - } - - /** - * 缓存数据 - * @access protected - * @param CacheItem $cacheItem 缓存Item - */ - protected function cacheData(CacheItem $cacheItem) - { - if ($cacheItem->getTag() && method_exists($this->cache, 'tag')) { - $this->cache->tag($cacheItem->getTag())->set($cacheItem->getKey(), $cacheItem->get(), $cacheItem->getExpire()); - } else { - $this->cache->set($cacheItem->getKey(), $cacheItem->get(), $cacheItem->getExpire()); - } - } - - /** - * 分析缓存Key - * @access protected - * @param BaseQuery $query 查询对象 - * @param string $method 查询方法 - * @return string - */ - protected function getCacheKey(BaseQuery $query, string $method = ''): string - { - if (!empty($query->getOptions('key')) && empty($method)) { - $key = 'think:' . $this->getConfig('database') . '.' . $query->getTable() . '|' . $query->getOptions('key'); - } else { - $key = $query->getQueryGuid(); - } - - return $key; - } - - /** - * 分析缓存 - * @access protected - * @param BaseQuery $query 查询对象 - * @param array $cache 缓存信息 - * @param string $method 查询方法 - * @return CacheItem - */ - protected function parseCache(BaseQuery $query, array $cache, string $method = ''): CacheItem - { - [$key, $expire, $tag] = $cache; - - if ($key instanceof CacheItem) { - $cacheItem = $key; - } else { - if (true === $key) { - $key = $this->getCacheKey($query, $method); - } - - $cacheItem = new CacheItem($key); - $cacheItem->expire($expire); - $cacheItem->tag($tag); - } - - return $cacheItem; - } - - /** - * 获取返回或者影响的记录数 - * @access public - * @return integer - */ - public function getNumRows(): int - { - return $this->numRows; - } - - /** - * 析构方法 - * @access public - */ - public function __destruct() - { - // 关闭连接 - $this->close(); - } -} diff --git a/vendor/topthink/think-orm/src/db/ConnectionInterface.php b/vendor/topthink/think-orm/src/db/ConnectionInterface.php deleted file mode 100644 index 18fe131..0000000 --- a/vendor/topthink/think-orm/src/db/ConnectionInterface.php +++ /dev/null @@ -1,190 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use Psr\SimpleCache\CacheInterface; -use think\DbManager; - -/** - * Connection interface - */ -interface ConnectionInterface -{ - /** - * 获取当前连接器类对应的Query类 - * @access public - * @return string - */ - public function getQueryClass(): string; - - /** - * 指定表名开始查询 - * @param $table - * @return BaseQuery - */ - public function table($table); - - /** - * 指定表名开始查询(不带前缀) - * @param $name - * @return BaseQuery - */ - public function name($name); - - /** - * 连接数据库方法 - * @access public - * @param array $config 接参数 - * @param integer $linkNum 连接序号 - * @return mixed - */ - public function connect(array $config = [], $linkNum = 0); - - /** - * 设置当前的数据库Db对象 - * @access public - * @param DbManager $db - * @return void - */ - public function setDb(DbManager $db); - - /** - * 设置当前的缓存对象 - * @access public - * @param CacheInterface $cache - * @return void - */ - public function setCache(CacheInterface $cache); - - /** - * 获取数据库的配置参数 - * @access public - * @param string $config 配置名称 - * @return mixed - */ - public function getConfig(string $config = ''); - - /** - * 关闭数据库(或者重新连接) - * @access public - * @return $this - */ - public function close(); - - /** - * 查找单条记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return array - */ - public function find(BaseQuery $query): array; - - /** - * 查找记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return array - */ - public function select(BaseQuery $query): array; - - /** - * 插入记录 - * @access public - * @param BaseQuery $query 查询对象 - * @param boolean $getLastInsID 返回自增主键 - * @return mixed - */ - public function insert(BaseQuery $query, bool $getLastInsID = false); - - /** - * 批量插入记录 - * @access public - * @param BaseQuery $query 查询对象 - * @param mixed $dataSet 数据集 - * @return integer - */ - public function insertAll(BaseQuery $query, array $dataSet = []): int; - - /** - * 更新记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return integer - */ - public function update(BaseQuery $query): int; - - /** - * 删除记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return int - */ - public function delete(BaseQuery $query): int; - - /** - * 得到某个字段的值 - * @access public - * @param BaseQuery $query 查询对象 - * @param string $field 字段名 - * @param mixed $default 默认值 - * @return mixed - */ - public function value(BaseQuery $query, string $field, $default = null); - - /** - * 得到某个列的数组 - * @access public - * @param BaseQuery $query 查询对象 - * @param string|array $column 字段名 多个字段用逗号分隔 - * @param string $key 索引 - * @return array - */ - public function column(BaseQuery $query, $column, string $key = ''): array; - - /** - * 执行数据库事务 - * @access public - * @param callable $callback 数据操作方法回调 - * @return mixed - */ - public function transaction(callable $callback); - - /** - * 启动事务 - * @access public - * @return void - */ - public function startTrans(); - - /** - * 用于非自动提交状态下面的查询提交 - * @access public - * @return void - */ - public function commit(); - - /** - * 事务回滚 - * @access public - * @return void - */ - public function rollback(); - - /** - * 获取最近一次查询的sql语句 - * @access public - * @return string - */ - public function getLastSql(): string; - -} diff --git a/vendor/topthink/think-orm/src/db/Fetch.php b/vendor/topthink/think-orm/src/db/Fetch.php deleted file mode 100644 index 16caed2..0000000 --- a/vendor/topthink/think-orm/src/db/Fetch.php +++ /dev/null @@ -1,494 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use think\db\exception\DbException as Exception; -use think\helper\Str; - -/** - * SQL获取类 - */ -class Fetch -{ - /** - * 查询对象 - * @var Query - */ - protected $query; - - /** - * Connection对象 - * @var Connection - */ - protected $connection; - - /** - * Builder对象 - * @var Builder - */ - protected $builder; - - /** - * 创建一个查询SQL获取对象 - * - * @param Query $query 查询对象 - */ - public function __construct(Query $query) - { - $this->query = $query; - $this->connection = $query->getConnection(); - $this->builder = $this->connection->getBuilder(); - } - - /** - * 聚合查询 - * @access protected - * @param string $aggregate 聚合方法 - * @param string $field 字段名 - * @return string - */ - protected function aggregate(string $aggregate, string $field): string - { - $this->query->parseOptions(); - - $field = $aggregate . '(' . $this->builder->parseKey($this->query, $field) . ') AS think_' . strtolower($aggregate); - - return $this->value($field, 0, false); - } - - /** - * 得到某个字段的值 - * @access public - * @param string $field 字段名 - * @param mixed $default 默认值 - * @param bool $one - * @return string - */ - public function value(string $field, $default = null, bool $one = true): string - { - $options = $this->query->parseOptions(); - - if (isset($options['field'])) { - $this->query->removeOption('field'); - } - - $this->query->setOption('field', (array) $field); - - // 生成查询SQL - $sql = $this->builder->select($this->query, $one); - - if (isset($options['field'])) { - $this->query->setOption('field', $options['field']); - } else { - $this->query->removeOption('field'); - } - - return $this->fetch($sql); - } - - /** - * 得到某个列的数组 - * @access public - * @param string $field 字段名 多个字段用逗号分隔 - * @param string $key 索引 - * @return string - */ - public function column(string $field, string $key = ''): string - { - $options = $this->query->parseOptions(); - - if (isset($options['field'])) { - $this->query->removeOption('field'); - } - - if ($key && '*' != $field) { - $field = $key . ',' . $field; - } - - $field = array_map('trim', explode(',', $field)); - - $this->query->setOption('field', $field); - - // 生成查询SQL - $sql = $this->builder->select($this->query); - - if (isset($options['field'])) { - $this->query->setOption('field', $options['field']); - } else { - $this->query->removeOption('field'); - } - - return $this->fetch($sql); - } - - /** - * 插入记录 - * @access public - * @param array $data 数据 - * @return string - */ - public function insert(array $data = []): string - { - $options = $this->query->parseOptions(); - - if (!empty($data)) { - $this->query->setOption('data', $data); - } - - $sql = $this->builder->insert($this->query); - - return $this->fetch($sql); - } - - /** - * 插入记录并获取自增ID - * @access public - * @param array $data 数据 - * @return string - */ - public function insertGetId(array $data = []): string - { - return $this->insert($data); - } - - /** - * 保存数据 自动判断insert或者update - * @access public - * @param array $data 数据 - * @param bool $forceInsert 是否强制insert - * @return string - */ - public function save(array $data = [], bool $forceInsert = false): string - { - if ($forceInsert) { - return $this->insert($data); - } - - $data = array_merge($this->query->getOptions('data') ?: [], $data); - - $this->query->setOption('data', $data); - - if ($this->query->getOptions('where')) { - $isUpdate = true; - } else { - $isUpdate = $this->query->parseUpdateData($data); - } - - return $isUpdate ? $this->update() : $this->insert(); - } - - /** - * 批量插入记录 - * @access public - * @param array $dataSet 数据集 - * @param integer $limit 每次写入数据限制 - * @return string - */ - public function insertAll(array $dataSet = [], int $limit = null): string - { - $options = $this->query->parseOptions(); - - if (empty($dataSet)) { - $dataSet = $options['data']; - } - - if (empty($limit) && !empty($options['limit'])) { - $limit = $options['limit']; - } - - if ($limit) { - $array = array_chunk($dataSet, $limit, true); - $fetchSql = []; - foreach ($array as $item) { - $sql = $this->builder->insertAll($this->query, $item); - $bind = $this->query->getBind(); - - $fetchSql[] = $this->connection->getRealSql($sql, $bind); - } - - return implode(';', $fetchSql); - } - - $sql = $this->builder->insertAll($this->query, $dataSet); - - return $this->fetch($sql); - } - - /** - * 通过Select方式插入记录 - * @access public - * @param array $fields 要插入的数据表字段名 - * @param string $table 要插入的数据表名 - * @return string - */ - public function selectInsert(array $fields, string $table): string - { - $this->query->parseOptions(); - - $sql = $this->builder->selectInsert($this->query, $fields, $table); - - return $this->fetch($sql); - } - - /** - * 更新记录 - * @access public - * @param mixed $data 数据 - * @return string - */ - public function update(array $data = []): string - { - $options = $this->query->parseOptions(); - - $data = !empty($data) ? $data : $options['data']; - - $pk = $this->query->getPk(); - - if (empty($options['where'])) { - // 如果存在主键数据 则自动作为更新条件 - if (is_string($pk) && isset($data[$pk])) { - $this->query->where($pk, '=', $data[$pk]); - unset($data[$pk]); - } elseif (is_array($pk)) { - // 增加复合主键支持 - foreach ($pk as $field) { - if (isset($data[$field])) { - $this->query->where($field, '=', $data[$field]); - } else { - // 如果缺少复合主键数据则不执行 - throw new Exception('miss complex primary data'); - } - unset($data[$field]); - } - } - - if (empty($this->query->getOptions('where'))) { - // 如果没有任何更新条件则不执行 - throw new Exception('miss update condition'); - } - } - - // 更新数据 - $this->query->setOption('data', $data); - - // 生成UPDATE SQL语句 - $sql = $this->builder->update($this->query); - - return $this->fetch($sql); - } - - /** - * 删除记录 - * @access public - * @param mixed $data 表达式 true 表示强制删除 - * @return string - */ - public function delete($data = null): string - { - $options = $this->query->parseOptions(); - - if (!is_null($data) && true !== $data) { - // AR模式分析主键条件 - $this->query->parsePkWhere($data); - } - - if (!empty($options['soft_delete'])) { - // 软删除 - [$field, $condition] = $options['soft_delete']; - if ($condition) { - $this->query->setOption('soft_delete', null); - $this->query->setOption('data', [$field => $condition]); - // 生成删除SQL语句 - $sql = $this->builder->delete($this->query); - return $this->fetch($sql); - } - } - - // 生成删除SQL语句 - $sql = $this->builder->delete($this->query); - - return $this->fetch($sql); - } - - /** - * 查找记录 返回SQL - * @access public - * @param mixed $data - * @return string - */ - public function select($data = null): string - { - $this->query->parseOptions(); - - if (!is_null($data)) { - // 主键条件分析 - $this->query->parsePkWhere($data); - } - - // 生成查询SQL - $sql = $this->builder->select($this->query); - - return $this->fetch($sql); - } - - /** - * 查找单条记录 返回SQL语句 - * @access public - * @param mixed $data - * @return string - */ - public function find($data = null): string - { - $this->query->parseOptions(); - - if (!is_null($data)) { - // AR模式分析主键条件 - $this->query->parsePkWhere($data); - } - - // 生成查询SQL - $sql = $this->builder->select($this->query, true); - - // 获取实际执行的SQL语句 - return $this->fetch($sql); - } - - /** - * 查找多条记录 如果不存在则抛出异常 - * @access public - * @param mixed $data - * @return string - */ - public function selectOrFail($data = null): string - { - return $this->select($data); - } - - /** - * 查找单条记录 如果不存在则抛出异常 - * @access public - * @param mixed $data - * @return string - */ - public function findOrFail($data = null): string - { - return $this->find($data); - } - - /** - * 查找单条记录 不存在返回空数据(或者空模型) - * @access public - * @param mixed $data 数据 - * @return string - */ - public function findOrEmpty($data = null) - { - return $this->find($data); - } - - /** - * 获取实际的SQL语句 - * @access public - * @param string $sql - * @return string - */ - public function fetch(string $sql): string - { - $bind = $this->query->getBind(); - - return $this->connection->getRealSql($sql, $bind); - } - - /** - * COUNT查询 - * @access public - * @param string $field 字段名 - * @return string - */ - public function count(string $field = '*'): string - { - $options = $this->query->parseOptions(); - - if (!empty($options['group'])) { - // 支持GROUP - $bind = $this->query->getBind(); - $subSql = $this->query->options($options)->field('count(' . $field . ') AS think_count')->bind($bind)->buildSql(); - - $query = $this->query->newQuery()->table([$subSql => '_group_count_']); - - return $query->fetchsql()->aggregate('COUNT', '*'); - } else { - return $this->aggregate('COUNT', $field); - } - } - - /** - * SUM查询 - * @access public - * @param string $field 字段名 - * @return string - */ - public function sum(string $field): string - { - return $this->aggregate('SUM', $field); - } - - /** - * MIN查询 - * @access public - * @param string $field 字段名 - * @return string - */ - public function min(string $field): string - { - return $this->aggregate('MIN', $field); - } - - /** - * MAX查询 - * @access public - * @param string $field 字段名 - * @return string - */ - public function max(string $field): string - { - return $this->aggregate('MAX', $field); - } - - /** - * AVG查询 - * @access public - * @param string $field 字段名 - * @return string - */ - public function avg(string $field): string - { - return $this->aggregate('AVG', $field); - } - - public function __call($method, $args) - { - if (strtolower(substr($method, 0, 5)) == 'getby') { - // 根据某个字段获取记录 - $field = Str::snake(substr($method, 5)); - return $this->where($field, '=', $args[0])->find(); - } elseif (strtolower(substr($method, 0, 10)) == 'getfieldby') { - // 根据某个字段获取记录的某个值 - $name = Str::snake(substr($method, 10)); - return $this->where($name, '=', $args[0])->value($args[1]); - } - - $result = call_user_func_array([$this->query, $method], $args); - return $result === $this->query ? $this : $result; - } -} diff --git a/vendor/topthink/think-orm/src/db/Mongo.php b/vendor/topthink/think-orm/src/db/Mongo.php deleted file mode 100644 index 5e8a09a..0000000 --- a/vendor/topthink/think-orm/src/db/Mongo.php +++ /dev/null @@ -1,712 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); -namespace think\db; - -use MongoDB\Driver\Command; -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Exception\AuthenticationException; -use MongoDB\Driver\Exception\ConnectionException; -use MongoDB\Driver\Exception\InvalidArgumentException; -use MongoDB\Driver\Exception\RuntimeException; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; -use think\db\exception\DbException as Exception; -use think\Paginator; - -class Mongo extends BaseQuery -{ - /** - * 当前数据库连接对象 - * @var \think\db\connector\Mongo - */ - protected $connection; - - /** - * 执行指令 返回数据集 - * @access public - * @param Command $command 指令 - * @param string $dbName - * @param ReadPreference $readPreference readPreference - * @param string|array $typeMap 指定返回的typeMap - * @return mixed - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - */ - public function command(Command $command, string $dbName = '', ReadPreference $readPreference = null, $typeMap = null) - { - return $this->connection->command($command, $dbName, $readPreference, $typeMap); - } - - /** - * 执行command - * @access public - * @param string|array|object $command 指令 - * @param mixed $extra 额外参数 - * @param string $db 数据库名 - * @return array - */ - public function cmd($command, $extra = null, string $db = ''): array - { - $this->parseOptions(); - return $this->connection->cmd($this, $command, $extra, $db); - } - - /** - * 指定distinct查询 - * @access public - * @param string $field 字段名 - * @return array - */ - public function getDistinct(string $field) - { - $result = $this->cmd('distinct', $field); - return $result[0]['values']; - } - - /** - * 获取数据库的所有collection - * @access public - * @param string $db 数据库名称 留空为当前数据库 - * @throws Exception - */ - public function listCollections(string $db = '') - { - $cursor = $this->cmd('listCollections', null, $db); - $result = []; - foreach ($cursor as $collection) { - $result[] = $collection['name']; - } - - return $result; - } - - /** - * COUNT查询 - * @access public - * @param string $field 字段名 - * @return integer - */ - public function count(string $field = null): int - { - $result = $this->cmd('count'); - - return $result[0]['n']; - } - - /** - * 聚合查询 - * @access public - * @param string $aggregate 聚合指令 - * @param string $field 字段名 - * @param bool $force 强制转为数字类型 - * @return mixed - */ - public function aggregate(string $aggregate, $field, bool $force = false) - { - $result = $this->cmd('aggregate', [strtolower($aggregate), $field]); - $value = $result[0]['aggregate'] ?? 0; - - if ($force) { - $value += 0; - } - - return $value; - } - - /** - * 多聚合操作 - * - * @param array $aggregate 聚合指令, 可以聚合多个参数, 如 ['sum' => 'field1', 'avg' => 'field2'] - * @param array $groupBy 类似mysql里面的group字段, 可以传入多个字段, 如 ['field_a', 'field_b', 'field_c'] - * @return array 查询结果 - */ - public function multiAggregate(array $aggregate, array $groupBy): array - { - $result = $this->cmd('multiAggregate', [$aggregate, $groupBy]); - - foreach ($result as &$row) { - if (isset($row['_id']) && !empty($row['_id'])) { - foreach ($row['_id'] as $k => $v) { - $row[$k] = $v; - } - unset($row['_id']); - } - } - - return $result; - } - - /** - * 字段值增长 - * @access public - * @param string $field 字段名 - * @param float $step 增长值 - * @return $this - */ - public function inc(string $field, float $step = 1) - { - $this->options['data'][$field] = ['$inc', $step]; - - return $this; - } - - /** - * 字段值减少 - * @access public - * @param string $field 字段名 - * @param float $step 减少值 - * @return $this - */ - public function dec(string $field, float $step = 1) - { - return $this->inc($field, -1 * $step); - } - - /** - * 指定当前操作的Collection - * @access public - * @param string $table 表名 - * @return $this - */ - public function table($table) - { - $this->options['table'] = $table; - - return $this; - } - - /** - * table方法的别名 - * @access public - * @param string $collection - * @return $this - */ - public function collection(string $collection) - { - return $this->table($collection); - } - - /** - * 设置typeMap - * @access public - * @param string|array $typeMap - * @return $this - */ - public function typeMap($typeMap) - { - $this->options['typeMap'] = $typeMap; - return $this; - } - - /** - * awaitData - * @access public - * @param bool $awaitData - * @return $this - */ - public function awaitData(bool $awaitData) - { - $this->options['awaitData'] = $awaitData; - return $this; - } - - /** - * batchSize - * @access public - * @param integer $batchSize - * @return $this - */ - public function batchSize(int $batchSize) - { - $this->options['batchSize'] = $batchSize; - return $this; - } - - /** - * exhaust - * @access public - * @param bool $exhaust - * @return $this - */ - public function exhaust(bool $exhaust) - { - $this->options['exhaust'] = $exhaust; - return $this; - } - - /** - * 设置modifiers - * @access public - * @param array $modifiers - * @return $this - */ - public function modifiers(array $modifiers) - { - $this->options['modifiers'] = $modifiers; - return $this; - } - - /** - * 设置noCursorTimeout - * @access public - * @param bool $noCursorTimeout - * @return $this - */ - public function noCursorTimeout(bool $noCursorTimeout) - { - $this->options['noCursorTimeout'] = $noCursorTimeout; - return $this; - } - - /** - * 设置oplogReplay - * @access public - * @param bool $oplogReplay - * @return $this - */ - public function oplogReplay(bool $oplogReplay) - { - $this->options['oplogReplay'] = $oplogReplay; - return $this; - } - - /** - * 设置partial - * @access public - * @param bool $partial - * @return $this - */ - public function partial(bool $partial) - { - $this->options['partial'] = $partial; - return $this; - } - - /** - * maxTimeMS - * @access public - * @param string $maxTimeMS - * @return $this - */ - public function maxTimeMS(string $maxTimeMS) - { - $this->options['maxTimeMS'] = $maxTimeMS; - return $this; - } - - /** - * collation - * @access public - * @param array $collation - * @return $this - */ - public function collation(array $collation) - { - $this->options['collation'] = $collation; - return $this; - } - - /** - * 设置是否REPLACE - * @access public - * @param bool $replace 是否使用REPLACE写入数据 - * @return $this - */ - public function replace(bool $replace = true) - { - return $this; - } - - /** - * 设置返回字段 - * @access public - * @param mixed $field 字段信息 - * @return $this - */ - public function field($field) - { - if (empty($field) || '*' == $field) { - return $this; - } - - if (is_string($field)) { - $field = array_map('trim', explode(',', $field)); - } - - $projection = []; - foreach ($field as $key => $val) { - if (is_numeric($key)) { - $projection[$val] = 1; - } else { - $projection[$key] = $val; - } - } - - $this->options['projection'] = $projection; - - return $this; - } - - /** - * 指定要排除的查询字段 - * @access public - * @param array|string $field 要排除的字段 - * @return $this - */ - public function withoutField($field) - { - if (empty($field) || '*' == $field) { - return $this; - } - - if (is_string($field)) { - $field = array_map('trim', explode(',', $field)); - } - - $projection = []; - foreach ($field as $key => $val) { - if (is_numeric($key)) { - $projection[$val] = 0; - } else { - $projection[$key] = $val; - } - } - - $this->options['projection'] = $projection; - return $this; - } - - /** - * 设置skip - * @access public - * @param integer $skip - * @return $this - */ - public function skip(int $skip) - { - $this->options['skip'] = $skip; - return $this; - } - - /** - * 设置slaveOk - * @access public - * @param bool $slaveOk - * @return $this - */ - public function slaveOk(bool $slaveOk) - { - $this->options['slaveOk'] = $slaveOk; - return $this; - } - - /** - * 指定查询数量 - * @access public - * @param int $offset 起始位置 - * @param int $length 查询数量 - * @return $this - */ - public function limit(int $offset, int $length = null) - { - if (is_null($length)) { - $length = $offset; - $offset = 0; - } - - $this->options['skip'] = $offset; - $this->options['limit'] = $length; - - return $this; - } - - /** - * 设置sort - * @access public - * @param array|string $field - * @param string $order - * @return $this - */ - public function order($field, string $order = '') - { - if (is_array($field)) { - $this->options['sort'] = $field; - } else { - $this->options['sort'][$field] = 'asc' == strtolower($order) ? 1 : -1; - } - return $this; - } - - /** - * 设置tailable - * @access public - * @param bool $tailable - * @return $this - */ - public function tailable(bool $tailable) - { - $this->options['tailable'] = $tailable; - return $this; - } - - /** - * 设置writeConcern对象 - * @access public - * @param WriteConcern $writeConcern - * @return $this - */ - public function writeConcern(WriteConcern $writeConcern) - { - $this->options['writeConcern'] = $writeConcern; - return $this; - } - - /** - * 获取当前数据表的主键 - * @access public - * @return string|array - */ - public function getPk() - { - return $this->pk ?: $this->connection->getConfig('pk'); - } - - /** - * 执行查询但只返回Cursor对象 - * @access public - * @return Cursor - */ - public function getCursor(): Cursor - { - $this->parseOptions(); - - return $this->connection->getCursor($this); - } - - /** - * 获取当前的查询标识 - * @access public - * @param mixed $data 要序列化的数据 - * @return string - */ - public function getQueryGuid($data = null): string - { - return md5($this->getConfig('database') . serialize(var_export($data ?: $this->options, true))); - } - - /** - * 分页查询 - * @access public - * @param int|array $listRows 每页数量 数组表示配置参数 - * @param int|bool $simple 是否简洁模式或者总记录数 - * @return Paginator - * @throws Exception - */ - public function paginate($listRows = null, $simple = false): Paginator - { - if (is_int($simple)) { - $total = $simple; - $simple = false; - } - - $defaultConfig = [ - 'query' => [], //url额外参数 - 'fragment' => '', //url锚点 - 'var_page' => 'page', //分页变量 - 'list_rows' => 15, //每页数量 - ]; - - if (is_array($listRows)) { - $config = array_merge($defaultConfig, $listRows); - $listRows = intval($config['list_rows']); - } else { - $config = $defaultConfig; - $listRows = intval($listRows ?: $config['list_rows']); - } - - $page = isset($config['page']) ? (int) $config['page'] : Paginator::getCurrentPage($config['var_page']); - - $page = $page < 1 ? 1 : $page; - - $config['path'] = $config['path'] ?? Paginator::getCurrentPath(); - - if (!isset($total) && !$simple) { - $options = $this->getOptions(); - - unset($this->options['order'], $this->options['limit'], $this->options['page'], $this->options['field']); - - $total = $this->count(); - $results = $this->options($options)->page($page, $listRows)->select(); - } elseif ($simple) { - $results = $this->limit(($page - 1) * $listRows, $listRows + 1)->select(); - $total = null; - } else { - $results = $this->page($page, $listRows)->select(); - } - - $this->removeOption('limit'); - $this->removeOption('page'); - - return Paginator::make($results, $listRows, $page, $total, $simple, $config); - } - - /** - * 分批数据返回处理 - * @access public - * @param integer $count 每次处理的数据数量 - * @param callable $callback 处理回调方法 - * @param string|array $column 分批处理的字段名 - * @param string $order 字段排序 - * @return bool - * @throws Exception - */ - public function chunk(int $count, callable $callback, $column = null, string $order = 'asc'): bool - { - $options = $this->getOptions(); - $column = $column ?: $this->getPk(); - - if (isset($options['order'])) { - unset($options['order']); - } - - if (is_array($column)) { - $times = 1; - $query = $this->options($options)->page($times, $count); - } else { - $query = $this->options($options)->limit($count); - - if (strpos($column, '.')) { - [$alias, $key] = explode('.', $column); - } else { - $key = $column; - } - } - - $resultSet = $query->order($column, $order)->select(); - - while (count($resultSet) > 0) { - if (false === call_user_func($callback, $resultSet)) { - return false; - } - - if (isset($times)) { - $times++; - $query = $this->options($options)->page($times, $count); - } else { - $end = $resultSet->pop(); - $lastId = is_array($end) ? $end[$key] : $end->getData($key); - - $query = $this->options($options) - ->limit($count) - ->where($column, 'asc' == strtolower($order) ? '>' : '<', $lastId); - } - - $resultSet = $query->order($column, $order)->select(); - } - - return true; - } - - /** - * 分析表达式(可用于查询或者写入操作) - * @access public - * @return array - */ - public function parseOptions(): array - { - $options = $this->options; - - // 获取数据表 - if (empty($options['table'])) { - $options['table'] = $this->getTable(); - } - - foreach (['where', 'data'] as $name) { - if (!isset($options[$name])) { - $options[$name] = []; - } - } - - $modifiers = empty($options['modifiers']) ? [] : $options['modifiers']; - if (isset($options['comment'])) { - $modifiers['$comment'] = $options['comment']; - } - - if (isset($options['maxTimeMS'])) { - $modifiers['$maxTimeMS'] = $options['maxTimeMS']; - } - - if (!empty($modifiers)) { - $options['modifiers'] = $modifiers; - } - - if (!isset($options['projection'])) { - $options['projection'] = []; - } - - if (!isset($options['typeMap'])) { - $options['typeMap'] = $this->getConfig('type_map'); - } - - if (!isset($options['limit'])) { - $options['limit'] = 0; - } - - foreach (['master', 'fetch_sql', 'fetch_cursor'] as $name) { - if (!isset($options[$name])) { - $options[$name] = false; - } - } - - if (isset($options['page'])) { - // 根据页数计算limit - [$page, $listRows] = $options['page']; - - $page = $page > 0 ? $page : 1; - $listRows = $listRows > 0 ? $listRows : (is_numeric($options['limit']) ? $options['limit'] : 20); - $offset = $listRows * ($page - 1); - $options['skip'] = intval($offset); - $options['limit'] = intval($listRows); - } - - $this->options = $options; - - return $options; - } - - /** - * 获取字段类型信息 - * @access public - * @return array - */ - public function getFieldsType(): array - { - if (!empty($this->options['field_type'])) { - return $this->options['field_type']; - } - - return []; - } - - /** - * 获取字段类型信息 - * @access public - * @param string $field 字段名 - * @return string|null - */ - public function getFieldType(string $field) - { - $fieldType = $this->getFieldsType(); - - return $fieldType[$field] ?? null; - } -} diff --git a/vendor/topthink/think-orm/src/db/PDOConnection.php b/vendor/topthink/think-orm/src/db/PDOConnection.php deleted file mode 100644 index 0a51c0c..0000000 --- a/vendor/topthink/think-orm/src/db/PDOConnection.php +++ /dev/null @@ -1,1792 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use Closure; -use PDO; -use PDOStatement; -use think\db\exception\BindParamException; -use think\db\exception\DbException; -use think\db\exception\PDOException; -use think\Model; - -/** - * 数据库连接基础类 - * @property PDO[] $links - * @property PDO $linkID - * @property PDO $linkRead - * @property PDO $linkWrite - */ -abstract class PDOConnection extends Connection -{ - const PARAM_FLOAT = 21; - - /** - * 数据库连接参数配置 - * @var array - */ - protected $config = [ - // 数据库类型 - 'type' => '', - // 服务器地址 - 'hostname' => '', - // 数据库名 - 'database' => '', - // 用户名 - 'username' => '', - // 密码 - 'password' => '', - // 端口 - 'hostport' => '', - // 连接dsn - 'dsn' => '', - // 数据库连接参数 - 'params' => [], - // 数据库编码默认采用utf8 - 'charset' => 'utf8', - // 数据库表前缀 - 'prefix' => '', - // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) - 'deploy' => 0, - // 数据库读写是否分离 主从式有效 - 'rw_separate' => false, - // 读写分离后 主服务器数量 - 'master_num' => 1, - // 指定从服务器序号 - 'slave_no' => '', - // 模型写入后自动读取主服务器 - 'read_master' => false, - // 是否严格检查字段是否存在 - 'fields_strict' => true, - // 开启字段缓存 - 'fields_cache' => false, - // 监听SQL - 'trigger_sql' => true, - // Builder类 - 'builder' => '', - // Query类 - 'query' => '', - // 是否需要断线重连 - 'break_reconnect' => false, - // 断线标识字符串 - 'break_match_str' => [], - ]; - - /** - * PDO操作实例 - * @var PDOStatement - */ - protected $PDOStatement; - - /** - * 当前SQL指令 - * @var string - */ - protected $queryStr = ''; - - /** - * 事务指令数 - * @var int - */ - protected $transTimes = 0; - - /** - * 重连次数 - * @var int - */ - protected $reConnectTimes = 0; - - /** - * 查询结果类型 - * @var int - */ - protected $fetchType = PDO::FETCH_ASSOC; - - /** - * 字段属性大小写 - * @var int - */ - protected $attrCase = PDO::CASE_LOWER; - - /** - * 数据表信息 - * @var array - */ - protected $info = []; - - /** - * 查询开始时间 - * @var float - */ - protected $queryStartTime; - - /** - * PDO连接参数 - * @var array - */ - protected $params = [ - PDO::ATTR_CASE => PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - PDO::ATTR_EMULATE_PREPARES => false, - ]; - - /** - * 参数绑定类型映射 - * @var array - */ - protected $bindType = [ - 'string' => PDO::PARAM_STR, - 'str' => PDO::PARAM_STR, - 'integer' => PDO::PARAM_INT, - 'int' => PDO::PARAM_INT, - 'boolean' => PDO::PARAM_BOOL, - 'bool' => PDO::PARAM_BOOL, - 'float' => self::PARAM_FLOAT, - 'datetime' => PDO::PARAM_STR, - 'timestamp' => PDO::PARAM_STR, - ]; - - /** - * 服务器断线标识字符 - * @var array - */ - protected $breakMatchStr = [ - 'server has gone away', - 'no connection to the server', - 'Lost connection', - 'is dead or not enabled', - 'Error while sending', - 'decryption failed or bad record mac', - 'server closed the connection unexpectedly', - 'SSL connection has been closed unexpectedly', - 'Error writing data to the connection', - 'Resource deadlock avoided', - 'failed with errno', - 'child connection forced to terminate due to client_idle_limit', - 'query_wait_timeout', - 'reset by peer', - 'Physical connection is not usable', - 'TCP Provider: Error code 0x68', - 'ORA-03114', - 'Packets out of order. Expected', - 'Adaptive Server connection failed', - 'Communication link failure', - 'connection is no longer usable', - 'Login timeout expired', - 'SQLSTATE[HY000] [2002] Connection refused', - 'running with the --read-only option so it cannot execute this statement', - 'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.', - 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again', - 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known', - 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected', - 'SQLSTATE[HY000] [2002] Connection timed out', - 'SSL: Connection timed out', - 'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.', - ]; - - /** - * 绑定参数 - * @var array - */ - protected $bind = []; - - /** - * 获取当前连接器类对应的Query类 - * @access public - * @return string - */ - public function getQueryClass(): string - { - return $this->getConfig('query') ?: Query::class; - } - - /** - * 获取当前连接器类对应的Builder类 - * @access public - * @return string - */ - public function getBuilderClass(): string - { - return $this->getConfig('builder') ?: '\\think\\db\\builder\\' . ucfirst($this->getConfig('type')); - } - - /** - * 解析pdo连接的dsn信息 - * @access protected - * @param array $config 连接信息 - * @return string - */ - abstract protected function parseDsn(array $config): string; - - /** - * 取得数据表的字段信息 - * @access public - * @param string $tableName 数据表名称 - * @return array - */ - abstract public function getFields(string $tableName): array; - - /** - * 取得数据库的表信息 - * @access public - * @param string $dbName 数据库名称 - * @return array - */ - abstract public function getTables(string $dbName = ''): array; - - /** - * 对返数据表字段信息进行大小写转换出来 - * @access public - * @param array $info 字段信息 - * @return array - */ - public function fieldCase(array $info): array - { - // 字段大小写转换 - switch ($this->attrCase) { - case PDO::CASE_LOWER: - $info = array_change_key_case($info); - break; - case PDO::CASE_UPPER: - $info = array_change_key_case($info, CASE_UPPER); - break; - case PDO::CASE_NATURAL: - default: - // 不做转换 - } - - return $info; - } - - /** - * 获取字段类型 - * @access protected - * @param string $type 字段类型 - * @return string - */ - protected function getFieldType(string $type): string - { - if (0 === strpos($type, 'set') || 0 === strpos($type, 'enum')) { - $result = 'string'; - } elseif (preg_match('/(double|float|decimal|real|numeric)/is', $type)) { - $result = 'float'; - } elseif (preg_match('/(int|serial|bit)/is', $type)) { - $result = 'int'; - } elseif (preg_match('/bool/is', $type)) { - $result = 'bool'; - } elseif (0 === strpos($type, 'timestamp')) { - $result = 'timestamp'; - } elseif (0 === strpos($type, 'datetime')) { - $result = 'datetime'; - } elseif (0 === strpos($type, 'date')) { - $result = 'date'; - } else { - $result = 'string'; - } - - return $result; - } - - /** - * 获取字段绑定类型 - * @access public - * @param string $type 字段类型 - * @return integer - */ - public function getFieldBindType(string $type): int - { - if (in_array($type, ['integer', 'string', 'float', 'boolean', 'bool', 'int', 'str'])) { - $bind = $this->bindType[$type]; - } elseif (0 === strpos($type, 'set') || 0 === strpos($type, 'enum')) { - $bind = PDO::PARAM_STR; - } elseif (preg_match('/(double|float|decimal|real|numeric)/is', $type)) { - $bind = self::PARAM_FLOAT; - } elseif (preg_match('/(int|serial|bit)/is', $type)) { - $bind = PDO::PARAM_INT; - } elseif (preg_match('/bool/is', $type)) { - $bind = PDO::PARAM_BOOL; - } else { - $bind = PDO::PARAM_STR; - } - - return $bind; - } - - /** - * 获取数据表信息缓存key - * @access protected - * @param string $schema 数据表名称 - * @return string - */ - protected function getSchemaCacheKey(string $schema): string - { - return $this->getConfig('hostname') . ':' . $this->getConfig('hostport') . '@' . $schema; - } - - /** - * @param string $tableName 数据表名称 - * @param bool $force 强制从数据库获取 - * @return array - */ - public function getSchemaInfo(string $tableName, $force = false) - { - if (!strpos($tableName, '.')) { - $schema = $this->getConfig('database') . '.' . $tableName; - } else { - $schema = $tableName; - } - - if (!isset($this->info[$schema]) || $force) { - // 读取字段缓存 - $cacheKey = $this->getSchemaCacheKey($schema); - $cacheField = $this->config['fields_cache'] && !empty($this->cache); - - if ($cacheField && !$force) { - $info = $this->cache->get($cacheKey); - } - - if (empty($info)) { - $info = $this->getTableFieldsInfo($tableName); - if ($cacheField) { - $this->cache->set($cacheKey, $info); - } - } - - $pk = $info['_pk'] ?? null; - $autoinc = $info['_autoinc'] ?? null; - unset($info['_pk'], $info['_autoinc']); - - $bind = []; - foreach ($info as $name => $val) { - $bind[$name] = $this->getFieldBindType($val); - } - - $this->info[$schema] = [ - 'fields' => array_keys($info), - 'type' => $info, - 'bind' => $bind, - 'pk' => $pk, - 'autoinc' => $autoinc, - ]; - } - - return $this->info[$schema]; - } - - /** - * 获取数据表信息 - * @access public - * @param mixed $tableName 数据表名 留空自动获取 - * @param string $fetch 获取信息类型 包括 fields type bind pk - * @return mixed - */ - public function getTableInfo($tableName, string $fetch = '') - { - if (is_array($tableName)) { - $tableName = key($tableName) ?: current($tableName); - } - - if (strpos($tableName, ',') || strpos($tableName, ')')) { - // 多表不获取字段信息 - return []; - } - - [$tableName] = explode(' ', $tableName); - - $info = $this->getSchemaInfo($tableName); - - return $fetch ? $info[$fetch] : $info; - } - - /** - * 获取数据表的字段信息 - * @access public - * @param string $tableName 数据表名 - * @return array - */ - public function getTableFieldsInfo(string $tableName): array - { - $fields = $this->getFields($tableName); - $info = []; - - foreach ($fields as $key => $val) { - // 记录字段类型 - $info[$key] = $this->getFieldType($val['type']); - - if (!empty($val['primary'])) { - $pk[] = $key; - } - - if (!empty($val['autoinc'])) { - $autoinc = $key; - } - } - - if (isset($pk)) { - // 设置主键 - $pk = count($pk) > 1 ? $pk : $pk[0]; - $info['_pk'] = $pk; - } - - if (isset($autoinc)) { - $info['_autoinc'] = $autoinc; - } - - return $info; - } - - /** - * 获取数据表的主键 - * @access public - * @param mixed $tableName 数据表名 - * @return string|array - */ - public function getPk($tableName) - { - return $this->getTableInfo($tableName, 'pk'); - } - - /** - * 获取数据表的自增主键 - * @access public - * @param mixed $tableName 数据表名 - * @return string - */ - public function getAutoInc($tableName) - { - return $this->getTableInfo($tableName, 'autoinc'); - } - - /** - * 获取数据表字段信息 - * @access public - * @param mixed $tableName 数据表名 - * @return array - */ - public function getTableFields($tableName): array - { - return $this->getTableInfo($tableName, 'fields'); - } - - /** - * 获取数据表字段类型 - * @access public - * @param mixed $tableName 数据表名 - * @param string $field 字段名 - * @return array|string - */ - public function getFieldsType($tableName, string $field = null) - { - $result = $this->getTableInfo($tableName, 'type'); - - if ($field && isset($result[$field])) { - return $result[$field]; - } - - return $result; - } - - /** - * 获取数据表绑定信息 - * @access public - * @param mixed $tableName 数据表名 - * @return array - */ - public function getFieldsBind($tableName): array - { - return $this->getTableInfo($tableName, 'bind'); - } - - /** - * 连接数据库方法 - * @access public - * @param array $config 连接参数 - * @param integer $linkNum 连接序号 - * @param array|bool $autoConnection 是否自动连接主数据库(用于分布式) - * @return PDO - * @throws PDOException - */ - public function connect(array $config = [], $linkNum = 0, $autoConnection = false): PDO - { - if (isset($this->links[$linkNum])) { - return $this->links[$linkNum]; - } - - if (empty($config)) { - $config = $this->config; - } else { - $config = array_merge($this->config, $config); - } - - // 连接参数 - if (isset($config['params']) && is_array($config['params'])) { - $params = $config['params'] + $this->params; - } else { - $params = $this->params; - } - - // 记录当前字段属性大小写设置 - $this->attrCase = $params[PDO::ATTR_CASE]; - - if (!empty($config['break_match_str'])) { - $this->breakMatchStr = array_merge($this->breakMatchStr, (array) $config['break_match_str']); - } - - try { - if (empty($config['dsn'])) { - $config['dsn'] = $this->parseDsn($config); - } - - $startTime = microtime(true); - - $this->links[$linkNum] = $this->createPdo($config['dsn'], $config['username'], $config['password'], $params); - - // SQL监控 - if (!empty($config['trigger_sql'])) { - $this->trigger('CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn']); - } - - return $this->links[$linkNum]; - } catch (\PDOException $e) { - if ($autoConnection) { - $this->db->log($e->getMessage(), 'error'); - return $this->connect($autoConnection, $linkNum); - } else { - throw $e; - } - } - } - - /** - * 视图查询 - * @access public - * @param array $args - * @return BaseQuery - */ - public function view(...$args) - { - return $this->newQuery()->view(...$args); - } - - /** - * 创建PDO实例 - * @param $dsn - * @param $username - * @param $password - * @param $params - * @return PDO - */ - protected function createPdo($dsn, $username, $password, $params) - { - return new PDO($dsn, $username, $password, $params); - } - - /** - * 释放查询结果 - * @access public - */ - public function free(): void - { - $this->PDOStatement = null; - } - - /** - * 获取PDO对象 - * @access public - * @return PDO|false - */ - public function getPdo() - { - if (!$this->linkID) { - return false; - } - - return $this->linkID; - } - - /** - * 执行查询 使用生成器返回数据 - * @access public - * @param BaseQuery $query 查询对象 - * @param string $sql sql指令 - * @param array $bind 参数绑定 - * @param Model|null $model 模型对象实例 - * @param null $condition 查询条件 - * @return \Generator - * @throws DbException - */ - public function getCursor(BaseQuery $query, string $sql, array $bind = [], $model = null, $condition = null) - { - $this->queryPDOStatement($query, $sql, $bind); - - // 返回结果集 - while ($result = $this->PDOStatement->fetch($this->fetchType)) { - if ($model) { - yield $model->newInstance($result, $condition); - } else { - yield $result; - } - } - } - - /** - * 执行查询 返回数据集 - * @access public - * @param string $sql sql指令 - * @param array $bind 参数绑定 - * @param bool $master 主库读取 - * @return array - * @throws DbException - */ - public function query(string $sql, array $bind = [], bool $master = false): array - { - return $this->pdoQuery($this->newQuery(), $sql, $bind, $master); - } - - /** - * 执行语句 - * @access public - * @param string $sql sql指令 - * @param array $bind 参数绑定 - * @return int - * @throws DbException - */ - public function execute(string $sql, array $bind = []): int - { - return $this->pdoExecute($this->newQuery(), $sql, $bind, true); - } - - /** - * 执行查询 返回数据集 - * @access protected - * @param BaseQuery $query 查询对象 - * @param mixed $sql sql指令 - * @param array $bind 参数绑定 - * @param bool $master 主库读取 - * @return array - * @throws DbException - */ - protected function pdoQuery(BaseQuery $query, $sql, array $bind = [], bool $master = null): array - { - // 分析查询表达式 - $query->parseOptions(); - - if ($query->getOptions('cache')) { - // 检查查询缓存 - $cacheItem = $this->parseCache($query, $query->getOptions('cache')); - $key = $cacheItem->getKey(); - - $data = $this->cache->get($key); - - if (null !== $data) { - return $data; - } - } - - if ($sql instanceof Closure) { - $sql = $sql($query); - $bind = $query->getBind(); - } - - if (!isset($master)) { - $master = $query->getOptions('master') ? true : false; - } - - $procedure = $query->getOptions('procedure') ? true : in_array(strtolower(substr(trim($sql), 0, 4)), ['call', 'exec']); - - $this->getPDOStatement($sql, $bind, $master, $procedure); - - $resultSet = $this->getResult($procedure); - - if (isset($cacheItem) && $resultSet) { - // 缓存数据集 - $cacheItem->set($resultSet); - $this->cacheData($cacheItem); - } - - return $resultSet; - } - - /** - * 执行查询但只返回PDOStatement对象 - * @access public - * @param BaseQuery $query 查询对象 - * @return \PDOStatement - * @throws DbException - */ - public function pdo(BaseQuery $query): PDOStatement - { - $bind = $query->getBind(); - // 生成查询SQL - $sql = $this->builder->select($query); - - return $this->queryPDOStatement($query, $sql, $bind); - } - - /** - * 执行查询但只返回PDOStatement对象 - * @access public - * @param string $sql sql指令 - * @param array $bind 参数绑定 - * @param bool $master 是否在主服务器读操作 - * @param bool $procedure 是否为存储过程调用 - * @return PDOStatement - * @throws DbException - */ - public function getPDOStatement(string $sql, array $bind = [], bool $master = false, bool $procedure = false): PDOStatement - { - try { - $this->initConnect($this->readMaster ?: $master); - // 记录SQL语句 - $this->queryStr = $sql; - $this->bind = $bind; - - $this->db->updateQueryTimes(); - $this->queryStartTime = microtime(true); - - // 预处理 - $this->PDOStatement = $this->linkID->prepare($sql); - - // 参数绑定 - if ($procedure) { - $this->bindParam($bind); - } else { - $this->bindValue($bind); - } - - // 执行查询 - $this->PDOStatement->execute(); - - // SQL监控 - if (!empty($this->config['trigger_sql'])) { - $this->trigger('', $master); - } - - $this->reConnectTimes = 0; - - return $this->PDOStatement; - } catch (\Throwable | \Exception $e) { - if ($this->transTimes > 0) { - // 事务活动中时不应该进行重试,应直接中断执行,防止造成污染。 - if ($this->isBreak($e)) { - // 尝试对事务计数进行重置 - $this->transTimes = 0; - } - } else { - if ($this->reConnectTimes < 4 && $this->isBreak($e)) { - ++$this->reConnectTimes; - return $this->close()->getPDOStatement($sql, $bind, $master, $procedure); - } - } - - if ($e instanceof \PDOException) { - throw new PDOException($e, $this->config, $this->getLastsql()); - } else { - throw $e; - } - } - } - - /** - * 执行语句 - * @access protected - * @param BaseQuery $query 查询对象 - * @param string $sql sql指令 - * @param array $bind 参数绑定 - * @param bool $origin 是否原生查询 - * @return int - * @throws DbException - */ - protected function pdoExecute(BaseQuery $query, string $sql, array $bind = [], bool $origin = false): int - { - if ($origin) { - $query->parseOptions(); - } - - $this->queryPDOStatement($query->master(true), $sql, $bind); - - if (!$origin && !empty($this->config['deploy']) && !empty($this->config['read_master'])) { - $this->readMaster = true; - } - - $this->numRows = $this->PDOStatement->rowCount(); - - if ($query->getOptions('cache')) { - // 清理缓存数据 - $cacheItem = $this->parseCache($query, $query->getOptions('cache')); - $key = $cacheItem->getKey(); - $tag = $cacheItem->getTag(); - - if (isset($key) && $this->cache->has($key)) { - $this->cache->delete($key); - } elseif (!empty($tag) && method_exists($this->cache, 'tag')) { - $this->cache->tag($tag)->clear(); - } - } - - return $this->numRows; - } - - /** - * @param BaseQuery $query - * @param string $sql - * @param array $bind - * @return PDOStatement - * @throws DbException - */ - protected function queryPDOStatement(BaseQuery $query, string $sql, array $bind = []): PDOStatement - { - $options = $query->getOptions(); - $master = !empty($options['master']) ? true : false; - $procedure = !empty($options['procedure']) ? true : in_array(strtolower(substr(trim($sql), 0, 4)), ['call', 'exec']); - - return $this->getPDOStatement($sql, $bind, $master, $procedure); - } - - /** - * 查找单条记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return array - * @throws DbException - */ - public function find(BaseQuery $query): array - { - // 事件回调 - $result = $this->db->trigger('before_find', $query); - - if (!$result) { - // 执行查询 - $resultSet = $this->pdoQuery($query, function ($query) { - return $this->builder->select($query, true); - }); - - $result = $resultSet[0] ?? []; - } - - return $result; - } - - /** - * 使用游标查询记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return \Generator - */ - public function cursor(BaseQuery $query) - { - // 分析查询表达式 - $options = $query->parseOptions(); - - // 生成查询SQL - $sql = $this->builder->select($query); - - $condition = $options['where']['AND'] ?? null; - - // 执行查询操作 - return $this->getCursor($query, $sql, $query->getBind(), $query->getModel(), $condition); - } - - /** - * 查找记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return array - * @throws DbException - */ - public function select(BaseQuery $query): array - { - $resultSet = $this->db->trigger('before_select', $query); - - if (!$resultSet) { - // 执行查询操作 - $resultSet = $this->pdoQuery($query, function ($query) { - return $this->builder->select($query); - }); - } - - return $resultSet; - } - - /** - * 插入记录 - * @access public - * @param BaseQuery $query 查询对象 - * @param boolean $getLastInsID 返回自增主键 - * @return mixed - */ - public function insert(BaseQuery $query, bool $getLastInsID = false) - { - // 分析查询表达式 - $options = $query->parseOptions(); - - // 生成SQL语句 - $sql = $this->builder->insert($query); - - // 执行操作 - $result = '' == $sql ? 0 : $this->pdoExecute($query, $sql, $query->getBind()); - - if ($result) { - $sequence = $options['sequence'] ?? null; - $lastInsId = $this->getLastInsID($query, $sequence); - - $data = $options['data']; - - if ($lastInsId) { - $pk = $query->getAutoInc(); - if ($pk) { - $data[$pk] = $lastInsId; - } - } - - $query->setOption('data', $data); - - $this->db->trigger('after_insert', $query); - - if ($getLastInsID && $lastInsId) { - return $lastInsId; - } - } - - return $result; - } - - /** - * 批量插入记录 - * @access public - * @param BaseQuery $query 查询对象 - * @param mixed $dataSet 数据集 - * @param integer $limit 每次写入数据限制 - * @return integer - * @throws \Exception - * @throws \Throwable - */ - public function insertAll(BaseQuery $query, array $dataSet = [], int $limit = 0): int - { - if (!is_array(reset($dataSet))) { - return 0; - } - - $options = $query->parseOptions(); - $replace = !empty($options['replace']); - - if (0 === $limit && count($dataSet) >= 5000) { - $limit = 1000; - } - - if ($limit) { - // 分批写入 自动启动事务支持 - $this->startTrans(); - - try { - $array = array_chunk($dataSet, $limit, true); - $count = 0; - - foreach ($array as $item) { - $sql = $this->builder->insertAll($query, $item, $replace); - $count += $this->pdoExecute($query, $sql, $query->getBind()); - } - - // 提交事务 - $this->commit(); - } catch (\Exception | \Throwable $e) { - $this->rollback(); - throw $e; - } - - return $count; - } - - $sql = $this->builder->insertAll($query, $dataSet, $replace); - - return $this->pdoExecute($query, $sql, $query->getBind()); - } - - /** - * 通过Select方式插入记录 - * @access public - * @param BaseQuery $query 查询对象 - * @param array $fields 要插入的数据表字段名 - * @param string $table 要插入的数据表名 - * @return integer - * @throws PDOException - */ - public function selectInsert(BaseQuery $query, array $fields, string $table): int - { - // 分析查询表达式 - $query->parseOptions(); - - $sql = $this->builder->selectInsert($query, $fields, $table); - - return $this->pdoExecute($query, $sql, $query->getBind()); - } - - /** - * 更新记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return integer - * @throws PDOException - */ - public function update(BaseQuery $query): int - { - $query->parseOptions(); - - // 生成UPDATE SQL语句 - $sql = $this->builder->update($query); - - // 执行操作 - $result = '' == $sql ? 0 : $this->pdoExecute($query, $sql, $query->getBind()); - - if ($result) { - $this->db->trigger('after_update', $query); - } - - return $result; - } - - /** - * 删除记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return int - * @throws PDOException - */ - public function delete(BaseQuery $query): int - { - // 分析查询表达式 - $query->parseOptions(); - - // 生成删除SQL语句 - $sql = $this->builder->delete($query); - - // 执行操作 - $result = $this->pdoExecute($query, $sql, $query->getBind()); - - if ($result) { - $this->db->trigger('after_delete', $query); - } - - return $result; - } - - /** - * 得到某个字段的值 - * @access public - * @param BaseQuery $query 查询对象 - * @param string $field 字段名 - * @param mixed $default 默认值 - * @param bool $one 返回一个值 - * @return mixed - */ - public function value(BaseQuery $query, string $field, $default = null, bool $one = true) - { - $options = $query->parseOptions(); - - if (isset($options['field'])) { - $query->removeOption('field'); - } - - if (isset($options['group'])) { - $query->group(''); - } - - $query->setOption('field', (array) $field); - - if (!empty($options['cache'])) { - $cacheItem = $this->parseCache($query, $options['cache'], 'value'); - $key = $cacheItem->getKey(); - - if ($this->cache->has($key)) { - return $this->cache->get($key); - } - } - - // 生成查询SQL - $sql = $this->builder->select($query, $one); - - if (isset($options['field'])) { - $query->setOption('field', $options['field']); - } else { - $query->removeOption('field'); - } - - if (isset($options['group'])) { - $query->setOption('group', $options['group']); - } - - // 执行查询操作 - $pdo = $this->getPDOStatement($sql, $query->getBind(), $options['master']); - - $result = $pdo->fetchColumn(); - - if (isset($cacheItem)) { - // 缓存数据 - $cacheItem->set($result); - $this->cacheData($cacheItem); - } - - return false !== $result ? $result : $default; - } - - /** - * 得到某个字段的值 - * @access public - * @param BaseQuery $query 查询对象 - * @param string $aggregate 聚合方法 - * @param mixed $field 字段名 - * @param bool $force 强制转为数字类型 - * @return mixed - */ - public function aggregate(BaseQuery $query, string $aggregate, $field, bool $force = false) - { - if (is_string($field) && 0 === stripos($field, 'DISTINCT ')) { - [$distinct, $field] = explode(' ', $field); - } - - $field = $aggregate . '(' . (!empty($distinct) ? 'DISTINCT ' : '') . $this->builder->parseKey($query, $field, true) . ') AS think_' . strtolower($aggregate); - - $result = $this->value($query, $field, 0, false); - - return $force ? (float) $result : $result; - } - - /** - * 得到某个列的数组 - * @access public - * @param BaseQuery $query 查询对象 - * @param string|array $column 字段名 多个字段用逗号分隔 - * @param string $key 索引 - * @return array - */ - public function column(BaseQuery $query, $column, string $key = ''): array - { - $options = $query->parseOptions(); - - if (isset($options['field'])) { - $query->removeOption('field'); - } - - if (empty($key) || trim($key) === '') { - $key = null; - } - - if (\is_string($column)) { - $column = \trim($column); - if ('*' !== $column) { - $column = \array_map('\trim', \explode(',', $column)); - } - } elseif (\is_array($column)) { - if (\in_array('*', $column)) { - $column = '*'; - } - } else { - throw new DbException('not support type'); - } - - $field = $column; - if ('*' !== $column && $key && !\in_array($key, $column)) { - $field[] = $key; - } - - $query->setOption('field', $field); - - if (!empty($options['cache'])) { - // 判断查询缓存 - $cacheItem = $this->parseCache($query, $options['cache'], 'column'); - $name = $cacheItem->getKey(); - - if ($this->cache->has($name)) { - return $this->cache->get($name); - } - } - - // 生成查询SQL - $sql = $this->builder->select($query); - - if (isset($options['field'])) { - $query->setOption('field', $options['field']); - } else { - $query->removeOption('field'); - } - - // 执行查询操作 - $pdo = $this->getPDOStatement($sql, $query->getBind(), $options['master']); - $resultSet = $pdo->fetchAll(PDO::FETCH_ASSOC); - - if (is_string($key) && strpos($key, '.')) { - [$alias, $key] = explode('.', $key); - } - - if (empty($resultSet)) { - $result = []; - } elseif ('*' !== $column && \count($column) === 1) { - $column = \array_shift($column); - if (\strpos($column, ' ')) { - $column = \substr(\strrchr(\trim($column), ' '), 1); - } - - if (\strpos($column, '.')) { - [$alias, $column] = \explode('.', $column); - } - - $result = \array_column($resultSet, $column, $key); - } elseif ($key) { - $result = \array_column($resultSet, null, $key); - } else { - $result = $resultSet; - } - - if (isset($cacheItem)) { - // 缓存数据 - $cacheItem->set($result); - $this->cacheData($cacheItem); - } - - return $result; - } - - /** - * 根据参数绑定组装最终的SQL语句 便于调试 - * @access public - * @param string $sql 带参数绑定的sql语句 - * @param array $bind 参数绑定列表 - * @return string - */ - public function getRealSql(string $sql, array $bind = []): string - { - foreach ($bind as $key => $val) { - $value = strval(is_array($val) ? $val[0] : $val); - $type = is_array($val) ? $val[1] : PDO::PARAM_STR; - - if (self::PARAM_FLOAT == $type || PDO::PARAM_STR == $type) { - $value = '\'' . addslashes($value) . '\''; - } elseif (PDO::PARAM_INT == $type && '' === $value) { - $value = '0'; - } - - // 判断占位符 - $sql = is_numeric($key) ? - substr_replace($sql, $value, strpos($sql, '?'), 1) : - substr_replace($sql, $value, strpos($sql, ':' . $key), strlen(':' . $key)); - } - - return rtrim($sql); - } - - /** - * 参数绑定 - * 支持 ['name'=>'value','id'=>123] 对应命名占位符 - * 或者 ['value',123] 对应问号占位符 - * @access public - * @param array $bind 要绑定的参数列表 - * @return void - * @throws BindParamException - */ - protected function bindValue(array $bind = []): void - { - foreach ($bind as $key => $val) { - // 占位符 - $param = is_numeric($key) ? $key + 1 : ':' . $key; - - if (is_array($val)) { - if (PDO::PARAM_INT == $val[1] && '' === $val[0]) { - $val[0] = 0; - } elseif (self::PARAM_FLOAT == $val[1]) { - $val[0] = is_string($val[0]) ? (float) $val[0] : $val[0]; - $val[1] = PDO::PARAM_STR; - } - - $result = $this->PDOStatement->bindValue($param, $val[0], $val[1]); - } else { - $result = $this->PDOStatement->bindValue($param, $val); - } - - if (!$result) { - throw new BindParamException( - "Error occurred when binding parameters '{$param}'", - $this->config, - $this->getLastsql(), - $bind - ); - } - } - } - - /** - * 存储过程的输入输出参数绑定 - * @access public - * @param array $bind 要绑定的参数列表 - * @return void - * @throws BindParamException - */ - protected function bindParam(array $bind): void - { - foreach ($bind as $key => $val) { - $param = is_numeric($key) ? $key + 1 : ':' . $key; - - if (is_array($val)) { - array_unshift($val, $param); - $result = call_user_func_array([$this->PDOStatement, 'bindParam'], $val); - } else { - $result = $this->PDOStatement->bindValue($param, $val); - } - - if (!$result) { - $param = array_shift($val); - - throw new BindParamException( - "Error occurred when binding parameters '{$param}'", - $this->config, - $this->getLastsql(), - $bind - ); - } - } - } - - /** - * 获得数据集数组 - * @access protected - * @param bool $procedure 是否存储过程 - * @return array - */ - protected function getResult(bool $procedure = false): array - { - if ($procedure) { - // 存储过程返回结果 - return $this->procedure(); - } - - $result = $this->PDOStatement->fetchAll($this->fetchType); - - $this->numRows = count($result); - - return $result; - } - - /** - * 获得存储过程数据集 - * @access protected - * @return array - */ - protected function procedure(): array - { - $item = []; - - do { - $result = $this->getResult(); - if (!empty($result)) { - $item[] = $result; - } - } while ($this->PDOStatement->nextRowset()); - - $this->numRows = count($item); - - return $item; - } - - /** - * 执行数据库事务 - * @access public - * @param callable $callback 数据操作方法回调 - * @return mixed - * @throws PDOException - * @throws \Exception - * @throws \Throwable - */ - public function transaction(callable $callback) - { - $this->startTrans(); - - try { - $result = null; - if (is_callable($callback)) { - $result = $callback($this); - } - - $this->commit(); - return $result; - } catch (\Exception | \Throwable $e) { - $this->rollback(); - throw $e; - } - } - - /** - * 启动事务 - * @access public - * @return void - * @throws \PDOException - * @throws \Exception - */ - public function startTrans(): void - { - try { - $this->initConnect(true); - - ++$this->transTimes; - - if (1 == $this->transTimes) { - $this->linkID->beginTransaction(); - } elseif ($this->transTimes > 1 && $this->supportSavepoint()) { - $this->linkID->exec( - $this->parseSavepoint('trans' . $this->transTimes) - ); - } - $this->reConnectTimes = 0; - } catch (\Throwable | \Exception $e) { - if ($this->transTimes === 1 && $this->reConnectTimes < 4 && $this->isBreak($e)) { - --$this->transTimes; - ++$this->reConnectTimes; - $this->close()->startTrans(); - } else { - if ($this->isBreak($e)) { - // 尝试对事务计数进行重置 - $this->transTimes = 0; - } - throw $e; - } - } - } - - /** - * 用于非自动提交状态下面的查询提交 - * @access public - * @return void - * @throws \PDOException - */ - public function commit(): void - { - $this->initConnect(true); - - if (1 == $this->transTimes) { - $this->linkID->commit(); - } - - --$this->transTimes; - } - - /** - * 事务回滚 - * @access public - * @return void - * @throws \PDOException - */ - public function rollback(): void - { - $this->initConnect(true); - - if (1 == $this->transTimes) { - $this->linkID->rollBack(); - } elseif ($this->transTimes > 1 && $this->supportSavepoint()) { - $this->linkID->exec( - $this->parseSavepointRollBack('trans' . $this->transTimes) - ); - } - - $this->transTimes = max(0, $this->transTimes - 1); - } - - /** - * 是否支持事务嵌套 - * @return bool - */ - protected function supportSavepoint(): bool - { - return false; - } - - /** - * 生成定义保存点的SQL - * @access protected - * @param string $name 标识 - * @return string - */ - protected function parseSavepoint(string $name): string - { - return 'SAVEPOINT ' . $name; - } - - /** - * 生成回滚到保存点的SQL - * @access protected - * @param string $name 标识 - * @return string - */ - protected function parseSavepointRollBack(string $name): string - { - return 'ROLLBACK TO SAVEPOINT ' . $name; - } - - /** - * 批处理执行SQL语句 - * 批处理的指令都认为是execute操作 - * @access public - * @param BaseQuery $query 查询对象 - * @param array $sqlArray SQL批处理指令 - * @param array $bind 参数绑定 - * @return bool - */ - public function batchQuery(BaseQuery $query, array $sqlArray = [], array $bind = []): bool - { - // 自动启动事务支持 - $this->startTrans(); - - try { - foreach ($sqlArray as $sql) { - $this->pdoExecute($query, $sql, $bind); - } - // 提交事务 - $this->commit(); - } catch (\Exception $e) { - $this->rollback(); - throw $e; - } - - return true; - } - - /** - * 关闭数据库(或者重新连接) - * @access public - * @return $this - */ - public function close() - { - $this->linkID = null; - $this->linkWrite = null; - $this->linkRead = null; - $this->links = []; - $this->transTimes = 0; - - $this->free(); - - return $this; - } - - /** - * 是否断线 - * @access protected - * @param \PDOException|\Exception $e 异常对象 - * @return bool - */ - protected function isBreak($e): bool - { - if (!$this->config['break_reconnect']) { - return false; - } - - $error = $e->getMessage(); - - foreach ($this->breakMatchStr as $msg) { - if (false !== stripos($error, $msg)) { - return true; - } - } - - return false; - } - - /** - * 获取最近一次查询的sql语句 - * @access public - * @return string - */ - public function getLastSql(): string - { - return $this->getRealSql($this->queryStr, $this->bind); - } - - /** - * 获取最近插入的ID - * @access public - * @param BaseQuery $query 查询对象 - * @param string $sequence 自增序列名 - * @return mixed - */ - public function getLastInsID(BaseQuery $query, string $sequence = null) - { - try { - $insertId = $this->linkID->lastInsertId($sequence); - } catch (\Exception $e) { - $insertId = ''; - } - - return $this->autoInsIDType($query, $insertId); - } - - /** - * 获取最近插入的ID - * @access public - * @param BaseQuery $query 查询对象 - * @param string $insertId 自增ID - * @return mixed - */ - protected function autoInsIDType(BaseQuery $query, string $insertId) - { - $pk = $query->getAutoInc(); - - if ($pk) { - $type = $this->getFieldBindType($pk); - - if (PDO::PARAM_INT == $type) { - $insertId = (int) $insertId; - } elseif (self::PARAM_FLOAT == $type) { - $insertId = (float) $insertId; - } - } - - return $insertId; - } - - /** - * 获取最近的错误信息 - * @access public - * @return string - */ - public function getError(): string - { - if ($this->PDOStatement) { - $error = $this->PDOStatement->errorInfo(); - $error = $error[1] . ':' . $error[2]; - } else { - $error = ''; - } - - if ('' != $this->queryStr) { - $error .= "\n [ SQL语句 ] : " . $this->getLastsql(); - } - - return $error; - } - - /** - * 初始化数据库连接 - * @access protected - * @param boolean $master 是否主服务器 - * @return void - */ - protected function initConnect(bool $master = true): void - { - if (!empty($this->config['deploy'])) { - // 采用分布式数据库 - if ($master || $this->transTimes) { - if (!$this->linkWrite) { - $this->linkWrite = $this->multiConnect(true); - } - - $this->linkID = $this->linkWrite; - } else { - if (!$this->linkRead) { - $this->linkRead = $this->multiConnect(false); - } - - $this->linkID = $this->linkRead; - } - } elseif (!$this->linkID) { - // 默认单数据库 - $this->linkID = $this->connect(); - } - } - - /** - * 连接分布式服务器 - * @access protected - * @param boolean $master 主服务器 - * @return PDO - */ - protected function multiConnect(bool $master = false): PDO - { - $config = []; - - // 分布式数据库配置解析 - foreach (['username', 'password', 'hostname', 'hostport', 'database', 'dsn', 'charset'] as $name) { - $config[$name] = is_string($this->config[$name]) ? explode(',', $this->config[$name]) : $this->config[$name]; - } - - // 主服务器序号 - $m = floor(mt_rand(0, $this->config['master_num'] - 1)); - - if ($this->config['rw_separate']) { - // 主从式采用读写分离 - if ($master) // 主服务器写入 - { - $r = $m; - } elseif (is_numeric($this->config['slave_no'])) { - // 指定服务器读 - $r = $this->config['slave_no']; - } else { - // 读操作连接从服务器 每次随机连接的数据库 - $r = floor(mt_rand($this->config['master_num'], count($config['hostname']) - 1)); - } - } else { - // 读写操作不区分服务器 每次随机连接的数据库 - $r = floor(mt_rand(0, count($config['hostname']) - 1)); - } - $dbMaster = false; - - if ($m != $r) { - $dbMaster = []; - foreach (['username', 'password', 'hostname', 'hostport', 'database', 'dsn', 'charset'] as $name) { - $dbMaster[$name] = $config[$name][$m] ?? $config[$name][0]; - } - } - - $dbConfig = []; - - foreach (['username', 'password', 'hostname', 'hostport', 'database', 'dsn', 'charset'] as $name) { - $dbConfig[$name] = $config[$name][$r] ?? $config[$name][0]; - } - - return $this->connect($dbConfig, $r, $r == $m ? false : $dbMaster); - } - - /** - * 启动XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function startTransXa(string $xid) - {} - - /** - * 预编译XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function prepareXa(string $xid) - {} - - /** - * 提交XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function commitXa(string $xid) - {} - - /** - * 回滚XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function rollbackXa(string $xid) - {} -} diff --git a/vendor/topthink/think-orm/src/db/Query.php b/vendor/topthink/think-orm/src/db/Query.php deleted file mode 100644 index aa96123..0000000 --- a/vendor/topthink/think-orm/src/db/Query.php +++ /dev/null @@ -1,451 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use PDOStatement; -use think\helper\Str; - -/** - * PDO数据查询类 - */ -class Query extends BaseQuery -{ - use concern\JoinAndViewQuery; - use concern\ParamsBind; - use concern\TableFieldInfo; - - /** - * 表达式方式指定Field排序 - * @access public - * @param string $field 排序字段 - * @param array $bind 参数绑定 - * @return $this - */ - public function orderRaw(string $field, array $bind = []) - { - $this->options['order'][] = new Raw($field, $bind); - - return $this; - } - - /** - * 表达式方式指定查询字段 - * @access public - * @param string $field 字段名 - * @return $this - */ - public function fieldRaw(string $field) - { - $this->options['field'][] = new Raw($field); - - return $this; - } - - /** - * 指定Field排序 orderField('id',[1,2,3],'desc') - * @access public - * @param string $field 排序字段 - * @param array $values 排序值 - * @param string $order 排序 desc/asc - * @return $this - */ - public function orderField(string $field, array $values, string $order = '') - { - if (!empty($values)) { - $values['sort'] = $order; - - $this->options['order'][$field] = $values; - } - - return $this; - } - - /** - * 随机排序 - * @access public - * @return $this - */ - public function orderRand() - { - $this->options['order'][] = '[rand]'; - return $this; - } - - /** - * 使用表达式设置数据 - * @access public - * @param string $field 字段名 - * @param string $value 字段值 - * @return $this - */ - public function exp(string $field, string $value) - { - $this->options['data'][$field] = new Raw($value); - return $this; - } - - /** - * 表达式方式指定当前操作的数据表 - * @access public - * @param mixed $table 表名 - * @return $this - */ - public function tableRaw(string $table) - { - $this->options['table'] = new Raw($table); - - return $this; - } - - /** - * 获取执行的SQL语句而不进行实际的查询 - * @access public - * @param bool $fetch 是否返回sql - * @return $this|Fetch - */ - public function fetchSql(bool $fetch = true) - { - $this->options['fetch_sql'] = $fetch; - - if ($fetch) { - return new Fetch($this); - } - - return $this; - } - - /** - * 批处理执行SQL语句 - * 批处理的指令都认为是execute操作 - * @access public - * @param array $sql SQL批处理指令 - * @return bool - */ - public function batchQuery(array $sql = []): bool - { - return $this->connection->batchQuery($this, $sql); - } - - /** - * USING支持 用于多表删除 - * @access public - * @param mixed $using USING - * @return $this - */ - public function using($using) - { - $this->options['using'] = $using; - return $this; - } - - /** - * 存储过程调用 - * @access public - * @param bool $procedure 是否为存储过程查询 - * @return $this - */ - public function procedure(bool $procedure = true) - { - $this->options['procedure'] = $procedure; - return $this; - } - - /** - * 指定group查询 - * @access public - * @param string|array $group GROUP - * @return $this - */ - public function group($group) - { - $this->options['group'] = $group; - return $this; - } - - /** - * 指定having查询 - * @access public - * @param string $having having - * @return $this - */ - public function having(string $having) - { - $this->options['having'] = $having; - return $this; - } - - /** - * 指定distinct查询 - * @access public - * @param bool $distinct 是否唯一 - * @return $this - */ - public function distinct(bool $distinct = true) - { - $this->options['distinct'] = $distinct; - return $this; - } - - /** - * 指定强制索引 - * @access public - * @param string $force 索引名称 - * @return $this - */ - public function force(string $force) - { - $this->options['force'] = $force; - return $this; - } - - /** - * 查询注释 - * @access public - * @param string $comment 注释 - * @return $this - */ - public function comment(string $comment) - { - $this->options['comment'] = $comment; - return $this; - } - - /** - * 设置是否REPLACE - * @access public - * @param bool $replace 是否使用REPLACE写入数据 - * @return $this - */ - public function replace(bool $replace = true) - { - $this->options['replace'] = $replace; - return $this; - } - - /** - * 设置当前查询所在的分区 - * @access public - * @param string|array $partition 分区名称 - * @return $this - */ - public function partition($partition) - { - $this->options['partition'] = $partition; - return $this; - } - - /** - * 设置DUPLICATE - * @access public - * @param array|string|Raw $duplicate DUPLICATE信息 - * @return $this - */ - public function duplicate($duplicate) - { - $this->options['duplicate'] = $duplicate; - return $this; - } - - /** - * 设置查询的额外参数 - * @access public - * @param string $extra 额外信息 - * @return $this - */ - public function extra(string $extra) - { - $this->options['extra'] = $extra; - return $this; - } - - /** - * 创建子查询SQL - * @access public - * @param bool $sub 是否添加括号 - * @return string - * @throws Exception - */ - public function buildSql(bool $sub = true): string - { - return $sub ? '( ' . $this->fetchSql()->select() . ' )' : $this->fetchSql()->select(); - } - - /** - * 获取当前数据表的主键 - * @access public - * @return string|array - */ - public function getPk() - { - if (empty($this->pk)) { - $this->pk = $this->connection->getPk($this->getTable()); - } - - return $this->pk; - } - - /** - * 指定数据表自增主键 - * @access public - * @param string $autoinc 自增键 - * @return $this - */ - public function autoinc(string $autoinc) - { - $this->autoinc = $autoinc; - return $this; - } - - /** - * 获取当前数据表的自增主键 - * @access public - * @return string|null - */ - public function getAutoInc() - { - $tableName = $this->getTable(); - - if (empty($this->autoinc) && $tableName) { - $this->autoinc = $this->connection->getAutoInc($tableName); - } - - return $this->autoinc; - } - - /** - * 字段值增长 - * @access public - * @param string $field 字段名 - * @param float $step 增长值 - * @return $this - */ - public function inc(string $field, float $step = 1) - { - $this->options['data'][$field] = ['INC', $step]; - - return $this; - } - - /** - * 字段值减少 - * @access public - * @param string $field 字段名 - * @param float $step 增长值 - * @return $this - */ - public function dec(string $field, float $step = 1) - { - $this->options['data'][$field] = ['DEC', $step]; - return $this; - } - - /** - * 获取当前的查询标识 - * @access public - * @param mixed $data 要序列化的数据 - * @return string - */ - public function getQueryGuid($data = null): string - { - return md5($this->getConfig('database') . serialize(var_export($data ?: $this->options, true)) . serialize($this->getBind(false))); - } - - /** - * 执行查询但只返回PDOStatement对象 - * @access public - * @return PDOStatement - */ - public function getPdo(): PDOStatement - { - return $this->connection->pdo($this); - } - - /** - * 使用游标查找记录 - * @access public - * @param mixed $data 数据 - * @return \Generator - */ - public function cursor($data = null) - { - if (!is_null($data)) { - // 主键条件分析 - $this->parsePkWhere($data); - } - - $this->options['data'] = $data; - - $connection = clone $this->connection; - - return $connection->cursor($this); - } - - /** - * 分批数据返回处理 - * @access public - * @param integer $count 每次处理的数据数量 - * @param callable $callback 处理回调方法 - * @param string|array $column 分批处理的字段名 - * @param string $order 字段排序 - * @return bool - * @throws Exception - */ - public function chunk(int $count, callable $callback, $column = null, string $order = 'asc'): bool - { - $options = $this->getOptions(); - $column = $column ?: $this->getPk(); - - if (isset($options['order'])) { - unset($options['order']); - } - - $bind = $this->bind; - - if (is_array($column)) { - $times = 1; - $query = $this->options($options)->page($times, $count); - } else { - $query = $this->options($options)->limit($count); - - if (strpos($column, '.')) { - [$alias, $key] = explode('.', $column); - } else { - $key = $column; - } - } - - $resultSet = $query->order($column, $order)->select(); - - while (count($resultSet) > 0) { - if (false === call_user_func($callback, $resultSet)) { - return false; - } - - if (isset($times)) { - $times++; - $query = $this->options($options)->page($times, $count); - } else { - $end = $resultSet->pop(); - $lastId = is_array($end) ? $end[$key] : $end->getData($key); - - $query = $this->options($options) - ->limit($count) - ->where($column, 'asc' == strtolower($order) ? '>' : '<', $lastId); - } - - $resultSet = $query->bind($bind)->order($column, $order)->select(); - } - - return true; - } -} diff --git a/vendor/topthink/think-orm/src/db/Raw.php b/vendor/topthink/think-orm/src/db/Raw.php deleted file mode 100644 index 833fbf0..0000000 --- a/vendor/topthink/think-orm/src/db/Raw.php +++ /dev/null @@ -1,71 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -/** - * SQL Raw - */ -class Raw -{ - /** - * 查询表达式 - * - * @var string - */ - protected $value; - - /** - * 参数绑定 - * - * @var array - */ - protected $bind = []; - - /** - * 创建一个查询表达式 - * - * @param string $value - * @param array $bind - * @return void - */ - public function __construct(string $value, array $bind = []) - { - $this->value = $value; - $this->bind = $bind; - } - - /** - * 获取表达式 - * - * @return string - */ - public function getValue(): string - { - return $this->value; - } - - /** - * 获取参数绑定 - * - * @return string - */ - public function getBind(): array - { - return $this->bind; - } - - public function __toString() - { - return (string) $this->value; - } -} diff --git a/vendor/topthink/think-orm/src/db/Where.php b/vendor/topthink/think-orm/src/db/Where.php deleted file mode 100644 index 0880460..0000000 --- a/vendor/topthink/think-orm/src/db/Where.php +++ /dev/null @@ -1,182 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db; - -use ArrayAccess; - -/** - * 数组查询对象 - */ -class Where implements ArrayAccess -{ - /** - * 查询表达式 - * @var array - */ - protected $where = []; - - /** - * 是否需要把查询条件两边增加括号 - * @var bool - */ - protected $enclose = false; - - /** - * 创建一个查询表达式 - * - * @param array $where 查询条件数组 - * @param bool $enclose 是否增加括号 - */ - public function __construct(array $where = [], bool $enclose = false) - { - $this->where = $where; - $this->enclose = $enclose; - } - - /** - * 设置是否添加括号 - * @access public - * @param bool $enclose - * @return $this - */ - public function enclose(bool $enclose = true) - { - $this->enclose = $enclose; - return $this; - } - - /** - * 解析为Query对象可识别的查询条件数组 - * @access public - * @return array - */ - public function parse(): array - { - $where = []; - - foreach ($this->where as $key => $val) { - if ($val instanceof Raw) { - $where[] = [$key, 'exp', $val]; - } elseif (is_null($val)) { - $where[] = [$key, 'NULL', '']; - } elseif (is_array($val)) { - $where[] = $this->parseItem($key, $val); - } else { - $where[] = [$key, '=', $val]; - } - } - - return $this->enclose ? [$where] : $where; - } - - /** - * 分析查询表达式 - * @access protected - * @param string $field 查询字段 - * @param array $where 查询条件 - * @return array - */ - protected function parseItem(string $field, array $where = []): array - { - $op = $where[0]; - $condition = $where[1] ?? null; - - if (is_array($op)) { - // 同一字段多条件查询 - array_unshift($where, $field); - } elseif (is_null($condition)) { - if (is_string($op) && in_array(strtoupper($op), ['NULL', 'NOTNULL', 'NOT NULL'], true)) { - // null查询 - $where = [$field, $op, '']; - } elseif (is_null($op) || '=' == $op) { - $where = [$field, 'NULL', '']; - } elseif ('<>' == $op) { - $where = [$field, 'NOTNULL', '']; - } else { - // 字段相等查询 - $where = [$field, '=', $op]; - } - } else { - $where = [$field, $op, $condition]; - } - - return $where; - } - - /** - * 修改器 设置数据对象的值 - * @access public - * @param string $name 名称 - * @param mixed $value 值 - * @return void - */ - public function __set($name, $value) - { - $this->where[$name] = $value; - } - - /** - * 获取器 获取数据对象的值 - * @access public - * @param string $name 名称 - * @return mixed - */ - public function __get($name) - { - return $this->where[$name] ?? null; - } - - /** - * 检测数据对象的值 - * @access public - * @param string $name 名称 - * @return bool - */ - public function __isset($name) - { - return isset($this->where[$name]); - } - - /** - * 销毁数据对象的值 - * @access public - * @param string $name 名称 - * @return void - */ - public function __unset($name) - { - unset($this->where[$name]); - } - - // ArrayAccess - public function offsetSet($name, $value) - { - $this->__set($name, $value); - } - - public function offsetExists($name) - { - return $this->__isset($name); - } - - public function offsetUnset($name) - { - $this->__unset($name); - } - - public function offsetGet($name) - { - return $this->__get($name); - } - -} diff --git a/vendor/topthink/think-orm/src/db/builder/Mongo.php b/vendor/topthink/think-orm/src/db/builder/Mongo.php deleted file mode 100644 index 823156b..0000000 --- a/vendor/topthink/think-orm/src/db/builder/Mongo.php +++ /dev/null @@ -1,675 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); -namespace think\db\builder; - -use MongoDB\BSON\Javascript; -use MongoDB\BSON\ObjectID; -use MongoDB\BSON\Regex; -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\Command; -use MongoDB\Driver\Exception\InvalidArgumentException; -use MongoDB\Driver\Query as MongoQuery; -use think\db\connector\Mongo as Connection; -use think\db\exception\DbException as Exception; -use think\db\Mongo as Query; - -class Mongo -{ - // connection对象实例 - protected $connection; - // 最后插入ID - protected $insertId = []; - // 查询表达式 - protected $exp = ['<>' => 'ne', '=' => 'eq', '>' => 'gt', '>=' => 'gte', '<' => 'lt', '<=' => 'lte', 'in' => 'in', 'not in' => 'nin', 'nin' => 'nin', 'mod' => 'mod', 'exists' => 'exists', 'null' => 'null', 'notnull' => 'not null', 'not null' => 'not null', 'regex' => 'regex', 'type' => 'type', 'all' => 'all', '> time' => '> time', '< time' => '< time', 'between' => 'between', 'not between' => 'not between', 'between time' => 'between time', 'not between time' => 'not between time', 'notbetween time' => 'not between time', 'like' => 'like', 'near' => 'near', 'size' => 'size']; - - /** - * 架构函数 - * @access public - * @param Connection $connection 数据库连接对象实例 - */ - public function __construct(Connection $connection) - { - $this->connection = $connection; - } - - /** - * 获取当前的连接对象实例 - * @access public - * @return Connection - */ - public function getConnection(): Connection - { - return $this->connection; - } - - /** - * key分析 - * @access protected - * @param string $key - * @return string - */ - protected function parseKey(Query $query, string $key): string - { - if (0 === strpos($key, '__TABLE__.')) { - [$collection, $key] = explode('.', $key, 2); - } - - if ('id' == $key && $this->connection->getConfig('pk_convert_id')) { - $key = '_id'; - } - - return trim($key); - } - - /** - * value分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $value - * @param string $field - * @return string - */ - protected function parseValue(Query $query, $value, $field = '') - { - if ('_id' == $field && 'ObjectID' == $this->connection->getConfig('pk_type') && is_string($value)) { - try { - return new ObjectID($value); - } catch (InvalidArgumentException $e) { - return new ObjectID(); - } - } - - return $value; - } - - /** - * insert数据分析 - * @access protected - * @param Query $query 查询对象 - * @param array $data 数据 - * @return array - */ - protected function parseData(Query $query, array $data): array - { - if (empty($data)) { - return []; - } - - $result = []; - - foreach ($data as $key => $val) { - $item = $this->parseKey($query, $key); - - if (is_object($val)) { - $result[$item] = $val; - } elseif (isset($val[0]) && 'exp' == $val[0]) { - $result[$item] = $val[1]; - } elseif (is_null($val)) { - $result[$item] = 'NULL'; - } else { - $result[$item] = $this->parseValue($query, $val, $key); - } - } - - return $result; - } - - /** - * Set数据分析 - * @access protected - * @param Query $query 查询对象 - * @param array $data 数据 - * @return array - */ - protected function parseSet(Query $query, array $data): array - { - if (empty($data)) { - return []; - } - - $result = []; - - foreach ($data as $key => $val) { - $item = $this->parseKey($query, $key); - - if (is_array($val) && isset($val[0]) && is_string($val[0]) && 0 === strpos($val[0], '$')) { - $result[$val[0]][$item] = $this->parseValue($query, $val[1], $key); - } else { - $result['$set'][$item] = $this->parseValue($query, $val, $key); - } - } - - return $result; - } - - /** - * 生成查询过滤条件 - * @access public - * @param Query $query 查询对象 - * @param mixed $where - * @return array - */ - public function parseWhere(Query $query, array $where): array - { - if (empty($where)) { - $where = []; - } - - $filter = []; - foreach ($where as $logic => $val) { - $logic = '$' . strtolower($logic); - foreach ($val as $field => $value) { - if (is_array($value)) { - if (key($value) !== 0) { - throw new Exception('where express error:' . var_export($value, true)); - } - $field = array_shift($value); - } elseif (!($value instanceof \Closure)) { - throw new Exception('where express error:' . var_export($value, true)); - } - - if ($value instanceof \Closure) { - // 使用闭包查询 - $query = new Query($this->connection); - call_user_func_array($value, [ & $query]); - $filter[$logic][] = $this->parseWhere($query, $query->getOptions('where')); - } else { - if (strpos($field, '|')) { - // 不同字段使用相同查询条件(OR) - $array = explode('|', $field); - foreach ($array as $k) { - $filter['$or'][] = $this->parseWhereItem($query, $k, $value); - } - } elseif (strpos($field, '&')) { - // 不同字段使用相同查询条件(AND) - $array = explode('&', $field); - foreach ($array as $k) { - $filter['$and'][] = $this->parseWhereItem($query, $k, $value); - } - } else { - // 对字段使用表达式查询 - $field = is_string($field) ? $field : ''; - $filter[$logic][] = $this->parseWhereItem($query, $field, $value); - } - } - } - } - - $options = $query->getOptions(); - if (!empty($options['soft_delete'])) { - // 附加软删除条件 - [$field, $condition] = $options['soft_delete']; - $filter['$and'][] = $this->parseWhereItem($query, $field, $condition); - } - - return $filter; - } - - // where子单元分析 - protected function parseWhereItem(Query $query, $field, $val): array - { - $key = $field ? $this->parseKey($query, $field) : ''; - // 查询规则和条件 - if (!is_array($val)) { - $val = ['=', $val]; - } - [$exp, $value] = $val; - - // 对一个字段使用多个查询条件 - if (is_array($exp)) { - $data = []; - foreach ($val as $value) { - $exp = $value[0]; - $value = $value[1]; - if (!in_array($exp, $this->exp)) { - $exp = strtolower($exp); - if (isset($this->exp[$exp])) { - $exp = $this->exp[$exp]; - } - } - $k = '$' . $exp; - $data[$k] = $value; - } - $result[$key] = $data; - return $result; - } elseif (!in_array($exp, $this->exp)) { - $exp = strtolower($exp); - if (isset($this->exp[$exp])) { - $exp = $this->exp[$exp]; - } else { - throw new Exception('where express error:' . $exp); - } - } - - $result = []; - if ('=' == $exp) { - // 普通查询 - $result[$key] = $this->parseValue($query, $value, $key); - } elseif (in_array($exp, ['neq', 'ne', 'gt', 'egt', 'gte', 'lt', 'lte', 'elt', 'mod'])) { - // 比较运算 - $k = '$' . $exp; - $result[$key] = [$k => $this->parseValue($query, $value, $key)]; - } elseif ('null' == $exp) { - // NULL 查询 - $result[$key] = null; - } elseif ('not null' == $exp) { - $result[$key] = ['$ne' => null]; - } elseif ('all' == $exp) { - // 满足所有指定条件 - $result[$key] = ['$all', $this->parseValue($query, $value, $key)]; - } elseif ('between' == $exp) { - // 区间查询 - $value = is_array($value) ? $value : explode(',', $value); - $result[$key] = ['$gte' => $this->parseValue($query, $value[0], $key), '$lte' => $this->parseValue($query, $value[1], $key)]; - } elseif ('not between' == $exp) { - // 范围查询 - $value = is_array($value) ? $value : explode(',', $value); - $result[$key] = ['$lt' => $this->parseValue($query, $value[0], $key), '$gt' => $this->parseValue($query, $value[1], $key)]; - } elseif ('exists' == $exp) { - // 字段是否存在 - $result[$key] = ['$exists' => (bool) $value]; - } elseif ('type' == $exp) { - // 类型查询 - $result[$key] = ['$type' => intval($value)]; - } elseif ('exp' == $exp) { - // 表达式查询 - $result['$where'] = $value instanceof Javascript ? $value : new Javascript($value); - } elseif ('like' == $exp) { - // 模糊查询 采用正则方式 - $result[$key] = $value instanceof Regex ? $value : new Regex($value, 'i'); - } elseif (in_array($exp, ['nin', 'in'])) { - // IN 查询 - $value = is_array($value) ? $value : explode(',', $value); - foreach ($value as $k => $val) { - $value[$k] = $this->parseValue($query, $val, $key); - } - $result[$key] = ['$' . $exp => $value]; - } elseif ('regex' == $exp) { - $result[$key] = $value instanceof Regex ? $value : new Regex($value, 'i'); - } elseif ('< time' == $exp) { - $result[$key] = ['$lt' => $this->parseDateTime($query, $value, $field)]; - } elseif ('> time' == $exp) { - $result[$key] = ['$gt' => $this->parseDateTime($query, $value, $field)]; - } elseif ('between time' == $exp) { - // 区间查询 - $value = is_array($value) ? $value : explode(',', $value); - $result[$key] = ['$gte' => $this->parseDateTime($query, $value[0], $field), '$lte' => $this->parseDateTime($query, $value[1], $field)]; - } elseif ('not between time' == $exp) { - // 范围查询 - $value = is_array($value) ? $value : explode(',', $value); - $result[$key] = ['$lt' => $this->parseDateTime($query, $value[0], $field), '$gt' => $this->parseDateTime($query, $value[1], $field)]; - } elseif ('near' == $exp) { - // 经纬度查询 - $result[$key] = ['$near' => $this->parseValue($query, $value, $key)]; - } elseif ('size' == $exp) { - // 元素长度查询 - $result[$key] = ['$size' => intval($value)]; - } else { - // 普通查询 - $result[$key] = $this->parseValue($query, $value, $key); - } - - return $result; - } - - /** - * 日期时间条件解析 - * @access protected - * @param Query $query 查询对象 - * @param string $value - * @param string $key - * @return string - */ - protected function parseDateTime(Query $query, $value, $key) - { - // 获取时间字段类型 - $type = $query->getFieldType($key); - - if ($type) { - if (is_string($value)) { - $value = strtotime($value) ?: $value; - } - - if (is_int($value)) { - if (preg_match('/(datetime|timestamp)/is', $type)) { - // 日期及时间戳类型 - $value = date('Y-m-d H:i:s', $value); - } elseif (preg_match('/(date)/is', $type)) { - // 日期及时间戳类型 - $value = date('Y-m-d', $value); - } - } - } - - return $value; - } - - /** - * 获取最后写入的ID 如果是insertAll方法的话 返回所有写入的ID - * @access public - * @return mixed - */ - public function getLastInsID() - { - return $this->insertId; - } - - /** - * 生成insert BulkWrite对象 - * @access public - * @param Query $query 查询对象 - * @return BulkWrite - */ - public function insert(Query $query): BulkWrite - { - // 分析并处理数据 - $options = $query->getOptions(); - - $data = $this->parseData($query, $options['data']); - - $bulk = new BulkWrite; - - if ($insertId = $bulk->insert($data)) { - $this->insertId = $insertId; - } - - $this->log('insert', $data, $options); - - return $bulk; - } - - /** - * 生成insertall BulkWrite对象 - * @access public - * @param Query $query 查询对象 - * @param array $dataSet 数据集 - * @return BulkWrite - */ - public function insertAll(Query $query, array $dataSet): BulkWrite - { - $bulk = new BulkWrite; - $options = $query->getOptions(); - - $this->insertId = []; - foreach ($dataSet as $data) { - // 分析并处理数据 - $data = $this->parseData($query, $data); - if ($insertId = $bulk->insert($data)) { - $this->insertId[] = $insertId; - } - } - - $this->log('insert', $dataSet, $options); - - return $bulk; - } - - /** - * 生成update BulkWrite对象 - * @access public - * @param Query $query 查询对象 - * @return BulkWrite - */ - public function update(Query $query): BulkWrite - { - $options = $query->getOptions(); - - $data = $this->parseSet($query, $options['data']); - $where = $this->parseWhere($query, $options['where']); - - if (1 == $options['limit']) { - $updateOptions = ['multi' => false]; - } else { - $updateOptions = ['multi' => true]; - } - - $bulk = new BulkWrite; - - $bulk->update($where, $data, $updateOptions); - - $this->log('update', $data, $where); - - return $bulk; - } - - /** - * 生成delete BulkWrite对象 - * @access public - * @param Query $query 查询对象 - * @return BulkWrite - */ - public function delete(Query $query): BulkWrite - { - $options = $query->getOptions(); - $where = $this->parseWhere($query, $options['where']); - - $bulk = new BulkWrite; - - if (1 == $options['limit']) { - $deleteOptions = ['limit' => 1]; - } else { - $deleteOptions = ['limit' => 0]; - } - - $bulk->delete($where, $deleteOptions); - - $this->log('remove', $where, $deleteOptions); - - return $bulk; - } - - /** - * 生成Mongo查询对象 - * @access public - * @param Query $query 查询对象 - * @param bool $one 是否仅获取一个记录 - * @return MongoQuery - */ - public function select(Query $query, bool $one = false): MongoQuery - { - $options = $query->getOptions(); - - $where = $this->parseWhere($query, $options['where']); - - if ($one) { - $options['limit'] = 1; - } - - $query = new MongoQuery($where, $options); - - $this->log('find', $where, $options); - - return $query; - } - - /** - * 生成Count命令 - * @access public - * @param Query $query 查询对象 - * @return Command - */ - public function count(Query $query): Command - { - $options = $query->getOptions(); - - $cmd['count'] = $options['table']; - $cmd['query'] = (object) $this->parseWhere($query, $options['where']); - - foreach (['hint', 'limit', 'maxTimeMS', 'skip'] as $option) { - if (isset($options[$option])) { - $cmd[$option] = $options[$option]; - } - } - - $command = new Command($cmd); - $this->log('cmd', 'count', $cmd); - - return $command; - } - - /** - * 聚合查询命令 - * @access public - * @param Query $query 查询对象 - * @param array $extra 指令和字段 - * @return Command - */ - public function aggregate(Query $query, array $extra): Command - { - $options = $query->getOptions(); - [$fun, $field] = $extra; - - if ('id' == $field && $this->connection->getConfig('pk_convert_id')) { - $field = '_id'; - } - - $group = isset($options['group']) ? '$' . $options['group'] : null; - - $pipeline = [ - ['$match' => (object) $this->parseWhere($query, $options['where'])], - ['$group' => ['_id' => $group, 'aggregate' => ['$' . $fun => '$' . $field]]], - ]; - - $cmd = [ - 'aggregate' => $options['table'], - 'allowDiskUse' => true, - 'pipeline' => $pipeline, - 'cursor' => new \stdClass, - ]; - - foreach (['explain', 'collation', 'bypassDocumentValidation', 'readConcern'] as $option) { - if (isset($options[$option])) { - $cmd[$option] = $options[$option]; - } - } - - $command = new Command($cmd); - - $this->log('aggregate', $cmd); - - return $command; - } - - /** - * 多聚合查询命令, 可以对多个字段进行 group by 操作 - * - * @param Query $query 查询对象 - * @param array $extra 指令和字段 - * @return Command - */ - public function multiAggregate(Query $query, $extra): Command - { - $options = $query->getOptions(); - - [$aggregate, $groupBy] = $extra; - - $groups = ['_id' => []]; - - foreach ($groupBy as $field) { - $groups['_id'][$field] = '$' . $field; - } - - foreach ($aggregate as $fun => $field) { - $groups[$field . '_' . $fun] = ['$' . $fun => '$' . $field]; - } - - $pipeline = [ - ['$match' => (object) $this->parseWhere($query, $options['where'])], - ['$group' => $groups], - ]; - - $cmd = [ - 'aggregate' => $options['table'], - 'allowDiskUse' => true, - 'pipeline' => $pipeline, - 'cursor' => new \stdClass, - ]; - - foreach (['explain', 'collation', 'bypassDocumentValidation', 'readConcern'] as $option) { - if (isset($options[$option])) { - $cmd[$option] = $options[$option]; - } - } - - $command = new Command($cmd); - $this->log('group', $cmd); - - return $command; - } - - /** - * 生成distinct命令 - * @access public - * @param Query $query 查询对象 - * @param string $field 字段名 - * @return Command - */ - public function distinct(Query $query, $field): Command - { - $options = $query->getOptions(); - - $cmd = [ - 'distinct' => $options['table'], - 'key' => $field, - ]; - - if (!empty($options['where'])) { - $cmd['query'] = (object) $this->parseWhere($query, $options['where']); - } - - if (isset($options['maxTimeMS'])) { - $cmd['maxTimeMS'] = $options['maxTimeMS']; - } - - $command = new Command($cmd); - - $this->log('cmd', 'distinct', $cmd); - - return $command; - } - - /** - * 查询所有的collection - * @access public - * @return Command - */ - public function listcollections(): Command - { - $cmd = ['listCollections' => 1]; - $command = new Command($cmd); - - $this->log('cmd', 'listCollections', $cmd); - - return $command; - } - - /** - * 查询数据表的状态信息 - * @access public - * @param Query $query 查询对象 - * @return Command - */ - public function collStats(Query $query): Command - { - $options = $query->getOptions(); - - $cmd = ['collStats' => $options['table']]; - $command = new Command($cmd); - - $this->log('cmd', 'collStats', $cmd); - - return $command; - } - - protected function log($type, $data, $options = []) - { - $this->connection->mongoLog($type, $data, $options); - } -} diff --git a/vendor/topthink/think-orm/src/db/builder/Mysql.php b/vendor/topthink/think-orm/src/db/builder/Mysql.php deleted file mode 100644 index 10c8d1d..0000000 --- a/vendor/topthink/think-orm/src/db/builder/Mysql.php +++ /dev/null @@ -1,426 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\builder; - -use think\db\Builder; -use think\db\exception\DbException as Exception; -use think\db\Query; -use think\db\Raw; - -/** - * mysql数据库驱动 - */ -class Mysql extends Builder -{ - /** - * 查询表达式解析 - * @var array - */ - protected $parser = [ - 'parseCompare' => ['=', '<>', '>', '>=', '<', '<='], - 'parseLike' => ['LIKE', 'NOT LIKE'], - 'parseBetween' => ['NOT BETWEEN', 'BETWEEN'], - 'parseIn' => ['NOT IN', 'IN'], - 'parseExp' => ['EXP'], - 'parseRegexp' => ['REGEXP', 'NOT REGEXP'], - 'parseNull' => ['NOT NULL', 'NULL'], - 'parseBetweenTime' => ['BETWEEN TIME', 'NOT BETWEEN TIME'], - 'parseTime' => ['< TIME', '> TIME', '<= TIME', '>= TIME'], - 'parseExists' => ['NOT EXISTS', 'EXISTS'], - 'parseColumn' => ['COLUMN'], - 'parseFindInSet' => ['FIND IN SET'], - ]; - - /** - * SELECT SQL表达式 - * @var string - */ - protected $selectSql = 'SELECT%DISTINCT%%EXTRA% %FIELD% FROM %TABLE%%PARTITION%%FORCE%%JOIN%%WHERE%%GROUP%%HAVING%%UNION%%ORDER%%LIMIT% %LOCK%%COMMENT%'; - - /** - * INSERT SQL表达式 - * @var string - */ - protected $insertSql = '%INSERT%%EXTRA% INTO %TABLE%%PARTITION% SET %SET% %DUPLICATE%%COMMENT%'; - - /** - * INSERT ALL SQL表达式 - * @var string - */ - protected $insertAllSql = '%INSERT%%EXTRA% INTO %TABLE%%PARTITION% (%FIELD%) VALUES %DATA% %DUPLICATE%%COMMENT%'; - - /** - * UPDATE SQL表达式 - * @var string - */ - protected $updateSql = 'UPDATE%EXTRA% %TABLE%%PARTITION% %JOIN% SET %SET% %WHERE% %ORDER%%LIMIT% %LOCK%%COMMENT%'; - - /** - * DELETE SQL表达式 - * @var string - */ - protected $deleteSql = 'DELETE%EXTRA% FROM %TABLE%%PARTITION%%USING%%JOIN%%WHERE%%ORDER%%LIMIT% %LOCK%%COMMENT%'; - - /** - * 生成查询SQL - * @access public - * @param Query $query 查询对象 - * @param bool $one 是否仅获取一个记录 - * @return string - */ - public function select(Query $query, bool $one = false): string - { - $options = $query->getOptions(); - - return str_replace( - ['%TABLE%', '%PARTITION%', '%DISTINCT%', '%EXTRA%', '%FIELD%', '%JOIN%', '%WHERE%', '%GROUP%', '%HAVING%', '%ORDER%', '%LIMIT%', '%UNION%', '%LOCK%', '%COMMENT%', '%FORCE%'], - [ - $this->parseTable($query, $options['table']), - $this->parsePartition($query, $options['partition']), - $this->parseDistinct($query, $options['distinct']), - $this->parseExtra($query, $options['extra']), - $this->parseField($query, $options['field']), - $this->parseJoin($query, $options['join']), - $this->parseWhere($query, $options['where']), - $this->parseGroup($query, $options['group']), - $this->parseHaving($query, $options['having']), - $this->parseOrder($query, $options['order']), - $this->parseLimit($query, $one ? '1' : $options['limit']), - $this->parseUnion($query, $options['union']), - $this->parseLock($query, $options['lock']), - $this->parseComment($query, $options['comment']), - $this->parseForce($query, $options['force']), - ], - $this->selectSql); - } - - /** - * 生成Insert SQL - * @access public - * @param Query $query 查询对象 - * @return string - */ - public function insert(Query $query): string - { - $options = $query->getOptions(); - - // 分析并处理数据 - $data = $this->parseData($query, $options['data']); - if (empty($data)) { - return ''; - } - - $set = []; - foreach ($data as $key => $val) { - $set[] = $key . ' = ' . $val; - } - - return str_replace( - ['%INSERT%', '%EXTRA%', '%TABLE%', '%PARTITION%', '%SET%', '%DUPLICATE%', '%COMMENT%'], - [ - !empty($options['replace']) ? 'REPLACE' : 'INSERT', - $this->parseExtra($query, $options['extra']), - $this->parseTable($query, $options['table']), - $this->parsePartition($query, $options['partition']), - implode(' , ', $set), - $this->parseDuplicate($query, $options['duplicate']), - $this->parseComment($query, $options['comment']), - ], - $this->insertSql); - } - - /** - * 生成insertall SQL - * @access public - * @param Query $query 查询对象 - * @param array $dataSet 数据集 - * @param bool $replace 是否replace - * @return string - */ - public function insertAll(Query $query, array $dataSet, bool $replace = false): string - { - $options = $query->getOptions(); - - // 获取绑定信息 - $bind = $query->getFieldsBindType(); - - // 获取合法的字段 - if ('*' == $options['field']) { - $allowFields = array_keys($bind); - } else { - $allowFields = $options['field']; - } - - $fields = []; - $values = []; - - foreach ($dataSet as $data) { - $data = $this->parseData($query, $data, $allowFields, $bind); - - $values[] = '( ' . implode(',', array_values($data)) . ' )'; - - if (!isset($insertFields)) { - $insertFields = array_keys($data); - } - } - - foreach ($insertFields as $field) { - $fields[] = $this->parseKey($query, $field); - } - - return str_replace( - ['%INSERT%', '%EXTRA%', '%TABLE%', '%PARTITION%', '%FIELD%', '%DATA%', '%DUPLICATE%', '%COMMENT%'], - [ - $replace ? 'REPLACE' : 'INSERT', - $this->parseExtra($query, $options['extra']), - $this->parseTable($query, $options['table']), - $this->parsePartition($query, $options['partition']), - implode(' , ', $fields), - implode(' , ', $values), - $this->parseDuplicate($query, $options['duplicate']), - $this->parseComment($query, $options['comment']), - ], - $this->insertAllSql); - } - - /** - * 生成update SQL - * @access public - * @param Query $query 查询对象 - * @return string - */ - public function update(Query $query): string - { - $options = $query->getOptions(); - - $data = $this->parseData($query, $options['data']); - - if (empty($data)) { - return ''; - } - $set = []; - foreach ($data as $key => $val) { - $set[] = $key . ' = ' . $val; - } - - return str_replace( - ['%TABLE%', '%PARTITION%', '%EXTRA%', '%SET%', '%JOIN%', '%WHERE%', '%ORDER%', '%LIMIT%', '%LOCK%', '%COMMENT%'], - [ - $this->parseTable($query, $options['table']), - $this->parsePartition($query, $options['partition']), - $this->parseExtra($query, $options['extra']), - implode(' , ', $set), - $this->parseJoin($query, $options['join']), - $this->parseWhere($query, $options['where']), - $this->parseOrder($query, $options['order']), - $this->parseLimit($query, $options['limit']), - $this->parseLock($query, $options['lock']), - $this->parseComment($query, $options['comment']), - ], - $this->updateSql); - } - - /** - * 生成delete SQL - * @access public - * @param Query $query 查询对象 - * @return string - */ - public function delete(Query $query): string - { - $options = $query->getOptions(); - - return str_replace( - ['%TABLE%', '%PARTITION%', '%EXTRA%', '%USING%', '%JOIN%', '%WHERE%', '%ORDER%', '%LIMIT%', '%LOCK%', '%COMMENT%'], - [ - $this->parseTable($query, $options['table']), - $this->parsePartition($query, $options['partition']), - $this->parseExtra($query, $options['extra']), - !empty($options['using']) ? ' USING ' . $this->parseTable($query, $options['using']) . ' ' : '', - $this->parseJoin($query, $options['join']), - $this->parseWhere($query, $options['where']), - $this->parseOrder($query, $options['order']), - $this->parseLimit($query, $options['limit']), - $this->parseLock($query, $options['lock']), - $this->parseComment($query, $options['comment']), - ], - $this->deleteSql); - } - - /** - * 正则查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @return string - */ - protected function parseRegexp(Query $query, string $key, string $exp, $value, string $field): string - { - if ($value instanceof Raw) { - $value = $this->parseRaw($query, $value); - } - - return $key . ' ' . $exp . ' ' . $value; - } - - /** - * FIND_IN_SET 查询 - * @access protected - * @param Query $query 查询对象 - * @param string $key - * @param string $exp - * @param mixed $value - * @param string $field - * @return string - */ - protected function parseFindInSet(Query $query, string $key, string $exp, $value, string $field): string - { - if ($value instanceof Raw) { - $value = $this->parseRaw($query, $value); - } - - return 'FIND_IN_SET(' . $value . ', ' . $key . ')'; - } - - /** - * 字段和表名处理 - * @access public - * @param Query $query 查询对象 - * @param mixed $key 字段名 - * @param bool $strict 严格检测 - * @return string - */ - public function parseKey(Query $query, $key, bool $strict = false): string - { - if (is_int($key)) { - return (string) $key; - } elseif ($key instanceof Raw) { - return $this->parseRaw($query, $key); - } - - $key = trim($key); - - if (strpos($key, '->>') && false === strpos($key, '(')) { - // JSON字段支持 - [$field, $name] = explode('->>', $key, 2); - - return $this->parseKey($query, $field, true) . '->>\'$' . (strpos($name, '[') === 0 ? '' : '.') . str_replace('->>', '.', $name) . '\''; - } elseif (strpos($key, '->') && false === strpos($key, '(')) { - // JSON字段支持 - [$field, $name] = explode('->', $key, 2); - return 'json_extract(' . $this->parseKey($query, $field, true) . ', \'$' . (strpos($name, '[') === 0 ? '' : '.') . str_replace('->', '.', $name) . '\')'; - } elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) { - [$table, $key] = explode('.', $key, 2); - - $alias = $query->getOptions('alias'); - - if ('__TABLE__' == $table) { - $table = $query->getOptions('table'); - $table = is_array($table) ? array_shift($table) : $table; - } - - if (isset($alias[$table])) { - $table = $alias[$table]; - } - } - - if ($strict && !preg_match('/^[\w\.\*]+$/', $key)) { - throw new Exception('not support data:' . $key); - } - - if ('*' != $key && !preg_match('/[,\'\"\*\(\)`.\s]/', $key)) { - $key = '`' . $key . '`'; - } - - if (isset($table)) { - if (strpos($table, '.')) { - $table = str_replace('.', '`.`', $table); - } - - $key = '`' . $table . '`.' . $key; - } - - return $key; - } - - /** - * 随机排序 - * @access protected - * @param Query $query 查询对象 - * @return string - */ - protected function parseRand(Query $query): string - { - return 'rand()'; - } - - /** - * Partition 分析 - * @access protected - * @param Query $query 查询对象 - * @param string|array $partition 分区 - * @return string - */ - protected function parsePartition(Query $query, $partition): string - { - if ('' == $partition) { - return ''; - } - - if (is_string($partition)) { - $partition = explode(',', $partition); - } - - return ' PARTITION (' . implode(' , ', $partition) . ') '; - } - - /** - * ON DUPLICATE KEY UPDATE 分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $duplicate - * @return string - */ - protected function parseDuplicate(Query $query, $duplicate): string - { - if ('' == $duplicate) { - return ''; - } - - if ($duplicate instanceof Raw) { - return ' ON DUPLICATE KEY UPDATE ' . $this->parseRaw($query, $duplicate) . ' '; - } - - if (is_string($duplicate)) { - $duplicate = explode(',', $duplicate); - } - - $updates = []; - foreach ($duplicate as $key => $val) { - if (is_numeric($key)) { - $val = $this->parseKey($query, $val); - $updates[] = $val . ' = VALUES(' . $val . ')'; - } elseif ($val instanceof Raw) { - $updates[] = $this->parseKey($query, $key) . " = " . $this->parseRaw($query, $val); - } else { - $name = $query->bindValue($val, $query->getConnection()->getFieldBindType($key)); - $updates[] = $this->parseKey($query, $key) . " = :" . $name; - } - } - - return ' ON DUPLICATE KEY UPDATE ' . implode(' , ', $updates) . ' '; - } -} diff --git a/vendor/topthink/think-orm/src/db/builder/Oracle.php b/vendor/topthink/think-orm/src/db/builder/Oracle.php deleted file mode 100644 index 77ad3c8..0000000 --- a/vendor/topthink/think-orm/src/db/builder/Oracle.php +++ /dev/null @@ -1,95 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\builder; - -use think\db\Builder; -use think\db\Query; - -/** - * Oracle数据库驱动 - */ -class Oracle extends Builder -{ - protected $selectSql = 'SELECT * FROM (SELECT thinkphp.*, rownum AS numrow FROM (SELECT %DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%%ORDER%) thinkphp ) %LIMIT%%COMMENT%'; - - /** - * limit分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $limit - * @return string - */ - protected function parseLimit(Query $query, string $limit): string - { - $limitStr = ''; - - if (!empty($limit)) { - $limit = explode(',', $limit); - - if (count($limit) > 1) { - $limitStr = "(numrow>" . $limit[0] . ") AND (numrow<=" . ($limit[0] + $limit[1]) . ")"; - } else { - $limitStr = "(numrow>0 AND numrow<=" . $limit[0] . ")"; - } - - } - - return $limitStr ? ' WHERE ' . $limitStr : ''; - } - - /** - * 设置锁机制 - * @access protected - * @param Query $query 查询对象 - * @param bool|false $lock - * @return string - */ - protected function parseLock(Query $query, $lock = false): string - { - if (!$lock) { - return ''; - } - - return ' FOR UPDATE NOWAIT '; - } - - /** - * 字段和表名处理 - * @access public - * @param Query $query 查询对象 - * @param string $key - * @param string $strict - * @return string - */ - public function parseKey(Query $query, $key, bool $strict = false): string - { - $key = trim($key); - - if (strpos($key, '->') && false === strpos($key, '(')) { - // JSON字段支持 - [$field, $name] = explode($key, '->'); - $key = $field . '."' . $name . '"'; - } - - return $key; - } - - /** - * 随机排序 - * @access protected - * @param Query $query 查询对象 - * @return string - */ - protected function parseRand(Query $query): string - { - return 'DBMS_RANDOM.value'; - } -} diff --git a/vendor/topthink/think-orm/src/db/builder/Pgsql.php b/vendor/topthink/think-orm/src/db/builder/Pgsql.php deleted file mode 100644 index 4eace0a..0000000 --- a/vendor/topthink/think-orm/src/db/builder/Pgsql.php +++ /dev/null @@ -1,118 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\builder; - -use think\db\Builder; -use think\db\Query; -use think\db\Raw; - -/** - * Pgsql数据库驱动 - */ -class Pgsql extends Builder -{ - /** - * INSERT SQL表达式 - * @var string - */ - protected $insertSql = 'INSERT INTO %TABLE% (%FIELD%) VALUES (%DATA%) %COMMENT%'; - - /** - * INSERT ALL SQL表达式 - * @var string - */ - protected $insertAllSql = 'INSERT INTO %TABLE% (%FIELD%) %DATA% %COMMENT%'; - - /** - * limit分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $limit - * @return string - */ - public function parseLimit(Query $query, string $limit): string - { - $limitStr = ''; - - if (!empty($limit)) { - $limit = explode(',', $limit); - if (count($limit) > 1) { - $limitStr .= ' LIMIT ' . $limit[1] . ' OFFSET ' . $limit[0] . ' '; - } else { - $limitStr .= ' LIMIT ' . $limit[0] . ' '; - } - } - - return $limitStr; - } - - /** - * 字段和表名处理 - * @access public - * @param Query $query 查询对象 - * @param mixed $key 字段名 - * @param bool $strict 严格检测 - * @return string - */ - public function parseKey(Query $query, $key, bool $strict = false): string - { - if (is_int($key)) { - return (string) $key; - } elseif ($key instanceof Raw) { - return $this->parseRaw($query, $key); - } - - $key = trim($key); - - if (strpos($key, '->') && false === strpos($key, '(')) { - // JSON字段支持 - [$field, $name] = explode('->', $key); - $key = '"' . $field . '"' . '->>\'' . $name . '\''; - } elseif (strpos($key, '.')) { - [$table, $key] = explode('.', $key, 2); - - $alias = $query->getOptions('alias'); - - if ('__TABLE__' == $table) { - $table = $query->getOptions('table'); - $table = is_array($table) ? array_shift($table) : $table; - } - - if (isset($alias[$table])) { - $table = $alias[$table]; - } - - if ('*' != $key && !preg_match('/[,\"\*\(\).\s]/', $key)) { - $key = '"' . $key . '"'; - } - } - - if (isset($table)) { - $key = $table . '.' . $key; - } - - return $key; - } - - /** - * 随机排序 - * @access protected - * @param Query $query 查询对象 - * @return string - */ - protected function parseRand(Query $query): string - { - return 'RANDOM()'; - } - -} diff --git a/vendor/topthink/think-orm/src/db/builder/Sqlite.php b/vendor/topthink/think-orm/src/db/builder/Sqlite.php deleted file mode 100644 index 40cab7f..0000000 --- a/vendor/topthink/think-orm/src/db/builder/Sqlite.php +++ /dev/null @@ -1,97 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\builder; - -use think\db\Builder; -use think\db\Query; -use think\db\Raw; - -/** - * Sqlite数据库驱动 - */ -class Sqlite extends Builder -{ - /** - * limit - * @access public - * @param Query $query 查询对象 - * @param mixed $limit - * @return string - */ - public function parseLimit(Query $query, string $limit): string - { - $limitStr = ''; - - if (!empty($limit)) { - $limit = explode(',', $limit); - if (count($limit) > 1) { - $limitStr .= ' LIMIT ' . $limit[1] . ' OFFSET ' . $limit[0] . ' '; - } else { - $limitStr .= ' LIMIT ' . $limit[0] . ' '; - } - } - - return $limitStr; - } - - /** - * 随机排序 - * @access protected - * @param Query $query 查询对象 - * @return string - */ - protected function parseRand(Query $query): string - { - return 'RANDOM()'; - } - - /** - * 字段和表名处理 - * @access public - * @param Query $query 查询对象 - * @param mixed $key 字段名 - * @param bool $strict 严格检测 - * @return string - */ - public function parseKey(Query $query, $key, bool $strict = false): string - { - if (is_int($key)) { - return (string) $key; - } elseif ($key instanceof Raw) { - return $this->parseRaw($query, $key); - } - - $key = trim($key); - - if (strpos($key, '.')) { - [$table, $key] = explode('.', $key, 2); - - $alias = $query->getOptions('alias'); - - if ('__TABLE__' == $table) { - $table = $query->getOptions('table'); - $table = is_array($table) ? array_shift($table) : $table; - } - - if (isset($alias[$table])) { - $table = $alias[$table]; - } - } - - if (isset($table)) { - $key = $table . '.' . $key; - } - - return $key; - } -} diff --git a/vendor/topthink/think-orm/src/db/builder/Sqlsrv.php b/vendor/topthink/think-orm/src/db/builder/Sqlsrv.php deleted file mode 100644 index 779b5e3..0000000 --- a/vendor/topthink/think-orm/src/db/builder/Sqlsrv.php +++ /dev/null @@ -1,184 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\db\builder; - -use think\db\Builder; -use think\db\exception\DbException as Exception; -use think\db\Query; -use think\db\Raw; - -/** - * Sqlsrv数据库驱动 - */ -class Sqlsrv extends Builder -{ - /** - * SELECT SQL表达式 - * @var string - */ - protected $selectSql = 'SELECT T1.* FROM (SELECT thinkphp.*, ROW_NUMBER() OVER (%ORDER%) AS ROW_NUMBER FROM (SELECT %DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%) AS thinkphp) AS T1 %LIMIT%%COMMENT%'; - /** - * SELECT INSERT SQL表达式 - * @var string - */ - protected $selectInsertSql = 'SELECT %DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%'; - - /** - * UPDATE SQL表达式 - * @var string - */ - protected $updateSql = 'UPDATE %TABLE% SET %SET% FROM %TABLE% %JOIN% %WHERE% %LIMIT% %LOCK%%COMMENT%'; - - /** - * DELETE SQL表达式 - * @var string - */ - protected $deleteSql = 'DELETE FROM %TABLE% %USING% FROM %TABLE% %JOIN% %WHERE% %LIMIT% %LOCK%%COMMENT%'; - - /** - * INSERT SQL表达式 - * @var string - */ - protected $insertSql = 'INSERT INTO %TABLE% (%FIELD%) VALUES (%DATA%) %COMMENT%'; - - /** - * INSERT ALL SQL表达式 - * @var string - */ - protected $insertAllSql = 'INSERT INTO %TABLE% (%FIELD%) %DATA% %COMMENT%'; - - /** - * order分析 - * @access protected - * @param Query $query 查询对象 - * @param mixed $order - * @return string - */ - protected function parseOrder(Query $query, array $order): string - { - if (empty($order)) { - return ' ORDER BY rand()'; - } - - $array = []; - - foreach ($order as $key => $val) { - if ($val instanceof Raw) { - $array[] = $this->parseRaw($query, $val); - } elseif ('[rand]' == $val) { - $array[] = $this->parseRand($query); - } else { - if (is_numeric($key)) { - [$key, $sort] = explode(' ', strpos($val, ' ') ? $val : $val . ' '); - } else { - $sort = $val; - } - - $sort = in_array(strtolower($sort), ['asc', 'desc'], true) ? ' ' . $sort : ''; - $array[] = $this->parseKey($query, $key, true) . $sort; - } - } - - return ' ORDER BY ' . implode(',', $array); - } - - /** - * 随机排序 - * @access protected - * @param Query $query 查询对象 - * @return string - */ - protected function parseRand(Query $query): string - { - return 'rand()'; - } - - /** - * 字段和表名处理 - * @access public - * @param Query $query 查询对象 - * @param mixed $key 字段名 - * @param bool $strict 严格检测 - * @return string - */ - public function parseKey(Query $query, $key, bool $strict = false): string - { - if (is_int($key)) { - return (string) $key; - } elseif ($key instanceof Raw) { - return $this->parseRaw($query, $key); - } - - $key = trim($key); - - if (strpos($key, '.') && !preg_match('/[,\'\"\(\)\[\s]/', $key)) { - [$table, $key] = explode('.', $key, 2); - - $alias = $query->getOptions('alias'); - - if ('__TABLE__' == $table) { - $table = $query->getOptions('table'); - $table = is_array($table) ? array_shift($table) : $table; - } - - if (isset($alias[$table])) { - $table = $alias[$table]; - } - } - - if ($strict && !preg_match('/^[\w\.\*]+$/', $key)) { - throw new Exception('not support data:' . $key); - } - - if ('*' != $key && !preg_match('/[,\'\"\*\(\)\[.\s]/', $key)) { - $key = '[' . $key . ']'; - } - - if (isset($table)) { - $key = '[' . $table . '].' . $key; - } - - return $key; - } - - /** - * limit - * @access protected - * @param Query $query 查询对象 - * @param mixed $limit - * @return string - */ - protected function parseLimit(Query $query, string $limit): string - { - if (empty($limit)) { - return ''; - } - - $limit = explode(',', $limit); - - if (count($limit) > 1) { - $limitStr = '(T1.ROW_NUMBER BETWEEN ' . $limit[0] . ' + 1 AND ' . $limit[0] . ' + ' . $limit[1] . ')'; - } else { - $limitStr = '(T1.ROW_NUMBER BETWEEN 1 AND ' . $limit[0] . ")"; - } - - return 'WHERE ' . $limitStr; - } - - public function selectInsert(Query $query, array $fields, string $table): string - { - $this->selectSql = $this->selectInsertSql; - - return parent::selectInsert($query, $fields, $table); - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php b/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php deleted file mode 100644 index dabfb92..0000000 --- a/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php +++ /dev/null @@ -1,107 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -use think\db\Raw; - -/** - * 聚合查询 - */ -trait AggregateQuery -{ - /** - * 聚合查询 - * @access protected - * @param string $aggregate 聚合方法 - * @param string|Raw $field 字段名 - * @param bool $force 强制转为数字类型 - * @return mixed - */ - protected function aggregate(string $aggregate, $field, bool $force = false) - { - return $this->connection->aggregate($this, $aggregate, $field, $force); - } - - /** - * COUNT查询 - * @access public - * @param string|Raw $field 字段名 - * @return int - */ - public function count(string $field = '*'): int - { - if (!empty($this->options['group'])) { - // 支持GROUP - $options = $this->getOptions(); - $subSql = $this->options($options) - ->field('count(' . $field . ') AS think_count') - ->bind($this->bind) - ->buildSql(); - - $query = $this->newQuery()->table([$subSql => '_group_count_']); - - $count = $query->aggregate('COUNT', '*'); - } else { - $count = $this->aggregate('COUNT', $field); - } - - return (int) $count; - } - - /** - * SUM查询 - * @access public - * @param string|Raw $field 字段名 - * @return float - */ - public function sum($field): float - { - return $this->aggregate('SUM', $field, true); - } - - /** - * MIN查询 - * @access public - * @param string|Raw $field 字段名 - * @param bool $force 强制转为数字类型 - * @return mixed - */ - public function min($field, bool $force = true) - { - return $this->aggregate('MIN', $field, $force); - } - - /** - * MAX查询 - * @access public - * @param string|Raw $field 字段名 - * @param bool $force 强制转为数字类型 - * @return mixed - */ - public function max($field, bool $force = true) - { - return $this->aggregate('MAX', $field, $force); - } - - /** - * AVG查询 - * @access public - * @param string|Raw $field 字段名 - * @return float - */ - public function avg($field): float - { - return $this->aggregate('AVG', $field, true); - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php b/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php deleted file mode 100644 index c33d1ed..0000000 --- a/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php +++ /dev/null @@ -1,229 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -use think\db\Raw; -use think\helper\Str; - -/** - * JOIN和VIEW查询 - */ -trait JoinAndViewQuery -{ - - /** - * 查询SQL组装 join - * @access public - * @param mixed $join 关联的表名 - * @param mixed $condition 条件 - * @param string $type JOIN类型 - * @param array $bind 参数绑定 - * @return $this - */ - public function join($join, string $condition = null, string $type = 'INNER', array $bind = []) - { - $table = $this->getJoinTable($join); - - if (!empty($bind) && $condition) { - $this->bindParams($condition, $bind); - } - - $this->options['join'][] = [$table, strtoupper($type), $condition]; - - return $this; - } - - /** - * LEFT JOIN - * @access public - * @param mixed $join 关联的表名 - * @param mixed $condition 条件 - * @param array $bind 参数绑定 - * @return $this - */ - public function leftJoin($join, string $condition = null, array $bind = []) - { - return $this->join($join, $condition, 'LEFT', $bind); - } - - /** - * RIGHT JOIN - * @access public - * @param mixed $join 关联的表名 - * @param mixed $condition 条件 - * @param array $bind 参数绑定 - * @return $this - */ - public function rightJoin($join, string $condition = null, array $bind = []) - { - return $this->join($join, $condition, 'RIGHT', $bind); - } - - /** - * FULL JOIN - * @access public - * @param mixed $join 关联的表名 - * @param mixed $condition 条件 - * @param array $bind 参数绑定 - * @return $this - */ - public function fullJoin($join, string $condition = null, array $bind = []) - { - return $this->join($join, $condition, 'FULL'); - } - - /** - * 获取Join表名及别名 支持 - * ['prefix_table或者子查询'=>'alias'] 'table alias' - * @access protected - * @param array|string|Raw $join JION表名 - * @param string $alias 别名 - * @return string|array - */ - protected function getJoinTable($join, &$alias = null) - { - if (is_array($join)) { - $table = $join; - $alias = array_shift($join); - return $table; - } elseif ($join instanceof Raw) { - return $join; - } - - $join = trim($join); - - if (false !== strpos($join, '(')) { - // 使用子查询 - $table = $join; - } else { - // 使用别名 - if (strpos($join, ' ')) { - // 使用别名 - [$table, $alias] = explode(' ', $join); - } else { - $table = $join; - if (false === strpos($join, '.')) { - $alias = $join; - } - } - - if ($this->prefix && false === strpos($table, '.') && 0 !== strpos($table, $this->prefix)) { - $table = $this->getTable($table); - } - } - - if (!empty($alias) && $table != $alias) { - $table = [$table => $alias]; - } - - return $table; - } - - /** - * 指定JOIN查询字段 - * @access public - * @param string|array $join 数据表 - * @param string|array $field 查询字段 - * @param string $on JOIN条件 - * @param string $type JOIN类型 - * @param array $bind 参数绑定 - * @return $this - */ - public function view($join, $field = true, $on = null, string $type = 'INNER', array $bind = []) - { - $this->options['view'] = true; - - $fields = []; - $table = $this->getJoinTable($join, $alias); - - if (true === $field) { - $fields = $alias . '.*'; - } else { - if (is_string($field)) { - $field = explode(',', $field); - } - - foreach ($field as $key => $val) { - if (is_numeric($key)) { - $fields[] = $alias . '.' . $val; - - $this->options['map'][$val] = $alias . '.' . $val; - } else { - if (preg_match('/[,=\.\'\"\(\s]/', $key)) { - $name = $key; - } else { - $name = $alias . '.' . $key; - } - - $fields[] = $name . ' AS ' . $val; - - $this->options['map'][$val] = $name; - } - } - } - - $this->field($fields); - - if ($on) { - $this->join($table, $on, $type, $bind); - } else { - $this->table($table); - } - - return $this; - } - - /** - * 视图查询处理 - * @access protected - * @param array $options 查询参数 - * @return void - */ - protected function parseView(array &$options): void - { - foreach (['AND', 'OR'] as $logic) { - if (isset($options['where'][$logic])) { - foreach ($options['where'][$logic] as $key => $val) { - if (array_key_exists($key, $options['map'])) { - array_shift($val); - array_unshift($val, $options['map'][$key]); - $options['where'][$logic][$options['map'][$key]] = $val; - unset($options['where'][$logic][$key]); - } - } - } - } - - if (isset($options['order'])) { - // 视图查询排序处理 - foreach ($options['order'] as $key => $val) { - if (is_numeric($key) && is_string($val)) { - if (strpos($val, ' ')) { - [$field, $sort] = explode(' ', $val); - if (array_key_exists($field, $options['map'])) { - $options['order'][$options['map'][$field]] = $sort; - unset($options['order'][$key]); - } - } elseif (array_key_exists($val, $options['map'])) { - $options['order'][$options['map'][$val]] = 'asc'; - unset($options['order'][$key]); - } - } elseif (array_key_exists($key, $options['map'])) { - $options['order'][$options['map'][$key]] = $val; - unset($options['order'][$key]); - } - } - } - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php b/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php deleted file mode 100644 index ffb72de..0000000 --- a/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php +++ /dev/null @@ -1,524 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -use Closure; -use think\helper\Str; -use think\Model; -use think\model\Collection as ModelCollection; - -/** - * 模型及关联查询 - */ -trait ModelRelationQuery -{ - - /** - * 当前模型对象 - * @var Model - */ - protected $model; - - /** - * 指定模型 - * @access public - * @param Model $model 模型对象实例 - * @return $this - */ - public function model(Model $model) - { - $this->model = $model; - return $this; - } - - /** - * 获取当前的模型对象 - * @access public - * @return Model|null - */ - public function getModel() - { - return $this->model; - } - - /** - * 设置需要隐藏的输出属性 - * @access public - * @param array $hidden 需要隐藏的字段名 - * @return $this - */ - public function hidden(array $hidden) - { - $this->options['hidden'] = $hidden; - return $this; - } - - /** - * 设置需要输出的属性 - * @access public - * @param array $visible 需要输出的属性 - * @return $this - */ - public function visible(array $visible) - { - $this->options['visible'] = $visible; - return $this; - } - - /** - * 设置需要追加输出的属性 - * @access public - * @param array $append 需要追加的属性 - * @return $this - */ - public function append(array $append) - { - $this->options['append'] = $append; - return $this; - } - - /** - * 添加查询范围 - * @access public - * @param array|string|Closure $scope 查询范围定义 - * @param array $args 参数 - * @return $this - */ - public function scope($scope, ...$args) - { - // 查询范围的第一个参数始终是当前查询对象 - array_unshift($args, $this); - - if ($scope instanceof Closure) { - call_user_func_array($scope, $args); - return $this; - } - - if (is_string($scope)) { - $scope = explode(',', $scope); - } - - if ($this->model) { - // 检查模型类的查询范围方法 - foreach ($scope as $name) { - $method = 'scope' . trim($name); - - if (method_exists($this->model, $method)) { - call_user_func_array([$this->model, $method], $args); - } - } - } - - return $this; - } - - /** - * 设置关联查询 - * @access public - * @param array $relation 关联名称 - * @return $this - */ - public function relation(array $relation) - { - if (!empty($relation)) { - $this->options['relation'] = $relation; - } - - return $this; - } - - /** - * 使用搜索器条件搜索字段 - * @access public - * @param string|array $fields 搜索字段 - * @param mixed $data 搜索数据 - * @param string $prefix 字段前缀标识 - * @return $this - */ - public function withSearch($fields, $data = [], string $prefix = '') - { - if (is_string($fields)) { - $fields = explode(',', $fields); - } - - $likeFields = $this->getConfig('match_like_fields') ?: []; - - foreach ($fields as $key => $field) { - if ($field instanceof Closure) { - $field($this, $data[$key] ?? null, $data, $prefix); - } elseif ($this->model) { - // 检测搜索器 - $fieldName = is_numeric($key) ? $field : $key; - $method = 'search' . Str::studly($fieldName) . 'Attr'; - - if (method_exists($this->model, $method)) { - $this->model->$method($this, $data[$field] ?? null, $data, $prefix); - } elseif (isset($data[$field])) { - $this->where($fieldName, in_array($fieldName, $likeFields) ? 'like' : '=', in_array($fieldName, $likeFields) ? '%' . $data[$field] . '%' : $data[$field]); - } - } - } - - return $this; - } - - /** - * 设置数据字段获取器 - * @access public - * @param string|array $name 字段名 - * @param callable $callback 闭包获取器 - * @return $this - */ - public function withAttr($name, callable $callback = null) - { - if (is_array($name)) { - $this->options['with_attr'] = $name; - } else { - $this->options['with_attr'][$name] = $callback; - } - - return $this; - } - - /** - * 关联预载入 In方式 - * @access public - * @param array|string $with 关联方法名称 - * @return $this - */ - public function with($with) - { - if (!empty($with)) { - $this->options['with'] = (array) $with; - } - - return $this; - } - - /** - * 关联预载入 JOIN方式 - * @access protected - * @param array|string $with 关联方法名 - * @param string $joinType JOIN方式 - * @return $this - */ - public function withJoin($with, string $joinType = '') - { - if (empty($with)) { - return $this; - } - - $with = (array) $with; - $first = true; - - foreach ($with as $key => $relation) { - $closure = null; - $field = true; - - if ($relation instanceof Closure) { - // 支持闭包查询过滤关联条件 - $closure = $relation; - $relation = $key; - } elseif (is_array($relation)) { - $field = $relation; - $relation = $key; - } elseif (is_string($relation) && strpos($relation, '.')) { - $relation = strstr($relation, '.', true); - } - - $result = $this->model->eagerly($this, $relation, $field, $joinType, $closure, $first); - - if (!$result) { - unset($with[$key]); - } else { - $first = false; - } - } - - $this->via(); - - $this->options['with_join'] = $with; - - return $this; - } - - /** - * 关联统计 - * @access protected - * @param array|string $relations 关联方法名 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param bool $subQuery 是否使用子查询 - * @return $this - */ - protected function withAggregate($relations, string $aggregate = 'count', $field = '*', bool $subQuery = true) - { - if (!$subQuery) { - $this->options['with_count'][] = [$relations, $aggregate, $field]; - } else { - if (!isset($this->options['field'])) { - $this->field('*'); - } - - $this->model->relationCount($this, (array) $relations, $aggregate, $field, true); - } - - return $this; - } - - /** - * 关联缓存 - * @access public - * @param string|array|bool $relation 关联方法名 - * @param mixed $key 缓存key - * @param integer|\DateTime $expire 缓存有效期 - * @param string $tag 缓存标签 - * @return $this - */ - public function withCache($relation = true, $key = true, $expire = null, string $tag = null) - { - if (false === $relation || false === $key || !$this->getConnection()->getCache()) { - return $this; - } - - if ($key instanceof \DateTimeInterface || $key instanceof \DateInterval || (is_int($key) && is_null($expire))) { - $expire = $key; - $key = true; - } - - if (true === $relation || is_numeric($relation)) { - $this->options['with_cache'] = $relation; - return $this; - } - - $relations = (array) $relation; - foreach ($relations as $name => $relation) { - if (!is_numeric($name)) { - $this->options['with_cache'][$name] = is_array($relation) ? $relation : [$key, $relation, $tag]; - } else { - $this->options['with_cache'][$relation] = [$key, $expire, $tag]; - } - } - - return $this; - } - - /** - * 关联统计 - * @access public - * @param string|array $relation 关联方法名 - * @param bool $subQuery 是否使用子查询 - * @return $this - */ - public function withCount($relation, bool $subQuery = true) - { - return $this->withAggregate($relation, 'count', '*', $subQuery); - } - - /** - * 关联统计Sum - * @access public - * @param string|array $relation 关联方法名 - * @param string $field 字段 - * @param bool $subQuery 是否使用子查询 - * @return $this - */ - public function withSum($relation, string $field, bool $subQuery = true) - { - return $this->withAggregate($relation, 'sum', $field, $subQuery); - } - - /** - * 关联统计Max - * @access public - * @param string|array $relation 关联方法名 - * @param string $field 字段 - * @param bool $subQuery 是否使用子查询 - * @return $this - */ - public function withMax($relation, string $field, bool $subQuery = true) - { - return $this->withAggregate($relation, 'max', $field, $subQuery); - } - - /** - * 关联统计Min - * @access public - * @param string|array $relation 关联方法名 - * @param string $field 字段 - * @param bool $subQuery 是否使用子查询 - * @return $this - */ - public function withMin($relation, string $field, bool $subQuery = true) - { - return $this->withAggregate($relation, 'min', $field, $subQuery); - } - - /** - * 关联统计Avg - * @access public - * @param string|array $relation 关联方法名 - * @param string $field 字段 - * @param bool $subQuery 是否使用子查询 - * @return $this - */ - public function withAvg($relation, string $field, bool $subQuery = true) - { - return $this->withAggregate($relation, 'avg', $field, $subQuery); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $relation 关联方法名 - * @param mixed $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @return $this - */ - public function has(string $relation, string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '') - { - return $this->model->has($relation, $operator, $count, $id, $joinType, $this); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $relation 关联方法名 - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @return $this - */ - public function hasWhere(string $relation, $where = [], string $fields = '*', string $joinType = '') - { - return $this->model->hasWhere($relation, $where, $fields, $joinType, $this); - } - - /** - * 查询数据转换为模型数据集对象 - * @access protected - * @param array $resultSet 数据集 - * @return ModelCollection - */ - protected function resultSetToModelCollection(array $resultSet): ModelCollection - { - if (empty($resultSet)) { - return $this->model->toCollection(); - } - - // 检查动态获取器 - if (!empty($this->options['with_attr'])) { - foreach ($this->options['with_attr'] as $name => $val) { - if (strpos($name, '.')) { - [$relation, $field] = explode('.', $name); - - $withRelationAttr[$relation][$field] = $val; - unset($this->options['with_attr'][$name]); - } - } - } - - $withRelationAttr = $withRelationAttr ?? []; - - foreach ($resultSet as $key => &$result) { - // 数据转换为模型对象 - $this->resultToModel($result, $this->options, true, $withRelationAttr); - } - - if (!empty($this->options['with'])) { - // 预载入 - $result->eagerlyResultSet($resultSet, $this->options['with'], $withRelationAttr, false, $this->options['with_cache'] ?? false); - } - - if (!empty($this->options['with_join'])) { - // 预载入 - $result->eagerlyResultSet($resultSet, $this->options['with_join'], $withRelationAttr, true, $this->options['with_cache'] ?? false); - } - - // 模型数据集转换 - return $this->model->toCollection($resultSet); - } - - /** - * 查询数据转换为模型对象 - * @access protected - * @param array $result 查询数据 - * @param array $options 查询参数 - * @param bool $resultSet 是否为数据集查询 - * @param array $withRelationAttr 关联字段获取器 - * @return void - */ - protected function resultToModel(array &$result, array $options = [], bool $resultSet = false, array $withRelationAttr = []): void - { - // 动态获取器 - if (!empty($options['with_attr']) && empty($withRelationAttr)) { - foreach ($options['with_attr'] as $name => $val) { - if (strpos($name, '.')) { - [$relation, $field] = explode('.', $name); - - $withRelationAttr[$relation][$field] = $val; - unset($options['with_attr'][$name]); - } - } - } - - // JSON 数据处理 - if (!empty($options['json'])) { - $this->jsonResult($result, $options['json'], $options['json_assoc'], $withRelationAttr); - } - - $result = $this->model - ->newInstance($result, $resultSet ? null : $this->getModelUpdateCondition($options)); - - // 动态获取器 - if (!empty($options['with_attr'])) { - $result->withAttribute($options['with_attr']); - } - - // 输出属性控制 - if (!empty($options['visible'])) { - $result->visible($options['visible']); - } elseif (!empty($options['hidden'])) { - $result->hidden($options['hidden']); - } - - if (!empty($options['append'])) { - $result->append($options['append']); - } - - // 关联查询 - if (!empty($options['relation'])) { - $result->relationQuery($options['relation'], $withRelationAttr); - } - - // 预载入查询 - if (!$resultSet && !empty($options['with'])) { - $result->eagerlyResult($result, $options['with'], $withRelationAttr, false, $options['with_cache'] ?? false); - } - - // JOIN预载入查询 - if (!$resultSet && !empty($options['with_join'])) { - $result->eagerlyResult($result, $options['with_join'], $withRelationAttr, true, $options['with_cache'] ?? false); - } - - // 关联统计 - if (!empty($options['with_count'])) { - foreach ($options['with_count'] as $val) { - $result->relationCount($this, (array) $val[0], $val[1], $val[2], false); - } - } - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/ParamsBind.php b/vendor/topthink/think-orm/src/db/concern/ParamsBind.php deleted file mode 100644 index 296e221..0000000 --- a/vendor/topthink/think-orm/src/db/concern/ParamsBind.php +++ /dev/null @@ -1,106 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -use PDO; - -/** - * 参数绑定支持 - */ -trait ParamsBind -{ - /** - * 当前参数绑定 - * @var array - */ - protected $bind = []; - - /** - * 批量参数绑定 - * @access public - * @param array $value 绑定变量值 - * @return $this - */ - public function bind(array $value) - { - $this->bind = array_merge($this->bind, $value); - return $this; - } - - /** - * 单个参数绑定 - * @access public - * @param mixed $value 绑定变量值 - * @param integer $type 绑定类型 - * @param string $name 绑定标识 - * @return string - */ - public function bindValue($value, int $type = null, string $name = null) - { - $name = $name ?: 'ThinkBind_' . (count($this->bind) + 1) . '_' . mt_rand() . '_'; - - $this->bind[$name] = [$value, $type ?: PDO::PARAM_STR]; - return $name; - } - - /** - * 检测参数是否已经绑定 - * @access public - * @param string $key 参数名 - * @return bool - */ - public function isBind($key) - { - return isset($this->bind[$key]); - } - - /** - * 参数绑定 - * @access public - * @param string $sql 绑定的sql表达式 - * @param array $bind 参数绑定 - * @return void - */ - public function bindParams(string &$sql, array $bind = []): void - { - foreach ($bind as $key => $value) { - if (is_array($value)) { - $name = $this->bindValue($value[0], $value[1], $value[2] ?? null); - } else { - $name = $this->bindValue($value); - } - - if (is_numeric($key)) { - $sql = substr_replace($sql, ':' . $name, strpos($sql, '?'), 1); - } else { - $sql = str_replace(':' . $key, ':' . $name, $sql); - } - } - } - - /** - * 获取绑定的参数 并清空 - * @access public - * @param bool $clear 是否清空绑定数据 - * @return array - */ - public function getBind(bool $clear = true): array - { - $bind = $this->bind; - if ($clear) { - $this->bind = []; - } - - return $bind; - } -} diff --git a/vendor/topthink/think-orm/src/db/concern/ResultOperation.php b/vendor/topthink/think-orm/src/db/concern/ResultOperation.php deleted file mode 100644 index d93c409..0000000 --- a/vendor/topthink/think-orm/src/db/concern/ResultOperation.php +++ /dev/null @@ -1,247 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -use Closure; -use think\Collection; -use think\db\exception\DataNotFoundException; -use think\db\exception\DbException; -use think\db\exception\ModelNotFoundException; -use think\db\Query; -use think\helper\Str; -use think\Model; - -/** - * 查询数据处理 - */ -trait ResultOperation -{ - /** - * 是否允许返回空数据(或空模型) - * @access public - * @param bool $allowEmpty 是否允许为空 - * @return $this - */ - public function allowEmpty(bool $allowEmpty = true) - { - $this->options['allow_empty'] = $allowEmpty; - return $this; - } - - /** - * 设置查询数据不存在是否抛出异常 - * @access public - * @param bool $fail 数据不存在是否抛出异常 - * @return $this - */ - public function failException(bool $fail = true) - { - $this->options['fail'] = $fail; - return $this; - } - - /** - * 处理数据 - * @access protected - * @param array $result 查询数据 - * @return void - */ - protected function result(array &$result): void - { - if (!empty($this->options['json'])) { - $this->jsonResult($result, $this->options['json'], true); - } - - if (!empty($this->options['with_attr'])) { - $this->getResultAttr($result, $this->options['with_attr']); - } - - $this->filterResult($result); - } - - /** - * 处理数据集 - * @access public - * @param array $resultSet 数据集 - * @return void - */ - protected function resultSet(array &$resultSet): void - { - if (!empty($this->options['json'])) { - foreach ($resultSet as &$result) { - $this->jsonResult($result, $this->options['json'], true); - } - } - - if (!empty($this->options['with_attr'])) { - foreach ($resultSet as &$result) { - $this->getResultAttr($result, $this->options['with_attr']); - } - } - - if (!empty($this->options['visible']) || !empty($this->options['hidden'])) { - foreach ($resultSet as &$result) { - $this->filterResult($result); - } - } - - // 返回Collection对象 - $resultSet = new Collection($resultSet); - } - - /** - * 处理数据的可见和隐藏 - * @access protected - * @param array $result 查询数据 - * @return void - */ - protected function filterResult(&$result): void - { - $array = []; - if (!empty($this->options['visible'])) { - foreach ($this->options['visible'] as $key) { - $array[] = $key; - } - $result = array_intersect_key($result, array_flip($array)); - } elseif (!empty($this->options['hidden'])) { - foreach ($this->options['hidden'] as $key) { - $array[] = $key; - } - $result = array_diff_key($result, array_flip($array)); - } - } - - /** - * 使用获取器处理数据 - * @access protected - * @param array $result 查询数据 - * @param array $withAttr 字段获取器 - * @return void - */ - protected function getResultAttr(array &$result, array $withAttr = []): void - { - foreach ($withAttr as $name => $closure) { - $name = Str::snake($name); - - if (strpos($name, '.')) { - // 支持JSON字段 获取器定义 - [$key, $field] = explode('.', $name); - - if (isset($result[$key])) { - $result[$key][$field] = $closure($result[$key][$field] ?? null, $result[$key]); - } - } else { - $result[$name] = $closure($result[$name] ?? null, $result); - } - } - } - - /** - * 处理空数据 - * @access protected - * @return array|Model|null - * @throws DbException - * @throws ModelNotFoundException - * @throws DataNotFoundException - */ - protected function resultToEmpty() - { - if (!empty($this->options['fail'])) { - $this->throwNotFound(); - } elseif (!empty($this->options['allow_empty'])) { - return !empty($this->model) ? $this->model->newInstance() : []; - } - } - - /** - * 查找单条记录 不存在返回空数据(或者空模型) - * @access public - * @param mixed $data 数据 - * @return array|Model - */ - public function findOrEmpty($data = null) - { - return $this->allowEmpty(true)->find($data); - } - - /** - * JSON字段数据转换 - * @access protected - * @param array $result 查询数据 - * @param array $json JSON字段 - * @param bool $assoc 是否转换为数组 - * @param array $withRelationAttr 关联获取器 - * @return void - */ - protected function jsonResult(array &$result, array $json = [], bool $assoc = false, array $withRelationAttr = []): void - { - foreach ($json as $name) { - if (!isset($result[$name])) { - continue; - } - - $result[$name] = json_decode($result[$name], true); - - if (isset($withRelationAttr[$name])) { - foreach ($withRelationAttr[$name] as $key => $closure) { - $result[$name][$key] = $closure($result[$name][$key] ?? null, $result[$name]); - } - } - - if (!$assoc) { - $result[$name] = (object) $result[$name]; - } - } - } - - /** - * 查询失败 抛出异常 - * @access protected - * @return void - * @throws ModelNotFoundException - * @throws DataNotFoundException - */ - protected function throwNotFound(): void - { - if (!empty($this->model)) { - $class = get_class($this->model); - throw new ModelNotFoundException('model data Not Found:' . $class, $class, $this->options); - } - - $table = $this->getTable(); - throw new DataNotFoundException('table data not Found:' . $table, $table, $this->options); - } - - /** - * 查找多条记录 如果不存在则抛出异常 - * @access public - * @param array|string|Query|Closure $data 数据 - * @return array|Model - */ - public function selectOrFail($data = null) - { - return $this->failException(true)->select($data); - } - - /** - * 查找单条记录 如果不存在则抛出异常 - * @access public - * @param array|string|Query|Closure $data 数据 - * @return array|Model - */ - public function findOrFail($data = null) - { - return $this->failException(true)->find($data); - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php b/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php deleted file mode 100644 index 9070bef..0000000 --- a/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php +++ /dev/null @@ -1,99 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -/** - * 数据字段信息 - */ -trait TableFieldInfo -{ - - /** - * 获取数据表字段信息 - * @access public - * @param string $tableName 数据表名 - * @return array - */ - public function getTableFields($tableName = ''): array - { - if ('' == $tableName) { - $tableName = $this->getTable(); - } - - return $this->connection->getTableFields($tableName); - } - - /** - * 获取详细字段类型信息 - * @access public - * @param string $tableName 数据表名称 - * @return array - */ - public function getFields(string $tableName = ''): array - { - return $this->connection->getFields($tableName ?: $this->getTable()); - } - - /** - * 获取字段类型信息 - * @access public - * @return array - */ - public function getFieldsType(): array - { - if (!empty($this->options['field_type'])) { - return $this->options['field_type']; - } - - return $this->connection->getFieldsType($this->getTable()); - } - - /** - * 获取字段类型信息 - * @access public - * @param string $field 字段名 - * @return string|null - */ - public function getFieldType(string $field) - { - $fieldType = $this->getFieldsType(); - - return $fieldType[$field] ?? null; - } - - /** - * 获取字段类型信息 - * @access public - * @return array - */ - public function getFieldsBindType(): array - { - $fieldType = $this->getFieldsType(); - - return array_map([$this->connection, 'getFieldBindType'], $fieldType); - } - - /** - * 获取字段类型信息 - * @access public - * @param string $field 字段名 - * @return int - */ - public function getFieldBindType(string $field): int - { - $fieldType = $this->getFieldType($field); - - return $this->connection->getFieldBindType($fieldType ?: ''); - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php b/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php deleted file mode 100644 index 1267e54..0000000 --- a/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php +++ /dev/null @@ -1,214 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -/** - * 时间查询支持 - */ -trait TimeFieldQuery -{ - /** - * 日期查询表达式 - * @var array - */ - protected $timeRule = [ - 'today' => ['today', 'tomorrow -1second'], - 'yesterday' => ['yesterday', 'today -1second'], - 'week' => ['this week 00:00:00', 'next week 00:00:00 -1second'], - 'last week' => ['last week 00:00:00', 'this week 00:00:00 -1second'], - 'month' => ['first Day of this month 00:00:00', 'first Day of next month 00:00:00 -1second'], - 'last month' => ['first Day of last month 00:00:00', 'first Day of this month 00:00:00 -1second'], - 'year' => ['this year 1/1', 'next year 1/1 -1second'], - 'last year' => ['last year 1/1', 'this year 1/1 -1second'], - ]; - - /** - * 添加日期或者时间查询规则 - * @access public - * @param array $rule 时间表达式 - * @return $this - */ - public function timeRule(array $rule) - { - $this->timeRule = array_merge($this->timeRule, $rule); - return $this; - } - - /** - * 查询日期或者时间 - * @access public - * @param string $field 日期字段名 - * @param string $op 比较运算符或者表达式 - * @param string|array $range 比较范围 - * @param string $logic AND OR - * @return $this - */ - public function whereTime(string $field, string $op, $range = null, string $logic = 'AND') - { - if (is_null($range)) { - if (isset($this->timeRule[$op])) { - $range = $this->timeRule[$op]; - } else { - $range = $op; - } - $op = is_array($range) ? 'between' : '>='; - } - - return $this->parseWhereExp($logic, $field, strtolower($op) . ' time', $range, [], true); - } - - /** - * 查询某个时间间隔数据 - * @access public - * @param string $field 日期字段名 - * @param string $start 开始时间 - * @param string $interval 时间间隔单位 day/month/year/week/hour/minute/second - * @param int $step 间隔 - * @param string $logic AND OR - * @return $this - */ - public function whereTimeInterval(string $field, string $start, string $interval = 'day', int $step = 1, string $logic = 'AND') - { - $startTime = strtotime($start); - $endTime = strtotime(($step > 0 ? '+' : '-') . abs($step) . ' ' . $interval . (abs($step) > 1 ? 's' : ''), $startTime); - - return $this->whereTime($field, 'between', $step > 0 ? [$startTime, $endTime - 1] : [$endTime, $startTime - 1], $logic); - } - - /** - * 查询月数据 whereMonth('time_field', '2018-1') - * @access public - * @param string $field 日期字段名 - * @param string $month 月份信息 - * @param int $step 间隔 - * @param string $logic AND OR - * @return $this - */ - public function whereMonth(string $field, string $month = 'this month', int $step = 1, string $logic = 'AND') - { - if (in_array($month, ['this month', 'last month'])) { - $month = date('Y-m', strtotime($month)); - } - - return $this->whereTimeInterval($field, $month, 'month', $step, $logic); - } - - /** - * 查询周数据 whereWeek('time_field', '2018-1-1') 从2018-1-1开始的一周数据 - * @access public - * @param string $field 日期字段名 - * @param string $week 周信息 - * @param int $step 间隔 - * @param string $logic AND OR - * @return $this - */ - public function whereWeek(string $field, string $week = 'this week', int $step = 1, string $logic = 'AND') - { - if (in_array($week, ['this week', 'last week'])) { - $week = date('Y-m-d', strtotime($week)); - } - - return $this->whereTimeInterval($field, $week, 'week', $step, $logic); - } - - /** - * 查询年数据 whereYear('time_field', '2018') - * @access public - * @param string $field 日期字段名 - * @param string $year 年份信息 - * @param int $step 间隔 - * @param string $logic AND OR - * @return $this - */ - public function whereYear(string $field, string $year = 'this year', int $step = 1, string $logic = 'AND') - { - if (in_array($year, ['this year', 'last year'])) { - $year = date('Y', strtotime($year)); - } - - return $this->whereTimeInterval($field, $year . '-1-1', 'year', $step, $logic); - } - - /** - * 查询日数据 whereDay('time_field', '2018-1-1') - * @access public - * @param string $field 日期字段名 - * @param string $day 日期信息 - * @param int $step 间隔 - * @param string $logic AND OR - * @return $this - */ - public function whereDay(string $field, string $day = 'today', int $step = 1, string $logic = 'AND') - { - if (in_array($day, ['today', 'yesterday'])) { - $day = date('Y-m-d', strtotime($day)); - } - - return $this->whereTimeInterval($field, $day, 'day', $step, $logic); - } - - /** - * 查询日期或者时间范围 whereBetweenTime('time_field', '2018-1-1','2018-1-15') - * @access public - * @param string $field 日期字段名 - * @param string|int $startTime 开始时间 - * @param string|int $endTime 结束时间 - * @param string $logic AND OR - * @return $this - */ - public function whereBetweenTime(string $field, $startTime, $endTime, string $logic = 'AND') - { - return $this->whereTime($field, 'between', [$startTime, $endTime], $logic); - } - - /** - * 查询日期或者时间范围 whereNotBetweenTime('time_field', '2018-1-1','2018-1-15') - * @access public - * @param string $field 日期字段名 - * @param string|int $startTime 开始时间 - * @param string|int $endTime 结束时间 - * @return $this - */ - public function whereNotBetweenTime(string $field, $startTime, $endTime) - { - return $this->whereTime($field, '<', $startTime) - ->whereTime($field, '>', $endTime); - } - - /** - * 查询当前时间在两个时间字段范围 whereBetweenTimeField('start_time', 'end_time') - * @access public - * @param string $startField 开始时间字段 - * @param string $endField 结束时间字段 - * @return $this - */ - public function whereBetweenTimeField(string $startField, string $endField) - { - return $this->whereTime($startField, '<=', time()) - ->whereTime($endField, '>=', time()); - } - - /** - * 查询当前时间不在两个时间字段范围 whereNotBetweenTimeField('start_time', 'end_time') - * @access public - * @param string $startField 开始时间字段 - * @param string $endField 结束时间字段 - * @return $this - */ - public function whereNotBetweenTimeField(string $startField, string $endField) - { - return $this->whereTime($startField, '>', time()) - ->whereTime($endField, '<', time(), 'OR'); - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/Transaction.php b/vendor/topthink/think-orm/src/db/concern/Transaction.php deleted file mode 100644 index f804ae2..0000000 --- a/vendor/topthink/think-orm/src/db/concern/Transaction.php +++ /dev/null @@ -1,117 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -use think\db\BaseQuery; - -/** - * 事务支持 - */ -trait Transaction -{ - - /** - * 执行数据库Xa事务 - * @access public - * @param callable $callback 数据操作方法回调 - * @param array $dbs 多个查询对象或者连接对象 - * @return mixed - * @throws PDOException - * @throws \Exception - * @throws \Throwable - */ - public function transactionXa($callback, array $dbs = []) - { - $xid = uniqid('xa'); - - if (empty($dbs)) { - $dbs[] = $this->getConnection(); - } - - foreach ($dbs as $key => $db) { - if ($db instanceof BaseQuery) { - $db = $db->getConnection(); - - $dbs[$key] = $db; - } - - $db->startTransXa($xid); - } - - try { - $result = null; - if (is_callable($callback)) { - $result = call_user_func_array($callback, [$this]); - } - - foreach ($dbs as $db) { - $db->prepareXa($xid); - } - - foreach ($dbs as $db) { - $db->commitXa($xid); - } - - return $result; - } catch (\Exception | \Throwable $e) { - foreach ($dbs as $db) { - $db->rollbackXa($xid); - } - throw $e; - } - } - - /** - * 执行数据库事务 - * @access public - * @param callable $callback 数据操作方法回调 - * @return mixed - */ - public function transaction(callable $callback) - { - return $this->connection->transaction($callback); - } - - /** - * 启动事务 - * @access public - * @return void - */ - public function startTrans(): void - { - $this->connection->startTrans(); - } - - /** - * 用于非自动提交状态下面的查询提交 - * @access public - * @return void - * @throws PDOException - */ - public function commit(): void - { - $this->connection->commit(); - } - - /** - * 事务回滚 - * @access public - * @return void - * @throws PDOException - */ - public function rollback(): void - { - $this->connection->rollback(); - } - -} diff --git a/vendor/topthink/think-orm/src/db/concern/WhereQuery.php b/vendor/topthink/think-orm/src/db/concern/WhereQuery.php deleted file mode 100644 index 1311628..0000000 --- a/vendor/topthink/think-orm/src/db/concern/WhereQuery.php +++ /dev/null @@ -1,532 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\concern; - -use Closure; -use think\db\BaseQuery; -use think\db\Raw; - -trait WhereQuery -{ - /** - * 指定AND查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $op 查询表达式 - * @param mixed $condition 查询条件 - * @return $this - */ - public function where($field, $op = null, $condition = null) - { - if ($field instanceof $this) { - $this->parseQueryWhere($field); - return $this; - } elseif (true === $field || 1 === $field) { - $this->options['where']['AND'][] = true; - return $this; - } - - $param = func_get_args(); - array_shift($param); - return $this->parseWhereExp('AND', $field, $op, $condition, $param); - } - - /** - * 解析Query对象查询条件 - * @access public - * @param BaseQuery $query 查询对象 - * @return void - */ - protected function parseQueryWhere(BaseQuery $query): void - { - $this->options['where'] = $query->getOptions('where'); - - if ($query->getOptions('via')) { - $via = $query->getOptions('via'); - foreach ($this->options['where'] as $logic => &$where) { - foreach ($where as $key => &$val) { - if (is_array($val) && !strpos($val[0], '.')) { - $val[0] = $via . '.' . $val[0]; - } - } - } - } - - $this->bind($query->getBind(false)); - } - - /** - * 指定OR查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $op 查询表达式 - * @param mixed $condition 查询条件 - * @return $this - */ - public function whereOr($field, $op = null, $condition = null) - { - $param = func_get_args(); - array_shift($param); - return $this->parseWhereExp('OR', $field, $op, $condition, $param); - } - - /** - * 指定XOR查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $op 查询表达式 - * @param mixed $condition 查询条件 - * @return $this - */ - public function whereXor($field, $op = null, $condition = null) - { - $param = func_get_args(); - array_shift($param); - return $this->parseWhereExp('XOR', $field, $op, $condition, $param); - } - - /** - * 指定Null查询条件 - * @access public - * @param mixed $field 查询字段 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereNull(string $field, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'NULL', null, [], true); - } - - /** - * 指定NotNull查询条件 - * @access public - * @param mixed $field 查询字段 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereNotNull(string $field, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'NOTNULL', null, [], true); - } - - /** - * 指定Exists查询条件 - * @access public - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereExists($condition, string $logic = 'AND') - { - if (is_string($condition)) { - $condition = new Raw($condition); - } - - $this->options['where'][strtoupper($logic)][] = ['', 'EXISTS', $condition]; - return $this; - } - - /** - * 指定NotExists查询条件 - * @access public - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereNotExists($condition, string $logic = 'AND') - { - if (is_string($condition)) { - $condition = new Raw($condition); - } - - $this->options['where'][strtoupper($logic)][] = ['', 'NOT EXISTS', $condition]; - return $this; - } - - /** - * 指定In查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereIn(string $field, $condition, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'IN', $condition, [], true); - } - - /** - * 指定NotIn查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereNotIn(string $field, $condition, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'NOT IN', $condition, [], true); - } - - /** - * 指定Like查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereLike(string $field, $condition, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'LIKE', $condition, [], true); - } - - /** - * 指定NotLike查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereNotLike(string $field, $condition, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'NOT LIKE', $condition, [], true); - } - - /** - * 指定Between查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereBetween(string $field, $condition, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'BETWEEN', $condition, [], true); - } - - /** - * 指定NotBetween查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereNotBetween(string $field, $condition, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'NOT BETWEEN', $condition, [], true); - } - - /** - * 指定FIND_IN_SET查询条件 - * @access public - * @param mixed $field 查询字段 - * @param mixed $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereFindInSet(string $field, $condition, string $logic = 'AND') - { - return $this->parseWhereExp($logic, $field, 'FIND IN SET', $condition, [], true); - } - - /** - * 比较两个字段 - * @access public - * @param string $field1 查询字段 - * @param string $operator 比较操作符 - * @param string $field2 比较字段 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereColumn(string $field1, string $operator, string $field2 = null, string $logic = 'AND') - { - if (is_null($field2)) { - $field2 = $operator; - $operator = '='; - } - - return $this->parseWhereExp($logic, $field1, 'COLUMN', [$operator, $field2], [], true); - } - - /** - * 设置软删除字段及条件 - * @access public - * @param string $field 查询字段 - * @param mixed $condition 查询条件 - * @return $this - */ - public function useSoftDelete(string $field, $condition = null) - { - if ($field) { - $this->options['soft_delete'] = [$field, $condition]; - } - - return $this; - } - - /** - * 指定Exp查询条件 - * @access public - * @param mixed $field 查询字段 - * @param string $where 查询条件 - * @param array $bind 参数绑定 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereExp(string $field, string $where, array $bind = [], string $logic = 'AND') - { - $this->options['where'][$logic][] = [$field, 'EXP', new Raw($where, $bind)]; - - return $this; - } - - /** - * 指定字段Raw查询 - * @access public - * @param string $field 查询字段表达式 - * @param mixed $op 查询表达式 - * @param string $condition 查询条件 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereFieldRaw(string $field, $op, $condition = null, string $logic = 'AND') - { - if (is_null($condition)) { - $condition = $op; - $op = '='; - } - - $this->options['where'][$logic][] = [new Raw($field), $op, $condition]; - return $this; - } - - /** - * 指定表达式查询条件 - * @access public - * @param string $where 查询条件 - * @param array $bind 参数绑定 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function whereRaw(string $where, array $bind = [], string $logic = 'AND') - { - $this->options['where'][$logic][] = new Raw($where, $bind); - - return $this; - } - - /** - * 指定表达式查询条件 OR - * @access public - * @param string $where 查询条件 - * @param array $bind 参数绑定 - * @return $this - */ - public function whereOrRaw(string $where, array $bind = []) - { - return $this->whereRaw($where, $bind, 'OR'); - } - - /** - * 分析查询表达式 - * @access protected - * @param string $logic 查询逻辑 and or xor - * @param mixed $field 查询字段 - * @param mixed $op 查询表达式 - * @param mixed $condition 查询条件 - * @param array $param 查询参数 - * @param bool $strict 严格模式 - * @return $this - */ - protected function parseWhereExp(string $logic, $field, $op, $condition, array $param = [], bool $strict = false) - { - $logic = strtoupper($logic); - - if (is_string($field) && !empty($this->options['via']) && false === strpos($field, '.')) { - $field = $this->options['via'] . '.' . $field; - } - - if ($field instanceof Raw) { - return $this->whereRaw($field, is_array($op) ? $op : [], $logic); - } elseif ($strict) { - // 使用严格模式查询 - if ('=' == $op) { - $where = $this->whereEq($field, $condition); - } else { - $where = [$field, $op, $condition, $logic]; - } - } elseif (is_array($field)) { - // 解析数组批量查询 - return $this->parseArrayWhereItems($field, $logic); - } elseif ($field instanceof Closure) { - $where = $field; - } elseif (is_string($field)) { - if (preg_match('/[,=\<\'\"\(\s]/', $field)) { - return $this->whereRaw($field, is_array($op) ? $op : [], $logic); - } elseif (is_string($op) && strtolower($op) == 'exp' && !is_null($condition)) { - $bind = isset($param[2]) && is_array($param[2]) ? $param[2] : []; - return $this->whereExp($field, $condition, $bind, $logic); - } - - $where = $this->parseWhereItem($logic, $field, $op, $condition, $param); - } - - if (!empty($where)) { - $this->options['where'][$logic][] = $where; - } - - return $this; - } - - /** - * 分析查询表达式 - * @access protected - * @param string $logic 查询逻辑 and or xor - * @param mixed $field 查询字段 - * @param mixed $op 查询表达式 - * @param mixed $condition 查询条件 - * @param array $param 查询参数 - * @return array - */ - protected function parseWhereItem(string $logic, $field, $op, $condition, array $param = []): array - { - if (is_array($op)) { - // 同一字段多条件查询 - array_unshift($param, $field); - $where = $param; - } elseif ($field && is_null($condition)) { - if (is_string($op) && in_array(strtoupper($op), ['NULL', 'NOTNULL', 'NOT NULL'], true)) { - // null查询 - $where = [$field, $op, '']; - } elseif ('=' === $op || is_null($op)) { - $where = [$field, 'NULL', '']; - } elseif ('<>' === $op) { - $where = [$field, 'NOTNULL', '']; - } else { - // 字段相等查询 - $where = $this->whereEq($field, $op); - } - } elseif (is_string($op) && in_array(strtoupper($op), ['EXISTS', 'NOT EXISTS', 'NOTEXISTS'], true)) { - $where = [$field, $op, is_string($condition) ? new Raw($condition) : $condition]; - } else { - $where = $field ? [$field, $op, $condition, $param[2] ?? null] : []; - } - - return $where; - } - - /** - * 相等查询的主键处理 - * @access protected - * @param string $field 字段名 - * @param mixed $value 字段值 - * @return array - */ - protected function whereEq(string $field, $value): array - { - if ($this->getPk() == $field) { - $this->options['key'] = $value; - } - - return [$field, '=', $value]; - } - - /** - * 数组批量查询 - * @access protected - * @param array $field 批量查询 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - protected function parseArrayWhereItems(array $field, string $logic) - { - if (key($field) !== 0) { - $where = []; - foreach ($field as $key => $val) { - if ($val instanceof Raw) { - $where[] = [$key, 'exp', $val]; - } else { - $where[] = is_null($val) ? [$key, 'NULL', ''] : [$key, is_array($val) ? 'IN' : '=', $val]; - } - } - } else { - // 数组批量查询 - $where = $field; - } - - if (!empty($where)) { - $this->options['where'][$logic] = isset($this->options['where'][$logic]) ? - array_merge($this->options['where'][$logic], $where) : $where; - } - - return $this; - } - - /** - * 去除某个查询条件 - * @access public - * @param string $field 查询字段 - * @param string $logic 查询逻辑 and or xor - * @return $this - */ - public function removeWhereField(string $field, string $logic = 'AND') - { - $logic = strtoupper($logic); - - if (isset($this->options['where'][$logic])) { - foreach ($this->options['where'][$logic] as $key => $val) { - if (is_array($val) && $val[0] == $field) { - unset($this->options['where'][$logic][$key]); - } - } - } - - return $this; - } - - /** - * 条件查询 - * @access public - * @param mixed $condition 满足条件(支持闭包) - * @param Closure|array $query 满足条件后执行的查询表达式(闭包或数组) - * @param Closure|array $otherwise 不满足条件后执行 - * @return $this - */ - public function when($condition, $query, $otherwise = null) - { - if ($condition instanceof Closure) { - $condition = $condition($this); - } - - if ($condition) { - if ($query instanceof Closure) { - $query($this, $condition); - } elseif (is_array($query)) { - $this->where($query); - } - } elseif ($otherwise) { - if ($otherwise instanceof Closure) { - $otherwise($this, $condition); - } elseif (is_array($otherwise)) { - $this->where($otherwise); - } - } - - return $this; - } -} diff --git a/vendor/topthink/think-orm/src/db/connector/Mongo.php b/vendor/topthink/think-orm/src/db/connector/Mongo.php deleted file mode 100644 index 4b05b79..0000000 --- a/vendor/topthink/think-orm/src/db/connector/Mongo.php +++ /dev/null @@ -1,1176 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\connector; - -use Closure; -use MongoDB\BSON\ObjectID; -use MongoDB\Driver\BulkWrite; -use MongoDB\Driver\Command; -use MongoDB\Driver\Cursor; -use MongoDB\Driver\Exception\AuthenticationException; -use MongoDB\Driver\Exception\BulkWriteException; -use MongoDB\Driver\Exception\ConnectionException; -use MongoDB\Driver\Exception\InvalidArgumentException; -use MongoDB\Driver\Exception\RuntimeException; -use MongoDB\Driver\Manager; -use MongoDB\Driver\Query as MongoQuery; -use MongoDB\Driver\ReadPreference; -use MongoDB\Driver\WriteConcern; -use think\db\BaseQuery; -use think\db\builder\Mongo as Builder; -use think\db\Connection; -use think\db\exception\DbException as Exception; -use think\db\Mongo as Query; -use function implode; -use function is_array; - -/** - * Mongo数据库驱动 - * @property Manager[] $links - * @property Manager $linkRead - * @property Manager $linkWrite - */ -class Mongo extends Connection -{ - - // 查询数据类型 - protected $dbName = ''; - protected $typeMap = 'array'; - protected $mongo; // MongoDb Object - protected $cursor; // MongoCursor Object - protected $session_uuid; // sessions会话列表当前会话数组key 随机生成 - protected $sessions = []; // 会话列表 - - /** @var Builder */ - protected $builder; - - // 数据库连接参数配置 - protected $config = [ - // 数据库类型 - 'type' => '', - // 服务器地址 - 'hostname' => '', - // 数据库名 - 'database' => '', - // 是否是复制集 - 'is_replica_set' => false, - // 用户名 - 'username' => '', - // 密码 - 'password' => '', - // 端口 - 'hostport' => '', - // 连接dsn - 'dsn' => '', - // 数据库连接参数 - 'params' => [], - // 数据库编码默认采用utf8 - 'charset' => 'utf8', - // 主键名 - 'pk' => '_id', - // 主键类型 - 'pk_type' => 'ObjectID', - // 数据库表前缀 - 'prefix' => '', - // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) - 'deploy' => 0, - // 数据库读写是否分离 主从式有效 - 'rw_separate' => false, - // 读写分离后 主服务器数量 - 'master_num' => 1, - // 指定从服务器序号 - 'slave_no' => '', - // 是否严格检查字段是否存在 - 'fields_strict' => true, - // 开启字段缓存 - 'fields_cache' => false, - // 监听SQL - 'trigger_sql' => true, - // 自动写入时间戳字段 - 'auto_timestamp' => false, - // 时间字段取出后的默认时间格式 - 'datetime_format' => 'Y-m-d H:i:s', - // 是否_id转换为id - 'pk_convert_id' => false, - // typeMap - 'type_map' => ['root' => 'array', 'document' => 'array'], - ]; - - /** - * 获取当前连接器类对应的Query类 - * @access public - * @return string - */ - public function getQueryClass(): string - { - return Query::class; - } - - /** - * 获取当前的builder实例对象 - * @access public - * @return Builder - */ - public function getBuilder() - { - return $this->builder; - } - - /** - * 获取当前连接器类对应的Builder类 - * @access public - * @return string - */ - public function getBuilderClass(): string - { - return Builder::class; - } - - /** - * 连接数据库方法 - * @access public - * @param array $config 连接参数 - * @param integer $linkNum 连接序号 - * @return Manager - * @throws InvalidArgumentException - * @throws RuntimeException - */ - public function connect(array $config = [], $linkNum = 0) - { - if (!isset($this->links[$linkNum])) { - if (empty($config)) { - $config = $this->config; - } else { - $config = array_merge($this->config, $config); - } - - $this->dbName = $config['database']; - $this->typeMap = $config['type_map']; - - if ($config['pk_convert_id'] && '_id' == $config['pk']) { - $this->config['pk'] = 'id'; - } - - if (empty($config['dsn'])) { - $config['dsn'] = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : ''); - } - - $startTime = microtime(true); - - $this->links[$linkNum] = new Manager($config['dsn'], $config['params']); - - if (!empty($config['trigger_sql'])) { - // 记录数据库连接信息 - $this->trigger('CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn']); - } - - } - - return $this->links[$linkNum]; - } - - /** - * 获取Mongo Manager对象 - * @access public - * @return Manager|null - */ - public function getMongo() - { - return $this->mongo ?: null; - } - - /** - * 设置/获取当前操作的database - * @access public - * @param string $db db - * @return string - */ - public function db(string $db = null) - { - if (is_null($db)) { - return $this->dbName; - } else { - $this->dbName = $db; - } - } - - /** - * 执行查询但只返回Cursor对象 - * @access public - * @param Query $query 查询对象 - * @return Cursor - */ - public function cursor($query) - { - // 分析查询表达式 - $options = $query->parseOptions(); - - // 生成MongoQuery对象 - $mongoQuery = $this->builder->select($query); - - $master = $query->getOptions('master') ? true : false; - - // 执行查询操作 - return $this->getCursor($query, $mongoQuery, $master); - } - - /** - * 执行查询并返回Cursor对象 - * @access public - * @param BaseQuery $query 查询对象 - * @param MongoQuery|Closure $mongoQuery Mongo查询对象 - * @param bool $master 是否主库操作 - * @return Cursor - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - */ - public function getCursor(BaseQuery $query, $mongoQuery, bool $master = false): Cursor - { - $this->initConnect($master); - $this->db->updateQueryTimes(); - - $options = $query->getOptions(); - $namespace = $options['table']; - - if (false === strpos($namespace, '.')) { - $namespace = $this->dbName . '.' . $namespace; - } - - if (!empty($this->queryStr)) { - // 记录执行指令 - $this->queryStr = 'db' . strstr($namespace, '.') . '.' . $this->queryStr; - } - - if ($mongoQuery instanceof Closure) { - $mongoQuery = $mongoQuery($query); - } - - $readPreference = $options['readPreference'] ?? null; - $this->queryStartTime = microtime(true); - - if ($session = $this->getSession()) { - $this->cursor = $this->mongo->executeQuery($namespace, $query, [ - 'readPreference' => is_null($readPreference) ? new ReadPreference(ReadPreference::RP_PRIMARY) : $readPreference, - 'session' => $session, - ]); - } else { - $this->cursor = $this->mongo->executeQuery($namespace, $mongoQuery, $readPreference); - } - - // SQL监控 - if (!empty($this->config['trigger_sql'])) { - $this->trigger('', $master); - } - - return $this->cursor; - } - - /** - * 执行查询 返回数据集 - * @access public - * @param MongoQuery $query 查询对象 - * @return mixed - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - */ - public function query(MongoQuery $query) - { - return $this->mongoQuery($this->newQuery(), $query); - } - - /** - * 执行语句 - * @access public - * @param BulkWrite $bulk - * @return int - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - * @throws BulkWriteException - */ - public function execute(BulkWrite $bulk) - { - return $this->mongoExecute($this->newQuery(), $bulk); - } - - /** - * 执行查询 - * @access protected - * @param BaseQuery $query 查询对象 - * @param MongoQuery|Closure $mongoQuery Mongo查询对象 - * @return array - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - */ - protected function mongoQuery(BaseQuery $query, $mongoQuery): array - { - $options = $query->parseOptions(); - - if ($query->getOptions('cache')) { - // 检查查询缓存 - $cacheItem = $this->parseCache($query, $query->getOptions('cache')); - $key = $cacheItem->getKey(); - - if ($this->cache->has($key)) { - return $this->cache->get($key); - } - } - - if ($mongoQuery instanceof Closure) { - $mongoQuery = $mongoQuery($query); - } - - $master = $query->getOptions('master') ? true : false; - $this->getCursor($query, $mongoQuery, $master); - - $resultSet = $this->getResult($options['typeMap']); - - if (isset($cacheItem) && $resultSet) { - // 缓存数据集 - $cacheItem->set($resultSet); - $this->cacheData($cacheItem); - } - - return $resultSet; - } - - /** - * 执行写操作 - * @access protected - * @param BaseQuery $query - * @param BulkWrite $bulk - * - * @return WriteResult - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - * @throws BulkWriteException - */ - protected function mongoExecute(BaseQuery $query, BulkWrite $bulk) - { - $this->initConnect(true); - $this->db->updateQueryTimes(); - - $options = $query->getOptions(); - - $namespace = $options['table']; - if (false === strpos($namespace, '.')) { - $namespace = $this->dbName . '.' . $namespace; - } - - if (!empty($this->queryStr)) { - // 记录执行指令 - $this->queryStr = 'db' . strstr($namespace, '.') . '.' . $this->queryStr; - } - - $writeConcern = $options['writeConcern'] ?? null; - $this->queryStartTime = microtime(true); - - if ($session = $this->getSession()) { - $writeResult = $this->mongo->executeBulkWrite($namespace, $bulk, [ - 'session' => $session, - 'writeConcern' => is_null($writeConcern) ? new WriteConcern(1) : $writeConcern, - ]); - } else { - $writeResult = $this->mongo->executeBulkWrite($namespace, $bulk, $writeConcern); - } - - // SQL监控 - if (!empty($this->config['trigger_sql'])) { - $this->trigger(); - } - - $this->numRows = $writeResult->getMatchedCount(); - - if ($query->getOptions('cache')) { - // 清理缓存数据 - $cacheItem = $this->parseCache($query, $query->getOptions('cache')); - $key = $cacheItem->getKey(); - $tag = $cacheItem->getTag(); - - if (isset($key) && $this->cache->has($key)) { - $this->cache->delete($key); - } elseif (!empty($tag) && method_exists($this->cache, 'tag')) { - $this->cache->tag($tag)->clear(); - } - } - - return $writeResult; - } - - /** - * 执行指令 - * @access public - * @param Command $command 指令 - * @param string $dbName 当前数据库名 - * @param ReadPreference $readPreference readPreference - * @param string|array $typeMap 指定返回的typeMap - * @param bool $master 是否主库操作 - * @return array - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - */ - public function command(Command $command, string $dbName = '', ReadPreference $readPreference = null, $typeMap = null, bool $master = false): array - { - $this->initConnect($master); - $this->db->updateQueryTimes(); - - $this->queryStartTime = microtime(true); - - $dbName = $dbName ?: $this->dbName; - - if (!empty($this->queryStr)) { - $this->queryStr = 'db.' . $this->queryStr; - } - - if ($session = $this->getSession()) { - $this->cursor = $this->mongo->executeCommand($dbName, $command, [ - 'readPreference' => is_null($readPreference) ? new ReadPreference(ReadPreference::RP_PRIMARY) : $readPreference, - 'session' => $session, - ]); - } else { - $this->cursor = $this->mongo->executeCommand($dbName, $command, $readPreference); - } - - // SQL监控 - if (!empty($this->config['trigger_sql'])) { - $this->trigger('', $master); - } - - return $this->getResult($typeMap); - } - - /** - * 获得数据集 - * @access protected - * @param string|array $typeMap 指定返回的typeMap - * @return mixed - */ - protected function getResult($typeMap = null): array - { - // 设置结果数据类型 - if (is_null($typeMap)) { - $typeMap = $this->typeMap; - } - - $typeMap = is_string($typeMap) ? ['root' => $typeMap] : $typeMap; - - $this->cursor->setTypeMap($typeMap); - - // 获取数据集 - $result = $this->cursor->toArray(); - - if ($this->getConfig('pk_convert_id')) { - // 转换ObjectID 字段 - foreach ($result as &$data) { - $this->convertObjectID($data); - } - } - - $this->numRows = count($result); - - return $result; - } - - /** - * ObjectID处理 - * @access protected - * @param array $data 数据 - * @return void - */ - protected function convertObjectID(array &$data): void - { - if (isset($data['_id']) && is_object($data['_id'])) { - $data['id'] = $data['_id']->__toString(); - unset($data['_id']); - } - } - - /** - * 数据库日志记录(仅供参考) - * @access public - * @param string $type 类型 - * @param mixed $data 数据 - * @param array $options 参数 - * @return void - */ - public function mongoLog(string $type, $data, array $options = []) - { - if (!$this->config['trigger_sql']) { - return; - } - - if (is_array($data)) { - array_walk_recursive($data, function (&$value) { - if ($value instanceof ObjectID) { - $value = $value->__toString(); - } - }); - } - - switch (strtolower($type)) { - case 'aggregate': - $this->queryStr = 'runCommand(' . ($data ? json_encode($data) : '') . ');'; - break; - case 'find': - $this->queryStr = $type . '(' . ($data ? json_encode($data) : '') . ')'; - - if (isset($options['sort'])) { - $this->queryStr .= '.sort(' . json_encode($options['sort']) . ')'; - } - - if (isset($options['skip'])) { - $this->queryStr .= '.skip(' . $options['skip'] . ')'; - } - - if (isset($options['limit'])) { - $this->queryStr .= '.limit(' . $options['limit'] . ')'; - } - - $this->queryStr .= ';'; - break; - case 'insert': - case 'remove': - $this->queryStr = $type . '(' . ($data ? json_encode($data) : '') . ');'; - break; - case 'update': - $this->queryStr = $type . '(' . json_encode($options) . ',' . json_encode($data) . ');'; - break; - case 'cmd': - $this->queryStr = $data . '(' . json_encode($options) . ');'; - break; - } - - $this->options = $options; - } - - /** - * 获取最近执行的指令 - * @access public - * @return string - */ - public function getLastSql(): string - { - return $this->queryStr; - } - - /** - * 关闭数据库 - * @access public - */ - public function close() - { - $this->mongo = null; - $this->cursor = null; - $this->linkRead = null; - $this->linkWrite = null; - $this->links = []; - } - - /** - * 初始化数据库连接 - * @access protected - * @param boolean $master 是否主服务器 - * @return void - */ - protected function initConnect(bool $master = true): void - { - if (!empty($this->config['deploy'])) { - // 采用分布式数据库 - if ($master) { - if (!$this->linkWrite) { - $this->linkWrite = $this->multiConnect(true); - } - - $this->mongo = $this->linkWrite; - } else { - if (!$this->linkRead) { - $this->linkRead = $this->multiConnect(false); - } - - $this->mongo = $this->linkRead; - } - } elseif (!$this->mongo) { - // 默认单数据库 - $this->mongo = $this->connect(); - } - } - - /** - * 连接分布式服务器 - * @access protected - * @param boolean $master 主服务器 - * @return Manager - */ - protected function multiConnect(bool $master = false): Manager - { - $config = []; - // 分布式数据库配置解析 - foreach (['username', 'password', 'hostname', 'hostport', 'database', 'dsn'] as $name) { - $config[$name] = is_string($this->config[$name]) ? explode(',', $this->config[$name]) : $this->config[$name]; - } - - // 主服务器序号 - $m = floor(mt_rand(0, $this->config['master_num'] - 1)); - - if ($this->config['rw_separate']) { - // 主从式采用读写分离 - if ($master) // 主服务器写入 - { - if ($this->config['is_replica_set']) { - return $this->replicaSetConnect(); - } else { - $r = $m; - } - } elseif (is_numeric($this->config['slave_no'])) { - // 指定服务器读 - $r = $this->config['slave_no']; - } else { - // 读操作连接从服务器 每次随机连接的数据库 - $r = floor(mt_rand($this->config['master_num'], count($config['hostname']) - 1)); - } - } else { - // 读写操作不区分服务器 每次随机连接的数据库 - $r = floor(mt_rand(0, count($config['hostname']) - 1)); - } - - $dbConfig = []; - - foreach (['username', 'password', 'hostname', 'hostport', 'database', 'dsn'] as $name) { - $dbConfig[$name] = $config[$name][$r] ?? $config[$name][0]; - } - - return $this->connect($dbConfig, $r); - } - - /** - * 创建基于复制集的连接 - * @return Manager - */ - public function replicaSetConnect(): Manager - { - $this->dbName = $this->config['database']; - $this->typeMap = $this->config['type_map']; - - $startTime = microtime(true); - - $this->config['params']['replicaSet'] = $this->config['database']; - - $manager = new Manager($this->buildUrl(), $this->config['params']); - - // 记录数据库连接信息 - if (!empty($config['trigger_sql'])) { - $this->trigger('CONNECT:ReplicaSet[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $this->config['dsn']); - } - - return $manager; - } - - /** - * 根据配置信息 生成适用于连接复制集的 URL - * @return string - */ - private function buildUrl(): string - { - $url = 'mongodb://' . ($this->config['username'] ? "{$this->config['username']}" : '') . ($this->config['password'] ? ":{$this->config['password']}@" : ''); - - $hostList = is_string($this->config['hostname']) ? explode(',', $this->config['hostname']) : $this->config['hostname']; - $portList = is_string($this->config['hostport']) ? explode(',', $this->config['hostport']) : $this->config['hostport']; - - for ($i = 0; $i < count($hostList); $i++) { - $url = $url . $hostList[$i] . ':' . $portList[0] . ','; - } - - return rtrim($url, ",") . '/'; - } - - /** - * 插入记录 - * @access public - * @param BaseQuery $query 查询对象 - * @param boolean $getLastInsID 返回自增主键 - * @return mixed - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - * @throws BulkWriteException - */ - public function insert(BaseQuery $query, bool $getLastInsID = false) - { - // 分析查询表达式 - $options = $query->parseOptions(); - - if (empty($options['data'])) { - throw new Exception('miss data to insert'); - } - - // 生成bulk对象 - $bulk = $this->builder->insert($query); - - $writeResult = $this->mongoExecute($query, $bulk); - $result = $writeResult->getInsertedCount(); - - if ($result) { - $data = $options['data']; - $lastInsId = $this->getLastInsID($query); - - if ($lastInsId) { - $pk = $query->getPk(); - $data[$pk] = $lastInsId; - } - - $query->setOption('data', $data); - - $this->db->trigger('after_insert', $query); - - if ($getLastInsID) { - return $lastInsId; - } - } - - return $result; - } - - /** - * 获取最近插入的ID - * @access public - * @param BaseQuery $query 查询对象 - * @return mixed - */ - public function getLastInsID(BaseQuery $query) - { - $id = $this->builder->getLastInsID(); - - if (is_array($id)) { - array_walk($id, function (&$item, $key) { - if ($item instanceof ObjectID) { - $item = $item->__toString(); - } - }); - } elseif ($id instanceof ObjectID) { - $id = $id->__toString(); - } - - return $id; - } - - /** - * 批量插入记录 - * @access public - * @param BaseQuery $query 查询对象 - * @param array $dataSet 数据集 - * @return integer - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - * @throws BulkWriteException - */ - public function insertAll(BaseQuery $query, array $dataSet = []): int - { - // 分析查询表达式 - $query->parseOptions(); - - if (!is_array(reset($dataSet))) { - return 0; - } - - // 生成bulkWrite对象 - $bulk = $this->builder->insertAll($query, $dataSet); - - $writeResult = $this->mongoExecute($query, $bulk); - - return $writeResult->getInsertedCount(); - } - - /** - * 更新记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return int - * @throws Exception - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - * @throws BulkWriteException - */ - public function update(BaseQuery $query): int - { - $query->parseOptions(); - - // 生成bulkWrite对象 - $bulk = $this->builder->update($query); - - $writeResult = $this->mongoExecute($query, $bulk); - - $result = $writeResult->getModifiedCount(); - - if ($result) { - $this->db->trigger('after_update', $query); - } - - return $result; - } - - /** - * 删除记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return int - * @throws Exception - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - * @throws BulkWriteException - */ - public function delete(BaseQuery $query): int - { - // 分析查询表达式 - $query->parseOptions(); - - // 生成bulkWrite对象 - $bulk = $this->builder->delete($query); - - // 执行操作 - $writeResult = $this->mongoExecute($query, $bulk); - - $result = $writeResult->getDeletedCount(); - - if ($result) { - $this->db->trigger('after_delete', $query); - } - - return $result; - } - - /** - * 查找记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return array - * @throws ModelNotFoundException - * @throws DataNotFoundException - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - */ - public function select(BaseQuery $query): array - { - $resultSet = $this->db->trigger('before_select', $query); - - if (!$resultSet) { - $resultSet = $this->mongoQuery($query, function ($query) { - return $this->builder->select($query); - }); - } - - return $resultSet; - } - - /** - * 查找单条记录 - * @access public - * @param BaseQuery $query 查询对象 - * @return array - * @throws ModelNotFoundException - * @throws DataNotFoundException - * @throws AuthenticationException - * @throws InvalidArgumentException - * @throws ConnectionException - * @throws RuntimeException - */ - public function find(BaseQuery $query): array - { - // 事件回调 - $result = $this->db->trigger('before_find', $query); - - if (!$result) { - // 执行查询 - $resultSet = $this->mongoQuery($query, function ($query) { - return $this->builder->select($query, true); - }); - - $result = $resultSet[0] ?? []; - } - - return $result; - } - - /** - * 得到某个字段的值 - * @access public - * @param string $field 字段名 - * @param mixed $default 默认值 - * @return mixed - */ - public function value(BaseQuery $query, string $field, $default = null) - { - $options = $query->parseOptions(); - - if (isset($options['projection'])) { - $query->removeOption('projection'); - } - - $query->setOption('projection', (array) $field); - - if (!empty($options['cache'])) { - $cacheItem = $this->parseCache($query, $options['cache']); - $key = $cacheItem->getKey(); - - if ($this->cache->has($key)) { - return $this->cache->get($key); - } - } - - $mongoQuery = $this->builder->select($query, true); - - if (isset($options['projection'])) { - $query->setOption('projection', $options['projection']); - } else { - $query->removeOption('projection'); - } - - // 执行查询操作 - $resultSet = $this->mongoQuery($query, $mongoQuery); - - if (!empty($resultSet)) { - $data = array_shift($resultSet); - $result = $data[$field]; - } else { - $result = false; - } - - if (isset($cacheItem) && false !== $result) { - // 缓存数据 - $cacheItem->set($result); - $this->cacheData($cacheItem); - } - - return false !== $result ? $result : $default; - } - - /** - * 得到某个列的数组 - * @access public - * @param BaseQuery $query - * @param string|array $field 字段名 多个字段用逗号分隔 - * @param string $key 索引 - * @return array - */ - public function column(BaseQuery $query, $field, string $key = ''): array - { - $options = $query->parseOptions(); - - if (isset($options['projection'])) { - $query->removeOption('projection'); - } - - if (is_array($field)) { - $field = implode(',', $field); - } - if ($key && '*' != $field) { - $projection = $key . ',' . $field; - } else { - $projection = $field; - } - - $query->field($projection); - - if (!empty($options['cache'])) { - // 判断查询缓存 - $cacheItem = $this->parseCache($query, $options['cache']); - $key = $cacheItem->getKey(); - - if ($this->cache->has($key)) { - return $this->cache->get($key); - } - } - - $mongoQuery = $this->builder->select($query); - - if (isset($options['projection'])) { - $query->setOption('projection', $options['projection']); - } else { - $query->removeOption('projection'); - } - - // 执行查询操作 - $resultSet = $this->mongoQuery($query, $mongoQuery); - - if (('*' == $field || strpos($field, ',')) && $key) { - $result = array_column($resultSet, null, $key); - } elseif (!empty($resultSet)) { - $result = array_column($resultSet, $field, $key); - } else { - $result = []; - } - - if (isset($cacheItem)) { - // 缓存数据 - $cacheItem->set($result); - $this->cacheData($cacheItem); - } - - return $result; - } - - /** - * 执行command - * @access public - * @param BaseQuery $query 查询对象 - * @param string|array|object $command 指令 - * @param mixed $extra 额外参数 - * @param string $db 数据库名 - * @return array - */ - public function cmd(BaseQuery $query, $command, $extra = null, string $db = ''): array - { - if (is_array($command) || is_object($command)) { - - $this->mongoLog('cmd', 'cmd', $command); - - // 直接创建Command对象 - $command = new Command($command); - } else { - // 调用Builder封装的Command对象 - $command = $this->builder->$command($query, $extra); - } - - return $this->command($command, $db); - } - - /** - * 获取数据库字段 - * @access public - * @param mixed $tableName 数据表名 - * @return array - */ - public function getTableFields($tableName): array - { - return []; - } - - /** - * 执行数据库事务 - * @access public - * @param callable $callback 数据操作方法回调 - * @return mixed - * @throws PDOException - * @throws \Exception - * @throws \Throwable - */ - public function transaction(callable $callback) - { - $this->startTrans(); - try { - $result = null; - if (is_callable($callback)) { - $result = call_user_func_array($callback, [$this]); - } - $this->commit(); - return $result; - } catch (\Exception $e) { - $this->rollback(); - throw $e; - } catch (\Throwable $e) { - $this->rollback(); - throw $e; - } - } - - /** - * 启动事务 - * @access public - * @return void - * @throws \PDOException - * @throws \Exception - */ - public function startTrans() - { - $this->initConnect(true); - $this->session_uuid = uniqid(); - $this->sessions[$this->session_uuid] = $this->getMongo()->startSession(); - - $this->sessions[$this->session_uuid]->startTransaction([]); - } - - /** - * 用于非自动提交状态下面的查询提交 - * @access public - * @return void - * @throws PDOException - */ - public function commit() - { - if ($session = $this->getSession()) { - $session->commitTransaction(); - $this->setLastSession(); - } - } - - /** - * 事务回滚 - * @access public - * @return void - * @throws PDOException - */ - public function rollback() - { - if ($session = $this->getSession()) { - $session->abortTransaction(); - $this->setLastSession(); - } - } - - /** - * 结束当前会话,设置上一个会话为当前会话 - * @author klinson - */ - protected function setLastSession() - { - if ($session = $this->getSession()) { - $session->endSession(); - unset($this->sessions[$this->session_uuid]); - if (empty($this->sessions)) { - $this->session_uuid = null; - } else { - end($this->sessions); - $this->session_uuid = key($this->sessions); - } - } - } - - /** - * 获取当前会话 - * @return \MongoDB\Driver\Session|null - * @author klinson - */ - public function getSession() - { - return ($this->session_uuid && isset($this->sessions[$this->session_uuid])) - ? $this->sessions[$this->session_uuid] - : null; - } -} diff --git a/vendor/topthink/think-orm/src/db/connector/Mysql.php b/vendor/topthink/think-orm/src/db/connector/Mysql.php deleted file mode 100644 index 483b447..0000000 --- a/vendor/topthink/think-orm/src/db/connector/Mysql.php +++ /dev/null @@ -1,162 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\connector; - -use PDO; -use think\db\PDOConnection; - -/** - * mysql数据库驱动 - */ -class Mysql extends PDOConnection -{ - - /** - * 解析pdo连接的dsn信息 - * @access protected - * @param array $config 连接信息 - * @return string - */ - protected function parseDsn(array $config): string - { - if (!empty($config['socket'])) { - $dsn = 'mysql:unix_socket=' . $config['socket']; - } elseif (!empty($config['hostport'])) { - $dsn = 'mysql:host=' . $config['hostname'] . ';port=' . $config['hostport']; - } else { - $dsn = 'mysql:host=' . $config['hostname']; - } - $dsn .= ';dbname=' . $config['database']; - - if (!empty($config['charset'])) { - $dsn .= ';charset=' . $config['charset']; - } - - return $dsn; - } - - /** - * 取得数据表的字段信息 - * @access public - * @param string $tableName - * @return array - */ - public function getFields(string $tableName): array - { - [$tableName] = explode(' ', $tableName); - - if (false === strpos($tableName, '`')) { - if (strpos($tableName, '.')) { - $tableName = str_replace('.', '`.`', $tableName); - } - $tableName = '`' . $tableName . '`'; - } - - $sql = 'SHOW FULL COLUMNS FROM ' . $tableName; - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - if (!empty($result)) { - foreach ($result as $key => $val) { - $val = array_change_key_case($val); - - $info[$val['field']] = [ - 'name' => $val['field'], - 'type' => $val['type'], - 'notnull' => 'NO' == $val['null'], - 'default' => $val['default'], - 'primary' => strtolower($val['key']) == 'pri', - 'autoinc' => strtolower($val['extra']) == 'auto_increment', - 'comment' => $val['comment'], - ]; - } - } - - return $this->fieldCase($info); - } - - /** - * 取得数据库的表信息 - * @access public - * @param string $dbName - * @return array - */ - public function getTables(string $dbName = ''): array - { - $sql = !empty($dbName) ? 'SHOW TABLES FROM ' . $dbName : 'SHOW TABLES '; - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - foreach ($result as $key => $val) { - $info[$key] = current($val); - } - - return $info; - } - - protected function supportSavepoint(): bool - { - return true; - } - - /** - * 启动XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function startTransXa(string $xid) - { - $this->initConnect(true); - $this->linkID->exec("XA START '$xid'"); - } - - /** - * 预编译XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function prepareXa(string $xid) - { - $this->initConnect(true); - $this->linkID->exec("XA END '$xid'"); - $this->linkID->exec("XA PREPARE '$xid'"); - } - - /** - * 提交XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function commitXa(string $xid) - { - $this->initConnect(true); - $this->linkID->exec("XA COMMIT '$xid'"); - } - - /** - * 回滚XA事务 - * @access public - * @param string $xid XA事务id - * @return void - */ - public function rollbackXa(string $xid) - { - $this->initConnect(true); - $this->linkID->exec("XA ROLLBACK '$xid'"); - } -} diff --git a/vendor/topthink/think-orm/src/db/connector/Oracle.php b/vendor/topthink/think-orm/src/db/connector/Oracle.php deleted file mode 100644 index 236d8bf..0000000 --- a/vendor/topthink/think-orm/src/db/connector/Oracle.php +++ /dev/null @@ -1,117 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\db\connector; - -use PDO; -use think\db\BaseQuery; -use think\db\PDOConnection; - -/** - * Oracle数据库驱动 - */ -class Oracle extends PDOConnection -{ - /** - * 解析pdo连接的dsn信息 - * @access protected - * @param array $config 连接信息 - * @return string - */ - protected function parseDsn(array $config): string - { - $dsn = 'oci:dbname='; - - if (!empty($config['hostname'])) { - // Oracle Instant Client - $dsn .= '//' . $config['hostname'] . ($config['hostport'] ? ':' . $config['hostport'] : '') . '/'; - } - - $dsn .= $config['database']; - - if (!empty($config['charset'])) { - $dsn .= ';charset=' . $config['charset']; - } - - return $dsn; - } - - /** - * 取得数据表的字段信息 - * @access public - * @param string $tableName - * @return array - */ - public function getFields(string $tableName): array - { - [$tableName] = explode(' ', $tableName); - $sql = "select a.column_name,data_type,DECODE (nullable, 'Y', 0, 1) notnull,data_default, DECODE (A .column_name,b.column_name,1,0) pk from all_tab_columns a,(select column_name from all_constraints c, all_cons_columns col where c.constraint_name = col.constraint_name and c.constraint_type = 'P' and c.table_name = '" . strtoupper($tableName) . "' ) b where table_name = '" . strtoupper($tableName) . "' and a.column_name = b.column_name (+)"; - - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - if ($result) { - foreach ($result as $key => $val) { - $val = array_change_key_case($val); - - $info[$val['column_name']] = [ - 'name' => $val['column_name'], - 'type' => $val['data_type'], - 'notnull' => $val['notnull'], - 'default' => $val['data_default'], - 'primary' => $val['pk'], - 'autoinc' => $val['pk'], - ]; - } - } - - return $this->fieldCase($info); - } - - /** - * 取得数据库的表信息(暂时实现取得用户表信息) - * @access public - * @param string $dbName - * @return array - */ - public function getTables(string $dbName = ''): array - { - $sql = 'select table_name from all_tables'; - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - foreach ($result as $key => $val) { - $info[$key] = current($val); - } - - return $info; - } - - /** - * 获取最近插入的ID - * @access public - * @param BaseQuery $query 查询对象 - * @param string $sequence 自增序列名 - * @return mixed - */ - public function getLastInsID(BaseQuery $query, string $sequence = null) - { - $pdo = $this->linkID->query("select {$sequence}.currval as id from dual"); - $result = $pdo->fetchColumn(); - - return $result; - } - - protected function supportSavepoint(): bool - { - return true; - } -} diff --git a/vendor/topthink/think-orm/src/db/connector/Pgsql.php b/vendor/topthink/think-orm/src/db/connector/Pgsql.php deleted file mode 100644 index fec8f84..0000000 --- a/vendor/topthink/think-orm/src/db/connector/Pgsql.php +++ /dev/null @@ -1,108 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\db\connector; - -use PDO; -use think\db\PDOConnection; - -/** - * Pgsql数据库驱动 - */ -class Pgsql extends PDOConnection -{ - - /** - * 默认PDO连接参数 - * @var array - */ - protected $params = [ - PDO::ATTR_CASE => PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - ]; - - /** - * 解析pdo连接的dsn信息 - * @access protected - * @param array $config 连接信息 - * @return string - */ - protected function parseDsn(array $config): string - { - $dsn = 'pgsql:dbname=' . $config['database'] . ';host=' . $config['hostname']; - - if (!empty($config['hostport'])) { - $dsn .= ';port=' . $config['hostport']; - } - - return $dsn; - } - - /** - * 取得数据表的字段信息 - * @access public - * @param string $tableName - * @return array - */ - public function getFields(string $tableName): array - { - [$tableName] = explode(' ', $tableName); - $sql = 'select fields_name as "field",fields_type as "type",fields_not_null as "null",fields_key_name as "key",fields_default as "default",fields_default as "extra" from table_msg(\'' . $tableName . '\');'; - - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - if (!empty($result)) { - foreach ($result as $key => $val) { - $val = array_change_key_case($val); - - $info[$val['field']] = [ - 'name' => $val['field'], - 'type' => $val['type'], - 'notnull' => (bool) ('' !== $val['null']), - 'default' => $val['default'], - 'primary' => !empty($val['key']), - 'autoinc' => (0 === strpos($val['extra'], 'nextval(')), - ]; - } - } - - return $this->fieldCase($info); - } - - /** - * 取得数据库的表信息 - * @access public - * @param string $dbName - * @return array - */ - public function getTables(string $dbName = ''): array - { - $sql = "select tablename as Tables_in_test from pg_tables where schemaname ='public'"; - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - foreach ($result as $key => $val) { - $info[$key] = current($val); - } - - return $info; - } - - protected function supportSavepoint(): bool - { - return true; - } -} diff --git a/vendor/topthink/think-orm/src/db/connector/Sqlite.php b/vendor/topthink/think-orm/src/db/connector/Sqlite.php deleted file mode 100644 index c664f20..0000000 --- a/vendor/topthink/think-orm/src/db/connector/Sqlite.php +++ /dev/null @@ -1,96 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\db\connector; - -use PDO; -use think\db\PDOConnection; - -/** - * Sqlite数据库驱动 - */ -class Sqlite extends PDOConnection -{ - - /** - * 解析pdo连接的dsn信息 - * @access protected - * @param array $config 连接信息 - * @return string - */ - protected function parseDsn(array $config): string - { - $dsn = 'sqlite:' . $config['database']; - - return $dsn; - } - - /** - * 取得数据表的字段信息 - * @access public - * @param string $tableName - * @return array - */ - public function getFields(string $tableName): array - { - [$tableName] = explode(' ', $tableName); - $sql = 'PRAGMA table_info( ' . $tableName . ' )'; - - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - if (!empty($result)) { - foreach ($result as $key => $val) { - $val = array_change_key_case($val); - - $info[$val['name']] = [ - 'name' => $val['name'], - 'type' => $val['type'], - 'notnull' => 1 === $val['notnull'], - 'default' => $val['dflt_value'], - 'primary' => '1' == $val['pk'], - 'autoinc' => '1' == $val['pk'], - ]; - } - } - - return $this->fieldCase($info); - } - - /** - * 取得数据库的表信息 - * @access public - * @param string $dbName - * @return array - */ - public function getTables(string $dbName = ''): array - { - $sql = "SELECT name FROM sqlite_master WHERE type='table' " - . "UNION ALL SELECT name FROM sqlite_temp_master " - . "WHERE type='table' ORDER BY name"; - - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - foreach ($result as $key => $val) { - $info[$key] = current($val); - } - - return $info; - } - - protected function supportSavepoint(): bool - { - return true; - } -} diff --git a/vendor/topthink/think-orm/src/db/connector/Sqlsrv.php b/vendor/topthink/think-orm/src/db/connector/Sqlsrv.php deleted file mode 100644 index 10d944f..0000000 --- a/vendor/topthink/think-orm/src/db/connector/Sqlsrv.php +++ /dev/null @@ -1,122 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\db\connector; - -use PDO; -use think\db\PDOConnection; - -/** - * Sqlsrv数据库驱动 - */ -class Sqlsrv extends PDOConnection -{ - /** - * 默认PDO连接参数 - * @var array - */ - protected $params = [ - PDO::ATTR_CASE => PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - ]; - - /** - * 解析pdo连接的dsn信息 - * @access protected - * @param array $config 连接信息 - * @return string - */ - protected function parseDsn(array $config): string - { - $dsn = 'sqlsrv:Database=' . $config['database'] . ';Server=' . $config['hostname']; - - if (!empty($config['hostport'])) { - $dsn .= ',' . $config['hostport']; - } - - return $dsn; - } - - /** - * 取得数据表的字段信息 - * @access public - * @param string $tableName - * @return array - */ - public function getFields(string $tableName): array - { - [$tableName] = explode(' ', $tableName); - strpos($tableName,'.') && $tableName = substr($tableName,strpos($tableName,'.') + 1); - $sql = "SELECT column_name, data_type, column_default, is_nullable - FROM information_schema.tables AS t - JOIN information_schema.columns AS c - ON t.table_catalog = c.table_catalog - AND t.table_schema = c.table_schema - AND t.table_name = c.table_name - WHERE t.table_name = '$tableName'"; - - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - if (!empty($result)) { - foreach ($result as $key => $val) { - $val = array_change_key_case($val); - - $info[$val['column_name']] = [ - 'name' => $val['column_name'], - 'type' => $val['data_type'], - 'notnull' => (bool) ('' === $val['is_nullable']), // not null is empty, null is yes - 'default' => $val['column_default'], - 'primary' => false, - 'autoinc' => false, - ]; - } - } - - $sql = "SELECT column_name FROM information_schema.key_column_usage WHERE table_name='$tableName'"; - $pdo = $this->linkID->query($sql); - $result = $pdo->fetch(PDO::FETCH_ASSOC); - - if ($result) { - $info[$result['column_name']]['primary'] = true; - } - - return $this->fieldCase($info); - } - - /** - * 取得数据表的字段信息 - * @access public - * @param string $dbName - * @return array - */ - public function getTables(string $dbName = ''): array - { - $sql = "SELECT TABLE_NAME - FROM INFORMATION_SCHEMA.TABLES - WHERE TABLE_TYPE = 'BASE TABLE' - "; - - $pdo = $this->getPDOStatement($sql); - $result = $pdo->fetchAll(PDO::FETCH_ASSOC); - $info = []; - - foreach ($result as $key => $val) { - $info[$key] = current($val); - } - - return $info; - } - -} diff --git a/vendor/topthink/think-orm/src/db/connector/pgsql.sql b/vendor/topthink/think-orm/src/db/connector/pgsql.sql deleted file mode 100644 index e1a09a3..0000000 --- a/vendor/topthink/think-orm/src/db/connector/pgsql.sql +++ /dev/null @@ -1,117 +0,0 @@ -CREATE OR REPLACE FUNCTION pgsql_type(a_type varchar) RETURNS varchar AS -$BODY$ -DECLARE - v_type varchar; -BEGIN - IF a_type='int8' THEN - v_type:='bigint'; - ELSIF a_type='int4' THEN - v_type:='integer'; - ELSIF a_type='int2' THEN - v_type:='smallint'; - ELSIF a_type='bpchar' THEN - v_type:='char'; - ELSE - v_type:=a_type; - END IF; - RETURN v_type; -END; -$BODY$ -LANGUAGE PLPGSQL; - -CREATE TYPE "public"."tablestruct" AS ( - "fields_key_name" varchar(100), - "fields_name" VARCHAR(200), - "fields_type" VARCHAR(20), - "fields_length" BIGINT, - "fields_not_null" VARCHAR(10), - "fields_default" VARCHAR(500), - "fields_comment" VARCHAR(1000) -); - -CREATE OR REPLACE FUNCTION "public"."table_msg" (a_schema_name varchar, a_table_name varchar) RETURNS SETOF "public"."tablestruct" AS -$body$ -DECLARE - v_ret tablestruct; - v_oid oid; - v_sql varchar; - v_rec RECORD; - v_key varchar; -BEGIN - SELECT - pg_class.oid INTO v_oid - FROM - pg_class - INNER JOIN pg_namespace ON (pg_class.relnamespace = pg_namespace.oid AND lower(pg_namespace.nspname) = a_schema_name) - WHERE - pg_class.relname=a_table_name; - IF NOT FOUND THEN - RETURN; - END IF; - - v_sql=' - SELECT - pg_attribute.attname AS fields_name, - pg_attribute.attnum AS fields_index, - pgsql_type(pg_type.typname::varchar) AS fields_type, - pg_attribute.atttypmod-4 as fields_length, - CASE WHEN pg_attribute.attnotnull THEN ''not null'' - ELSE '''' - END AS fields_not_null, - pg_attrdef.adsrc AS fields_default, - pg_description.description AS fields_comment - FROM - pg_attribute - INNER JOIN pg_class ON pg_attribute.attrelid = pg_class.oid - INNER JOIN pg_type ON pg_attribute.atttypid = pg_type.oid - LEFT OUTER JOIN pg_attrdef ON pg_attrdef.adrelid = pg_class.oid AND pg_attrdef.adnum = pg_attribute.attnum - LEFT OUTER JOIN pg_description ON pg_description.objoid = pg_class.oid AND pg_description.objsubid = pg_attribute.attnum - WHERE - pg_attribute.attnum > 0 - AND attisdropped <> ''t'' - AND pg_class.oid = ' || v_oid || ' - ORDER BY pg_attribute.attnum' ; - - FOR v_rec IN EXECUTE v_sql LOOP - v_ret.fields_name=v_rec.fields_name; - v_ret.fields_type=v_rec.fields_type; - IF v_rec.fields_length > 0 THEN - v_ret.fields_length:=v_rec.fields_length; - ELSE - v_ret.fields_length:=NULL; - END IF; - v_ret.fields_not_null=v_rec.fields_not_null; - v_ret.fields_default=v_rec.fields_default; - v_ret.fields_comment=v_rec.fields_comment; - SELECT constraint_name INTO v_key FROM information_schema.key_column_usage WHERE table_schema=a_schema_name AND table_name=a_table_name AND column_name=v_rec.fields_name; - IF FOUND THEN - v_ret.fields_key_name=v_key; - ELSE - v_ret.fields_key_name=''; - END IF; - RETURN NEXT v_ret; - END LOOP; - RETURN ; -END; -$body$ -LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; - -COMMENT ON FUNCTION "public"."table_msg"(a_schema_name varchar, a_table_name varchar) -IS '获得表信息'; - ----重载一个函数 -CREATE OR REPLACE FUNCTION "public"."table_msg" (a_table_name varchar) RETURNS SETOF "public"."tablestruct" AS -$body$ -DECLARE - v_ret tablestruct; -BEGIN - FOR v_ret IN SELECT * FROM table_msg('public',a_table_name) LOOP - RETURN NEXT v_ret; - END LOOP; - RETURN; -END; -$body$ -LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; - -COMMENT ON FUNCTION "public"."table_msg"(a_table_name varchar) -IS '获得表信息'; \ No newline at end of file diff --git a/vendor/topthink/think-orm/src/db/exception/BindParamException.php b/vendor/topthink/think-orm/src/db/exception/BindParamException.php deleted file mode 100644 index 08bb388..0000000 --- a/vendor/topthink/think-orm/src/db/exception/BindParamException.php +++ /dev/null @@ -1,35 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\exception; - -/** - * PDO参数绑定异常 - */ -class BindParamException extends DbException -{ - - /** - * BindParamException constructor. - * @access public - * @param string $message - * @param array $config - * @param string $sql - * @param array $bind - * @param int $code - */ - public function __construct(string $message, array $config, string $sql, array $bind, int $code = 10502) - { - $this->setData('Bind Param', $bind); - parent::__construct($message, $config, $sql, $code); - } -} diff --git a/vendor/topthink/think-orm/src/db/exception/DataNotFoundException.php b/vendor/topthink/think-orm/src/db/exception/DataNotFoundException.php deleted file mode 100644 index d10dd43..0000000 --- a/vendor/topthink/think-orm/src/db/exception/DataNotFoundException.php +++ /dev/null @@ -1,43 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\exception; - -class DataNotFoundException extends DbException -{ - protected $table; - - /** - * DbException constructor. - * @access public - * @param string $message - * @param string $table - * @param array $config - */ - public function __construct(string $message, string $table = '', array $config = []) - { - $this->message = $message; - $this->table = $table; - - $this->setData('Database Config', $config); - } - - /** - * 获取数据表名 - * @access public - * @return string - */ - public function getTable() - { - return $this->table; - } -} diff --git a/vendor/topthink/think-orm/src/db/exception/DbException.php b/vendor/topthink/think-orm/src/db/exception/DbException.php deleted file mode 100644 index f68b21c..0000000 --- a/vendor/topthink/think-orm/src/db/exception/DbException.php +++ /dev/null @@ -1,44 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\exception; - -use think\Exception; - -/** - * Database相关异常处理类 - */ -class DbException extends Exception -{ - /** - * DbException constructor. - * @access public - * @param string $message - * @param array $config - * @param string $sql - * @param int $code - */ - public function __construct(string $message, array $config = [], string $sql = '', int $code = 10500) - { - $this->message = $message; - $this->code = $code; - - $this->setData('Database Status', [ - 'Error Code' => $code, - 'Error Message' => $message, - 'Error SQL' => $sql, - ]); - - unset($config['username'], $config['password']); - $this->setData('Database Config', $config); - } -} diff --git a/vendor/topthink/think-orm/src/db/exception/InvalidArgumentException.php b/vendor/topthink/think-orm/src/db/exception/InvalidArgumentException.php deleted file mode 100644 index 047e45e..0000000 --- a/vendor/topthink/think-orm/src/db/exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); -namespace think\db\exception; - -use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInvalidArgumentInterface; - -/** - * 非法数据异常 - */ -class InvalidArgumentException extends \InvalidArgumentException implements SimpleCacheInvalidArgumentInterface -{ -} diff --git a/vendor/topthink/think-orm/src/db/exception/ModelEventException.php b/vendor/topthink/think-orm/src/db/exception/ModelEventException.php deleted file mode 100644 index 767bc1a..0000000 --- a/vendor/topthink/think-orm/src/db/exception/ModelEventException.php +++ /dev/null @@ -1,19 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\db\exception; - -/** - * 模型事件异常 - */ -class ModelEventException extends DbException -{ -} diff --git a/vendor/topthink/think-orm/src/db/exception/ModelNotFoundException.php b/vendor/topthink/think-orm/src/db/exception/ModelNotFoundException.php deleted file mode 100644 index 84a1525..0000000 --- a/vendor/topthink/think-orm/src/db/exception/ModelNotFoundException.php +++ /dev/null @@ -1,44 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\exception; - -class ModelNotFoundException extends DbException -{ - protected $model; - - /** - * 构造方法 - * @access public - * @param string $message - * @param string $model - * @param array $config - */ - public function __construct(string $message, string $model = '', array $config = []) - { - $this->message = $message; - $this->model = $model; - - $this->setData('Database Config', $config); - } - - /** - * 获取模型类名 - * @access public - * @return string - */ - public function getModel() - { - return $this->model; - } - -} diff --git a/vendor/topthink/think-orm/src/db/exception/PDOException.php b/vendor/topthink/think-orm/src/db/exception/PDOException.php deleted file mode 100644 index efe78b9..0000000 --- a/vendor/topthink/think-orm/src/db/exception/PDOException.php +++ /dev/null @@ -1,44 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\db\exception; - -/** - * PDO异常处理类 - * 重新封装了系统的\PDOException类 - */ -class PDOException extends DbException -{ - /** - * PDOException constructor. - * @access public - * @param \PDOException $exception - * @param array $config - * @param string $sql - * @param int $code - */ - public function __construct(\PDOException $exception, array $config = [], string $sql = '', int $code = 10501) - { - $error = $exception->errorInfo; - $message = $exception->getMessage(); - - if (!empty($error)) { - $this->setData('PDO Error Info', [ - 'SQLSTATE' => $error[0], - 'Driver Error Code' => isset($error[1]) ? $error[1] : 0, - 'Driver Error Message' => isset($error[2]) ? $error[2] : '', - ]); - } - - parent::__construct($message, $config, $sql, $code); - } -} diff --git a/vendor/topthink/think-orm/src/facade/Db.php b/vendor/topthink/think-orm/src/facade/Db.php deleted file mode 100644 index b0296c6..0000000 --- a/vendor/topthink/think-orm/src/facade/Db.php +++ /dev/null @@ -1,31 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\facade; - -use think\Facade; - -/** - * @see \think\DbManager - * @mixin \think\DbManager - */ -class Db extends Facade -{ - /** - * 获取当前Facade对应类名(或者已经绑定的容器对象标识) - * @access protected - * @return string - */ - protected static function getFacadeClass() - { - return 'think\DbManager'; - } -} diff --git a/vendor/topthink/think-orm/src/model/Collection.php b/vendor/topthink/think-orm/src/model/Collection.php deleted file mode 100644 index f017e32..0000000 --- a/vendor/topthink/think-orm/src/model/Collection.php +++ /dev/null @@ -1,265 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model; - -use think\Collection as BaseCollection; -use think\Model; -use think\Paginator; - -/** - * 模型数据集类 - */ -class Collection extends BaseCollection -{ - /** - * 延迟预载入关联查询 - * @access public - * @param array|string $relation 关联 - * @param mixed $cache 关联缓存 - * @return $this - */ - public function load($relation, $cache = false) - { - if (!$this->isEmpty()) { - $item = current($this->items); - $item->eagerlyResultSet($this->items, (array) $relation, [], false, $cache); - } - - return $this; - } - - /** - * 删除数据集的数据 - * @access public - * @return bool - */ - public function delete(): bool - { - $this->each(function (Model $model) { - $model->delete(); - }); - - return true; - } - - /** - * 更新数据 - * @access public - * @param array $data 数据数组 - * @param array $allowField 允许字段 - * @return bool - */ - public function update(array $data, array $allowField = []): bool - { - $this->each(function (Model $model) use ($data, $allowField) { - if (!empty($allowField)) { - $model->allowField($allowField); - } - - $model->save($data); - }); - - return true; - } - - /** - * 设置需要隐藏的输出属性 - * @access public - * @param array $hidden 属性列表 - * @return $this - */ - public function hidden(array $hidden) - { - $this->each(function (Model $model) use ($hidden) { - $model->hidden($hidden); - }); - - return $this; - } - - /** - * 设置需要输出的属性 - * @access public - * @param array $visible - * @return $this - */ - public function visible(array $visible) - { - $this->each(function (Model $model) use ($visible) { - $model->visible($visible); - }); - - return $this; - } - - /** - * 设置需要追加的输出属性 - * @access public - * @param array $append 属性列表 - * @return $this - */ - public function append(array $append) - { - $this->each(function (Model $model) use ($append) { - $model->append($append); - }); - - return $this; - } - - /** - * 设置模型输出场景 - * @access public - * @param string $scene 场景名称 - * @return $this - */ - public function scene(string $scene) - { - $this->each(function (Model $model) use ($scene) { - $model->scene($scene); - }); - - return $this; - } - - /** - * 设置父模型 - * @access public - * @param Model $parent 父模型 - * @return $this - */ - public function setParent(Model $parent) - { - $this->each(function (Model $model) use ($parent) { - $model->setParent($parent); - }); - - return $this; - } - - /** - * 设置数据字段获取器 - * @access public - * @param string|array $name 字段名 - * @param callable $callback 闭包获取器 - * @return $this - */ - public function withAttr($name, $callback = null) - { - $this->each(function (Model $model) use ($name, $callback) { - $model->withAttribute($name, $callback); - }); - - return $this; - } - - /** - * 绑定(一对一)关联属性到当前模型 - * @access protected - * @param string $relation 关联名称 - * @param array $attrs 绑定属性 - * @return $this - * @throws Exception - */ - public function bindAttr(string $relation, array $attrs = []) - { - $this->each(function (Model $model) use ($relation, $attrs) { - $model->bindAttr($relation, $attrs); - }); - - return $this; - } - - /** - * 按指定键整理数据 - * - * @access public - * @param mixed $items 数据 - * @param string $indexKey 键名 - * @return array - */ - public function dictionary($items = null, string &$indexKey = null) - { - if ($items instanceof self || $items instanceof Paginator) { - $items = $items->all(); - } - - $items = is_null($items) ? $this->items : $items; - - if ($items && empty($indexKey)) { - $indexKey = $items[0]->getPk(); - } - - if (isset($indexKey) && is_string($indexKey)) { - return array_column($items, null, $indexKey); - } - - return $items; - } - - /** - * 比较数据集,返回差集 - * - * @access public - * @param mixed $items 数据 - * @param string $indexKey 指定比较的键名 - * @return static - */ - public function diff($items, string $indexKey = null) - { - if ($this->isEmpty()) { - return new static($items); - } - - $diff = []; - $dictionary = $this->dictionary($items, $indexKey); - - if (is_string($indexKey)) { - foreach ($this->items as $item) { - if (!isset($dictionary[$item[$indexKey]])) { - $diff[] = $item; - } - } - } - - return new static($diff); - } - - /** - * 比较数据集,返回交集 - * - * @access public - * @param mixed $items 数据 - * @param string $indexKey 指定比较的键名 - * @return static - */ - public function intersect($items, string $indexKey = null) - { - if ($this->isEmpty()) { - return new static([]); - } - - $intersect = []; - $dictionary = $this->dictionary($items, $indexKey); - - if (is_string($indexKey)) { - foreach ($this->items as $item) { - if (isset($dictionary[$item[$indexKey]])) { - $intersect[] = $item; - } - } - } - - return new static($intersect); - } -} diff --git a/vendor/topthink/think-orm/src/model/Pivot.php b/vendor/topthink/think-orm/src/model/Pivot.php deleted file mode 100644 index 893c01b..0000000 --- a/vendor/topthink/think-orm/src/model/Pivot.php +++ /dev/null @@ -1,53 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model; - -use think\Model; - -/** - * 多对多中间表模型类 - */ -class Pivot extends Model -{ - - /** - * 父模型 - * @var Model - */ - public $parent; - - /** - * 是否时间自动写入 - * @var bool - */ - protected $autoWriteTimestamp = false; - - /** - * 架构函数 - * @access public - * @param array $data 数据 - * @param Model $parent 上级模型 - * @param string $table 中间数据表名 - */ - public function __construct(array $data = [], Model $parent = null, string $table = '') - { - $this->parent = $parent; - - if (is_null($this->name)) { - $this->name = $table; - } - - parent::__construct($data); - } - -} diff --git a/vendor/topthink/think-orm/src/model/Relation.php b/vendor/topthink/think-orm/src/model/Relation.php deleted file mode 100644 index e823bd9..0000000 --- a/vendor/topthink/think-orm/src/model/Relation.php +++ /dev/null @@ -1,278 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model; - -use Closure; -use ReflectionFunction; -use think\db\BaseQuery as Query; -use think\db\exception\DbException as Exception; -use think\Model; - -/** - * 模型关联基础类 - * @package think\model - * @mixin Query - */ -abstract class Relation -{ - /** - * 父模型对象 - * @var Model - */ - protected $parent; - - /** - * 当前关联的模型类名 - * @var string - */ - protected $model; - - /** - * 关联模型查询对象 - * @var Query - */ - protected $query; - - /** - * 关联表外键 - * @var string - */ - protected $foreignKey; - - /** - * 关联表主键 - * @var string - */ - protected $localKey; - - /** - * 是否执行关联基础查询 - * @var bool - */ - protected $baseQuery; - - /** - * 是否为自关联 - * @var bool - */ - protected $selfRelation = false; - - /** - * 关联数据数量限制 - * @var int - */ - protected $withLimit; - - /** - * 关联数据字段限制 - * @var array - */ - protected $withField; - - /** - * 获取关联的所属模型 - * @access public - * @return Model - */ - public function getParent(): Model - { - return $this->parent; - } - - /** - * 获取当前的关联模型类的Query实例 - * @access public - * @return Query - */ - public function getQuery() - { - return $this->query; - } - - /** - * 获取关联表外键 - * @access public - * @return string - */ - public function getForeignKey() - { - return $this->foreignKey; - } - - /** - * 获取关联表主键 - * @access public - * @return string - */ - public function getLocalKey() - { - return $this->localKey; - } - - /** - * 获取当前的关联模型类的实例 - * @access public - * @return Model - */ - public function getModel(): Model - { - return $this->query->getModel(); - } - - /** - * 当前关联是否为自关联 - * @access public - * @return bool - */ - public function isSelfRelation(): bool - { - return $this->selfRelation; - } - - /** - * 封装关联数据集 - * @access public - * @param array $resultSet 数据集 - * @param Model $parent 父模型 - * @return mixed - */ - protected function resultSetBuild(array $resultSet, Model $parent = null) - { - return (new $this->model)->toCollection($resultSet)->setParent($parent); - } - - protected function getQueryFields(string $model) - { - $fields = $this->query->getOptions('field'); - return $this->getRelationQueryFields($fields, $model); - } - - protected function getRelationQueryFields($fields, string $model) - { - if (empty($fields) || '*' == $fields) { - return $model . '.*'; - } - - if (is_string($fields)) { - $fields = explode(',', $fields); - } - - foreach ($fields as &$field) { - if (false === strpos($field, '.')) { - $field = $model . '.' . $field; - } - } - - return $fields; - } - - protected function getQueryWhere(array &$where, string $relation): void - { - foreach ($where as $key => &$val) { - if (is_string($key)) { - $where[] = [false === strpos($key, '.') ? $relation . '.' . $key : $key, '=', $val]; - unset($where[$key]); - } elseif (isset($val[0]) && false === strpos($val[0], '.')) { - $val[0] = $relation . '.' . $val[0]; - } - } - } - - /** - * 更新数据 - * @access public - * @param array $data 更新数据 - * @return integer - */ - public function update(array $data = []): int - { - return $this->query->update($data); - } - - /** - * 删除记录 - * @access public - * @param mixed $data 表达式 true 表示强制删除 - * @return int - * @throws Exception - * @throws PDOException - */ - public function delete($data = null): int - { - return $this->query->delete($data); - } - - /** - * 限制关联数据的数量 - * @access public - * @param int $limit 关联数量限制 - * @return $this - */ - public function withLimit(int $limit) - { - $this->withLimit = $limit; - return $this; - } - - /** - * 限制关联数据的字段 - * @access public - * @param array $field 关联字段限制 - * @return $this - */ - public function withField(array $field) - { - $this->withField = $field; - return $this; - } - - /** - * 判断闭包的参数类型 - * @access protected - * @return mixed - */ - protected function getClosureType(Closure $closure) - { - $reflect = new ReflectionFunction($closure); - $params = $reflect->getParameters(); - - if (!empty($params)) { - $type = $params[0]->getType(); - return is_null($type) || Relation::class == $type->getName() ? $this : $this->query; - } - - return $this; - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - {} - - public function __call($method, $args) - { - if ($this->query) { - // 执行基础查询 - $this->baseQuery(); - - $result = call_user_func_array([$this->query, $method], $args); - - return $result === $this->query ? $this : $result; - } - - throw new Exception('method not exists:' . __CLASS__ . '->' . $method); - } -} diff --git a/vendor/topthink/think-orm/src/model/concern/Attribute.php b/vendor/topthink/think-orm/src/model/concern/Attribute.php deleted file mode 100644 index 737e29d..0000000 --- a/vendor/topthink/think-orm/src/model/concern/Attribute.php +++ /dev/null @@ -1,692 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\concern; - -use InvalidArgumentException; -use think\db\Raw; -use think\helper\Str; -use think\model\Relation; - -/** - * 模型数据处理 - */ -trait Attribute -{ - /** - * 数据表主键 复合主键使用数组定义 - * @var string|array - */ - protected $pk = 'id'; - - /** - * 数据表字段信息 留空则自动获取 - * @var array - */ - protected $schema = []; - - /** - * 当前允许写入的字段 - * @var array - */ - protected $field = []; - - /** - * 字段自动类型转换 - * @var array - */ - protected $type = []; - - /** - * 数据表废弃字段 - * @var array - */ - protected $disuse = []; - - /** - * 数据表只读字段 - * @var array - */ - protected $readonly = []; - - /** - * 当前模型数据 - * @var array - */ - private $data = []; - - /** - * 原始数据 - * @var array - */ - private $origin = []; - - /** - * JSON数据表字段 - * @var array - */ - protected $json = []; - - /** - * JSON数据表字段类型 - * @var array - */ - protected $jsonType = []; - - /** - * JSON数据取出是否需要转换为数组 - * @var bool - */ - protected $jsonAssoc = false; - - /** - * 是否严格字段大小写 - * @var bool - */ - protected $strict = true; - - /** - * 获取器数据 - * @var array - */ - private $get = []; - - /** - * 修改器执行记录 - * @var array - */ - private $set = []; - - /** - * 动态获取器 - * @var array - */ - private $withAttr = []; - - /** - * 获取模型对象的主键 - * @access public - * @return string|array - */ - public function getPk() - { - return $this->pk; - } - - /** - * 判断一个字段名是否为主键字段 - * @access public - * @param string $key 名称 - * @return bool - */ - protected function isPk(string $key): bool - { - $pk = $this->getPk(); - - if (is_string($pk) && $pk == $key) { - return true; - } elseif (is_array($pk) && in_array($key, $pk)) { - return true; - } - - return false; - } - - /** - * 获取模型对象的主键值 - * @access public - * @return mixed - */ - public function getKey() - { - $pk = $this->getPk(); - - if (is_string($pk) && array_key_exists($pk, $this->data)) { - return $this->data[$pk]; - } - - return; - } - - /** - * 设置允许写入的字段 - * @access public - * @param array $field 允许写入的字段 - * @return $this - */ - public function allowField(array $field) - { - $this->field = $field; - - return $this; - } - - /** - * 设置只读字段 - * @access public - * @param array $field 只读字段 - * @return $this - */ - public function readOnly(array $field) - { - $this->readonly = $field; - - return $this; - } - - /** - * 获取实际的字段名 - * @access protected - * @param string $name 字段名 - * @return string - */ - protected function getRealFieldName(string $name): string - { - if ($this->convertNameToCamel || !$this->strict) { - return Str::snake($name); - } - - return $name; - } - - /** - * 设置数据对象值 - * @access public - * @param array $data 数据 - * @param bool $set 是否调用修改器 - * @param array $allow 允许的字段名 - * @return $this - */ - public function data(array $data, bool $set = false, array $allow = []) - { - // 清空数据 - $this->data = []; - - // 废弃字段 - foreach ($this->disuse as $key) { - if (array_key_exists($key, $data)) { - unset($data[$key]); - } - } - - if (!empty($allow)) { - $result = []; - foreach ($allow as $name) { - if (isset($data[$name])) { - $result[$name] = $data[$name]; - } - } - $data = $result; - } - - if ($set) { - // 数据对象赋值 - $this->setAttrs($data); - } else { - $this->data = $data; - } - - return $this; - } - - /** - * 批量追加数据对象值 - * @access public - * @param array $data 数据 - * @param bool $set 是否需要进行数据处理 - * @return $this - */ - public function appendData(array $data, bool $set = false) - { - if ($set) { - $this->setAttrs($data); - } else { - $this->data = array_merge($this->data, $data); - } - - return $this; - } - - /** - * 获取对象原始数据 如果不存在指定字段返回null - * @access public - * @param string $name 字段名 留空获取全部 - * @return mixed - */ - public function getOrigin(string $name = null) - { - if (is_null($name)) { - return $this->origin; - } - - $fieldName = $this->getRealFieldName($name); - - return array_key_exists($fieldName, $this->origin) ? $this->origin[$fieldName] : null; - } - - /** - * 获取当前对象数据 如果不存在指定字段返回false - * @access public - * @param string $name 字段名 留空获取全部 - * @return mixed - * @throws InvalidArgumentException - */ - public function getData(string $name = null) - { - if (is_null($name)) { - return $this->data; - } - - $fieldName = $this->getRealFieldName($name); - - if (array_key_exists($fieldName, $this->data)) { - return $this->data[$fieldName]; - } elseif (array_key_exists($fieldName, $this->relation)) { - return $this->relation[$fieldName]; - } - - throw new InvalidArgumentException('property not exists:' . static::class . '->' . $name); - } - - /** - * 获取变化的数据 并排除只读数据 - * @access public - * @return array - */ - public function getChangedData(): array - { - $data = $this->force ? $this->data : array_udiff_assoc($this->data, $this->origin, function ($a, $b) { - if ((empty($a) || empty($b)) && $a !== $b) { - return 1; - } - - return is_object($a) || $a != $b ? 1 : 0; - }); - - // 只读字段不允许更新 - foreach ($this->readonly as $key => $field) { - if (array_key_exists($field, $data)) { - unset($data[$field]); - } - } - - return $data; - } - - /** - * 直接设置数据对象值 - * @access public - * @param string $name 属性名 - * @param mixed $value 值 - * @return void - */ - public function set(string $name, $value): void - { - $name = $this->getRealFieldName($name); - - $this->data[$name] = $value; - unset($this->get[$name]); - } - - /** - * 通过修改器 批量设置数据对象值 - * @access public - * @param array $data 数据 - * @return void - */ - public function setAttrs(array $data): void - { - // 进行数据处理 - foreach ($data as $key => $value) { - $this->setAttr($key, $value, $data); - } - } - - /** - * 通过修改器 设置数据对象值 - * @access public - * @param string $name 属性名 - * @param mixed $value 属性值 - * @param array $data 数据 - * @return void - */ - public function setAttr(string $name, $value, array $data = []): void - { - $name = $this->getRealFieldName($name); - - if (isset($this->set[$name])) { - return; - } - - // 检测修改器 - $method = 'set' . Str::studly($name) . 'Attr'; - - if (method_exists($this, $method)) { - $array = $this->data; - - $value = $this->$method($value, array_merge($this->data, $data)); - - $this->set[$name] = true; - if (is_null($value) && $array !== $this->data) { - return; - } - } - - // 设置数据对象属性 - $this->data[$name] = $value; - unset($this->get[$name]); - } - - /** - * 数据写入 类型转换 - * @access protected - * @param mixed $value 值 - * @param string|array $type 要转换的类型 - * @return mixed - */ - protected function writeTransform($value, $type) - { - if (is_null($value)) { - return; - } - - if ($value instanceof Raw) { - return $value; - } - - if (is_array($type)) { - [$type, $param] = $type; - } elseif (strpos($type, ':')) { - [$type, $param] = explode(':', $type, 2); - } - - switch ($type) { - case 'integer': - $value = (int) $value; - break; - case 'float': - if (empty($param)) { - $value = (float) $value; - } else { - $value = (float) number_format($value, (int) $param, '.', ''); - } - break; - case 'boolean': - $value = (bool) $value; - break; - case 'timestamp': - if (!is_numeric($value)) { - $value = strtotime($value); - } - break; - case 'datetime': - $value = is_numeric($value) ? $value : strtotime($value); - $value = $this->formatDateTime('Y-m-d H:i:s.u', $value, true); - break; - case 'object': - if (is_object($value)) { - $value = json_encode($value, JSON_FORCE_OBJECT); - } - break; - case 'array': - $value = (array) $value; - case 'json': - $option = !empty($param) ? (int) $param : JSON_UNESCAPED_UNICODE; - $value = json_encode($value, $option); - break; - case 'serialize': - $value = serialize($value); - break; - default: - if (is_object($value) && false !== strpos($type, '\\') && method_exists($value, '__toString')) { - // 对象类型 - $value = $value->__toString(); - } - } - - return $value; - } - - /** - * 获取器 获取数据对象的值 - * @access public - * @param string $name 名称 - * @return mixed - * @throws InvalidArgumentException - */ - public function getAttr(string $name) - { - try { - $relation = false; - $value = $this->getData($name); - } catch (InvalidArgumentException $e) { - $relation = $this->isRelationAttr($name); - $value = null; - } - - return $this->getValue($name, $value, $relation); - } - - /** - * 获取经过获取器处理后的数据对象的值 - * @access protected - * @param string $name 字段名称 - * @param mixed $value 字段值 - * @param bool|string $relation 是否为关联属性或者关联名 - * @return mixed - * @throws InvalidArgumentException - */ - protected function getValue(string $name, $value, $relation = false) - { - // 检测属性获取器 - $fieldName = $this->getRealFieldName($name); - - if (array_key_exists($fieldName, $this->get)) { - return $this->get[$fieldName]; - } - - $method = 'get' . Str::studly($name) . 'Attr'; - if (isset($this->withAttr[$fieldName])) { - if ($relation) { - $value = $this->getRelationValue($relation); - } - - if (in_array($fieldName, $this->json) && is_array($this->withAttr[$fieldName])) { - $value = $this->getJsonValue($fieldName, $value); - } else { - $closure = $this->withAttr[$fieldName]; - $value = $closure($value, $this->data); - } - } elseif (method_exists($this, $method)) { - if ($relation) { - $value = $this->getRelationValue($relation); - } - - $value = $this->$method($value, $this->data); - } elseif ($relation) { - $value = $this->getRelationValue($relation); - // 保存关联对象值 - $this->relation[$name] = $value; - } - - $this->get[$fieldName] = $value; - - return $value; - } - - /** - * 读取数据类型处理 - * @access protected - * @return void - */ - protected function readDataType(): void - { - foreach ($this->data as $key => $value) { - if (isset($this->type[$key])) { - $this->get[$key] = $this->readTransform($value, $this->type[$key]); - } elseif ($this->autoWriteTimestamp && in_array($key, [$this->createTime, $this->updateTime])) { - $this->get[$key] = $this->getTimestampValue($value); - } - } - } - - /** - * 写入数据类型处理 - * @access protected - * @param array $data 数据 - * @return array - */ - protected function writeDataType(array $data): array - { - foreach ($data as $name => &$value) { - if (isset($this->type[$name])) { - // 类型转换 - $value = $this->writeTransform($value, $this->type[$name]); - } - } - - return $data; - } - - /** - * 获取JSON字段属性值 - * @access protected - * @param string $name 属性名 - * @param mixed $value JSON数据 - * @return mixed - */ - protected function getJsonValue($name, $value) - { - foreach ($this->withAttr[$name] as $key => $closure) { - if ($this->jsonAssoc) { - $value[$key] = $closure($value[$key], $value); - } else { - $value->$key = $closure($value->$key, $value); - } - } - - return $value; - } - - /** - * 获取关联属性值 - * @access protected - * @param string $relation 关联名 - * @return mixed - */ - protected function getRelationValue(string $relation) - { - $modelRelation = $this->$relation(); - - return $modelRelation instanceof Relation ? $this->getRelationData($modelRelation) : null; - } - - /** - * 数据读取 类型转换 - * @access protected - * @param mixed $value 值 - * @param string|array $type 要转换的类型 - * @return mixed - */ - protected function readTransform($value, $type) - { - if (is_null($value)) { - return; - } - - if (is_array($type)) { - [$type, $param] = $type; - } elseif (strpos($type, ':')) { - [$type, $param] = explode(':', $type, 2); - } - - switch ($type) { - case 'integer': - $value = (int) $value; - break; - case 'float': - if (empty($param)) { - $value = (float) $value; - } else { - $value = (float) number_format($value, (int) $param, '.', ''); - } - break; - case 'boolean': - $value = (bool) $value; - break; - case 'timestamp': - if (!is_null($value)) { - $format = !empty($param) ? $param : $this->dateFormat; - $value = $this->formatDateTime($format, $value, true); - } - break; - case 'datetime': - if (!is_null($value)) { - $format = !empty($param) ? $param : $this->dateFormat; - $value = $this->formatDateTime($format, $value); - } - break; - case 'json': - $value = json_decode($value, true); - break; - case 'array': - $value = empty($value) ? [] : json_decode($value, true); - break; - case 'object': - $value = empty($value) ? new \stdClass() : json_decode($value); - break; - case 'serialize': - try { - $value = unserialize($value); - } catch (\Exception $e) { - $value = null; - } - break; - default: - if (false !== strpos($type, '\\')) { - // 对象类型 - $value = new $type($value); - } - } - - return $value; - } - - /** - * 设置数据字段获取器 - * @access public - * @param string|array $name 字段名 - * @param callable $callback 闭包获取器 - * @return $this - */ - public function withAttribute($name, callable $callback = null) - { - if (is_array($name)) { - foreach ($name as $key => $val) { - $this->withAttribute($key, $val); - } - } else { - $name = $this->getRealFieldName($name); - - if (strpos($name, '.')) { - [$name, $key] = explode('.', $name); - - $this->withAttr[$name][$key] = $callback; - } else { - $this->withAttr[$name] = $callback; - } - } - - return $this; - } - -} diff --git a/vendor/topthink/think-orm/src/model/concern/Conversion.php b/vendor/topthink/think-orm/src/model/concern/Conversion.php deleted file mode 100644 index 35d96d0..0000000 --- a/vendor/topthink/think-orm/src/model/concern/Conversion.php +++ /dev/null @@ -1,358 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\concern; - -use think\Collection; -use think\db\exception\DbException as Exception; -use think\helper\Str; -use think\Model; -use think\model\Collection as ModelCollection; -use think\model\relation\OneToOne; - -/** - * 模型数据转换处理 - */ -trait Conversion -{ - /** - * 数据输出显示的属性 - * @var array - */ - protected $visible = []; - - /** - * 数据输出隐藏的属性 - * @var array - */ - protected $hidden = []; - - /** - * 数据输出需要追加的属性 - * @var array - */ - protected $append = []; - - /** - * 场景 - * @var array - */ - protected $scene = []; - - /** - * 数据输出字段映射 - * @var array - */ - protected $mapping = []; - - /** - * 数据集对象名 - * @var string - */ - protected $resultSetType; - - /** - * 数据命名是否自动转为驼峰 - * @var bool - */ - protected $convertNameToCamel; - - /** - * 转换数据为驼峰命名(用于输出) - * @access public - * @param bool $toCamel 是否自动驼峰命名 - * @return $this - */ - public function convertNameToCamel(bool $toCamel = true) - { - $this->convertNameToCamel = $toCamel; - return $this; - } - - /** - * 设置需要附加的输出属性 - * @access public - * @param array $append 属性列表 - * @return $this - */ - public function append(array $append = []) - { - $this->append = $append; - - return $this; - } - - /** - * 设置输出层场景 - * @access public - * @param string $scene 场景名称 - * @return $this - */ - public function scene(string $scene) - { - if (isset($this->scene[$scene])) { - $data = $this->scene[$scene]; - foreach (['append', 'hidden', 'visible'] as $name) { - if (isset($data[$name])) { - $this->$name($data[$name]); - } - } - } - - return $this; - } - - /** - * 设置附加关联对象的属性 - * @access public - * @param string $attr 关联属性 - * @param string|array $append 追加属性名 - * @return $this - * @throws Exception - */ - public function appendRelationAttr(string $attr, array $append) - { - $relation = Str::camel($attr); - - if (isset($this->relation[$relation])) { - $model = $this->relation[$relation]; - } else { - $model = $this->getRelationData($this->$relation()); - } - - if ($model instanceof Model) { - foreach ($append as $key => $attr) { - $key = is_numeric($key) ? $attr : $key; - if (isset($this->data[$key])) { - throw new Exception('bind attr has exists:' . $key); - } - - $this->data[$key] = $model->$attr; - } - } - - return $this; - } - - /** - * 设置需要隐藏的输出属性 - * @access public - * @param array $hidden 属性列表 - * @return $this - */ - public function hidden(array $hidden = []) - { - $this->hidden = $hidden; - - return $this; - } - - /** - * 设置需要输出的属性 - * @access public - * @param array $visible - * @return $this - */ - public function visible(array $visible = []) - { - $this->visible = $visible; - - return $this; - } - - /** - * 设置属性的映射输出 - * @access public - * @param array $map - * @return $this - */ - public function mapping(array $map) - { - $this->mapping = $map; - - return $this; - } - - /** - * 转换当前模型对象为数组 - * @access public - * @return array - */ - public function toArray(): array - { - $item = []; - $hasVisible = false; - - foreach ($this->visible as $key => $val) { - if (is_string($val)) { - if (strpos($val, '.')) { - [$relation, $name] = explode('.', $val); - $this->visible[$relation][] = $name; - } else { - $this->visible[$val] = true; - $hasVisible = true; - } - unset($this->visible[$key]); - } - } - - foreach ($this->hidden as $key => $val) { - if (is_string($val)) { - if (strpos($val, '.')) { - [$relation, $name] = explode('.', $val); - $this->hidden[$relation][] = $name; - } else { - $this->hidden[$val] = true; - } - unset($this->hidden[$key]); - } - } - - // 合并关联数据 - $data = array_merge($this->data, $this->relation); - - foreach ($data as $key => $val) { - if ($val instanceof Model || $val instanceof ModelCollection) { - // 关联模型对象 - if (isset($this->visible[$key]) && is_array($this->visible[$key])) { - $val->visible($this->visible[$key]); - } elseif (isset($this->hidden[$key]) && is_array($this->hidden[$key])) { - $val->hidden($this->hidden[$key]); - } - // 关联模型对象 - if (!isset($this->hidden[$key]) || true !== $this->hidden[$key]) { - $item[$key] = $val->toArray(); - } - } elseif (isset($this->visible[$key])) { - $item[$key] = $this->getAttr($key); - } elseif (!isset($this->hidden[$key]) && !$hasVisible) { - $item[$key] = $this->getAttr($key); - } - - if (isset($this->mapping[$key])) { - // 检查字段映射 - $mapName = $this->mapping[$key]; - $item[$mapName] = $item[$key]; - unset($item[$key]); - } - } - - // 追加属性(必须定义获取器) - foreach ($this->append as $key => $name) { - $this->appendAttrToArray($item, $key, $name); - } - - if ($this->convertNameToCamel) { - foreach ($item as $key => $val) { - $name = Str::camel($key); - if ($name !== $key) { - $item[$name] = $val; - unset($item[$key]); - } - } - } - - return $item; - } - - protected function appendAttrToArray(array &$item, $key, $name) - { - if (is_array($name)) { - // 追加关联对象属性 - $relation = $this->getRelation($key, true); - $item[$key] = $relation ? $relation->append($name) - ->toArray() : []; - } elseif (strpos($name, '.')) { - [$key, $attr] = explode('.', $name); - // 追加关联对象属性 - $relation = $this->getRelation($key, true); - $item[$key] = $relation ? $relation->append([$attr]) - ->toArray() : []; - } else { - $value = $this->getAttr($name); - $item[$name] = $value; - - $this->getBindAttrValue($name, $value, $item); - } - } - - protected function getBindAttrValue(string $name, $value, array &$item = []) - { - $relation = $this->isRelationAttr($name); - if (!$relation) { - return false; - } - - $modelRelation = $this->$relation(); - - if ($modelRelation instanceof OneToOne) { - $bindAttr = $modelRelation->getBindAttr(); - - if (!empty($bindAttr)) { - unset($item[$name]); - } - - foreach ($bindAttr as $key => $attr) { - $key = is_numeric($key) ? $attr : $key; - - if (isset($item[$key])) { - throw new Exception('bind attr has exists:' . $key); - } - - $item[$key] = $value ? $value->getAttr($attr) : null; - } - } - } - - /** - * 转换当前模型对象为JSON字符串 - * @access public - * @param integer $options json参数 - * @return string - */ - public function toJson(int $options = JSON_UNESCAPED_UNICODE): string - { - return json_encode($this->toArray(), $options); - } - - public function __toString() - { - return $this->toJson(); - } - - // JsonSerializable - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * 转换数据集为数据集对象 - * @access public - * @param array|Collection $collection 数据集 - * @param string $resultSetType 数据集类 - * @return Collection - */ - public function toCollection(iterable $collection = [], string $resultSetType = null): Collection - { - $resultSetType = $resultSetType ?: $this->resultSetType; - - if ($resultSetType && false !== strpos($resultSetType, '\\')) { - $collection = new $resultSetType($collection); - } else { - $collection = new ModelCollection($collection); - } - - return $collection; - } - -} diff --git a/vendor/topthink/think-orm/src/model/concern/ModelEvent.php b/vendor/topthink/think-orm/src/model/concern/ModelEvent.php deleted file mode 100644 index f560379..0000000 --- a/vendor/topthink/think-orm/src/model/concern/ModelEvent.php +++ /dev/null @@ -1,88 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\concern; - -use think\db\exception\ModelEventException; -use think\helper\Str; - -/** - * 模型事件处理 - */ -trait ModelEvent -{ - - /** - * Event对象 - * @var object - */ - protected static $event; - - /** - * 是否需要事件响应 - * @var bool - */ - protected $withEvent = true; - - /** - * 设置Event对象 - * @access public - * @param object $event Event对象 - * @return void - */ - public static function setEvent($event) - { - self::$event = $event; - } - - /** - * 当前操作的事件响应 - * @access protected - * @param bool $event 是否需要事件响应 - * @return $this - */ - public function withEvent(bool $event) - { - $this->withEvent = $event; - return $this; - } - - /** - * 触发事件 - * @access protected - * @param string $event 事件名 - * @return bool - */ - protected function trigger(string $event): bool - { - if (!$this->withEvent) { - return true; - } - - $call = 'on' . Str::studly($event); - - try { - if (method_exists(static::class, $call)) { - $result = call_user_func([static::class, $call], $this); - } elseif (is_object(self::$event) && method_exists(self::$event, 'trigger')) { - $result = self::$event->trigger(static::class . '.' . $event, $this); - $result = empty($result) ? true : end($result); - } else { - $result = true; - } - - return false === $result ? false : true; - } catch (ModelEventException $e) { - return false; - } - } -} diff --git a/vendor/topthink/think-orm/src/model/concern/OptimLock.php b/vendor/topthink/think-orm/src/model/concern/OptimLock.php deleted file mode 100644 index 5e61318..0000000 --- a/vendor/topthink/think-orm/src/model/concern/OptimLock.php +++ /dev/null @@ -1,85 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\concern; - -use think\db\exception\DbException as Exception; - -/** - * 乐观锁 - */ -trait OptimLock -{ - protected function getOptimLockField() - { - return property_exists($this, 'optimLock') && isset($this->optimLock) ? $this->optimLock : 'lock_version'; - } - - /** - * 数据检查 - * @access protected - * @return void - */ - protected function checkData(): void - { - $this->isExists() ? $this->updateLockVersion() : $this->recordLockVersion(); - } - - /** - * 记录乐观锁 - * @access protected - * @return void - */ - protected function recordLockVersion(): void - { - $optimLock = $this->getOptimLockField(); - - if ($optimLock) { - $this->set($optimLock, 0); - } - } - - /** - * 更新乐观锁 - * @access protected - * @return void - */ - protected function updateLockVersion(): void - { - $optimLock = $this->getOptimLockField(); - - if ($optimLock && $lockVer = $this->getOrigin($optimLock)) { - // 更新乐观锁 - $this->set($optimLock, $lockVer + 1); - } - } - - public function getWhere() - { - $where = parent::getWhere(); - $optimLock = $this->getOptimLockField(); - - if ($optimLock && $lockVer = $this->getOrigin($optimLock)) { - $where[] = [$optimLock, '=', $lockVer]; - } - - return $where; - } - - protected function checkResult($result): void - { - if (!$result) { - throw new Exception('record has update'); - } - } - -} diff --git a/vendor/topthink/think-orm/src/model/concern/RelationShip.php b/vendor/topthink/think-orm/src/model/concern/RelationShip.php deleted file mode 100644 index f3da1c4..0000000 --- a/vendor/topthink/think-orm/src/model/concern/RelationShip.php +++ /dev/null @@ -1,841 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\concern; - -use Closure; -use think\Collection; -use think\db\BaseQuery as Query; -use think\db\exception\DbException as Exception; -use think\helper\Str; -use think\Model; -use think\model\Relation; -use think\model\relation\BelongsTo; -use think\model\relation\BelongsToMany; -use think\model\relation\HasMany; -use think\model\relation\HasManyThrough; -use think\model\relation\HasOne; -use think\model\relation\HasOneThrough; -use think\model\relation\MorphMany; -use think\model\relation\MorphOne; -use think\model\relation\MorphTo; -use think\model\relation\MorphToMany; -use think\model\relation\OneToOne; - -/** - * 模型关联处理 - */ -trait RelationShip -{ - /** - * 父关联模型对象 - * @var object - */ - private $parent; - - /** - * 模型关联数据 - * @var array - */ - private $relation = []; - - /** - * 关联写入定义信息 - * @var array - */ - private $together = []; - - /** - * 关联自动写入信息 - * @var array - */ - protected $relationWrite = []; - - /** - * 设置父关联对象 - * @access public - * @param Model $model 模型对象 - * @return $this - */ - public function setParent(Model $model) - { - $this->parent = $model; - - return $this; - } - - /** - * 获取父关联对象 - * @access public - * @return Model - */ - public function getParent(): Model - { - return $this->parent; - } - - /** - * 获取当前模型的关联模型数据 - * @access public - * @param string $name 关联方法名 - * @param bool $auto 不存在是否自动获取 - * @return mixed - */ - public function getRelation(string $name = null, bool $auto = false) - { - if (is_null($name)) { - return $this->relation; - } - - if (array_key_exists($name, $this->relation)) { - return $this->relation[$name]; - } elseif ($auto) { - $relation = Str::camel($name); - return $this->getRelationValue($relation); - } - } - - /** - * 设置关联数据对象值 - * @access public - * @param string $name 属性名 - * @param mixed $value 属性值 - * @param array $data 数据 - * @return $this - */ - public function setRelation(string $name, $value, array $data = []) - { - // 检测修改器 - $method = 'set' . Str::studly($name) . 'Attr'; - - if (method_exists($this, $method)) { - $value = $this->$method($value, array_merge($this->data, $data)); - } - - $this->relation[$this->getRealFieldName($name)] = $value; - - return $this; - } - - /** - * 查询当前模型的关联数据 - * @access public - * @param array $relations 关联名 - * @param array $withRelationAttr 关联获取器 - * @return void - */ - public function relationQuery(array $relations, array $withRelationAttr = []): void - { - foreach ($relations as $key => $relation) { - $subRelation = ''; - $closure = null; - - if ($relation instanceof Closure) { - // 支持闭包查询过滤关联条件 - $closure = $relation; - $relation = $key; - } - - if (is_array($relation)) { - $subRelation = $relation; - $relation = $key; - } elseif (strpos($relation, '.')) { - [$relation, $subRelation] = explode('.', $relation, 2); - } - - $method = Str::camel($relation); - $relationName = Str::snake($relation); - - $relationResult = $this->$method(); - - if (isset($withRelationAttr[$relationName])) { - $relationResult->withAttr($withRelationAttr[$relationName]); - } - - $this->relation[$relation] = $relationResult->getRelation($subRelation, $closure); - } - } - - /** - * 关联数据写入 - * @access public - * @param array $relation 关联 - * @return $this - */ - public function together(array $relation) - { - $this->together = $relation; - - $this->checkAutoRelationWrite(); - - return $this; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $relation 关联方法名 - * @param mixed $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public static function has(string $relation, string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null): Query - { - return (new static()) - ->$relation() - ->has($operator, $count, $id, $joinType, $query); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $relation 关联方法名 - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public static function hasWhere(string $relation, $where = [], string $fields = '*', string $joinType = '', Query $query = null): Query - { - return (new static()) - ->$relation() - ->hasWhere($where, $fields, $joinType, $query); - } - - /** - * 预载入关联查询 JOIN方式 - * @access public - * @param Query $query Query对象 - * @param string $relation 关联方法名 - * @param mixed $field 字段 - * @param string $joinType JOIN类型 - * @param Closure $closure 闭包 - * @param bool $first - * @return bool - */ - public function eagerly(Query $query, string $relation, $field, string $joinType = '', Closure $closure = null, bool $first = false): bool - { - $relation = Str::camel($relation); - $class = $this->$relation(); - - if ($class instanceof OneToOne) { - $class->eagerly($query, $relation, $field, $joinType, $closure, $first); - return true; - } else { - return false; - } - } - - /** - * 预载入关联查询 返回数据集 - * @access public - * @param array $resultSet 数据集 - * @param string $relation 关联名 - * @param array $withRelationAttr 关联获取器 - * @param bool $join 是否为JOIN方式 - * @param mixed $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, array $relations, array $withRelationAttr = [], bool $join = false, $cache = false): void - { - foreach ($relations as $key => $relation) { - $subRelation = []; - $closure = null; - - if ($relation instanceof Closure) { - $closure = $relation; - $relation = $key; - } - - if (is_array($relation)) { - $subRelation = $relation; - $relation = $key; - } elseif (strpos($relation, '.')) { - [$relation, $subRelation] = explode('.', $relation, 2); - - $subRelation = [$subRelation]; - } - - $relationName = $relation; - $relation = Str::camel($relation); - - $relationResult = $this->$relation(); - - if (isset($withRelationAttr[$relationName])) { - $relationResult->withAttr($withRelationAttr[$relationName]); - } - - if (is_scalar($cache)) { - $relationCache = [$cache]; - } else { - $relationCache = $cache[$relationName] ?? $cache; - } - - $relationResult->eagerlyResultSet($resultSet, $relationName, $subRelation, $closure, $relationCache, $join); - } - } - - /** - * 预载入关联查询 返回模型对象 - * @access public - * @param Model $result 数据对象 - * @param array $relations 关联 - * @param array $withRelationAttr 关联获取器 - * @param bool $join 是否为JOIN方式 - * @param mixed $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, array $relations, array $withRelationAttr = [], bool $join = false, $cache = false): void - { - foreach ($relations as $key => $relation) { - $subRelation = []; - $closure = null; - - if ($relation instanceof Closure) { - $closure = $relation; - $relation = $key; - } - - if (is_array($relation)) { - $subRelation = $relation; - $relation = $key; - } elseif (strpos($relation, '.')) { - [$relation, $subRelation] = explode('.', $relation, 2); - - $subRelation = [$subRelation]; - } - - $relationName = $relation; - $relation = Str::camel($relation); - - $relationResult = $this->$relation(); - - if (isset($withRelationAttr[$relationName])) { - $relationResult->withAttr($withRelationAttr[$relationName]); - } - - if (is_scalar($cache)) { - $relationCache = [$cache]; - } else { - $relationCache = $cache[$relationName] ?? []; - } - - $relationResult->eagerlyResult($result, $relationName, $subRelation, $closure, $relationCache, $join); - } - } - - /** - * 绑定(一对一)关联属性到当前模型 - * @access protected - * @param string $relation 关联名称 - * @param array $attrs 绑定属性 - * @return $this - * @throws Exception - */ - public function bindAttr(string $relation, array $attrs = []) - { - $relation = $this->getRelation($relation); - - foreach ($attrs as $key => $attr) { - $key = is_numeric($key) ? $attr : $key; - $value = $this->getOrigin($key); - - if (!is_null($value)) { - throw new Exception('bind attr has exists:' . $key); - } - - $this->set($key, $relation ? $relation->$attr : null); - } - - return $this; - } - - /** - * 关联统计 - * @access public - * @param Query $query 查询对象 - * @param array $relations 关联名 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param bool $useSubQuery 子查询 - * @return void - */ - public function relationCount(Query $query, array $relations, string $aggregate = 'sum', string $field = '*', bool $useSubQuery = true): void - { - foreach ($relations as $key => $relation) { - $closure = $name = null; - - if ($relation instanceof Closure) { - $closure = $relation; - $relation = $key; - } elseif (is_string($key)) { - $name = $relation; - $relation = $key; - } - - $relation = Str::camel($relation); - - if ($useSubQuery) { - $count = $this->$relation()->getRelationCountQuery($closure, $aggregate, $field, $name); - } else { - $count = $this->$relation()->relationCount($this, $closure, $aggregate, $field, $name); - } - - if (empty($name)) { - $name = Str::snake($relation) . '_' . $aggregate; - } - - if ($useSubQuery) { - $query->field(['(' . $count . ')' => $name]); - } else { - $this->setAttr($name, $count); - } - } - } - - /** - * HAS ONE 关联定义 - * @access public - * @param string $model 模型名 - * @param string $foreignKey 关联外键 - * @param string $localKey 当前主键 - * @return HasOne - */ - public function hasOne(string $model, string $foreignKey = '', string $localKey = ''): HasOne - { - // 记录当前关联信息 - $model = $this->parseModel($model); - $localKey = $localKey ?: $this->getPk(); - $foreignKey = $foreignKey ?: $this->getForeignKey($this->name); - - return new HasOne($this, $model, $foreignKey, $localKey); - } - - /** - * BELONGS TO 关联定义 - * @access public - * @param string $model 模型名 - * @param string $foreignKey 关联外键 - * @param string $localKey 关联主键 - * @return BelongsTo - */ - public function belongsTo(string $model, string $foreignKey = '', string $localKey = ''): BelongsTo - { - // 记录当前关联信息 - $model = $this->parseModel($model); - $foreignKey = $foreignKey ?: $this->getForeignKey((new $model)->getName()); - $localKey = $localKey ?: (new $model)->getPk(); - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); - $relation = Str::snake($trace[1]['function']); - - return new BelongsTo($this, $model, $foreignKey, $localKey, $relation); - } - - /** - * HAS MANY 关联定义 - * @access public - * @param string $model 模型名 - * @param string $foreignKey 关联外键 - * @param string $localKey 当前主键 - * @return HasMany - */ - public function hasMany(string $model, string $foreignKey = '', string $localKey = ''): HasMany - { - // 记录当前关联信息 - $model = $this->parseModel($model); - $localKey = $localKey ?: $this->getPk(); - $foreignKey = $foreignKey ?: $this->getForeignKey($this->name); - - return new HasMany($this, $model, $foreignKey, $localKey); - } - - /** - * HAS MANY 远程关联定义 - * @access public - * @param string $model 模型名 - * @param string $through 中间模型名 - * @param string $foreignKey 关联外键 - * @param string $throughKey 关联外键 - * @param string $localKey 当前主键 - * @param string $throughPk 中间表主键 - * @return HasManyThrough - */ - public function hasManyThrough(string $model, string $through, string $foreignKey = '', string $throughKey = '', string $localKey = '', string $throughPk = ''): HasManyThrough - { - // 记录当前关联信息 - $model = $this->parseModel($model); - $through = $this->parseModel($through); - $localKey = $localKey ?: $this->getPk(); - $foreignKey = $foreignKey ?: $this->getForeignKey($this->name); - $throughKey = $throughKey ?: $this->getForeignKey((new $through)->getName()); - $throughPk = $throughPk ?: (new $through)->getPk(); - - return new HasManyThrough($this, $model, $through, $foreignKey, $throughKey, $localKey, $throughPk); - } - - /** - * HAS ONE 远程关联定义 - * @access public - * @param string $model 模型名 - * @param string $through 中间模型名 - * @param string $foreignKey 关联外键 - * @param string $throughKey 关联外键 - * @param string $localKey 当前主键 - * @param string $throughPk 中间表主键 - * @return HasOneThrough - */ - public function hasOneThrough(string $model, string $through, string $foreignKey = '', string $throughKey = '', string $localKey = '', string $throughPk = ''): HasOneThrough - { - // 记录当前关联信息 - $model = $this->parseModel($model); - $through = $this->parseModel($through); - $localKey = $localKey ?: $this->getPk(); - $foreignKey = $foreignKey ?: $this->getForeignKey($this->name); - $throughKey = $throughKey ?: $this->getForeignKey((new $through)->getName()); - $throughPk = $throughPk ?: (new $through)->getPk(); - - return new HasOneThrough($this, $model, $through, $foreignKey, $throughKey, $localKey, $throughPk); - } - - /** - * BELONGS TO MANY 关联定义 - * @access public - * @param string $model 模型名 - * @param string $middle 中间表/模型名 - * @param string $foreignKey 关联外键 - * @param string $localKey 当前模型关联键 - * @return BelongsToMany - */ - public function belongsToMany(string $model, string $middle = '', string $foreignKey = '', string $localKey = ''): BelongsToMany - { - // 记录当前关联信息 - $model = $this->parseModel($model); - $name = Str::snake(class_basename($model)); - $middle = $middle ?: Str::snake($this->name) . '_' . $name; - $foreignKey = $foreignKey ?: $name . '_id'; - $localKey = $localKey ?: $this->getForeignKey($this->name); - - return new BelongsToMany($this, $model, $middle, $foreignKey, $localKey); - } - - /** - * MORPH One 关联定义 - * @access public - * @param string $model 模型名 - * @param string|array $morph 多态字段信息 - * @param string $type 多态类型 - * @return MorphOne - */ - public function morphOne(string $model, $morph = null, string $type = ''): MorphOne - { - // 记录当前关联信息 - $model = $this->parseModel($model); - - if (is_null($morph)) { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); - $morph = Str::snake($trace[1]['function']); - } - - if (is_array($morph)) { - [$morphType, $foreignKey] = $morph; - } else { - $morphType = $morph . '_type'; - $foreignKey = $morph . '_id'; - } - - $type = $type ?: get_class($this); - - return new MorphOne($this, $model, $foreignKey, $morphType, $type); - } - - /** - * MORPH MANY 关联定义 - * @access public - * @param string $model 模型名 - * @param string|array $morph 多态字段信息 - * @param string $type 多态类型 - * @return MorphMany - */ - public function morphMany(string $model, $morph = null, string $type = ''): MorphMany - { - // 记录当前关联信息 - $model = $this->parseModel($model); - - if (is_null($morph)) { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); - $morph = Str::snake($trace[1]['function']); - } - - $type = $type ?: get_class($this); - - if (is_array($morph)) { - [$morphType, $foreignKey] = $morph; - } else { - $morphType = $morph . '_type'; - $foreignKey = $morph . '_id'; - } - - return new MorphMany($this, $model, $foreignKey, $morphType, $type); - } - - /** - * MORPH TO 关联定义 - * @access public - * @param string|array $morph 多态字段信息 - * @param array $alias 多态别名定义 - * @return MorphTo - */ - public function morphTo($morph = null, array $alias = []): MorphTo - { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); - $relation = Str::snake($trace[1]['function']); - - if (is_null($morph)) { - $morph = $relation; - } - - // 记录当前关联信息 - if (is_array($morph)) { - [$morphType, $foreignKey] = $morph; - } else { - $morphType = $morph . '_type'; - $foreignKey = $morph . '_id'; - } - - return new MorphTo($this, $morphType, $foreignKey, $alias, $relation); - } - - /** - * MORPH TO MANY关联定义 - * @access public - * @param string $model 模型名 - * @param string $middle 中间表名/模型名 - * @param string|array $morph 多态字段信息 - * @param string $localKey 当前模型关联键 - * @return MorphToMany - */ - public function morphToMany(string $model, string $middle, $morph = null, string $localKey = null): MorphToMany - { - if (is_null($morph)) { - $morph = $middle; - } - - // 记录当前关联信息 - if (is_array($morph)) { - [$morphType, $morphKey] = $morph; - } else { - $morphType = $morph . '_type'; - $morphKey = $morph . '_id'; - } - - $model = $this->parseModel($model); - $name = Str::snake(class_basename($model)); - $localKey = $localKey ?: $this->getForeignKey($name); - - return new MorphToMany($this, $model, $middle, $morphType, $morphKey, $localKey); - } - - /** - * MORPH BY MANY关联定义 - * @access public - * @param string $model 模型名 - * @param string $middle 中间表名/模型名 - * @param string|array $morph 多态字段信息 - * @param string $foreignKey 关联外键 - * @return MorphToMany - */ - public function morphByMany(string $model, string $middle, $morph = null, string $foreignKey = null): MorphToMany - { - if (is_null($morph)) { - $morph = $middle; - } - - // 记录当前关联信息 - if (is_array($morph)) { - [$morphType, $morphKey] = $morph; - } else { - $morphType = $morph . '_type'; - $morphKey = $morph . '_id'; - } - - $model = $this->parseModel($model); - $foreignKey = $foreignKey ?: $this->getForeignKey($this->name); - - return new MorphToMany($this, $model, $middle, $morphType, $morphKey, $foreignKey, true); - } - - /** - * 解析模型的完整命名空间 - * @access protected - * @param string $model 模型名(或者完整类名) - * @return string - */ - protected function parseModel(string $model): string - { - if (false === strpos($model, '\\')) { - $path = explode('\\', static::class); - array_pop($path); - array_push($path, Str::studly($model)); - $model = implode('\\', $path); - } - - return $model; - } - - /** - * 获取模型的默认外键名 - * @access protected - * @param string $name 模型名 - * @return string - */ - protected function getForeignKey(string $name): string - { - if (strpos($name, '\\')) { - $name = class_basename($name); - } - - return Str::snake($name) . '_id'; - } - - /** - * 检查属性是否为关联属性 如果是则返回关联方法名 - * @access protected - * @param string $attr 关联属性名 - * @return string|false - */ - protected function isRelationAttr(string $attr) - { - $relation = Str::camel($attr); - - if ((method_exists($this, $relation) && !method_exists('think\Model', $relation)) || isset(static::$macro[static::class][$relation])) { - return $relation; - } - - return false; - } - - /** - * 智能获取关联模型数据 - * @access protected - * @param Relation $modelRelation 模型关联对象 - * @return mixed - */ - protected function getRelationData(Relation $modelRelation) - { - if ($this->parent && !$modelRelation->isSelfRelation() - && get_class($this->parent) == get_class($modelRelation->getModel())) { - return $this->parent; - } - - // 获取关联数据 - return $modelRelation->getRelation(); - } - - /** - * 关联数据自动写入检查 - * @access protected - * @return void - */ - protected function checkAutoRelationWrite(): void - { - foreach ($this->together as $key => $name) { - if (is_array($name)) { - if (key($name) === 0) { - $this->relationWrite[$key] = []; - // 绑定关联属性 - foreach ($name as $val) { - if (isset($this->data[$val])) { - $this->relationWrite[$key][$val] = $this->data[$val]; - } - } - } else { - // 直接传入关联数据 - $this->relationWrite[$key] = $name; - } - } elseif (isset($this->relation[$name])) { - $this->relationWrite[$name] = $this->relation[$name]; - } elseif (isset($this->data[$name])) { - $this->relationWrite[$name] = $this->data[$name]; - unset($this->data[$name]); - } - } - } - - /** - * 自动关联数据更新(针对一对一关联) - * @access protected - * @return void - */ - protected function autoRelationUpdate(): void - { - foreach ($this->relationWrite as $name => $val) { - if ($val instanceof Model) { - $val->exists(true)->save(); - } else { - $model = $this->getRelation($name, true); - - if ($model instanceof Model) { - $model->exists(true)->save($val); - } - } - } - } - - /** - * 自动关联数据写入(针对一对一关联) - * @access protected - * @return void - */ - protected function autoRelationInsert(): void - { - foreach ($this->relationWrite as $name => $val) { - $method = Str::camel($name); - $this->$method()->save($val); - } - } - - /** - * 自动关联数据删除(支持一对一及一对多关联) - * @access protected - * @return void - */ - protected function autoRelationDelete(): void - { - foreach ($this->relationWrite as $key => $name) { - $name = is_numeric($key) ? $name : $key; - $result = $this->getRelation($name, true); - - if ($result instanceof Model) { - $result->delete(); - } elseif ($result instanceof Collection) { - foreach ($result as $model) { - $model->delete(); - } - } - } - } - - /** - * 移除当前模型的关联属性 - * @access public - * @return $this - */ - public function removeRelation() - { - $this->relation = []; - return $this; - } -} diff --git a/vendor/topthink/think-orm/src/model/concern/SoftDelete.php b/vendor/topthink/think-orm/src/model/concern/SoftDelete.php deleted file mode 100644 index ce5d392..0000000 --- a/vendor/topthink/think-orm/src/model/concern/SoftDelete.php +++ /dev/null @@ -1,248 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\concern; - -use think\db\BaseQuery as Query; -use think\Model; - -/** - * 数据软删除 - * @mixin Model - */ -trait SoftDelete -{ - /** - * 是否包含软删除数据 - * @var bool - */ - protected $withTrashed = false; - - /** - * 判断当前实例是否被软删除 - * @access public - * @return bool - */ - public function trashed(): bool - { - $field = $this->getDeleteTimeField(); - - if ($field && !empty($this->getOrigin($field))) { - return true; - } - - return false; - } - - /** - * 查询软删除数据 - * @access public - * @return Query - */ - public static function withTrashed(): Query - { - $model = new static(); - - return $model->withTrashedData(true)->db(); - } - - /** - * 是否包含软删除数据 - * @access protected - * @param bool $withTrashed 是否包含软删除数据 - * @return $this - */ - protected function withTrashedData(bool $withTrashed) - { - $this->withTrashed = $withTrashed; - return $this; - } - - /** - * 只查询软删除数据 - * @access public - * @return Query - */ - public static function onlyTrashed(): Query - { - $model = new static(); - $field = $model->getDeleteTimeField(true); - - if ($field) { - return $model - ->db() - ->useSoftDelete($field, $model->getWithTrashedExp()); - } - - return $model->db(); - } - - /** - * 获取软删除数据的查询条件 - * @access protected - * @return array - */ - protected function getWithTrashedExp(): array - { - return is_null($this->defaultSoftDelete) ? ['notnull', ''] : ['<>', $this->defaultSoftDelete]; - } - - /** - * 删除当前的记录 - * @access public - * @return bool - */ - public function delete(): bool - { - if (!$this->isExists() || $this->isEmpty() || false === $this->trigger('BeforeDelete')) { - return false; - } - - $name = $this->getDeleteTimeField(); - - if ($name && !$this->isForce()) { - // 软删除 - $this->set($name, $this->autoWriteTimestamp($name)); - - $result = $this->exists()->withEvent(false)->save(); - - $this->withEvent(true); - } else { - // 读取更新条件 - $where = $this->getWhere(); - - // 删除当前模型数据 - $result = $this->db() - ->where($where) - ->removeOption('soft_delete') - ->delete(); - - $this->lazySave(false); - } - - // 关联删除 - if (!empty($this->relationWrite)) { - $this->autoRelationDelete(); - } - - $this->trigger('AfterDelete'); - - $this->exists(false); - - return true; - } - - /** - * 删除记录 - * @access public - * @param mixed $data 主键列表 支持闭包查询条件 - * @param bool $force 是否强制删除 - * @return bool - */ - public static function destroy($data, bool $force = false): bool - { - // 包含软删除数据 - $query = (new static())->withTrashedData(true)->db(false); - - if (is_array($data) && key($data) !== 0) { - $query->where($data); - $data = null; - } elseif ($data instanceof \Closure) { - call_user_func_array($data, [ & $query]); - $data = null; - } elseif (is_null($data)) { - return false; - } - - $resultSet = $query->select($data); - - foreach ($resultSet as $result) { - $result->force($force)->delete(); - } - - return true; - } - - /** - * 恢复被软删除的记录 - * @access public - * @param array $where 更新条件 - * @return bool - */ - public function restore($where = []): bool - { - $name = $this->getDeleteTimeField(); - - if (!$name || false === $this->trigger('BeforeRestore')) { - return false; - } - - if (empty($where)) { - $pk = $this->getPk(); - if (is_string($pk)) { - $where[] = [$pk, '=', $this->getData($pk)]; - } - } - - // 恢复删除 - $this->db(false) - ->where($where) - ->useSoftDelete($name, $this->getWithTrashedExp()) - ->update([$name => $this->defaultSoftDelete]); - - $this->trigger('AfterRestore'); - - return true; - } - - /** - * 获取软删除字段 - * @access protected - * @param bool $read 是否查询操作 写操作的时候会自动去掉表别名 - * @return string|false - */ - protected function getDeleteTimeField(bool $read = false) - { - $field = property_exists($this, 'deleteTime') && isset($this->deleteTime) ? $this->deleteTime : 'delete_time'; - - if (false === $field) { - return false; - } - - if (false === strpos($field, '.')) { - $field = '__TABLE__.' . $field; - } - - if (!$read && strpos($field, '.')) { - $array = explode('.', $field); - $field = array_pop($array); - } - - return $field; - } - - /** - * 查询的时候默认排除软删除数据 - * @access protected - * @param Query $query - * @return void - */ - protected function withNoTrashed(Query $query): void - { - $field = $this->getDeleteTimeField(true); - - if ($field) { - $condition = is_null($this->defaultSoftDelete) ? ['null', ''] : ['=', $this->defaultSoftDelete]; - $query->useSoftDelete($field, $condition); - } - } -} diff --git a/vendor/topthink/think-orm/src/model/concern/TimeStamp.php b/vendor/topthink/think-orm/src/model/concern/TimeStamp.php deleted file mode 100644 index e207961..0000000 --- a/vendor/topthink/think-orm/src/model/concern/TimeStamp.php +++ /dev/null @@ -1,208 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\concern; - -use DateTime; - -/** - * 自动时间戳 - */ -trait TimeStamp -{ - /** - * 是否需要自动写入时间戳 如果设置为字符串 则表示时间字段的类型 - * @var bool|string - */ - protected $autoWriteTimestamp; - - /** - * 创建时间字段 false表示关闭 - * @var false|string - */ - protected $createTime = 'create_time'; - - /** - * 更新时间字段 false表示关闭 - * @var false|string - */ - protected $updateTime = 'update_time'; - - /** - * 时间字段显示格式 - * @var string - */ - protected $dateFormat; - - /** - * 是否需要自动写入时间字段 - * @access public - * @param bool|string $auto - * @return $this - */ - public function isAutoWriteTimestamp($auto) - { - $this->autoWriteTimestamp = $this->checkTimeFieldType($auto); - - return $this; - } - - /** - * 检测时间字段的实际类型 - * @access public - * @param bool|string $type - * @return mixed - */ - protected function checkTimeFieldType($type) - { - if (true === $type) { - if (isset($this->type[$this->createTime])) { - $type = $this->type[$this->createTime]; - } elseif (isset($this->schema[$this->createTime]) && in_array($this->schema[$this->createTime], ['datetime', 'date', 'timestamp', 'int'])) { - $type = $this->schema[$this->createTime]; - } else { - $type = $this->getFieldType($this->createTime); - } - } - - return $type; - } - - /** - * 获取自动写入时间字段 - * @access public - * @return bool|string - */ - public function getAutoWriteTimestamp() - { - return $this->autoWriteTimestamp; - } - - /** - * 设置时间字段格式化 - * @access public - * @param string|false $format - * @return $this - */ - public function setDateFormat($format) - { - $this->dateFormat = $format; - - return $this; - } - - /** - * 获取自动写入时间字段 - * @access public - * @return string|false - */ - public function getDateFormat() - { - return $this->dateFormat; - } - - /** - * 自动写入时间戳 - * @access protected - * @return mixed - */ - protected function autoWriteTimestamp() - { - // 检测时间字段类型 - $type = $this->checkTimeFieldType($this->autoWriteTimestamp); - - return is_string($type) ? $this->getTimeTypeValue($type) : time(); - } - - /** - * 获取指定类型的时间字段值 - * @access protected - * @param string $type 时间字段类型 - * @return mixed - */ - protected function getTimeTypeValue(string $type) - { - $value = time(); - - switch ($type) { - case 'datetime': - case 'date': - case 'timestamp': - $value = $this->formatDateTime('Y-m-d H:i:s.u'); - break; - default: - if (false !== strpos($type, '\\')) { - // 对象数据写入 - $obj = new $type(); - if (method_exists($obj, '__toString')) { - // 对象数据写入 - $value = $obj->__toString(); - } - } - } - - return $value; - } - - /** - * 时间日期字段格式化处理 - * @access protected - * @param mixed $format 日期格式 - * @param mixed $time 时间日期表达式 - * @param bool $timestamp 时间表达式是否为时间戳 - * @return mixed - */ - protected function formatDateTime($format, $time = 'now', bool $timestamp = false) - { - if (empty($time)) { - return; - } - - if (false === $format) { - return $time; - } elseif (false !== strpos($format, '\\')) { - return new $format($time); - } - - if ($time instanceof DateTime) { - $dateTime = $time; - } elseif ($timestamp) { - $dateTime = new DateTime(); - $dateTime->setTimestamp((int) $time); - } else { - $dateTime = new DateTime($time); - } - - return $dateTime->format($format); - } - - /** - * 获取时间字段值 - * @access protected - * @param mixed $value - * @return mixed - */ - protected function getTimestampValue($value) - { - $type = $this->checkTimeFieldType($this->autoWriteTimestamp); - - if (is_string($type) && in_array(strtolower($type), [ - 'datetime', 'date', 'timestamp', - ])) { - $value = $this->formatDateTime($this->dateFormat, $value); - } else { - $value = $this->formatDateTime($this->dateFormat, $value, true); - } - - return $value; - } -} diff --git a/vendor/topthink/think-orm/src/model/relation/BelongsTo.php b/vendor/topthink/think-orm/src/model/relation/BelongsTo.php deleted file mode 100644 index 789c944..0000000 --- a/vendor/topthink/think-orm/src/model/relation/BelongsTo.php +++ /dev/null @@ -1,331 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\relation; - -use Closure; -use think\db\BaseQuery as Query; -use think\helper\Str; -use think\Model; - -/** - * BelongsTo关联类 - */ -class BelongsTo extends OneToOne -{ - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 模型名 - * @param string $foreignKey 关联外键 - * @param string $localKey 关联主键 - * @param string $relation 关联名 - */ - public function __construct(Model $parent, string $model, string $foreignKey, string $localKey, string $relation = null) - { - $this->parent = $parent; - $this->model = $model; - $this->foreignKey = $foreignKey; - $this->localKey = $localKey; - $this->query = (new $model)->db(); - $this->relation = $relation; - - if (get_class($parent) == $model) { - $this->selfRelation = true; - } - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Model - */ - public function getRelation(array $subRelation = [], Closure $closure = null) - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - $foreignKey = $this->foreignKey; - - $relationModel = $this->query - ->removeWhereField($this->localKey) - ->where($this->localKey, $this->parent->$foreignKey) - ->relation($subRelation) - ->find(); - - if ($relationModel) { - if (!empty($this->bindAttr)) { - // 绑定关联属性 - $this->bindAttr($this->parent, $relationModel); - } - - $relationModel->setParent(clone $this->parent); - } - - return $relationModel; - } - - /** - * 创建关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 聚合字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', &$name = ''): string - { - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query - ->whereExp($this->localKey, '=' . $this->parent->getTable() . '.' . $this->foreignKey) - ->fetchSql() - ->$aggregate($field); - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return integer - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null) - { - $foreignKey = $this->foreignKey; - - if (!isset($result->$foreignKey)) { - return 0; - } - - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query - ->where($this->localKey, '=', $result->$foreignKey) - ->$aggregate($field); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null): Query - { - $table = $this->query->getTable(); - $model = class_basename($this->parent); - $relation = class_basename($this->model); - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - $softDelete = $this->query->getOptions('soft_delete'); - $query = $query ?: $this->parent->db()->alias($model); - - return $query->whereExists(function ($query) use ($table, $model, $relation, $localKey, $foreignKey, $softDelete) { - $query->table([$table => $relation]) - ->field($relation . '.' . $localKey) - ->whereExp($model . '.' . $foreignKey, '=' . $relation . '.' . $localKey) - ->when($softDelete, function ($query) use ($softDelete, $relation) { - $query->where($relation . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }); - }); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null): Query - { - $table = $this->query->getTable(); - $model = class_basename($this->parent); - $relation = class_basename($this->model); - - if (is_array($where)) { - $this->getQueryWhere($where, $relation); - } elseif ($where instanceof Query) { - $where->via($relation); - } elseif ($where instanceof Closure) { - $where($this->query->via($relation)); - $where = $this->query; - } - - $fields = $this->getRelationQueryFields($fields, $model); - $softDelete = $this->query->getOptions('soft_delete'); - $query = $query ?: $this->parent->db()->alias($model); - - return $query->field($fields) - ->join([$table => $relation], $model . '.' . $this->foreignKey . '=' . $relation . '.' . $this->localKey, $joinType ?: $this->joinType) - ->when($softDelete, function ($query) use ($softDelete, $relation) { - $query->where($relation . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }) - ->where($where); - } - - /** - * 预载入关联查询(数据集) - * @access protected - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - protected function eagerlySet(array &$resultSet, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - - $range = []; - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (isset($result->$foreignKey)) { - $range[] = $result->$foreignKey; - } - } - - if (!empty($range)) { - $this->query->removeWhereField($localKey); - - $data = $this->eagerlyWhere([ - [$localKey, 'in', $range], - ], $localKey, $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - // 关联模型 - if (!isset($data[$result->$foreignKey])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$foreignKey]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - if (!empty($this->bindAttr)) { - // 绑定关联属性 - $this->bindAttr($result, $relationModel); - } else { - // 设置关联属性 - $result->setRelation($relation, $relationModel); - } - } - } - } - - /** - * 预载入关联查询(数据) - * @access protected - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - protected function eagerlyOne(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - - $this->query->removeWhereField($localKey); - - $data = $this->eagerlyWhere([ - [$localKey, '=', $result->$foreignKey], - ], $localKey, $subRelation, $closure, $cache); - - // 关联模型 - if (!isset($data[$result->$foreignKey])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$foreignKey]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - if (!empty($this->bindAttr)) { - // 绑定关联属性 - $this->bindAttr($result, $relationModel); - } else { - // 设置关联属性 - $result->setRelation($relation, $relationModel); - } - } - - /** - * 添加关联数据 - * @access public - * @param Model $model关联模型对象 - * @return Model - */ - public function associate(Model $model): Model - { - $this->parent->setAttr($this->foreignKey, $model->getKey()); - $this->parent->save(); - - return $this->parent->setRelation($this->relation, $model); - } - - /** - * 注销关联数据 - * @access public - * @return Model - */ - public function dissociate(): Model - { - $foreignKey = $this->foreignKey; - - $this->parent->setAttr($foreignKey, null); - $this->parent->save(); - - return $this->parent->setRelation($this->relation, null); - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery)) { - if (isset($this->parent->{$this->foreignKey})) { - // 关联查询带入关联条件 - $this->query->where($this->localKey, '=', $this->parent->{$this->foreignKey}); - } - - $this->baseQuery = true; - } - } -} diff --git a/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php b/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php deleted file mode 100644 index 6b64d95..0000000 --- a/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php +++ /dev/null @@ -1,684 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use think\Collection; -use think\db\BaseQuery as Query; -use think\db\exception\DbException as Exception; -use think\db\Raw; -use think\Model; -use think\model\Pivot; -use think\model\Relation; -use think\Paginator; - -/** - * 多对多关联类 - */ -class BelongsToMany extends Relation -{ - /** - * 中间表表名 - * @var string - */ - protected $middle; - - /** - * 中间表模型名称 - * @var string - */ - protected $pivotName; - - /** - * 中间表模型对象 - * @var Pivot - */ - protected $pivot; - - /** - * 中间表数据名称 - * @var string - */ - protected $pivotDataName = 'pivot'; - - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 模型名 - * @param string $middle 中间表/模型名 - * @param string $foreignKey 关联模型外键 - * @param string $localKey 当前模型关联键 - */ - public function __construct(Model $parent, string $model, string $middle, string $foreignKey, string $localKey) - { - $this->parent = $parent; - $this->model = $model; - $this->foreignKey = $foreignKey; - $this->localKey = $localKey; - - if (false !== strpos($middle, '\\')) { - $this->pivotName = $middle; - $this->middle = class_basename($middle); - } else { - $this->middle = $middle; - } - - $this->query = (new $model)->db(); - $this->pivot = $this->newPivot(); - } - - /** - * 设置中间表模型 - * @access public - * @param $pivot - * @return $this - */ - public function pivot(string $pivot) - { - $this->pivotName = $pivot; - return $this; - } - - /** - * 设置中间表数据名称 - * @access public - * @param string $name - * @return $this - */ - public function name(string $name) - { - $this->pivotDataName = $name; - return $this; - } - - /** - * 实例化中间表模型 - * @access public - * @param $data - * @return Pivot - * @throws Exception - */ - protected function newPivot(array $data = []): Pivot - { - $class = $this->pivotName ?: Pivot::class; - $pivot = new $class($data, $this->parent, $this->middle); - - if ($pivot instanceof Pivot) { - return $pivot; - } else { - throw new Exception('pivot model must extends: \think\model\Pivot'); - } - } - - /** - * 合成中间表模型 - * @access protected - * @param array|Collection|Paginator $models - */ - protected function hydratePivot(iterable $models) - { - foreach ($models as $model) { - $pivot = []; - - foreach ($model->getData() as $key => $val) { - if (strpos($key, '__')) { - [$name, $attr] = explode('__', $key, 2); - - if ('pivot' == $name) { - $pivot[$attr] = $val; - unset($model->$key); - } - } - } - - $model->setRelation($this->pivotDataName, $this->newPivot($pivot)); - } - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Collection - */ - public function getRelation(array $subRelation = [], Closure $closure = null): Collection - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - $result = $this->relation($subRelation) - ->select() - ->setParent(clone $this->parent); - - $this->hydratePivot($result); - - return $result; - } - - /** - * 重载select方法 - * @access public - * @param mixed $data - * @return Collection - */ - public function select($data = null): Collection - { - $this->baseQuery(); - $result = $this->query->select($data); - $this->hydratePivot($result); - - return $result; - } - - /** - * 重载paginate方法 - * @access public - * @param int|array $listRows - * @param int|bool $simple - * @return Paginator - */ - public function paginate($listRows = null, $simple = false): Paginator - { - $this->baseQuery(); - $result = $this->query->paginate($listRows, $simple); - $this->hydratePivot($result); - - return $result; - } - - /** - * 重载find方法 - * @access public - * @param mixed $data - * @return Model - */ - public function find($data = null) - { - $this->baseQuery(); - $result = $this->query->find($data); - - if ($result && !$result->isEmpty()) { - $this->hydratePivot([$result]); - } - - return $result; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Model - */ - public function has(string $operator = '>=', $count = 1, $id = '*', string $joinType = 'INNER', Query $query = null) - { - return $this->parent; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - * @throws Exception - */ - public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null) - { - throw new Exception('relation not support: hasWhere'); - } - - /** - * 设置中间表的查询条件 - * @access public - * @param string $field - * @param string $op - * @param mixed $condition - * @return $this - */ - public function wherePivot($field, $op = null, $condition = null) - { - $this->query->where('pivot.' . $field, $op, $condition); - return $this; - } - - /** - * 预载入关联查询(数据集) - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $pk = $resultSet[0]->getPk(); - $range = []; - - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (isset($result->$pk)) { - $range[] = $result->$pk; - } - } - - if (!empty($range)) { - // 查询关联数据 - $data = $this->eagerlyManyToMany([ - ['pivot.' . $localKey, 'in', $range], - ], $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - if (!isset($data[$result->$pk])) { - $data[$result->$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$result->$pk], clone $this->parent)); - } - } - } - - /** - * 预载入关联查询(单个数据) - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $pk = $result->getPk(); - - if (isset($result->$pk)) { - $pk = $result->$pk; - // 查询管理数据 - $data = $this->eagerlyManyToMany([ - ['pivot.' . $this->localKey, '=', $pk], - ], $subRelation, $closure, $cache); - - // 关联数据封装 - if (!isset($data[$pk])) { - $data[$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$pk], clone $this->parent)); - } - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return integer - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): float - { - $pk = $result->getPk(); - - if (!isset($result->$pk)) { - return 0; - } - - $pk = $result->$pk; - - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->belongsToManyQuery($this->foreignKey, $this->localKey, [ - ['pivot.' . $this->localKey, '=', $pk], - ])->$aggregate($field); - } - - /** - * 获取关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string - { - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->belongsToManyQuery($this->foreignKey, $this->localKey, [ - [ - 'pivot.' . $this->localKey, 'exp', new Raw('=' . $this->parent->db(false)->getTable() . '.' . $this->parent->getPk()), - ], - ])->fetchSql()->$aggregate($field); - } - - /** - * 多对多 关联模型预查询 - * @access protected - * @param array $where 关联预查询条件 - * @param array $subRelation 子关联 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyManyToMany(array $where, array $subRelation = [], Closure $closure = null, array $cache = []): array - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - // 预载入关联查询 支持嵌套预载入 - $list = $this->belongsToManyQuery($this->foreignKey, $this->localKey, $where) - ->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select(); - - // 组装模型数据 - $data = []; - foreach ($list as $set) { - $pivot = []; - foreach ($set->getData() as $key => $val) { - if (strpos($key, '__')) { - [$name, $attr] = explode('__', $key, 2); - if ('pivot' == $name) { - $pivot[$attr] = $val; - unset($set->$key); - } - } - } - $key = $pivot[$this->localKey]; - - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { - continue; - } - - $set->setRelation($this->pivotDataName, $this->newPivot($pivot)); - - $data[$key][] = $set; - } - - return $data; - } - - /** - * BELONGS TO MANY 关联查询 - * @access protected - * @param string $foreignKey 关联模型关联键 - * @param string $localKey 当前模型关联键 - * @param array $condition 关联查询条件 - * @return Query - */ - protected function belongsToManyQuery(string $foreignKey, string $localKey, array $condition = []): Query - { - // 关联查询封装 - if (empty($this->baseQuery)) { - $tableName = $this->query->getTable(); - $table = $this->pivot->db()->getTable(); - $fields = $this->getQueryFields($tableName); - - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - - $this->query - ->field($fields) - ->tableField(true, $table, 'pivot', 'pivot__') - ->join([$table => 'pivot'], 'pivot.' . $foreignKey . '=' . $tableName . '.' . $this->query->getPk()) - ->where($condition); - - } - - return $this->query; - } - - /** - * 保存(新增)当前关联数据对象 - * @access public - * @param mixed $data 数据 可以使用数组 关联模型对象 和 关联对象的主键 - * @param array $pivot 中间表额外数据 - * @return array|Pivot - */ - public function save($data, array $pivot = []) - { - // 保存关联表/中间表数据 - return $this->attach($data, $pivot); - } - - /** - * 批量保存当前关联数据对象 - * @access public - * @param iterable $dataSet 数据集 - * @param array $pivot 中间表额外数据 - * @param bool $samePivot 额外数据是否相同 - * @return array|false - */ - public function saveAll(iterable $dataSet, array $pivot = [], bool $samePivot = false) - { - $result = []; - - foreach ($dataSet as $key => $data) { - if (!$samePivot) { - $pivotData = $pivot[$key] ?? []; - } else { - $pivotData = $pivot; - } - - $result[] = $this->attach($data, $pivotData); - } - - return empty($result) ? false : $result; - } - - /** - * 附加关联的一个中间表数据 - * @access public - * @param mixed $data 数据 可以使用数组、关联模型对象 或者 关联对象的主键 - * @param array $pivot 中间表额外数据 - * @return array|Pivot - * @throws Exception - */ - public function attach($data, array $pivot = []) - { - if (is_array($data)) { - if (key($data) === 0) { - $id = $data; - } else { - // 保存关联表数据 - $model = new $this->model; - $id = $model->insertGetId($data); - } - } elseif (is_numeric($data) || is_string($data)) { - // 根据关联表主键直接写入中间表 - $id = $data; - } elseif ($data instanceof Model) { - // 根据关联表主键直接写入中间表 - $id = $data->getKey(); - } - - if (!empty($id)) { - // 保存中间表数据 - $pivot[$this->localKey] = $this->parent->getKey(); - - $ids = (array) $id; - foreach ($ids as $id) { - $pivot[$this->foreignKey] = $id; - $this->pivot->replace() - ->exists(false) - ->data([]) - ->save($pivot); - $result[] = $this->newPivot($pivot); - } - - if (count($result) == 1) { - // 返回中间表模型对象 - $result = $result[0]; - } - - return $result; - } else { - throw new Exception('miss relation data'); - } - } - - /** - * 判断是否存在关联数据 - * @access public - * @param mixed $data 数据 可以使用关联模型对象 或者 关联对象的主键 - * @return Pivot|false - */ - public function attached($data) - { - if ($data instanceof Model) { - $id = $data->getKey(); - } else { - $id = $data; - } - - $pivot = $this->pivot - ->where($this->localKey, $this->parent->getKey()) - ->where($this->foreignKey, $id) - ->find(); - - return $pivot ?: false; - } - - /** - * 解除关联的一个中间表数据 - * @access public - * @param integer|array $data 数据 可以使用关联对象的主键 - * @param bool $relationDel 是否同时删除关联表数据 - * @return integer - */ - public function detach($data = null, bool $relationDel = false): int - { - if (is_array($data)) { - $id = $data; - } elseif (is_numeric($data) || is_string($data)) { - // 根据关联表主键直接写入中间表 - $id = $data; - } elseif ($data instanceof Model) { - // 根据关联表主键直接写入中间表 - $id = $data->getKey(); - } - - // 删除中间表数据 - $pivot = []; - $pivot[] = [$this->localKey, '=', $this->parent->getKey()]; - - if (isset($id)) { - $pivot[] = [$this->foreignKey, is_array($id) ? 'in' : '=', $id]; - } - - $result = $this->pivot->where($pivot)->delete(); - - // 删除关联表数据 - if (isset($id) && $relationDel) { - $model = $this->model; - $model::destroy($id); - } - - return $result; - } - - /** - * 数据同步 - * @access public - * @param array $ids - * @param bool $detaching - * @return array - */ - public function sync(array $ids, bool $detaching = true): array - { - $changes = [ - 'attached' => [], - 'detached' => [], - 'updated' => [], - ]; - - $current = $this->pivot - ->where($this->localKey, $this->parent->getKey()) - ->column($this->foreignKey); - - $records = []; - - foreach ($ids as $key => $value) { - if (!is_array($value)) { - $records[$value] = []; - } else { - $records[$key] = $value; - } - } - - $detach = array_diff($current, array_keys($records)); - - if ($detaching && count($detach) > 0) { - $this->detach($detach); - $changes['detached'] = $detach; - } - - foreach ($records as $id => $attributes) { - if (!in_array($id, $current)) { - $this->attach($id, $attributes); - $changes['attached'][] = $id; - } elseif (count($attributes) > 0 && $this->attach($id, $attributes)) { - $changes['updated'][] = $id; - } - } - - return $changes; - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery)) { - $foreignKey = $this->foreignKey; - $localKey = $this->localKey; - - // 关联查询 - if (null === $this->parent->getKey()) { - $condition = ['pivot.' . $localKey, 'exp', new Raw('=' . $this->parent->getTable() . '.' . $this->parent->getPk())]; - } else { - $condition = ['pivot.' . $localKey, '=', $this->parent->getKey()]; - } - - $this->belongsToManyQuery($foreignKey, $localKey, [$condition]); - - $this->baseQuery = true; - } - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/HasMany.php b/vendor/topthink/think-orm/src/model/relation/HasMany.php deleted file mode 100644 index a67d41b..0000000 --- a/vendor/topthink/think-orm/src/model/relation/HasMany.php +++ /dev/null @@ -1,367 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\relation; - -use Closure; -use think\Collection; -use think\db\BaseQuery as Query; -use think\helper\Str; -use think\Model; -use think\model\Relation; - -/** - * 一对多关联类 - */ -class HasMany extends Relation -{ - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 模型名 - * @param string $foreignKey 关联外键 - * @param string $localKey 当前模型主键 - */ - public function __construct(Model $parent, string $model, string $foreignKey, string $localKey) - { - $this->parent = $parent; - $this->model = $model; - $this->foreignKey = $foreignKey; - $this->localKey = $localKey; - $this->query = (new $model)->db(); - - if (get_class($parent) == $model) { - $this->selfRelation = true; - } - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Collection - */ - public function getRelation(array $subRelation = [], Closure $closure = null): Collection - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - - return $this->query - ->where($this->foreignKey, $this->parent->{$this->localKey}) - ->relation($subRelation) - ->select() - ->setParent(clone $this->parent); - } - - /** - * 预载入关联查询 - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $range = []; - - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (isset($result->$localKey)) { - $range[] = $result->$localKey; - } - } - - if (!empty($range)) { - $data = $this->eagerlyOneToMany([ - [$this->foreignKey, 'in', $range], - ], $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - $pk = $result->$localKey; - if (!isset($data[$pk])) { - $data[$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$pk], clone $this->parent)); - } - } - } - - /** - * 预载入关联查询 - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - - if (isset($result->$localKey)) { - $pk = $result->$localKey; - $data = $this->eagerlyOneToMany([ - [$this->foreignKey, '=', $pk], - ], $subRelation, $closure, $cache); - - // 关联数据封装 - if (!isset($data[$pk])) { - $data[$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$pk], clone $this->parent)); - } - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return integer - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null) - { - $localKey = $this->localKey; - - if (!isset($result->$localKey)) { - return 0; - } - - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query - ->where($this->foreignKey, '=', $result->$localKey) - ->$aggregate($field); - } - - /** - * 创建关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string - { - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query->alias($aggregate . '_table') - ->whereExp($aggregate . '_table.' . $this->foreignKey, '=' . $this->parent->getTable() . '.' . $this->localKey) - ->fetchSql() - ->$aggregate($field); - } - - /** - * 一对多 关联模型预查询 - * @access public - * @param array $where 关联预查询条件 - * @param array $subRelation 子关联 - * @param Closure $closure - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyOneToMany(array $where, array $subRelation = [], Closure $closure = null, array $cache = []): array - { - $foreignKey = $this->foreignKey; - - $this->query->removeWhereField($this->foreignKey); - - // 预载入关联查询 支持嵌套预载入 - if ($closure) { - $this->baseQuery = true; - $closure($this->getClosureType($closure)); - } - - $list = $this->query - ->where($where) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->with($subRelation) - ->select(); - - // 组装模型数据 - $data = []; - - foreach ($list as $set) { - $key = $set->$foreignKey; - - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { - continue; - } - - $data[$key][] = $set; - } - - return $data; - } - - /** - * 保存(新增)当前关联数据对象 - * @access public - * @param mixed $data 数据 可以使用数组 关联模型对象 - * @param boolean $replace 是否自动识别更新和写入 - * @return Model|false - */ - public function save($data, bool $replace = true) - { - $model = $this->make(); - - return $model->replace($replace)->save($data) ? $model : false; - } - - /** - * 创建关联对象实例 - * @param array|Model $data - * @return Model - */ - public function make($data = []): Model - { - if ($data instanceof Model) { - $data = $data->getData(); - } - - // 保存关联表数据 - $data[$this->foreignKey] = $this->parent->{$this->localKey}; - - return new $this->model($data); - } - - /** - * 批量保存当前关联数据对象 - * @access public - * @param iterable $dataSet 数据集 - * @param boolean $replace 是否自动识别更新和写入 - * @return array|false - */ - public function saveAll(iterable $dataSet, bool $replace = true) - { - $result = []; - - foreach ($dataSet as $key => $data) { - $result[] = $this->save($data, $replace); - } - - return empty($result) ? false : $result; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = 'INNER', Query $query = null): Query - { - $table = $this->query->getTable(); - - $model = class_basename($this->parent); - $relation = class_basename($this->model); - - if ('*' != $id) { - $id = $relation . '.' . (new $this->model)->getPk(); - } - - $softDelete = $this->query->getOptions('soft_delete'); - $query = $query ?: $this->parent->db()->alias($model); - - return $query->field($model . '.*') - ->join([$table => $relation], $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey, $joinType) - ->when($softDelete, function ($query) use ($softDelete, $relation) { - $query->where($relation . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }) - ->group($relation . '.' . $this->foreignKey) - ->having('count(' . $id . ')' . $operator . $count); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null): Query - { - $table = $this->query->getTable(); - $model = class_basename($this->parent); - $relation = class_basename($this->model); - - if (is_array($where)) { - $this->getQueryWhere($where, $relation); - } elseif ($where instanceof Query) { - $where->via($relation); - } elseif ($where instanceof Closure) { - $where($this->query->via($relation)); - $where = $this->query; - } - - $fields = $this->getRelationQueryFields($fields, $model); - $softDelete = $this->query->getOptions('soft_delete'); - $query = $query ?: $this->parent->db()->alias($model); - - return $query->group($model . '.' . $this->localKey) - ->field($fields) - ->join([$table => $relation], $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey, $joinType) - ->when($softDelete, function ($query) use ($softDelete, $relation) { - $query->where($relation . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }) - ->where($where); - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery)) { - if (isset($this->parent->{$this->localKey})) { - // 关联查询带入关联条件 - $this->query->where($this->foreignKey, '=', $this->parent->{$this->localKey}); - } - - $this->baseQuery = true; - } - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php b/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php deleted file mode 100644 index 30d5ca4..0000000 --- a/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php +++ /dev/null @@ -1,382 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use think\Collection; -use think\db\BaseQuery as Query; -use think\helper\Str; -use think\Model; -use think\model\Relation; - -/** - * 远程一对多关联类 - */ -class HasManyThrough extends Relation -{ - /** - * 中间关联表外键 - * @var string - */ - protected $throughKey; - - /** - * 中间主键 - * @var string - */ - protected $throughPk; - - /** - * 中间表查询对象 - * @var Query - */ - protected $through; - - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 关联模型名 - * @param string $through 中间模型名 - * @param string $foreignKey 关联外键 - * @param string $throughKey 中间关联外键 - * @param string $localKey 当前模型主键 - * @param string $throughPk 中间模型主键 - */ - public function __construct(Model $parent, string $model, string $through, string $foreignKey, string $throughKey, string $localKey, string $throughPk) - { - $this->parent = $parent; - $this->model = $model; - $this->through = (new $through)->db(); - $this->foreignKey = $foreignKey; - $this->throughKey = $throughKey; - $this->localKey = $localKey; - $this->throughPk = $throughPk; - $this->query = (new $model)->db(); - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Collection - */ - public function getRelation(array $subRelation = [], Closure $closure = null) - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - $this->baseQuery(); - - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - - return $this->query->relation($subRelation) - ->select() - ->setParent(clone $this->parent); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null): Query - { - $model = Str::snake(class_basename($this->parent)); - $throughTable = $this->through->getTable(); - $pk = $this->throughPk; - $throughKey = $this->throughKey; - $relation = new $this->model; - $relationTable = $relation->getTable(); - $softDelete = $this->query->getOptions('soft_delete'); - - if ('*' != $id) { - $id = $relationTable . '.' . $relation->getPk(); - } - $query = $query ?: $this->parent->db()->alias($model); - - return $query->field($model . '.*') - ->join($throughTable, $throughTable . '.' . $this->foreignKey . '=' . $model . '.' . $this->localKey) - ->join($relationTable, $relationTable . '.' . $throughKey . '=' . $throughTable . '.' . $this->throughPk) - ->when($softDelete, function ($query) use ($softDelete, $relationTable) { - $query->where($relationTable . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }) - ->group($relationTable . '.' . $this->throughKey) - ->having('count(' . $id . ')' . $operator . $count); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function hasWhere($where = [], $fields = null, $joinType = '', Query $query = null): Query - { - $model = Str::snake(class_basename($this->parent)); - $throughTable = $this->through->getTable(); - $pk = $this->throughPk; - $throughKey = $this->throughKey; - $modelTable = (new $this->model)->getTable(); - - if (is_array($where)) { - $this->getQueryWhere($where, $modelTable); - } elseif ($where instanceof Query) { - $where->via($modelTable); - } elseif ($where instanceof Closure) { - $where($this->query->via($modelTable)); - $where = $this->query; - } - - $fields = $this->getRelationQueryFields($fields, $model); - $softDelete = $this->query->getOptions('soft_delete'); - $query = $query ?: $this->parent->db()->alias($model); - - return $query->join($throughTable, $throughTable . '.' . $this->foreignKey . '=' . $model . '.' . $this->localKey) - ->join($modelTable, $modelTable . '.' . $throughKey . '=' . $throughTable . '.' . $this->throughPk, $joinType) - ->when($softDelete, function ($query) use ($softDelete, $modelTable) { - $query->where($modelTable . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }) - ->group($modelTable . '.' . $this->throughKey) - ->where($where) - ->field($fields); - } - - /** - * 预载入关联查询(数据集) - * @access protected - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - - $range = []; - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (isset($result->$localKey)) { - $range[] = $result->$localKey; - } - } - - if (!empty($range)) { - $this->query->removeWhereField($foreignKey); - - $data = $this->eagerlyWhere([ - [$this->foreignKey, 'in', $range], - ], $foreignKey, $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - $pk = $result->$localKey; - if (!isset($data[$pk])) { - $data[$pk] = []; - } - - // 设置关联属性 - $result->setRelation($relation, $this->resultSetBuild($data[$pk], clone $this->parent)); - } - } - } - - /** - * 预载入关联查询(数据) - * @access protected - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - $pk = $result->$localKey; - - $this->query->removeWhereField($foreignKey); - - $data = $this->eagerlyWhere([ - [$foreignKey, '=', $pk], - ], $foreignKey, $subRelation, $closure, $cache); - - // 关联数据封装 - if (!isset($data[$pk])) { - $data[$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$pk], clone $this->parent)); - } - - /** - * 关联模型预查询 - * @access public - * @param array $where 关联预查询条件 - * @param string $key 关联键名 - * @param array $subRelation 子关联 - * @param Closure $closure - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyWhere(array $where, string $key, array $subRelation = [], Closure $closure = null, array $cache = []): array - { - // 预载入关联查询 支持嵌套预载入 - $throughList = $this->through->where($where)->select(); - $keys = $throughList->column($this->throughPk, $this->throughPk); - - if ($closure) { - $this->baseQuery = true; - $closure($this->getClosureType($closure)); - } - - $list = $this->query - ->where($this->throughKey, 'in', $keys) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select(); - - // 组装模型数据 - $data = []; - $keys = $throughList->column($this->foreignKey, $this->throughPk); - - foreach ($list as $set) { - $key = $keys[$set->{$this->throughKey}]; - - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { - continue; - } - - $data[$key][] = $set; - } - - return $data; - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return mixed - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null) - { - $localKey = $this->localKey; - - if (!isset($result->$localKey)) { - return 0; - } - - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - $alias = Str::snake(class_basename($this->model)); - $throughTable = $this->through->getTable(); - $pk = $this->throughPk; - $throughKey = $this->throughKey; - $modelTable = $this->parent->getTable(); - - if (false === strpos($field, '.')) { - $field = $alias . '.' . $field; - } - - return $this->query - ->alias($alias) - ->join($throughTable, $throughTable . '.' . $pk . '=' . $alias . '.' . $throughKey) - ->join($modelTable, $modelTable . '.' . $this->localKey . '=' . $throughTable . '.' . $this->foreignKey) - ->where($throughTable . '.' . $this->foreignKey, $result->$localKey) - ->$aggregate($field); - } - - /** - * 创建关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string - { - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - $alias = Str::snake(class_basename($this->model)); - $throughTable = $this->through->getTable(); - $pk = $this->throughPk; - $throughKey = $this->throughKey; - $modelTable = $this->parent->getTable(); - - if (false === strpos($field, '.')) { - $field = $alias . '.' . $field; - } - - return $this->query - ->alias($alias) - ->join($throughTable, $throughTable . '.' . $pk . '=' . $alias . '.' . $throughKey) - ->join($modelTable, $modelTable . '.' . $this->localKey . '=' . $throughTable . '.' . $this->foreignKey) - ->whereExp($throughTable . '.' . $this->foreignKey, '=' . $this->parent->getTable() . '.' . $this->localKey) - ->fetchSql() - ->$aggregate($field); - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery) && $this->parent->getData()) { - $alias = Str::snake(class_basename($this->model)); - $throughTable = $this->through->getTable(); - $pk = $this->throughPk; - $throughKey = $this->throughKey; - $modelTable = $this->parent->getTable(); - $fields = $this->getQueryFields($alias); - - $this->query - ->field($fields) - ->alias($alias) - ->join($throughTable, $throughTable . '.' . $pk . '=' . $alias . '.' . $throughKey) - ->join($modelTable, $modelTable . '.' . $this->localKey . '=' . $throughTable . '.' . $this->foreignKey) - ->where($throughTable . '.' . $this->foreignKey, $this->parent->{$this->localKey}); - - $this->baseQuery = true; - } - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/HasOne.php b/vendor/topthink/think-orm/src/model/relation/HasOne.php deleted file mode 100644 index 7fcd20a..0000000 --- a/vendor/topthink/think-orm/src/model/relation/HasOne.php +++ /dev/null @@ -1,300 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\model\relation; - -use Closure; -use think\db\BaseQuery as Query; -use think\helper\Str; -use think\Model; - -/** - * HasOne 关联类 - */ -class HasOne extends OneToOne -{ - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 模型名 - * @param string $foreignKey 关联外键 - * @param string $localKey 当前模型主键 - */ - public function __construct(Model $parent, string $model, string $foreignKey, string $localKey) - { - $this->parent = $parent; - $this->model = $model; - $this->foreignKey = $foreignKey; - $this->localKey = $localKey; - $this->query = (new $model)->db(); - - if (get_class($parent) == $model) { - $this->selfRelation = true; - } - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Model - */ - public function getRelation(array $subRelation = [], Closure $closure = null) - { - $localKey = $this->localKey; - - if ($closure) { - $closure($this->getClosureType($closure)); - } - - // 判断关联类型执行查询 - $relationModel = $this->query - ->removeWhereField($this->foreignKey) - ->where($this->foreignKey, $this->parent->$localKey) - ->relation($subRelation) - ->find(); - - if ($relationModel) { - if (!empty($this->bindAttr)) { - // 绑定关联属性 - $this->bindAttr($this->parent, $relationModel); - } - - $relationModel->setParent(clone $this->parent); - } - - return $relationModel; - } - - /** - * 创建关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string - { - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query - ->whereExp($this->foreignKey, '=' . $this->parent->getTable() . '.' . $this->localKey) - ->fetchSql() - ->$aggregate($field); - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return integer - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null) - { - $localKey = $this->localKey; - - if (!isset($result->$localKey)) { - return 0; - } - - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query - ->where($this->foreignKey, '=', $result->$localKey) - ->$aggregate($field); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null): Query - { - $table = $this->query->getTable(); - $model = class_basename($this->parent); - $relation = class_basename($this->model); - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - $softDelete = $this->query->getOptions('soft_delete'); - $query = $query ?: $this->parent->db()->alias($model); - - return $query->whereExists(function ($query) use ($table, $model, $relation, $localKey, $foreignKey, $softDelete) { - $query->table([$table => $relation]) - ->field($relation . '.' . $foreignKey) - ->whereExp($model . '.' . $localKey, '=' . $relation . '.' . $foreignKey) - ->when($softDelete, function ($query) use ($softDelete, $relation) { - $query->where($relation . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }); - }); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null): Query - { - $table = $this->query->getTable(); - $model = class_basename($this->parent); - $relation = class_basename($this->model); - - if (is_array($where)) { - $this->getQueryWhere($where, $relation); - } elseif ($where instanceof Query) { - $where->via($relation); - } elseif ($where instanceof Closure) { - $where($this->query->via($relation)); - $where = $this->query; - } - - $fields = $this->getRelationQueryFields($fields, $model); - $softDelete = $this->query->getOptions('soft_delete'); - $query = $query ? $query->alias($model) : $this->parent->db()->alias($model); - - return $query->field($fields) - ->join([$table => $relation], $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey, $joinType ?: $this->joinType) - ->when($softDelete, function ($query) use ($softDelete, $relation) { - $query->where($relation . strstr($softDelete[0], '.'), '=' == $softDelete[1][0] ? $softDelete[1][1] : null); - }) - ->where($where); - } - - /** - * 预载入关联查询(数据集) - * @access protected - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - protected function eagerlySet(array &$resultSet, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - - $range = []; - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (isset($result->$localKey)) { - $range[] = $result->$localKey; - } - } - - if (!empty($range)) { - $this->query->removeWhereField($foreignKey); - - $data = $this->eagerlyWhere([ - [$foreignKey, 'in', $range], - ], $foreignKey, $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - // 关联模型 - if (!isset($data[$result->$localKey])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$localKey]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - if (!empty($this->bindAttr)) { - // 绑定关联属性 - $this->bindAttr($result, $relationModel); - } else { - // 设置关联属性 - $result->setRelation($relation, $relationModel); - } - } - } - } - - /** - * 预载入关联查询(数据) - * @access protected - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - protected function eagerlyOne(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - - $this->query->removeWhereField($foreignKey); - - $data = $this->eagerlyWhere([ - [$foreignKey, '=', $result->$localKey], - ], $foreignKey, $subRelation, $closure, $cache); - - // 关联模型 - if (!isset($data[$result->$localKey])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$localKey]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - if (!empty($this->bindAttr)) { - // 绑定关联属性 - $this->bindAttr($result, $relationModel); - } else { - $result->setRelation($relation, $relationModel); - } - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery)) { - if (isset($this->parent->{$this->localKey})) { - // 关联查询带入关联条件 - $this->query->where($this->foreignKey, '=', $this->parent->{$this->localKey}); - } - - $this->baseQuery = true; - } - } -} diff --git a/vendor/topthink/think-orm/src/model/relation/HasOneThrough.php b/vendor/topthink/think-orm/src/model/relation/HasOneThrough.php deleted file mode 100644 index 8ec42df..0000000 --- a/vendor/topthink/think-orm/src/model/relation/HasOneThrough.php +++ /dev/null @@ -1,163 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use think\helper\Str; -use think\Model; - -/** - * 远程一对一关联类 - */ -class HasOneThrough extends HasManyThrough -{ - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Model - */ - public function getRelation(array $subRelation = [], Closure $closure = null) - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - $this->baseQuery(); - - $relationModel = $this->query->relation($subRelation)->find(); - - if ($relationModel) { - $relationModel->setParent(clone $this->parent); - } - - return $relationModel; - } - - /** - * 预载入关联查询(数据集) - * @access protected - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - - $range = []; - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (isset($result->$localKey)) { - $range[] = $result->$localKey; - } - } - - if (!empty($range)) { - $this->query->removeWhereField($foreignKey); - - $data = $this->eagerlyWhere([ - [$this->foreignKey, 'in', $range], - ], $foreignKey, $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - // 关联模型 - if (!isset($data[$result->$localKey])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$localKey]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - // 设置关联属性 - $result->setRelation($relation, $relationModel); - } - } - } - - /** - * 预载入关联查询(数据) - * @access protected - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $localKey = $this->localKey; - $foreignKey = $this->foreignKey; - - $this->query->removeWhereField($foreignKey); - - $data = $this->eagerlyWhere([ - [$foreignKey, '=', $result->$localKey], - ], $foreignKey, $subRelation, $closure, $cache); - - // 关联模型 - if (!isset($data[$result->$localKey])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$localKey]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - $result->setRelation($relation, $relationModel); - } - - /** - * 关联模型预查询 - * @access public - * @param array $where 关联预查询条件 - * @param string $key 关联键名 - * @param array $subRelation 子关联 - * @param Closure $closure - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyWhere(array $where, string $key, array $subRelation = [], Closure $closure = null, array $cache = []): array - { - // 预载入关联查询 支持嵌套预载入 - $keys = $this->through->where($where)->column($this->throughPk, $this->foreignKey); - - if ($closure) { - $closure($this->getClosureType($closure)); - } - - $list = $this->query - ->where($this->throughKey, 'in', $keys) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select(); - - // 组装模型数据 - $data = []; - $keys = array_flip($keys); - - foreach ($list as $set) { - $data[$keys[$set->{$this->throughKey}]] = $set; - } - - return $data; - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/MorphMany.php b/vendor/topthink/think-orm/src/model/relation/MorphMany.php deleted file mode 100644 index 82910cb..0000000 --- a/vendor/topthink/think-orm/src/model/relation/MorphMany.php +++ /dev/null @@ -1,353 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use think\Collection; -use think\db\BaseQuery as Query; -use think\db\exception\DbException as Exception; -use think\helper\Str; -use think\Model; -use think\model\Relation; - -/** - * 多态一对多关联 - */ -class MorphMany extends Relation -{ - - /** - * 多态关联外键 - * @var string - */ - protected $morphKey; - /** - * 多态字段名 - * @var string - */ - protected $morphType; - - /** - * 多态类型 - * @var string - */ - protected $type; - - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 模型名 - * @param string $morphKey 关联外键 - * @param string $morphType 多态字段名 - * @param string $type 多态类型 - */ - public function __construct(Model $parent, string $model, string $morphKey, string $morphType, string $type) - { - $this->parent = $parent; - $this->model = $model; - $this->type = $type; - $this->morphKey = $morphKey; - $this->morphType = $morphType; - $this->query = (new $model)->db(); - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Collection - */ - public function getRelation(array $subRelation = [], Closure $closure = null): Collection - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - $this->baseQuery(); - - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - - return $this->query->relation($subRelation) - ->select() - ->setParent(clone $this->parent); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null) - { - throw new Exception('relation not support: has'); - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null) - { - throw new Exception('relation not support: hasWhere'); - } - - /** - * 预载入关联查询 - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $morphType = $this->morphType; - $morphKey = $this->morphKey; - $type = $this->type; - $range = []; - - foreach ($resultSet as $result) { - $pk = $result->getPk(); - // 获取关联外键列表 - if (isset($result->$pk)) { - $range[] = $result->$pk; - } - } - - if (!empty($range)) { - $where = [ - [$morphKey, 'in', $range], - [$morphType, '=', $type], - ]; - $data = $this->eagerlyMorphToMany($where, $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - if (!isset($data[$result->$pk])) { - $data[$result->$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$result->$pk], clone $this->parent)); - } - } - } - - /** - * 预载入关联查询 - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $pk = $result->getPk(); - - if (isset($result->$pk)) { - $key = $result->$pk; - $data = $this->eagerlyMorphToMany([ - [$this->morphKey, '=', $key], - [$this->morphType, '=', $this->type], - ], $subRelation, $closure, $cache); - - if (!isset($data[$key])) { - $data[$key] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$key], clone $this->parent)); - } - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return mixed - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null) - { - $pk = $result->getPk(); - - if (!isset($result->$pk)) { - return 0; - } - - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query - ->where([ - [$this->morphKey, '=', $result->$pk], - [$this->morphType, '=', $this->type], - ]) - ->$aggregate($field); - } - - /** - * 获取关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string - { - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->query - ->whereExp($this->morphKey, '=' . $this->parent->getTable() . '.' . $this->parent->getPk()) - ->where($this->morphType, '=', $this->type) - ->fetchSql() - ->$aggregate($field); - } - - /** - * 多态一对多 关联模型预查询 - * @access protected - * @param array $where 关联预查询条件 - * @param array $subRelation 子关联 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyMorphToMany(array $where, array $subRelation = [], Closure $closure = null, array $cache = []): array - { - // 预载入关联查询 支持嵌套预载入 - $this->query->removeOption('where'); - - if ($closure) { - $this->baseQuery = true; - $closure($this->getClosureType($closure)); - } - - $list = $this->query - ->where($where) - ->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select(); - $morphKey = $this->morphKey; - - // 组装模型数据 - $data = []; - foreach ($list as $set) { - $key = $set->$morphKey; - - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { - continue; - } - - $data[$key][] = $set; - } - - return $data; - } - - /** - * 保存(新增)当前关联数据对象 - * @access public - * @param mixed $data 数据 可以使用数组 关联模型对象 - * @param bool $replace 是否自动识别更新和写入 - * @return Model|false - */ - public function save($data, bool $replace = true) - { - $model = $this->make(); - - return $model->replace($replace)->save($data) ? $model : false; - } - - /** - * 创建关联对象实例 - * @param array|Model $data - * @return Model - */ - public function make($data = []): Model - { - if ($data instanceof Model) { - $data = $data->getData(); - } - - // 保存关联表数据 - $pk = $this->parent->getPk(); - - $data[$this->morphKey] = $this->parent->$pk; - $data[$this->morphType] = $this->type; - - return new $this->model($data); - } - - /** - * 批量保存当前关联数据对象 - * @access public - * @param iterable $dataSet 数据集 - * @param boolean $replace 是否自动识别更新和写入 - * @return array|false - */ - public function saveAll(iterable $dataSet, bool $replace = true) - { - $result = []; - - foreach ($dataSet as $key => $data) { - $result[] = $this->save($data, $replace); - } - - return empty($result) ? false : $result; - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery) && $this->parent->getData()) { - $pk = $this->parent->getPk(); - - $this->query->where([ - [$this->morphKey, '=', $this->parent->$pk], - [$this->morphType, '=', $this->type], - ]); - - $this->baseQuery = true; - } - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/MorphOne.php b/vendor/topthink/think-orm/src/model/relation/MorphOne.php deleted file mode 100644 index 6789c76..0000000 --- a/vendor/topthink/think-orm/src/model/relation/MorphOne.php +++ /dev/null @@ -1,280 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use think\db\BaseQuery as Query; -use think\db\exception\DbException as Exception; -use think\helper\Str; -use think\Model; -use think\model\Relation; - -/** - * 多态一对一关联类 - */ -class MorphOne extends Relation -{ - /** - * 多态关联外键 - * @var string - */ - protected $morphKey; - - /** - * 多态字段 - * @var string - */ - protected $morphType; - - /** - * 多态类型 - * @var string - */ - protected $type; - - /** - * 构造函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 模型名 - * @param string $morphKey 关联外键 - * @param string $morphType 多态字段名 - * @param string $type 多态类型 - */ - public function __construct(Model $parent, string $model, string $morphKey, string $morphType, string $type) - { - $this->parent = $parent; - $this->model = $model; - $this->type = $type; - $this->morphKey = $morphKey; - $this->morphType = $morphType; - $this->query = (new $model)->db(); - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Model - */ - public function getRelation(array $subRelation = [], Closure $closure = null) - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - $this->baseQuery(); - - $relationModel = $this->query->relation($subRelation)->find(); - - if ($relationModel) { - $relationModel->setParent(clone $this->parent); - } - - return $relationModel; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null) - { - return $this->parent; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null) - { - throw new Exception('relation not support: hasWhere'); - } - - /** - * 预载入关联查询 - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $morphType = $this->morphType; - $morphKey = $this->morphKey; - $type = $this->type; - $range = []; - - foreach ($resultSet as $result) { - $pk = $result->getPk(); - // 获取关联外键列表 - if (isset($result->$pk)) { - $range[] = $result->$pk; - } - } - - if (!empty($range)) { - $data = $this->eagerlyMorphToOne([ - [$morphKey, 'in', $range], - [$morphType, '=', $type], - ], $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - if (!isset($data[$result->$pk])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$pk]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - $result->setRelation($relation, $relationModel); - } - } - } - - /** - * 预载入关联查询 - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - $pk = $result->getPk(); - - if (isset($result->$pk)) { - $pk = $result->$pk; - $data = $this->eagerlyMorphToOne([ - [$this->morphKey, '=', $pk], - [$this->morphType, '=', $this->type], - ], $subRelation, $closure, $cache); - - if (isset($data[$pk])) { - $relationModel = $data[$pk]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } else { - $relationModel = null; - } - - $result->setRelation($relation, $relationModel); - } - } - - /** - * 多态一对一 关联模型预查询 - * @access protected - * @param array $where 关联预查询条件 - * @param array $subRelation 子关联 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyMorphToOne(array $where, array $subRelation = [], $closure = null, array $cache = []): array - { - // 预载入关联查询 支持嵌套预载入 - if ($closure) { - $this->baseQuery = true; - $closure($this->getClosureType($closure)); - } - - $list = $this->query - ->where($where) - ->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select(); - $morphKey = $this->morphKey; - - // 组装模型数据 - $data = []; - - foreach ($list as $set) { - $data[$set->$morphKey] = $set; - } - - return $data; - } - - /** - * 保存(新增)当前关联数据对象 - * @access public - * @param mixed $data 数据 可以使用数组 关联模型对象 - * @param boolean $replace 是否自动识别更新和写入 - * @return Model|false - */ - public function save($data, bool $replace = true) - { - $model = $this->make(); - return $model->replace($replace)->save($data) ? $model : false; - } - - /** - * 创建关联对象实例 - * @param array|Model $data - * @return Model - */ - public function make($data = []): Model - { - if ($data instanceof Model) { - $data = $data->getData(); - } - - // 保存关联表数据 - $pk = $this->parent->getPk(); - - $data[$this->morphKey] = $this->parent->$pk; - $data[$this->morphType] = $this->type; - - return new $this->model($data); - } - - /** - * 执行基础查询(进执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery) && $this->parent->getData()) { - $pk = $this->parent->getPk(); - - $this->query->where([ - [$this->morphKey, '=', $this->parent->$pk], - [$this->morphType, '=', $this->type], - ]); - $this->baseQuery = true; - } - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/MorphTo.php b/vendor/topthink/think-orm/src/model/relation/MorphTo.php deleted file mode 100644 index 986380e..0000000 --- a/vendor/topthink/think-orm/src/model/relation/MorphTo.php +++ /dev/null @@ -1,332 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use think\db\exception\DbException as Exception; -use think\helper\Str; -use think\Model; -use think\model\Relation; - -/** - * 多态关联类 - */ -class MorphTo extends Relation -{ - /** - * 多态关联外键 - * @var string - */ - protected $morphKey; - - /** - * 多态字段 - * @var string - */ - protected $morphType; - - /** - * 多态别名 - * @var array - */ - protected $alias = []; - - /** - * 关联名 - * @var string - */ - protected $relation; - - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $morphType 多态字段名 - * @param string $morphKey 外键名 - * @param array $alias 多态别名定义 - * @param string $relation 关联名 - */ - public function __construct(Model $parent, string $morphType, string $morphKey, array $alias = [], string $relation = null) - { - $this->parent = $parent; - $this->morphType = $morphType; - $this->morphKey = $morphKey; - $this->alias = $alias; - $this->relation = $relation; - } - - /** - * 获取当前的关联模型类的实例 - * @access public - * @return Model - */ - public function getModel(): Model - { - $morphType = $this->morphType; - $model = $this->parseModel($this->parent->$morphType); - - return (new $model); - } - - /** - * 延迟获取关联数据 - * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 - * @return Model - */ - public function getRelation(array $subRelation = [], Closure $closure = null) - { - $morphKey = $this->morphKey; - $morphType = $this->morphType; - - // 多态模型 - $model = $this->parseModel($this->parent->$morphType); - - // 主键数据 - $pk = $this->parent->$morphKey; - - $relationModel = (new $model)->relation($subRelation)->find($pk); - - if ($relationModel) { - $relationModel->setParent(clone $this->parent); - } - - return $relationModel; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null) - { - return $this->parent; - } - - /** - * 根据关联条件查询当前模型 - * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 - * @return Query - */ - public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null) - { - throw new Exception('relation not support: hasWhere'); - } - - /** - * 解析模型的完整命名空间 - * @access protected - * @param string $model 模型名(或者完整类名) - * @return string - */ - protected function parseModel(string $model): string - { - if (isset($this->alias[$model])) { - $model = $this->alias[$model]; - } - - if (false === strpos($model, '\\')) { - $path = explode('\\', get_class($this->parent)); - array_pop($path); - array_push($path, Str::studly($model)); - $model = implode('\\', $path); - } - - return $model; - } - - /** - * 设置多态别名 - * @access public - * @param array $alias 别名定义 - * @return $this - */ - public function setAlias(array $alias) - { - $this->alias = $alias; - - return $this; - } - - /** - * 移除关联查询参数 - * @access public - * @return $this - */ - public function removeOption() - { - return $this; - } - - /** - * 预载入关联查询 - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - * @throws Exception - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $morphKey = $this->morphKey; - $morphType = $this->morphType; - $range = []; - - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (!empty($result->$morphKey)) { - $range[$result->$morphType][] = $result->$morphKey; - } - } - - if (!empty($range)) { - - foreach ($range as $key => $val) { - // 多态类型映射 - $model = $this->parseModel($key); - $obj = new $model; - $pk = $obj->getPk(); - $list = $obj->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select($val); - $data = []; - - foreach ($list as $k => $vo) { - $data[$vo->$pk] = $vo; - } - - foreach ($resultSet as $result) { - if ($key == $result->$morphType) { - // 关联模型 - if (!isset($data[$result->$morphKey])) { - $relationModel = null; - } else { - $relationModel = $data[$result->$morphKey]; - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - $result->setRelation($relation, $relationModel); - } - } - } - } - } - - /** - * 预载入关联查询 - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void - { - // 多态类型映射 - $model = $this->parseModel($result->{$this->morphType}); - - $this->eagerlyMorphToOne($model, $relation, $result, $subRelation, $cache); - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @return integer - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*') - {} - - /** - * 多态MorphTo 关联模型预查询 - * @access protected - * @param string $model 关联模型对象 - * @param string $relation 关联名 - * @param Model $result - * @param array $subRelation 子关联 - * @param array $cache 关联缓存 - * @return void - */ - protected function eagerlyMorphToOne(string $model, string $relation, Model $result, array $subRelation = [], array $cache = []): void - { - // 预载入关联查询 支持嵌套预载入 - $pk = $this->parent->{$this->morphKey}; - $data = (new $model)->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->find($pk); - - if ($data) { - $data->setParent(clone $result); - $data->exists(true); - } - - $result->setRelation($relation, $data ?: null); - } - - /** - * 添加关联数据 - * @access public - * @param Model $model 关联模型对象 - * @param string $type 多态类型 - * @return Model - */ - public function associate(Model $model, string $type = ''): Model - { - $morphKey = $this->morphKey; - $morphType = $this->morphType; - $pk = $model->getPk(); - - $this->parent->setAttr($morphKey, $model->$pk); - $this->parent->setAttr($morphType, $type ?: get_class($model)); - $this->parent->save(); - - return $this->parent->setRelation($this->relation, $model); - } - - /** - * 注销关联数据 - * @access public - * @return Model - */ - public function dissociate(): Model - { - $morphKey = $this->morphKey; - $morphType = $this->morphType; - - $this->parent->setAttr($morphKey, null); - $this->parent->setAttr($morphType, null); - $this->parent->save(); - - return $this->parent->setRelation($this->relation, null); - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/MorphToMany.php b/vendor/topthink/think-orm/src/model/relation/MorphToMany.php deleted file mode 100644 index 88bbf9a..0000000 --- a/vendor/topthink/think-orm/src/model/relation/MorphToMany.php +++ /dev/null @@ -1,458 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use Exception; -use think\db\BaseQuery as Query; -use think\db\Raw; -use think\Model; -use think\model\Pivot; - -/** - * 多态多对多关联 - */ -class MorphToMany extends BelongsToMany -{ - - /** - * 多态字段名 - * @var string - */ - protected $morphType; - - /** - * 多态模型名 - * @var string - */ - protected $morphClass; - - /** - * 是否反向关联 - * @var bool - */ - protected $inverse; - - /** - * 架构函数 - * @access public - * @param Model $parent 上级模型对象 - * @param string $model 模型名 - * @param string $middle 中间表名/模型名 - * @param string $morphKey 关联外键 - * @param string $morphType 多态字段名 - * @param string $localKey 当前模型关联键 - * @param bool $inverse 反向关联 - */ - public function __construct(Model $parent, string $model, string $middle, string $morphType, string $morphKey, string $localKey, bool $inverse = false) - { - $this->morphType = $morphType; - $this->inverse = $inverse; - $this->morphClass = $inverse ? $model : get_class($parent); - - $foreignKey = $inverse ? $morphKey : $localKey; - $localKey = $inverse ? $localKey : $morphKey; - - parent::__construct($parent, $model, $middle, $foreignKey, $localKey); - } - - /** - * 预载入关联查询(数据集) - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $pk = $resultSet[0]->getPk(); - $range = []; - - foreach ($resultSet as $result) { - // 获取关联外键列表 - if (isset($result->$pk)) { - $range[] = $result->$pk; - } - } - - if (!empty($range)) { - // 查询关联数据 - $data = $this->eagerlyManyToMany([ - ['pivot.' . $this->localKey, 'in', $range], - ['pivot.' . $this->morphType, '=', $this->morphClass], - ], $subRelation, $closure, $cache); - - // 关联数据封装 - foreach ($resultSet as $result) { - if (!isset($data[$result->$pk])) { - $data[$result->$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$result->$pk], clone $this->parent)); - } - } - } - - /** - * 预载入关联查询(单个数据) - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation, Closure $closure = null, array $cache = []): void - { - $pk = $result->getPk(); - - if (isset($result->$pk)) { - $pk = $result->$pk; - // 查询管理数据 - $data = $this->eagerlyManyToMany([ - ['pivot.' . $this->localKey, '=', $pk], - ['pivot.' . $this->morphType, '=', $this->morphClass], - ], $subRelation, $closure, $cache); - - // 关联数据封装 - if (!isset($data[$pk])) { - $data[$pk] = []; - } - - $result->setRelation($relation, $this->resultSetBuild($data[$pk], clone $this->parent)); - } - } - - /** - * 关联统计 - * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return integer - */ - public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): float - { - $pk = $result->getPk(); - - if (!isset($result->$pk)) { - return 0; - } - - $pk = $result->$pk; - - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->belongsToManyQuery($this->foreignKey, $this->localKey, [ - ['pivot.' . $this->localKey, '=', $pk], - ['pivot.' . $this->morphType, '=', $this->morphClass], - ])->$aggregate($field); - } - - /** - * 获取关联统计子查询 - * @access public - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 - * @param string $name 统计字段别名 - * @return string - */ - public function getRelationCountQuery(Closure $closure = null, string $aggregate = 'count', string $field = '*', string &$name = null): string - { - if ($closure) { - $closure($this->getClosureType($closure), $name); - } - - return $this->belongsToManyQuery($this->foreignKey, $this->localKey, [ - ['pivot.' . $this->localKey, 'exp', new Raw('=' . $this->parent->db(false)->getTable() . '.' . $this->parent->getPk())], - ['pivot.' . $this->morphType, '=', $this->morphClass], - ])->fetchSql()->$aggregate($field); - } - - /** - * BELONGS TO MANY 关联查询 - * @access protected - * @param string $foreignKey 关联模型关联键 - * @param string $localKey 当前模型关联键 - * @param array $condition 关联查询条件 - * @return Query - */ - protected function belongsToManyQuery(string $foreignKey, string $localKey, array $condition = []): Query - { - // 关联查询封装 - $tableName = $this->query->getTable(); - $table = $this->pivot->db()->getTable(); - $fields = $this->getQueryFields($tableName); - - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - - $query = $this->query - ->field($fields) - ->tableField(true, $table, 'pivot', 'pivot__'); - - if (empty($this->baseQuery)) { - $relationFk = $this->query->getPk(); - $query->join([$table => 'pivot'], 'pivot.' . $foreignKey . '=' . $tableName . '.' . $relationFk) - ->where($condition); - } - - return $query; - } - - /** - * 多对多 关联模型预查询 - * @access protected - * @param array $where 关联预查询条件 - * @param array $subRelation 子关联 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyManyToMany(array $where, array $subRelation = [], Closure $closure = null, array $cache = []): array - { - if ($closure) { - $closure($this->getClosureType($closure)); - } - - // 预载入关联查询 支持嵌套预载入 - $list = $this->belongsToManyQuery($this->foreignKey, $this->localKey, $where) - ->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select(); - - // 组装模型数据 - $data = []; - foreach ($list as $set) { - $pivot = []; - foreach ($set->getData() as $key => $val) { - if (strpos($key, '__')) { - [$name, $attr] = explode('__', $key, 2); - if ('pivot' == $name) { - $pivot[$attr] = $val; - unset($set->$key); - } - } - } - - $key = $pivot[$this->localKey]; - - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { - continue; - } - - $set->setRelation($this->pivotDataName, $this->newPivot($pivot)); - - $data[$key][] = $set; - } - - return $data; - } - - /** - * 附加关联的一个中间表数据 - * @access public - * @param mixed $data 数据 可以使用数组、关联模型对象 或者 关联对象的主键 - * @param array $pivot 中间表额外数据 - * @return array|Pivot - */ - public function attach($data, array $pivot = []) - { - if (is_array($data)) { - if (key($data) === 0) { - $id = $data; - } else { - // 保存关联表数据 - $model = new $this->model; - $id = $model->insertGetId($data); - } - } else if (is_numeric($data) || is_string($data)) { - // 根据关联表主键直接写入中间表 - $id = $data; - } else if ($data instanceof Model) { - // 根据关联表主键直接写入中间表 - $id = $data->getKey(); - } - - if (!empty($id)) { - // 保存中间表数据 - $pivot[$this->localKey] = $this->parent->getKey(); - $pivot[$this->morphType] = $this->morphClass; - $ids = (array) $id; - - $result = []; - - foreach ($ids as $id) { - $pivot[$this->foreignKey] = $id; - - $this->pivot->replace() - ->exists(false) - ->data([]) - ->save($pivot); - $result[] = $this->newPivot($pivot); - } - - if (count($result) == 1) { - // 返回中间表模型对象 - $result = $result[0]; - } - - return $result; - } else { - throw new Exception('miss relation data'); - } - } - - /** - * 判断是否存在关联数据 - * @access public - * @param mixed $data 数据 可以使用关联模型对象 或者 关联对象的主键 - * @return Pivot|false - */ - public function attached($data) - { - if ($data instanceof Model) { - $id = $data->getKey(); - } else { - $id = $data; - } - - $pivot = $this->pivot - ->where($this->localKey, $this->parent->getKey()) - ->where($this->morphType, $this->morphClass) - ->where($this->foreignKey, $id) - ->find(); - - return $pivot ?: false; - } - - /** - * 解除关联的一个中间表数据 - * @access public - * @param integer|array $data 数据 可以使用关联对象的主键 - * @param bool $relationDel 是否同时删除关联表数据 - * @return integer - */ - public function detach($data = null, bool $relationDel = false): int - { - if (is_array($data)) { - $id = $data; - } else if (is_numeric($data) || is_string($data)) { - // 根据关联表主键直接写入中间表 - $id = $data; - } else if ($data instanceof Model) { - // 根据关联表主键直接写入中间表 - $id = $data->getKey(); - } - - // 删除中间表数据 - $pivot = [ - [$this->localKey, '=', $this->parent->getKey()], - [$this->morphType, '=', $this->morphClass], - ]; - - if (isset($id)) { - $pivot[] = [$this->foreignKey, is_array($id) ? 'in' : '=', $id]; - } - - $result = $this->pivot->where($pivot)->delete(); - - // 删除关联表数据 - if (isset($id) && $relationDel) { - $model = $this->model; - $model::destroy($id); - } - - return $result; - } - - /** - * 数据同步 - * @access public - * @param array $ids - * @param bool $detaching - * @return array - */ - public function sync(array $ids, bool $detaching = true): array - { - $changes = [ - 'attached' => [], - 'detached' => [], - 'updated' => [], - ]; - - $current = $this->pivot - ->where($this->localKey, $this->parent->getKey()) - ->where($this->morphType, $this->morphClass) - ->column($this->foreignKey); - - $records = []; - - foreach ($ids as $key => $value) { - if (!is_array($value)) { - $records[$value] = []; - } else { - $records[$key] = $value; - } - } - - $detach = array_diff($current, array_keys($records)); - - if ($detaching && count($detach) > 0) { - $this->detach($detach); - $changes['detached'] = $detach; - } - - foreach ($records as $id => $attributes) { - if (!in_array($id, $current)) { - $this->attach($id, $attributes); - $changes['attached'][] = $id; - } else if (count($attributes) > 0 && $this->attach($id, $attributes)) { - $changes['updated'][] = $id; - } - } - - return $changes; - } - - /** - * 执行基础查询(仅执行一次) - * @access protected - * @return void - */ - protected function baseQuery(): void - { - if (empty($this->baseQuery)) { - $foreignKey = $this->foreignKey; - $localKey = $this->localKey; - - // 关联查询 - $this->belongsToManyQuery($foreignKey, $localKey, [ - ['pivot.' . $localKey, '=', $this->parent->getKey()], - ['pivot.' . $this->morphType, '=', $this->morphClass], - ]); - - $this->baseQuery = true; - } - } - -} diff --git a/vendor/topthink/think-orm/src/model/relation/OneToOne.php b/vendor/topthink/think-orm/src/model/relation/OneToOne.php deleted file mode 100644 index 65bbfda..0000000 --- a/vendor/topthink/think-orm/src/model/relation/OneToOne.php +++ /dev/null @@ -1,328 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\model\relation; - -use Closure; -use think\db\BaseQuery as Query; -use think\db\exception\DbException as Exception; -use think\helper\Str; -use think\Model; -use think\model\Relation; - -/** - * 一对一关联基础类 - * @package think\model\relation - */ -abstract class OneToOne extends Relation -{ - /** - * JOIN类型 - * @var string - */ - protected $joinType = 'INNER'; - - /** - * 绑定的关联属性 - * @var array - */ - protected $bindAttr = []; - - /** - * 关联名 - * @var string - */ - protected $relation; - - /** - * 设置join类型 - * @access public - * @param string $type JOIN类型 - * @return $this - */ - public function joinType(string $type) - { - $this->joinType = $type; - return $this; - } - - /** - * 预载入关联查询(JOIN方式) - * @access public - * @param Query $query 查询对象 - * @param string $relation 关联名 - * @param mixed $field 关联字段 - * @param string $joinType JOIN方式 - * @param Closure $closure 闭包条件 - * @param bool $first - * @return void - */ - public function eagerly(Query $query, string $relation, $field = true, string $joinType = '', Closure $closure = null, bool $first = false): void - { - $name = Str::snake(class_basename($this->parent)); - - if ($first) { - $table = $query->getTable(); - $query->table([$table => $name]); - - if ($query->getOptions('field')) { - $masterField = $query->getOptions('field'); - $query->removeOption('field'); - } else { - $masterField = true; - } - - $query->tableField($masterField, $table, $name); - } - - // 预载入封装 - $joinTable = $this->query->getTable(); - $joinAlias = $relation; - $joinType = $joinType ?: $this->joinType; - - $query->via($joinAlias); - - if ($this instanceof BelongsTo) { - $joinOn = $name . '.' . $this->foreignKey . '=' . $joinAlias . '.' . $this->localKey; - } else { - $joinOn = $name . '.' . $this->localKey . '=' . $joinAlias . '.' . $this->foreignKey; - } - - if ($closure) { - // 执行闭包查询 - $closure($this->getClosureType($closure)); - - // 使用withField指定获取关联的字段 - if ($this->withField) { - $field = $this->withField; - } - } - - $query->join([$joinTable => $joinAlias], $joinOn, $joinType) - ->tableField($field, $joinTable, $joinAlias, $relation . '__'); - } - - /** - * 预载入关联查询(数据集) - * @access protected - * @param array $resultSet - * @param string $relation - * @param array $subRelation - * @param Closure $closure - * @return mixed - */ - abstract protected function eagerlySet(array &$resultSet, string $relation, array $subRelation = [], Closure $closure = null); - - /** - * 预载入关联查询(数据) - * @access protected - * @param Model $result - * @param string $relation - * @param array $subRelation - * @param Closure $closure - * @return mixed - */ - abstract protected function eagerlyOne(Model $result, string $relation, array $subRelation = [], Closure $closure = null); - - /** - * 预载入关联查询(数据集) - * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @param bool $join 是否为JOIN方式 - * @return void - */ - public function eagerlyResultSet(array &$resultSet, string $relation, array $subRelation = [], Closure $closure = null, array $cache = [], bool $join = false): void - { - if ($join) { - // 模型JOIN关联组装 - foreach ($resultSet as $result) { - $this->match($this->model, $relation, $result); - } - } else { - // IN查询 - $this->eagerlySet($resultSet, $relation, $subRelation, $closure, $cache); - } - } - - /** - * 预载入关联查询(数据) - * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 - * @param bool $join 是否为JOIN方式 - * @return void - */ - public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = [], bool $join = false): void - { - if ($join) { - // 模型JOIN关联组装 - $this->match($this->model, $relation, $result); - } else { - // IN查询 - $this->eagerlyOne($result, $relation, $subRelation, $closure, $cache); - } - } - - /** - * 保存(新增)当前关联数据对象 - * @access public - * @param mixed $data 数据 可以使用数组 关联模型对象 - * @param boolean $replace 是否自动识别更新和写入 - * @return Model|false - */ - public function save($data, bool $replace = true) - { - if ($data instanceof Model) { - $data = $data->getData(); - } - - $model = new $this->model; - // 保存关联表数据 - $data[$this->foreignKey] = $this->parent->{$this->localKey}; - - return $model->replace($replace)->save($data) ? $model : false; - } - - /** - * 绑定关联表的属性到父模型属性 - * @access public - * @param array $attr 要绑定的属性列表 - * @return $this - */ - public function bind(array $attr) - { - $this->bindAttr = $attr; - - return $this; - } - - /** - * 获取绑定属性 - * @access public - * @return array - */ - public function getBindAttr(): array - { - return $this->bindAttr; - } - - /** - * 一对一 关联模型预查询拼装 - * @access public - * @param string $model 模型名称 - * @param string $relation 关联名 - * @param Model $result 模型对象实例 - * @return void - */ - protected function match(string $model, string $relation, Model $result): void - { - // 重新组装模型数据 - foreach ($result->getData() as $key => $val) { - if (strpos($key, '__')) { - [$name, $attr] = explode('__', $key, 2); - if ($name == $relation) { - $list[$name][$attr] = $val; - unset($result->$key); - } - } - } - - if (isset($list[$relation])) { - $array = array_unique($list[$relation]); - - if (count($array) == 1 && null === current($array)) { - $relationModel = null; - } else { - $relationModel = new $model($list[$relation]); - $relationModel->setParent(clone $result); - $relationModel->exists(true); - } - - if (!empty($this->bindAttr)) { - $this->bindAttr($result, $relationModel); - } - } else { - $relationModel = null; - } - - $result->setRelation($relation, $relationModel); - } - - /** - * 绑定关联属性到父模型 - * @access protected - * @param Model $result 父模型对象 - * @param Model $model 关联模型对象 - * @return void - * @throws Exception - */ - protected function bindAttr(Model $result, Model $model = null): void - { - foreach ($this->bindAttr as $key => $attr) { - $key = is_numeric($key) ? $attr : $key; - $value = $result->getOrigin($key); - - if (!is_null($value)) { - throw new Exception('bind attr has exists:' . $key); - } - - $result->setAttr($key, $model ? $model->$attr : null); - } - } - - /** - * 一对一 关联模型预查询(IN方式) - * @access public - * @param array $where 关联预查询条件 - * @param string $key 关联键名 - * @param array $subRelation 子关联 - * @param Closure $closure - * @param array $cache 关联缓存 - * @return array - */ - protected function eagerlyWhere(array $where, string $key, array $subRelation = [], Closure $closure = null, array $cache = []) - { - // 预载入关联查询 支持嵌套预载入 - if ($closure) { - $this->baseQuery = true; - $closure($this->getClosureType($closure)); - } - - if ($this->withField) { - $this->query->field($this->withField); - } - - $list = $this->query - ->where($where) - ->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->select(); - - // 组装模型数据 - $data = []; - - foreach ($list as $set) { - if (!isset($data[$set->$key])) { - $data[$set->$key] = $set; - } - } - - return $data; - } - -} diff --git a/vendor/topthink/think-orm/src/paginator/driver/Bootstrap.php b/vendor/topthink/think-orm/src/paginator/driver/Bootstrap.php deleted file mode 100644 index 6d55c39..0000000 --- a/vendor/topthink/think-orm/src/paginator/driver/Bootstrap.php +++ /dev/null @@ -1,209 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace think\paginator\driver; - -use think\Paginator; - -/** - * Bootstrap 分页驱动 - */ -class Bootstrap extends Paginator -{ - - /** - * 上一页按钮 - * @param string $text - * @return string - */ - protected function getPreviousButton(string $text = "«"): string - { - - if ($this->currentPage() <= 1) { - return $this->getDisabledTextWrapper($text); - } - - $url = $this->url( - $this->currentPage() - 1 - ); - - return $this->getPageLinkWrapper($url, $text); - } - - /** - * 下一页按钮 - * @param string $text - * @return string - */ - protected function getNextButton(string $text = '»'): string - { - if (!$this->hasMore) { - return $this->getDisabledTextWrapper($text); - } - - $url = $this->url($this->currentPage() + 1); - - return $this->getPageLinkWrapper($url, $text); - } - - /** - * 页码按钮 - * @return string - */ - protected function getLinks(): string - { - if ($this->simple) { - return ''; - } - - $block = [ - 'first' => null, - 'slider' => null, - 'last' => null, - ]; - - $side = 3; - $window = $side * 2; - - if ($this->lastPage < $window + 6) { - $block['first'] = $this->getUrlRange(1, $this->lastPage); - } elseif ($this->currentPage <= $window) { - $block['first'] = $this->getUrlRange(1, $window + 2); - $block['last'] = $this->getUrlRange($this->lastPage - 1, $this->lastPage); - } elseif ($this->currentPage > ($this->lastPage - $window)) { - $block['first'] = $this->getUrlRange(1, 2); - $block['last'] = $this->getUrlRange($this->lastPage - ($window + 2), $this->lastPage); - } else { - $block['first'] = $this->getUrlRange(1, 2); - $block['slider'] = $this->getUrlRange($this->currentPage - $side, $this->currentPage + $side); - $block['last'] = $this->getUrlRange($this->lastPage - 1, $this->lastPage); - } - - $html = ''; - - if (is_array($block['first'])) { - $html .= $this->getUrlLinks($block['first']); - } - - if (is_array($block['slider'])) { - $html .= $this->getDots(); - $html .= $this->getUrlLinks($block['slider']); - } - - if (is_array($block['last'])) { - $html .= $this->getDots(); - $html .= $this->getUrlLinks($block['last']); - } - - return $html; - } - - /** - * 渲染分页html - * @return mixed - */ - public function render() - { - if ($this->hasPages()) { - if ($this->simple) { - return sprintf( - '
      %s %s
    ', - $this->getPreviousButton(), - $this->getNextButton() - ); - } else { - return sprintf( - '
      %s %s %s
    ', - $this->getPreviousButton(), - $this->getLinks(), - $this->getNextButton() - ); - } - } - } - - /** - * 生成一个可点击的按钮 - * - * @param string $url - * @param string $page - * @return string - */ - protected function getAvailablePageWrapper(string $url, string $page): string - { - return '
  • ' . $page . '
  • '; - } - - /** - * 生成一个禁用的按钮 - * - * @param string $text - * @return string - */ - protected function getDisabledTextWrapper(string $text): string - { - return '
  • ' . $text . '
  • '; - } - - /** - * 生成一个激活的按钮 - * - * @param string $text - * @return string - */ - protected function getActivePageWrapper(string $text): string - { - return '
  • ' . $text . '
  • '; - } - - /** - * 生成省略号按钮 - * - * @return string - */ - protected function getDots(): string - { - return $this->getDisabledTextWrapper('...'); - } - - /** - * 批量生成页码按钮. - * - * @param array $urls - * @return string - */ - protected function getUrlLinks(array $urls): string - { - $html = ''; - - foreach ($urls as $page => $url) { - $html .= $this->getPageLinkWrapper($url, $page); - } - - return $html; - } - - /** - * 生成普通页码按钮 - * - * @param string $url - * @param string $page - * @return string - */ - protected function getPageLinkWrapper(string $url, string $page): string - { - if ($this->currentPage() == $page) { - return $this->getActivePageWrapper($page); - } - - return $this->getAvailablePageWrapper($url, $page); - } -} diff --git a/vendor/topthink/think-orm/stubs/Exception.php b/vendor/topthink/think-orm/stubs/Exception.php deleted file mode 100644 index 0fdba9c..0000000 --- a/vendor/topthink/think-orm/stubs/Exception.php +++ /dev/null @@ -1,59 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types=1); - -namespace think; - -/** - * 异常基础类 - * @package think - */ -class Exception extends \Exception -{ - /** - * 保存异常页面显示的额外Debug数据 - * @var array - */ - protected $data = []; - - /** - * 设置异常额外的Debug数据 - * 数据将会显示为下面的格式 - * - * Exception Data - * -------------------------------------------------- - * Label 1 - * key1 value1 - * key2 value2 - * Label 2 - * key1 value1 - * key2 value2 - * - * @access protected - * @param string $label 数据分类,用于异常页面显示 - * @param array $data 需要显示的数据,必须为关联数组 - */ - final protected function setData(string $label, array $data) - { - $this->data[$label] = $data; - } - - /** - * 获取异常额外Debug数据 - * 主要用于输出到异常页面便于调试 - * @access public - * @return array 由setData设置的Debug数据 - */ - final public function getData() - { - return $this->data; - } -} diff --git a/vendor/topthink/think-orm/stubs/Facade.php b/vendor/topthink/think-orm/stubs/Facade.php deleted file mode 100644 index d801d8b..0000000 --- a/vendor/topthink/think-orm/stubs/Facade.php +++ /dev/null @@ -1,65 +0,0 @@ - -// +---------------------------------------------------------------------- -declare(strict_types=1); - -namespace think; - -class Facade -{ - /** - * 始终创建新的对象实例 - * @var bool - */ - protected static $alwaysNewInstance; - - protected static $instance; - - /** - * 获取当前Facade对应类名 - * @access protected - * @return string - */ - protected static function getFacadeClass() - {} - - /** - * 创建Facade实例 - * @static - * @access protected - * @param bool $newInstance 是否每次创建新的实例 - * @return object - */ - protected static function createFacade(bool $newInstance = false) - { - $class = static::getFacadeClass() ?: 'think\DbManager'; - - if (static::$alwaysNewInstance) { - $newInstance = true; - } - - if ($newInstance) { - return new $class(); - } - - if (!self::$instance) { - self::$instance = new $class(); - } - - return self::$instance; - - } - - // 调用实际类的方法 - public static function __callStatic($method, $params) - { - return call_user_func_array([static::createFacade(), $method], $params); - } -} diff --git a/vendor/topthink/think-orm/stubs/load_stubs.php b/vendor/topthink/think-orm/stubs/load_stubs.php deleted file mode 100644 index 5854cda..0000000 --- a/vendor/topthink/think-orm/stubs/load_stubs.php +++ /dev/null @@ -1,9 +0,0 @@ -=7.1.0", - "topthink/framework": "^6.0.0" - }, - "autoload": { - "psr-4": { - "think\\trace\\": "src" - } - }, - "extra": { - "think":{ - "services":[ - "think\\trace\\Service" - ], - "config":{ - "trace": "src/config.php" - } - } - }, - "minimum-stability": "dev" -} diff --git a/vendor/topthink/think-trace/src/Console.php b/vendor/topthink/think-trace/src/Console.php deleted file mode 100644 index c97d1e0..0000000 --- a/vendor/topthink/think-trace/src/Console.php +++ /dev/null @@ -1,173 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); -namespace think\trace; - -use think\App; -use think\Response; - -/** - * 浏览器调试输出 - */ -class Console -{ - protected $config = [ - 'tabs' => ['base' => '基本', 'file' => '文件', 'info' => '流程', 'notice|error' => '错误', 'sql' => 'SQL', 'debug|log' => '调试'], - ]; - - // 实例化并传入参数 - public function __construct(array $config = []) - { - $this->config = array_merge($this->config, $config); - } - - /** - * 调试输出接口 - * @access public - * @param Response $response Response对象 - * @param array $log 日志信息 - * @return string|bool - */ - public function output(App $app, Response $response, array $log = []) - { - $request = $app->request; - $contentType = $response->getHeader('Content-Type'); - - if ($request->isJson() || $request->isAjax()) { - return false; - } elseif (!empty($contentType) && strpos($contentType, 'html') === false) { - return false; - } elseif ($response->getCode() == 204) { - return false; - } - - // 获取基本信息 - $runtime = number_format(microtime(true) - $app->getBeginTime(), 10, '.', ''); - $reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞'; - $mem = number_format((memory_get_usage() - $app->getBeginMem()) / 1024, 2); - - if ($request->host()) { - $uri = $request->protocol() . ' ' . $request->method() . ' : ' . $request->url(true); - } else { - $uri = 'cmd:' . implode(' ', $_SERVER['argv']); - } - - // 页面Trace信息 - $base = [ - '请求信息' => date('Y-m-d H:i:s', $request->time() ?: time()) . ' ' . $uri, - '运行时间' => number_format((float) $runtime, 6) . 's [ 吞吐率:' . $reqs . 'req/s ] 内存消耗:' . $mem . 'kb 文件加载:' . count(get_included_files()), - '查询信息' => $app->db->getQueryTimes() . ' queries', - '缓存信息' => $app->cache->getReadTimes() . ' reads,' . $app->cache->getWriteTimes() . ' writes', - ]; - - if (isset($app->session)) { - $base['会话信息'] = 'SESSION_ID=' . $app->session->getId(); - } - - $info = $this->getFileInfo(); - - // 页面Trace信息 - $trace = []; - foreach ($this->config['tabs'] as $name => $title) { - $name = strtolower($name); - switch ($name) { - case 'base': // 基本信息 - $trace[$title] = $base; - break; - case 'file': // 文件信息 - $trace[$title] = $info; - break; - default: // 调试信息 - if (strpos($name, '|')) { - // 多组信息 - $names = explode('|', $name); - $result = []; - foreach ($names as $item) { - $result = array_merge($result, $log[$item] ?? []); - } - $trace[$title] = $result; - } else { - $trace[$title] = $log[$name] ?? ''; - } - } - } - - //输出到控制台 - $lines = ''; - foreach ($trace as $type => $msg) { - $lines .= $this->console($type, empty($msg) ? [] : $msg); - } - $js = << -{$lines} - -JS; - return $js; - } - - protected function console(string $type, $msg) - { - $type = strtolower($type); - $trace_tabs = array_values($this->config['tabs']); - $line = []; - $line[] = ($type == $trace_tabs[0] || '调试' == $type || '错误' == $type) - ? "console.group('{$type}');" - : "console.groupCollapsed('{$type}');"; - - foreach ((array) $msg as $key => $m) { - switch ($type) { - case '调试': - $var_type = gettype($m); - if (in_array($var_type, ['array', 'string'])) { - $line[] = "console.log(" . json_encode($m) . ");"; - } else { - $line[] = "console.log(" . json_encode(var_export($m, true)) . ");"; - } - break; - case '错误': - $msg = str_replace("\n", '\n', addslashes(is_scalar($m) ? $m : json_encode($m))); - $style = 'color:#F4006B;font-size:14px;'; - $line[] = "console.error(\"%c{$msg}\", \"{$style}\");"; - break; - case 'sql': - $msg = str_replace("\n", '\n', addslashes($m)); - $style = "color:#009bb4;"; - $line[] = "console.log(\"%c{$msg}\", \"{$style}\");"; - break; - default: - $m = is_string($key) ? $key . ' ' . $m : $key + 1 . ' ' . $m; - $msg = json_encode($m); - $line[] = "console.log({$msg});"; - break; - } - } - $line[] = "console.groupEnd();"; - return implode(PHP_EOL, $line); - } - - /** - * 获取文件加载信息 - * @access protected - * @return integer|array - */ - protected function getFileInfo() - { - $files = get_included_files(); - $info = []; - - foreach ($files as $key => $file) { - $info[] = $file . ' ( ' . number_format(filesize($file) / 1024, 2) . ' KB )'; - } - - return $info; - } -} diff --git a/vendor/topthink/think-trace/src/Html.php b/vendor/topthink/think-trace/src/Html.php deleted file mode 100644 index 35b3146..0000000 --- a/vendor/topthink/think-trace/src/Html.php +++ /dev/null @@ -1,126 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); -namespace think\trace; - -use think\App; -use think\Response; - -/** - * 页面Trace调试 - */ -class Html -{ - protected $config = [ - 'file' => '', - 'tabs' => ['base' => '基本', 'file' => '文件', 'info' => '流程', 'notice|error' => '错误', 'sql' => 'SQL', 'debug|log' => '调试'], - ]; - - // 实例化并传入参数 - public function __construct(array $config = []) - { - $this->config = array_merge($this->config, $config); - } - - /** - * 调试输出接口 - * @access public - * @param App $app 应用实例 - * @param Response $response Response对象 - * @param array $log 日志信息 - * @return bool|string - */ - public function output(App $app, Response $response, array $log = []) - { - $request = $app->request; - $contentType = $response->getHeader('Content-Type'); - - if ($request->isJson() || $request->isAjax()) { - return false; - } elseif (!empty($contentType) && strpos($contentType, 'html') === false) { - return false; - } elseif ($response->getCode() == 204) { - return false; - } - - // 获取基本信息 - $runtime = number_format(microtime(true) - $app->getBeginTime(), 10, '.', ''); - $reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞'; - $mem = number_format((memory_get_usage() - $app->getBeginMem()) / 1024, 2); - - // 页面Trace信息 - if ($request->host()) { - $uri = $request->protocol() . ' ' . $request->method() . ' : ' . $request->url(true); - } else { - $uri = 'cmd:' . implode(' ', $_SERVER['argv']); - } - - $base = [ - '请求信息' => date('Y-m-d H:i:s', $request->time() ?: time()) . ' ' . $uri, - '运行时间' => number_format((float) $runtime, 6) . 's [ 吞吐率:' . $reqs . 'req/s ] 内存消耗:' . $mem . 'kb 文件加载:' . count(get_included_files()), - '查询信息' => $app->db->getQueryTimes() . ' queries', - '缓存信息' => $app->cache->getReadTimes() . ' reads,' . $app->cache->getWriteTimes() . ' writes', - ]; - - if (isset($app->session)) { - $base['会话信息'] = 'SESSION_ID=' . $app->session->getId(); - } - - $info = $this->getFileInfo(); - - // 页面Trace信息 - $trace = []; - foreach ($this->config['tabs'] as $name => $title) { - $name = strtolower($name); - switch ($name) { - case 'base': // 基本信息 - $trace[$title] = $base; - break; - case 'file': // 文件信息 - $trace[$title] = $info; - break; - default: // 调试信息 - if (strpos($name, '|')) { - // 多组信息 - $names = explode('|', $name); - $result = []; - foreach ($names as $item) { - $result = array_merge($result, $log[$item] ?? []); - } - $trace[$title] = $result; - } else { - $trace[$title] = $log[$name] ?? ''; - } - } - } - // 调用Trace页面模板 - ob_start(); - include $this->config['file'] ?: __DIR__ . '/tpl/page_trace.tpl'; - return ob_get_clean(); - } - - /** - * 获取文件加载信息 - * @access protected - * @return integer|array - */ - protected function getFileInfo() - { - $files = get_included_files(); - $info = []; - - foreach ($files as $key => $file) { - $info[] = $file . ' ( ' . number_format(filesize($file) / 1024, 2) . ' KB )'; - } - - return $info; - } -} diff --git a/vendor/topthink/think-trace/src/Service.php b/vendor/topthink/think-trace/src/Service.php deleted file mode 100644 index 3e78ecc..0000000 --- a/vendor/topthink/think-trace/src/Service.php +++ /dev/null @@ -1,21 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace think\trace; - -use think\Service as BaseService; - -class Service extends BaseService -{ - public function register() - { - $this->app->middleware->add(TraceDebug::class); - } -} diff --git a/vendor/topthink/think-trace/src/TraceDebug.php b/vendor/topthink/think-trace/src/TraceDebug.php deleted file mode 100644 index 5ed9cbf..0000000 --- a/vendor/topthink/think-trace/src/TraceDebug.php +++ /dev/null @@ -1,109 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\trace; - -use Closure; -use think\App; -use think\Config; -use think\event\LogWrite; -use think\Request; -use think\Response; -use think\response\Redirect; - -/** - * 页面Trace中间件 - */ -class TraceDebug -{ - - /** - * Trace日志 - * @var array - */ - protected $log = []; - - /** - * 配置参数 - * @var array - */ - protected $config = []; - - /** @var App */ - protected $app; - - public function __construct(App $app, Config $config) - { - $this->app = $app; - $this->config = $config->get('trace'); - } - - /** - * 页面Trace调试 - * @access public - * @param Request $request - * @param Closure $next - * @return void - */ - public function handle($request, Closure $next) - { - $debug = $this->app->isDebug(); - - // 注册日志监听 - if ($debug) { - $this->log = []; - $this->app->event->listen(LogWrite::class, function ($event) { - if (empty($this->config['channel']) || $this->config['channel'] == $event->channel) { - $this->log = array_merge_recursive($this->log, $event->log); - } - }); - } - - $response = $next($request); - - // Trace调试注入 - if ($debug) { - $data = $response->getContent(); - $this->traceDebug($response, $data); - $response->content($data); - } - - return $response; - } - - public function traceDebug(Response $response, &$content) - { - $config = $this->config; - $type = $config['type'] ?? 'Html'; - - unset($config['type']); - - $trace = App::factory($type, '\\think\\trace\\', $config); - - if ($response instanceof Redirect) { - //TODO 记录 - } else { - $log = $this->app->log->getLog($config['channel'] ?? ''); - $log = array_merge_recursive($this->log, $log); - $output = $trace->output($this->app, $response, $log); - if (is_string($output)) { - // trace调试信息注入 - $pos = strripos($content, ''); - if (false !== $pos) { - $content = substr($content, 0, $pos) . $output . substr($content, $pos); - } else { - $content = $content . $output; - } - } - } - } -} diff --git a/vendor/topthink/think-trace/src/config.php b/vendor/topthink/think-trace/src/config.php deleted file mode 100644 index fad2392..0000000 --- a/vendor/topthink/think-trace/src/config.php +++ /dev/null @@ -1,10 +0,0 @@ - 'Html', - // 读取的日志通道名 - 'channel' => '', -]; diff --git a/vendor/topthink/think-trace/src/tpl/page_trace.tpl b/vendor/topthink/think-trace/src/tpl/page_trace.tpl deleted file mode 100644 index 6b1b9a1..0000000 --- a/vendor/topthink/think-trace/src/tpl/page_trace.tpl +++ /dev/null @@ -1,71 +0,0 @@ -
    - - -
    -
    -
    - -
    - - diff --git a/vendor/zircote/swagger-php/.gitignore b/vendor/zircote/swagger-php/.gitignore deleted file mode 100644 index 6857871..0000000 --- a/vendor/zircote/swagger-php/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/vendor -/composer.lock -/bin/* -!/bin/openapi -/openapi.json -/openapi.yaml -/docs/.vuepress/dist -.phpunit.result.cache -/.php_cs.cache diff --git a/vendor/zircote/swagger-php/.php_cs.dist b/vendor/zircote/swagger-php/.php_cs.dist deleted file mode 100644 index 572f893..0000000 --- a/vendor/zircote/swagger-php/.php_cs.dist +++ /dev/null @@ -1,69 +0,0 @@ -path('src')->name('*.php') - ->path('tests')->name('*.php') - ->notPath('tests/Fixtures') - ->in(__DIR__) -; - -return PhpCsFixer\Config::create() - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'no_unused_imports' => true, - 'blank_line_before_statement' => ['statements' => ['return']], - 'cast_spaces' => ['space' => 'single'], - 'concat_space' => true, - 'declare_strict_types' => true, - 'function_typehint_space' => true, - 'lowercase_cast' => true, - 'magic_constant_casing' => true, - 'method_separation' => true, - 'single_blank_line_before_namespace' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_around_offset' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'single_quote' => true, - 'method_separation' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_extra_consecutive_blank_lines' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, - 'ordered_imports' => true, - 'short_scalar_cast' => true, - 'space_after_semicolon' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - - 'no_empty_phpdoc' => true, - 'no_superfluous_phpdoc_tags' => true, - 'phpdoc_align' => true, - 'phpdoc_inline_tag' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_var_without_name' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => true, - 'phpdoc_trim' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_summary' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_separation' => true, - 'phpdoc_scalar' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_alias_tag' => true, - 'phpdoc_order' => true, - 'phpdoc_var_annotation_correct_order' => true, - 'phpdoc_var_without_name' => true, - ]) - ->setFinder($finder) -; diff --git a/vendor/zircote/swagger-php/.travis.yml b/vendor/zircote/swagger-php/.travis.yml deleted file mode 100644 index 3d7d9bc..0000000 --- a/vendor/zircote/swagger-php/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -sudo: false -language: php - -cache: - directories: - - $HOME/.composer/cache - -php: - - 7.2 - - 7.3 - - 7.4 - -matrix: - include: - - php: 7.4 - env: CS=yes - -before_script: - - composer self-update - - composer install --prefer-dist --no-interaction - -script: - - ./bin/phpunit - - if [ '$CS' = 'yes' ]; then composer run-script fix-cs; fi diff --git a/vendor/zircote/swagger-php/Changelog.md b/vendor/zircote/swagger-php/Changelog.md deleted file mode 100644 index 08943b3..0000000 --- a/vendor/zircote/swagger-php/Changelog.md +++ /dev/null @@ -1,3 +0,0 @@ -# Changelog - -The changelog is moved to the [releases page](https://github.com/zircote/swagger-php/releases) diff --git a/vendor/zircote/swagger-php/Examples/Readme.md b/vendor/zircote/swagger-php/Examples/Readme.md deleted file mode 100644 index 26a74bb..0000000 --- a/vendor/zircote/swagger-php/Examples/Readme.md +++ /dev/null @@ -1,70 +0,0 @@ -## Code/Annotation examples - -Collection of code/annotation examples and their corresponding OpenAPI specs generated using swagger-php. - -* **openapi-spec** - - Implementation of the [OpenAPI v3 example specs](https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v3.0) - using swagger-php annotations. - - * openapi-spec: [source](openapi-spec) / [spec](openapi-spec/openapi-spec.yaml) - * petstore-3.0 (includes oauth2 auth flow): [source](petstore-3.0) / [spec](openapi-spec/petstore-3.0.yaml) - -* **petstore.swagger.io** - - The [swagger-ui](http://petstore.swagger.io/) petstore example using swagger-php annotations. - - * petstore.swagger.io: [source](petstore.swagger.io) / [spec](petstore.swagger.io/petstore.swagger.io.yaml) - -* **swagger-spec** - - Some more examples based on the (now defunct) [swagger-api](https://github.com/swagger-api/) specs. - - * petstore: [source](swagger-spec/petstore) / [spec](swagger-spec/petstore/petstore.yaml) - * petstore-simple: [source](swagger-spec/petstore-simple) - / [spec](swagger-spec/petstore-simple/petstore-simple.yaml) - * petstore-with-external-docs: [source](swagger-spec/petstore-with-external-docs) - / [spec](swagger-spec/petstore-with-external-docs/petstore-with-external-docs.yaml) - -* **Other** - - * simple response object: [source](example-object) / [spec](example-object/example-object.yaml) - * misc: [source](misc) / [spec](misc/misc.yaml) - * using interfaces: [source](using-interfaces) - / [spec (inherit)](using-interfaces/using-interfaces-inherit.yaml) - / [spec (merge)](using-interfaces/using-interfaces-merge.yaml) - * using traits: [source](using-traits) - / [spec (inherit)](using-traits/using-traits-inherit.yaml) - / [spec (merge)](using-traits/using-interfaces-merge.yaml) - * using refs: [source](using-refs) / [spec](using-refs/using-refs.yaml) - - -## Custom processors - -[Processors](../src/Processors) implement the various steps involved in converting annotations into an OpenAPI spec. - -Writing a custom processor is the recommended way to extend swagger-php in a clean way. - -Processors are expected to implement the `__invoke()` method expecting the current `Analysis` object as single parameter: - -```php - - - - - diff --git a/vendor/zircote/swagger-php/Examples/openapi-spec/Repository.php b/vendor/zircote/swagger-php/Examples/openapi-spec/Repository.php deleted file mode 100644 index 68e8c69..0000000 --- a/vendor/zircote/swagger-php/Examples/openapi-spec/Repository.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -class Pet -{ - /** - * @OA\Post( - * path="/pet", - * tags={"pet"}, - * summary="Add a new pet to the store", - * operationId="addPet", - * @OA\Response( - * response=405, - * description="Invalid input" - * ), - * security={ - * {"petstore_auth": {"write:pets", "read:pets"}} - * }, - * requestBody={"$ref": "#/components/requestBodies/Pet"} - * ) - */ - public function addPet() - { - } - - /** - * @OA\Put( - * path="/pet", - * tags={"pet"}, - * summary="Update an existing pet", - * operationId="updatePet", - * @OA\Response( - * response=400, - * description="Invalid ID supplied" - * ), - * @OA\Response( - * response=404, - * description="Pet not found" - * ), - * @OA\Response( - * response=405, - * description="Validation exception" - * ), - * security={ - * {"petstore_auth": {"write:pets", "read:pets"}} - * }, - * requestBody={"$ref": "#/components/requestBodies/Pet"} - * ) - */ - public function updatePet() - { - } - - /** - * @OA\Get( - * path="/pet/findByStatus", - * tags={"pet"}, - * summary="Finds Pets by status", - * description="Multiple status values can be provided with comma separated string", - * operationId="findPetsByStatus", - * deprecated=true, - * @OA\Parameter( - * name="status", - * in="query", - * description="Status values that needed to be considered for filter", - * required=true, - * explode=true, - * @OA\Schema( - * type="array", - * default="available", - * @OA\Items( - * type="string", - * enum = {"available", "pending", "sold"}, - * ) - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent( - * type="array", - * @OA\Items(ref="#/components/schemas/Pet") - * ), - * @OA\XmlContent( - * type="array", - * @OA\Items(ref="#/components/schemas/Pet") - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid status value" - * ), - * security={ - * {"petstore_auth": {"write:pets", "read:pets"}} - * } - * ) - */ - public function findPetsByStatus() - { - } - - /** - * @OA\Get( - * path="/pet/findByTags", - * tags={"pet"}, - * summary="Finds Pets by tags", - * description="Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - * operationId="findByTags", - * @OA\Parameter( - * name="tags", - * in="query", - * description="Tags to filter by", - * required=true, - * explode=true, - * @OA\Schema( - * type="array", - * @OA\Items( - * type="string", - * ) - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent( - * type="array", - * @OA\Items(ref="#/components/schemas/Pet") - * ), - * @OA\XmlContent( - * type="array", - * @OA\Items(ref="#/components/schemas/Pet") - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid status value" - * ), - * security={ - * {"petstore_auth": {"write:pets", "read:pets"}} - * } - * ) - */ - public function findByTags() - { - } - - /** - * @OA\Get( - * path="/pet/{petId}", - * tags={"pet"}, - * summary="Find pet by ID", - * description="Returns a single pet", - * operationId="getPetById", - * @OA\Parameter( - * name="petId", - * in="path", - * description="ID of pet to return", - * required=true, - * @OA\Schema( - * type="integer", - * format="int64" - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent(ref="#/components/schemas/Pet"), - * @OA\XmlContent(ref="#/components/schemas/Pet"), - * ), - * @OA\Response( - * response=400, - * description="Invalid ID supplier" - * ), - * @OA\Response( - * response=404, - * description="Pet not found" - * ), - * security={ - * {"api_key": {}} - * } - * ) - * - * @param int $id - */ - public function getPetById($id) - { - } - - /** - * @OA\Post( - * path="/pet/{petId}", - * tags={"pet"}, - * summary="Updates a pet in the store with form data", - * operationId="updatePetWithForm", - * @OA\Parameter( - * name="petId", - * in="path", - * description="ID of pet that needs to be updated", - * required=true, - * @OA\Schema( - * type="integer", - * format="int64" - * ) - * ), - * @OA\Response( - * response=405, - * description="Invalid input" - * ), - * security={ - * {"petstore_auth": {"write:pets", "read:pets"}} - * }, - * @OA\RequestBody( - * description="Input data format", - * @OA\MediaType( - * mediaType="application/x-www-form-urlencoded", - * @OA\Schema( - * type="object", - * @OA\Property( - * property="name", - * description="Updated name of the pet", - * type="string", - * ), - * @OA\Property( - * property="status", - * description="Updated status of the pet", - * type="string" - * ) - * ) - * ) - * ) - * ) - */ - public function updatePetWithForm() - { - } - - /** - * @OA\Delete( - * path="/pet/{petId}", - * tags={"pet"}, - * summary="Deletes a pet", - * operationId="deletePet", - * @OA\Parameter( - * name="api_key", - * in="header", - * required=false, - * @OA\Schema( - * type="string" - * ) - * ), - * @OA\Parameter( - * name="petId", - * in="path", - * description="Pet id to delete", - * required=true, - * @OA\Schema( - * type="integer", - * format="int64" - * ), - * ), - * @OA\Response( - * response=400, - * description="Invalid ID supplied", - * ), - * @OA\Response( - * response=404, - * description="Pet not found", - * ), - * security={ - * {"petstore_auth": {"write:pets", "read:pets"}} - * }, - * ) - */ - public function deletePet() - { - } - - /** - * @OA\Post( - * path="/pet/{petId}/uploadImage", - * tags={"pet"}, - * summary="uploads an image", - * operationId="uploadFile", - * @OA\Parameter( - * name="petId", - * in="path", - * description="ID of pet to update", - * required=true, - * @OA\Schema( - * type="integer", - * format="int64", - * example=1 - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent(ref="#/components/schemas/ApiResponse") - * ), - * security={ - * {"petstore_auth": {"write:pets", "read:pets"}} - * }, - * @OA\RequestBody( - * description="Upload images request body", - * @OA\MediaType( - * mediaType="application/octet-stream", - * @OA\Schema( - * type="string", - * format="binary" - * ) - * ) - * ) - * ) - */ - public function uploadFile() - { - } -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/controllers/Store.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/controllers/Store.php deleted file mode 100644 index 9e5b55e..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/controllers/Store.php +++ /dev/null @@ -1,139 +0,0 @@ - - */ -class Store -{ - /** - * @OA\Get( - * path="/store", - * tags={"store"}, - * summary="Returns pet inventories by status", - * description="Returns a map of status codes to quantities", - * operationId="getInventory", - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent( - * @OA\AdditionalProperties( - * type="integer", - * format="int32" - * ) - * ) - * ), - * security={ - * {"api_key": {}} - * } - * ) - */ - public function getInventory() - { - } - - /** - * @OA\Post( - * path="/store/order", - * tags={"store"}, - * summary="Place an order for a pet", - * operationId="placeOrder", - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent(ref="#/components/schemas/Order"), - * @OA\XmlContent(ref="#/components/schemas/Order") - * ), - * @OA\RequestBody( - * description="order placed for purchasing th pet", - * required=true, - * @OA\JsonContent(ref="#/components/schemas/Order") - * ) - * ) - */ - public function placeOrder() - { - } - - /** - * @OA\Get( - * path="/store/order/{orderId}", - * tags={"store"}, - * description="For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions", - * operationId="getOrderById", - * @OA\Parameter( - * name="orderId", - * in="path", - * description="ID of pet that needs to be fetched", - * required=true, - * @OA\Schema( - * type="integer", - * format="int64", - * maximum=1, - * minimum=10 - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent(ref="#/components/schemas/Order"), - * @OA\MediaType( - * mediaType="application/xml", - * @OA\Schema(ref="#/components/schemas/Order") - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid ID supplied" - * ), - * @OA\Response( - * response=404, - * description="Order not found" - * ) - * ) - */ - public function getOrderById() - { - } - - /** - * @OA\Delete( - * path="/store/order/{orderId}", - * tags={"store"}, - * summary="Delete purchase order by ID", - * description="For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", - * operationId="deleteOrder", - * @OA\Parameter( - * name="orderId", - * in="path", - * required=true, - * description="ID of the order that needs to be deleted", - * @OA\Schema( - * type="integer", - * format="int64", - * minimum=1 - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid ID supplied" - * ), - * @OA\Response( - * response=404, - * description="Order not found" - * ) - * ), - */ - public function deleteOrder() - { - } -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/controllers/User.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/controllers/User.php deleted file mode 100644 index 45d05b2..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/controllers/User.php +++ /dev/null @@ -1,233 +0,0 @@ - - */ -class User -{ - /** - * @OA\Post( - * path="/user", - * tags={"user"}, - * summary="Create user", - * description="This can only be done by the logged in user.", - * operationId="createUser", - * @OA\Response( - * response="default", - * description="successful operation" - * ), - * @OA\RequestBody( - * description="Create user object", - * required=true, - * @OA\JsonContent(ref="#/components/schemas/User") - * ) - * ) - */ - public function createUser() - { - } - - /** - * @OA\Post( - * path="/user/createWithArray", - * tags={"user"}, - * summary="Create list of users with given input array", - * operationId="createUsersWithListInput", - * @OA\Response( - * response="default", - * description="successful operation" - * ), - * @OA\RequestBody(ref="#/components/requestBodies/UserArray") - * ) - */ - public function createUsersWithListInput() - { - } - - /** - * @OA\Get( - * path="/user/login", - * tags={"user"}, - * summary="Logs user into system", - * operationId="loginUser", - * @OA\Parameter( - * name="username", - * in="query", - * description="The user name for login", - * required=true, - * @OA\Schema( - * type="string" - * ) - * ), - * @OA\Parameter( - * name="password", - * in="query", - * required=true, - * @OA\Schema( - * type="string", - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\Header( - * header="X-Rate-Limit", - * description="calls per hour allowed by the user", - * @OA\Schema( - * type="integer", - * format="int32" - * ) - * ), - * @OA\Header( - * header="X-Expires-After", - * description="date in UTC when token expires", - * @OA\Schema( - * type="string", - * format="datetime" - * ) - * ), - * @OA\JsonContent( - * type="string" - * ), - * @OA\MediaType( - * mediaType="application/xml", - * @OA\Schema( - * type="string" - * ) - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid username/password supplied" - * ) - * ) - */ - public function loginUser() - { - } - - /** - * @OA\Get( - * path="/user/logout", - * tags={"user"}, - * summary="Logs out current logged in user session", - * operationId="logoutUser", - * @OA\Response( - * response="default", - * description="successful operation" - * ) - * ) - */ - public function logoutUser() - { - } - - /** - * @OA\Get( - * path="/user/{username}", - * summary="Get user by user name", - * operationId="getUserByName", - * @OA\Parameter( - * name="username", - * in="path", - * required=true, - * @OA\Schema( - * type="string" - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\JsonContent(ref="#/components/schemas/User"), - * @OA\MediaType( - * mediaType="application/xml", - * @OA\Schema(ref="#/components/schemas/User") - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid username supplied" - * ), - * @OA\Response( - * response=404, - * description="User not found" - * ), - * ) - */ - public function getUserByName() - { - } - - /** - * @OA\Put( - * path="/user/{username}", - * summary="Updated user", - * description="This can pnly be done by the logged in user.", - * operationId="updateUser", - * @OA\Parameter( - * name="username", - * in="path", - * description="name that to be updated", - * required=true, - * @OA\Schema( - * type="string" - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid user supplied" - * ), - * @OA\Response( - * response=404, - * description="User not found" - * ), - * @OA\RequestBody( - * description="Updated user object", - * required=true, - * @OA\JsonContent(ref="#/components/schemas/User") - * ) - * ) - */ - public function updateUser() - { - } - - /** - * @OA\Delete( - * path="/user/{username}", - * summary="Delete user", - * description="This can only be done by the logged in user.", - * operationId="deleteUser", - * @OA\Parameter( - * name="username", - * in="path", - * description="The name that needs to be deleted", - * required=true, - * @OA\Schema( - * type="string" - * ) - * ), - * @OA\Response( - * response=400, - * description="Invalid username supplied", - * ), - * @OA\Response( - * response=404, - * description="User not found", - * ) - * ) - */ - public function deleteUser() - { - } -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/ApiResponse.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/models/ApiResponse.php deleted file mode 100644 index e49bd66..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/ApiResponse.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * @OA\Schema( - * description="Api response", - * title="Api response" - * ) - */ -class ApiResponse -{ - /** - * @OA\Property( - * description="Code", - * title="Code", - * format="int32" - * ) - * - * @var int - */ - private $code; - - /** - * OA\Property( - * description="Type", - * title="Type", - * ) - * - * @var string - */ - private $type; - - /** - * @OA\Property( - * description="Message", - * title="Message" - * ) - * - * @var string - */ - private $message; -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Category.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Category.php deleted file mode 100644 index db7d2a8..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Category.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * @OA\Schema( - * description="Pets Category", - * title="Pets Category", - * @OA\Xml( - * name="Category" - * ) - * ) - */ -class Category -{ - /** - * @OA\Property( - * title="ID", - * description="ID", - * format="int64", - * ) - * - * @var integer - */ - private $id; - - /** - * @OA\Property( - * title="Category name", - * description="Category name" - * ) - * - * @var string - */ - private $name; -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Order.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Order.php deleted file mode 100644 index fad6b64..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Order.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @OA\Schema( - * title="Order model", - * description="Order model", - * ) - */ -class Order -{ - /** - * @OA\Property( - * format="int64", - * title="ID", - * default=1, - * description="ID", - * ) - * - * @var integer - */ - private $id; - - /** - * @OA\Property( - * default=1, - * format="int64", - * description="Pet ID", - * title="Pet ID", - * ) - * - * @var integer - */ - private $petId; - - /** - * @OA\Property( - * default=12, - * format="in32", - * description="Quantity", - * title="Quantity", - * ) - * - * @var integer - */ - private $quantity; - - /** - * @OA\Property( - * default="2017-02-02 18:31:45", - * format="datetime", - * description="Shipping date", - * title="Shipping date", - * type="string" - * ) - * - * @var \DateTime - */ - private $shipDate; - - /** - * @OA\Property( - * default="placed", - * title="Order status", - * description="Order status", - * enum={"placed", "approved", "delivered"}, - * ) - * - * @var string - */ - private $status; - - /** - * @OA\Property( - * default="false", - * format="int64", - * description="Complete status", - * title="Complete status", - * ) - * - * @var boolean - */ - private $complete; -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Pet.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Pet.php deleted file mode 100644 index c90c1f2..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/Pet.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * @OA\Schema( - * description="Pet model", - * title="Pet model", - * required={"name", "photoUrls"}, - * @OA\Xml( - * name="Pet" - * ) - * ) - */ -class Pet -{ - - /** - * @OA\Property( - * format="int64", - * description="ID", - * title="ID", - * ) - * - * @var integer - */ - private $id; - - /** - * @OA\Property( - * description="Category relation", - * title="Category", - * ) - * - * @var \Petstore30\Category - */ - private $category; - - /** - * @OA\Property( - * format="int64", - * description="Pet name", - * title="Pet name", - * ) - * - * @var integer - */ - private $name; - - /** - * @OA\Property( - * description="Photo urls", - * title="Photo urls", - * @OA\Xml( - * name="photoUrl", - * wrapped=true - * ), - * @OA\Items( - * type="string", - * default="images/image-1.png" - * ) - * ) - * - * @var array - */ - private $photoUrls; - - /** - * @OA\Property( - * description="Pet tags", - * title="Pet tags", - * @OA\Xml( - * name="tag", - * wrapped=true - * ), - * ) - * - * @var \Petstore30\Tag[] - */ - private $tags; -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/RequestBody.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/models/RequestBody.php deleted file mode 100644 index 00575f7..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/RequestBody.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * @OA\Schema( - * description="Tag", - * title="Tag", - * @OA\Xml( - * name="Tag" - * ) - * ) - */ -class Tag -{ - /** - * @OA\Property( - * format="int64", - * description="ID", - * title="ID" - * ) - * - * @var integer - */ - private $id; - - /** - * @OA\Property( - * description="Name", - * title="Name" - * ) - * - * @var string - */ - private $name; -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/User.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/models/User.php deleted file mode 100644 index e144cf3..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/models/User.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * @OA\Schema( - * title="User model", - * description="User model", - * ) - */ -class User -{ - /** - * @OA\Property( - * format="int64", - * description="ID", - * title="ID", - * ) - * - * @var integer - */ - private $id; - - /** - * @OA\Property( - * description="Username", - * title="Username", - * ) - * - * @var string - */ - private $username; - - /** - * @OA\Property( - * description="First name", - * title="First name", - * ) - * - * @var string - */ - private $firstName; - - /** - * @OA\Property( - * description="Last name", - * title="Last name", - * ) - * - * @var string - */ - private $lastName; - - /** - * @OA\Property( - * format="email", - * description="Email", - * title="Email", - * ) - * - * @var string - */ - private $email; - - /** - * @OA\Property( - * format="int64", - * description="Password", - * title="Password", - * maximum=255 - * ) - * - * @var string - */ - private $password; - - /** - * @OA\Property( - * format="msisdn", - * description="Phone", - * title="Phone", - * ) - * - * @var string - */ - private $phone; - - /** - * @OA\Property( - * format="int32", - * description="User status", - * title="User status", - * ) - * - * @var integer - */ - private $userStatus; -} diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/petstore-3.0.yaml b/vendor/zircote/swagger-php/Examples/petstore-3.0/petstore-3.0.yaml deleted file mode 100644 index cf48e5d..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/petstore-3.0.yaml +++ /dev/null @@ -1,736 +0,0 @@ -openapi: 3.0.0 -info: - title: 'Swagger Petstore' - description: "This is a sample Petstore server. You can find\nout more about Swagger at\n[http://swagger.io](http://swagger.io) or on\n[irc.freenode.net, #swagger](http://swagger.io/irc/)." - termsOfService: 'http://swagger.io/terms/' - contact: - email: apiteam@swagger.io - license: - name: 'Apache 2.0' - url: 'http://www.apache.org/licenses/LICENSE-2.0.html' - version: 1.0.0 -servers: - - - url: 'https://virtserver.swaggerhub.com/swagger/Petstore/1.0.0' - description: 'SwaggerHUB API Mocking' -paths: - /pet: - put: - tags: - - pet - summary: 'Update an existing pet' - operationId: updatePet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - '400': - description: 'Invalid ID supplied' - '404': - description: 'Pet not found' - '405': - description: 'Validation exception' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - post: - tags: - - pet - summary: 'Add a new pet to the store' - operationId: addPet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - '405': - description: 'Invalid input' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - /pet/findByStatus: - get: - tags: - - pet - summary: 'Finds Pets by status' - description: 'Multiple status values can be provided with comma separated string' - operationId: findPetsByStatus - parameters: - - - name: status - in: query - description: 'Status values that needed to be considered for filter' - required: true - explode: true - schema: - type: array - items: - type: string - enum: - - available - - pending - - sold - default: available - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: 'Invalid status value' - deprecated: true - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - /pet/findByTags: - get: - tags: - - pet - summary: 'Finds Pets by tags' - description: 'Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.' - operationId: findByTags - parameters: - - - name: tags - in: query - description: 'Tags to filter by' - required: true - explode: true - schema: - type: array - items: - type: string - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: 'Invalid status value' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - '/pet/{petId}': - get: - tags: - - pet - summary: 'Find pet by ID' - description: 'Returns a single pet' - operationId: getPetById - parameters: - - - name: petId - in: path - description: 'ID of pet to return' - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - '400': - description: 'Invalid ID supplier' - '404': - description: 'Pet not found' - security: - - - api_key: [] - post: - tags: - - pet - summary: 'Updates a pet in the store with form data' - operationId: updatePetWithForm - parameters: - - - name: petId - in: path - description: 'ID of pet that needs to be updated' - required: true - schema: - type: integer - format: int64 - requestBody: - description: 'Input data format' - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: 'Updated name of the pet' - type: string - status: - description: 'Updated status of the pet' - type: string - type: object - responses: - '405': - description: 'Invalid input' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - delete: - tags: - - pet - summary: 'Deletes a pet' - operationId: deletePet - parameters: - - - name: api_key - in: header - required: false - schema: - type: string - - - name: petId - in: path - description: 'Pet id to delete' - required: true - schema: - type: integer - format: int64 - responses: - '400': - description: 'Invalid ID supplied' - '404': - description: 'Pet not found' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - '/pet/{petId}/uploadImage': - post: - tags: - - pet - summary: 'uploads an image' - operationId: uploadFile - parameters: - - - name: petId - in: path - description: 'ID of pet to update' - required: true - schema: - type: integer - format: int64 - example: 1 - requestBody: - description: 'Upload images request body' - content: - application/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - /store: - get: - tags: - - store - summary: 'Returns pet inventories by status' - description: 'Returns a map of status codes to quantities' - operationId: getInventory - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - additionalProperties: - type: integer - format: int32 - security: - - - api_key: [] - /store/order: - post: - tags: - - store - summary: 'Place an order for a pet' - operationId: placeOrder - requestBody: - description: 'order placed for purchasing th pet' - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - application/xml: - schema: - $ref: '#/components/schemas/Order' - '/store/order/{orderId}': - get: - tags: - - store - description: 'For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions' - operationId: getOrderById - parameters: - - - name: orderId - in: path - description: 'ID of pet that needs to be fetched' - required: true - schema: - type: integer - format: int64 - maximum: 1 - minimum: 10 - responses: - '200': - description: 'successful operation' - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - '400': - description: 'Invalid ID supplied' - '404': - description: 'Order not found' - delete: - tags: - - store - summary: 'Delete purchase order by ID' - description: 'For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors' - operationId: deleteOrder - parameters: - - - name: orderId - in: path - description: 'ID of the order that needs to be deleted' - required: true - schema: - type: integer - format: int64 - minimum: 1 - responses: - '400': - description: 'Invalid ID supplied' - '404': - description: 'Order not found' - /user: - post: - tags: - - user - summary: 'Create user' - description: 'This can only be done by the logged in user.' - operationId: createUser - requestBody: - description: 'Create user object' - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/User' - responses: - default: - description: 'successful operation' - /user/createWithArray: - post: - tags: - - user - summary: 'Create list of users with given input array' - operationId: createUsersWithListInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: 'successful operation' - /user/login: - get: - tags: - - user - summary: 'Logs user into system' - operationId: loginUser - parameters: - - - name: username - in: query - description: 'The user name for login' - required: true - schema: - type: string - - - name: password - in: query - required: true - schema: - type: string - responses: - '200': - description: 'successful operation' - headers: - X-Rate-Limit: - description: 'calls per hour allowed by the user' - schema: - type: integer - format: int32 - X-Expires-After: - description: 'date in UTC when token expires' - schema: - type: string - format: datetime - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - '400': - description: 'Invalid username/password supplied' - /user/logout: - get: - tags: - - user - summary: 'Logs out current logged in user session' - operationId: logoutUser - responses: - default: - description: 'successful operation' - '/user/{username}': - get: - summary: 'Get user by user name' - operationId: getUserByName - parameters: - - - name: username - in: path - required: true - schema: - type: string - responses: - '200': - description: 'successful operation' - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - '400': - description: 'Invalid username supplied' - '404': - description: 'User not found' - put: - summary: 'Updated user' - description: 'This can pnly be done by the logged in user.' - operationId: updateUser - parameters: - - - name: username - in: path - description: 'name that to be updated' - required: true - schema: - type: string - requestBody: - description: 'Updated user object' - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/User' - responses: - '400': - description: 'Invalid user supplied' - '404': - description: 'User not found' - delete: - summary: 'Delete user' - description: 'This can only be done by the logged in user.' - operationId: deleteUser - parameters: - - - name: username - in: path - description: 'The name that needs to be deleted' - required: true - schema: - type: string - responses: - '400': - description: 'Invalid username supplied' - '404': - description: 'User not found' -components: - schemas: - ApiResponse: - title: 'Api response' - description: 'Api response' - properties: - code: - title: Code - description: Code - type: integer - format: int32 - message: - title: Message - description: Message - type: string - type: object - Category: - title: 'Pets Category' - description: 'Pets Category' - properties: - id: - title: ID - description: ID - type: integer - format: int64 - name: - title: 'Category name' - description: 'Category name' - type: string - type: object - xml: - name: Category - Order: - title: 'Order model' - description: 'Order model' - properties: - id: - title: ID - description: ID - type: integer - format: int64 - default: 1 - petId: - title: 'Pet ID' - description: 'Pet ID' - type: integer - format: int64 - default: 1 - quantity: - title: Quantity - description: Quantity - type: integer - format: in32 - default: 12 - shipDate: - title: 'Shipping date' - description: 'Shipping date' - type: string - format: datetime - default: '2017-02-02 18:31:45' - status: - title: 'Order status' - description: 'Order status' - type: string - default: placed - enum: - - placed - - approved - - delivered - complete: - title: 'Complete status' - description: 'Complete status' - type: boolean - format: int64 - default: 'false' - type: object - Pet: - title: 'Pet model' - description: 'Pet model' - required: - - name - - photoUrls - properties: - id: - title: ID - description: ID - type: integer - format: int64 - category: - $ref: '#/components/schemas/Category' - name: - title: 'Pet name' - description: 'Pet name' - type: integer - format: int64 - photoUrls: - title: 'Photo urls' - description: 'Photo urls' - type: array - items: - type: string - default: images/image-1.png - xml: - name: photoUrl - wrapped: true - tags: - title: 'Pet tags' - description: 'Pet tags' - type: array - items: - $ref: '#/components/schemas/Tag' - xml: - name: tag - wrapped: true - type: object - xml: - name: Pet - Tag: - title: Tag - description: Tag - properties: - id: - title: ID - description: ID - type: integer - format: int64 - name: - title: Name - description: Name - type: string - type: object - xml: - name: Tag - User: - title: 'User model' - description: 'User model' - properties: - id: - title: ID - description: ID - type: integer - format: int64 - username: - title: Username - description: Username - type: string - firstName: - title: 'First name' - description: 'First name' - type: string - lastName: - title: 'Last name' - description: 'Last name' - type: string - email: - title: Email - description: Email - type: string - format: email - password: - title: Password - description: Password - type: string - format: int64 - maximum: 255 - phone: - title: Phone - description: Phone - type: string - format: msisdn - userStatus: - title: 'User status' - description: 'User status' - type: integer - format: int32 - type: object - requestBodies: - Pet: - description: 'Pet object that needs to be added to the store' - required: true - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - UserArray: - description: 'List of user object' - required: true - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - securitySchemes: - petstore_auth: - type: oauth2 - flows: - implicit: - authorizationUrl: 'http://petstore.swagger.io/oauth/dialog' - scopes: - 'write:pets': 'modify pets in your account' - 'read:pets': 'read your pets' - api_key: - type: apiKey - name: api_key - in: header -tags: - - - name: pet - description: 'Everything about your Pets' - externalDocs: - description: 'Find out more' - url: 'http://swagger.io' - - - name: store - description: 'Access to Petstore orders' - - - name: user - description: 'Operations about user' - externalDocs: - description: 'Find out more about store' - url: 'http://swagger.io' -externalDocs: - description: 'Find out more about Swagger' - url: 'http://swagger.io' diff --git a/vendor/zircote/swagger-php/Examples/petstore-3.0/security.php b/vendor/zircote/swagger-php/Examples/petstore-3.0/security.php deleted file mode 100644 index ed86d1d..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore-3.0/security.php +++ /dev/null @@ -1,27 +0,0 @@ -= 1 and <= 10. Other values will generated exceptions", - * operationId="getOrderById", - * @OA\Parameter( - * name="orderId", - * in="path", - * description="ID of pet that needs to be fetched", - * required=true, - * @OA\Schema( - * type="integer", - * format="int64", - * minimum=1.0, - * maximum=10.0 - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\Schema(ref="#/components/schemas/Order") - * ), - * @OA\Response(response=400, description="Invalid ID supplied"), - * @OA\Response(response=404, description="Order not found") - * ) - */ - public function getOrderById() - { - } - - /** - * @OA\Delete(path="/store/order/{orderId}", - * tags={"store"}, - * summary="Delete purchase order by ID", - * description="For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", - * operationId="deleteOrder", - * @OA\Parameter( - * name="orderId", - * in="path", - * required=true, - * description="ID of the order that needs to be deleted", - * @OA\Schema( - * type="integer", - * format="int64", - * minimum=1.0 - * ) - * ), - * @OA\Response(response=400, description="Invalid ID supplied"), - * @OA\Response(response=404, description="Order not found") - * ) - */ - public function deleteOrder() - { - } -} diff --git a/vendor/zircote/swagger-php/Examples/petstore.swagger.io/controllers/UserController.php b/vendor/zircote/swagger-php/Examples/petstore.swagger.io/controllers/UserController.php deleted file mode 100644 index 14b1cd1..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore.swagger.io/controllers/UserController.php +++ /dev/null @@ -1,219 +0,0 @@ -= 1 and <= 10. Other values will generated exceptions", - "operationId": "getOrderById", - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "ID of pet that needs to be fetched", - "required": true, - "schema": { - "type": "integer", - "format": "int64", - "maximum": 10, - "minimum": 1 - } - } - ], - "responses": { - "200": { - "description": "successful operation" - }, - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Order not found" - } - } - }, - "delete": { - "tags": [ - "store" - ], - "summary": "Delete purchase order by ID", - "description": "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", - "operationId": "deleteOrder", - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "ID of the order that needs to be deleted", - "required": true, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 1 - } - } - ], - "responses": { - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Order not found" - } - } - } - }, - "/user": { - "post": { - "tags": [ - "user" - ], - "summary": "Create user", - "description": "This can only be done by the logged in user.", - "operationId": "createUser", - "requestBody": { - "description": "Created user object", - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/user/createWithArray": { - "post": { - "tags": [ - "user" - ], - "summary": "Creates list of users with given input array", - "description": "", - "operationId": "createUsersWithArrayInput", - "requestBody": { - "description": "List of user object", - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - } - } - } - }, - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/user/createWithList": { - "post": { - "tags": [ - "user" - ], - "summary": "Creates list of users with given input array", - "description": "", - "operationId": "createUsersWithListInput", - "requestBody": { - "description": "List of user object", - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - } - } - } - }, - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/user/login": { - "get": { - "tags": [ - "user" - ], - "summary": "Logs user into the system", - "description": "", - "operationId": "loginUser", - "parameters": [ - { - "name": "username", - "in": "query", - "description": "The user name for login", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "password", - "in": "query", - "description": "The password for login in clear text", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "headers": { - "X-Rate-Limit": { - "description": "calls per hour allowed by the user", - "schema": { - "type": "integer", - "format": "int32" - } - }, - "X-Expires-After": { - "description": "date in UTC when token expires", - "schema": { - "type": "string", - "format": "date-time" - } - } - } - }, - "400": { - "description": "Invalid username/password supplied" - } - } - } - }, - "/user/logout": { - "get": { - "tags": [ - "user" - ], - "summary": "Logs out current logged in user session", - "description": "", - "operationId": "logoutUser", - "parameters": [], - "responses": { - "default": { - "description": "successful operation" - } - } - } - }, - "/user/{username}": { - "get": { - "tags": [ - "user" - ], - "summary": "Get user by user name", - "description": "", - "operationId": "getUserByName", - "parameters": [ - { - "name": "username", - "in": "path", - "description": "The name that needs to be fetched. Use user1 for testing. ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - }, - "400": { - "description": "Invalid username supplied" - }, - "404": { - "description": "User not found" - } - } - }, - "put": { - "tags": [ - "user" - ], - "summary": "Updated user", - "description": "This can only be done by the logged in user.", - "operationId": "updateUser", - "parameters": [ - { - "name": "username", - "in": "path", - "description": "name that need to be updated", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "Updated user object", - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - } - }, - "responses": { - "400": { - "description": "Invalid user supplied" - }, - "404": { - "description": "User not found" - } - } - }, - "delete": { - "tags": [ - "user" - ], - "summary": "Delete user", - "description": "This can only be done by the logged in user.", - "operationId": "deleteUser", - "parameters": [ - { - "name": "username", - "in": "path", - "description": "The name that needs to be deleted", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "400": { - "description": "Invalid username supplied" - }, - "404": { - "description": "User not found" - } - } - } - } - }, - "components": { - "schemas": { - "ApiResponse": { - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "type": "object" - }, - "Category": { - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - } - }, - "type": "object", - "xml": { - "name": "Category" - } - }, - "Order": { - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "petId": { - "type": "integer", - "format": "int64" - }, - "complete": { - "type": "boolean", - "default": false - }, - "quantity": { - "type": "integer", - "format": "int32" - }, - "shipDate": { - "type": "string", - "format": "date-time" - }, - "status": { - "description": "Order Status", - "type": "string", - "enum": [ - "placed", - "approved", - "delivered" - ] - } - }, - "type": "object", - "xml": { - "name": "Order" - } - }, - "Pet": { - "required": [ - "name", - "photoUrls" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string", - "example": "doggie" - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "photoUrls": { - "type": "array", - "items": { - "type": "string" - }, - "xml": { - "name": "photoUrl", - "wrapped": true - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tag" - }, - "xml": { - "name": "tag", - "wrapped": true - } - }, - "status": { - "description": "pet status in the store", - "type": "string", - "enum": [ - "available", - "pending", - "sold" - ] - } - }, - "type": "object", - "xml": { - "name": "Pet" - } - }, - "Tag": { - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - } - }, - "type": "object", - "xml": { - "name": "Tag" - } - }, - "User": { - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "username": { - "type": "string" - }, - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, - "email": { - "type": "string" - }, - "password": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "userStatus": { - "description": "User Status", - "type": "integer", - "format": "int32" - } - }, - "type": "object", - "xml": { - "name": "User" - } - } - }, - "securitySchemes": { - "api_key": { - "type": "apiKey", - "name": "api_key", - "in": "header" - }, - "petstore_auth": { - "type": "oauth2", - "flows": { - "implicit": { - "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", - "scopes": { - "read:pets": "read your pets", - "write:pets": "modify pets in your account" - } - } - } - } - } - }, - "tags": [ - { - "name": "pet", - "description": "Everything about your Pets", - "externalDocs": { - "description": "Find out more", - "url": "http://swagger.io" - } - }, - { - "name": "store", - "description": "Access to Petstore orders" - }, - { - "name": "user", - "description": "Operations about user", - "externalDocs": { - "description": "Find out more about our store", - "url": "http://swagger.io" - } - } - ], - "externalDocs": { - "description": "Find out more about Swagger", - "url": "http://swagger.io" - } -} \ No newline at end of file diff --git a/vendor/zircote/swagger-php/Examples/petstore.swagger.io/petstore.swagger.io.yaml b/vendor/zircote/swagger-php/Examples/petstore.swagger.io/petstore.swagger.io.yaml deleted file mode 100644 index 7dd7f73..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore.swagger.io/petstore.swagger.io.yaml +++ /dev/null @@ -1,669 +0,0 @@ -openapi: 3.0.0 -info: - title: 'Swagger Petstore' - description: 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.' - termsOfService: 'http://swagger.io/terms/' - contact: - email: apiteam@swagger.io - license: - name: 'Apache 2.0' - url: 'http://www.apache.org/licenses/LICENSE-2.0.html' - version: 1.0.0 -servers: - - - url: 'https://petstore.swagger.io/v3' - description: 'OpenApi host' -paths: - /pet/findByTags: - get: - tags: - - pet - summary: 'Finds Pets by tags' - description: 'Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.' - operationId: findPetsByTags - parameters: - - - name: tags - in: query - description: 'Tags to filter by' - required: true - style: form - schema: - type: array - items: - type: string - responses: - '200': - description: 'successful operation' - '400': - description: 'Invalid tag value' - deprecated: true - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - /pet/findByStatus: - get: - tags: - - pet - summary: 'Finds Pets by status' - description: 'Multiple status values can be provided with comma separated strings' - operationId: findPetsByStatus - parameters: - - - name: status - in: query - description: 'Status values that need to be considered for filter' - required: true - style: form - schema: - type: array - items: - type: string - default: available - enum: - - available - - pending - - sold - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: 'Invalid status value' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - '/pet/{petId}': - get: - tags: - - pet - summary: 'Find pet by ID' - description: 'Returns a single pet' - operationId: getPetById - parameters: - - - name: petId - in: path - description: 'ID of pet to return' - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: 'successful operation' - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - '400': - description: 'Invalid ID supplied' - '404': - description: 'Pet not found' - security: - - - api_key: [] - post: - tags: - - pet - summary: 'Updates a pet in the store with form data' - description: '' - operationId: updatePetWithForm - parameters: - - - name: petId - in: path - description: 'ID of pet that needs to be updated' - required: true - schema: - type: integer - format: int64 - requestBody: - required: false - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: 'Updated name of the pet' - type: string - status: - description: 'Updated status of the pet' - type: string - type: object - responses: - '405': - description: 'Invalid input' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - delete: - tags: - - pet - summary: 'Deletes a pet' - description: '' - operationId: deletePet - parameters: - - - name: petId - in: path - description: 'Pet id to delete' - required: true - schema: - type: integer - format: int64 - responses: - '400': - description: 'Invalid ID supplied' - '404': - description: 'Pet not found' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - /pet: - put: - tags: - - pet - summary: 'Update an existing pet' - description: '' - operationId: updatePet - requestBody: - description: 'Pet object that needs to be added to the store' - required: true - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - responses: - '400': - description: 'Invalid ID supplied' - '404': - description: 'Pet not found' - '405': - description: 'Validation exception' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - post: - tags: - - pet - summary: 'Add a new pet to the store' - description: '' - operationId: addPet - requestBody: - description: 'Pet object that needs to be added to the store' - required: true - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - responses: - '405': - description: 'Invalid input' - security: - - - petstore_auth: - - 'write:pets' - - 'read:pets' - '/pet/{petId}/uploadImage': - post: - tags: - - pet - summary: 'uploads an image' - description: '' - operationId: uploadFile - parameters: - - - name: petId - in: path - description: 'ID of pet to update' - required: true - schema: - type: integer - format: int64 - requestBody: - required: true - content: - multipart/form-data: - schema: - required: - - file - properties: - additionalMetadata: - description: 'Additional data to pass to server' - type: string - file: - description: 'file to upload' - type: string - format: file - type: object - responses: - '200': - description: 'successful operation' - security: - - - petstore_auth: - - 'read:pets' - - 'write:pets' - /store/inventory: - get: - tags: - - store - summary: 'Returns pet inventories by status' - description: 'Returns a map of status codes to quantities' - operationId: getInventory - parameters: [] - responses: - '200': - description: 'successful operation' - security: - - - api_key: [] - /store/order: - post: - tags: - - store - summary: 'Place an order for a pet' - description: '' - operationId: placeOrder - requestBody: - description: 'order placed for purchasing the pet' - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - responses: - '200': - description: 'successful operation' - '400': - description: 'Invalid Order' - '/store/order/{orderId}': - get: - tags: - - store - summary: 'Find purchase order by ID' - description: 'For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions' - operationId: getOrderById - parameters: - - - name: orderId - in: path - description: 'ID of pet that needs to be fetched' - required: true - schema: - type: integer - format: int64 - maximum: 10 - minimum: 1 - responses: - '200': - description: 'successful operation' - '400': - description: 'Invalid ID supplied' - '404': - description: 'Order not found' - delete: - tags: - - store - summary: 'Delete purchase order by ID' - description: 'For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors' - operationId: deleteOrder - parameters: - - - name: orderId - in: path - description: 'ID of the order that needs to be deleted' - required: true - schema: - type: integer - format: int64 - minimum: 1 - responses: - '400': - description: 'Invalid ID supplied' - '404': - description: 'Order not found' - /user: - post: - tags: - - user - summary: 'Create user' - description: 'This can only be done by the logged in user.' - operationId: createUser - requestBody: - description: 'Created user object' - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/User' - responses: - default: - description: 'successful operation' - /user/createWithArray: - post: - tags: - - user - summary: 'Creates list of users with given input array' - description: '' - operationId: createUsersWithArrayInput - requestBody: - description: 'List of user object' - required: true - content: - multipart/form-data: - schema: - type: array - items: - $ref: '#/components/schemas/User' - responses: - default: - description: 'successful operation' - /user/createWithList: - post: - tags: - - user - summary: 'Creates list of users with given input array' - description: '' - operationId: createUsersWithListInput - requestBody: - description: 'List of user object' - required: true - content: - multipart/form-data: - schema: - type: array - items: - $ref: '#/components/schemas/User' - responses: - default: - description: 'successful operation' - /user/login: - get: - tags: - - user - summary: 'Logs user into the system' - description: '' - operationId: loginUser - parameters: - - - name: username - in: query - description: 'The user name for login' - required: true - schema: - type: string - - - name: password - in: query - description: 'The password for login in clear text' - schema: - type: string - responses: - '200': - description: 'successful operation' - headers: - X-Rate-Limit: - description: 'calls per hour allowed by the user' - schema: - type: integer - format: int32 - X-Expires-After: - description: 'date in UTC when token expires' - schema: - type: string - format: date-time - '400': - description: 'Invalid username/password supplied' - /user/logout: - get: - tags: - - user - summary: 'Logs out current logged in user session' - description: '' - operationId: logoutUser - parameters: [] - responses: - default: - description: 'successful operation' - '/user/{username}': - get: - tags: - - user - summary: 'Get user by user name' - description: '' - operationId: getUserByName - parameters: - - - name: username - in: path - description: 'The name that needs to be fetched. Use user1 for testing. ' - required: true - schema: - type: string - responses: - '200': - description: 'successful operation' - '400': - description: 'Invalid username supplied' - '404': - description: 'User not found' - put: - tags: - - user - summary: 'Updated user' - description: 'This can only be done by the logged in user.' - operationId: updateUser - parameters: - - - name: username - in: path - description: 'name that need to be updated' - required: true - schema: - type: string - requestBody: - description: 'Updated user object' - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/User' - responses: - '400': - description: 'Invalid user supplied' - '404': - description: 'User not found' - delete: - tags: - - user - summary: 'Delete user' - description: 'This can only be done by the logged in user.' - operationId: deleteUser - parameters: - - - name: username - in: path - description: 'The name that needs to be deleted' - required: true - schema: - type: string - responses: - '400': - description: 'Invalid username supplied' - '404': - description: 'User not found' -components: - schemas: - ApiResponse: - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string - type: object - Category: - properties: - id: - type: integer - format: int64 - name: - type: string - type: object - xml: - name: Category - Order: - properties: - id: - type: integer - format: int64 - petId: - type: integer - format: int64 - complete: - type: boolean - default: false - quantity: - type: integer - format: int32 - shipDate: - type: string - format: date-time - status: - description: 'Order Status' - type: string - enum: - - placed - - approved - - delivered - type: object - xml: - name: Order - Pet: - required: - - name - - photoUrls - properties: - id: - type: integer - format: int64 - name: - type: string - example: doggie - category: - $ref: '#/components/schemas/Category' - photoUrls: - type: array - items: - type: string - xml: - name: photoUrl - wrapped: true - tags: - type: array - items: - $ref: '#/components/schemas/Tag' - xml: - name: tag - wrapped: true - status: - description: 'pet status in the store' - type: string - enum: - - available - - pending - - sold - type: object - xml: - name: Pet - Tag: - properties: - id: - type: integer - format: int64 - name: - type: string - type: object - xml: - name: Tag - User: - properties: - id: - type: integer - format: int64 - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: 'User Status' - type: integer - format: int32 - type: object - xml: - name: User - securitySchemes: - api_key: - type: apiKey - name: api_key - in: header - petstore_auth: - type: oauth2 - flows: - implicit: - authorizationUrl: 'http://petstore.swagger.io/oauth/dialog' - scopes: - 'read:pets': 'read your pets' - 'write:pets': 'modify pets in your account' -tags: - - - name: pet - description: 'Everything about your Pets' - externalDocs: - description: 'Find out more' - url: 'http://swagger.io' - - - name: store - description: 'Access to Petstore orders' - - - name: user - description: 'Operations about user' - externalDocs: - description: 'Find out more about our store' - url: 'http://swagger.io' -externalDocs: - description: 'Find out more about Swagger' - url: 'http://swagger.io' diff --git a/vendor/zircote/swagger-php/Examples/petstore.swagger.io/security.php b/vendor/zircote/swagger-php/Examples/petstore.swagger.io/security.php deleted file mode 100644 index 13771b5..0000000 --- a/vendor/zircote/swagger-php/Examples/petstore.swagger.io/security.php +++ /dev/null @@ -1,24 +0,0 @@ -getAnnotationsOfType(Schema::class, true); - $operations = $analysis->getAnnotationsOfType(Operation::class); - - foreach ($operations as $operation) { - if ($operation->x !== UNDEFINED && array_key_exists(self::X_QUERY_AGS_REF, $operation->x)) { - if ($schema = $this->schemaForRef($schemas, $operation->x[self::X_QUERY_AGS_REF])) { - $this->expandQueryArgs($operation, $schema); - $this->cleanUp($operation); - } - } - } - } - - /** - * Find schema for the given ref. - */ - protected function schemaForRef(array $schemas, string $ref) - { - foreach ($schemas as $schema) { - if (Components::SCHEMA_REF . $schema->schema === $ref) { - return $schema; - } - } - - return null; - } - - /** - * Expand the given operation by injecting parameters for all properties of the given schema. - */ - protected function expandQueryArgs(Operation $operation, Schema $schema) - { - if ($schema->properties === UNDEFINED || !$schema->properties) { - return; - } - - $operation->parameters = $operation->parameters === UNDEFINED ? [] : $operation->parameters; - foreach ($schema->properties as $property) { - $parameter = new Parameter([ - 'name' => $property->property, - 'in' => 'query', - 'required' => false, - ]); - $operation->parameters[] = $parameter; - } - } - - /** - * Clean up. - */ - protected function cleanUp($operation) - { - unset($operation->x[self::X_QUERY_AGS_REF]); - if (!$operation->x) { - $operation->x = UNDEFINED; - } - } -} - diff --git a/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/app/Product.php b/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/app/Product.php deleted file mode 100644 index 2dd4b44..0000000 --- a/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/app/Product.php +++ /dev/null @@ -1,27 +0,0 @@ - -Uses a custom processor `QueryArgsFromSchema` processor to convert a vendor extension into query parameters. -The parameters are extracted from the schema referenced by the custom extension. diff --git a/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/scan.php b/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/scan.php deleted file mode 100644 index b7a30b0..0000000 --- a/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/scan.php +++ /dev/null @@ -1,23 +0,0 @@ - $processors, -]; - -$openapi = OpenApi\scan(__DIR__ . '/app', $options); -$spec = json_encode($openapi, JSON_PRETTY_PRINT); -file_put_contents(__DIR__ . '/schema-query-parameter-processor.json', $spec); -//echo $spec; \ No newline at end of file diff --git a/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/schema-query-parameter-processor.json b/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/schema-query-parameter-processor.json deleted file mode 100644 index fdbe593..0000000 --- a/vendor/zircote/swagger-php/Examples/schema-query-parameter-processor/schema-query-parameter-processor.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "openapi": "3.0.0", - "info": { - "title": "Example of using a custom processor in swagger-php", - "version": "1.0.0" - }, - "paths": { - "\/products\/{id}": { - "get": { - "tags": [ - "Products" - ], - "operationId": "App\\ProductController::getProduct", - "responses": { - "200": { - "description": "A single product", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/Product" - } - } - } - } - } - } - }, - "\/products\/search": { - "get": { - "tags": [ - "Products" - ], - "operationId": "App\\ProductController::findProducts", - "parameters": [ - { - "name": "id", - "in": "query", - "required": false - }, - { - "name": "name", - "in": "query", - "required": false - } - ], - "responses": { - "200": { - "description": "A list of matching products", - "content": { - "application\/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#\/components\/schemas\/Product" - } - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "Product": { - "title": "Product", - "description": "A simple product model", - "properties": { - "id": { - "description": "The unique identifier of a product in our catalog.", - "type": "integer", - "format": "int64", - "example": 1 - }, - "name": { - "type": "string", - "format": "int64", - "example": 1 - } - }, - "type": "object" - } - } - } -} \ No newline at end of file diff --git a/vendor/zircote/swagger-php/Examples/swagger-spec/petstore-simple/SimplePet.php b/vendor/zircote/swagger-php/Examples/swagger-spec/petstore-simple/SimplePet.php deleted file mode 100644 index 7e32b8f..0000000 --- a/vendor/zircote/swagger-php/Examples/swagger-spec/petstore-simple/SimplePet.php +++ /dev/null @@ -1,37 +0,0 @@ - -A common scenario is to let swagger-php generate a definition based on your model class. -These definitions can then be referenced with `ref="#/components/schemas/$classname" - -You can define top-level parameters which can be references with $ref="#/components/parameters/$parameter" - -You can define top-level responses which can be references with $ref="#/components/responses/$response" - -I find it usefull to add @OA\Response(ref="#/components/responses/todo") to the operations when i'm starting out with writting the swagger documentation. -As it bypasses the "@OA\Get() requires at least one @OA\Response()" error and you'll get a nice list of the available api calls in swagger-ui. - -Then later, a search for '#/components/responses/todo' will reveal the operations I haven't documented yet. - - -And although definitions are generally used for model-level schema's' they can be used for smaller things as well. -Like a @OA\Schema, @OA\Property or @OA\Items that is uses multiple times. - -toYaml(); -``` - -### Usage from the Command Line Interface - -Generate the documentation to a static json file. - -```bash -./vendor/bin/openapi --help -``` - -### Usage from the Deserializer - -Generate the OpenApi annotation object from a json string, which makes it easier to manipulate objects programmatically. - -```php -deserialize($jsonString, 'OpenApi\Annotations\OpenApi'); -echo $openapi->toJson(); -``` - -### Usage from [docker](https://docker.com) - -Generate the swagger documentation to a static json file. - -``` -docker run -v "$PWD":/app -it tico/swagger-php --help -``` - -## More on OpenApi & Swagger - -- https://swagger.io -- https://www.openapis.org -- [OpenApi Documentation](https://swagger.io/docs/) -- [OpenApi Specification](http://swagger.io/specification/) -- [Related projects](docs/Related-projects.md) - -## Contributing - -Feel free to submit [Github Issues](https://github.com/zircote/swagger-php/issues) -or pull requests. - -The documentation website is build from the [docs](docs/) folder with [vuepress](https://vuepress.vuejs.org). - -Make sure pull requests pass [PHPUnit](https://phpunit.de/) -and [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) (PSR-2) tests. - -### To run both unit tests and linting execute: -```bash -composer test -``` - -### Running unit tests only: -```bash -./bin/phpunit -``` - -### Running linting only: -```bash -composer lint -``` - -### To make `php-cs-fixer` fix linting errors: -```bash -composer cs -``` diff --git a/vendor/zircote/swagger-php/bin/openapi b/vendor/zircote/swagger-php/bin/openapi deleted file mode 100644 index 10a9668..0000000 --- a/vendor/zircote/swagger-php/bin/openapi +++ /dev/null @@ -1,251 +0,0 @@ -#!/usr/bin/env php - false, - 'format' => 'auto', - 'exclude' => [], - 'pattern' => '*.php', - 'bootstrap' => false, - 'help' => false, - 'debug' => false, - 'processor' => [], -]; -$aliases = [ - 'o' => 'output', - 'e' => 'exclude', - 'n' => 'pattern', - 'b' => 'bootstrap', - 'h' => 'help', - 'd' => 'debug', - 'p' => 'processor', - 'f' => 'format' -]; -$needsArgument = [ - 'output', - 'format', - 'exclude', - 'pattern', - 'bootstrap', - 'processor', -]; -$paths = []; -$error = false; -define('OpenApi\COLOR_RED', "\033[31m"); -define('OpenApi\COLOR_YELLOW', "\033[33m"); -define('OpenApi\COLOR_STOP', "\033[0m"); - -try { - // Parse cli arguments - for ($i = 1; $i < $argc; $i++) { - $arg = $argv[$i]; - if (substr($arg, 0, 2) === '--') { // longopt - $option = substr($arg, 2); - } elseif ($arg[0] === '-') { // shortopt - if (array_key_exists(substr($arg, 1), $aliases)) { - $option = $aliases[$arg[1]]; - } else { - throw new Exception('Unknown option: "' . $arg . '"'); - } - } else { - $paths[] = $arg; - continue; - } - if (array_key_exists($option, $options) === false) { - throw new Exception('Unknown option: "' . $arg . '"'); - } - if (in_array($option, $needsArgument)) { - if (empty($argv[$i + 1]) || $argv[$i + 1][0] === '-') { - throw new Exception('Missing argument for "' . $arg . '"'); - } - if (is_array($options[$option])) { - $options[$option][] = $argv[$i + 1]; - } else { - $options[$option] = $argv[$i + 1]; - } - $i++; - } else { - $options[$option] = true; - } - } -} catch (Exception $e) { - $error = $e->getMessage(); -} - -if (!$error && $options['bootstrap']) { - if (is_readable($options['bootstrap']) === false) { - $error = 'Invalid `--bootstrap` value: "'.$options['bootstrap'].'"'; - } else { - require_once($options['bootstrap']); - } -} -if (count($paths) === 0) { - $error = 'Specify at least one path.'; -} -if ($options['help'] === false && $error) { - error_log(''); - error_log(COLOR_RED.'Error: '.$error.COLOR_STOP); - $options['help'] = true; // Show help -} -if ($options['help']) { - $help = << 'Error', - E_WARNING => 'Warning', - E_PARSE => 'Parser error', - E_NOTICE => 'Notice', - E_STRICT => 'Strict', - E_DEPRECATED => 'Deprecated', - E_CORE_ERROR => 'Error(Core)', - E_CORE_WARNING => 'Warning(Core)', - E_COMPILE_ERROR => 'Error(compile)', - E_COMPILE_WARNING => 'Warning(Compile)', - E_RECOVERABLE_ERROR => 'Error(Recoverable)', - E_USER_ERROR => 'Error', - E_USER_WARNING => 'Warning', - E_USER_NOTICE => 'Notice', - E_USER_DEPRECATED => 'Deprecated', -]; -set_error_handler(function ($errno, $errstr, $file, $line) use ($errorTypes, $options) { - if (!(error_reporting() & $errno)) { - return; // This error code is not included in error_reporting - } - $type = array_key_exists($errno, $errorTypes) ? $errorTypes[$errno] : 'Error'; - $color = (substr($type, 0, 5) === 'Error') ? COLOR_RED: COLOR_YELLOW; - error_log(COLOR_RED.$type. ': '.$errstr.COLOR_STOP); - if ($options['debug']) { - error_log(' in '.$file.' on line '.$line); - } - if (substr($type, 0, 5) === 'Error') { - exit($errno); - } -}); -set_exception_handler(function ($exception) use ($options) { - if ($options['debug']) { - error_log($exception); - } else { - error_log(COLOR_RED.'Exception: '.$exception->getMessage().COLOR_STOP); - // if ($options['debug']) { - // error_log(' in '.$exception->getFile().' on line '.$exception->getLine()); - // } - } - exit($exception->getCode() ?: 1); -}); -$exit = 0; -Logger::getInstance()->log = function ($entry, $type) use ($options, &$exit) { - $exit = 1; - if ($type === E_USER_NOTICE) { - $type = ''; - $color = COLOR_YELLOW; - } else { - $type = 'Warning: '; - $color = COLOR_RED; - } - if ($entry instanceof Exception) { - error_log(COLOR_RED."Error: " . $entry->getMessage().COLOR_STOP); - if ($options['debug']) { - error_log('Stack trace:'.PHP_EOL.$entry->getTraceAsString()); - } - } else { - error_log($color. $type . $entry.COLOR_STOP); - if ($options['debug']) { - // Show backtrace in debug mode - $e = (string)(new Exception('trace')); - $trace = explode("\n", substr($e, strpos($e, 'Stack trace:'))); - foreach ($trace as $i => $entry) { - if ($i === 0) { - error_log($entry); - } - if ($i <= 3) { - continue; - } - preg_match('/#([0-9]+) (.*)$/', $entry, $match); - error_log('#' .($match[1] - 2).' '.$match[2]); - } - } - } -}; -$exclude = null; -if ($options['exclude']) { - $exclude = $options['exclude']; - if (strpos($exclude[0], ',') !== false) { - $exploded = explode(',', $exclude[0]); - error_log(COLOR_RED.'Comma-separated exclude paths are deprecated, use multiple --exclude statements: --exclude '.$exploded[0].' --exclude '.$exploded[1]).COLOR_STOP; - $exclude[0] = array_shift($exploded); - $exclude = array_merge($exclude, $exploded); - } -} - -$pattern = "*.php"; -if ($options['pattern']) { - $pattern = $options['pattern']; -} - -foreach ($options["processor"] as $processor) { - $class = '\OpenApi\Processors\\'.$processor; - if (class_exists($class)) { - $processor = new $class(); - } elseif (class_exists($processor)) { - $processor = new $processor(); - } - Analysis::registerProcessor($processor); -} - -$openapi = OpenApi\scan($paths, ['exclude' => $exclude, 'pattern' => $pattern]); - -if ($exit !== 0) { - error_log(''); -} -if ($options['output'] === false) { - if (strtolower($options['format']) === 'json') { - echo $openapi->toJson(); - } else { - echo $openapi->toYaml(); - } - echo "\n"; -} else { - if (is_dir($options['output'])) { - $options['output'] .= '/openapi.yaml'; - } - $openapi->saveAs($options['output'], $options['format']); -} -exit($exit); diff --git a/vendor/zircote/swagger-php/composer.json b/vendor/zircote/swagger-php/composer.json deleted file mode 100644 index 2bf8e68..0000000 --- a/vendor/zircote/swagger-php/composer.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "zircote/swagger-php", - "type": "library", - "license": "Apache-2.0", - "bin": [ - "bin/openapi" - ], - "description": "swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations", - "keywords": [ - "json", - "rest", - "api", - "service discovery" - ], - "homepage": "https://github.com/zircote/swagger-php/", - "authors": [ - { - "name": "Robert Allen", - "email": "zircote@gmail.com" - }, - { - "name": "Bob Fanger", - "email": "bfanger@gmail.com", - "homepage": "https://bfanger.nl" - }, - { - "name": "Martin Rademacher", - "email": "mano@radebatz.net", - "homepage": "https://radebatz.net" - } - ], - "config": { - "bin-dir": "bin", - "sort-packages": true - }, - "minimum-stability": "stable", - "require": { - "php": ">=7.2", - "ext-json": "*", - "doctrine/annotations": "*", - "symfony/finder": ">=2.2", - "symfony/yaml": ">=3.3" - }, - "autoload": { - "psr-4": { - "OpenApi\\": "src" - }, - "files": [ - "src/functions.php" - ] - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "phpunit/phpunit": ">=8" - }, - "autoload-dev": { - "psr-4": { - "OpenApi\\Tests\\": "tests/", - "AnotherNamespace\\": "tests/Fixtures/AnotherNamespace" - } - }, - "scripts": { - "cs": "php-cs-fixer fix --allow-risky=yes", - "lint": "@cs --dry-run", - "test": [ - "phpunit", - "@lint" - ], - "docs": "vuepress dev docs/", - "deploy_docs": "vuepress build docs/ && cp -r .git docs/.vuepress/dist/.git && cd docs/.vuepress/dist/ && git symbolic-ref HEAD refs/heads/gh-pages && git add --all" - } -} diff --git a/vendor/zircote/swagger-php/docs/.vuepress/config.js b/vendor/zircote/swagger-php/docs/.vuepress/config.js deleted file mode 100644 index c4951f2..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - title: "Swagger-PHP v3.x", - base: "/swagger-php/", - description: - "Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations.", - themeConfig: { - sidebar: "auto", - nav: [ - { text: "Guide", link: "/Getting-started" }, - { - text: "OpenApi", - link: "https://swagger.io/docs/specification/about/" - }, - { - text: "Specification", - link: "http://swagger.io/specification/" - }, - { text: "Github", link: "https://github.com/zircote/swagger-php" } - ] - } -}; diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/annotations.html b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/annotations.html deleted file mode 100644 index 3292ca2..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/annotations.html +++ /dev/null @@ -1,783 +0,0 @@ - - - - - - - - - Annotations — Swagger-PHP documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    Annotations - -

    -
    -

    Note

    -

    This is the documentation for (older / unsupported) swagger-php v1.x -
    Go to the - swagger-php v3.x documentation -

    -
    -
    -
    -
    <?php
    -
    -use Swagger\Annotations as SWG;
    -
    -/**
    - *
    - * @SWG\Model(id="Pet")
    - */
    -class Pet
    -{
    -    /**
    -     * @var Tag[]
    -     *
    -     * @SWG\Property(name="tags", type="array", items="$ref:Tag")
    -     */
    -    protected $tags = array();
    -}
    -
    -
    -
    -

    When properties are ommitted, swagger-php will try to detect their value. The name for the @SWGProperty - in this example is not needed, because swagger-php would infer “tags” based on - protected $tags after the annotation.

    -

    The use statement also optional when using - - @SWG\ - for annotations.

    -

    Tip! Mistype an attribute and a warning will be shown with the available attributes for that particular - annotation. -

    -
    -

    Annotation Hierarchy - -

    -
    -
    -
    - @SWG\Resource
    -  - @SWG\Api
    -    - @SWG\Operation
    -      - @SWG\Parameter
    -      - @SWG\ResponseMessage
    -
    -- @SWG\Model
    -  - @SWG\Property
    -    - @SWG\Items
    -
    -- @SWG\Authorization
    -  - @SWG\Scope
    -
    -- @SWG\Info
    -
    -
    -
    -
    -
    -

    Resource - -

    -

    - Attributes -

    -
      -
    • - - apiVersion - the version this api is being rendered as
    • -
    • - - swaggerVersion - the swagger-docs version being rendered - - 2.0 - -
    • -
    • - - resourcePath - the HTTP URI path for the resource
    • -
    • - - basePath - the service root HTTP URI path
    • -
    • - Api []
    • -
    -

    - Example Annotations -

    -
    -
    -
    use Swagger\Annotations as SWG;
    -
    -/**
    - * @SWG\Resource(
    - *     apiVersion="0.2",
    - *     swaggerVersion="1.1",
    - *     resourcePath="/pet",
    - *     basePath="http://petstore.swagger.wordnik.com/api"
    - * )
    - */
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    {
    -    "apiVersion":"0.2",
    -    "swaggerVersion":"1.1",
    -    "basePath":"http://petstore.swagger.wordnik.com/api",
    -    "resourcePath":"/pet",
    -    "apis":[...],
    -    "models": [...]
    -}
    -
    -
    -
    -

    - Allowable Use: -

    -

    Recommended as file or class annotation.

    -
    -
    -

    Api - -

    -

    - Attributes -

    -
      -
    • - - path - -
    • -
    • - - description - -
    • -
    • - Operation []
    • -
    -

    - Example Annotation -

    -
    -
    -
    use Swagger\Annotations as SWG;
    -
    -/**
    - *
    - * @SWG\Api(
    - *   path="/pet.{format}/{petId}",
    - *   description="Operations about pets",
    - *   @SWG\Operation(...,
    - *      @SWG\Parameter(...),
    - *      @SWG\ResponseMessage(...),
    - *      @SWG\ResponseMessage(...)
    - *   )
    - * )
    - */
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    {
    -    "path":"/pet.{format}/{petId}",
    -    "description":"Operations about pets",
    -    "operations":[
    -        ...
    -    ]
    -}
    -
    -
    -
    -

    - Allowable Use: -

    -

    Must be after or inside a - Resource annotation. Recommended as method annotation.

    -
    -
    -

    Operation - -

    -

    - Attributes -

    -
      -
    • - - method - GET|POST|DELETE|PUT|PATCH etc
    • -
    • - - summary - string
    • -
    • - - notes - string
    • -
    • - - type - the - Model ID returned
    • -
    • - - nickname - string
    • -
    • - ResponseMessage []
    • -
    • - Parameter []
    • -
    -

    - Example Annotations -

    -
    -
    -
    use Swagger\Annotations as SWG;
    -
    -/**
    - * @SWG\Operation(
    - *     method="GET", summary="Find pet by ID", notes="Returns a pet based on ID",
    - *     type="Pet", nickname="getPetById", ...
    - * )
    - */
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    {
    -    "method":"GET",
    -    "summary":"Find pet by ID",
    -    "notes":"Returns a pet based on ID",
    -    "type":"Pet",
    -    "nickname":"getPetById",
    -    "parameters":[...],
    -    "responseMessages":[...]
    -}
    -
    -
    -
    -

    - Allowable Use: -

    -

    Enclosed within - Api.

    -
    -
    -

    ResponseMessage - -

    -

    - Attributes -

    -
      -
    • - - code - -
    • -
    • - - message - -
    • -
    -

    - Example Annotations -

    -
    -
    -
    /**
    - * @SWG\ResponseMessage(code=404, message="Pet not found")
    - */
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    "responseMessages":[
    -    {
    -        "code":404,
    -        "message":"Pet not found"
    -    }
    -]
    -
    -
    -
    -

    - Allowable Use: -

    -

    Enclosed within - Operation.

    -
    -
    -

    Parameter - -

    -

    - Attributes -

    -
      -
    • - - name - -
    • -
    • - - description - -
    • -
    • - - paramType - body|query|path
    • -
    • - - required - bool
    • -
    • - - allowMultiple - bool
    • -
    • - - type - scalar or Model|object
    • -
    • - - defaultValue - -
    • -
    -

    - Example Annotations -

    -
    -
    -
    use Swagger\Annotations as SWG;
    -
    -/**
    - * @SWG\Parameter(
    - *     name="petId",
    - *     description="ID of pet that needs to be fetched",
    - *     paramType="path",
    - *     required=true,
    - *     allowMultiple=false,
    - *     type="string"
    - * )
    - */
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    {
    -    "name":"petId",
    -    "description":"ID of pet that needs to be fetched",
    -    "paramType":"path",
    -    "required":true,
    -    "allowMultiple":false,
    -    "type":"string"
    -}
    -
    -
    -
    -

    - Allowable Use: -

    -

    Enclosed within - Operation -

    -
    -
    -

    Model - -

    -
    -

    Note

    -

    The annotations parser will follow any - extend statements of the current model class and include annotations from the - base class as well, as long as the - - Model - annotation is placed into the comment block directly above the class declaration. Be - sure also to activate the parser in the base class with the appropriate annotations.

    -
    -

    - Attributes -

    -
      -
    • - - id - the formal name of the Model being described. Defaults to the name of the class (excl. - namespace). -
    • -
    • - - required - the required properties. Example: required=”[‘id’,’name’]”
    • -
    -

    - Example Annotations -

    -
    -
    -
    use Swagger\Annotations as SWG;
    -
    -/**
    - * @SWG\Model(id="Pet")
    - */
    - class Pet
    - {
    -    ...
    - }
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    "Pet":{
    -    "id":"Pet",
    -    "properties":{
    -        ...
    -    }
    -}
    -
    -
    -
    -
    -
    -

    Property - -

    -

    - Attributes -

    -
      -
    • - - name - -
    • -
    • - - type - -
    • -
    • - - description - -
    • -
    • - Items -
    • -
    -

    - Example Annotations -

    -
    -
    -
    use Swagger\Annotations as SWG;
    -
    -/**
    - * @SWG\Property(name="category",type="Category")
    - */
    - public $category;
    - * @SWG\Property(
    - *      name="status",type="string",
    - *      enum="['available', 'pending', 'sold']",
    - *      description="pet status in the store")
    - */
    - public $status;
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    "category":{
    -    "type":"Category"
    -},
    -"status":{
    -    "enum":["available", "pending", "sold"],
    -    "description":"pet status in the store",
    -    "type":"string"
    -},
    -
    -
    -
    -

    - Allowable Use: -

    -

    Enclosed within - Model or as property annotation.

    -
    -
    -

    Items - -

    -
    -

    Note

    -

    The - - Items - annotation defines an array type i.e. an array of integers, strings or - - $ref - to another model type. References are defined with a - $ref: preamble followed by the model ID name as defined within a - Model annotation. The - - @SWG\Items - annotation resides within a - Property declaration.

    -
    -

    - Attributes -

    -
      -
    • - - Type - -
    • -
    -

    - Example Annotations -

    -
    -
    -
    use Swagger\Annotations as SWG;
    -
    -class Pet
    -{
    -    /**
    -     * @SWG\Property(name="photoUrls",type="array",@SWG\Items("string"))
    -     */
    -    public $photos;
    -
    -    /**
    -     * @SWG\Property(name="tags",type="array",@SWG\Items("Tag"))
    -     */
    -    public $tags;
    -
    -    }
    -
    -
    -
    -

    - Derived JSON -

    -
    -
    -
    "properties":{
    -    "tags":{
    -        "items":{
    -            "$ref":"Tag"
    -        },
    -        "type":"array"
    -    },
    -    "id":{
    -        "type":"integer",
    -        "format: "int64"
    -    },
    -    "category":{
    -        "type":"Category"
    -    },
    -    "status":{
    -        "enum":["available", "pending", "sold"]
    -        "description":"pet status in the store",
    -        "type":"string"
    -    },
    -    "name":{
    -        "type":"string"
    -    },
    -    "photoUrls":{
    -        "items":{
    -            "type":"string"
    -        },
    -        "type":"array"
    -    }
    -}
    -
    -
    -
    -

    - Allowable Use: -

    -

    Enclosed within: - Property -

    -
    -
    - - -
    -
    -
    -
    -
    -

    - Table Of Contents -

    - - -

    Previous topic

    -

    - Using Swagger-PHP -

    -

    Next topic

    -

    - Partials -

    - - -
    -
    -
    -
    - - - - - \ No newline at end of file diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/installation.html b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/installation.html deleted file mode 100644 index 1432b15..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/installation.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - Installation — Swagger-PHP documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    Installation - -

    -
    -

    Note

    -

    This is the documentation for (older / unsupported) swagger-php v1.x -
    Go to the - swagger-php v3.x documentation -

    -
    - -
    -

    Via Phar - -

    -

    Download the latest - swagger.phar -

    -
    -
    -
    % php swagger.phar --help
    -
    -
    -
    -
    -
    -

    Manual (Unsupported) - -

    -

    Download/clone the source from - GitHub, install - Doctrine Annotations and configure a PSR compatible class loader.

    -
    -
    - - -
    -
    -
    -
    -
    -

    - Table Of Contents -

    - - -

    Previous topic

    -

    - Welcome to Swagger-PHP’s documentation! -

    -

    Next topic

    -

    - Using Swagger-PHP -

    - - -
    -
    -
    -
    - - - - - \ No newline at end of file diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/partials.html b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/partials.html deleted file mode 100644 index 02ffe10..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/partials.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - Partials — Swagger-PHP documentation - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    Partials - -

    -
    -

    Note

    -

    This is the documentation for (older / unsupported) swagger-php v1.x -
    Go to the - swagger-php v3.x documentation -

    -
    -

    To avoid duplication swagger-php introduces partials.

    -
    -

    Defining a partial - -

    -

    Any swagger annotation can become a partial by addding the property “partial”.

    -
    -
    -
    /**
    - * @SWG\Parameter(partial="path_id", name="id", paramType="path", type="integer")
    - * @SWG\ResponseMessage(partial="error404", code=404, message="Entity not found")
    - */
    -
    -
    -
    -
    -
    -

    Using a partial - -

    -
    -
    -
    /**
    - * @SWG\Operation(
    - *   method="GET",
    - *   nickname="partialDemo"
    - *   @SWG\Partial("path_id"),
    - *   @SWG\Partial("error404"),
    - * )
    - */
    -
    -
    -
    -

    Output:

    -
    -
    -
    operations: [
    -  {
    -    method: "GET",
    -    nickname: "partialDemo",
    -    parameters: [
    -      {
    -        paramType: "path",
    -        name: "id",
    -        type: "integer"
    -      }
    -    ],
    -    responseMessages: [
    -      {
    -        code: 404,
    -        message: "Entity not found"
    -
    -      }
    -    ]
    -  }
    -]
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -

    - Table Of Contents -

    - - -

    Previous topic

    -

    - Annotations -

    - - -
    -
    -
    -
    - - - - - \ No newline at end of file diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/search.html b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/search.html deleted file mode 100644 index ffabf51..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/search.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - Search — Swagger-PHP documentation - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Search

    -
    - -

    - Please activate JavaScript to enable the search functionality. -

    -
    -

    - From here you can search these documents. Enter your search words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages containing fewer words won't appear in the result - list. -

    -
    - - - -
    - -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - \ No newline at end of file diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/searchindex.js b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/searchindex.js deleted file mode 100644 index 04de393..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({envversion:42,terms:{code:[0,1,3],partial:[],help:[4,2],photo:3,becaus:3,scalar:3,follow:[4,3],vari:4,find:3,entiti:1,categori:3,depend:[4,2],cli:4,configur:2,activ:3,friendli:0,partial_id:1,petid:3,add:[1,2],pend:3,my_project:4,queri:3,arrai:[4,3],introduc:1,info:3,them:4,sourc:2,"return":3,string:3,thei:4,get:[1,3],fals:3,autoload:2,util:0,psr:2,getpetbyid:3,loader:2,requir:[2,3],formal:3,resid:3,name:[1,3],manual:[],integ:[1,3],patch:3,"try":3,unsupport:[],each:4,found:[1,3],refer:3,summari:3,zircot:2,mistyp:3,intern:0,"static":4,petstor:3,download:2,ommit:3,librari:0,compat:[0,2],project:[4,2],shown:3,detect:3,extend:3,apivers:3,pet:[4,3],defaultvalu:3,content:[0,4],delet:3,version:3,mai:[0,4],"new":4,ref:3,method:[1,4,3],attribut:3,after:3,run:2,deriv:3,insid:3,workflow:4,sold:3,"enum":3,bodi:3,base:3,output:[1,4],put:3,path:[1,3],post:3,becom:1,valu:3,addit:4,about:[],would:3,current:3,resourcepath:3,etc:3,place:[4,3],messag:[1,3],gener:[0,4],allowmultipl:3,com:3,block:3,first:2,comment:3,via:[],partialdemo:1,directli:3,paramtyp:[1,3],within:3,echo:4,header:4,"long":3,instal:[],your:[0,2,4],duplic:1,from:[2,3],describ:3,wai:4,swaggervers:3,compos:[],swg:[1,3],"class":[2,3],avail:3,json:[0,2,3,4],includ:3,statement:3,recommend:[],"var":[4,3],scope:3,swagger:[],type:[1,4,3],"final":2,store:3,allow:3,option:[4,3],namespac:3,"public":3,line:[],protect:3,warn:3,appropri:3,enclos:3,particular:3,excl:3,"true":3,getresourc:4,must:[4,3],fly:4,photourl:3,"default":3,servic:3,access:4,exampl:[4,3],path_id:1,defin:[],can:[1,4],abov:3,root:3,fetch:3,result:0,file:[4,3],creat:4,applic:4,descript:3,basepath:3,parser:3,ani:[1,3],uri:3,tag:3,implement:2,onto:4,want:4,swgproperti:3,need:3,vendor:2,check:4,declar:3,multipl:4,author:3,perform:4,anoth:3,make:4,format:3,tip:3,note:3,also:3,when:3,html:4,bool:3,int64:3,you:4,infer:3,updat:2,product:4,sure:3,http:3,webserv:4,clone:2,object:3,tool:0,statu:3,discov:4,render:3,portal:0,user:0,extern:0,develop:4,php:[],doctrin:2,wordnik:3,github:2,nicknam:[1,3],doc:[4,3],bootstrap:2,well:[0,3],phar:[],sandbox:0,client:0,command:[],error404:1,thi:3,choos:4,preambl:3,avoid:1,latest:2},objtypes:{},objnames:{},filenames:["index","partials","installation","annotations","using_swagger"],titles:["Welcome to Swagger-PHP’s documentation!","Partials","Installation","Annotations","Using Swagger-PHP"],objects:{},titleterms:{oper:3,via:[4,2],partial:1,phar:2,api:3,hierarchi:3,instal:2,paramet:3,php:[0,4],welcom:0,item:3,compos:2,recommend:2,swagger:[0,4],resourc:3,line:4,responsemessag:3,about:0,document:0,properti:3,manual:2,annot:3,defin:1,unsupport:2,command:4,model:3}}) \ No newline at end of file diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/ajax-loader.gif b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/ajax-loader.gif deleted file mode 100644 index 61faf8c..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/ajax-loader.gif and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/basic.css b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/basic.css deleted file mode 100644 index 967e36c..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/basic.css +++ /dev/null @@ -1,537 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - width: 30px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment-bright.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment-bright.png deleted file mode 100644 index 551517b..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment-bright.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment-close.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment-close.png deleted file mode 100644 index 09b54be..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment-close.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment.png deleted file mode 100644 index 92feb52..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/comment.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-note.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-note.png deleted file mode 100644 index 263fbd5..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-note.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-seealso.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-seealso.png deleted file mode 100644 index 3eb7b05..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-seealso.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-todo.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-todo.png deleted file mode 100644 index babc4b6..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-todo.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-topic.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-topic.png deleted file mode 100644 index 2ac5747..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-topic.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-warning.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-warning.png deleted file mode 100644 index 7233d45..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/dialog-warning.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/doctools.js b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/doctools.js deleted file mode 100644 index c5455c9..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/doctools.js +++ /dev/null @@ -1,238 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/down-pressed.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/down-pressed.png deleted file mode 100644 index 6f7ad78..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/down-pressed.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/down.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/down.png deleted file mode 100644 index 3003a88..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/down.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/epub.css b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/epub.css deleted file mode 100644 index 7465a42..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/epub.css +++ /dev/null @@ -1,310 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: {{ theme_bodyfont }}; - font-size: 100%; - background-color: {{ theme_footerbgcolor }}; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: {{ theme_sidebarbgcolor }}; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: {{ theme_bgcolor }}; - color: {{ theme_textcolor }}; - padding: 0 20px 30px 20px; -} - -{%- if theme_rightsidebar|tobool %} -div.bodywrapper { - margin: 0 230px 0 0; -} -{%- endif %} - -div.footer { - color: {{ theme_footertextcolor }}; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: {{ theme_footertextcolor }}; - text-decoration: underline; -} - -div.related { - background-color: {{ theme_relbarbgcolor }}; - line-height: 30px; - color: {{ theme_relbartextcolor }}; -} - -div.related a { - color: {{ theme_relbarlinkcolor }}; -} - -div.sphinxsidebar { - {%- if theme_stickysidebar|tobool %} - top: 30px; - bottom: 0; - margin: 0; - position: fixed; - overflow: auto; - height: auto; - {%- endif %} - {%- if theme_rightsidebar|tobool %} - float: right; - {%- if theme_stickysidebar|tobool %} - right: 0; - {%- endif %} - {%- endif %} -} - -{%- if theme_stickysidebar|tobool %} -/* this is nice, but it it leads to hidden headings when jumping - to an anchor */ -/* -div.related { - position: fixed; -} - -div.documentwrapper { - margin-top: 30px; -} -*/ -{%- endif %} - -div.sphinxsidebar h3 { - font-family: {{ theme_headfont }}; - color: {{ theme_sidebartextcolor }}; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: {{ theme_sidebartextcolor }}; -} - -div.sphinxsidebar h4 { - font-family: {{ theme_headfont }}; - color: {{ theme_sidebartextcolor }}; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: {{ theme_sidebartextcolor }}; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: {{ theme_sidebartextcolor }}; -} - -div.sphinxsidebar a { - color: {{ theme_sidebarlinkcolor }}; -} - -div.sphinxsidebar input { - border: 1px solid {{ theme_sidebarlinkcolor }}; - font-family: sans-serif; - font-size: 1em; -} - -{% if theme_collapsiblesidebar|tobool %} -/* for collapsible sidebar */ -div#sidebarbutton { - background-color: {{ theme_sidebarbtncolor }}; -} -{% endif %} - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: {{ theme_linkcolor }}; - text-decoration: none; -} - -a:visited { - color: {{ theme_visitedlinkcolor }}; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -{% if theme_externalrefs|tobool %} -a.external { - text-decoration: none; - border-bottom: 1px dashed {{ theme_linkcolor }}; -} - -a.external:hover { - text-decoration: none; - border-bottom: none; -} - -a.external:visited { - text-decoration: none; - border-bottom: 1px dashed {{ theme_visitedlinkcolor }}; -} -{% endif %} - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: {{ theme_headfont }}; - background-color: {{ theme_headbgcolor }}; - font-weight: normal; - color: {{ theme_headtextcolor }}; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: {{ theme_headlinkcolor }}; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: {{ theme_headlinkcolor }}; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: {{ theme_codebgcolor }}; - color: {{ theme_codetextcolor }}; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -tt { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -.viewcode-back { - font-family: {{ theme_bodyfont }}; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/file.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/file.png deleted file mode 100644 index d18082e..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/file.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/footerbg.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/footerbg.png deleted file mode 100644 index 1fbc873..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/footerbg.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/headerbg.png b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/headerbg.png deleted file mode 100644 index 0596f20..0000000 Binary files a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/headerbg.png and /dev/null differ diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/ie6.css b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/ie6.css deleted file mode 100644 index ebdcae3..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/ie6.css +++ /dev/null @@ -1,7 +0,0 @@ -* html img, -* html .png{position:relative;behavior:expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none", -this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "',sizingMethod='image')", -this.src = "static/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''), -this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "',sizingMethod='crop')", -this.runtimeStyle.backgroundImage = "none")),this.pngSet=true) -);} diff --git a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/jquery-1.11.1.js b/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/jquery-1.11.1.js deleted file mode 100644 index d4b67f7..0000000 --- a/vendor/zircote/swagger-php/docs/.vuepress/public/1.x/static/jquery-1.11.1.js +++ /dev/null @@ -1,10308 +0,0 @@ -/*! - * jQuery JavaScript Library v1.11.1 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-05-01T17:42Z - */ - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var deletedIds = []; - -var slice = deletedIds.slice; - -var concat = deletedIds.concat; - -var push = deletedIds.push; - -var indexOf = deletedIds.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - version = "1.11.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1, IE<9 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: deletedIds.sort, - splice: deletedIds.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( support.ownLast ) { - for ( key in obj ) { - return hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( indexOf ) { - return indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - while ( j < len ) { - first[ i++ ] = second[ j++ ]; - } - - // Support: IE<9 - // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) - if ( len !== len ) { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: function() { - return +( new Date() ); - }, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v1.10.19 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-04-18 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
    "; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowclip^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - - } else if ( !(--remaining) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * Clean-up method for dom ready events - */ -function detach() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } -} - -/** - * The ready event handler and self cleanup method - */ -function completed() { - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - - -var strundefined = typeof undefined; - - - -// Support: IE<9 -// Iteration over object's inherited properties before its own -var i; -for ( i in jQuery( support ) ) { - break; -} -support.ownLast = i !== "0"; - -// Note: most support tests are defined in their respective modules. -// false until the test is run -support.inlineBlockNeedsLayout = false; - -// Execute ASAP in case we need to set body.style.zoom -jQuery(function() { - // Minified: var a,b,c,d - var val, div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - // Return for frameset docs that don't have a body - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - if ( typeof div.style.zoom !== strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); -}); - - - - -(function() { - var div = document.createElement( "div" ); - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( elem ) { - var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], - nodeType = +elem.nodeType || 1; - - // Do not set data on non-element DOM nodes because it will not be cleared (#8335). - return nodeType !== 1 && nodeType !== 9 ? - false : - - // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute("classid") === noData; -}; - - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - -function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements (space-suffixed to avoid Object.prototype collisions) - // throw uncatchable exceptions if you attempt to set expando properties - noData: { - "applet ": true, - "embed ": true, - // ...but Flash objects (which have this classid) *can* handle expandos - "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[0], - attrs = elem && elem.attributes; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; -}; -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); - - // Setup - div.innerHTML = "
    a"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName( "tbody" ).length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = - document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - input.type = "checkbox"; - input.checked = true; - fragment.appendChild( input ); - support.appendChecked = input.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE6-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // #11217 - WebKit loses check when the name is after the checked attribute - fragment.appendChild( div ); - div.innerHTML = ""; - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } -})(); - - -(function() { - var i, eventName, - div = document.createElement( "div" ); - - // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) - for ( i in { submit: true, change: true, focusin: true }) { - eventName = "on" + i; - - if ( !(support[ i + "Bubbles" ] = eventName in window) ) { - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - div.setAttribute( eventName, "t" ); - support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: IE < 9, Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - jQuery._removeData( doc, fix ); - } else { - jQuery._data( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
    ", "
    " ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
    " ], - tr: [ 2, "", "
    " ], - col: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
    ", "
    " ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!support.noCloneEvent || !support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
    " && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - deletedIds.push( id ); - } - } - } - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "