$out .= " " . Xml::elementClean( 'comment', null, strval( $row->rev_comment ) ) . "\n";
}
+ if ( $row->rev_content_model ) {
+ $out .= " " . Xml::element('model', null, strval( $row->rev_content_model ) ) . "\n";
+ }
+
+ if ( $row->rev_content_format ) {
+ $out .= " " . Xml::element('format', null, strval( $row->rev_content_format ) ) . "\n";
+ }
+
$text = '';
if ( $row->rev_deleted & Revision::DELETED_TEXT ) {
$out .= " " . Xml::element( 'text', array( 'deleted' => 'deleted' ) ) . "\n";
$this->debug( "Enter revision handler" );
$revisionInfo = array();
- $normalFields = array( 'id', 'timestamp', 'comment', 'minor', 'text' );
+ $normalFields = array( 'id', 'timestamp', 'comment', 'minor', 'model', 'format', 'text' );
$skip = false;
if ( isset( $revisionInfo['text'] ) ) {
$revision->setText( $revisionInfo['text'] );
}
+ if ( isset( $revisionInfo['model'] ) ) {
+ $revision->setModel( $revisionInfo['model'] );
+ }
+ if ( isset( $revisionInfo['text'] ) ) {
+ $revision->setFormat( $revisionInfo['format'] );
+ }
$revision->setTitle( $pageInfo['_title'] );
if ( isset( $revisionInfo['timestamp'] ) ) {
var $timestamp = "20010115000000";
var $user = 0;
var $user_text = "";
+ var $model = null;
+ var $format = null;
var $text = "";
var $comment = "";
var $minor = false;
$this->user_text = $ip;
}
+ /**
+ * @param $model
+ */
+ function setModel( $model ) {
+ $this->model = $model;
+ }
+
+ /**
+ * @param $format
+ */
+ function setFormat( $format ) {
+ $this->format = $format;
+ }
+
/**
* @param $text
*/
return $this->text;
}
+ /**
+ * @return string
+ */
+ function getModel() {
+ if ( is_null( $this->model ) ) {
+ $this->model = $this->getTitle()->getContentModelName();
+ }
+
+ return $this->model;
+ }
+
+ /**
+ * @return string
+ */
+ function getFormat() {
+ if ( is_null( $this->model ) ) {
+ $this->format = ContentHandler::getForTitle( $this->getTitle() )->getDefaultFormat();
+ }
+
+ return $this->format;
+ }
+
/**
* @return string
*/
# Insert the row
$revision = new Revision( array(
'page' => $pageId,
+ 'content_model' => $this->getModel(),
+ 'content_format' => $this->getFormat(),
'text' => $this->getText(),
'comment' => $this->getComment(),
'user' => $userId,