Completed
Pull Request — 2.1 (#1109)
by Paweł
11:04
created
SWP/Bundle/CoreBundle/Command/DownloadThemesFromExternalStorageCommand.php 7 patches
Doc Comments   -47 removed lines patch added patch discarded remove patch
@@ -47,50 +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
-
76
-        try {
77
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
78
-        } catch (ConnectException $e) {
79
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
80
-        }
81
-
82
-        $filesystem = new Filesystem();
83
-
84
-        $zip = new \ZipArchive();
85
-        if (true === $zip->open($tempLocation)) {
86
-            if (!$filesystem->exists($this->themesDirectory)) {
87
-                $filesystem->mkdir($this->themesDirectory);
88
-            }
89
-
90
-            $zip->extractTo($this->themesDirectory);
91
-            $zip->close();
92
-        }
93
-
94
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
95
-    }
96
-}
Please login to merge, or discard this patch.
Unused Use Statements   -47 removed lines patch added patch discarded remove patch
@@ -47,50 +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
-
76
-        try {
77
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
78
-        } catch (ConnectException $e) {
79
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
80
-        }
81
-
82
-        $filesystem = new Filesystem();
83
-
84
-        $zip = new \ZipArchive();
85
-        if (true === $zip->open($tempLocation)) {
86
-            if (!$filesystem->exists($this->themesDirectory)) {
87
-                $filesystem->mkdir($this->themesDirectory);
88
-            }
89
-
90
-            $zip->extractTo($this->themesDirectory);
91
-            $zip->close();
92
-        }
93
-
94
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
95
-    }
96
-}
Please login to merge, or discard this patch.
Indentation   -47 removed lines patch added patch discarded remove patch
@@ -47,50 +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
-
76
-        try {
77
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
78
-        } catch (ConnectException $e) {
79
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
80
-        }
81
-
82
-        $filesystem = new Filesystem();
83
-
84
-        $zip = new \ZipArchive();
85
-        if (true === $zip->open($tempLocation)) {
86
-            if (!$filesystem->exists($this->themesDirectory)) {
87
-                $filesystem->mkdir($this->themesDirectory);
88
-            }
89
-
90
-            $zip->extractTo($this->themesDirectory);
91
-            $zip->close();
92
-        }
93
-
94
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
95
-    }
96
-}
Please login to merge, or discard this patch.
Switch Indentation   -47 removed lines patch added patch discarded remove patch
@@ -47,50 +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
-
76
-        try {
77
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
78
-        } catch (ConnectException $e) {
79
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
80
-        }
81
-
82
-        $filesystem = new Filesystem();
83
-
84
-        $zip = new \ZipArchive();
85
-        if (true === $zip->open($tempLocation)) {
86
-            if (!$filesystem->exists($this->themesDirectory)) {
87
-                $filesystem->mkdir($this->themesDirectory);
88
-            }
89
-
90
-            $zip->extractTo($this->themesDirectory);
91
-            $zip->close();
92
-        }
93
-
94
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
95
-    }
96
-}
Please login to merge, or discard this patch.
Spacing   -47 removed lines patch added patch discarded remove patch
@@ -47,50 +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
-
76
-        try {
77
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
78
-        } catch (ConnectException $e) {
79
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
80
-        }
81
-
82
-        $filesystem = new Filesystem();
83
-
84
-        $zip = new \ZipArchive();
85
-        if (true === $zip->open($tempLocation)) {
86
-            if (!$filesystem->exists($this->themesDirectory)) {
87
-                $filesystem->mkdir($this->themesDirectory);
88
-            }
89
-
90
-            $zip->extractTo($this->themesDirectory);
91
-            $zip->close();
92
-        }
93
-
94
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
95
-    }
96
-}
Please login to merge, or discard this patch.
Braces   -47 removed lines patch added patch discarded remove patch
@@ -47,50 +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
-
76
-        try {
77
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
78
-        } catch (ConnectException $e) {
79
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
80
-        }
81
-
82
-        $filesystem = new Filesystem();
83
-
84
-        $zip = new \ZipArchive();
85
-        if (true === $zip->open($tempLocation)) {
86
-            if (!$filesystem->exists($this->themesDirectory)) {
87
-                $filesystem->mkdir($this->themesDirectory);
88
-            }
89
-
90
-            $zip->extractTo($this->themesDirectory);
91
-            $zip->close();
92
-        }
93
-
94
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
95
-    }
96
-}
Please login to merge, or discard this patch.
Upper-Lower-Casing   -47 removed lines patch added patch discarded remove patch
@@ -47,50 +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
-
76
-        try {
77
-            $client->request('GET', $this->themesUrl, ['sink' => $tempLocation]);
78
-        } catch (ConnectException $e) {
79
-            $output->writeln(sprintf("<bg=red;options=bold>Can't download themes package from '%s'.</>", $this->themesUrl));
80
-        }
81
-
82
-        $filesystem = new Filesystem();
83
-
84
-        $zip = new \ZipArchive();
85
-        if (true === $zip->open($tempLocation)) {
86
-            if (!$filesystem->exists($this->themesDirectory)) {
87
-                $filesystem->mkdir($this->themesDirectory);
88
-            }
89
-
90
-            $zip->extractTo($this->themesDirectory);
91
-            $zip->close();
92
-        }
93
-
94
-        $output->writeln('<bg=green;options=bold>Themes were downloaded and extracted.</>');
95
-    }
96
-}
Please login to merge, or discard this patch.