@@ -59,11 +59,12 @@ public function __construct(
5959 InputInterface $ input ,
6060 OutputInterface $ output ,
6161 WPCli $ WPCli
62- ) {
63- $ this ->config = $ config ;
64- $ this ->input = $ input ;
65- $ this ->output = $ output ;
66- $ this ->WPCli = $ WPCli ;
62+ )
63+ {
64+ $ this ->config = $ config ;
65+ $ this ->input = $ input ;
66+ $ this ->output = $ output ;
67+ $ this ->WPCli = $ WPCli ;
6768 $ this ->command = $ command ;
6869 }
6970
@@ -109,22 +110,22 @@ public function pathToWordPress()
109110 protected function run ()
110111 {
111112 $ args = [
112- 'url ' => $ this ->input ->getOption ('url ' ),
113- 'title ' => $ this ->input ->getOption ('title ' ),
114- 'admin_user ' => $ this ->config ->get ('wp_username ' ),
113+ 'url ' => $ this ->input ->getOption ('url ' ),
114+ 'title ' => $ this ->input ->getOption ('title ' ),
115+ 'admin_user ' => $ this ->config ->get ('wp_username ' ),
115116 'admin_email ' => $ this ->config ->get ('email ' ),
116- 'skip-email ' => true ,
117- 'path ' => $ this ->input ->getArgument ('name ' ),
117+ 'skip-email ' => true ,
118+ 'path ' => realpath ( $ this ->input ->getArgument ('name ' ) ),
118119 ];
119120
120121 $ this ->output ->writeln ("<comment>Installing WordPress, you'll be asked for admin password which is optional if not provided we'll generate one for you.<comment> " );
121122
122123 // ask for admin password and feed it to wp-cli
123- $ helper = $ this ->command ->getHelper ('question ' );
124+ $ helper = $ this ->command ->getHelper ('question ' );
124125 $ question = new Question ('<info>Please enter new password for WordPress admin panel : </info> ' , null );
125126 $ question ->setHidden (true );
126127 $ question ->setHiddenFallback (false );
127- $ args [ 'admin_password ' ] = $ helper ->ask ($ this ->input , $ this ->output , $ question );
128+ $ args ['admin_password ' ] = $ helper ->ask ($ this ->input , $ this ->output , $ question );
128129
129130 $ this ->WPCli ->install ($ args );
130131
@@ -139,11 +140,11 @@ protected function run()
139140 protected function configure ()
140141 {
141142 $ this ->WPCli ->config ([
142- 'dbname ' => $ this ->input ->getOption ('db ' ) ?: $ this ->input ->getArgument ('name ' ),
143- 'dbuser ' => $ this ->config ->get ('username ' ),
144- 'dbpass ' => $ this ->config ->get ('password ' ),
145- 'dbhost ' => $ this ->config ->get ('host ' ),
146- 'path ' => $ this ->input ->getArgument ('name ' ),
143+ 'dbname ' => $ this ->input ->getOption ('db ' ) ?: $ this ->input ->getArgument ('name ' ),
144+ 'dbuser ' => $ this ->config ->get ('username ' ),
145+ 'dbpass ' => $ this ->config ->get ('password ' ),
146+ 'dbhost ' => $ this ->config ->get ('host ' ),
147+ 'path ' => realpath ( $ this ->input ->getArgument ('name ' ) ),
147148 'dbprefix ' => $ this ->input ->getOption ('prefix ' ) ?: $ this ->input ->getArgument ('name ' ) . '_ ' ,
148149 ]);
149150
@@ -178,7 +179,7 @@ protected function createDatabase()
178179 */
179180 protected function connect ()
180181 {
181- $ host = $ this ->config ->get ('host ' );
182+ $ host = $ this ->config ->get ('host ' );
182183 $ username = $ this ->config ->get ('username ' );
183184 $ password = $ this ->config ->get ('password ' );
184185
0 commit comments