Code Duplication    Length = 31-35 lines in 2 locations

src/Magestead/Installers/MagentoProject.php 1 location

@@ 49-83 (lines=35) @@
46
     * @param $projectPath
47
     * @param $output
48
     */
49
    protected function installMagento(array $options, $projectPath, OutputInterface $output)
50
    {
51
        $locale           = $options['magestead']['apps']['mba_12345']['locale'];
52
        $db_name          = $options['magestead']['apps']['mba_12345']['db_name'];
53
        $base_url         = $options['magestead']['apps']['mba_12345']['base_url'];
54
        $default_currency = $options['magestead']['apps']['mba_12345']['default_currency'];
55
56
        $install = 'vagrant ssh -c \'cd /var/www/public; php -f install.php -- \
57
--license_agreement_accepted "yes" \
58
--locale "' . $locale . '" \
59
--timezone "Europe/London" \
60
--default_currency "' . $default_currency . '" \
61
--db_host "localhost" \
62
--db_name "' . $db_name . '" \
63
--db_user "magestead" \
64
--db_pass "vagrant" \
65
--session_save "db" \
66
--url "http://' . $base_url . '/" \
67
--use_rewrites "yes" \
68
--skip_url_validation "yes" \
69
--use_secure "no" \
70
--use_secure_admin "no" \
71
--secure_base_url "http://' . $base_url . '/" \
72
--admin_firstname "RichDynamix" \
73
--admin_lastname "Magestead" \
74
--admin_email "[email protected]" \
75
--admin_username "admin" \
76
--admin_password "password123"\' ';
77
78
        new ProcessCommand($install, $projectPath, $output);
79
80
        $this->configureRedis($projectPath);
81
        $this->setPermissions($projectPath, $output);
82
        $this->installMagerun($projectPath, $output);
83
    }
84
85
    /**
86
     * @param $projectPath

src/Magestead/Installers/Magento2Project.php 1 location

@@ 100-130 (lines=31) @@
97
     * @param $projectPath
98
     * @param OutputInterface $output
99
     */
100
    protected function installMagento(array $config, array $options, $projectPath, OutputInterface $output)
101
    {
102
        $this->setPermissions($projectPath, $output);
103
104
        $this->installSampleData($options, $projectPath, $output);
105
106
        $output->writeln('<info>Installing Magento 2 Software</info>');
107
        $locale           = $config['magestead']['apps']['mba_12345']['locale'];
108
        $db_name          = $config['magestead']['apps']['mba_12345']['db_name'];
109
        $base_url         = $config['magestead']['apps']['mba_12345']['base_url'];
110
        $default_currency = $config['magestead']['apps']['mba_12345']['default_currency'];
111
112
        $install = 'vagrant ssh -c \'cd /var/www/public; bin/magento setup:install --base-url=http://'.$base_url.'/ \
113
--db-host=localhost \
114
--db-name='.$db_name.' \
115
--db-user=magestead \
116
--db-password=vagrant \
117
--admin-firstname=RichDynamix \
118
--admin-lastname=Magestead \
119
[email protected] \
120
--admin-user=admin \
121
--admin-password=password123 \
122
--language='.$locale.' \
123
--currency='.$default_currency.' \
124
--timezone=Europe/London \
125
--use-rewrites=1 \
126
--backend-frontname=admin \
127
--session-save=db \'';
128
129
        new ProcessCommand($install, $projectPath, $output);
130
    }
131
132
    /**
133
     * @param $options