From b793bda7cb65e6f72eaa8b3d3564f4f3faa97709 Mon Sep 17 00:00:00 2001 From: Russell Date: Sat, 23 Jul 2016 17:59:40 -0400 Subject: [PATCH] version bump and remove vendor --- composer.json | 3 +- composer.lock | 103 -- vendor/autoload.php | 7 - vendor/composer/ClassLoader.php | 413 ----- vendor/composer/LICENSE | 21 - vendor/composer/autoload_classmap.php | 9 - vendor/composer/autoload_namespaces.php | 9 - vendor/composer/autoload_psr4.php | 10 - vendor/composer/autoload_real.php | 45 - vendor/composer/installed.json | 88 - vendor/sndsgd/error/LICENSE | 21 - vendor/sndsgd/error/README.md | 24 - vendor/sndsgd/error/composer.json | 29 - vendor/sndsgd/error/src/Error.php | 50 - vendor/sndsgd/error/src/ErrorInterface.php | 10 - vendor/sndsgd/util/LICENSE | 21 - vendor/sndsgd/util/README.md | 25 - vendor/sndsgd/util/composer.json | 29 - vendor/sndsgd/util/src/Arr.php | 284 --- vendor/sndsgd/util/src/ArrayAbstract.php | 108 -- vendor/sndsgd/util/src/Classname.php | 96 - vendor/sndsgd/util/src/Compare.php | 46 - vendor/sndsgd/util/src/Config.php | 100 -- vendor/sndsgd/util/src/Crypt.php | 146 -- vendor/sndsgd/util/src/DataTrait.php | 101 -- vendor/sndsgd/util/src/Date.php | 67 - vendor/sndsgd/util/src/ErrorTrait.php | 62 - vendor/sndsgd/util/src/Func.php | 41 - vendor/sndsgd/util/src/Json.php | 25 - vendor/sndsgd/util/src/Mime.php | 1880 -------------------- vendor/sndsgd/util/src/Net.php | 23 - vendor/sndsgd/util/src/PriorityQueue.php | 35 - vendor/sndsgd/util/src/Process.php | 252 --- vendor/sndsgd/util/src/Singleton.php | 50 - vendor/sndsgd/util/src/Storage.php | 86 - vendor/sndsgd/util/src/Str.php | 250 --- vendor/sndsgd/util/src/Timer.php | 174 -- vendor/sndsgd/util/src/TypeTest.php | 114 -- vendor/sndsgd/util/src/Url.php | 502 ------ 39 files changed, 1 insertion(+), 5358 deletions(-) delete mode 100644 composer.lock delete mode 100644 vendor/autoload.php delete mode 100644 vendor/composer/ClassLoader.php delete mode 100644 vendor/composer/LICENSE delete mode 100644 vendor/composer/autoload_classmap.php delete mode 100644 vendor/composer/autoload_namespaces.php delete mode 100644 vendor/composer/autoload_psr4.php delete mode 100644 vendor/composer/autoload_real.php delete mode 100644 vendor/composer/installed.json delete mode 100644 vendor/sndsgd/error/LICENSE delete mode 100644 vendor/sndsgd/error/README.md delete mode 100644 vendor/sndsgd/error/composer.json delete mode 100644 vendor/sndsgd/error/src/Error.php delete mode 100644 vendor/sndsgd/error/src/ErrorInterface.php delete mode 100644 vendor/sndsgd/util/LICENSE delete mode 100644 vendor/sndsgd/util/README.md delete mode 100644 vendor/sndsgd/util/composer.json delete mode 100644 vendor/sndsgd/util/src/Arr.php delete mode 100644 vendor/sndsgd/util/src/ArrayAbstract.php delete mode 100644 vendor/sndsgd/util/src/Classname.php delete mode 100644 vendor/sndsgd/util/src/Compare.php delete mode 100644 vendor/sndsgd/util/src/Config.php delete mode 100644 vendor/sndsgd/util/src/Crypt.php delete mode 100644 vendor/sndsgd/util/src/DataTrait.php delete mode 100644 vendor/sndsgd/util/src/Date.php delete mode 100644 vendor/sndsgd/util/src/ErrorTrait.php delete mode 100644 vendor/sndsgd/util/src/Func.php delete mode 100644 vendor/sndsgd/util/src/Json.php delete mode 100644 vendor/sndsgd/util/src/Mime.php delete mode 100644 vendor/sndsgd/util/src/Net.php delete mode 100644 vendor/sndsgd/util/src/PriorityQueue.php delete mode 100644 vendor/sndsgd/util/src/Process.php delete mode 100644 vendor/sndsgd/util/src/Singleton.php delete mode 100644 vendor/sndsgd/util/src/Storage.php delete mode 100644 vendor/sndsgd/util/src/Str.php delete mode 100644 vendor/sndsgd/util/src/Timer.php delete mode 100644 vendor/sndsgd/util/src/TypeTest.php delete mode 100644 vendor/sndsgd/util/src/Url.php diff --git a/composer.json b/composer.json index 0a81794..bb999b8 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,9 @@ "issues": "https://github.com/sndsgd/rate/issues", "source": "https://github.com/sndsgd/rate/tree/master" }, - "minimum-stability": "dev", "require": { "php": ">=7.0.0", - "sndsgd/util": "~1.0.3", + "sndsgd/util": ">=1.1.0", "sndsgd/error": ">=0.0.3" }, "require-dev": { diff --git a/composer.lock b/composer.lock deleted file mode 100644 index dae26ab..0000000 --- a/composer.lock +++ /dev/null @@ -1,103 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "17453b492adc60132ed57259bd2a713b", - "content-hash": "21a7e652108949358054bb6c7d0371f1", - "packages": [ - { - "name": "sndsgd/error", - "version": "0.0.3", - "source": { - "type": "git", - "url": "https://github.com/sndsgd/sndsgd-error.git", - "reference": "1374b2158e08263651fb513c0ff85fdc84001b04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sndsgd/sndsgd-error/zipball/1374b2158e08263651fb513c0ff85fdc84001b04", - "reference": "1374b2158e08263651fb513c0ff85fdc84001b04", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "satooshi/php-coveralls": "~1.0", - "sndsgd/util": "~1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "sndsgd\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Russell B", - "homepage": "http://snds.gd/" - } - ], - "description": "A simple error implementation in PHP", - "homepage": "https://github.com/sndsgd/sndsgd-error", - "time": "2016-04-09 11:04:39" - }, - { - "name": "sndsgd/util", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sndsgd/sndsgd-util.git", - "reference": "07b66088d8d3f558bb4838ba29bcfa98ef4e38ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sndsgd/sndsgd-util/zipball/07b66088d8d3f558bb4838ba29bcfa98ef4e38ea", - "reference": "07b66088d8d3f558bb4838ba29bcfa98ef4e38ea", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "mikey179/vfsstream": "~1.6.0", - "satooshi/php-coveralls": "~1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "sndsgd\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Russell B", - "homepage": "http://snds.gd/" - } - ], - "description": "A utility toolkit for PHP", - "homepage": "https://github.com/sndsgd/sndsgd-util", - "time": "2016-05-08 10:20:06" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.0.0" - }, - "platform-dev": [] -} diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 342aa6a..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +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 http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // 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; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $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; - } - - /** - * 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); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * 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) - { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative) { - return false; - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if ($file === null && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if ($file === null) { - // Remember that this class does not exist. - return $this->classMap[$class] = false; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { - 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; - } - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index c8d57af..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) 2015 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 7a91153..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - array($baseDir . '/src', $vendorDir . '/sndsgd/util/src', $vendorDir . '/sndsgd/error/src'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index ac6e44a..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,45 +0,0 @@ - $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); - - return $loader; - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index 7a9bd3f..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - { - "name": "sndsgd/util", - "version": "1.0.3", - "version_normalized": "1.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sndsgd/sndsgd-util.git", - "reference": "07b66088d8d3f558bb4838ba29bcfa98ef4e38ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sndsgd/sndsgd-util/zipball/07b66088d8d3f558bb4838ba29bcfa98ef4e38ea", - "reference": "07b66088d8d3f558bb4838ba29bcfa98ef4e38ea", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "mikey179/vfsstream": "~1.6.0", - "satooshi/php-coveralls": "~1.0" - }, - "time": "2016-05-08 10:20:06", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "sndsgd\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Russell B", - "homepage": "http://snds.gd/" - } - ], - "description": "A utility toolkit for PHP", - "homepage": "https://github.com/sndsgd/sndsgd-util" - }, - { - "name": "sndsgd/error", - "version": "0.0.3", - "version_normalized": "0.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/sndsgd/sndsgd-error.git", - "reference": "1374b2158e08263651fb513c0ff85fdc84001b04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sndsgd/sndsgd-error/zipball/1374b2158e08263651fb513c0ff85fdc84001b04", - "reference": "1374b2158e08263651fb513c0ff85fdc84001b04", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "satooshi/php-coveralls": "~1.0", - "sndsgd/util": "~1.0" - }, - "time": "2016-04-09 11:04:39", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "sndsgd\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Russell B", - "homepage": "http://snds.gd/" - } - ], - "description": "A simple error implementation in PHP", - "homepage": "https://github.com/sndsgd/sndsgd-error" - } -] diff --git a/vendor/sndsgd/error/LICENSE b/vendor/sndsgd/error/LICENSE deleted file mode 100644 index ccaf65c..0000000 --- a/vendor/sndsgd/error/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Russell Barnhart - -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/sndsgd/error/README.md b/vendor/sndsgd/error/README.md deleted file mode 100644 index 2d0baab..0000000 --- a/vendor/sndsgd/error/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# sndsgd/error - -[![Latest Version](https://img.shields.io/github/release/sndsgd/sndsgd-error.svg?style=flat-square)](https://github.com/sndsgd/sndsgd-error/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/sndsgd/sndsgd-error/LICENSE) -[![Build Status](https://img.shields.io/travis/sndsgd/sndsgd-error/master.svg?style=flat-square)](https://travis-ci.org/sndsgd/sndsgd-error) -[![Coverage Status](https://img.shields.io/coveralls/sndsgd/sndsgd-error.svg?style=flat-square)](https://coveralls.io/r/sndsgd/sndsgd-error?branch=master) -[![Total Downloads](https://img.shields.io/packagist/dt/sndsgd/error.svg?style=flat-square)](https://packagist.org/packages/sndsgd/error) - -A simple error implementation in PHP. - -## Requirements - -This project is unstable and subject to changes from release to release. If you intend to depend on this project, be sure to make note of and specify the version in your project's `composer.json`. Doing so will ensure any breaking changes do not break your project. - -You need **PHP >= 7.0** to use this library. - - -## Install - -Install `sndsgd/error` using [Composer](https://getcomposer.org/). - -``` -composer require sndsgd/error -``` diff --git a/vendor/sndsgd/error/composer.json b/vendor/sndsgd/error/composer.json deleted file mode 100644 index e7fe7fb..0000000 --- a/vendor/sndsgd/error/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "sndsgd/error", - "description": "A simple error implementation in PHP", - "type": "library", - "homepage": "https://github.com/sndsgd/sndsgd-error", - "license": "MIT", - "authors": [ - { - "name": "Russell B", - "homepage": "http://snds.gd/" - } - ], - "support": { - "issues": "https://github.com/sndsgd/sndsgd-util/issues", - "source": "https://github.com/sndsgd/sndsgd-util/tree/master" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "satooshi/php-coveralls": "~1.0", - "sndsgd/util": "~1.0" - }, - "autoload": { - "psr-4": { - "sndsgd\\": "src/" - } - } -} diff --git a/vendor/sndsgd/error/src/Error.php b/vendor/sndsgd/error/src/Error.php deleted file mode 100644 index 37d71da..0000000 --- a/vendor/sndsgd/error/src/Error.php +++ /dev/null @@ -1,50 +0,0 @@ -message = $message; - $this->code = $code; - } - - public function getMessage(): string - { - return $this->message; - } - - public function getCode(): int - { - return $this->code; - } - - public function toArray(): array - { - return [ - "message" => $this->getMessage(), - "code" => $this->getCode(), - ]; - } - - /** - * @see http://php.net/manual/en/jsonserializable.jsonserialize.php - */ - public function jsonSerialize() - { - return $this->toArray(); - } -} diff --git a/vendor/sndsgd/error/src/ErrorInterface.php b/vendor/sndsgd/error/src/ErrorInterface.php deleted file mode 100644 index ced5a85..0000000 --- a/vendor/sndsgd/error/src/ErrorInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -= 7.0** to use this library, however, the latest stable version of PHP is recommended. - - -## Install - -Install `sndsgd/util` using [Composer](https://getcomposer.org/). - -``` -composer require sndsgd/util -``` diff --git a/vendor/sndsgd/util/composer.json b/vendor/sndsgd/util/composer.json deleted file mode 100644 index 158cda0..0000000 --- a/vendor/sndsgd/util/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "sndsgd/util", - "description": "A utility toolkit for PHP", - "type": "library", - "homepage": "https://github.com/sndsgd/sndsgd-util", - "license": "MIT", - "authors": [ - { - "name": "Russell B", - "homepage": "http://snds.gd/" - } - ], - "support": { - "issues": "https://github.com/sndsgd/sndsgd-util/issues", - "source": "https://github.com/sndsgd/sndsgd-util/tree/master" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "mikey179/vfsStream": "~1.6.0", - "satooshi/php-coveralls": "~1.0" - }, - "autoload": { - "psr-4": { - "sndsgd\\": "src/" - } - } -} diff --git a/vendor/sndsgd/util/src/Arr.php b/vendor/sndsgd/util/src/Arr.php deleted file mode 100644 index 2539f31..0000000 --- a/vendor/sndsgd/util/src/Arr.php +++ /dev/null @@ -1,284 +0,0 @@ - - * var_dump((array) null); - * // => array(0) - * - * - * @param mixed $value The value to convert to an array - * @return array - */ - public static function cast($value): array - { - return (is_array($value)) ? $value : [$value]; - } - - /** - * Add a value to an array - * - * @param array $arr The array to add values to - * @param string|number $key The index/key to add the value under - * @param string|number $value The value to add - */ - public static function addValue(array &$arr, $key, $value) - { - if (isset($arr[$key])) { - if (!is_array($arr[$key])) { - $arr[$key] = [$arr[$key]]; - } - $arr[$key][] = $value; - } - else { - $arr[$key] = $value; - } - } - - /** - * Get an array value, or use a default if the key doesn't exist - * - * @param array $arr - * @param string|integer $key - * @param mixed $default - * @return mixed - */ - public static function getValue(array $arr, $key, $default = null) - { - return isset($arr[$key]) ? $arr[$key] : $default; - } - - /** - * Ensure that keys exist in an array - * @todo this 'bool|string' return is wonky - * - * @param array $arr The array to test - * @param array $keys Keys to check for in $test - * @return boolean|string - * @return boolean TRUE if all required keys exist - * @return string An error message indicating a key does NOT exist - */ - public static function requireKeys(array $arr, array $keys) - { - foreach ($keys as $key) { - if (!isset($arr[$key])) { - return "missing required key '$key'"; - } - } - return true; - } - - /** - * Ensure that all keys in one array exist in another - * - * @param array $arr The array to fill with missing values - * @param array $defaults The values to fill $arr with - * @return array - */ - public static function defaults(array $arr = null, array $defaults): array - { - if ($arr === null) { - return $defaults; - } - foreach ($defaults as $key => $value) { - if (!isset($arr[$key])) { - $arr[$key] = $value; - } - } - return $arr; - } - - /** - * Flatten an array - * - * @param array $arr The array to flatten - * @return array - */ - public static function flatten(array $arr): array - { - $i = 0; - $len = count($arr); - for (; $i<$len; $i++) { - if (is_array($arr[$i])) { - array_splice($arr, $i, 1, $arr[$i]); - $len--; - } - } - return $arr; - } - - /** - * Implode values with a defferent delimeter before the last element - * - * @param string $delim The delimeter - * @param array $arr The array to implode - * @param string|null $beforeLast A string to prepend to the last element - * @return string - */ - public static function implode($delim, array $arr, $beforeLast = null): string - { - if (count($arr) > 1 && $beforeLast !== null) { - $arr[] = $beforeLast.array_pop($arr); - } - return implode($delim, $arr); - } - - /** - * Selectively remove values from an array based on their keys - * - * @param array $arr The array to operate on - * @param string $key A key to remove from the array - * @return array - */ - public static function without(array $arr, string ...$keys): array - { - foreach ($keys as $key) { - if (isset($arr[$key])) { - unset($arr[$key]); - } - } - return $arr; - } - - /** - * Selectively keep values in an array based on their keys - * - * @param array $arr The array to operate on - * @param string ...$keys The key(s) to remove from the array - * @return array - */ - public static function only(array $arr, string ...$keys): array - { - $ret = []; - foreach ($keys as $key) { - if (isset($arr[$key])) { - $ret[$key] = $arr[$key]; - } - } - return $ret; - } - - /** - * Filter an array with a callback that can analyze keys AND values - * - * @param array $arr The array to operate on - * @param callable $fn The callback function - * @return array - */ - public static function filter(array $arr, callable $fn): array - { - return array_filter($arr, $fn, ARRAY_FILTER_USE_BOTH); - } - - /** - * Remove values from the end of an array using comparison - * - * @param array $arr The source array - * @param mixed $match Values matching this value will be removed - * @param boolean $strict Whether or not to use strict comparison - * @return array - */ - public static function popValues( - array $arr, - $match = false, - bool $strict = false - ): array { - $func = Compare::getMethod($strict); - $len = count($arr); - while ($len > 0 && call_user_func($func, end($arr), $match)) { - array_pop($arr); - $len--; - } - return $arr; - } - - /** - * Remove values from the beginning of an array using comparison - * - * @param array $arr The source array - * @param mixed $match Values matching this value will be removed - * @param boolean $strict Whether or not to use strict comparison - * @return array - */ - public static function shiftValues( - array $arr, - $match = false, - bool $strict = false - ): array { - $func = Compare::getMethod($strict); - $len = count($arr); - while ($len > 0 && call_user_func($func, reset($arr), $match)) { - array_shift($arr); - $len--; - } - return $arr; - } - - /** - * Create an attribute string from an associative array - * - * @param array|null $arr - * @return string - */ - public static function toAttributeString(array $arr = null): string - { - $ret = ""; - if ($arr !== null) { - foreach ($arr as $k => $v) { - $ret .= " $k=\"$v\""; - } - } - return $ret; - } - - /** - * Test that a given key exists, and its value passes a test function - * - * @param array $arr The array to search - * @param string $key The key of the array value to test - * @param callable $test A function to test the value - * @return boolean - */ - public static function testValueByKey( - array $arr, - string $key, - callable $test - ): bool { - return (array_key_exists($key, $arr) && $test($arr[$key])); - } - - /** - * Export an array as a string with better than default formatting - * - * @param array $arr The array to export - * @return string - */ - public static function export(array $arr): string - { - $str = var_export($arr, true); - $str = str_replace("array (", "array(", $str); - $str = preg_replace("/=>(\s+)array\(/s", "=> array(", $str); - $str = preg_replace("/array\(\s+\)/", "array()", $str); - return $str; - } -} diff --git a/vendor/sndsgd/util/src/ArrayAbstract.php b/vendor/sndsgd/util/src/ArrayAbstract.php deleted file mode 100644 index f2c9e39..0000000 --- a/vendor/sndsgd/util/src/ArrayAbstract.php +++ /dev/null @@ -1,108 +0,0 @@ -values = $values; - $this->isReadOnly = $isReadOnly; - } - - /** - * @see http://php.net/manual/countable.count - * @return int - */ - public function count() - { - return count($this->values); - } - - /** - * @see http://php.net/manual/arrayaccess.offsetexists - * @param mixed $offset - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->values[$offset]); - } - - /** - * @see http://php.net/manual/arrayaccess.offsetget - * @param mixed $offset - * @return mixed - */ - public function offsetGet($offset) - { - return $this->offsetExists($offset) ? $this->values[$offset] : null; - } - - /** - * @see http://php.net/manual/arrayaccess.offsetset - * @param mixed $offset - * @param mixed $value - * @throws \RuntimeException - */ - public function offsetSet($offset, $value) - { - if ($this->isReadOnly) { - $class = get_class($this); - throw new \RuntimeException( - "failed to set array value; $class is read only" - ); - } elseif ($offset === null) { - $this->values[] = $value; - } else { - $this->values[$offset] = $value; - } - } - - /** - * @see http://php.net/manual/arrayaccess.offsetunset - * @param mixed $offset - * @throws \RuntimeException - */ - public function offsetUnset($offset) - { - if ($this->isReadOnly) { - $class = get_class($this); - throw new \RuntimeException( - "failed to unset array value; $class is read only" - ); - } - unset($this->values[$offset]); - } - - /** - * @see http://php.net/manual/iteratoraggregate.getiterator - * @return \ArrayIterator - */ - public function getIterator() - { - return new \ArrayIterator($this->values); - } -} diff --git a/vendor/sndsgd/util/src/Classname.php b/vendor/sndsgd/util/src/Classname.php deleted file mode 100644 index 1a87864..0000000 --- a/vendor/sndsgd/util/src/Classname.php +++ /dev/null @@ -1,96 +0,0 @@ - - */ - public static function split(string $class): array - { - $class = preg_replace(self::REGEX_TRIM, "", $class); - return preg_split(self::REGEX_SPLIT, $class); - } - - /** - * Convert a string into a namespaced classname - * - * @param string|array $class - * @return string - */ - public static function toString($class, $separator = "\\"): string - { - if (is_string($class)) { - $class = self::split($class); - } - return implode($separator, $class); - } - - /** - * Convert a string into a namespaced method name - * - * @param string|array $class - * @param boolean $asArray Whether or not to return as an array - * @return string|array - */ - public static function toMethod($class, $asArray = false) - { - if (is_string($class)) { - $class = self::split($class); - } - $method = array_pop($class); - $classname = implode("\\", $class); - return ($asArray) ? [$classname, $method] : "$classname::$method"; - } - - /** - * Get a namespaced classname from a string of php - * - * @param string $contents - * @return string|null - */ - public static function fromContents(string $contents) - { - $class = null; - $namespace = null; - $tokens = token_get_all($contents); - for ($i=0, $len=count($tokens); $i<$len; $i++) { - if ($tokens[$i][0] === T_NAMESPACE) { - for ($j=$i+1, $jlen=count($tokens); $j<$jlen; $j++) { - if ($tokens[$j][0] === T_STRING) { - $namespace .= "\\".$tokens[$j][1]; - } - else if ($tokens[$j] === "{" || $tokens[$j] === ";") { - break; - } - } - } - else if ($tokens[$i][0] === T_CLASS) { - for ($j=$i+1; $j<$len; $j++) { - if ($tokens[$j] === "{") { - $class = $tokens[$i+2][1]; - } - } - } - } - - if ($class === null) { - return null; - } - return ($namespace === null) - ? $class - : trim($namespace."\\".$class, "\\"); - } -} diff --git a/vendor/sndsgd/util/src/Compare.php b/vendor/sndsgd/util/src/Compare.php deleted file mode 100644 index 011840b..0000000 --- a/vendor/sndsgd/util/src/Compare.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ - private static $values = []; - - /** - * Set initial config values - * - * @param array $values - */ - public static function init(array $values = []) - { - self::$values = $values; - } - - /** - * Set one or more config values - * - * @param string|array $key The unique identifier for the value - * @param number|string|null $value The value - */ - public static function set($key, $value = null) - { - if (is_array($key)) { - self::$values = array_merge(self::$values, $key); - } - else { - self::$values[$key] = $value; - } - } - - /** - * Get a config value - * - * @param string $key The unique key for the value to fetch - * @param string|null $default A value to return if the key does not exist - * @return mixed - */ - public static function get(string $key, $default = null) - { - return (array_key_exists($key, self::$values)) - ? self::$values[$key] - : $default; - } - - /** - * Get a config value, and throw an exception if it doesn't exist - * - * @param string $key The unique key for the value to fetch - * @return mixed - * @throws \Exception if $key is not set - */ - public static function getRequired(string $key) - { - if (array_key_exists($key, self::$values)) { - return self::$values[$key]; - } - throw new \Exception("the required config value '$key' was not found"); - } - - /** - * Get multiple values with specific keys as array - * - * @param array $map configName => returnName - * @return array All values are found - * @return string An error message indicating a missing config value - */ - public static function getAs(array $map) - { - $ret = []; - foreach ($map as $key => $retKey) { - if (!array_key_exists($key, self::$values)) { - return "the required config value '$key' was not found"; - } - $ret[$retKey] = self::$values[$key]; - } - return $ret; - } - - /** - * Get the entire config array - * - * @return array - */ - public static function getAll(): array - { - return self::$values; - } -} diff --git a/vendor/sndsgd/util/src/Crypt.php b/vendor/sndsgd/util/src/Crypt.php deleted file mode 100644 index b83e974..0000000 --- a/vendor/sndsgd/util/src/Crypt.php +++ /dev/null @@ -1,146 +0,0 @@ -cipher = $cipher; - $this->mode = $mode; - $this->ivSize = mcrypt_get_iv_size($cipher, $mode); - } - - /** - * Call `mcrypt_encrypt` - * Stubbable for testing failures - */ - protected function mencrypt(string $key, string $value, string $iv) - { - return mcrypt_encrypt($this->cipher, $key, $value, $this->mode, $iv); - } - - /** - * Call `mcrypt_decrypt` - * Stubbable for testing failures - */ - protected function mdecrypt(string $key, string $value, string $iv) - { - return mcrypt_decrypt($this->cipher, $key, $value, $this->mode, $iv); - } - - /** - * Encrypt a value - * - * @param string $value The value top encrypt - * @param string $key The key - * @return string The encrypted value - * @throws \Exception If the encryption fails - */ - public function encryptBinary(string $value, string $key): string - { - $iv = mcrypt_create_iv($this->ivSize, MCRYPT_DEV_URANDOM); - $ret = $this->mencrypt($this->packKey($key), $value, $iv); - if ($ret === false) { - throw new \Exception("decryption failure"); - } - return $iv.$ret; - } - - /** - * Decrypt a value - * Note: this will trim null bytes from the end of the decrypted result - * - * @param string $value The encrypted value - * @param string $key The encryption key - * @return string|null The decrypted value - * @throws \Exception If the decryption fails - */ - public function decryptBinary(string $value, string $key): string - { - $iv = substr($value, 0, $this->ivSize); - $value = substr($value, $this->ivSize); - $ret = $this->mdecrypt($this->packKey($key), $value, $iv); - if ($ret === false) { - throw new \Exception("encryption failure"); - } - return rtrim($ret, "\0"); - } - - /** - * Serialize and encrypt a value - * - * @param mixed $value - * @param string $key - * @param boolean $base64 Whether to base64 encode the result - * @return string|null - */ - public function encrypt($value, string $key, bool $base64 = false): string - { - $ret = $this->encryptBinary(serialize($value), $key); - return ($base64) ? base64_encode($ret) : $ret; - } - - /** - * Decrypt a serialized value - * - * @param string $value - * @param string $key - * @param boolean $base64 Whether to base64 decode the value before decrypting - * @return mixed - */ - public function decrypt(string $value, string $key, bool $base64 = false) - { - if ($base64) { - $value = base64_decode($value); - } - $ret = $this->decryptBinary($value, $key); - return unserialize($ret); - } - - /** - * Used to ensure a key is the appropriate length - * - * @param string $key - * @param int $length The desired key length - * @return string - */ - private function packKey(string $key, int $length = 32): string - { - $hash = sha1($key); - $hash .= strrev($hash); - return pack("H*", substr($hash, 0, $length * 2)); - } -} diff --git a/vendor/sndsgd/util/src/DataTrait.php b/vendor/sndsgd/util/src/DataTrait.php deleted file mode 100644 index 92a8e96..0000000 --- a/vendor/sndsgd/util/src/DataTrait.php +++ /dev/null @@ -1,101 +0,0 @@ - - */ - protected $data = []; - - /** - * Determine if any data exists - * - * @return boolean - */ - public function hasData(): bool - { - return !empty($this->data); - } - - /** - * Overwrite the current data - * - * @param array $data The data to replace current data with - * @return object The parent class - */ - public function setData(array $data = []) - { - $this->data = $data; - return $this; - } - - /** - * Add data - * - * @param string|array $key The name to stash data under - * @param mixed $value Whatever needs to be stashed - * @return object The parent class - */ - public function addData($key, $value = null) - { - if (is_array($key)) { - foreach ($key as $k => $v) { - $this->data[$k] = $v; - } - } - else if (is_string($key)) { - $this->data[$key] = $value; - } - else { - throw new \InvalidArgumentException( - "invalid value provided for 'key'; expecting a key as a ". - "string or an associative array" - ); - } - return $this; - } - - /** - * Remove data - * - * @param string $key The key of the data to remove - * @return boolean Whether or not the data was removed - */ - public function removeData(string $key = null): bool - { - if ($key === null) { - $this->data = []; - return true; - } - if (array_key_exists($key, $this->data)) { - unset($this->data[$key]); - return true; - } - return false; - } - - /** - * Retrieve data - * - * @param string $key The key of the data to return - * @param mixed $default A value to return if the key doesn't exist - * @return void - */ - public function getData(string $key = null, $default = null) - { - if ($key === null) { - return $this->data; - } - else if (!array_key_exists($key, $this->data)) { - return $default; - } - return $this->data[$key]; - } -} diff --git a/vendor/sndsgd/util/src/Date.php b/vendor/sndsgd/util/src/Date.php deleted file mode 100644 index 8e2d44c..0000000 --- a/vendor/sndsgd/util/src/Date.php +++ /dev/null @@ -1,67 +0,0 @@ -error = $msg; - if (($err = error_get_last()) !== null) { - $this->errorDetail = - "'{$err['message']}' in {$err['file']} on line {$err['line']}"; - } - } - - /** - * Retreive the current error - * - * @return string|null - */ - public function getError() - { - return $this->error; - } - - /** - * Retreive the current error detail - * - * @return string|null - */ - public function getErrorDetail() - { - return $this->errorDetail; - } - - /** - * Reset the errors - */ - public function clearError() - { - $this->error = $this->errorDetail = null; - } -} diff --git a/vendor/sndsgd/util/src/Func.php b/vendor/sndsgd/util/src/Func.php deleted file mode 100644 index eadbb82..0000000 --- a/vendor/sndsgd/util/src/Func.php +++ /dev/null @@ -1,41 +0,0 @@ -getMethod($method); - } - return new \ReflectionFunction($func); - } -} diff --git a/vendor/sndsgd/util/src/Json.php b/vendor/sndsgd/util/src/Json.php deleted file mode 100644 index 28c0bd9..0000000 --- a/vendor/sndsgd/util/src/Json.php +++ /dev/null @@ -1,25 +0,0 @@ -file($path); - return ($type === false) ? "application/octet-stream" : $type; - } - - /** - * Get a file extension from a content type - * - * @param string $type The mime or content type to search for - * @param string $default A fallback to extension return - * @return string - */ - public static function getExtension( - string $type, - string $default = "unknown" - ): string - { - return array_key_exists($type, self::$types) - ? self::$types[$type] - : $default; - } - - /** - * File extensions and their respective content types - * - * @var array - */ - private static $extensions = [ - "3dml" => "text/vnd.in3d.3dml", - "3g2" => "video/3gpp2", - "3gp" => "video/3gpp", - "aab" => "application/x-authorware-bin", - "aac" => "audio/x-aac", - "aam" => "application/x-authorware-map", - "aas" => "application/x-authorware-seg", - "abw" => "application/x-abiword", - "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", - "ai" => "application/postscript", - "aif" => "audio/x-aiff", - "aifc" => "audio/x-aiff", - "aiff" => "audio/x-aiff", - "air" => "application/vnd.adobe.air-application-installer-package+zip", - "alc" => "chemical/x-alchemy", - "ami" => "application/vnd.amiga.ami", - "amr" => "audio/amr", - "anx" => "application/annodex", - "apk" => "application/vnd.android.package-archive", - "application" => "application/x-ms-application", - "apr" => "application/vnd.lotus-approach", - "art" => "image/x-jg", - "asc" => "application/pgp-signature", - "asf" => "video/x-ms-asf", - "asm" => "text/x-asm", - "asn" => "chemical/x-ncbi-asn1-spec", - "aso" => "application/vnd.accpac.simply.aso", - "asx" => "video/x-ms-asf", - "atc" => "application/vnd.acucorp", - "atom" => "application/atom+xml", - "atomcat" => "application/atomcat+xml", - "atomsrv" => "application/atomserv+xml", - "atomsvc" => "application/atomsvc+xml", - "atx" => "application/vnd.antix.game-component", - "au" => "audio/basic", - "avi" => "video/x-msvideo", - "aw" => "application/applixware", - "awb" => "audio/amr-wb", - "axa" => "audio/annodex", - "axv" => "video/annodex", - "azf" => "application/vnd.airzip.filesecure.azf", - "azs" => "application/vnd.airzip.filesecure.azs", - "azw" => "application/vnd.amazon.ebook", - "b" => "chemical/x-molconn-Z", - "bak" => "application/x-trash", - "bat" => "application/x-msdos-program", - "bcpio" => "application/x-bcpio", - "bdf" => "application/x-font-bdf", - "bdm" => "application/vnd.syncml.dm+wbxml", - "bh2" => "application/vnd.fujitsu.oasysprs", - "bib" => "text/x-bibtex", - "bmi" => "application/vnd.bmi", - "bmp" => "image/bmp", - "boo" => "text/x-boo", - "book" => "application/vnd.framemaker", - "box" => "application/vnd.previewsystems.box", - "boz" => "application/x-bzip2", - "brf" => "text/plain", - "bsd" => "chemical/x-crossfire", - "btif" => "image/prs.btif", - "bz" => "application/x-bzip", - "bz2" => "application/x-bzip2", - "c" => "text/x-csrc", - "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", - "cac" => "chemical/x-cache", - "cache" => "chemical/x-cache", - "cap" => "application/cap", - "car" => "application/vnd.curl.car", - "cascii" => "chemical/x-cactvs-binary", - "cat" => "application/vnd.ms-pki.seccat", - "cbin" => "chemical/x-cactvs-binary", - "cbr" => "application/x-cbr", - "cbz" => "application/x-cbz", - "cc" => "text/x-c++src", - "cct" => "application/x-director", - "ccxml" => "application/ccxml+xml", - "cda" => "application/x-cdf", - "cdbcmsg" => "application/vnd.contact.cmsg", - "cdf" => "application/x-cdf", - "cdkey" => "application/vnd.mediastation.cdkey", - "cdr" => "image/x-coreldraw", - "cdt" => "image/x-coreldrawtemplate", - "cdx" => "chemical/x-cdx", - "cdxml" => "application/vnd.chemdraw+xml", - "cdy" => "application/vnd.cinderella", - "cef" => "chemical/x-cxf", - "cer" => "application/pkix-cert", - "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", - "cls" => "text/x-tex", - "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-msdos-program", - "conf" => "text/plain", - "cpa" => "chemical/x-compass", - "cpio" => "application/x-cpio", - "cpp" => "text/x-c++src", - "cpt" => "application/mac-compactpro", - "crd" => "application/x-mscardfile", - "crl" => "application/pkix-crl", - "crt" => "application/x-x509-ca-cert", - "crw" => "image/x-canon-crw", - "csd" => "audio/csound", - "csf" => "chemical/x-cache-csf", - "csh" => "application/x-csh", - "csm" => "chemical/x-csml", - "csml" => "chemical/x-csml", - "csp" => "application/vnd.commonspace", - "css" => "text/css", - "cst" => "application/x-director", - "csv" => "text/csv", - "ctab" => "chemical/x-cactvs-binary", - "ctx" => "chemical/x-ctx", - "cu" => "application/cu-seeme", - "cub" => "chemical/x-gaussian-cube", - "curl" => "text/vnd.curl", - "cww" => "application/prs.cww", - "cxf" => "chemical/x-cxf", - "cxt" => "application/x-director", - "cxx" => "text/x-c", - "d" => "text/x-dsrc", - "daf" => "application/vnd.mobius.daf", - "dat" => "application/x-ns-proxy-autoconfig", - "dataless" => "application/vnd.fdsn.seed", - "davmount" => "application/davmount+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", - "der" => "application/x-x509-ca-cert", - "dfac" => "application/vnd.dreamfactory", - "dic" => "text/x-c", - "dif" => "video/dv", - "diff" => "text/x-diff", - "dir" => "application/x-director", - "dis" => "application/vnd.mobius.dis", - "djv" => "image/vnd.djvu", - "djvu" => "image/vnd.djvu", - "dl" => "video/dl", - "dll" => "application/x-msdos-program", - "dmg" => "application/x-apple-diskimage", - "dms" => "application/x-dms", - "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", - "dsc" => "text/prs.lines.tag", - "dtb" => "application/x-dtbook+xml", - "dtd" => "application/xml-dtd", - "dts" => "audio/vnd.dts", - "dtshd" => "audio/vnd.dts.hd", - "dv" => "video/dv", - "dvi" => "application/x-dvi", - "dwf" => "model/vnd.dwf", - "dwg" => "image/vnd.dwg", - "dx" => "chemical/x-jcamp-dx", - "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", - "emb" => "chemical/x-embl-dl-nucleotide", - "embl" => "chemical/x-embl-dl-nucleotide", - "eml" => "message/rfc822", - "emma" => "application/emma+xml", - "ent" => "chemical/x-pdb", - "eol" => "audio/vnd.digital-winds", - "eot" => "application/vnd.ms-fontobject", - "eps" => "application/postscript", - "epsf" => "application/postscript", - "epsi" => "application/postscript", - "epub" => "application/epub+zip", - "erf" => "image/x-epson-erf", - "es" => "application/ecmascript", - "es3" => "application/vnd.eszigno3+xml", - "esf" => "application/vnd.epson.esf", - "et3" => "application/vnd.eszigno3+xml", - "etx" => "text/x-setext", - "exe" => "application/x-msdos-program", - "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", - "fb" => "application/x-maker", - "fbdoc" => "application/x-maker", - "fbs" => "image/vnd.fastbidsheet", - "fch" => "chemical/x-gaussian-checkpoint", - "fchk" => "chemical/x-gaussian-checkpoint", - "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/flac", - "fli" => "video/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", - "frm" => "application/x-maker", - "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", - "fzs" => "application/vnd.fuzzysheet", - "g3" => "image/g3fax", - "gac" => "application/vnd.groove-account", - "gal" => "chemical/x-gaussian-log", - "gam" => "chemical/x-gamess-input", - "gamin" => "chemical/x-gamess-input", - "gan" => "application/x-ganttproject", - "gau" => "chemical/x-gaussian-input", - "gcd" => "text/x-pcs-gcd", - "gcf" => "application/x-graphing-calculator", - "gcg" => "chemical/x-gcg8-sequence", - "gdl" => "model/vnd.gdl", - "gen" => "chemical/x-genbank", - "geo" => "application/vnd.dynageo", - "gex" => "application/vnd.geometry-explorer", - "gf" => "application/x-tex-gf", - "ggb" => "application/vnd.geogebra.file", - "ggt" => "application/vnd.geogebra.tool", - "ghf" => "application/vnd.groove-help", - "gif" => "image/gif", - "gim" => "application/vnd.groove-identity-message", - "gjc" => "chemical/x-gaussian-input", - "gjf" => "chemical/x-gaussian-input", - "gl" => "video/gl", - "gmx" => "application/vnd.gmx", - "gnumeric" => "application/x-gnumeric", - "gph" => "application/vnd.flographit", - "gpt" => "chemical/x-mopac-graph", - "gqf" => "application/vnd.grafeq", - "gqs" => "application/vnd.grafeq", - "gram" => "application/srgs", - "gre" => "application/vnd.geometry-explorer", - "grv" => "application/vnd.groove-injector", - "grxml" => "application/srgs+xml", - "gsf" => "application/x-font", - "gsm" => "audio/x-gsm", - "gtar" => "application/x-gtar", - "gtm" => "application/vnd.groove-tool-message", - "gtw" => "model/vnd.gtw", - "gv" => "text/vnd.graphviz", - "gz" => "application/gzip", - "h" => "text/x-c", - "h261" => "video/h261", - "h263" => "video/h263", - "h264" => "video/h264", - "hbci" => "application/vnd.hbci", - "hdf" => "application/x-hdf", - "hh" => "text/x-c", - "hin" => "chemical/x-hin", - "hlp" => "application/winhlp", - "hpgl" => "application/vnd.hp-hpgl", - "hpid" => "application/vnd.hp-hpid", - "hpp" => "text/x-c++hdr", - "hps" => "application/vnd.hp-hps", - "hqx" => "application/mac-binhex40", - "hs" => "text/x-haskell", - "hta" => "application/hta", - "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", - "hxx" => "text/x-c++hdr", - "ica" => "application/x-ica", - "icc" => "application/vnd.iccprofile", - "ice" => "x-conference/x-cooltalk", - "icm" => "application/vnd.iccprofile", - "ico" => "image/x-icon", - "ics" => "text/calendar", - "icz" => "text/calendar", - "ief" => "image/ief", - "ifb" => "text/calendar", - "ifm" => "application/vnd.shana.informed.formdata", - "iges" => "model/iges", - "igl" => "application/vnd.igloader", - "igs" => "model/iges", - "igx" => "application/vnd.micrografx.igx", - "iif" => "application/vnd.shana.informed.interchange", - "iii" => "application/x-iphone", - "imp" => "application/vnd.accpac.simply.imp", - "ims" => "application/vnd.ms-ims", - "in" => "text/plain", - "info" => "application/x-info", - "inp" => "chemical/x-gamess-input", - "ins" => "application/x-internet-signup", - "ipk" => "application/vnd.shana.informed.package", - "irm" => "application/vnd.ibm.rights-management", - "irp" => "application/vnd.irepository.package+xml", - "iso" => "application/x-iso9660-image", - "isp" => "application/x-internet-signup", - "ist" => "chemical/x-isostar", - "istr" => "chemical/x-isostar", - "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", - "jdx" => "chemical/x-jcamp-dx", - "jisp" => "application/vnd.jisp", - "jlt" => "application/vnd.hp-jlyt", - "jmz" => "application/x-jmol", - "jng" => "image/x-jng", - "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", - "kar" => "audio/midi", - "karbon" => "application/vnd.kde.karbon", - "key" => "application/pgp-keys", - "kfo" => "application/vnd.kde.kformula", - "kia" => "application/vnd.kidspiration", - "kil" => "application/x-killustrator", - "kin" => "chemical/x-kinemage", - "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", - "ksh" => "text/plain", - "ksp" => "application/vnd.kde.kspread", - "ktr" => "application/vnd.kahootz", - "ktz" => "application/vnd.kahootz", - "kwd" => "application/vnd.kde.kword", - "kwt" => "application/vnd.kde.kword", - "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-lha", - "lhs" => "text/x-literate-haskell", - "lin" => "application/bbolin", - "link66" => "application/vnd.route66.link66+xml", - "list" => "text/plain", - "list3820" => "application/vnd.ibm.modcap", - "listafp" => "application/vnd.ibm.modcap", - "log" => "text/plain", - "lostxml" => "application/lost+xml", - "lrm" => "application/vnd.ms-lrm", - "lsf" => "video/x-la-asf", - "lsx" => "video/x-la-asf", - "ltf" => "application/vnd.frogans.ltf", - "ltx" => "text/x-tex", - "lvp" => "audio/vnd.lucent.voice", - "lwp" => "application/vnd.lotus-wordpro", - "lyx" => "application/x-lyx", - "lzh" => "application/x-lzh", - "lzx" => "application/x-lzx", - "m13" => "application/x-msmediaview", - "m14" => "application/x-msmediaview", - "m1v" => "video/mpeg", - "m2a" => "audio/mpeg", - "m2v" => "video/mpeg", - "m3a" => "audio/mpeg", - "m3u" => "audio/x-mpegurl", - "m4u" => "video/vnd.mpegurl", - "m4v" => "video/x-m4v", - "ma" => "application/mathematica", - "mag" => "application/vnd.ecowin.chart", - "maker" => "application/vnd.framemaker", - "man" => "text/troff", - "manifest" => "text/cache-manifest", - "mathml" => "application/mathml+xml", - "mb" => "application/mathematica", - "mbk" => "application/vnd.mobius.mbk", - "mbox" => "application/mbox", - "mc1" => "application/vnd.medcalcdata", - "mcd" => "application/vnd.mcd", - "mcif" => "chemical/x-mmcif", - "mcm" => "chemical/x-macmolecule", - "mcurl" => "text/vnd.curl.mcurl", - "md" => "text/x-markdown", - "mdb" => "application/msaccess", - "mdi" => "image/vnd.ms-modi", - "me" => "text/troff", - "mesh" => "model/mesh", - "mfm" => "application/vnd.mfmp", - "mgz" => "application/vnd.proteus.magazine", - "mht" => "message/rfc822", - "mhtml" => "message/rfc822", - "mid" => "audio/midi", - "midi" => "audio/midi", - "mif" => "application/vnd.mif", - "mime" => "message/rfc822", - "mj2" => "video/mj2", - "mjp2" => "video/mj2", - "mkv" => "video/x-matroska", - "mlp" => "application/vnd.dolby.mlp", - "mm" => "application/x-freemind", - "mmd" => "application/vnd.chipnuts.karaoke-mmd", - "mmf" => "application/vnd.smaf", - "mml" => "text/mathml", - "mmod" => "chemical/x-macromodel-input", - "mmr" => "image/vnd.fujixerox.edmics-mmr", - "mng" => "video/x-mng", - "mny" => "application/x-msmoney", - "mobi" => "application/x-mobipocket-ebook", - "moc" => "text/x-moc", - "mol" => "chemical/x-mdl-molfile", - "moo" => "chemical/x-mopac-out", - "mop" => "chemical/x-mopac-input", - "mopcrt" => "chemical/x-mopac-input", - "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", - "mpa" => "video/mpeg", - "mpc" => "application/vnd.mophun.certificate", - "mpe" => "video/mpeg", - "mpeg" => "video/mpeg", - "mpega" => "audio/mpeg", - "mpg" => "video/mpeg", - "mpg4" => "video/mp4", - "mpga" => "audio/mpeg", - "mph" => "application/x-comsol", - "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", - "mpv" => "video/x-matroska", - "mpy" => "application/vnd.ibm.minipay", - "mqy" => "application/vnd.mobius.mqy", - "mrc" => "application/marc", - "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", - "nb" => "application/mathematica", - "nbp" => "application/mathematica", - "nc" => "application/x-netcdf", - "ncx" => "application/x-dtbncx+xml", - "nef" => "image/x-nikon-nef", - "ngdat" => "application/vnd.nokia.n-gage.data", - "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", - "nsf" => "application/vnd.lotus-notes", - "nwc" => "application/x-nwc", - "nws" => "message/rfc822", - "o" => "application/x-object", - "oa2" => "application/vnd.fujitsu.oasys2", - "oa3" => "application/vnd.fujitsu.oasys3", - "oas" => "application/vnd.fujitsu.oasys", - "obd" => "application/x-msbinder", - "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", - "old" => "application/x-trash", - "one" => "application/onenote", - "onepkg" => "application/onenote", - "onetmp" => "application/onenote", - "onetoc" => "application/onenote", - "onetoc2" => "application/onenote", - "opf" => "application/oebps-package+xml", - "oprc" => "application/vnd.palm", - "orc" => "audio/csound", - "orf" => "image/x-olympus-orf", - "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", - "otm" => "application/vnd.oasis.opendocument.text-master", - "otp" => "application/vnd.oasis.opendocument.presentation-template", - "ots" => "application/vnd.oasis.opendocument.spreadsheet-template", - "ott" => "application/vnd.oasis.opendocument.text-template", - "oxt" => "application/vnd.openofficeorg.extension", - "oza" => "application/x-oz-application", - "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", - "pac" => "application/x-ns-proxy-autoconfig", - "pas" => "text/x-pascal", - "pat" => "image/x-coreldrawpattern", - "patch" => "text/x-diff", - "pbd" => "application/vnd.powerbuilder6", - "pbm" => "image/x-portable-bitmap", - "pcap" => "application/cap", - "pcf" => "application/x-font", - "pcl" => "application/vnd.hp-pcl", - "pclxl" => "application/vnd.hp-pclxl", - "pct" => "image/x-pict", - "pcurl" => "application/vnd.curl.pcurl", - "pcx" => "image/pcx", - "pdb" => "application/vnd.palm", - "pdf" => "application/pdf", - "pfa" => "application/x-font", - "pfb" => "application/x-font", - "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-httpd-php", - "phps" => "application/x-httpd-php-source", - "pht" => "application/x-httpd-php", - "phtml" => "application/x-httpd-php", - "pic" => "image/x-pict", - "pk" => "application/x-tex-pk", - "pki" => "application/pkixcmp", - "pkipath" => "application/pkix-pkipath", - "pl" => "text/x-perl", - "plb" => "application/vnd.3gpp.pic-bw-large", - "plc" => "application/vnd.mobius.plc", - "plf" => "application/vnd.pocketlearn", - "pls" => "application/pls+xml", - "pm" => "text/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.template.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/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", - "prt" => "chemical/x-ncbi-asn1-ascii", - "ps" => "application/postscript", - "psb" => "application/vnd.3gpp.pic-bw-small", - "psd" => "image/vnd.adobe.photoshop", - "psf" => "application/x-font-linux-psf", - "ptid" => "application/vnd.pvi.ptid1", - "pub" => "application/x-mspublisher", - "pvb" => "application/vnd.3gpp.pic-bw-var", - "pwn" => "application/vnd.3m.post-it-notes", - "pwz" => "application/vnd.ms-powerpoint", - "py" => "text/x-python", - "pya" => "audio/vnd.ms-playready.media.pya", - "pyc" => "application/x-python-code", - "pyo" => "application/x-python-code", - "pyv" => "video/vnd.ms-playready.media.pyv", - "qam" => "application/vnd.epson.quickanime", - "qbo" => "application/vnd.intu.qbo", - "qfx" => "application/vnd.intu.qfx", - "qgs" => "application/x-qgis", - "qps" => "application/vnd.publishare-delta-tree", - "qt" => "video/quicktime", - "qtl" => "application/x-quicktimeplayer", - "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/rar", - "ras" => "image/x-cmu-raster", - "rb" => "application/x-ruby", - "rcprofile" => "application/vnd.ipunplugged.rcprofile", - "rd" => "chemical/x-mdl-rdfile", - "rdf" => "application/rdf+xml", - "rdp" => "application/x-rdp", - "rdz" => "application/vnd.data-vision.rdz", - "rep" => "application/vnd.businessobjects", - "res" => "application/x-dtbresource+xml", - "rgb" => "image/x-rgb", - "rhtml" => "application/x-httpd-eruby", - "rif" => "application/reginfo+xml", - "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", - "rnc" => "application/relax-ng-compact-syntax", - "roff" => "text/troff", - "ros" => "chemical/x-rosdal", - "rpm" => "application/x-redhat-package-manager", - "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", - "rxn" => "chemical/x-mdl-rxnfile", - "s" => "text/x-asm", - "saf" => "application/vnd.yamaha.smaf-audio", - "sbml" => "application/sbml+xml", - "sc" => "application/vnd.ibm.secure-container", - "scala" => "text/x-scala", - "scd" => "application/x-msschedule", - "sce" => "application/x-scilab", - "sci" => "application/x-scilab", - "scm" => "application/vnd.lotus-screencam", - "sco" => "audio/csound", - "scq" => "application/scvp-cv-request", - "scr" => "application/x-silverlight", - "scs" => "application/scvp-cv-response", - "sct" => "text/scriptlet", - "scurl" => "text/vnd.curl.scurl", - "sd" => "chemical/x-mdl-sdfile", - "sda" => "application/vnd.stardivision.draw", - "sdc" => "application/vnd.stardivision.calc", - "sdd" => "application/vnd.stardivision.impress", - "sdf" => "chemical/x-mdl-sdfile", - "sdkd" => "application/vnd.solent.sdkm+xml", - "sdkm" => "application/vnd.solent.sdkm+xml", - "sdp" => "application/sdp", - "sds" => "application/vnd.stardivision.chart", - "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", - "sgf" => "application/x-go-sgf", - "sgl" => "application/vnd.stardivision.writer-global", - "sgm" => "text/sgml", - "sgml" => "text/sgml", - "sh" => "application/x-sh", - "shar" => "application/x-shar", - "shf" => "application/shf+xml", - "shp" => "application/x-qgis", - "shtml" => "text/html", - "shx" => "application/x-qgis", - "si" => "text/vnd.wap.si", - "sic" => "application/vnd.wap.sic", - "sid" => "audio/prs.sid", - "sig" => "application/pgp-signature", - "sik" => "application/x-trash", - "silo" => "model/mesh", - "sis" => "application/vnd.symbian.install", - "sisx" => "application/vnd.symbian.install", - "sit" => "application/x-stuffit", - "sitx" => "application/x-stuffit", - "skd" => "application/vnd.koan", - "skm" => "application/vnd.koan", - "skp" => "application/vnd.koan", - "skt" => "application/vnd.koan", - "sl" => "text/vnd.wap.sl", - "slc" => "application/vnd.wap.slc", - "sldm" => "application/vnd.ms-powerpoint.slide.macroEnabled.12", - "sldx" => "application/vnd.openxmlformats-officedocument.presentationml.slide", - "slt" => "application/vnd.epson.salt", - "smf" => "application/vnd.stardivision.math", - "smi" => "application/smil", - "smil" => "application/smil", - "sml" => "application/smil", - "snd" => "audio/basic", - "snf" => "application/x-font-snf", - "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", - "srx" => "application/sparql-results+xml", - "sse" => "application/vnd.kodak-descriptor", - "ssf" => "application/vnd.epson.ssf", - "ssml" => "application/ssml+xml", - "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/sla", - "str" => "application/vnd.pg.format", - "stw" => "application/vnd.sun.xml.writer.template", - "sty" => "text/x-tex", - "sus" => "application/vnd.sus-calendar", - "susp" => "application/vnd.sus-calendar", - "sv4cpio" => "application/x-sv4cpio", - "sv4crc" => "application/x-sv4crc", - "svd" => "application/vnd.svd", - "svg" => "image/svg+xml", - "svgz" => "image/svg+xml", - "sw" => "chemical/x-swissprot", - "swa" => "application/x-director", - "swf" => "application/x-shockwave-flash", - "swfl" => "application/x-shockwave-flash", - "swi" => "application/vnd.arastra.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", - "tao" => "application/vnd.tao.intent-module-archive", - "tar" => "application/x-tar", - "taz" => "application/x-gtar-compressed", - "tcap" => "application/vnd.3gpp2.tcap", - "tcl" => "application/x-tcl", - "teacher" => "application/vnd.smart.teacher", - "tex" => "application/x-tex", - "texi" => "application/x-texinfo", - "texinfo" => "application/x-texinfo", - "text" => "text/plain", - "tfm" => "application/x-tex-tfm", - "tgf" => "chemical/x-mdl-tgf", - "tgz" => "application/x-gtar-compressed", - "thmx" => "application/vnd.ms-officetheme", - "tif" => "image/tiff", - "tiff" => "image/tiff", - "tk" => "text/x-tcl", - "tm" => "text/texmacs", - "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", - "ts" => "video/MP2T", - "tsp" => "application/dsptype", - "tsv" => "text/tab-separated-values", - "ttc" => "application/x-font-ttf", - "ttf" => "application/x-font-ttf", - "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", - "uls" => "text/iuls", - "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", - "val" => "chemical/x-ncbi-asn1-binary", - "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", - "vmd" => "chemical/x-vmd", - "vms" => "chemical/x-vamas-iso14976", - "vor" => "application/vnd.stardivision.writer", - "vox" => "application/x-authorware-bin", - "vrm" => "x-world/x-vrml", - "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", - "webm" => "video/webm", - "wiz" => "application/msword", - "wk" => "application/x-123", - "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-ms-wmz", - "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" => "text/scriptlet", - "wsdl" => "application/wsdl+xml", - "wspolicy" => "application/wspolicy+xml", - "wtb" => "application/vnd.webturbo", - "wvx" => "video/x-ms-wvx", - "wz" => "application/x-wingz", - "x32" => "application/x-authorware-bin", - "x3d" => "application/vnd.hzn-3d-crossword", - "xap" => "application/x-silverlight-app", - "xar" => "application/vnd.xara", - "xbap" => "application/x-ms-xbap", - "xbd" => "application/vnd.fujixerox.docuworks.binder", - "xbm" => "image/x-xbitmap", - "xcf" => "application/x-xcf", - "xdm" => "application/vnd.syncml.dm+xml", - "xdp" => "application/vnd.adobe.xdp+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", - "xlb" => "application/vnd.ms-excel", - "xlc" => "application/vnd.ms-excel", - "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", - "xml" => "application/xml", - "xo" => "application/vnd.olpc-sugar", - "xop" => "application/xop+xml", - "xpdl" => "application/xml", - "xpi" => "application/x-xpinstall", - "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", - "xtel" => "chemical/x-xtel", - "xul" => "application/vnd.mozilla.xul+xml", - "xvm" => "application/xv+xml", - "xvml" => "application/xv+xml", - "xwd" => "image/x-xwindowdump", - "xyz" => "chemical/x-xyz", - "zaz" => "application/vnd.zzazz.deck+xml", - "zip" => "application/zip", - "zir" => "application/vnd.zul", - "zirz" => "application/vnd.zul", - "zmm" => "application/vnd.handheld-entertainment+xml", - "zmt" => "chemical/x-mopac-input", - "123" => "application/vnd.lotus-1-2-3", - ]; - - /** - * Content types and their respective file extensions - * - * @var array|null - */ - private static $types = [ - "application/andrew-inset" => "ez", - "application/annodex" => "anx", - "application/applixware" => "aw", - "application/atom+xml" => "atom", - "application/atomcat+xml" => "atomcat", - "application/atomserv+xml" => "atomsrv", - "application/atomsvc+xml" => "atomsvc", - "application/bbolin" => "lin", - "application/cap" => "cap", - "application/ccxml+xml" => "ccxml", - "application/cu-seeme" => "cu", - "application/davmount+xml" => "davmount", - "application/dsptype" => "tsp", - "application/ecmascript" => "es", - "application/emma+xml" => "emma", - "application/epub+zip" => "epub", - "application/font-tdpfr" => "pfr", - "application/gzip" => "gz", - "application/hta" => "hta", - "application/hyperstudio" => "stk", - "application/java-archive" => "jar", - "application/java-serialized-object" => "ser", - "application/java-vm" => "class", - "application/javascript" => "js", - "application/json" => "json", - "application/lost+xml" => "lostxml", - "application/mac-binhex40" => "hqx", - "application/mac-compactpro" => "cpt", - "application/marc" => "mrc", - "application/mathematica" => "nb", - "application/mathml+xml" => "mathml", - "application/mbox" => "mbox", - "application/mediaservercontrol+xml" => "mscml", - "application/mp4" => "mp4s", - "application/msaccess" => "mdb", - "application/msword" => "doc", - "application/mxf" => "mxf", - "application/oda" => "oda", - "application/oebps-package+xml" => "opf", - "application/ogg" => "ogx", - "application/onenote" => "one", - "application/patch-ops-error+xml" => "xer", - "application/pdf" => "pdf", - "application/pgp-encrypted" => "pgp", - "application/pgp-keys" => "key", - "application/pgp-signature" => "pgp", - "application/pics-rules" => "prf", - "application/pkcs10" => "p10", - "application/pkcs7-mime" => "p7c", - "application/pkcs7-signature" => "p7s", - "application/pkix-cert" => "cer", - "application/pkix-crl" => "crl", - "application/pkix-pkipath" => "pkipath", - "application/pkixcmp" => "pki", - "application/pls+xml" => "pls", - "application/postscript" => "ps", - "application/prs.cww" => "cww", - "application/rar" => "rar", - "application/rdf+xml" => "rdf", - "application/reginfo+xml" => "rif", - "application/relax-ng-compact-syntax" => "rnc", - "application/resource-lists+xml" => "rl", - "application/resource-lists-diff+xml" => "rld", - "application/rls-services+xml" => "rs", - "application/rsd+xml" => "rsd", - "application/rss+xml" => "rss", - "application/rtf" => "rtf", - "application/sbml+xml" => "sbml", - "application/scvp-cv-request" => "scq", - "application/scvp-cv-response" => "scs", - "application/scvp-vp-request" => "spq", - "application/scvp-vp-response" => "spp", - "application/sdp" => "sdp", - "application/set-payment-initiation" => "setpay", - "application/set-registration-initiation" => "setreg", - "application/shf+xml" => "shf", - "application/sla" => "stl", - "application/smil" => "smil", - "application/smil+xml" => "smil", - "application/sparql-query" => "rq", - "application/sparql-results+xml" => "srx", - "application/srgs" => "gram", - "application/srgs+xml" => "grxml", - "application/ssml+xml" => "ssml", - "application/vnd.3gpp.pic-bw-large" => "plb", - "application/vnd.3gpp.pic-bw-small" => "psb", - "application/vnd.3gpp.pic-bw-var" => "pvb", - "application/vnd.3gpp2.tcap" => "tcap", - "application/vnd.3m.post-it-notes" => "pwn", - "application/vnd.accpac.simply.aso" => "aso", - "application/vnd.accpac.simply.imp" => "imp", - "application/vnd.acucobol" => "acu", - "application/vnd.acucorp" => "acutc", - "application/vnd.adobe.air-application-installer-package+zip" => "air", - "application/vnd.adobe.xdp+xml" => "xdp", - "application/vnd.adobe.xfdf" => "xfdf", - "application/vnd.airzip.filesecure.azf" => "azf", - "application/vnd.airzip.filesecure.azs" => "azs", - "application/vnd.amazon.ebook" => "azw", - "application/vnd.americandynamics.acc" => "acc", - "application/vnd.amiga.ami" => "ami", - "application/vnd.android.package-archive" => "apk", - "application/vnd.anser-web-certificate-issue-initiation" => "cii", - "application/vnd.anser-web-funds-transfer-initiation" => "fti", - "application/vnd.antix.game-component" => "atx", - "application/vnd.apple.installer+xml" => "mpkg", - "application/vnd.arastra.swi" => "swi", - "application/vnd.audiograph" => "aep", - "application/vnd.blueice.multipass" => "mpm", - "application/vnd.bmi" => "bmi", - "application/vnd.businessobjects" => "rep", - "application/vnd.chemdraw+xml" => "cdxml", - "application/vnd.chipnuts.karaoke-mmd" => "mmd", - "application/vnd.cinderella" => "cdy", - "application/vnd.claymore" => "cla", - "application/vnd.clonk.c4group" => "c4d", - "application/vnd.commonspace" => "csp", - "application/vnd.contact.cmsg" => "cdbcmsg", - "application/vnd.cosmocaller" => "cmc", - "application/vnd.crick.clicker" => "clkx", - "application/vnd.crick.clicker.keyboard" => "clkk", - "application/vnd.crick.clicker.palette" => "clkp", - "application/vnd.crick.clicker.template" => "clkt", - "application/vnd.crick.clicker.wordbank" => "clkw", - "application/vnd.criticaltools.wbs+xml" => "wbs", - "application/vnd.ctc-posml" => "pml", - "application/vnd.cups-ppd" => "ppd", - "application/vnd.curl.car" => "car", - "application/vnd.curl.pcurl" => "pcurl", - "application/vnd.data-vision.rdz" => "rdz", - "application/vnd.denovo.fcselayout-link" => "fe_launch", - "application/vnd.dna" => "dna", - "application/vnd.dolby.mlp" => "mlp", - "application/vnd.dpgraph" => "dpg", - "application/vnd.dreamfactory" => "dfac", - "application/vnd.dynageo" => "geo", - "application/vnd.ecowin.chart" => "mag", - "application/vnd.enliven" => "nml", - "application/vnd.epson.esf" => "esf", - "application/vnd.epson.msf" => "msf", - "application/vnd.epson.quickanime" => "qam", - "application/vnd.epson.salt" => "slt", - "application/vnd.epson.ssf" => "ssf", - "application/vnd.eszigno3+xml" => "es3", - "application/vnd.ezpix-album" => "ez2", - "application/vnd.ezpix-package" => "ez3", - "application/vnd.fdf" => "fdf", - "application/vnd.fdsn.mseed" => "mseed", - "application/vnd.fdsn.seed" => "dataless", - "application/vnd.flographit" => "gph", - "application/vnd.fluxtime.clip" => "ftc", - "application/vnd.framemaker" => "book", - "application/vnd.frogans.fnc" => "fnc", - "application/vnd.frogans.ltf" => "ltf", - "application/vnd.fsc.weblaunch" => "fsc", - "application/vnd.fujitsu.oasys" => "oas", - "application/vnd.fujitsu.oasys2" => "oa2", - "application/vnd.fujitsu.oasys3" => "oa3", - "application/vnd.fujitsu.oasysgp" => "fg5", - "application/vnd.fujitsu.oasysprs" => "bh2", - "application/vnd.fujixerox.ddd" => "ddd", - "application/vnd.fujixerox.docuworks" => "xdw", - "application/vnd.fujixerox.docuworks.binder" => "xbd", - "application/vnd.fuzzysheet" => "fzs", - "application/vnd.genomatix.tuxedo" => "txd", - "application/vnd.geogebra.file" => "ggb", - "application/vnd.geogebra.tool" => "ggt", - "application/vnd.geometry-explorer" => "gex", - "application/vnd.gmx" => "gmx", - "application/vnd.google-earth.kml+xml" => "kml", - "application/vnd.google-earth.kmz" => "kmz", - "application/vnd.grafeq" => "gqf", - "application/vnd.groove-account" => "gac", - "application/vnd.groove-help" => "ghf", - "application/vnd.groove-identity-message" => "gim", - "application/vnd.groove-injector" => "grv", - "application/vnd.groove-tool-message" => "gtm", - "application/vnd.groove-tool-template" => "tpl", - "application/vnd.groove-vcard" => "vcg", - "application/vnd.handheld-entertainment+xml" => "zmm", - "application/vnd.hbci" => "hbci", - "application/vnd.hhe.lesson-player" => "les", - "application/vnd.hp-hpgl" => "hpgl", - "application/vnd.hp-hpid" => "hpid", - "application/vnd.hp-hps" => "hps", - "application/vnd.hp-jlyt" => "jlt", - "application/vnd.hp-pcl" => "pcl", - "application/vnd.hp-pclxl" => "pclxl", - "application/vnd.hydrostatix.sof-data" => "sfd-hdstx", - "application/vnd.hzn-3d-crossword" => "x3d", - "application/vnd.ibm.minipay" => "mpy", - "application/vnd.ibm.modcap" => "afp", - "application/vnd.ibm.rights-management" => "irm", - "application/vnd.ibm.secure-container" => "sc", - "application/vnd.iccprofile" => "icc", - "application/vnd.igloader" => "igl", - "application/vnd.immervision-ivp" => "ivp", - "application/vnd.immervision-ivu" => "ivu", - "application/vnd.intercon.formnet" => "xpw", - "application/vnd.intu.qbo" => "qbo", - "application/vnd.intu.qfx" => "qfx", - "application/vnd.ipunplugged.rcprofile" => "rcprofile", - "application/vnd.irepository.package+xml" => "irp", - "application/vnd.is-xpr" => "xpr", - "application/vnd.jam" => "jam", - "application/vnd.jcp.javame.midlet-rms" => "rms", - "application/vnd.jisp" => "jisp", - "application/vnd.joost.joda-archive" => "joda", - "application/vnd.kahootz" => "ktr", - "application/vnd.kde.karbon" => "karbon", - "application/vnd.kde.kchart" => "chrt", - "application/vnd.kde.kformula" => "kfo", - "application/vnd.kde.kivio" => "flw", - "application/vnd.kde.kontour" => "kon", - "application/vnd.kde.kpresenter" => "kpr", - "application/vnd.kde.kspread" => "ksp", - "application/vnd.kde.kword" => "kwd", - "application/vnd.kenameaapp" => "htke", - "application/vnd.kidspiration" => "kia", - "application/vnd.kinar" => "kne", - "application/vnd.koan" => "skd", - "application/vnd.kodak-descriptor" => "sse", - "application/vnd.llamagraphics.life-balance.desktop" => "lbd", - "application/vnd.llamagraphics.life-balance.exchange+xml" => "lbe", - "application/vnd.lotus-1-2-3" => "123", - "application/vnd.lotus-approach" => "apr", - "application/vnd.lotus-freelance" => "pre", - "application/vnd.lotus-notes" => "nsf", - "application/vnd.lotus-organizer" => "org", - "application/vnd.lotus-screencam" => "scm", - "application/vnd.lotus-wordpro" => "lwp", - "application/vnd.macports.portpkg" => "portpkg", - "application/vnd.mcd" => "mcd", - "application/vnd.medcalcdata" => "mc1", - "application/vnd.mediastation.cdkey" => "cdkey", - "application/vnd.mfer" => "mwf", - "application/vnd.mfmp" => "mfm", - "application/vnd.micrografx.flo" => "flo", - "application/vnd.micrografx.igx" => "igx", - "application/vnd.mif" => "mif", - "application/vnd.mobius.daf" => "daf", - "application/vnd.mobius.dis" => "dis", - "application/vnd.mobius.mbk" => "mbk", - "application/vnd.mobius.mqy" => "mqy", - "application/vnd.mobius.msl" => "msl", - "application/vnd.mobius.plc" => "plc", - "application/vnd.mobius.txf" => "txf", - "application/vnd.mophun.application" => "mpn", - "application/vnd.mophun.certificate" => "mpc", - "application/vnd.mozilla.xul+xml" => "xul", - "application/vnd.ms-artgalry" => "cil", - "application/vnd.ms-cab-compressed" => "cab", - "application/vnd.ms-excel" => "xlb", - "application/vnd.ms-excel.addin.macroEnabled.12" => "xlam", - "application/vnd.ms-excel.addin.macroenabled.12" => "xlam", - "application/vnd.ms-excel.sheet.binary.macroEnabled.12" => "xlsb", - "application/vnd.ms-excel.sheet.binary.macroenabled.12" => "xlsb", - "application/vnd.ms-excel.sheet.macroEnabled.12" => "xlsm", - "application/vnd.ms-excel.sheet.macroenabled.12" => "xlsm", - "application/vnd.ms-excel.template.macroEnabled.12" => "xltm", - "application/vnd.ms-excel.template.macroenabled.12" => "xltm", - "application/vnd.ms-fontobject" => "eot", - "application/vnd.ms-htmlhelp" => "chm", - "application/vnd.ms-ims" => "ims", - "application/vnd.ms-lrm" => "lrm", - "application/vnd.ms-officetheme" => "thmx", - "application/vnd.ms-pki.seccat" => "cat", - "application/vnd.ms-pki.stl" => "stl", - "application/vnd.ms-powerpoint" => "ppt", - "application/vnd.ms-powerpoint.addin.macroEnabled.12" => "ppam", - "application/vnd.ms-powerpoint.addin.macroenabled.12" => "ppam", - "application/vnd.ms-powerpoint.presentation.macroEnabled.12" => "pptm", - "application/vnd.ms-powerpoint.presentation.macroenabled.12" => "pptm", - "application/vnd.ms-powerpoint.slide.macroEnabled.12" => "sldm", - "application/vnd.ms-powerpoint.slide.macroenabled.12" => "sldm", - "application/vnd.ms-powerpoint.slideshow.macroEnabled.12" => "ppsm", - "application/vnd.ms-powerpoint.slideshow.macroenabled.12" => "ppsm", - "application/vnd.ms-powerpoint.template.macroEnabled.12" => "potm", - "application/vnd.ms-powerpoint.template.macroenabled.12" => "potm", - "application/vnd.ms-project" => "mpp", - "application/vnd.ms-word.document.macroEnabled.12" => "docm", - "application/vnd.ms-word.document.macroenabled.12" => "docm", - "application/vnd.ms-word.template.macroEnabled.12" => "dotm", - "application/vnd.ms-word.template.macroenabled.12" => "dotm", - "application/vnd.ms-works" => "wcm", - "application/vnd.ms-wpl" => "wpl", - "application/vnd.ms-xpsdocument" => "xps", - "application/vnd.mseq" => "mseq", - "application/vnd.musician" => "mus", - "application/vnd.muvee.style" => "msty", - "application/vnd.neurolanguage.nlu" => "nlu", - "application/vnd.noblenet-directory" => "nnd", - "application/vnd.noblenet-sealer" => "nns", - "application/vnd.noblenet-web" => "nnw", - "application/vnd.nokia.n-gage.data" => "ngdat", - "application/vnd.nokia.n-gage.symbian.install" => "n-gage", - "application/vnd.nokia.radio-preset" => "rpst", - "application/vnd.nokia.radio-presets" => "rpss", - "application/vnd.novadigm.edm" => "edm", - "application/vnd.novadigm.edx" => "edx", - "application/vnd.novadigm.ext" => "ext", - "application/vnd.oasis.opendocument.chart" => "odc", - "application/vnd.oasis.opendocument.chart-template" => "otc", - "application/vnd.oasis.opendocument.database" => "odb", - "application/vnd.oasis.opendocument.formula" => "odf", - "application/vnd.oasis.opendocument.formula-template" => "odft", - "application/vnd.oasis.opendocument.graphics" => "odg", - "application/vnd.oasis.opendocument.graphics-template" => "otg", - "application/vnd.oasis.opendocument.image" => "odi", - "application/vnd.oasis.opendocument.image-template" => "oti", - "application/vnd.oasis.opendocument.presentation" => "odp", - "application/vnd.oasis.opendocument.presentation-template" => "otp", - "application/vnd.oasis.opendocument.spreadsheet" => "ods", - "application/vnd.oasis.opendocument.spreadsheet-template" => "ots", - "application/vnd.oasis.opendocument.text" => "odt", - "application/vnd.oasis.opendocument.text-master" => "odm", - "application/vnd.oasis.opendocument.text-template" => "ott", - "application/vnd.oasis.opendocument.text-web" => "oth", - "application/vnd.olpc-sugar" => "xo", - "application/vnd.oma.dd2+xml" => "dd2", - "application/vnd.openofficeorg.extension" => "oxt", - "application/vnd.openxmlformats-officedocument.presentationml.presentation" => "pptx", - "application/vnd.openxmlformats-officedocument.presentationml.slide" => "sldx", - "application/vnd.openxmlformats-officedocument.presentationml.slideshow" => "ppsx", - "application/vnd.openxmlformats-officedocument.presentationml.template" => "potx", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" => "xlsx", - "application/vnd.openxmlformats-officedocument.spreadsheetml.template" => "xltx", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document" => "docx", - "application/vnd.openxmlformats-officedocument.wordprocessingml.template" => "dotx", - "application/vnd.osgi.dp" => "dp", - "application/vnd.palm" => "oprc", - "application/vnd.pg.format" => "str", - "application/vnd.pg.osasli" => "ei6", - "application/vnd.picsel" => "efif", - "application/vnd.pocketlearn" => "plf", - "application/vnd.powerbuilder6" => "pbd", - "application/vnd.previewsystems.box" => "box", - "application/vnd.proteus.magazine" => "mgz", - "application/vnd.publishare-delta-tree" => "qps", - "application/vnd.pvi.ptid1" => "ptid", - "application/vnd.quark.quarkxpress" => "qwd", - "application/vnd.recordare.musicxml" => "mxl", - "application/vnd.recordare.musicxml+xml" => "musicxml", - "application/vnd.rim.cod" => "cod", - "application/vnd.rn-realmedia" => "rm", - "application/vnd.route66.link66+xml" => "link66", - "application/vnd.seemail" => "see", - "application/vnd.sema" => "sema", - "application/vnd.semd" => "semd", - "application/vnd.semf" => "semf", - "application/vnd.shana.informed.formdata" => "ifm", - "application/vnd.shana.informed.formtemplate" => "itp", - "application/vnd.shana.informed.interchange" => "iif", - "application/vnd.shana.informed.package" => "ipk", - "application/vnd.simtech-mindmapper" => "twd", - "application/vnd.smaf" => "mmf", - "application/vnd.smart.teacher" => "teacher", - "application/vnd.solent.sdkm+xml" => "sdkd", - "application/vnd.spotfire.dxp" => "dxp", - "application/vnd.spotfire.sfs" => "sfs", - "application/vnd.stardivision.calc" => "sdc", - "application/vnd.stardivision.chart" => "sds", - "application/vnd.stardivision.draw" => "sda", - "application/vnd.stardivision.impress" => "sdd", - "application/vnd.stardivision.math" => "smf", - "application/vnd.stardivision.writer" => "sdw", - "application/vnd.stardivision.writer-global" => "sgl", - "application/vnd.sun.xml.calc" => "sxc", - "application/vnd.sun.xml.calc.template" => "stc", - "application/vnd.sun.xml.draw" => "sxd", - "application/vnd.sun.xml.draw.template" => "std", - "application/vnd.sun.xml.impress" => "sxi", - "application/vnd.sun.xml.impress.template" => "sti", - "application/vnd.sun.xml.math" => "sxm", - "application/vnd.sun.xml.writer" => "sxw", - "application/vnd.sun.xml.writer.global" => "sxg", - "application/vnd.sun.xml.writer.template" => "stw", - "application/vnd.sus-calendar" => "sus", - "application/vnd.svd" => "svd", - "application/vnd.symbian.install" => "sis", - "application/vnd.syncml+xml" => "xsm", - "application/vnd.syncml.dm+wbxml" => "bdm", - "application/vnd.syncml.dm+xml" => "xdm", - "application/vnd.tao.intent-module-archive" => "tao", - "application/vnd.tmobile-livetv" => "tmo", - "application/vnd.trid.tpt" => "tpt", - "application/vnd.triscape.mxs" => "mxs", - "application/vnd.trueapp" => "tra", - "application/vnd.ufdl" => "ufd", - "application/vnd.uiq.theme" => "utz", - "application/vnd.umajin" => "umj", - "application/vnd.unity" => "unityweb", - "application/vnd.uoml+xml" => "uoml", - "application/vnd.vcx" => "vcx", - "application/vnd.visio" => "vsd", - "application/vnd.visionary" => "vis", - "application/vnd.vsf" => "vsf", - "application/vnd.wap.sic" => "sic", - "application/vnd.wap.slc" => "slc", - "application/vnd.wap.wbxml" => "wbxml", - "application/vnd.wap.wmlc" => "wmlc", - "application/vnd.wap.wmlscriptc" => "wmlsc", - "application/vnd.webturbo" => "wtb", - "application/vnd.wordperfect" => "wpd", - "application/vnd.wqd" => "wqd", - "application/vnd.wt.stf" => "stf", - "application/vnd.xara" => "xar", - "application/vnd.xfdl" => "xfdl", - "application/vnd.yamaha.hv-dic" => "hvd", - "application/vnd.yamaha.hv-script" => "hvs", - "application/vnd.yamaha.hv-voice" => "hvp", - "application/vnd.yamaha.openscoreformat" => "osf", - "application/vnd.yamaha.openscoreformat.osfpvg+xml" => "osfpvg", - "application/vnd.yamaha.smaf-audio" => "saf", - "application/vnd.yamaha.smaf-phrase" => "spf", - "application/vnd.yellowriver-custom-menu" => "cmp", - "application/vnd.zul" => "zir", - "application/vnd.zzazz.deck+xml" => "zaz", - "application/voicexml+xml" => "vxml", - "application/winhlp" => "hlp", - "application/wsdl+xml" => "wsdl", - "application/wspolicy+xml" => "wspolicy", - "application/x-123" => "wk", - "application/x-abiword" => "abw", - "application/x-ace-compressed" => "ace", - "application/x-apple-diskimage" => "dmg", - "application/x-authorware-bin" => "aab", - "application/x-authorware-map" => "aam", - "application/x-authorware-seg" => "aas", - "application/x-bcpio" => "bcpio", - "application/x-bittorrent" => "torrent", - "application/x-bzip" => "bz", - "application/x-bzip2" => "boz", - "application/x-cab" => "cab", - "application/x-cbr" => "cbr", - "application/x-cbz" => "cbz", - "application/x-cdf" => "cda", - "application/x-cdlink" => "vcd", - "application/x-chat" => "chat", - "application/x-chess-pgn" => "pgn", - "application/x-comsol" => "mph", - "application/x-cpio" => "cpio", - "application/x-csh" => "csh", - "application/x-debian-package" => "deb", - "application/x-director" => "dcr", - "application/x-dms" => "dms", - "application/x-doom" => "wad", - "application/x-dtbncx+xml" => "ncx", - "application/x-dtbook+xml" => "dtb", - "application/x-dtbresource+xml" => "res", - "application/x-dvi" => "dvi", - "application/x-font" => "gsf", - "application/x-font-bdf" => "bdf", - "application/x-font-ghostscript" => "gsf", - "application/x-font-linux-psf" => "psf", - "application/x-font-otf" => "otf", - "application/x-font-pcf" => "pcf", - "application/x-font-snf" => "snf", - "application/x-font-ttf" => "ttc", - "application/x-font-type1" => "afm", - "application/x-freemind" => "mm", - "application/x-futuresplash" => "spl", - "application/x-ganttproject" => "gan", - "application/x-gnumeric" => "gnumeric", - "application/x-go-sgf" => "sgf", - "application/x-graphing-calculator" => "gcf", - "application/x-gtar" => "gtar", - "application/x-gtar-compressed" => "taz", - "application/x-gzip" => "gz", - "application/x-hdf" => "hdf", - "application/x-httpd-eruby" => "rhtml", - "application/x-httpd-php" => "php", - "application/x-httpd-php-source" => "phps", - "application/x-ica" => "ica", - "application/x-info" => "info", - "application/x-internet-signup" => "ins", - "application/x-iphone" => "iii", - "application/x-iso9660-image" => "iso", - "application/x-jam" => "jam", - "application/x-java-jnlp-file" => "jnlp", - "application/x-javascript" => "js", - "application/x-jmol" => "jmz", - "application/x-kchart" => "chrt", - "application/x-killustrator" => "kil", - "application/x-koan" => "skd", - "application/x-kpresenter" => "kpr", - "application/x-kspread" => "ksp", - "application/x-kword" => "kwd", - "application/x-latex" => "latex", - "application/x-lha" => "lha", - "application/x-lyx" => "lyx", - "application/x-lzh" => "lzh", - "application/x-lzx" => "lzx", - "application/x-maker" => "book", - "application/x-mif" => "mif", - "application/x-mobipocket-ebook" => "mobi", - "application/x-ms-application" => "application", - "application/x-ms-wmd" => "wmd", - "application/x-ms-wmz" => "wmz", - "application/x-ms-xbap" => "xbap", - "application/x-msaccess" => "mdb", - "application/x-msbinder" => "obd", - "application/x-mscardfile" => "crd", - "application/x-msclip" => "clp", - "application/x-msdos-program" => "bat", - "application/x-msdownload" => "bat", - "application/x-msi" => "msi", - "application/x-msmediaview" => "m13", - "application/x-msmetafile" => "wmf", - "application/x-msmoney" => "mny", - "application/x-mspublisher" => "pub", - "application/x-msschedule" => "scd", - "application/x-msterminal" => "trm", - "application/x-mswrite" => "wri", - "application/x-netcdf" => "nc", - "application/x-ns-proxy-autoconfig" => "dat", - "application/x-nwc" => "nwc", - "application/x-object" => "o", - "application/x-oz-application" => "oza", - "application/x-pkcs12" => "p12", - "application/x-pkcs7-certificates" => "p7b", - "application/x-pkcs7-certreqresp" => "p7r", - "application/x-pkcs7-crl" => "crl", - "application/x-python-code" => "pyc", - "application/x-qgis" => "qgs", - "application/x-quicktimeplayer" => "qtl", - "application/x-rar-compressed" => "rar", - "application/x-rdp" => "rdp", - "application/x-redhat-package-manager" => "rpm", - "application/x-rpm" => "rpm", - "application/x-ruby" => "rb", - "application/x-scilab" => "sce", - "application/x-sh" => "sh", - "application/x-shar" => "shar", - "application/x-shockwave-flash" => "swf", - "application/x-silverlight" => "scr", - "application/x-silverlight-app" => "xap", - "application/x-sql" => "sql", - "application/x-stuffit" => "sit", - "application/x-stuffitx" => "sitx", - "application/x-sv4cpio" => "sv4cpio", - "application/x-sv4crc" => "sv4crc", - "application/x-tar" => "tar", - "application/x-tcl" => "tcl", - "application/x-tex" => "tex", - "application/x-tex-gf" => "gf", - "application/x-tex-pk" => "pk", - "application/x-tex-tfm" => "tfm", - "application/x-texinfo" => "texi", - "application/x-trash" => "bak", - "application/x-troff" => "roff", - "application/x-troff-man" => "man", - "application/x-troff-me" => "me", - "application/x-troff-ms" => "ms", - "application/x-ustar" => "ustar", - "application/x-wais-source" => "src", - "application/x-wingz" => "wz", - "application/x-x509-ca-cert" => "crt", - "application/x-xcf" => "xcf", - "application/x-xfig" => "fig", - "application/x-xpinstall" => "xpi", - "application/xenc+xml" => "xenc", - "application/xhtml+xml" => "xht", - "application/xml" => "xml", - "application/xml-dtd" => "dtd", - "application/xop+xml" => "xop", - "application/xslt+xml" => "xslt", - "application/xspf+xml" => "xspf", - "application/xv+xml" => "mxml", - "application/zip" => "zip", - "audio/adpcm" => "adp", - "audio/amr" => "amr", - "audio/amr-wb" => "awb", - "audio/annodex" => "axa", - "audio/basic" => "au", - "audio/csound" => "csd", - "audio/flac" => "flac", - "audio/midi" => "mid", - "audio/mp4" => "mp4a", - "audio/mpeg" => "mp3", - "audio/ogg" => "ogg", - "audio/prs.sid" => "sid", - "audio/vnd.digital-winds" => "eol", - "audio/vnd.dts" => "dts", - "audio/vnd.dts.hd" => "dtshd", - "audio/vnd.lucent.voice" => "lvp", - "audio/vnd.ms-playready.media.pya" => "pya", - "audio/vnd.nuera.ecelp4800" => "ecelp4800", - "audio/vnd.nuera.ecelp7470" => "ecelp7470", - "audio/vnd.nuera.ecelp9600" => "ecelp9600", - "audio/x-aac" => "aac", - "audio/x-aiff" => "aiff", - "audio/x-gsm" => "gsm", - "audio/x-mpegurl" => "m3u", - "audio/x-ms-wax" => "wax", - "audio/x-ms-wma" => "wma", - "audio/x-pn-realaudio" => "ram", - "audio/x-pn-realaudio-plugin" => "rmp", - "audio/x-realaudio" => "ra", - "audio/x-scpls" => "pls", - "audio/x-wav" => "wav", - "chemical/x-alchemy" => "alc", - "chemical/x-cache" => "cac", - "chemical/x-cache-csf" => "csf", - "chemical/x-cactvs-binary" => "cascii", - "chemical/x-cdx" => "cdx", - "chemical/x-cerius" => "cer", - "chemical/x-chemdraw" => "chm", - "chemical/x-cif" => "cif", - "chemical/x-cmdf" => "cmdf", - "chemical/x-cml" => "cml", - "chemical/x-compass" => "cpa", - "chemical/x-crossfire" => "bsd", - "chemical/x-csml" => "csm", - "chemical/x-ctx" => "ctx", - "chemical/x-cxf" => "cef", - "chemical/x-embl-dl-nucleotide" => "emb", - "chemical/x-galactic-spc" => "spc", - "chemical/x-gamess-input" => "gam", - "chemical/x-gaussian-checkpoint" => "fch", - "chemical/x-gaussian-cube" => "cub", - "chemical/x-gaussian-input" => "gau", - "chemical/x-gaussian-log" => "gal", - "chemical/x-gcg8-sequence" => "gcg", - "chemical/x-genbank" => "gen", - "chemical/x-hin" => "hin", - "chemical/x-isostar" => "ist", - "chemical/x-jcamp-dx" => "dx", - "chemical/x-kinemage" => "kin", - "chemical/x-macmolecule" => "mcm", - "chemical/x-macromodel-input" => "mmd", - "chemical/x-mdl-molfile" => "mol", - "chemical/x-mdl-rdfile" => "rd", - "chemical/x-mdl-rxnfile" => "rxn", - "chemical/x-mdl-sdfile" => "sd", - "chemical/x-mdl-tgf" => "tgf", - "chemical/x-mmcif" => "mcif", - "chemical/x-molconn-Z" => "b", - "chemical/x-mopac-graph" => "gpt", - "chemical/x-mopac-input" => "mop", - "chemical/x-mopac-out" => "moo", - "chemical/x-mopac-vib" => "mvb", - "chemical/x-ncbi-asn1-ascii" => "prt", - "chemical/x-ncbi-asn1-binary" => "aso", - "chemical/x-ncbi-asn1-spec" => "asn", - "chemical/x-pdb" => "ent", - "chemical/x-rosdal" => "ros", - "chemical/x-swissprot" => "sw", - "chemical/x-vamas-iso14976" => "vms", - "chemical/x-vmd" => "vmd", - "chemical/x-xtel" => "xtel", - "chemical/x-xyz" => "xyz", - "image/bmp" => "bmp", - "image/cgm" => "cgm", - "image/g3fax" => "g3", - "image/gif" => "gif", - "image/ief" => "ief", - "image/jpeg" => "jpg", - "image/pcx" => "pcx", - "image/png" => "png", - "image/prs.btif" => "btif", - "image/svg+xml" => "svg", - "image/tiff" => "tif", - "image/vnd.adobe.photoshop" => "psd", - "image/vnd.djvu" => "djvu", - "image/vnd.dwg" => "dwg", - "image/vnd.dxf" => "dxf", - "image/vnd.fastbidsheet" => "fbs", - "image/vnd.fpx" => "fpx", - "image/vnd.fst" => "fst", - "image/vnd.fujixerox.edmics-mmr" => "mmr", - "image/vnd.fujixerox.edmics-rlc" => "rlc", - "image/vnd.ms-modi" => "mdi", - "image/vnd.net-fpx" => "npx", - "image/vnd.wap.wbmp" => "wbmp", - "image/vnd.xiff" => "xif", - "image/x-canon-crw" => "crw", - "image/x-cmu-raster" => "ras", - "image/x-cmx" => "cmx", - "image/x-coreldraw" => "cdr", - "image/x-coreldrawpattern" => "pat", - "image/x-coreldrawtemplate" => "cdt", - "image/x-corelphotopaint" => "cpt", - "image/x-epson-erf" => "erf", - "image/x-freehand" => "fh", - "image/x-icon" => "ico", - "image/x-jg" => "art", - "image/x-jng" => "jng", - "image/x-ms-bmp" => "bmp", - "image/x-nikon-nef" => "nef", - "image/x-olympus-orf" => "orf", - "image/x-pcx" => "pcx", - "image/x-photoshop" => "psd", - "image/x-pict" => "pct", - "image/x-portable-anymap" => "pnm", - "image/x-portable-bitmap" => "pbm", - "image/x-portable-graymap" => "pgm", - "image/x-portable-pixmap" => "ppm", - "image/x-rgb" => "rgb", - "image/x-xbitmap" => "xbm", - "image/x-xpixmap" => "xpm", - "image/x-xwindowdump" => "xwd", - "message/rfc822" => "eml", - "model/iges" => "iges", - "model/mesh" => "mesh", - "model/vnd.dwf" => "dwf", - "model/vnd.gdl" => "gdl", - "model/vnd.gtw" => "gtw", - "model/vnd.mts" => "mts", - "model/vnd.vtu" => "vtu", - "model/vrml" => "vrml", - "text/cache-manifest" => "manifest", - "text/calendar" => "ics", - "text/css" => "css", - "text/csv" => "csv", - "text/html" => "html", - "text/iuls" => "uls", - "text/mathml" => "mml", - "text/plain" => "txt", - "text/prs.lines.tag" => "dsc", - "text/richtext" => "rtx", - "text/scriptlet" => "sct", - "text/sgml" => "sgm", - "text/tab-separated-values" => "tsv", - "text/texmacs" => "tm", - "text/troff" => "man", - "text/uri-list" => "uri", - "text/vnd.curl" => "curl", - "text/vnd.curl.dcurl" => "dcurl", - "text/vnd.curl.mcurl" => "mcurl", - "text/vnd.curl.scurl" => "scurl", - "text/vnd.fly" => "fly", - "text/vnd.fmi.flexstor" => "flx", - "text/vnd.graphviz" => "gv", - "text/vnd.in3d.3dml" => "3dml", - "text/vnd.in3d.spot" => "spot", - "text/vnd.sun.j2me.app-descriptor" => "jad", - "text/vnd.wap.si" => "si", - "text/vnd.wap.sl" => "sl", - "text/vnd.wap.wml" => "wml", - "text/vnd.wap.wmlscript" => "wmls", - "text/x-asm" => "asm", - "text/x-bibtex" => "bib", - "text/x-boo" => "boo", - "text/x-c" => "c", - "text/x-c++hdr" => "hh", - "text/x-c++src" => "cc", - "text/x-component" => "htc", - "text/x-csh" => "csh", - "text/x-csrc" => "c", - "text/x-diff" => "diff", - "text/x-dsrc" => "d", - "text/x-fortran" => "f", - "text/x-haskell" => "hs", - "text/x-java" => "java", - "text/x-java-source" => "java", - "text/x-literate-haskell" => "lhs", - "text/x-markdown" => "md", - "text/x-moc" => "moc", - "text/x-pascal" => "p", - "text/x-pcs-gcd" => "gcd", - "text/x-perl" => "pl", - "text/x-python" => "py", - "text/x-scala" => "scala", - "text/x-setext" => "etx", - "text/x-sfv" => "sfv", - "text/x-tcl" => "tcl", - "text/x-tex" => "tex", - "text/x-uuencode" => "uu", - "text/x-vcalendar" => "vcs", - "text/x-vcard" => "vcf", - "video/3gpp" => "3gp", - "video/3gpp2" => "3g2", - "video/MP2T" => "ts", - "video/annodex" => "axv", - "video/dl" => "dl", - "video/dv" => "dif", - "video/fli" => "fli", - "video/gl" => "gl", - "video/h261" => "h261", - "video/h263" => "h263", - "video/h264" => "h264", - "video/jpeg" => "jpgv", - "video/jpm" => "jpgm", - "video/mj2" => "mj2", - "video/mp4" => "mp4", - "video/mpeg" => "mpg", - "video/ogg" => "ogv", - "video/quicktime" => "mov", - "video/vnd.fvt" => "fvt", - "video/vnd.mpegurl" => "mxu", - "video/vnd.ms-playready.media.pyv" => "pyv", - "video/vnd.vivo" => "viv", - "video/webm" => "webm", - "video/x-f4v" => "f4v", - "video/x-fli" => "fli", - "video/x-flv" => "flv", - "video/x-la-asf" => "lsf", - "video/x-m4v" => "m4v", - "video/x-matroska" => "mkv", - "video/x-mng" => "mng", - "video/x-ms-asf" => "asf", - "video/x-ms-wm" => "wm", - "video/x-ms-wmv" => "wmv", - "video/x-ms-wmx" => "wmx", - "video/x-ms-wvx" => "wvx", - "video/x-msvideo" => "avi", - "video/x-sgi-movie" => "movie", - "x-conference/x-cooltalk" => "ice", - "x-epoc/x-sisx-app" => "sisx", - "x-world/x-vrml" => "vrm", - ]; -} diff --git a/vendor/sndsgd/util/src/Net.php b/vendor/sndsgd/util/src/Net.php deleted file mode 100644 index 2ac47d6..0000000 --- a/vendor/sndsgd/util/src/Net.php +++ /dev/null @@ -1,23 +0,0 @@ -counter--]; - } - parent::insert($value, $priority); - } -} diff --git a/vendor/sndsgd/util/src/Process.php b/vendor/sndsgd/util/src/Process.php deleted file mode 100644 index 92d7b03..0000000 --- a/vendor/sndsgd/util/src/Process.php +++ /dev/null @@ -1,252 +0,0 @@ -|null - */ - private $env = null; - - /** - * The descriptorspec to pass to proc_open - * - * @var array - */ - private $spec = [ - self::STDIN => ["pipe", "r"], - self::STDOUT => ["pipe", "w"], - self::STDERR => ["pipe", "w"] - ]; - - /** - * Data to pass as stdin - * - * @var string - */ - private $stdin = ""; - - /** - * After a process completes, the stdout buffer will be stashed here - * - * @var string - */ - private $stdout; - - /** - * After a process completes, the stderr buffer will be stashed here - * - * @var string - */ - private $stderr; - - /** - * After a process completes, the exit code will be stashed here - * - * @var integer - */ - private $exitcode; - - /** - * @param array|string $command The command to execute - * @param string|null $cwd The current working directory for the command - */ - public function __construct($command, string $cwd = null) - { - if (is_array($command)) { - $command = implode(" ", $command); - } - $this->command = $command; - $this->cwd = $cwd; - } - - /** - * Set the stdin contents - * - * @param string $str The stdin value - * @return \sndsgd\Process - */ - public function setStdin(string $str): Process - { - $this->spec[self::STDIN] = ["pipe", "r"]; - $this->stdin = $str; - return $this; - } - - /** - * Set the path to a file to read into stdin - * - * @param string $path An absolute file path - * @return \sndsgd\Process - * @throws InvalidArgumentException If $path is not a readable file - */ - public function setStdinFile(string $path): Process - { - if (!is_readable($path)) { - throw new \InvalidArgumentException( - "invalid value provided for 'path'; ". - "'$path' is not a readable file" - ); - } - $this->spec[self::STDIN] = ["file", $path, "r"]; - $this->stdin = ""; - return $this; - } - - /** - * Set an output file for either stdout or stderr - * - * @param integer $stream The index of the relevant stream - * @param string $path An absolute file path - * @param bool $append Whether or not to append to the file - */ - private function setOutputFile(int $stream, string $path, bool $append) - { - if (!is_writable($path)) { - throw new \InvalidArgumentException( - "invalid value provided for 'path'; ". - "'$path' is not a writable file" - ); - } - $this->spec[$stream] = ["file", $path, $append === true ? "a" : "w"]; - } - - /** - * Set the path to a file to write stdout to - * - * @param string $path An absolute file path - * @param boolean $append Whether or not to append to the file - * @return \sndsgd\Process - */ - public function setStdoutFile(string $path, bool $append = false): Process - { - $this->setOutputFile(self::STDOUT, $path, $append); - return $this; - } - - /** - * Set the path to a file to write stderr to - * - * @param string $path An absolute file path - * @param boolean $append Whether or not to append to the file - * @return \sndsgd\Process - */ - public function setStderrFile(string $path, bool $append = false): Process - { - $this->setOutputFile(self::STDERR, $path, $append); - return $this; - } - - /** - * @return string - */ - public function getStdout(): string - { - return $this->stdout; - } - - /** - * @return string - */ - public function getStderr(): string - { - return $this->stderr; - } - - /** - * @return int - */ - public function getExitcode(): int - { - return $this->exitcode; - } - - /** - * @return string - */ - public function getCommand(): string - { - return $this->command; - } - - /** - * Execute the command - * - * @return bool Whether or not the process returned a successful exit code - */ - public function exec(): bool - { - $process = proc_open( - $this->command, - $this->spec, - $pipes, - $this->cwd, - $this->env - ); - - if (is_resource($process)) { - if ($this->spec[self::STDIN][0] === "pipe") { - fwrite($pipes[0], $this->stdin); - fclose($pipes[0]); - } - if ($this->spec[self::STDOUT][0] === "pipe") { - $this->stdout = stream_get_contents($pipes[1]); - fclose($pipes[1]); - } - if ($this->spec[self::STDERR][0] === "pipe") { - $this->stderr = stream_get_contents($pipes[2]); - fclose($pipes[2]); - } - $this->exitcode = proc_close($process); - } - return ($this->exitcode === 0); - } - - /** - * @return array - */ - public function toArray(): array - { - return [ - "command" => $this->command, - "cwd" => $this->cwd, - "exit code" => $this->exitcode, - "stdout" => $this->stdout, - "stderr" => $this->stderr - ]; - } - - /** - * @deprecated Use Process::toArray() - * @return array - */ - public function export(): array - { - return $this->toArray(); - } -} diff --git a/vendor/sndsgd/util/src/Singleton.php b/vendor/sndsgd/util/src/Singleton.php deleted file mode 100644 index af9e2f8..0000000 --- a/vendor/sndsgd/util/src/Singleton.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ - private $values = []; - - /** - * Get a value by calling its key as a static method - * - * @param string $name The name of the called method - * @param array $args The arguments provided to the method - * @return mixed - */ - public static function __callStatic(string $name, array $args) - { - $instance = static::getInstance(); - return $instance->get($name); - } - - /** - * Import values - * - * @param array $values - */ - public function import(array $values) - { - $this->values = $values; - } - - /** - * Export the current values - * - * @return array - */ - public function export(): array - { - return $this->values; - } - - /** - * Add an object to the container - * - * @param string $name A key to used for retrieving the value later - * @param mixed $value The value to add - */ - public function set(string $name, $value) - { - $this->values[$name] = $value; - } - - /** - * Retrieve a value - * - * @param string $name - * @return mixed - * @throws \Exception If the provided name doesn't exist - */ - public function get(string $name) - { - if (!array_key_exists($name, $this->values)) { - throw new \Exception("no value exists for '$name'"); - } - return $this->values[$name]; - } - - /** - * Determine if a given name exists - * - * @param string $name - * @return boolean - */ - public function has($name) - { - return array_key_exists($name, $this->values); - } -} diff --git a/vendor/sndsgd/util/src/Str.php b/vendor/sndsgd/util/src/Str.php deleted file mode 100644 index c65eee8..0000000 --- a/vendor/sndsgd/util/src/Str.php +++ /dev/null @@ -1,250 +0,0 @@ - true, - "false" => false, - "1" => true, - "0" => false, - "on" => true, - "off" => false, - "" => false - ]; - return (array_key_exists($str, $values)) - ? $values[$str] - : null; - } - - /** - * Convert a string to camelCase - * - * @param string $str - * @return string - */ - public static function toCamelCase(string $str): string - { - $str = trim($str); - $fn = function($arg) { - list($match, $char) = $arg; - $ret = str_replace($char, "", $match); - return strtoupper($ret); - }; - return preg_replace_callback("~( |_|-){1,}[A-Za-z]~", $fn, $str); - } - - /** - * Convert a string to snake_case - * - * @param string $str - * @param bool $uppercase - * @return string - */ - public static function toSnakeCase( - string $str, - bool $uppercase = false - ): string - { - $str = trim($str); - $str = preg_replace("~[^a-z0-9]+~i", "_", $str); - - /** - * @param array $arg - * [0] the match - * [1] the character - */ - $fn = function($arg) { - $match = $arg[0]; - return $match[0]."_".$match[1]; - }; - $ret = preg_replace_callback("~([a-z])[A-Z]~", $fn, $str); - return ($uppercase) ? strtoupper($ret) : strtolower($ret); - } - - /** - * Remove all tabs that occur immediately after a newline - * - * @param string $str - * @return string - */ - public static function stripPostNewlineTabs(string $str): string - { - $regex = "~".PHP_EOL."[\t]+~"; - return preg_replace($regex, PHP_EOL, $str); - } - - /** - * Remove empty lines - * - * @param string $str - * @return string - */ - public static function stripEmptyLines(string $str): string - { - $regex = "~(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+~"; - return preg_replace($regex, PHP_EOL, $str); - } - - /** - * Summarize a string to a given max length - * - * @param string $str The value to summarize - * @param int $maxLength The max number of characters to return - * @param string $ellipsis A string to append to the result - * @param string $needle If provided, attempt to split on this string - */ - public static function summarize( - string $str, - int $maxLength, - string $ellipsis = "...", - string $needle = "" - ): string - { - $length = mb_strlen($str); - if ($length <= $maxLength) { - return $str; - } - - $endPos = $maxPos = $maxLength - mb_strlen($ellipsis); - if ($needle !== "") { - $offset = $maxPos - $length; - $endPos = mb_strrpos($str, $needle, $offset); - if ($endPos === false) { - $endPos = $maxPos; - } - } - - return mb_substr($str, 0, $endPos).$ellipsis; - } - - /** - * Handle string replacements given an array of find => replace values - * - * This was added to keep sndsgd\field\Error::getMessage() DRY - * @param string $str The string to replace within - * @param array $values - * @return string - */ - public static function replace(string $str, array $values): string - { - return str_replace(array_keys($values), array_values($values), $str); - } -} diff --git a/vendor/sndsgd/util/src/Timer.php b/vendor/sndsgd/util/src/Timer.php deleted file mode 100644 index 6bedaee..0000000 --- a/vendor/sndsgd/util/src/Timer.php +++ /dev/null @@ -1,174 +0,0 @@ - - */ - private static $timers = []; - - /** - * Reset the array of referenced timers - * - * @return void - */ - public static function reset() - { - self::$timers = []; - } - - /** - * Get all durations for named timers - * - * @param int $precision - * @return array - */ - public static function getDurations(int $precision = -1): array - { - $ret = []; - foreach (self::$timers as $t) { - Arr::addValue($ret, $t->getName(), $t->getDuration($precision)); - } - return $ret; - } - - /** - * A nickname for the timer - * - * @var string|null - */ - protected $name; - - /** - * The start time in microseconds - * - * @var float|null - */ - protected $startTime; - - /** - * The start time in microseconds - * - * @var float|null - */ - protected $stopTime; - - /** - * The duration in microseconds - * - * @var float|null - */ - protected $duration; - - /** - * @param string|null $name A handle to give the timer instance - * @param bool $wait Whether to start the timer - */ - public function __construct(string $name = null, float $startTime = 0.0) - { - if ($name !== null) { - self::$timers[] = $this; - } - $this->name = $name; - $this->startTime = ($startTime !== 0.0) ? $startTime : microtime(true); - } - - /** - * Convert the object into a string - * - * @return string - */ - public function __toString() - { - $name = $this->getName(); - $time = $this->getDuration(5); - return ($this->getStopTime() === null) - ? "{$name} has consumed {$time} seconds so far" - : "{$name} took {$time} seconds"; - } - - /** - * Get the name - * - * @return string - */ - public function getName(): string - { - return $this->name ?? "unknown"; - } - - /** - * Get the start time - * - * @return float - */ - public function getStartTime(): float - { - return $this->startTime; - } - - /** - * Start the timer - * - * @return void - */ - public function restart() - { - $this->startTime = microtime(true); - } - - /** - * Stop the timer and calculate the duration - * - * @return float|string The timer duration - */ - public function stop(int $precision = -1) - { - $time = microtime(true); - if ($this->stopTime === null) { - $this->stopTime = $time; - $this->duration = $this->stopTime - $this->startTime; - } - return $this->fmtDuration($this->duration, $precision); - } - - /** - * Get the stop time - * - * @return float|null - */ - public function getStopTime() - { - return $this->stopTime; - } - - /** - * Get the current duration - * - * @param integer $precision - * @return string|float - */ - public function getDuration(int $precision = -1) - { - //var_dump($this->duration); - $duration = $this->duration ?? microtime(true) - $this->startTime; - return $this->fmtDuration($duration, $precision); - } - - /** - * @return string|float - */ - private function fmtDuration(float $duration, int $precision) - { - return ($precision < 0) - ? $duration - : number_format($duration, $precision); - } -} diff --git a/vendor/sndsgd/util/src/TypeTest.php b/vendor/sndsgd/util/src/TypeTest.php deleted file mode 100644 index 5904d04..0000000 --- a/vendor/sndsgd/util/src/TypeTest.php +++ /dev/null @@ -1,114 +0,0 @@ - - */ - protected static $scalarTypeTests = [ - "bool" => "is_bool", - "float" => "is_float", - "int" => "is_int", - "string" => "is_string", - ]; - - /** - * Ensure a value is a string or null - * - * @param mixed $value The value to test - * @param string $name The variable/argument name - * @return string|null - * @throws \InvalidArgumentException If the value is not a string or null - */ - public static function nullableString($value, string $name) - { - if (!is_string($value) && $value !== null) { - throw new \InvalidArgumentException( - "invalid value provided for '$name'; expecting a string or null" - ); - } - return $value; - } - - /** - * Ensure a value is an int or null - * - * @param mixed $value The value to test - * @param string $name The variable/argument name - * @return int|null - * @throws \InvalidArgumentException If the value is not an int or null - */ - public static function nullableInt($value, string $name) - { - if (!is_int($value) && $value !== null) { - throw new \InvalidArgumentException( - "invalid value provided for '$name'; expecting an int or null" - ); - } - return $value; - } - - /** - * Ensure all elements in an array are of a given type - * - * @param array $values The value to test - * @param string $type A scalar type or class name - * @return array - * @throws \InvalidArgumentException - */ - public static function typedArray(array $values, string $type) - { - if (!isset(static::$scalarTypeTests[$type])) { - return self::instanceArray($values, $type); - } - return self::scalarArray($values, $type); - } - - /** - * Ensure all elements in an array are of a given instance - * - * @param array $values - * @param string $class - * @return array - * @throws \InvalidArgumentException - */ - private static function instanceArray(array $values, string $class) - { - foreach ($values as $index => $value) { - if (!($value instanceof $class)) { - throw new \InvalidArgumentException( - "invalid element at position '$index'; ". - "expecting an instance of $class" - ); - } - } - return $values; - } - - /** - * Ensure all elements in an array are of a given scalar type - * - * @param array $values - * @param string $type - * @return array - * @throws \InvalidArgumentException - */ - private static function scalarArray(array $values, string $type) - { - $func = static::$scalarTypeTests[$type]; - foreach ($values as $index => $value) { - if (!call_user_func($func, $value)) { - $article = ($type === "int") ? "an" : "a"; - throw new \InvalidArgumentException( - "invalid element at position '$index'; ". - "expecting $article $type" - ); - } - } - return $values; - } -} diff --git a/vendor/sndsgd/util/src/Url.php b/vendor/sndsgd/util/src/Url.php deleted file mode 100644 index d598fad..0000000 --- a/vendor/sndsgd/util/src/Url.php +++ /dev/null @@ -1,502 +0,0 @@ - - */ - public static function decodeQueryString($source, $rfc = self::RFC_3986) - { - $ret = []; - if ($source !== '') { - $decode = self::getQueryStringDecoder($rfc); - $queryPairs = explode('&', $source); - foreach ($queryPairs as $pair) { - $parts = explode('=', $pair, 2); - $key = $decode($parts[0]); - $value = (count($parts) === 1) ? true : $decode($parts[1]); - Arr::addValue($ret, $key, $value); - } - } - - return $ret; - } - - /** - * Create a url encoded string - * - * php's `http_build_query` does a wacky job of handling arrays - * @param array $query - * @return string - */ - public static function encodeQueryString(array $query, $rfc = self::RFC_3986) - { - $ret = []; - $encode = self::getQueryStringEncoder($rfc); - foreach ($query as $name => $value) { - if (is_array($value)) { - foreach ($value as $v) { - $ret[] = $name.'='.$encode($v); - } - } - else { - $ret[] = $name.'='.$encode($value); - } - } - return implode('&', $ret); - } - - /** - * Parse a url string into an object - * - * @param string $url - * @return \sndsgd\Url - */ - public static function createFromString($url) - { - if (!is_string($url)) { - throw new \InvalidArgumentException( - "invalid value provided for 'url'; expecting a string" - ); - } - - $ret = new Url; - if (($url = trim($url)) === '') { - return $ret; - } - - if (($url = parse_url($url)) === false) { - throw new \InvalidArgumentException( - "invalid value provided for 'url'; ". - "url parsing failed" - ); - } - - foreach ($url as $k => $v) { - $fn = 'set'.ucfirst($k); - call_user_func([$ret, $fn], $v); - } - return $ret; - } - - /** - * Create a url instance given an array of url properties and values - * - * @param array $arr - * @return \sndsgd\Url - */ - public static function createFromArray(array $arr) - { - $ret = new Url; - $keys = ['scheme','user','pass','host','port','path','query','fragment']; - foreach ($keys as $key) { - if (array_key_exists($key, $arr)) { - $fn = 'set'.ucfirst($key); - call_user_func([$ret, $fn], $arr[$key]); - } - } - return $ret; - } - - - /** - * @var string|null - */ - protected $scheme; - - /** - * @var string|null - */ - protected $user; - - /** - * @var string|null - */ - protected $pass; - - /** - * @var string|null - */ - protected $host; - - /** - * @var integer|null - */ - protected $port; - - /** - * @var string|null - */ - protected $path; - - /** - * @var array|null - */ - protected $query = []; - - /** - * @var string|null - */ - protected $fragment; - - - /** - * Set the scheme portion of the url - * - * @param string $scheme - */ - public function setScheme($scheme) - { - $this->scheme = $scheme; - } - - /** - * Get the scheme portion of the url - * - * @return string|null - */ - public function getScheme() - { - return $this->scheme; - } - - /** - * Set the user portion of the url - * - * @param string $user - */ - public function setUser($user) - { - $this->user = $user; - } - - /** - * Get the user portion of the url - * - * @return string|null - */ - public function getUser() - { - return $this->user; - } - - /** - * Set the password portion of the url - * - * @param string|null $password - */ - public function setPass($password = null) - { - $this->pass = TypeTest::nullableString($password, "password"); - } - - /** - * Get the password portion of the url - * - * @return string|null - */ - public function getPass() - { - return $this->pass; - } - - /** - * Set the host portion of the url - * - * @param string $host - */ - public function setHost($host = null) - { - $this->host = TypeTest::nullableString($host, "host"); - } - - /** - * Get the host portion of the url - * - * @return string|null - */ - public function getHost() - { - return $this->host; - } - - /** - * Set the port portion of the url - * - * @param string|null $port - */ - public function setPort($port = null) - { - if (is_null($port) || is_int($port)) { - $this->port = $port; - } - else if (is_string($port) && preg_match('/^[0-9]+$/', $port) !== 0) { - $this->port = Str::toNumber($port); - } - else { - throw new \InvalidArgumentException( - "invalid value provided for 'port'; ". - " expecting an integer, string of integers, or null" - ); - } - return $this; - } - - /** - * Get the port portion of the url - * - * @return integer|null - */ - public function getPort() - { - return $this->port; - } - - /** - * Set the path portion of the url - * - * @return string|null - */ - public function setPath($path = null) - { - if (is_string($path)) { - if ($path{0} !== '/') { - $path = "/$path"; - } - } - else if (!is_null($path)) { - throw new \InvalidArgumentException( - "invalid value provided for 'path'; ". - " expecting a string or null" - ); - } - $this->path = $path; - } - - /** - * Get the path portion of the url - * - * @return string|null - */ - public function getPath() - { - return $this->path; - } - - /** - * Set the query data - * - * @param string|array|null $query - * @return \sndsgd\Url - */ - public function setQuery($query = null) - { - $this->query = []; - return ($query === null) - ? $this - : $this->addQueryData($query); - } - - /** - * Add more data to the query - * - * @param string|array $data - * @return \sndsgd\Url - */ - public function addQueryData($data) - { - if (is_string($data)) { - $data = self::decodeQueryString($data); - } - else if (is_object($data)) { - $data = (array) $data; - } - else if (!is_array($data)) { - throw new \InvalidArgumentException( - "invalid value provided for 'query'; ". - "expecting a string, array, or object" - ); - } - - foreach ($data as $k => $v) { - Arr::addValue($this->query, $k, $v); - } - return $this; - } - - /** - * Get the query portion of the url - * - * @return array - */ - public function getQuery() - { - return $this->query; - } - - /** - * Set the fragment - * - * @param string|null $fragment - * @return \sndsgd\Url - */ - public function setFragment($fragment = null) - { - if (is_string($fragment)) { - if ($fragment{0} === '#') { - $fragment = substr($fragment, 1); - } - } - else if (!is_null($fragment)) { - throw new \InvalidArgumentException( - "invalid value provided for 'fragment'; ". - "expecting a string or null" - ); - } - - $this->fragment = $fragment; - return $this; - } - - /** - * Get the fragment - * - * @return string - */ - public function getFragment() - { - return $this->fragment; - } - - /** - * Get the url as an array - * - * @return array - */ - public function __toArray() - { - $ret = []; - foreach ($this as $property => $value) { - $ret[$property] = $value; - } - return $ret; - } - - /** - * Convert the url into a string - * - * @return string - */ - public function __toString() - { - $scheme = ($this->scheme !== null) ? $this->scheme.'://' : ''; - $user = ($this->user !== null) ? $this->user : ''; - $pass = ($this->pass !== null) ? $this->pass : ''; - $credentials = ($user || $pass) ? "$user:$pass@" : ''; - $host = ($this->host !== null) ? $this->host : ''; - $port = ($this->port !== null) ? ':'.$this->port : ''; - $path = ($this->path !== null) ? $this->path : ''; - if (strlen($path) === 0) { - $path = '/'; - } - - $query = ($this->query) - ? '?'.self::encodeQueryString($this->query) - : ''; - $fragment = ($this->fragment !== null) ? '#'.$this->fragment : ''; - - return $scheme.$credentials.$host.$port.$path.$query.$fragment; - } - - /** - * Update missing properties in the url with those of another url - * - * @param string|sndsgd\Url $to - * @return \sndsgd\Url - * @throws InvalidArgumentException If an invalid argument is passed - */ - public function merge($to) - { - if (is_array($to)) { - $to = Url::createFromArray($to); - } - else if (is_string($to)) { - $to = self::createFromString($to); - } - else if (($to instanceof Url) === false) { - throw new \InvalidArgumentException( - "invalid value provided for 'to'; expecting a url as string, ". - "an instance of sndsgd\\Url, or an array of url properties" - ); - } - - $toValues = $to->__toArray(); - - # the query property will be an empty array if it has no value - if (count($this->query) === 0 && $toValues['query']) { - $this->setQuery($toValues['query']); - } - - $keys = ['scheme','user','pass','host','port','path','fragment']; - foreach ($keys as $key) { - if ($this->$key === null && $toValues[$key] !== null) { - call_user_func([$this, 'set'.ucfirst($key)], $toValues[$key]); - } - } - - return $this; - } -}