diff --git a/libraries/Config.class.php b/libraries/Config.class.php index db4e75ab9..07554d81b 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -527,16 +527,6 @@ class PMA_Config return $this->source; } - /** - * old PHP 4 style constructor - * - * @deprecated - */ - function PMA_Config($source = null) - { - $this->__construct($source); - } - /** * returns time of last config change. * @return int Unix timestamp @@ -788,7 +778,7 @@ class PMA_Config /** * @static */ - function isHttps() + static public function isHttps() { $is_https = false; @@ -837,7 +827,7 @@ class PMA_Config /** * @static */ - function getCookiePath() + static public function getCookiePath() { static $cookie_path = null; @@ -922,7 +912,7 @@ class PMA_Config * @param string $current_size current selected font size with unit * @return array selectable font sizes */ - function getFontsizeOptions($current_size = '82%') + static protected function _getFontsizeOptions($current_size = '82%') { $unit = preg_replace('/[0-9.]*/', '', $current_size); $value = preg_replace('/[^0-9.]*/', '', $current_size); @@ -980,16 +970,16 @@ class PMA_Config * * @uses $_SESSION['PMA_Config'] * @uses PMA_Config::get() - * @uses PMA_Config::getFontsizeOptions() + * @uses PMA_Config::_getFontsizeOptions() * @uses $GLOBALS['strFontSize'] * @static * @param string $current_size currently slected font size with unit * @return string html selectbox */ - function getFontsizeSelection() + static protected function _getFontsizeSelection() { $current_size = $_SESSION['PMA_Config']->get('fontsize'); - $options = PMA_Config::getFontsizeOptions($current_size); + $options = PMA_Config::_getFontsizeOptions($current_size); $return = '' . $GLOBALS['strFontSize'] . ':' . "\n"; $return .= '' . "\n"; @@ -1009,18 +999,18 @@ class PMA_Config * return complete font size selection form * * @uses PMA_generate_common_hidden_inputs() - * @uses PMA_Config::getFontsizeSelection() + * @uses PMA_Config::_getFontsizeSelection() * @uses $GLOBALS['strGo'] * @static * @param string $current_size currently slected font size with unit * @return string html selectbox */ - function getFontsizeForm() + static public function getFontsizeForm() { return '' . "\n" . PMA_generate_common_hidden_inputs() . "\n" - . PMA_Config::getFontsizeSelection() . "\n" + . PMA_Config::_getFontsizeSelection() . "\n" . '' . "\n" . '' . "\n" . '' . "\n" diff --git a/libraries/File.class.php b/libraries/File.class.php index a1dbd3fe2..56a81b1f2 100644 --- a/libraries/File.class.php +++ b/libraries/File.class.php @@ -69,18 +69,6 @@ class PMA_File */ var $_charset = null; - /** - * old PHP 4 style constructor - * - * @see PMA_File::__construct() - * @uses PMA_File::__construct() - * @access public - */ - function PMA_File($name = false) - { - $this->__construct($name); - } - /** * constructor * @@ -875,4 +863,4 @@ class PMA_File } } -?> \ No newline at end of file +?> diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 79d61d66c..d4eb091ff 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -68,15 +68,6 @@ require_once './libraries/List.class.php'; $this->build(); } - /** - * old PHP 4 style constructor - * - * @see PMA_List_Database::__construct() - */ - function PMA_List_Database($db_link_user = null, $db_link_control = null) { - $this->__construct($db_link_user, $db_link_control); - } - /** * removes all databases not accessible by current user from list * @@ -354,13 +345,13 @@ require_once './libraries/List.class.php'; } /** - * returns a part of the items + * returns a part of the items * * @uses PMA_List_Database::$items * @uses array_slice() * @param integer $offset * @param integer $count - * @return array some items + * @return array some items */ function getLimitedItems($offset, $count) { diff --git a/libraries/Sql.class.php b/libraries/Sql.class.php index 5b037c184..cf6a14870 100644 --- a/libraries/Sql.class.php +++ b/libraries/Sql.class.php @@ -78,17 +78,6 @@ class PMA_Sql */ var $_tokens = array(); - /** - * old PHP 4 style constructor - * @deprecated - * @access public - * @see PMA_sql::__construct() - */ - function PMA_sql($sql) - { - $this->__construct($sql); - } - /** * Constructor * diff --git a/libraries/StorageEngine.class.php b/libraries/StorageEngine.class.php index ce80ae9e9..af73d102b 100644 --- a/libraries/StorageEngine.class.php +++ b/libraries/StorageEngine.class.php @@ -51,11 +51,11 @@ class PMA_StorageEngine * @staticvar array $storage_engines storage engines * @access public * @uses PMA_MYSQL_INT_VERSION - * @uses PMA_StorageEngine::getStorageEnginesBefore40102() + * @uses PMA_StorageEngine::_getStorageEnginesBefore40102() * @uses PMA_DBI_fetch_result() * @return array of storage engines */ - function getStorageEngines() + static public function getStorageEngines() { static $storage_engines = null; @@ -67,7 +67,7 @@ class PMA_StorageEngine // SHOW STORAGE ENGINES comes with MySQL 4.1.2 if (PMA_MYSQL_INT_VERSION < 40102) { - $storage_engines = PMA_StorageEngine::getStorageEnginesBefore40102(); + $storage_engines = PMA_StorageEngine::_getStorageEnginesBefore40102(); } else { $storage_engines = PMA_DBI_fetch_result('SHOW STORAGE ENGINES', 'Engine'); } @@ -90,7 +90,7 @@ class PMA_StorageEngine * Should unavailable storage engines be offered? * @return string html selectbox */ - function getHtmlSelect($name = 'engine', $id = null, + static public function getHtmlSelect($name = 'engine', $id = null, $selected = null, $offerUnavailableEngines = false) { $selected = strtolower($selected); @@ -126,7 +126,7 @@ class PMA_StorageEngine * @uses substr() * @return array of storage engines */ - function getStorageEnginesBefore40102() + static protected function _getStorageEnginesBefore40102() { $storage_engines = array( 'myisam' => array( @@ -181,7 +181,7 @@ class PMA_StorageEngine * @param string $engine The engine ID * @return object The engine plugin */ - function getEngine($engine) + static public function getEngine($engine) { $engine = str_replace('/', '', str_replace('.', '', $engine)); $engine_lowercase_filename = strtolower($engine); @@ -203,7 +203,7 @@ class PMA_StorageEngine * @param string $engine name of engine * @reutrn boolean whether $engine is valid or not */ - function isValid($engine) + static public function isValid($engine) { $storage_engines = PMA_StorageEngine::getStorageEngines(); return isset($storage_engines[$engine]); @@ -360,18 +360,6 @@ class PMA_StorageEngine } } - /** - * old PHP 4 style constructor - * @deprecated - * @see PMA_StorageEngine::__construct() - * @uses PMA_StorageEngine::__construct() - * @param string $engine engine name - */ - function PMA_StorageEngine($engine) - { - $this->__construct($engine); - } - /** * public String getTitle() * diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 96d5fd86b..9591d9e1e 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -137,7 +137,7 @@ class PMA_Table { return $this->getDbName($quoted) . '.' . $this->getName($quoted); } - function isView($db = null, $table = null) + static public function isView($db = null, $table = null) { if (strlen($db) && strlen($table)) { return PMA_Table::_isView($db, $table); @@ -208,16 +208,6 @@ class PMA_Table { } } - /** - * old PHP 4style constructor - * - * @see PMA_Table::__construct() - */ - function PMA_Table($table_name, $db_name) - { - $this->__construct($table_name, $db_name); - } - /** * Checks if this "table" is a view * @@ -230,7 +220,8 @@ class PMA_Table { * * @access public */ - function _isView($db, $table) { + static protected function _isView($db, $table) + { // maybe we already know if the table is a view if (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view']) { return true; @@ -374,7 +365,7 @@ class PMA_Table { * * @access public */ - function countRecords($db, $table, $ret = false, $force_exact = false) + static public function countRecords($db, $table, $ret = false, $force_exact = false) { $row_count = false; diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php index a0a93eb9b..4671814ec 100644 --- a/libraries/Theme.class.php +++ b/libraries/Theme.class.php @@ -110,7 +110,7 @@ class PMA_Theme { * @param string $folder path to theme * @return object PMA_Theme */ - function load($folder) + static public function load($folder) { $theme = new PMA_Theme(); @@ -382,4 +382,4 @@ class PMA_Theme { .''; } } -?> \ No newline at end of file +?> diff --git a/libraries/Theme_Manager.class.php b/libraries/Theme_Manager.class.php index 064ed2e9a..1de54919d 100644 --- a/libraries/Theme_Manager.class.php +++ b/libraries/Theme_Manager.class.php @@ -212,14 +212,6 @@ class PMA_Theme_Manager return true; } - /** - * old PHP 4 constructor - */ - function PMA_Theme_Manager() - { - $this->__construct(); - } - /** * @private * @param string $folder diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 9c7a7eb7b..d8ae36243 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -34,20 +34,6 @@ * @version $Id$ */ -/** - * For now, avoid warnings of E_STRICT mode - * (this must be done before function definitions) - */ -if (defined('E_STRICT')) { - $old_error_reporting = error_reporting(0); - if ($old_error_reporting & E_STRICT) { - error_reporting($old_error_reporting ^ E_STRICT); - } else { - error_reporting($old_error_reporting); - } - unset($old_error_reporting); -} - // at this point PMA_PHP_INT_VERSION is not yet defined if (version_compare(phpversion(), '6', 'lt')) { /** @@ -238,6 +224,15 @@ if (empty($__redirect) && !defined('PMA_NO_VARIABLES_IMPORT')) { require './libraries/grab_globals.lib.php'; } +/** + * check timezone setting + * this could produce an E_STRICT - but only once, + * if not done here it will produce E_STRICT on every date/time function + * + * @todo need to decide how we should handle this (without @) + */ +date_default_timezone_set(@date_default_timezone_get()); + /** * include session handling after the globals, to prevent overwriting */ diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index a21d49606..4689ebe1f 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -325,16 +325,13 @@ function PMA_DBI_fetch_row($result) * * @uses mysqli_result * @uses func_get_args() - * @uses is_object() - * @uses is_a() * @uses mysqli_free_result() * @param result $result,... one or more mysql result resources */ function PMA_DBI_free_result() { foreach (func_get_args() as $result) { - if (is_object($result) - && is_a($result, 'mysqli_result')) { + if ($result instanceof mysqli_result) { mysqli_free_result($result); } } diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 237c07aa7..d2828d598 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -54,7 +54,7 @@ if (isset($plugin_list)) { $plugin_list['sql']['options'][] = array('type' => 'bgroup', 'name' => 'structure', 'text' => 'strStructure', 'force' => 'data'); if ($plugin_param['export_type'] == 'table') { - if (PMA_Table::_isView($GLOBALS['db'], $GLOBALS['table'])) { + if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) { $drop_clause = 'DROP VIEW'; } else { $drop_clause = 'DROP TABLE'; @@ -133,7 +133,7 @@ if (! isset($sql_backquotes)) { * * @param string Text of comment * - * @return string The formatted comment + * @return string The formatted comment */ function PMA_exportComment($text = '') { @@ -195,7 +195,7 @@ function PMA_exportHeader() $head = PMA_exportComment('phpMyAdmin SQL Dump') . PMA_exportComment('version ' . PMA_VERSION) . PMA_exportComment('http://www.phpmyadmin.net') - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strHost'] . ': ' . $cfg['Server']['host']); if (!empty($cfg['Server']['port'])) { $head .= ':' . $cfg['Server']['port']; @@ -212,7 +212,7 @@ function PMA_exportHeader() $head .= PMA_exportComment(); foreach($lines as $one_line) { $head .= PMA_exportComment($one_line); - } + } $head .= PMA_exportComment(); } @@ -291,7 +291,7 @@ function PMA_exportDBCreate($db) */ function PMA_exportDBHeader($db) { - $head = PMA_exportComment() + $head = PMA_exportComment() . PMA_exportComment($GLOBALS['strDatabase'] . ': ' . (isset($GLOBALS['sql_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\'')) . PMA_exportComment(); return PMA_exportOutputHandler($head); @@ -323,9 +323,9 @@ function PMA_exportDBFooter($db) if ($procedure_names) { $delimiter = '$$'; $procs_funcs = $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strProcedures']) - . PMA_exportComment() + . PMA_exportComment() . 'DELIMITER ' . $delimiter . $crlf . PMA_exportComment(); @@ -333,7 +333,7 @@ function PMA_exportDBFooter($db) $procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf; } - $procs_funcs .= PMA_exportComment() + $procs_funcs .= PMA_exportComment() . 'DELIMITER ;' . $crlf . PMA_exportComment(); } @@ -444,7 +444,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false) $schema_create .= $new_crlf; if (!empty($sql_drop_table)) { - if (PMA_Table::_isView($db,$table)) { + if (PMA_Table::isView($db,$table)) { $drop_clause = 'DROP VIEW'; } else { $drop_clause = 'DROP TABLE'; @@ -511,7 +511,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false) $sql_constraints = ''; } else { $sql_constraints = $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strConstraintsForDumped']) . PMA_exportComment(); } @@ -622,7 +622,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm if (isset($comments_map) && count($comments_map) > 0) { $schema_create .= $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strCommentsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); foreach ($comments_map AS $comment_field => $comment) { $schema_create .= PMA_exportComment(' ' . PMA_backquote($comment_field, $sql_backquotes)) @@ -633,26 +633,26 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm if (isset($mime_map) && count($mime_map) > 0) { $schema_create .= $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); @reset($mime_map); foreach ($mime_map AS $mime_field => $mime) { $schema_create .= PMA_exportComment(' ' . PMA_backquote($mime_field, $sql_backquotes)) . PMA_exportComment(' ' . PMA_backquote($mime['mimetype'], $sql_backquotes)); } - $schema_create .= PMA_exportComment(); + $schema_create .= PMA_exportComment(); } if ($have_rel) { $schema_create .= $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); foreach ($res_rel AS $rel_field => $rel) { $schema_create .= PMA_exportComment(' ' . PMA_backquote($rel_field, $sql_backquotes)) . PMA_exportComment(' ' . PMA_backquote($rel['foreign_table'], $sql_backquotes) . ' -> ' . PMA_backquote($rel['foreign_field'], $sql_backquotes)); } - $schema_create .= PMA_exportComment(); + $schema_create .= PMA_exportComment(); } return $schema_create; @@ -670,7 +670,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm * @param boolean whether to include column comments * @param boolean whether to include mime comments * @param string 'stand_in', 'create_table', 'create_view' - * @param string 'server', 'database', 'table' + * @param string 'server', 'database', 'table' * * @return bool Whether it suceeded * @@ -684,19 +684,19 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE, $dump = $crlf . PMA_exportComment(str_repeat('-', 56)) . $crlf - . PMA_exportComment(); + . PMA_exportComment(); switch($export_mode) { case 'create_table': $dump .= PMA_exportComment($GLOBALS['strTableStructure'] . ' ' . $formatted_table_name) - . PMA_exportComment(); + . PMA_exportComment(); $dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates) . ';' . $crlf; $triggers = PMA_DBI_get_triggers($db, $table); if ($triggers) { $dump .= $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strTriggers'] . ' ' . $formatted_table_name) - . PMA_exportComment(); + . PMA_exportComment(); $delimiter = '//'; foreach ($triggers as $trigger) { $dump .= $trigger['drop'] . ';' . $crlf; @@ -765,12 +765,12 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) // Do not export data for a VIEW // (For a VIEW, this is called only when exporting a single VIEW) - if (PMA_Table::_isView($db, $table)) { + if (PMA_Table::isView($db, $table)) { $head = $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment('VIEW ' . ' ' . $formatted_table_name) - . PMA_exportComment($GLOBALS['strData'] . ': ' . $GLOBALS['strNone']) - . PMA_exportComment() + . PMA_exportComment($GLOBALS['strData'] . ': ' . $GLOBALS['strNone']) + . PMA_exportComment() . $crlf; if (! PMA_exportOutputHandler($head)) { @@ -781,9 +781,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) // it's not a VIEW $head = $crlf - . PMA_exportComment() + . PMA_exportComment() . PMA_exportComment($GLOBALS['strDumpingData'] . ' ' . $formatted_table_name) - . PMA_exportComment() + . PMA_exportComment() . $crlf; if (! PMA_exportOutputHandler($head)) { diff --git a/libraries/sqlvalidator.class.php b/libraries/sqlvalidator.class.php index 8f46b0737..547d33d0e 100644 --- a/libraries/sqlvalidator.class.php +++ b/libraries/sqlvalidator.class.php @@ -165,7 +165,7 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) { * * @access public */ - function PMA_SQLValidator() + function __construct() { $this->url = 'http://sqlvalidator.mimer.com/v1/services'; $this->service_name = 'SQL99Validator'; diff --git a/pdf_schema.php b/pdf_schema.php index 2ff0ba967..5d31802d6 100644 --- a/pdf_schema.php +++ b/pdf_schema.php @@ -76,7 +76,7 @@ class PMA_PDF extends TCPDF { * @access public * @see FPDF::FPDF() */ - function PMA_PDF($orientation = 'L', $unit = 'mm', $format = 'A4') + function __construct($orientation = 'L', $unit = 'mm', $format = 'A4') { $this->Alias = array() ; $this->TCPDF($orientation, $unit, $format); @@ -617,7 +617,7 @@ class PMA_RT_Table { * @see PMA_PDF, PMA_RT_Table::PMA_RT_Table_setWidth, PMA_RT_Table::PMA_RT_Table_setHeight */ - function PMA_RT_Table($table_name, $ff, &$same_wide_width) + function __construct($table_name, $ff, &$same_wide_width) { global $pdf, $pdf_page_number, $cfgRelation, $db; @@ -750,7 +750,7 @@ class PMA_RT_Relation { * @access private * @see PMA_RT_Relation::PMA_RT_Relation_getXy */ - function PMA_RT_Relation($master_table, $master_field, $foreign_table, $foreign_field) + function __construct($master_table, $master_field, $foreign_table, $foreign_field) { $src_pos = $this->PMA_RT_Relation_getXy($master_table, $master_field); $dest_pos = $this->PMA_RT_Relation_getXy($foreign_table, $foreign_field); @@ -959,7 +959,7 @@ class PMA_RT { * @access private * @see PMA_PDF */ - function PMA_RT($which_rel, $show_info = 0, $change_color = 0, $show_grid = 0, $all_tab_same_wide = 0, $orientation = 'L', $paper = 'A4') + function __construct($which_rel, $show_info = 0, $change_color = 0, $show_grid = 0, $all_tab_same_wide = 0, $orientation = 'L', $paper = 'A4') { global $pdf, $db, $cfgRelation, $with_doc; diff --git a/server_databases.php b/server_databases.php index b9b8898b0..c2d2b1a44 100644 --- a/server_databases.php +++ b/server_databases.php @@ -208,9 +208,19 @@ if ($databases_count > 0) { echo ' ' . "\n"; } echo ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . htmlspecialchars($current['SCHEMA_NAME']) . "\n" . ' ' . "\n" + . ' T' . "\n" . ' ' . "\n"; foreach ($column_order as $stat_name => $stat) { @@ -242,8 +252,17 @@ if ($databases_count > 0) { if ($is_superuser) { echo ' ' . "\n" - . ' '. "\n" - . ' ' .($cfg['PropertiesIconic'] ? ' ' : $strCheckPrivs). "\n" + . ' '. "\n" + . ' ' + . ($cfg['PropertiesIconic'] + ? ' ' + : $strCheckPrivs) . "\n" . ' ' . "\n"; } echo '' . "\n";