Skip to content

Commit

Permalink
Code Guidelines: Fix naming of variable '$result' to $t_result
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Jan 26, 2014
1 parent 0ee5e93 commit 840c1c1
Show file tree
Hide file tree
Showing 56 changed files with 383 additions and 387 deletions.
4 changes: 2 additions & 2 deletions adm_config_report.php
Expand Up @@ -262,7 +262,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
FROM $t_config_table
$t_where
ORDER BY user_id, project_id, config_id ";
$result = db_query_bound( $query );
$t_result = db_query_bound( $query );
?>

<!-- FILTER FORM -->
Expand Down Expand Up @@ -355,7 +355,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
# db contains a large number of configurations
$t_form_security_token = form_security_token( 'adm_config_delete' );

while( $row = db_fetch_array( $result ) ) {
while( $row = db_fetch_array( $t_result ) ) {
extract( $row, EXTR_PREFIX_ALL, 'v' );

?>
Expand Down
8 changes: 4 additions & 4 deletions admin/copy_field.php
Expand Up @@ -68,13 +68,13 @@
$t_bug_table = db_get_table( 'bug' );
$query = 'SELECT * FROM ' . $t_string_table . ' WHERE field_id = ' . db_param() . ' and value <> ' . db_param();

$result = @db_query_bound( $query, array( $f_source_field_id, '' ) );
if( FALSE == $result ) {
$t_result = @db_query_bound( $query, array( $f_source_field_id, '' ) );
if( FALSE == $t_result ) {
echo '<p>No fields need to be updated.</p>';
}
else {

$count = db_num_rows( $result );
$count = db_num_rows( $t_result );
echo '<p>Found ' . $count . ' fields to be updated.</p>';
$t_failures = 0;

Expand All @@ -86,7 +86,7 @@
}

for( $i = 0;$i < $count;$i++ ) {
$row = db_fetch_array( $result );
$row = db_fetch_array( $t_result );
extract( $row, EXTR_PREFIX_ALL, 'v' );

# trace bug id back to project
Expand Down
20 changes: 10 additions & 10 deletions admin/install.php
Expand Up @@ -380,8 +380,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
$f_db_exists = true;
}
if( $f_db_type == 'db2' ) {
$result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $result === false ) {
$t_result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $t_result === false ) {
print_test_result( BAD, true, 'set schema failed: ' . $g_db->errorMsg() );
}
} else {
Expand Down Expand Up @@ -412,8 +412,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
if( $t_result == true ) {
$t_db_open = true;
if( $f_db_type == 'db2' ) {
$result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $result === false ) {
$t_result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $t_result === false ) {
print_test_result( BAD, true, 'set schema failed: ' . $g_db->errorMsg() );
}
} else {
Expand Down Expand Up @@ -789,8 +789,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
$t_result = @$g_db->Connect( $f_hostname, $f_db_username, $f_db_password, $f_database_name );

if( $f_db_type == 'db2' ) {
$result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $result === false ) {
$t_result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $t_result === false ) {
echo $g_db->errorMsg();
}
}
Expand Down Expand Up @@ -839,8 +839,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
}

if( $f_db_type == 'db2' ) {
$result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $result === false ) {
$t_result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $t_result === false ) {
echo $g_db->errorMsg();
}
}
Expand Down Expand Up @@ -1113,8 +1113,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
}

if( $f_db_type == 'db2' ) {
$result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $result === false ) {
$t_result = $g_db->execute( 'set schema ' . $f_db_schema );
if( $t_result === false ) {
echo $g_db->errorMsg();
}
}
Expand Down
4 changes: 2 additions & 2 deletions admin/test_email.php
Expand Up @@ -53,9 +53,9 @@
$t_email_data->body = 'Your PHP mail settings appear to be correctly set.';
$t_email_data->metadata['priority'] = config_get( 'mail_priority' );
$t_email_data->metadata['charset'] = 'utf-8';
$result = email_send( $t_email_data );
$t_result = email_send( $t_email_data );

if( !$result ) {
if( !$t_result ) {
echo ' PROBLEMS SENDING MAIL TO: ' . config_get_global( 'webmaster_email' ) . '. Please check your php/mail server settings.<br />';
} else {
echo ' mail() send successful.<br />';
Expand Down
8 changes: 4 additions & 4 deletions admin/test_langs.php
Expand Up @@ -156,10 +156,10 @@ function checkfile( $p_path, $p_file, $p_quiet = false ) {
$file = $p_path . $p_file;

set_error_handler( 'lang_error_handler' );
$result = checktoken( $file, ($p_file == STRINGS_ENGLISH ) );
$t_result = checktoken( $file, ($p_file == STRINGS_ENGLISH ) );
restore_error_handler();

if( !$result ) {
if( !$t_result ) {
print_error( "Language file '$p_file' failed at phase 1.", 'FAILED' );
if( $p_quiet ) {
return false;
Expand All @@ -175,12 +175,12 @@ function checkfile( $p_path, $p_file, $p_quiet = false ) {

set_error_handler( 'lang_error_handler' );
ob_start();
$result = eval( "require_once( '$file' );" );
$t_result = eval( "require_once( '$file' );" );
$data = ob_get_contents();
ob_end_clean();
restore_error_handler();

if( $result === false ) {
if( $t_result === false ) {
print_error( "Language file '$p_file' failed at eval", 'FAILED' );
if( $p_quiet ) {
return false;
Expand Down
6 changes: 3 additions & 3 deletions admin/upgrade_unattended.php
Expand Up @@ -51,7 +51,7 @@
/**
* Print the result of an upgrade step.
*
* @param integer $result GOOD or BAD.
* @param integer $p_result GOOD or BAD.
* @param bool $p_hard_fail If result is BAD, sets the global failure flag.
* @param string $p_message The message describing the upgrade step.
* @access private
Expand All @@ -76,11 +76,11 @@ function print_test_result( $p_result, $p_hard_fail = true, $p_message = '' ) {
echo "\n";
}

$result = @db_connect( config_get_global( 'dsn', false ), config_get_global( 'hostname' ),
$t_result = @db_connect( config_get_global( 'dsn', false ), config_get_global( 'hostname' ),
config_get_global( 'db_username' ), config_get_global( 'db_password' ),
config_get_global( 'database_name' ) );

if( false == $result ) {
if( false == $t_result ) {
echo "Opening connection to database " .
config_get_global( 'database_name' ) .
" on host " . config_get_global( 'hostname' ) .
Expand Down
6 changes: 3 additions & 3 deletions api/soap/mc_api.php
Expand Up @@ -411,11 +411,11 @@ function mci_filter_db_get_available_queries( $p_project_id = null, $p_user_id =
AND (is_public = " . db_prepare_bool(true) . "
OR user_id = " . db_param() . ")
ORDER BY is_public DESC, name ASC";
$result = db_query_bound( $query, array( $t_project_id, $t_user_id ) );
$query_count = db_num_rows( $result );
$t_result = db_query_bound( $query, array( $t_project_id, $t_user_id ) );
$query_count = db_num_rows( $t_result );

for( $i = 0;$i < $query_count;$i++ ) {
$row = db_fetch_array( $result );
$row = db_fetch_array( $t_result );

$t_filter_detail = explode( '#', $row['filter_string'], 2 );
if ( !isset($t_filter_detail[1]) ) {
Expand Down
8 changes: 4 additions & 4 deletions api/soap/mc_file_api.php
Expand Up @@ -141,7 +141,7 @@ function mci_file_add( $p_id, $p_name, $p_content, $p_file_type, $p_table, $p_ti

if( 'bug' == $p_table ) {
# bump the last_updated date
$result = bug_update_date( $t_issue_id );
bug_update_date( $t_issue_id );

# add history entry
history_log_event_special( $t_issue_id, FILE_ADDED, $p_name );
Expand Down Expand Up @@ -180,13 +180,13 @@ function mci_file_get( $p_file_id, $p_type, $p_user_id ) {
return SoapObjectsFactory::newSoapFault( 'Server', 'Invalid file type '.$p_type. ' .' );
}

$result = db_query( $query );
$t_result = db_query( $query );

if ( $result->EOF ) {
if ( $t_result->EOF ) {
return SoapObjectsFactory::newSoapFault( 'Client', 'Unable to find an attachment with type ' . $p_type. ' and id ' . $p_file_id . ' .' );
}

$row = db_fetch_array( $result );
$row = db_fetch_array( $t_result );

if ( $p_type == 'doc' ) {
$t_project_id = $row['project_id'];
Expand Down
6 changes: 3 additions & 3 deletions api/soap/mc_issue_api.php
Expand Up @@ -556,12 +556,12 @@ function mc_issue_get_id_from_summary( $p_username, $p_password, $p_summary ) {
FROM $t_bug_table
WHERE summary = " . db_param();

$result = db_query_bound( $query, array( $p_summary ), 1 );
$t_result = db_query_bound( $query, array( $p_summary ), 1 );

if( db_num_rows( $result ) == 0 ) {
if( db_num_rows( $t_result ) == 0 ) {
return 0;
} else {
while(( $row = db_fetch_array( $result ) ) !== false ) {
while(( $row = db_fetch_array( $t_result ) ) !== false ) {
$t_issue_id = (int) $row['id'];
$t_project_id = bug_get_field( $t_issue_id, 'project_id' );
$g_project_override = $t_project_id;
Expand Down
6 changes: 3 additions & 3 deletions api/soap/mc_project_api.php
Expand Up @@ -722,12 +722,12 @@ function mc_project_get_attachments( $p_username, $p_password, $p_project_id ) {
( ( pult.user_id = $t_user_id ) AND ( pult.access_level $t_access_clause ) ) OR
( ut.access_level = $t_admin ) )
ORDER BY pt.name ASC, pft.title ASC";
$result = db_query( $query );
$num_files = db_num_rows( $result );
$t_result = db_query( $query );
$num_files = db_num_rows( $t_result );

$t_result = array();
for( $i = 0;$i < $num_files;$i++ ) {
$row = db_fetch_array( $result );
$row = db_fetch_array( $t_result );

$t_attachment = array();
$t_attachment['id'] = $row['id'];
Expand Down
4 changes: 2 additions & 2 deletions bug_reminder.php
Expand Up @@ -91,14 +91,14 @@
}
}

$result = email_bug_reminder( $f_to, $f_bug_id, $f_body );
$t_result = email_bug_reminder( $f_to, $f_bug_id, $f_body );

# Add reminder as bugnote if store reminders option is ON.
if ( ON == config_get( 'store_reminders' ) ) {
# Build list of recipients, truncated to note_attr fields's length
$t_attr = '|';
$t_length = 0;
foreach( $result as $t_id ) {
foreach( $t_result as $t_id ) {
$t_recipient = $t_id . '|';
$t_length += strlen( $t_recipient );
if( $t_length > 250 ) {
Expand Down
6 changes: 3 additions & 3 deletions core/authentication_api.php
Expand Up @@ -777,11 +777,11 @@ function auth_is_cookie_valid( $p_cookie_string ) {
$query = "SELECT *
FROM $t_user_table
WHERE cookie_string=" . db_param();
$result = db_query_bound( $query, array( $p_cookie_string ) );
$t_result = db_query_bound( $query, array( $p_cookie_string ) );

# return true if a matching cookie was found
if( 1 == db_num_rows( $result ) ) {
user_cache_database_result( db_fetch_array( $result ) );
if( 1 == db_num_rows( $t_result ) ) {
user_cache_database_result( db_fetch_array( $t_result ) );
return true;
} else {
return false;
Expand Down

0 comments on commit 840c1c1

Please sign in to comment.