Manual:DBConnRef.php
Appearance
MediaWiki file: DBConnRef.php | |
---|---|
Location: | includes/libs/rdbms/database/ |
Source code: | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes: | Wikimedia\Rdbms\DBConnRef |
Helper class used for automatically marking an IDatabase connection as reusable (once it no longer matters which DB domain is selected) and for deferring the actual network connection. This uses an RAII-style pattern where calling code is expected to keep the returned reference handle as a function variable that falls out of scope when no longer needed. This avoids the need for matching reuseConnection()
calls for every "return" statement as well as the tedious use of try/finally.