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
Include AuthManager API endpoints in authmanager channel
[lhc/web/wiklou.git]
/
includes
/
RevisionList.php
diff --git
a/includes/RevisionList.php
b/includes/RevisionList.php
index
e417473
..
811870c
100644
(file)
--- a/
includes/RevisionList.php
+++ b/
includes/RevisionList.php
@@
-23,7
+23,7
@@
/**
* List for revision table items for a single page
*/
/**
* List for revision table items for a single page
*/
-abstract class RevisionListBase extends ContextSource {
+abstract class RevisionListBase extends ContextSource
implements Iterator
{
/** @var Title */
public $title;
/** @var Title */
public $title;
@@
-89,6
+89,10
@@
abstract class RevisionListBase extends ContextSource {
return $this->current;
}
return $this->current;
}
+ public function rewind() {
+ $this->reset();
+ }
+
/**
* Get the current list item, or false if we are at the end
* @return Revision
/**
* Get the current list item, or false if we are at the end
* @return Revision
@@
-107,6
+111,14
@@
abstract class RevisionListBase extends ContextSource {
return $this->current;
}
return $this->current;
}
+ public function key() {
+ return $this->res ? $this->res->key(): 0;
+ }
+
+ public function valid() {
+ return $this->res ? $this->res->valid() : false;
+ }
+
/**
* Get the number of items in the list.
* @return int
/**
* Get the number of items in the list.
* @return int
@@
-121,7
+133,7
@@
abstract class RevisionListBase extends ContextSource {
/**
* Do the DB query to iterate through the objects.
/**
* Do the DB query to iterate through the objects.
- * @param
DatabaseBase $db DatabaseBase
object to use for the query
+ * @param
IDatabase $db DB
object to use for the query
*/
abstract public function doQuery( $db );
*/
abstract public function doQuery( $db );
@@
-264,23
+276,23
@@
class RevisionList extends RevisionListBase {
}
/**
}
/**
- * @param
DatabaseB
ase $db
+ * @param
IDatab
ase $db
* @return mixed
*/
public function doQuery( $db ) {
* @return mixed
*/
public function doQuery( $db ) {
- $conds =
array( 'rev_page' => $this->title->getArticleID() )
;
+ $conds =
[ 'rev_page' => $this->title->getArticleID() ]
;
if ( $this->ids !== null ) {
$conds['rev_id'] = array_map( 'intval', $this->ids );
}
return $db->select(
if ( $this->ids !== null ) {
$conds['rev_id'] = array_map( 'intval', $this->ids );
}
return $db->select(
-
array( 'revision', 'page', 'user' )
,
+
[ 'revision', 'page', 'user' ]
,
array_merge( Revision::selectFields(), Revision::selectUserFields() ),
$conds,
__METHOD__,
array_merge( Revision::selectFields(), Revision::selectUserFields() ),
$conds,
__METHOD__,
-
array( 'ORDER BY' => 'rev_id DESC' )
,
- array(
+
[ 'ORDER BY' => 'rev_id DESC' ]
,
+ [
'page' => Revision::pageJoinCond(),
'page' => Revision::pageJoinCond(),
- 'user' => Revision::userJoinCond()
)
+ 'user' => Revision::userJoinCond()
]
);
}
);
}
@@
-350,11
+362,11
@@
class RevisionItem extends RevisionItemBase {
return Linker::linkKnown(
$this->list->title,
$date,
return Linker::linkKnown(
$this->list->title,
$date,
-
array()
,
- array(
+
[]
,
+ [
'oldid' => $this->revision->getId(),
'unhide' => 1
'oldid' => $this->revision->getId(),
'unhide' => 1
- )
+ ]
);
}
);
}
@@
-372,12
+384,12
@@
class RevisionItem extends RevisionItemBase {
return Linker::linkKnown(
$this->list->title,
$this->list->msg( 'diff' )->escaped(),
return Linker::linkKnown(
$this->list->title,
$this->list->msg( 'diff' )->escaped(),
-
array()
,
- array(
+
[]
,
+ [
'diff' => $this->revision->getId(),
'oldid' => 'prev',
'unhide' => 1
'diff' => $this->revision->getId(),
'oldid' => 'prev',
'unhide' => 1
- )
+ ]
);
}
}
);
}
}