X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FimportImages.php;h=54fd4e2d88ded8a5655ae5d5f7ce5c20e64d3cfb;hb=0182f3fb638750850b7a34018730e77f2fffd048;hp=2b5d690136eb201ad185d9a215e36f48be3592c8;hpb=af4cbbb26bb49021125929bbcb0dc60b75cb06e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 2b5d690136..54fd4e2d88 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -35,8 +35,8 @@ $optionsWithArgs = array( 'extensions', 'comment', 'comment-file', 'comment-ext', 'summary', 'user', 'license', 'sleep', 'limit', 'from', 'source-wiki-url', 'timestamp', ); -require_once( __DIR__ . '/commandLine.inc' ); -require_once( __DIR__ . '/importImages.inc' ); +require_once __DIR__ . '/commandLine.inc'; +require_once __DIR__ . '/importImages.inc'; $processed = $added = $ignored = $skipped = $overwritten = $failed = 0; echo "Import Images\n\n"; @@ -104,7 +104,7 @@ if ( $limit ) { $timestamp = isset( $options['timestamp'] ) ? $options['timestamp'] : false; # Get the upload comment. Provide a default one in case there's no comment given. -$comment = 'Importing image file'; +$comment = 'Importing file'; if ( isset( $options['comment-file'] ) ) { $comment = file_get_contents( $options['comment-file'] ); @@ -230,14 +230,14 @@ if ( $count > 0 ) { } else { $props = FSFile::getPropsFromPath( $file ); $flags = 0; - $options = array(); + $publishOptions = array(); $handler = MediaHandler::getHandler( $props['mime'] ); if ( $handler ) { - $options['headers'] = $handler->getStreamHeaders( $props['metadata'] ); + $publishOptions['headers'] = $handler->getStreamHeaders( $props['metadata'] ); } else { - $options['headers'] = array(); + $publishOptions['headers'] = array(); } - $archive = $image->publish( $file, $flags, $options ); + $archive = $image->publish( $file, $flags, $publishOptions ); if ( !$archive->isGood() ) { echo "failed. (" . $archive->getWikiText() . @@ -248,7 +248,7 @@ if ( $count > 0 ) { } $commentText = SpecialUpload::getInitialPageText( $commentText, $license ); - if ( !$summary ) { + if ( !isset( $options['summary'] ) ) { $summary = $commentText; } @@ -347,7 +347,7 @@ Options: --sleep= Sleep between files. Useful mostly for debugging. --user= Set username of uploader, default 'Maintenance script' --check-userblock Check if the user got blocked during import. ---comment= Set file description, default 'Importing image file'. +--comment= Set file description, default 'Importing file'. --comment-file= Set description to the content of . --comment-ext= Causes the description for each file to be loaded from a file with the same name but the extension . If a global description is also given, it is appended.