]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move to non-static version
authorLukas Reschke <lukas@statuscode.ch>
Mon, 31 Oct 2016 17:42:19 +0000 (18:42 +0100)
committerLukas Reschke <lukas@statuscode.ch>
Mon, 31 Oct 2016 17:42:19 +0000 (18:42 +0100)
The static version is used nowhere in the code and just decreases coverage

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
lib/private/Archive/Archive.php
lib/private/Installer.php

index da2c53f2aa14c44939efdd86dfe3addfa080ae7a..fadc12d2a24bcab1022a99dddc907f76a4795943 100644 (file)
 
 namespace OC\Archive;
 
-abstract class Archive{
-       /**
-        * Open any of the supported archive types
-        *
-        * @param string $path
-        * @return Archive|void
-        */
-       public static function open($path) {
-               $mime = \OC::$server->getMimeTypeDetector()->detect($path);
-
-               switch($mime) {
-                       case 'application/zip':
-                               return new ZIP($path);
-                       case 'application/x-gzip':
-                               return new TAR($path);
-                       case 'application/x-bzip2':
-                               return new TAR($path);
-               }
-       }
-
+abstract class Archive {
        /**
         * @param $source
         */
index 67c949bc1352bba9a72868ea68e1c962970bcd25..120992d3e632cc3620400576db79fe5453e23146 100644 (file)
@@ -46,6 +46,7 @@ use OC\App\CodeChecker\CodeChecker;
 use OC\App\CodeChecker\EmptyCheck;
 use OC\App\CodeChecker\PrivateCheck;
 use OC\Archive\Archive;
+use OC\Archive\TAR;
 use OC_App;
 use OC_DB;
 use OC_Helper;
@@ -254,7 +255,7 @@ class Installer {
                                if($verified === true) {
                                        // Seems to match, let's proceed
                                        $extractDir = $this->tempManager->getTemporaryFolder();
-                                       $archive = Archive::open($tempFile);
+                                       $archive = new TAR($tempFile);
 
                                        if($archive) {
                                                $archive->extract($extractDir);