From: <vb...@us...> - 2002-08-27 12:44:13
|
Update of /cvsroot/mantisbt/mantisbt/core In directory usw-pr-cvs1:/tmp/cvs-serv20815/core Modified Files: API.php config_api.php file_api.php Log Message: - Replaced the use of / by DIRECTORY_SEPARATOR in a couple of places. - Check for obsolete variables is now only done in the login_page.php as well as admin pages. - Add config_obsolete() to config_api.php - Added core/obsolete.php to call config_obsolete for all obsolete variables. - Localised "cached" Index: API.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/API.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- API.php 26 Aug 2002 22:35:04 -0000 1.10 +++ API.php 27 Aug 2002 12:44:09 -0000 1.11 @@ -9,29 +9,10 @@ # INCLUDES ########################################################################### - $t_core_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR; + $t_core_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; # Include compatibility file before anything else require_once( $t_core_dir . 'php_api.php' ); - - # Should be eventually moved to the admin scripts, but keep it here for a while - # to make sure people don't miss it. - function obsolete_config_variable($var, $replace) { - global $$var; - if (isset($$var)) { - PRINT '$' . $var . ' is now obsolete'; - if ($replace != '') { - PRINT ', please use $' . $replace; - } - exit; - } - } - - # Check for obsolete variables - obsolete_config_variable('g_notify_developers_on_new', 'g_notify_flags'); - obsolete_config_variable('g_notify_on_new_threshold', 'g_notify_flags'); - obsolete_config_variable('g_notify_admin_on_new', 'g_notify_flags'); - require_once( $t_core_dir . 'timer_api.php' ); # initialize our timer @@ -44,7 +25,6 @@ # DATABASE WILL BE OPENED HERE!! THE DATABASE SHOULDN'T BE EXPLICITLY # OPENED ANYWHERE ELSE. require_once( $t_core_dir . 'database_api.php' ); - require_once( $t_core_dir . 'config_api.php' ); require_once( $t_core_dir . 'gpc_api.php' ); Index: config_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/config_api.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- config_api.php 27 Aug 2002 10:08:08 -0000 1.3 +++ config_api.php 27 Aug 2002 12:44:10 -0000 1.4 @@ -64,4 +64,17 @@ return true; } + # ------------------ + # Checks if an obsolete configuration variable is still in use. If so, an error + # will be generated and the script will exit. This is called from login_page.php and + # admin_check.php. + function config_obsolete($var, $replace) { + if ( config_is_set( $var ) ) { + PRINT '$' . $var . ' is now obsolete'; + if ($replace != '') { + PRINT ', please use $' . $replace; + } + exit; + } + } ?> Index: file_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/file_api.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- file_api.php 26 Aug 2002 22:42:26 -0000 1.3 +++ file_api.php 27 Aug 2002 12:44:10 -0000 1.4 @@ -43,7 +43,7 @@ } if ( ( FTP == config_get( 'file_upload_method' ) ) && file_exists ( $v_diskfile ) ) { - PRINT " (cached)"; + PRINT ' (' . lang_get( 'cached' ) . ')'; } if ( $i != ($num_files - 1) ) { |