Index: trunk/phase3/includes/filerepo/OldLocalFile.php |
— | — | @@ -34,7 +34,14 @@ |
35 | 35 | $file->loadFromRow( $row, 'oi_' ); |
36 | 36 | return $file; |
37 | 37 | } |
38 | | - |
| 38 | + |
| 39 | + /** |
| 40 | + * @static |
| 41 | + * @param $sha1 |
| 42 | + * @param $repo LocalRepo |
| 43 | + * @param bool $timestamp |
| 44 | + * @return bool|OldLocalFile |
| 45 | + */ |
39 | 46 | static function newFromKey( $sha1, $repo, $timestamp = false ) { |
40 | 47 | $conds = array( 'oi_sha1' => $sha1 ); |
41 | 48 | if( $timestamp ) { |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -83,6 +83,9 @@ |
84 | 84 | /** |
85 | 85 | * Create a LocalFile from a SHA-1 key |
86 | 86 | * Do not call this except from inside a repo class. |
| 87 | + * @param $sha1 |
| 88 | + * @param $repo LocalRepo |
| 89 | + * @param $timestamp |
87 | 90 | */ |
88 | 91 | static function newFromKey( $sha1, $repo, $timestamp = false ) { |
89 | 92 | $conds = array( 'img_sha1' => $sha1 ); |
— | — | @@ -1292,7 +1295,13 @@ |
1293 | 1296 | * @ingroup FileRepo |
1294 | 1297 | */ |
1295 | 1298 | class LocalFileDeleteBatch { |
1296 | | - var $file, $reason, $srcRels = array(), $archiveUrls = array(), $deletionBatch, $suppress; |
| 1299 | + |
| 1300 | + /** |
| 1301 | + * @var LocalFile |
| 1302 | + */ |
| 1303 | + var $file; |
| 1304 | + |
| 1305 | + var $reason, $srcRels = array(), $archiveUrls = array(), $deletionBatch, $suppress; |
1297 | 1306 | var $status; |
1298 | 1307 | |
1299 | 1308 | function __construct( File $file, $reason = '', $suppress = false ) { |
— | — | @@ -1603,8 +1612,13 @@ |
1604 | 1613 | * @ingroup FileRepo |
1605 | 1614 | */ |
1606 | 1615 | class LocalFileRestoreBatch { |
1607 | | - var $file, $cleanupBatch, $ids, $all, $unsuppress = false; |
| 1616 | + /** |
| 1617 | + * @var LocalFile |
| 1618 | + */ |
| 1619 | + var $file; |
1608 | 1620 | |
| 1621 | + var $cleanupBatch, $ids, $all, $unsuppress = false; |
| 1622 | + |
1609 | 1623 | function __construct( File $file, $unsuppress = false ) { |
1610 | 1624 | $this->file = $file; |
1611 | 1625 | $this->cleanupBatch = $this->ids = array(); |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -66,6 +66,8 @@ |
67 | 67 | * instance of the repository's old file class instead of a |
68 | 68 | * current file. Repositories not supporting version control |
69 | 69 | * should return false if this parameter is set. |
| 70 | + * |
| 71 | + * @return File |
70 | 72 | */ |
71 | 73 | function newFile( $title, $time = false ) { |
72 | 74 | if ( !($title instanceof Title) ) { |
— | — | @@ -140,7 +142,7 @@ |
141 | 143 | return false; |
142 | 144 | } |
143 | 145 | $redir = $this->checkRedirect( $title ); |
144 | | - if( $redir && $redir->getNamespace() == NS_FILE) { |
| 146 | + if( $redir && $title->getNamespace() == NS_FILE) { |
145 | 147 | $img = $this->newFile( $redir ); |
146 | 148 | if( !$img ) { |
147 | 149 | return false; |
— | — | @@ -189,6 +191,8 @@ |
190 | 192 | * of the repository's old file class instead of a current |
191 | 193 | * file. Repositories not supporting version control should |
192 | 194 | * return false if this parameter is set. |
| 195 | + * |
| 196 | + * @return File |
193 | 197 | */ |
194 | 198 | function newFileFromKey( $sha1, $time = false ) { |
195 | 199 | if ( $time ) { |
— | — | @@ -265,6 +269,7 @@ |
266 | 270 | |
267 | 271 | /** |
268 | 272 | * Get the name of an image from its title object |
| 273 | + * @param $title Title |
269 | 274 | */ |
270 | 275 | function getNameFromTitle( $title ) { |
271 | 276 | if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) { |
— | — | @@ -624,6 +629,7 @@ |
625 | 630 | * STUB |
626 | 631 | * |
627 | 632 | * @param $title Title of image |
| 633 | + * @return Bool |
628 | 634 | */ |
629 | 635 | function checkRedirect( $title ) { |
630 | 636 | return false; |
Index: trunk/phase3/includes/filerepo/FileRepoStatus.php |
— | — | @@ -28,6 +28,9 @@ |
29 | 29 | return $result; |
30 | 30 | } |
31 | 31 | |
| 32 | + /** |
| 33 | + * @param $repo FileRepo |
| 34 | + */ |
32 | 35 | function __construct( $repo = false ) { |
33 | 36 | if ( $repo ) { |
34 | 37 | $this->cleanCallback = $repo->getErrorCleanupFunction(); |
Index: trunk/phase3/includes/filerepo/UnregisteredLocalFile.php |
— | — | @@ -19,8 +19,13 @@ |
20 | 20 | * @ingroup FileRepo |
21 | 21 | */ |
22 | 22 | class UnregisteredLocalFile extends File { |
23 | | - var $title, $path, $mime, $handler, $dims; |
| 23 | + var $title, $path, $mime, $dims; |
24 | 24 | |
| 25 | + /** |
| 26 | + * @var MediaHandler |
| 27 | + */ |
| 28 | + var $handler; |
| 29 | + |
25 | 30 | static function newFromPath( $path, $mime ) { |
26 | 31 | return new UnregisteredLocalFile( false, false, $path, $mime ); |
27 | 32 | } |
— | — | @@ -29,6 +34,13 @@ |
30 | 35 | return new UnregisteredLocalFile( $title, $repo, false, false ); |
31 | 36 | } |
32 | 37 | |
| 38 | + /** |
| 39 | + * @throws MWException |
| 40 | + * @param bool $title |
| 41 | + * @param $repo FSRepo |
| 42 | + * @param bool $path |
| 43 | + * @param bool $mime |
| 44 | + */ |
33 | 45 | function __construct( $title = false, $repo = false, $path = false, $mime = false ) { |
34 | 46 | if ( !( $title && $repo ) && !$path ) { |
35 | 47 | throw new MWException( __METHOD__.': not enough parameters, must specify title and repo, or a full path' ); |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -52,9 +52,20 @@ |
53 | 53 | /** |
54 | 54 | * The following member variables are not lazy-initialised |
55 | 55 | */ |
56 | | - var $repo, $title, $lastError, $redirected, $redirectedTitle; |
57 | 56 | |
58 | 57 | /** |
| 58 | + * @var LocalRepo |
| 59 | + */ |
| 60 | + var $repo; |
| 61 | + |
| 62 | + /** |
| 63 | + * @var Title |
| 64 | + */ |
| 65 | + var $title; |
| 66 | + |
| 67 | + var $lastError, $redirected, $redirectedTitle; |
| 68 | + |
| 69 | + /** |
59 | 70 | * Call this constructor from child classes |
60 | 71 | */ |
61 | 72 | function __construct( $title, $repo ) { |
— | — | @@ -1117,9 +1128,13 @@ |
1118 | 1129 | if( $this->isLocal() ) { |
1119 | 1130 | global $wgParser; |
1120 | 1131 | $revision = Revision::newFromTitle( $this->title ); |
1121 | | - if ( !$revision ) return false; |
| 1132 | + if ( !$revision ) { |
| 1133 | + return false; |
| 1134 | + } |
1122 | 1135 | $text = $revision->getText(); |
1123 | | - if ( !$text ) return false; |
| 1136 | + if ( !$text ) { |
| 1137 | + return false; |
| 1138 | + } |
1124 | 1139 | $pout = $wgParser->parse( $text, $this->title, new ParserOptions() ); |
1125 | 1140 | return $pout->getText(); |
1126 | 1141 | } |
Index: trunk/phase3/includes/filerepo/LocalRepo.php |
— | — | @@ -133,6 +133,7 @@ |
134 | 134 | /** |
135 | 135 | * Function link Title::getArticleID(). |
136 | 136 | * We can't say Title object, what database it should use, so we duplicate that function here. |
| 137 | + * @param $title Title |
137 | 138 | */ |
138 | 139 | protected function getArticleID( $title ) { |
139 | 140 | if( !$title instanceof Title ) { |
Index: trunk/phase3/includes/filerepo/RepoGroup.php |
— | — | @@ -16,7 +16,13 @@ |
17 | 17 | * @ingroup FileRepo |
18 | 18 | */ |
19 | 19 | class RepoGroup { |
20 | | - var $localRepo, $foreignRepos, $reposInitialised = false; |
| 20 | + |
| 21 | + /** |
| 22 | + * @var LocalRepo |
| 23 | + */ |
| 24 | + var $localRepo; |
| 25 | + |
| 26 | + var $foreignRepos, $reposInitialised = false; |
21 | 27 | var $localInfo, $foreignInfo; |
22 | 28 | var $cache; |
23 | 29 | |
Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php |
— | — | @@ -15,7 +15,13 @@ |
16 | 16 | class ForeignAPIFile extends File { |
17 | 17 | |
18 | 18 | private $mExists; |
19 | | - |
| 19 | + |
| 20 | + /** |
| 21 | + * @param $title |
| 22 | + * @param $repo ForeignApiRepo |
| 23 | + * @param $info |
| 24 | + * @param bool $exists |
| 25 | + */ |
20 | 26 | function __construct( $title, $repo, $info, $exists = false ) { |
21 | 27 | parent::__construct( $title, $repo ); |
22 | 28 | $this->mInfo = $info; |
Index: trunk/phase3/includes/filerepo/ArchivedFile.php |
— | — | @@ -16,7 +16,6 @@ |
17 | 17 | * @private |
18 | 18 | */ |
19 | 19 | var $id, # filearchive row ID |
20 | | - $title, # image title |
21 | 20 | $name, # image name |
22 | 21 | $group, # FileStore storage group |
23 | 22 | $key, # FileStore sha1 key |
— | — | @@ -34,6 +33,11 @@ |
35 | 34 | $dataLoaded, # Whether or not all this has been loaded from the database (loadFromXxx) |
36 | 35 | $deleted; # Bitfield akin to rev_deleted |
37 | 36 | |
| 37 | + /** |
| 38 | + * @var Title |
| 39 | + */ |
| 40 | + var $title; # image title |
| 41 | + |
38 | 42 | /**#@-*/ |
39 | 43 | |
40 | 44 | function __construct( $title, $id=0, $key='' ) { |
Index: trunk/phase3/includes/media/Generic.php |
— | — | @@ -21,6 +21,8 @@ |
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Get a MediaHandler for a given MIME type from the instance cache |
| 25 | + * |
| 26 | + * @return MediaHandler |
25 | 27 | */ |
26 | 28 | static function getHandler( $type ) { |
27 | 29 | global $wgMediaHandlers; |