From 0ae88423531ccc5bb7cd0f4e5940e8af36c1be73 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Tue, 17 Jan 2006 17:03:02 +0000 Subject: [PATCH] (not complete) PEAR coding standard --- ChangeLog | 1 + db_datadict.php | 9 +- db_details_importdocsql.php | 19 +- db_details_structure.php | 8 +- db_operations.php | 4 +- db_printview.php | 11 +- error.php | 5 +- export.php | 104 +- import.php | 21 +- index.php | 10 +- left.php | 2 +- libraries/Config.class.php | 2 +- libraries/Theme_Manager.class.php | 134 +- libraries/auth/cookie.auth.lib.php | 33 +- libraries/auth/http.auth.lib.php | 14 +- libraries/blowfish.php | 6 +- libraries/bookmark.lib.php | 10 +- libraries/charset_conversion.lib.php | 26 +- libraries/check_user_privileges.lib.php | 28 +- libraries/common.lib.php | 59 +- libraries/database_interface.lib.php | 6 +- libraries/db_details_db_info.inc.php | 4 +- libraries/db_details_links.inc.php | 2 +- libraries/db_table_exists.lib.php | 10 +- libraries/dbg/profiling.php | 4 +- libraries/dbi/mysql.dbi.lib.php | 82 +- libraries/dbi/mysqli.dbi.lib.php | 104 +- libraries/display_create_database.lib.php | 2 +- libraries/display_create_table.lib.php | 2 +- libraries/display_export.lib.php | 2 +- libraries/display_import.lib.php | 18 +- libraries/display_tbl.lib.php | 74 +- libraries/display_tbl_links.lib.php | 2 +- libraries/export/csv.php | 16 +- libraries/export/htmlexcel.php | 12 +- libraries/export/htmlword.php | 50 +- libraries/export/latex.php | 51 +- libraries/export/pdf.php | 6 +- libraries/export/sql.php | 73 +- libraries/export/xls.php | 33 +- libraries/export/xml.php | 10 +- libraries/file_listing.php | 27 +- libraries/footer.inc.php | 8 +- libraries/fpdf/fpdf.php | 3512 +++++++++++---------- libraries/fpdf/ufpdf.php | 1003 +++--- libraries/get_foreign.lib.php | 3 +- libraries/header.inc.php | 10 +- libraries/header_meta_style.inc.php | 5 +- libraries/import.lib.php | 45 +- libraries/import/csv.php | 34 +- libraries/import/sql.php | 52 +- libraries/ip_allow_deny.lib.php | 62 +- libraries/mult_submits.inc.php | 4 +- libraries/mysql_charsets.lib.php | 2 +- libraries/plugin_interface.lib.php | 6 +- libraries/read_dump.lib.php | 24 +- libraries/relation.lib.php | 36 +- libraries/select_lang.lib.php | 99 +- libraries/select_server.lib.php | 2 +- libraries/server_common.inc.php | 2 +- libraries/session.inc.php | 57 +- libraries/sql_query_form.lib.php | 159 +- libraries/sqlparser.lib.php | 274 +- libraries/sqlvalidator.class.php | 14 +- libraries/string.lib.php | 2 +- libraries/tbl_indexes.lib.php | 4 +- libraries/tbl_move_copy.php | 2 +- libraries/tbl_properties.inc.php | 18 +- libraries/tbl_properties_common.php | 2 +- libraries/tbl_properties_links.inc.php | 2 +- libraries/tbl_replace_fields.inc.php | 9 +- libraries/transformations.lib.php | 6 +- libraries/unzip.lib.php | 77 +- libraries/url_generating.lib.php | 22 +- main.php | 23 +- pdf_pages.php | 4 +- pdf_schema.php | 1385 ++++---- scripts/decode_bug.php | 3 +- scripts/setup.php | 59 +- scripts/upgrade.pl | 4 +- server_binlog.php | 10 +- server_databases.php | 8 +- server_privileges.php | 46 +- server_status.php | 4 +- sql.php | 49 +- tbl_addfield.php | 2 +- tbl_change.php | 54 +- tbl_create.php | 2 +- tbl_indexes.php | 14 +- tbl_move_copy.php | 4 +- tbl_printview.php | 13 +- tbl_properties_operations.php | 2 +- tbl_properties_structure.php | 18 +- tbl_relation.php | 12 +- tbl_replace.php | 16 +- tbl_select.php | 2 +- transformation_wrapper.php | 10 +- 97 files changed, 4447 insertions(+), 3950 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8774a3415..0a6e9d1cc 100755 --- a/ChangeLog +++ b/ChangeLog @@ -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 * server_privileges.php: typo diff --git a/db_datadict.php b/db_datadict.php index 0f0746c35..b16cd6c80 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -52,7 +52,7 @@ if ($cfgRelation['commwork']) { * 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)) { @@ -128,7 +128,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) { /** * 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'])) { @@ -141,8 +141,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) { } else { $have_rel = FALSE; } - } - else { + } else { $have_rel = FALSE; } // end if @@ -237,7 +236,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) { xml:lang="en" dir="ltr"> >*/ ?> - + >*/ ?> 0) { foreach ($lines AS $lkey => $line) { //echo '

' . $line . '

'; - $inf = explode('|',$line); + $inf = explode('|', $line); if (!empty($inf[1]) && strlen(trim($inf[1])) > 0) { $qry = ' INSERT INTO @@ -125,14 +125,11 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) { 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 @@ -173,15 +170,13 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) { 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); } @@ -228,7 +223,7 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) { */ ?> -
> + > diff --git a/db_details_structure.php b/db_details_structure.php index 061f09b30..fe7a71727 100644 --- a/db_details_structure.php +++ b/db_details_structure.php @@ -152,7 +152,7 @@ $row_count = 0; $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 ); } @@ -452,21 +452,21 @@ echo '