Skip to content

Commit

Permalink
Replace error_string calls with calls to the Error class
Browse files Browse the repository at this point in the history
The old error_string function has been moved to the MantisBT\Error
class as a static function.
  • Loading branch information
davidhicks committed Feb 25, 2012
1 parent b09de30 commit 2cacc8d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
6 changes: 4 additions & 2 deletions application/services/soap/mc_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# change the license of future releases.
# See docs/ folder for more details

use MantisBT\Error;

# set up error_handler() as the new default error handling function
set_error_handler( 'mc_error_handler' );

Expand Down Expand Up @@ -398,11 +400,11 @@ function mc_error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) {
break;
case E_USER_ERROR:
$t_error_type = "APPLICATION ERROR #$p_error";
$t_error_description = error_string( $p_error );
$t_error_description = Error::error_string( $p_error );
break;
case E_USER_WARNING:
$t_error_type = "APPLICATION WARNING #$p_error";
$t_error_description = error_string( $p_error );
$t_error_description = Error::error_string( $p_error );
break;
case E_USER_NOTICE:

Expand Down
6 changes: 4 additions & 2 deletions public/admin/check/check_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* @link http://www.mantisbt.org
*/

use MantisBT\Error;

$g_show_all = false;
$g_show_errors = false;

Expand Down Expand Up @@ -75,11 +77,11 @@ function check_print_error_rows() {
break;
case E_USER_ERROR:
$t_error_type = 'APPLICATION ERROR #' . $t_error['error'];
$t_error_description = htmlentities( error_string( $t_error['error'] ) );
$t_error_description = htmlentities( Error::error_string( $t_error['error'] ) );
break;
case E_USER_WARNING:
$t_error_type = 'APPLICATION WARNING #' . $t_error['error'];
$t_error_description = htmlentities( error_string( $t_error['error'] ) );
$t_error_description = htmlentities( Error::error_string( $t_error['error'] ) );
break;
case E_USER_NOTICE:
# used for debugging
Expand Down
9 changes: 4 additions & 5 deletions public/print_all_bug_options_reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
* @uses print_api.php
*/

/**
* MantisBT Core API's
*/
use MantisBT\Error;

require_once( 'core.php' );
require_api( 'authentication_api.php' );
require_api( 'constant_inc.php' );
Expand Down Expand Up @@ -88,9 +87,9 @@
echo '<br /><div>';

if ( $result ) {
print lang_get( 'operation_successful' );
echo lang_get( 'operation_successful' );
} else {
print error_string( ERROR_GENERIC );
echo Error::error_string( ERROR_GENERIC );
}

echo '<br />';
Expand Down
9 changes: 4 additions & 5 deletions public/print_all_bug_options_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
* @uses print_api.php
*/

/**
* MantisBT Core API's
*/
use MantisBT\Error;

require_once( 'core.php' );
require_api( 'authentication_api.php' );
require_api( 'constant_inc.php' );
Expand Down Expand Up @@ -97,9 +96,9 @@
echo '<br /><div>';

if ( $result ) {
print lang_get( 'operation_successful' );
echo lang_get( 'operation_successful' );
} else {
print error_string( ERROR_GENERIC );
echo Error::error_string( ERROR_GENERIC );
}

echo '<br />';
Expand Down

0 comments on commit 2cacc8d

Please sign in to comment.