dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Use the request object provided in User::setCookies"
[lhc/web/wiklou.git]
/
includes
/
filerepo
/
file
/
ArchivedFile.php
diff --git
a/includes/filerepo/file/ArchivedFile.php
b/includes/filerepo/file/ArchivedFile.php
index
5b0d8e2
..
1d45428
100644
(file)
--- a/
includes/filerepo/file/ArchivedFile.php
+++ b/
includes/filerepo/file/ArchivedFile.php
@@
-100,8
+100,9
@@
class ArchivedFile {
* @param Title $title
* @param int $id
* @param string $key
* @param Title $title
* @param int $id
* @param string $key
+ * @param string $sha1
*/
*/
- function __construct( $title, $id = 0, $key = '' ) {
+ function __construct( $title, $id = 0, $key = ''
, $sha1 = ''
) {
$this->id = -1;
$this->title = false;
$this->name = false;
$this->id = -1;
$this->title = false;
$this->name = false;
@@
-136,7
+137,11
@@
class ArchivedFile {
$this->key = $key;
}
$this->key = $key;
}
- if ( !$id && !$key && !( $title instanceof Title ) ) {
+ if ( $sha1 ) {
+ $this->sha1 = $sha1;
+ }
+
+ if ( !$id && !$key && !( $title instanceof Title ) && !$sha1 ) {
throw new MWException( "No specifications provided to ArchivedFile constructor." );
}
}
throw new MWException( "No specifications provided to ArchivedFile constructor." );
}
}
@@
-162,6
+167,9
@@
class ArchivedFile {
if ( $this->title ) {
$conds['fa_name'] = $this->title->getDBkey();
}
if ( $this->title ) {
$conds['fa_name'] = $this->title->getDBkey();
}
+ if ( $this->sha1 ) {
+ $conds['fa_sha1'] = $this->sha1;
+ }
if ( !count( $conds ) ) {
throw new MWException( "No specific information for retrieving archived file" );
if ( !count( $conds ) ) {
throw new MWException( "No specific information for retrieving archived file" );