Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to load balancer for PHP 8.2+ warnings. #951

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions adodb-loadbalancer.inc.php
Expand Up @@ -38,17 +38,17 @@ class ADOdbLoadBalancer
/**
* @var bool|array All connections to each database.
*/
protected $connections = false;
protected $connections = [];

/**
* @var bool|array Just connections to the write capable database.
*/
protected $connections_write = false;
protected $connections_write = [];

/**
* @var bool|array Just connections to the readonly database.
*/
protected $connections_readonly = false;
protected $connections_readonly = [];

/**
* @var array Counts of all connections and their types.
Expand All @@ -73,12 +73,12 @@ class ADOdbLoadBalancer
/**
* @var bool Session variables that must be maintained across all connections, ie: SET TIME ZONE.
*/
protected $session_variables = false;
protected $session_variables = [];

/**
* @var bool Called immediately after connecting to any DB.
*/
protected $user_defined_session_init_sql = false;
protected $user_defined_session_init_sql = [];


/**
Expand Down Expand Up @@ -403,7 +403,7 @@ public function setSessionVariable($name, $value, $execute_immediately = true)
*/
private function executeSessionVariables($adodb_obj = false)
{
if (is_array($this->session_variables)) {
if (is_array($this->session_variables) && count($this->session_variables) > 0) {
$sql = '';
foreach ($this->session_variables as $name => $value) {
// $sql .= 'SET SESSION '. $name .' '. $value;
Expand Down