@@ -936,13 +936,8 @@ public function download_wp( $subdir = '' ) {
936936 mkdir ( $ dest_dir );
937937 }
938938
939- error_log ( 'Copy WP from Cache Dir to Run Dir ' . $ dest_dir );
940- error_log ( print_r ( scandir ( $ dest_dir ), true ) );
941-
942939 self ::copy_dir ( self ::$ cache_dir , $ dest_dir );
943940
944- error_log ( print_r ( scandir ( $ dest_dir ), true ) );
945-
946941 if ( ! is_dir ( $ dest_dir . '/wp-content/mu-plugins ' ) ) {
947942 mkdir ( $ dest_dir . '/wp-content/mu-plugins ' );
948943 }
@@ -980,24 +975,16 @@ public function create_config( $subdir = '', $extra_php = false ) {
980975 $ config_cache_path = self ::$ install_cache_dir . '/config_ ' . md5 ( implode ( ': ' , $ params ) . ':subdir= ' . $ subdir );
981976 }
982977
983- error_log ( 'Creating wp-config.php in Run Dir: ' . $ run_dir );
984- error_log ( 'Config Cache Path: ' . $ config_cache_path . ' ' . (int ) file_exists ( $ config_cache_path ) );
985-
986- error_log ( print_r ( scandir ( $ run_dir ), true ) );
987-
988978 if ( $ config_cache_path && file_exists ( $ config_cache_path ) ) {
989979 copy ( $ config_cache_path , $ run_dir . '/wp-config.php ' );
990980 } else {
991- $ result = $ this ->proc ( 'wp config create ' , $ params , $ subdir )->run_check ();
992- error_log ( 'Running wp config create ' . Utils \assoc_args_to_str ( $ params ) . ' in Run Dir: ' . $ run_dir );
993- error_log ( $ result ->stderr );
994- error_log ( $ result ->stdout );
981+ // TODO: Fail scenario if wp-config.php cannot be written.
982+ $ this ->proc ( 'wp config create ' , $ params , $ subdir )->run_check ();
995983 if ( $ config_cache_path && file_exists ( $ run_dir . '/wp-config.php ' ) ) {
996984 copy ( $ run_dir . '/wp-config.php ' , $ config_cache_path );
997985 }
998986 }
999987
1000- error_log ( print_r ( scandir ( $ run_dir ), true ) );
1001988 }
1002989
1003990 public function install_wp ( $ subdir = '' ) {
@@ -1036,41 +1023,18 @@ public function install_wp( $subdir = '' ) {
10361023 $ install_cache_path = self ::$ install_cache_dir . '/install_ ' . md5 ( implode ( ': ' , $ install_args ) . ':subdir= ' . $ subdir );
10371024 }
10381025
1039- error_log ( 'Install Cache Dir: ' . self ::$ install_cache_dir );
1040- error_log ( 'Install Cache Path: ' . $ install_cache_path );
1041- error_log ( 'Cache Dir: ' . self ::$ cache_dir );
1042- error_log ( print_r ( scandir ( self ::$ cache_dir ), true ) );
1043- error_log ( 'SQLite Cache Dir: ' . self ::$ sqlite_cache_dir );
1044- error_log ( print_r ( scandir ( self ::$ sqlite_cache_dir ), true ) );
1045- error_log ( 'Run Dir: ' . $ run_dir );
1046- error_log ( print_r ( scandir ( $ run_dir ), true ) );
1047-
10481026 if ( $ install_cache_path && file_exists ( $ install_cache_path ) ) {
1049- error_log ( 'Install Cache Dir: ' . $ install_cache_path );
1050- error_log ( print_r ( scandir ( $ install_cache_path ), true ) );
1051- error_log ( print_r ( scandir ( $ install_cache_path . '/wp-content ' ), true ) );
1052-
10531027 self ::copy_dir ( $ install_cache_path , $ run_dir );
10541028
1055- error_log ( 'Run Dir after Copy: ' );
1056-
1057- error_log ( print_r ( scandir ( $ run_dir ), true ) );
1058-
10591029 // This is the sqlite equivalent of restoring a database dump in MySQL
10601030 if ( 'sqlite ' === self ::$ db_type ) {
10611031 copy ( "{$ install_cache_path }.sqlite " , "$ run_dir/wp-content/database/.ht.sqlite " );
10621032 } else {
10631033 self ::run_sql ( 'mysql --no-defaults ' , [ 'execute ' => "source {$ install_cache_path }.sql " ], true /*add_database*/ );
10641034 }
10651035 } else {
1066- error_log ( '$subdir: ' . $ subdir );
1067- if ( $ subdir ) {
1068- error_log ( print_r ( scandir ( $ subdir ), true ) );
1069- }
1036+ $ this ->proc ( 'wp core install ' , $ install_args , $ subdir )->run_check ();
10701037
1071- $ result = $ this ->proc ( 'wp core install ' , $ install_args , $ subdir )->run_check ();
1072- error_log ( $ result ->stderr );
1073- error_log ( $ result ->stdout );
10741038 if ( $ install_cache_path ) {
10751039 if ( ! file_exists ( $ install_cache_path ) ) {
10761040 mkdir ( $ install_cache_path );
0 commit comments