aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/vendor/symfony/config/Loader
diff options
context:
space:
mode:
Diffstat (limited to 'srcs/phpmyadmin/vendor/symfony/config/Loader')
-rw-r--r--srcs/phpmyadmin/vendor/symfony/config/Loader/DelegatingLoader.php50
-rw-r--r--srcs/phpmyadmin/vendor/symfony/config/Loader/FileLoader.php186
-rw-r--r--srcs/phpmyadmin/vendor/symfony/config/Loader/GlobFileLoader.php36
-rw-r--r--srcs/phpmyadmin/vendor/symfony/config/Loader/Loader.php78
-rw-r--r--srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderInterface.php52
-rw-r--r--srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolver.php68
-rw-r--r--srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolverInterface.php30
7 files changed, 0 insertions, 500 deletions
diff --git a/srcs/phpmyadmin/vendor/symfony/config/Loader/DelegatingLoader.php b/srcs/phpmyadmin/vendor/symfony/config/Loader/DelegatingLoader.php
deleted file mode 100644
index e40e57d..0000000
--- a/srcs/phpmyadmin/vendor/symfony/config/Loader/DelegatingLoader.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Loader;
-
-use Symfony\Component\Config\Exception\LoaderLoadException;
-
-/**
- * DelegatingLoader delegates loading to other loaders using a loader resolver.
- *
- * This loader acts as an array of LoaderInterface objects - each having
- * a chance to load a given resource (handled by the resolver)
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class DelegatingLoader extends Loader
-{
- public function __construct(LoaderResolverInterface $resolver)
- {
- $this->resolver = $resolver;
- }
-
- /**
- * {@inheritdoc}
- */
- public function load($resource, $type = null)
- {
- if (false === $loader = $this->resolver->resolve($resource, $type)) {
- throw new LoaderLoadException($resource, null, null, null, $type);
- }
-
- return $loader->load($resource, $type);
- }
-
- /**
- * {@inheritdoc}
- */
- public function supports($resource, $type = null)
- {
- return false !== $this->resolver->resolve($resource, $type);
- }
-}
diff --git a/srcs/phpmyadmin/vendor/symfony/config/Loader/FileLoader.php b/srcs/phpmyadmin/vendor/symfony/config/Loader/FileLoader.php
deleted file mode 100644
index 828ac67..0000000
--- a/srcs/phpmyadmin/vendor/symfony/config/Loader/FileLoader.php
+++ /dev/null
@@ -1,186 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Loader;
-
-use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException;
-use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
-use Symfony\Component\Config\Exception\LoaderLoadException;
-use Symfony\Component\Config\FileLocatorInterface;
-use Symfony\Component\Config\Resource\FileExistenceResource;
-use Symfony\Component\Config\Resource\GlobResource;
-
-/**
- * FileLoader is the abstract class used by all built-in loaders that are file based.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-abstract class FileLoader extends Loader
-{
- protected static $loading = [];
-
- protected $locator;
-
- private $currentDir;
-
- public function __construct(FileLocatorInterface $locator)
- {
- $this->locator = $locator;
- }
-
- /**
- * Sets the current directory.
- *
- * @param string $dir
- */
- public function setCurrentDir($dir)
- {
- $this->currentDir = $dir;
- }
-
- /**
- * Returns the file locator used by this loader.
- *
- * @return FileLocatorInterface
- */
- public function getLocator()
- {
- return $this->locator;
- }
-
- /**
- * Imports a resource.
- *
- * @param mixed $resource A Resource
- * @param string|null $type The resource type or null if unknown
- * @param bool $ignoreErrors Whether to ignore import errors or not
- * @param string|null $sourceResource The original resource importing the new resource
- * @param string|string[]|null $exclude Glob patterns to exclude from the import
- *
- * @return mixed
- *
- * @throws LoaderLoadException
- * @throws FileLoaderImportCircularReferenceException
- * @throws FileLocatorFileNotFoundException
- */
- public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null/*, $exclude = null*/)
- {
- if (\func_num_args() < 5 && __CLASS__ !== \get_class($this) && 0 !== strpos(\get_class($this), 'Symfony\Component\\') && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
- @trigger_error(sprintf('The "%s()" method will have a new "$exclude = null" argument in version 5.0, not defining it is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED);
- }
- $exclude = \func_num_args() >= 5 ? func_get_arg(4) : null;
-
- if (\is_string($resource) && \strlen($resource) !== $i = strcspn($resource, '*?{[')) {
- $excluded = [];
- foreach ((array) $exclude as $pattern) {
- foreach ($this->glob($pattern, true, $_, false, true) as $path => $info) {
- // normalize Windows slashes
- $excluded[str_replace('\\', '/', $path)] = true;
- }
- }
-
- $ret = [];
- $isSubpath = 0 !== $i && false !== strpos(substr($resource, 0, $i), '/');
- foreach ($this->glob($resource, false, $_, $ignoreErrors || !$isSubpath, false, $excluded) as $path => $info) {
- if (null !== $res = $this->doImport($path, $type, $ignoreErrors, $sourceResource)) {
- $ret[] = $res;
- }
- $isSubpath = true;
- }
-
- if ($isSubpath) {
- return isset($ret[1]) ? $ret : (isset($ret[0]) ? $ret[0] : null);
- }
- }
-
- return $this->doImport($resource, $type, $ignoreErrors, $sourceResource);
- }
-
- /**
- * @internal
- */
- protected function glob(string $pattern, bool $recursive, &$resource = null, bool $ignoreErrors = false, bool $forExclusion = false, array $excluded = [])
- {
- if (\strlen($pattern) === $i = strcspn($pattern, '*?{[')) {
- $prefix = $pattern;
- $pattern = '';
- } elseif (0 === $i || false === strpos(substr($pattern, 0, $i), '/')) {
- $prefix = '.';
- $pattern = '/'.$pattern;
- } else {
- $prefix = \dirname(substr($pattern, 0, 1 + $i));
- $pattern = substr($pattern, \strlen($prefix));
- }
-
- try {
- $prefix = $this->locator->locate($prefix, $this->currentDir, true);
- } catch (FileLocatorFileNotFoundException $e) {
- if (!$ignoreErrors) {
- throw $e;
- }
-
- $resource = [];
- foreach ($e->getPaths() as $path) {
- $resource[] = new FileExistenceResource($path);
- }
-
- return;
- }
- $resource = new GlobResource($prefix, $pattern, $recursive, $forExclusion, $excluded);
-
- yield from $resource;
- }
-
- private function doImport($resource, string $type = null, bool $ignoreErrors = false, $sourceResource = null)
- {
- try {
- $loader = $this->resolve($resource, $type);
-
- if ($loader instanceof self && null !== $this->currentDir) {
- $resource = $loader->getLocator()->locate($resource, $this->currentDir, false);
- }
-
- $resources = \is_array($resource) ? $resource : [$resource];
- for ($i = 0; $i < $resourcesCount = \count($resources); ++$i) {
- if (isset(self::$loading[$resources[$i]])) {
- if ($i == $resourcesCount - 1) {
- throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading));
- }
- } else {
- $resource = $resources[$i];
- break;
- }
- }
- self::$loading[$resource] = true;
-
- try {
- $ret = $loader->load($resource, $type);
- } finally {
- unset(self::$loading[$resource]);
- }
-
- return $ret;
- } catch (FileLoaderImportCircularReferenceException $e) {
- throw $e;
- } catch (\Exception $e) {
- if (!$ignoreErrors) {
- // prevent embedded imports from nesting multiple exceptions
- if ($e instanceof LoaderLoadException) {
- throw $e;
- }
-
- throw new LoaderLoadException($resource, $sourceResource, null, $e, $type);
- }
- }
-
- return null;
- }
-}
diff --git a/srcs/phpmyadmin/vendor/symfony/config/Loader/GlobFileLoader.php b/srcs/phpmyadmin/vendor/symfony/config/Loader/GlobFileLoader.php
deleted file mode 100644
index f432b45..0000000
--- a/srcs/phpmyadmin/vendor/symfony/config/Loader/GlobFileLoader.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Loader;
-
-/**
- * GlobFileLoader loads files from a glob pattern.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class GlobFileLoader extends FileLoader
-{
- /**
- * {@inheritdoc}
- */
- public function load($resource, $type = null)
- {
- return $this->import($resource);
- }
-
- /**
- * {@inheritdoc}
- */
- public function supports($resource, $type = null)
- {
- return 'glob' === $type;
- }
-}
diff --git a/srcs/phpmyadmin/vendor/symfony/config/Loader/Loader.php b/srcs/phpmyadmin/vendor/symfony/config/Loader/Loader.php
deleted file mode 100644
index 698ab40..0000000
--- a/srcs/phpmyadmin/vendor/symfony/config/Loader/Loader.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Loader;
-
-use Symfony\Component\Config\Exception\LoaderLoadException;
-
-/**
- * Loader is the abstract class used by all built-in loaders.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-abstract class Loader implements LoaderInterface
-{
- protected $resolver;
-
- /**
- * {@inheritdoc}
- */
- public function getResolver()
- {
- return $this->resolver;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setResolver(LoaderResolverInterface $resolver)
- {
- $this->resolver = $resolver;
- }
-
- /**
- * Imports a resource.
- *
- * @param mixed $resource A resource
- * @param string|null $type The resource type or null if unknown
- *
- * @return mixed
- */
- public function import($resource, $type = null)
- {
- return $this->resolve($resource, $type)->load($resource, $type);
- }
-
- /**
- * Finds a loader able to load an imported resource.
- *
- * @param mixed $resource A resource
- * @param string|null $type The resource type or null if unknown
- *
- * @return $this|LoaderInterface
- *
- * @throws LoaderLoadException If no loader is found
- */
- public function resolve($resource, $type = null)
- {
- if ($this->supports($resource, $type)) {
- return $this;
- }
-
- $loader = null === $this->resolver ? false : $this->resolver->resolve($resource, $type);
-
- if (false === $loader) {
- throw new LoaderLoadException($resource, null, null, null, $type);
- }
-
- return $loader;
- }
-}
diff --git a/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderInterface.php b/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderInterface.php
deleted file mode 100644
index dfca9dd..0000000
--- a/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderInterface.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Loader;
-
-/**
- * LoaderInterface is the interface implemented by all loader classes.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-interface LoaderInterface
-{
- /**
- * Loads a resource.
- *
- * @param mixed $resource The resource
- * @param string|null $type The resource type or null if unknown
- *
- * @throws \Exception If something went wrong
- */
- public function load($resource, $type = null);
-
- /**
- * Returns whether this class supports the given resource.
- *
- * @param mixed $resource A resource
- * @param string|null $type The resource type or null if unknown
- *
- * @return bool True if this class supports the given resource, false otherwise
- */
- public function supports($resource, $type = null);
-
- /**
- * Gets the loader resolver.
- *
- * @return LoaderResolverInterface A LoaderResolverInterface instance
- */
- public function getResolver();
-
- /**
- * Sets the loader resolver.
- */
- public function setResolver(LoaderResolverInterface $resolver);
-}
diff --git a/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolver.php b/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolver.php
deleted file mode 100644
index c99efda..0000000
--- a/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolver.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Loader;
-
-/**
- * LoaderResolver selects a loader for a given resource.
- *
- * A resource can be anything (e.g. a full path to a config file or a Closure).
- * Each loader determines whether it can load a resource and how.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class LoaderResolver implements LoaderResolverInterface
-{
- /**
- * @var LoaderInterface[] An array of LoaderInterface objects
- */
- private $loaders = [];
-
- /**
- * @param LoaderInterface[] $loaders An array of loaders
- */
- public function __construct(array $loaders = [])
- {
- foreach ($loaders as $loader) {
- $this->addLoader($loader);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function resolve($resource, $type = null)
- {
- foreach ($this->loaders as $loader) {
- if ($loader->supports($resource, $type)) {
- return $loader;
- }
- }
-
- return false;
- }
-
- public function addLoader(LoaderInterface $loader)
- {
- $this->loaders[] = $loader;
- $loader->setResolver($this);
- }
-
- /**
- * Returns the registered loaders.
- *
- * @return LoaderInterface[] An array of LoaderInterface instances
- */
- public function getLoaders()
- {
- return $this->loaders;
- }
-}
diff --git a/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolverInterface.php b/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolverInterface.php
deleted file mode 100644
index 40f1a1a..0000000
--- a/srcs/phpmyadmin/vendor/symfony/config/Loader/LoaderResolverInterface.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Loader;
-
-/**
- * LoaderResolverInterface selects a loader for a given resource.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-interface LoaderResolverInterface
-{
- /**
- * Returns a loader able to load the resource.
- *
- * @param mixed $resource A resource
- * @param string|null $type The resource type or null if unknown
- *
- * @return LoaderInterface|false The loader or false if none is able to load the resource
- */
- public function resolve($resource, $type = null);
-}