r104355 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104354‎ | r104355 | r104356 >
Date:18:55, 27 November 2011
Author:aaron
Status:deferred
Tags:
Comment:
* Made LocalRepo extend FileRepo directly
* Documentation and w/s cleanups
Modified paths:
  • /branches/FileBackend/phase3/includes/filerepo/FSRepo.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/LocalRepo.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/filerepo/FSRepo.php
@@ -18,6 +18,5 @@
1919 if ( !( $this->backend instanceof FSFileBackend ) ) {
2020 throw new MWException( "FSRepo only supports FSFileBackend." );
2121 }
22 - //wfDeprecated( "FSRepo is deprecated, use FileRepo instead." );
2322 }
2423 }
Index: branches/FileBackend/phase3/includes/filerepo/LocalRepo.php
@@ -10,9 +10,10 @@
1111 /**
1212 * A repository that stores files in the local filesystem and registers them
1313 * in the wiki's own database. This is the most commonly used repository class.
 14+ *
1415 * @ingroup FileRepo
1516 */
16 -class LocalRepo extends FSRepo {
 17+class LocalRepo extends FileRepo {
1718 var $fileFactory = array( 'LocalFile', 'newFromTitle' );
1819 var $fileFactoryKey = array( 'LocalFile', 'newFromKey' );
1920 var $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' );
@@ -22,7 +23,7 @@
2324
2425 /**
2526 * @throws MWException
26 - * @param $row
 27+ * @param $row
2728 * @return File
2829 */
2930 function newFileFromRow( $row ) {
@@ -87,6 +88,7 @@
8889
8990 /**
9091 * Check if a deleted (filearchive) file has this sha1 key
 92+ *
9193 * @param $key String File storage key (base-36 sha1 key with file extension)
9294 * @param $lock String|null Use "lock" to lock the row via FOR UPDATE
9395 * @return bool File with this key is in use
@@ -103,6 +105,7 @@
104106
105107 /**
106108 * Check if a hidden (revision delete) file has this sha1 key
 109+ *
107110 * @param $key String File storage key (base-36 sha1 key with file extension)
108111 * @param $lock String|null Use "lock" to lock the row via FOR UPDATE
109112 * @return bool File with this key is in use
@@ -185,6 +188,7 @@
186189 /**
187190 * Function link Title::getArticleID().
188191 * We can't say Title object, what database it should use, so we duplicate that function here.
 192+ *
189193 * @param $title Title
190194 */
191195 protected function getArticleID( $title ) {
@@ -193,13 +197,13 @@
194198 }
195199 $dbr = $this->getSlaveDB();
196200 $id = $dbr->selectField(
197 - 'page', // Table
198 - 'page_id', //Field
199 - array( //Conditions
 201+ 'page', // Table
 202+ 'page_id', //Field
 203+ array( //Conditions
200204 'page_namespace' => $title->getNamespace(),
201205 'page_title' => $title->getDBkey(),
202206 ),
203 - __METHOD__ //Function name
 207+ __METHOD__ //Function name
204208 );
205209 return $id;
206210 }
@@ -207,6 +211,8 @@
208212 /**
209213 * Get an array or iterator of file objects for files that have a given
210214 * SHA-1 content hash.
 215+ *
 216+ * @param string
211217 * @return Array
212218 */
213219 function findBySha1( $hash ) {
@@ -244,6 +250,7 @@
245251 * Get a key on the primary cache for this repository.
246252 * Returns false if the repository's cache is not accessible at this site.
247253 * The parameters are the parts of the key, as for wfMemcKey().
 254+ *
248255 * @return string
249256 */
250257 function getSharedCacheKey( /*...*/ ) {

Status & tagging log