Skip to content

Commit

Permalink
(not complete) PEAR coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
CybotTM committed Jan 17, 2006
1 parent 9518c45 commit 0ae8842
Show file tree
Hide file tree
Showing 97 changed files with 4,482 additions and 3,985 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $Source$
- clarified some variable names
* db_sarch.php:
fixed bug: Undefined variable: num_tables
* [really much files]: (not complete) PEAR coding standard

2006-01-16 Marc Delisle <lem9@users.sourceforge.net>
* server_privileges.php: typo
Expand Down
9 changes: 4 additions & 5 deletions db_datadict.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* Selects the database and gets tables names
*/
PMA_DBI_select_db($db);
$rowset = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
$rowset = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);

$count = 0;
while ($row = PMA_DBI_fetch_assoc($rowset)) {
Expand Down Expand Up @@ -128,7 +128,7 @@
/**
* Gets fields properties
*/
$result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
$result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
$fields_cnt = PMA_DBI_num_rows($result);
// Check if we can use Relations (Mike Beck)
if (!empty($cfgRelation['relation'])) {
Expand All @@ -141,8 +141,7 @@
} else {
$have_rel = FALSE;
}
}
else {
} else {
$have_rel = FALSE;
} // end if

Expand Down Expand Up @@ -237,7 +236,7 @@
<td<?php echo $type_nowrap; ?> xml:lang="en" dir="ltr"><?php echo $type; ?></td>
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $strAttribute; ?></td>*/ ?>
<td><?php echo (($row['Null'] == '' || $row['Null'] == 'NO') ? $strNo : $strYes); ?></td>
<td nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?></td>
<td nowrap="nowrap"><?php if (isset($row['Default'])) { echo $row['Default']; } ?></td>
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $row['Extra']; ?></td>*/ ?>
<?php
if ($have_rel) {
Expand Down
19 changes: 7 additions & 12 deletions db_details_importdocsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
if (isset($lines) && is_array($lines) && count($lines) > 0) {
foreach ($lines AS $lkey => $line) {
//echo '<p>' . $line . '</p>';
$inf = explode('|',$line);
$inf = explode('|', $line);
if (!empty($inf[1]) && strlen(trim($inf[1])) > 0) {
$qry = '
INSERT INTO
Expand Down Expand Up @@ -125,14 +125,11 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
if (empty($DOCUMENT_ROOT)) {
if (!empty($_SERVER) && isset($_SERVER['DOCUMENT_ROOT'])) {
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
}
else if (!empty($_ENV) && isset($_ENV['DOCUMENT_ROOT'])) {
} elseif (!empty($_ENV) && isset($_ENV['DOCUMENT_ROOT'])) {
$DOCUMENT_ROOT = $_ENV['DOCUMENT_ROOT'];
}
else if (@getenv('DOCUMENT_ROOT')) {
} elseif (@getenv('DOCUMENT_ROOT')) {
$DOCUMENT_ROOT = getenv('DOCUMENT_ROOT');
}
else {
} else {
$DOCUMENT_ROOT = '.';
}
} // end if
Expand Down Expand Up @@ -173,15 +170,13 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
echo $strFileCouldNotBeRead;
exit();
}
}
else {
} else {
$sql_file_new = $tmp_subdir . basename($sql_file);
move_uploaded_file($sql_file, $sql_file_new);
$docsql_text = PMA_readFile($sql_file_new, $sql_file_compression);
unlink($sql_file_new);
}
}
else {
} else {
// read from the normal upload dir
$docsql_text = PMA_readFile($sql_file, $sql_file_compression);
}
Expand Down Expand Up @@ -228,7 +223,7 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
*/
?>

<form method="post" action="db_details_importdocsql.php" <?php if ($is_upload) echo ' enctype="multipart/form-data"'; ?>>
<form method="post" action="db_details_importdocsql.php" <?php if ($is_upload) { echo ' enctype="multipart/form-data"'; } ?>>
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<input type="hidden" name="submit_show" value="true" />
<input type="hidden" name="do" value="import" />
Expand Down
8 changes: 4 additions & 4 deletions db_details_structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function PMA_TableHeader( $db_is_information_schema = false ) {
$hidden_fields = array();
$odd_row = true;
foreach ( $tables as $keyname => $each_table ) {
if ( $each_table['TABLE_ROWS'] === NULL || $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
if ( $each_table['TABLE_ROWS'] === null || $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
$each_table['TABLE_ROWS'] = PMA_countRecords( $db,
$each_table['TABLE_NAME'], $return = true, $force_exact = true );
}
Expand Down Expand Up @@ -452,21 +452,21 @@ function PMA_TableHeader( $db_is_information_schema = false ) {
/* Printable view of a table */
echo '<p>';
echo '<a href="db_printview.php?' . $url_query . '">';
if ( $cfg['PropertiesIconic'] ) {
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage
.'b_print.png" width="16" height="16" alt="" />';
}
echo $strPrintView . '</a> ';

echo '<a href="./db_datadict.php?' . $url_query . '">';
if($cfg['PropertiesIconic']){
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage
.'b_tblanalyse.png" width="16" height="16" alt="" />';
}
echo $strDataDict . '</a>';
echo '</p>';

if ( empty( $db_is_information_schema ) ) {
if (empty($db_is_information_schema)) {
require('./libraries/display_create_table.lib.php');
} // end if (Create Table dialog)

Expand Down
4 changes: 2 additions & 2 deletions db_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

// Duplicate the bookmarks for this db (done once for each db)
if ($db != $newname) {
$get_fields = array('user','label','query');
$get_fields = array('user', 'label', 'query');
$where_fields = array('dbase' => $db);
$new_fields = array('dbase' => $newname);
PMA_duplicate_table_info('bookmarkwork', 'bookmark', $get_fields,
Expand Down Expand Up @@ -332,7 +332,7 @@
SELECT *
FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']) . '
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
$test_rs = PMA_query_as_cu($test_query, NULL, PMA_DBI_QUERY_STORE);
$test_rs = PMA_query_as_cu($test_query, null, PMA_DBI_QUERY_STORE);

if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
<!-- PDF schema -->
Expand Down
11 changes: 5 additions & 6 deletions db_printview.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
unset($result);

if (isset($sot_cache)) {
$result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
$result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
while ($tmp = PMA_DBI_fetch_row($result)) {
if (!isset($sot_cache[$tmp[0]])) {
Expand Down Expand Up @@ -134,7 +134,7 @@
if (isset($sts_data['Type'])) {
if ($sts_data['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
} else if (!preg_match('@ISAM|HEAP@i', $sts_data['Type'])) {
} elseif (!preg_match('@ISAM|HEAP@i', $sts_data['Type'])) {
$nonisam = TRUE;
}
}
Expand All @@ -149,18 +149,17 @@
} else {
list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, 0);
}
} else if ($cfg['ShowStats']) {
} elseif ($cfg['ShowStats']) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
$sum_entries += $sts_data['Rows'];
}
// MyISAM MERGE Table
else if ($cfg['ShowStats'] && $mergetable == TRUE) {
elseif ($cfg['ShowStats'] && $mergetable == TRUE) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
else if ($cfg['ShowStats']) {
} elseif ($cfg['ShowStats']) {
$formated_size = 'unknown';
$unit = '';
}
Expand Down
5 changes: 3 additions & 2 deletions error.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@
<body>
<h1>phpMyAdmin - <?php echo $type; ?></h1>
<p><?php
if (get_magic_quotes_gpc())
if (get_magic_quotes_gpc()) {
echo PMA_sanitize(stripslashes($_REQUEST['error']));
else
} else {
echo PMA_sanitize($_REQUEST['error']);
}
?></p>
</body>
</html>
Loading

0 comments on commit 0ae8842

Please sign in to comment.