Completed
Pull Request — 2.1 (#1109)
by Paweł
19:50 queued 10:16
created
SWP/Bundle/CoreBundle/Command/DownloadThemesFromExternalStorageCommand.php 7 patches
Doc Comments   -46 removed lines patch added patch discarded remove patch
@@ -47,49 +47,3 @@
 block discarded – undo
47 47
             ->setName(self::$defaultName)
48 48
             ->setDescription('Downloads theme from configured storage.')
49 49
             ->setHelp(<<<'EOT'
50
-Location for themes archive can be defined by `THEMES_DOWNLOAD_URL` env variable. 
51
-
52
-Themes must be packed into one compressed file (*.zip). 
53
-Archive can be created with 'zip -r ../themes.zip *' command (called from your themes directory). 
54
-
55
-Remember that themes must be located in their tenants directories. Example:
56
-
57
-123abc
58
-   theme_1
59
-   theme_2
60
-456def
61
-   theme_3 
62
-
63
-EOT);
64
-    }
65
-
66
-    protected function execute(InputInterface $input, OutputInterface $output): void
67
-    {
68
-        if ('' === $this->themesUrl) {
69
-            $output->writeln('<bg=red;options=bold>Themes archive url is empty.</>');
70
-
71
-            return;
72
-        }
73
-        $client = new Client();
74
-        $tempLocation = rtrim(sys_get_temp_dir(), '/').DIRECTORY_SEPARATOR.'themes.zip';
75
-        try {
76
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
77
-        } catch (ConnectException $e) {
78
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
79
-        }
80
-
81
-        $filesystem = new Filesystem();
82
-
83
-        $zip = new \ZipArchive();
84
-        if (true === $zip->open($tempLocation)) {
85
-            if (!$filesystem->exists($this->themesDirectory)) {
86
-                $filesystem->mkdir($this->themesDirectory);
87
-            }
88
-
89
-            $zip->extractTo($this->themesDirectory);
90
-            $zip->close();
91
-        }
92
-
93
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
94
-    }
95
-}
Please login to merge, or discard this patch.
Unused Use Statements   -46 removed lines patch added patch discarded remove patch
@@ -47,49 +47,3 @@
 block discarded – undo
47 47
             ->setName(self::$defaultName)
48 48
             ->setDescription('Downloads theme from configured storage.')
49 49
             ->setHelp(<<<'EOT'
50
-Location for themes archive can be defined by `THEMES_DOWNLOAD_URL` env variable. 
51
-
52
-Themes must be packed into one compressed file (*.zip). 
53
-Archive can be created with 'zip -r ../themes.zip *' command (called from your themes directory). 
54
-
55
-Remember that themes must be located in their tenants directories. Example:
56
-
57
-123abc
58
-   theme_1
59
-   theme_2
60
-456def
61
-   theme_3 
62
-
63
-EOT);
64
-    }
65
-
66
-    protected function execute(InputInterface $input, OutputInterface $output): void
67
-    {
68
-        if ('' === $this->themesUrl) {
69
-            $output->writeln('<bg=red;options=bold>Themes archive url is empty.</>');
70
-
71
-            return;
72
-        }
73
-        $client = new Client();
74
-        $tempLocation = rtrim(sys_get_temp_dir(), '/').DIRECTORY_SEPARATOR.'themes.zip';
75
-        try {
76
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
77
-        } catch (ConnectException $e) {
78
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
79
-        }
80
-
81
-        $filesystem = new Filesystem();
82
-
83
-        $zip = new \ZipArchive();
84
-        if (true === $zip->open($tempLocation)) {
85
-            if (!$filesystem->exists($this->themesDirectory)) {
86
-                $filesystem->mkdir($this->themesDirectory);
87
-            }
88
-
89
-            $zip->extractTo($this->themesDirectory);
90
-            $zip->close();
91
-        }
92
-
93
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
94
-    }
95
-}
Please login to merge, or discard this patch.
Indentation   -46 removed lines patch added patch discarded remove patch
@@ -47,49 +47,3 @@
 block discarded – undo
47 47
             ->setName(self::$defaultName)
48 48
             ->setDescription('Downloads theme from configured storage.')
49 49
             ->setHelp(<<<'EOT'
50
-Location for themes archive can be defined by `THEMES_DOWNLOAD_URL` env variable. 
51
-
52
-Themes must be packed into one compressed file (*.zip). 
53
-Archive can be created with 'zip -r ../themes.zip *' command (called from your themes directory). 
54
-
55
-Remember that themes must be located in their tenants directories. Example:
56
-
57
-123abc
58
-   theme_1
59
-   theme_2
60
-456def
61
-   theme_3 
62
-
63
-EOT);
64
-    }
65
-
66
-    protected function execute(InputInterface $input, OutputInterface $output): void
67
-    {
68
-        if ('' === $this->themesUrl) {
69
-            $output->writeln('<bg=red;options=bold>Themes archive url is empty.</>');
70
-
71
-            return;
72
-        }
73
-        $client = new Client();
74
-        $tempLocation = rtrim(sys_get_temp_dir(), '/').DIRECTORY_SEPARATOR.'themes.zip';
75
-        try {
76
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
77
-        } catch (ConnectException $e) {
78
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
79
-        }
80
-
81
-        $filesystem = new Filesystem();
82
-
83
-        $zip = new \ZipArchive();
84
-        if (true === $zip->open($tempLocation)) {
85
-            if (!$filesystem->exists($this->themesDirectory)) {
86
-                $filesystem->mkdir($this->themesDirectory);
87
-            }
88
-
89
-            $zip->extractTo($this->themesDirectory);
90
-            $zip->close();
91
-        }
92
-
93
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
94
-    }
95
-}
Please login to merge, or discard this patch.
Switch Indentation   -46 removed lines patch added patch discarded remove patch
@@ -47,49 +47,3 @@
 block discarded – undo
47 47
             ->setName(self::$defaultName)
48 48
             ->setDescription('Downloads theme from configured storage.')
49 49
             ->setHelp(<<<'EOT'
50
-Location for themes archive can be defined by `THEMES_DOWNLOAD_URL` env variable. 
51
-
52
-Themes must be packed into one compressed file (*.zip). 
53
-Archive can be created with 'zip -r ../themes.zip *' command (called from your themes directory). 
54
-
55
-Remember that themes must be located in their tenants directories. Example:
56
-
57
-123abc
58
-   theme_1
59
-   theme_2
60
-456def
61
-   theme_3 
62
-
63
-EOT);
64
-    }
65
-
66
-    protected function execute(InputInterface $input, OutputInterface $output): void
67
-    {
68
-        if ('' === $this->themesUrl) {
69
-            $output->writeln('<bg=red;options=bold>Themes archive url is empty.</>');
70
-
71
-            return;
72
-        }
73
-        $client = new Client();
74
-        $tempLocation = rtrim(sys_get_temp_dir(), '/').DIRECTORY_SEPARATOR.'themes.zip';
75
-        try {
76
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
77
-        } catch (ConnectException $e) {
78
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
79
-        }
80
-
81
-        $filesystem = new Filesystem();
82
-
83
-        $zip = new \ZipArchive();
84
-        if (true === $zip->open($tempLocation)) {
85
-            if (!$filesystem->exists($this->themesDirectory)) {
86
-                $filesystem->mkdir($this->themesDirectory);
87
-            }
88
-
89
-            $zip->extractTo($this->themesDirectory);
90
-            $zip->close();
91
-        }
92
-
93
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
94
-    }
95
-}
Please login to merge, or discard this patch.
Spacing   -46 removed lines patch added patch discarded remove patch
@@ -47,49 +47,3 @@
 block discarded – undo
47 47
             ->setName(self::$defaultName)
48 48
             ->setDescription('Downloads theme from configured storage.')
49 49
             ->setHelp(<<<'EOT'
50
-Location for themes archive can be defined by `THEMES_DOWNLOAD_URL` env variable. 
51
-
52
-Themes must be packed into one compressed file (*.zip). 
53
-Archive can be created with 'zip -r ../themes.zip *' command (called from your themes directory). 
54
-
55
-Remember that themes must be located in their tenants directories. Example:
56
-
57
-123abc
58
-   theme_1
59
-   theme_2
60
-456def
61
-   theme_3 
62
-
63
-EOT);
64
-    }
65
-
66
-    protected function execute(InputInterface $input, OutputInterface $output): void
67
-    {
68
-        if ('' === $this->themesUrl) {
69
-            $output->writeln('<bg=red;options=bold>Themes archive url is empty.</>');
70
-
71
-            return;
72
-        }
73
-        $client = new Client();
74
-        $tempLocation = rtrim(sys_get_temp_dir(), '/').DIRECTORY_SEPARATOR.'themes.zip';
75
-        try {
76
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
77
-        } catch (ConnectException $e) {
78
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
79
-        }
80
-
81
-        $filesystem = new Filesystem();
82
-
83
-        $zip = new \ZipArchive();
84
-        if (true === $zip->open($tempLocation)) {
85
-            if (!$filesystem->exists($this->themesDirectory)) {
86
-                $filesystem->mkdir($this->themesDirectory);
87
-            }
88
-
89
-            $zip->extractTo($this->themesDirectory);
90
-            $zip->close();
91
-        }
92
-
93
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
94
-    }
95
-}
Please login to merge, or discard this patch.
Braces   -46 removed lines patch added patch discarded remove patch
@@ -47,49 +47,3 @@
 block discarded – undo
47 47
             ->setName(self::$defaultName)
48 48
             ->setDescription('Downloads theme from configured storage.')
49 49
             ->setHelp(<<<'EOT'
50
-Location for themes archive can be defined by `THEMES_DOWNLOAD_URL` env variable. 
51
-
52
-Themes must be packed into one compressed file (*.zip). 
53
-Archive can be created with 'zip -r ../themes.zip *' command (called from your themes directory). 
54
-
55
-Remember that themes must be located in their tenants directories. Example:
56
-
57
-123abc
58
-   theme_1
59
-   theme_2
60
-456def
61
-   theme_3 
62
-
63
-EOT);
64
-    }
65
-
66
-    protected function execute(InputInterface $input, OutputInterface $output): void
67
-    {
68
-        if ('' === $this->themesUrl) {
69
-            $output->writeln('<bg=red;options=bold>Themes archive url is empty.</>');
70
-
71
-            return;
72
-        }
73
-        $client = new Client();
74
-        $tempLocation = rtrim(sys_get_temp_dir(), '/').DIRECTORY_SEPARATOR.'themes.zip';
75
-        try {
76
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
77
-        } catch (ConnectException $e) {
78
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
79
-        }
80
-
81
-        $filesystem = new Filesystem();
82
-
83
-        $zip = new \ZipArchive();
84
-        if (true === $zip->open($tempLocation)) {
85
-            if (!$filesystem->exists($this->themesDirectory)) {
86
-                $filesystem->mkdir($this->themesDirectory);
87
-            }
88
-
89
-            $zip->extractTo($this->themesDirectory);
90
-            $zip->close();
91
-        }
92
-
93
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
94
-    }
95
-}
Please login to merge, or discard this patch.
Upper-Lower-Casing   -46 removed lines patch added patch discarded remove patch
@@ -47,49 +47,3 @@
 block discarded – undo
47 47
             ->setName(self::$defaultName)
48 48
             ->setDescription('Downloads theme from configured storage.')
49 49
             ->setHelp(<<<'EOT'
50
-Location for themes archive can be defined by `THEMES_DOWNLOAD_URL` env variable. 
51
-
52
-Themes must be packed into one compressed file (*.zip). 
53
-Archive can be created with 'zip -r ../themes.zip *' command (called from your themes directory). 
54
-
55
-Remember that themes must be located in their tenants directories. Example:
56
-
57
-123abc
58
-   theme_1
59
-   theme_2
60
-456def
61
-   theme_3 
62
-
63
-EOT);
64
-    }
65
-
66
-    protected function execute(InputInterface $input, OutputInterface $output): void
67
-    {
68
-        if ('' === $this->themesUrl) {
69
-            $output->writeln('<bg=red;options=bold>Themes archive url is empty.</>');
70
-
71
-            return;
72
-        }
73
-        $client = new Client();
74
-        $tempLocation = rtrim(sys_get_temp_dir(), '/').DIRECTORY_SEPARATOR.'themes.zip';
75
-        try {
76
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
77
-        } catch (ConnectException $e) {
78
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
79
-        }
80
-
81
-        $filesystem = new Filesystem();
82
-
83
-        $zip = new \ZipArchive();
84
-        if (true === $zip->open($tempLocation)) {
85
-            if (!$filesystem->exists($this->themesDirectory)) {
86
-                $filesystem->mkdir($this->themesDirectory);
87
-            }
88
-
89
-            $zip->extractTo($this->themesDirectory);
90
-            $zip->close();
91
-        }
92
-
93
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
94
-    }
95
-}
Please login to merge, or discard this patch.