-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "Make TermsDomainDb an interface"
- Loading branch information
Showing
8 changed files
with
78 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare( strict_types=1 ); | ||
|
||
namespace Wikibase\Lib\Rdbms; | ||
|
||
use Wikimedia\Rdbms\IDatabase; | ||
use Wikimedia\Rdbms\ILoadBalancer; | ||
use Wikimedia\Rdbms\IReadableDatabase; | ||
|
||
/** | ||
* Accesses terms (labels, descriptions, aliases) database tables via {@link RepoDomainDb}. | ||
* | ||
* @license GPL-2.0-or-later | ||
*/ | ||
class RepoDomainTermsDb implements TermsDomainDb { | ||
|
||
private RepoDomainDb $repoDb; | ||
|
||
public function __construct( RepoDomainDb $repoDb ) { | ||
$this->repoDb = $repoDb; | ||
} | ||
|
||
public function getWriteConnection( int $flags = 0 ): IDatabase { | ||
return $this->repoDb->connections()->getWriteConnection( $flags ); | ||
} | ||
|
||
public function getReadConnection( ?array $groups = null, int $flags = 0 ): IReadableDatabase { | ||
return $this->repoDb->connections()->getReadConnection( $groups, $flags ); | ||
} | ||
|
||
public function waitForReplicationOfAllAffectedClusters( ?int $timeout = null ): void { | ||
$this->repoDb->replication()->waitForAllAffectedClusters( $timeout ); | ||
} | ||
|
||
/** | ||
* @deprecated Don't use this unless it needs to be passed to a service we don't control | ||
*/ | ||
public function loadBalancer(): ILoadBalancer { | ||
return $this->repoDb->loadBalancer(); | ||
} | ||
|
||
/** | ||
* @deprecated Don't use this unless it needs to be passed to a service we don't control | ||
*/ | ||
public function domain(): string { | ||
return $this->repoDb->domain(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters