1414
1515use Joomlatools \Console \Command ;
1616use Joomlatools \Console \Command \Database ;
17- use Joomlatools \Console \Command \Vhost ;
18- use Joomlatools \Console \Joomla \Util ;
1917
2018class Install extends Database \AbstractDatabase
2119{
@@ -115,11 +113,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
115113 $ this ->installExtensions ($ input , $ output );
116114 }
117115
118- $ this ->_enableWebInstaller ($ input , $ output );
119-
120- $ output ->writeln ("Your new Joomla site has been configured. " );
116+ $ output ->writeln ("Your new Joomla site has been created. " );
117+ $ output ->writeln ("It was installed using the domain name <info> $ this ->site .test</info>. " );
121118 $ output ->writeln ("You can login using the following username and password combination: <info>admin</info>/<info>admin</info>. " );
122119
120+
123121 return 0 ;
124122 }
125123
@@ -138,7 +136,7 @@ public function importdb(InputInterface $input, OutputInterface $output)
138136 '--www ' => $ this ->www
139137 );
140138
141- $ optionalArgs = array ('sample-data ' , 'drop ' , 'mysql-login ' , 'mysql_db_prefix ' , ' mysql-db-prefix ' , 'mysql-host ' , 'mysql-port ' , 'mysql-database ' , 'skip-exists-check ' , 'skip-create-statement ' , 'www ' , 'use-webroot-dir ' );
139+ $ optionalArgs = array ('sample-data ' , 'drop ' , 'mysql-login ' , 'mysql-db-prefix ' , 'mysql-host ' , 'mysql-port ' , 'mysql-database ' , 'skip-exists-check ' , 'skip-create-statement ' , 'www ' , 'use-webroot-dir ' );
142140 foreach ($ optionalArgs as $ optionalArg )
143141 {
144142 $ value = $ input ->getOption ($ optionalArg );
@@ -163,7 +161,7 @@ public function createConfig(InputInterface $input, OutputInterface $output)
163161 '--www ' => $ this ->www
164162 );
165163
166- $ optionalArgs = array ('overwrite ' , 'mysql-login ' , 'mysql_db_prefix ' , ' mysql-db-prefix ' , 'mysql-host ' , 'mysql-port ' , 'mysql-database ' , 'mysql-driver ' , 'interactive ' , 'options ' , 'www ' , 'use-webroot-dir ' );
164+ $ optionalArgs = array ('overwrite ' , 'mysql-login ' , 'mysql-db-prefix ' , 'mysql-host ' , 'mysql-port ' , 'mysql-database ' , 'mysql-driver ' , 'interactive ' , 'options ' , 'www ' , 'use-webroot-dir ' );
167165 foreach ($ optionalArgs as $ optionalArg )
168166 {
169167 $ value = $ input ->getOption ($ optionalArg );
@@ -204,55 +202,4 @@ public function installExtensions(InputInterface $input, OutputInterface $output
204202
205203 $ installer ->run ($ extension_input , $ output );
206204 }
207-
208- protected function _enableWebInstaller (InputInterface $ input , OutputInterface $ output )
209- {
210- $ version = Util::getJoomlaVersion ($ this ->target_dir );
211-
212- if (version_compare ($ version ->release , '3.2.0 ' , '< ' )) {
213- return ;
214- }
215-
216- $ xml = simplexml_load_file ('http://appscdn.joomla.org/webapps/jedapps/webinstaller.xml ' );
217-
218- if (!$ xml )
219- {
220- $ output ->writeln ('<warning>Failed to install web installer</warning> ' );
221-
222- return ;
223- }
224-
225- $ url = '' ;
226- foreach ($ xml ->update ->downloads ->children () as $ download )
227- {
228- $ attributes = $ download ->attributes ();
229- if ($ attributes ->type == 'full ' && $ attributes ->format == 'zip ' )
230- {
231- $ url = (string ) $ download ;
232- break ;
233- }
234- }
235-
236- if (empty ($ url )) {
237- return ;
238- }
239-
240- $ filename = Util::getWritablePath ().'/cache/ ' .basename ($ url );
241- if (!file_exists ($ filename ))
242- {
243- $ bytes = file_put_contents ($ filename , fopen ($ url , 'r ' ));
244- if ($ bytes === false || $ bytes == 0 ) {
245- return ;
246- }
247- }
248-
249- `mkdir -p $ this ->target_dir /plugins/installer `;
250- `cd $ this ->target_dir /plugins/installer/ && unzip -o $ filename `;
251-
252- $ sql = "INSERT INTO `j_extensions` (`name`, `type`, `element`, `folder`, `enabled`, `access`, `manifest_cache`) VALUES ('plg_installer_webinstaller', 'plugin', 'webinstaller', 'installer', 1, 1, '{ \"name \": \"plg_installer_webinstaller \", \"type \": \"plugin \", \"version \": \"" .$ xml ->update ->version ."\", \"description \": \"Web Installer \"}'); " ;
253- $ sql = escapeshellarg ($ sql );
254-
255- $ password = empty ($ this ->mysql ->password ) ? '' : sprintf ("-p'%s' " , $ this ->mysql ->password );
256- exec (sprintf ("mysql --host=%s --port=%u -u'%s' %s %s -e %s " , $ this ->mysql ->host , $ this ->mysql ->port , $ this ->mysql ->user , $ password , $ this ->target_db , $ sql ));
257- }
258205}
0 commit comments