+
+ /**
+ * Get a connection to the slave DB
+ */
+ function getSlaveDB() {
+ return wfGetDB( DB_SLAVE );
+ }
+
+ /**
+ * Get a connection to the master DB
+ */
+ function getMasterDB() {
+ return wfGetDB( DB_MASTER );
+ }
+
+ /**
+ * Get a key on the primary cache for this repository.
+ * Returns false if the repository's cache is not accessible at this site.
+ * The parameters are the parts of the key, as for wfMemcKey().
+ */
+ function getSharedCacheKey( /*...*/ ) {
+ $args = func_get_args();
+ return call_user_func_array( 'wfMemcKey', $args );
+ }
+
+ /**
+ * Invalidates image redirect cache related to that image
+ *
+ * @param Title $title Title of image
+ */
+ function invalidateImageRedirect( $title ) {
+ global $wgMemc;
+ $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getPrefixedDBkey() ) );
+ if ( $memcKey ) {
+ $wgMemc->delete( $memcKey );
+ }
+ }