* Revision::READ_LATEST : Select the data from the master (since 1.20)
* Revision::READ_LOCKING : Select & lock the data from the master
*
- * @param int $revId
- * @param int $pageId (optional)
+ * @param int $pageId
+ * @param int $revId (optional)
* @param int $flags Bitfield (optional)
* @return Revision|null
*/
'ar_id',
'ar_page_id',
'ar_rev_id',
+ 'ar_text',
'ar_text_id',
'ar_timestamp',
'ar_comment',
/**
* Constructor
*
- * @param object $row Either a database row or an array
+ * @param object|array $row Either a database row or an array
* @throws MWException
* @access private
*/
}
/**
- * Get revision text associated with an old or archive row
- * $row is usually an object from wfFetchRow(), both the flags and the text
- * field must be included.
- *
- * @param stdClass $row The text data
- * @param string $prefix Table prefix (default 'old_')
- * @param string|bool $wiki The name of the wiki to load the revision text from
- * (same as the the wiki $row was loaded from) or false to indicate the local
- * wiki (this is the default). Otherwise, it must be a symbolic wiki database
- * identifier as understood by the LoadBalancer class.
- * @return string Text the text requested or false on failure
- */
+ * Get revision text associated with an old or archive row
+ * $row is usually an object from wfFetchRow(), both the flags and the text
+ * field must be included.
+ *
+ * @param stdClass $row The text data
+ * @param string $prefix Table prefix (default 'old_')
+ * @param string|bool $wiki The name of the wiki to load the revision text from
+ * (same as the the wiki $row was loaded from) or false to indicate the local
+ * wiki (this is the default). Otherwise, it must be a symbolic wiki database
+ * identifier as understood by the LoadBalancer class.
+ * @return string Text the text requested or false on failure
+ */
public static function getRevisionText( $row, $prefix = 'old_', $wiki = false ) {
wfProfileIn( __METHOD__ );
* @param int $pageId: ID number of the page to read from
* @param string $summary Revision's summary
* @param bool $minor Whether the revision should be considered as minor
+ * @param User|null $user User object to use or null for $wgUser
* @return Revision|null Revision or null on error
*/
- public static function newNullRevision( $dbw, $pageId, $summary, $minor ) {
+ public static function newNullRevision( $dbw, $pageId, $summary, $minor, $user = null ) {
global $wgContentHandlerUseDB;
wfProfileIn( __METHOD__ );
__METHOD__ );
if ( $current ) {
+ if ( !$user ) {
+ global $wgUser;
+ $user = $wgUser;
+ }
+
$row = array(
'page' => $pageId,
+ 'user_text' => $user->getName(),
+ 'user' => $user->getId(),
'comment' => $summary,
'minor_edit' => $minor,
'text_id' => $current->rev_text_id,
* 50 revisions for the sake of performance.
*
* @since 1.20
+ * @deprecated since 1.24
*
* @param DatabaseBase|int $db The Database to perform the check on. May be given as a
* Database object or a database identifier usable with wfGetDB.