MediaWiki master
LocalRepo.php
Go to the documentation of this file.
1<?php
38
48class LocalRepo extends FileRepo {
50 protected $fileFactory = [ LocalFile::class, 'newFromTitle' ];
52 protected $fileFactoryKey = [ LocalFile::class, 'newFromKey' ];
54 protected $fileFromRowFactory = [ LocalFile::class, 'newFromRow' ];
56 protected $oldFileFromRowFactory = [ OldLocalFile::class, 'newFromRow' ];
58 protected $oldFileFactory = [ OldLocalFile::class, 'newFromTitle' ];
60 protected $oldFileFactoryKey = [ OldLocalFile::class, 'newFromKey' ];
61
63 protected $dbDomain;
67
69 protected $blobStore;
70
72 protected $useJsonMetadata = true;
73
75 protected $useSplitMetadata = false;
76
78 protected $splitMetadataThreshold = 1000;
79
81 protected $updateCompatibleMetadata = false;
82
84 protected $reserializeMetadata = false;
85
86 public function __construct( array $info = null ) {
87 parent::__construct( $info );
88
89 $this->dbDomain = WikiMap::getCurrentWikiDbDomain();
90 $this->hasAccessibleSharedCache = true;
91
92 $this->hasSha1Storage = ( $info['storageLayout'] ?? null ) === 'sha1';
93 $this->dbProvider = MediaWikiServices::getInstance()->getConnectionProvider();
94
95 if ( $this->hasSha1Storage() ) {
96 $this->backend = new FileBackendDBRepoWrapper( [
97 'backend' => $this->backend,
98 'repoName' => $this->name,
99 'dbHandleFactory' => $this->getDBFactory()
100 ] );
101 }
102
103 foreach (
104 [
105 'useJsonMetadata',
106 'useSplitMetadata',
107 'splitMetadataThreshold',
108 'updateCompatibleMetadata',
109 'reserializeMetadata',
110 ] as $option
111 ) {
112 if ( isset( $info[$option] ) ) {
113 $this->$option = $info[$option];
114 }
115 }
116 }
117
122 public function newFileFromRow( $row ) {
123 if ( isset( $row->img_name ) ) {
124 return call_user_func( $this->fileFromRowFactory, $row, $this );
125 } elseif ( isset( $row->oi_name ) ) {
126 return call_user_func( $this->oldFileFromRowFactory, $row, $this );
127 } else {
128 throw new InvalidArgumentException( __METHOD__ . ': invalid row' );
129 }
130 }
131
137 public function newFromArchiveName( $title, $archiveName ) {
138 $title = File::normalizeTitle( $title );
139 return OldLocalFile::newFromArchiveName( $title, $this, $archiveName );
140 }
141
152 public function cleanupDeletedBatch( array $storageKeys ) {
153 if ( $this->hasSha1Storage() ) {
154 wfDebug( __METHOD__ . ": skipped because storage uses sha1 paths" );
155 return Status::newGood();
156 }
157
158 $backend = $this->backend; // convenience
159 $root = $this->getZonePath( 'deleted' );
160 $dbw = $this->getPrimaryDB();
161 $status = $this->newGood();
162 $storageKeys = array_unique( $storageKeys );
163 foreach ( $storageKeys as $key ) {
164 $hashPath = $this->getDeletedHashPath( $key );
165 $path = "$root/$hashPath$key";
166 $dbw->startAtomic( __METHOD__ );
167 // Check for usage in deleted/hidden files and preemptively
168 // lock the key to avoid any future use until we are finished.
169 $deleted = $this->deletedFileHasKey( $key, 'lock' );
170 $hidden = $this->hiddenFileHasKey( $key, 'lock' );
171 if ( !$deleted && !$hidden ) { // not in use now
172 wfDebug( __METHOD__ . ": deleting $key" );
173 $op = [ 'op' => 'delete', 'src' => $path ];
174 if ( !$backend->doOperation( $op )->isOK() ) {
175 $status->error( 'undelete-cleanup-error', $path );
176 $status->failCount++;
177 }
178 } else {
179 wfDebug( __METHOD__ . ": $key still in use" );
180 $status->successCount++;
181 }
182 $dbw->endAtomic( __METHOD__ );
183 }
184
185 return $status;
186 }
187
195 protected function deletedFileHasKey( $key, $lock = null ) {
196 $queryBuilder = $this->getPrimaryDB()->newSelectQueryBuilder()
197 ->select( '1' )
198 ->from( 'filearchive' )
199 ->where( [ 'fa_storage_group' => 'deleted', 'fa_storage_key' => $key ] );
200 if ( $lock === 'lock' ) {
201 $queryBuilder->forUpdate();
202 }
203 return (bool)$queryBuilder->caller( __METHOD__ )->fetchField();
204 }
205
213 protected function hiddenFileHasKey( $key, $lock = null ) {
214 $sha1 = self::getHashFromKey( $key );
215 $ext = File::normalizeExtension( substr( $key, strcspn( $key, '.' ) + 1 ) );
216
217 $dbw = $this->getPrimaryDB();
218 $queryBuilder = $dbw->newSelectQueryBuilder()
219 ->select( '1' )
220 ->from( 'oldimage' )
221 ->where( [
222 'oi_sha1' => $sha1,
223 $dbw->expr( 'oi_archive_name', IExpression::LIKE, new LikeValue( $dbw->anyString(), ".$ext" ) ),
224 $dbw->bitAnd( 'oi_deleted', File::DELETED_FILE ) => File::DELETED_FILE,
225 ] );
226 if ( $lock === 'lock' ) {
227 $queryBuilder->forUpdate();
228 }
229
230 return (bool)$queryBuilder->caller( __METHOD__ )->fetchField();
231 }
232
239 public static function getHashFromKey( $key ) {
240 $sha1 = strtok( $key, '.' );
241 if ( is_string( $sha1 ) && strlen( $sha1 ) === 32 && $sha1[0] === '0' ) {
242 $sha1 = substr( $sha1, 1 );
243 }
244 return $sha1;
245 }
246
253 public function checkRedirect( $title ) {
254 $title = File::normalizeTitle( $title, 'exception' );
255
256 $memcKey = $this->getSharedCacheKey( 'file-redirect', md5( $title->getDBkey() ) );
257 if ( $memcKey === false ) {
258 $memcKey = $this->getLocalCacheKey( 'file-redirect', md5( $title->getDBkey() ) );
259 $expiry = 300; // no invalidation, 5 minutes
260 } else {
261 $expiry = 86400; // has invalidation, 1 day
262 }
263
264 $method = __METHOD__;
265 $redirDbKey = $this->wanCache->getWithSetCallback(
266 $memcKey,
267 $expiry,
268 function ( $oldValue, &$ttl, array &$setOpts ) use ( $method, $title ) {
269 $dbr = $this->getReplicaDB(); // possibly remote DB
270
271 $setOpts += Database::getCacheSetOptions( $dbr );
272
273 $row = $dbr->newSelectQueryBuilder()
274 ->select( [ 'rd_namespace', 'rd_title' ] )
275 ->from( 'page' )
276 ->join( 'redirect', null, 'rd_from = page_id' )
277 ->where( [ 'page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey() ] )
278 ->caller( $method )->fetchRow();
279
280 return ( $row && $row->rd_namespace == NS_FILE )
281 ? Title::makeTitle( $row->rd_namespace, $row->rd_title )->getDBkey()
282 : ''; // negative cache
283 },
284 [ 'pcTTL' => WANObjectCache::TTL_PROC_LONG ]
285 );
286
287 // @note: also checks " " for b/c
288 if ( $redirDbKey !== ' ' && strval( $redirDbKey ) !== '' ) {
289 // Page is a redirect to another file
290 return Title::newFromText( $redirDbKey, NS_FILE );
291 }
292
293 return false; // no redirect
294 }
295
296 public function findFiles( array $items, $flags = 0 ) {
297 $finalFiles = []; // map of (DB key => corresponding File) for matches
298
299 $searchSet = []; // map of (normalized DB key => search params)
300 foreach ( $items as $item ) {
301 if ( is_array( $item ) ) {
302 $title = File::normalizeTitle( $item['title'] );
303 if ( $title ) {
304 $searchSet[$title->getDBkey()] = $item;
305 }
306 } else {
307 $title = File::normalizeTitle( $item );
308 if ( $title ) {
309 $searchSet[$title->getDBkey()] = [];
310 }
311 }
312 }
313
314 $fileMatchesSearch = static function ( File $file, array $search ) {
315 // Note: file name comparison done elsewhere (to handle redirects)
316
317 // Fallback to RequestContext::getMain should be replaced with a better
318 // way of setting the user that should be used; currently it needs to be
319 // set for each file individually. See T263033#6477586
320 $contextPerformer = RequestContext::getMain()->getAuthority();
321 $performer = ( !empty( $search['private'] ) && $search['private'] instanceof Authority )
322 ? $search['private']
323 : $contextPerformer;
324
325 return (
326 $file->exists() &&
327 (
328 ( empty( $search['time'] ) && !$file->isOld() ) ||
329 ( !empty( $search['time'] ) && $search['time'] === $file->getTimestamp() )
330 ) &&
331 ( !empty( $search['private'] ) || !$file->isDeleted( File::DELETED_FILE ) ) &&
332 $file->userCan( File::DELETED_FILE, $performer )
333 );
334 };
335
336 $applyMatchingFiles = function ( IResultWrapper $res, &$searchSet, &$finalFiles )
337 use ( $fileMatchesSearch, $flags )
338 {
339 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
340 $info = $this->getInfo();
341 foreach ( $res as $row ) {
342 $file = $this->newFileFromRow( $row );
343 // There must have been a search for this DB key, but this has to handle the
344 // cases were title capitalization is different on the client and repo wikis.
345 $dbKeysLook = [ strtr( $file->getName(), ' ', '_' ) ];
346 if ( !empty( $info['initialCapital'] ) ) {
347 // Search keys for "hi.png" and "Hi.png" should use the "Hi.png file"
348 $dbKeysLook[] = $contLang->lcfirst( $file->getName() );
349 }
350 foreach ( $dbKeysLook as $dbKey ) {
351 if ( isset( $searchSet[$dbKey] )
352 && $fileMatchesSearch( $file, $searchSet[$dbKey] )
353 ) {
354 $finalFiles[$dbKey] = ( $flags & FileRepo::NAME_AND_TIME_ONLY )
355 ? [ 'title' => $dbKey, 'timestamp' => $file->getTimestamp() ]
356 : $file;
357 unset( $searchSet[$dbKey] );
358 }
359 }
360 }
361 };
362
363 $dbr = $this->getReplicaDB();
364
365 // Query image table
366 $imgNames = [];
367 foreach ( $searchSet as $dbKey => $_ ) {
368 $imgNames[] = $this->getNameFromTitle( File::normalizeTitle( $dbKey ) );
369 }
370
371 if ( count( $imgNames ) ) {
372 $queryBuilder = FileSelectQueryBuilder::newForFile( $dbr );
373 $res = $queryBuilder->where( [ 'img_name' => $imgNames ] )->caller( __METHOD__ )->fetchResultSet();
374 $applyMatchingFiles( $res, $searchSet, $finalFiles );
375 }
376
377 // Query old image table
378 $oiConds = []; // WHERE clause array for each file
379 foreach ( $searchSet as $dbKey => $search ) {
380 if ( isset( $search['time'] ) ) {
381 $oiConds[] = $dbr
382 ->expr( 'oi_name', '=', $this->getNameFromTitle( File::normalizeTitle( $dbKey ) ) )
383 ->and( 'oi_timestamp', '=', $dbr->timestamp( $search['time'] ) );
384 }
385 }
386
387 if ( count( $oiConds ) ) {
388 $queryBuilder = FileSelectQueryBuilder::newForOldFile( $dbr );
389
390 $res = $queryBuilder->where( $dbr->orExpr( $oiConds ) )
391 ->caller( __METHOD__ )->fetchResultSet();
392 $applyMatchingFiles( $res, $searchSet, $finalFiles );
393 }
394
395 // Check for redirects...
396 foreach ( $searchSet as $dbKey => $search ) {
397 if ( !empty( $search['ignoreRedirect'] ) ) {
398 continue;
399 }
400
401 $title = File::normalizeTitle( $dbKey );
402 $redir = $this->checkRedirect( $title ); // hopefully hits memcached
403
404 if ( $redir && $redir->getNamespace() === NS_FILE ) {
405 $file = $this->newFile( $redir );
406 if ( $file && $fileMatchesSearch( $file, $search ) ) {
407 $file->redirectedFrom( $title->getDBkey() );
408 if ( $flags & FileRepo::NAME_AND_TIME_ONLY ) {
409 $finalFiles[$dbKey] = [
410 'title' => $file->getTitle()->getDBkey(),
411 'timestamp' => $file->getTimestamp()
412 ];
413 } else {
414 $finalFiles[$dbKey] = $file;
415 }
416 }
417 }
418 }
419
420 return $finalFiles;
421 }
422
430 public function findBySha1( $hash ) {
431 $queryBuilder = FileSelectQueryBuilder::newForFile( $this->getReplicaDB() );
432 $res = $queryBuilder->where( [ 'img_sha1' => $hash ] )
433 ->orderBy( 'img_name' )
434 ->caller( __METHOD__ )->fetchResultSet();
435
436 $result = [];
437 foreach ( $res as $row ) {
438 $result[] = $this->newFileFromRow( $row );
439 }
440 $res->free();
441
442 return $result;
443 }
444
454 public function findBySha1s( array $hashes ) {
455 if ( $hashes === [] ) {
456 return []; // empty parameter
457 }
458
459 $dbr = $this->getReplicaDB();
460 $queryBuilder = FileSelectQueryBuilder::newForFile( $dbr );
461
462 $queryBuilder->where( [ 'img_sha1' => $hashes ] )
463 ->orderBy( 'img_name' );
464 $res = $queryBuilder->caller( __METHOD__ )->fetchResultSet();
465
466 $result = [];
467 foreach ( $res as $row ) {
468 $file = $this->newFileFromRow( $row );
469 $result[$file->getSha1()][] = $file;
470 }
471 $res->free();
472
473 return $result;
474 }
475
483 public function findFilesByPrefix( $prefix, $limit ) {
484 $dbr = $this->getReplicaDB();
485 $queryBuilder = FileSelectQueryBuilder::newForFile( $dbr );
486
487 $queryBuilder
488 ->where( $dbr->expr( 'img_name', IExpression::LIKE, new LikeValue( $prefix, $dbr->anyString() ) ) )
489 ->orderBy( 'img_name' )
490 ->limit( intval( $limit ) );
491 $res = $queryBuilder->caller( __METHOD__ )->fetchResultSet();
492
493 // Build file objects
494 $files = [];
495 foreach ( $res as $row ) {
496 $files[] = $this->newFileFromRow( $row );
497 }
498
499 return $files;
500 }
501
506 public function getReplicaDB() {
507 return $this->dbProvider->getReplicaDatabase();
508 }
509
515 public function getPrimaryDB() {
516 return $this->dbProvider->getPrimaryDatabase();
517 }
518
523 protected function getDBFactory() {
524 // TODO: DB_REPLICA/DB_PRIMARY shouldn't be passed around
525 return static function ( $index ) {
526 if ( $index === DB_PRIMARY ) {
527 return MediaWikiServices::getInstance()->getConnectionProvider()->getPrimaryDatabase();
528 } else {
529 return MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
530 }
531 };
532 }
533
540 protected function hasAcessibleSharedCache() {
541 return $this->hasAccessibleSharedCache;
542 }
543
544 public function getSharedCacheKey( $kClassSuffix, ...$components ) {
545 // T267668: do not include the repo name in the key
546 return $this->hasAcessibleSharedCache()
547 ? $this->wanCache->makeGlobalKey(
548 'filerepo-' . $kClassSuffix,
549 $this->dbDomain,
550 ...$components
551 )
552 : false;
553 }
554
561 public function invalidateImageRedirect( $title ) {
562 $key = $this->getSharedCacheKey( 'file-redirect', md5( $title->getDBkey() ) );
563 if ( $key ) {
564 $this->getPrimaryDB()->onTransactionPreCommitOrIdle(
565 function () use ( $key ) {
566 $this->wanCache->delete( $key );
567 },
568 __METHOD__
569 );
570 }
571 }
572
573 public function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
574 return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
575 }
576
577 public function storeBatch( array $triplets, $flags = 0 ) {
578 return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
579 }
580
581 public function cleanupBatch( array $files, $flags = 0 ) {
582 return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
583 }
584
585 public function publish(
586 $src,
587 $dstRel,
588 $archiveRel,
589 $flags = 0,
590 array $options = []
591 ) {
592 return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
593 }
594
595 public function publishBatch( array $ntuples, $flags = 0 ) {
596 return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
597 }
598
599 public function delete( $srcRel, $archiveRel ) {
600 return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
601 }
602
603 public function deleteBatch( array $sourceDestPairs ) {
604 return $this->skipWriteOperationIfSha1( __FUNCTION__, func_get_args() );
605 }
606
614 protected function skipWriteOperationIfSha1( $function, array $args ) {
615 $this->assertWritableRepo(); // fail out if read-only
616
617 if ( $this->hasSha1Storage() ) {
618 wfDebug( __METHOD__ . ": skipped because storage uses sha1 paths" );
619 return Status::newGood();
620 } else {
621 return parent::$function( ...$args );
622 }
623 }
624
634 public function isJsonMetadataEnabled() {
635 return $this->useJsonMetadata;
636 }
637
644 public function isSplitMetadataEnabled() {
645 return $this->isJsonMetadataEnabled() && $this->useSplitMetadata;
646 }
647
654 public function getSplitMetadataThreshold() {
655 return $this->splitMetadataThreshold;
656 }
657
658 public function isMetadataUpdateEnabled() {
659 return $this->updateCompatibleMetadata;
660 }
661
663 return $this->reserializeMetadata;
664 }
665
672 public function getBlobStore(): ?BlobStore {
673 if ( !$this->blobStore ) {
674 $this->blobStore = MediaWikiServices::getInstance()->getBlobStoreFactory()
675 ->newBlobStore( $this->dbDomain );
676 }
677 return $this->blobStore;
678 }
679}
const NS_FILE
Definition Defines.php:71
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:81
Proxy backend that manages file layout rewriting for FileRepo.
Base class for file repositories.
Definition FileRepo.php:52
assertWritableRepo()
Throw an exception if this repo is read-only by design.
newGood( $value=null)
Create a new good result.
const NAME_AND_TIME_ONLY
Definition FileRepo.php:58
getLocalCacheKey( $kClassSuffix,... $components)
Get a site-local, repository-qualified, WAN cache key.
hasSha1Storage()
Returns whether or not storage is SHA-1 based.
FileBackend $backend
Definition FileRepo.php:75
getZonePath( $zone)
Get the storage path corresponding to one of the zones.
Definition FileRepo.php:398
getDeletedHashPath( $key)
Get a relative path for a deletion archive key, e.g.
getNameFromTitle( $title)
Get the name of a file from its title.
Definition FileRepo.php:716
newFile( $title, $time=false)
Create a new File object from the local repository.
Definition FileRepo.php:422
getInfo()
Return information about the repository.
Implements some public methods and some protected utility functions which are required by multiple ch...
Definition File.php:74
getTimestamp()
Get the 14-character timestamp of the file upload.
Definition File.php:2308
getName()
Return the name of this file.
Definition File.php:342
exists()
Returns true if file exists in the repository.
Definition File.php:1018
isOld()
Returns true if the image is an old version STUB.
Definition File.php:2062
getTitle()
Return the associated title object.
Definition File.php:372
redirectedFrom(string $from)
Definition File.php:2443
isDeleted( $field)
Is this file a "deleted" file in a private archive? STUB.
Definition File.php:2074
userCan( $field, Authority $performer)
Determine if the current user is allowed to view a particular field of this file, if it's marked as d...
Definition File.php:2363
Local repository that stores files in the local filesystem and registers them in the wiki's own datab...
Definition LocalRepo.php:48
skipWriteOperationIfSha1( $function, array $args)
Skips the write operation if storage is sha1-based, executes it normally otherwise.
int null $splitMetadataThreshold
Definition LocalRepo.php:78
getDBFactory()
Get a callback to get a DB handle given an index (DB_REPLICA/DB_PRIMARY)
getSharedCacheKey( $kClassSuffix,... $components)
Get a global, repository-qualified, WAN cache key.
isMetadataUpdateEnabled()
newFileFromRow( $row)
isSplitMetadataEnabled()
Returns true if files should split up large metadata, storing parts of it in the BlobStore.
deletedFileHasKey( $key, $lock=null)
Check if a deleted (filearchive) file has this sha1 key.
callable $oldFileFactoryKey
Definition LocalRepo.php:60
callable $oldFileFactory
Definition LocalRepo.php:58
isJsonMetadataEnabled()
Returns true if files should store metadata in JSON format.
cleanupBatch(array $files, $flags=0)
Deletes a batch of files.
publishBatch(array $ntuples, $flags=0)
Publish a batch of files.
findFiles(array $items, $flags=0)
Find many files at once.
findFilesByPrefix( $prefix, $limit)
Return an array of files where the name starts with $prefix.
findBySha1s(array $hashes)
Get an array of arrays or iterators of file objects for files that have the given SHA-1 content hashe...
getBlobStore()
Get a BlobStore for storing and retrieving large metadata, or null if that can't be done.
IConnectionProvider $dbProvider
Definition LocalRepo.php:64
callable $oldFileFromRowFactory
Definition LocalRepo.php:56
string $dbDomain
DB domain of the repo wiki.
Definition LocalRepo.php:63
BlobStore $blobStore
Definition LocalRepo.php:69
bool $useJsonMetadata
Definition LocalRepo.php:72
invalidateImageRedirect( $title)
Invalidates image redirect cache related to that image.
cleanupDeletedBatch(array $storageKeys)
Delete files in the deleted directory if they are not referenced in the filearchive table.
bool $updateCompatibleMetadata
Definition LocalRepo.php:81
getPrimaryDB()
Get a connection to the primary DB.
checkRedirect( $title)
Checks if there is a redirect named as $title.
hasAcessibleSharedCache()
Check whether the repo has a shared cache, accessible from the current site context.
bool $hasAccessibleSharedCache
Whether shared cache keys are exposed/accessible.
Definition LocalRepo.php:66
callable $fileFactoryKey
Definition LocalRepo.php:52
getReplicaDB()
Get a connection to the replica DB.
store( $srcPath, $dstZone, $dstRel, $flags=0)
Store a file to a given destination.
publish( $src, $dstRel, $archiveRel, $flags=0, array $options=[])
Copy or move a file either from a storage path, virtual URL, or file system path, into this repositor...
storeBatch(array $triplets, $flags=0)
Store a batch of files.
getSplitMetadataThreshold()
Get the threshold above which metadata items should be split into separate storage,...
callable $fileFromRowFactory
Definition LocalRepo.php:54
__construct(array $info=null)
Definition LocalRepo.php:86
deleteBatch(array $sourceDestPairs)
Move a group of files to the deletion archive.
hiddenFileHasKey( $key, $lock=null)
Check if a hidden (revision delete) file has this sha1 key.
static getHashFromKey( $key)
Gets the SHA1 hash from a storage key.
newFromArchiveName( $title, $archiveName)
bool $reserializeMetadata
Definition LocalRepo.php:84
isMetadataReserializeEnabled()
callable $fileFactory
Definition LocalRepo.php:50
bool $useSplitMetadata
Definition LocalRepo.php:75
findBySha1( $hash)
Get an array or iterator of file objects for files that have a given SHA-1 content hash.
Group all the pieces relevant to the context of a request into one instance.
Service locator for MediaWiki core services.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:54
Represents a title within MediaWiki.
Definition Title.php:79
Tools for dealing with other locally-hosted wikis.
Definition WikiMap.php:31
doOperation(array $op, array $opts=[])
Same as doOperations() except it takes a single operation.
Content of like value.
Definition LikeValue.php:14
Represents the target of a wiki link.
Interface for objects (potentially) representing an editable wiki page.
This interface represents the authority associated with the current execution context,...
Definition Authority.php:37
Service for loading and storing data blobs.
Definition BlobStore.php:33
Provide primary and replica IDatabase connections.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:39
A database connection without write operations.
Result wrapper for grabbing data queried from an IDatabase object.
const DB_PRIMARY
Definition defines.php:28