����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.140 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connections/ |
Upload File : |
<?php
namespace Doctrine\DBAL\Connections;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Driver;
use InvalidArgumentException;
use function sprintf;
use function trigger_error;
use const E_USER_DEPRECATED;
/**
* @deprecated Use PrimaryReadReplicaConnection instead
*/
class MasterSlaveConnection extends PrimaryReadReplicaConnection
{
/**
* Creates Primary Replica Connection.
*
* @internal The connection can be only instantiated by the driver manager.
*
* @param mixed[] $params
*
* @throws InvalidArgumentException
*/
public function __construct(
array $params,
Driver $driver,
?Configuration $config = null,
?EventManager $eventManager = null
) {
$this->deprecated(self::class, PrimaryReadReplicaConnection::class);
if (isset($params['master'])) {
$this->deprecated('Params key "master"', '"primary"');
$params['primary'] = $params['master'];
unset($params['master']);
}
if (isset($params['slaves'])) {
$this->deprecated('Params key "slaves"', '"replica"');
$params['replica'] = $params['slaves'];
unset($params['slaves']);
}
if (isset($params['keepSlave'])) {
$this->deprecated('Params key "keepSlave"', '"keepReplica"');
$params['keepReplica'] = $params['keepSlave'];
unset($params['keepSlave']);
}
parent::__construct($params, $driver, $config, $eventManager);
}
/**
* Checks if the connection is currently towards the primary or not.
*/
public function isConnectedToMaster(): bool
{
$this->deprecated('isConnectedtoMaster()', 'isConnectedToPrimary()');
return $this->isConnectedToPrimary();
}
/**
* @param string|null $connectionName
*
* @return bool
*/
public function connect($connectionName = null)
{
if ($connectionName === 'master') {
$connectionName = 'primary';
$this->deprecated('connect("master")', 'ensureConnectedToPrimary()');
}
if ($connectionName === 'slave') {
$connectionName = 'replica';
$this->deprecated('connect("slave")', 'ensureConnectedToReplica()');
}
return $this->performConnect($connectionName);
}
private function deprecated(string $thing, string $instead): void
{
@trigger_error(
sprintf(
'%s is deprecated since doctrine/dbal 2.11 and will be removed in 3.0, use %s instead.',
$thing,
$instead
),
E_USER_DEPRECATED
);
}
}