From b5eb93058007abff998c1aec8adf6c5d7335eb59 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Tue, 30 Dec 2014 01:10:45 +0100 Subject: [PATCH] Install: Use foreach to check for obsolete config files --- admin/install.php | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/admin/install.php b/admin/install.php index 0e2be3e319..17388694d0 100644 --- a/admin/install.php +++ b/admin/install.php @@ -284,13 +284,42 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes 'Disable safe_mode in php.ini before proceeding' ) ?> 'move', + 'custom_constants_inc.php' => 'move', + 'custom_strings_inc.php' => 'move', + 'custom_functions_inc.php' => 'move', + 'custom_relationships_inc.php' => 'move', + 'mc_config_defaults_inc.php' => 'delete', + 'mc_config_inc.php' => 'contents', + ); + + foreach( $t_config_files as $t_file => $t_action ) { + $t_dir = dirname( dirname( __FILE__ ) ) . '/'; + if( substr( $t_file, 0, 3 ) == 'mc_' ) { + $t_dir .= 'api/soap/'; + } + + switch( $t_action ) { + case 'move': + $t_message = "Move $t_file to config/$t_file."; + break; + case 'delete': + $t_message = 'Delete this file.'; + break; + case 'contents': + $t_message = 'Move contents to config_inc.php file.'; + break; + } + + print_test( + "Checking there is no '$t_file' file in 1.2.x location.", + !file_exists( $t_dir . $t_file ), + true, + $t_message + ); + } ?>