Adding @package, second part.

This commit is contained in:
Michal Čihař
2008-11-24 11:05:40 +00:00
parent 688c9986de
commit 56941e509c
97 changed files with 283 additions and 142 deletions

View File

@@ -4,9 +4,12 @@
* phpMyAdmin fatal error display page * phpMyAdmin fatal error display page
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/* Input sanitizing */ /**
* Input sanitizing.
*/
require_once './libraries/sanitizing.lib.php'; require_once './libraries/sanitizing.lib.php';
/* Get variables */ /* Get variables */

View File

@@ -3,6 +3,7 @@
/** /**
* @todo too much die here, or? * @todo too much die here, or?
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -362,7 +363,7 @@ if (!$save_on_server) {
} else { } else {
header('Pragma: no-cache'); header('Pragma: no-cache');
// test case: exporting a database into a .gz file with Safari // test case: exporting a database into a .gz file with Safari
// would produce files not having the current time // would produce files not having the current time
// (added this header for Safari but should not harm other browsers) // (added this header for Safari but should not harm other browsers)
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
} }

View File

@@ -5,6 +5,7 @@
* *
* @uses PMA_Bookmark_getList() * @uses PMA_Bookmark_getList()
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -26,6 +26,7 @@
* @uses time() * @uses time()
* @uses PMA_getenv() * @uses PMA_getenv()
* @uses header() to send charset * @uses header() to send charset
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -4,6 +4,7 @@
* Holds class PMA_Error * Holds class PMA_Error
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -14,6 +15,7 @@ require_once './libraries/Message.class.php';
/** /**
* a single error * a single error
* *
* @package phpMyAdmin
*/ */
class PMA_Error extends PMA_Message class PMA_Error extends PMA_Message
{ {

View File

@@ -4,6 +4,7 @@
* Holds class PMA_Error_Handler * Holds class PMA_Error_Handler
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -14,6 +15,7 @@ require_once './libraries/Error.class.php';
/** /**
* handling errors * handling errors
* *
* @package phpMyAdmin
*/ */
class PMA_Error_Handler class PMA_Error_Handler
{ {

View File

@@ -12,8 +12,8 @@
* @todo replace error messages with localized string * @todo replace error messages with localized string
* @todo when uploading a file into a blob field, should we also consider using * @todo when uploading a file into a blob field, should we also consider using
* chunks like in import? UPDATE `table` SET `field` = `field` + [chunk] * chunks like in import? UPDATE `table` SET `field` = `field` + [chunk]
* @package phpMyAdmin
*/ */
class PMA_File class PMA_File
{ {
/** /**

View File

@@ -10,6 +10,7 @@
/** /**
* @since phpMyAdmin 3.0.0 * @since phpMyAdmin 3.0.0
* *
* @package phpMyAdmin
*/ */
class PMA_Index class PMA_Index
{ {
@@ -582,6 +583,9 @@ class PMA_Index
} }
} }
/**
* @package phpMyAdmin
*/
class PMA_Index_Column class PMA_Index_Column
{ {
/** /**

View File

@@ -4,12 +4,14 @@
* hold the PMA_List base class * hold the PMA_List base class
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
* @todo add caching * @todo add caching
* @since phpMyAdmin 2.9.10 * @since phpMyAdmin 2.9.10
* @abstract * @abstract
* @package phpMyAdmin
*/ */
abstract class PMA_List extends ArrayObject abstract class PMA_List extends ArrayObject
{ {

View File

@@ -4,6 +4,7 @@
* holds the PMA_List_Database class * holds the PMA_List_Database class
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -23,6 +24,7 @@ require_once './libraries/List.class.php';
* @todo ? support --skip-showdatabases and user has only global rights * @todo ? support --skip-showdatabases and user has only global rights
* @access public * @access public
* @since phpMyAdmin 2.9.10 * @since phpMyAdmin 2.9.10
* @package phpMyAdmin
*/ */
/*public*/ class PMA_List_Database extends PMA_List /*public*/ class PMA_List_Database extends PMA_List
{ {
@@ -46,7 +48,7 @@ require_once './libraries/List.class.php';
* @access protected * @access protected
*/ */
protected $_show_databases_disabled = false; protected $_show_databases_disabled = false;
/** /**
* @var string command to retrieve databases from server * @var string command to retrieve databases from server
*/ */
@@ -111,11 +113,11 @@ require_once './libraries/List.class.php';
if ($this->_show_databases_disabled) { if ($this->_show_databases_disabled) {
return array(); return array();
} }
if (null !== $like_db_name) { if (null !== $like_db_name) {
$command = "SHOW DATABASES LIKE '" . $like_db_name . "'"; $command = "SHOW DATABASES LIKE '" . $like_db_name . "'";
} elseif (null === $this->_command) { } elseif (null === $this->_command) {
$command = str_replace('#user#', $GLOBALS['cfg']['Server']['user'], $command = str_replace('#user#', $GLOBALS['cfg']['Server']['user'],
$GLOBALS['cfg']['Server']['ShowDatabasesCommand']); $GLOBALS['cfg']['Server']['ShowDatabasesCommand']);
$this->_command = $command; $this->_command = $command;
} else { } else {
@@ -165,7 +167,7 @@ require_once './libraries/List.class.php';
} }
$this->exchangeArray($items); $this->exchangeArray($items);
} }
$this->_checkHideDatabase(); $this->_checkHideDatabase();
} }
@@ -197,7 +199,7 @@ require_once './libraries/List.class.php';
if (! is_array($GLOBALS['cfg']['Server']['only_db'])) { if (! is_array($GLOBALS['cfg']['Server']['only_db'])) {
return false; return false;
} }
$items = array(); $items = array();
foreach ($GLOBALS['cfg']['Server']['only_db'] as $each_only_db) { foreach ($GLOBALS['cfg']['Server']['only_db'] as $each_only_db) {
@@ -224,7 +226,7 @@ require_once './libraries/List.class.php';
// @todo induce error, about not using wildcards with SHOW DATABASE disabled? // @todo induce error, about not using wildcards with SHOW DATABASE disabled?
} }
$this->exchangeArray($items); $this->exchangeArray($items);
return true; return true;
@@ -313,7 +315,7 @@ require_once './libraries/List.class.php';
'disp_name' => $disp_name, 'disp_name' => $disp_name,
'comment' => $db_tooltip, 'comment' => $db_tooltip,
); );
if ($GLOBALS['cfg']['Server']['CountTables']) { if ($GLOBALS['cfg']['Server']['CountTables']) {
$dbgroups[$group][$db]['num_tables'] = PMA_getTableCount($db); $dbgroups[$group][$db]['num_tables'] = PMA_getTableCount($db);
} }
@@ -371,7 +373,7 @@ require_once './libraries/List.class.php';
} else { } else {
$return .= htmlspecialchars($db['disp_name']); $return .= htmlspecialchars($db['disp_name']);
} }
if (! empty($db['num_tables'])) { if (! empty($db['num_tables'])) {
$return .= ' (' . $db['num_tables'] . ')'; $return .= ' (' . $db['num_tables'] . ')';
} }

View File

@@ -4,6 +4,7 @@
* Holds class PMA_Message * Holds class PMA_Message
* *
* @version $Id: Error.class.php 10738 2007-10-08 16:02:58Z cybot_tm $ * @version $Id: Error.class.php 10738 2007-10-08 16:02:58Z cybot_tm $
* @package phpMyAdmin
*/ */
/** /**
@@ -47,6 +48,7 @@
* // strSomeLocaleMessage <sup>1</sup> strSomeMoreLocale<br /> * // strSomeLocaleMessage <sup>1</sup> strSomeMoreLocale<br />
* // strSomeEvenMoreLocale - some final words * // strSomeEvenMoreLocale - some final words
* </code> * </code>
* @package phpMyAdmin
*/ */
class PMA_Message class PMA_Message
{ {

View File

@@ -1,15 +1,21 @@
<?php <?php
/** /**
* Enter description here... * Enter description here...
* @package phpMyAdmin
* *
*/ */
/**
* Database listing.
*/
require_once './libraries/List_Database.class.php'; require_once './libraries/List_Database.class.php';
/** /**
* phpMyAdmin main Controller * phpMyAdmin main Controller
*
*
* *
*
*
* @package phpMyAdmin
*/ */
class PMA class PMA
{ {
@@ -19,21 +25,21 @@ class PMA
* @var PMA_List_Database * @var PMA_List_Database
*/ */
protected $databases = null; protected $databases = null;
/** /**
* DBMS user link * DBMS user link
* *
* @var resource * @var resource
*/ */
protected $userlink = null; protected $userlink = null;
/** /**
* DBMS control link * DBMS control link
* *
* @var resource * @var resource
*/ */
protected $controllink = null; protected $controllink = null;
/** /**
* magic access to protected/inaccessible members/properties * magic access to protected/inaccessible members/properties
* *
@@ -52,10 +58,10 @@ class PMA
return $this->controllink; return $this->controllink;
break; break;
} }
return null; return null;
} }
/** /**
* magic access to protected/inaccessible members/properties * magic access to protected/inaccessible members/properties
* *
@@ -72,7 +78,7 @@ class PMA
break; break;
} }
} }
/** /**
* Accessor to PMA::$databases * Accessor to PMA::$databases
* *
@@ -87,7 +93,7 @@ class PMA
if (null === $this->databases) { if (null === $this->databases) {
$this->databases = new PMA_List_Database($this->userlink, $this->controllink); $this->databases = new PMA_List_Database($this->userlink, $this->controllink);
} }
return $this->databases; return $this->databases;
} }
} }

View File

@@ -4,16 +4,18 @@
* Library for extracting information about the partitions * Library for extracting information about the partitions
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
* base Partition Class * base Partition Class
* @package phpMyAdmin
*/ */
class PMA_Partition class PMA_Partition
{ {
/** /**
* returns array of partition names for a specific db/table * returns array of partition names for a specific db/table
* *
* @access public * @access public
* @uses PMA_DBI_fetch_result() * @uses PMA_DBI_fetch_result()
@@ -29,14 +31,14 @@ class PMA_Partition
} }
/** /**
* checks if MySQL server supports partitioning * checks if MySQL server supports partitioning
* *
* @static * @static
* @staticvar boolean $have_partitioning * @staticvar boolean $have_partitioning
* @staticvar boolean $already_checked * @staticvar boolean $already_checked
* @access public * @access public
* @uses PMA_DBI_fetch_result() * @uses PMA_DBI_fetch_result()
* @return boolean * @return boolean
*/ */
static public function havePartitioning() static public function havePartitioning()
{ {

View File

@@ -4,6 +4,7 @@
* Library for extracting information about the available storage engines * Library for extracting information about the available storage engines
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -21,6 +22,7 @@ define('PMA_ENGINE_DETAILS_TYPE_BOOLEAN', 3); // 'ON' or 'OFF'
/** /**
* base Storage Engine Class * base Storage Engine Class
* @package phpMyAdmin
*/ */
class PMA_StorageEngine class PMA_StorageEngine
{ {

View File

@@ -3,16 +3,18 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
* @todo make use of PMA_Message and PMA_Error * @todo make use of PMA_Message and PMA_Error
* @package phpMyAdmin
*/ */
class PMA_Table class PMA_Table
{ {
static $cache = array(); static $cache = array();
/** /**
* @var string table name * @var string table name
*/ */
@@ -248,10 +250,10 @@ class PMA_Table
$comment = strtoupper(PMA_Table::sGetStatusInfo($db, $table, 'Comment')); $comment = strtoupper(PMA_Table::sGetStatusInfo($db, $table, 'Comment'));
return substr($comment, 0, 4) == 'VIEW'; return substr($comment, 0, 4) == 'VIEW';
} }
static public function sGetToolTip($db, $table) static public function sGetToolTip($db, $table)
{ {
return PMA_Table::sGetStatusInfo($db, $table, 'Comment') return PMA_Table::sGetStatusInfo($db, $table, 'Comment')
. ' (' . PMA_Table::countRecords($db, $table, true) . ')'; . ' (' . PMA_Table::countRecords($db, $table, true) . ')';
} }
@@ -260,11 +262,11 @@ class PMA_Table
if (! isset(PMA_Table::$cache[$db][$table]) || $force_read) { if (! isset(PMA_Table::$cache[$db][$table]) || $force_read) {
PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\''); PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\'');
} }
if (null === $info) { if (null === $info) {
return PMA_Table::$cache[$db][$table]; return PMA_Table::$cache[$db][$table];
} }
if (! isset(PMA_Table::$cache[$db][$table][$info]) || $force_read) { if (! isset(PMA_Table::$cache[$db][$table][$info]) || $force_read) {
PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\''); PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\'');
} }
@@ -327,7 +329,7 @@ class PMA_Table
$query .= ' NOT NULL'; $query .= ' NOT NULL';
} }
} }
switch ($default_type) { switch ($default_type) {
case 'USER_DEFINED' : case 'USER_DEFINED' :
if ($is_timestamp && $default_value === '0') { if ($is_timestamp && $default_value === '0') {
@@ -352,7 +354,7 @@ class PMA_Table
if (!empty($extra)) { if (!empty($extra)) {
$query .= ' ' . $extra; $query .= ' ' . $extra;
// Force an auto_increment field to be part of the primary key // Force an auto_increment field to be part of the primary key
// even if user did not tick the PK box; // even if user did not tick the PK box;
if ($extra == 'AUTO_INCREMENT') { if ($extra == 'AUTO_INCREMENT') {
$primary_cnt = count($field_primary); $primary_cnt = count($field_primary);
if (1 == $primary_cnt) { if (1 == $primary_cnt) {
@@ -401,25 +403,25 @@ class PMA_Table
* *
* @access public * @access public
*/ */
static public function countRecords($db, $table, $ret = false, static public function countRecords($db, $table, $ret = false,
$force_exact = false, $is_view = null) $force_exact = false, $is_view = null)
{ {
if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) { if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) {
$row_count = PMA_Table::$cache[$db][$table]['ExactRows']; $row_count = PMA_Table::$cache[$db][$table]['ExactRows'];
} else { } else {
$row_count = false; $row_count = false;
if (null === $is_view) { if (null === $is_view) {
$is_view = PMA_Table::isView($db, $table); $is_view = PMA_Table::isView($db, $table);
} }
if (! $force_exact) { if (! $force_exact) {
if (! isset(PMA_Table::$cache[$db][$table]['Rows']) && ! $is_view) { if (! isset(PMA_Table::$cache[$db][$table]['Rows']) && ! $is_view) {
PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table, true) . '\''); PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table, true) . '\'');
} }
$row_count = PMA_Table::$cache[$db][$table]['Rows']; $row_count = PMA_Table::$cache[$db][$table]['Rows'];
} }
// for a VIEW, $row_count is always false at this point // for a VIEW, $row_count is always false at this point
if (false === $row_count || $row_count < $GLOBALS['cfg']['MaxExactCount']) { if (false === $row_count || $row_count < $GLOBALS['cfg']['MaxExactCount']) {
if (! $is_view) { if (! $is_view) {
@@ -431,7 +433,7 @@ class PMA_Table
// count could bring down a server, so we offer an // count could bring down a server, so we offer an
// alternative: setting MaxExactCountViews to 0 will bypass // alternative: setting MaxExactCountViews to 0 will bypass
// completely the record counting for views // completely the record counting for views
if ($GLOBALS['cfg']['MaxExactCountViews'] == 0) { if ($GLOBALS['cfg']['MaxExactCountViews'] == 0) {
$row_count = 0; $row_count = 0;
} else { } else {

View File

@@ -2,6 +2,7 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* @version $Id$ * @version $Id$
* @package phpMyAdmin-DBG
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,13 +4,16 @@
* Displays form for password change * Displays form for password change
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
} }
// loic1: autocomplete feature of IE kills the "onchange" event handler and it /**
// must be replaced by the "onpropertychange" one in this case * loic1: autocomplete feature of IE kills the "onchange" event handler and it
* must be replaced by the "onpropertychange" one in this case
*/
$chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5) $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5)
? 'onpropertychange' ? 'onpropertychange'
: 'onchange'; : 'onchange';

View File

@@ -4,6 +4,7 @@
* Displays form for creating database (if user has privileges for that) * Displays form for creating database (if user has privileges for that)
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -23,6 +23,7 @@
* on MySQL 5.0.18. * on MySQL 5.0.18.
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,6 +4,7 @@
* Code for displaying language selection * Code for displaying language selection
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,6 +4,7 @@
* library for displaying table with results from all sort of select queries * library for displaying table with results from all sort of select queries
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -467,7 +468,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$unsorted_sql_query = $analyzed_sql[0]['unsorted_query']; $unsorted_sql_query = $analyzed_sql[0]['unsorted_query'];
} }
// Handles the case of multiple clicks on a column's header // Handles the case of multiple clicks on a column's header
// which would add many spaces before "ORDER BY" in the // which would add many spaces before "ORDER BY" in the
// generated query. // generated query.
$unsorted_sql_query = trim($unsorted_sql_query); $unsorted_sql_query = trim($unsorted_sql_query);
@@ -507,15 +508,15 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$asc_sort = '`' . implode('` ASC, `', array_keys($index->getColumns())) . '` ASC'; $asc_sort = '`' . implode('` ASC, `', array_keys($index->getColumns())) . '` ASC';
$desc_sort = '`' . implode('` DESC, `', array_keys($index->getColumns())) . '` DESC'; $desc_sort = '`' . implode('` DESC, `', array_keys($index->getColumns())) . '` DESC';
$used_index = $used_index || $local_order == $asc_sort || $local_order == $desc_sort; $used_index = $used_index || $local_order == $asc_sort || $local_order == $desc_sort;
echo '<option value="' echo '<option value="'
. htmlspecialchars($unsorted_sql_query . ' ORDER BY ' . $asc_sort) . htmlspecialchars($unsorted_sql_query . ' ORDER BY ' . $asc_sort)
. '"' . ($local_order == $asc_sort ? ' selected="selected"' : '') . '"' . ($local_order == $asc_sort ? ' selected="selected"' : '')
. '>' . htmlspecialchars($index->getName()) . ' (' . '>' . htmlspecialchars($index->getName()) . ' ('
. $GLOBALS['strAscending'] . ')</option>'; . $GLOBALS['strAscending'] . ')</option>';
echo '<option value="' echo '<option value="'
. htmlspecialchars($unsorted_sql_query . ' ORDER BY ' . $desc_sort) . htmlspecialchars($unsorted_sql_query . ' ORDER BY ' . $desc_sort)
. '"' . ($local_order == $desc_sort ? ' selected="selected"' : '') . '"' . ($local_order == $desc_sort ? ' selected="selected"' : '')
. '>' . htmlspecialchars($index->getName()) . ' (' . '>' . htmlspecialchars($index->getName()) . ' ('
. $GLOBALS['strDescending'] . ')</option>'; . $GLOBALS['strDescending'] . ')</option>';
} }
echo '<option value="' . htmlspecialchars($unsorted_sql_query) . '"' . ($used_index ? '' : ' selected="selected"') . '>' . $GLOBALS['strNone'] . '</option>'; echo '<option value="' . htmlspecialchars($unsorted_sql_query) . '"' . ($used_index ? '' : ' selected="selected"') . '>' . $GLOBALS['strNone'] . '</option>';
@@ -588,7 +589,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
echo '</form>'; echo '</form>';
} }
// Start of form for multi-rows edit/delete/export // Start of form for multi-rows edit/delete/export
if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp') { if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp') {
echo '<form method="post" action="tbl_row_action.php" name="rowsDeleteForm" id="rowsDeleteForm">' . "\n"; echo '<form method="post" action="tbl_row_action.php" name="rowsDeleteForm" id="rowsDeleteForm">' . "\n";
@@ -749,9 +750,9 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
if (isset($fields_meta[$i]->orgname)) { if (isset($fields_meta[$i]->orgname)) {
$name_to_use_in_sort = $fields_meta[$i]->orgname; $name_to_use_in_sort = $fields_meta[$i]->orgname;
} }
// $name_to_use_in_sort might contain a space due to // $name_to_use_in_sort might contain a space due to
// formatting of function expressions like "COUNT(name )" // formatting of function expressions like "COUNT(name )"
// so we remove the space in this situation // so we remove the space in this situation
$name_to_use_in_sort = str_replace(' )', ')', $name_to_use_in_sort); $name_to_use_in_sort = str_replace(' )', ')', $name_to_use_in_sort);
if (empty($sort_expression)) { if (empty($sort_expression)) {
@@ -1327,9 +1328,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$row[$i] = PMA_printable_bit_value($row[$i], $meta->length); $row[$i] = PMA_printable_bit_value($row[$i], $meta->length);
} elseif (stristr($field_flags, 'BINARY') && $meta->type == 'string') { } elseif (stristr($field_flags, 'BINARY') && $meta->type == 'string') {
if ($_SESSION['userconf']['display_binary'] || (isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse'])) { if ($_SESSION['userconf']['display_binary'] || (isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse'])) {
// user asked to see the real contents of BINARY // user asked to see the real contents of BINARY
// fields, or we detected a PROCEDURE ANALYSE in // fields, or we detected a PROCEDURE ANALYSE in
// the query (results are reported as being // the query (results are reported as being
// binary strings) // binary strings)
$row[$i] = PMA_replace_binary_contents($row[$i]); $row[$i] = PMA_replace_binary_contents($row[$i]);
} else { } else {
@@ -1681,7 +1682,7 @@ function PMA_displayTable_checkConfigParams()
// we know that the checkbox was unchecked // we know that the checkbox was unchecked
unset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']); unset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']);
} }
// move current query to the last position, to be removed last // move current query to the last position, to be removed last
// so only least executed query will be removed if maximum remembered queries // so only least executed query will be removed if maximum remembered queries
// limit is reached // limit is reached
@@ -1815,8 +1816,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
$sort_expression = $sort_expression_nodirection = $sort_direction = ''; $sort_expression = $sort_expression_nodirection = $sort_direction = '';
} }
// 1.4 Prepares display of first and last value of the sorted column // 1.4 Prepares display of first and last value of the sorted column
if (! empty($sort_expression_nodirection)) { if (! empty($sort_expression_nodirection)) {
list($sort_table, $sort_column) = explode('.', $sort_expression_nodirection); list($sort_table, $sort_column) = explode('.', $sort_expression_nodirection);
$sort_table = PMA_unQuote($sort_table); $sort_table = PMA_unQuote($sort_table);
@@ -1833,11 +1834,11 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
if ($sorted_column_index !== false) { if ($sorted_column_index !== false) {
// fetch first row of the result set // fetch first row of the result set
$row = PMA_DBI_fetch_row($dt_result); $row = PMA_DBI_fetch_row($dt_result);
$column_for_first_row = $row[$sorted_column_index]; $column_for_first_row = $row[$sorted_column_index];
// fetch last row of the result set // fetch last row of the result set
PMA_DBI_data_seek($dt_result, $num_rows - 1); PMA_DBI_data_seek($dt_result, $num_rows - 1);
$row = PMA_DBI_fetch_row($dt_result); $row = PMA_DBI_fetch_row($dt_result);
$column_for_last_row = $row[$sorted_column_index]; $column_for_last_row = $row[$sorted_column_index];
// reset to first row for the loop in PMA_displayTableBody() // reset to first row for the loop in PMA_displayTableBody()
PMA_DBI_data_seek($dt_result, 0); PMA_DBI_data_seek($dt_result, 0);
// we could also use here $sort_expression_nodirection // we could also use here $sort_expression_nodirection
@@ -1846,7 +1847,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
} }
unset($sorted_column_index, $sort_table, $sort_column); unset($sorted_column_index, $sort_table, $sort_column);
} }
// 2. ----- Displays the top of the page ----- // 2. ----- Displays the top of the page -----
// 2.1 Displays a messages with position informations // 2.1 Displays a messages with position informations
@@ -2109,7 +2110,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
// (the url_query has extra parameters that won't be used to export) // (the url_query has extra parameters that won't be used to export)
// (the single_table parameter is used in display_export.lib.php // (the single_table parameter is used in display_export.lib.php
// to hide the SQL and the structure export dialogs) // to hide the SQL and the structure export dialogs)
// If the parser found a PROCEDURE clause // If the parser found a PROCEDURE clause
// (most probably PROCEDURE ANALYSE()) it makes no sense to // (most probably PROCEDURE ANALYSE()) it makes no sense to
// display the Export link). // display the Export link).
if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT' && !isset($printview) && ! isset($analyzed_sql[0]['queryflags']['procedure'])) { if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT' && !isset($printview) && ! isset($analyzed_sql[0]['queryflags']['procedure'])) {
@@ -2151,10 +2152,10 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
} }
/** /**
* Verifies what to do with non-printable contents (binary or BLOB) * Verifies what to do with non-printable contents (binary or BLOB)
* in Browse mode. * in Browse mode.
* *
* @uses is_null() * @uses is_null()
* @uses isset() * @uses isset()
* @uses strlen() * @uses strlen()
* @uses PMA_formatByteDown() * @uses PMA_formatByteDown()
@@ -2162,10 +2163,10 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
* @uses str_replace() * @uses str_replace()
* @param string $category BLOB|BINARY * @param string $category BLOB|BINARY
* @param string $content the binary content * @param string $content the binary content
* @param string $transform_function * @param string $transform_function
* @param string $transform_options * @param string $transform_options
* @param string $default_function * @param string $default_function
* @param object $meta the meta-information about this field * @param object $meta the meta-information about this field
* @return mixed string or float * @return mixed string or float
*/ */
function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta) { function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta) {
@@ -2190,7 +2191,7 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
$result = $default_function($result, array(), $meta); $result = $default_function($result, array(), $meta);
if (stristr($meta->type, 'BLOB') && $_SESSION['userconf']['display_blob']) { if (stristr($meta->type, 'BLOB') && $_SESSION['userconf']['display_blob']) {
// in this case, restart from the original $content // in this case, restart from the original $content
$result = PMA_replace_binary_contents($content); $result = PMA_replace_binary_contents($content);
} }
} }
} }
@@ -2202,20 +2203,20 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
* taking into account foreign key description field and transformations * taking into account foreign key description field and transformations
* *
* @uses is_array() * @uses is_array()
* @uses PMA_backquote() * @uses PMA_backquote()
* @uses PMA_DBI_try_query() * @uses PMA_DBI_try_query()
* @uses PMA_DBI_num_rows() * @uses PMA_DBI_num_rows()
* @uses PMA_DBI_fetch_row() * @uses PMA_DBI_fetch_row()
* @uses $GLOBALS['strLinkNotFound'] * @uses $GLOBALS['strLinkNotFound']
* @uses PMA_DBI_free_result() * @uses PMA_DBI_free_result()
* @uses $GLOBALS['printview'] * @uses $GLOBALS['printview']
* @uses htmlspecialchars() * @uses htmlspecialchars()
* @uses PMA_generate_common_url() * @uses PMA_generate_common_url()
* @param string $mouse_events * @param string $mouse_events
* @param string $class * @param string $class
* @param string $condition_field * @param string $condition_field
* @param string $analyzed_sql * @param string $analyzed_sql
* @param object $meta the meta-information about this field * @param object $meta the meta-information about this field
* @param string $map * @param string $map
* @param string $data * @param string $data
* @param string $transform_function * @param string $transform_function
@@ -2240,17 +2241,17 @@ function PMA_prepare_row_data($mouse_events, $class, $condition_field, $analyzed
$meta->name = $true_column; $meta->name = $true_column;
} // end if } // end if
} // end if } // end if
} // end foreach } // end foreach
} // end if } // end if
if (isset($map[$meta->name])) { if (isset($map[$meta->name])) {
// Field to display from the foreign table? // Field to display from the foreign table?
if (isset($map[$meta->name][2]) && strlen($map[$meta->name][2])) { if (isset($map[$meta->name][2]) && strlen($map[$meta->name][2])) {
$dispsql = 'SELECT ' . PMA_backquote($map[$meta->name][2]) $dispsql = 'SELECT ' . PMA_backquote($map[$meta->name][2])
. ' FROM ' . PMA_backquote($map[$meta->name][3]) . ' FROM ' . PMA_backquote($map[$meta->name][3])
. '.' . PMA_backquote($map[$meta->name][0]) . '.' . PMA_backquote($map[$meta->name][0])
. ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' WHERE ' . PMA_backquote($map[$meta->name][1])
. $where_comparison; . $where_comparison;
$dispresult = PMA_DBI_try_query($dispsql, null, PMA_DBI_QUERY_STORE); $dispresult = PMA_DBI_try_query($dispsql, null, PMA_DBI_QUERY_STORE);
if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) { if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
list($dispval) = PMA_DBI_fetch_row($dispresult, 0); list($dispval) = PMA_DBI_fetch_row($dispresult, 0);
@@ -2285,15 +2286,15 @@ function PMA_prepare_row_data($mouse_events, $class, $condition_field, $analyzed
); );
$result .= '<a href="sql.php' . PMA_generate_common_url($_url_params) $result .= '<a href="sql.php' . PMA_generate_common_url($_url_params)
. '"' . $title . '>'; . '"' . $title . '>';
if ($transform_function != $default_function) { if ($transform_function != $default_function) {
// always apply a transformation on the real data, // always apply a transformation on the real data,
// not on the display field // not on the display field
$result .= $transform_function($data, $transform_options, $meta); $result .= $transform_function($data, $transform_options, $meta);
} else { } else {
if ('D' == $_SESSION['userconf']['relational_display']) { if ('D' == $_SESSION['userconf']['relational_display']) {
// user chose "relational display field" in the // user chose "relational display field" in the
// display options, so show display field in the cell // display options, so show display field in the cell
$result .= $transform_function($dispval, array(), $meta); $result .= $transform_function($dispval, array(), $meta);
} else { } else {
// otherwise display data in the cell // otherwise display data in the cell

View File

@@ -8,6 +8,7 @@
* - also changes made in js/functions.js * - also changes made in js/functions.js
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -36,8 +36,10 @@ if (isset($plugin_list)) {
define('PMA_PDF_FONT', 'DejaVuSans'); define('PMA_PDF_FONT', 'DejaVuSans');
require_once './libraries/tcpdf/tcpdf.php'; require_once './libraries/tcpdf/tcpdf.php';
// Adapted from a LGPL script by Philip Clarke /**
* Adapted from a LGPL script by Philip Clarke
* @package phpMyAdmin-Export-PDF
*/
class PMA_PDF extends TCPDF class PMA_PDF extends TCPDF
{ {
var $tablewidths; var $tablewidths;

View File

@@ -4,6 +4,7 @@
* Set of functions used to build XML dumps of tables * Set of functions used to build XML dumps of tables
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin-Export-XML
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -5,6 +5,7 @@
* *
* @todo rename to file_listing.lib.php * @todo rename to file_listing.lib.php
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -23,7 +24,7 @@ function PMA_getDirContent($dir, $expression = '')
} }
while ($file = @readdir($handle)) { while ($file = @readdir($handle)) {
// for PHP < 5.2.4, is_file() gives a warning when using open_basedir // for PHP < 5.2.4, is_file() gives a warning when using open_basedir
// and verifying '..' or '.' // and verifying '..' or '.'
if ('.' != $file && '..' != $file && is_file($dir . $file) && ($expression == '' || preg_match($expression, $file))) { if ('.' != $file && '..' != $file && is_file($dir . $file) && ($expression == '' || preg_match($expression, $file))) {
$result[] = $file; $result[] = $file;
} }

View File

@@ -42,6 +42,7 @@
* @uses basename() * @uses basename()
* @uses file_exists() * @uses file_exists()
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -2,11 +2,12 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* This library grabs the names and values of the variables sent or posted to a * This library grabs the names and values of the variables sent or posted to a
* script in $_GET, $_POST and $_FILES superglobals and sets simple globals * script in $_GET, $_POST and $_FILES superglobals and sets simple globals
* variables from them. It does the same work for $HTTP_ACCEPT_LANGUAGE and * variables from them. It does the same work for $HTTP_ACCEPT_LANGUAGE and
* $HTTP_AUTHORIZATION. * $HTTP_AUTHORIZATION.
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id: header.inc.php 10719 2007-10-04 15:03:44Z cybot_tm $ * @version $Id: header.inc.php 10719 2007-10-04 15:03:44Z cybot_tm $
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,6 +4,7 @@
* Library that provides common import functions that are used by import plugins * Library that provides common import functions that are used by import plugins
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -82,7 +83,7 @@ function PMA_detectCompression($filepath)
function PMA_importRunQuery($sql = '', $full = '', $controluser = false) function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
{ {
global $import_run_buffer, $go_sql, $complete_query, $display_query, global $import_run_buffer, $go_sql, $complete_query, $display_query,
$sql_query, $my_die, $error, $reload, $sql_query, $my_die, $error, $reload,
$skip_queries, $executed_queries, $max_sql_len, $read_multiply, $skip_queries, $executed_queries, $max_sql_len, $read_multiply,
$cfg, $sql_query_disabled, $db, $run_query, $is_superuser; $cfg, $sql_query_disabled, $db, $run_query, $is_superuser;
$read_multiply = 1; $read_multiply = 1;

View File

@@ -10,6 +10,9 @@ if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/**
* Load relations.
*/
require_once './libraries/relation.lib.php'; require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -5,6 +5,7 @@
* feature * feature
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */

View File

@@ -10,6 +10,7 @@
* 2002/2/22 - by Yukihiro Kawada <kawada@den.fujifilm.co.jp> * 2002/2/22 - by Yukihiro Kawada <kawada@den.fujifilm.co.jp>
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,6 +4,7 @@
* displays the pma logo, links and db and server selection in left frame * displays the pma logo, links and db and server selection in left frame
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -10,6 +10,7 @@
* Make some wrappers for the top and bottoms of our files. * Make some wrappers for the top and bottoms of our files.
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -4,13 +4,14 @@
* Simple interface for creating OASIS OpenDocument files. * Simple interface for creating OASIS OpenDocument files.
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
} }
/** /**
* * Load ZIP handler.
*/ */
require_once './libraries/zip.lib.php'; require_once './libraries/zip.lib.php';

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -4,6 +4,7 @@
* Generic plugin interface. * Generic plugin interface.
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -4,6 +4,7 @@
* Set of functions used with the relation and pdf feature * Set of functions used with the relation and pdf feature
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -44,7 +45,7 @@ function PMA_query_as_cu($sql, $show_error = true, $options = 0)
/** /**
* @uses $_SESSION['relation' . $GLOBALS['server']] for caching * @uses $_SESSION['relation' . $GLOBALS['server']] for caching
* @uses $GLOBALS['cfgRelation'] to set it * @uses $GLOBALS['cfgRelation'] to set it
* @uses $GLOBALS['server'] to ensure we are using server-specific pmadb * @uses $GLOBALS['server'] to ensure we are using server-specific pmadb
* @uses PMA__getRelationsParam() * @uses PMA__getRelationsParam()
* @uses PMA_printRelationsParamDiagnostic() * @uses PMA_printRelationsParamDiagnostic()
* @param bool $verbose whether to print diagnostic info * @param bool $verbose whether to print diagnostic info
@@ -391,7 +392,7 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both')
if (count($one_key['index_list']) == 1) { if (count($one_key['index_list']) == 1) {
foreach ($one_key['index_list'] as $i => $field) { foreach ($one_key['index_list'] as $i => $field) {
// If a foreign key is defined in the 'internal' source (pmadb) // If a foreign key is defined in the 'internal' source (pmadb)
// and as a native foreign key, we won't get it twice // and as a native foreign key, we won't get it twice
// if $source='both' because we use $field as key // if $source='both' because we use $field as key
// The parser looks for a CONSTRAINT clause just before // The parser looks for a CONSTRAINT clause just before
@@ -1096,7 +1097,7 @@ function PMA_getRelatives($from)
/** /**
* Rename a field in relation tables * Rename a field in relation tables
* *
* usually called after a field in a table was renamed in tbl_alter.php * usually called after a field in a table was renamed in tbl_alter.php
* *
* @uses PMA_getRelationsParam() * @uses PMA_getRelationsParam()
@@ -1111,7 +1112,7 @@ function PMA_getRelatives($from)
function PMA_REL_renameField($db, $table, $field, $new_name) function PMA_REL_renameField($db, $table, $field, $new_name)
{ {
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['displaywork']) { if ($cfgRelation['displaywork']) {
$table_query = 'UPDATE ' . PMA_backquote($cfgRelation['db']) . '.' . PMA_backquote($cfgRelation['table_info']) $table_query = 'UPDATE ' . PMA_backquote($cfgRelation['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
. ' SET display_field = \'' . PMA_sqlAddslashes($new_name) . '\'' . ' SET display_field = \'' . PMA_sqlAddslashes($new_name) . '\''
@@ -1140,7 +1141,7 @@ function PMA_REL_renameField($db, $table, $field, $new_name)
/** /**
* Create a PDF page * Create a PDF page
* *
* @uses $GLOBALS['strNoDescription'] * @uses $GLOBALS['strNoDescription']
* @uses PMA_backquote() * @uses PMA_backquote()
* @uses $GLOBALS['cfgRelation']['db'] * @uses $GLOBALS['cfgRelation']['db']
@@ -1152,7 +1153,7 @@ function PMA_REL_renameField($db, $table, $field, $new_name)
* @param array $cfgRelation * @param array $cfgRelation
* @param string $db * @param string $db
* @param string $query_default_option * @param string $query_default_option
* @return string $pdf_page_number * @return string $pdf_page_number
*/ */
function PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option) { function PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option) {
if (! isset($newpage) || $newpage == '') { if (! isset($newpage) || $newpage == '') {

View File

@@ -4,6 +4,7 @@
* Set of functions used for cleaning up phpMyAdmin tables * Set of functions used for cleaning up phpMyAdmin tables
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -28,7 +29,7 @@ require_once './libraries/relation.lib.php';
function PMA_relationsCleanupColumn($db, $table, $column) function PMA_relationsCleanupColumn($db, $table, $column)
{ {
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['commwork']) { if ($cfgRelation['commwork']) {
$remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['db']) . '.' . PMA_backquote($cfgRelation['column_info']) $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['db']) . '.' . PMA_backquote($cfgRelation['column_info'])
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''

View File

@@ -1,9 +1,10 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* This is in a separate script because it's called from a number of scripts
* *
* @version $Id$ * @version $Id$
* This is in a separate script because it's called from a number of scripts * @package phpMyAdmin
*/ */
/** /**

View File

@@ -4,6 +4,7 @@
* Code for displaying server selection written by nijel * Code for displaying server selection written by nijel
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -8,6 +8,7 @@
* @uses PMA_DBI_QUERY_STORE * @uses PMA_DBI_QUERY_STORE
* @uses $userlink * @uses $userlink
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -10,6 +10,7 @@
* @uses session_name() * @uses session_name()
* @uses session_start() * @uses session_start()
* @uses ini_set() * @uses ini_set()
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -20,7 +21,7 @@ if (! defined('PHPMYADMIN')) {
if (!@function_exists('session_name')) { if (!@function_exists('session_name')) {
PMA_fatalError('strCantLoad', 'session'); PMA_fatalError('strCantLoad', 'session');
} elseif (ini_get('session.auto_start') == true && session_name() != 'phpMyAdmin') { } elseif (ini_get('session.auto_start') == true && session_name() != 'phpMyAdmin') {
// Do not delete the existing session, it might be used by other // Do not delete the existing session, it might be used by other
// applications; instead just close it. // applications; instead just close it.
session_write_close(); session_write_close();
} }

View File

@@ -19,7 +19,8 @@
* It's easier to use only uppercase for proper sorting. In case of * It's easier to use only uppercase for proper sorting. In case of
* doubt, use the DEBUG code after this function's definition. * doubt, use the DEBUG code after this function's definition.
* *
* @version$Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -695,7 +696,7 @@ $PMA_SQPdata_reserved_word = array (
*/ */
$PMA_SQPdata_reserved_word_cnt = 288; $PMA_SQPdata_reserved_word_cnt = 288;
/** /**
* The previous array must be sorted so that the binary search work. * The previous array must be sorted so that the binary search work.
* Sometimes a word is not added in the correct order, so * Sometimes a word is not added in the correct order, so
* this debugging code shows the problem. The same should be * this debugging code shows the problem. The same should be
* done for all arrays. * done for all arrays.

View File

@@ -28,6 +28,7 @@
* href="syntax.css.php" />' at the moment.) * href="syntax.css.php" />' at the moment.)
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
@@ -1150,7 +1151,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
break; break;
} // end switch } // end switch
if ($subresult['querytype'] == 'SELECT' if ($subresult['querytype'] == 'SELECT'
&& ! $in_group_concat && ! $in_group_concat
&& ! ($seen_subquery && $arr[$i - 1]['type'] == 'punct_bracket_close_round')) { && ! ($seen_subquery && $arr[$i - 1]['type'] == 'punct_bracket_close_round')) {
if (!$seen_from) { if (!$seen_from) {
@@ -1705,7 +1706,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$limit_clause .= $sep; $limit_clause .= $sep;
} }
} }
if ($after_limit && $seen_limit) { if ($after_limit && $seen_limit) {
$section_after_limit .= $arr[$i]['data'] . $sep; $section_after_limit .= $arr[$i]['data'] . $sep;
} }

View File

@@ -1,32 +1,33 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* PHP interface to MimerSQL Validator * PHP interface to MimerSQL Validator
* *
* Copyright 2002, 2003 Robin Johnson <robbat2@users.sourceforge.net> * Copyright 2002, 2003 Robin Johnson <robbat2@users.sourceforge.net>
* http://www.orbis-terrarum.net/?l=people.robbat2 * http://www.orbis-terrarum.net/?l=people.robbat2
* *
* All data is transported over HTTP-SOAP * All data is transported over HTTP-SOAP
* And uses the PEAR SOAP Module * And uses the PEAR SOAP Module
* *
* Install instructions for PEAR SOAP * Install instructions for PEAR SOAP
* Make sure you have a really recent PHP with PEAR support * Make sure you have a really recent PHP with PEAR support
* run this: "pear install Mail_Mime Net_DIME SOAP" * run this: "pear install Mail_Mime Net_DIME SOAP"
* *
* If you got this file from somewhere other than phpMyAdmin * If you got this file from somewhere other than phpMyAdmin
* please be aware that the latest copy will always be in the * please be aware that the latest copy will always be in the
* phpMyAdmin subversion tree as * phpMyAdmin subversion tree as
* $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/libraries/sqlvalidator.class.php $ * $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/libraries/sqlvalidator.class.php $
* *
* This code that also used to depend on the PHP overload module, but that has been * This code that also used to depend on the PHP overload module, but that has been
* removed now. * removed now.
* *
* @access public * @access public
* *
* @author Robin Johnson <robbat2@users.sourceforge.net> * @author Robin Johnson <robbat2@users.sourceforge.net>
* *
* @version $Id$ * @version $Id$
*/ * @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;
} }

View File

@@ -28,6 +28,7 @@
* Also set a username and password if you have a private one * Also set a username and password if you have a private one
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -19,6 +19,7 @@
* @uses mb_internal_encoding() * @uses mb_internal_encoding()
* @uses defined() * @uses defined()
* @todo a .lib filename should not have code in main(), split or rename file * @todo a .lib filename should not have code in main(), split or rename file
* @package phpMyAdmin
*/ */
if (! defined('PHPMYADMIN')) { if (! defined('PHPMYADMIN')) {
exit; exit;

View File

@@ -20,6 +20,7 @@
* Please provide a comment for your function, what it does and what parameters are available. * Please provide a comment for your function, what it does and what parameters are available.
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin-Transformation
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -23,6 +24,7 @@
* Official ZIP file format: http://www.pkware.com/appnote.txt * Official ZIP file format: http://www.pkware.com/appnote.txt
* *
* @access public * @access public
* @package phpMyAdmin
*/ */
class zipfile class zipfile
{ {

View File

@@ -7,6 +7,7 @@
* that would read any file using a GET parameter, it would open a hole * that would read any file using a GET parameter, it would open a hole
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**
@@ -74,7 +75,7 @@ if ($cfgRelation['pdfwork']) {
} }
break; break;
case 'createpage': case 'createpage':
$pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option); $pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option);
// A u t o m a t i c l a y o u t // A u t o m a t i c l a y o u t
// ================================ // ================================
@@ -85,10 +86,10 @@ if ($cfgRelation['pdfwork']) {
if (isset($auto_layout_foreign)) { if (isset($auto_layout_foreign)) {
// get the tables list // get the tables list
$tables = PMA_DBI_get_tables_full($db); $tables = PMA_DBI_get_tables_full($db);
// find the ones who support FOREIGN KEY; it's not // find the ones who support FOREIGN KEY; it's not
// important that we group together InnoDB tables // important that we group together InnoDB tables
// and PBXT tables, as this logic is just to put // and PBXT tables, as this logic is just to put
// the tables on the layout, not to determine relations // the tables on the layout, not to determine relations
$foreignkey_tables = array(); $foreignkey_tables = array();
foreach($tables as $table_name => $table_properties) { foreach($tables as $table_name => $table_properties) {
if (PMA_foreignkey_supported($table_properties['ENGINE'])) { if (PMA_foreignkey_supported($table_properties['ENGINE'])) {

View File

@@ -48,6 +48,7 @@ require_once './libraries/tcpdf/tcpdf.php';
* *
* @access public * @access public
* @see FPDF * @see FPDF
* @package phpMyAdmin
*/ */
class PMA_PDF extends TCPDF { class PMA_PDF extends TCPDF {
/** /**
@@ -496,6 +497,7 @@ class PMA_PDF extends TCPDF {
* *
* @access private * @access private
* @see PMA_RT * @see PMA_RT
* @package phpMyAdmin
*/ */
class PMA_RT_Table { class PMA_RT_Table {
/** /**
@@ -680,6 +682,7 @@ class PMA_RT_Table {
* *
* @access private * @access private
* @see PMA_RT * @see PMA_RT
* @package phpMyAdmin
*/ */
class PMA_RT_Relation { class PMA_RT_Relation {
/** /**
@@ -806,6 +809,7 @@ class PMA_RT_Relation {
* *
* @access public * @access public
* @see PMA_PDF * @see PMA_PDF
* @package phpMyAdmin
*/ */
class PMA_RT { class PMA_RT {
/** /**

View File

@@ -1,8 +1,9 @@
<?php <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */ /* vim: set expandtab sw=4 ts=4 sts=4: */
/** /**
* * phpinfo() wrapper to allow displaying only when configured to do so.
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -39,6 +39,7 @@
* @uses preg_replace() * @uses preg_replace()
* @uses htmlspecialchars() * @uses htmlspecialchars()
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -7,6 +7,7 @@
* that would read any file using a GET parameter, it would open a hole * that would read any file using a GET parameter, it would open a hole
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -36,6 +36,7 @@
* @uses implode() * @uses implode()
* @uses htmlspecialchars() * @uses htmlspecialchars()
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -5,6 +5,7 @@
* *
* @version $Id$ * @version $Id$
* @todo falcon storage enginge is not listed under dev.mysql.com/doc/refman but dev.mysql.com/doc/falcon/ * @todo falcon storage enginge is not listed under dev.mysql.com/doc/refman but dev.mysql.com/doc/falcon/
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -5,6 +5,7 @@
* + reset status variables * + reset status variables
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
/** /**
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -23,6 +23,7 @@ require_once './libraries/js_escape.lib.php';
/** /**
* Form management class, displays and processes forms * Form management class, displays and processes forms
* @package phpMyAdmin-setup
*/ */
class FormDisplay class FormDisplay
{ {

View File

@@ -4,14 +4,15 @@
* Simple wrapper just to enable error reporting and include config * Simple wrapper just to enable error reporting and include config
* *
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/**
*
*/
echo "Starting to parse config file...\n"; echo "Starting to parse config file...\n";
error_reporting(E_ALL); error_reporting(E_ALL);
/**
* Read config file.
*/
require './config.inc.php'; require './config.inc.php';
?> ?>

View File

@@ -4,6 +4,7 @@
* @todo we must handle the case if sql.php is called directly with a query * @todo we must handle the case if sql.php is called directly with a query
* what returns 0 rows - to prevent cyclic redirects or includes * what returns 0 rows - to prevent cyclic redirects or includes
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -12,6 +12,9 @@
*/ */
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Framework.php';
/**
* @package phpMyAdmin-test
*/
class Environment_test extends PHPUnit_Framework_TestCase class Environment_test extends PHPUnit_Framework_TestCase
{ {
public function testPhpVersion() public function testPhpVersion()

View File

@@ -12,6 +12,9 @@
*/ */
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Framework.php';
/**
* @package phpMyAdmin-test
*/
class FailTest extends PHPUnit_Framework_TestCase class FailTest extends PHPUnit_Framework_TestCase
{ {
public function testFail() public function testFail()

View File

@@ -32,6 +32,9 @@ $GLOBALS['charset'] = 'UTF-8';
require_once './libraries/string.lib.php'; require_once './libraries/string.lib.php';
/**
* @package phpMyAdmin-test
*/
class PMA_STR_sub_test extends PHPUnit_Framework_TestCase class PMA_STR_sub_test extends PHPUnit_Framework_TestCase
{ {
public function testMultiByte() public function testMultiByte()

View File

@@ -20,6 +20,7 @@ require_once './libraries/blowfish.php';
/** /**
* Test java script escaping. * Test java script escaping.
* *
* @package phpMyAdmin-test
*/ */
class PMA_blowfish_test extends PHPUnit_Framework_TestCase class PMA_blowfish_test extends PHPUnit_Framework_TestCase
{ {
@@ -27,7 +28,7 @@ class PMA_blowfish_test extends PHPUnit_Framework_TestCase
{ {
$secret = '$%ÄüfuDFRR'; $secret = '$%ÄüfuDFRR';
$string = '12345678'; $string = '12345678';
$this->assertEquals($string, $this->assertEquals($string,
PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret)); PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret));
} }
@@ -35,7 +36,7 @@ class PMA_blowfish_test extends PHPUnit_Framework_TestCase
{ {
$secret = '$%ÄüfuDFRR'; $secret = '$%ÄüfuDFRR';
$string = 'abcDEF012!"§$%&/()=?`´"\',.;:-_#+*~öäüÖÄÜ^°²³'; $string = 'abcDEF012!"§$%&/()=?`´"\',.;:-_#+*~öäüÖÄÜ^°²³';
$this->assertEquals($string, $this->assertEquals($string,
PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret)); PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret));
} }

View File

@@ -21,6 +21,7 @@ require_once './libraries/js_escape.lib.php';
/** /**
* Test java script escaping. * Test java script escaping.
* *
* @package phpMyAdmin-test
*/ */
class PMA_escapeJsString_test extends PHPUnit_Framework_TestCase class PMA_escapeJsString_test extends PHPUnit_Framework_TestCase
{ {

View File

@@ -21,12 +21,13 @@ require_once './libraries/common.lib.php';
/** /**
* Test MySQL escaping. * Test MySQL escaping.
* *
* @package phpMyAdmin-test
*/ */
class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
{ {
/** /**
* PMA_escape_mysql_wildcards tests * PMA_escape_mysql_wildcards tests
*/ */
public function testEscape_1() public function testEscape_1()
@@ -54,8 +55,8 @@ class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
$this->assertEquals('\\\_\\\%', PMA_escape_mysql_wildcards('\_\%')); $this->assertEquals('\\\_\\\%', PMA_escape_mysql_wildcards('\_\%'));
} }
/** /**
* PMA_unescape_mysql_wildcards tests * PMA_unescape_mysql_wildcards tests
*/ */
public function testUnEscape_1() public function testUnEscape_1()
@@ -77,7 +78,7 @@ class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
{ {
$this->assertEquals('%_', PMA_unescape_mysql_wildcards('%\_')); $this->assertEquals('%_', PMA_unescape_mysql_wildcards('%\_'));
} }
public function testUnEscape_5() public function testUnEscape_5()
{ {
$this->assertEquals('\%\_', PMA_unescape_mysql_wildcards('\\\%\\\_')); $this->assertEquals('\%\_', PMA_unescape_mysql_wildcards('\\\%\\\_'));

View File

@@ -14,6 +14,9 @@ require_once 'PHPUnit/Framework.php';
require_once './libraries/core.lib.php'; require_once './libraries/core.lib.php';
require_once './libraries/url_generating.lib.php'; require_once './libraries/url_generating.lib.php';
/**
* @package phpMyAdmin-test
*/
class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase
{ {
public function setUp() public function setUp()

View File

@@ -13,6 +13,9 @@
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Framework.php';
require_once './libraries/core.lib.php'; require_once './libraries/core.lib.php';
/**
* @package phpMyAdmin-test
*/
class PMA_get_real_size_test extends PHPUnit_Framework_TestCase class PMA_get_real_size_test extends PHPUnit_Framework_TestCase
{ {
public function testNull() public function testNull()

View File

@@ -13,6 +13,9 @@
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Framework.php';
require_once './libraries/core.lib.php'; require_once './libraries/core.lib.php';
/**
* @package phpMyAdmin-test
*/
class PMA_isValid_test extends PHPUnit_Framework_TestCase class PMA_isValid_test extends PHPUnit_Framework_TestCase
{ {
public function testVarNotSetAfterTest() public function testVarNotSetAfterTest()

View File

@@ -13,6 +13,9 @@
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Framework.php';
require_once './libraries/common.lib.php'; require_once './libraries/common.lib.php';
/**
* @package phpMyAdmin-test
*/
class PMA_pow_test extends PHPUnit_Framework_TestCase class PMA_pow_test extends PHPUnit_Framework_TestCase
{ {
public function testIntOverflow() public function testIntOverflow()

View File

@@ -13,6 +13,9 @@
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Framework.php';
require_once './libraries/sanitizing.lib.php'; require_once './libraries/sanitizing.lib.php';
/**
* @package phpMyAdmin-test
*/
class PMA_sanitize_test extends PHPUnit_Framework_TestCase class PMA_sanitize_test extends PHPUnit_Framework_TestCase
{ {
public function testXssInHref() public function testXssInHref()

View File

@@ -13,6 +13,9 @@
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Framework.php';
require_once './libraries/transformations.lib.php'; require_once './libraries/transformations.lib.php';
/**
* @package phpMyAdmin-test
*/
class PMA_transformation_getOptions_test extends PHPUnit_Framework_TestCase class PMA_transformation_getOptions_test extends PHPUnit_Framework_TestCase
{ {
public function testDefault() public function testDefault()

View File

@@ -6,6 +6,7 @@
* @todo js error when view name is empty (strFormEmpty) * @todo js error when view name is empty (strFormEmpty)
* @todo (also validate if js is disabled, after form submission?) * @todo (also validate if js is disabled, after form submission?)
* @version $Id$ * @version $Id$
* @package phpMyAdmin
*/ */
/** /**

View File

@@ -3,6 +3,7 @@
* generate an WebApp file for Prism / WebRunner * generate an WebApp file for Prism / WebRunner
* *
* @see http://wiki.mozilla.org/Prism * @see http://wiki.mozilla.org/Prism
* @package phpMyAdmin
*/ */
/** /**