diff options
Diffstat (limited to 'srcs/phpmyadmin/vendor/twig/extensions')
34 files changed, 0 insertions, 1560 deletions
diff --git a/srcs/phpmyadmin/vendor/twig/extensions/.travis.yml b/srcs/phpmyadmin/vendor/twig/extensions/.travis.yml deleted file mode 100644 index 88c7404..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: php - -sudo: false - -cache: - directories: - - vendor - - $HOME/.composer/cache/files - -env: - - DEPS=no - -before_install: - - phpenv config-rm xdebug.ini - -before_script: - - if [ "$DEPS" == "low" ]; then composer --prefer-lowest --prefer-stable update; fi; - - if [ "$DEPS" == "no" ]; then composer install; fi; - -script: | - ./vendor/bin/simple-phpunit - -matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - - php: 5.5 - - php: 5.6 - env: DEPS=low - - php: 7.0 - - php: 7.1 - - php: 7.2 - fast_finish: true diff --git a/srcs/phpmyadmin/vendor/twig/extensions/LICENSE b/srcs/phpmyadmin/vendor/twig/extensions/LICENSE deleted file mode 100644 index b420d71..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2017 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/srcs/phpmyadmin/vendor/twig/extensions/README.rst b/srcs/phpmyadmin/vendor/twig/extensions/README.rst deleted file mode 100644 index 2b4ea92..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/README.rst +++ /dev/null @@ -1,14 +0,0 @@ -Twig Extensions Repository -========================== - -This repository hosts Twig Extensions that do not belong to the core but can -be nonetheless interesting to share with other developers. - -Fork this repository, add your extension, and request a pull. - -More Information ----------------- - -Read the `documentation`_ for more information. - -.. _documentation: http://twig-extensions.readthedocs.io/ diff --git a/srcs/phpmyadmin/vendor/twig/extensions/composer.json b/srcs/phpmyadmin/vendor/twig/extensions/composer.json deleted file mode 100644 index 3644d8e..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "twig/extensions", - "description": "Common additional features for Twig that do not directly belong in core", - "keywords": ["i18n","text"], - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "twig/twig": "^1.27|^2.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3.4", - "symfony/translation": "^2.7|^3.4" - }, - "suggest": { - "symfony/translation": "Allow the time_diff output to be translated" - }, - "autoload": { - "psr-0": { "Twig_Extensions_": "lib/" }, - "psr-4": { "Twig\\Extensions\\": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - } -} diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php deleted file mode 100644 index 9ad5a46..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) 2009 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -@trigger_error('The "Twig_Extensions_Autoloader" class is deprecated since version 1.5. Use Composer instead.', E_USER_DEPRECATED); - -/** - * Autoloads Twig Extensions classes. - * - * @author Fabien Potencier <fabien.potencier@symfony-project.com> - * - * @deprecated since version 1.5, use Composer instead. - */ -class Twig_Extensions_Autoloader -{ - /** - * Registers Twig_Extensions_Autoloader as an SPL autoloader. - */ - public static function register() - { - spl_autoload_register(array(new self(), 'autoload')); - } - - /** - * Handles autoloading of classes. - * - * @param string $class a class name - * - * @return bool Returns true if the class has been loaded - */ - public static function autoload($class) - { - if (0 !== strpos($class, 'Twig_Extensions')) { - return; - } - - if (file_exists($file = __DIR__.'/../../'.str_replace('_', '/', $class).'.php')) { - require $file; - } - } -} diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Array.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Array.php deleted file mode 100644 index a5eaf6d..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Array.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -/** - * This file is part of Twig. - * - * (c) 2009 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @author Ricard Clau <ricard.clau@gmail.com> - */ -class Twig_Extensions_Extension_Array extends Twig_Extension -{ - /** - * {@inheritdoc} - */ - public function getFilters() - { - $filters = array( - new Twig_SimpleFilter('shuffle', 'twig_shuffle_filter'), - ); - - return $filters; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'array'; - } -} - -/** - * Shuffles an array. - * - * @param array|Traversable $array An array - * - * @return array - */ -function twig_shuffle_filter($array) -{ - if ($array instanceof Traversable) { - $array = iterator_to_array($array, false); - } - - shuffle($array); - - return $array; -} - -class_alias('Twig_Extensions_Extension_Array', 'Twig\Extensions\ArrayExtension', false); diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php deleted file mode 100644 index 1cdd455..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -/** - * This file is part of Twig. - * - * (c) 2014 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use Symfony\Component\Translation\TranslatorInterface; -use Symfony\Component\Translation\IdentityTranslator; - -/** - * @author Robin van der Vleuten <robinvdvleuten@gmail.com> - */ -class Twig_Extensions_Extension_Date extends Twig_Extension -{ - public static $units = array( - 'y' => 'year', - 'm' => 'month', - 'd' => 'day', - 'h' => 'hour', - 'i' => 'minute', - 's' => 'second', - ); - - /** - * @var TranslatorInterface - */ - private $translator; - - public function __construct(TranslatorInterface $translator = null) - { - // Ignore the IdentityTranslator, otherwise the parameters won't be replaced properly - if ($translator instanceof IdentityTranslator) { - $translator = null; - } - - $this->translator = $translator; - } - - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - new Twig_SimpleFilter('time_diff', array($this, 'diff'), array('needs_environment' => true)), - ); - } - - /** - * Filter for converting dates to a time ago string like Facebook and Twitter has. - * - * @param Twig_Environment $env a Twig_Environment instance - * @param string|DateTime $date a string or DateTime object to convert - * @param string|DateTime $now A string or DateTime object to compare with. If none given, the current time will be used. - * - * @return string the converted time - */ - public function diff(Twig_Environment $env, $date, $now = null) - { - // Convert both dates to DateTime instances. - $date = twig_date_converter($env, $date); - $now = twig_date_converter($env, $now); - - // Get the difference between the two DateTime objects. - $diff = $date->diff($now); - - // Check for each interval if it appears in the $diff object. - foreach (self::$units as $attribute => $unit) { - $count = $diff->$attribute; - - if (0 !== $count) { - return $this->getPluralizedInterval($count, $diff->invert, $unit); - } - } - - return ''; - } - - protected function getPluralizedInterval($count, $invert, $unit) - { - if ($this->translator) { - $id = sprintf('diff.%s.%s', $invert ? 'in' : 'ago', $unit); - - return $this->translator->transChoice($id, $count, array('%count%' => $count), 'date'); - } - - if (1 !== $count) { - $unit .= 's'; - } - - return $invert ? "in $count $unit" : "$count $unit ago"; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'date'; - } -} - -class_alias('Twig_Extensions_Extension_Date', 'Twig\Extensions\DateExtension', false); diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/I18n.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/I18n.php deleted file mode 100644 index 41cb9ce..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/I18n.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) 2010 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class Twig_Extensions_Extension_I18n extends Twig_Extension -{ - /** - * {@inheritdoc} - */ - public function getTokenParsers() - { - return array(new Twig_Extensions_TokenParser_Trans()); - } - - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - new Twig_SimpleFilter('trans', 'gettext'), - ); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'i18n'; - } -} - -class_alias('Twig_Extensions_Extension_I18n', 'Twig\Extensions\I18nExtension', false); diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php deleted file mode 100644 index 49b0f88..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) 2010 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class Twig_Extensions_Extension_Intl extends Twig_Extension -{ - public function __construct() - { - if (!class_exists('IntlDateFormatter')) { - throw new RuntimeException('The native PHP intl extension (http://php.net/manual/en/book.intl.php) is needed to use intl-based filters.'); - } - } - - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - new Twig_SimpleFilter('localizeddate', 'twig_localized_date_filter', array('needs_environment' => true)), - new Twig_SimpleFilter('localizednumber', 'twig_localized_number_filter'), - new Twig_SimpleFilter('localizedcurrency', 'twig_localized_currency_filter'), - ); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'intl'; - } -} - -function twig_localized_date_filter(Twig_Environment $env, $date, $dateFormat = 'medium', $timeFormat = 'medium', $locale = null, $timezone = null, $format = null, $calendar = 'gregorian') -{ - $date = twig_date_converter($env, $date, $timezone); - - $formatValues = array( - 'none' => IntlDateFormatter::NONE, - 'short' => IntlDateFormatter::SHORT, - 'medium' => IntlDateFormatter::MEDIUM, - 'long' => IntlDateFormatter::LONG, - 'full' => IntlDateFormatter::FULL, - ); - - if (PHP_VERSION_ID < 50500 || !class_exists('IntlTimeZone')) { - $formatter = IntlDateFormatter::create( - $locale, - $formatValues[$dateFormat], - $formatValues[$timeFormat], - $date->getTimezone()->getName(), - 'gregorian' === $calendar ? IntlDateFormatter::GREGORIAN : IntlDateFormatter::TRADITIONAL, - $format - ); - - return $formatter->format($date->getTimestamp()); - } - - $formatter = IntlDateFormatter::create( - $locale, - $formatValues[$dateFormat], - $formatValues[$timeFormat], - IntlTimeZone::createTimeZone($date->getTimezone()->getName()), - 'gregorian' === $calendar ? IntlDateFormatter::GREGORIAN : IntlDateFormatter::TRADITIONAL, - $format - ); - - return $formatter->format($date->getTimestamp()); -} - -function twig_localized_number_filter($number, $style = 'decimal', $type = 'default', $locale = null) -{ - static $typeValues = array( - 'default' => NumberFormatter::TYPE_DEFAULT, - 'int32' => NumberFormatter::TYPE_INT32, - 'int64' => NumberFormatter::TYPE_INT64, - 'double' => NumberFormatter::TYPE_DOUBLE, - 'currency' => NumberFormatter::TYPE_CURRENCY, - ); - - $formatter = twig_get_number_formatter($locale, $style); - - if (!isset($typeValues[$type])) { - throw new Twig_Error_Syntax(sprintf('The type "%s" does not exist. Known types are: "%s"', $type, implode('", "', array_keys($typeValues)))); - } - - return $formatter->format($number, $typeValues[$type]); -} - -function twig_localized_currency_filter($number, $currency = null, $locale = null) -{ - $formatter = twig_get_number_formatter($locale, 'currency'); - - return $formatter->formatCurrency($number, $currency); -} - -/** - * Gets a number formatter instance according to given locale and formatter. - * - * @param string $locale Locale in which the number would be formatted - * @param int $style Style of the formatting - * - * @return NumberFormatter A NumberFormatter instance - */ -function twig_get_number_formatter($locale, $style) -{ - static $formatter, $currentStyle; - - $locale = null !== $locale ? $locale : Locale::getDefault(); - - if ($formatter && $formatter->getLocale() === $locale && $currentStyle === $style) { - // Return same instance of NumberFormatter if parameters are the same - // to those in previous call - return $formatter; - } - - static $styleValues = array( - 'decimal' => NumberFormatter::DECIMAL, - 'currency' => NumberFormatter::CURRENCY, - 'percent' => NumberFormatter::PERCENT, - 'scientific' => NumberFormatter::SCIENTIFIC, - 'spellout' => NumberFormatter::SPELLOUT, - 'ordinal' => NumberFormatter::ORDINAL, - 'duration' => NumberFormatter::DURATION, - ); - - if (!isset($styleValues[$style])) { - throw new Twig_Error_Syntax(sprintf('The style "%s" does not exist. Known styles are: "%s"', $style, implode('", "', array_keys($styleValues)))); - } - - $currentStyle = $style; - - $formatter = NumberFormatter::create($locale, $styleValues[$style]); - - return $formatter; -} - -class_alias('Twig_Extensions_Extension_Intl', 'Twig\Extensions\IntlExtension', false); diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php deleted file mode 100644 index 52d3591..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -/** - * This file is part of Twig. - * - * (c) 2009 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @author Henrik Bjornskov <hb@peytz.dk> - */ -class Twig_Extensions_Extension_Text extends Twig_Extension -{ - /** - * {@inheritdoc} - */ - public function getFilters() - { - return array( - new Twig_SimpleFilter('truncate', 'twig_truncate_filter', array('needs_environment' => true)), - new Twig_SimpleFilter('wordwrap', 'twig_wordwrap_filter', array('needs_environment' => true)), - ); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'Text'; - } -} - -if (function_exists('mb_get_info')) { - function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...') - { - if (mb_strlen($value, $env->getCharset()) > $length) { - if ($preserve) { - // If breakpoint is on the last word, return the value without separator. - if (false === ($breakpoint = mb_strpos($value, ' ', $length, $env->getCharset()))) { - return $value; - } - - $length = $breakpoint; - } - - return rtrim(mb_substr($value, 0, $length, $env->getCharset())).$separator; - } - - return $value; - } - - function twig_wordwrap_filter(Twig_Environment $env, $value, $length = 80, $separator = "\n", $preserve = false) - { - $sentences = array(); - - $previous = mb_regex_encoding(); - mb_regex_encoding($env->getCharset()); - - $pieces = mb_split($separator, $value); - mb_regex_encoding($previous); - - foreach ($pieces as $piece) { - while (!$preserve && mb_strlen($piece, $env->getCharset()) > $length) { - $sentences[] = mb_substr($piece, 0, $length, $env->getCharset()); - $piece = mb_substr($piece, $length, 2048, $env->getCharset()); - } - - $sentences[] = $piece; - } - - return implode($separator, $sentences); - } -} else { - function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...') - { - if (strlen($value) > $length) { - if ($preserve) { - if (false !== ($breakpoint = strpos($value, ' ', $length))) { - $length = $breakpoint; - } - } - - return rtrim(substr($value, 0, $length)).$separator; - } - - return $value; - } - - function twig_wordwrap_filter(Twig_Environment $env, $value, $length = 80, $separator = "\n", $preserve = false) - { - return wordwrap($value, $length, $separator, !$preserve); - } -} - -class_alias('Twig_Extensions_Extension_Text', 'Twig\Extensions\TextExtension', false); diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar.php deleted file mode 100644 index b6cc0a7..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) 2010 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @deprecated since version 1.5 - */ -abstract class Twig_Extensions_Grammar implements Twig_Extensions_GrammarInterface -{ - protected $name; - protected $parser; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - /** - * @param Twig_Parser $parser - */ - public function setParser(Twig_Parser $parser) - { - $this->parser = $parser; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } -} diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Arguments.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Arguments.php deleted file mode 100644 index abb9e0e..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Arguments.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) 2010 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @deprecated since version 1.5 - */ -class Twig_Extensions_Grammar_Arguments extends Twig_Extensions_Grammar -{ - public function __toString() - { - return sprintf('<%s:arguments>', $this->name); - } - - public function parse(Twig_Token $token) - { - return $this->parser->getExpressionParser()->parseArguments(); - } -} diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Array.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Array.php deleted file mode 100644 index 94d7b8c..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Array.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) 2010 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @deprecated since version 1.5 - */ -class Twig_Extensions_Grammar_Array extends Twig_Extensions_Grammar -{ - public function __toString() - { - return sprintf('<%s:array>', $this->name); - } - - public function parse(Twig_Token $token) - { - return $this->parser->getExpressionParser()->parseArrayExpression(); - } -} diff --git a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Body.php b/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Body.php deleted file mode 100644 index b2ac43e..0000000 --- a/srcs/phpmyadmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Body.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) 2010 Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @deprecated since version 1.5 - */ -class Twig_Extensions_Grammar_Body extends Twig_Extensions_Grammar -{ - protected $end; - - public function __construct($name, $end = null) - { - parent::__construct($name); - - $this->end = null === $end ? 'end'.$name : $end; - } - - public function __toString() - { - return sprintf('<%s:body>', $this->name); - } - - public function parse(Twig_Token $token) - { - $stream = $this-& |
