Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13972351
D12098.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12098.id.diff
View Options
diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php
--- a/src/infrastructure/storage/lisk/LiskDAO.php
+++ b/src/infrastructure/storage/lisk/LiskDAO.php
@@ -188,6 +188,7 @@
private static $transactionIsolationLevel = 0;
private $ephemeral = false;
+ private $forcedConnection;
private static $connections = array();
@@ -280,6 +281,21 @@
}
+ /**
+ * Force an object to use a specific connection.
+ *
+ * This overrides all connection management and forces the object to use
+ * a specific connection when interacting with the database.
+ *
+ * @param AphrontDatabaseConnection Connection to force this object to use.
+ * @task conn
+ */
+ public function setForcedConnection(AphrontDatabaseConnection $connection) {
+ $this->forcedConnection = $connection;
+ return $this;
+ }
+
+
/* -( Configuring Lisk )--------------------------------------------------- */
@@ -941,6 +957,10 @@
throw new Exception("Unknown mode '{$mode}', should be 'r' or 'w'.");
}
+ if ($this->forcedConnection) {
+ return $this->forcedConnection;
+ }
+
if (self::shouldIsolateAllLiskEffectsToCurrentProcess()) {
$mode = 'isolate-'.$mode;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 18 2024, 6:30 PM (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717035
Default Alt Text
D12098.id.diff (1 KB)
Attached To
Mode
D12098: Allow LiskDAO to be forced to use a specific connection
Attached
Detach File
Event Timeline
Log In to Comment