Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
25
vendor/autoload.php
vendored
Normal file
25
vendor/autoload.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitc94a8368bcea9853dd31683be0b15c06::getLoader();
|
119
vendor/bin/doctrine-dbal
vendored
Executable file
119
vendor/bin/doctrine-dbal
vendored
Executable file
|
@ -0,0 +1,119 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../doctrine/dbal/bin/doctrine-dbal)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
return include("phpvfscomposer://" . __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal');
|
||||
}
|
||||
}
|
||||
|
||||
return include __DIR__ . '/..'.'/doctrine/dbal/bin/doctrine-dbal';
|
119
vendor/bin/patch-type-declarations
vendored
Executable file
119
vendor/bin/patch-type-declarations
vendored
Executable file
|
@ -0,0 +1,119 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../symfony/error-handler/Resources/bin/patch-type-declarations)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/error-handler/Resources/bin/patch-type-declarations');
|
||||
}
|
||||
}
|
||||
|
||||
return include __DIR__ . '/..'.'/symfony/error-handler/Resources/bin/patch-type-declarations';
|
119
vendor/bin/var-dump-server
vendored
Executable file
119
vendor/bin/var-dump-server
vendored
Executable file
|
@ -0,0 +1,119 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server');
|
||||
}
|
||||
}
|
||||
|
||||
return include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server';
|
579
vendor/composer/ClassLoader.php
vendored
Normal file
579
vendor/composer/ClassLoader.php
vendored
Normal file
|
@ -0,0 +1,579 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* 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 <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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 list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
$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 list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
$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] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
$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 list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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 list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
359
vendor/composer/InstalledVersions.php
vendored
Normal file
359
vendor/composer/InstalledVersions.php
vendored
Normal file
|
@ -0,0 +1,359 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
21
vendor/composer/LICENSE
vendored
Normal file
21
vendor/composer/LICENSE
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
19
vendor/composer/autoload_classmap.php
vendored
Normal file
19
vendor/composer/autoload_classmap.php
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
|
||||
'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
|
||||
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
||||
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
|
||||
'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
|
||||
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
|
||||
'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
|
||||
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
|
||||
);
|
25
vendor/composer/autoload_files.php
vendored
Normal file
25
vendor/composer/autoload_files.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php',
|
||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
|
||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
|
||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'89efb1254ef2d1c5d80096acd12c4098' => $vendorDir . '/twig/twig/src/Resources/core.php',
|
||||
'ffecb95d45175fd40f75be8a23b34f90' => $vendorDir . '/twig/twig/src/Resources/debug.php',
|
||||
'c7baa00073ee9c61edf148c51917cfb4' => $vendorDir . '/twig/twig/src/Resources/escaper.php',
|
||||
'f844ccf1d25df8663951193c3fc307c8' => $vendorDir . '/twig/twig/src/Resources/string_loader.php',
|
||||
);
|
10
vendor/composer/autoload_namespaces.php
vendored
Normal file
10
vendor/composer/autoload_namespaces.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Mustache' => array($vendorDir . '/mustache/mustache/src'),
|
||||
);
|
43
vendor/composer/autoload_psr4.php
vendored
Normal file
43
vendor/composer/autoload_psr4.php
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Twig\\' => array($vendorDir . '/twig/twig/src'),
|
||||
'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'),
|
||||
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
|
||||
'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
|
||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
|
||||
'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'),
|
||||
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
||||
'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
|
||||
'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
|
||||
'Symfony\\Contracts\\HttpClient\\' => array($vendorDir . '/symfony/http-client-contracts'),
|
||||
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
|
||||
'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'),
|
||||
'Symfony\\Component\\HttpClient\\' => array($vendorDir . '/symfony/http-client'),
|
||||
'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
|
||||
'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
|
||||
'Symfony\\Component\\ErrorHandler\\' => array($vendorDir . '/symfony/error-handler'),
|
||||
'Stevenmaguire\\OAuth2\\Client\\' => array($vendorDir . '/stevenmaguire/oauth2-bitbucket/src'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
|
||||
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
|
||||
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
|
||||
'League\\OAuth2\\Client\\' => array($vendorDir . '/league/oauth2-client/src'),
|
||||
'Lavaux\\Website\\' => array($baseDir . '/src'),
|
||||
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
|
||||
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
|
||||
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
|
||||
'Doctrine\\RST\\' => array($vendorDir . '/doctrine/rst-parser/lib'),
|
||||
'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'),
|
||||
'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/src'),
|
||||
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
|
||||
'Doctrine\\Common\\' => array($vendorDir . '/doctrine/event-manager/src'),
|
||||
);
|
50
vendor/composer/autoload_real.php
vendored
Normal file
50
vendor/composer/autoload_real.php
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitc94a8368bcea9853dd31683be0b15c06
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc94a8368bcea9853dd31683be0b15c06', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc94a8368bcea9853dd31683be0b15c06', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc94a8368bcea9853dd31683be0b15c06::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitc94a8368bcea9853dd31683be0b15c06::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
||||
require $file;
|
||||
}
|
||||
}, null, null);
|
||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||
$requireFile($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
256
vendor/composer/autoload_static.php
vendored
Normal file
256
vendor/composer/autoload_static.php
vendored
Normal file
|
@ -0,0 +1,256 @@
|
|||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitc94a8368bcea9853dd31683be0b15c06
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php',
|
||||
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
|
||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
|
||||
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'89efb1254ef2d1c5d80096acd12c4098' => __DIR__ . '/..' . '/twig/twig/src/Resources/core.php',
|
||||
'ffecb95d45175fd40f75be8a23b34f90' => __DIR__ . '/..' . '/twig/twig/src/Resources/debug.php',
|
||||
'c7baa00073ee9c61edf148c51917cfb4' => __DIR__ . '/..' . '/twig/twig/src/Resources/escaper.php',
|
||||
'f844ccf1d25df8663951193c3fc307c8' => __DIR__ . '/..' . '/twig/twig/src/Resources/string_loader.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'T' =>
|
||||
array (
|
||||
'Twig\\' => 5,
|
||||
),
|
||||
'S' =>
|
||||
array (
|
||||
'Symfony\\Polyfill\\Php81\\' => 23,
|
||||
'Symfony\\Polyfill\\Php80\\' => 23,
|
||||
'Symfony\\Polyfill\\Php73\\' => 23,
|
||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
|
||||
'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31,
|
||||
'Symfony\\Polyfill\\Ctype\\' => 23,
|
||||
'Symfony\\Contracts\\Translation\\' => 30,
|
||||
'Symfony\\Contracts\\Service\\' => 26,
|
||||
'Symfony\\Contracts\\HttpClient\\' => 29,
|
||||
'Symfony\\Component\\VarDumper\\' => 28,
|
||||
'Symfony\\Component\\String\\' => 25,
|
||||
'Symfony\\Component\\HttpClient\\' => 29,
|
||||
'Symfony\\Component\\Finder\\' => 25,
|
||||
'Symfony\\Component\\Filesystem\\' => 29,
|
||||
'Symfony\\Component\\ErrorHandler\\' => 31,
|
||||
'Stevenmaguire\\OAuth2\\Client\\' => 28,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Http\\Message\\' => 17,
|
||||
'Psr\\Http\\Client\\' => 16,
|
||||
'Psr\\Container\\' => 14,
|
||||
'Psr\\Cache\\' => 10,
|
||||
'PHPMailer\\PHPMailer\\' => 20,
|
||||
),
|
||||
'L' =>
|
||||
array (
|
||||
'League\\OAuth2\\Client\\' => 21,
|
||||
'Lavaux\\Website\\' => 15,
|
||||
),
|
||||
'G' =>
|
||||
array (
|
||||
'GuzzleHttp\\Psr7\\' => 16,
|
||||
'GuzzleHttp\\Promise\\' => 19,
|
||||
'GuzzleHttp\\' => 11,
|
||||
),
|
||||
'D' =>
|
||||
array (
|
||||
'Doctrine\\RST\\' => 13,
|
||||
'Doctrine\\Deprecations\\' => 22,
|
||||
'Doctrine\\DBAL\\' => 14,
|
||||
'Doctrine\\Common\\Cache\\' => 22,
|
||||
'Doctrine\\Common\\' => 16,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Twig\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/twig/twig/src',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php81\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php81',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php80\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php73\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
|
||||
),
|
||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Grapheme\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme',
|
||||
),
|
||||
'Symfony\\Polyfill\\Ctype\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||
),
|
||||
'Symfony\\Contracts\\Translation\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/translation-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\Service\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/service-contracts',
|
||||
),
|
||||
'Symfony\\Contracts\\HttpClient\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/http-client-contracts',
|
||||
),
|
||||
'Symfony\\Component\\VarDumper\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/var-dumper',
|
||||
),
|
||||
'Symfony\\Component\\String\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/string',
|
||||
),
|
||||
'Symfony\\Component\\HttpClient\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/http-client',
|
||||
),
|
||||
'Symfony\\Component\\Finder\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/finder',
|
||||
),
|
||||
'Symfony\\Component\\Filesystem\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/filesystem',
|
||||
),
|
||||
'Symfony\\Component\\ErrorHandler\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/error-handler',
|
||||
),
|
||||
'Stevenmaguire\\OAuth2\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/stevenmaguire/oauth2-bitbucket/src',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
),
|
||||
'Psr\\Http\\Message\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-message/src',
|
||||
1 => __DIR__ . '/..' . '/psr/http-factory/src',
|
||||
),
|
||||
'Psr\\Http\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-client/src',
|
||||
),
|
||||
'Psr\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/container/src',
|
||||
),
|
||||
'Psr\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/cache/src',
|
||||
),
|
||||
'PHPMailer\\PHPMailer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
|
||||
),
|
||||
'League\\OAuth2\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/league/oauth2-client/src',
|
||||
),
|
||||
'Lavaux\\Website\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src',
|
||||
),
|
||||
'GuzzleHttp\\Psr7\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
|
||||
),
|
||||
'GuzzleHttp\\Promise\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
|
||||
),
|
||||
'GuzzleHttp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
|
||||
),
|
||||
'Doctrine\\RST\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/rst-parser/lib',
|
||||
),
|
||||
'Doctrine\\Deprecations\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations',
|
||||
),
|
||||
'Doctrine\\DBAL\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/dbal/src',
|
||||
),
|
||||
'Doctrine\\Common\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache',
|
||||
),
|
||||
'Doctrine\\Common\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/event-manager/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'M' =>
|
||||
array (
|
||||
'Mustache' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/mustache/mustache/src',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
|
||||
'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
|
||||
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
||||
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
|
||||
'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
|
||||
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
|
||||
'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
|
||||
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc94a8368bcea9853dd31683be0b15c06::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc94a8368bcea9853dd31683be0b15c06::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInitc94a8368bcea9853dd31683be0b15c06::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInitc94a8368bcea9853dd31683be0b15c06::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
2980
vendor/composer/installed.json
vendored
Normal file
2980
vendor/composer/installed.json
vendored
Normal file
File diff suppressed because it is too large
Load diff
416
vendor/composer/installed.php
vendored
Normal file
416
vendor/composer/installed.php
vendored
Normal file
|
@ -0,0 +1,416 @@
|
|||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'lavaux/website',
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '2f2228851ee1ee14a2e036e4a8bae7f5db7a3048',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev' => true,
|
||||
),
|
||||
'versions' => array(
|
||||
'doctrine/cache' => array(
|
||||
'pretty_version' => '2.2.0',
|
||||
'version' => '2.2.0.0',
|
||||
'reference' => '1ca8f21980e770095a31456042471a57bc4c68fb',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../doctrine/cache',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'doctrine/dbal' => array(
|
||||
'pretty_version' => '3.9.1',
|
||||
'version' => '3.9.1.0',
|
||||
'reference' => 'd7dc08f98cba352b2bab5d32c5e58f7e745c11a7',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../doctrine/dbal',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'doctrine/deprecations' => array(
|
||||
'pretty_version' => '1.1.3',
|
||||
'version' => '1.1.3.0',
|
||||
'reference' => 'dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../doctrine/deprecations',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'doctrine/event-manager' => array(
|
||||
'pretty_version' => '1.2.0',
|
||||
'version' => '1.2.0.0',
|
||||
'reference' => '95aa4cb529f1e96576f3fda9f5705ada4056a520',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../doctrine/event-manager',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'doctrine/rst-parser' => array(
|
||||
'pretty_version' => '0.5.6',
|
||||
'version' => '0.5.6.0',
|
||||
'reference' => 'ca7f5f31f9ea58fde5aeffe0f7b8eb569e71a104',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../doctrine/rst-parser',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'guzzlehttp/guzzle' => array(
|
||||
'pretty_version' => '7.9.2',
|
||||
'version' => '7.9.2.0',
|
||||
'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'guzzlehttp/promises' => array(
|
||||
'pretty_version' => '2.0.3',
|
||||
'version' => '2.0.3.0',
|
||||
'reference' => '6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../guzzlehttp/promises',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'guzzlehttp/psr7' => array(
|
||||
'pretty_version' => '2.7.0',
|
||||
'version' => '2.7.0.0',
|
||||
'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'lavaux/website' => array(
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '2f2228851ee1ee14a2e036e4a8bae7f5db7a3048',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'league/oauth2-client' => array(
|
||||
'pretty_version' => '2.7.0',
|
||||
'version' => '2.7.0.0',
|
||||
'reference' => '160d6274b03562ebeb55ed18399281d8118b76c8',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../league/oauth2-client',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'mustache/mustache' => array(
|
||||
'pretty_version' => 'v2.14.2',
|
||||
'version' => '2.14.2.0',
|
||||
'reference' => 'e62b7c3849d22ec55f3ec425507bf7968193a6cb',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../mustache/mustache',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'paragonie/random_compat' => array(
|
||||
'pretty_version' => 'v9.99.100',
|
||||
'version' => '9.99.100.0',
|
||||
'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../paragonie/random_compat',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'php-http/async-client-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '*',
|
||||
),
|
||||
),
|
||||
'php-http/client-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '*',
|
||||
),
|
||||
),
|
||||
'phpmailer/phpmailer' => array(
|
||||
'pretty_version' => 'v6.9.1',
|
||||
'version' => '6.9.1.0',
|
||||
'reference' => '039de174cd9c17a8389754d3b877a2ed22743e18',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/cache' => array(
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/cache',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/container' => array(
|
||||
'pretty_version' => '1.1.2',
|
||||
'version' => '1.1.2.0',
|
||||
'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/container',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-client' => array(
|
||||
'pretty_version' => '1.0.3',
|
||||
'version' => '1.0.3.0',
|
||||
'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-client',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-client-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'psr/http-factory' => array(
|
||||
'pretty_version' => '1.1.0',
|
||||
'version' => '1.1.0.0',
|
||||
'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-factory',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-factory-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'psr/http-message' => array(
|
||||
'pretty_version' => '2.0',
|
||||
'version' => '2.0.0.0',
|
||||
'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/http-message',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/http-message-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'psr/log' => array(
|
||||
'pretty_version' => '1.1.4',
|
||||
'version' => '1.1.4.0',
|
||||
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/log',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'ralouphie/getallheaders' => array(
|
||||
'pretty_version' => '3.0.3',
|
||||
'version' => '3.0.3.0',
|
||||
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../ralouphie/getallheaders',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'stevenmaguire/oauth2-bitbucket' => array(
|
||||
'pretty_version' => '3.0.0',
|
||||
'version' => '3.0.0.0',
|
||||
'reference' => '7ab903e7ac47b3fb18ff27fe5b7c8d2a494bd39c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../stevenmaguire/oauth2-bitbucket',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/deprecation-contracts' => array(
|
||||
'pretty_version' => 'v2.5.3',
|
||||
'version' => '2.5.3.0',
|
||||
'reference' => '80d075412b557d41002320b96a096ca65aa2c98d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/error-handler' => array(
|
||||
'pretty_version' => 'v5.4.42',
|
||||
'version' => '5.4.42.0',
|
||||
'reference' => 'db15ba0fd50890156ed40087ccedc7851a1f5b76',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/error-handler',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/filesystem' => array(
|
||||
'pretty_version' => 'v5.4.44',
|
||||
'version' => '5.4.44.0',
|
||||
'reference' => '76c3818964e9d32be3862c9318ae3ba9aa280ddc',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/filesystem',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/finder' => array(
|
||||
'pretty_version' => 'v5.4.43',
|
||||
'version' => '5.4.43.0',
|
||||
'reference' => 'ae25a9145a900764158d439653d5630191155ca0',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/finder',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/http-client' => array(
|
||||
'pretty_version' => 'v5.4.44',
|
||||
'version' => '5.4.44.0',
|
||||
'reference' => '58d3dc6bfa5fb37137e32d52ddc202ba4d1cea04',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/http-client',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/http-client-contracts' => array(
|
||||
'pretty_version' => 'v2.5.3',
|
||||
'version' => '2.5.3.0',
|
||||
'reference' => 'e5cc97c2b4a4db0ba26bebc154f1426e3fd1d2f1',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/http-client-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/http-client-implementation' => array(
|
||||
'dev_requirement' => false,
|
||||
'provided' => array(
|
||||
0 => '2.4',
|
||||
),
|
||||
),
|
||||
'symfony/polyfill-ctype' => array(
|
||||
'pretty_version' => 'v1.31.0',
|
||||
'version' => '1.31.0.0',
|
||||
'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-intl-grapheme' => array(
|
||||
'pretty_version' => 'v1.31.0',
|
||||
'version' => '1.31.0.0',
|
||||
'reference' => 'b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-intl-normalizer' => array(
|
||||
'pretty_version' => 'v1.31.0',
|
||||
'version' => '1.31.0.0',
|
||||
'reference' => '3833d7255cc303546435cb650316bff708a1c75c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-mbstring' => array(
|
||||
'pretty_version' => 'v1.31.0',
|
||||
'version' => '1.31.0.0',
|
||||
'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-php73' => array(
|
||||
'pretty_version' => 'v1.31.0',
|
||||
'version' => '1.31.0.0',
|
||||
'reference' => '0f68c03565dcaaf25a890667542e8bd75fe7e5bb',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-php80' => array(
|
||||
'pretty_version' => 'v1.31.0',
|
||||
'version' => '1.31.0.0',
|
||||
'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-php81' => array(
|
||||
'pretty_version' => 'v1.31.0',
|
||||
'version' => '1.31.0.0',
|
||||
'reference' => '4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php81',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/service-contracts' => array(
|
||||
'pretty_version' => 'v2.5.3',
|
||||
'version' => '2.5.3.0',
|
||||
'reference' => 'a2329596ddc8fd568900e3fc76cba42489ecc7f3',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/service-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/string' => array(
|
||||
'pretty_version' => 'v5.4.44',
|
||||
'version' => '5.4.44.0',
|
||||
'reference' => '832caa16b6d9aac6bf11747315225f5aba384c24',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/string',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/translation-contracts' => array(
|
||||
'pretty_version' => 'v2.5.3',
|
||||
'version' => '2.5.3.0',
|
||||
'reference' => 'b0073a77ac0b7ea55131020e87b1e3af540f4664',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/translation-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/var-dumper' => array(
|
||||
'pretty_version' => 'v5.4.43',
|
||||
'version' => '5.4.43.0',
|
||||
'reference' => '6be6a6a8af4818564e3726fc65cf936f34743cef',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/var-dumper',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'twbs/bootstrap' => array(
|
||||
'pretty_version' => 'v5.3.3',
|
||||
'version' => '5.3.3.0',
|
||||
'reference' => '6e1f75f420f68e1d52733b8e407fc7c3766c9dba',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../twbs/bootstrap',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'twig/twig' => array(
|
||||
'pretty_version' => 'v3.11.1',
|
||||
'version' => '3.11.1.0',
|
||||
'reference' => 'ff063afc691e1cfda6714f1915ed766cb108d188',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../twig/twig',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'twitter/bootstrap' => array(
|
||||
'dev_requirement' => false,
|
||||
'replaced' => array(
|
||||
0 => 'v5.3.3',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
26
vendor/composer/platform_check.php
vendored
Normal file
26
vendor/composer/platform_check.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
// platform_check.php @generated by Composer
|
||||
|
||||
$issues = array();
|
||||
|
||||
if (!(PHP_VERSION_ID >= 70400)) {
|
||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
|
||||
}
|
||||
|
||||
if ($issues) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||
} elseif (!headers_sent()) {
|
||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
19
vendor/doctrine/cache/LICENSE
vendored
Normal file
19
vendor/doctrine/cache/LICENSE
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2006-2015 Doctrine Project
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
13
vendor/doctrine/cache/README.md
vendored
Normal file
13
vendor/doctrine/cache/README.md
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Doctrine Cache
|
||||
|
||||
[](https://github.com/doctrine/cache/actions)
|
||||
[](https://codecov.io/gh/doctrine/cache/branch/1.10.x)
|
||||
|
||||
[](https://packagist.org/packages/doctrine/cache)
|
||||
[](https://packagist.org/packages/doctrine/cache)
|
||||
|
||||
Cache component extracted from the Doctrine Common project. [Documentation](https://www.doctrine-project.org/projects/doctrine-cache/en/current/index.html)
|
||||
|
||||
This library is deprecated and will no longer receive bug fixes from the
|
||||
Doctrine Project. Please use a different cache library, preferably PSR-6 or
|
||||
PSR-16 instead.
|
27
vendor/doctrine/cache/UPGRADE-1.11.md
vendored
Normal file
27
vendor/doctrine/cache/UPGRADE-1.11.md
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Upgrade to 1.11
|
||||
|
||||
doctrine/cache will no longer be maintained and all cache implementations have
|
||||
been marked as deprecated. These implementations will be removed in 2.0, which
|
||||
will only contain interfaces to provide a lightweight package for backward
|
||||
compatibility.
|
||||
|
||||
There are two new classes to use in the `Doctrine\Common\Cache\Psr6` namespace:
|
||||
* The `CacheAdapter` class allows using any Doctrine Cache as PSR-6 cache. This
|
||||
is useful to provide a forward compatibility layer in libraries that accept
|
||||
Doctrine cache implementations and switch to PSR-6.
|
||||
* The `DoctrineProvider` class allows using any PSR-6 cache as Doctrine cache.
|
||||
This implementation is designed for libraries that leak the cache and want to
|
||||
switch to allowing PSR-6 implementations. This class is design to be used
|
||||
during the transition phase of sunsetting doctrine/cache support.
|
||||
|
||||
A full example to setup a filesystem based PSR-6 cache with symfony/cache
|
||||
using the `DoctrineProvider` to convert back to Doctrine's `Cache` interface:
|
||||
|
||||
```php
|
||||
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
|
||||
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
|
||||
|
||||
$cachePool = new FilesystemAdapter();
|
||||
$cache = DoctrineProvider::wrap($cachePool);
|
||||
// $cache instanceof \Doctrine\Common\Cache\Cache
|
||||
```
|
16
vendor/doctrine/cache/UPGRADE-1.4.md
vendored
Normal file
16
vendor/doctrine/cache/UPGRADE-1.4.md
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Upgrade to 1.4
|
||||
|
||||
## Minor BC Break: `Doctrine\Common\Cache\FileCache#$extension` is now `private`.
|
||||
|
||||
If you need to override the value of `Doctrine\Common\Cache\FileCache#$extension`, then use the
|
||||
second parameter of `Doctrine\Common\Cache\FileCache#__construct()` instead of overriding
|
||||
the property in your own implementation.
|
||||
|
||||
## Minor BC Break: file based caches paths changed
|
||||
|
||||
`Doctrine\Common\Cache\FileCache`, `Doctrine\Common\Cache\PhpFileCache` and
|
||||
`Doctrine\Common\Cache\FilesystemCache` are using a different cache paths structure.
|
||||
|
||||
If you rely on warmed up caches for deployments, consider that caches generated
|
||||
with `doctrine/cache` `<1.4` are not compatible with the new directory structure,
|
||||
and will be ignored.
|
50
vendor/doctrine/cache/composer.json
vendored
Normal file
50
vendor/doctrine/cache/composer.json
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"name": "doctrine/cache",
|
||||
"type": "library",
|
||||
"description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
|
||||
"keywords": [
|
||||
"php",
|
||||
"cache",
|
||||
"caching",
|
||||
"abstraction",
|
||||
"redis",
|
||||
"memcached",
|
||||
"couchdb",
|
||||
"xcache",
|
||||
"apcu"
|
||||
],
|
||||
"homepage": "https://www.doctrine-project.org/projects/cache.html",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
|
||||
{"name": "Roman Borschel", "email": "roman@code-factory.org"},
|
||||
{"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
|
||||
{"name": "Jonathan Wage", "email": "jonwage@gmail.com"},
|
||||
{"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
|
||||
],
|
||||
"require": {
|
||||
"php": "~7.1 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
|
||||
"doctrine/coding-standard": "^9",
|
||||
"psr/cache": "^1.0 || ^2.0 || ^3.0",
|
||||
"cache/integration-tests": "dev-master",
|
||||
"symfony/cache": "^4.4 || ^5.4 || ^6",
|
||||
"symfony/var-exporter": "^4.4 || ^5.4 || ^6"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/common": ">2.2,<2.4"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" }
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||
}
|
||||
}
|
||||
}
|
90
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php
vendored
Normal file
90
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
/**
|
||||
* Interface for cache drivers.
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
*/
|
||||
interface Cache
|
||||
{
|
||||
public const STATS_HITS = 'hits';
|
||||
public const STATS_MISSES = 'misses';
|
||||
public const STATS_UPTIME = 'uptime';
|
||||
public const STATS_MEMORY_USAGE = 'memory_usage';
|
||||
public const STATS_MEMORY_AVAILABLE = 'memory_available';
|
||||
/**
|
||||
* Only for backward compatibility (may be removed in next major release)
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public const STATS_MEMORY_AVAILIABLE = 'memory_available';
|
||||
|
||||
/**
|
||||
* Fetches an entry from the cache.
|
||||
*
|
||||
* @param string $id The id of the cache entry to fetch.
|
||||
*
|
||||
* @return mixed The cached data or FALSE, if no cache entry exists for the given id.
|
||||
*/
|
||||
public function fetch($id);
|
||||
|
||||
/**
|
||||
* Tests if an entry exists in the cache.
|
||||
*
|
||||
* @param string $id The cache id of the entry to check for.
|
||||
*
|
||||
* @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise.
|
||||
*/
|
||||
public function contains($id);
|
||||
|
||||
/**
|
||||
* Puts data into the cache.
|
||||
*
|
||||
* If a cache entry with the given id already exists, its data will be replaced.
|
||||
*
|
||||
* @param string $id The cache id.
|
||||
* @param mixed $data The cache entry/data.
|
||||
* @param int $lifeTime The lifetime in number of seconds for this cache entry.
|
||||
* If zero (the default), the entry never expires (although it may be deleted from the cache
|
||||
* to make place for other entries).
|
||||
*
|
||||
* @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.
|
||||
*/
|
||||
public function save($id, $data, $lifeTime = 0);
|
||||
|
||||
/**
|
||||
* Deletes a cache entry.
|
||||
*
|
||||
* @param string $id The cache id.
|
||||
*
|
||||
* @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise.
|
||||
* Deleting a non-existing entry is considered successful.
|
||||
*/
|
||||
public function delete($id);
|
||||
|
||||
/**
|
||||
* Retrieves cached information from the data store.
|
||||
*
|
||||
* The server's statistics array has the following values:
|
||||
*
|
||||
* - <b>hits</b>
|
||||
* Number of keys that have been requested and found present.
|
||||
*
|
||||
* - <b>misses</b>
|
||||
* Number of items that have been requested and not found.
|
||||
*
|
||||
* - <b>uptime</b>
|
||||
* Time that the server is running.
|
||||
*
|
||||
* - <b>memory_usage</b>
|
||||
* Memory used by this server to store items.
|
||||
*
|
||||
* - <b>memory_available</b>
|
||||
* Memory allowed to use for storage.
|
||||
*
|
||||
* @return mixed[]|null An associative array with server's statistics if available, NULL otherwise.
|
||||
*/
|
||||
public function getStats();
|
||||
}
|
325
vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php
vendored
Normal file
325
vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php
vendored
Normal file
|
@ -0,0 +1,325 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
use function array_combine;
|
||||
use function array_key_exists;
|
||||
use function array_map;
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* Base class for cache provider implementations.
|
||||
*/
|
||||
abstract class CacheProvider implements Cache, FlushableCache, ClearableCache, MultiOperationCache
|
||||
{
|
||||
public const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]';
|
||||
|
||||
/**
|
||||
* The namespace to prefix all cache ids with.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $namespace = '';
|
||||
|
||||
/**
|
||||
* The namespace version.
|
||||
*
|
||||
* @var int|null
|
||||
*/
|
||||
private $namespaceVersion;
|
||||
|
||||
/**
|
||||
* Sets the namespace to prefix all cache ids with.
|
||||
*
|
||||
* @param string $namespace
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setNamespace($namespace)
|
||||
{
|
||||
$this->namespace = (string) $namespace;
|
||||
$this->namespaceVersion = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the namespace that prefixes all cache ids.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNamespace()
|
||||
{
|
||||
return $this->namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fetch($id)
|
||||
{
|
||||
return $this->doFetch($this->getNamespacedId($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fetchMultiple(array $keys)
|
||||
{
|
||||
if (empty($keys)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// note: the array_combine() is in place to keep an association between our $keys and the $namespacedKeys
|
||||
$namespacedKeys = array_combine($keys, array_map([$this, 'getNamespacedId'], $keys));
|
||||
$items = $this->doFetchMultiple($namespacedKeys);
|
||||
$foundItems = [];
|
||||
|
||||
// no internal array function supports this sort of mapping: needs to be iterative
|
||||
// this filters and combines keys in one pass
|
||||
foreach ($namespacedKeys as $requestedKey => $namespacedKey) {
|
||||
if (! isset($items[$namespacedKey]) && ! array_key_exists($namespacedKey, $items)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$foundItems[$requestedKey] = $items[$namespacedKey];
|
||||
}
|
||||
|
||||
return $foundItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function saveMultiple(array $keysAndValues, $lifetime = 0)
|
||||
{
|
||||
$namespacedKeysAndValues = [];
|
||||
foreach ($keysAndValues as $key => $value) {
|
||||
$namespacedKeysAndValues[$this->getNamespacedId($key)] = $value;
|
||||
}
|
||||
|
||||
return $this->doSaveMultiple($namespacedKeysAndValues, $lifetime);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function contains($id)
|
||||
{
|
||||
return $this->doContains($this->getNamespacedId($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save($id, $data, $lifeTime = 0)
|
||||
{
|
||||
return $this->doSave($this->getNamespacedId($id), $data, $lifeTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMultiple(array $keys)
|
||||
{
|
||||
return $this->doDeleteMultiple(array_map([$this, 'getNamespacedId'], $keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
return $this->doDelete($this->getNamespacedId($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getStats()
|
||||
{
|
||||
return $this->doGetStats();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function flushAll()
|
||||
{
|
||||
return $this->doFlush();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function deleteAll()
|
||||
{
|
||||
$namespaceCacheKey = $this->getNamespaceCacheKey();
|
||||
$namespaceVersion = $this->getNamespaceVersion() + 1;
|
||||
|
||||
if ($this->doSave($namespaceCacheKey, $namespaceVersion)) {
|
||||
$this->namespaceVersion = $namespaceVersion;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefixes the passed id with the configured namespace value.
|
||||
*
|
||||
* @param string $id The id to namespace.
|
||||
*
|
||||
* @return string The namespaced id.
|
||||
*/
|
||||
private function getNamespacedId(string $id): string
|
||||
{
|
||||
$namespaceVersion = $this->getNamespaceVersion();
|
||||
|
||||
return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the namespace cache key.
|
||||
*/
|
||||
private function getNamespaceCacheKey(): string
|
||||
{
|
||||
return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the namespace version.
|
||||
*/
|
||||
private function getNamespaceVersion(): int
|
||||
{
|
||||
if ($this->namespaceVersion !== null) {
|
||||
return $this->namespaceVersion;
|
||||
}
|
||||
|
||||
$namespaceCacheKey = $this->getNamespaceCacheKey();
|
||||
$this->namespaceVersion = (int) $this->doFetch($namespaceCacheKey) ?: 1;
|
||||
|
||||
return $this->namespaceVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it.
|
||||
*
|
||||
* @param string[] $keys Array of keys to retrieve from cache
|
||||
*
|
||||
* @return mixed[] Array of values retrieved for the given keys.
|
||||
*/
|
||||
protected function doFetchMultiple(array $keys)
|
||||
{
|
||||
$returnValues = [];
|
||||
|
||||
foreach ($keys as $key) {
|
||||
$item = $this->doFetch($key);
|
||||
if ($item === false && ! $this->doContains($key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$returnValues[$key] = $item;
|
||||
}
|
||||
|
||||
return $returnValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches an entry from the cache.
|
||||
*
|
||||
* @param string $id The id of the cache entry to fetch.
|
||||
*
|
||||
* @return mixed|false The cached data or FALSE, if no cache entry exists for the given id.
|
||||
*/
|
||||
abstract protected function doFetch($id);
|
||||
|
||||
/**
|
||||
* Tests if an entry exists in the cache.
|
||||
*
|
||||
* @param string $id The cache id of the entry to check for.
|
||||
*
|
||||
* @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise.
|
||||
*/
|
||||
abstract protected function doContains($id);
|
||||
|
||||
/**
|
||||
* Default implementation of doSaveMultiple. Each driver that supports multi-put should override it.
|
||||
*
|
||||
* @param mixed[] $keysAndValues Array of keys and values to save in cache
|
||||
* @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these
|
||||
* cache entries (0 => infinite lifeTime).
|
||||
*
|
||||
* @return bool TRUE if the operation was successful, FALSE if it wasn't.
|
||||
*/
|
||||
protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
|
||||
{
|
||||
$success = true;
|
||||
|
||||
foreach ($keysAndValues as $key => $value) {
|
||||
if ($this->doSave($key, $value, $lifetime)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$success = false;
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts data into the cache.
|
||||
*
|
||||
* @param string $id The cache id.
|
||||
* @param string $data The cache entry/data.
|
||||
* @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this
|
||||
* cache entry (0 => infinite lifeTime).
|
||||
*
|
||||
* @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.
|
||||
*/
|
||||
abstract protected function doSave($id, $data, $lifeTime = 0);
|
||||
|
||||
/**
|
||||
* Default implementation of doDeleteMultiple. Each driver that supports multi-delete should override it.
|
||||
*
|
||||
* @param string[] $keys Array of keys to delete from cache
|
||||
*
|
||||
* @return bool TRUE if the operation was successful, FALSE if it wasn't
|
||||
*/
|
||||
protected function doDeleteMultiple(array $keys)
|
||||
{
|
||||
$success = true;
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if ($this->doDelete($key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$success = false;
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a cache entry.
|
||||
*
|
||||
* @param string $id The cache id.
|
||||
*
|
||||
* @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise.
|
||||
*/
|
||||
abstract protected function doDelete($id);
|
||||
|
||||
/**
|
||||
* Flushes all cache entries.
|
||||
*
|
||||
* @return bool TRUE if the cache entries were successfully flushed, FALSE otherwise.
|
||||
*/
|
||||
abstract protected function doFlush();
|
||||
|
||||
/**
|
||||
* Retrieves cached information from the data store.
|
||||
*
|
||||
* @return mixed[]|null An associative array with server's statistics if available, NULL otherwise.
|
||||
*/
|
||||
abstract protected function doGetStats();
|
||||
}
|
21
vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php
vendored
Normal file
21
vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
/**
|
||||
* Interface for cache that can be flushed.
|
||||
*
|
||||
* Intended to be used for partial clearing of a cache namespace. For a more
|
||||
* global "flushing", see {@see FlushableCache}.
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
*/
|
||||
interface ClearableCache
|
||||
{
|
||||
/**
|
||||
* Deletes all cache entries in the current cache namespace.
|
||||
*
|
||||
* @return bool TRUE if the cache entries were successfully deleted, FALSE otherwise.
|
||||
*/
|
||||
public function deleteAll();
|
||||
}
|
18
vendor/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php
vendored
Normal file
18
vendor/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
/**
|
||||
* Interface for cache that can be flushed.
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
*/
|
||||
interface FlushableCache
|
||||
{
|
||||
/**
|
||||
* Flushes all cache entries, globally.
|
||||
*
|
||||
* @return bool TRUE if the cache entries were successfully flushed, FALSE otherwise.
|
||||
*/
|
||||
public function flushAll();
|
||||
}
|
22
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiDeleteCache.php
vendored
Normal file
22
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiDeleteCache.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
/**
|
||||
* Interface for cache drivers that allows to put many items at once.
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
*/
|
||||
interface MultiDeleteCache
|
||||
{
|
||||
/**
|
||||
* Deletes several cache entries.
|
||||
*
|
||||
* @param string[] $keys Array of keys to delete from cache
|
||||
*
|
||||
* @return bool TRUE if the operation was successful, FALSE if it wasn't.
|
||||
*/
|
||||
public function deleteMultiple(array $keys);
|
||||
}
|
23
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php
vendored
Normal file
23
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
/**
|
||||
* Interface for cache drivers that allows to get many items at once.
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
*/
|
||||
interface MultiGetCache
|
||||
{
|
||||
/**
|
||||
* Returns an associative array of values for keys is found in cache.
|
||||
*
|
||||
* @param string[] $keys Array of keys to retrieve from cache
|
||||
*
|
||||
* @return mixed[] Array of retrieved values, indexed by the specified keys.
|
||||
* Values that couldn't be retrieved are not contained in this array.
|
||||
*/
|
||||
public function fetchMultiple(array $keys);
|
||||
}
|
12
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiOperationCache.php
vendored
Normal file
12
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiOperationCache.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
/**
|
||||
* Interface for cache drivers that supports multiple items manipulation.
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
*/
|
||||
interface MultiOperationCache extends MultiGetCache, MultiDeleteCache, MultiPutCache
|
||||
{
|
||||
}
|
24
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php
vendored
Normal file
24
vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache;
|
||||
|
||||
/**
|
||||
* Interface for cache drivers that allows to put many items at once.
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
*/
|
||||
interface MultiPutCache
|
||||
{
|
||||
/**
|
||||
* Returns a boolean value indicating if the operation succeeded.
|
||||
*
|
||||
* @param mixed[] $keysAndValues Array of keys and values to save in cache
|
||||
* @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these
|
||||
* cache entries (0 => infinite lifeTime).
|
||||
*
|
||||
* @return bool TRUE if the operation was successful, FALSE if it wasn't.
|
||||
*/
|
||||
public function saveMultiple(array $keysAndValues, $lifetime = 0);
|
||||
}
|
340
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php
vendored
Normal file
340
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php
vendored
Normal file
|
@ -0,0 +1,340 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache\Psr6;
|
||||
|
||||
use Doctrine\Common\Cache\Cache;
|
||||
use Doctrine\Common\Cache\ClearableCache;
|
||||
use Doctrine\Common\Cache\MultiDeleteCache;
|
||||
use Doctrine\Common\Cache\MultiGetCache;
|
||||
use Doctrine\Common\Cache\MultiPutCache;
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use Symfony\Component\Cache\DoctrineProvider as SymfonyDoctrineProvider;
|
||||
|
||||
use function array_key_exists;
|
||||
use function assert;
|
||||
use function count;
|
||||
use function current;
|
||||
use function get_class;
|
||||
use function gettype;
|
||||
use function is_object;
|
||||
use function is_string;
|
||||
use function microtime;
|
||||
use function sprintf;
|
||||
use function strpbrk;
|
||||
|
||||
use const PHP_VERSION_ID;
|
||||
|
||||
final class CacheAdapter implements CacheItemPoolInterface
|
||||
{
|
||||
private const RESERVED_CHARACTERS = '{}()/\@:';
|
||||
|
||||
/** @var Cache */
|
||||
private $cache;
|
||||
|
||||
/** @var array<CacheItem|TypedCacheItem> */
|
||||
private $deferredItems = [];
|
||||
|
||||
public static function wrap(Cache $cache): CacheItemPoolInterface
|
||||
{
|
||||
if ($cache instanceof DoctrineProvider && ! $cache->getNamespace()) {
|
||||
return $cache->getPool();
|
||||
}
|
||||
|
||||
if ($cache instanceof SymfonyDoctrineProvider && ! $cache->getNamespace()) {
|
||||
$getPool = function () {
|
||||
// phpcs:ignore Squiz.Scope.StaticThisUsage.Found
|
||||
return $this->pool;
|
||||
};
|
||||
|
||||
return $getPool->bindTo($cache, SymfonyDoctrineProvider::class)();
|
||||
}
|
||||
|
||||
return new self($cache);
|
||||
}
|
||||
|
||||
private function __construct(Cache $cache)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
public function getCache(): Cache
|
||||
{
|
||||
return $this->cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getItem($key): CacheItemInterface
|
||||
{
|
||||
assert(self::validKey($key));
|
||||
|
||||
if (isset($this->deferredItems[$key])) {
|
||||
$this->commit();
|
||||
}
|
||||
|
||||
$value = $this->cache->fetch($key);
|
||||
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
if ($value !== false) {
|
||||
return new TypedCacheItem($key, $value, true);
|
||||
}
|
||||
|
||||
return new TypedCacheItem($key, null, false);
|
||||
}
|
||||
|
||||
if ($value !== false) {
|
||||
return new CacheItem($key, $value, true);
|
||||
}
|
||||
|
||||
return new CacheItem($key, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getItems(array $keys = []): array
|
||||
{
|
||||
if ($this->deferredItems) {
|
||||
$this->commit();
|
||||
}
|
||||
|
||||
assert(self::validKeys($keys));
|
||||
|
||||
$values = $this->doFetchMultiple($keys);
|
||||
$items = [];
|
||||
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
foreach ($keys as $key) {
|
||||
if (array_key_exists($key, $values)) {
|
||||
$items[$key] = new TypedCacheItem($key, $values[$key], true);
|
||||
} else {
|
||||
$items[$key] = new TypedCacheItem($key, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if (array_key_exists($key, $values)) {
|
||||
$items[$key] = new CacheItem($key, $values[$key], true);
|
||||
} else {
|
||||
$items[$key] = new CacheItem($key, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function hasItem($key): bool
|
||||
{
|
||||
assert(self::validKey($key));
|
||||
|
||||
if (isset($this->deferredItems[$key])) {
|
||||
$this->commit();
|
||||
}
|
||||
|
||||
return $this->cache->contains($key);
|
||||
}
|
||||
|
||||
public function clear(): bool
|
||||
{
|
||||
$this->deferredItems = [];
|
||||
|
||||
if (! $this->cache instanceof ClearableCache) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->cache->deleteAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function deleteItem($key): bool
|
||||
{
|
||||
assert(self::validKey($key));
|
||||
unset($this->deferredItems[$key]);
|
||||
|
||||
return $this->cache->delete($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function deleteItems(array $keys): bool
|
||||
{
|
||||
foreach ($keys as $key) {
|
||||
assert(self::validKey($key));
|
||||
unset($this->deferredItems[$key]);
|
||||
}
|
||||
|
||||
return $this->doDeleteMultiple($keys);
|
||||
}
|
||||
|
||||
public function save(CacheItemInterface $item): bool
|
||||
{
|
||||
return $this->saveDeferred($item) && $this->commit();
|
||||
}
|
||||
|
||||
public function saveDeferred(CacheItemInterface $item): bool
|
||||
{
|
||||
if (! $item instanceof CacheItem && ! $item instanceof TypedCacheItem) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->deferredItems[$item->getKey()] = $item;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function commit(): bool
|
||||
{
|
||||
if (! $this->deferredItems) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$now = microtime(true);
|
||||
$itemsCount = 0;
|
||||
$byLifetime = [];
|
||||
$expiredKeys = [];
|
||||
|
||||
foreach ($this->deferredItems as $key => $item) {
|
||||
$lifetime = ($item->getExpiry() ?? $now) - $now;
|
||||
|
||||
if ($lifetime < 0) {
|
||||
$expiredKeys[] = $key;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
++$itemsCount;
|
||||
$byLifetime[(int) $lifetime][$key] = $item->get();
|
||||
}
|
||||
|
||||
$this->deferredItems = [];
|
||||
|
||||
switch (count($expiredKeys)) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
$this->cache->delete(current($expiredKeys));
|
||||
break;
|
||||
default:
|
||||
$this->doDeleteMultiple($expiredKeys);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($itemsCount === 1) {
|
||||
return $this->cache->save($key, $item->get(), (int) $lifetime);
|
||||
}
|
||||
|
||||
$success = true;
|
||||
foreach ($byLifetime as $lifetime => $values) {
|
||||
$success = $this->doSaveMultiple($values, $lifetime) && $success;
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $key
|
||||
*/
|
||||
private static function validKey($key): bool
|
||||
{
|
||||
if (! is_string($key)) {
|
||||
throw new InvalidArgument(sprintf('Cache key must be string, "%s" given.', is_object($key) ? get_class($key) : gettype($key)));
|
||||
}
|
||||
|
||||
if ($key === '') {
|
||||
throw new InvalidArgument('Cache key length must be greater than zero.');
|
||||
}
|
||||
|
||||
if (strpbrk($key, self::RESERVED_CHARACTERS) !== false) {
|
||||
throw new InvalidArgument(sprintf('Cache key "%s" contains reserved characters "%s".', $key, self::RESERVED_CHARACTERS));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $keys
|
||||
*/
|
||||
private static function validKeys(array $keys): bool
|
||||
{
|
||||
foreach ($keys as $key) {
|
||||
self::validKey($key);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $keys
|
||||
*/
|
||||
private function doDeleteMultiple(array $keys): bool
|
||||
{
|
||||
if ($this->cache instanceof MultiDeleteCache) {
|
||||
return $this->cache->deleteMultiple($keys);
|
||||
}
|
||||
|
||||
$success = true;
|
||||
foreach ($keys as $key) {
|
||||
$success = $this->cache->delete($key) && $success;
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $keys
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
private function doFetchMultiple(array $keys): array
|
||||
{
|
||||
if ($this->cache instanceof MultiGetCache) {
|
||||
return $this->cache->fetchMultiple($keys);
|
||||
}
|
||||
|
||||
$values = [];
|
||||
foreach ($keys as $key) {
|
||||
$value = $this->cache->fetch($key);
|
||||
if (! $value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$values[$key] = $value;
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $keysAndValues
|
||||
*/
|
||||
private function doSaveMultiple(array $keysAndValues, int $lifetime = 0): bool
|
||||
{
|
||||
if ($this->cache instanceof MultiPutCache) {
|
||||
return $this->cache->saveMultiple($keysAndValues, $lifetime);
|
||||
}
|
||||
|
||||
$success = true;
|
||||
foreach ($keysAndValues as $key => $value) {
|
||||
$success = $this->cache->save($key, $value, $lifetime) && $success;
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
}
|
118
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php
vendored
Normal file
118
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php
vendored
Normal file
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache\Psr6;
|
||||
|
||||
use DateInterval;
|
||||
use DateTime;
|
||||
use DateTimeInterface;
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
use TypeError;
|
||||
|
||||
use function get_class;
|
||||
use function gettype;
|
||||
use function is_int;
|
||||
use function is_object;
|
||||
use function microtime;
|
||||
use function sprintf;
|
||||
|
||||
final class CacheItem implements CacheItemInterface
|
||||
{
|
||||
/** @var string */
|
||||
private $key;
|
||||
/** @var mixed */
|
||||
private $value;
|
||||
/** @var bool */
|
||||
private $isHit;
|
||||
/** @var float|null */
|
||||
private $expiry;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @param mixed $data
|
||||
*/
|
||||
public function __construct(string $key, $data, bool $isHit)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->value = $data;
|
||||
$this->isHit = $isHit;
|
||||
}
|
||||
|
||||
public function getKey(): string
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function isHit(): bool
|
||||
{
|
||||
return $this->isHit;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function set($value): self
|
||||
{
|
||||
$this->value = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function expiresAt($expiration): self
|
||||
{
|
||||
if ($expiration === null) {
|
||||
$this->expiry = null;
|
||||
} elseif ($expiration instanceof DateTimeInterface) {
|
||||
$this->expiry = (float) $expiration->format('U.u');
|
||||
} else {
|
||||
throw new TypeError(sprintf(
|
||||
'Expected $expiration to be an instance of DateTimeInterface or null, got %s',
|
||||
is_object($expiration) ? get_class($expiration) : gettype($expiration)
|
||||
));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function expiresAfter($time): self
|
||||
{
|
||||
if ($time === null) {
|
||||
$this->expiry = null;
|
||||
} elseif ($time instanceof DateInterval) {
|
||||
$this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u');
|
||||
} elseif (is_int($time)) {
|
||||
$this->expiry = $time + microtime(true);
|
||||
} else {
|
||||
throw new TypeError(sprintf(
|
||||
'Expected $time to be either an integer, an instance of DateInterval or null, got %s',
|
||||
is_object($time) ? get_class($time) : gettype($time)
|
||||
));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function getExpiry(): ?float
|
||||
{
|
||||
return $this->expiry;
|
||||
}
|
||||
}
|
135
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php
vendored
Normal file
135
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php
vendored
Normal file
|
@ -0,0 +1,135 @@
|
|||
<?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 Doctrine\Common\Cache\Psr6;
|
||||
|
||||
use Doctrine\Common\Cache\Cache;
|
||||
use Doctrine\Common\Cache\CacheProvider;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use Symfony\Component\Cache\Adapter\DoctrineAdapter as SymfonyDoctrineAdapter;
|
||||
use Symfony\Contracts\Service\ResetInterface;
|
||||
|
||||
use function rawurlencode;
|
||||
|
||||
/**
|
||||
* This class was copied from the Symfony Framework, see the original copyright
|
||||
* notice above. The code is distributed subject to the license terms in
|
||||
* https://github.com/symfony/symfony/blob/ff0cf61278982539c49e467db9ab13cbd342f76d/LICENSE
|
||||
*/
|
||||
final class DoctrineProvider extends CacheProvider
|
||||
{
|
||||
/** @var CacheItemPoolInterface */
|
||||
private $pool;
|
||||
|
||||
public static function wrap(CacheItemPoolInterface $pool): Cache
|
||||
{
|
||||
if ($pool instanceof CacheAdapter) {
|
||||
return $pool->getCache();
|
||||
}
|
||||
|
||||
if ($pool instanceof SymfonyDoctrineAdapter) {
|
||||
$getCache = function () {
|
||||
// phpcs:ignore Squiz.Scope.StaticThisUsage.Found
|
||||
return $this->provider;
|
||||
};
|
||||
|
||||
return $getCache->bindTo($pool, SymfonyDoctrineAdapter::class)();
|
||||
}
|
||||
|
||||
return new self($pool);
|
||||
}
|
||||
|
||||
private function __construct(CacheItemPoolInterface $pool)
|
||||
{
|
||||
$this->pool = $pool;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
public function getPool(): CacheItemPoolInterface
|
||||
{
|
||||
return $this->pool;
|
||||
}
|
||||
|
||||
public function reset(): void
|
||||
{
|
||||
if ($this->pool instanceof ResetInterface) {
|
||||
$this->pool->reset();
|
||||
}
|
||||
|
||||
$this->setNamespace($this->getNamespace());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doFetch($id)
|
||||
{
|
||||
$item = $this->pool->getItem(rawurlencode($id));
|
||||
|
||||
return $item->isHit() ? $item->get() : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doContains($id)
|
||||
{
|
||||
return $this->pool->hasItem(rawurlencode($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doSave($id, $data, $lifeTime = 0)
|
||||
{
|
||||
$item = $this->pool->getItem(rawurlencode($id));
|
||||
|
||||
if (0 < $lifeTime) {
|
||||
$item->expiresAfter($lifeTime);
|
||||
}
|
||||
|
||||
return $this->pool->save($item->set($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doDelete($id)
|
||||
{
|
||||
return $this->pool->deleteItem(rawurlencode($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doFlush()
|
||||
{
|
||||
return $this->pool->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
protected function doGetStats()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
13
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php
vendored
Normal file
13
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache\Psr6;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Psr\Cache\InvalidArgumentException as PsrInvalidArgumentException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class InvalidArgument extends InvalidArgumentException implements PsrInvalidArgumentException
|
||||
{
|
||||
}
|
99
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php
vendored
Normal file
99
vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php
vendored
Normal file
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Cache\Psr6;
|
||||
|
||||
use DateInterval;
|
||||
use DateTime;
|
||||
use DateTimeInterface;
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
use TypeError;
|
||||
|
||||
use function get_debug_type;
|
||||
use function is_int;
|
||||
use function microtime;
|
||||
use function sprintf;
|
||||
|
||||
final class TypedCacheItem implements CacheItemInterface
|
||||
{
|
||||
private ?float $expiry = null;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __construct(
|
||||
private string $key,
|
||||
private mixed $value,
|
||||
private bool $isHit,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getKey(): string
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
public function get(): mixed
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function isHit(): bool
|
||||
{
|
||||
return $this->isHit;
|
||||
}
|
||||
|
||||
public function set(mixed $value): static
|
||||
{
|
||||
$this->value = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function expiresAt($expiration): static
|
||||
{
|
||||
if ($expiration === null) {
|
||||
$this->expiry = null;
|
||||
} elseif ($expiration instanceof DateTimeInterface) {
|
||||
$this->expiry = (float) $expiration->format('U.u');
|
||||
} else {
|
||||
throw new TypeError(sprintf(
|
||||
'Expected $expiration to be an instance of DateTimeInterface or null, got %s',
|
||||
get_debug_type($expiration)
|
||||
));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function expiresAfter($time): static
|
||||
{
|
||||
if ($time === null) {
|
||||
$this->expiry = null;
|
||||
} elseif ($time instanceof DateInterval) {
|
||||
$this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u');
|
||||
} elseif (is_int($time)) {
|
||||
$this->expiry = $time + microtime(true);
|
||||
} else {
|
||||
throw new TypeError(sprintf(
|
||||
'Expected $time to be either an integer, an instance of DateInterval or null, got %s',
|
||||
get_debug_type($time)
|
||||
));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function getExpiry(): ?float
|
||||
{
|
||||
return $this->expiry;
|
||||
}
|
||||
}
|
6
vendor/doctrine/dbal/CONTRIBUTING.md
vendored
Normal file
6
vendor/doctrine/dbal/CONTRIBUTING.md
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
This repository has [guidelines specific to testing][testing guidelines], and
|
||||
Doctrine has [general contributing guidelines][contributor workflow], make
|
||||
sure you follow both.
|
||||
|
||||
[contributor workflow]: https://www.doctrine-project.org/contribute/index.html
|
||||
[testing guidelines]: https://www.doctrine-project.org/projects/doctrine-dbal/en/stable/reference/testing.html
|
19
vendor/doctrine/dbal/LICENSE
vendored
Normal file
19
vendor/doctrine/dbal/LICENSE
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2006-2018 Doctrine Project
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
50
vendor/doctrine/dbal/README.md
vendored
Normal file
50
vendor/doctrine/dbal/README.md
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
# Doctrine DBAL
|
||||
|
||||
| [5.0-dev][5.0] | [4.2-dev][4.2] | [4.1][4.1] | [3.9][3.9] |
|
||||
|:---------------------------------------------------:|:---------------------------------------------------:|:---------------------------------------------------:|:---------------------------------------------------:|
|
||||
| [![GitHub Actions][GA 5.0 image]][GA 5.0] | [![GitHub Actions][GA 4.2 image]][GA 4.2] | [![GitHub Actions][GA 4.1 image]][GA 4.1] | [![GitHub Actions][GA 3.9 image]][GA 3.9] |
|
||||
| [![AppVeyor][AppVeyor 5.0 image]][AppVeyor 5.0] | [![AppVeyor][AppVeyor 4.2 image]][AppVeyor 4.2] | [![AppVeyor][AppVeyor 4.1 image]][AppVeyor 4.1] | [![AppVeyor][AppVeyor 3.9 image]][AppVeyor 3.9] |
|
||||
| [![Code Coverage][Coverage 5.0 image]][CodeCov 5.0] | [![Code Coverage][Coverage 4.2 image]][CodeCov 4.2] | [![Code Coverage][Coverage 4.1 image]][CodeCov 4.1] | [![Code Coverage][Coverage 3.9 image]][CodeCov 3.9] |
|
||||
| N/A | N/A | [![Type Coverage][TypeCov image]][TypeCov] | N/A |
|
||||
|
||||
Powerful ***D***ata***B***ase ***A***bstraction ***L***ayer with many features for database schema introspection and schema management.
|
||||
|
||||
## More resources:
|
||||
|
||||
* [Website](http://www.doctrine-project.org/projects/dbal.html)
|
||||
* [Documentation](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/)
|
||||
* [Issue Tracker](https://github.com/doctrine/dbal/issues)
|
||||
|
||||
[Coverage 5.0 image]: https://codecov.io/gh/doctrine/dbal/branch/5.0.x/graph/badge.svg
|
||||
[5.0]: https://github.com/doctrine/dbal/tree/5.0.x
|
||||
[CodeCov 5.0]: https://codecov.io/gh/doctrine/dbal/branch/5.0.x
|
||||
[AppVeyor 5.0]: https://ci.appveyor.com/project/doctrine/dbal/branch/5.0.x
|
||||
[AppVeyor 5.0 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/5.0.x?svg=true
|
||||
[GA 5.0]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A5.0.x
|
||||
[GA 5.0 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=5.0.x
|
||||
|
||||
[Coverage 4.2 image]: https://codecov.io/gh/doctrine/dbal/branch/4.2.x/graph/badge.svg
|
||||
[4.2]: https://github.com/doctrine/dbal/tree/4.2.x
|
||||
[CodeCov 4.2]: https://codecov.io/gh/doctrine/dbal/branch/4.2.x
|
||||
[AppVeyor 4.2]: https://ci.appveyor.com/project/doctrine/dbal/branch/4.2.x
|
||||
[AppVeyor 4.2 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/4.2.x?svg=true
|
||||
[GA 4.2]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.2.x
|
||||
[GA 4.2 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=4.2.x
|
||||
|
||||
[Coverage 4.1 image]: https://codecov.io/gh/doctrine/dbal/branch/4.1.x/graph/badge.svg
|
||||
[4.1]: https://github.com/doctrine/dbal/tree/4.1.x
|
||||
[CodeCov 4.1]: https://codecov.io/gh/doctrine/dbal/branch/4.1.x
|
||||
[AppVeyor 4.1]: https://ci.appveyor.com/project/doctrine/dbal/branch/4.1.x
|
||||
[AppVeyor 4.1 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/4.1.x?svg=true
|
||||
[GA 4.1]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.1.x
|
||||
[GA 4.1 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=4.1.x
|
||||
[TypeCov]: https://shepherd.dev/github/doctrine/dbal
|
||||
[TypeCov image]: https://shepherd.dev/github/doctrine/dbal/coverage.svg
|
||||
|
||||
[Coverage 3.9 image]: https://codecov.io/gh/doctrine/dbal/branch/3.9.x/graph/badge.svg
|
||||
[3.9]: https://github.com/doctrine/dbal/tree/3.9.x
|
||||
[CodeCov 3.9]: https://codecov.io/gh/doctrine/dbal/branch/3.9.x
|
||||
[AppVeyor 3.9]: https://ci.appveyor.com/project/doctrine/dbal/branch/3.9.x
|
||||
[AppVeyor 3.9 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/3.9.x?svg=true
|
||||
[GA 3.9]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A3.9.x
|
||||
[GA 3.9 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=3.9.x
|
4
vendor/doctrine/dbal/bin/doctrine-dbal
vendored
Executable file
4
vendor/doctrine/dbal/bin/doctrine-dbal
vendored
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/doctrine-dbal.php';
|
55
vendor/doctrine/dbal/bin/doctrine-dbal.php
vendored
Normal file
55
vendor/doctrine/dbal/bin/doctrine-dbal.php
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
use Doctrine\DBAL\Tools\Console\ConsoleRunner;
|
||||
|
||||
fwrite(
|
||||
STDERR,
|
||||
'[Warning] The use of this script is discouraged.'
|
||||
. ' You find instructions on how to bootstrap the console runner in our documentation.'
|
||||
. PHP_EOL,
|
||||
);
|
||||
|
||||
echo PHP_EOL . PHP_EOL;
|
||||
|
||||
$files = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php'];
|
||||
$loader = null;
|
||||
$cwd = getcwd();
|
||||
$directories = [$cwd, $cwd . DIRECTORY_SEPARATOR . 'config'];
|
||||
$configFile = null;
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (file_exists($file)) {
|
||||
$loader = require $file;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $loader) {
|
||||
throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');
|
||||
}
|
||||
|
||||
foreach ($directories as $directory) {
|
||||
$configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php';
|
||||
|
||||
if (file_exists($configFile)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! file_exists($configFile)) {
|
||||
ConsoleRunner::printCliConfigTemplate();
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (! is_readable($configFile)) {
|
||||
echo 'Configuration file [' . $configFile . '] does not have read permission.' . PHP_EOL;
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$commands = [];
|
||||
$connectionProvider = require $configFile;
|
||||
|
||||
ConsoleRunner::run($connectionProvider, $commands);
|
73
vendor/doctrine/dbal/composer.json
vendored
Normal file
73
vendor/doctrine/dbal/composer.json
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
"name": "doctrine/dbal",
|
||||
"type": "library",
|
||||
"description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.",
|
||||
"keywords": [
|
||||
"abstraction",
|
||||
"database",
|
||||
"dbal",
|
||||
"db2",
|
||||
"mariadb",
|
||||
"mssql",
|
||||
"mysql",
|
||||
"pgsql",
|
||||
"postgresql",
|
||||
"oci8",
|
||||
"oracle",
|
||||
"pdo",
|
||||
"queryobject",
|
||||
"sasql",
|
||||
"sql",
|
||||
"sqlite",
|
||||
"sqlserver",
|
||||
"sqlsrv"
|
||||
],
|
||||
"homepage": "https://www.doctrine-project.org/projects/dbal.html",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
|
||||
{"name": "Roman Borschel", "email": "roman@code-factory.org"},
|
||||
{"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
|
||||
{"name": "Jonathan Wage", "email": "jonwage@gmail.com"}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0",
|
||||
"composer-runtime-api": "^2",
|
||||
"doctrine/cache": "^1.11|^2.0",
|
||||
"doctrine/deprecations": "^0.5.3|^1",
|
||||
"doctrine/event-manager": "^1|^2",
|
||||
"psr/cache": "^1|^2|^3",
|
||||
"psr/log": "^1|^2|^3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "12.0.0",
|
||||
"fig/log-test": "^1",
|
||||
"jetbrains/phpstorm-stubs": "2023.1",
|
||||
"phpstan/phpstan": "1.12.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.6",
|
||||
"phpunit/phpunit": "9.6.20",
|
||||
"psalm/plugin-phpunit": "0.18.4",
|
||||
"slevomat/coding-standard": "8.13.1",
|
||||
"squizlabs/php_codesniffer": "3.10.2",
|
||||
"symfony/cache": "^5.4|^6.0|^7.0",
|
||||
"symfony/console": "^4.4|^5.4|^6.0|^7.0",
|
||||
"vimeo/psalm": "4.30.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "For helpful console commands such as SQL execution and import of files."
|
||||
},
|
||||
"bin": ["bin/doctrine-dbal"],
|
||||
"config": {
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true,
|
||||
"composer/package-versions-deprecated": true
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Doctrine\\DBAL\\": "src" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "Doctrine\\DBAL\\Tests\\": "tests" }
|
||||
}
|
||||
}
|
42
vendor/doctrine/dbal/src/ArrayParameterType.php
vendored
Normal file
42
vendor/doctrine/dbal/src/ArrayParameterType.php
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL;
|
||||
|
||||
final class ArrayParameterType
|
||||
{
|
||||
/**
|
||||
* Represents an array of ints to be expanded by Doctrine SQL parsing.
|
||||
*/
|
||||
public const INTEGER = ParameterType::INTEGER + Connection::ARRAY_PARAM_OFFSET;
|
||||
|
||||
/**
|
||||
* Represents an array of strings to be expanded by Doctrine SQL parsing.
|
||||
*/
|
||||
public const STRING = ParameterType::STRING + Connection::ARRAY_PARAM_OFFSET;
|
||||
|
||||
/**
|
||||
* Represents an array of ascii strings to be expanded by Doctrine SQL parsing.
|
||||
*/
|
||||
public const ASCII = ParameterType::ASCII + Connection::ARRAY_PARAM_OFFSET;
|
||||
|
||||
/**
|
||||
* Represents an array of ascii strings to be expanded by Doctrine SQL parsing.
|
||||
*/
|
||||
public const BINARY = ParameterType::BINARY + Connection::ARRAY_PARAM_OFFSET;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-param self::* $type
|
||||
*
|
||||
* @psalm-return ParameterType::INTEGER|ParameterType::STRING|ParameterType::ASCII|ParameterType::BINARY
|
||||
*/
|
||||
public static function toElementParameterType(int $type): int
|
||||
{
|
||||
return $type - Connection::ARRAY_PARAM_OFFSET;
|
||||
}
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
}
|
10
vendor/doctrine/dbal/src/ArrayParameters/Exception.php
vendored
Normal file
10
vendor/doctrine/dbal/src/ArrayParameters/Exception.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\ArrayParameters;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/** @internal */
|
||||
interface Exception extends Throwable
|
||||
{
|
||||
}
|
19
vendor/doctrine/dbal/src/ArrayParameters/Exception/MissingNamedParameter.php
vendored
Normal file
19
vendor/doctrine/dbal/src/ArrayParameters/Exception/MissingNamedParameter.php
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\ArrayParameters\Exception;
|
||||
|
||||
use Doctrine\DBAL\ArrayParameters\Exception;
|
||||
use LogicException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
class MissingNamedParameter extends LogicException implements Exception
|
||||
{
|
||||
public static function new(string $name): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('Named parameter "%s" does not have a bound value.', $name),
|
||||
);
|
||||
}
|
||||
}
|
23
vendor/doctrine/dbal/src/ArrayParameters/Exception/MissingPositionalParameter.php
vendored
Normal file
23
vendor/doctrine/dbal/src/ArrayParameters/Exception/MissingPositionalParameter.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\ArrayParameters\Exception;
|
||||
|
||||
use Doctrine\DBAL\ArrayParameters\Exception;
|
||||
use LogicException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
class MissingPositionalParameter extends LogicException implements Exception
|
||||
{
|
||||
public static function new(int $index): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('Positional parameter at index %d does not have a bound value.', $index),
|
||||
);
|
||||
}
|
||||
}
|
116
vendor/doctrine/dbal/src/Cache/ArrayResult.php
vendored
Normal file
116
vendor/doctrine/dbal/src/Cache/ArrayResult.php
vendored
Normal file
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Cache;
|
||||
|
||||
use Doctrine\DBAL\Driver\FetchUtils;
|
||||
use Doctrine\DBAL\Driver\Result;
|
||||
|
||||
use function array_values;
|
||||
use function count;
|
||||
use function reset;
|
||||
|
||||
/** @internal The class is internal to the caching layer implementation. */
|
||||
final class ArrayResult implements Result
|
||||
{
|
||||
/** @var list<array<string, mixed>> */
|
||||
private array $data;
|
||||
|
||||
private int $columnCount = 0;
|
||||
private int $num = 0;
|
||||
|
||||
/** @param list<array<string, mixed>> $data */
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
if (count($data) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->columnCount = count($data[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchNumeric()
|
||||
{
|
||||
$row = $this->fetch();
|
||||
|
||||
if ($row === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return array_values($row);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAssociative()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchOne()
|
||||
{
|
||||
$row = $this->fetch();
|
||||
|
||||
if ($row === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return reset($row);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAllNumeric(): array
|
||||
{
|
||||
return FetchUtils::fetchAllNumeric($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAllAssociative(): array
|
||||
{
|
||||
return FetchUtils::fetchAllAssociative($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchFirstColumn(): array
|
||||
{
|
||||
return FetchUtils::fetchFirstColumn($this);
|
||||
}
|
||||
|
||||
public function rowCount(): int
|
||||
{
|
||||
return count($this->data);
|
||||
}
|
||||
|
||||
public function columnCount(): int
|
||||
{
|
||||
return $this->columnCount;
|
||||
}
|
||||
|
||||
public function free(): void
|
||||
{
|
||||
$this->data = [];
|
||||
}
|
||||
|
||||
/** @return array<string, mixed>|false */
|
||||
private function fetch()
|
||||
{
|
||||
if (! isset($this->data[$this->num])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->data[$this->num++];
|
||||
}
|
||||
}
|
21
vendor/doctrine/dbal/src/Cache/CacheException.php
vendored
Normal file
21
vendor/doctrine/dbal/src/Cache/CacheException.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Cache;
|
||||
|
||||
use Doctrine\DBAL\Exception;
|
||||
|
||||
/** @psalm-immutable */
|
||||
class CacheException extends Exception
|
||||
{
|
||||
/** @return CacheException */
|
||||
public static function noCacheKey()
|
||||
{
|
||||
return new self('No cache key was set.');
|
||||
}
|
||||
|
||||
/** @return CacheException */
|
||||
public static function noResultDriverConfigured()
|
||||
{
|
||||
return new self('Trying to cache a query but no result driver is configured.');
|
||||
}
|
||||
}
|
176
vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php
vendored
Normal file
176
vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php
vendored
Normal file
|
@ -0,0 +1,176 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Cache;
|
||||
|
||||
use Doctrine\Common\Cache\Cache;
|
||||
use Doctrine\Common\Cache\Psr6\CacheAdapter;
|
||||
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use TypeError;
|
||||
|
||||
use function get_class;
|
||||
use function hash;
|
||||
use function serialize;
|
||||
use function sha1;
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* Query Cache Profile handles the data relevant for query caching.
|
||||
*
|
||||
* It is a value object, setter methods return NEW instances.
|
||||
*/
|
||||
class QueryCacheProfile
|
||||
{
|
||||
private ?CacheItemPoolInterface $resultCache = null;
|
||||
|
||||
/** @var int */
|
||||
private $lifetime;
|
||||
|
||||
/** @var string|null */
|
||||
private $cacheKey;
|
||||
|
||||
/**
|
||||
* @param int $lifetime
|
||||
* @param string|null $cacheKey
|
||||
* @param CacheItemPoolInterface|Cache|null $resultCache
|
||||
*/
|
||||
public function __construct($lifetime = 0, $cacheKey = null, ?object $resultCache = null)
|
||||
{
|
||||
$this->lifetime = $lifetime;
|
||||
$this->cacheKey = $cacheKey;
|
||||
if ($resultCache instanceof CacheItemPoolInterface) {
|
||||
$this->resultCache = $resultCache;
|
||||
} elseif ($resultCache instanceof Cache) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4620',
|
||||
'Passing an instance of %s to %s as $resultCache is deprecated. Pass an instance of %s instead.',
|
||||
Cache::class,
|
||||
__METHOD__,
|
||||
CacheItemPoolInterface::class,
|
||||
);
|
||||
|
||||
$this->resultCache = CacheAdapter::wrap($resultCache);
|
||||
} elseif ($resultCache !== null) {
|
||||
throw new TypeError(sprintf(
|
||||
'$resultCache: Expected either null or an instance of %s or %s, got %s.',
|
||||
CacheItemPoolInterface::class,
|
||||
Cache::class,
|
||||
get_class($resultCache),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public function getResultCache(): ?CacheItemPoolInterface
|
||||
{
|
||||
return $this->resultCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@see getResultCache()} instead.
|
||||
*
|
||||
* @return Cache|null
|
||||
*/
|
||||
public function getResultCacheDriver()
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4620',
|
||||
'%s is deprecated, call getResultCache() instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
return $this->resultCache !== null ? DoctrineProvider::wrap($this->resultCache) : null;
|
||||
}
|
||||
|
||||
/** @return int */
|
||||
public function getLifetime()
|
||||
{
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @throws CacheException
|
||||
*/
|
||||
public function getCacheKey()
|
||||
{
|
||||
if ($this->cacheKey === null) {
|
||||
throw CacheException::noCacheKey();
|
||||
}
|
||||
|
||||
return $this->cacheKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the real cache key from query, params, types and connection parameters.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param list<mixed>|array<string, mixed> $params
|
||||
* @param array<int, Type|int|string|null>|array<string, Type|int|string|null> $types
|
||||
* @param array<string, mixed> $connectionParams
|
||||
*
|
||||
* @return array{string, string}
|
||||
*/
|
||||
public function generateCacheKeys($sql, $params, $types, array $connectionParams = [])
|
||||
{
|
||||
if (isset($connectionParams['password'])) {
|
||||
unset($connectionParams['password']);
|
||||
}
|
||||
|
||||
$realCacheKey = 'query=' . $sql .
|
||||
'¶ms=' . serialize($params) .
|
||||
'&types=' . serialize($types) .
|
||||
'&connectionParams=' . hash('sha256', serialize($connectionParams));
|
||||
|
||||
// should the key be automatically generated using the inputs or is the cache key set?
|
||||
$cacheKey = $this->cacheKey ?? sha1($realCacheKey);
|
||||
|
||||
return [$cacheKey, $realCacheKey];
|
||||
}
|
||||
|
||||
public function setResultCache(CacheItemPoolInterface $cache): QueryCacheProfile
|
||||
{
|
||||
return new QueryCacheProfile($this->lifetime, $this->cacheKey, $cache);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@see setResultCache()} instead.
|
||||
*
|
||||
* @return QueryCacheProfile
|
||||
*/
|
||||
public function setResultCacheDriver(Cache $cache)
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4620',
|
||||
'%s is deprecated, call setResultCache() instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
return new QueryCacheProfile($this->lifetime, $this->cacheKey, CacheAdapter::wrap($cache));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $cacheKey
|
||||
*
|
||||
* @return QueryCacheProfile
|
||||
*/
|
||||
public function setCacheKey($cacheKey)
|
||||
{
|
||||
return new QueryCacheProfile($this->lifetime, $cacheKey, $this->resultCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $lifetime
|
||||
*
|
||||
* @return QueryCacheProfile
|
||||
*/
|
||||
public function setLifetime($lifetime)
|
||||
{
|
||||
return new QueryCacheProfile($lifetime, $this->cacheKey, $this->resultCache);
|
||||
}
|
||||
}
|
28
vendor/doctrine/dbal/src/ColumnCase.php
vendored
Normal file
28
vendor/doctrine/dbal/src/ColumnCase.php
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL;
|
||||
|
||||
/**
|
||||
* Contains portable column case conversions.
|
||||
*/
|
||||
final class ColumnCase
|
||||
{
|
||||
/**
|
||||
* Convert column names to upper case.
|
||||
*/
|
||||
public const UPPER = 1;
|
||||
|
||||
/**
|
||||
* Convert column names to lower case.
|
||||
*/
|
||||
public const LOWER = 2;
|
||||
|
||||
/**
|
||||
* This class cannot be instantiated.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
}
|
265
vendor/doctrine/dbal/src/Configuration.php
vendored
Normal file
265
vendor/doctrine/dbal/src/Configuration.php
vendored
Normal file
|
@ -0,0 +1,265 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL;
|
||||
|
||||
use Doctrine\Common\Cache\Cache;
|
||||
use Doctrine\Common\Cache\Psr6\CacheAdapter;
|
||||
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
|
||||
use Doctrine\DBAL\Driver\Middleware;
|
||||
use Doctrine\DBAL\Logging\SQLLogger;
|
||||
use Doctrine\DBAL\Schema\SchemaManagerFactory;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
use function func_num_args;
|
||||
|
||||
/**
|
||||
* Configuration container for the Doctrine DBAL.
|
||||
*/
|
||||
class Configuration
|
||||
{
|
||||
/** @var Middleware[] */
|
||||
private array $middlewares = [];
|
||||
|
||||
/**
|
||||
* The SQL logger in use. If null, SQL logging is disabled.
|
||||
*
|
||||
* @var SQLLogger|null
|
||||
*/
|
||||
protected $sqlLogger;
|
||||
|
||||
/**
|
||||
* The cache driver implementation that is used for query result caching.
|
||||
*/
|
||||
private ?CacheItemPoolInterface $resultCache = null;
|
||||
|
||||
/**
|
||||
* The cache driver implementation that is used for query result caching.
|
||||
*
|
||||
* @deprecated Use {@see $resultCache} instead.
|
||||
*
|
||||
* @var Cache|null
|
||||
*/
|
||||
protected $resultCacheImpl;
|
||||
|
||||
/**
|
||||
* The callable to use to filter schema assets.
|
||||
*
|
||||
* @var callable|null
|
||||
*/
|
||||
protected $schemaAssetsFilter;
|
||||
|
||||
/**
|
||||
* The default auto-commit mode for connections.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $autoCommit = true;
|
||||
|
||||
/**
|
||||
* Whether type comments should be disabled to provide the same DB schema than
|
||||
* will be obtained with DBAL 4.x. This is useful when relying only on the
|
||||
* platform-aware schema comparison (which does not need those type comments)
|
||||
* rather than the deprecated legacy tooling.
|
||||
*/
|
||||
private bool $disableTypeComments = false;
|
||||
|
||||
private ?SchemaManagerFactory $schemaManagerFactory = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->schemaAssetsFilter = static function (): bool {
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled.
|
||||
*
|
||||
* @deprecated Use {@see setMiddlewares()} and {@see \Doctrine\DBAL\Logging\Middleware} instead.
|
||||
*/
|
||||
public function setSQLLogger(?SQLLogger $logger = null): void
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4967',
|
||||
'%s is deprecated, use setMiddlewares() and Logging\\Middleware instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
$this->sqlLogger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SQL logger that is used.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function getSQLLogger(): ?SQLLogger
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4967',
|
||||
'%s is deprecated.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
return $this->sqlLogger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cache driver implementation that is used for query result caching.
|
||||
*/
|
||||
public function getResultCache(): ?CacheItemPoolInterface
|
||||
{
|
||||
return $this->resultCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cache driver implementation that is used for query result caching.
|
||||
*
|
||||
* @deprecated Use {@see getResultCache()} instead.
|
||||
*/
|
||||
public function getResultCacheImpl(): ?Cache
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4620',
|
||||
'%s is deprecated, call getResultCache() instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
return $this->resultCacheImpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cache driver implementation that is used for query result caching.
|
||||
*/
|
||||
public function setResultCache(CacheItemPoolInterface $cache): void
|
||||
{
|
||||
$this->resultCacheImpl = DoctrineProvider::wrap($cache);
|
||||
$this->resultCache = $cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cache driver implementation that is used for query result caching.
|
||||
*
|
||||
* @deprecated Use {@see setResultCache()} instead.
|
||||
*/
|
||||
public function setResultCacheImpl(Cache $cacheImpl): void
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4620',
|
||||
'%s is deprecated, call setResultCache() instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
$this->resultCacheImpl = $cacheImpl;
|
||||
$this->resultCache = CacheAdapter::wrap($cacheImpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the callable to use to filter schema assets.
|
||||
*/
|
||||
public function setSchemaAssetsFilter(?callable $callable = null): void
|
||||
{
|
||||
if (func_num_args() < 1) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5483',
|
||||
'Not passing an argument to %s is deprecated.',
|
||||
__METHOD__,
|
||||
);
|
||||
} elseif ($callable === null) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5483',
|
||||
'Using NULL as a schema asset filter is deprecated.'
|
||||
. ' Use a callable that always returns true instead.',
|
||||
);
|
||||
}
|
||||
|
||||
$this->schemaAssetsFilter = $callable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the callable to use to filter schema assets.
|
||||
*/
|
||||
public function getSchemaAssetsFilter(): ?callable
|
||||
{
|
||||
return $this->schemaAssetsFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default auto-commit mode for connections.
|
||||
*
|
||||
* If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual
|
||||
* transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either
|
||||
* the method commit or the method rollback. By default, new connections are in auto-commit mode.
|
||||
*
|
||||
* @see getAutoCommit
|
||||
*
|
||||
* @param bool $autoCommit True to enable auto-commit mode; false to disable it
|
||||
*/
|
||||
public function setAutoCommit(bool $autoCommit): void
|
||||
{
|
||||
$this->autoCommit = $autoCommit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default auto-commit mode for connections.
|
||||
*
|
||||
* @see setAutoCommit
|
||||
*
|
||||
* @return bool True if auto-commit mode is enabled by default for connections, false otherwise.
|
||||
*/
|
||||
public function getAutoCommit(): bool
|
||||
{
|
||||
return $this->autoCommit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Middleware[] $middlewares
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMiddlewares(array $middlewares): self
|
||||
{
|
||||
$this->middlewares = $middlewares;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/** @return Middleware[] */
|
||||
public function getMiddlewares(): array
|
||||
{
|
||||
return $this->middlewares;
|
||||
}
|
||||
|
||||
public function getSchemaManagerFactory(): ?SchemaManagerFactory
|
||||
{
|
||||
return $this->schemaManagerFactory;
|
||||
}
|
||||
|
||||
/** @return $this */
|
||||
public function setSchemaManagerFactory(SchemaManagerFactory $schemaManagerFactory): self
|
||||
{
|
||||
$this->schemaManagerFactory = $schemaManagerFactory;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisableTypeComments(): bool
|
||||
{
|
||||
return $this->disableTypeComments;
|
||||
}
|
||||
|
||||
/** @return $this */
|
||||
public function setDisableTypeComments(bool $disableTypeComments): self
|
||||
{
|
||||
$this->disableTypeComments = $disableTypeComments;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
2001
vendor/doctrine/dbal/src/Connection.php
vendored
Normal file
2001
vendor/doctrine/dbal/src/Connection.php
vendored
Normal file
File diff suppressed because it is too large
Load diff
31
vendor/doctrine/dbal/src/ConnectionException.php
vendored
Normal file
31
vendor/doctrine/dbal/src/ConnectionException.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL;
|
||||
|
||||
/** @psalm-immutable */
|
||||
class ConnectionException extends Exception
|
||||
{
|
||||
/** @return ConnectionException */
|
||||
public static function commitFailedRollbackOnly()
|
||||
{
|
||||
return new self('Transaction commit failed because the transaction has been marked for rollback only.');
|
||||
}
|
||||
|
||||
/** @return ConnectionException */
|
||||
public static function noActiveTransaction()
|
||||
{
|
||||
return new self('There is no active transaction.');
|
||||
}
|
||||
|
||||
/** @return ConnectionException */
|
||||
public static function savepointsNotSupported()
|
||||
{
|
||||
return new self('Savepoints are not supported by this driver.');
|
||||
}
|
||||
|
||||
/** @return ConnectionException */
|
||||
public static function mayNotAlterNestedTransactionWithSavepointsInTransaction()
|
||||
{
|
||||
return new self('May not alter the nested transaction with savepoints behavior while a transaction is open.');
|
||||
}
|
||||
}
|
374
vendor/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php
vendored
Normal file
374
vendor/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php
vendored
Normal file
|
@ -0,0 +1,374 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Connections;
|
||||
|
||||
use Doctrine\Common\EventManager;
|
||||
use Doctrine\DBAL\Configuration;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Driver\Connection as DriverConnection;
|
||||
use Doctrine\DBAL\Driver\Exception as DriverException;
|
||||
use Doctrine\DBAL\DriverManager;
|
||||
use Doctrine\DBAL\Event\ConnectionEventArgs;
|
||||
use Doctrine\DBAL\Events;
|
||||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Statement;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use InvalidArgumentException;
|
||||
use SensitiveParameter;
|
||||
|
||||
use function array_rand;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Primary-Replica Connection
|
||||
*
|
||||
* Connection can be used with primary-replica setups.
|
||||
*
|
||||
* Important for the understanding of this connection should be how and when
|
||||
* it picks the replica or primary.
|
||||
*
|
||||
* 1. Replica if primary was never picked before and ONLY if 'getWrappedConnection'
|
||||
* or 'executeQuery' is used.
|
||||
* 2. Primary picked when 'executeStatement', 'insert', 'delete', 'update', 'createSavepoint',
|
||||
* 'releaseSavepoint', 'beginTransaction', 'rollback', 'commit' or 'prepare' is called.
|
||||
* 3. If Primary was picked once during the lifetime of the connection it will always get picked afterwards.
|
||||
* 4. One replica connection is randomly picked ONCE during a request.
|
||||
*
|
||||
* ATTENTION: You can write to the replica with this connection if you execute a write query without
|
||||
* opening up a transaction. For example:
|
||||
*
|
||||
* $conn = DriverManager::getConnection(...);
|
||||
* $conn->executeQuery("DELETE FROM table");
|
||||
*
|
||||
* Be aware that Connection#executeQuery is a method specifically for READ
|
||||
* operations only.
|
||||
*
|
||||
* Use Connection#executeStatement for any SQL statement that changes/updates
|
||||
* state in the database (UPDATE, INSERT, DELETE or DDL statements).
|
||||
*
|
||||
* This connection is limited to replica operations using the
|
||||
* Connection#executeQuery operation only, because it wouldn't be compatible
|
||||
* with the ORM or SchemaManager code otherwise. Both use all the other
|
||||
* operations in a context where writes could happen to a replica, which makes
|
||||
* this restricted approach necessary.
|
||||
*
|
||||
* You can manually connect to the primary at any time by calling:
|
||||
*
|
||||
* $conn->ensureConnectedToPrimary();
|
||||
*
|
||||
* Instantiation through the DriverManager looks like:
|
||||
*
|
||||
* @psalm-import-type Params from DriverManager
|
||||
* @example
|
||||
*
|
||||
* $conn = DriverManager::getConnection(array(
|
||||
* 'wrapperClass' => 'Doctrine\DBAL\Connections\PrimaryReadReplicaConnection',
|
||||
* 'driver' => 'pdo_mysql',
|
||||
* 'primary' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''),
|
||||
* 'replica' => array(
|
||||
* array('user' => 'replica1', 'password' => '', 'host' => '', 'dbname' => ''),
|
||||
* array('user' => 'replica2', 'password' => '', 'host' => '', 'dbname' => ''),
|
||||
* )
|
||||
* ));
|
||||
*
|
||||
* You can also pass 'driverOptions' and any other documented option to each of this drivers
|
||||
* to pass additional information.
|
||||
*/
|
||||
class PrimaryReadReplicaConnection extends Connection
|
||||
{
|
||||
/**
|
||||
* Primary and Replica connection (one of the randomly picked replicas).
|
||||
*
|
||||
* @var DriverConnection[]|null[]
|
||||
*/
|
||||
protected $connections = ['primary' => null, 'replica' => null];
|
||||
|
||||
/**
|
||||
* You can keep the replica connection and then switch back to it
|
||||
* during the request if you know what you are doing.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $keepReplica = false;
|
||||
|
||||
/**
|
||||
* Creates Primary Replica Connection.
|
||||
*
|
||||
* @internal The connection can be only instantiated by the driver manager.
|
||||
*
|
||||
* @param array<string,mixed> $params
|
||||
* @psalm-param Params $params
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(
|
||||
array $params,
|
||||
Driver $driver,
|
||||
?Configuration $config = null,
|
||||
?EventManager $eventManager = null
|
||||
) {
|
||||
if (! isset($params['replica'], $params['primary'])) {
|
||||
throw new InvalidArgumentException('primary or replica configuration missing');
|
||||
}
|
||||
|
||||
if (count($params['replica']) === 0) {
|
||||
throw new InvalidArgumentException('You have to configure at least one replica.');
|
||||
}
|
||||
|
||||
if (isset($params['driver'])) {
|
||||
$params['primary']['driver'] = $params['driver'];
|
||||
|
||||
foreach ($params['replica'] as $replicaKey => $replica) {
|
||||
$params['replica'][$replicaKey]['driver'] = $params['driver'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->keepReplica = (bool) ($params['keepReplica'] ?? false);
|
||||
|
||||
parent::__construct($params, $driver, $config, $eventManager);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the connection is currently towards the primary or not.
|
||||
*/
|
||||
public function isConnectedToPrimary(): bool
|
||||
{
|
||||
return $this->_conn !== null && $this->_conn === $this->connections['primary'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $connectionName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function connect($connectionName = null)
|
||||
{
|
||||
if ($connectionName !== null) {
|
||||
throw new InvalidArgumentException(
|
||||
'Passing a connection name as first argument is not supported anymore.'
|
||||
. ' Use ensureConnectedToPrimary()/ensureConnectedToReplica() instead.',
|
||||
);
|
||||
}
|
||||
|
||||
return $this->performConnect();
|
||||
}
|
||||
|
||||
protected function performConnect(?string $connectionName = null): bool
|
||||
{
|
||||
$requestedConnectionChange = ($connectionName !== null);
|
||||
$connectionName = $connectionName ?? 'replica';
|
||||
|
||||
if ($connectionName !== 'replica' && $connectionName !== 'primary') {
|
||||
throw new InvalidArgumentException('Invalid option to connect(), only primary or replica allowed.');
|
||||
}
|
||||
|
||||
// If we have a connection open, and this is not an explicit connection
|
||||
// change request, then abort right here, because we are already done.
|
||||
// This prevents writes to the replica in case of "keepReplica" option enabled.
|
||||
if ($this->_conn !== null && ! $requestedConnectionChange) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$forcePrimaryAsReplica = false;
|
||||
|
||||
if ($this->getTransactionNestingLevel() > 0) {
|
||||
$connectionName = 'primary';
|
||||
$forcePrimaryAsReplica = true;
|
||||
}
|
||||
|
||||
if (isset($this->connections[$connectionName])) {
|
||||
$this->_conn = $this->connections[$connectionName];
|
||||
|
||||
if ($forcePrimaryAsReplica && ! $this->keepReplica) {
|
||||
$this->connections['replica'] = $this->_conn;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($connectionName === 'primary') {
|
||||
$this->connections['primary'] = $this->_conn = $this->connectTo($connectionName);
|
||||
|
||||
// Set replica connection to primary to avoid invalid reads
|
||||
if (! $this->keepReplica) {
|
||||
$this->connections['replica'] = $this->connections['primary'];
|
||||
}
|
||||
} else {
|
||||
$this->connections['replica'] = $this->_conn = $this->connectTo($connectionName);
|
||||
}
|
||||
|
||||
if ($this->_eventManager->hasListeners(Events::postConnect)) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/issues/5784',
|
||||
'Subscribing to %s events is deprecated. Implement a middleware instead.',
|
||||
Events::postConnect,
|
||||
);
|
||||
|
||||
$eventArgs = new ConnectionEventArgs($this);
|
||||
$this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to the primary node of the database cluster.
|
||||
*
|
||||
* All following statements after this will be executed against the primary node.
|
||||
*/
|
||||
public function ensureConnectedToPrimary(): bool
|
||||
{
|
||||
return $this->performConnect('primary');
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to a replica node of the database cluster.
|
||||
*
|
||||
* All following statements after this will be executed against the replica node,
|
||||
* unless the keepReplica option is set to false and a primary connection
|
||||
* was already opened.
|
||||
*/
|
||||
public function ensureConnectedToReplica(): bool
|
||||
{
|
||||
return $this->performConnect('replica');
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to a specific connection.
|
||||
*
|
||||
* @param string $connectionName
|
||||
*
|
||||
* @return DriverConnection
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function connectTo($connectionName)
|
||||
{
|
||||
$params = $this->getParams();
|
||||
|
||||
$connectionParams = $this->chooseConnectionConfiguration($connectionName, $params);
|
||||
|
||||
try {
|
||||
return $this->_driver->connect($connectionParams);
|
||||
} catch (DriverException $e) {
|
||||
throw $this->convertException($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $connectionName
|
||||
* @param mixed[] $params
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function chooseConnectionConfiguration(
|
||||
$connectionName,
|
||||
#[SensitiveParameter]
|
||||
$params
|
||||
) {
|
||||
if ($connectionName === 'primary') {
|
||||
return $params['primary'];
|
||||
}
|
||||
|
||||
$config = $params['replica'][array_rand($params['replica'])];
|
||||
|
||||
if (! isset($config['charset']) && isset($params['primary']['charset'])) {
|
||||
$config['charset'] = $params['primary']['charset'];
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function executeStatement($sql, array $params = [], array $types = [])
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
return parent::executeStatement($sql, $params, $types);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function beginTransaction()
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
return parent::beginTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
return parent::commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function rollBack()
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
return parent::rollBack();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
unset($this->connections['primary'], $this->connections['replica']);
|
||||
|
||||
parent::close();
|
||||
|
||||
$this->_conn = null;
|
||||
$this->connections = ['primary' => null, 'replica' => null];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function createSavepoint($savepoint)
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
parent::createSavepoint($savepoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function releaseSavepoint($savepoint)
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
parent::releaseSavepoint($savepoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function rollbackSavepoint($savepoint)
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
parent::rollbackSavepoint($savepoint);
|
||||
}
|
||||
|
||||
public function prepare(string $sql): Statement
|
||||
{
|
||||
$this->ensureConnectedToPrimary();
|
||||
|
||||
return parent::prepare($sql);
|
||||
}
|
||||
}
|
57
vendor/doctrine/dbal/src/Driver.php
vendored
Normal file
57
vendor/doctrine/dbal/src/Driver.php
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL;
|
||||
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter;
|
||||
use Doctrine\DBAL\Driver\Connection as DriverConnection;
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Schema\AbstractSchemaManager;
|
||||
use SensitiveParameter;
|
||||
|
||||
/**
|
||||
* Driver interface.
|
||||
* Interface that all DBAL drivers must implement.
|
||||
*
|
||||
* @psalm-import-type Params from DriverManager
|
||||
*/
|
||||
interface Driver
|
||||
{
|
||||
/**
|
||||
* Attempts to create a connection with the database.
|
||||
*
|
||||
* @param array<string, mixed> $params All connection parameters.
|
||||
* @psalm-param Params $params All connection parameters.
|
||||
*
|
||||
* @return DriverConnection The database connection.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function connect(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
);
|
||||
|
||||
/**
|
||||
* Gets the DatabasePlatform instance that provides all the metadata about
|
||||
* the platform this driver connects to.
|
||||
*
|
||||
* @return AbstractPlatform The database platform.
|
||||
*/
|
||||
public function getDatabasePlatform();
|
||||
|
||||
/**
|
||||
* Gets the SchemaManager that can be used to inspect and change the underlying
|
||||
* database schema of the platform this driver connects to.
|
||||
*
|
||||
* @deprecated Use {@link AbstractPlatform::createSchemaManager()} instead.
|
||||
*
|
||||
* @return AbstractSchemaManager
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform);
|
||||
|
||||
/**
|
||||
* Gets the ExceptionConverter that can be used to convert driver-level exceptions into DBAL exceptions.
|
||||
*/
|
||||
public function getExceptionConverter(): ExceptionConverter;
|
||||
}
|
25
vendor/doctrine/dbal/src/Driver/API/ExceptionConverter.php
vendored
Normal file
25
vendor/doctrine/dbal/src/Driver/API/ExceptionConverter.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API;
|
||||
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Query;
|
||||
|
||||
interface ExceptionConverter
|
||||
{
|
||||
/**
|
||||
* Converts a given driver-level exception into a DBAL-level driver exception.
|
||||
*
|
||||
* Implementors should use the vendor-specific error code and SQLSTATE of the exception
|
||||
* and instantiate the most appropriate specialized {@see DriverException} subclass.
|
||||
*
|
||||
* @param Exception $exception The driver exception to convert.
|
||||
* @param Query|null $query The SQL query that triggered the exception, if any.
|
||||
*
|
||||
* @return DriverException An instance of {@see DriverException} or one of its subclasses.
|
||||
*/
|
||||
public function convert(Exception $exception, ?Query $query): DriverException;
|
||||
}
|
65
vendor/doctrine/dbal/src/Driver/API/IBMDB2/ExceptionConverter.php
vendored
Normal file
65
vendor/doctrine/dbal/src/Driver/API/IBMDB2/ExceptionConverter.php
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API\IBMDB2;
|
||||
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Exception\ConnectionException;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\InvalidFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\SyntaxErrorException;
|
||||
use Doctrine\DBAL\Exception\TableExistsException;
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use Doctrine\DBAL\Query;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @link https://www.ibm.com/docs/en/db2/11.5?topic=messages-sql
|
||||
*/
|
||||
final class ExceptionConverter implements ExceptionConverterInterface
|
||||
{
|
||||
public function convert(Exception $exception, ?Query $query): DriverException
|
||||
{
|
||||
switch ($exception->getCode()) {
|
||||
case -104:
|
||||
return new SyntaxErrorException($exception, $query);
|
||||
|
||||
case -203:
|
||||
return new NonUniqueFieldNameException($exception, $query);
|
||||
|
||||
case -204:
|
||||
return new TableNotFoundException($exception, $query);
|
||||
|
||||
case -206:
|
||||
return new InvalidFieldNameException($exception, $query);
|
||||
|
||||
case -407:
|
||||
return new NotNullConstraintViolationException($exception, $query);
|
||||
|
||||
case -530:
|
||||
case -531:
|
||||
case -532:
|
||||
case -20356:
|
||||
return new ForeignKeyConstraintViolationException($exception, $query);
|
||||
|
||||
case -601:
|
||||
return new TableExistsException($exception, $query);
|
||||
|
||||
case -803:
|
||||
return new UniqueConstraintViolationException($exception, $query);
|
||||
|
||||
case -1336:
|
||||
case -30082:
|
||||
return new ConnectionException($exception, $query);
|
||||
}
|
||||
|
||||
return new DriverException($exception, $query);
|
||||
}
|
||||
}
|
120
vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php
vendored
Normal file
120
vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API\MySQL;
|
||||
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Exception\ConnectionException;
|
||||
use Doctrine\DBAL\Exception\ConnectionLost;
|
||||
use Doctrine\DBAL\Exception\DatabaseDoesNotExist;
|
||||
use Doctrine\DBAL\Exception\DeadlockException;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\InvalidFieldNameException;
|
||||
use Doctrine\DBAL\Exception\LockWaitTimeoutException;
|
||||
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\SyntaxErrorException;
|
||||
use Doctrine\DBAL\Exception\TableExistsException;
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use Doctrine\DBAL\Query;
|
||||
|
||||
/** @internal */
|
||||
final class ExceptionConverter implements ExceptionConverterInterface
|
||||
{
|
||||
/**
|
||||
* @link https://dev.mysql.com/doc/mysql-errors/8.0/en/client-error-reference.html
|
||||
* @link https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html
|
||||
*/
|
||||
public function convert(Exception $exception, ?Query $query): DriverException
|
||||
{
|
||||
switch ($exception->getCode()) {
|
||||
case 1008:
|
||||
return new DatabaseDoesNotExist($exception, $query);
|
||||
|
||||
case 1213:
|
||||
return new DeadlockException($exception, $query);
|
||||
|
||||
case 1205:
|
||||
return new LockWaitTimeoutException($exception, $query);
|
||||
|
||||
case 1050:
|
||||
return new TableExistsException($exception, $query);
|
||||
|
||||
case 1051:
|
||||
case 1146:
|
||||
return new TableNotFoundException($exception, $query);
|
||||
|
||||
case 1216:
|
||||
case 1217:
|
||||
case 1451:
|
||||
case 1452:
|
||||
case 1701:
|
||||
return new ForeignKeyConstraintViolationException($exception, $query);
|
||||
|
||||
case 1062:
|
||||
case 1557:
|
||||
case 1569:
|
||||
case 1586:
|
||||
return new UniqueConstraintViolationException($exception, $query);
|
||||
|
||||
case 1054:
|
||||
case 1166:
|
||||
case 1611:
|
||||
return new InvalidFieldNameException($exception, $query);
|
||||
|
||||
case 1052:
|
||||
case 1060:
|
||||
case 1110:
|
||||
return new NonUniqueFieldNameException($exception, $query);
|
||||
|
||||
case 1064:
|
||||
case 1149:
|
||||
case 1287:
|
||||
case 1341:
|
||||
case 1342:
|
||||
case 1343:
|
||||
case 1344:
|
||||
case 1382:
|
||||
case 1479:
|
||||
case 1541:
|
||||
case 1554:
|
||||
case 1626:
|
||||
return new SyntaxErrorException($exception, $query);
|
||||
|
||||
case 1044:
|
||||
case 1045:
|
||||
case 1046:
|
||||
case 1049:
|
||||
case 1095:
|
||||
case 1142:
|
||||
case 1143:
|
||||
case 1227:
|
||||
case 1370:
|
||||
case 1429:
|
||||
case 2002:
|
||||
case 2005:
|
||||
case 2054:
|
||||
return new ConnectionException($exception, $query);
|
||||
|
||||
case 2006:
|
||||
case 4031:
|
||||
return new ConnectionLost($exception, $query);
|
||||
|
||||
case 1048:
|
||||
case 1121:
|
||||
case 1138:
|
||||
case 1171:
|
||||
case 1252:
|
||||
case 1263:
|
||||
case 1364:
|
||||
case 1566:
|
||||
return new NotNullConstraintViolationException($exception, $query);
|
||||
}
|
||||
|
||||
return new DriverException($exception, $query);
|
||||
}
|
||||
}
|
74
vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php
vendored
Normal file
74
vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API\OCI;
|
||||
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Exception\ConnectionException;
|
||||
use Doctrine\DBAL\Exception\DatabaseDoesNotExist;
|
||||
use Doctrine\DBAL\Exception\DatabaseObjectNotFoundException;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\InvalidFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\SyntaxErrorException;
|
||||
use Doctrine\DBAL\Exception\TableExistsException;
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use Doctrine\DBAL\Query;
|
||||
|
||||
/** @internal */
|
||||
final class ExceptionConverter implements ExceptionConverterInterface
|
||||
{
|
||||
/** @link http://www.dba-oracle.com/t_error_code_list.htm */
|
||||
public function convert(Exception $exception, ?Query $query): DriverException
|
||||
{
|
||||
switch ($exception->getCode()) {
|
||||
case 1:
|
||||
case 2299:
|
||||
case 38911:
|
||||
return new UniqueConstraintViolationException($exception, $query);
|
||||
|
||||
case 904:
|
||||
return new InvalidFieldNameException($exception, $query);
|
||||
|
||||
case 918:
|
||||
case 960:
|
||||
return new NonUniqueFieldNameException($exception, $query);
|
||||
|
||||
case 923:
|
||||
return new SyntaxErrorException($exception, $query);
|
||||
|
||||
case 942:
|
||||
return new TableNotFoundException($exception, $query);
|
||||
|
||||
case 955:
|
||||
return new TableExistsException($exception, $query);
|
||||
|
||||
case 1017:
|
||||
case 12545:
|
||||
return new ConnectionException($exception, $query);
|
||||
|
||||
case 1400:
|
||||
return new NotNullConstraintViolationException($exception, $query);
|
||||
|
||||
case 1918:
|
||||
return new DatabaseDoesNotExist($exception, $query);
|
||||
|
||||
case 2289:
|
||||
case 2443:
|
||||
case 4080:
|
||||
return new DatabaseObjectNotFoundException($exception, $query);
|
||||
|
||||
case 2266:
|
||||
case 2291:
|
||||
case 2292:
|
||||
return new ForeignKeyConstraintViolationException($exception, $query);
|
||||
}
|
||||
|
||||
return new DriverException($exception, $query);
|
||||
}
|
||||
}
|
89
vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php
vendored
Normal file
89
vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API\PostgreSQL;
|
||||
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Exception\ConnectionException;
|
||||
use Doctrine\DBAL\Exception\DatabaseDoesNotExist;
|
||||
use Doctrine\DBAL\Exception\DeadlockException;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\InvalidFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\SchemaDoesNotExist;
|
||||
use Doctrine\DBAL\Exception\SyntaxErrorException;
|
||||
use Doctrine\DBAL\Exception\TableExistsException;
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use Doctrine\DBAL\Query;
|
||||
|
||||
use function strpos;
|
||||
|
||||
/** @internal */
|
||||
final class ExceptionConverter implements ExceptionConverterInterface
|
||||
{
|
||||
/** @link http://www.postgresql.org/docs/9.4/static/errcodes-appendix.html */
|
||||
public function convert(Exception $exception, ?Query $query): DriverException
|
||||
{
|
||||
switch ($exception->getSQLState()) {
|
||||
case '40001':
|
||||
case '40P01':
|
||||
return new DeadlockException($exception, $query);
|
||||
|
||||
case '0A000':
|
||||
// Foreign key constraint violations during a TRUNCATE operation
|
||||
// are considered "feature not supported" in PostgreSQL.
|
||||
if (strpos($exception->getMessage(), 'truncate') !== false) {
|
||||
return new ForeignKeyConstraintViolationException($exception, $query);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case '23502':
|
||||
return new NotNullConstraintViolationException($exception, $query);
|
||||
|
||||
case '23503':
|
||||
return new ForeignKeyConstraintViolationException($exception, $query);
|
||||
|
||||
case '23505':
|
||||
return new UniqueConstraintViolationException($exception, $query);
|
||||
|
||||
case '3D000':
|
||||
return new DatabaseDoesNotExist($exception, $query);
|
||||
|
||||
case '3F000':
|
||||
return new SchemaDoesNotExist($exception, $query);
|
||||
|
||||
case '42601':
|
||||
return new SyntaxErrorException($exception, $query);
|
||||
|
||||
case '42702':
|
||||
return new NonUniqueFieldNameException($exception, $query);
|
||||
|
||||
case '42703':
|
||||
return new InvalidFieldNameException($exception, $query);
|
||||
|
||||
case '42P01':
|
||||
return new TableNotFoundException($exception, $query);
|
||||
|
||||
case '42P07':
|
||||
return new TableExistsException($exception, $query);
|
||||
|
||||
case '08006':
|
||||
return new ConnectionException($exception, $query);
|
||||
}
|
||||
|
||||
// Prior to fixing https://bugs.php.net/bug.php?id=64705 (PHP 7.4.10),
|
||||
// in some cases (mainly connection errors) the PDO exception wouldn't provide a SQLSTATE via its code.
|
||||
// We have to match against the SQLSTATE in the error message in these cases.
|
||||
if ($exception->getCode() === 7 && strpos($exception->getMessage(), 'SQLSTATE[08006]') !== false) {
|
||||
return new ConnectionException($exception, $query);
|
||||
}
|
||||
|
||||
return new DriverException($exception, $query);
|
||||
}
|
||||
}
|
69
vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php
vendored
Normal file
69
vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API\SQLSrv;
|
||||
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Exception\ConnectionException;
|
||||
use Doctrine\DBAL\Exception\DatabaseObjectNotFoundException;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\InvalidFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\SyntaxErrorException;
|
||||
use Doctrine\DBAL\Exception\TableExistsException;
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use Doctrine\DBAL\Query;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @link https://docs.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors
|
||||
*/
|
||||
final class ExceptionConverter implements ExceptionConverterInterface
|
||||
{
|
||||
public function convert(Exception $exception, ?Query $query): DriverException
|
||||
{
|
||||
switch ($exception->getCode()) {
|
||||
case 102:
|
||||
return new SyntaxErrorException($exception, $query);
|
||||
|
||||
case 207:
|
||||
return new InvalidFieldNameException($exception, $query);
|
||||
|
||||
case 208:
|
||||
return new TableNotFoundException($exception, $query);
|
||||
|
||||
case 209:
|
||||
return new NonUniqueFieldNameException($exception, $query);
|
||||
|
||||
case 515:
|
||||
return new NotNullConstraintViolationException($exception, $query);
|
||||
|
||||
case 547:
|
||||
case 4712:
|
||||
return new ForeignKeyConstraintViolationException($exception, $query);
|
||||
|
||||
case 2601:
|
||||
case 2627:
|
||||
return new UniqueConstraintViolationException($exception, $query);
|
||||
|
||||
case 2714:
|
||||
return new TableExistsException($exception, $query);
|
||||
|
||||
case 3701:
|
||||
case 15151:
|
||||
return new DatabaseObjectNotFoundException($exception, $query);
|
||||
|
||||
case 11001:
|
||||
case 18456:
|
||||
return new ConnectionException($exception, $query);
|
||||
}
|
||||
|
||||
return new DriverException($exception, $query);
|
||||
}
|
||||
}
|
85
vendor/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php
vendored
Normal file
85
vendor/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API\SQLite;
|
||||
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Exception\ConnectionException;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\InvalidFieldNameException;
|
||||
use Doctrine\DBAL\Exception\LockWaitTimeoutException;
|
||||
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
|
||||
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
|
||||
use Doctrine\DBAL\Exception\ReadOnlyException;
|
||||
use Doctrine\DBAL\Exception\SyntaxErrorException;
|
||||
use Doctrine\DBAL\Exception\TableExistsException;
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use Doctrine\DBAL\Query;
|
||||
|
||||
use function strpos;
|
||||
|
||||
/** @internal */
|
||||
final class ExceptionConverter implements ExceptionConverterInterface
|
||||
{
|
||||
/** @link http://www.sqlite.org/c3ref/c_abort.html */
|
||||
public function convert(Exception $exception, ?Query $query): DriverException
|
||||
{
|
||||
if (strpos($exception->getMessage(), 'database is locked') !== false) {
|
||||
return new LockWaitTimeoutException($exception, $query);
|
||||
}
|
||||
|
||||
if (
|
||||
strpos($exception->getMessage(), 'must be unique') !== false ||
|
||||
strpos($exception->getMessage(), 'is not unique') !== false ||
|
||||
strpos($exception->getMessage(), 'are not unique') !== false ||
|
||||
strpos($exception->getMessage(), 'UNIQUE constraint failed') !== false
|
||||
) {
|
||||
return new UniqueConstraintViolationException($exception, $query);
|
||||
}
|
||||
|
||||
if (
|
||||
strpos($exception->getMessage(), 'may not be NULL') !== false ||
|
||||
strpos($exception->getMessage(), 'NOT NULL constraint failed') !== false
|
||||
) {
|
||||
return new NotNullConstraintViolationException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'no such table:') !== false) {
|
||||
return new TableNotFoundException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'already exists') !== false) {
|
||||
return new TableExistsException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'has no column named') !== false) {
|
||||
return new InvalidFieldNameException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'ambiguous column name') !== false) {
|
||||
return new NonUniqueFieldNameException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'syntax error') !== false) {
|
||||
return new SyntaxErrorException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'attempt to write a readonly database') !== false) {
|
||||
return new ReadOnlyException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'unable to open database file') !== false) {
|
||||
return new ConnectionException($exception, $query);
|
||||
}
|
||||
|
||||
if (strpos($exception->getMessage(), 'FOREIGN KEY constraint failed') !== false) {
|
||||
return new ForeignKeyConstraintViolationException($exception, $query);
|
||||
}
|
||||
|
||||
return new DriverException($exception, $query);
|
||||
}
|
||||
}
|
80
vendor/doctrine/dbal/src/Driver/API/SQLite/UserDefinedFunctions.php
vendored
Normal file
80
vendor/doctrine/dbal/src/Driver/API/SQLite/UserDefinedFunctions.php
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\API\SQLite;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function array_merge;
|
||||
use function strpos;
|
||||
|
||||
/**
|
||||
* User-defined SQLite functions.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class UserDefinedFunctions
|
||||
{
|
||||
private const DEFAULT_FUNCTIONS = [
|
||||
'sqrt' => ['callback' => [SqlitePlatform::class, 'udfSqrt'], 'numArgs' => 1],
|
||||
'mod' => ['callback' => [SqlitePlatform::class, 'udfMod'], 'numArgs' => 2],
|
||||
'locate' => ['callback' => [SqlitePlatform::class, 'udfLocate'], 'numArgs' => -1],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param callable(string, callable, int): bool $callback
|
||||
* @param array<string, array{callback: callable, numArgs: int}> $additionalFunctions
|
||||
*/
|
||||
public static function register(callable $callback, array $additionalFunctions = []): void
|
||||
{
|
||||
$userDefinedFunctions = array_merge(self::DEFAULT_FUNCTIONS, $additionalFunctions);
|
||||
|
||||
foreach ($userDefinedFunctions as $function => $data) {
|
||||
$callback($function, $data['callback'], $data['numArgs']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User-defined function that implements MOD().
|
||||
*
|
||||
* @param int $a
|
||||
* @param int $b
|
||||
*/
|
||||
public static function mod($a, $b): int
|
||||
{
|
||||
return $a % $b;
|
||||
}
|
||||
|
||||
/**
|
||||
* User-defined function that implements LOCATE().
|
||||
*
|
||||
* @param string $str
|
||||
* @param string $substr
|
||||
* @param int $offset
|
||||
*/
|
||||
public static function locate($str, $substr, $offset = 0): int
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5749',
|
||||
'Relying on DBAL\'s emulated LOCATE() function is deprecated. '
|
||||
. 'Use INSTR() or %s::getLocateExpression() instead.',
|
||||
AbstractPlatform::class,
|
||||
);
|
||||
|
||||
// SQL's LOCATE function works on 1-based positions, while PHP's strpos works on 0-based positions.
|
||||
// So we have to make them compatible if an offset is given.
|
||||
if ($offset > 0) {
|
||||
$offset -= 1;
|
||||
}
|
||||
|
||||
$pos = strpos($str, $substr, $offset);
|
||||
|
||||
if ($pos !== false) {
|
||||
return $pos + 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
100
vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php
vendored
Normal file
100
vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php
vendored
Normal file
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\API\IBMDB2\ExceptionConverter;
|
||||
use Doctrine\DBAL\Exception as DBALException;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\DB2111Platform;
|
||||
use Doctrine\DBAL\Platforms\DB2Platform;
|
||||
use Doctrine\DBAL\Schema\DB2SchemaManager;
|
||||
use Doctrine\DBAL\VersionAwarePlatformDriver;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function assert;
|
||||
use function preg_match;
|
||||
use function version_compare;
|
||||
|
||||
/**
|
||||
* Abstract base implementation of the {@see Driver} interface for IBM DB2 based drivers.
|
||||
*/
|
||||
abstract class AbstractDB2Driver implements VersionAwarePlatformDriver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return new DB2Platform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@link DB2Platform::createSchemaManager()} instead.
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5458',
|
||||
'AbstractDB2Driver::getSchemaManager() is deprecated.'
|
||||
. ' Use DB2Platform::createSchemaManager() instead.',
|
||||
);
|
||||
|
||||
assert($platform instanceof DB2Platform);
|
||||
|
||||
return new DB2SchemaManager($conn, $platform);
|
||||
}
|
||||
|
||||
public function getExceptionConverter(): ExceptionConverterInterface
|
||||
{
|
||||
return new ExceptionConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function createDatabasePlatformForVersion($version)
|
||||
{
|
||||
if (version_compare($this->getVersionNumber($version), '11.1', '>=')) {
|
||||
return new DB2111Platform();
|
||||
}
|
||||
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5156',
|
||||
'IBM DB2 < 11.1 support is deprecated and will be removed in DBAL 4.'
|
||||
. ' Consider upgrading to IBM DB2 11.1 or later.',
|
||||
);
|
||||
|
||||
return $this->getDatabasePlatform();
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects IBM DB2 server version
|
||||
*
|
||||
* @param string $versionString Version string as returned by IBM DB2 server, i.e. 'DB2/LINUXX8664 11.5.8.0'
|
||||
*
|
||||
* @throws DBALException
|
||||
*/
|
||||
private function getVersionNumber(string $versionString): string
|
||||
{
|
||||
if (
|
||||
preg_match(
|
||||
'/^(?:[^\s]+\s)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
|
||||
$versionString,
|
||||
$versionParts,
|
||||
) !== 1
|
||||
) {
|
||||
throw DBALException::invalidPlatformVersionSpecified(
|
||||
$versionString,
|
||||
'^(?:[^\s]+\s)?<major_version>.<minor_version>.<patch_version>',
|
||||
);
|
||||
}
|
||||
|
||||
return $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch'];
|
||||
}
|
||||
}
|
44
vendor/doctrine/dbal/src/Driver/AbstractException.php
vendored
Normal file
44
vendor/doctrine/dbal/src/Driver/AbstractException.php
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Exception as BaseException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Base implementation of the {@see Exception} interface.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
abstract class AbstractException extends BaseException implements Exception
|
||||
{
|
||||
/**
|
||||
* The SQLSTATE of the driver.
|
||||
*/
|
||||
private ?string $sqlState = null;
|
||||
|
||||
/**
|
||||
* @param string $message The driver error message.
|
||||
* @param string|null $sqlState The SQLSTATE the driver is in at the time the error occurred, if any.
|
||||
* @param int $code The driver specific error code if any.
|
||||
* @param Throwable|null $previous The previous throwable used for the exception chaining.
|
||||
*/
|
||||
public function __construct($message, $sqlState = null, $code = 0, ?Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
$this->sqlState = $sqlState;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getSQLState()
|
||||
{
|
||||
return $this->sqlState;
|
||||
}
|
||||
}
|
231
vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php
vendored
Normal file
231
vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php
vendored
Normal file
|
@ -0,0 +1,231 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter;
|
||||
use Doctrine\DBAL\Driver\API\MySQL;
|
||||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1010Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1043Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1052Platform;
|
||||
use Doctrine\DBAL\Platforms\MariaDb1060Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL57Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL80Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQL84Platform;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\MySQLSchemaManager;
|
||||
use Doctrine\DBAL\VersionAwarePlatformDriver;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function assert;
|
||||
use function preg_match;
|
||||
use function stripos;
|
||||
use function version_compare;
|
||||
|
||||
/**
|
||||
* Abstract base implementation of the {@see Driver} interface for MySQL based drivers.
|
||||
*/
|
||||
abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function createDatabasePlatformForVersion($version)
|
||||
{
|
||||
$mariadb = stripos($version, 'mariadb') !== false;
|
||||
|
||||
if ($mariadb) {
|
||||
$mariaDbVersion = $this->getMariaDbMysqlVersionNumber($version);
|
||||
if (version_compare($mariaDbVersion, '10.10.0', '>=')) {
|
||||
return new MariaDb1010Platform();
|
||||
}
|
||||
|
||||
if (version_compare($mariaDbVersion, '10.6.0', '>=')) {
|
||||
return new MariaDb1060Platform();
|
||||
}
|
||||
|
||||
if (version_compare($mariaDbVersion, '10.5.2', '>=')) {
|
||||
return new MariaDb1052Platform();
|
||||
}
|
||||
|
||||
if (version_compare($mariaDbVersion, '10.4.3', '>=')) {
|
||||
return new MariaDb1043Platform();
|
||||
}
|
||||
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/6110',
|
||||
'Support for MariaDB < 10.4 is deprecated and will be removed in DBAL 4.'
|
||||
. ' Consider upgrading to a more recent version of MariaDB.',
|
||||
);
|
||||
|
||||
if (version_compare($mariaDbVersion, '10.2.7', '>=')) {
|
||||
return new MariaDb1027Platform();
|
||||
}
|
||||
} else {
|
||||
$oracleMysqlVersion = $this->getOracleMysqlVersionNumber($version);
|
||||
|
||||
if (version_compare($oracleMysqlVersion, '8.4.0', '>=')) {
|
||||
if (! version_compare($version, '8.4.0', '>=')) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/orm',
|
||||
'https://github.com/doctrine/dbal/pull/5779',
|
||||
'Version detection logic for MySQL will change in DBAL 4. '
|
||||
. 'Please specify the version as the server reports it, e.g. "8.4.0" instead of "8.4".',
|
||||
);
|
||||
}
|
||||
|
||||
return new MySQL84Platform();
|
||||
}
|
||||
|
||||
if (version_compare($oracleMysqlVersion, '8', '>=')) {
|
||||
if (! version_compare($version, '8.0.0', '>=')) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/orm',
|
||||
'https://github.com/doctrine/dbal/pull/5779',
|
||||
'Version detection logic for MySQL will change in DBAL 4. '
|
||||
. 'Please specify the version as the server reports it, e.g. "8.0.31" instead of "8".',
|
||||
);
|
||||
}
|
||||
|
||||
return new MySQL80Platform();
|
||||
}
|
||||
|
||||
if (version_compare($oracleMysqlVersion, '5.7.9', '>=')) {
|
||||
if (! version_compare($version, '5.7.9', '>=')) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/orm',
|
||||
'https://github.com/doctrine/dbal/pull/5779',
|
||||
'Version detection logic for MySQL will change in DBAL 4. '
|
||||
. 'Please specify the version as the server reports it, e.g. "5.7.40" instead of "5.7".',
|
||||
);
|
||||
}
|
||||
|
||||
return new MySQL57Platform();
|
||||
}
|
||||
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5072',
|
||||
'MySQL 5.6 support is deprecated and will be removed in DBAL 4.'
|
||||
. ' Consider upgrading to MySQL 5.7 or later.',
|
||||
);
|
||||
}
|
||||
|
||||
return $this->getDatabasePlatform();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a normalized 'version number' from the server string
|
||||
* returned by Oracle MySQL servers.
|
||||
*
|
||||
* @param string $versionString Version string returned by the driver, i.e. '5.7.10'
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function getOracleMysqlVersionNumber(string $versionString): string
|
||||
{
|
||||
if (
|
||||
preg_match(
|
||||
'/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/',
|
||||
$versionString,
|
||||
$versionParts,
|
||||
) !== 1
|
||||
) {
|
||||
throw Exception::invalidPlatformVersionSpecified(
|
||||
$versionString,
|
||||
'<major_version>.<minor_version>.<patch_version>',
|
||||
);
|
||||
}
|
||||
|
||||
$majorVersion = $versionParts['major'];
|
||||
$minorVersion = $versionParts['minor'] ?? 0;
|
||||
$patchVersion = $versionParts['patch'] ?? null;
|
||||
|
||||
if ($majorVersion === '5' && $minorVersion === '7') {
|
||||
$patchVersion ??= '9';
|
||||
} else {
|
||||
$patchVersion ??= '0';
|
||||
}
|
||||
|
||||
return $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect MariaDB server version, including hack for some mariadb distributions
|
||||
* that starts with the prefix '5.5.5-'
|
||||
*
|
||||
* @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial'
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function getMariaDbMysqlVersionNumber(string $versionString): string
|
||||
{
|
||||
if (stripos($versionString, 'MariaDB') === 0) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/orm',
|
||||
'https://github.com/doctrine/dbal/pull/5779',
|
||||
'Version detection logic for MySQL will change in DBAL 4. '
|
||||
. 'Please specify the version as the server reports it, '
|
||||
. 'e.g. "10.9.3-MariaDB" instead of "mariadb-10.9".',
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
preg_match(
|
||||
'/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
|
||||
$versionString,
|
||||
$versionParts,
|
||||
) !== 1
|
||||
) {
|
||||
throw Exception::invalidPlatformVersionSpecified(
|
||||
$versionString,
|
||||
'^(?:5\.5\.5-)?(mariadb-)?<major_version>.<minor_version>.<patch_version>',
|
||||
);
|
||||
}
|
||||
|
||||
return $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return AbstractMySQLPlatform
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return new MySQLPlatform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@link AbstractMySQLPlatform::createSchemaManager()} instead.
|
||||
*
|
||||
* @return MySQLSchemaManager
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5458',
|
||||
'AbstractMySQLDriver::getSchemaManager() is deprecated.'
|
||||
. ' Use MySQLPlatform::createSchemaManager() instead.',
|
||||
);
|
||||
|
||||
assert($platform instanceof AbstractMySQLPlatform);
|
||||
|
||||
return new MySQLSchemaManager($conn, $platform);
|
||||
}
|
||||
|
||||
public function getExceptionConverter(): ExceptionConverter
|
||||
{
|
||||
return new MySQL\ExceptionConverter();
|
||||
}
|
||||
}
|
65
vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php
vendored
Normal file
65
vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Driver\AbstractOracleDriver\EasyConnectString;
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter;
|
||||
use Doctrine\DBAL\Driver\API\OCI;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Schema\OracleSchemaManager;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function assert;
|
||||
|
||||
/**
|
||||
* Abstract base implementation of the {@see Driver} interface for Oracle based drivers.
|
||||
*/
|
||||
abstract class AbstractOracleDriver implements Driver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return new OraclePlatform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@link OraclePlatform::createSchemaManager()} instead.
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5458',
|
||||
'AbstractOracleDriver::getSchemaManager() is deprecated.'
|
||||
. ' Use OraclePlatform::createSchemaManager() instead.',
|
||||
);
|
||||
|
||||
assert($platform instanceof OraclePlatform);
|
||||
|
||||
return new OracleSchemaManager($conn, $platform);
|
||||
}
|
||||
|
||||
public function getExceptionConverter(): ExceptionConverter
|
||||
{
|
||||
return new OCI\ExceptionConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an appropriate Easy Connect String for the given parameters.
|
||||
*
|
||||
* @param array<string, mixed> $params The connection parameters to return the Easy Connect String for.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getEasyConnectString(array $params)
|
||||
{
|
||||
return (string) EasyConnectString::fromConnectionParameters($params);
|
||||
}
|
||||
}
|
116
vendor/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php
vendored
Normal file
116
vendor/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php
vendored
Normal file
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\AbstractOracleDriver;
|
||||
|
||||
use function implode;
|
||||
use function is_array;
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* Represents an Oracle Easy Connect string
|
||||
*
|
||||
* @link https://docs.oracle.com/database/121/NETAG/naming.htm
|
||||
*/
|
||||
final class EasyConnectString
|
||||
{
|
||||
private string $string;
|
||||
|
||||
private function __construct(string $string)
|
||||
{
|
||||
$this->string = $string;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the object from an array representation
|
||||
*
|
||||
* @param mixed[] $params
|
||||
*/
|
||||
public static function fromArray(array $params): self
|
||||
{
|
||||
return new self(self::renderParams($params));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the object from the given DBAL connection parameters.
|
||||
*
|
||||
* @param mixed[] $params
|
||||
*/
|
||||
public static function fromConnectionParameters(array $params): self
|
||||
{
|
||||
if (isset($params['connectstring'])) {
|
||||
return new self($params['connectstring']);
|
||||
}
|
||||
|
||||
if (! isset($params['host'])) {
|
||||
return new self($params['dbname'] ?? '');
|
||||
}
|
||||
|
||||
$connectData = [];
|
||||
|
||||
if (isset($params['servicename']) || isset($params['dbname'])) {
|
||||
$serviceKey = 'SID';
|
||||
|
||||
if (isset($params['service'])) {
|
||||
$serviceKey = 'SERVICE_NAME';
|
||||
}
|
||||
|
||||
$serviceName = $params['servicename'] ?? $params['dbname'];
|
||||
|
||||
$connectData[$serviceKey] = $serviceName;
|
||||
}
|
||||
|
||||
if (isset($params['instancename'])) {
|
||||
$connectData['INSTANCE_NAME'] = $params['instancename'];
|
||||
}
|
||||
|
||||
if (! empty($params['pooled'])) {
|
||||
$connectData['SERVER'] = 'POOLED';
|
||||
}
|
||||
|
||||
return self::fromArray([
|
||||
'DESCRIPTION' => [
|
||||
'ADDRESS' => [
|
||||
'PROTOCOL' => 'TCP',
|
||||
'HOST' => $params['host'],
|
||||
'PORT' => $params['port'] ?? 1521,
|
||||
],
|
||||
'CONNECT_DATA' => $connectData,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/** @param mixed[] $params */
|
||||
private static function renderParams(array $params): string
|
||||
{
|
||||
$chunks = [];
|
||||
|
||||
foreach ($params as $key => $value) {
|
||||
$string = self::renderValue($value);
|
||||
|
||||
if ($string === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$chunks[] = sprintf('(%s=%s)', $key, $string);
|
||||
}
|
||||
|
||||
return implode('', $chunks);
|
||||
}
|
||||
|
||||
/** @param mixed $value */
|
||||
private static function renderValue($value): string
|
||||
{
|
||||
if (is_array($value)) {
|
||||
return self::renderParams($value);
|
||||
}
|
||||
|
||||
return (string) $value;
|
||||
}
|
||||
}
|
93
vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php
vendored
Normal file
93
vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter;
|
||||
use Doctrine\DBAL\Driver\API\PostgreSQL;
|
||||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL120Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Schema\PostgreSQLSchemaManager;
|
||||
use Doctrine\DBAL\VersionAwarePlatformDriver;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function assert;
|
||||
use function preg_match;
|
||||
use function version_compare;
|
||||
|
||||
/**
|
||||
* Abstract base implementation of the {@see Driver} interface for PostgreSQL based drivers.
|
||||
*/
|
||||
abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function createDatabasePlatformForVersion($version)
|
||||
{
|
||||
if (preg_match('/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $version, $versionParts) !== 1) {
|
||||
throw Exception::invalidPlatformVersionSpecified(
|
||||
$version,
|
||||
'<major_version>.<minor_version>.<patch_version>',
|
||||
);
|
||||
}
|
||||
|
||||
$majorVersion = $versionParts['major'];
|
||||
$minorVersion = $versionParts['minor'] ?? 0;
|
||||
$patchVersion = $versionParts['patch'] ?? 0;
|
||||
$version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
|
||||
|
||||
if (version_compare($version, '12.0', '>=')) {
|
||||
return new PostgreSQL120Platform();
|
||||
}
|
||||
|
||||
if (version_compare($version, '10.0', '>=')) {
|
||||
return new PostgreSQL100Platform();
|
||||
}
|
||||
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5060',
|
||||
'PostgreSQL 9 support is deprecated and will be removed in DBAL 4.'
|
||||
. ' Consider upgrading to Postgres 10 or later.',
|
||||
);
|
||||
|
||||
return new PostgreSQL94Platform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return new PostgreSQL94Platform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@link PostgreSQLPlatform::createSchemaManager()} instead.
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5458',
|
||||
'AbstractPostgreSQLDriver::getSchemaManager() is deprecated.'
|
||||
. ' Use PostgreSQLPlatform::createSchemaManager() instead.',
|
||||
);
|
||||
|
||||
assert($platform instanceof PostgreSQLPlatform);
|
||||
|
||||
return new PostgreSQLSchemaManager($conn, $platform);
|
||||
}
|
||||
|
||||
public function getExceptionConverter(): ExceptionConverter
|
||||
{
|
||||
return new PostgreSQL\ExceptionConverter();
|
||||
}
|
||||
}
|
53
vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php
vendored
Normal file
53
vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
||||
use Doctrine\DBAL\Driver\API\SQLSrv\ExceptionConverter;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
|
||||
use Doctrine\DBAL\Platforms\SQLServerPlatform;
|
||||
use Doctrine\DBAL\Schema\SQLServerSchemaManager;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function assert;
|
||||
|
||||
/**
|
||||
* Abstract base implementation of the {@see Driver} interface for Microsoft SQL Server based drivers.
|
||||
*/
|
||||
abstract class AbstractSQLServerDriver implements Driver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return new SQLServer2012Platform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@link SQLServerPlatform::createSchemaManager()} instead.
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5458',
|
||||
'AbstractSQLServerDriver::getSchemaManager() is deprecated.'
|
||||
. ' Use SQLServerPlatform::createSchemaManager() instead.',
|
||||
);
|
||||
|
||||
assert($platform instanceof SQLServerPlatform);
|
||||
|
||||
return new SQLServerSchemaManager($conn, $platform);
|
||||
}
|
||||
|
||||
public function getExceptionConverter(): ExceptionConverterInterface
|
||||
{
|
||||
return new ExceptionConverter();
|
||||
}
|
||||
}
|
20
vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver/Exception/PortWithoutHost.php
vendored
Normal file
20
vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver/Exception/PortWithoutHost.php
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\AbstractSQLServerDriver\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class PortWithoutHost extends AbstractException
|
||||
{
|
||||
public static function new(): self
|
||||
{
|
||||
return new self('Connection port specified without the host');
|
||||
}
|
||||
}
|
52
vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php
vendored
Normal file
52
vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver.php
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter;
|
||||
use Doctrine\DBAL\Driver\API\SQLite;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\SqliteSchemaManager;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function assert;
|
||||
|
||||
/**
|
||||
* Abstract base implementation of the {@see Doctrine\DBAL\Driver} interface for SQLite based drivers.
|
||||
*/
|
||||
abstract class AbstractSQLiteDriver implements Driver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return new SqlitePlatform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@link SqlitePlatform::createSchemaManager()} instead.
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5458',
|
||||
'AbstractSQLiteDriver::getSchemaManager() is deprecated.'
|
||||
. ' Use SqlitePlatform::createSchemaManager() instead.',
|
||||
);
|
||||
|
||||
assert($platform instanceof SqlitePlatform);
|
||||
|
||||
return new SqliteSchemaManager($conn, $platform);
|
||||
}
|
||||
|
||||
public function getExceptionConverter(): ExceptionConverter
|
||||
{
|
||||
return new SQLite\ExceptionConverter();
|
||||
}
|
||||
}
|
31
vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver/Middleware/EnableForeignKeys.php
vendored
Normal file
31
vendor/doctrine/dbal/src/Driver/AbstractSQLiteDriver/Middleware/EnableForeignKeys.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\AbstractSQLiteDriver\Middleware;
|
||||
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Driver\Connection;
|
||||
use Doctrine\DBAL\Driver\Middleware;
|
||||
use Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware;
|
||||
use SensitiveParameter;
|
||||
|
||||
class EnableForeignKeys implements Middleware
|
||||
{
|
||||
public function wrap(Driver $driver): Driver
|
||||
{
|
||||
return new class ($driver) extends AbstractDriverMiddleware {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function connect(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
): Connection {
|
||||
$connection = parent::connect($params);
|
||||
|
||||
$connection->exec('PRAGMA foreign_keys=ON');
|
||||
|
||||
return $connection;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
86
vendor/doctrine/dbal/src/Driver/Connection.php
vendored
Normal file
86
vendor/doctrine/dbal/src/Driver/Connection.php
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
|
||||
/**
|
||||
* Connection interface.
|
||||
* Driver connections must implement this interface.
|
||||
*
|
||||
* @method resource|object getNativeConnection()
|
||||
*/
|
||||
interface Connection
|
||||
{
|
||||
/**
|
||||
* Prepares a statement for execution and returns a Statement object.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function prepare(string $sql): Statement;
|
||||
|
||||
/**
|
||||
* Executes an SQL statement, returning a result set as a Statement object.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function query(string $sql): Result;
|
||||
|
||||
/**
|
||||
* Quotes a string for use in a query.
|
||||
*
|
||||
* The usage of this method is discouraged. Use prepared statements
|
||||
* or {@see AbstractPlatform::quoteStringLiteral()} instead.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param int $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function quote($value, $type = ParameterType::STRING);
|
||||
|
||||
/**
|
||||
* Executes an SQL statement and return the number of affected rows.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function exec(string $sql): int;
|
||||
|
||||
/**
|
||||
* Returns the ID of the last inserted row or sequence value.
|
||||
*
|
||||
* @param string|null $name
|
||||
*
|
||||
* @return string|int|false
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function lastInsertId($name = null);
|
||||
|
||||
/**
|
||||
* Initiates a transaction.
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function beginTransaction();
|
||||
|
||||
/**
|
||||
* Commits a transaction.
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function commit();
|
||||
|
||||
/**
|
||||
* Rolls back the current transaction, as initiated by beginTransaction().
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function rollBack();
|
||||
}
|
20
vendor/doctrine/dbal/src/Driver/Exception.php
vendored
Normal file
20
vendor/doctrine/dbal/src/Driver/Exception.php
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/** @psalm-immutable */
|
||||
interface Exception extends Throwable
|
||||
{
|
||||
/**
|
||||
* Returns the SQLSTATE the driver was in at the time the error occurred.
|
||||
*
|
||||
* Returns null if the driver does not provide a SQLSTATE for the error occurred.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSQLState();
|
||||
}
|
23
vendor/doctrine/dbal/src/Driver/Exception/UnknownParameterType.php
vendored
Normal file
23
vendor/doctrine/dbal/src/Driver/Exception/UnknownParameterType.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class UnknownParameterType extends AbstractException
|
||||
{
|
||||
/** @param mixed $type */
|
||||
public static function new($type): self
|
||||
{
|
||||
return new self(sprintf('Unknown parameter type, %d given.', $type));
|
||||
}
|
||||
}
|
73
vendor/doctrine/dbal/src/Driver/FetchUtils.php
vendored
Normal file
73
vendor/doctrine/dbal/src/Driver/FetchUtils.php
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
/** @internal */
|
||||
final class FetchUtils
|
||||
{
|
||||
/**
|
||||
* @return mixed|false
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function fetchOne(Result $result)
|
||||
{
|
||||
$row = $result->fetchNumeric();
|
||||
|
||||
if ($row === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $row[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<list<mixed>>
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function fetchAllNumeric(Result $result): array
|
||||
{
|
||||
$rows = [];
|
||||
|
||||
while (($row = $result->fetchNumeric()) !== false) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array<string,mixed>>
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function fetchAllAssociative(Result $result): array
|
||||
{
|
||||
$rows = [];
|
||||
|
||||
while (($row = $result->fetchAssociative()) !== false) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<mixed>
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function fetchFirstColumn(Result $result): array
|
||||
{
|
||||
$rows = [];
|
||||
|
||||
while (($row = $result->fetchOne()) !== false) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
}
|
141
vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php
vendored
Normal file
141
vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php
vendored
Normal file
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2;
|
||||
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\ConnectionError;
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\PrepareFailed;
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError;
|
||||
use Doctrine\DBAL\Driver\Result as ResultInterface;
|
||||
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
|
||||
use Doctrine\DBAL\Driver\Statement as DriverStatement;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use stdClass;
|
||||
|
||||
use function assert;
|
||||
use function db2_autocommit;
|
||||
use function db2_commit;
|
||||
use function db2_escape_string;
|
||||
use function db2_exec;
|
||||
use function db2_last_insert_id;
|
||||
use function db2_num_rows;
|
||||
use function db2_prepare;
|
||||
use function db2_rollback;
|
||||
use function db2_server_info;
|
||||
use function error_get_last;
|
||||
|
||||
use const DB2_AUTOCOMMIT_OFF;
|
||||
use const DB2_AUTOCOMMIT_ON;
|
||||
|
||||
final class Connection implements ServerInfoAwareConnection
|
||||
{
|
||||
/** @var resource */
|
||||
private $connection;
|
||||
|
||||
/**
|
||||
* @internal The connection can be only instantiated by its driver.
|
||||
*
|
||||
* @param resource $connection
|
||||
*/
|
||||
public function __construct($connection)
|
||||
{
|
||||
$this->connection = $connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getServerVersion()
|
||||
{
|
||||
$serverInfo = db2_server_info($this->connection);
|
||||
assert($serverInfo instanceof stdClass);
|
||||
|
||||
return $serverInfo->DBMS_VER;
|
||||
}
|
||||
|
||||
public function prepare(string $sql): DriverStatement
|
||||
{
|
||||
$stmt = @db2_prepare($this->connection, $sql);
|
||||
|
||||
if ($stmt === false) {
|
||||
throw PrepareFailed::new(error_get_last());
|
||||
}
|
||||
|
||||
return new Statement($stmt);
|
||||
}
|
||||
|
||||
public function query(string $sql): ResultInterface
|
||||
{
|
||||
return $this->prepare($sql)->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function quote($value, $type = ParameterType::STRING)
|
||||
{
|
||||
$value = db2_escape_string($value);
|
||||
|
||||
if ($type === ParameterType::INTEGER) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return "'" . $value . "'";
|
||||
}
|
||||
|
||||
public function exec(string $sql): int
|
||||
{
|
||||
$stmt = @db2_exec($this->connection, $sql);
|
||||
|
||||
if ($stmt === false) {
|
||||
throw StatementError::new();
|
||||
}
|
||||
|
||||
return db2_num_rows($stmt);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function lastInsertId($name = null)
|
||||
{
|
||||
if ($name !== null) {
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/issues/4687',
|
||||
'The usage of Connection::lastInsertId() with a sequence name is deprecated.',
|
||||
);
|
||||
}
|
||||
|
||||
return db2_last_insert_id($this->connection) ?? false;
|
||||
}
|
||||
|
||||
public function beginTransaction(): bool
|
||||
{
|
||||
return db2_autocommit($this->connection, DB2_AUTOCOMMIT_OFF);
|
||||
}
|
||||
|
||||
public function commit(): bool
|
||||
{
|
||||
if (! db2_commit($this->connection)) {
|
||||
throw ConnectionError::new($this->connection);
|
||||
}
|
||||
|
||||
return db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON);
|
||||
}
|
||||
|
||||
public function rollBack(): bool
|
||||
{
|
||||
if (! db2_rollback($this->connection)) {
|
||||
throw ConnectionError::new($this->connection);
|
||||
}
|
||||
|
||||
return db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON);
|
||||
}
|
||||
|
||||
/** @return resource */
|
||||
public function getNativeConnection()
|
||||
{
|
||||
return $this->connection;
|
||||
}
|
||||
}
|
84
vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php
vendored
Normal file
84
vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2;
|
||||
|
||||
use SensitiveParameter;
|
||||
|
||||
use function implode;
|
||||
use function sprintf;
|
||||
use function strpos;
|
||||
|
||||
/**
|
||||
* IBM DB2 DSN
|
||||
*/
|
||||
final class DataSourceName
|
||||
{
|
||||
private string $string;
|
||||
|
||||
private function __construct(
|
||||
#[SensitiveParameter]
|
||||
string $string
|
||||
) {
|
||||
$this->string = $string;
|
||||
}
|
||||
|
||||
public function toString(): string
|
||||
{
|
||||
return $this->string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the object from an array representation
|
||||
*
|
||||
* @param array<string,mixed> $params
|
||||
*/
|
||||
public static function fromArray(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
): self {
|
||||
$chunks = [];
|
||||
|
||||
foreach ($params as $key => $value) {
|
||||
$chunks[] = sprintf('%s=%s', $key, $value);
|
||||
}
|
||||
|
||||
return new self(implode(';', $chunks));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the object from the given DBAL connection parameters.
|
||||
*
|
||||
* @param array<string,mixed> $params
|
||||
*/
|
||||
public static function fromConnectionParameters(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
): self {
|
||||
if (isset($params['dbname']) && strpos($params['dbname'], '=') !== false) {
|
||||
return new self($params['dbname']);
|
||||
}
|
||||
|
||||
$dsnParams = [];
|
||||
|
||||
foreach (
|
||||
[
|
||||
'host' => 'HOSTNAME',
|
||||
'port' => 'PORT',
|
||||
'protocol' => 'PROTOCOL',
|
||||
'dbname' => 'DATABASE',
|
||||
'user' => 'UID',
|
||||
'password' => 'PWD',
|
||||
] as $dbalParam => $dsnParam
|
||||
) {
|
||||
if (! isset($params[$dbalParam])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$dsnParams[$dsnParam] = $params[$dbalParam];
|
||||
}
|
||||
|
||||
return self::fromArray($dsnParams);
|
||||
}
|
||||
}
|
41
vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php
vendored
Normal file
41
vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractDB2Driver;
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\ConnectionFailed;
|
||||
use SensitiveParameter;
|
||||
|
||||
use function db2_connect;
|
||||
use function db2_pconnect;
|
||||
|
||||
final class Driver extends AbstractDB2Driver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return Connection
|
||||
*/
|
||||
public function connect(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
) {
|
||||
$dataSourceName = DataSourceName::fromConnectionParameters($params)->toString();
|
||||
|
||||
$username = $params['user'] ?? '';
|
||||
$password = $params['password'] ?? '';
|
||||
$driverOptions = $params['driverOptions'] ?? [];
|
||||
|
||||
if (! empty($params['persistent'])) {
|
||||
$connection = db2_pconnect($dataSourceName, $username, $password, $driverOptions);
|
||||
} else {
|
||||
$connection = db2_connect($dataSourceName, $username, $password, $driverOptions);
|
||||
}
|
||||
|
||||
if ($connection === false) {
|
||||
throw ConnectionFailed::new();
|
||||
}
|
||||
|
||||
return new Connection($connection);
|
||||
}
|
||||
}
|
27
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php
vendored
Normal file
27
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class CannotCopyStreamToStream extends AbstractException
|
||||
{
|
||||
/** @psalm-param array{message: string}|null $error */
|
||||
public static function new(?array $error): self
|
||||
{
|
||||
$message = 'Could not copy source stream to temporary file';
|
||||
|
||||
if ($error !== null) {
|
||||
$message .= ': ' . $error['message'];
|
||||
}
|
||||
|
||||
return new self($message);
|
||||
}
|
||||
}
|
27
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php
vendored
Normal file
27
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class CannotCreateTemporaryFile extends AbstractException
|
||||
{
|
||||
/** @psalm-param array{message: string}|null $error */
|
||||
public static function new(?array $error): self
|
||||
{
|
||||
$message = 'Could not create temporary file';
|
||||
|
||||
if ($error !== null) {
|
||||
$message .= ': ' . $error['message'];
|
||||
}
|
||||
|
||||
return new self($message);
|
||||
}
|
||||
}
|
29
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionError.php
vendored
Normal file
29
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionError.php
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function db2_conn_error;
|
||||
use function db2_conn_errormsg;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class ConnectionError extends AbstractException
|
||||
{
|
||||
/** @param resource $connection */
|
||||
public static function new($connection): self
|
||||
{
|
||||
$message = db2_conn_errormsg($connection);
|
||||
$sqlState = db2_conn_error($connection);
|
||||
|
||||
return Factory::create($message, static function (int $code) use ($message, $sqlState): self {
|
||||
return new self($message, $sqlState, $code);
|
||||
});
|
||||
}
|
||||
}
|
28
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionFailed.php
vendored
Normal file
28
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionFailed.php
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function db2_conn_error;
|
||||
use function db2_conn_errormsg;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class ConnectionFailed extends AbstractException
|
||||
{
|
||||
public static function new(): self
|
||||
{
|
||||
$message = db2_conn_errormsg();
|
||||
$sqlState = db2_conn_error();
|
||||
|
||||
return Factory::create($message, static function (int $code) use ($message, $sqlState): self {
|
||||
return new self($message, $sqlState, $code);
|
||||
});
|
||||
}
|
||||
}
|
35
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/Factory.php
vendored
Normal file
35
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/Factory.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function preg_match;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class Factory
|
||||
{
|
||||
/**
|
||||
* @param callable(int): T $constructor
|
||||
*
|
||||
* @return T
|
||||
*
|
||||
* @template T of AbstractException
|
||||
*/
|
||||
public static function create(string $message, callable $constructor): AbstractException
|
||||
{
|
||||
$code = 0;
|
||||
|
||||
if (preg_match('/ SQL(\d+)N /', $message, $matches) === 1) {
|
||||
$code = -(int) $matches[1];
|
||||
}
|
||||
|
||||
return $constructor($code);
|
||||
}
|
||||
}
|
25
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/PrepareFailed.php
vendored
Normal file
25
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/PrepareFailed.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class PrepareFailed extends AbstractException
|
||||
{
|
||||
/** @psalm-param array{message: string}|null $error */
|
||||
public static function new(?array $error): self
|
||||
{
|
||||
if ($error === null) {
|
||||
return new self('Unknown error');
|
||||
}
|
||||
|
||||
return new self($error['message']);
|
||||
}
|
||||
}
|
34
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/StatementError.php
vendored
Normal file
34
vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/StatementError.php
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function db2_stmt_error;
|
||||
use function db2_stmt_errormsg;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class StatementError extends AbstractException
|
||||
{
|
||||
/** @param resource|null $statement */
|
||||
public static function new($statement = null): self
|
||||
{
|
||||
if ($statement !== null) {
|
||||
$message = db2_stmt_errormsg($statement);
|
||||
$sqlState = db2_stmt_error($statement);
|
||||
} else {
|
||||
$message = db2_stmt_errormsg();
|
||||
$sqlState = db2_stmt_error();
|
||||
}
|
||||
|
||||
return Factory::create($message, static function (int $code) use ($message, $sqlState): self {
|
||||
return new self($message, $sqlState, $code);
|
||||
});
|
||||
}
|
||||
}
|
113
vendor/doctrine/dbal/src/Driver/IBMDB2/Result.php
vendored
Normal file
113
vendor/doctrine/dbal/src/Driver/IBMDB2/Result.php
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2;
|
||||
|
||||
use Doctrine\DBAL\Driver\FetchUtils;
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError;
|
||||
use Doctrine\DBAL\Driver\Result as ResultInterface;
|
||||
|
||||
use function db2_fetch_array;
|
||||
use function db2_fetch_assoc;
|
||||
use function db2_free_result;
|
||||
use function db2_num_fields;
|
||||
use function db2_num_rows;
|
||||
use function db2_stmt_error;
|
||||
|
||||
final class Result implements ResultInterface
|
||||
{
|
||||
/** @var resource */
|
||||
private $statement;
|
||||
|
||||
/**
|
||||
* @internal The result can be only instantiated by its driver connection or statement.
|
||||
*
|
||||
* @param resource $statement
|
||||
*/
|
||||
public function __construct($statement)
|
||||
{
|
||||
$this->statement = $statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchNumeric()
|
||||
{
|
||||
$row = @db2_fetch_array($this->statement);
|
||||
|
||||
if ($row === false && db2_stmt_error($this->statement) !== '02000') {
|
||||
throw StatementError::new($this->statement);
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAssociative()
|
||||
{
|
||||
$row = @db2_fetch_assoc($this->statement);
|
||||
|
||||
if ($row === false && db2_stmt_error($this->statement) !== '02000') {
|
||||
throw StatementError::new($this->statement);
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchOne()
|
||||
{
|
||||
return FetchUtils::fetchOne($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAllNumeric(): array
|
||||
{
|
||||
return FetchUtils::fetchAllNumeric($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAllAssociative(): array
|
||||
{
|
||||
return FetchUtils::fetchAllAssociative($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchFirstColumn(): array
|
||||
{
|
||||
return FetchUtils::fetchFirstColumn($this);
|
||||
}
|
||||
|
||||
public function rowCount(): int
|
||||
{
|
||||
return @db2_num_rows($this->statement);
|
||||
}
|
||||
|
||||
public function columnCount(): int
|
||||
{
|
||||
$count = db2_num_fields($this->statement);
|
||||
|
||||
if ($count !== false) {
|
||||
return $count;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function free(): void
|
||||
{
|
||||
db2_free_result($this->statement);
|
||||
}
|
||||
}
|
220
vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php
vendored
Normal file
220
vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php
vendored
Normal file
|
@ -0,0 +1,220 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\IBMDB2;
|
||||
|
||||
use Doctrine\DBAL\Driver\Exception;
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\CannotCopyStreamToStream;
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\CannotCreateTemporaryFile;
|
||||
use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError;
|
||||
use Doctrine\DBAL\Driver\Result as ResultInterface;
|
||||
use Doctrine\DBAL\Driver\Statement as StatementInterface;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function assert;
|
||||
use function db2_bind_param;
|
||||
use function db2_execute;
|
||||
use function error_get_last;
|
||||
use function fclose;
|
||||
use function func_num_args;
|
||||
use function is_int;
|
||||
use function is_resource;
|
||||
use function stream_copy_to_stream;
|
||||
use function stream_get_meta_data;
|
||||
use function tmpfile;
|
||||
|
||||
use const DB2_BINARY;
|
||||
use const DB2_CHAR;
|
||||
use const DB2_LONG;
|
||||
use const DB2_PARAM_FILE;
|
||||
use const DB2_PARAM_IN;
|
||||
|
||||
final class Statement implements StatementInterface
|
||||
{
|
||||
/** @var resource */
|
||||
private $stmt;
|
||||
|
||||
/** @var mixed[] */
|
||||
private array $parameters = [];
|
||||
|
||||
/**
|
||||
* Map of LOB parameter positions to the tuples containing reference to the variable bound to the driver statement
|
||||
* and the temporary file handle bound to the underlying statement
|
||||
*
|
||||
* @var array<int,string|resource|null>
|
||||
*/
|
||||
private array $lobs = [];
|
||||
|
||||
/**
|
||||
* @internal The statement can be only instantiated by its driver connection.
|
||||
*
|
||||
* @param resource $stmt
|
||||
*/
|
||||
public function __construct($stmt)
|
||||
{
|
||||
$this->stmt = $stmt;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function bindValue($param, $value, $type = ParameterType::STRING): bool
|
||||
{
|
||||
assert(is_int($param));
|
||||
|
||||
if (func_num_args() < 3) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5558',
|
||||
'Not passing $type to Statement::bindValue() is deprecated.'
|
||||
. ' Pass the type corresponding to the parameter being bound.',
|
||||
);
|
||||
}
|
||||
|
||||
return $this->bindParam($param, $value, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@see bindValue()} instead.
|
||||
*/
|
||||
public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5563',
|
||||
'%s is deprecated. Use bindValue() instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
assert(is_int($param));
|
||||
|
||||
if (func_num_args() < 3) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5558',
|
||||
'Not passing $type to Statement::bindParam() is deprecated.'
|
||||
. ' Pass the type corresponding to the parameter being bound.',
|
||||
);
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case ParameterType::INTEGER:
|
||||
$this->bind($param, $variable, DB2_PARAM_IN, DB2_LONG);
|
||||
break;
|
||||
|
||||
case ParameterType::LARGE_OBJECT:
|
||||
$this->lobs[$param] = &$variable;
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->bind($param, $variable, DB2_PARAM_IN, DB2_CHAR);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $position Parameter position
|
||||
* @param mixed $variable
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function bind($position, &$variable, int $parameterType, int $dataType): void
|
||||
{
|
||||
$this->parameters[$position] =& $variable;
|
||||
|
||||
if (! db2_bind_param($this->stmt, $position, '', $parameterType, $dataType)) {
|
||||
throw StatementError::new($this->stmt);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function execute($params = null): ResultInterface
|
||||
{
|
||||
if ($params !== null) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5556',
|
||||
'Passing $params to Statement::execute() is deprecated. Bind parameters using'
|
||||
. ' Statement::bindParam() or Statement::bindValue() instead.',
|
||||
);
|
||||
}
|
||||
|
||||
$handles = $this->bindLobs();
|
||||
|
||||
$result = @db2_execute($this->stmt, $params ?? $this->parameters);
|
||||
|
||||
foreach ($handles as $handle) {
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
$this->lobs = [];
|
||||
|
||||
if ($result === false) {
|
||||
throw StatementError::new($this->stmt);
|
||||
}
|
||||
|
||||
return new Result($this->stmt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<resource>
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function bindLobs(): array
|
||||
{
|
||||
$handles = [];
|
||||
|
||||
foreach ($this->lobs as $param => $value) {
|
||||
if (is_resource($value)) {
|
||||
$handle = $handles[] = $this->createTemporaryFile();
|
||||
$path = stream_get_meta_data($handle)['uri'];
|
||||
|
||||
$this->copyStreamToStream($value, $handle);
|
||||
|
||||
$this->bind($param, $path, DB2_PARAM_FILE, DB2_BINARY);
|
||||
} else {
|
||||
$this->bind($param, $value, DB2_PARAM_IN, DB2_CHAR);
|
||||
}
|
||||
|
||||
unset($value);
|
||||
}
|
||||
|
||||
return $handles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function createTemporaryFile()
|
||||
{
|
||||
$handle = @tmpfile();
|
||||
|
||||
if ($handle === false) {
|
||||
throw CannotCreateTemporaryFile::new(error_get_last());
|
||||
}
|
||||
|
||||
return $handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource $source
|
||||
* @param resource $target
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function copyStreamToStream($source, $target): void
|
||||
{
|
||||
if (@stream_copy_to_stream($source, $target) === false) {
|
||||
throw CannotCopyStreamToStream::new(error_get_last());
|
||||
}
|
||||
}
|
||||
}
|
12
vendor/doctrine/dbal/src/Driver/Middleware.php
vendored
Normal file
12
vendor/doctrine/dbal/src/Driver/Middleware.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver;
|
||||
|
||||
use Doctrine\DBAL\Driver;
|
||||
|
||||
interface Middleware
|
||||
{
|
||||
public function wrap(Driver $driver): Driver;
|
||||
}
|
113
vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php
vendored
Normal file
113
vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Middleware;
|
||||
|
||||
use Doctrine\DBAL\Driver\Connection;
|
||||
use Doctrine\DBAL\Driver\Result;
|
||||
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
|
||||
use Doctrine\DBAL\Driver\Statement;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use LogicException;
|
||||
|
||||
use function get_class;
|
||||
use function method_exists;
|
||||
use function sprintf;
|
||||
|
||||
abstract class AbstractConnectionMiddleware implements ServerInfoAwareConnection
|
||||
{
|
||||
private Connection $wrappedConnection;
|
||||
|
||||
public function __construct(Connection $wrappedConnection)
|
||||
{
|
||||
$this->wrappedConnection = $wrappedConnection;
|
||||
}
|
||||
|
||||
public function prepare(string $sql): Statement
|
||||
{
|
||||
return $this->wrappedConnection->prepare($sql);
|
||||
}
|
||||
|
||||
public function query(string $sql): Result
|
||||
{
|
||||
return $this->wrappedConnection->query($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function quote($value, $type = ParameterType::STRING)
|
||||
{
|
||||
return $this->wrappedConnection->quote($value, $type);
|
||||
}
|
||||
|
||||
public function exec(string $sql): int
|
||||
{
|
||||
return $this->wrappedConnection->exec($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function lastInsertId($name = null)
|
||||
{
|
||||
if ($name !== null) {
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/issues/4687',
|
||||
'The usage of Connection::lastInsertId() with a sequence name is deprecated.',
|
||||
);
|
||||
}
|
||||
|
||||
return $this->wrappedConnection->lastInsertId($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function beginTransaction()
|
||||
{
|
||||
return $this->wrappedConnection->beginTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
return $this->wrappedConnection->commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function rollBack()
|
||||
{
|
||||
return $this->wrappedConnection->rollBack();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getServerVersion()
|
||||
{
|
||||
if (! $this->wrappedConnection instanceof ServerInfoAwareConnection) {
|
||||
throw new LogicException('The underlying connection is not a ServerInfoAwareConnection');
|
||||
}
|
||||
|
||||
return $this->wrappedConnection->getServerVersion();
|
||||
}
|
||||
|
||||
/** @return resource|object */
|
||||
public function getNativeConnection()
|
||||
{
|
||||
if (! method_exists($this->wrappedConnection, 'getNativeConnection')) {
|
||||
throw new LogicException(sprintf(
|
||||
'The driver connection %s does not support accessing the native connection.',
|
||||
get_class($this->wrappedConnection),
|
||||
));
|
||||
}
|
||||
|
||||
return $this->wrappedConnection->getNativeConnection();
|
||||
}
|
||||
}
|
73
vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php
vendored
Normal file
73
vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Middleware;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Driver\API\ExceptionConverter;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\VersionAwarePlatformDriver;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use SensitiveParameter;
|
||||
|
||||
abstract class AbstractDriverMiddleware implements VersionAwarePlatformDriver
|
||||
{
|
||||
private Driver $wrappedDriver;
|
||||
|
||||
public function __construct(Driver $wrappedDriver)
|
||||
{
|
||||
$this->wrappedDriver = $wrappedDriver;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function connect(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
) {
|
||||
return $this->wrappedDriver->connect($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return $this->wrappedDriver->getDatabasePlatform();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@link AbstractPlatform::createSchemaManager()} instead.
|
||||
*/
|
||||
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
||||
{
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5458',
|
||||
'AbstractDriverMiddleware::getSchemaManager() is deprecated.'
|
||||
. ' Use AbstractPlatform::createSchemaManager() instead.',
|
||||
);
|
||||
|
||||
return $this->wrappedDriver->getSchemaManager($conn, $platform);
|
||||
}
|
||||
|
||||
public function getExceptionConverter(): ExceptionConverter
|
||||
{
|
||||
return $this->wrappedDriver->getExceptionConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function createDatabasePlatformForVersion($version)
|
||||
{
|
||||
if ($this->wrappedDriver instanceof VersionAwarePlatformDriver) {
|
||||
return $this->wrappedDriver->createDatabasePlatformForVersion($version);
|
||||
}
|
||||
|
||||
return $this->wrappedDriver->getDatabasePlatform();
|
||||
}
|
||||
}
|
78
vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php
vendored
Normal file
78
vendor/doctrine/dbal/src/Driver/Middleware/AbstractResultMiddleware.php
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Middleware;
|
||||
|
||||
use Doctrine\DBAL\Driver\Result;
|
||||
|
||||
abstract class AbstractResultMiddleware implements Result
|
||||
{
|
||||
private Result $wrappedResult;
|
||||
|
||||
public function __construct(Result $result)
|
||||
{
|
||||
$this->wrappedResult = $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchNumeric()
|
||||
{
|
||||
return $this->wrappedResult->fetchNumeric();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAssociative()
|
||||
{
|
||||
return $this->wrappedResult->fetchAssociative();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchOne()
|
||||
{
|
||||
return $this->wrappedResult->fetchOne();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAllNumeric(): array
|
||||
{
|
||||
return $this->wrappedResult->fetchAllNumeric();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchAllAssociative(): array
|
||||
{
|
||||
return $this->wrappedResult->fetchAllAssociative();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function fetchFirstColumn(): array
|
||||
{
|
||||
return $this->wrappedResult->fetchFirstColumn();
|
||||
}
|
||||
|
||||
public function rowCount(): int
|
||||
{
|
||||
return $this->wrappedResult->rowCount();
|
||||
}
|
||||
|
||||
public function columnCount(): int
|
||||
{
|
||||
return $this->wrappedResult->columnCount();
|
||||
}
|
||||
|
||||
public function free(): void
|
||||
{
|
||||
$this->wrappedResult->free();
|
||||
}
|
||||
}
|
71
vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php
vendored
Normal file
71
vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Middleware;
|
||||
|
||||
use Doctrine\DBAL\Driver\Result;
|
||||
use Doctrine\DBAL\Driver\Statement;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
|
||||
use function func_num_args;
|
||||
|
||||
abstract class AbstractStatementMiddleware implements Statement
|
||||
{
|
||||
private Statement $wrappedStatement;
|
||||
|
||||
public function __construct(Statement $wrappedStatement)
|
||||
{
|
||||
$this->wrappedStatement = $wrappedStatement;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function bindValue($param, $value, $type = ParameterType::STRING)
|
||||
{
|
||||
if (func_num_args() < 3) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5558',
|
||||
'Not passing $type to Statement::bindValue() is deprecated.'
|
||||
. ' Pass the type corresponding to the parameter being bound.',
|
||||
);
|
||||
}
|
||||
|
||||
return $this->wrappedStatement->bindValue($param, $value, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Use {@see bindValue()} instead.
|
||||
*/
|
||||
public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null)
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5563',
|
||||
'%s is deprecated. Use bindValue() instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
if (func_num_args() < 3) {
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5558',
|
||||
'Not passing $type to Statement::bindParam() is deprecated.'
|
||||
. ' Pass the type corresponding to the parameter being bound.',
|
||||
);
|
||||
}
|
||||
|
||||
return $this->wrappedStatement->bindParam($param, $variable, $type, $length);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function execute($params = null): Result
|
||||
{
|
||||
return $this->wrappedStatement->execute($params);
|
||||
}
|
||||
}
|
141
vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php
vendored
Normal file
141
vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php
vendored
Normal file
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli;
|
||||
|
||||
use Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError;
|
||||
use Doctrine\DBAL\Driver\Result as ResultInterface;
|
||||
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
|
||||
use Doctrine\DBAL\Driver\Statement as DriverStatement;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use mysqli;
|
||||
use mysqli_sql_exception;
|
||||
|
||||
final class Connection implements ServerInfoAwareConnection
|
||||
{
|
||||
/**
|
||||
* Name of the option to set connection flags
|
||||
*/
|
||||
public const OPTION_FLAGS = 'flags';
|
||||
|
||||
private mysqli $connection;
|
||||
|
||||
/** @internal The connection can be only instantiated by its driver. */
|
||||
public function __construct(mysqli $connection)
|
||||
{
|
||||
$this->connection = $connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves mysqli native resource handle.
|
||||
*
|
||||
* Could be used if part of your application is not using DBAL.
|
||||
*
|
||||
* @deprecated Call {@see getNativeConnection()} instead.
|
||||
*/
|
||||
public function getWrappedResourceHandle(): mysqli
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/5037',
|
||||
'%s is deprecated, call getNativeConnection() instead.',
|
||||
__METHOD__,
|
||||
);
|
||||
|
||||
return $this->getNativeConnection();
|
||||
}
|
||||
|
||||
public function getServerVersion(): string
|
||||
{
|
||||
return $this->connection->get_server_info();
|
||||
}
|
||||
|
||||
public function prepare(string $sql): DriverStatement
|
||||
{
|
||||
try {
|
||||
$stmt = $this->connection->prepare($sql);
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
throw ConnectionError::upcast($e);
|
||||
}
|
||||
|
||||
if ($stmt === false) {
|
||||
throw ConnectionError::new($this->connection);
|
||||
}
|
||||
|
||||
return new Statement($stmt);
|
||||
}
|
||||
|
||||
public function query(string $sql): ResultInterface
|
||||
{
|
||||
return $this->prepare($sql)->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function quote($value, $type = ParameterType::STRING)
|
||||
{
|
||||
return "'" . $this->connection->escape_string($value) . "'";
|
||||
}
|
||||
|
||||
public function exec(string $sql): int
|
||||
{
|
||||
try {
|
||||
$result = $this->connection->query($sql);
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
throw ConnectionError::upcast($e);
|
||||
}
|
||||
|
||||
if ($result === false) {
|
||||
throw ConnectionError::new($this->connection);
|
||||
}
|
||||
|
||||
return $this->connection->affected_rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function lastInsertId($name = null)
|
||||
{
|
||||
if ($name !== null) {
|
||||
Deprecation::triggerIfCalledFromOutside(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/issues/4687',
|
||||
'The usage of Connection::lastInsertId() with a sequence name is deprecated.',
|
||||
);
|
||||
}
|
||||
|
||||
return $this->connection->insert_id;
|
||||
}
|
||||
|
||||
public function beginTransaction(): bool
|
||||
{
|
||||
$this->connection->begin_transaction();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function commit(): bool
|
||||
{
|
||||
try {
|
||||
return $this->connection->commit();
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function rollBack(): bool
|
||||
{
|
||||
try {
|
||||
return $this->connection->rollback();
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getNativeConnection(): mysqli
|
||||
{
|
||||
return $this->connection;
|
||||
}
|
||||
}
|
117
vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php
vendored
Normal file
117
vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
|
||||
use Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed;
|
||||
use Doctrine\DBAL\Driver\Mysqli\Exception\HostRequired;
|
||||
use Doctrine\DBAL\Driver\Mysqli\Initializer\Charset;
|
||||
use Doctrine\DBAL\Driver\Mysqli\Initializer\Options;
|
||||
use Doctrine\DBAL\Driver\Mysqli\Initializer\Secure;
|
||||
use Generator;
|
||||
use mysqli;
|
||||
use mysqli_sql_exception;
|
||||
use SensitiveParameter;
|
||||
|
||||
final class Driver extends AbstractMySQLDriver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return Connection
|
||||
*/
|
||||
public function connect(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
) {
|
||||
if (! empty($params['persistent'])) {
|
||||
if (! isset($params['host'])) {
|
||||
throw HostRequired::forPersistentConnection();
|
||||
}
|
||||
|
||||
$host = 'p:' . $params['host'];
|
||||
} else {
|
||||
$host = $params['host'] ?? null;
|
||||
}
|
||||
|
||||
$connection = new mysqli();
|
||||
|
||||
foreach ($this->compilePreInitializers($params) as $initializer) {
|
||||
$initializer->initialize($connection);
|
||||
}
|
||||
|
||||
try {
|
||||
$success = @$connection->real_connect(
|
||||
$host,
|
||||
$params['user'] ?? null,
|
||||
$params['password'] ?? null,
|
||||
$params['dbname'] ?? null,
|
||||
$params['port'] ?? null,
|
||||
$params['unix_socket'] ?? null,
|
||||
$params['driverOptions'][Connection::OPTION_FLAGS] ?? 0,
|
||||
);
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
throw ConnectionFailed::upcast($e);
|
||||
}
|
||||
|
||||
if (! $success) {
|
||||
throw ConnectionFailed::new($connection);
|
||||
}
|
||||
|
||||
foreach ($this->compilePostInitializers($params) as $initializer) {
|
||||
$initializer->initialize($connection);
|
||||
}
|
||||
|
||||
return new Connection($connection);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $params
|
||||
*
|
||||
* @return Generator<int, Initializer>
|
||||
*/
|
||||
private function compilePreInitializers(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
): Generator {
|
||||
unset($params['driverOptions'][Connection::OPTION_FLAGS]);
|
||||
|
||||
if (isset($params['driverOptions']) && $params['driverOptions'] !== []) {
|
||||
yield new Options($params['driverOptions']);
|
||||
}
|
||||
|
||||
if (
|
||||
! isset($params['ssl_key']) &&
|
||||
! isset($params['ssl_cert']) &&
|
||||
! isset($params['ssl_ca']) &&
|
||||
! isset($params['ssl_capath']) &&
|
||||
! isset($params['ssl_cipher'])
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
yield new Secure(
|
||||
$params['ssl_key'] ?? '',
|
||||
$params['ssl_cert'] ?? '',
|
||||
$params['ssl_ca'] ?? '',
|
||||
$params['ssl_capath'] ?? '',
|
||||
$params['ssl_cipher'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $params
|
||||
*
|
||||
* @return Generator<int, Initializer>
|
||||
*/
|
||||
private function compilePostInitializers(
|
||||
#[SensitiveParameter]
|
||||
array $params
|
||||
): Generator {
|
||||
if (! isset($params['charset'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
yield new Charset($params['charset']);
|
||||
}
|
||||
}
|
31
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php
vendored
Normal file
31
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
use mysqli;
|
||||
use mysqli_sql_exception;
|
||||
use ReflectionProperty;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class ConnectionError extends AbstractException
|
||||
{
|
||||
public static function new(mysqli $connection): self
|
||||
{
|
||||
return new self($connection->error, $connection->sqlstate, $connection->errno);
|
||||
}
|
||||
|
||||
public static function upcast(mysqli_sql_exception $exception): self
|
||||
{
|
||||
$p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate');
|
||||
$p->setAccessible(true);
|
||||
|
||||
return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception);
|
||||
}
|
||||
}
|
36
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php
vendored
Normal file
36
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
use mysqli;
|
||||
use mysqli_sql_exception;
|
||||
use ReflectionProperty;
|
||||
|
||||
use function assert;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class ConnectionFailed extends AbstractException
|
||||
{
|
||||
public static function new(mysqli $connection): self
|
||||
{
|
||||
$error = $connection->connect_error;
|
||||
assert($error !== null);
|
||||
|
||||
return new self($error, 'HY000', $connection->connect_errno);
|
||||
}
|
||||
|
||||
public static function upcast(mysqli_sql_exception $exception): self
|
||||
{
|
||||
$p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate');
|
||||
$p->setAccessible(true);
|
||||
|
||||
return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception);
|
||||
}
|
||||
}
|
22
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php
vendored
Normal file
22
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class FailedReadingStreamOffset extends AbstractException
|
||||
{
|
||||
public static function new(int $parameter): self
|
||||
{
|
||||
return new self(sprintf('Failed reading the stream resource for parameter #%d.', $parameter));
|
||||
}
|
||||
}
|
20
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/HostRequired.php
vendored
Normal file
20
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/HostRequired.php
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class HostRequired extends AbstractException
|
||||
{
|
||||
public static function forPersistentConnection(): self
|
||||
{
|
||||
return new self('The "host" parameter is required for a persistent connection');
|
||||
}
|
||||
}
|
42
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php
vendored
Normal file
42
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
use mysqli;
|
||||
use mysqli_sql_exception;
|
||||
use ReflectionProperty;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class InvalidCharset extends AbstractException
|
||||
{
|
||||
public static function fromCharset(mysqli $connection, string $charset): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('Failed to set charset "%s": %s', $charset, $connection->error),
|
||||
$connection->sqlstate,
|
||||
$connection->errno,
|
||||
);
|
||||
}
|
||||
|
||||
public static function upcast(mysqli_sql_exception $exception, string $charset): self
|
||||
{
|
||||
$p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate');
|
||||
$p->setAccessible(true);
|
||||
|
||||
return new self(
|
||||
sprintf('Failed to set charset "%s": %s', $charset, $exception->getMessage()),
|
||||
$p->getValue($exception),
|
||||
(int) $exception->getCode(),
|
||||
$exception,
|
||||
);
|
||||
}
|
||||
}
|
25
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php
vendored
Normal file
25
vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\Mysqli\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class InvalidOption extends AbstractException
|
||||
{
|
||||
/** @param mixed $value */
|
||||
public static function fromOption(int $option, $value): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('Failed to set option %d with value "%s"', $option, $value),
|
||||
);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue