update dockerfiles based on latest streamline image

The latest images incorporate all changes previously added by the dockerfiles.
The arm image however is still missing/unreliable from the registry and must be
built independently.
This commit is contained in:
2024-04-25 10:04:06 -07:00
parent 6896f639bd
commit d26252fc11
10177 changed files with 1212770 additions and 194 deletions
@@ -0,0 +1,82 @@
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Logging;
use Doctrine\DBAL\Driver\Connection as ConnectionInterface;
use Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware;
use Doctrine\DBAL\Driver\Result;
use Doctrine\DBAL\Driver\Statement as DriverStatement;
use Psr\Log\LoggerInterface;
final class Connection extends AbstractConnectionMiddleware
{
private LoggerInterface $logger;
/** @internal This connection can be only instantiated by its driver. */
public function __construct(ConnectionInterface $connection, LoggerInterface $logger)
{
parent::__construct($connection);
$this->logger = $logger;
}
public function __destruct()
{
$this->logger->info('Disconnecting');
}
public function prepare(string $sql): DriverStatement
{
return new Statement(
parent::prepare($sql),
$this->logger,
$sql,
);
}
public function query(string $sql): Result
{
$this->logger->debug('Executing query: {sql}', ['sql' => $sql]);
return parent::query($sql);
}
public function exec(string $sql): int
{
$this->logger->debug('Executing statement: {sql}', ['sql' => $sql]);
return parent::exec($sql);
}
/**
* {@inheritDoc}
*/
public function beginTransaction()
{
$this->logger->debug('Beginning transaction');
return parent::beginTransaction();
}
/**
* {@inheritDoc}
*/
public function commit()
{
$this->logger->debug('Committing transaction');
return parent::commit();
}
/**
* {@inheritDoc}
*/
public function rollBack()
{
$this->logger->debug('Rolling back transaction');
return parent::rollBack();
}
}
@@ -0,0 +1,75 @@
<?php
namespace Doctrine\DBAL\Logging;
use Doctrine\Deprecations\Deprecation;
use function microtime;
/**
* Includes executed SQLs in a Debug Stack.
*
* @deprecated
*/
class DebugStack implements SQLLogger
{
/**
* Executed SQL queries.
*
* @var array<int, array<string, mixed>>
*/
public $queries = [];
/**
* If Debug Stack is enabled (log queries) or not.
*
* @var bool
*/
public $enabled = true;
/** @var float|null */
public $start = null;
/** @var int */
public $currentQuery = 0;
public function __construct()
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4967',
'DebugStack is deprecated.',
);
}
/**
* {@inheritDoc}
*/
public function startQuery($sql, ?array $params = null, ?array $types = null)
{
if (! $this->enabled) {
return;
}
$this->start = microtime(true);
$this->queries[++$this->currentQuery] = [
'sql' => $sql,
'params' => $params,
'types' => $types,
'executionMS' => 0,
];
}
/**
* {@inheritDoc}
*/
public function stopQuery()
{
if (! $this->enabled) {
return;
}
$this->queries[$this->currentQuery]['executionMS'] = microtime(true) - $this->start;
}
}
@@ -0,0 +1,58 @@
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Logging;
use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware;
use Psr\Log\LoggerInterface;
use SensitiveParameter;
final class Driver extends AbstractDriverMiddleware
{
private LoggerInterface $logger;
/** @internal This driver can be only instantiated by its middleware. */
public function __construct(DriverInterface $driver, LoggerInterface $logger)
{
parent::__construct($driver);
$this->logger = $logger;
}
/**
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
array $params
) {
$this->logger->info('Connecting with parameters {params}', ['params' => $this->maskPassword($params)]);
return new Connection(
parent::connect($params),
$this->logger,
);
}
/**
* @param array<string,mixed> $params Connection parameters
*
* @return array<string,mixed>
*/
private function maskPassword(
#[SensitiveParameter]
array $params
): array {
if (isset($params['password'])) {
$params['password'] = '<redacted>';
}
if (isset($params['url'])) {
$params['url'] = '<redacted>';
}
return $params;
}
}
@@ -0,0 +1,48 @@
<?php
namespace Doctrine\DBAL\Logging;
use Doctrine\Deprecations\Deprecation;
/**
* Chains multiple SQLLogger.
*
* @deprecated
*/
class LoggerChain implements SQLLogger
{
/** @var iterable<SQLLogger> */
private iterable $loggers;
/** @param iterable<SQLLogger> $loggers */
public function __construct(iterable $loggers = [])
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4967',
'LoggerChain is deprecated',
);
$this->loggers = $loggers;
}
/**
* {@inheritDoc}
*/
public function startQuery($sql, ?array $params = null, ?array $types = null)
{
foreach ($this->loggers as $logger) {
$logger->startQuery($sql, $params, $types);
}
}
/**
* {@inheritDoc}
*/
public function stopQuery()
{
foreach ($this->loggers as $logger) {
$logger->stopQuery();
}
}
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Logging;
use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\Middleware as MiddlewareInterface;
use Psr\Log\LoggerInterface;
final class Middleware implements MiddlewareInterface
{
private LoggerInterface $logger;
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}
public function wrap(DriverInterface $driver): DriverInterface
{
return new Driver($driver, $this->logger);
}
}
@@ -0,0 +1,32 @@
<?php
namespace Doctrine\DBAL\Logging;
use Doctrine\DBAL\Types\Type;
/**
* Interface for SQL loggers.
*
* @deprecated Use {@see \Doctrine\DBAL\Logging\Middleware} or implement
* {@see \Doctrine\DBAL\Driver\Middleware} instead.
*/
interface SQLLogger
{
/**
* Logs a SQL statement somewhere.
*
* @param string $sql SQL statement
* @param list<mixed>|array<string, mixed>|null $params Statement parameters
* @param array<int, Type|int|string|null>|array<string, Type|int|string|null>|null $types Parameter types
*
* @return void
*/
public function startQuery($sql, ?array $params = null, ?array $types = null);
/**
* Marks the last started query as stopped. This can be used for timing of queries.
*
* @return void
*/
public function stopQuery();
}
@@ -0,0 +1,100 @@
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Logging;
use Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware;
use Doctrine\DBAL\Driver\Result as ResultInterface;
use Doctrine\DBAL\Driver\Statement as StatementInterface;
use Doctrine\DBAL\ParameterType;
use Doctrine\Deprecations\Deprecation;
use Psr\Log\LoggerInterface;
use function array_slice;
use function func_get_args;
use function func_num_args;
final class Statement extends AbstractStatementMiddleware
{
private LoggerInterface $logger;
private string $sql;
/** @var array<int,mixed>|array<string,mixed> */
private array $params = [];
/** @var array<int,int>|array<string,int> */
private array $types = [];
/** @internal This statement can be only instantiated by its connection. */
public function __construct(StatementInterface $statement, LoggerInterface $logger, string $sql)
{
parent::__construct($statement);
$this->logger = $logger;
$this->sql = $sql;
}
/**
* {@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.',
);
}
$this->params[$param] = &$variable;
$this->types[$param] = $type;
return parent::bindParam($param, $variable, $type, ...array_slice(func_get_args(), 3));
}
/**
* {@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.',
);
}
$this->params[$param] = $value;
$this->types[$param] = $type;
return parent::bindValue($param, $value, $type);
}
/**
* {@inheritDoc}
*/
public function execute($params = null): ResultInterface
{
$this->logger->debug('Executing statement: {sql} (parameters: {params}, types: {types})', [
'sql' => $this->sql,
'params' => $params ?? $this->params,
'types' => $this->types,
]);
return parent::execute($params);
}
}