MediaWiki  REL1_24
importImages.php File Reference

Import one or more images from the local file system into the wiki without using the web-based interface. More...

Go to the source code of this file.

Functions

 showUsage ($reason=false)

Variables

 $comment = 'Importing file'
if(isset($options['comment-file']))
elseif(isset($options['comment'])) 
$commentExt = isset( $options['comment-ext'] ) ? $options['comment-ext'] : false
 $count = count( $files )
if(count($args)==0) $dir = $args[0]
 $extensions
 $files = findFiles( $dir, $extensions, isset( $options['search-recursively'] ) )
 $from = $options['from']
 $license = isset( $options['license'] ) ? $options['license'] : ''
 $limit = $options['limit']
 $optionsWithArgs
 $processed = $added = $ignored = $skipped = $overwritten = $failed = 0
 $sleep = $options['sleep']
 $summary = isset( $options['summary'] ) ? $options['summary'] : ''
if($limit) $timestamp = isset( $options['timestamp'] ) ? $options['timestamp'] : false
 $user
if(isset($options['protect'])&&isset($options['unprotect']))
if(isset($options['protect'])&&$options['protect']==1)
global 
$wgFileExtensions
if(!$user instanceof User$wgUser = $user

Detailed Description

Import one or more images from the local file system into the wiki without using the web-based interface.

"Smart import" additions:

  • aim: preserve the essential metadata (user, description) when importing media files from an existing wiki.
  • process:
    • interface with the source wiki, don't use bare files only (see --source-wiki-url).
    • fetch metadata from source wiki for each file to import.
    • commit the fetched metadata to the destination wiki while submitting.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Author:
Rob Church <[email protected]>
Mij <[email protected]>

Definition in file importImages.php.


Function Documentation

showUsage ( reason = false)

Variable Documentation

if (isset($options['comment-file'])) elseif (isset($options['comment'])) $commentExt = isset( $options['comment-ext'] ) ? $options['comment-ext'] : false

Definition at line 127 of file importImages.php.

$count = count( $files )

Definition at line 135 of file importImages.php.

$license = isset( $options['license'] ) ? $options['license'] : ''

Definition at line 132 of file importImages.php.

$limit = $options['limit']

Definition at line 106 of file importImages.php.

Referenced by Maintenance\adjustMemoryLimit(), ApiQuerySiteinfo\appendGeneralInfo(), ImageListPager\combineResult(), PrefixSearch\defaultSearchBackend(), SpecialRecentChangesLinked\doMainQuery(), Installer\envCheckCache(), ApiQueryDeletedrevs\execute(), SpecialExport\execute(), ApiQueryFilearchive\execute(), ApiFeedContributions\execute(), UpdateSpecialPages\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiOpenSearch\execute(), ApiQueryAllUsers\execute(), CleanupRemovedModules\execute(), ApiQueryRevisions\execute(), WikiDiff3\find_middle_snake(), WikiDiff3\findMostProgress(), IndexPager\getLimitLinks(), TablePager\getLimitSelectList(), DatabaseMssql\limitResult(), BloomFilterTitleHasLogs\merge(), SpecialRecentChanges\outputChangesList(), PurgeChangedPages\pageableSortedRows(), SwiftFileBackendFileList\pageFromList(), SpecialWatchlist\prefixSearchSubpages(), SpecialLog\prefixSearchSubpages(), SpecialEditWatchlist\prefixSearchSubpages(), SpecialJavaScriptTest\prefixSearchSubpages(), SpecialListUsers\prefixSearchSubpages(), ApiQueryRandom\prepareQuery(), ImageListPager\reallyDoQuery(), ApiQueryPrefixSearch\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQuerySearch\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), PrefixSearch\search(), PrefixSearch\searchBackend(), PrefixSearch\searchWithVariants(), ApiResult\setParsedLimit(), PrefixSearch\specialSearch(), SyncFileBackend\syncBackends(), PrefixSearch\titleSearch(), wfDebugBacktrace(), wfGetAllCallers(), and wfShowingResults().

$optionsWithArgs
Initial value:
 array(
    'extensions', 'comment', 'comment-file', 'comment-ext', 'summary', 'user',
    'license', 'sleep', 'limit', 'from', 'source-wiki-url', 'timestamp',
)

Definition at line 35 of file importImages.php.

$processed = $added = $ignored = $skipped = $overwritten = $failed = 0
$sleep = $options['sleep']

Definition at line 97 of file importImages.php.

Referenced by DeleteImageCache\execute(), and BagOStuff\lock().

if ($limit) $timestamp = isset( $options['timestamp'] ) ? $options['timestamp'] : false

Definition at line 113 of file importImages.php.

Referenced by LocalFileRestoreBatch\addIds(), ParserOutput\addImage(), ImageBuilder\addMissingImage(), FileCacheBase\cacheTimestamp(), RevisionDeleter\checkRevisionExistence(), ApiFeedWatchlist\createFeedItem(), Xml\dateMenu(), JobQueue\doDeduplicateRootJob(), SpecialWatchlist\doHeader(), ApiSetNotificationTimestamp\execute(), FixUserRegistration\execute(), FixTimestamps\execute(), ApiQueryAllUsers\execute(), LocalFileMoveBatch\execute(), EditPageTest\forceRevisionDate(), ApiEditPageTest\forceRevisionDate(), FeedUtils\formatDiff(), FeedUtils\formatDiffRow(), CreditsAction\getAuthor(), NewUsersLogFormatter\getComment(), ReverseChronologicalPager\getDateCond(), TestRecentChangesHelper\getDefaultAttributes(), RevertAction\getFormFields(), Preferences\getTimezoneOptions(), FileCacheBase\isCacheGood(), Skin\lastModified(), BagOStuff\lock(), TestRecentChangesHelper\makeDeletedEditRecentChange(), TestRecentChangesHelper\makeEditRecentChange(), TestRecentChangesHelper\makeLogRecentChange(), TestRecentChangesHelper\makeNewBotEditRecentChange(), SpecialLockdb\onSubmit(), RevertAction\onSuccess(), SpecialRecentChanges\optionsPanel(), IPTC\parse(), Block\purgeExpired(), ZipDirectoryReader\readCentralDirectory(), ApiQueryRecentChanges\run(), User\setEmailAuthenticationTimestamp(), ParserOutput\setTimestamp(), MWTimestampTest\testConstructWithNoTimestamp(), MWTimestampTest\testInvalidOutput(), WfTimestampTest\testOldTimestamps(), MWTimestampTest\testToString(), MWTimestampTest\testValidOutput(), MWTimestampTest\testValidParse(), and wfTimestamp().

$user
Initial value:
 isset( $options['user'] )
    ? User::newFromName( $options['user'] )
    : User::newFromName( 'Maintenance script' )

Definition at line 71 of file importImages.php.

if (isset($options['protect'])&&isset($options['unprotect'])) if (isset($options['protect'])&&$options['protect']==1) global $wgFileExtensions

Definition at line 57 of file importImages.php.

if (!$user instanceof User) $wgUser = $user

Definition at line 77 of file importImages.php.