MediaWiki
REL1_24
|
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 |
Import one or more images from the local file system into the wiki without using the web-based interface.
"Smart import" additions:
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
Definition in file importImages.php.
$comment = 'Importing file' |
Definition at line 116 of file importImages.php.
Referenced by BackupDumperLoggerTest\addLogEntry(), RecentChangeTest\assertIRCComment(), BackupDumperLoggerTest\assertLogItem(), Orphans\checkOrphans(), Linker\commentBlock(), ApiFeedWatchlist\createFeedItem(), ApiTestCaseUpload\deleteFileByTitle(), UserCache\doQuery(), GenderCache\doQuery(), ApiImageRotate\execute(), ApiQueryRevisions\extractRowInfo(), Linker\formatAutocomments(), Linker\formatComment(), FeedUtils\formatDiffRow(), Linker\formatLinksInComment(), LogFormatter\getComment(), UploadBase\getFilenamePrefixBlacklist(), RevDelLogItem\getHTML(), RevDelRevisionItem\getHTML(), ApiQueryImageInfo\getInfo(), IRCColourfulRCFeedFormatter\getLine(), GIFMetadataExtractor\getMetadata(), UploadFromUrl\insertJob(), RevertAction\onSubmit(), UploadFromStash\performUpload(), UploadFromUrl\performUpload(), UploadBase\performUpload(), ImportReporter\reportPage(), RevDelList\setVisibility(), LinkerTest\testFormatComment(), LanguageTest\testGetParentLanguage(), LanguageTest\testIsSupportedLanguage(), and CLDRPluralRuleEvaluatorTest\testValidRules().
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.
if (count($args)==0) $dir = $args[0] |
Definition at line 50 of file importImages.php.
Referenced by IndexPager\__construct(), CheckSyntax\addDirectoryContent(), lessc\addImportDir(), ApiQueryBase\addTimestampWhereRange(), ApiQueryBase\addWhereRange(), FileCacheBase\cachePath(), UploadFromUrlTestSuite\deleteDirs(), CliInstaller\dirIsExecutable(), TestFileOpPerformance\doPerfTest(), ApiQueryDeletedrevs\execute(), SpecialExport\execute(), ApiQueryFilearchive\execute(), PruneFileCache\execute(), UploadStashCleanup\execute(), ApiQueryAllUsers\execute(), FindHooks\execute(), findFiles(), lessc\findImport(), MemoryFileBackend\getDirectoryListInternal(), SpecialVersion\getGitCurrentBranch(), SpecialVersion\getGitHeadSha1(), SpecialRandomInCategory\getQueryInfo(), RandomImageGenerator\getRandomFilenames(), SpecialVersion\getSvnInfo(), SpecialVersion\getSvnRevision(), ForeignAPIFile\getThumbnails(), lessc_parser\parseChunk(), ImageCleanup\pokeFile(), PruneFileCache\prune_directory(), ForeignAPIFile\purgeThumbnails(), ApiQueryCategoryMembers\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryAllPages\run(), WikiImporter\setImageBasePath(), UploadFromUrlTestSuite\setupUploadDir(), Article\showCssOrJsPage(), CdbTest\testCdb(), GitInfoTest\testMissingJsonData(), GitInfoTest\testValidJsonData(), lessc\tryImport(), wfMkdirParents(), wfRecursiveRemoveDir(), and RandomImageGenerator\writeImages().
isset( $options['extensions'] ) ? explode( ',', strtolower( $options['extensions'] ) ) : $wgFileExtensions
Definition at line 63 of file importImages.php.
Referenced by MimeMagic\__construct(), ApiQuerySiteinfo\appendExtensions(), UploadBase\checkWarnings(), SpecialVersion\execute(), SpecialVersion\getExtensionCredits(), MediaHandler\getThumbType(), and SpecialUpload\processVerificationError().
$files = findFiles( $dir, $extensions, isset( $options['search-recursively'] ) ) |
Definition at line 68 of file importImages.php.
Referenced by ExtensionsTestSuite\__construct(), CheckSyntax\buildFileList(), AutoLoaderTest\checkAutoLoadConf(), TextPassDumperTest\checkpointHelper(), Sqlite\checkSqlSyntax(), SqliteMaintenance\checkSyntax(), UploadFromUrlTestSuite\deleteFiles(), JSParseHelper\execute(), PatchSql\execute(), findFiles(), MWDebug\getFilesIncluded(), CSSMin\getLocalFileReferences(), ResourceLoaderFileModule\getStyleFiles(), ForeignAPIFile\getThumbnails(), MWCryptRand\initialRandomState(), ResourcesTest\provideMediaStylesheets(), ResourcesTest\provideResourceFiles(), LocalFile\purgeThumbList(), ForeignAPIFile\purgeThumbnails(), ApiQueryDuplicateFiles\run(), and SpecialUploadStash\showUploads().
Definition at line 92 of file importImages.php.
Referenced by DoubleReplacer\__construct(), CategoryPage\closeShowCategory(), ReassignEdits\doReassignEdits(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ReassignEdits\execute(), ApiQueryAllUsers\execute(), SpecialPrefixindex\execute(), SpecialCategories\execute(), ConvertLinks\execute(), SpecialWatchlist\fetchOptionsFromRequest(), BrokenRedirectsPage\formatResult(), FormatJsonTest\getEncodeTestCases(), ConverterRule\getRulesDesc(), User\loadFromSession(), SpecialPrefixindex\namespacePrefixForm(), ConverterRule\parseRules(), lessc_parser\peek(), UserDupes\reassignEdits(), ReplacementArray\removeArray(), ReplacementArray\removePair(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), UserMailer\send(), ReplacementArray\setPair(), SpecialPrefixindex\showPrefixChunk(), FormatJsonTest\testEncodeAllOk(), FormatJsonTest\testEncodeDefault(), FormatJsonTest\testEncodeUtf8(), FormatJsonTest\testEncodeXmlMeta(), and wfRelativePath().
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 |
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 |
Definition at line 41 of file importImages.php.
Referenced by SearchHighlighter\highlightText(), and SearchUpdateTest\testBug32712().
$sleep = $options['sleep'] |
Definition at line 97 of file importImages.php.
Referenced by DeleteImageCache\execute(), and BagOStuff\lock().
Definition at line 129 of file importImages.php.
Referenced by ApiRollback\execute(), SpecialJavaScriptTest\execute(), EditCLI\execute(), RollbackEdits\execute(), ResourceLoaderFileModule\getLocalPath(), SpecialJavaScriptTest\initQUnitTesting(), and EditPageTest\testSectionEdit().
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 |
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.