Use lower case for true, false and null

This commit is contained in:
Madhura Jayaratne 2011-09-23 11:11:41 +05:30
parent 9bcb83af03
commit 13adb5adf7
20 changed files with 40 additions and 40 deletions

View File

@ -12,7 +12,7 @@
/*
* @var string contains media type of BLOB reference
*/
$mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL;
$mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : null;
/*
* @var string indicates whether media type is of custom type
@ -22,7 +22,7 @@
/*
* @var string contains BLOB reference
*/
$bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : NULL;
$bsReference = isset($_REQUEST['bs_reference']) ? $_REQUEST['bs_reference'] : null;
// if media type and BS reference are specified
if (isset($mediaType) && isset($bsReference)) {

View File

@ -69,16 +69,16 @@ if (! $result) {
/**
* String containing the SQL Query formatted in pretty HTML
* @global array $GLOBALS['extra_data']
* @name $extra_data
* @name $extra_data
*/
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query, 'success');
$extra_data['sql_query'] = PMA_showMessage(null, $sql_query, 'success');
//Construct the html for the new database, so that it can be appended to the list of databases on server_databases.php
/**
* Build the array to be passed to {@link PMA_generate_common_url} to generate the links
* @global array $GLOBALS['db_url_params']
* @name $db_url_params
* @name $db_url_params
*/
$db_url_params['db'] = $new_db;

View File

@ -304,7 +304,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
*/
if ( $GLOBALS['is_ajax_request'] == true) {
$extra_data['newname'] = $newname;
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
$extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
};
}
@ -442,7 +442,7 @@ echo __('Remove database');
'reload' => '1',
'purge' => '1',
'message_to_show' => sprintf(__('Database %s has been dropped.'), htmlspecialchars(PMA_backquote($db))),
'db' => NULL,
'db' => null,
);
?>
<li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="drop_db_anchor"' : ''); ?>>

View File

@ -395,7 +395,7 @@ if (!$error) {
}
}
if (! $error && false !== $import_handle && NULL !== $import_handle) {
if (! $error && false !== $import_handle && null !== $import_handle) {
fclose($import_handle);
}

View File

@ -99,17 +99,17 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu
}
if (!$server) {
$link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, $password, empty($client_flags) ? NULL : $client_flags);
$link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, $password, empty($client_flags) ? null : $client_flags);
// Retry with empty password if we're allowed to
if (empty($link) && $cfg['Server']['nopassword'] && !$is_controluser) {
$link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, '', empty($client_flags) ? NULL : $client_flags);
$link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, '', empty($client_flags) ? null : $client_flags);
}
} else {
if (!isset($server['host'])) {
$link = PMA_DBI_real_connect($server_socket, $user, $password, NULL);
$link = PMA_DBI_real_connect($server_socket, $user, $password, null);
} else {
$link = PMA_DBI_real_connect($server['host'] . $server_port . $server_socket, $user, $password, NULL);
$link = PMA_DBI_real_connect($server['host'] . $server_port . $server_socket, $user, $password, null);
}
}
if (empty($link)) {

View File

@ -209,7 +209,7 @@ if (isset($plugin_list)) {
$buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . $crlf;
if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{' . PMA_expandUserString($GLOBALS['latex_data_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\label{' . PMA_expandUserString($GLOBALS['latex_data_label'], NULL, array('table' => $table, 'database' => $db)) . '} \\\\';
. '} \\label{' . PMA_expandUserString($GLOBALS['latex_data_label'], null, array('table' => $table, 'database' => $db)) . '} \\\\';
}
if (!PMA_exportOutputHandler($buffer)) {
return false;
@ -372,7 +372,7 @@ if (isset($plugin_list)) {
// Table caption for first page and label
if (isset($GLOBALS['latex_caption'])) {
$buffer .= ' \\caption{'. PMA_expandUserString($GLOBALS['latex_structure_caption'], 'PMA_texEscape', array('table' => $table, 'database' => $db))
. '} \\label{' . PMA_expandUserString($GLOBALS['latex_structure_label'], NULL, array('table' => $table, 'database' => $db))
. '} \\label{' . PMA_expandUserString($GLOBALS['latex_structure_label'], null, array('table' => $table, 'database' => $db))
. '} \\\\' . $crlf;
}
$buffer .= $header . ' \\\\ \\hline \\hline' . $crlf . '\\endfirsthead' . $crlf;

View File

@ -75,7 +75,7 @@ function get_tab_info()
PMA_DBI_select_db($GLOBALS['db']);
$tab_column = array();
for ($i = 0, $cnt = count($GLOBALS['PMD']["TABLE_NAME"]); $i < $cnt; $i++) {
$fields_rs = PMA_DBI_query(PMA_DBI_get_columns_sql($GLOBALS['db'], $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i], null, true), NULL, PMA_DBI_QUERY_STORE);
$fields_rs = PMA_DBI_query(PMA_DBI_get_columns_sql($GLOBALS['db'], $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i], null, true), null, PMA_DBI_QUERY_STORE);
$j = 0;
while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
$tab_column[$GLOBALS['PMD']['TABLE_NAME'][$i]]['COLUMN_ID'][$j] = $j;
@ -98,7 +98,7 @@ function get_script_contr()
PMA_DBI_select_db($GLOBALS['db']);
$con["C_NAME"] = array();
$i = 0;
$alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($GLOBALS['db']), NULL, PMA_DBI_QUERY_STORE);
$alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($GLOBALS['db']), null, PMA_DBI_QUERY_STORE);
while ($val = @PMA_DBI_fetch_row($alltab_rs)) {
$row = PMA_getForeigners($GLOBALS['db'], $val[0], '', 'internal');
//echo "<br> internal ".$GLOBALS['db']." - ".$val[0]." - ";

View File

@ -1486,7 +1486,7 @@ function printVariablesTable()
}
if ('%' === substr($name, -1, 1)) {
echo htmlspecialchars(PMA_formatNumber($value, 0, 2)) . ' %';
} elseif (strpos($name, 'Uptime')!==FALSE) {
} elseif (strpos($name, 'Uptime') !== false) {
echo htmlspecialchars(PMA_timespanFormat($value));
} elseif (is_numeric($value) && $value == (int) $value && $value > 1000) {
echo htmlspecialchars(PMA_formatNumber($value, 3, 1));

10
sql.php
View File

@ -104,7 +104,7 @@ if (isset($_REQUEST['get_relational_values']) && $_REQUEST['get_relational_value
}
$extra_data['dropdown'] = $dropdown;
PMA_ajaxResponse(NULL, true, $extra_data);
PMA_ajaxResponse(null, true, $extra_data);
}
/**
@ -133,7 +133,7 @@ if (isset($_REQUEST['get_enum_values']) && $_REQUEST['get_enum_values'] == true)
$dropdown = '<select>' . $dropdown . '</select>';
$extra_data['dropdown'] = $dropdown;
PMA_ajaxResponse(NULL, true, $extra_data);
PMA_ajaxResponse(null, true, $extra_data);
}
/**
@ -162,7 +162,7 @@ if (isset($_REQUEST['get_set_values']) && $_REQUEST['get_set_values'] == true) {
$select = '<select multiple="multiple" size="' . $select_size . '">' . $select . '</select>';
$extra_data['select'] = $select;
PMA_ajaxResponse(NULL, true, $extra_data);
PMA_ajaxResponse(null, true, $extra_data);
}
/**
@ -191,7 +191,7 @@ if (isset($_REQUEST['set_col_prefs']) && $_REQUEST['set_col_prefs'] == true) {
}
}
PMA_ajaxResponse(NULL, ($retval == true));
PMA_ajaxResponse(null, ($retval == true));
}
// Default to browse if no query set and we have table
@ -766,7 +766,7 @@ else {
$row = PMA_DBI_fetch_row($result);
$extra_data = array();
$extra_data['value'] = $row[0];
PMA_ajaxResponse(NULL, true, $extra_data);
PMA_ajaxResponse(null, true, $extra_data);
}
if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['table_maintenance'])) {

View File

@ -186,7 +186,7 @@ if (isset($_REQUEST['do_save_data'])) {
$message->addParam($table);
if( $GLOBALS['is_ajax_request'] == true) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
$extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
}

View File

@ -131,7 +131,7 @@ if (isset($_REQUEST['do_save_data'])) {
}
if ( $_REQUEST['ajax_request'] == true) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
$extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
}

View File

@ -100,7 +100,7 @@ if (isset($_REQUEST['do_save_data'])) {
if ( $GLOBALS['is_ajax_request'] == true) {
$extra_data['index_table'] = PMA_Index::getView($table, $db);
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
$extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
}

View File

@ -65,13 +65,13 @@ if (PMA_isValid($_REQUEST['new_name'])) {
$db = $_REQUEST['target_db'];
$table = $_REQUEST['new_name'];
}
if ( $_REQUEST['ajax_request'] == true) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
$extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
$extra_data['db'] = $GLOBALS['db'];
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
}
$reload = 1;
}
} else {

View File

@ -230,7 +230,7 @@ if (isset($result) && empty($message_to_show)) {
// $result should exist, regardless of $_message
$_type = $result ? 'success' : 'error';
if ( $_REQUEST['ajax_request'] == true) {
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
$extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
PMA_ajaxResponse($_message, $_message->isSuccess(), $extra_data);
}
}

View File

@ -231,8 +231,8 @@ foreach ($loop_array as $rownumber => $where_clause) {
// for blobstreaming
if ($blob_streaming_active) {
$remove_blob_repo = isset($_REQUEST['remove_blob_repo_' . $key]) ? $_REQUEST['remove_blob_repo_' . $key] : NULL;
$upload_blob_repo = isset($_REQUEST['upload_blob_repo_' . $key]) ? $_REQUEST['upload_blob_repo_' . $key] : NULL;
$remove_blob_repo = isset($_REQUEST['remove_blob_repo_' . $key]) ? $_REQUEST['remove_blob_repo_' . $key] : null;
$upload_blob_repo = isset($_REQUEST['upload_blob_repo_' . $key]) ? $_REQUEST['upload_blob_repo_' . $key] : null;
// checks if an existing blob repository reference should be removed
if (isset($remove_blob_repo) && ! isset($upload_blob_repo)) {

View File

@ -19,7 +19,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
/**
* Turn off backup globals
*/
protected $backupGlobals = FALSE;
protected $backupGlobals = false;
/**
* @var PMA_Config

View File

@ -94,7 +94,7 @@ class PMA_array_test extends PHPUnit_Framework_TestCase
PMA_array_write('sarr/not_existing/1', $arr, 'some_val');
$this->assertEquals($arr['sarr']['not_existing'][1], 'some_val');
PMA_array_write('sarr/0/2', $arr, NULL);
PMA_array_write('sarr/0/2', $arr, null);
$this->assertNull($arr['sarr'][0][2]);
}

View File

@ -104,9 +104,9 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
if (defined('PMA_IS_IIS')) {
$this->oldIISvalue = PMA_IS_IIS;
runkit_constant_redefine('PMA_IS_IIS', NULL);
runkit_constant_redefine('PMA_IS_IIS', null);
} else {
runkit_constant_add('PMA_IS_IIS', NULL);
runkit_constant_add('PMA_IS_IIS', null);
}
@ -114,9 +114,9 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
if (defined('SID')) {
$this->oldSIDvalue = SID;
runkit_constant_redefine('SID', NULL);
runkit_constant_redefine('SID', null);
} else {
runkit_constant_add('SID', NULL);
runkit_constant_add('SID', null);
}
}

View File

@ -10,9 +10,9 @@
require_once 'PmaSeleniumTestCase.php';
class PmaSeleniumLoginTest extends PmaSeleniumTestCase
class PmaSeleniumLoginTest extends PmaSeleniumTestCase
{
protected $captureScreenshotOnFailure = TRUE;
protected $captureScreenshotOnFailure = true;
protected $screenshotPath = '/var/www/screenshots';
protected $screenshotUrl = 'http://localhost/screenshots';

View File

@ -21,7 +21,7 @@ class PmaSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
protected $selenium;
protected $cfg;
protected $captureScreenshotOnFailure = TRUE;
protected $captureScreenshotOnFailure = true;
protected $screenshotPath = '/var/www/screenshots';
protected $screenshotUrl = 'http://localhost/screenshots';