Fix some phpdoc errors.

This commit is contained in:
Michal Čihař
2008-11-24 09:55:30 +00:00
parent 610cc27c57
commit 9561f56875
19 changed files with 182 additions and 140 deletions

View File

@@ -5,6 +5,10 @@
* @version 1.0
* @package BLOBStreaming
*/
/**
* Core library.
*/
require_once './libraries/common.inc.php';
/**
@@ -49,7 +53,7 @@
$query .= " WHERE Blob_url='" . PMA_sqlAddslashes($bsReference) . "'";
$result = PMA_DBI_query($query);
// if record exists
if ($data = PMA_DBI_fetch_assoc($result))
{

View File

@@ -5,6 +5,10 @@
* @version 1.0
* @package BLOBStreaming
*/
/**
* Core library.
*/
require_once './libraries/common.inc.php';
/*
@@ -13,7 +17,7 @@
$mediaType = isset($_REQUEST['media_type']) ? $_REQUEST['media_type'] : NULL;
/*
* @var string indicates whether media type is of custom type
* @var string indicates whether media type is of custom type
*/
$customType = isset($_REQUEST['custom_type']) ? $_REQUEST['custom_type'] : false;

View File

@@ -4,6 +4,7 @@
* file upload functions
*
* @version $Id$
* @package phpMyAdmin
*/
/**
@@ -155,7 +156,6 @@ class PMA_File
* @access public
* @uses PMA_File::$_name
* @param string $name file name
* @access public
*/
function setName($name)
{
@@ -1231,7 +1231,7 @@ class PMA_File
/**
* sets reference to most recent BLOB repository reference
*
* @access static public
* @access public
* @param string - BLOB repository reference
*/
static function setRecentBLOBReference($ref)
@@ -1242,7 +1242,7 @@ class PMA_File
/**
* retrieves reference to most recent BLOB repository reference
*
* @access static public
* @access public
* @return string - most recent BLOB repository reference
*/
static function getRecentBLOBReference()

View File

@@ -4,11 +4,12 @@
* holds the datasbe index class
*
* @version $Id$
* @package phpMyAdmin
*/
/**
* @since phpMyAdmin 3.0.0
*
*
*/
class PMA_Index
{
@@ -18,29 +19,29 @@ class PMA_Index
* @var array
*/
protected static $_registry = array();
/**
* @var string The name of the schema
*/
protected $_schema = '';
/**
* @var string The name of the table
*/
protected $_table = '';
/**
* @var string The name of the index
*/
protected $_name = '';
/**
* Columns in index
*
* @var array
*/
protected $_columns = array();
/**
* The index method used (BTREE, FULLTEXT, HASH, RTREE).
*
@@ -54,34 +55,34 @@ class PMA_Index
* @var string
*/
protected $_choice = '';
/**
* Various remarks.
*
* @var string
*/
protected $_remarks = '';
/**
* Any comment provided for the index with a COMMENT attribute when the
* Any comment provided for the index with a COMMENT attribute when the
* index was created.
*
* @var string
*/
protected $_comment = '';
/**
* @var integer 0 if the index cannot contain duplicates, 1 if it can.
* @var integer 0 if the index cannot contain duplicates, 1 if it can.
*/
protected $_non_unique = 0;
/**
* Indicates how the key is packed. NULL if it is not.
*
* @var string
*/
protected $_packed = null;
/**
* Constructor
*
@@ -92,7 +93,7 @@ class PMA_Index
{
$this->set($params);
}
static public function singleton($schema, $table, $index_name = '')
{
PMA_Index::_loadIndexes($table, $schema);
@@ -107,7 +108,7 @@ class PMA_Index
return PMA_Index::$_registry[$schema][$table][$index_name];
}
}
/**
* returns an array with all indexes from the given table
*
@@ -120,14 +121,14 @@ class PMA_Index
static public function getFromTable($table, $schema)
{
PMA_Index::_loadIndexes($table, $schema);
if (isset(PMA_Index::$_registry[$schema][$table])) {
return PMA_Index::$_registry[$schema][$table];
} else {
return array();
}
}
/**
* return primary if set, false otherwise
*
@@ -140,14 +141,14 @@ class PMA_Index
static public function getPrimary($table, $schema)
{
PMA_Index::_loadIndexes($table, $schema);
if (isset(PMA_Index::$_registry[$schema][$table]['PRIMARY'])) {
return PMA_Index::$_registry[$schema][$table]['PRIMARY'];
} else {
return false;
}
}
/**
* Load index data for table
*
@@ -165,7 +166,7 @@ class PMA_Index
if (isset(PMA_Index::$_registry[$schema][$table])) {
return true;
}
$_raw_indexes = PMA_DBI_fetch_result('SHOW INDEX FROM ' . PMA_backquote($schema) . '.' . PMA_backquote($table));
foreach ($_raw_indexes as $_each_index) {
$_each_index['Schema'] = $schema;
@@ -175,13 +176,13 @@ class PMA_Index
} else {
$key = PMA_Index::$_registry[$schema][$table][$_each_index['Key_name']];
}
$key->addColumn($_each_index);
}
return true;
}
/**
* Add column to index
*
@@ -195,11 +196,11 @@ class PMA_Index
$this->_columns[$params['Column_name']] = new PMA_Index_Column($params);
}
}
public function addColumns($columns)
{
$_columns = array();
if (isset($columns['names'])) {
// coming from form
// $columns[names][]
@@ -217,12 +218,12 @@ class PMA_Index
// ...
$_columns = $columns;
}
foreach ($_columns as $column) {
$this->addColumn($column);
}
}
/**
* Returns true if $column indexed in this index
*
@@ -234,7 +235,7 @@ class PMA_Index
{
return isset($this->_columns[$column]);
}
public function set($params)
{
if (isset($params['columns'])) {
@@ -274,22 +275,22 @@ class PMA_Index
$this->_choice = 'INDEX';
}
}
public function getColumnCount()
{
return count($this->_columns);
}
public function getComment()
{
return $this->_comment;
}
public function getRemarks()
{
return $this->_remarks;
}
public function getComments()
{
$comments = $this->getRemarks();
@@ -297,19 +298,19 @@ class PMA_Index
$comments .= "\n";
}
$comments .= $this->getComment();
return $comments;
}
public function getType()
{
return $this->_type;
}
/**
* Return a list of all index choices
* Return a list of all index choices
*
* @return array index choices
* @return array index choices
*/
static public function getIndexChoices()
{
@@ -318,13 +319,13 @@ class PMA_Index
'INDEX',
'UNIQUE',
'FULLTEXT',
);
);
}
public function generateIndexSelector()
{
$html_options = '';
foreach (PMA_Index::getIndexChoices() as $each_index_choice) {
if ($each_index_choice === 'PRIMARY'
&& $this->_choice !== 'PRIMARY'
@@ -336,15 +337,15 @@ class PMA_Index
. (($this->_choice == $each_index_choice) ? ' selected="selected"' : '')
. '>'. $each_index_choice . '</option>' . "\n";
}
return $html_options;
}
public function getPacked()
{
return $this->_packed;
}
public function isPacked($as_text = false)
{
if ($as_text) {
@@ -358,19 +359,19 @@ class PMA_Index
'1' => true,
);
}
if (null === $this->_packed) {
return $r[0];
}
return $this->_packed;
}
public function getNonUnique()
{
return $this->_non_unique;
}
public function isUnique($as_text = false)
{
if ($as_text) {
@@ -384,25 +385,25 @@ class PMA_Index
'1' => false,
);
}
return $r[$this->_non_unique];
}
public function getName()
{
return $this->_name;
}
public function setName($name)
{
$this->_name = (string) $name;
}
public function getColumns()
{
return $this->_columns;
}
/**
* Show index data
*
@@ -421,10 +422,10 @@ class PMA_Index
if (count($indexes) < 1) {
return PMA_Message::warning('strNoIndex')->getDisplay();
}
$r = '';
$r .= '<h2>' . $GLOBALS['strIndexes'] . ': ';
$r .= '<h2>' . $GLOBALS['strIndexes'] . ': ';
$r .= PMA_showMySQLDocu('optimization', 'optimizing-database-structure');
$r .= '</h2>';
$r .= '<table>';
@@ -445,13 +446,13 @@ class PMA_Index
$r .= '</tr>';
$r .= '</thead>';
$r .= '<tbody>';
$odd_row = true;
foreach ($indexes as $index) {
$row_span = ' rowspan="' . $index->getColumnCount() . '" ';
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
if (! $print_mode) {
$this_params = $GLOBALS['url_params'];
$this_params['index'] = $index->getName();
@@ -459,7 +460,7 @@ class PMA_Index
. ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
. '">' . PMA_getIcon('b_edit.png', $GLOBALS['strEdit']) . '</a>'
. '</td>' . "\n";
$this_params = $GLOBALS['url_params'];
if ($index->getName() == 'PRIMARY') {
$this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY';
@@ -470,19 +471,19 @@ class PMA_Index
$this_params['zero_rows'] = sprintf($GLOBALS['strIndexHasBeenDropped'], $index->getName());
$js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName());
}
$r .= '<td ' . $row_span . '>'
. ' <a href="sql.php' . PMA_generate_common_url($this_params)
. '" onclick="return confirmLink(this, \'' . $js_msg . '\')">'
. '" onclick="return confirmLink(this, \'' . $js_msg . '\')">'
. PMA_getIcon('b_drop.png', $GLOBALS['strDrop']) . '</a>'
. '</td>' . "\n";
}
$r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
$r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
$r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
$r .= '<td ' . $row_span . '>' . $index->isPacked(true) . '</td>';
foreach ($index->getColumns() as $column) {
if ($column->getSeqInIndex() > 1) {
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
@@ -497,24 +498,24 @@ class PMA_Index
$r .= '<td>' . htmlspecialchars($column->getNull()) . '</td>';
if ($column->getSeqInIndex() == 1) {
$r .= '<td ' . $row_span . '>'
$r .= '<td ' . $row_span . '>'
. htmlspecialchars($index->getComments()) . '</td>';
}
$r .= '</tr>';
} // end foreach $index['Sequences']
$odd_row = ! $odd_row;
} // end while
$r .= '</tbody>';
$r .= '</table>';
if (! $print_mode) {
$r .= PMA_Index::findDuplicates($table, $schema);
}
return $r;
}
public function getCompareData()
{
$data = array(
@@ -522,14 +523,14 @@ class PMA_Index
'Packed' => $this->_packed,
'Index_type' => $this->_type,
);
foreach ($this->_columns as $column) {
$data['columns'][] = $column->getCompareData();
}
return $data;
}
/**
* Function to check over array of indexes and look for common problems
*
@@ -547,15 +548,15 @@ class PMA_Index
static public function findDuplicates($table, $schema)
{
$indexes = PMA_Index::getFromTable($table, $schema);
$output = '';
// count($indexes) < 2:
// there is no need to check if there less than two indexes
if (count($indexes) < 2) {
return $output;
}
// remove last index from stack and ...
while ($while_index = array_pop($indexes)) {
// ... compare with every remaining index in stack
@@ -563,15 +564,15 @@ class PMA_Index
if ($each_index->getCompareData() !== $while_index->getCompareData()) {
continue;
}
// did not find any difference
// so it makes no sense to have this two equal indexes
$message = PMA_Message::warning('strIndexesSeemEqual');
$message->addParam($each_index->getName());
$message->addParam($while_index->getName());
$output .= $message->getDisplay();
// there is no need to check any further indexes if we have already
// found that this one has a duplicate
continue 2;
@@ -587,49 +588,49 @@ class PMA_Index_Column
* @var string The column name
*/
protected $_name = '';
/**
* @var integer The column sequence number in the index, starting with 1.
* @var integer The column sequence number in the index, starting with 1.
*/
protected $_seq_in_index = 1;
/**
* @var string How the column is sorted in the index. “A” (Ascending) or NULL (Not sorted)
* @var string How the column is sorted in the index. “A” (Ascending) or NULL (Not sorted)
*/
protected $_collation = null;
/**
* The number of indexed characters if the column is only partly indexed,
* NULL if the entire column is indexed.
* The number of indexed characters if the column is only partly indexed,
* NULL if the entire column is indexed.
*
* @var integer
*/
protected $_sub_part = null;
/**
* Contains YES if the column may contain NULL.
* If not, the column contains NO.
* Contains YES if the column may contain NULL.
* If not, the column contains NO.
*
* @var string
*/
protected $_null = '';
/**
* An estimate of the number of unique values in the index. This is updated
* by running ANALYZE TABLE or myisamchk -a. Cardinality is counted based on
* statistics stored as integers, so the value is not necessarily exact even
* for small tables. The higher the cardinality, the greater the chance that
* MySQL uses the index when doing joins.
* An estimate of the number of unique values in the index. This is updated
* by running ANALYZE TABLE or myisamchk -a. Cardinality is counted based on
* statistics stored as integers, so the value is not necessarily exact even
* for small tables. The higher the cardinality, the greater the chance that
* MySQL uses the index when doing joins.
*
* @var integer
*/
protected $_cardinality = 0;
public function __construct($params = array())
{
$this->set($params);
}
public function set($params)
{
if (isset($params['Column_name'])) {
@@ -651,32 +652,32 @@ class PMA_Index_Column
$this->_null = $params['Null'];
}
}
public function getName()
{
return $this->_name;
}
public function getCollation()
{
return $this->_collation;
}
public function getCardinality()
{
return $this->_cardinality;
}
public function getNull()
{
return $this->_null;
}
public function getSeqInIndex()
{
return $this->_seq_in_index;
}
public function getSubPart()
{
return $this->_sub_part;

View File

@@ -29,6 +29,7 @@
* - authentication work
*
* @version $Id$
* @package phpMyAdmin
*/
/**

View File

@@ -1404,9 +1404,9 @@ $cfg['Export']['sql_drop_table'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_if_not_exists']
* true by default for correct behavior when dealing with exporting
* of VIEWs and the stand-in table
* @global boolean $cfg['Export']['sql_if_not_exists']
*/
$cfg['Export']['sql_if_not_exists'] = true;
@@ -2361,7 +2361,7 @@ $cfg['DBG'] = array();
/**
* Output executed queries and their execution times
*
* @global boolean $cfg['DBG']['enable']
* @global boolean $cfg['DBG']['sql']
*/
$cfg['DBG']['sql'] = false;
@@ -2369,7 +2369,7 @@ $cfg['DBG']['sql'] = false;
* Make the DBG stuff available
* To use the following, please install the DBG extension from http://dd.cron.ru/dbg/
*
* @global boolean $cfg['DBG']['enable']
* @global boolean $cfg['DBG']['php']
*/
$cfg['DBG']['php'] = false;

View File

@@ -10,7 +10,9 @@ if (! defined('PHPMYADMIN')) {
exit;
}
// MySQL client API
/**
* MySQL client API
*/
if (!defined('PMA_MYSQL_CLIENT_API')) {
$client_api = explode('.', mysqli_get_client_info());
define('PMA_MYSQL_CLIENT_API', (int)sprintf('%d%02d%02d', $client_api[0], $client_api[1], intval($client_api[2])));

View File

@@ -10,7 +10,9 @@ if (! defined('PHPMYADMIN')) {
exit;
}
// this gets executed twice so avoid a notice
/**
* This gets executed twice so avoid a notice
*/
if (! defined('CG_FORMAT_NHIBERNATE_CS')) {
define("CG_FORMAT_NHIBERNATE_CS", "NHibernate C# DO");
define("CG_FORMAT_NHIBERNATE_XML", "NHibernate XML");

View File

@@ -4,6 +4,7 @@
* phpMyAdmin Language Loading File
*
* @version $Id$
* @package phpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
@@ -124,7 +125,7 @@ function PMA_langSet(&$lang)
*
* @return bool true on success, otherwise false
*
* @global $available_languages
* @global array $available_languages
*
* @access private
*/

View File

@@ -4,6 +4,7 @@
* the navigation frame - displays server, db and table selection tree
*
* @version $Id$
* @package phpMyAdmin
* @uses $GLOBALS['pma']->databases
* @uses $GLOBALS['server']
* @uses $GLOBALS['db']
@@ -47,11 +48,11 @@
require_once './libraries/common.inc.php';
/**
* finish and cleanup navigation.php script execution
* finish and cleanup navigation.php script execution, only to be used in navigation.php
*
* @uses $GLOBALS['controllink'] to close it
* @uses $GLOBALS['userlink'] to close it
* @access private only to be used in navigation.php
* @access private
*/
function PMA_exitNavigationFrame()
{
@@ -141,27 +142,27 @@ require_once './libraries/header_http.inc.php';
var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
// INIT PMA_setFrameSize
var onloadCnt = 0;
var onLoadHandler = window.onload;
var onloadCnt = 0;
var onLoadHandler = window.onload;
var resizeHandler = window.onresize;
window.document.onresize = resizeHandler;
window.onload = function() {
if (onloadCnt == 0) {
if (typeof(onLoadHandler) == "function") {
onLoadHandler();
if (typeof(onLoadHandler) == "function") {
onLoadHandler();
}
if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
PMA_setFrameSize();
if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
PMA_setFrameSize();
}
onloadCnt++;
}
};
window.onresize = function() {
if (typeof(resizeHandler) == "function") {
resizeHandler();
if (typeof(resizeHandler) == "function") {
resizeHandler();
}
if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
PMA_saveFrameSize();
if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
PMA_saveFrameSize();
}
};
// ]]>
@@ -260,7 +261,7 @@ $element_counter = 0;
if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
$table_list = PMA_getTableList($GLOBALS['db']);
$table_count = count($table_list);
// show selected databasename as link to DefaultTabDatabase-page
// with table count in ()
$common_url_query = PMA_generate_common_url($GLOBALS['db']);
@@ -311,7 +312,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
'db' => $GLOBALS['db']
);
PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
}
}
PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
// lower table list paginator
if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
@@ -346,12 +347,12 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
* @uses PMA_generate_common_url()
* @uses PMA_getTableList()
* @uses PMA_displayTableList()
* @global $element_counter
* @global $img_minus
* @global $img_plus
* @global $href_left
* @global $db_start
* @global $common_url_query
* @global integer $element_counter
* @global string $img_minus
* @global string $img_plus
* @global string $href_left
* @global string $db_start
* @global string $common_url_query
* @param array $ext_dblist extended db list
* @param integer $offset
* @param integer $count

View File

@@ -4,6 +4,7 @@
* Contributed by Maxime Delorme and merged by lem9
*
* @version $Id$
* @package phpMyAdmin
*/
/**

View File

@@ -8,6 +8,9 @@
* @version $Id$
*/
/**
* Core libraries.
*/
require './lib/common.inc.php';
require_once './setup/lib/Form.class.php';
require_once './setup/lib/FormDisplay.class.php';
@@ -57,7 +60,7 @@ if (PMA_ifSetOr($_POST['submit_clear'], '')) {
exit;
} elseif (PMA_ifSetOr($_POST['submit_download'], '')) {
//
// Output generated config file
// Output generated config file
//
header('Content-Type: text/plain');
header('Content-Disposition: attachment; filename="config.inc.php"');
@@ -97,4 +100,4 @@ if (PMA_ifSetOr($_POST['submit_clear'], '')) {
header('Location: index.php?page=config');
exit;
}
?>
?>

View File

@@ -12,6 +12,9 @@ if (!defined('PHPMYADMIN')) {
exit;
}
/**
* Core libraries.
*/
require_once './setup/lib/FormDisplay.class.php';
require_once './setup/lib/index.lib.php';
@@ -42,4 +45,4 @@ check_config_rw($config_readable, $config_writable, $config_exists);
<?php
display_fieldset_bottom_simple();
display_form_bottom();
?>
?>

View File

@@ -12,6 +12,9 @@ if (!defined('PHPMYADMIN')) {
exit;
}
/**
* Core libraries.
*/
require_once './setup/lib/Form.class.php';
require_once './setup/lib/FormDisplay.class.php';
require_once './setup/lib/form_processing.lib.php';
@@ -44,4 +47,4 @@ foreach ($formset['forms'] as $form_name) {
$form_display->registerForm($form_name);
}
process_formset($form_display);
?>
?>

View File

@@ -12,6 +12,9 @@ if (!defined('PHPMYADMIN')) {
exit;
}
/**
* Core libraries.
*/
require_once './libraries/display_select_lang.lib.php';
require_once './setup/lib/FormDisplay.class.php';
require_once './setup/lib/index.lib.php';
@@ -240,4 +243,4 @@ display_form_bottom();
<a href="http://phpmyadmin.net"><?php echo $GLOBALS['strSetupHomepageLink'] ?></a>
<a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php echo $GLOBALS['strSetupDonateLink'] ?></a>
<a href="?version_check=1<?php echo "{$separator}token=" . $_SESSION[' PMA_token '] ?>"><?php echo $GLOBALS['strSetupVersionCheckLink'] ?></a>
</div>
</div>

View File

@@ -12,6 +12,9 @@ if (!defined('PHPMYADMIN')) {
exit;
}
/**
* Core libraries.
*/
require_once './setup/lib/Form.class.php';
require_once './setup/lib/FormDisplay.class.php';
require_once './setup/lib/form_processing.lib.php';
@@ -44,4 +47,4 @@ $form_display->registerForm('Server_login_options', $id);
$form_display->registerForm('Server_config', $id);
$form_display->registerForm('Server_pmadb', $id);
process_formset($form_display);
?>
?>

View File

@@ -9,6 +9,9 @@
* @version $Id$
*/
/**
* Core libraries.
*/
require './lib/common.inc.php';
$page = filter_input(INPUT_GET, 'page');

View File

@@ -14,6 +14,9 @@
* @version $Id$
*/
/**
* Core libraries.
*/
require_once './setup/lib/FormDisplay.tpl.php';
require_once './setup/lib/validate.lib.php';
require_once './libraries/js_escape.lib.php';
@@ -579,4 +582,4 @@ class FormDisplay
return str_replace(array('Servers/1/', '/'), array('Servers/', '_'), $path);
}
}
?>
?>

View File

@@ -11,6 +11,10 @@
// TODO: remove
error_reporting(E_ALL | E_STRICT);
/**
* Do not include full common.
* @ignore
*/
define('PMA_MINIMUM_COMMON', TRUE);
define('PMA_SETUP', TRUE);
chdir('..');
@@ -204,7 +208,7 @@ function PMA_lang_desc($canonical_path)
}
/**
* Wraps link in <a> tags and replaces argument separator in internal links
* Wraps link in &lt;a&gt; tags and replaces argument separator in internal links
* to the one returned by PMA_get_arg_separator()
*
* @param string $link
@@ -225,4 +229,4 @@ function PMA_lang_link_replace($link, $text)
return '<a href="' . $link . '">' . $text . '</a>';
}
?>
?>