Skip to content

Commit 884d3b4

Browse files
committed
Merge branch 'mrrobot47-update/log_msgs'
2 parents de002f7 + 45cb9eb commit 884d3b4

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/Site_Command.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function create( $args, $assoc_args ) {
148148

149149
$this->init_checks();
150150

151-
EE::log( 'Configuring project...' );
151+
EE::log( 'Configuring project.' );
152152

153153
$this->configure_site();
154154
$this->create_site( $assoc_args );
@@ -241,7 +241,7 @@ public function enable( $args ) {
241241
\EE\Utils\delem_log( 'site enable start' );
242242
$args = \EE\Utils\set_site_arg( $args, 'site enable' );
243243
$this->populate_site_info( $args );
244-
EE::log( "Enabling site $this->site_name..." );
244+
EE::log( "Enabling site $this->site_name." );
245245
if ( $this->docker::docker_compose_up( $this->site_root ) ) {
246246
$this->db::update( [ 'is_enabled' => '1' ], [ 'sitename' => $this->site_name ] );
247247
EE::success( "Site $this->site_name enabled." );
@@ -263,7 +263,7 @@ public function disable( $args ) {
263263
\EE\Utils\delem_log( 'site disable start' );
264264
$args = \EE\Utils\set_site_arg( $args, 'site disable' );
265265
$this->populate_site_info( $args );
266-
EE::log( "Disabling site $this->site_name..." );
266+
EE::log( "Disabling site $this->site_name." );
267267
if ( $this->docker::docker_compose_down( $this->site_root ) ) {
268268
$this->db::update( [ 'is_enabled' => '0' ], [ 'sitename' => $this->site_name ] );
269269
EE::success( "Site $this->site_name disabled." );
@@ -366,8 +366,8 @@ private function configure_site() {
366366
EE::error( "Webroot directory for site $this->site_name already exists." );
367367
}
368368

369-
EE::log( "Creating WordPress site $this->site_name..." );
370-
EE::log( 'Copying configuration files...' );
369+
EE::log( "Creating WordPress site $this->site_name." );
370+
EE::log( 'Copying configuration files.' );
371371

372372
$filter = array();
373373
$filter[] = $this->site_type;
@@ -461,6 +461,10 @@ private function create_site( $assoc_args ) {
461461
$this->setup_site_network();
462462
$this->level = 3;
463463
try {
464+
EE::log( 'Pulling latest images. This may take some time.' );
465+
chdir( $this->site_root );
466+
\EE\Utils\default_launch( 'docker-compose pull' );
467+
EE::log( 'Starting site\'s services.' );
464468
if ( ! $this->docker::docker_compose_up( $this->site_root ) ) {
465469
throw new Exception( 'There was some error in docker-compose up.' );
466470
}
@@ -620,6 +624,8 @@ private function wp_download_and_config( $assoc_args ) {
620624
}
621625
}
622626

627+
EE::log( 'Downloading and configuring WordPress.' );
628+
623629
$chown_command = "docker-compose exec php chown -R www-data: /var/www/";
624630
EE::debug( 'COMMAND: ' . $chown_command );
625631
EE::debug( 'STDOUT: ' . shell_exec( $chown_command ) );
@@ -657,7 +663,7 @@ private function create_etc_hosts_entry() {
657663
* Install wordpress with given credentials.
658664
*/
659665
private function install_wp() {
660-
EE::log( "\nInstalling WordPress site..." );
666+
EE::log( "\nInstalling WordPress site." );
661667
chdir( $this->site_root );
662668
$install_command = "docker-compose exec --user='www-data' php wp core install --url='" . $this->site_name . "' --title='" . $this->site_title . "' --admin_user='" . $this->site_user . "'" . ( ! $this->site_pass ? "" : " --admin_password='" . $this->site_pass . "'" ) . " --admin_email='" . $this->site_email . "'";
663669

@@ -750,7 +756,7 @@ private function populate_site_info( $args ) {
750756
private function catch_clean( $e ) {
751757
\EE\Utils\delem_log( 'site cleanup start' );
752758
EE::warning( $e->getMessage() );
753-
EE::warning( 'Initiating clean-up...' );
759+
EE::warning( 'Initiating clean-up.' );
754760
$this->delete_site();
755761
\EE\Utils\delem_log( 'site cleanup end' );
756762
exit;
@@ -775,7 +781,7 @@ private function shutDownFunction() {
775781
$error = error_get_last();
776782
if ( isset( $error ) ) {
777783
if ( $error['type'] === E_ERROR ) {
778-
EE::warning( 'An Error occurred. Initiating clean-up...' );
784+
EE::warning( 'An Error occurred. Initiating clean-up.' );
779785
$this->logger->error( 'Type: ' . $error['type'] );
780786
$this->logger->error( 'Message: ' . $error['message'] );
781787
$this->logger->error( 'File: ' . $error['file'] );

0 commit comments

Comments
 (0)