bec26273 by Yashwant

delete siteflexDB folder phpmyadmin mysql user interface

1 parent 6d1d2420
Showing 1000 changed files with 0 additions and 4876 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

1 src_dir: libraries
2 coverage_clover: build/logs/clover.xml
3 json_path: build/logs/coveralls-upload.json
1 # scrutinizer-ci.com configuration
2 imports:
3 - javascript
4 - php
5 filter:
6 excluded_paths: [libraries/php-gettext/*, libraries/tcpdf/*, libraries/bfShapeFiles/*, PMAStandard/*, libraries/phpseclib/*, libraries/plugins/auth/recaptchalib.php, libraries/plugins/auth/swekey/swekey.php, libraries/sql-formatter/*, js/jquery/*, js/jqplot/*, js/openlayers/*, js/codemirror/*, js/canvg/*, js/tracekit/*, js/OpenStreetMap.js, js/sprintf.js, test/libraries/php-gettext/*, test/libraries/sql-formatter/*]
7 tools:
8 php_code_sniffer:
9 config:
10 standard: "PMAStandard"
1 # Contributing to phpMyAdmin
2
3 As an open source project, phpMyAdmin welcomes contributions of many forms.
4
5 ## Bug reporting
6
7 We appreciate your effort to improve phpMyAdmin by submitting a bug report. Before doing so, please check the following things:
8
9 1. Check whether the bug you face **hasn't been already reported**. Duplicate reports takes us time, that we could be used to fix other bugs or make improvements.
10 2. Specify the phpMyAdmin, server, PHP, MySQL and browser information that may be helpful to fix the problem, especially exact **version numbers**.
11 3. If you got some error, please **describe what happened** and add error message. Reports like "I get error when I clicked on some link." are useless.
12 4. Provide easy steps to reproduce and if possible include your table structure (``SHOW CREATE TABLE `tbl_name```); if your problem implies specific data, attach a small export file for sample rows.
13 5. **Security problems** should not be reported here. See [our security page](https://www.phpmyadmin.net/security/).
14 Thanks for your help!
15
16 Please report [bugs on GitHub][1].
17
18 [1]: https://github.com/phpmyadmin/phpmyadmin/issues/new
19
20 ## Patches submission
21
22 Patches are welcome as [pull requests on GitHub][2]. Please include a
23 Signed-off-by tag. Note that by submitting patches with the Signed-off-by
24 tag, you are giving permission to license the patch as GPLv2-or-later. See
25 [the DCO file][3] for details.
26
27 [2]: https://github.com/phpmyadmin/phpmyadmin/pulls
28 [3]: https://github.com/phpmyadmin/phpmyadmin/blob/master/DCO
29
30 ## More information
31
32 You can find more information on our website:
33
34 https://www.phpmyadmin.net/contribute/
1 If you would like to make a contribution to the phpMyAdmin Project, please
2 certify to the following:
3 ***
4 phpMyAdmin Developer's Certificate of Origin. Version 1.0
5
6 By making a contribution to this project, I certify that:
7
8 (a) The contribution was created in whole or in part by me and I have the
9 right to submit it under the license of "GNU General Public License or
10 any later version" ("GPLv2-or-later"); or
11
12 (b) The contribution is based upon previous work that, to the best of my
13 knowledge, is covered under an appropriate open source license and I have
14 the right under that license to submit that work with modifications,
15 whether created in whole or in part by me, under GPLv2-or-later; or
16
17 (c) The contribution was provided directly to me by some other person who
18 certified (a) or (b) and I have not modified it.
19
20 (d) I understand and agree that this project and the contribution are public
21 and that a record of the contribution (including all metadata and
22 personal information I submit with it, including my sign-off) is
23 maintained indefinitely and may be redistributed consistent with
24 phpMyAdmin's policies and the requirements of the GPLv2-or-later where
25 they are relevant.
26
27 (e) I am granting this work to this project under the terms of the
28 GPLv2-or-later.
29
30 http://www.gnu.org/licenses/gpl-2.0.html
31
32 ***
33 ***
34 And please confirm your certification to the above by adding the following
35 line to your patch:
36
37 Signed-off-by: Jane Developer <[email protected]>
38
39 using your real name (sorry, no pseudonyms or anonymous contributions).
40
41 If you are a developer who is authorized to contribute to phpMyAdmin on
42 behalf of your employer, then please use your corporate email address in the
43 Signed-off-by tag. If not, then please use a personal email address.
44
1 phpMyAdmin - Readme
2 ===================
3
4 Version 4.5.3.1
5
6 A set of PHP-scripts to manage MySQL over the web.
7
8 https://www.phpmyadmin.net/
9
10 Summary
11 -------
12
13 phpMyAdmin is intended to handle the administration of MySQL over the web.
14 For a summary of features, list of requirements, and installation instructions,
15 please see the documentation in the ./doc/ folder or at http://docs.phpmyadmin.net/
16
17 Copyright
18 ---------
19
20 Copyright © 1998 onwards -- the phpMyAdmin team
21
22 Certain libraries are copyrighted by their respective authors;
23 see the full copyright list for details.
24
25 For full copyright information, please see ./doc/copyright.rst
26
27 License
28 -------
29
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License version 2, as published by the
32 Free Software Foundation.
33
34 This program is distributed in the hope that it will be useful, but WITHOUT
35 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
36 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
37 details.
38
39 You should have received a copy of the GNU General Public License
40 along with this program. If not, see <http://www.gnu.org/licenses/>.
41
42 Licensing of current contributions
43 ----------------------------------
44
45 Beginning on 2013-12-01, new contributions to this codebase are all licensed
46 under terms compatible with GPLv2-or-later. phpMyAdmin is currently
47 transitioning older code to GPLv2-or-later, but work is not yet complete.
48
49 Enjoy!
50 ------
51
52 The phpMyAdmin team
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * display selection for relational field values
5 *
6 * @package PhpMyAdmin
7 */
8
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/transformations.lib.php';
11 require_once 'libraries/browse_foreigners.lib.php';
12
13 /**
14 * Sets globals from $_REQUEST
15 */
16 $request_params = array(
17 'data',
18 'field'
19 );
20
21 foreach ($request_params as $one_request_param) {
22 if (isset($_REQUEST[$one_request_param])) {
23 $GLOBALS[$one_request_param] = $_REQUEST[$one_request_param];
24 }
25 }
26
27 PMA_Util::checkParameters(array('db', 'table', 'field'));
28
29 $response = PMA_Response::getInstance();
30 $response->getFooter()->setMinimal();
31 $header = $response->getHeader();
32 $header->disableMenuAndConsole();
33 $header->setBodyId('body_browse_foreigners');
34
35 /**
36 * Displays the frame
37 */
38
39 $cfgRelation = PMA_getRelationsParam();
40 $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : false);
41 $foreign_limit = PMA_getForeignLimit(
42 isset($_REQUEST['foreign_showAll']) ? $_REQUEST['foreign_showAll'] : null
43 );
44
45 $foreignData = PMA_getForeignData(
46 $foreigners, $_REQUEST['field'], true,
47 isset($_REQUEST['foreign_filter'])
48 ? $_REQUEST['foreign_filter']
49 : '',
50 isset($foreign_limit) ? $foreign_limit : null
51 );
52
53 // HTML output
54 $html = PMA_getHtmlForRelationalFieldSelection(
55 $db, $table, $_REQUEST['field'], $foreignData,
56 isset($fieldkey) ? $fieldkey : null,
57 isset($data) ? $data : null
58 );
59
60 $response->addHtml($html);
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Simple script to set correct charset for changelog
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Gets core libraries and defines some variables
11 */
12 require 'libraries/common.inc.php';
13
14 $response = PMA_Response::getInstance();
15 $response->disable();
16
17 $filename = CHANGELOG_FILE;
18
19 /**
20 * Read changelog.
21 */
22 // Check if the file is available, some distributions remove these.
23 if (is_readable($filename)) {
24
25 // Test if the if is in a compressed format
26 if (substr($filename, -3) == '.gz') {
27 ob_start();
28 readgzfile($filename);
29 $changelog = ob_get_contents();
30 ob_end_clean();
31 } else {
32 $changelog = file_get_contents($filename);
33 }
34 } else {
35 printf(
36 __(
37 'The %s file is not available on this system, please visit '
38 . 'www.phpmyadmin.net for more information.'
39 ),
40 $filename
41 );
42 exit;
43 }
44
45 /**
46 * Whole changelog in variable.
47 */
48 $changelog = htmlspecialchars($changelog);
49
50 $tracker_url = 'https://sourceforge.net/support/tracker.php?aid=\\1';
51 $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/';
52 $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/';
53 $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/';
54 $github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
55 $faq_url = 'http://docs.phpmyadmin.net/en/latest/faq.html';
56
57 $replaces = array(
58 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
59 => '<a href="\\1">\\1</a>',
60
61 // sourceforge users
62 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
63 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
64 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
65 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
66 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
67 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
68
69 // mail address
70 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
71 => '\\1 <a href="mailto:\\3">\\2</a>',
72
73 // linking patches
74 '/patch\s*#?([0-9]{6,})/i'
75 => '<a href="' . $tracker_url . '">patch #\\1</a>',
76
77 // linking RFE
78 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
79 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
80
81 // linking files
82 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
83 => '\\1<a href="' . $github_url . 'commits/HEAD/\\2">\\2</a>',
84
85 // FAQ entries
86 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
87 => '<a href="' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
88
89 // linking bugs
90 '/bug\s*#?([0-9]{6,})/i'
91 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
92
93 // all other 6+ digit numbers are treated as bugs
94 '/(?<!bug|RFE|patch) #?([0-9]{6,})/i'
95 => '<a href="' . $tracker_url . '">bug #\\1</a>',
96
97 // GitHub issues
98 '/issue\s*#?([0-9]{4,5}) /i'
99 => '<a href="' . $github_url . 'issues/\\1">issue #\\1</a> ',
100
101 // transitioned SF.net project bug/rfe/patch links
102 // by the time we reach 6-digit numbers, we can probably retire the above links
103 '/patch\s*#?([0-9]{4,5}) /i'
104 => '<a href="' . $tracker_url_patch . '">patch #\\1</a> ',
105 '/(?:rfe|feature)\s*#?([0-9]{4,5}) /i'
106 => '<a href="' . $tracker_url_rfe . '">RFE #\\1</a> ',
107 '/bug\s*#?([0-9]{4,5}) /i'
108 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
109 '/(?<!bug|RFE|patch) #?([0-9]{4,5}) /i'
110 => '<a href="' . $tracker_url_bug . '">bug #\\1</a> ',
111
112 // CVE/CAN entries
113 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
114 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
115
116 // PMASAentries
117 '/(PMASA-[0-9]+-[0-9]+)/'
118 => '<a href="https://www.phpmyadmin.net/security/\\1/">\\1</a>',
119
120 // Highlight releases (with links)
121 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
122 => '<a name="\\1_\\2_\\3"></a>'
123 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
124 . '\\1.\\2.\\3.0 \\4</a>',
125 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
126 => '<a name="\\1_\\2_\\3_\\4"></a>'
127 . '<a href="' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
128 . '\\1.\\2.\\3.\\4 \\5</a>',
129
130 // Highlight releases (not linkable)
131 '/( ### )(.*)/'
132 => '\\1<b>\\2</b>',
133
134 );
135
136 header('Content-type: text/html; charset=utf-8');
137 ?>
138 <!DOCTYPE HTML>
139 <html lang="en" dir="ltr">
140 <head>
141 <link rel="icon" href="favicon.ico" type="image/x-icon" />
142 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
143 <title>phpMyAdmin - ChangeLog</title>
144 <meta charset="utf-8" />
145 </head>
146 <body>
147 <h1>phpMyAdmin - ChangeLog</h1>
148 <?php
149 echo '<pre>';
150 echo preg_replace(array_keys($replaces), $replaces, $changelog);
151 echo '</pre>';
152 ?>
153 <script type="text/javascript">
154 var links = document.getElementsByTagName("a");
155 for(var i = 0; i < links.length; i++) {
156 links[i].target = "_blank";
157 }
158 </script>
159 </body>
160 </html>
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Displays status of phpMyAdmin configuration storage
5 *
6 * @package PhpMyAdmin
7 */
8
9 require_once 'libraries/common.inc.php';
10
11 // If request for creating the pmadb
12 if (isset($_REQUEST['create_pmadb'])) {
13 if (PMA_createPMADatabase()) {
14 PMA_fixPMATables('phpmyadmin');
15 }
16 }
17
18 // If request for creating all PMA tables.
19 if (isset($_REQUEST['fixall_pmadb'])) {
20 PMA_fixPMATables($GLOBALS['db']);
21 }
22
23 $cfgRelation = PMA_getRelationsParam();
24 // If request for creating missing PMA tables.
25 if (isset($_REQUEST['fix_pmadb'])) {
26 PMA_fixPMATables($cfgRelation['db']);
27 }
28
29 $response = PMA_Response::getInstance();
30 $response->addHTML(
31 PMA_getRelationsParamDiagnostic($cfgRelation)
32 );
1 {
2 "name": "phpmyadmin/phpmyadmin",
3 "type": "application",
4 "description": "MySQL web administration tool",
5 "keywords": ["phpmyadmin","mysql","web"],
6 "homepage": "https://www.phpmyadmin.net/",
7 "license": "GPL-2.0+",
8 "authors": [
9 {
10 "name": "The phpMyAdmin Team",
11 "email": "[email protected]",
12 "homepage": "https://www.phpmyadmin.net/team/"
13 }
14 ],
15 "support": {
16 "forum": "https://www.phpmyadmin.net/support/",
17 "issues": "https://github.com/phpmyadmin/phpmyadmin/issues",
18 "wiki": "http://wiki.phpmyadmin.net/",
19 "source": "https://github.com/phpmyadmin/phpmyadmin"
20 },
21 "require": {
22 "php": ">=5.5.0"
23 },
24 "require-dev": {
25 "satooshi/php-coveralls": ">=0.6",
26 "phpunit/phpunit": ">=3.7",
27 "phpunit/phpunit-selenium": ">=1.2",
28 "squizlabs/php_codesniffer": "2.*"
29 },
30 "repositories": [
31 {
32 "type": "composer",
33 "url": "https://www.phpmyadmin.net"
34 }
35 ]
36 }
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * phpMyAdmin sample configuration, you can use it as base for
5 * manual configuration. For easier setup you can use setup/
6 *
7 * All directives are explained in documentation in the doc/ folder
8 * or at <http://docs.phpmyadmin.net/>.
9 *
10 * @package PhpMyAdmin
11 */
12
13 /**
14 * This is needed for cookie based authentication to encrypt password in
15 * cookie
16 */
17 $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
18
19 /**
20 * Servers configuration
21 */
22 $i = 0;
23
24 /**
25 * First server
26 */
27 $i++;
28 /* Authentication type */
29 $cfg['Servers'][$i]['auth_type'] = 'cookie';
30 /* Server parameters */
31 $cfg['Servers'][$i]['host'] = 'localhost';
32 $cfg['Servers'][$i]['connect_type'] = 'tcp';
33 $cfg['Servers'][$i]['compress'] = false;
34 $cfg['Servers'][$i]['AllowNoPassword'] = false;
35
36 /**
37 * phpMyAdmin configuration storage settings.
38 */
39
40 /* User used to manipulate with storage */
41 // $cfg['Servers'][$i]['controlhost'] = '';
42 // $cfg['Servers'][$i]['controlport'] = '';
43 // $cfg['Servers'][$i]['controluser'] = 'pma';
44 // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
45
46 /* Storage database and tables */
47 // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
48 // $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
49 // $cfg['Servers'][$i]['relation'] = 'pma__relation';
50 // $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
51 // $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
52 // $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
53 // $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
54 // $cfg['Servers'][$i]['history'] = 'pma__history';
55 // $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
56 // $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
57 // $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
58 // $cfg['Servers'][$i]['recent'] = 'pma__recent';
59 // $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
60 // $cfg['Servers'][$i]['users'] = 'pma__users';
61 // $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
62 // $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
63 // $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
64 // $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
65 // $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
66 // $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
67 /* Contrib / Swekey authentication */
68 // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
69
70 /**
71 * End of servers configuration
72 */
73
74 /**
75 * Directories for saving/loading files from server
76 */
77 $cfg['UploadDir'] = '';
78 $cfg['SaveDir'] = '';
79
80 /**
81 * Whether to display icons or text or both icons and text in table row
82 * action segment. Value can be either of 'icons', 'text' or 'both'.
83 * default = 'both'
84 */
85 //$cfg['RowActionType'] = 'icons';
86
87 /**
88 * Defines whether a user should be displayed a "show all (records)"
89 * button in browse mode or not.
90 * default = false
91 */
92 //$cfg['ShowAll'] = true;
93
94 /**
95 * Number of rows displayed when browsing a result set. If the result
96 * set contains more rows, "Previous" and "Next".
97 * Possible values: 25, 50, 100, 250, 500
98 * default = 25
99 */
100 //$cfg['MaxRows'] = 50;
101
102 /**
103 * Disallow editing of binary fields
104 * valid values are:
105 * false allow editing
106 * 'blob' allow editing except for BLOB fields
107 * 'noblob' disallow editing except for BLOB fields
108 * 'all' disallow editing
109 * default = 'blob'
110 */
111 //$cfg['ProtectBinary'] = false;
112
113 /**
114 * Default language to use, if not browser-defined or user-defined
115 * (you find all languages in the locale folder)
116 * uncomment the desired line:
117 * default = 'en'
118 */
119 //$cfg['DefaultLang'] = 'en';
120 //$cfg['DefaultLang'] = 'de';
121
122 /**
123 * How many columns should be used for table display of a database?
124 * (a value larger than 1 results in some information being hidden)
125 * default = 1
126 */
127 //$cfg['PropertiesNumColumns'] = 2;
128
129 /**
130 * Set to true if you want DB-based query history.If false, this utilizes
131 * JS-routines to display query history (lost by window close)
132 *
133 * This requires configuration storage enabled, see above.
134 * default = false
135 */
136 //$cfg['QueryHistoryDB'] = true;
137
138 /**
139 * When using DB-based query history, how many entries should be kept?
140 * default = 25
141 */
142 //$cfg['QueryHistoryMax'] = 100;
143
144 /**
145 * Whether or not to query the user before sending the error report to
146 * the phpMyAdmin team when a JavaScript error occurs
147 *
148 * Available options
149 * ('ask' | 'always' | 'never')
150 * default = 'ask'
151 */
152 //$cfg['SendErrorReports'] = 'always';
153
154 /**
155 * You can find more configuration options in the documentation
156 * in the doc/ folder or at <http://docs.phpmyadmin.net/>.
157 */
1 <?php
2
3 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 /**
5 * Central Columns view/edit
6 *
7 * @package PhpMyAdmin
8 */
9 /**
10 * Gets some core libraries
11 */
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/central_columns.lib.php';
14
15 if (isset($_POST['edit_save']) || isset($_POST['add_new_column'])) {
16 $col_name = $_POST['col_name'];
17 if (isset($_POST['edit_save'])) {
18 $orig_col_name = $_POST['orig_col_name'];
19 }
20 $col_default = $_POST['col_default'];
21 if ($col_default == 'NONE' && $_POST['col_default_sel'] != 'USER_DEFINED') {
22 $col_default = "";
23 }
24 $col_extra = isset($_POST['col_extra']) ? $_POST['col_extra'] : '';
25 $col_isNull = isset($_POST['col_isNull'])?1:0;
26 $col_length = $_POST['col_length'];
27 $col_attribute = $_POST['col_attribute'];
28 $col_type = $_POST['col_type'];
29 $collation = $_POST['collation'];
30 if (isset($orig_col_name) && $orig_col_name) {
31 echo PMA_updateOneColumn(
32 $db, $orig_col_name, $col_name, $col_type, $col_attribute,
33 $col_length, $col_isNull, $collation, $col_extra, $col_default
34 );
35 exit;
36 } else {
37 $tmp_msg = PMA_updateOneColumn(
38 $db, "", $col_name, $col_type, $col_attribute,
39 $col_length, $col_isNull, $collation, $col_extra, $col_default
40 );
41 }
42 }
43 if (isset($_POST['populateColumns'])) {
44 $selected_tbl = $_POST['selectedTable'];
45 echo PMA_getHTMLforColumnDropdown($db, $selected_tbl);
46 exit;
47 }
48 if (isset($_POST['getColumnList'])) {
49 echo PMA_getCentralColumnsListRaw($db, $_POST['cur_table']);
50 exit;
51 }
52 if (isset($_POST['add_column'])) {
53 $selected_col = array();
54 $selected_tbl = $_POST['table-select'];
55 $selected_col[] = $_POST['column-select'];
56 $tmp_msg = PMA_syncUniqueColumns($selected_col, false, $selected_tbl);
57 }
58 $response = PMA_Response::getInstance();
59 $header = $response->getHeader();
60 $scripts = $header->getScripts();
61 $scripts->addFile('jquery/jquery.uitablefilter.js');
62 $scripts->addFile('jquery/jquery.tablesorter.js');
63 $scripts->addFile('db_central_columns.js');
64 $cfgCentralColumns = PMA_centralColumnsGetParams();
65 $pmadb = $cfgCentralColumns['db'];
66 $pmatable = $cfgCentralColumns['table'];
67 $max_rows = $GLOBALS['cfg']['MaxRows'];
68
69 if (isset($_REQUEST['edit_central_columns_page'])) {
70 $selected_fld = $_REQUEST['selected_fld'];
71 $selected_db = $_REQUEST['db'];
72 $edit_central_column_page = PMA_getHTMLforEditingPage(
73 $selected_fld, $selected_db
74 );
75 $response->addHTML($edit_central_column_page);
76 exit;
77 }
78 if (isset($_POST['multi_edit_central_column_save'])) {
79 $message = PMA_updateMultipleColumn();
80 if (!is_bool($message)) {
81 $response->isSuccess(false);
82 $response->addJSON('message', $message);
83 }
84 }
85 if (isset($_POST['delete_save'])) {
86 $col_name = array();
87 parse_str($_POST['col_name'], $col_name);
88 $tmp_msg = PMA_deleteColumnsFromList($col_name['selected_fld'], false);
89 }
90 if (isset($_REQUEST['total_rows']) && $_REQUEST['total_rows']) {
91 $total_rows = $_REQUEST['total_rows'];
92 } else {
93 $total_rows = PMA_getCentralColumnsCount($db);
94 }
95 if (isset($_REQUEST['pos'])) {
96 $pos = $_REQUEST['pos'];
97 } else {
98 $pos = 0;
99 }
100 $addNewColumn = PMA_getHTMLforAddNewColumn($db);
101 $response->addHTML($addNewColumn);
102 if ($total_rows <= 0) {
103 $response->addHTML(
104 '<fieldset>' . __(
105 'The central list of columns for the current database is empty.'
106 ) . '</fieldset>'
107 );
108 $columnAdd = PMA_getHTMLforAddCentralColumn($total_rows, $pos, $db);
109 $response->addHTML($columnAdd);
110 exit;
111 }
112 $table_navigation_html = PMA_getHTMLforTableNavigation($total_rows, $pos, $db);
113 $response->addHTML($table_navigation_html);
114 $columnAdd = PMA_getHTMLforAddCentralColumn($total_rows, $pos, $db);
115 $response->addHTML($columnAdd);
116 $deleteRowForm = '<form method="post" id="del_form" action="db_central_columns.php">'
117 . PMA_URL_getHiddenInputs(
118 $db
119 )
120 . '<input id="del_col_name" type="hidden" name="col_name" value="">'
121 . '<input type="hidden" name="pos" value="' . $pos . '">'
122 . '<input type="hidden" name="delete_save" value="delete"></form>';
123 $response->addHTML($deleteRowForm);
124 $table_struct = '<div id="tableslistcontainer">'
125 . '<form name="tableslistcontainer">'
126 . '<table id="table_columns" class="tablesorter" '
127 . 'style="min-width:100%" class="data">';
128 $response->addHTML($table_struct);
129 $tableheader = PMA_getCentralColumnsTableHeader(
130 'column_heading', __('Click to sort.'), 2
131 );
132 $response->addHTML($tableheader);
133 $result = PMA_getColumnsList($db, $pos, $max_rows);
134 $odd_row = true;
135 $row_num = 0;
136 foreach ($result as $row) {
137 $tableHtmlRow = PMA_getHTMLforCentralColumnsTableRow(
138 $row, $odd_row, $row_num, $db
139 );
140 $response->addHTML($tableHtmlRow);
141 $odd_row = !$odd_row;
142 $row_num++;
143 }
144 $response->addHTML('</table>');
145 $tablefooter = PMA_getCentralColumnsTableFooter($pmaThemeImage, $text_dir);
146 $response->addHTML($tablefooter);
147 $response->addHTML('</form></div>');
148 $message = PMA_Message::success(
149 sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + count($result)))
150 );
151 if (isset($tmp_msg) && $tmp_msg !== true) {
152 $message = $tmp_msg;
153 }
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Database creating page
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Gets some core libraries
11 */
12 require_once 'libraries/common.inc.php';
13
14 require_once 'libraries/mysql_charsets.inc.php';
15 if (! PMA_DRIZZLE) {
16 include_once 'libraries/replication.inc.php';
17 }
18 require 'libraries/build_html_for_db.lib.php';
19
20 /**
21 * Defines the url to return to in case of error in a sql statement
22 */
23 $err_url = 'index.php' . PMA_URL_getCommon();
24
25 /**
26 * Builds and executes the db creation sql query
27 */
28 $sql_query = 'CREATE DATABASE ' . PMA_Util::backquote($_POST['new_db']);
29 if (! empty($_POST['db_collation'])) {
30 list($db_charset) = explode('_', $_POST['db_collation']);
31 if (in_array($db_charset, $mysql_charsets)
32 && in_array($_POST['db_collation'], $mysql_collations[$db_charset])
33 ) {
34 $sql_query .= ' DEFAULT'
35 . PMA_generateCharsetQueryPart($_POST['db_collation']);
36 }
37 $db_collation_for_ajax = $_POST['db_collation'];
38 unset($db_charset);
39 }
40 $sql_query .= ';';
41
42 $result = $GLOBALS['dbi']->tryQuery($sql_query);
43
44 if (! $result) {
45 $message = PMA_Message::rawError($GLOBALS['dbi']->getError());
46 // avoid displaying the not-created db name in header or navi panel
47 $GLOBALS['db'] = '';
48 $GLOBALS['table'] = '';
49
50 /**
51 * If in an Ajax request, just display the message with {@link PMA_Response}
52 */
53 if ($GLOBALS['is_ajax_request'] == true) {
54 $response = PMA_Response::getInstance();
55 $response->isSuccess(false);
56 $response->addJSON('message', $message);
57 } else {
58 include_once 'index.php';
59 }
60 } else {
61 $message = PMA_Message::success(__('Database %1$s has been created.'));
62 $message->addParam($_POST['new_db']);
63 $GLOBALS['db'] = $_POST['new_db'];
64
65 /**
66 * If in an Ajax request, build the output and send it
67 */
68 if ($GLOBALS['is_ajax_request'] == true) {
69 //Construct the html for the new database, so that it can be appended to
70 // the list of databases on server_databases.php
71
72 /**
73 * Build the array to be passed to {@link PMA_URL_getCommon}
74 * to generate the links
75 *
76 * @global array $GLOBALS['db_url_params']
77 * @name $db_url_params
78 */
79 $db_url_params['db'] = $_POST['new_db'];
80
81 $is_superuser = $GLOBALS['dbi']->isSuperuser();
82 $column_order = PMA_getColumnOrder();
83 $url_query = PMA_URL_getCommon(array('db' => $_POST['new_db']));
84
85 /**
86 * String that will contain the output HTML
87 * @name $new_db_string
88 */
89 $new_db_string = '<tr>';
90
91 if (empty($db_collation_for_ajax)) {
92 $db_collation_for_ajax = PMA_getServerCollation();
93 }
94
95 // $dbstats comes from the create table dialog
96 if (! empty($dbstats)) {
97 $current = array(
98 'SCHEMA_NAME' => $_POST['new_db'],
99 'DEFAULT_COLLATION_NAME' => $db_collation_for_ajax,
100 'SCHEMA_TABLES' => '0',
101 'SCHEMA_TABLE_ROWS' => '0',
102 'SCHEMA_DATA_LENGTH' => '0',
103 'SCHEMA_MAX_DATA_LENGTH' => '0',
104 'SCHEMA_INDEX_LENGTH' => '0',
105 'SCHEMA_LENGTH' => '0',
106 'SCHEMA_DATA_FREE' => '0'
107 );
108 } else {
109 $current = array(
110 'SCHEMA_NAME' => $_POST['new_db'],
111 'DEFAULT_COLLATION_NAME' => $db_collation_for_ajax
112 );
113 }
114
115 list($column_order, $generated_html) = PMA_buildHtmlForDb(
116 $current, $is_superuser, $url_query,
117 $column_order, $replication_types, $GLOBALS['replication_info']
118 );
119 $new_db_string .= $generated_html;
120
121 $new_db_string .= '</tr>';
122
123 $response = PMA_Response::getInstance();
124 $response->addJSON('message', $message);
125 $response->addJSON('new_db_string', $new_db_string);
126 $response->addJSON(
127 'sql_query',
128 PMA_Util::getMessage(
129 null, $sql_query, 'success'
130 )
131 );
132 $response->addJSON(
133 'url_query',
134 PMA_Util::getScriptNameForOption(
135 $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
136 )
137 . $url_query . '&amp;db='
138 . urlencode($current['SCHEMA_NAME'])
139 );
140 } else {
141 include_once '' . PMA_Util::getScriptNameForOption(
142 $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
143 );
144 }
145 }
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Renders data dictionary
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Gets the variables sent or posted to this script, then displays headers
11 */
12 require_once 'libraries/common.inc.php';
13
14 if (! isset($selected_tbl)) {
15 include 'libraries/db_common.inc.php';
16 list(
17 $tables,
18 $num_tables,
19 $total_num_tables,
20 $sub_part,
21 $is_show_stats,
22 $db_is_system_schema,
23 $tooltip_truename,
24 $tooltip_aliasname,
25 $pos
26 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
27 }
28
29 $response = PMA_Response::getInstance();
30 $header = $response->getHeader();
31 $header->enablePrintView();
32
33 /**
34 * Gets the relations settings
35 */
36 $cfgRelation = PMA_getRelationsParam();
37
38 require_once 'libraries/transformations.lib.php';
39 require_once 'libraries/Index.class.php';
40
41 /**
42 * Check parameters
43 */
44 PMA_Util::checkParameters(array('db'));
45
46 /**
47 * Defines the url to return to in case of error in a sql statement
48 */
49 $err_url = 'db_sql.php' . PMA_URL_getCommon(array('db' => $db));
50
51 if ($cfgRelation['commwork']) {
52 $comment = PMA_getDbComment($db);
53
54 /**
55 * Displays DB comment
56 */
57 if ($comment) {
58 echo '<p>' . __('Database comment')
59 . '<br /><i>' . htmlspecialchars($comment) . '</i></p>';
60 } // end if
61 }
62
63 /**
64 * Selects the database and gets tables names
65 */
66 $GLOBALS['dbi']->selectDb($db);
67 $tables = $GLOBALS['dbi']->getTables($db);
68
69 $count = 0;
70 foreach ($tables as $table) {
71 $comments = PMA_getComments($db, $table);
72
73 echo '<div>' . "\n";
74
75 echo '<h2>' . htmlspecialchars($table) . '</h2>' . "\n";
76
77 /**
78 * Gets table information
79 */
80 $show_comment = $GLOBALS['dbi']->getTable($db, $table)
81 ->getStatusInfo('TABLE_COMMENT');
82
83 /**
84 * Gets table keys and retains them
85 */
86 $GLOBALS['dbi']->selectDb($db);
87 $indexes = $GLOBALS['dbi']->getTableIndexes($db, $table);
88 list($primary, $pk_array, $indexes_info, $indexes_data)
89 = PMA_Util::processIndexData($indexes);
90
91 /**
92 * Gets columns properties
93 */
94 $columns = $GLOBALS['dbi']->getColumns($db, $table);
95
96 // Check if we can use Relations
97 list($res_rel, $have_rel) = PMA_getRelationsAndStatus(
98 ! empty($cfgRelation['relation']), $db, $table
99 );
100
101 /**
102 * Displays the comments of the table if MySQL >= 3.23
103 */
104 if (!empty($show_comment)) {
105 echo __('Table comments:') . ' ';
106 echo htmlspecialchars($show_comment) . '<br /><br />';
107 }
108
109 /**
110 * Displays the table structure
111 */
112
113 echo '<table width="100%" class="print">';
114 echo '<tr><th width="50">' . __('Column') . '</th>';
115 echo '<th width="80">' . __('Type') . '</th>';
116 echo '<th width="40">' . __('Null') . '</th>';
117 echo '<th width="70">' . __('Default') . '</th>';
118 if ($have_rel) {
119 echo ' <th>' . __('Links to') . '</th>' . "\n";
120 }
121 echo ' <th>' . __('Comments') . '</th>' . "\n";
122 if ($cfgRelation['mimework']) {
123 echo ' <th>MIME</th>' . "\n";
124 }
125 echo '</tr>';
126 $odd_row = true;
127 foreach ($columns as $row) {
128
129 if ($row['Null'] == '') {
130 $row['Null'] = 'NO';
131 }
132 $extracted_columnspec
133 = PMA_Util::extractColumnSpec($row['Type']);
134
135 // reformat mysql query output
136 // set or enum types: slashes single quotes inside options
137
138 $type = htmlspecialchars($extracted_columnspec['print_type']);
139 $attribute = $extracted_columnspec['attribute'];
140 if (! isset($row['Default'])) {
141 if ($row['Null'] != 'NO') {
142 $row['Default'] = '<i>NULL</i>';
143 }
144 } else {
145 $row['Default'] = htmlspecialchars($row['Default']);
146 }
147 $column_name = $row['Field'];
148
149 echo '<tr class="';
150 echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row;
151 echo '">';
152 echo '<td class="nowrap">';
153 echo htmlspecialchars($column_name);
154
155 if (isset($pk_array[$row['Field']])) {
156 echo ' <em>(' . __('Primary') . ')</em>';
157 }
158 echo '</td>';
159 echo '<td'
160 . PMA_Util::getClassForType(
161 $extracted_columnspec['type']
162 )
163 . ' lang="en" dir="ltr">' . $type . '</td>';
164
165 echo '<td>';
166 echo (($row['Null'] == 'NO') ? __('No') : __('Yes'));
167 echo '</td>';
168 echo '<td class="nowrap">';
169 if (isset($row['Default'])) {
170 echo $row['Default'];
171 }
172 echo '</td>';
173
174 if ($have_rel) {
175 echo ' <td>';
176 if ($foreigner = PMA_searchColumnInForeigners($res_rel, $column_name)) {
177 echo htmlspecialchars(
178 $foreigner['foreign_table']
179 . ' -> '
180 . $foreigner['foreign_field']
181 );
182 }
183 echo '</td>' . "\n";
184 }
185 echo ' <td>';
186 if (isset($comments[$column_name])) {
187 echo htmlspecialchars($comments[$column_name]);
188 }
189 echo '</td>' . "\n";
190 if ($cfgRelation['mimework']) {
191 $mime_map = PMA_getMIME($db, $table, true);
192
193 echo ' <td>';
194 if (isset($mime_map[$column_name])) {
195 echo htmlspecialchars(
196 str_replace('_', '/', $mime_map[$column_name]['mimetype'])
197 );
198 }
199 echo '</td>' . "\n";
200 }
201 echo '</tr>';
202 } // end foreach
203 $count++;
204 echo '</table>';
205 // display indexes information
206 if (count(PMA_Index::getFromTable($table, $db)) > 0) {
207 echo PMA_Index::getHtmlForIndexes($table, $db, true);
208 }
209 echo '</div>';
210 } //ends main while
211
212 /**
213 * Displays the footer
214 */
215 echo PMA_Util::getButton();
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * phpMyAdmin designer general code
5 *
6 * @package PhpMyAdmin-Designer
7 */
8
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/pmd_common.php';
11 require_once 'libraries/db_designer.lib.php';
12
13 $response = PMA_Response::getInstance();
14
15 if (isset($_REQUEST['dialog'])) {
16
17 if ($_REQUEST['dialog'] == 'edit') {
18 $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage');
19 } else if ($_REQUEST['dialog'] == 'delete') {
20 $html = PMA_getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage');
21 } else if ($_REQUEST['dialog'] == 'save_as') {
22 $html = PMA_getHtmlForPageSaveAs($GLOBALS['db']);
23 } else if ($_REQUEST['dialog'] == 'export') {
24 include_once 'libraries/plugin_interface.lib.php';
25 $html = PMA_getHtmlForSchemaExport(
26 $GLOBALS['db'], $_REQUEST['selected_page']
27 );
28 }
29
30 if (! empty($html)) {
31 $response->addHTML($html);
32 }
33 return;
34 }
35
36 if (isset($_REQUEST['operation'])) {
37
38 if ($_REQUEST['operation'] == 'deletePage') {
39 $success = PMA_deletePage($_REQUEST['selected_page']);
40 $response->isSuccess($success);
41 } elseif ($_REQUEST['operation'] == 'savePage') {
42 if ($_REQUEST['save_page'] == 'same') {
43 $page = $_REQUEST['selected_page'];
44 } else { // new
45 $page = PMA_createNewPage($_REQUEST['selected_value'], $GLOBALS['db']);
46 $response->addJSON('id', $page);
47 }
48 $success = PMA_saveTablePositions($page);
49 $response->isSuccess($success);
50 } elseif ($_REQUEST['operation'] == 'setDisplayField') {
51 PMA_saveDisplayField(
52 $_REQUEST['db'], $_REQUEST['table'], $_REQUEST['field']
53 );
54 $response->isSuccess(true);
55 } elseif ($_REQUEST['operation'] == 'addNewRelation') {
56 list($success, $message) = PMA_addNewRelation(
57 $_REQUEST['db'],
58 $_REQUEST['T1'],
59 $_REQUEST['F1'],
60 $_REQUEST['T2'],
61 $_REQUEST['F2'],
62 $_REQUEST['on_delete'],
63 $_REQUEST['on_update']
64 );
65 $response->isSuccess($success);
66 $response->addJSON('message', $message);
67 } elseif ($_REQUEST['operation'] == 'removeRelation') {
68 list($success, $message) = PMA_removeRelation(
69 $_REQUEST['T1'],
70 $_REQUEST['F1'],
71 $_REQUEST['T2'],
72 $_REQUEST['F2']
73 );
74 $response->isSuccess($success);
75 $response->addJSON('message', $message);
76 } elseif ($_REQUEST['operation'] == 'save_setting_value') {
77 $success = PMA_saveDesignerSetting($_REQUEST['index'], $_REQUEST['value']);
78 $response->isSuccess($success);
79 }
80
81 return;
82 }
83
84 $script_display_field = PMA_getTablesInfo();
85 $tab_column = PMA_getColumnsInfo();
86 $script_tables = PMA_getScriptTabs();
87 $tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys();
88 $tables_all_keys = PMA_getAllKeys();
89 $classes_side_menu = PMA_returnClassNamesFromMenuButtons();
90
91 $display_page = -1;
92 $selected_page = null;
93
94 if (isset($_REQUEST['query'])) {
95 $display_page = PMA_getDefaultPage($_REQUEST['db']);
96 } else {
97 if (! empty($_REQUEST['page'])) {
98 $display_page = $_REQUEST['page'];
99 } else {
100 $display_page = PMA_getLoadingPage($_REQUEST['db']);
101 }
102 }
103 if ($display_page != -1) {
104 $selected_page = PMA_getPageName($display_page);
105 }
106 $tab_pos = PMA_getTablePositions($display_page);
107 $script_contr = PMA_getScriptContr();
108
109 $params = array('lang' => $GLOBALS['lang']);
110 if (isset($_GET['db'])) {
111 $params['db'] = $_GET['db'];
112 }
113
114 $response = PMA_Response::getInstance();
115 $response->getFooter()->setMinimal();
116 $header = $response->getHeader();
117 $header->setBodyId('pmd_body');
118
119 $scripts = $header->getScripts();
120 $scripts->addFile('jquery/jquery.fullscreen.js');
121 $scripts->addFile('pmd/designer_db.js');
122 $scripts->addFile('pmd/designer_objects.js');
123 $scripts->addFile('pmd/designer_page.js');
124 $scripts->addFile('pmd/history.js');
125 $scripts->addFile('pmd/move.js');
126 $scripts->addFile('pmd/iecanvas.js', true);
127 $scripts->addFile('pmd/init.js');
128
129 require 'libraries/db_common.inc.php';
130
131 list(
132 $tables,
133 $num_tables,
134 $total_num_tables,
135 $sub_part,
136 $is_show_stats,
137 $db_is_system_schema,
138 $tooltip_truename,
139 $tooltip_aliasname,
140 $pos
141 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
142
143 // Embed some data into HTML, later it will be read
144 // by pmd/init.js and converted to JS variables.
145 $response->addHTML(
146 PMA_getHtmlForJSFields(
147 $script_tables, $script_contr, $script_display_field, $display_page
148 )
149 );
150 $response->addHTML(
151 PMA_getDesignerPageMenu(isset($_REQUEST['query']), $selected_page, $classes_side_menu)
152 );
153
154
155
156 $response->addHTML('<div id="canvas_outer">');
157 $response->addHTML(
158 '<form action="" id="container-form" method="post" name="form1">'
159 );
160
161 $response->addHTML(PMA_getHTMLCanvas());
162 $response->addHTML(PMA_getHTMLTableList($tab_pos, $display_page));
163
164 $response->addHTML(
165 PMA_getDatabaseTables(
166 $tab_pos, $display_page, $tab_column,
167 $tables_all_keys, $tables_pk_or_unique_keys
168 )
169 );
170 $response->addHTML('</form>');
171 $response->addHTML('</div>'); // end canvas_outer
172
173 $response->addHTML('<div id="pmd_hint"></div>');
174
175 $response->addHTML(PMA_getNewRelationPanel());
176 $response->addHTML(PMA_getDeleteRelationPanel());
177
178 if (isset($_REQUEST['query'])) {
179 $response->addHTML(PMA_getOptionsPanel());
180 $response->addHTML(PMA_getRenameToPanel());
181 $response->addHTML(PMA_getHavingQueryPanel());
182 $response->addHTML(PMA_getAggregateQueryPanel());
183 $response->addHTML(PMA_getWhereQueryPanel());
184 $response->addHTML(PMA_getQueryDetails());
185 }
186
187 $response->addHTML('<div id="PMA_disable_floating_menubar"></div>');
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Events management.
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Include required files
11 */
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/Util.class.php';
14
15 /**
16 * Include all other files
17 */
18 require_once 'libraries/rte/rte_events.lib.php';
19
20 /**
21 * Do the magic
22 */
23 $_PMA_RTE = 'EVN';
24 require_once 'libraries/rte/rte_main.inc.php';
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * dumps a database
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Gets some core libraries
11 */
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/config/page_settings.class.php';
14 require_once 'libraries/export.lib.php';
15
16 PMA_PageSettings::showGroup('Export');
17
18 $response = PMA_Response::getInstance();
19 $header = $response->getHeader();
20 $scripts = $header->getScripts();
21 $scripts->addFile('export.js');
22
23 // $sub_part is used in PMA_Util::getDbInfo() to see if we are coming from
24 // db_export.php, in which case we don't obey $cfg['MaxTableList']
25 $sub_part = '_export';
26 require_once 'libraries/db_common.inc.php';
27 $url_query .= '&amp;goto=db_export.php';
28
29 list(
30 $tables,
31 $num_tables,
32 $total_num_tables,
33 $sub_part,
34 $is_show_stats,
35 $db_is_system_schema,
36 $tooltip_truename,
37 $tooltip_aliasname,
38 $pos
39 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
40
41 /**
42 * Displays the form
43 */
44 $export_page_title = __('View dump (schema) of database');
45
46 // exit if no tables in db found
47 if ($num_tables < 1) {
48 PMA_Message::error(__('No tables found in database.'))->display();
49 exit;
50 } // end if
51
52 $multi_values = '<div class="export_table_list_container">';
53 if (isset($_GET['structure_or_data_forced'])) {
54 $force_val = htmlspecialchars($_GET['structure_or_data_forced']);
55 } else {
56 $force_val = 0;
57 }
58 $multi_values .= '<input type="hidden" name="structure_or_data_forced" value="'
59 . $force_val . '">';
60 $multi_values .= '<table class="export_table_select">'
61 . '<thead><tr><th></th>'
62 . '<th>' . __('Tables') . '</th>'
63 . '<th class="export_structure">' . __('Structure') . '</th>'
64 . '<th class="export_data">' . __('Data') . '</th>'
65 . '</tr><tr>'
66 . '<td></td>'
67 . '<td class="export_table_name all">' . __('Select all') . '</td>'
68 . '<td class="export_structure all">'
69 . '<input type="checkbox" id="table_structure_all" /></td>'
70 . '<td class="export_data all"><input type="checkbox" id="table_data_all" />'
71 . '</td>'
72 . '</tr></thead>'
73 . '<tbody>';
74 $multi_values .= "\n";
75
76 // when called by libraries/mult_submits.inc.php
77 if (!empty($_POST['selected_tbl']) && empty($table_select)) {
78 $table_select = $_POST['selected_tbl'];
79 }
80
81 // Check if the selected tables are defined in $_GET
82 // (from clicking Back button on export.php)
83 foreach (array('table_select', 'table_structure', 'table_data') as $one_key) {
84 if (isset($_GET[$one_key])) {
85 $_GET[$one_key] = urldecode($_GET[$one_key]);
86 $_GET[$one_key] = explode(",", $_GET[$one_key]);
87 }
88 }
89
90 foreach ($tables as $each_table) {
91 if (isset($_GET['table_select'])) {
92 $is_checked = PMA_getCheckedClause(
93 $each_table['Name'], $_GET['table_select']
94 );
95 } elseif (isset($table_select)) {
96 $is_checked = PMA_getCheckedClause(
97 $each_table['Name'], $table_select
98 );
99 } else {
100 $is_checked = ' checked="checked"';
101 }
102 if (isset($_GET['table_structure'])) {
103 $structure_checked = PMA_getCheckedClause(
104 $each_table['Name'], $_GET['table_structure']
105 );
106 } else {
107 $structure_checked = $is_checked;
108 }
109 if (isset($_GET['table_data'])) {
110 $data_checked = PMA_getCheckedClause(
111 $each_table['Name'], $_GET['table_data']
112 );
113 } else {
114 $data_checked = $is_checked;
115 }
116 $table_html = htmlspecialchars($each_table['Name']);
117 $multi_values .= '<tr>';
118 $multi_values .= '<td><input type="checkbox" name="table_select[]"'
119 . ' value="' . $table_html . '"' . $is_checked . ' /></td>';
120 $multi_values .= '<td class="export_table_name">'
121 . str_replace(' ', '&nbsp;', $table_html) . '</td>';
122 $multi_values .= '<td class="export_structure">'
123 . '<input type="checkbox" name="table_structure[]"'
124 . ' value="' . $table_html . '"' . $structure_checked . ' /></td>';
125 $multi_values .= '<td class="export_data">'
126 . '<input type="checkbox" name="table_data[]"'
127 . ' value="' . $table_html . '"' . $data_checked . ' /></td>';
128 $multi_values .= '</tr>';
129 } // end for
130
131 $multi_values .= "\n";
132 $multi_values .= '</tbody></table></div>';
133
134 $export_type = 'database';
135 require_once 'libraries/display_export.inc.php';
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Database import page
5 *
6 * @package PhpMyAdmin
7 */
8
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/config/page_settings.class.php';
11
12 PMA_PageSettings::showGroup('Import');
13
14 $response = PMA_Response::getInstance();
15 $header = $response->getHeader();
16 $scripts = $header->getScripts();
17 $scripts->addFile('import.js');
18
19 /**
20 * Gets tables information and displays top links
21 */
22 require 'libraries/db_common.inc.php';
23
24 list(
25 $tables,
26 $num_tables,
27 $total_num_tables,
28 $sub_part,
29 $is_show_stats,
30 $db_is_system_schema,
31 $tooltip_truename,
32 $tooltip_aliasname,
33 $pos
34 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
35
36 require 'libraries/display_import.lib.php';
37 $response = PMA_Response::getInstance();
38 $response->addHTML(
39 PMA_getImportDisplay(
40 'database', $db, $table, $max_upload_size
41 )
42 );
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * handles miscellaneous db operations:
5 * - move/rename
6 * - copy
7 * - changing collation
8 * - changing comment
9 * - adding tables
10 * - viewing PDF schemas
11 *
12 * @package PhpMyAdmin
13 */
14
15 /**
16 * requirements
17 */
18 require_once 'libraries/common.inc.php';
19 require_once 'libraries/mysql_charsets.inc.php';
20 require_once 'libraries/display_create_table.lib.php';
21
22 /**
23 * functions implementation for this script
24 */
25 require_once 'libraries/check_user_privileges.lib.php';
26 require_once 'libraries/operations.lib.php';
27
28 // add a javascript file for jQuery functions to handle Ajax actions
29 $response = PMA_Response::getInstance();
30 $header = $response->getHeader();
31 $scripts = $header->getScripts();
32 $scripts->addFile('db_operations.js');
33
34 $sql_query = '';
35
36 /**
37 * Rename/move or copy database
38 */
39 /** @var PMA_String $pmaString */
40 $pmaString = $GLOBALS['PMA_String'];
41 if (/*overload*/mb_strlen($GLOBALS['db'])
42 && (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy']))
43 ) {
44 if (! empty($_REQUEST['db_rename'])) {
45 $move = true;
46 } else {
47 $move = false;
48 }
49
50 if (! isset($_REQUEST['newname'])
51 || ! /*overload*/mb_strlen($_REQUEST['newname'])
52 ) {
53 $message = PMA_Message::error(__('The database name is empty!'));
54 } else {
55 $_error = false;
56 if ($move || ! empty($_REQUEST['create_database_before_copying'])) {
57 PMA_createDbBeforeCopy();
58 }
59
60 // here I don't use DELIMITER because it's not part of the
61 // language; I have to send each statement one by one
62
63 // to avoid selecting alternatively the current and new db
64 // we would need to modify the CREATE definitions to qualify
65 // the db name
66 PMA_runProcedureAndFunctionDefinitions($GLOBALS['db']);
67
68 // go back to current db, just in case
69 $GLOBALS['dbi']->selectDb($GLOBALS['db']);
70
71 $tables_full = $GLOBALS['dbi']->getTablesFull($GLOBALS['db']);
72
73 include_once "libraries/plugin_interface.lib.php";
74 // remove all foreign key constraints, otherwise we can get errors
75 /* @var $export_sql_plugin ExportSql */
76 $export_sql_plugin = PMA_getPlugin(
77 "export",
78 "sql",
79 'libraries/plugins/export/',
80 array(
81 'single_table' => isset($single_table),
82 'export_type' => 'database'
83 )
84 );
85
86 // create stand-in tables for views
87 $views = PMA_getViewsAndCreateSqlViewStandIn(
88 $tables_full, $export_sql_plugin, $GLOBALS['db']
89 );
90
91 // copy tables
92 $sqlConstratints = PMA_copyTables(
93 $tables_full, $move, $GLOBALS['db']
94 );
95
96 // handle the views
97 if (! $_error) {
98 PMA_handleTheViews($views, $move, $GLOBALS['db']);
99 }
100 unset($views);
101
102 // now that all tables exist, create all the accumulated constraints
103 if (! $_error && count($sqlConstratints) > 0) {
104 PMA_createAllAccumulatedConstraints($sqlConstratints);
105 }
106 unset($sqlConstratints);
107
108 if (! PMA_DRIZZLE && PMA_MYSQL_INT_VERSION >= 50100) {
109 // here DELIMITER is not used because it's not part of the
110 // language; each statement is sent one by one
111
112 PMA_runEventDefinitionsForDb($GLOBALS['db']);
113 }
114
115 // go back to current db, just in case
116 $GLOBALS['dbi']->selectDb($GLOBALS['db']);
117
118 // Duplicate the bookmarks for this db (done once for each db)
119 PMA_duplicateBookmarks($_error, $GLOBALS['db']);
120
121 if (! $_error && $move) {
122 if (isset($_REQUEST['adjust_privileges'])
123 && ! empty($_REQUEST['adjust_privileges'])
124 ) {
125 PMA_AdjustPrivileges_moveDB($GLOBALS['db'], $_REQUEST['newname']);
126 }
127
128 /**
129 * cleanup pmadb stuff for this db
130 */
131 include_once 'libraries/relation_cleanup.lib.php';
132 PMA_relationsCleanupDatabase($GLOBALS['db']);
133
134 // if someday the RENAME DATABASE reappears, do not DROP
135 $local_query = 'DROP DATABASE '
136 . PMA_Util::backquote($GLOBALS['db']) . ';';
137 $sql_query .= "\n" . $local_query;
138 $GLOBALS['dbi']->query($local_query);
139
140 $message = PMA_Message::success(
141 __('Database %1$s has been renamed to %2$s.')
142 );
143 $message->addParam($GLOBALS['db']);
144 $message->addParam($_REQUEST['newname']);
145 } elseif (! $_error) {
146 if (isset($_REQUEST['adjust_privileges'])
147 && ! empty($_REQUEST['adjust_privileges'])
148 ) {
149 PMA_AdjustPrivileges_copyDB($GLOBALS['db'], $_REQUEST['newname']);
150 }
151
152 $message = PMA_Message::success(
153 __('Database %1$s has been copied to %2$s.')
154 );
155 $message->addParam($GLOBALS['db']);
156 $message->addParam($_REQUEST['newname']);
157 } else {
158 $message = PMA_Message::error();
159 }
160 $reload = true;
161
162 /* Change database to be used */
163 if (! $_error && $move) {
164 $GLOBALS['db'] = $_REQUEST['newname'];
165 } elseif (! $_error) {
166 if (isset($_REQUEST['switch_to_new'])
167 && $_REQUEST['switch_to_new'] == 'true'
168 ) {
169 $GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', 'true');
170 $GLOBALS['db'] = $_REQUEST['newname'];
171 } else {
172 $GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', '');
173 }
174 }
175 }
176
177 /**
178 * Database has been successfully renamed/moved. If in an Ajax request,
179 * generate the output with {@link PMA_Response} and exit
180 */
181 if ($GLOBALS['is_ajax_request'] == true) {
182 $response = PMA_Response::getInstance();
183 $response->isSuccess($message->isSuccess());
184 $response->addJSON('message', $message);
185 $response->addJSON('newname', $_REQUEST['newname']);
186 $response->addJSON(
187 'sql_query',
188 PMA_Util::getMessage(null, $sql_query)
189 );
190 $response->addJSON('db', $GLOBALS['db']);
191 exit;
192 }
193 }
194
195 /**
196 * Settings for relations stuff
197 */
198
199 $cfgRelation = PMA_getRelationsParam();
200
201 /**
202 * Check if comments were updated
203 * (must be done before displaying the menu tabs)
204 */
205 if (isset($_REQUEST['comment'])) {
206 PMA_setDbComment($GLOBALS['db'], $_REQUEST['comment']);
207 }
208
209 require 'libraries/db_common.inc.php';
210 $url_query .= '&amp;goto=db_operations.php';
211
212 // Gets the database structure
213 $sub_part = '_structure';
214
215 list(
216 $tables,
217 $num_tables,
218 $total_num_tables,
219 $sub_part,
220 $is_show_stats,
221 $db_is_system_schema,
222 $tooltip_truename,
223 $tooltip_aliasname,
224 $pos
225 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
226
227 echo "\n";
228
229 if (isset($message)) {
230 echo PMA_Util::getMessage($message, $sql_query);
231 unset($message);
232 }
233
234 $_REQUEST['db_collation'] = PMA_getDbCollation($GLOBALS['db']);
235 $is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']);
236
237 $response->addHTML('<div id="boxContainer" data-box-width="300">');
238
239 if (!$is_information_schema) {
240 if ($cfgRelation['commwork']) {
241 /**
242 * database comment
243 */
244 $response->addHTML(PMA_getHtmlForDatabaseComment($GLOBALS['db']));
245 }
246
247 $response->addHTML('<div class="operations_half_width">');
248 $response->addHTML(PMA_getHtmlForCreateTable($db));
249 $response->addHTML('</div>');
250
251 /**
252 * rename database
253 */
254 if ($GLOBALS['db'] != 'mysql') {
255 $response->addHTML(PMA_getHtmlForRenameDatabase($GLOBALS['db']));
256 }
257
258 // Drop link if allowed
259 // Don't even try to drop information_schema.
260 // You won't be able to. Believe me. You won't.
261 // Don't allow to easily drop mysql database, RFE #1327514.
262 if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
263 && ! $db_is_system_schema
264 && (PMA_DRIZZLE || $GLOBALS['db'] != 'mysql')
265 ) {
266 $response->addHTML(PMA_getHtmlForDropDatabaseLink($GLOBALS['db']));
267 }
268 /**
269 * Copy database
270 */
271 $response->addHTML(PMA_getHtmlForCopyDatabase($GLOBALS['db']));
272
273 /**
274 * Change database charset
275 */
276 $response->addHTML(PMA_getHtmlForChangeDatabaseCharset($GLOBALS['db'], $table));
277
278 if (! $cfgRelation['allworks']
279 && $cfg['PmaNoRelation_DisableWarning'] == false
280 ) {
281 $message = PMA_Message::notice(
282 __(
283 'The phpMyAdmin configuration storage has been deactivated. ' .
284 '%sFind out why%s.'
285 )
286 );
287 $message->addParam(
288 '<a href="' . $cfg['PmaAbsoluteUri']
289 . 'chk_rel.php' . $url_query . '">',
290 false
291 );
292 $message->addParam('</a>', false);
293 /* Show error if user has configured something, notice elsewhere */
294 if (!empty($cfg['Servers'][$server]['pmadb'])) {
295 $message->isError(true);
296 }
297 } // end if
298 } // end if (!$is_information_schema)
299
300 $response->addHTML('</div>');
301
302 // not sure about displaying the PDF dialog in case db is information_schema
303 if ($cfgRelation['pdfwork'] && $num_tables > 0) {
304 // We only show this if we find something in the new pdf_pages table
305 $test_query = '
306 SELECT *
307 FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
308 . '.' . PMA_Util::backquote($cfgRelation['pdf_pages']) . '
309 WHERE db_name = \'' . PMA_Util::sqlAddSlashes($GLOBALS['db']) . '\'';
310 $test_rs = PMA_queryAsControlUser(
311 $test_query,
312 false,
313 PMA_DatabaseInterface::QUERY_STORE
314 );
315 } // end if
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * query by example the whole database
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * requirements
11 */
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/DBQbe.class.php';
14 require_once 'libraries/bookmark.lib.php';
15 require_once 'libraries/sql.lib.php';
16
17 $response = PMA_Response::getInstance();
18
19 // Gets the relation settings
20 $cfgRelation = PMA_getRelationsParam();
21
22 $savedSearchList = array();
23 $savedSearch = null;
24 $currentSearchId = null;
25 if ($cfgRelation['savedsearcheswork']) {
26 include 'libraries/SavedSearches.class.php';
27 $header = $response->getHeader();
28 $scripts = $header->getScripts();
29 $scripts->addFile('db_qbe.js');
30
31 //Get saved search list.
32 $savedSearch = new PMA_SavedSearches($GLOBALS);
33 $savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
34 ->setDbname($_REQUEST['db']);
35
36 if (!empty($_REQUEST['searchId'])) {
37 $savedSearch->setId($_REQUEST['searchId']);
38 }
39
40 //Action field is sent.
41 if (isset($_REQUEST['action'])) {
42 $savedSearch->setSearchName($_REQUEST['searchName']);
43 if ('create' === $_REQUEST['action']) {
44 $saveResult = $savedSearch->setId(null)
45 ->setCriterias($_REQUEST)
46 ->save();
47 } elseif ('update' === $_REQUEST['action']) {
48 $saveResult = $savedSearch->setCriterias($_REQUEST)
49 ->save();
50 } elseif ('delete' === $_REQUEST['action']) {
51 $deleteResult = $savedSearch->delete();
52 //After deletion, reset search.
53 $savedSearch = new PMA_SavedSearches($GLOBALS);
54 $savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
55 ->setDbname($_REQUEST['db']);
56 $_REQUEST = array();
57 } elseif ('load' === $_REQUEST['action']) {
58 if (empty($_REQUEST['searchId'])) {
59 //when not loading a search, reset the object.
60 $savedSearch = new PMA_SavedSearches($GLOBALS);
61 $savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
62 ->setDbname($_REQUEST['db']);
63 $_REQUEST = array();
64 } else {
65 $loadResult = $savedSearch->load();
66 }
67 }
68 //Else, it's an "update query"
69 }
70
71 $savedSearchList = $savedSearch->getList();
72 $currentSearchId = $savedSearch->getId();
73 }
74
75 /**
76 * A query has been submitted -> (maybe) execute it
77 */
78 $message_to_display = false;
79 if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
80 if (! preg_match('@^SELECT@i', $sql_query)) {
81 $message_to_display = true;
82 } else {
83 $goto = 'db_sql.php';
84
85 // Parse and analyze the query
86 include_once 'libraries/parse_analyze.inc.php';
87
88 PMA_executeQueryAndSendQueryResponse(
89 $analyzed_sql_results, // analyzed_sql_results
90 false, // is_gotofile
91 $_REQUEST['db'], // db
92 null, // table
93 false, // find_real_end
94 null, // sql_query_for_bookmark
95 null, // extra_data
96 null, // message_to_show
97 null, // message
98 null, // sql_data
99 $goto, // goto
100 $pmaThemeImage, // pmaThemeImage
101 null, // disp_query
102 null, // disp_message
103 null, // query_type
104 $sql_query, // sql_query
105 null, // selectedTables
106 null // complete_query
107 );
108 }
109 }
110
111 $sub_part = '_qbe';
112 require 'libraries/db_common.inc.php';
113 $url_query .= '&amp;goto=db_qbe.php';
114 $url_params['goto'] = 'db_qbe.php';
115
116 list(
117 $tables,
118 $num_tables,
119 $total_num_tables,
120 $sub_part,
121 $is_show_stats,
122 $db_is_system_schema,
123 $tooltip_truename,
124 $tooltip_aliasname,
125 $pos
126 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
127
128 if ($message_to_display) {
129 PMA_Message::error(__('You have to choose at least one column to display!'))
130 ->display();
131 }
132 unset($message_to_display);
133
134 // create new qbe search instance
135 $db_qbe = new PMA_DbQbe($GLOBALS['db'], $savedSearchList, $savedSearch);
136
137 $url = 'db_designer.php' . PMA_URL_getCommon(
138 array_merge(
139 $url_params,
140 array('query' => 1)
141 )
142 );
143 $response->addHTML(
144 PMA_Message::notice(
145 sprintf(
146 __('Switch to %svisual builder%s'),
147 '<a href="' . $url . '">',
148 '</a>'
149 )
150 )
151 );
152
153 /**
154 * Displays the Query by example form
155 */
156 $response->addHTML($db_qbe->getSelectionForm());
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Routines management.
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Include required files
11 */
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/Util.class.php';
14 require_once 'libraries/mysql_charsets.inc.php';
15
16 /**
17 * Include all other files
18 */
19 require_once 'libraries/check_user_privileges.lib.php';
20 require_once 'libraries/rte/rte_routines.lib.php';
21
22 /**
23 * Do the magic
24 */
25 $_PMA_RTE = 'RTN';
26 require_once 'libraries/rte/rte_main.inc.php';
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * searches the entire database
5 *
6 * @todo make use of UNION when searching multiple tables
7 * @todo display executed query, optional?
8 * @package PhpMyAdmin
9 */
10
11 /**
12 * Gets some core libraries
13 */
14 require_once 'libraries/common.inc.php';
15 require_once 'libraries/DbSearch.class.php';
16
17 $response = PMA_Response::getInstance();
18 $header = $response->getHeader();
19 $scripts = $header->getScripts();
20 $scripts->addFile('db_search.js');
21 $scripts->addFile('sql.js');
22 $scripts->addFile('makegrid.js');
23 $scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
24
25 require 'libraries/db_common.inc.php';
26
27 // If config variable $GLOBALS['cfg']['UseDbSearch'] is on false : exit.
28 if (! $GLOBALS['cfg']['UseDbSearch']) {
29 PMA_Util::mysqlDie(
30 __('Access denied!'), '', false, $err_url
31 );
32 } // end if
33 $url_query .= '&amp;goto=db_search.php';
34 $url_params['goto'] = 'db_search.php';
35
36 // Create a database search instance
37 $db_search = new PMA_DbSearch($GLOBALS['db']);
38
39 // Display top links if we are not in an Ajax request
40 if ($GLOBALS['is_ajax_request'] != true) {
41 list(
42 $tables,
43 $num_tables,
44 $total_num_tables,
45 $sub_part,
46 $is_show_stats,
47 $db_is_system_schema,
48 $tooltip_truename,
49 $tooltip_aliasname,
50 $pos
51 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
52 }
53
54 // Main search form has been submitted, get results
55 if (isset($_REQUEST['submit_search'])) {
56 $response->addHTML($db_search->getSearchResults());
57 } else {
58 $response->addHTML('<div id="searchresults"></div>');
59 }
60
61 // If we are in an Ajax request, we need to exit after displaying all the HTML
62 if ($GLOBALS['is_ajax_request'] == true && empty($_REQUEST['ajax_page_request'])) {
63 exit;
64 }
65
66 // Display the search form
67 $response->addHTML(
68 '<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>'
69 . '<br class="clearfloat" />'
70 );
71 $response->addHTML($db_search->getSelectionForm());
72 $response->addHTML($db_search->getResultDivs());
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Database SQL executor
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 *
11 */
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/config/page_settings.class.php';
14
15 PMA_PageSettings::showGroup('Sql_queries');
16
17 /**
18 * Runs common work
19 */
20 $response = PMA_Response::getInstance();
21 $header = $response->getHeader();
22 $scripts = $header->getScripts();
23 $scripts->addFile('functions.js');
24 $scripts->addFile('makegrid.js');
25 $scripts->addFile('jquery/jquery.uitablefilter.js');
26 $scripts->addFile('sql.js');
27
28 require 'libraries/db_common.inc.php';
29 require_once 'libraries/sql_query_form.lib.php';
30
31 // After a syntax error, we return to this script
32 // with the typed query in the textarea.
33 $goto = 'db_sql.php';
34 $back = 'db_sql.php';
35
36 /**
37 * Query box, bookmark, insert data from textfile
38 */
39 $response->addHTML(
40 PMA_getHtmlForSqlQueryForm(
41 true, false,
42 isset($_REQUEST['delimiter'])
43 ? htmlspecialchars($_REQUEST['delimiter'])
44 : ';'
45 )
46 );
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Table/Column autocomplete in SQL editors
5 *
6 * @package PhpMyAdmin
7 */
8
9 require_once 'libraries/common.inc.php';
10
11 if ($GLOBALS['cfg']['EnableAutocompleteForTablesAndColumns']) {
12 $db = isset($_POST['db']) ? $_POST['db'] : $GLOBALS['db'];
13 $sql_autocomplete = array();
14 if ($db) {
15 $tableNames = $GLOBALS['dbi']->getTables($db);
16 foreach ($tableNames as $tableName) {
17 $sql_autocomplete[$tableName] = $GLOBALS['dbi']->getColumns(
18 $db, $tableName
19 );
20 }
21 }
22 } else {
23 $sql_autocomplete = true;
24 }
25 $response = PMA_Response::getInstance();
26 $response->addJSON("tables", json_encode($sql_autocomplete));
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Format SQL for SQL editors
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Loading common files. Used to check for authorization, localization and to
11 * load the parsing library.
12 */
13 require_once 'libraries/common.inc.php';
14
15 $query = !empty($_POST['sql']) ? $_POST['sql'] : '';
16
17 $query = SqlParser\Utils\Formatter::format($query);
18
19 $response = PMA_Response::getInstance();
20 $response->addJSON("sql", $query);
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Database structure manipulation
5 *
6 * @package PhpMyAdmin
7 */
8
9 namespace PMA;
10
11 use PMA_Response;
12
13 require_once 'libraries/common.inc.php';
14 require_once 'libraries/db_common.inc.php';
15
16 list(
17 $tables,
18 $num_tables,
19 $total_num_tables,
20 $sub_part,
21 $is_show_stats,
22 $db_is_system_schema,
23 $tooltip_truename,
24 $tooltip_aliasname,
25 $pos
26 ) = \PMA_Util::getDbInfo($GLOBALS['db'], isset($sub_part) ? $sub_part : '');
27
28 require_once 'libraries/di/Container.class.php';
29 require_once 'libraries/controllers/DatabaseStructureController.class.php';
30 require_once 'libraries/Response.class.php';
31
32 $container = DI\Container::getDefaultContainer();
33 $container->factory('PMA\Controllers\DatabaseStructureController');
34 $container->alias(
35 'DatabaseStructureController', 'PMA\Controllers\DatabaseStructureController'
36 );
37 $container->set('PMA_Response', PMA_Response::getInstance());
38 $container->alias('response', 'PMA_Response');
39
40 global $db, $pos, $db_is_system_schema, $total_num_tables, $tables, $num_tables;
41 /* Define dependencies for the concerned controller */
42 $dependency_definitions = array(
43 'db' => $db,
44 'url_query' => &$GLOBALS['url_query'],
45 'pos' => $pos,
46 'db_is_system_schema' => $db_is_system_schema,
47 'num_tables' => $num_tables,
48 'total_num_tables' => $total_num_tables,
49 'tables' => $tables,
50 );
51
52 /** @var Controllers\DatabaseStructureController $controller */
53 $controller = $container->get('DatabaseStructureController', $dependency_definitions);
54 $controller->indexAction();
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Tracking configuration for database
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Run common work
11 */
12 require_once 'libraries/common.inc.php';
13
14 require_once './libraries/tracking.lib.php';
15 require_once 'libraries/display_create_table.lib.php';
16
17 //Get some js files needed for Ajax requests
18 $response = PMA_Response::getInstance();
19 $header = $response->getHeader();
20 $scripts = $header->getScripts();
21 $scripts->addFile('jquery/jquery.tablesorter.js');
22 $scripts->addFile('db_tracking.js');
23
24 /**
25 * If we are not in an Ajax request, then do the common work and show the links etc.
26 */
27 require 'libraries/db_common.inc.php';
28 $url_query .= '&amp;goto=tbl_tracking.php&amp;back=db_tracking.php';
29
30 // Get the database structure
31 $sub_part = '_structure';
32
33 list(
34 $tables,
35 $num_tables,
36 $total_num_tables,
37 $sub_part,
38 $is_show_stats,
39 $db_is_system_schema,
40 $tooltip_truename,
41 $tooltip_aliasname,
42 $pos
43 ) = PMA_Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
44
45 // Work to do?
46 // (here, do not use $_REQUEST['db] as it can be crafted)
47 if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
48
49 PMA_Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
50 PMA_Message::success(
51 __('Tracking data deleted successfully.')
52 )->display();
53
54 } elseif (isset($_REQUEST['submit_create_version'])) {
55
56 PMA_createTrackingForMultipleTables($_REQUEST['selected']);
57 PMA_Message::success(
58 sprintf(
59 __(
60 'Version %1$s was created for selected tables,'
61 . ' tracking is active for them.'
62 ),
63 htmlspecialchars($_REQUEST['version'])
64 )
65 )->display();
66
67 } elseif (isset($_REQUEST['submit_mult'])) {
68
69 if (! empty($_REQUEST['selected_tbl'])) {
70 if ($_REQUEST['submit_mult'] == 'delete_tracking') {
71
72 foreach ($_REQUEST['selected_tbl'] as $table) {
73 PMA_Tracker::deleteTracking($GLOBALS['db'], $table);
74 }
75 PMA_Message::success(
76 __('Tracking data deleted successfully.')
77 )->display();
78
79 } elseif ($_REQUEST['submit_mult'] == 'track') {
80
81 echo PMA_getHtmlForDataDefinitionAndManipulationStatements(
82 'db_tracking.php' . $url_query,
83 0,
84 $GLOBALS['db'],
85 $_REQUEST['selected_tbl']
86 );
87 exit;
88 }
89 } else {
90 PMA_Message::notice(
91 __('No tables selected.')
92 )->display();
93 }
94 }
95
96 // Get tracked data about the database
97 $data = PMA_Tracker::getTrackedData($_REQUEST['db'], '', '1');
98
99 // No tables present and no log exist
100 if ($num_tables == 0 && count($data['ddlog']) == 0) {
101 echo '<p>' . __('No tables found in database.') . '</p>' . "\n";
102
103 if (empty($db_is_system_schema)) {
104 echo PMA_getHtmlForCreateTable($db);
105 }
106 exit;
107 }
108
109 // ---------------------------------------------------------------------------
110 $cfgRelation = PMA_getRelationsParam();
111
112 // Prepare statement to get HEAD version
113 $all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' .
114 PMA_Util::backquote($cfgRelation['db']) . '.' .
115 PMA_Util::backquote($cfgRelation['tracking']) .
116 ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($_REQUEST['db']) . '\' ' .
117 ' GROUP BY table_name' .
118 ' ORDER BY table_name ASC';
119
120 $all_tables_result = PMA_queryAsControlUser($all_tables_query);
121
122 // If a HEAD version exists
123 if (is_object($all_tables_result) && $GLOBALS['dbi']->numRows($all_tables_result) > 0) {
124 PMA_displayTrackedTables(
125 $GLOBALS['db'], $all_tables_result, $url_query, $pmaThemeImage,
126 $text_dir, $cfgRelation
127 );
128 }
129
130 $untracked_tables = PMA_getUntrackedTables($GLOBALS['db']);
131
132 // If untracked tables exist
133 if (count($untracked_tables) > 0) {
134 PMA_displayUntrackedTables(
135 $GLOBALS['db'], $untracked_tables, $url_query, $pmaThemeImage, $text_dir
136 );
137 }
138 // If available print out database log
139 if (count($data['ddlog']) > 0) {
140 $log = '';
141 foreach ($data['ddlog'] as $entry) {
142 $log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n"
143 . $entry['statement'] . "\n";
144 }
145 echo PMA_Util::getMessage(__('Database Log'), $log);
146 }
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Triggers management.
5 *
6 * @package PhpMyAdmin
7 */
8
9 /**
10 * Include required files
11 */
12 require_once 'libraries/common.inc.php';
13
14 /**
15 * Include all other files
16 */
17 require_once 'libraries/rte/rte_triggers.lib.php';
18
19 /**
20 * Do the magic
21 */
22 $_PMA_RTE = 'TRI';
23 require_once 'libraries/rte/rte_main.inc.php';
1 # Makefile for Sphinx documentation
2 #
3
4 # You can set these variables from the command line.
5 SPHINXOPTS =
6 SPHINXBUILD = sphinx-build
7 PAPER =
8 BUILDDIR = .
9
10 # User-friendly check for sphinx-build
11 ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12 $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13 endif
14
15 # Internal variables.
16 PAPEROPT_a4 = -D latex_paper_size=a4
17 PAPEROPT_letter = -D latex_paper_size=letter
18 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19 # the i18n builder cannot share the environment and doctrees with the others
20 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21
22 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23
24 help:
25 @echo "Please use \`make <target>' where <target> is one of"
26 @echo " html to make standalone HTML files"
27 @echo " dirhtml to make HTML files named index.html in directories"
28 @echo " singlehtml to make a single large HTML file"
29 @echo " pickle to make pickle files"
30 @echo " json to make JSON files"
31 @echo " htmlhelp to make HTML files and a HTML help project"
32 @echo " qthelp to make HTML files and a qthelp project"
33 @echo " devhelp to make HTML files and a Devhelp project"
34 @echo " epub to make an epub"
35 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36 @echo " latexpdf to make LaTeX files and run them through pdflatex"
37 @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38 @echo " text to make text files"
39 @echo " man to make manual pages"
40 @echo " texinfo to make Texinfo files"
41 @echo " info to make Texinfo files and run them through makeinfo"
42 @echo " gettext to make PO message catalogs"
43 @echo " changes to make an overview of all changed/added/deprecated items"
44 @echo " xml to make Docutils-native XML files"
45 @echo " pseudoxml to make pseudoxml-XML files for display purposes"
46 @echo " linkcheck to check all external links for integrity"
47 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
48
49 clean:
50 -rm -rf $(BUILDDIR)/doctrees
51 -rm -rf $(BUILDDIR)/html
52 -rm -rf $(BUILDDIR)/dirhtml
53 -rm -rf $(BUILDDIR)/singlehtml
54 -rm -rf $(BUILDDIR)/pickle
55 -rm -rf $(BUILDDIR)/json
56 -rm -rf $(BUILDDIR)/htmlhelp
57 -rm -rf $(BUILDDIR)/qthelp
58 -rm -rf $(BUILDDIR)/devhelp
59 -rm -rf $(BUILDDIR)/epub
60 -rm -rf $(BUILDDIR)/latex
61 -rm -rf $(BUILDDIR)/text
62 -rm -rf $(BUILDDIR)/man
63 -rm -rf $(BUILDDIR)/texinfo
64 -rm -rf $(BUILDDIR)/info
65 -rm -rf $(BUILDDIR)/gettext
66 -rm -rf $(BUILDDIR)/changes
67 -rm -rf $(BUILDDIR)/linkcheck
68 -rm -rf $(BUILDDIR)/doctest
69 -rm -rf $(BUILDDIR)/xml
70 -rm -rf $(BUILDDIR)/pseudoxml
71
72 html:
73 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
74 @echo
75 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
76
77 dirhtml:
78 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
79 @echo
80 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
81
82 singlehtml:
83 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
84 @echo
85 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
86
87 pickle:
88 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
89 @echo
90 @echo "Build finished; now you can process the pickle files."
91
92 json:
93 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
94 @echo
95 @echo "Build finished; now you can process the JSON files."
96
97 htmlhelp:
98 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
99 @echo
100 @echo "Build finished; now you can run HTML Help Workshop with the" \
101 ".hhp project file in $(BUILDDIR)/htmlhelp."
102
103 qthelp:
104 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
105 @echo
106 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
107 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
108 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/phpMyAdmin.qhcp"
109 @echo "To view the help file:"
110 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/phpMyAdmin.qhc"
111
112 devhelp:
113 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
114 @echo
115 @echo "Build finished."
116 @echo "To view the help file:"
117 @echo "# mkdir -p $$HOME/.local/share/devhelp/phpMyAdmin"
118 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/phpMyAdmin"
119 @echo "# devhelp"
120
121 epub:
122 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
123 @echo
124 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
125
126 latex:
127 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
128 @echo
129 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
130 @echo "Run \`make' in that directory to run these through (pdf)latex" \
131 "(use \`make latexpdf' here to do that automatically)."
132
133 latexpdf:
134 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
135 @echo "Running LaTeX files through pdflatex..."
136 $(MAKE) -C $(BUILDDIR)/latex all-pdf
137 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
138
139 latexpdfja:
140 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
141 @echo "Running LaTeX files through platex and dvipdfmx..."
142 $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
143 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
144
145 text:
146 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
147 @echo
148 @echo "Build finished. The text files are in $(BUILDDIR)/text."
149
150 man:
151 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
152 @echo
153 @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
154
155 texinfo:
156 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
157 @echo
158 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
159 @echo "Run \`make' in that directory to run these through makeinfo" \
160 "(use \`make info' here to do that automatically)."
161
162 info:
163 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
164 @echo "Running Texinfo files through makeinfo..."
165 make -C $(BUILDDIR)/texinfo info
166 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
167
168 gettext:
169 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
170 @echo
171 @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
172
173 changes:
174 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
175 @echo
176 @echo "The overview file is in $(BUILDDIR)/changes."
177
178 linkcheck:
179 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
180 @echo
181 @echo "Link check complete; look for any errors in the above output " \
182 "or in $(BUILDDIR)/linkcheck/output.txt."
183
184 doctest:
185 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
186 @echo "Testing of doctests in the sources finished, look at the " \
187 "results in $(BUILDDIR)/doctest/output.txt."
188
189 xml:
190 $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
191 @echo
192 @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
193
194 pseudoxml:
195 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
196 @echo
197 @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
1 from sphinx.domains import Domain, ObjType
2 from sphinx.roles import XRefRole
3 from sphinx.domains.std import GenericObject, StandardDomain
4 from sphinx.directives import ObjectDescription
5 from sphinx.util.nodes import clean_astext, make_refnode
6 from sphinx.util import ws_re
7 from sphinx import addnodes
8 from sphinx.util.docfields import Field
9 from docutils import nodes
10
11 def get_id_from_cfg(text):
12 '''
13 Formats anchor ID from config option.
14 '''
15 if text[:6] == '$cfg[\'':
16 text = text[6:]
17 if text[-2:] == '\']':
18 text = text[:-2]
19 text = text.replace('[$i]', '')
20 parts = text.split("']['")
21 return parts
22
23
24 class ConfigOption(ObjectDescription):
25 indextemplate = 'configuration option; %s'
26 parse_node = None
27
28 has_arguments = True
29
30 doc_field_types = [
31 Field('default', label='Default value', has_arg=False,
32 names=('default', )),
33 Field('type', label='Type', has_arg=False,
34 names=('type',)),
35 ]
36
37
38 def handle_signature(self, sig, signode):
39 signode.clear()
40 signode += addnodes.desc_name(sig, sig)
41 # normalize whitespace like XRefRole does
42 name = ws_re.sub('', sig)
43 return name
44
45 def add_target_and_index(self, name, sig, signode):
46 targetparts = get_id_from_cfg(name)
47 targetname = 'cfg_%s' % '_'.join(targetparts)
48 signode['ids'].append(targetname)
49 self.state.document.note_explicit_target(signode)
50 indextype = 'single'
51
52 # Generic index entries
53 indexentry = self.indextemplate % (name,)
54 self.indexnode['entries'].append((indextype, indexentry,
55 targetname, targetname))
56 self.indexnode['entries'].append((indextype, name,
57 targetname, targetname))
58
59 # Server section
60 if targetparts[0] == 'Servers' and len(targetparts) > 1:
61 indexname = ', '.join(targetparts[1:])
62 self.indexnode['entries'].append((indextype, 'server configuration; %s' % indexname,
63 targetname, targetname))
64 self.indexnode['entries'].append((indextype, indexname,
65 targetname, targetname))
66 else:
67 indexname = ', '.join(targetparts)
68 self.indexnode['entries'].append((indextype, indexname,
69 targetname, targetname))
70
71 self.env.domaindata['config']['objects'][self.objtype, name] = \
72 self.env.docname, targetname
73
74
75 class ConfigSectionXRefRole(XRefRole):
76 """
77 Cross-referencing role for configuration sections (adds an index entry).
78 """
79
80 def result_nodes(self, document, env, node, is_ref):
81 if not is_ref:
82 return [node], []
83 varname = node['reftarget']
84 tgtid = 'index-%s' % env.new_serialno('index')
85 indexnode = addnodes.index()
86 indexnode['entries'] = [
87 ('single', varname, tgtid, varname),
88 ('single', 'configuration section; %s' % varname, tgtid, varname)
89 ]
90 targetnode = nodes.target('', '', ids=[tgtid])
91 document.note_explicit_target(targetnode)
92 return [indexnode, targetnode, node], []
93
94 class ConfigSection(ObjectDescription):
95 indextemplate = 'configuration section; %s'
96 parse_node = None
97
98 def handle_signature(self, sig, signode):
99 if self.parse_node:
100 name = self.parse_node(self.env, sig, signode)
101 else:
102 signode.clear()
103 signode += addnodes.desc_name(sig, sig)
104 # normalize whitespace like XRefRole does
105 name = ws_re.sub('', sig)
106 return name
107
108 def add_target_and_index(self, name, sig, signode):
109 targetname = '%s-%s' % (self.objtype, name)
110 signode['ids'].append(targetname)
111 self.state.document.note_explicit_target(signode)
112 if self.indextemplate:
113 colon = self.indextemplate.find(':')
114 if colon != -1:
115 indextype = self.indextemplate[:colon].strip()
116 indexentry = self.indextemplate[colon+1:].strip() % (name,)
117 else:
118 indextype = 'single'
119 indexentry = self.indextemplate % (name,)
120 self.indexnode['entries'].append((indextype, indexentry,
121 targetname, targetname))
122 self.env.domaindata['config']['objects'][self.objtype, name] = \
123 self.env.docname, targetname
124
125
126 class ConfigOptionXRefRole(XRefRole):
127 """
128 Cross-referencing role for configuration options (adds an index entry).
129 """
130
131 def result_nodes(self, document, env, node, is_ref):
132 if not is_ref:
133 return [node], []
134 varname = node['reftarget']
135 tgtid = 'index-%s' % env.new_serialno('index')
136 indexnode = addnodes.index()
137 indexnode['entries'] = [
138 ('single', varname, tgtid, varname),
139 ('single', 'configuration option; %s' % varname, tgtid, varname)
140 ]
141 targetnode = nodes.target('', '', ids=[tgtid])
142 document.note_explicit_target(targetnode)
143 return [indexnode, targetnode, node], []
144
145
146 class ConfigFileDomain(Domain):
147 name = 'config'
148 label = 'Config'
149
150 object_types = {
151 'option': ObjType('config option', 'option'),
152 'section': ObjType('config section', 'section'),
153 }
154 directives = {
155 'option': ConfigOption,
156 'section': ConfigSection,
157 }
158 roles = {
159 'option': ConfigOptionXRefRole(),
160 'section': ConfigSectionXRefRole(),
161 }
162
163 initial_data = {
164 'objects': {}, # (type, name) -> docname, labelid
165 }
166
167 def clear_doc(self, docname):
168 for key, (fn, _) in self.data['objects'].items():
169 if fn == docname:
170 del self.data['objects'][key]
171
172 def resolve_xref(self, env, fromdocname, builder,
173 typ, target, node, contnode):
174 docname, labelid = self.data['objects'].get((typ, target), ('', ''))
175 if not docname:
176 return None
177 else:
178 return make_refnode(builder, fromdocname, docname,
179 labelid, contnode)
180
181 def get_objects(self):
182 for (type, name), info in self.data['objects'].items():
183 yield (name, name, type, info[0], info[1],
184 self.object_types[type].attrs['searchprio'])
185
186 def setup(app):
187 app.add_domain(ConfigFileDomain)
188
1 # -*- coding: utf-8 -*-
2 #
3 # phpMyAdmin documentation build configuration file, created by
4 # sphinx-quickstart on Wed Sep 26 14:04:48 2012.
5 #
6 # This file is execfile()d with the current directory set to its containing dir.
7 #
8 # Note that not all possible configuration values are present in this
9 # autogenerated file.
10 #
11 # All configuration values have a default; values that are commented out
12 # serve to show the default.
13
14 import sys
15 import os
16
17 # If extensions (or modules to document with autodoc) are in another directory,
18 # add these directories to sys.path here. If the directory is relative to the
19 # documentation root, use os.path.abspath to make it absolute, like shown here.
20 #sys.path.insert(0, os.path.abspath('.'))
21 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
22
23 # -- General configuration ------------------------------------------------
24
25 # If your documentation needs a minimal Sphinx version, state it here.
26 #needs_sphinx = '1.0'
27
28 # Add any Sphinx extension module names here, as strings. They can be
29 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30 # ones.
31 extensions = ['configext']
32
33 # Add any paths that contain templates here, relative to this directory.
34 templates_path = ['_templates']
35
36 # The suffix of source filenames.
37 source_suffix = '.rst'
38
39 # The encoding of source files.
40 #source_encoding = 'utf-8-sig'
41
42 # The master toctree document.
43 master_doc = 'index'
44
45 # General information about the project.
46 project = u'phpMyAdmin'
47 copyright = u'2012 - 2014, The phpMyAdmin devel team'
48
49 # The version info for the project you're documenting, acts as replacement for
50 # |version| and |release|, also used in various other places throughout the
51 # built documents.
52 #
53 # The short X.Y version.
54 version = '4.5.3.1'
55 # The full version, including alpha/beta/rc tags.
56 release = version
57
58 # The language for content autogenerated by Sphinx. Refer to documentation
59 # for a list of supported languages.
60 #language = None
61
62 # There are two options for replacing |today|: either, you set today to some
63 # non-false value, then it is used:
64 #today = ''
65 # Else, today_fmt is used as the format for a strftime call.
66 #today_fmt = '%B %d, %Y'
67
68 # List of patterns, relative to source directory, that match files and
69 # directories to ignore when looking for source files.
70 exclude_patterns = ['_build', 'html', 'doctrees']
71
72 # The reST default role (used for this markup: `text`) to use for all
73 # documents.
74 #default_role = None
75
76 # If true, '()' will be appended to :func: etc. cross-reference text.
77 #add_function_parentheses = True
78
79 # If true, the current module name will be prepended to all description
80 # unit titles (such as .. function::).
81 #add_module_names = True
82
83 # If true, sectionauthor and moduleauthor directives will be shown in the
84 # output. They are ignored by default.
85 #show_authors = False
86
87 # The name of the Pygments (syntax highlighting) style to use.
88 pygments_style = 'sphinx'
89
90 # A list of ignored prefixes for module index sorting.
91 #modindex_common_prefix = []
92
93 # If true, keep warnings as "system message" paragraphs in the built documents.
94 #keep_warnings = False
95
96
97 # -- Options for HTML output ----------------------------------------------
98
99 # The theme to use for HTML and HTML Help pages. See the documentation for
100 # a list of builtin themes.
101 html_theme = 'default'
102
103 # Theme options are theme-specific and customize the look and feel of a theme
104 # further. For a list of options available for each theme, see the
105 # documentation.
106 #html_theme_options = {}
107
108 # Add any paths that contain custom themes here, relative to this directory.
109 #html_theme_path = []
110
111 # The name for this set of Sphinx documents. If None, it defaults to
112 # "<project> v<release> documentation".
113 #html_title = None
114
115 # A shorter title for the navigation bar. Default is the same as html_title.
116 #html_short_title = None
117
118 # The name of an image file (relative to this directory) to place at the top
119 # of the sidebar.
120 #html_logo = None
121
122 # The name of an image file (within the static path) to use as favicon of the
123 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
124 # pixels large.
125 #html_favicon = None
126
127 # Add any paths that contain custom static files (such as style sheets) here,
128 # relative to this directory. They are copied after the builtin static files,
129 # so a file named "default.css" will overwrite the builtin "default.css".
130 #html_static_path = ['_static']
131
132 # Add any extra paths that contain custom files (such as robots.txt or
133 # .htaccess) here, relative to this directory. These files are copied
134 # directly to the root of the documentation.
135 #html_extra_path = []
136
137 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
138 # using the given strftime format.
139 #html_last_updated_fmt = '%b %d, %Y'
140
141 # If true, SmartyPants will be used to convert quotes and dashes to
142 # typographically correct entities.
143 #html_use_smartypants = True
144
145 # Custom sidebar templates, maps document names to template names.
146 #html_sidebars = {}
147
148 # Additional templates that should be rendered to pages, maps page names to
149 # template names.
150 #html_additional_pages = {}
151
152 # If false, no module index is generated.
153 #html_domain_indices = True
154
155 # If false, no index is generated.
156 #html_use_index = True
157
158 # If true, the index is split into individual pages for each letter.
159 #html_split_index = False
160
161 # If true, links to the reST sources are added to the pages.
162 #html_show_sourcelink = True
163
164 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
165 #html_show_sphinx = True
166
167 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
168 #html_show_copyright = True
169
170 # If true, an OpenSearch description file will be output, and all pages will
171 # contain a <link> tag referring to it. The value of this option must be the
172 # base URL from which the finished HTML is served.
173 #html_use_opensearch = ''
174
175 # This is the file name suffix for HTML files (e.g. ".xhtml").
176 #html_file_suffix = None
177
178 # Output file base name for HTML help builder.
179 htmlhelp_basename = 'phpMyAdmindoc'
180
181
182 # -- Options for LaTeX output ---------------------------------------------
183
184 latex_elements = {
185 # The paper size ('letterpaper' or 'a4paper').
186 #'papersize': 'letterpaper',
187
188 # The font size ('10pt', '11pt' or '12pt').
189 #'pointsize': '10pt',
190
191 # Additional stuff for the LaTeX preamble.
192 #'preamble': '',
193 }
194
195 # Grouping the document tree into LaTeX files. List of tuples
196 # (source start file, target name, title,
197 # author, documentclass [howto, manual, or own class]).
198 latex_documents = [
199 ('index', 'phpMyAdmin.tex', u'phpMyAdmin Documentation',
200 u'The phpMyAdmin devel team', 'manual'),
201 ]
202
203 # The name of an image file (relative to this directory) to place at the top of
204 # the title page.
205 #latex_logo = None
206
207 # For "manual" documents, if this is true, then toplevel headings are parts,
208 # not chapters.
209 #latex_use_parts = False
210
211 # If true, show page references after internal links.
212 #latex_show_pagerefs = False
213
214 # If true, show URL addresses after external links.
215 #latex_show_urls = False
216
217 # Documents to append as an appendix to all manuals.
218 #latex_appendices = []
219
220 # If false, no module index is generated.
221 #latex_domain_indices = True
222
223
224 # -- Options for manual page output ---------------------------------------
225
226 # One entry per manual page. List of tuples
227 # (source start file, name, description, authors, manual section).
228 man_pages = [
229 ('index', 'phpmyadmin', u'phpMyAdmin Documentation',
230 [u'The phpMyAdmin devel team'], 1)
231 ]
232
233 # If true, show URL addresses after external links.
234 #man_show_urls = False
235
236
237 # -- Options for Texinfo output -------------------------------------------
238
239 # Grouping the document tree into Texinfo files. List of tuples
240 # (source start file, target name, title, author,
241 # dir menu entry, description, category)
242 texinfo_documents = [
243 ('index', 'phpMyAdmin', u'phpMyAdmin Documentation',
244 u'The phpMyAdmin devel team', 'phpMyAdmin', 'One line description of project.',
245 'Miscellaneous'),
246 ]
247
248 # Documents to append as an appendix to all manuals.
249 #texinfo_appendices = []
250
251 # If false, no module index is generated.
252 #texinfo_domain_indices = True
253
254 # How to display URL addresses: 'footnote', 'no', or 'inline'.
255 #texinfo_show_urls = 'footnote'
256
257
258 # -- Options for Epub output ---------------------------------------------------
259
260 # Bibliographic Dublin Core info.
261 epub_title = u'phpMyAdmin'
262 epub_author = u'The phpMyAdmin devel team'
263 epub_publisher = u'The phpMyAdmin devel team'
264 epub_copyright = copyright
265
266 # The language of the text. It defaults to the language option
267 # or en if the language is not set.
268 #epub_language = ''
269
270 # The scheme of the identifier. Typical schemes are ISBN or URL.
271 #epub_scheme = ''
272
273 # The unique identifier of the text. This can be a ISBN number
274 # or the project homepage.
275 #epub_identifier = ''
276
277 # A unique identification for the text.
278 #epub_uid = ''
279
280 # A tuple containing the cover image and cover page html template filenames.
281 #epub_cover = ()
282
283 # HTML files that should be inserted before the pages created by sphinx.
284 # The format is a list of tuples containing the path and title.
285 #epub_pre_files = []
286
287 # HTML files shat should be inserted after the pages created by sphinx.
288 # The format is a list of tuples containing the path and title.
289 #epub_post_files = []
290
291 # A list of files that should not be packed into the epub file.
292 #epub_exclude_files = []
293
294 # The depth of the table of contents in toc.ncx.
295 #epub_tocdepth = 3
296
297 # Allow duplicate toc entries.
298 #epub_tocdup = True
299
300 # Highlight PHP without starting <?php tag
301 from sphinx.highlighting import lexers
302 from pygments.lexers.web import PhpLexer
303
304 lexers['php'] = PhpLexer(startinline=True)
1 .. _copyright:
2
3 Copyright
4 =========
5
6 .. code-block:: none
7
8 Copyright (C) 1998-2000 Tobias Ratschiller <tobias_at_ratschiller.com>
9 Copyright (C) 2001-2014 Marc Delisle <marc_at_infomarc.info>
10 Olivier Müller <om_at_omnis.ch>
11 Robin Johnson <robbat2_at_users.sourceforge.net>
12 Alexander M. Turek <me_at_derrabus.de>
13 Michal Čihař <michal_at_cihar.com>
14 Garvin Hicking <me_at_supergarv.de>
15 Michael Keck <mkkeck_at_users.sourceforge.net>
16 Sebastian Mendel <cybot_tm_at_users.sourceforge.net>
17 [check credits for more details]
18
19 This program is free software; you can redistribute it and/or modify
20 it under the terms of the GNU General Public License version 2, as
21 published by the Free Software Foundation.
22
23 This program is distributed in the hope that it will be useful, but
24 WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 General Public License for more details.
27
28 You should have received a copy of the GNU General Public License
29 along with this program. If not, see `http://www.gnu.org/licenses/
30 <http://www.gnu.org/licenses/>`_.
31
32 Third party licenses
33 ++++++++++++++++++++
34
35 phpMyAdmin includes several third party libraries which come under their
36 respective licenses.
37
38 jQuery's license, which is where we got the files under js/jquery/ is
39 (MIT|GPL), a copy of each license is available in this repository (GPL
40 is available as LICENSE, MIT as js/jquery/MIT-LICENSE.txt).
41
42 TCPDF which is located under libraries/tcpdf is released under GPL
43 version 3 and the license is available as libraries/tcpdf/LICENSE.TXT.
44
45 DejaVu fonts which are located under libraries/tcpdf/fonts/ and their
46 license is documented in
47 libraries/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE.
48
49 PHP-gettext which is located under libraries/php-gettext/ is released
50 under GPL version 2 license which is available in the LICENSE file.
1 .. _developers:
2
3 Developers Information
4 ======================
5
6 phpMyAdmin is Open Source, so you're invited to contribute to it. Many
7 great features have been written by other people and you too can help
8 to make phpMyAdmin a useful tool.
9
10 You can check out all the possibilities to contribute in the
11 `contribute section on our website
12 <https://www.phpmyadmin.net/contribute/>`_.
1 # Sphinx build info version 1
2 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3 config: c10164fadd8088ff3602d3d757b94e77
4 tags: 645f666f9bcd5a90fca523b33c5a78b7
1 .. _copyright:
2
3 Copyright
4 =========
5
6 .. code-block:: none
7
8 Copyright (C) 1998-2000 Tobias Ratschiller <tobias_at_ratschiller.com>
9 Copyright (C) 2001-2014 Marc Delisle <marc_at_infomarc.info>
10 Olivier Müller <om_at_omnis.ch>
11 Robin Johnson <robbat2_at_users.sourceforge.net>
12 Alexander M. Turek <me_at_derrabus.de>
13 Michal Čihař <michal_at_cihar.com>
14 Garvin Hicking <me_at_supergarv.de>
15 Michael Keck <mkkeck_at_users.sourceforge.net>
16 Sebastian Mendel <cybot_tm_at_users.sourceforge.net>
17 [check credits for more details]
18
19 This program is free software; you can redistribute it and/or modify
20 it under the terms of the GNU General Public License version 2, as
21 published by the Free Software Foundation.
22
23 This program is distributed in the hope that it will be useful, but
24 WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 General Public License for more details.
27
28 You should have received a copy of the GNU General Public License
29 along with this program. If not, see `http://www.gnu.org/licenses/
30 <http://www.gnu.org/licenses/>`_.
31
32 Third party licenses
33 ++++++++++++++++++++
34
35 phpMyAdmin includes several third party libraries which come under their
36 respective licenses.
37
38 jQuery's license, which is where we got the files under js/jquery/ is
39 (MIT|GPL), a copy of each license is available in this repository (GPL
40 is available as LICENSE, MIT as js/jquery/MIT-LICENSE.txt).
41
42 TCPDF which is located under libraries/tcpdf is released under GPL
43 version 3 and the license is available as libraries/tcpdf/LICENSE.TXT.
44
45 DejaVu fonts which are located under libraries/tcpdf/fonts/ and their
46 license is documented in
47 libraries/tcpdf/fonts/dejavu-fonts-ttf-2.33/LICENSE.
48
49 PHP-gettext which is located under libraries/php-gettext/ is released
50 under GPL version 2 license which is available in the LICENSE file.
1 .. _developers:
2
3 Developers Information
4 ======================
5
6 phpMyAdmin is Open Source, so you're invited to contribute to it. Many
7 great features have been written by other people and you too can help
8 to make phpMyAdmin a useful tool.
9
10 You can check out all the possibilities to contribute in the
11 `contribute section on our website
12 <https://www.phpmyadmin.net/contribute/>`_.
1 Import and export
2 =================
3
4 In addition to the standard Import and Export tab, you can also import an SQL file directly by dragging and dropping
5 it from your local file manager to the phpMyAdmin interface in your web browser.
6
7 Open Document Spreadsheet
8 -------------------------
9
10 When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the
11 import as simple as possible.
12
13 Table name
14 ~~~~~~~~~~
15
16 During import, phpMyAdmin uses the sheet name as the table name; you should rename the
17 sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create,
18 though this is less of a concern since you could quickly rename the new table from the Operations tab).
19
20 Column names
21 ~~~~~~~~~~~~
22
23 You should also make the first row of your spreadsheet a header with the names of the columns (this can be
24 accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the
25 checkbox for "The first line of the file contains the table column names;" this way your newly imported
26 data will go to the proper columns.
27
1 .. phpMyAdmin documentation master file, created by
2 sphinx-quickstart on Wed Sep 26 14:04:48 2012.
3 You can adapt this file completely to your liking, but it should at least
4 contain the root `toctree` directive.
5
6 Welcome to phpMyAdmin's documentation!
7 ======================================
8
9 Contents:
10
11 .. toctree::
12 :maxdepth: 2
13
14 intro
15 require
16 setup
17 config
18 user
19 faq
20 developers
21 vendors
22 copyright
23 credits
24 glossary
25
26
27 Indices and tables
28 ==================
29
30 * :ref:`genindex`
31 * :ref:`search`
32 * :ref:`glossary`
1 .. _intro:
2
3 Introduction
4 ============
5
6 phpMyAdmin can manage a whole MySQL server (needs a super-user) as
7 well as a single database. To accomplish the latter you'll need a
8 properly set up MySQL user who can read/write only the desired
9 database. It's up to you to look up the appropriate part in the MySQL
10 manual.
11
12
13 Supported features
14 ------------------
15
16 Currently phpMyAdmin can:
17
18 * browse and drop databases, tables, views, columns and indexes
19 * display multiple results sets through stored procedures or queries
20 * create, copy, drop, rename and alter databases, tables, columns and
21 indexes
22 * maintenance server, databases and tables, with proposals on server
23 configuration
24 * execute, edit and bookmark any :term:`SQL`-statement, even batch-queries
25 * load text files into tables
26 * create [#f1]_ and read dumps of tables
27 * export [#f1]_ data to various formats: :term:`CSV`, :term:`XML`, :term:`PDF`,
28 :term:`ISO`/:term:`IEC` 26300 - :term:`OpenDocument` Text and Spreadsheet, Microsoft
29 Word 2000, and LATEX formats
30 * import data and :term:`MySQL` structures from :term:`OpenDocument` spreadsheets, as
31 well as :term:`XML`, :term:`CSV`, and :term:`SQL` files
32 * administer multiple servers
33 * manage MySQL users and privileges
34 * check referential integrity in MyISAM tables
35 * using Query-by-example (QBE), create complex queries automatically
36 connecting required tables
37 * create :term:`PDF` graphics of your
38 database layout
39 * search globally in a database or a subset of it
40 * transform stored data into any format using a set of predefined
41 functions, like displaying BLOB-data as image or download-link
42 * track changes on databases, tables and views
43 * support InnoDB tables and foreign keys
44 * support mysqli, the improved MySQL extension see :ref:`faq1_17`
45 * create, edit, call, export and drop stored procedures and functions
46 * create, edit, export and drop events and triggers
47 * communicate in `80 different languages
48 <https://www.phpmyadmin.net/translations/>`_
49
50
51 A word about users
52 ------------------
53
54 Many people have difficulty understanding the concept of user
55 management with regards to phpMyAdmin. When a user logs in to
56 phpMyAdmin, that username and password are passed directly to MySQL.
57 phpMyAdmin does no account management on its own (other than allowing
58 one to manipulate the MySQL user account information); all users must
59 be valid MySQL users.
60
61 .. rubric:: Footnotes
62
63 .. [#f1]
64
65 phpMyAdmin can compress (:term:`Zip`, :term:`GZip` or :term:`RFC 1952`
66 formats) dumps and :term:`CSV` exports if you use PHP with
67 :term:`Zlib` support (``--with-zlib``).
68 Proper support may also need changes in :file:`php.ini`.
1 Other sources of information
2 ============================
3
4 Printed Book
5 ------------
6
7 The definitive guide to using phpMyAdmin is the book Mastering phpMyAdmin for
8 Effective MySQL Management by Marc Delisle. You can get information on that
9 book and other officially endorsed `books at the phpMyAdmin site`_.
10
11 .. _books at the phpMyAdmin site: https://www.phpmyadmin.net/docs/
12
13 Tutorials
14 ---------
15
16 Third party tutorials and articles are listed on our `wiki page`_.
17
18 .. _wiki page: http://wiki.phpmyadmin.net/pma/Articles
1 User management
2 ===============
3
4 User management is the process of controlling which users are allowed to
5 connect to the MySQL server and what permissions they have on each database.
6 phpMyAdmin does not handle user management, rather it passes the username and
7 password on to MySQL, which then determines whether a user is permitted to
8 perform a particular action. Within phpMyAdmin, administrators have full
9 control over creating users, viewing and editing privileges for existing users,
10 and removing users.
11
12 Within phpMyAdmin, user management is controlled via the :guilabel:`Users` link
13 from the main page. Users can be created, edited, and removed.
14
15 Creating a new user
16 -------------------
17
18 To create a new user, click the :guilabel:`Add a new user` link near the bottom
19 of the :guilabel:`Users` page (you must be a "superuser", e.g., user "root").
20 Use the textboxes and drop-downs to configure the user to your particular
21 needs. You can then select whether to create a database for that user and grant
22 specific global privileges. Once you've created the user (by clicking Go), you
23 can define that user's permissions on a specific database (don't grant global
24 privileges in that case). In general, users do not need any global privileges
25 (other than USAGE), only permissions for their specific database.
26
27 Editing an existing user
28 ------------------------
29
30 To edit an existing user, simply click the pencil icon to the right of that
31 user in the :guilabel:`Users` page. You can then edit their global- and
32 database-specific privileges, change their password, or even copy those
33 privileges to a new user.
34
35 Deleting a user
36 ---------------
37
38 From the :guilabel:`Users` page, check the checkbox for the user you wish to
39 remove, select whether or not to also remove any databases of the same name (if
40 they exist), and click Go.
41
42 Assigning privileges to user for a specific database
43 ----------------------------------------------------
44
45 Users are assigned to databases by editing the user record (from the
46 :guilabel:`Users` link on the home page) not from within the :guilabel:`Users`
47 link under the table. If you are creating a user specifically for a given table
48 you will have to create the user first (with no global privileges) and then go
49 back and edit that user to add the table and privileges for the individual
50 table.
1 .. _require:
2
3 Requirements
4 ============
5
6 Web server
7 ----------
8
9 Since phpMyAdmin's interface is based entirely in your browser, you'll need a
10 web server (such as Apache, nginx, :term:`IIS`) to install phpMyAdmin's files into.
11
12 PHP
13 ---
14
15 * You need PHP 5.5.0 or newer, with ``session`` support, the Standard PHP Library
16 (SPL) extension, JSON support, and the ``mbstring`` extension.
17
18 * To support uploading of ZIP files, you need the PHP ``zip`` extension.
19
20 * You need GD2 support in PHP to display inline thumbnails of JPEGs
21 ("image/jpeg: inline") with their original aspect ratio.
22
23 * When using the cookie authentication (the default), the `openssl
24 <http://www.php.net/openssl>`_ extension is strongly suggested.
25
26 * To support upload progress bars, see :ref:`faq2_9`.
27
28 * To support XML and Open Document Spreadsheet importing, you need the
29 `libxml <http://www.php.net/libxml>`_ extension.
30
31 * To support reCAPTCHA on the login page, you need the
32 `openssl <http://www.php.net/openssl>`_ extension.
33
34 * Performance suggestion: install the ``ctype`` extension.
35
36 .. seealso:: :ref:`faq1_31`, :ref:`authentication_modes`
37
38 Database
39 --------
40
41 phpMyAdmin supports MySQL-compatible databases.
42
43 * MySQL 5.5 or newer
44 * MariaDB 5.5 or newer
45 * Drizzle
46
47 .. seealso:: :ref:`faq1_17`
48
49 Web browser
50 -----------
51
52 To access phpMyAdmin you need a web browser with cookies and JavaScript
53 enabled.
54
1 .. _transformations:
2
3 Transformations
4 ===============
5
6 .. _transformationsintro:
7
8 Introduction
9 ++++++++++++
10
11 To enable transformations, you have to setup the ``column_info``
12 table and the proper directives. Please see the :ref:`config` on how to do so.
13
14 You can apply different transformations to the contents of each
15 column. The transformation will take the content of each column and
16 transform it with certain rules defined in the selected
17 transformation.
18
19 Say you have a column 'filename' which contains a filename. Normally
20 you would see in phpMyAdmin only this filename. Using transformations
21 you can transform that filename into a HTML link, so you can click
22 inside of the phpMyAdmin structure on the column's link and will see
23 the file displayed in a new browser window. Using transformation
24 options you can also specify strings to append/prepend to a string or
25 the format you want the output stored in.
26
27 For a general overview of all available transformations and their
28 options, you can consult your *<www.your-host.com>/<your-install-
29 dir>/transformation\_overview.php* installation.
30
31 For a tutorial on how to effectively use transformations, see our
32 `Link section <http://www.phpmyadmin.net/home_page/docs.php>`_ on the
33 official phpMyAdmin homepage.
34
35 .. _transformationshowto:
36
37 Usage
38 +++++
39
40 Go to your *tbl\_structure.php* page (i.e. reached through clicking on
41 the 'Structure' link for a table). There click on "Change" (or change
42 icon) and there you will see three new fields at the end of the line.
43 They are called 'MIME-type', 'Browser transformation' and
44 'Transformation options'.
45
46 * The field 'MIME-type' is a drop-down field. Select the MIME-type that
47 corresponds to the column's contents. Please note that transformations
48 are inactive as long as no MIME-type is selected.
49 * The field 'Browser transformation' is a drop-down field. You can
50 choose from a hopefully growing amount of pre-defined transformations.
51 See below for information on how to build your own transformation.
52 There are global transformations and mimetype-bound transformations.
53 Global transformations can be used for any mimetype. They will take
54 the mimetype, if necessary, into regard. Mimetype-bound
55 transformations usually only operate on a certain mimetype. There are
56 transformations which operate on the main mimetype (like 'image'),
57 which will most likely take the subtype into regard, and those who
58 only operate on a specific subtype (like 'image/jpeg'). You can use
59 transformations on mimetypes for which the function was not defined
60 for. There is no security check for you selected the right
61 transformation, so take care of what the output will be like.
62 * The field 'Transformation options' is a free-type textfield. You have
63 to enter transform-function specific options here. Usually the
64 transforms can operate with default options, but it is generally a
65 good idea to look up the overview to see which options are necessary.
66 Much like the ENUM/SET-Fields, you have to split up several options
67 using the format 'a','b','c',...(NOTE THE MISSING BLANKS). This is
68 because internally the options will be parsed as an array, leaving the
69 first value the first element in the array, and so forth. If you want
70 to specify a MIME character set you can define it in the
71 transformation\_options. You have to put that outside of the pre-
72 defined options of the specific mime-transform, as the last value of
73 the set. Use the format "'; charset=XXX'". If you use a transform, for
74 which you can specify 2 options and you want to append a character
75 set, enter "'first parameter','second parameter','charset=us-ascii'".
76 You can, however use the defaults for the parameters: "'','','charset
77 =us-ascii'".
78
79 .. _transformationsfiles:
80
81 File structure
82 ++++++++++++++
83
84 All specific transformations for mimetypes are defined through class
85 files in the directory 'libraries/plugins/transformations/'. Each of
86 them extends a certain transformation abstract class declared in
87 libraries/plugins/transformations/abstract.
88
89 They are stored in files to ease up customization and easy adding of
90 new transformations.
91
92 Because the user cannot enter own mimetypes, it is kept sure that
93 transformations always work. It makes no sense to apply a
94 transformation to a mimetype the transform-function doesn't know to
95 handle.
96
97 There is a file called '*transformations.lib.php*' that provides some
98 basic functions which can be included by any other transform function.
99
100 The file name convention is ``[Mimetype]_[Subtype]_[Transformation
101 Name].class.php``, while the abtract class that it extends has the
102 name ``[Transformation Name]TransformationsPlugin``. All of the
103 methods that have to be implemented by a transformations plug-in are:
104
105 #. getMIMEType() and getMIMESubtype() in the main class;
106 #. getName(), getInfo() and applyTransformation() in the abstract class
107 it extends.
108
109 The getMIMEType(), getMIMESubtype() and getName() methods return the
110 name of the MIME type, MIME Subtype and transformation accordingly.
111 getInfo() returns the transformation's description and possible
112 options it may receive and applyTransformation() is the method that
113 does the actual work of the transformation plug-in.
114
115 Please see the libraries/plugins/transformations/TEMPLATE and
116 libraries/plugins/transformations/TEMPLATE\_ABSTRACT files for adding
117 your own transformation plug-in. You can also generate a new
118 transformation plug-in (with or without the abstract transformation
119 class), by using
120 :file:`libraries/plugins/transformations/generator_plugin.sh` or
121 :file:`libraries/plugins/transformations/generator_main_class.sh`.
122
123 The applyTransformation() method always gets passed three variables:
124
125 #. **$buffer** - Contains the text inside of the column. This is the
126 text, you want to transform.
127 #. **$options** - Contains any user-passed options to a transform
128 function as an array.
129 #. **$meta** - Contains an object with information about your column. The
130 data is drawn from the output of the `mysql\_fetch\_field()
131 <http://www.php.net/mysql_fetch_field>`_ function. This means, all
132 object properties described on the `manual page
133 <http://www.php.net/mysql_fetch_field>`_ are available in this
134 variable and can be used to transform a column accordingly to
135 unsigned/zerofill/not\_null/... properties. The $meta->mimetype
136 variable contains the original MIME-type of the column (i.e.
137 'text/plain', 'image/jpeg' etc.)
138
1 User Guide
2 ==========
3
4 .. toctree::
5 :maxdepth: 2
6
7 transformations
8 privileges
9 other
10 import_export
1 Distributing and packaging phpMyAdmin
2 =====================================
3
4 This document is intended to give advices to people who want to
5 redistribute phpMyAdmin inside other software package such as Linux
6 distribution or some all in one package including web server and MySQL
7 server.
8
9 Generally you can customize some basic aspects (paths to some files and
10 behavior) in :file:`libraries/vendor_config.php`.
11
12 For example if you want setup script to generate config file in var, change
13 ``SETUP_CONFIG_FILE`` to :file:`/var/lib/phpmyadmin/config.inc.php` and you
14 will also probably want to skip directory writable check, so set
15 ``SETUP_DIR_WRITABLE`` to false.
16
17 External libraries
18 ------------------
19
20 phpMyAdmin includes several external libraries, you might want to
21 replace them with system ones if they are available, but please note
22 that you should test whether version you provide is compatible with the
23 one we ship.
24
25 Currently known list of external libraries:
26
27 js/jquery
28 jQuery js framework and various jQuery based libraries.
29
30 libraries/php-gettext
31 php-gettext library
32 libraries/tcpdf
33 tcpdf library, stripped down of not needed files
34 libraries/phpseclib
35 portions of phpseclib library
1 /*
2 * basic.css
3 * ~~~~~~~~~
4 *
5 * Sphinx stylesheet -- basic theme.
6 *
7 * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
8 * :license: BSD, see LICENSE for details.
9 *
10 */
11
12 /* -- main layout ----------------------------------------------------------- */
13
14 div.clearer {
15 clear: both;
16 }
17
18 /* -- relbar ---------------------------------------------------------------- */
19
20 div.related {
21 width: 100%;
22 font-size: 90%;
23 }
24
25 div.related h3 {
26 display: none;
27 }
28
29 div.related ul {
30 margin: 0;
31 padding: 0 0 0 10px;
32 list-style: none;
33 }
34
35 div.related li {
36 display: inline;
37 }
38
39 div.related li.right {
40 float: right;
41 margin-right: 5px;
42 }
43
44 /* -- sidebar --------------------------------------------------------------- */
45
46 div.sphinxsidebarwrapper {
47 padding: 10px 5px 0 10px;
48 }
49
50 div.sphinxsidebar {
51 float: left;
52 width: 230px;
53 margin-left: -100%;
54 font-size: 90%;
55 }
56
57 div.sphinxsidebar ul {
58 list-style: none;
59 }
60
61 div.sphinxsidebar ul ul,
62 div.sphinxsidebar ul.want-points {
63 margin-left: 20px;
64 list-style: square;
65 }
66
67 div.sphinxsidebar ul ul {
68 margin-top: 0;
69 margin-bottom: 0;
70 }
71
72 div.sphinxsidebar form {
73 margin-top: 10px;
74 }
75
76 div.sphinxsidebar input {
77 border: 1px solid #98dbcc;
78 font-family: sans-serif;
79 font-size: 1em;
80 }
81
82 div.sphinxsidebar #searchbox input[type="text"] {
83 width: 170px;
84 }
85
86 div.sphinxsidebar #searchbox input[type="submit"] {
87 width: 30px;
88 }
89
90 img {
91 border: 0;
92 max-width: 100%;
93 }
94
95 /* -- search page ----------------------------------------------------------- */
96
97 ul.search {
98 margin: 10px 0 0 20px;
99 padding: 0;
100 }
101
102 ul.search li {
103 padding: 5px 0 5px 20px;
104 background-image: url(file.png);
105 background-repeat: no-repeat;
106 background-position: 0 7px;
107 }
108
109 ul.search li a {
110 font-weight: bold;
111 }
112
113 ul.search li div.context {
114 color: #888;
115 margin: 2px 0 0 30px;
116 text-align: left;
117 }
118
119 ul.keywordmatches li.goodmatch a {
120 font-weight: bold;
121 }
122
123 /* -- index page ------------------------------------------------------------ */
124
125 table.contentstable {
126 width: 90%;
127 }
128
129 table.contentstable p.biglink {
130 line-height: 150%;
131 }
132
133 a.biglink {
134 font-size: 1.3em;
135 }
136
137 span.linkdescr {
138 font-style: italic;
139 padding-top: 5px;
140 font-size: 90%;
141 }
142
143 /* -- general index --------------------------------------------------------- */
144
145 table.indextable {
146 width: 100%;
147 }
148
149 table.indextable td {
150 text-align: left;
151 vertical-align: top;
152 }
153
154 table.indextable dl, table.indextable dd {
155 margin-top: 0;
156 margin-bottom: 0;
157 }
158
159 table.indextable tr.pcap {
160 height: 10px;
161 }
162
163 table.indextable tr.cap {
164 margin-top: 10px;
165 background-color: #f2f2f2;
166 }
167
168 img.toggler {
169 margin-right: 3px;
170 margin-top: 3px;
171 cursor: pointer;
172 }
173
174 div.modindex-jumpbox {
175 border-top: 1px solid #ddd;
176 border-bottom: 1px solid #ddd;
177 margin: 1em 0 1em 0;
178 padding: 0.4em;
179 }
180
181 div.genindex-jumpbox {
182 border-top: 1px solid #ddd;
183 border-bottom: 1px solid #ddd;
184 margin: 1em 0 1em 0;
185 padding: 0.4em;
186 }
187
188 /* -- general body styles --------------------------------------------------- */
189
190 a.headerlink {
191 visibility: hidden;
192 }
193
194 h1:hover > a.headerlink,
195 h2:hover > a.headerlink,
196 h3:hover > a.headerlink,
197 h4:hover > a.headerlink,
198 h5:hover > a.headerlink,
199 h6:hover > a.headerlink,
200 dt:hover > a.headerlink {
201 visibility: visible;
202 }
203
204 div.body p.caption {
205 text-align: inherit;
206 }
207
208 div.body td {
209 text-align: left;
210 }
211
212 .field-list ul {
213 padding-left: 1em;
214 }
215
216 .first {
217 margin-top: 0 !important;
218 }
219
220 p.rubric {
221 margin-top: 30px;
222 font-weight: bold;
223 }
224
225 img.align-left, .figure.align-left, object.align-left {
226 clear: left;
227 float: left;
228 margin-right: 1em;
229 }
230
231 img.align-right, .figure.align-right, object.align-right {
232 clear: right;
233 float: right;
234 margin-left: 1em;
235 }
236
237 img.align-center, .figure.align-center, object.align-center {
238 display: block;
239 margin-left: auto;
240 margin-right: auto;
241 }
242
243 .align-left {
244 text-align: left;
245 }
246
247 .align-center {
248 text-align: center;
249 }
250
251 .align-right {
252 text-align: right;
253 }
254
255 /* -- sidebars -------------------------------------------------------------- */
256
257 div.sidebar {
258 margin: 0 0 0.5em 1em;
259 border: 1px solid #ddb;
260 padding: 7px 7px 0 7px;
261 background-color: #ffe;
262 width: 40%;
263 float: right;
264 }
265
266 p.sidebar-title {
267 font-weight: bold;
268 }
269
270 /* -- topics ---------------------------------------------------------------- */
271
272 div.topic {
273 border: 1px solid #ccc;
274 padding: 7px 7px 0 7px;
275 margin: 10px 0 10px 0;
276 }
277
278 p.topic-title {
279 font-size: 1.1em;
280 font-weight: bold;
281 margin-top: 10px;
282 }
283
284 /* -- admonitions ----------------------------------------------------------- */
285
286 div.admonition {
287 margin-top: 10px;
288 margin-bottom: 10px;
289 padding: 7px;
290 }
291
292 div.admonition dt {
293 font-weight: bold;
294 }
295
296 div.admonition dl {
297 margin-bottom: 0;
298 }
299
300 p.admonition-title {
301 margin: 0px 10px 5px 0px;
302 font-weight: bold;
303 }
304
305 div.body p.centered {
306 text-align: center;
307 margin-top: 25px;
308 }
309
310 /* -- tables ---------------------------------------------------------------- */
311
312 table.docutils {
313 border: 0;
314 border-collapse: collapse;
315 }
316
317 table.docutils td, table.docutils th {
318 padding: 1px 8px 1px 5px;
319 border-top: 0;
320 border-left: 0;
321 border-right: 0;
322 border-bottom: 1px solid #aaa;
323 }
324
325 table.field-list td, table.field-list th {
326 border: 0 !important;
327 }
328
329 table.footnote td, table.footnote th {
330 border: 0 !important;
331 }
332
333 th {
334 text-align: left;
335 padding-right: 5px;
336 }
337
338 table.citation {
339 border-left: solid 1px gray;
340 margin-left: 1px;
341 }
342
343 table.citation td {
344 border-bottom: none;
345 }
346
347 /* -- other body styles ----------------------------------------------------- */
348
349 ol.arabic {
350 list-style: decimal;
351 }
352
353 ol.loweralpha {
354 list-style: lower-alpha;
355 }
356
357 ol.upperalpha {
358 list-style: upper-alpha;
359 }
360
361 ol.lowerroman {
362 list-style: lower-roman;
363 }
364
365 ol.upperroman {
366 list-style: upper-roman;
367 }
368
369 dl {
370 margin-bottom: 15px;
371 }
372
373 dd p {
374 margin-top: 0px;
375 }
376
377 dd ul, dd table {
378 margin-bottom: 10px;
379 }
380
381 dd {
382 margin-top: 3px;
383 margin-bottom: 10px;
384 margin-left: 30px;
385 }
386
387 dt:target, .highlighted {
388 background-color: #fbe54e;
389 }
390
391 dl.glossary dt {
392 font-weight: bold;
393 font-size: 1.1em;
394 }
395
396 .field-list ul {
397 margin: 0;
398 padding-left: 1em;
399 }
400
401 .field-list p {
402 margin: 0;
403 }
404
405 .optional {
406 font-size: 1.3em;
407 }
408
409 .versionmodified {
410 font-style: italic;
411 }
412
413 .system-message {
414 background-color: #fda;
415 padding: 5px;
416 border: 3px solid red;
417 }
418
419 .footnote:target {
420 background-color: #ffa;
421 }
422
423 .line-block {
424 display: block;
425 margin-top: 1em;
426 margin-bottom: 1em;
427 }
428
429 .line-block .line-block {
430 margin-top: 0;
431 margin-bottom: 0;
432 margin-left: 1.5em;
433 }
434
435 .guilabel, .menuselection {
436 font-family: sans-serif;
437 }
438
439 .accelerator {
440 text-decoration: underline;
441 }
442
443 .classifier {
444 font-style: oblique;
445 }
446
447 abbr, acronym {
448 border-bottom: dotted 1px;
449 cursor: help;
450 }
451
452 /* -- code displays --------------------------------------------------------- */
453
454 pre {
455 overflow: auto;
456 overflow-y: hidden; /* fixes display issues on Chrome browsers */
457 }
458
459 td.linenos pre {
460 padding: 5px 0px;
461 border: 0;
462 background-color: transparent;
463 color: #aaa;
464 }
465
466 table.highlighttable {
467 margin-left: 0.5em;
468 }
469
470 table.highlighttable td {
471 padding: 0 0.5em 0 0.5em;
472 }
473
474 tt.descname {
475 background-color: transparent;
476 font-weight: bold;
477 font-size: 1.2em;
478 }
479
480 tt.descclassname {
481 background-color: transparent;
482 }
483
484 tt.xref, a tt {
485 background-color: transparent;
486 font-weight: bold;
487 }
488
489 h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
490 background-color: transparent;
491 }
492
493 .viewcode-link {
494 float: right;
495 }
496
497 .viewcode-back {
498 float: right;
499 font-family: sans-serif;
500 }
501
502 div.viewcode-block:target {
503 margin: -1px -10px;
504 padding: 0 10px;
505 }
506
507 /* -- math display ---------------------------------------------------------- */
508
509 img.math {
510 vertical-align: middle;
511 }
512
513 div.body div.math p {
514 text-align: center;
515 }
516
517 span.eqno {
518 float: right;
519 }
520
521 /* -- printout stylesheet --------------------------------------------------- */
522
523 @media print {
524 div.document,
525 div.documentwrapper,
526 div.bodywrapper {
527 margin: 0 !important;
528 width: 100%;
529 }
530
531 div.sphinxsidebar,
532 div.related,
533 div.footer,
534 #top-link {
535 display: none;
536 }
537 }
...\ No newline at end of file ...\ No newline at end of file
1 /*
2 * default.css_t
3 * ~~~~~~~~~~~~~
4 *
5 * Sphinx stylesheet -- default theme.
6 *
7 * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
8 * :license: BSD, see LICENSE for details.
9 *
10 */
11
12 @import url("basic.css");
13
14 /* -- page layout ----------------------------------------------------------- */
15
16 body {
17 font-family: sans-serif;
18 font-size: 100%;
19 background-color: #11303d;
20 color: #000;
21 margin: 0;
22 padding: 0;
23 }
24
25 div.document {
26 background-color: #1c4e63;
27 }
28
29 div.documentwrapper {
30 float: left;
31 width: 100%;
32 }
33
34 div.bodywrapper {
35 margin: 0 0 0 230px;
36 }
37
38 div.body {
39 background-color: #ffffff;
40 color: #000000;
41 padding: 0 20px 30px 20px;
42 }
43
44 div.footer {
45 color: #ffffff;
46 width: 100%;
47 padding: 9px 0 9px 0;
48 text-align: center;
49 font-size: 75%;
50 }
51
52 div.footer a {
53 color: #ffffff;
54 text-decoration: underline;
55 }
56
57 div.related {
58 background-color: #133f52;
59 line-height: 30px;
60 color: #ffffff;
61 }
62
63 div.related a {
64 color: #ffffff;
65 }
66
67 div.sphinxsidebar {
68 }
69
70 div.sphinxsidebar h3 {
71 font-family: 'Trebuchet MS', sans-serif;
72 color: #ffffff;
73 font-size: 1.4em;
74 font-weight: normal;
75 margin: 0;
76 padding: 0;
77 }
78
79 div.sphinxsidebar h3 a {
80 color: #ffffff;
81 }
82
83 div.sphinxsidebar h4 {
84 font-family: 'Trebuchet MS', sans-serif;
85 color: #ffffff;
86 font-size: 1.3em;
87 font-weight: normal;
88 margin: 5px 0 0 0;
89 padding: 0;
90 }
91
92 div.sphinxsidebar p {
93 color: #ffffff;
94 }
95
96 div.sphinxsidebar p.topless {
97 margin: 5px 10px 10px 10px;
98 }
99
100 div.sphinxsidebar ul {
101 margin: 10px;
102 padding: 0;
103 color: #ffffff;
104 }
105
106 div.sphinxsidebar a {
107 color: #98dbcc;
108 }
109
110 div.sphinxsidebar input {
111 border: 1px solid #98dbcc;
112 font-family: sans-serif;
113 font-size: 1em;
114 }
115
116
117
118 /* -- hyperlink styles ------------------------------------------------------ */
119
120 a {
121 color: #355f7c;
122 text-decoration: none;
123 }
124
125 a:visited {
126 color: #355f7c;
127 text-decoration: none;
128 }
129
130 a:hover {
131 text-decoration: underline;
132 }
133
134
135
136 /* -- body styles ----------------------------------------------------------- */
137
138 div.body h1,
139 div.body h2,
140 div.body h3,
141 div.body h4,
142 div.body h5,
143 div.body h6 {
144 font-family: 'Trebuchet MS', sans-serif;
145 background-color: #f2f2f2;
146 font-weight: normal;
147 color: #20435c;
148 border-bottom: 1px solid #ccc;
149 margin: 20px -20px 10px -20px;
150 padding: 3px 0 3px 10px;
151 }
152
153 div.body h1 { margin-top: 0; font-size: 200%; }
154 div.body h2 { font-size: 160%; }
155 div.body h3 { font-size: 140%; }
156 div.body h4 { font-size: 120%; }
157 div.body h5 { font-size: 110%; }
158 div.body h6 { font-size: 100%; }
159
160 a.headerlink {
161 color: #c60f0f;
162 font-size: 0.8em;
163 padding: 0 4px 0 4px;
164 text-decoration: none;
165 }
166
167 a.headerlink:hover {
168 background-color: #c60f0f;
169 color: white;
170 }
171
172 div.body p, div.body dd, div.body li {
173 text-align: justify;
174 line-height: 130%;
175 }
176
177 div.admonition p.admonition-title + p {
178 display: inline;
179 }
180
181 div.admonition p {
182 margin-bottom: 5px;
183 }
184
185 div.admonition pre {
186 margin-bottom: 5px;
187 }
188
189 div.admonition ul, div.admonition ol {
190 margin-bottom: 5px;
191 }
192
193 div.note {
194 background-color: #eee;
195 border: 1px solid #ccc;
196 }
197
198 div.seealso {
199 background-color: #ffc;
200 border: 1px solid #ff6;
201 }
202
203 div.topic {
204 background-color: #eee;
205 }
206
207 div.warning {
208 background-color: #ffe4e4;
209 border: 1px solid #f66;
210 }
211
212 p.admonition-title {
213 display: inline;
214 }
215
216 p.admonition-title:after {
217 content: ":";
218 }
219
220 pre {
221 padding: 5px;
222 background-color: #eeffcc;
223 color: #333333;
224 line-height: 120%;
225 border: 1px solid #ac9;
226 border-left: none;
227 border-right: none;
228 }
229
230 tt {
231 background-color: #ecf0f3;
232 padding: 0 1px 0 1px;
233 font-size: 0.95em;
234 }
235
236 th {
237 background-color: #ede;
238 }
239
240 .warning tt {
241 background: #efc2c2;
242 }
243
244 .note tt {
245 background: #d6d6d6;
246 }
247
248 .viewcode-back {
249 font-family: sans-serif;
250 }
251
252 div.viewcode-block:target {
253 background-color: #f4debf;
254 border-top: 1px solid #ac9;
255 border-bottom: 1px solid #ac9;
256 }
...\ No newline at end of file ...\ No newline at end of file
1 /*
2 * doctools.js
3 * ~~~~~~~~~~~
4 *
5 * Sphinx JavaScript utilities for all documentation.
6 *
7 * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
8 * :license: BSD, see LICENSE for details.
9 *
10 */
11
12 /**
13 * select a different prefix for underscore
14 */
15 $u = _.noConflict();
16
17 /**
18 * make the code below compatible with browsers without
19 * an installed firebug like debugger
20 if (!window.console || !console.firebug) {
21 var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
22 "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
23 "profile", "profileEnd"];
24 window.console = {};
25 for (var i = 0; i < names.length; ++i)
26 window.console[names[i]] = function() {};
27 }
28 */
29
30 /**
31 * small helper function to urldecode strings
32 */
33 jQuery.urldecode = function(x) {
34 return decodeURIComponent(x).replace(/\+/g, ' ');
35 };
36
37 /**
38 * small helper function to urlencode strings
39 */
40 jQuery.urlencode = encodeURIComponent;
41
42 /**
43 * This function returns the parsed url parameters of the
44 * current request. Multiple values per key are supported,
45 * it will always return arrays of strings for the value parts.
46 */
47 jQuery.getQueryParameters = function(s) {
48 if (typeof s == 'undefined')
49 s = document.location.search;
50 var parts = s.substr(s.indexOf('?') + 1).split('&');
51 var result = {};
52 for (var i = 0; i < parts.length; i++) {
53 var tmp = parts[i].split('=', 2);
54 var key = jQuery.urldecode(tmp[0]);
55 var value = jQuery.urldecode(tmp[1]);
56 if (key in result)
57 result[key].push(value);
58 else
59 result[key] = [value];
60 }
61 return result;
62 };
63
64 /**
65 * highlight a given string on a jquery object by wrapping it in
66 * span elements with the given class name.
67 */
68 jQuery.fn.highlightText = function(text, className) {
69 function highlight(node) {
70 if (node.nodeType == 3) {
71 var val = node.nodeValue;
72 var pos = val.toLowerCase().indexOf(text);
73 if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
74 var span = document.createElement("span");
75 span.className = className;
76 span.appendChild(document.createTextNode(val.substr(pos, text.length)));
77 node.parentNode.insertBefore(span, node.parentNode.insertBefore(
78 document.createTextNode(val.substr(pos + text.length)),
79 node.nextSibling));
80 node.nodeValue = val.substr(0, pos);
81 }
82 }
83 else if (!jQuery(node).is("button, select, textarea")) {
84 jQuery.each(node.childNodes, function() {
85 highlight(this);
86 });
87 }
88 }
89 return this.each(function() {
90 highlight(this);
91 });
92 };
93
94 /**
95 * Small JavaScript module for the documentation.
96 */
97 var Documentation = {
98
99 init : function() {
100 this.fixFirefoxAnchorBug();
101 this.highlightSearchWords();
102 this.initIndexTable();
103 },
104
105 /**
106 * i18n support
107 */
108 TRANSLATIONS : {},
109 PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
110 LOCALE : 'unknown',
111
112 // gettext and ngettext don't access this so that the functions
113 // can safely bound to a different name (_ = Documentation.gettext)
114 gettext : function(string) {
115 var translated = Documentation.TRANSLATIONS[string];
116 if (typeof translated == 'undefined')
117 return string;
118 return (typeof translated == 'string') ? translated : translated[0];
119 },
120
121 ngettext : function(singular, plural, n) {
122 var translated = Documentation.TRANSLATIONS[singular];
123 if (typeof translated == 'undefined')
124 return (n == 1) ? singular : plural;
125 return translated[Documentation.PLURALEXPR(n)];
126 },
127
128 addTranslations : function(catalog) {
129 for (var key in catalog.messages)
130 this.TRANSLATIONS[key] = catalog.messages[key];
131 this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
132 this.LOCALE = catalog.locale;
133 },
134
135 /**
136 * add context elements like header anchor links
137 */
138 addContextElements : function() {
139 $('div[id] > :header:first').each(function() {
140 $('<a class="headerlink">\u00B6</a>').
141 attr('href', '#' + this.id).
142 attr('title', _('Permalink to this headline')).
143 appendTo(this);
144 });
145 $('dt[id]').each(function() {
146 $('<a class="headerlink">\u00B6</a>').
147 attr('href', '#' + this.id).
148 attr('title', _('Permalink to this definition')).
149 appendTo(this);
150 });
151 },
152
153 /**
154 * workaround a firefox stupidity
155 */
156 fixFirefoxAnchorBug : function() {
157 if (document.location.hash && $.browser.mozilla)
158 window.setTimeout(function() {
159 document.location.href += '';
160 }, 10);
161 },
162
163 /**
164 * highlight the search words provided in the url in the text
165 */
166 highlightSearchWords : function() {
167 var params = $.getQueryParameters();
168 var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
169 if (terms.length) {
170 var body = $('div.body');
171 if (!body.length) {
172 body = $('body');
173 }
174 window.setTimeout(function() {
175 $.each(terms, function() {
176 body.highlightText(this.toLowerCase(), 'highlighted');
177 });
178 }, 10);
179 $('<p class="highlight-link"><a href="javascript:Documentation.' +
180 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
181 .appendTo($('#searchbox'));
182 }
183 },
184
185 /**
186 * init the domain index toggle buttons
187 */
188 initIndexTable : function() {
189 var togglers = $('img.toggler').click(function() {
190 var src = $(this).attr('src');
191 var idnum = $(this).attr('id').substr(7);
192 $('tr.cg-' + idnum).toggle();
193 if (src.substr(-9) == 'minus.png')
194 $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
195 else
196 $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
197 }).css('display', '');
198 if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
199 togglers.click();
200 }
201 },
202
203 /**
204 * helper function to hide the search marks again
205 */
206 hideSearchWords : function() {
207 $('#searchbox .highlight-link').fadeOut(300);
208 $('span.highlighted').removeClass('highlighted');
209 },
210
211 /**
212 * make the url absolute
213 */
214 makeURL : function(relativeURL) {
215 return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
216 },
217
218 /**
219 * get the current relative url
220 */
221 getCurrentURL : function() {
222 var path = document.location.pathname;
223 var parts = path.split(/\//);
224 $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
225 if (this == '..')
226 parts.pop();
227 });
228 var url = parts.join('/');
229 return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
230 }
231 };
232
233 // quick alias for translations
234 _ = Documentation.gettext;
235
236 $(document).ready(function() {
237 Documentation.init();
238 });
This diff could not be displayed because it is too large.
1 .highlight .hll { background-color: #ffffcc }
2 .highlight { background: #eeffcc; }
3 .highlight .c { color: #408090; font-style: italic } /* Comment */
4 .highlight .err { border: 1px solid #FF0000 } /* Error */
5 .highlight .k { color: #007020; font-weight: bold } /* Keyword */
6 .highlight .o { color: #666666 } /* Operator */
7 .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
8 .highlight .cp { color: #007020 } /* Comment.Preproc */
9 .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
10 .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
11 .highlight .gd { color: #A00000 } /* Generic.Deleted */
12 .highlight .ge { font-style: italic } /* Generic.Emph */
13 .highlight .gr { color: #FF0000 } /* Generic.Error */
14 .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
15 .highlight .gi { color: #00A000 } /* Generic.Inserted */
16 .highlight .go { color: #333333 } /* Generic.Output */
17 .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
18 .highlight .gs { font-weight: bold } /* Generic.Strong */
19 .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
20 .highlight .gt { color: #0044DD } /* Generic.Traceback */
21 .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
22 .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
23 .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
24 .highlight .kp { color: #007020 } /* Keyword.Pseudo */
25 .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
26 .highlight .kt { color: #902000 } /* Keyword.Type */
27 .highlight .m { color: #208050 } /* Literal.Number */
28 .highlight .s { color: #4070a0 } /* Literal.String */
29 .highlight .na { color: #4070a0 } /* Name.Attribute */
30 .highlight .nb { color: #007020 } /* Name.Builtin */
31 .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
32 .highlight .no { color: #60add5 } /* Name.Constant */
33 .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
34 .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
35 .highlight .ne { color: #007020 } /* Name.Exception */
36 .highlight .nf { color: #06287e } /* Name.Function */
37 .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
38 .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
39 .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
40 .highlight .nv { color: #bb60d5 } /* Name.Variable */
41 .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
42 .highlight .w { color: #bbbbbb } /* Text.Whitespace */
43 .highlight .mb { color: #208050 } /* Literal.Number.Bin */
44 .highlight .mf { color: #208050 } /* Literal.Number.Float */
45 .highlight .mh { color: #208050 } /* Literal.Number.Hex */
46 .highlight .mi { color: #208050 } /* Literal.Number.Integer */
47 .highlight .mo { color: #208050 } /* Literal.Number.Oct */
48 .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
49 .highlight .sc { color: #4070a0 } /* Literal.String.Char */
50 .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
51 .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
52 .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
53 .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
54 .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
55 .highlight .sx { color: #c65d09 } /* Literal.String.Other */
56 .highlight .sr { color: #235388 } /* Literal.String.Regex */
57 .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
58 .highlight .ss { color: #517918 } /* Literal.String.Symbol */
59 .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
60 .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
61 .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
62 .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
63 .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
...\ No newline at end of file ...\ No newline at end of file
1 /*
2 * sidebar.js
3 * ~~~~~~~~~~
4 *
5 * This script makes the Sphinx sidebar collapsible.
6 *
7 * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds
8 * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
9 * used to collapse and expand the sidebar.
10 *
11 * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
12 * and the width of the sidebar and the margin-left of the document
13 * are decreased. When the sidebar is expanded the opposite happens.
14 * This script saves a per-browser/per-session cookie used to
15 * remember the position of the sidebar among the pages.
16 * Once the browser is closed the cookie is deleted and the position
17 * reset to the default (expanded).
18 *
19 * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
20 * :license: BSD, see LICENSE for details.
21 *
22 */
23
24 $(function() {
25
26
27
28
29
30
31
32
33 // global elements used by the functions.
34 // the 'sidebarbutton' element is defined as global after its
35 // creation, in the add_sidebar_button function
36 var bodywrapper = $('.bodywrapper');
37 var sidebar = $('.sphinxsidebar');
38 var sidebarwrapper = $('.sphinxsidebarwrapper');
39
40 // for some reason, the document has no sidebar; do not run into errors
41 if (!sidebar.length) return;
42
43 // original margin-left of the bodywrapper and width of the sidebar
44 // with the sidebar expanded
45 var bw_margin_expanded = bodywrapper.css('margin-left');
46 var ssb_width_expanded = sidebar.width();
47
48 // margin-left of the bodywrapper and width of the sidebar
49 // with the sidebar collapsed
50 var bw_margin_collapsed = '.8em';
51 var ssb_width_collapsed = '.8em';
52
53 // colors used by the current theme
54 var dark_color = $('.related').css('background-color');
55 var light_color = $('.document').css('background-color');
56
57 function sidebar_is_collapsed() {
58 return sidebarwrapper.is(':not(:visible)');
59 }
60
61 function toggle_sidebar() {
62 if (sidebar_is_collapsed())
63 expand_sidebar();
64 else
65 collapse_sidebar();
66 }
67
68 function collapse_sidebar() {
69 sidebarwrapper.hide();
70 sidebar.css('width', ssb_width_collapsed);
71 bodywrapper.css('margin-left', bw_margin_collapsed);
72 sidebarbutton.css({
73 'margin-left': '0',
74 'height': bodywrapper.height()
75 });
76 sidebarbutton.find('span').text('»');
77 sidebarbutton.attr('title', _('Expand sidebar'));
78 document.cookie = 'sidebar=collapsed';
79 }
80
81 function expand_sidebar() {
82 bodywrapper.css('margin-left', bw_margin_expanded);
83 sidebar.css('width', ssb_width_expanded);
84 sidebarwrapper.show();
85 sidebarbutton.css({
86 'margin-left': ssb_width_expanded-12,
87 'height': bodywrapper.height()
88 });
89 sidebarbutton.find('span').text('«');
90 sidebarbutton.attr('title', _('Collapse sidebar'));
91 document.cookie = 'sidebar=expanded';
92 }
93
94 function add_sidebar_button() {
95 sidebarwrapper.css({
96 'float': 'left',
97 'margin-right': '0',
98 'width': ssb_width_expanded - 28
99 });
100 // create the button
101 sidebar.append(
102 '<div id="sidebarbutton"><span>&laquo;</span></div>'
103 );
104 var sidebarbutton = $('#sidebarbutton');
105 light_color = sidebarbutton.css('background-color');
106 // find the height of the viewport to center the '<<' in the page
107 var viewport_height;
108 if (window.innerHeight)
109 viewport_height = window.innerHeight;
110 else
111 viewport_height = $(window).height();
112 sidebarbutton.find('span').css({
113 'display': 'block',
114 'margin-top': (viewport_height - sidebar.position().top - 20) / 2
115 });
116
117 sidebarbutton.click(toggle_sidebar);
118 sidebarbutton.attr('title', _('Collapse sidebar'));
119 sidebarbutton.css({
120 'color': '#FFFFFF',
121 'border-left': '1px solid ' + dark_color,
122 'font-size': '1.2em',
123 'cursor': 'pointer',
124 'height': bodywrapper.height(),
125 'padding-top': '1px',
126 'margin-left': ssb_width_expanded - 12
127 });
128
129 sidebarbutton.hover(
130 function () {
131 $(this).css('background-color', dark_color);
132 },
133 function () {
134 $(this).css('background-color', light_color);
135 }
136 );
137 }
138
139 function set_position_from_cookie() {
140 if (!document.cookie)
141 return;
142 var items = document.cookie.split(';');
143 for(var k=0; k<items.length; k++) {
144 var key_val = items[k].split('=');
145 var key = key_val[0].replace(/ /, ""); // strip leading spaces
146 if (key == 'sidebar') {
147 var value = key_val[1];
148 if ((value == 'collapsed') && (!sidebar_is_collapsed()))
149 collapse_sidebar();
150 else if ((value == 'expanded') && (sidebar_is_collapsed()))
151 expand_sidebar();
152 }
153 }
154 }
155
156 add_sidebar_button();
157 var sidebarbutton = $('#sidebarbutton');
158 set_position_from_cookie();
159 });
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!