MediaWiki  1.23.2
LocalRepo.php
Go to the documentation of this file.
1 <?php
31 class LocalRepo extends FileRepo {
33  protected $fileFactory = array( 'LocalFile', 'newFromTitle' );
34 
36  protected $fileFactoryKey = array( 'LocalFile', 'newFromKey' );
37 
39  protected $fileFromRowFactory = array( 'LocalFile', 'newFromRow' );
40 
42  protected $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
43 
45  protected $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' );
46 
48  protected $oldFileFactoryKey = array( 'OldLocalFile', 'newFromKey' );
49 
55  function newFileFromRow( $row ) {
56  if ( isset( $row->img_name ) ) {
57  return call_user_func( $this->fileFromRowFactory, $row, $this );
58  } elseif ( isset( $row->oi_name ) ) {
59  return call_user_func( $this->oldFileFromRowFactory, $row, $this );
60  } else {
61  throw new MWException( __METHOD__ . ': invalid row' );
62  }
63  }
64 
70  function newFromArchiveName( $title, $archiveName ) {
71  return OldLocalFile::newFromArchiveName( $title, $this, $archiveName );
72  }
73 
84  function cleanupDeletedBatch( array $storageKeys ) {
85  $backend = $this->backend; // convenience
86  $root = $this->getZonePath( 'deleted' );
87  $dbw = $this->getMasterDB();
88  $status = $this->newGood();
89  $storageKeys = array_unique( $storageKeys );
90  foreach ( $storageKeys as $key ) {
91  $hashPath = $this->getDeletedHashPath( $key );
92  $path = "$root/$hashPath$key";
93  $dbw->begin( __METHOD__ );
94  // Check for usage in deleted/hidden files and pre-emptively
95  // lock the key to avoid any future use until we are finished.
96  $deleted = $this->deletedFileHasKey( $key, 'lock' );
97  $hidden = $this->hiddenFileHasKey( $key, 'lock' );
98  if ( !$deleted && !$hidden ) { // not in use now
99  wfDebug( __METHOD__ . ": deleting $key\n" );
100  $op = array( 'op' => 'delete', 'src' => $path );
101  if ( !$backend->doOperation( $op )->isOK() ) {
102  $status->error( 'undelete-cleanup-error', $path );
103  $status->failCount++;
104  }
105  } else {
106  wfDebug( __METHOD__ . ": $key still in use\n" );
107  $status->successCount++;
108  }
109  $dbw->commit( __METHOD__ );
110  }
111 
112  return $status;
113  }
114 
122  protected function deletedFileHasKey( $key, $lock = null ) {
123  $options = ( $lock === 'lock' ) ? array( 'FOR UPDATE' ) : array();
124 
125  $dbw = $this->getMasterDB();
126 
127  return (bool)$dbw->selectField( 'filearchive', '1',
128  array( 'fa_storage_group' => 'deleted', 'fa_storage_key' => $key ),
129  __METHOD__, $options
130  );
131  }
132 
140  protected function hiddenFileHasKey( $key, $lock = null ) {
141  $options = ( $lock === 'lock' ) ? array( 'FOR UPDATE' ) : array();
142 
143  $sha1 = self::getHashFromKey( $key );
144  $ext = File::normalizeExtension( substr( $key, strcspn( $key, '.' ) + 1 ) );
145 
146  $dbw = $this->getMasterDB();
147 
148  return (bool)$dbw->selectField( 'oldimage', '1',
149  array( 'oi_sha1' => $sha1,
150  'oi_archive_name ' . $dbw->buildLike( $dbw->anyString(), ".$ext" ),
151  $dbw->bitAnd( 'oi_deleted', File::DELETED_FILE ) => File::DELETED_FILE ),
152  __METHOD__, $options
153  );
154  }
155 
162  public static function getHashFromKey( $key ) {
163  return strtok( $key, '.' );
164  }
165 
172  function checkRedirect( Title $title ) {
173  global $wgMemc;
174 
175  $title = File::normalizeTitle( $title, 'exception' );
176 
177  $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) );
178  if ( $memcKey === false ) {
179  $memcKey = $this->getLocalCacheKey( 'image_redirect', md5( $title->getDBkey() ) );
180  $expiry = 300; // no invalidation, 5 minutes
181  } else {
182  $expiry = 86400; // has invalidation, 1 day
183  }
184  $cachedValue = $wgMemc->get( $memcKey );
185  if ( $cachedValue === ' ' || $cachedValue === '' ) {
186  // Does not exist
187  return false;
188  } elseif ( strval( $cachedValue ) !== '' && $cachedValue !== ' PURGED' ) {
189  return Title::newFromText( $cachedValue, NS_FILE );
190  } // else $cachedValue is false or null: cache miss
191 
192  $id = $this->getArticleID( $title );
193  if ( !$id ) {
194  $wgMemc->add( $memcKey, " ", $expiry );
195 
196  return false;
197  }
198  $dbr = $this->getSlaveDB();
199  $row = $dbr->selectRow(
200  'redirect',
201  array( 'rd_title', 'rd_namespace' ),
202  array( 'rd_from' => $id ),
203  __METHOD__
204  );
205 
206  if ( $row && $row->rd_namespace == NS_FILE ) {
207  $targetTitle = Title::makeTitle( $row->rd_namespace, $row->rd_title );
208  $wgMemc->add( $memcKey, $targetTitle->getDBkey(), $expiry );
209 
210  return $targetTitle;
211  } else {
212  $wgMemc->add( $memcKey, '', $expiry );
213 
214  return false;
215  }
216  }
217 
225  protected function getArticleID( $title ) {
226  if ( !$title instanceof Title ) {
227  return 0;
228  }
229  $dbr = $this->getSlaveDB();
230  $id = $dbr->selectField(
231  'page', // Table
232  'page_id', //Field
233  array( //Conditions
234  'page_namespace' => $title->getNamespace(),
235  'page_title' => $title->getDBkey(),
236  ),
237  __METHOD__ //Function name
238  );
239 
240  return $id;
241  }
242 
243  public function findFiles( array $items, $flags = 0 ) {
244  $finalFiles = array(); // map of (DB key => corresponding File) for matches
245 
246  $searchSet = array(); // map of (normalized DB key => search params)
247  foreach ( $items as $item ) {
248  if ( is_array( $item ) ) {
249  $title = File::normalizeTitle( $item['title'] );
250  if ( $title ) {
251  $searchSet[$title->getDBkey()] = $item;
252  }
253  } else {
254  $title = File::normalizeTitle( $item );
255  if ( $title ) {
256  $searchSet[$title->getDBkey()] = array();
257  }
258  }
259  }
260 
261  $fileMatchesSearch = function ( File $file, array $search ) {
262  // Note: file name comparison done elsewhere (to handle redirects)
263  $user = ( !empty( $search['private'] ) && $search['private'] instanceof User )
264  ? $search['private']
265  : null;
266 
267  return (
268  $file->exists() &&
269  (
270  ( empty( $search['time'] ) && !$file->isOld() ) ||
271  ( !empty( $search['time'] ) && $search['time'] === $file->getTimestamp() )
272  ) &&
273  ( !empty( $search['private'] ) || !$file->isDeleted( File::DELETED_FILE ) ) &&
274  $file->userCan( File::DELETED_FILE, $user )
275  );
276  };
277 
278  $repo = $this;
279  $applyMatchingFiles = function ( ResultWrapper $res, &$searchSet, &$finalFiles )
280  use ( $repo, $fileMatchesSearch, $flags )
281  {
283  $info = $repo->getInfo();
284  foreach ( $res as $row ) {
285  $file = $repo->newFileFromRow( $row );
286  // There must have been a search for this DB key, but this has to handle the
287  // cases were title capitalization is different on the client and repo wikis.
288  $dbKeysLook = array( str_replace( ' ', '_', $file->getName() ) );
289  if ( !empty( $info['initialCapital'] ) ) {
290  // Search keys for "hi.png" and "Hi.png" should use the "Hi.png file"
291  $dbKeysLook[] = $wgContLang->lcfirst( $file->getName() );
292  }
293  foreach ( $dbKeysLook as $dbKey ) {
294  if ( isset( $searchSet[$dbKey] )
295  && $fileMatchesSearch( $file, $searchSet[$dbKey] )
296  ) {
297  $finalFiles[$dbKey] = ( $flags & FileRepo::NAME_AND_TIME_ONLY )
298  ? array( 'title' => $dbKey, 'timestamp' => $file->getTimestamp() )
299  : $file;
300  unset( $searchSet[$dbKey] );
301  }
302  }
303  }
304  };
305 
306  $dbr = $this->getSlaveDB();
307 
308  // Query image table
309  $imgNames = array();
310  foreach ( array_keys( $searchSet ) as $dbKey ) {
311  $imgNames[] = $this->getNameFromTitle( File::normalizeTitle( $dbKey ) );
312  }
313 
314  if ( count( $imgNames ) ) {
315  $res = $dbr->select( 'image',
316  LocalFile::selectFields(), array( 'img_name' => $imgNames ), __METHOD__ );
317  $applyMatchingFiles( $res, $searchSet, $finalFiles );
318  }
319 
320  // Query old image table
321  $oiConds = array(); // WHERE clause array for each file
322  foreach ( $searchSet as $dbKey => $search ) {
323  if ( isset( $search['time'] ) ) {
324  $oiConds[] = $dbr->makeList(
325  array(
326  'oi_name' => $this->getNameFromTitle( File::normalizeTitle( $dbKey ) ),
327  'oi_timestamp' => $dbr->timestamp( $search['time'] )
328  ),
329  LIST_AND
330  );
331  }
332  }
333 
334  if ( count( $oiConds ) ) {
335  $res = $dbr->select( 'oldimage',
336  OldLocalFile::selectFields(), $dbr->makeList( $oiConds, LIST_OR ), __METHOD__ );
337  $applyMatchingFiles( $res, $searchSet, $finalFiles );
338  }
339 
340  // Check for redirects...
341  foreach ( $searchSet as $dbKey => $search ) {
342  if ( !empty( $search['ignoreRedirect'] ) ) {
343  continue;
344  }
345 
346  $title = File::normalizeTitle( $dbKey );
347  $redir = $this->checkRedirect( $title ); // hopefully hits memcached
348 
349  if ( $redir && $redir->getNamespace() == NS_FILE ) {
350  $file = $this->newFile( $redir );
351  if ( $file && $fileMatchesSearch( $file, $search ) ) {
352  $file->redirectedFrom( $title->getDBkey() );
354  $finalFiles[$dbKey] = array(
355  'title' => $file->getTitle()->getDBkey(),
356  'timestamp' => $file->getTimestamp()
357  );
358  } else {
359  $finalFiles[$dbKey] = $file;
360  }
361  }
362  }
363  }
364 
365  return $finalFiles;
366  }
367 
375  function findBySha1( $hash ) {
376  $dbr = $this->getSlaveDB();
377  $res = $dbr->select(
378  'image',
380  array( 'img_sha1' => $hash ),
381  __METHOD__,
382  array( 'ORDER BY' => 'img_name' )
383  );
384 
385  $result = array();
386  foreach ( $res as $row ) {
387  $result[] = $this->newFileFromRow( $row );
388  }
389  $res->free();
390 
391  return $result;
392  }
393 
403  function findBySha1s( array $hashes ) {
404  if ( !count( $hashes ) ) {
405  return array(); //empty parameter
406  }
407 
408  $dbr = $this->getSlaveDB();
409  $res = $dbr->select(
410  'image',
412  array( 'img_sha1' => $hashes ),
413  __METHOD__,
414  array( 'ORDER BY' => 'img_name' )
415  );
416 
417  $result = array();
418  foreach ( $res as $row ) {
419  $file = $this->newFileFromRow( $row );
420  $result[$file->getSha1()][] = $file;
421  }
422  $res->free();
423 
424  return $result;
425  }
426 
434  public function findFilesByPrefix( $prefix, $limit ) {
435  $selectOptions = array( 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) );
436 
437  // Query database
438  $dbr = $this->getSlaveDB();
439  $res = $dbr->select(
440  'image',
442  'img_name ' . $dbr->buildLike( $prefix, $dbr->anyString() ),
443  __METHOD__,
444  $selectOptions
445  );
446 
447  // Build file objects
448  $files = array();
449  foreach ( $res as $row ) {
450  $files[] = $this->newFileFromRow( $row );
451  }
452 
453  return $files;
454  }
455 
460  function getSlaveDB() {
461  return wfGetDB( DB_SLAVE );
462  }
463 
468  function getMasterDB() {
469  return wfGetDB( DB_MASTER );
470  }
471 
479  function getSharedCacheKey( /*...*/ ) {
480  $args = func_get_args();
481 
482  return call_user_func_array( 'wfMemcKey', $args );
483  }
484 
491  function invalidateImageRedirect( Title $title ) {
492  global $wgMemc;
493  $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) );
494  if ( $memcKey ) {
495  // Set a temporary value for the cache key, to ensure
496  // that this value stays purged long enough so that
497  // it isn't refreshed with a stale value due to a
498  // lagged slave.
499  $wgMemc->set( $memcKey, ' PURGED', 12 );
500  }
501  }
502 
509  function getInfo() {
510  global $wgFavicon;
511 
512  return array_merge( parent::getInfo(), array(
513  'favicon' => wfExpandUrl( $wgFavicon ),
514  ) );
515  }
516 }
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
DB_MASTER
const DB_MASTER
Definition: Defines.php:56
LocalRepo\getInfo
getInfo()
Return information about the repository.
Definition: LocalRepo.php:503
LocalRepo\newFileFromRow
newFileFromRow( $row)
Definition: LocalRepo.php:49
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$files
$files
Definition: importImages.php:67
FileRepo\newGood
newGood( $value=null)
Create a new good result.
Definition: FileRepo.php:1691
LocalRepo\getMasterDB
getMasterDB()
Get a connection to the master DB.
Definition: LocalRepo.php:462
$wgMemc
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $wgMemc
Definition: globals.txt:25
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3650
FileBackend\doOperation
doOperation(array $op, array $opts=array())
Same as doOperations() except it takes a single operation.
Definition: FileBackend.php:402
LocalRepo\deletedFileHasKey
deletedFileHasKey( $key, $lock=null)
Check if a deleted (filearchive) file has this sha1 key.
Definition: LocalRepo.php:116
NS_FILE
const NS_FILE
Definition: Defines.php:85
$limit
if( $sleep) $limit
Definition: importImages.php:99
FileRepo\getZonePath
getZonePath( $zone)
Get the storage path corresponding to one of the zones.
Definition: FileRepo.php:355
OldLocalFile\selectFields
static selectFields()
Fields in the oldimage table.
Definition: OldLocalFile.php:106
FileRepo\$backend
FileBackend $backend
Definition: FileRepo.php:50
LocalRepo\$fileFactory
array $fileFactory
Definition: LocalRepo.php:32
$wgContLang
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
Definition: design.txt:56
$flags
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition: hooks.txt:2113
LocalRepo\hiddenFileHasKey
hiddenFileHasKey( $key, $lock=null)
Check if a hidden (revision delete) file has this sha1 key.
Definition: LocalRepo.php:134
LocalRepo\getHashFromKey
static getHashFromKey( $key)
Gets the SHA1 hash from a storage key.
Definition: LocalRepo.php:156
File\normalizeTitle
static normalizeTitle( $title, $exception=false)
Given a string or Title object return either a valid Title object with namespace NS_FILE or null.
Definition: File.php:161
LIST_AND
const LIST_AND
Definition: Defines.php:203
$dbr
$dbr
Definition: testCompression.php:48
FileRepo
Base class for file repositories.
Definition: FileRepo.php:37
File\normalizeExtension
static normalizeExtension( $ext)
Normalize a file extension to the common form, and ensure it's clean.
Definition: File.php:200
File
Implements some public methods and some protected utility functions which are required by multiple ch...
Definition: File.php:50
LIST_OR
const LIST_OR
Definition: Defines.php:206
FileRepo\newFile
newFile( $title, $time=false)
Create a new File object from the local repository.
Definition: FileRepo.php:379
MWException
MediaWiki exception.
Definition: MWException.php:26
LocalRepo\getSlaveDB
getSlaveDB()
Get a connection to the slave DB.
Definition: LocalRepo.php:454
LocalRepo\$oldFileFactoryKey
array $oldFileFactoryKey
Definition: LocalRepo.php:42
LocalRepo\$oldFileFromRowFactory
array $oldFileFromRowFactory
Definition: LocalRepo.php:38
LocalRepo\invalidateImageRedirect
invalidateImageRedirect(Title $title)
Invalidates image redirect cache related to that image.
Definition: LocalRepo.php:485
LocalRepo\getArticleID
getArticleID( $title)
Function link Title::getArticleID().
Definition: LocalRepo.php:219
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
LocalRepo\findFiles
findFiles(array $items, $flags=0)
Find many files at once.
Definition: LocalRepo.php:237
FileRepo\getNameFromTitle
getNameFromTitle(Title $title)
Get the name of a file from its title object.
Definition: FileRepo.php:622
$options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:1530
wfDebug
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:933
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
LocalRepo\newFromArchiveName
newFromArchiveName( $title, $archiveName)
Definition: LocalRepo.php:64
LocalRepo\findBySha1s
findBySha1s(array $hashes)
Get an array of arrays or iterators of file objects for files that have the given SHA-1 content hashe...
Definition: LocalRepo.php:397
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
FileRepo\getLocalCacheKey
getLocalCacheKey()
Get a key for this repo in the local cache domain.
Definition: FileRepo.php:1776
LocalRepo\findFilesByPrefix
findFilesByPrefix( $prefix, $limit)
Return an array of files where the name starts with $prefix.
Definition: LocalRepo.php:428
LocalRepo\checkRedirect
checkRedirect(Title $title)
Checks if there is a redirect named as $title.
Definition: LocalRepo.php:166
$hash
return false to override stock group addition can be modified try getUserPermissionsErrors userCan checks are continued by internal code can override on output return false to not delete it return false to override the default password checks & $hash
Definition: hooks.txt:2697
LocalRepo\$fileFactoryKey
array $fileFactoryKey
Definition: LocalRepo.php:34
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
$args
if( $line===false) $args
Definition: cdb.php:62
LocalFile\selectFields
static selectFields()
Fields in the image table.
Definition: LocalFile.php:163
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:55
Title
Represents a title within MediaWiki.
Definition: Title.php:35
LocalRepo\cleanupDeletedBatch
cleanupDeletedBatch(array $storageKeys)
Delete files in the deleted directory if they are not referenced in the filearchive table.
Definition: LocalRepo.php:78
$ext
$ext
Definition: NoLocalSettings.php:34
LocalRepo\getSharedCacheKey
getSharedCacheKey()
Get a key on the primary cache for this repository.
Definition: LocalRepo.php:473
$path
$path
Definition: NoLocalSettings.php:35
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
User
User
Definition: All_system_messages.txt:425
LocalRepo\findBySha1
findBySha1( $hash)
Get an array or iterator of file objects for files that have a given SHA-1 content hash.
Definition: LocalRepo.php:369
LocalRepo\$oldFileFactory
array $oldFileFactory
Definition: LocalRepo.php:40
$hashes
$hashes
Definition: testCompression.php:62
File\DELETED_FILE
const DELETED_FILE
Definition: File.php:52
LocalRepo\$fileFromRowFactory
array $fileFromRowFactory
Definition: LocalRepo.php:36
$res
$res
Definition: database.txt:21
OldLocalFile\newFromArchiveName
static newFromArchiveName( $title, $repo, $archiveName)
Definition: OldLocalFile.php:59
FileRepo\getDeletedHashPath
getDeletedHashPath( $key)
Get a relative path for a deletion archive key, e.g.
Definition: FileRepo.php:1465
FileRepo\NAME_AND_TIME_ONLY
const NAME_AND_TIME_ONLY
Definition: FileRepo.php:43
LocalRepo
A repository that stores files in the local filesystem and registers them in the wiki's own database.
Definition: LocalRepo.php:31
ResultWrapper
Result wrapper for grabbing data queried by someone else.
Definition: DatabaseUtility.php:99
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:497