fixed E_STRICT

This commit is contained in:
Sebastian Mendel
2007-08-02 11:40:16 +00:00
parent 3623ccbc73
commit d2b9013fad
14 changed files with 88 additions and 148 deletions

View File

@@ -527,16 +527,6 @@ class PMA_Config
return $this->source; return $this->source;
} }
/**
* old PHP 4 style constructor
*
* @deprecated
*/
function PMA_Config($source = null)
{
$this->__construct($source);
}
/** /**
* returns time of last config change. * returns time of last config change.
* @return int Unix timestamp * @return int Unix timestamp
@@ -788,7 +778,7 @@ class PMA_Config
/** /**
* @static * @static
*/ */
function isHttps() static public function isHttps()
{ {
$is_https = false; $is_https = false;
@@ -837,7 +827,7 @@ class PMA_Config
/** /**
* @static * @static
*/ */
function getCookiePath() static public function getCookiePath()
{ {
static $cookie_path = null; static $cookie_path = null;
@@ -922,7 +912,7 @@ class PMA_Config
* @param string $current_size current selected font size with unit * @param string $current_size current selected font size with unit
* @return array selectable font sizes * @return array selectable font sizes
*/ */
function getFontsizeOptions($current_size = '82%') static protected function _getFontsizeOptions($current_size = '82%')
{ {
$unit = preg_replace('/[0-9.]*/', '', $current_size); $unit = preg_replace('/[0-9.]*/', '', $current_size);
$value = 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 $_SESSION['PMA_Config']
* @uses PMA_Config::get() * @uses PMA_Config::get()
* @uses PMA_Config::getFontsizeOptions() * @uses PMA_Config::_getFontsizeOptions()
* @uses $GLOBALS['strFontSize'] * @uses $GLOBALS['strFontSize']
* @static * @static
* @param string $current_size currently slected font size with unit * @param string $current_size currently slected font size with unit
* @return string html selectbox * @return string html selectbox
*/ */
function getFontsizeSelection() static protected function _getFontsizeSelection()
{ {
$current_size = $_SESSION['PMA_Config']->get('fontsize'); $current_size = $_SESSION['PMA_Config']->get('fontsize');
$options = PMA_Config::getFontsizeOptions($current_size); $options = PMA_Config::_getFontsizeOptions($current_size);
$return = '<label for="select_fontsize">' . $GLOBALS['strFontSize'] . ':</label>' . "\n"; $return = '<label for="select_fontsize">' . $GLOBALS['strFontSize'] . ':</label>' . "\n";
$return .= '<select name="fontsize" id="select_fontsize" onchange="this.form.submit();">' . "\n"; $return .= '<select name="fontsize" id="select_fontsize" onchange="this.form.submit();">' . "\n";
@@ -1009,18 +999,18 @@ class PMA_Config
* return complete font size selection form * return complete font size selection form
* *
* @uses PMA_generate_common_hidden_inputs() * @uses PMA_generate_common_hidden_inputs()
* @uses PMA_Config::getFontsizeSelection() * @uses PMA_Config::_getFontsizeSelection()
* @uses $GLOBALS['strGo'] * @uses $GLOBALS['strGo']
* @static * @static
* @param string $current_size currently slected font size with unit * @param string $current_size currently slected font size with unit
* @return string html selectbox * @return string html selectbox
*/ */
function getFontsizeForm() static public function getFontsizeForm()
{ {
return '<form name="form_fontsize_selection" id="form_fontsize_selection"' return '<form name="form_fontsize_selection" id="form_fontsize_selection"'
. ' method="post" action="index.php" target="_parent">' . "\n" . ' method="post" action="index.php" target="_parent">' . "\n"
. PMA_generate_common_hidden_inputs() . "\n" . PMA_generate_common_hidden_inputs() . "\n"
. PMA_Config::getFontsizeSelection() . "\n" . PMA_Config::_getFontsizeSelection() . "\n"
. '<noscript>' . "\n" . '<noscript>' . "\n"
. '<input type="submit" value="' . $GLOBALS['strGo'] . '" />' . "\n" . '<input type="submit" value="' . $GLOBALS['strGo'] . '" />' . "\n"
. '</noscript>' . "\n" . '</noscript>' . "\n"

View File

@@ -69,18 +69,6 @@ class PMA_File
*/ */
var $_charset = null; 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 * constructor
* *
@@ -875,4 +863,4 @@ class PMA_File
} }
} }
?> ?>

View File

@@ -68,15 +68,6 @@ require_once './libraries/List.class.php';
$this->build(); $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 * 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 PMA_List_Database::$items
* @uses array_slice() * @uses array_slice()
* @param integer $offset * @param integer $offset
* @param integer $count * @param integer $count
* @return array some items * @return array some items
*/ */
function getLimitedItems($offset, $count) function getLimitedItems($offset, $count)
{ {

View File

@@ -78,17 +78,6 @@ class PMA_Sql
*/ */
var $_tokens = array(); var $_tokens = array();
/**
* old PHP 4 style constructor
* @deprecated
* @access public
* @see PMA_sql::__construct()
*/
function PMA_sql($sql)
{
$this->__construct($sql);
}
/** /**
* Constructor * Constructor
* *

View File

@@ -51,11 +51,11 @@ class PMA_StorageEngine
* @staticvar array $storage_engines storage engines * @staticvar array $storage_engines storage engines
* @access public * @access public
* @uses PMA_MYSQL_INT_VERSION * @uses PMA_MYSQL_INT_VERSION
* @uses PMA_StorageEngine::getStorageEnginesBefore40102() * @uses PMA_StorageEngine::_getStorageEnginesBefore40102()
* @uses PMA_DBI_fetch_result() * @uses PMA_DBI_fetch_result()
* @return array of storage engines * @return array of storage engines
*/ */
function getStorageEngines() static public function getStorageEngines()
{ {
static $storage_engines = null; static $storage_engines = null;
@@ -67,7 +67,7 @@ class PMA_StorageEngine
// SHOW STORAGE ENGINES comes with MySQL 4.1.2 // SHOW STORAGE ENGINES comes with MySQL 4.1.2
if (PMA_MYSQL_INT_VERSION < 40102) { if (PMA_MYSQL_INT_VERSION < 40102) {
$storage_engines = PMA_StorageEngine::getStorageEnginesBefore40102(); $storage_engines = PMA_StorageEngine::_getStorageEnginesBefore40102();
} else { } else {
$storage_engines = PMA_DBI_fetch_result('SHOW STORAGE ENGINES', 'Engine'); $storage_engines = PMA_DBI_fetch_result('SHOW STORAGE ENGINES', 'Engine');
} }
@@ -90,7 +90,7 @@ class PMA_StorageEngine
* Should unavailable storage engines be offered? * Should unavailable storage engines be offered?
* @return string html selectbox * @return string html selectbox
*/ */
function getHtmlSelect($name = 'engine', $id = null, static public function getHtmlSelect($name = 'engine', $id = null,
$selected = null, $offerUnavailableEngines = false) $selected = null, $offerUnavailableEngines = false)
{ {
$selected = strtolower($selected); $selected = strtolower($selected);
@@ -126,7 +126,7 @@ class PMA_StorageEngine
* @uses substr() * @uses substr()
* @return array of storage engines * @return array of storage engines
*/ */
function getStorageEnginesBefore40102() static protected function _getStorageEnginesBefore40102()
{ {
$storage_engines = array( $storage_engines = array(
'myisam' => array( 'myisam' => array(
@@ -181,7 +181,7 @@ class PMA_StorageEngine
* @param string $engine The engine ID * @param string $engine The engine ID
* @return object The engine plugin * @return object The engine plugin
*/ */
function getEngine($engine) static public function getEngine($engine)
{ {
$engine = str_replace('/', '', str_replace('.', '', $engine)); $engine = str_replace('/', '', str_replace('.', '', $engine));
$engine_lowercase_filename = strtolower($engine); $engine_lowercase_filename = strtolower($engine);
@@ -203,7 +203,7 @@ class PMA_StorageEngine
* @param string $engine name of engine * @param string $engine name of engine
* @reutrn boolean whether $engine is valid or not * @reutrn boolean whether $engine is valid or not
*/ */
function isValid($engine) static public function isValid($engine)
{ {
$storage_engines = PMA_StorageEngine::getStorageEngines(); $storage_engines = PMA_StorageEngine::getStorageEngines();
return isset($storage_engines[$engine]); 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() * public String getTitle()
* *

View File

@@ -137,7 +137,7 @@ class PMA_Table {
return $this->getDbName($quoted) . '.' . $this->getName($quoted); 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)) { if (strlen($db) && strlen($table)) {
return PMA_Table::_isView($db, $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 * Checks if this "table" is a view
* *
@@ -230,7 +220,8 @@ class PMA_Table {
* *
* @access public * @access public
*/ */
function _isView($db, $table) { static protected function _isView($db, $table)
{
// maybe we already know if the table is a view // maybe we already know if the table is a view
if (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view']) { if (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view']) {
return true; return true;
@@ -374,7 +365,7 @@ class PMA_Table {
* *
* @access public * @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; $row_count = false;

View File

@@ -110,7 +110,7 @@ class PMA_Theme {
* @param string $folder path to theme * @param string $folder path to theme
* @return object PMA_Theme * @return object PMA_Theme
*/ */
function load($folder) static public function load($folder)
{ {
$theme = new PMA_Theme(); $theme = new PMA_Theme();
@@ -382,4 +382,4 @@ class PMA_Theme {
.'</div>'; .'</div>';
} }
} }
?> ?>

View File

@@ -212,14 +212,6 @@ class PMA_Theme_Manager
return true; return true;
} }
/**
* old PHP 4 constructor
*/
function PMA_Theme_Manager()
{
$this->__construct();
}
/** /**
* @private * @private
* @param string $folder * @param string $folder

View File

@@ -34,20 +34,6 @@
* @version $Id$ * @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 // at this point PMA_PHP_INT_VERSION is not yet defined
if (version_compare(phpversion(), '6', 'lt')) { if (version_compare(phpversion(), '6', 'lt')) {
/** /**
@@ -238,6 +224,15 @@ if (empty($__redirect) && !defined('PMA_NO_VARIABLES_IMPORT')) {
require './libraries/grab_globals.lib.php'; 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 * include session handling after the globals, to prevent overwriting
*/ */

View File

@@ -325,16 +325,13 @@ function PMA_DBI_fetch_row($result)
* *
* @uses mysqli_result * @uses mysqli_result
* @uses func_get_args() * @uses func_get_args()
* @uses is_object()
* @uses is_a()
* @uses mysqli_free_result() * @uses mysqli_free_result()
* @param result $result,... one or more mysql result resources * @param result $result,... one or more mysql result resources
*/ */
function PMA_DBI_free_result() function PMA_DBI_free_result()
{ {
foreach (func_get_args() as $result) { foreach (func_get_args() as $result) {
if (is_object($result) if ($result instanceof mysqli_result) {
&& is_a($result, 'mysqli_result')) {
mysqli_free_result($result); mysqli_free_result($result);
} }
} }

View File

@@ -54,7 +54,7 @@ if (isset($plugin_list)) {
$plugin_list['sql']['options'][] = $plugin_list['sql']['options'][] =
array('type' => 'bgroup', 'name' => 'structure', 'text' => 'strStructure', 'force' => 'data'); array('type' => 'bgroup', 'name' => 'structure', 'text' => 'strStructure', 'force' => 'data');
if ($plugin_param['export_type'] == 'table') { 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'; $drop_clause = 'DROP VIEW';
} else { } else {
$drop_clause = 'DROP TABLE'; $drop_clause = 'DROP TABLE';
@@ -133,7 +133,7 @@ if (! isset($sql_backquotes)) {
* *
* @param string Text of comment * @param string Text of comment
* *
* @return string The formatted comment * @return string The formatted comment
*/ */
function PMA_exportComment($text = '') function PMA_exportComment($text = '')
{ {
@@ -195,7 +195,7 @@ function PMA_exportHeader()
$head = PMA_exportComment('phpMyAdmin SQL Dump') $head = PMA_exportComment('phpMyAdmin SQL Dump')
. PMA_exportComment('version ' . PMA_VERSION) . PMA_exportComment('version ' . PMA_VERSION)
. PMA_exportComment('http://www.phpmyadmin.net') . PMA_exportComment('http://www.phpmyadmin.net')
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strHost'] . ': ' . $cfg['Server']['host']); . PMA_exportComment($GLOBALS['strHost'] . ': ' . $cfg['Server']['host']);
if (!empty($cfg['Server']['port'])) { if (!empty($cfg['Server']['port'])) {
$head .= ':' . $cfg['Server']['port']; $head .= ':' . $cfg['Server']['port'];
@@ -212,7 +212,7 @@ function PMA_exportHeader()
$head .= PMA_exportComment(); $head .= PMA_exportComment();
foreach($lines as $one_line) { foreach($lines as $one_line) {
$head .= PMA_exportComment($one_line); $head .= PMA_exportComment($one_line);
} }
$head .= PMA_exportComment(); $head .= PMA_exportComment();
} }
@@ -291,7 +291,7 @@ function PMA_exportDBCreate($db)
*/ */
function PMA_exportDBHeader($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($GLOBALS['strDatabase'] . ': ' . (isset($GLOBALS['sql_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\''))
. PMA_exportComment(); . PMA_exportComment();
return PMA_exportOutputHandler($head); return PMA_exportOutputHandler($head);
@@ -323,9 +323,9 @@ function PMA_exportDBFooter($db)
if ($procedure_names) { if ($procedure_names) {
$delimiter = '$$'; $delimiter = '$$';
$procs_funcs = $crlf $procs_funcs = $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strProcedures']) . PMA_exportComment($GLOBALS['strProcedures'])
. PMA_exportComment() . PMA_exportComment()
. 'DELIMITER ' . $delimiter . $crlf . 'DELIMITER ' . $delimiter . $crlf
. PMA_exportComment(); . 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_DBI_get_procedure_or_function_def($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf;
} }
$procs_funcs .= PMA_exportComment() $procs_funcs .= PMA_exportComment()
. 'DELIMITER ;' . $crlf . 'DELIMITER ;' . $crlf
. PMA_exportComment(); . PMA_exportComment();
} }
@@ -444,7 +444,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
$schema_create .= $new_crlf; $schema_create .= $new_crlf;
if (!empty($sql_drop_table)) { if (!empty($sql_drop_table)) {
if (PMA_Table::_isView($db,$table)) { if (PMA_Table::isView($db,$table)) {
$drop_clause = 'DROP VIEW'; $drop_clause = 'DROP VIEW';
} else { } else {
$drop_clause = 'DROP TABLE'; $drop_clause = 'DROP TABLE';
@@ -511,7 +511,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
$sql_constraints = ''; $sql_constraints = '';
} else { } else {
$sql_constraints = $crlf $sql_constraints = $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strConstraintsForDumped']) . PMA_exportComment($GLOBALS['strConstraintsForDumped'])
. PMA_exportComment(); . 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) { if (isset($comments_map) && count($comments_map) > 0) {
$schema_create .= $crlf $schema_create .= $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strCommentsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); . PMA_exportComment($GLOBALS['strCommentsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':');
foreach ($comments_map AS $comment_field => $comment) { foreach ($comments_map AS $comment_field => $comment) {
$schema_create .= PMA_exportComment(' ' . PMA_backquote($comment_field, $sql_backquotes)) $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) { if (isset($mime_map) && count($mime_map) > 0) {
$schema_create .= $crlf $schema_create .= $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); . PMA_exportComment($GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':');
@reset($mime_map); @reset($mime_map);
foreach ($mime_map AS $mime_field => $mime) { foreach ($mime_map AS $mime_field => $mime) {
$schema_create .= PMA_exportComment(' ' . PMA_backquote($mime_field, $sql_backquotes)) $schema_create .= PMA_exportComment(' ' . PMA_backquote($mime_field, $sql_backquotes))
. PMA_exportComment(' ' . PMA_backquote($mime['mimetype'], $sql_backquotes)); . PMA_exportComment(' ' . PMA_backquote($mime['mimetype'], $sql_backquotes));
} }
$schema_create .= PMA_exportComment(); $schema_create .= PMA_exportComment();
} }
if ($have_rel) { if ($have_rel) {
$schema_create .= $crlf $schema_create .= $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':'); . PMA_exportComment($GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $sql_backquotes) . ':');
foreach ($res_rel AS $rel_field => $rel) { foreach ($res_rel AS $rel_field => $rel) {
$schema_create .= PMA_exportComment(' ' . PMA_backquote($rel_field, $sql_backquotes)) $schema_create .= PMA_exportComment(' ' . PMA_backquote($rel_field, $sql_backquotes))
. PMA_exportComment(' ' . PMA_backquote($rel['foreign_table'], $sql_backquotes) . PMA_exportComment(' ' . PMA_backquote($rel['foreign_table'], $sql_backquotes)
. ' -> ' . PMA_backquote($rel['foreign_field'], $sql_backquotes)); . ' -> ' . PMA_backquote($rel['foreign_field'], $sql_backquotes));
} }
$schema_create .= PMA_exportComment(); $schema_create .= PMA_exportComment();
} }
return $schema_create; 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 column comments
* @param boolean whether to include mime comments * @param boolean whether to include mime comments
* @param string 'stand_in', 'create_table', 'create_view' * @param string 'stand_in', 'create_table', 'create_view'
* @param string 'server', 'database', 'table' * @param string 'server', 'database', 'table'
* *
* @return bool Whether it suceeded * @return bool Whether it suceeded
* *
@@ -684,19 +684,19 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE,
$dump = $crlf $dump = $crlf
. PMA_exportComment(str_repeat('-', 56)) . PMA_exportComment(str_repeat('-', 56))
. $crlf . $crlf
. PMA_exportComment(); . PMA_exportComment();
switch($export_mode) { switch($export_mode) {
case 'create_table': case 'create_table':
$dump .= PMA_exportComment($GLOBALS['strTableStructure'] . ' ' . $formatted_table_name) $dump .= PMA_exportComment($GLOBALS['strTableStructure'] . ' ' . $formatted_table_name)
. PMA_exportComment(); . PMA_exportComment();
$dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates) . ';' . $crlf; $dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates) . ';' . $crlf;
$triggers = PMA_DBI_get_triggers($db, $table); $triggers = PMA_DBI_get_triggers($db, $table);
if ($triggers) { if ($triggers) {
$dump .= $crlf $dump .= $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strTriggers'] . ' ' . $formatted_table_name) . PMA_exportComment($GLOBALS['strTriggers'] . ' ' . $formatted_table_name)
. PMA_exportComment(); . PMA_exportComment();
$delimiter = '//'; $delimiter = '//';
foreach ($triggers as $trigger) { foreach ($triggers as $trigger) {
$dump .= $trigger['drop'] . ';' . $crlf; $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 // Do not export data for a VIEW
// (For a VIEW, this is called only when exporting a single 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 $head = $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment('VIEW ' . ' ' . $formatted_table_name) . PMA_exportComment('VIEW ' . ' ' . $formatted_table_name)
. PMA_exportComment($GLOBALS['strData'] . ': ' . $GLOBALS['strNone']) . PMA_exportComment($GLOBALS['strData'] . ': ' . $GLOBALS['strNone'])
. PMA_exportComment() . PMA_exportComment()
. $crlf; . $crlf;
if (! PMA_exportOutputHandler($head)) { if (! PMA_exportOutputHandler($head)) {
@@ -781,9 +781,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
// it's not a VIEW // it's not a VIEW
$head = $crlf $head = $crlf
. PMA_exportComment() . PMA_exportComment()
. PMA_exportComment($GLOBALS['strDumpingData'] . ' ' . $formatted_table_name) . PMA_exportComment($GLOBALS['strDumpingData'] . ' ' . $formatted_table_name)
. PMA_exportComment() . PMA_exportComment()
. $crlf; . $crlf;
if (! PMA_exportOutputHandler($head)) { if (! PMA_exportOutputHandler($head)) {

View File

@@ -165,7 +165,7 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
* *
* @access public * @access public
*/ */
function PMA_SQLValidator() function __construct()
{ {
$this->url = 'http://sqlvalidator.mimer.com/v1/services'; $this->url = 'http://sqlvalidator.mimer.com/v1/services';
$this->service_name = 'SQL99Validator'; $this->service_name = 'SQL99Validator';

View File

@@ -76,7 +76,7 @@ class PMA_PDF extends TCPDF {
* @access public * @access public
* @see FPDF::FPDF() * @see FPDF::FPDF()
*/ */
function PMA_PDF($orientation = 'L', $unit = 'mm', $format = 'A4') function __construct($orientation = 'L', $unit = 'mm', $format = 'A4')
{ {
$this->Alias = array() ; $this->Alias = array() ;
$this->TCPDF($orientation, $unit, $format); $this->TCPDF($orientation, $unit, $format);
@@ -617,7 +617,7 @@ class PMA_RT_Table {
* @see PMA_PDF, PMA_RT_Table::PMA_RT_Table_setWidth, * @see PMA_PDF, PMA_RT_Table::PMA_RT_Table_setWidth,
PMA_RT_Table::PMA_RT_Table_setHeight 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; global $pdf, $pdf_page_number, $cfgRelation, $db;
@@ -750,7 +750,7 @@ class PMA_RT_Relation {
* @access private * @access private
* @see PMA_RT_Relation::PMA_RT_Relation_getXy * @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); $src_pos = $this->PMA_RT_Relation_getXy($master_table, $master_field);
$dest_pos = $this->PMA_RT_Relation_getXy($foreign_table, $foreign_field); $dest_pos = $this->PMA_RT_Relation_getXy($foreign_table, $foreign_field);
@@ -959,7 +959,7 @@ class PMA_RT {
* @access private * @access private
* @see PMA_PDF * @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; global $pdf, $db, $cfgRelation, $with_doc;

View File

@@ -208,9 +208,19 @@ if ($databases_count > 0) {
echo ' </td>' . "\n"; echo ' </td>' . "\n";
} }
echo ' <td class="name">' . "\n" echo ' <td class="name">' . "\n"
. ' <a onclick="if (window.parent.openDb(\'' . urlencode($current['SCHEMA_NAME']) . '\')) return false;" href="index.php?' . $url_query . '&amp;db=' . urlencode($current['SCHEMA_NAME']) . '" title="' . sprintf($strJumpToDB, htmlspecialchars($current['SCHEMA_NAME'])) . '" target="_parent">' . "\n" . ' <a onclick="'
. 'if (window.parent.openDb(\'' . PMA_jsFormat($current['SCHEMA_NAME'], false) . '\')) return false;'
. '" href="index.php?' . $url_query . '&amp;db='
. urlencode($current['SCHEMA_NAME']) . '" title="'
. sprintf($strJumpToDB, htmlspecialchars($current['SCHEMA_NAME']))
. '" target="_parent">' . "\n"
. ' ' . htmlspecialchars($current['SCHEMA_NAME']) . "\n" . ' ' . htmlspecialchars($current['SCHEMA_NAME']) . "\n"
. ' </a>' . "\n" . ' </a>' . "\n"
. ' <a onclick="
//<![CDATA[
if (window.parent.openDb(\'' . PMA_jsFormat($current['SCHEMA_NAME'], false) . '\', true)) return false;
//]]>
">T</a>' . "\n"
. ' </td>' . "\n"; . ' </td>' . "\n";
foreach ($column_order as $stat_name => $stat) { foreach ($column_order as $stat_name => $stat) {
@@ -242,8 +252,17 @@ if ($databases_count > 0) {
if ($is_superuser) { if ($is_superuser) {
echo ' <td class="tool">' . "\n" echo ' <td class="tool">' . "\n"
. ' <a onclick="window.parent.setDb(\'' . urlencode($current['SCHEMA_NAME']) . '\');" href="./server_privileges.php?' . $url_query . '&amp;checkprivs=' . urlencode($current['SCHEMA_NAME']) . '" title="' . sprintf($strCheckPrivsLong, htmlspecialchars($current['SCHEMA_NAME'])) . '">'. "\n" . ' <a onclick="
. ' ' .($cfg['PropertiesIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_rights.png" width="16" height="16" alt=" ' .$strCheckPrivs . '" /> ' : $strCheckPrivs). "\n" // <![CDATA[
window.parent.setDb(\'' . PMA_jsFormat($current['SCHEMA_NAME']) . '\');
// ]]>" href="./server_privileges.php?' . $url_query
. '&amp;checkprivs=' . urlencode($current['SCHEMA_NAME'])
. '" title="' . sprintf($strCheckPrivsLong, htmlspecialchars($current['SCHEMA_NAME']))
. '">'. "\n"
. ' '
. ($cfg['PropertiesIconic']
? '<img class="icon" src="' . $pmaThemeImage . 's_rights.png" width="16" height="16" alt=" ' . $strCheckPrivs . '" /> '
: $strCheckPrivs) . "\n"
. ' </a></td>' . "\n"; . ' </a></td>' . "\n";
} }
echo '</tr>' . "\n"; echo '</tr>' . "\n";