diff options
| author | Damien Regad <dregad@mantisbt.org> | 2020-01-25 22:20:42 +0100 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2020-01-25 22:20:42 +0100 |
| commit | a89c5c308169497b86231a5266d8e5720811b9df (patch) | |
| tree | 0a2a15c184f593e37fd38530c1ebae8571742aac /adodb-loadbalancer.inc.php | |
| parent | a3817e67beead9c00447b96385a45664b8439460 (diff) | |
| download | adodb-a89c5c308169497b86231a5266d8e5720811b9df.tar.gz adodb-a89c5c308169497b86231a5266d8e5720811b9df.tar.bz2 adodb-a89c5c308169497b86231a5266d8e5720811b9df.zip | |
Logical operators: use &&,|| instead of AND,OR
Diffstat (limited to 'adodb-loadbalancer.inc.php')
| -rw-r--r-- | adodb-loadbalancer.inc.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/adodb-loadbalancer.inc.php b/adodb-loadbalancer.inc.php index 7cc71091..13f05461 100644 --- a/adodb-loadbalancer.inc.php +++ b/adodb-loadbalancer.inc.php @@ -275,7 +275,7 @@ class ADOdbLoadBalancer */ public function getConnection($type = 'write', $pin_connection = null) { - while ( ($type == 'write' AND $this->total_connections['write'] > 0 ) OR ( $type == 'readonly' AND $this->total_connections['all'] > 0 ) ) { + while ( ($type == 'write' && $this->total_connections['write'] > 0 ) || ( $type == 'readonly' && $this->total_connections['all'] > 0 ) ) { if ($this->pinned_connection_id !== false ) { $connection_id = $this->pinned_connection_id; } else { @@ -290,7 +290,7 @@ class ADOdbLoadBalancer } catch ( Exception $e ) { //Connection error, see if there are other connections to try still. $this->removeConnection($connection_id); - if (( $type == 'write' AND $this->total_connections['write'] == 0 ) OR ( $type == 'readonly' AND $this->total_connections['all'] == 0 ) ) { + if (( $type == 'write' && $this->total_connections['write'] == 0 ) || ( $type == 'readonly' && $this->total_connections['all'] == 0 ) ) { throw $e; } } @@ -570,7 +570,7 @@ class ADOdbLoadBalancer } if ($type === false ) { - if (is_array($this->connections) AND count($this->connections) > 0 ) { + if (is_array($this->connections) && count($this->connections) > 0 ) { foreach( $this->connections as $key => $connection_obj ) { $adodb_obj = $connection_obj->getADOdbObject(); return call_user_func_array(array($adodb_obj, $method), $this->makeValuesReferenced($args)); //Just makes the function call on the first object. @@ -596,7 +596,7 @@ class ADOdbLoadBalancer */ public function __get($property) { - if (is_array($this->connections) AND count($this->connections) > 0 ) { + if (is_array($this->connections) && count($this->connections) > 0 ) { foreach ( $this->connections as $key => $connection_obj ) { return $connection_obj->getADOdbObject()->$property; //Just returns the property from the first object. } @@ -616,7 +616,7 @@ class ADOdbLoadBalancer public function __set($property, $value) { //Special function to set object properties on all objects without initiating a connection to the database. - if (is_array($this->connections) AND count($this->connections) > 0 ) { + if (is_array($this->connections) && count($this->connections) > 0 ) { foreach ( $this->connections as $key => $connection_obj ) { $connection_obj->getADOdbObject()->$property = $value; } |
