| @@ 296-304 (lines=9) @@ | ||
| 293 | * @param bool|string $wiki Wiki ID, or false for the current wiki |
|
| 294 | * @return LoadBalancer |
|
| 295 | */ |
|
| 296 | public function &getExternalLB( $cluster, $wiki = false ) { |
|
| 297 | if ( !isset( $this->extLBs[$cluster] ) ) { |
|
| 298 | $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $wiki ); |
|
| 299 | $this->extLBs[$cluster]->parentInfo( [ 'id' => "ext-$cluster" ] ); |
|
| 300 | $this->chronProt->initLB( $this->extLBs[$cluster] ); |
|
| 301 | } |
|
| 302 | ||
| 303 | return $this->extLBs[$cluster]; |
|
| 304 | } |
|
| 305 | ||
| 306 | /** |
|
| 307 | * Make a new load balancer object based on template and load array |
|
| @@ 125-133 (lines=9) @@ | ||
| 122 | * @param bool|string $wiki |
|
| 123 | * @return array |
|
| 124 | */ |
|
| 125 | public function &getExternalLB( $cluster, $wiki = false ) { |
|
| 126 | if ( !isset( $this->extLBs[$cluster] ) ) { |
|
| 127 | $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $wiki ); |
|
| 128 | $this->extLBs[$cluster]->parentInfo( [ 'id' => "ext-$cluster" ] ); |
|
| 129 | $this->chronProt->initLB( $this->extLBs[$cluster] ); |
|
| 130 | } |
|
| 131 | ||
| 132 | return $this->extLBs[$cluster]; |
|
| 133 | } |
|
| 134 | ||
| 135 | private function newLoadBalancer( array $servers ) { |
|
| 136 | return new LoadBalancer( [ |
|