Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339205 )

Change subject: WIP actually import the file...
......................................................................

WIP actually import the file...

Change-Id: I7cf321a0ed03839bfd55a5ef356decf7d0b9c6e9
---
M src/Generic/Importer.php
1 file changed, 20 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileImporter 
refs/changes/05/339205/1

diff --git a/src/Generic/Importer.php b/src/Generic/Importer.php
index 9f8d88e..2c33c68 100644
--- a/src/Generic/Importer.php
+++ b/src/Generic/Importer.php
@@ -3,6 +3,9 @@
 namespace FileImporter\Generic;
 
 use FileImporter\Generic\Exceptions\ImportException;
+use RepoGroup;
+use UploadFromStash;
+use UploadStash;
 
 class Importer {
 
@@ -14,9 +17,25 @@
         * @throws ImportException
         */
        public function import( ImportDetails $importDetails, ImportAdjustments 
$importAdjustments ) {
-               // TODO implement
+               global $wgUser;
                // TODO copy files directly in swift if possible?
 
+               // TODO dont use wgUser
+               $user = $wgUser;
+
+               $localRepo = RepoGroup::singleton()->getLocalRepo();
+               $stash = new UploadStash( $localRepo, $user );
+
+               // TODO actually download the files into tmp storage!
+               // TODO stash ALL of the files!?!!!?
+               $stash->stashFile( $tmpFilePath, 'extFileImporter' );
+
+               $uploader = new UploadFromStash( $user, $stash, $localRepo );
+               // TODO how to actually upload them from the stash?
+
+               // TODO import the text revisions?
+               // TODO modifications on the text!
+
                return false;
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/339205
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7cf321a0ed03839bfd55a5ef356decf7d0b9c6e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FileImporter
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to