Document some require/includes as phpdoc otherwise takes random block before to document it.
This commit is contained in:
@@ -71,7 +71,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
|
||||
// will handle them after the tables
|
||||
/**
|
||||
* @todo support a view of a view
|
||||
* @todo support triggers
|
||||
* @todo support triggers
|
||||
*/
|
||||
if (PMA_Table::isView($db, $each_table)) {
|
||||
$views[] = $each_table;
|
||||
@@ -184,7 +184,9 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
|
||||
}
|
||||
|
||||
if (! $_error && $move) {
|
||||
// cleanup pmadb stuff for this db
|
||||
/**
|
||||
* cleanup pmadb stuff for this db
|
||||
*/
|
||||
require_once './libraries/relation_cleanup.lib.php';
|
||||
PMA_relationsCleanupDatabase($db);
|
||||
|
||||
@@ -416,7 +418,7 @@ if (!$is_information_schema) {
|
||||
<?php
|
||||
$choices = array(
|
||||
'structure' => $strStrucOnly,
|
||||
'data' => $strStrucData,
|
||||
'data' => $strStrucData,
|
||||
'dataonly' => $strDataOnly);
|
||||
PMA_generate_html_radio('what', $choices, 'data', true);
|
||||
unset($choices);
|
||||
|
@@ -280,6 +280,9 @@ if ($import_file != 'none' && !$error) {
|
||||
break;
|
||||
case 'application/zip':
|
||||
if ($cfg['ZipDump'] && @function_exists('zip_open')) {
|
||||
/**
|
||||
* Load interface for zip extension.
|
||||
*/
|
||||
include_once './libraries/zip_extension.lib.php';
|
||||
$result = PMA_getZipContents($import_file);
|
||||
if (! empty($result['error'])) {
|
||||
|
@@ -30,7 +30,9 @@ if ($GLOBALS['PMA_allow_mbstr']) {
|
||||
mb_internal_encoding($GLOBALS['charset']);
|
||||
}
|
||||
|
||||
// This is for handling input better
|
||||
/**
|
||||
* Load proper code for handling input.
|
||||
*/
|
||||
if (defined('PMA_MULTIBYTE_ENCODING') || $GLOBALS['PMA_allow_mbstr']) {
|
||||
$GLOBALS['PMA_strpos'] = 'mb_strpos';
|
||||
$GLOBALS['PMA_substr'] = 'mb_substr';
|
||||
@@ -47,6 +49,9 @@ if (defined('PMA_MULTIBYTE_ENCODING') || $GLOBALS['PMA_allow_mbstr']) {
|
||||
require './libraries/string_native.lib.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load ctype handler.
|
||||
*/
|
||||
if (@extension_loaded('ctype')) {
|
||||
require './libraries/string_type_ctype.lib.php';
|
||||
} else {
|
||||
|
9
sql.php
9
sql.php
@@ -310,8 +310,14 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
|
||||
}
|
||||
$active_page = $goto;
|
||||
$message = PMA_Message::rawError($error);
|
||||
/**
|
||||
* Go to target path.
|
||||
*/
|
||||
require './' . PMA_securePath($goto);
|
||||
} else {
|
||||
/**
|
||||
* HTML header.
|
||||
*/
|
||||
require_once './libraries/header.inc.php';
|
||||
$full_err_url = (preg_match('@^(db|tbl)_@', $err_url))
|
||||
? $err_url . '&show_query=1&sql_query=' . urlencode($sql_query)
|
||||
@@ -445,6 +451,9 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
|
||||
|
||||
// garvin: if a table or database gets dropped, check column comments.
|
||||
if (isset($purge) && $purge == '1') {
|
||||
/**
|
||||
* Cleanup relations.
|
||||
*/
|
||||
require_once './libraries/relation_cleanup.lib.php';
|
||||
|
||||
if (strlen($table) && strlen($db)) {
|
||||
|
@@ -43,27 +43,27 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
$field_cnt = count($_REQUEST['field_orig']);
|
||||
$key_fields = array();
|
||||
$changes = array();
|
||||
|
||||
|
||||
for ($i = 0; $i < $field_cnt; $i++) {
|
||||
$changes[] = 'CHANGE ' . PMA_Table::generateAlter(
|
||||
$_REQUEST['field_orig'][$i],
|
||||
$_REQUEST['field_orig'][$i],
|
||||
$_REQUEST['field_name'][$i],
|
||||
$_REQUEST['field_type'][$i],
|
||||
$_REQUEST['field_length'][$i],
|
||||
$_REQUEST['field_type'][$i],
|
||||
$_REQUEST['field_length'][$i],
|
||||
$_REQUEST['field_attribute'][$i],
|
||||
isset($_REQUEST['field_collation'][$i])
|
||||
? $_REQUEST['field_collation'][$i]
|
||||
isset($_REQUEST['field_collation'][$i])
|
||||
? $_REQUEST['field_collation'][$i]
|
||||
: '',
|
||||
isset($_REQUEST['field_null'][$i])
|
||||
? $_REQUEST['field_null'][$i]
|
||||
isset($_REQUEST['field_null'][$i])
|
||||
? $_REQUEST['field_null'][$i]
|
||||
: 'NOT NULL',
|
||||
$_REQUEST['field_default_type'][$i],
|
||||
$_REQUEST['field_default_type'][$i],
|
||||
$_REQUEST['field_default_value'][$i],
|
||||
isset($_REQUEST['field_extra'][$i])
|
||||
? $_REQUEST['field_extra'][$i]
|
||||
: false,
|
||||
isset($_REQUEST['field_comments'][$i])
|
||||
? $_REQUEST['field_comments'][$i]
|
||||
isset($_REQUEST['field_comments'][$i])
|
||||
? $_REQUEST['field_comments'][$i]
|
||||
: '',
|
||||
$key_fields,
|
||||
$i,
|
||||
@@ -75,7 +75,7 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
$key_query = '';
|
||||
/**
|
||||
* this is a little bit more complex
|
||||
*
|
||||
*
|
||||
* @todo if someone selects A_I when altering a column we need to check:
|
||||
* - no other column with A_I
|
||||
* - the column has an index, if not create one
|
||||
@@ -90,7 +90,7 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
$key_query = ', ADD KEY (' . implode(', ', $fields) . ') ';
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// To allow replication, we first select the db to use and then run queries
|
||||
// on this db.
|
||||
PMA_DBI_select_db($db) or PMA_mysqlDie(PMA_DBI_getError(), 'USE ' . PMA_backquote($db) . ';', '', $err_url);
|
||||
@@ -103,7 +103,9 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
$message->addParam($table);
|
||||
$btnDrop = 'Fake';
|
||||
|
||||
// garvin: If comments were sent, enable relation stuff
|
||||
/**
|
||||
* If comments were sent, enable relation stuff
|
||||
*/
|
||||
require_once './libraries/relation.lib.php';
|
||||
require_once './libraries/transformations.lib.php';
|
||||
|
||||
@@ -111,7 +113,7 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
if (isset($_REQUEST['field_orig']) && is_array($_REQUEST['field_orig'])) {
|
||||
foreach ($_REQUEST['field_orig'] as $fieldindex => $fieldcontent) {
|
||||
if ($_REQUEST['field_name'][$fieldindex] != $fieldcontent) {
|
||||
PMA_REL_renameField($db, $table, $fieldcontent,
|
||||
PMA_REL_renameField($db, $table, $fieldcontent,
|
||||
$_REQUEST['field_name'][$fieldindex]);
|
||||
}
|
||||
}
|
||||
@@ -119,14 +121,14 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
|
||||
// update mime types
|
||||
if (isset($_REQUEST['field_mimetype'])
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
&& is_array($_REQUEST['field_mimetype'])
|
||||
&& $cfg['BrowseMIME']) {
|
||||
foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) {
|
||||
if (isset($_REQUEST['field_name'][$fieldindex])
|
||||
&& strlen($_REQUEST['field_name'][$fieldindex])) {
|
||||
PMA_setMIME($db, $table, $_REQUEST['field_name'][$fieldindex],
|
||||
$mimetype,
|
||||
$_REQUEST['field_transformation'][$fieldindex],
|
||||
PMA_setMIME($db, $table, $_REQUEST['field_name'][$fieldindex],
|
||||
$mimetype,
|
||||
$_REQUEST['field_transformation'][$fieldindex],
|
||||
$_REQUEST['field_transformation_options'][$fieldindex]);
|
||||
}
|
||||
}
|
||||
@@ -149,7 +151,7 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
|
||||
/**
|
||||
* No modifications yet required -> displays the table fields
|
||||
*
|
||||
*
|
||||
* $selected comes from multi_submits.inc.php
|
||||
*/
|
||||
if ($abort == false) {
|
||||
@@ -194,6 +196,9 @@ if ($abort == false) {
|
||||
$analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table));
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for changing properties.
|
||||
*/
|
||||
require './libraries/tbl_properties.inc.php';
|
||||
}
|
||||
|
||||
|
@@ -234,7 +234,7 @@ foreach ($loop_array as $rowcount => $primary_key) {
|
||||
$val = "'" . PMA_sqlAddslashes($bs_reference) . "'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (empty($me_funcs[$key])) {
|
||||
$cur_value = $val;
|
||||
} elseif ('UNIX_TIMESTAMP' === $me_funcs[$key] && $val != "''") {
|
||||
@@ -397,7 +397,13 @@ $GLOBALS['js_include'][] = 'functions.js';
|
||||
$GLOBALS['js_include'][] = 'mootools.js';
|
||||
|
||||
$active_page = $goto_include;
|
||||
/**
|
||||
* Load header.
|
||||
*/
|
||||
require_once './libraries/header.inc.php';
|
||||
/**
|
||||
* Load target page.
|
||||
*/
|
||||
require './' . PMA_securePath($goto_include);
|
||||
exit;
|
||||
?>
|
||||
|
Reference in New Issue
Block a user