refactor: susun semula struktur folder — Laravel source ke src/
This commit is contained in:
34
vendor/symfony/polyfill-php84/Resources/stubs/Deprecated.php
vendored
Normal file
34
vendor/symfony/polyfill-php84/Resources/stubs/Deprecated.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80100) {
|
||||
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)]
|
||||
final class Deprecated
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
public ?string $message;
|
||||
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
public ?string $since;
|
||||
|
||||
public function __construct(?string $message = null, ?string $since = null)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->since = $since;
|
||||
}
|
||||
}
|
||||
} elseif (\PHP_VERSION_ID < 80400) {
|
||||
require dirname(__DIR__).'/Deprecated.php';
|
||||
}
|
||||
43
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Dblib.php
vendored
Normal file
43
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Dblib.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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 Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_dblib')) {
|
||||
class Dblib extends \PDO
|
||||
{
|
||||
public const ATTR_CONNECTION_TIMEOUT = \PDO::DBLIB_ATTR_CONNECTION_TIMEOUT;
|
||||
public const ATTR_QUERY_TIMEOUT = \PDO::DBLIB_ATTR_QUERY_TIMEOUT;
|
||||
public const ATTR_STRINGIFY_UNIQUEIDENTIFIER = \PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER;
|
||||
public const ATTR_VERSION = \PDO::DBLIB_ATTR_VERSION;
|
||||
public const ATTR_TDS_VERSION = \PHP_VERSION_ID >= 70300 ? \PDO::DBLIB_ATTR_TDS_VERSION : 1004;
|
||||
public const ATTR_SKIP_EMPTY_ROWSETS = \PHP_VERSION_ID >= 70300 ? \PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS : 1005;
|
||||
public const ATTR_DATETIME_CONVERT = \PHP_VERSION_ID >= 70300 ? \PDO::DBLIB_ATTR_DATETIME_CONVERT : 1006;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('dblib' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Dblib::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Dblib::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Dblib::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Firebird.php
vendored
Normal file
39
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Firebird.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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 Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_firebird')) {
|
||||
class Firebird extends \PDO
|
||||
{
|
||||
public const ATTR_DATE_FORMAT = \PDO::FB_ATTR_DATE_FORMAT;
|
||||
public const ATTR_TIME_FORMAT = \PDO::FB_ATTR_TIME_FORMAT;
|
||||
public const ATTR_TIMESTAMP_FORMAT = \PDO::FB_ATTR_TIMESTAMP_FORMAT;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('firebird' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Firebird::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Firebird::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Firebird::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
101
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Mysql.php
vendored
Normal file
101
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Mysql.php
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
<?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 Pdo;
|
||||
|
||||
use PDO;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_mysql')) {
|
||||
// Feature detection for non-mysqlnd; see also https://www.php.net/manual/en/class.pdo-mysql.php#pdo-mysql.constants.attr-max-buffer-size
|
||||
if (\defined('PDO::MYSQL_ATTR_MAX_BUFFER_SIZE') && \defined('PDO::MYSQL_ATTR_READ_DEFAULT_FILE') && \defined('PDO::MYSQL_ATTR_READ_DEFAULT_GROUP')) {
|
||||
class Mysql extends \PDO
|
||||
{
|
||||
public const ATTR_COMPRESS = \PDO::MYSQL_ATTR_COMPRESS;
|
||||
public const ATTR_DIRECT_QUERY = \PDO::MYSQL_ATTR_DIRECT_QUERY;
|
||||
public const ATTR_FOUND_ROWS = \PDO::MYSQL_ATTR_FOUND_ROWS;
|
||||
public const ATTR_IGNORE_SPACE = \PDO::MYSQL_ATTR_IGNORE_SPACE;
|
||||
public const ATTR_INIT_COMMAND = \PDO::MYSQL_ATTR_INIT_COMMAND;
|
||||
public const ATTR_LOCAL_INFILE = \PDO::MYSQL_ATTR_LOCAL_INFILE;
|
||||
public const ATTR_LOCAL_INFILE_DIRECTORY = \PHP_VERSION_ID >= 80100 ? \PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY : 1015;
|
||||
public const ATTR_MAX_BUFFER_SIZE = \PDO::MYSQL_ATTR_MAX_BUFFER_SIZE;
|
||||
public const ATTR_MULTI_STATEMENTS = \PDO::MYSQL_ATTR_MULTI_STATEMENTS;
|
||||
public const ATTR_READ_DEFAULT_FILE = \PDO::MYSQL_ATTR_READ_DEFAULT_FILE;
|
||||
public const ATTR_READ_DEFAULT_GROUP = \PDO::MYSQL_ATTR_READ_DEFAULT_GROUP;
|
||||
public const ATTR_SERVER_PUBLIC_KEY = \PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY;
|
||||
public const ATTR_SSL_CA = \PDO::MYSQL_ATTR_SSL_CA;
|
||||
public const ATTR_SSL_CAPATH = \PDO::MYSQL_ATTR_SSL_CAPATH;
|
||||
public const ATTR_SSL_CERT = \PDO::MYSQL_ATTR_SSL_CERT;
|
||||
public const ATTR_SSL_CIPHER = \PDO::MYSQL_ATTR_SSL_CIPHER;
|
||||
public const ATTR_SSL_KEY = \PDO::MYSQL_ATTR_SSL_KEY;
|
||||
public const ATTR_SSL_VERIFY_SERVER_CERT = \PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT;
|
||||
public const ATTR_USE_BUFFERED_QUERY = \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('mysql' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Mysql::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Mysql::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Mysql::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
class Mysql extends \PDO
|
||||
{
|
||||
public const ATTR_COMPRESS = \PDO::MYSQL_ATTR_COMPRESS;
|
||||
public const ATTR_DIRECT_QUERY = \PDO::MYSQL_ATTR_DIRECT_QUERY;
|
||||
public const ATTR_FOUND_ROWS = \PDO::MYSQL_ATTR_FOUND_ROWS;
|
||||
public const ATTR_IGNORE_SPACE = \PDO::MYSQL_ATTR_IGNORE_SPACE;
|
||||
public const ATTR_INIT_COMMAND = \PDO::MYSQL_ATTR_INIT_COMMAND;
|
||||
public const ATTR_LOCAL_INFILE = \PDO::MYSQL_ATTR_LOCAL_INFILE;
|
||||
public const ATTR_LOCAL_INFILE_DIRECTORY = \PHP_VERSION_ID >= 80100 ? \PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY : 1015;
|
||||
// public const ATTR_MAX_BUFFER_SIZE = PDO::MYSQL_ATTR_MAX_BUFFER_SIZE; // disabled for mysqlnd
|
||||
public const ATTR_MULTI_STATEMENTS = \PDO::MYSQL_ATTR_MULTI_STATEMENTS;
|
||||
// public const ATTR_READ_DEFAULT_FILE = PDO::MYSQL_ATTR_READ_DEFAULT_FILE; // disabled for mysqlnd
|
||||
// public const ATTR_READ_DEFAULT_GROUP = PDO::MYSQL_ATTR_READ_DEFAULT_GROUP; // disabled for mysqlnd
|
||||
public const ATTR_SERVER_PUBLIC_KEY = \PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY;
|
||||
public const ATTR_SSL_CA = \PDO::MYSQL_ATTR_SSL_CA;
|
||||
public const ATTR_SSL_CAPATH = \PDO::MYSQL_ATTR_SSL_CAPATH;
|
||||
public const ATTR_SSL_CERT = \PDO::MYSQL_ATTR_SSL_CERT;
|
||||
public const ATTR_SSL_CIPHER = \PDO::MYSQL_ATTR_SSL_CIPHER;
|
||||
public const ATTR_SSL_KEY = \PDO::MYSQL_ATTR_SSL_KEY;
|
||||
public const ATTR_SSL_VERIFY_SERVER_CERT = \PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT;
|
||||
public const ATTR_USE_BUFFERED_QUERY = \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('mysql' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Mysql::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Mysql::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Mysql::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Odbc.php
vendored
Normal file
41
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Odbc.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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 Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_odbc')) {
|
||||
class Odbc extends \PDO
|
||||
{
|
||||
public const ATTR_USE_CURSOR_LIBRARY = \PDO::ODBC_ATTR_USE_CURSOR_LIBRARY;
|
||||
public const ATTR_ASSUME_UTF8 = \PDO::ODBC_ATTR_ASSUME_UTF8;
|
||||
public const SQL_USE_IF_NEEDED = \PDO::ODBC_SQL_USE_IF_NEEDED;
|
||||
public const SQL_USE_DRIVER = \PDO::ODBC_SQL_USE_DRIVER;
|
||||
public const SQL_USE_ODBC = \PDO::ODBC_SQL_USE_ODBC;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('odbc' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Odbc::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Odbc::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Odbc::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
94
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Pgsql.php
vendored
Normal file
94
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Pgsql.php
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
<?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 Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_pgsql')) {
|
||||
class Pgsql extends \PDO
|
||||
{
|
||||
public const ATTR_DISABLE_PREPARES = \PDO::PGSQL_ATTR_DISABLE_PREPARES;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('pgsql' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Pgsql::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Pgsql::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Pgsql::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function copyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null): bool
|
||||
{
|
||||
return $this->pgsqlCopyFromArray($tableName, $rows, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
public function copyFromFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null): bool
|
||||
{
|
||||
return $this->pgsqlCopyFromFile($tableName, $filename, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|false
|
||||
*/
|
||||
public function copyToArray(string $tableName, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null)
|
||||
{
|
||||
return $this->pgsqlCopyToArray($tableName, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
public function copyToFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = '\\\\N', ?string $fields = null): bool
|
||||
{
|
||||
return $this->pgsqlCopyToFile($tableName, $filename, $separator, $nullAs, $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|false
|
||||
*/
|
||||
public function getNotify(int $fetchMode = \PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0)
|
||||
{
|
||||
return $this->pgsqlGetNotify($fetchMode, $timeoutMilliseconds);
|
||||
}
|
||||
|
||||
public function getPid(): int
|
||||
{
|
||||
return $this->pgsqlGetPid();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|false
|
||||
*/
|
||||
public function lobCreate()
|
||||
{
|
||||
return $this->pgsqlLOBCreate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return resource|false
|
||||
*/
|
||||
public function lobOpen(string $oid, string $mode = 'rb')
|
||||
{
|
||||
return $this->pgsqlLOBOpen($oid, $mode);
|
||||
}
|
||||
|
||||
public function lobUnlink(string $oid): bool
|
||||
{
|
||||
return $this->pgsqlLOBUnlink($oid);
|
||||
}
|
||||
}
|
||||
}
|
||||
58
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Sqlite.php
vendored
Normal file
58
vendor/symfony/polyfill-php84/Resources/stubs/Pdo/Sqlite.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?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 Pdo;
|
||||
|
||||
if (\PHP_VERSION_ID < 80400 && \extension_loaded('pdo_sqlite')) {
|
||||
class Sqlite extends \PDO
|
||||
{
|
||||
public const ATTR_EXTENDED_RESULT_CODES = \PHP_VERSION_ID >= 70400 ? \PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES : 1002;
|
||||
public const ATTR_OPEN_FLAGS = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_ATTR_OPEN_FLAGS : 1000;
|
||||
public const ATTR_READONLY_STATEMENT = \PHP_VERSION_ID >= 70400 ? \PDO::SQLITE_ATTR_READONLY_STATEMENT : 1001;
|
||||
public const DETERMINISTIC = \PDO::SQLITE_DETERMINISTIC;
|
||||
public const OPEN_READONLY = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_OPEN_READONLY : 1;
|
||||
public const OPEN_READWRITE = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_OPEN_READWRITE : 2;
|
||||
public const OPEN_CREATE = \PHP_VERSION_ID >= 70300 ? \PDO::SQLITE_OPEN_CREATE : 4;
|
||||
|
||||
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
|
||||
{
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
|
||||
if ('sqlite' !== $driver = $this->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
|
||||
throw new \PDOException(\sprintf('Pdo\Sqlite::__construct() cannot be used for connecting to the "%s" driver', $driver));
|
||||
}
|
||||
}
|
||||
|
||||
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): self
|
||||
{
|
||||
try {
|
||||
return new self($dsn, $username, $password, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw preg_match('/^Pdo\\\\Sqlite::__construct\(\) cannot be used for connecting to the "([a-z]+)" driver/', $e->getMessage(), $matches) ? new \PDOException(\sprintf('Pdo\Sqlite::connect() cannot be used for connecting to the "%s" driver', $matches[1])) : $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function createAggregate(string $name, callable $step, callable $finalize, int $numArgs = -1): bool
|
||||
{
|
||||
return $this->sqliteCreateAggregate($name, $step, $finalize, $numArgs);
|
||||
}
|
||||
|
||||
public function createCollation(string $name, callable $callback): bool
|
||||
{
|
||||
return $this->sqliteCreateCollation($name, $callback);
|
||||
}
|
||||
|
||||
public function createFunction(string $function_name, callable $callback, int $num_args = -1, int $flags = 0): bool
|
||||
{
|
||||
return $this->sqliteCreateFunction($function_name, $callback, $num_args, $flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
156
vendor/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php
vendored
Normal file
156
vendor/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80400) {
|
||||
// @author Daniel Scherzer <daniel.e.scherzer@gmail.com>
|
||||
final class ReflectionConstant
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @readonly
|
||||
*/
|
||||
public $name;
|
||||
|
||||
private $value;
|
||||
private $deprecated;
|
||||
|
||||
private static $persistentConstants = [];
|
||||
|
||||
public function __construct(string $name)
|
||||
{
|
||||
if (!defined($name) || false !== strpos($name, '::')) {
|
||||
throw new ReflectionException("Constant \"$name\" does not exist");
|
||||
}
|
||||
|
||||
$this->name = ltrim($name, '\\');
|
||||
$deprecated = false;
|
||||
$eh = set_error_handler(static function ($type, $msg, $file, $line) use ($name, &$deprecated, &$eh) {
|
||||
if (\E_DEPRECATED === $type && "Constant $name is deprecated" === $msg) {
|
||||
return $deprecated = true;
|
||||
}
|
||||
|
||||
return $eh && $eh($type, $msg, $file, $line);
|
||||
});
|
||||
|
||||
try {
|
||||
$this->value = constant($name);
|
||||
$this->deprecated = $deprecated;
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function getNamespaceName(): string
|
||||
{
|
||||
if (false === $slashPos = strrpos($this->name, '\\')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return substr($this->name, 0, $slashPos);
|
||||
}
|
||||
|
||||
public function getShortName(): string
|
||||
{
|
||||
if (false === $slashPos = strrpos($this->name, '\\')) {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
return substr($this->name, $slashPos + 1);
|
||||
}
|
||||
|
||||
public function isDeprecated(): bool
|
||||
{
|
||||
return $this->deprecated;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
// A constant is persistent if provided by PHP itself rather than
|
||||
// being defined by users. If we got here, we know that it *is*
|
||||
// defined, so we just need to figure out if it is defined by the
|
||||
// user or not
|
||||
if (!self::$persistentConstants) {
|
||||
$persistentConstants = get_defined_constants(true);
|
||||
unset($persistentConstants['user']);
|
||||
foreach ($persistentConstants as $constants) {
|
||||
self::$persistentConstants += $constants;
|
||||
}
|
||||
}
|
||||
$persistent = array_key_exists($this->name, self::$persistentConstants);
|
||||
|
||||
// Can't match the inclusion of `no_file_cache` but the rest is
|
||||
// possible to match
|
||||
$result = 'Constant [ ';
|
||||
if ($persistent || $this->deprecated) {
|
||||
$result .= '<';
|
||||
if ($persistent) {
|
||||
$result .= 'persistent';
|
||||
if ($this->deprecated) {
|
||||
$result .= ', ';
|
||||
}
|
||||
}
|
||||
if ($this->deprecated) {
|
||||
$result .= 'deprecated';
|
||||
}
|
||||
$result .= '> ';
|
||||
}
|
||||
// Cannot just use gettype() to match zend_zval_type_name()
|
||||
if (is_object($this->value)) {
|
||||
$result .= \PHP_VERSION_ID >= 80000 ? get_debug_type($this->value) : gettype($this->value);
|
||||
} elseif (is_bool($this->value)) {
|
||||
$result .= 'bool';
|
||||
} elseif (is_int($this->value)) {
|
||||
$result .= 'int';
|
||||
} elseif (is_float($this->value)) {
|
||||
$result .= 'float';
|
||||
} elseif (null === $this->value) {
|
||||
$result .= 'null';
|
||||
} else {
|
||||
$result .= gettype($this->value);
|
||||
}
|
||||
$result .= ' ';
|
||||
$result .= $this->name;
|
||||
$result .= ' ] { ';
|
||||
if (is_array($this->value)) {
|
||||
$result .= 'Array';
|
||||
} else {
|
||||
// This will throw an exception if the value is an object that
|
||||
// cannot be converted to string; that is expected and matches
|
||||
// the behavior of zval_get_string_func()
|
||||
$result .= (string) $this->value;
|
||||
}
|
||||
$result .= " }\n";
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function __sleep(): array
|
||||
{
|
||||
throw new Exception("Serialization of 'ReflectionConstant' is not allowed");
|
||||
}
|
||||
|
||||
public function __wakeup(): void
|
||||
{
|
||||
throw new Exception("Unserialization of 'ReflectionConstant' is not allowed");
|
||||
}
|
||||
}
|
||||
}
|
||||
44
vendor/symfony/polyfill-php84/Resources/stubs/RoundingMode.php
vendored
Normal file
44
vendor/symfony/polyfill-php84/Resources/stubs/RoundingMode.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
if (\PHP_VERSION_ID < 80100) {
|
||||
final class RoundingMode
|
||||
{
|
||||
const HalfAwayFromZero = 0;
|
||||
const HalfTowardsZero = 1;
|
||||
const HalfEven = 2;
|
||||
const HalfOdd = 3;
|
||||
const TowardsZero = 4;
|
||||
const AwayFromZero = 5;
|
||||
const NegativeInfinity = 6;
|
||||
const PositiveInfinity = 7;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function cases(): array
|
||||
{
|
||||
return [
|
||||
self::HalfAwayFromZero,
|
||||
self::HalfTowardsZero,
|
||||
self::HalfEven,
|
||||
self::HalfOdd,
|
||||
self::TowardsZero,
|
||||
self::AwayFromZero,
|
||||
self::NegativeInfinity,
|
||||
self::PositiveInfinity,
|
||||
];
|
||||
}
|
||||
}
|
||||
} elseif (\PHP_VERSION_ID < 80400) {
|
||||
require dirname(__DIR__).'/RoundingMode.php';
|
||||
}
|
||||
Reference in New Issue
Block a user