X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FImport.php;h=b5411fc38ca602b739ac2c17118f3e89e3491a4d;hb=797e52dd0534ee102240cb78eb71fcce95a3153e;hp=bd9ce25cbca53d98d8541d8d41c1826ecd08b28c;hpb=eeaca0a97fcb416c0ae2b24aec0b8ab76c30cac6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Import.php b/includes/Import.php index bd9ce25cbc..b5411fc38c 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -330,8 +330,8 @@ class WikiImporter { * @param $title Title * @param $origTitle Title * @param $revCount Integer - * @param $sucCount Int: number of revisions for which callback returned true - * @param $pageInfo Array: associative array of page information + * @param int $sucCount number of revisions for which callback returned true + * @param array $pageInfo associative array of page information */ private function pageOutCallback( $title, $origTitle, $revCount, $sucCount, $pageInfo ) { if( isset( $this->mPageOutCallback ) ) { @@ -400,7 +400,7 @@ class WikiImporter { /** Left in for debugging */ private function dumpElement() { static $lookup = null; - if (!$lookup) { + if ( !$lookup ) { $xmlReaderConstants = array( "NONE", "ELEMENT", @@ -473,7 +473,7 @@ class WikiImporter { $skip = true; } - if ($skip) { + if ( $skip ) { $keepReading = $this->reader->next(); $skip = false; $this->debug( "Skip" ); @@ -509,7 +509,7 @@ class WikiImporter { while ( $this->reader->read() ) { if ( $this->reader->nodeType == XmlReader::END_ELEMENT && - $this->reader->name == 'logitem') { + $this->reader->name == 'logitem' ) { break; } @@ -572,7 +572,7 @@ class WikiImporter { while ( $skip ? $this->reader->next() : $this->reader->read() ) { if ( $this->reader->nodeType == XmlReader::END_ELEMENT && - $this->reader->name == 'page') { + $this->reader->name == 'page' ) { break; } @@ -626,7 +626,7 @@ class WikiImporter { while ( $skip ? $this->reader->next() : $this->reader->read() ) { if ( $this->reader->nodeType == XmlReader::END_ELEMENT && - $this->reader->name == 'revision') { + $this->reader->name == 'revision' ) { break; } @@ -712,7 +712,7 @@ class WikiImporter { while ( $skip ? $this->reader->next() : $this->reader->read() ) { if ( $this->reader->nodeType == XmlReader::END_ELEMENT && - $this->reader->name == 'upload') { + $this->reader->name == 'upload' ) { break; } @@ -809,7 +809,7 @@ class WikiImporter { while ( $this->reader->read() ) { if ( $this->reader->nodeType == XmlReader::END_ELEMENT && - $this->reader->name == 'contributor') { + $this->reader->name == 'contributor' ) { break; } @@ -897,7 +897,7 @@ class UploadSourceAdapter { * @return bool */ function stream_open( $path, $mode, $options, &$opened_path ) { - $url = parse_url($path); + $url = parse_url( $path ); $id = $url['host']; if ( !isset( self::$sourceRegistrations[$id] ) ) { @@ -918,22 +918,22 @@ class UploadSourceAdapter { $leave = false; while ( !$leave && !$this->mSource->atEnd() && - strlen($this->mBuffer) < $count ) { + strlen( $this->mBuffer ) < $count ) { $read = $this->mSource->readChunk(); - if ( !strlen($read) ) { + if ( !strlen( $read ) ) { $leave = true; } $this->mBuffer .= $read; } - if ( strlen($this->mBuffer) ) { + if ( strlen( $this->mBuffer ) ) { $return = substr( $this->mBuffer, 0, $count ); $this->mBuffer = substr( $this->mBuffer, $count ); } - $this->mPosition += strlen($return); + $this->mPosition += strlen( $return ); return $return; } @@ -1390,7 +1390,7 @@ class WikiRevision { array( 'rev_page' => $pageId, 'rev_timestamp' => $dbw->timestamp( $this->timestamp ), 'rev_user_text' => $userText, - 'rev_comment' => $this->getComment() ), + 'rev_comment' => $this->getComment() ), __METHOD__ ); if( $prior ) { @@ -1405,15 +1405,15 @@ class WikiRevision { # @todo FIXME: Use original rev_id optionally (better for backups) # Insert the row $revision = new Revision( array( - 'title' => $this->title, - 'page' => $pageId, - 'content_model' => $this->getModel(), + 'title' => $this->title, + 'page' => $pageId, + 'content_model' => $this->getModel(), 'content_format' => $this->getFormat(), - 'text' => $this->getContent()->serialize( $this->getFormat() ), //XXX: just set 'content' => $this->getContent()? - 'comment' => $this->getComment(), - 'user' => $userId, - 'user_text' => $userText, - 'timestamp' => $this->timestamp, + 'text' => $this->getContent()->serialize( $this->getFormat() ), //XXX: just set 'content' => $this->getContent()? + 'comment' => $this->getComment(), + 'user' => $userId, + 'user_text' => $userText, + 'timestamp' => $this->timestamp, 'minor_edit' => $this->minor, ) ); $revision->insertOn( $dbw ); @@ -1442,13 +1442,13 @@ class WikiRevision { // @todo FIXME: Use original log ID (better for backups) $prior = $dbw->selectField( 'logging', '1', array( 'log_type' => $this->getType(), - 'log_action' => $this->getAction(), + 'log_action' => $this->getAction(), 'log_timestamp' => $dbw->timestamp( $this->timestamp ), 'log_namespace' => $this->getTitle()->getNamespace(), - 'log_title' => $this->getTitle()->getDBkey(), - 'log_comment' => $this->getComment(), + 'log_title' => $this->getTitle()->getDBkey(), + 'log_comment' => $this->getComment(), #'log_user_text' => $this->user_text, - 'log_params' => $this->params ), + 'log_params' => $this->params ), __METHOD__ ); // @todo FIXME: This could fail slightly for multiple matches :P @@ -1650,7 +1650,7 @@ class ImportStreamSource { return Status::newFatal( 'importnofile' ); } if( !empty( $upload['error'] ) ) { - switch($upload['error']){ + switch( $upload['error'] ) { case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini. return Status::newFatal( 'importuploaderrorsize' ); case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.