Code Duplication    Length = 31-35 lines in 2 locations

src/Magestead/Installers/Magento2Project.php 1 location

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

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