Merge branch 'master' of https://github.com/phpmyadmin/phpmyadmin into UT_plu_relation

This commit is contained in:
adamgsoc2013 2013-07-07 10:27:25 +08:00
commit 8d2e433faa
150 changed files with 87323 additions and 79948 deletions

View File

@ -22,6 +22,8 @@ phpMyAdmin - ChangeLog
+ rfe #1434 Improvements to the table browsing navigation bar
+ rfe #1233 and rfe #1283 Improvements to Relation View interface
+ rfe #175 Allow cross-database relations
- [core] Dropped support for PHP 5.2.
+ rfe #487 and rfe #1405 Find and Replacing column wise
4.0.5.0 (not yet released)
- bug #3977 Not detected configuration storage
@ -31,6 +33,9 @@ phpMyAdmin - ChangeLog
- bug #3960 NavigationBarIconic config not honored
- bug #3985 Call to undefined function mb_detect_encoding
4.0.4.1 (2013-06-30)
- [security] Global variables scope injection vulnerability (see PMASA-2013-7)
4.0.4.0 (2013-06-17)
- bug #3959 Using DefaultTabDatabase in NavigationTree for Database Click
- bug #3961 Avoid Suhosin warning when in simulation mode

2
README
View File

@ -42,7 +42,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Requirements
------------
* PHP 5.2 or later
* PHP 5.3 or later
* MySQL 5.0 or later
* a web-browser (doh!)

View File

@ -19,6 +19,6 @@
"source": "https://github.com/phpmyadmin/phpmyadmin"
},
"require": {
"php": ">=5.2.0"
"php": ">=5.3.0"
}
}

View File

@ -395,8 +395,8 @@ MMCache but upgrading MMCache to version 2.3.21 solves the problem.
Yes.
Since release 3.0 only PHP 5.2 and newer. For older PHP versions, use
phpMyAdmin 2.11.x.
Since release 4.1 phpMyAdmin supports only PHP 5.3 and newer. For PHP 5.2 you
can use 4.0.x releases.
.. _faq1_32:

View File

@ -12,7 +12,7 @@ web server (such as Apache, :term:`IIS`) to install phpMyAdmin's files into.
PHP
---
* You need PHP 5.2.0 or newer, with ``session`` support, the Standard PHP Library
* You need PHP 5.3.0 or newer, with ``session`` support, the Standard PHP Library
(SPL) extension and JSON support.
* To support uploading of ZIP files, you need the PHP ``zip`` extension.
@ -31,7 +31,7 @@ PHP
* To support upload progress bars, see :ref:`faq2_9`.
* To support XML and Open Document Spreadsheet importing, you need PHP
5.2.17 or newer and the `libxml <http://www.php.net/libxml>`_
with the `libxml <http://www.php.net/libxml>`_
extension.
.. seealso:: :ref:`faq1_31`, :ref:`authentication_modes`

View File

@ -122,6 +122,24 @@ if ($_POST == array() && $_GET == array()) {
* We only need to load the selected plugin
*/
if (! in_array(
$format,
array(
'csv',
'ldi',
'mediawiki',
'ods',
'shp',
'sql',
'xml'
)
)
) {
// this should not happen for a normal user
// but only during an attack
PMA_fatalError('Incorrect format parameter');
}
$post_patterns = array(
'/^force_file_/',
'/^'. $format . '_/'

View File

@ -274,6 +274,10 @@ $js_messages['strSave'] = __('Save');
$js_messages['strHideSearchCriteria'] = __('Hide search criteria');
$js_messages['strShowSearchCriteria'] = __('Show search criteria');
/* For tbl_find_replace.js */
$js_messages['strHideFindNReplaceCriteria'] = __('Hide find and replace criteria');
$js_messages['strShowFindNReplaceCriteria'] = __('Show find and replace criteria');
/* For tbl_zoom_plot_jqplot.js */
$js_messages['strZoomSearch'] = __('Zoom Search');
$js_messages['strDisplayHelp'] = '<ul><li>'

47
js/tbl_find_replace.js Normal file
View File

@ -0,0 +1,47 @@
/**
* Unbind all event handlers before tearing down a page
*/
AJAX.registerTeardown('tbl_find_replace.js', function () {
$('#find_replace_form').unbind('submit');
$('#toggle_find').unbind('click');
});
/**
* Bind events
*/
AJAX.registerOnload('tbl_find_replace.js', function () {
$('<div id="toggle_find_div"><a id="toggle_find"></a></div>')
.insertAfter('#find_replace_form')
.hide();
$('#toggle_find')
.html(PMA_messages.strHideFindNReplaceCriteria)
.click(function() {
var $link = $(this);
$('#find_replace_form').slideToggle();
if ($link.text() == PMA_messages.strHideFindNReplaceCriteria) {
$link.text(PMA_messages.strShowFindNReplaceCriteria);
} else {
$link.text(PMA_messages.strHideFindNReplaceCriteria);
}
return false
});
$('#find_replace_form').submit(function(e) {
e.preventDefault();
var findReplaceForm = $('#find_replace_form');
PMA_prepareForAjaxRequest(findReplaceForm);
var $msgbox = PMA_ajaxShowMessage();
$.post(findReplaceForm.attr('action'), findReplaceForm.serialize(), function (data) {
PMA_ajaxRemoveMessage($msgbox);
if (data.success === true) {
$('#toggle_find_div').show();
$('#toggle_find').click();
$("#sqlqueryresults").html(data.preview);
} else {
$("#sqlqueryresults").html(data.error);
}
});
});
});

View File

@ -248,7 +248,7 @@ class PMA_Error extends PMA_Message
/**
* Get HTML backtrace
*
* @return void
* @return string
*/
public function getBacktraceDisplay()
{
@ -364,8 +364,8 @@ class PMA_Error extends PMA_Message
/**
* return short relative path to phpMyAdmin basedir
*
* prevent path disclusore in error message,
* and make users feel save to submit error reports
* prevent path disclosure in error message,
* and make users feel safe to submit error reports
*
* @param string $dest path to be shorten
*
@ -384,7 +384,7 @@ class PMA_Error extends PMA_Message
$Ahere = explode(
$path_separator,
realpath(dirname(__FILE__) . $path_separator . '..')
realpath(__DIR__ . $path_separator . '..')
);
$Adest = explode($path_separator, $dest);

View File

@ -531,7 +531,7 @@ class PMA_File
* get registered plugins for file compression
foreach (PMA_getPlugins($type = 'compression') as $plugin) {
if (call_user_func_array(array($plugin['classname'], 'canHandle'), array($this->getName()))) {
if ($plugin['classname']::canHandle($this->getName())) {
$this->setCompressionPlugin($plugin);
break;
}

View File

@ -358,7 +358,7 @@ class PMA_Index
/**
* Returns index choice (PRIMARY, UNIQUE, INDEX, SPATIAL, FULLTEXT)
*
* @return index choice
* @return string index choice
*/
public function getChoice()
{

View File

@ -247,6 +247,7 @@ class PMA_List_Database extends PMA_List
$tmp_mydbs = $GLOBALS['dbi']->fetchResult(
$local_query, null, null, $GLOBALS['controllink']
);
$dblist = array();
if ($tmp_mydbs) {
// Will use as associative array of the following 2 code
// lines:

View File

@ -281,7 +281,7 @@ class PMA_Menu
$tabs['search']['link'] = 'tbl_select.php';
$tabs['search']['active'] = in_array(
basename($GLOBALS['PMA_PHP_SELF']),
array('tbl_select.php', 'tbl_zoom_select.php')
array('tbl_select.php', 'tbl_zoom_select.php', 'tbl_find_replace.php')
);
if (! $db_is_information_schema) {

View File

@ -17,8 +17,8 @@
* // get simple success message 'Success'
* $message = PMA_Message::success();
*
* // get special notice 'Some locale notice'
* $message = PMA_Message::notice('strSomeLocaleNotice');
* // get special notice
* $message = PMA_Message::notice(__('This is a localized notice'));
* </code>
*
* more advanced usage example:
@ -29,7 +29,7 @@
* // create another message, a hint, with a localized string which expects
* // two parameters: $strSomeTooltip = 'Read the %smanual%s'
* $hint = PMA_Message::notice('strSomeTooltip');
* // replace %d with the following params
* // replace placeholders with the following params
* $hint->addParam('[doc@cfg_Example]');
* $hint->addParam('[/doc]');
* // add this hint as a tooltip
@ -723,12 +723,12 @@ class PMA_Message
return $this->isDisplayed;
}
/**
* Returns the message with corresponding image icon
*
*
* @param string $message the message(s)
*
*
* @return string message with icon
*/
public function getMessageWithIcon($message)
@ -743,7 +743,7 @@ class PMA_Message
}
$message = PMA_Message::notice(PMA_Util::getImage($image)) . " " . $message;
return $message;
}
}
?>

View File

@ -135,12 +135,9 @@ class PMA_OutputBuffering
{
if (ob_get_status() && $this->_mode) {
ob_flush();
} else {
flush();
}
/**
* previously we had here an "else flush()" but some PHP versions
* (at least PHP 5.2.11) have a bug (49816) that produces garbled
* data
*/
}
}

View File

@ -210,6 +210,11 @@ class PMA_TableSearch
$subtabs['zoom']['text'] = __('Zoom Search');
$subtabs['zoom']['id'] = 'zoom_search_id';
$subtabs['replace']['icon'] = 'b_find_replace.png';
$subtabs['replace']['link'] = 'tbl_find_replace.php';
$subtabs['replace']['text'] = __('Find and Replace');
$subtabs['replace']['id'] = 'find_replace_id';
return $subtabs;
}
@ -1070,8 +1075,22 @@ EOT;
private function _getFormTag($goto)
{
$html_output = '';
$scriptName = ($this->_searchType == 'zoom' ? 'tbl_zoom_select.php' : 'tbl_select.php');
$formId = ($this->_searchType == 'zoom' ? 'zoom_search_form' : 'tbl_search_form');
$scriptName = '';
$formId = '';
switch ($this->_searchType) {
case 'normal' :
$scriptName = 'tbl_select.php';
$formId = 'tbl_search_form';
break;
case 'zoom' :
$scriptName = 'tbl_zoom_select.php';
$formId = 'zoom_search_form';
break;
case 'replace' :
$scriptName = 'tbl_find_replace.php';
$formId = 'find_replace_form';
break;
}
$html_output .= '<form method="post" action="' . $scriptName . '" '
. 'name="insertForm" id="' . $formId . '" '
@ -1086,14 +1105,11 @@ EOT;
}
/**
* Generates the table search form under table search tab
* Returns the HTML for secondary levels tabs of the table search page
*
* @param string $goto Goto URL
* @param string $dataLabel Label for points in zoom plot
*
* @return string the generated HTML for table search form
* @return string HTML for secondary levels tabs
*/
public function getSelectionForm($goto, $dataLabel = null)
public function getSecondaryTabs()
{
$url_params = array();
$url_params['db'] = $this->_db;
@ -1105,8 +1121,20 @@ EOT;
}
$html_output .= '</ul>';
$html_output .= '<div class="clearfloat"></div>';
return $html_output;
}
$html_output .= $this->_getFormTag($goto);
/**
* Generates the table search form under table search tab
*
* @param string $goto Goto URL
* @param string $dataLabel Label for points in zoom plot
*
* @return string the generated HTML for table search form
*/
public function getSelectionForm($goto, $dataLabel = null)
{
$html_output = $this->_getFormTag($goto);
if ($this->_searchType == 'zoom') {
$html_output .= '<fieldset id="fieldset_zoom_search">';
@ -1118,7 +1146,7 @@ EOT;
$html_output .= $this->_getOptionsZoom($dataLabel);
$html_output .= '</fieldset>';
$html_output .= '</fieldset>';
} else {
} else if ($this->_searchType == 'normal') {
$html_output .= '<fieldset id="fieldset_table_search">';
$html_output .= '<fieldset id="fieldset_table_qbe">';
$html_output .= '<legend>'
@ -1130,6 +1158,13 @@ EOT;
$html_output .= '</fieldset>';
$html_output .= $this->_getOptions();
$html_output .= '</fieldset>';
} else if ($this->_searchType == 'replace') {
$html_output .= '<fieldset id="fieldset_find_replace">';
$html_output .= '<fieldset id="fieldset_find">';
$html_output .= '<legend>' . __('Find and Replace') . '</legend>';
$html_output .= $this->_getSearchAndReplaceHTML();
$html_output .= '</fieldset>';
$html_output .= '</fieldset>';
}
/**
@ -1225,5 +1260,141 @@ EOT;
$html_output .= '</form>';
return $html_output;
}
/**
* Displays the 'Find and Replace' form
*
* @return HTML for 'Find and Replace' form
*/
function _getSearchAndReplaceHTML()
{
$htmlOutput = __('Find')
. ': <input type="text" value="" name="find" />';
$htmlOutput .= __('Replace with')
. ': <input type="text" value="" name="replaceWith" />';
$htmlOutput .= __('Column') . ': <select name="columnIndex">';
for ($i = 0; $i < count($this->_columnNames); $i++) {
$type = preg_replace('@\(.*@s', '', $this->_columnTypes[$i]);
if ($GLOBALS['PMA_Types']->getTypeClass($type) == 'CHAR') {
$column = $this->_columnNames[$i];
$htmlOutput .= '<option value="' . $i . '">'
. htmlspecialchars($column) . '</option>';
}
}
$htmlOutput .= '</select>';
return $htmlOutput;
}
/**
* Returns HTML for prviewing strings found and their replacements
*
* @param int $columnIndex index of the column
* @param string $find string to find in the column
* @param string $replaceWith string to replace with
* @param string $charSet character set of the connection
*
* @return HTML for prviewing strings found and their replacements
*/
function getReplacePreview($columnIndex, $find, $replaceWith, $charSet)
{
$column = $this->_columnNames[$columnIndex];
$sql_query = "SELECT "
. PMA_Util::backquote($column) . ","
. " REPLACE("
. PMA_Util::backquote($column) . ", '" . $find . "', '" . $replaceWith
. "'),"
. " COUNT(*)"
. " FROM " . PMA_Util::backquote($this->_db)
. "." . PMA_Util::backquote($this->_table)
. " WHERE " . PMA_Util::backquote($column)
. " LIKE '%" . $find . "%' COLLATE " . $charSet . "_bin"; // here we
// change the collation of the 2nd operand to a case sensitive
// binary collation to make sure that the comparison is case sensitive
$sql_query .= " GROUP BY " . PMA_Util::backquote($column)
. " ORDER BY " . PMA_Util::backquote($column) . " ASC";
$rs = $GLOBALS['dbi']->query(
$sql_query, null, PMA_DatabaseInterface::QUERY_STORE
);
$htmlOutput = '<form method="post" action="tbl_find_replace.php"'
. ' name="previewForm" id="previewForm" class="ajax">';
$htmlOutput .= PMA_generate_common_hidden_inputs($this->_db, $this->_table);
$htmlOutput .= '<input type="hidden" name="replace" value="true" />';
$htmlOutput .= '<input type="hidden" name="columnIndex" value="'
. $columnIndex . '" />';
$htmlOutput .= '<input type="hidden" name="findString"'
. ' value="' . $find . '" />';
$htmlOutput .= '<input type="hidden" name="replaceWith"'
. ' value="' . $replaceWith . '" />';
$htmlOutput .= '<fieldset id="fieldset_find_replace_preview">';
$htmlOutput .= '<legend>' . __('Find and replace - preview') . '</legend>';
$htmlOutput .= '<table id="previewTable">'
. '<thead><tr>'
. '<th>' . __('Count') . '</th>'
. '<th>' . __('Original string') . '</th>'
. '<th>' . __('Replaced string') . '</th>'
. '</tr></thead>';
$htmlOutput .= '<tbody>';
$odd = true;
while ($row = $GLOBALS['dbi']->fetchRow($rs)) {
$val = $row[0];
$replaced = $row[1];
$count = $row[2];
$valMd5 = md5($val);
$htmlOutput .= '<tr class="' . ($odd ? 'odd' : 'even') . '">';
$htmlOutput .= '<td class="right">' . htmlspecialchars($count) . '</td>';
$htmlOutput .= '<td>' . htmlspecialchars($val) . '</td>';
$htmlOutput .= '<td>' . htmlspecialchars($replaced) . '</td>';
$htmlOutput .= '</tr>';
$odd = ! $odd;
}
$htmlOutput .= '</tbody>';
$htmlOutput .= '</table>';
$htmlOutput .= '</fieldset>';
$htmlOutput .= '<fieldset class="tblFooters">';
$htmlOutput .= '<input type="submit" name="replace"'
. ' value="' . __('Replace') . '" />';
$htmlOutput .= '</fieldset>';
$htmlOutput .= '</form>';
return $htmlOutput;
}
/**
* Replaces a given string in a column with a give replacement
*
* @param int $columnIndex index of the column
* @param string $find string to find in the column
* @param string $replaceWith string to replace with
* @param string $charSet character set of the connection
*
* @return void
*/
function replace($columnIndex, $find, $replaceWith, $charSet)
{
$column = $this->_columnNames[$columnIndex];
$sql_query = "UPDATE " . PMA_Util::backquote($this->_db)
. "." . PMA_Util::backquote($this->_table)
. " SET " . PMA_Util::backquote($column) . " ="
. " REPLACE("
. PMA_Util::backquote($column) . ", '" . $find . "', '" . $replaceWith
. "')"
. " WHERE " . PMA_Util::backquote($column)
. " LIKE '%" . $find . "%' COLLATE " . $charSet . "_bin"; // here we
// change the collation of the 2nd operand to a case sensitive
// binary collation to make sure that the comparison is case sensitive
$GLOBALS['dbi']->query(
$sql_query, null, PMA_DatabaseInterface::QUERY_STORE
);
$GLOBALS['sql_query'] = $sql_query;
}
}
?>

View File

@ -388,8 +388,6 @@ class PMA_Tracker
$tracking_set = self::$default_tracking_set;
}
include_once './libraries/export/sql.php';
$create_sql = "";
if (self::$add_drop_database == true) {

View File

@ -35,15 +35,8 @@
* Minimum PHP version; can't call PMA_fatalError() which uses a
* PHP 5 function, so cannot easily localize this message.
*/
if (version_compare(PHP_VERSION, '5.2.0', 'lt')) {
die('PHP 5.2+ is required');
}
/**
* Backward compatibility for PHP 5.2
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
if (version_compare(PHP_VERSION, '5.3.0', 'lt')) {
die('PHP 5.3+ is required');
}
/**
@ -57,17 +50,6 @@ require './libraries/Error_Handler.class.php';
$GLOBALS['error_handler'] = new PMA_Error_Handler();
$cfg['Error_Handler']['display'] = true;
/*
* This setting was removed in PHP 5.3. But at this point PMA_PHP_INT_VERSION
* is not yet defined so we use another way to find out the PHP version.
*/
if (version_compare(phpversion(), '5.3', 'lt')) {
/**
* Avoid object cloning errors
*/
@ini_set('zend.ze1_compatibility_mode', false);
}
/**
* This setting was removed in PHP 5.4. But at this point PMA_PHP_INT_VERSION
* is not yet defined so we use another way to find out the PHP version.

View File

@ -46,6 +46,11 @@ $GLOBALS['dummy_queries'] = array(
'Support' => 'NO',
'Comment' => 'dummy2 comment'
),
array(
'Engine' => 'FEDERATED',
'Support' => 'NO',
'Comment' => 'Federated MySQL storage engine'
),
)
),
array(
@ -280,6 +285,23 @@ $GLOBALS['dummy_queries'] = array(
'query' => "SHOW TABLES FROM `phpmyadmin`",
'result' => array(),
),
array(
'query' => "SELECT tracking_active FROM pma_table_tracking" .
" WHERE db_name = 'pma_test_db'" .
" AND table_name = 'pma_test_table'" .
" ORDER BY version DESC",
'columns' => array('tracking_active'),
'result' => array(
array(1)
)
),
array(
'query' => "SELECT tracking_active FROM pma_table_tracking" .
" WHERE db_name = 'pma_test_db'" .
" AND table_name = 'pma_test_table2'" .
" ORDER BY version DESC",
'result' => array()
)
);
/**
* Current database.

View File

@ -86,12 +86,11 @@ class PMA_DBI_Mysqli implements PMA_DBI_Extension
) {
global $cfg;
// mysqli persistent connections only on PHP 5.3+
if (PMA_PHP_INT_VERSION >= 50300) {
if ($cfg['PersistentConnections'] || $persistent) {
$host = 'p:' . $host;
}
// mysqli persistent connections
if ($cfg['PersistentConnections'] || $persistent) {
$host = 'p:' . $host;
}
if ($client_flags === null) {
return @mysqli_real_connect(
$link,
@ -691,10 +690,6 @@ class PMA_DBI_Mysqli implements PMA_DBI_Extension
*/
public function fieldFlags($result, $i)
{
// This is missing from PHP 5.2.5, see http://bugs.php.net/bug.php?id=44846
if (! defined('MYSQLI_ENUM_FLAG')) {
define('MYSQLI_ENUM_FLAG', 256); // see MySQL source include/mysql_com.h
}
$f = mysqli_fetch_field_direct($result, $i);
$type = $f->type;
$charsetnr = $f->charsetnr;
@ -758,4 +753,4 @@ class PMA_DBI_Mysqli implements PMA_DBI_Extension
return trim($flags);
}
}
?>
?>

View File

@ -168,7 +168,7 @@ if ($_SESSION[$SESSION_KEY]["handler"] != "UploadNoplugin") {
echo ' class="ajax"';
?>>
<input type="hidden" name="<?php
echo call_user_func($_SESSION[$SESSION_KEY]['handler'] . '::getIdKey');
echo $_SESSION[$SESSION_KEY]['handler']::getIdKey();
?>" value="<?php echo $upload_id ; ?>" />
<?php

View File

@ -123,10 +123,7 @@ function PMA_importAjaxStatus($id)
{
header('Content-type: application/json');
echo json_encode(
call_user_func(
$_SESSION[$GLOBALS['SESSION_KEY']]['handler'] . '::getUploadStatus',
$id
)
$_SESSION[$GLOBALS['SESSION_KEY']]['handler']::getUploadStatus($id)
);
}
?>

View File

@ -25,11 +25,7 @@ function PMA_getDirContent($dir, $expression = '')
$dir .= '/';
}
while ($file = @readdir($handle)) {
// for PHP < 5.2.4, is_file() gives a warning when using open_basedir
// and verifying '..' or '.'
if ('.' != $file
&& '..' != $file
&& is_file($dir . $file)
if (is_file($dir . $file)
&& ($expression == '' || preg_match($expression, $file))
) {
$result[] = $file;

View File

@ -253,7 +253,7 @@ function PMA_showColumnTypesInDataEditView($url_params, $showColumnType)
*
* @param array $column containing column type, Default and null
*
* @return nothing
* @return void
*/
function PMA_getDefaultForDatetime($column)
{

View File

@ -19,6 +19,7 @@ $GLOBALS['OpenDocumentNS']
. 'xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" '
. 'xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" '
. 'xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" '
. 'xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" '
. 'xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" ';
/**

View File

@ -76,6 +76,7 @@ $is_select = isset($analyzed_sql[0]['queryflags']['select_from']);
// aggregates all the results into one array
$analyzed_sql_results = array(
"parsed_sql" => $parsed_sql,
"analyzed_sql" => $analyzed_sql,
"reload" => $reload,
"drop_database" => $drop_database,

View File

@ -43,21 +43,12 @@ abstract class PluginObserver implements SplObserver
* This method is called when any PluginManager to which the observer
* is attached calls PluginManager::notify()
*
* TODO Declare this function abstract, removing its body,
* as soon as we drop support for PHP 5.2.x.
* See bug #3538655.
*
* @param SplSubject $subject The PluginManager notifying the observer
* of an update.
*
* @return void
*/
public function update (SplSubject $subject)
{
throw new Exception(
'PluginObserver::update must be overridden in child classes.'
);
}
public abstract function update (SplSubject $subject);
/* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */

View File

@ -40,25 +40,4 @@ class Application_Octetstream_Download extends DownloadTransformationsPlugin
return "OctetStream";
}
}
/**
* Function to call Application_Octetstream_Download::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Application_Octetstream_Download_getInfo()
{
return Application_Octetstream_Download::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Application_Octetstream_Hex extends HexTransformationsPlugin
return "OctetStream";
}
}
/**
* Function to call Application_Octetstream_Hex::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Application_Octetstream_Hex_getInfo()
{
return Application_Octetstream_Hex::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Image_JPEG_Inline extends InlineTransformationsPlugin
return "JPEG";
}
}
/**
* Function to call Image_JPEG_Inline::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Image_JPEG_Inline_getInfo()
{
return Image_JPEG_Inline::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Image_JPEG_Link extends ImageLinkTransformationsPlugin
return "JPEG";
}
}
/**
* Function to call Image_JPEG_Link::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Image_JPEG_Link_getInfo()
{
return Image_JPEG_Link::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Image_PNG_Inline extends InlineTransformationsPlugin
return "PNG";
}
}
/**
* Function to call Image_PNG_Inline::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Image_PNG_Inline_getInfo()
{
return Image_PNG_Inline::getInfo();
}
?>
?>

View File

@ -43,26 +43,4 @@ class [MIMEType]_[MIMESubtype]_[TransformationName]
return "[MIMESubtype]";
}
}
/**
* Function to call [MIMEType]_[MIMESubtype]_[TransformationName]::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function [MIMEType]_[MIMESubtype]_[TransformationName]_getInfo()
{
return [MIMEType]_[MIMESubtype]_[TransformationName]::getInfo();
}
?>

View File

@ -42,25 +42,4 @@ class Text_Plain_Append extends AppendTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Append::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Append_getInfo()
{
return Text_Plain_Append::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_Dateformat extends DateFormatTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Dateformat::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Dateformat_getInfo()
{
return Text_Plain_Dateformat::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_External extends ExternalTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_External::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_External_getInfo()
{
return Text_Plain_External::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_Formatted extends FormattedTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Formatted::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Formatted_getInfo()
{
return Text_Plain_Formatted::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_Imagelink extends TextImageLinkTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Imagelink::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Imagelink_getInfo()
{
return Text_Plain_Imagelink::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_Link extends TextLinkTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Link::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Link_getInfo()
{
return Text_Plain_Link::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_Longtoipv4 extends LongToIPv4TransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Longtoipv4::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Longtoipv4_getInfo()
{
return Text_Plain_Longtoipv4::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_Sql extends SQLTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Sql::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Sql_getInfo()
{
return Text_Plain_Sql::getInfo();
}
?>
?>

View File

@ -41,25 +41,4 @@ class Text_Plain_Substring extends SubstringTransformationsPlugin
return "Plain";
}
}
/**
* Function to call Text_Plain_Substring::getInfo();
*
* Temporary workaround for bug #3783 :
* Calling a method from a variable class is not possible before PHP 5.3.
*
* This function is called by PMA_getTransformationDescription()
* in libraries/transformations.lib.php using a variable to construct it's name.
* This function then calls the static method.
*
* Don't use this function unless you are affected by the same issue.
* Call the static method directly instead.
*
* @deprecated
* @return string Info about transformation class
*/
function Text_Plain_Substring_getInfo()
{
return Text_Plain_Substring::getInfo();
}
?>
?>

View File

@ -59,11 +59,9 @@ abstract class OptionsPropertyGroup extends OptionsPropertyItem
$this->_properties = array_udiff(
$this->getProperties(),
array($property),
// for PHP 5.2 compability
create_function(
'$a, $b',
'return ($a === $b ) ? 0 : 1'
)
function ($a, $b) {
return ($a === $b ) ? 0 : 1;
}
);
}

View File

@ -1113,23 +1113,13 @@ function PMA_getDefaultSqlQueryForBrowse($db, $table)
* Responds an error when an error happens when executing the query
*
* @param boolean $is_gotofile whether goto file or not
* @param String $goto goto page url
* @param String $table current table
* @param String $active_page active page url
* @param String $error error after executing the query
*
* @return void
*/
function PMA_handleQueryExecuteError($is_gotofile, $goto, $table, $active_page,
$error
) {
function PMA_handleQueryExecuteError($is_gotofile, $error) {
if ($is_gotofile) {
if (strpos($goto, 'db_') === 0 && strlen($table)) {
$table = '';
}
$active_page = $goto;
$message = PMA_Message::rawError($error);
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', $message);
@ -1144,7 +1134,7 @@ function PMA_handleQueryExecuteError($is_gotofile, $goto, $table, $active_page,
* @param String $bkm_user the bookmarking user
* @param String $import_text import text
* @param String $bkm_label bookmark label
* @param boolean $bkm_replace whether to rep;ace existing bookmarks
* @param boolean $bkm_replace whether to replace existing bookmarks
*
* @return void
*/
@ -1247,4 +1237,229 @@ function PMA_hasCurrentDbChanged($db)
return $reload;
}
/**
* If a table, database or column gets dropped, clean comments.
*
* @param String $db current database
* @param String $table current table
* @param String $dropped_column dropped column if any
* @param bool $purge
* @param array $extra_data
*
* @return array $extra_data
*/
function PMA_cleanupRelations($db, $table, $dropped_column, $purge, $extra_data)
{
include_once 'libraries/relation_cleanup.lib.php';
if (isset($purge) && $purge == 1) {
if (strlen($table) && strlen($db)) {
PMA_relationsCleanupTable($db, $table);
} elseif (strlen($db)) {
PMA_relationsCleanupDatabase($db);
}
}
if (isset($dropped_column)
&& !empty($dropped_column)
&& strlen($db)
&& strlen($table)
) {
PMA_relationsCleanupColumn($db, $table, $dropped_column);
if(isset($extra_data)) {
// to refresh the list of indexes (Ajax mode)
$extra_data['indexes_list'] = PMA_Index::getView($table, $db);
}
}
return $extra_data;
}
/**
* Function to count the total number of rows for the same 'SELECT' query without
* the 'LIMIT' clause that may have been programatically added
*
* @param int $num_rows number of rows affected/changed by the query
* @param bool $is_select whether the query is SELECT or not
* @param bool $justBrowsing whether just browsing or not
* @param string $db the current database
* @param string $table the current table
* @param array $parsed_sql parsed sql
* @param array $analyzed_sql_results the analyzed query and other varibles set
* after analyzing the query
*
* @return int $unlim_num_rows unlimited number of rows
*/
function PMA_countQueryResults($num_rows, $is_select, $justBrowsing,
$db, $table, $parsed_sql, $analyzed_sql_results
) {
if (!PMA_isAppendLimitClause($analyzed_sql_results))
{
// if we did not append a limit, set this to get a correct
// "Showing rows..." message
// $_SESSION['tmp_user_values']['max_rows'] = 'all';
$unlim_num_rows = $num_rows;
} elseif ($is_select) {
// c o u n t q u e r y
// If we are "just browsing", there is only one table,
// and no WHERE clause (or just 'WHERE 1 '),
// we do a quick count (which uses MaxExactCount) because
// SQL_CALC_FOUND_ROWS is not quick on large InnoDB tables
// However, do not count again if we did it previously
// due to $find_real_end == true
if ($justBrowsing) {
$unlim_num_rows = PMA_Table::countRecords(
$db,
$table,
$force_exact = true
);
} else {
// add select expression after the SQL_CALC_FOUND_ROWS
// for UNION, just adding SQL_CALC_FOUND_ROWS
// after the first SELECT works.
// take the left part, could be:
// SELECT
// (SELECT
$analyzed_sql = $analyzed_sql_results['analyzed_sql'];
$count_query = PMA_SQP_format(
$parsed_sql,
'query_only',
0,
$analyzed_sql[0]['position_of_first_select'] + 1
);
$count_query .= ' SQL_CALC_FOUND_ROWS ';
// add everything that was after the first SELECT
$count_query .= PMA_SQP_format(
$parsed_sql,
'query_only',
$analyzed_sql[0]['position_of_first_select'] + 1
);
// ensure there is no semicolon at the end of the
// count query because we'll probably add
// a LIMIT 1 clause after it
$count_query = rtrim($count_query);
$count_query = rtrim($count_query, ';');
// if using SQL_CALC_FOUND_ROWS, add a LIMIT to avoid
// long delays. Returned count will be complete anyway.
// (but a LIMIT would disrupt results in an UNION)
if (! isset($analyzed_sql[0]['queryflags']['union'])) {
$count_query .= ' LIMIT 1';
}
// run the count query
$GLOBALS['dbi']->tryQuery($count_query);
// if (mysql_error()) {
// void.
// I tried the case
// (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`)
// UNION (SELECT `User`, `Host`, "%" AS "Db",
// `Select_priv`
// FROM `user`) ORDER BY `User`, `Host`, `Db`;
// and although the generated count_query is wrong
// the SELECT FOUND_ROWS() work! (maybe it gets the
// count from the latest query that worked)
//
// another case where the count_query is wrong:
// SELECT COUNT(*), f1 from t1 group by f1
// and you click to sort on count(*)
// }
$unlim_num_rows = $GLOBALS['dbi']->fetchValue('SELECT FOUND_ROWS()');
} // end else "just browsing"
} else {// not $is_select
$unlim_num_rows = 0;
}
return $unlim_num_rows;
}
/**
* Function to handle all aspects relating to executing the query
*
* @param array $analyzed_sql_results
* @param String $full_sql_query full sql query
* @param boolean $is_gotofile whether to go to a file
* @param String $db current database
* @param String $table current table
* @param boolean $find_real_end whether to find the real end
* @param String $import_text sql command
* @param String $bkm_user bookmarking user
*
* @return mixed
*/
function PMA_executeTheQuery($analyzed_sql_results, $full_sql_query, $is_gotofile,
$db, $table, $find_real_end, $import_text, $bkm_user, $extra_data
) {
// Only if we ask to see the php code
if (isset($GLOBALS['show_as_php']) || ! empty($GLOBALS['validatequery'])) {
$result = null;
$num_rows = 0;
$unlim_num_rows = 0;
} else { // If we don't ask to see the php code
if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
$GLOBALS['dbi']->query('SET PROFILING=1;');
}
$result = PMA_executeQueryAndStoreResults($full_sql_query);
// Displays an error message if required and stop parsing the script
$error = $GLOBALS['dbi']->getError();
if ($error) {
PMA_handleQueryExecuteError($is_gotofile, $error);
}
// If there are no errors and bookmarklabel was given,
// store the query as a bookmark
if (! empty($_POST['bkm_label']) && ! empty($import_text)) {
PMA_storeTheQueryAsBookmark($db, $bkm_user,
$import_text, $_POST['bkm_label'],
isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null
);
} // end store bookmarks
// Gets the number of rows affected/returned
// (This must be done immediately after the query because
// mysql_affected_rows() reports about the last query done)
$num_rows = PMA_getNumberOfRowsAffectedOrChanged(
$analyzed_sql_results['is_affected'], $result,
isset($num_rows) ? $num_rows : null
);
// Grabs the profiling results
if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
$profiling_results = $GLOBALS['dbi']->fetchResult('SHOW PROFILE;');
}
$justBrowsing = PMA_isJustBrowsing(
$analyzed_sql_results,isset($find_real_end) ? $find_real_end : null
);
$unlim_num_rows = PMA_countQueryResults($num_rows,
$analyzed_sql_results['is_select'], $justBrowsing, $db,
$table, $analyzed_sql_results['parsed_sql'], $analyzed_sql_results
);
$extra_data = PMA_cleanupRelations(
isset($db) ? $db : '', isset($table) ? $table : '',
isset($_REQUEST['dropped_column']) ? $_REQUEST['dropped_column'] : null,
isset($_REQUEST['purge']) ? $_REQUEST['purge'] : null,
isset($extra_data) ? $extra_data : null
);
}
return array($result, $num_rows, $unlim_num_rows,
isset($profiling_results) ? $profiling_results : null,
isset($justBrowsing) ? $justBrowsing : null, $extra_data
);
}
?>

View File

@ -147,10 +147,7 @@ function PMA_getTransformationDescription($file, $html_formatted = true)
// include and instantiate the class
include_once 'libraries/plugins/transformations/' . $file;
/* Temporary workaround for bug #3783 :
Calling a method from a variable class is not possible before PHP 5.3. */
$functionGetInfo = $class_name . "_getInfo";
return $functionGetInfo();
return $class_name::getInfo();
}
/**
@ -279,7 +276,7 @@ function PMA_setMIME($db, $table, $key, $mimetype, $transformation,
WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($db) . '\'
AND `table_name` = \'' . PMA_Util::sqlAddSlashes($table) . '\'
AND `column_name` = \'' . PMA_Util::sqlAddSlashes($key) . '\'';
$test_rs = PMA_queryAsControlUser(
$test_qry, true, PMA_DatabaseInterface::QUERY_STORE
);
@ -391,24 +388,24 @@ function PMA_clearTransformations($db, $table = '', $column = '')
. PMA_Util::backquote($cfgRelation['db']) . '.'
. PMA_Util::backquote($cfgRelation['column_info'])
. ' WHERE ';
if (($column != '') && ($table != '')) {
$delete_sql .= '`db_name` = \'' . $db . '\' AND '
. '`table_name` = \'' . $table . '\' AND '
. '`column_name` = \'' . $column . '\' ';
} else if ($table != '') {
$delete_sql .= '`db_name` = \'' . $db . '\' AND '
. '`table_name` = \'' . $table . '\' ';
} else {
$delete_sql .= '`db_name` = \'' . $db . '\' ';
}
return $GLOBALS['dbi']->tryQuery($delete_sql);
}
?>

1988
po/af.po

File diff suppressed because it is too large Load Diff

2042
po/ar.po

File diff suppressed because it is too large Load Diff

1997
po/az.po

File diff suppressed because it is too large Load Diff

2294
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2049
po/bg.po

File diff suppressed because it is too large Load Diff

7057
po/bn.po

File diff suppressed because it is too large Load Diff

2016
po/br.po

File diff suppressed because it is too large Load Diff

2001
po/bs.po

File diff suppressed because it is too large Load Diff

2309
po/ca.po

File diff suppressed because it is too large Load Diff

1974
po/ckb.po

File diff suppressed because it is too large Load Diff

2253
po/cs.po

File diff suppressed because it is too large Load Diff

2028
po/cy.po

File diff suppressed because it is too large Load Diff

2303
po/da.po

File diff suppressed because it is too large Load Diff

2394
po/de.po

File diff suppressed because it is too large Load Diff

2400
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2404
po/es.po

File diff suppressed because it is too large Load Diff

2326
po/et.po

File diff suppressed because it is too large Load Diff

2015
po/eu.po

File diff suppressed because it is too large Load Diff

2075
po/fa.po

File diff suppressed because it is too large Load Diff

2412
po/fi.po

File diff suppressed because it is too large Load Diff

2333
po/fr.po

File diff suppressed because it is too large Load Diff

2363
po/gl.po

File diff suppressed because it is too large Load Diff

1999
po/he.po

File diff suppressed because it is too large Load Diff

2054
po/hi.po

File diff suppressed because it is too large Load Diff

2274
po/hr.po

File diff suppressed because it is too large Load Diff

4463
po/hu.po

File diff suppressed because it is too large Load Diff

1956
po/hy.po

File diff suppressed because it is too large Load Diff

1964
po/ia.po

File diff suppressed because it is too large Load Diff

2126
po/id.po

File diff suppressed because it is too large Load Diff

2350
po/it.po

File diff suppressed because it is too large Load Diff

2285
po/ja.po

File diff suppressed because it is too large Load Diff

2062
po/ka.po

File diff suppressed because it is too large Load Diff

1966
po/kk.po

File diff suppressed because it is too large Load Diff

1950
po/kn.po

File diff suppressed because it is too large Load Diff

2050
po/ko.po

File diff suppressed because it is too large Load Diff

2067
po/lt.po

File diff suppressed because it is too large Load Diff

2009
po/lv.po

File diff suppressed because it is too large Load Diff

2001
po/mk.po

File diff suppressed because it is too large Load Diff

1952
po/ml.po

File diff suppressed because it is too large Load Diff

2122
po/mn.po

File diff suppressed because it is too large Load Diff

1995
po/ms.po

File diff suppressed because it is too large Load Diff

2348
po/nb.po

File diff suppressed because it is too large Load Diff

2330
po/nl.po

File diff suppressed because it is too large Load Diff

1950
po/pa.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2322
po/pl.po

File diff suppressed because it is too large Load Diff

2082
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2123
po/ro.po

File diff suppressed because it is too large Load Diff

2333
po/ru.po

File diff suppressed because it is too large Load Diff

2038
po/si.po

File diff suppressed because it is too large Load Diff

2288
po/sk.po

File diff suppressed because it is too large Load Diff

2310
po/sl.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More