Compare commits

..

342 Commits

Author SHA1 Message Date
fca58c22c6 Merge pull request #864 from cytopia/release/v1.10.3
Release v1.10.3
2022-02-04 19:13:08 +01:00
830549a905 Update README 2022-02-04 12:47:03 +01:00
015d66052e Adjust CHANGELOG 2022-02-04 11:05:05 +01:00
82a1d7c881 Adjust release date 2022-02-04 11:04:02 +01:00
7d346463c7 Adjust smoke tests 2022-02-04 11:03:00 +01:00
ae780388dc Update PHP images 2022-02-03 20:34:01 +01:00
422af8e916 Added missing mariadb entries into gitignore 2022-02-03 10:16:11 +01:00
3d3f716121 Added PHP 8.2 2022-02-03 10:15:54 +01:00
928d5a2475 Updated get-modules tests 2022-02-03 10:01:56 +01:00
9b37e3a307 Updated project files 2022-02-03 10:01:28 +01:00
682eaf82ee Merge pull request #863 from cytopia/release/v1.10.2
Release v1.10.2
2022-02-02 18:57:11 +01:00
38b96b7a08 Updated project files 2022-02-02 11:41:20 +01:00
94bf3c9dcf Updated PHP images 2022-02-02 11:40:50 +01:00
9272bfec92 Merge pull request #861 from cytopia/release/v1.10.1
Release v1.10.1
2022-01-30 20:20:53 +01:00
d57e72bc75 Update project files 2022-01-30 14:28:50 +01:00
bbc6a661ed Fixes #754 Be able to delete emails from control center 2022-01-30 14:27:08 +01:00
2ea5ff59e0 Fxies #830 Evaluate MASS_VHOST_SSL_GEN env var 2022-01-30 13:59:43 +01:00
ba6fd1e554 Merge pull request #860 from cytopia/release/v1.10.0
Release v1.10.0
2022-01-28 08:36:08 +01:00
fe67bdf6bb Harden CI tests 2022-01-27 17:30:00 +01:00
4a9c0b6d9f Update HTTPD images 2022-01-27 14:49:57 +01:00
855d98d895 Add Docker volumes for MariaDB 10.6 and 10.7 2022-01-27 12:37:47 +01:00
01b0ecdf20 Fixes #807 description in env-example 2022-01-27 08:41:55 +01:00
fe9e6264d9 Update PHP modules in README 2022-01-27 08:30:41 +01:00
55bb37c53b Update project files 2022-01-27 08:23:19 +01:00
a6894b7793 Add MariaDB conf anbd log dirs 2022-01-27 08:21:44 +01:00
0daa62cc02 Update comment about PHP 8.0 and 8.1 stability 2022-01-27 08:17:32 +01:00
38942fa168 Added MariaDB 10.6 and MariaDB 10.7 2022-01-27 08:15:46 +01:00
a0246b7a0e Update HTTPD images 2022-01-27 08:11:28 +01:00
b17f4600f4 Update PHP images 2022-01-27 08:11:12 +01:00
5f465abd61 Merge pull request #851 from felixmosh/fix-850
fix: show utf-8 mail body properly
2022-01-26 12:08:04 +01:00
61246b5151 Merge branch 'master' into fix-850 2022-01-26 10:01:31 +01:00
ca90af0fb0 Merge pull request #859 from cytopia/release/v1.9.3
Release v1.9.3
2022-01-25 20:14:49 +01:00
7bd6b34698 Update project files 2022-01-25 10:06:22 +01:00
2677422250 Update PHP images 2022-01-24 19:29:54 +01:00
200000cb5b Ensure documentation passes CI checks 2022-01-24 15:23:41 +01:00
8560267fdc Update MySQL Docker Images 2022-01-24 14:39:10 +01:00
8c13144d3e Update available PHP modules 2022-01-24 09:27:31 +01:00
2f8fc59dd9 Ensure PHP code is compatible to legacy versions 2022-01-24 09:15:52 +01:00
d9fb88058f Updated PHP Docker Images to 0.129 2022-01-24 08:39:23 +01:00
4c15e191a0 Merge branch 'master' into fix-850 2022-01-23 13:36:19 +01:00
249b132e58 Merge pull request #832 from Ernestopheles/patch-1
Update setup-auto-dns.rst
2022-01-23 13:35:44 +01:00
6e34d3b263 Merge pull request #843 from ericvanjohnson/patch-1
Update add-project-dns-entry-on-win.rst (grammar correction)
2022-01-23 13:33:17 +01:00
68bd88d304 Merge branch 'master' into patch-1 2022-01-23 13:32:39 +01:00
bfb4769e85 fix: show utf-8 mail body properly 2021-11-07 15:56:54 +02:00
23a6aed10d Merge pull request #817 from ulin-evgeny/patch
Fixed typos
2021-10-15 11:48:42 +02:00
0dfd63d7f9 Merge branch 'master' into patch 2021-10-15 11:48:31 +02:00
3804a3b6f3 Merge pull request #842 from ericp-mrel/fix-redis-args-parsing
Fix redis args parsing for password
2021-10-15 11:47:49 +02:00
9cfc69e5bb Update add-project-dns-entry-on-win.rst 2021-10-13 04:48:52 -07:00
56555e87a5 Adjust redis args regex to allow optional quotes. 2021-10-12 10:44:44 -05:00
5e90a3a35d Use preg_match_all to get redis password from args
This should fix the issue where preg_split was being used and would cause an error if the redis args variable didn't contain the --requirepass string and the WebGUI wouldn't load as a result.
2021-10-12 09:42:04 -05:00
54e17f5ec5 Update setup-auto-dns.rst
For me it has been unclear if prot 53 may not be in use in cobination to 127.0.0.1 or generally.
2021-08-24 17:48:52 +02:00
b5d19264de Fixed typos 2021-06-20 05:07:19 +03:00
f6bbdc72fd Merge pull request #814 from cytopia/release/v1.9.2
Release v1.9.2
2021-06-04 13:06:36 +02:00
2f9ba2e30a Release v1.9.2 2021-06-04 10:32:46 +02:00
fa0c8f5632 Merge pull request #787 from merlijnvanlent/master
Ability to view emails within the intranet dashboard.
2021-05-21 15:31:13 +02:00
64330b5b12 Merge branch 'master' into master 2021-05-21 10:50:26 +02:00
872340e14b Merge pull request #806 from Agnohendrix/patch-1
XDebug 3.0 Linux Docs
2021-05-21 10:48:21 +02:00
5eb2ee8ca0 Merge branch 'master' into master 2021-05-20 16:28:02 +02:00
aff86a6b15 Merge branch 'master' into patch-1 2021-05-20 15:48:25 +02:00
fb51eece98 Merge pull request #777 from cytopia/release/v1.9.1
Devilbox Release v1.9.1
2021-05-20 14:51:02 +02:00
6c438bb434 Updated Adminer to 4.8.1 2021-05-20 10:52:49 +02:00
9935780588 Update README 2021-05-20 00:12:10 +02:00
20cba7d773 Update CHANGELOG 2021-05-20 00:03:16 +02:00
353fa53d29 Updated php images to 0.125 2021-05-19 22:59:42 +02:00
f28e1ee4a4 Enable mysql binlog by default 2021-05-19 19:04:22 +02:00
fb390ac429 gitignore php-ini 8.1 dir 2021-05-19 19:03:56 +02:00
867327a8c3 Update project files 2021-05-19 16:06:53 +02:00
8ffd65a905 Upgrade sphinx deprecations 2021-05-19 16:05:45 +02:00
5a4574edb8 Remove Travis CI 2021-05-19 16:05:44 +02:00
dc350b00b5 Update CHANGELOG date 2021-05-19 16:05:43 +02:00
f4d492ea98 Update release date 2021-05-19 16:05:42 +02:00
c40c43c4ea Exclude shellcheck rule 2021-05-19 16:05:41 +02:00
d0585bb174 Update documentation 2021-05-19 16:05:40 +02:00
0b9d18cdf4 Adjust enabled PHP modules 2021-05-19 16:05:33 +02:00
ba42717f01 Update CHANGELOG 2021-05-19 16:05:29 +02:00
b4c3de9195 Update PHP images to 0.124 2021-05-19 16:05:25 +02:00
a0423ebd02 Adjust xdebug CI tests 2021-05-19 16:05:21 +02:00
06c2a7ac51 Update Available PHP modules in README 2021-05-19 16:05:17 +02:00
543e373b91 Added PHP Xdebug info page for intranet 2021-05-19 16:05:14 +02:00
3d0154f987 Docs: smaller headlines for PHP modules 2021-05-19 16:05:10 +02:00
715c6b3c83 Adjusted Xdebug 3.0 defaults 2021-05-19 16:05:06 +02:00
d8e728a6a4 Merge pull request #802 from llaville/patch-intranet
Patch intranet to fix issue 801
2021-05-19 16:04:34 +02:00
1d41fb025c Merge branch 'master' into patch-intranet 2021-05-19 16:01:18 +02:00
af98125279 Merge branch 'master' into patch-1 2021-05-18 08:39:16 +02:00
ab761eedba Merge pull request #783 from mhodge13/master
Kibana 6.6 and above uses ELASTICSEARCH_HOSTS
2021-05-17 20:36:00 +02:00
0058e0bd61 Merge branch 'master' into master 2021-05-17 20:34:25 +02:00
2dd3ec9dd0 Merge pull request #781 from kovacbb/patch-1
Update enable-varnish.rst
2021-05-17 20:33:47 +02:00
7f294735e7 Fixed wrong push 2021-05-05 15:55:44 +02:00
a07b3442f1 Updated XDebug Linux documentation for XDebug 3.0 2021-05-05 15:50:46 +02:00
db1be81471 Update compose/docker-compose.override.yml-elk 2021-04-19 18:10:43 +02:00
d5e463db60 Update compose/docker-compose.override.yml-all 2021-04-19 18:10:36 +02:00
83c0c672d4 avoid PHP Fatal Error when pgsql PHP module is not available 2021-04-19 17:27:20 +02:00
af68fb65f2 avoid PHP Fatal Error when mysqli PHP module is not available 2021-04-19 17:25:56 +02:00
f6c273d6c4 avoid PHP Fatal Error when memcache PHP modules are not available 2021-04-19 17:24:11 +02:00
46f5c48ba0 avoid PHP Fatal Error when redis PHP module is not available 2021-04-19 17:21:47 +02:00
6c18e8f112 avoid PHP Fatal Error when mongo PHP modules are not available 2021-04-19 17:20:00 +02:00
6807b83e6b typo error fixed in memcached info panel 2021-04-19 14:29:43 +00:00
01fb99ec1a Added custom shadowdom element to view emails
WIthout the styling leaking into the global styling.
2021-02-21 14:40:16 +01:00
56342426b3 Kibana 6.6 and above uses ELASTICSEARCH_HOSTS 2021-02-11 08:48:18 -06:00
87e710050f Update enable-varnish.rst
fix small typo
2021-02-04 22:49:29 +01:00
cdfb55ec2d Merge pull request #771 from alikon/patch-1
xdebug v3 info panel
2020-12-21 10:14:40 +01:00
7cad84f527 Update .devilbox/www/htdocs/xdebug.php
Co-authored-by: cytopia <cytopia@everythingcli.org>
2020-12-21 08:24:46 +01:00
e65685b604 with header and footer 2020-12-18 17:16:28 +01:00
7e08261602 moved to Info 2020-12-18 14:07:46 +01:00
30d23f0f6f move to Info 2020-12-18 14:06:57 +01:00
b5fca3f842 moved on Info 2020-12-18 14:06:38 +01:00
dd529d0a1a xdebug 3 info panel 2020-12-18 12:59:49 +01:00
a6863c5ceb xdebug v3 info panel 2020-12-18 12:58:17 +01:00
6dba0ce963 Merge pull request #766 from BrookeDot/patch-1
Capitalize p in WordPress
2020-12-13 17:17:36 +01:00
201925e0b2 Merge branch 'master' into patch-1 2020-12-13 13:07:31 +01:00
ffee650e60 Merge pull request #765 from cytopia/release/v1.9.0
Devilbox Release v1.9.0
2020-12-13 13:03:01 +01:00
59738601b2 Capitalize p in WordPress
This is a simple edit to capitalize the p in WordPress throughout this document
2020-12-12 16:37:03 -08:00
50ae11f95f Retry network tasks 2020-12-12 19:13:31 +01:00
09b8803f21 Adjust test and examples according to Xdebug 3.0 2020-12-12 19:04:35 +01:00
75aa5139e2 Sort correctly when updating modules 2020-12-12 18:14:15 +01:00
f9b4a9d9f4 Fix lint job 2020-12-12 17:54:32 +01:00
0151167635 Devilbox Release v1.9.0 2020-12-12 17:53:36 +01:00
9c6711c948 Update php images 2020-12-12 17:53:32 +01:00
22f5c945ef Fixes #761 missing varnish config env var 2020-12-12 17:53:28 +01:00
1b768425b2 Added checks for TLD_SUFFIX in check-config.sh 2020-12-12 17:53:24 +01:00
a05f3eea47 Merge pull request #760 from avierr/patch-1
Updated docs for Mac SSL
2020-12-01 19:12:20 +01:00
e3c1e18ae3 Update for Mac 2020-12-01 16:46:29 +00:00
a78bccfd33 Merge pull request #757 from cytopia/release/v1.8.3
Release v1.8.3
2020-11-22 17:08:56 +01:00
2679acc569 Fix symlink handling with watcherd 2020-11-22 14:36:13 +01:00
6b18f7b71d CI: wordpress: increase retries and be more verbose 2020-11-22 12:40:02 +01:00
df6ee3fb36 Intranet: show custom Httpd configuration files 2020-11-22 11:54:56 +01:00
fda37efc64 Check supervisor configs with check-config.sh 2020-11-22 11:13:04 +01:00
e9281c9b40 Bump versions 2020-11-22 10:57:37 +01:00
dfd3e27882 Fixes #753 handle symlinks with watcherd 2020-11-22 10:57:06 +01:00
8e7069f893 Fixes #692 Add custom supervisor configs 2020-11-22 10:56:08 +01:00
c96f740c39 check-config.sh: debug mode 2020-11-20 15:15:45 +01:00
fe54bbf714 check-config: custom configs 2020-11-20 15:09:21 +01:00
9660c37937 check-config.sh: verify LOCAL_LISTEN_ADDR 2020-11-20 14:46:29 +01:00
0d6ecf23e3 check-config.sh: check customizations 2020-11-20 14:35:53 +01:00
3a2dacf748 Fix shellcheck for check-config 2020-11-20 13:37:09 +01:00
467fc03640 Validate htdocs dir in check-config 2020-11-20 13:18:19 +01:00
7480eb4e08 Add project checks 2020-11-20 13:06:06 +01:00
f348fa7814 Fixes #751 check-config output duplication 2020-11-17 12:51:15 +01:00
b8055a175b Merge pull request #750 from cytopia/release/v1.8.2
Devilbox Release v1.8.2
2020-11-14 15:19:52 +01:00
9b58e2daa8 Fix typos 2020-11-14 15:17:38 +01:00
30e2b08c72 Fixes #547 Added link to official Contao Devilbox docs 2020-11-14 11:59:32 +01:00
1f0676de4a Fixes #707 Move Backups out of Devilbox directory 2020-11-14 11:51:33 +01:00
6735daaaeb Bump release 2020-11-14 10:49:50 +01:00
657ba28afd Fix entrypoint in MySQL image 2020-11-14 10:34:09 +01:00
14259518c6 check-config: allow paths to be outside Devilbox dir 2020-11-14 10:33:46 +01:00
d406eac805 Provide updating information 2020-11-14 10:33:22 +01:00
dfb2a1097d Various fixes on PHP-FPM images 2020-11-14 10:32:52 +01:00
8553a5645b Merge pull request #747 from cytopia/release/v1.8.1
Release v1.8.1
2020-11-12 19:22:21 +01:00
6e59572a51 CI: check-config.sh checks 2020-11-12 17:12:58 +01:00
bbf297a356 check-config.sh abort if .env file is not present 2020-11-12 17:12:58 +01:00
8a290af71c Ensure to check uid/gid with check-config 2020-11-12 17:12:58 +01:00
f2929f3d08 Merge branch 'master' into release/v1.8.1 2020-11-12 15:36:09 +01:00
4fb0d557a6 Merge pull request #734 from alexandredoria/patch-1
Enable remote_autostart as default on Xdebug configuration
2020-11-12 15:35:52 +01:00
d0776566a2 Merge branch 'master' into patch-1 2020-11-12 15:29:47 +01:00
254b76205c Update gitignore 2020-11-12 15:23:22 +01:00
d727835228 Replace tree with find command 2020-11-12 15:03:57 +01:00
760d1606c5 Adjust CI tests for PHP 8.(0|1) xdebug settings 2020-11-12 14:52:25 +01:00
5d476b9c32 Bump version 2020-11-12 14:44:59 +01:00
6465542af8 Fixes #746 xdebug config for PHP 8.0 and 8.1 2020-11-12 14:44:02 +01:00
686ad73b63 Ensure to check versions in check-config.sh 2020-11-12 14:39:14 +01:00
70695d179c Add hints to check-config.sh 2020-11-12 14:31:59 +01:00
039ffacaf7 Silence PHP warnings in phpmemcached and opcache GUIs 2020-11-12 14:20:42 +01:00
9367c9540a Add check-config.sh script for local troubleshooting 2020-11-12 14:19:49 +01:00
87fa92d931 Merge pull request #743 from cytopia/release/v1.8.0
Release v1.8.0
2020-11-09 09:46:22 +01:00
d655bea64f Fixed undefined var in integration tests 2020-11-08 15:52:32 +01:00
4acfa94639 Fix Adminer for PHP 8.0/8.1 2020-11-08 15:42:43 +01:00
2d5361891e Add integration tests for MariaDB 10.5 2020-11-08 15:42:00 +01:00
db58f3b1bb Disable Wordpress tests for PHP 8.0 and PHP 8.1 2020-11-08 14:46:02 +01:00
2dfb908fbf Fix phpPgAdmin for PHP 8.0 and PHP 8.1 2020-11-08 14:44:21 +01:00
20931a7d97 Fix missing config for phpMyAdmin 5.0.4 2020-11-08 14:09:11 +01:00
8fa4ea59c7 Fix shellcheck issues with tests 2020-11-08 13:59:20 +01:00
da12bccc29 Fix configs for phpMyAdmin 2020-11-08 13:55:44 +01:00
3e9bcec90b Add MariaDB 10.5 2020-11-08 13:52:33 +01:00
e5f93062ca Add PHP 8.1 conf directories 2020-11-08 13:47:02 +01:00
f37e9b2a58 Bump to minor release 2020-11-08 13:28:58 +01:00
156e36be56 Fix Adminer 4.7.7 2020-11-08 13:27:31 +01:00
6aca07a5b9 Update phpMyAdmin 2020-11-08 12:56:53 +01:00
530698aee2 Update documentation 2020-11-08 11:17:04 +01:00
9f647fa745 Adjust integration tests 2020-11-08 11:16:28 +01:00
8f510c7f6c Update Adminer from 4.7.5 to 4.7.7 2020-11-08 11:04:33 +01:00
d94cf193e3 Update env-example 2020-11-08 11:02:55 +01:00
d471794f72 Fix phpPgAdmin error reporting 2020-11-07 16:57:40 +01:00
9ff5006d1a Ensure phpRedmin works without login 2020-11-07 16:41:02 +01:00
9179683f18 Ensure backwards compatibility with phpPgAdmin 2020-11-07 16:15:32 +01:00
16a0f360bf Fix CHANGELOG 2020-11-07 15:56:37 +01:00
bca2a37723 #728 Updated phpPgAdmin from 7.12 to 7.13 2020-11-07 15:52:05 +01:00
e2806d147a Fix typo in version 2020-11-07 12:04:34 +01:00
9cefd120ef Add missing docker volumes 2020-11-07 11:54:35 +01:00
97d8602f19 Fix broken link in docs 2020-11-07 11:45:47 +01:00
2c8c8f2fa5 Update Readme 2020-11-07 11:34:52 +01:00
b9cf538dcf Update Changelog 2020-11-07 11:18:38 +01:00
f034dec17a Add latest available docker images 2020-11-07 11:17:59 +01:00
9ce7111587 Update integration tests 2020-11-07 11:17:13 +01:00
d5eca8a114 Update PHP images 2020-11-07 10:38:03 +01:00
81f344ee04 Enable remote_autostart on Xdebug configuration for Docker on Linux: Xdebug for Visual Studio Code
Normally is need to use a specific HTTP GET/POST variable to start remote debugging. When this setting is set to true, Xdebug will always attempt to start a remote debugging session and try to connect to  vscode-php-debug plugin client, even if the GET/POST/COOKIE variable was not present.

More information on 
https://xdebug.org/docs/all_settings
https://xdebug.org/docs/remote#browser_session
2020-10-09 12:58:03 -03:00
4b23dd6d6d Merge pull request #725 from cytopia/release/v1.7.2
Release v1.7.2
2020-09-18 10:18:39 +02:00
10952e80b2 Merge branch 'master' into release/v1.7.2 2020-09-17 17:28:48 +02:00
ae4514e1ca Merge pull request #726 from tyrann0us/patch-1
Fix typo docker-composer kil
2020-09-17 17:28:30 +02:00
0d1fe20cc4 Fix typo docker-composer kil 2020-09-17 13:47:21 +02:00
f67182f111 Added COMPOSER_MEMORY_LIMIT variable to php settings 2020-09-17 10:46:50 +02:00
4540afa507 CI Adjust drupal test 2020-09-16 15:19:46 +02:00
1868719479 Added new PHP images 2020-09-16 11:32:57 +02:00
3556873f19 Merge pull request #711 from cytopia/release/v1.7.1
Release v1.7.1
2020-08-09 18:32:42 +02:00
eafc56f5ab Update docker images 2020-08-09 16:30:18 +02:00
a10efca1c3 Refs #611, #700 Updating PHP images 2020-06-29 01:27:08 +02:00
8c931cdf56 Merge pull request #690 from cytopia/release/v1.7.0
Release v1.7.0
2020-03-25 09:41:40 +01:00
487b69331c Use reproducible linkcheck 2020-03-24 12:06:32 +01:00
6984d43ff9 Update version and Changelog 2020-03-24 09:31:12 +01:00
a097b5b4d8 Update Readme 2020-03-24 09:29:27 +01:00
0b118486b5 Update docs: available container 2020-03-24 09:29:26 +01:00
c73d5a711f Add Python Flask Compose files 2020-03-24 09:29:25 +01:00
78244371ca Ease linkcheck 2020-03-24 09:29:24 +01:00
a1fa4806e1 Add Python Flask logo 2020-03-24 09:29:22 +01:00
02e3f8cf6e Fix headlines 2020-03-24 09:29:21 +01:00
f7741d88f9 Documentation: Python Flask 2020-03-24 09:29:10 +01:00
bc16d8906e Merge pull request #689 from cytopia/release/v1.6.3
Release v1.6.3
2020-03-23 18:55:28 +01:00
fa6a91350c Fix Release number in Update info 2020-03-23 15:26:00 +01:00
d4e3b885da Update release date 2020-03-23 14:47:55 +01:00
68f34be368 Document new env variable 2020-03-23 14:47:33 +01:00
5679774a30 Default env variable to prevent .env misconfigurations 2020-03-23 11:40:19 +01:00
056bbfb057 Allow postgresql to start without a password 2020-03-23 11:31:43 +01:00
fb77920460 Bump version and update CHANGELOG 2020-03-22 16:15:32 +01:00
a377209a72 Updated HAProxy version 2020-03-22 16:15:28 +01:00
c1fbb9c2c4 Updated PHP-FPM versions 2020-03-22 16:15:24 +01:00
ca6f7f56ac Merge pull request #688 from mjherraiz/patch-1
Update docs to newest symfony version
2020-03-22 16:11:08 +01:00
163642aac7 Update php version in symfony example doc 2020-03-22 12:26:30 +01:00
37c82a334c Update docs to newest symfony version
The new symfony structure delete web folder and change it for more standart public folder.
Now diferents env are managed with and env file
2020-03-21 19:39:46 +01:00
844ca283bf Merge pull request #686 from ops-andy/docs/expressionengine
Add How To for ExpressionEngine cms
2020-03-20 06:22:03 +01:00
63de90415c more tweaks to setup-expressionengine and now passing builds 2020-03-19 13:23:07 -04:00
c67c66c8ef fixed underline error in setup-expressionengine 2020-03-19 12:45:53 -04:00
80b6582d91 Merge branch 'master' into docs/expressionengine 2020-03-19 12:44:20 -04:00
d68adcbb01 added more detail to install instrcutions and shortened curl link 2020-03-19 12:34:21 -04:00
112e24207b added back Joomla question in FAQ 2020-03-19 11:31:42 -04:00
17232a5eb4 added ExpressionEngine install docs 2020-03-19 11:27:04 -04:00
7d6c7a4aff Merge pull request #684 from bplus/patch-3
Minor spelling fix
2020-03-06 17:01:39 +01:00
a98c6146a4 Merge branch 'master' into patch-3 2020-03-06 17:01:32 +01:00
175e4d8d02 Merge pull request #683 from bplus/patch-1
Spelling fix: Apline to Alpine
2020-03-06 17:01:00 +01:00
c56243bb9d Merge branch 'master' into patch-1 2020-03-06 17:00:40 +01:00
e294e6f6cd Merge pull request #682 from bplus/patch-2
Update CONTRIBUTING.md
2020-03-06 17:00:10 +01:00
4691117100 Minor spelling fix 2020-03-05 14:16:47 -06:00
d104e4e9a5 Update CONTRIBUTING.md
Minor spelling fix.
2020-03-05 14:12:34 -06:00
8aabde1b5a Spelling fix: Apline to Alpine
Minor spelling error.
2020-03-05 14:11:06 -06:00
44bbf048ce Merge pull request #676 from llaville/fix_reverse-proxy_docs
Fix reverse proxy docs
2020-02-24 09:06:50 +01:00
84183c9688 fix typo error in desired DNS name 2020-02-19 17:06:16 +01:00
c05a74fd5f wrong dns record (probably copy/paste from setup-reverse-proxy-nodejs.rst) 2020-02-19 17:04:11 +01:00
0c5750b8bf Merge pull request #675 from alikon/patch-1
fix  year 2020 in changelog
2020-02-13 09:16:58 +01:00
886689ca64 year 2020 f 2020-02-10 12:23:28 +01:00
bfdd3ffbfc Merge pull request #671 from cytopia/release/v1.6.2
Release v1.6.2
2020-02-09 10:21:26 +01:00
3c12883ea1 Update modules in README 2020-02-08 18:45:04 +01:00
51281ef5a0 Release v1.6.2 2020-02-06 09:22:15 +01:00
bf140cf8cd Merge pull request #663 from cytopia/release/v1.6.1
Release v1.6.1
2020-01-05 17:43:52 +01:00
ed8639c636 Refs #662 Fix Symfony version display on Devilbox intranet 2020-01-05 17:18:07 +01:00
06830367c9 Fixes #662 Update to latest Symfony CLI 2020-01-05 15:26:56 +01:00
556b50d76c Merge pull request #661 from cytopia/readme-badges
Update badges
2020-01-05 02:18:27 +01:00
4d2839f6d5 Update badges 2020-01-05 02:19:47 +01:00
87fe2ba593 Merge pull request #660 from cytopia/fix-github-settings
Fix username
2020-01-05 01:39:49 +01:00
cd82fa74a7 Fix username 2020-01-05 01:41:25 +01:00
e48c8e96dc Merge pull request #659 from cytopia/release/v1.6.0
Release v1.6.0
2020-01-05 01:37:59 +01:00
f29d552dfa Fixes #378 Allow to mount local ssh dir into PHP container (r/o) 2020-01-04 22:15:50 +01:00
304fc86329 Fixes #615 Add tool: phpmd 2020-01-04 21:07:52 +01:00
d44905bfb5 Use IP address of PHP container for Apache/Nginx upstream to skip DNS lookup 2020-01-04 20:56:30 +01:00
1b9ef528d2 GitHub settings 2020-01-04 17:41:59 +01:00
4f97eae8fe Prepare Release v1.6.0 2020-01-04 17:06:29 +01:00
2e09f7f0f8 Refs #265 Make vhost ssl type configurable 2020-01-04 17:06:08 +01:00
6fa7a84bd3 Refs #642 Make email catch-all configurable 2020-01-04 17:03:42 +01:00
266c5b84a3 Ensure env file has equal spacing everywhere 2020-01-04 17:02:33 +01:00
b75aa9f2ab Merge pull request #658 from cytopia/fix-unbound-var
Fix unbound bash variable in CI tests
2020-01-04 15:44:27 +01:00
99163bd525 Fix unbound bash variable in CI tests 2020-01-04 15:45:54 +01:00
dada924b41 Merge pull request #657 from cytopia/release/v1.5.0
Release v1.5.0
2020-01-04 03:44:09 +01:00
75b6db7676 Refs #653 #643 add integration tests for MySQL/MariaDB/Percona images 2020-01-03 18:24:38 +01:00
f90b53c79a Fixes #654 Add Opcache Control Panel 2020-01-03 15:39:22 +01:00
7d1d3add5a Merge pull request #655 from cytopia/release/v1.4.0
Release v1.4.0
2020-01-02 18:32:22 +01:00
17735e09ce Adjust release date 2020-01-02 16:12:30 +01:00
ff143fe931 Fixes #265 HTTP to HTTPS redirect 2019-12-31 18:42:42 +01:00
72c7a7db02 Fixes #642 Fixes #614 Updated PHP Docker image 2019-12-31 18:41:13 +01:00
151246179d Refs #618 Update Compose override file with new version 2019-12-31 18:13:52 +01:00
6e27f83b4d Update Changelog 2019-12-31 17:47:57 +01:00
616fed6326 Fixes #618 Update Compose version to 2.3 2019-12-31 17:37:32 +01:00
0b9d127979 Merge pull request #650 from cytopia/update-vendors
Release v1.3.0
2019-12-28 23:40:17 +01:00
53e10a5a38 Fix error_reporting in phpMyAdmin 2019-12-28 22:20:32 +01:00
e3ce8593be Remove non-stable Redis image 2019-12-28 22:05:48 +01:00
e3da67d96d Adding Redis 6.0 2019-12-28 22:00:49 +01:00
4ae80c66aa Remove obsolete links from documentation 2019-12-28 21:27:15 +01:00
ada47bbd5b Ensure travis fails on errors 2019-12-28 21:26:49 +01:00
207b7ac7ad Add Adminer update instructions to changelog 2019-12-28 21:12:08 +01:00
25eac35991 Add phpMyAdmin 5.0.0 2019-12-28 21:02:28 +01:00
8eef4b05ec Update phpMyAdmin to 4.9.3 2019-12-28 20:55:21 +01:00
d8a84bb889 Fix failing tests for Adminer and PHP 8.0 2019-12-28 20:48:41 +01:00
4ac8eb17d2 Fix Adminer tests 2019-12-08 11:11:37 +01:00
e2930d2b4e Update version and Changelog 2019-12-08 08:17:19 +01:00
d6818a1470 Update phpMyAdmin to 4.9.2 2019-12-08 08:14:01 +01:00
914f32bc14 Fixes #626 Update Adminer to 4.7.5 2019-12-08 08:12:03 +01:00
9234730dd8 Merge pull request #648 from cytopia/docs
Build documentation in CI
2019-12-02 19:29:06 +01:00
921188a5b3 Build documentation in CI 2019-12-02 11:23:29 +01:00
bdf8eb7578 Merge pull request #647 from cytopia/release/v1.2.0
Release v1.2.0
2019-12-01 10:49:53 +01:00
dc9a30ed5f Fixes #592 sqlsrv connection problem 2019-11-30 23:15:35 +01:00
e6d0a1597f Reference more issues in Changelog 2019-11-30 23:02:31 +01:00
cf91371b61 Add Updating instructions 2019-11-30 22:59:42 +01:00
b07e2cb747 Cleanup docker-compose.yml 2019-11-30 22:53:21 +01:00
ca5dec2e57 Bump version and Changelog 2019-11-30 22:53:05 +01:00
ccea6e3814 Add latest MySQL images 2019-11-30 22:52:37 +01:00
ce4b340224 Fix #622 by adding httpd server with latest cert-gen version 2019-11-30 22:52:19 +01:00
31940fc22a Add latest PHP-FPM images 2019-11-30 22:51:15 +01:00
a7d3c53979 Make PHP 7.3 the default 2019-11-30 22:50:43 +01:00
44b146b824 Merge pull request #645 from cytopia/release/v1.1.0
Release v1.1.0
2019-11-24 22:16:46 +01:00
44b9611c94 Remove empty line from README.md 2019-11-24 16:15:01 +01:00
593dfbe31a Fix Wordpress CI check 2019-11-24 11:38:27 +01:00
a409c214c7 Do not change HTTP port when running from inside container 2019-11-24 10:37:49 +01:00
4daebaa325 Ensure vhost-gen config files match with upstream 2019-11-24 10:34:42 +01:00
967f282739 Adjust Changelog 2019-11-24 10:31:07 +01:00
182269fdf1 Update MongoDB images 2019-11-24 10:29:15 +01:00
57a1f335f6 Update PostgreSQL images 2019-11-24 10:25:29 +01:00
247530bcac Add GitHub Actions build badges 2019-11-24 10:24:04 +01:00
8f47af8bfb Exclude Apache 2.2 from static DirectoryIndex test 2019-11-24 10:06:37 +01:00
49d6c68bb5 Test Frameworks according to chosen PHP version 2019-11-24 10:02:12 +01:00
b318da24c6 Update version dates 2019-11-24 01:04:01 +01:00
3551c89311 Split GitHub Actions workflows 2019-11-24 01:02:51 +01:00
b5ed81e28a Fix Travis builds 2019-11-23 12:41:57 +01:00
57ff6da675 Fix unbound variable 2019-11-23 00:26:50 +01:00
c8de832210 Simplify tests 2019-11-23 00:02:17 +01:00
41493bc514 Test against wordpress 2019-11-22 23:11:34 +01:00
2f129611cc Fix unbound variable in tests 2019-11-22 10:41:25 +01:00
2744a39aec Adjust Travis CI checks 2019-11-22 08:56:49 +01:00
9cff9a1277 Update PHP image version 2019-11-22 08:49:26 +01:00
7301d581df Update Intranet version 2019-11-21 17:34:03 +01:00
c271734278 Update CHANGELOG 2019-11-21 17:33:34 +01:00
574a6cc183 Test all versions via GitHub Actions 2019-11-21 15:20:35 +01:00
5d9f396b14 Ensure Vendor login works 2019-11-21 14:55:16 +01:00
7ea5aa8aed Fixes #641 Adding latest version of phpPgAdmin 2019-11-21 13:35:45 +01:00
2a2167205a Make tests pass shellcheck 2019-11-21 12:44:35 +01:00
2b58cb5153 Fixes #644 Use PHP 7.4 with stable JPEG support 2019-11-20 12:01:20 +01:00
f4ddbfb15e Run CI steps even if previous ones failed 2019-11-18 00:58:24 +01:00
de89a170e7 php-fpm v0.92 2019-11-18 00:20:31 +01:00
2aacfeaaed Add integration tests via GitHub Actions 2019-11-18 00:17:10 +01:00
ace5d7c1fc Merge pull request #624 from nuno-andre/patch-1
Updates end-of-line for batch file
2019-11-02 19:53:34 +01:00
04e7c70b26 Updates end-of-line for batch file
Using *nix' `lf` line endings instead of `crlf` in Windows batch files can lead to [unexpected results](https://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e).
2019-08-27 19:26:53 +02:00
0543f2da92 Merge pull request #591 from cytopia/ngrok
Make Ngrok region configurable via NGROK_REGION env var
2019-06-11 08:58:53 +02:00
9b5e19cf41 Make Ngrok region configurable via NGROK_REGION env var 2019-06-10 19:00:02 +02:00
3dec841e88 Merge pull request #590 from cytopia/update-php-container
Fix #587 Use updated PHP images
2019-06-10 18:29:31 +02:00
3370934bb3 Bump version date 2019-06-10 16:46:24 +02:00
0a5327ac77 Reflect new modules in README 2019-06-10 16:46:10 +02:00
11c46cd9c0 Fix #587 Use updated PHP images 2019-06-10 16:40:44 +02:00
7347 changed files with 1098502 additions and 282314 deletions

4
.devilbox/cfg/mysql.cnf Normal file
View File

@ -0,0 +1,4 @@
[mysqld]
server_id = 1
log_bin = "mysql-bin"
sync_binlog = 0

View File

@ -13,8 +13,8 @@ error_reporting(-1);
putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1');
$DEVILBOX_VERSION = 'v1.0.2';
$DEVILBOX_DATE = '2019-05-21';
$DEVILBOX_VERSION = 'v1.10.3';
$DEVILBOX_DATE = '2022-02-04';
$DEVILBOX_API_PAGE = 'devilbox-api/status.json';
//
@ -127,15 +127,27 @@ function loadClass($class) {
break;
case 'Redis':
// Check if redis is using a password
$REDIS_ROOT_PASSWORD = '';
$_REDIS_ARGS = loadClass('Helper')->getEnv('REDIS_ARGS');
$_REDIS_PASS = preg_split("/--requirepass\s+/", $_REDIS_ARGS);
if (is_array($_REDIS_PASS) && count($_REDIS_PASS)) {
// In case the option is specified multiple times, use the last effective one.
$_REDIS_PASS = $_REDIS_PASS[count($_REDIS_PASS)-1];
/*
* This pattern will match optional quoted string, 'my password' or "my password"
* or if there aren't any quotes, it will match up until the next space.
*/
$_REDIS_PASS = array();
preg_match_all('/--requirepass\s+("|\')?(?(1)(.*)|([^\s]*))(?(1)\1|)/', $_REDIS_ARGS, $_REDIS_PASS, PREG_SET_ORDER);
if (! empty($_REDIS_PASS)) {
/*
* In case the option is specified multiple times, use the last effective one.
*
* preg_match_all returns a multi-dimensional array, the first level array is in order of which was matched first,
* and the password string is either matched in group 2 or group 3 which is always the end of the sub-array.
*/
$_REDIS_PASS = end(end($_REDIS_PASS));
if (strlen($_REDIS_PASS) > 0) {
$REDIS_ROOT_PASSWORD = $_REDIS_PASS;
}

View File

@ -0,0 +1,22 @@
class HtmlEmail extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
let emailContent;
const templateId = this.dataset.templateId;
try {
emailContent = document.getElementById(templateId).innerHTML;
} catch (error) {
console.log(error);
return;
}
const container = document.createElement('div');
container.innerHTML = emailContent;
this.shadowRoot.appendChild(container);
}
}
customElements.define('html-email', HtmlEmail);

View File

@ -0,0 +1,62 @@
<?php require '../config.php'; ?>
<?php loadClass('Helper')->authPage(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>Httpd custom configs</h1>
<br/>
<br/>
<p>Shows your currently custom configuration files applied to the Httpd container.</p>
<div class="row">
<div class="col-md-12">
<?php $vHosts = loadClass('Httpd')->getVirtualHosts(); ?>
<?php $custom = false; ?>
<?php foreach ($vHosts as $vHost): ?>
<?php if (($vhostGen = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
<?php $custom = true; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($custom): ?>
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Project</th>
<th>Host</th>
<th>Container</th>
<th>Files</th>
</tr>
</thead>
<tbody>
<?php foreach ($vHosts as $vHost): ?>
<?php if (($vhostGen = loadClass('Httpd')->getVhostgenTemplatePath($vHost['name'])) !== false): ?>
<tr>
<th><?php echo $vHost['domain']; ?></th>
<td><?php echo loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vHost['name'].'/'.loadClass('Helper')->getEnv('HTTPD_TEMPLATE_DIR');?></td>
<td><?php echo dirname($vhostGen); ?></td>
<td><code><?php echo basename($vhostGen); ?></code></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>No custom configurations applied.</p>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -0,0 +1,126 @@
<?php require '../config.php'; ?>
<?php loadClass('Helper')->authPage(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<h1>PHP custom configs</h1>
<br/>
<br/>
<p>Shows your currently custom configuration files applied to the PHP-FPM container.</p>
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<thead class="thead-inverse">
<tr>
<th>Section</th>
<th>Host</th>
<th>Container</th>
<th>Files</th>
</tr>
</thead>
<tbody>
<tr>
<th>Supervisord</th>
<td>supervisor/</td>
<td>/etc/supervisor/custom.d/</td>
<td>
<?php
$files = glob('/etc/supervisor/custom.d/*.conf');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>Autostart (global)</th>
<td>autostart/</td>
<td>/startup.2.d/</td>
<td>
<?php
$files = glob('/startup.2.d/*.sh');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>Autostart (version)</th>
<td>cfg/php-startup-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
<td>/startup.1.d/</td>
<td>
<?php
$files = glob('/startup.1.d/*.sh');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>PHP-FPM</th>
<td>cfg/php-fpm-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
<td>/etc/php-fpm-custom.d/</td>
<td>
<?php
$files = glob('/etc/php-fpm-custom.d/*.conf');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
<tr>
<th>PHP</th>
<td>cfg/php-ini-<?php echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;?>/</td>
<td>/etc/php-custom.d/</td>
<td>
<?php
$files = glob('/etc/php-custom.d/*.ini');
if ($files) {
foreach ($files as $file) {
echo '<code>'.basename($file). '</code><br/>';
}
} else {
echo 'No custom files';
}
?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -19,7 +19,7 @@
<div class="col-md-12">
<?php if (!loadClass('Memcd')->isAvailable()): ?>
<p>Memcahed container is not running.</p>
<p>Memcached container is not running.</p>
<?php else: ?>
<?php foreach (loadClass('Memcd')->getInfo() as $srv => $data): ?>
<h2><?php echo $srv; ?></h2>

View File

@ -0,0 +1,32 @@
<?php require '../config.php'; ?>
<?php loadClass('Helper')->authPage(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo loadClass('Html')->getHead(); ?>
</head>
<body>
<?php echo loadClass('Html')->getNavbar(); ?>
<div class="container">
<div class="row">
<div class="col-md-12">
<style>
body {width: 100% !important;}
</style>
<?php if (($version = phpversion('xdebug')) === false): ?>
<p><code>xdebug</code> module is not enabled.</p>
<?php elseif (!function_exists('xdebug_info')): ?>
<p>Xdebug info only available with <code>xdebug 3.x.x</code> or greater. Your version is <code>xdebug <?php echo $version;?></code></p>
<?php else:?>
<?php xdebug_info(); ?>
<?php endif; ?>
</div>
</div>
</div><!-- /.container -->
<?php echo loadClass('Html')->getFooter(); ?>
</body>
</html>

View File

@ -24,6 +24,17 @@ require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'mimeDeco
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php';
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Sort.php';
if (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
$message = $_GET['delete'];
$MyMbox = new \devilbox\Mail('/var/mail/devilbox');
$MyMbox->delete($message);
header('Location: /mail.php');
exit();
}
//
// Setup Sort/Order
//
@ -152,6 +163,7 @@ $messages = $MyMbox->get($sortOrderArr);
<th>From <?php echo $orderFrom;?></th>
<th>To <?php echo $orderTo;?></th>
<th>Subject <?php echo $orderSubj;?></th>
<th>Action</th>
</tr>
</thead>
<tbody>
@ -159,6 +171,17 @@ $messages = $MyMbox->get($sortOrderArr);
<?php
$message = htmlentities($data['raw']);
$structure = $data['decoded'];
$body = null;
if (isset($structure->body)) {
$body = $structure->body;
}
elseif(isset($structure->parts[1]->body)) {
$body = $structure->parts[1]->body;
}
elseif(isset($structure->parts[0]->body)) {
$body = $structure->parts[0]->body;
}
?>
<tr id="<?php echo $data['num'];?>" class="subject">
<td><?php echo $data['num'];?></td>
@ -169,21 +192,19 @@ $messages = $MyMbox->get($sortOrderArr);
<td><?php echo htmlentities($structure->headers['from']);?></td>
<td><?php echo htmlentities($structure->headers['x-original-to']);?></td>
<td><?php echo htmlentities($structure->headers['subject']);?></td>
<td><a href="/mail.php?delete=<?php echo $data['num']-1;?>" title="Delete Email"><i class="fa fa-trash"></i></a></td>
</tr>
<tr></tr>
<tr id="mail-<?php echo $data['num'];?>" style="display:none">
<td></td>
<td colspan="4">
<?php if (isset($structure->body)): ?>
<?php echo htmlentities($structure->body) ?>
<?php elseif(isset($structure->parts[1]->body)): ?>
<?php echo htmlentities($structure->parts[1]->body) ?>
<?php elseif(isset($structure->parts[0]->body)): ?>
<?php echo htmlentities($structure->parts[0]->body) ?>
<td colspan="5">
<?php if ($body !== null): ?>
<template id="mail-body-<?=$data['num']?>"><?=$body?></template>
<html-email data-template-id="mail-body-<?=$data['num']?>"></html-email>
<?php else: ?>
<?php echo '<div class="alert alert-warning" role="alert">
<div class="alert alert-warning" role="alert">
No valid body found
</div>' ?>
</div>
<?php endif; ?>
<hr>
<p><a class="btn btn-primary" data-toggle="collapse" href="#email-<?php echo $data['num'];?>" aria-expanded="false" aria-controls="email-<?php echo $data['num'];?>">Raw source</a></p>
@ -205,15 +226,13 @@ $messages = $MyMbox->get($sortOrderArr);
<?php echo loadClass('Html')->getFooter(); ?>
<script>
$(function() {
$('.subject').each(function() {
$(this).click(function() {
var id = ($(this).attr('id'));
$('#mail-'+id).toggle();
})
$('.subject').click(function() {
var id = ($(this).attr('id'));
$('#mail-'+id).toggle();
})
// Handler for .ready() called.
});
</script>
<script src="/assets/js/html-email.js"></script>
</body>
</html>

View File

@ -13,6 +13,7 @@
* @license MIT, http://acollington.mit-license.org/
*/
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);
/*
* User configuration

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

391
.devilbox/www/htdocs/vendor/ocp.php vendored Normal file
View File

@ -0,0 +1,391 @@
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
0.1.4 2013-04-09 added "recheck" to update files when using large revalidate_freq (or validate_timestamps=Off)
0.1.3 2013-03-30 show host and php version, can bookmark with hashtag ie. #statistics - needs new layout asap
0.1.2 2013-03-25 show optimization levels, number formatting, support for start_time in 7.0.2
0.1.1 2013-03-18 today Zend completely renamed Optimizer+ to OPcache, adjusted OCP to keep working
0.1.0 2013-03-17 added group/sort indicators, replaced "accelerator_" functions with "opcache_"
0.0.6 2013-03-16 transition support as Zend renames product and functions for PHP 5.5 (stasilok)
0.0.5 2013-03-10 added refresh button (GK)
0.0.4 2013-02-18 added file grouping and sorting (click on headers) - code needs cleanup but gets the job done
0.0.2 2013-02-14 first public release
* known problems/limitations:
Unlike APC, the Zend OPcache API
- cannot determine when a file was put into the cache
- cannot change settings on the fly
- cannot protect opcache functions by restricting execution to only specific scripts/paths
* todo:
Extract variables for prefered ordering and better layout instead of just dumping into tables
File list filter
*/
// ini_set('display_errors',1); error_reporting(-1);
if ( count(get_included_files())>1 || php_sapi_name()=='cli' || empty($_SERVER['REMOTE_ADDR']) ) { die; } // weak block against indirect access
$time=time();
define('CACHEPREFIX',function_exists('opcache_reset')?'opcache_':(function_exists('accelerator_reset')?'accelerator_':''));
if ( !empty($_GET['RESET']) ) {
if ( function_exists(CACHEPREFIX.'reset') ) { call_user_func(CACHEPREFIX.'reset'); }
header( 'Location: '.str_replace('?'.$_SERVER['QUERY_STRING'],'',$_SERVER['REQUEST_URI']) );
exit;
}
if ( !empty($_GET['RECHECK']) ) {
if ( function_exists(CACHEPREFIX.'invalidate') ) {
$recheck=trim($_GET['RECHECK']); $files=call_user_func(CACHEPREFIX.'get_status');
if (!empty($files['scripts'])) {
foreach ($files['scripts'] as $file=>$value) {
if ( $recheck==='1' || strpos($file,$recheck)===0 ) call_user_func(CACHEPREFIX.'invalidate',$file);
}
}
header( 'Location: '.str_replace('?'.$_SERVER['QUERY_STRING'],'',$_SERVER['REQUEST_URI']) );
} else { echo 'Sorry, this feature requires Zend Opcache newer than April 8th 2013'; }
exit;
}
?><!DOCTYPE html>
<html>
<head>
<title>OCP - Opcache Control Panel</title>
<meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
<style type="text/css">
body {background-color: #fff; color: #000;}
body, td, th, h1, h2 {font-family: sans-serif;}
pre {margin: 0px; font-family: monospace;}
a:link,a:visited {color: #000099; text-decoration: none;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse; width: 600px; }
.center {text-align: center;}
.center table { margin-left: auto; margin-right: auto; text-align: left;}
.center th { text-align: center !important; }
.middle {vertical-align:middle;}
td, th { border: 1px solid #000; font-size: 75%; vertical-align: baseline; padding: 3px; }
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000; width:50%; white-space:nowrap;}
.h {background-color: #9999cc; font-weight: bold; color: #000;}
.v {background-color: #cccccc; color: #000;}
.vr {background-color: #cccccc; text-align: right; color: #000; white-space: nowrap;}
.b {font-weight:bold;}
.white, .white a {color:#fff;}
img {float: right; border: 0px;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000;}
.meta, .small {font-size: 75%; }
.meta {margin: 2em 0;}
.meta a, th a {padding: 10px; white-space:nowrap; }
.buttons {margin:0 0 1em;}
.buttons a {margin:0 15px; background-color: #9999cc; color:#fff; text-decoration:none; padding:1px; border:1px solid #000; display:inline-block; width:5em; text-align:center;}
#files td.v a {font-weight:bold; color:#9999cc; margin:0 10px 0 5px; text-decoration:none; font-size:120%;}
#files td.v a:hover {font-weight:bold; color:#ee0000;}
.graph {display:inline-block; width:145px; margin:1em 0 1em 1px; border:0; vertical-align:top;}
.graph table {width:100%; height:150px; border:0; padding:0; margin:5px 0 0 0; position:relative;}
.graph td {vertical-align:middle; border:0; padding:0 0 0 5px;}
.graph .bar {width:25px; text-align:right; padding:0 2px; color:#fff;}
.graph .total {width:34px; text-align:center; padding:0 5px 0 0;}
.graph .total div {border:1px dashed #888; border-right:0; height:99%; width:12px; position:absolute; bottom:0; left:17px; z-index:-1;}
.graph .total span {background:#fff; font-weight:bold;}
.graph .actual {text-align:right; font-weight:bold; padding:0 5px 0 0;}
.graph .red {background:#ee0000;}
.graph .green {background:#00cc00;}
.graph .brown {background:#8B4513;}
</style>
<!--[if lt IE 9]><script type="text/javascript" defer="defer">
window.onload=function(){var i,t=document.getElementsByTagName('table');for(i=0;i<t.length;i++){if(t[i].parentNode.className=='graph')t[i].style.height=150-(t[i].clientHeight-150)+'px';}}
</script><![endif]-->
</head>
<body>
<div class="center">
<h1><a href="?">Opcache Control Panel</a></h1>
<div class="buttons">
<a href="?ALL=1">Details</a>
<a href="?FILES=1&GROUP=2&SORT=3">Files</a>
<a href="?RESET=1" onclick="return confirm('RESET cache ?')">Reset</a>
<?php if ( function_exists(CACHEPREFIX.'invalidate') ) { ?>
<a href="?RECHECK=1" onclick="return confirm('Recheck all files in the cache ?')">Recheck</a>
<?php } ?>
<a href="?" onclick="window.location.reload(true); return false">Refresh</a>
</div>
<?php
if ( !function_exists(CACHEPREFIX.'get_status') ) { echo '<h2>Opcache not detected?</h2>'; die; }
if ( !empty($_GET['FILES']) ) { echo '<h2>files cached</h2>'; files_display(); echo '</div></body></html>'; exit; }
if ( !(isset($_REQUEST['GRAPHS']) && !$_REQUEST['GRAPHS']) && CACHEPREFIX=='opcache_') { graphs_display(); if ( !empty($_REQUEST['GRAPHS']) ) { exit; } }
ob_start(); phpinfo(8); $phpinfo = ob_get_contents(); ob_end_clean(); // some info is only available via phpinfo? sadly buffering capture has to be used
if ( !preg_match( '/module\_Zend.(Optimizer\+|OPcache).+?(\<table[^>]*\>.+?\<\/table\>).+?(\<table[^>]*\>.+?\<\/table\>)/is', $phpinfo, $opcache) ) { } // todo
if ( function_exists(CACHEPREFIX.'get_configuration') ) { echo '<h2>general</h2>'; $configuration=call_user_func(CACHEPREFIX.'get_configuration'); }
$host=function_exists('gethostname')?@gethostname():@php_uname('n'); if (empty($host)) { $host=empty($_SERVER['SERVER_NAME'])?$_SERVER['HOST_NAME']:$_SERVER['SERVER_NAME']; }
$version=array('Host'=>$host);
$version['PHP Version']='PHP '.(defined('PHP_VERSION')?PHP_VERSION:'???').' '.(defined('PHP_SAPI')?PHP_SAPI:'').' '.(defined('PHP_OS')?' '.PHP_OS:'');
$version['Opcache Version']=empty($configuration['version']['version'])?'???':$configuration['version'][CACHEPREFIX.'product_name'].' '.$configuration['version']['version'];
print_table($version);
if ( !empty($opcache[2]) ) { echo preg_replace('/\<tr\>\<td class\="e"\>[^>]+\<\/td\>\<td class\="v"\>[0-9\,\. ]+\<\/td\>\<\/tr\>/','',$opcache[2]); }
if ( function_exists(CACHEPREFIX.'get_status') && $status=call_user_func(CACHEPREFIX.'get_status') ) {
$uptime=array();
if ( !empty($status[CACHEPREFIX.'statistics']['start_time']) ) {
$uptime['uptime']=time_since($time,$status[CACHEPREFIX.'statistics']['start_time'],1,'');
}
if ( !empty($status[CACHEPREFIX.'statistics']['last_restart_time']) ) {
$uptime['last_restart']=time_since($time,$status[CACHEPREFIX.'statistics']['last_restart_time']);
}
if (!empty($uptime)) {print_table($uptime);}
if ( !empty($status['cache_full']) ) { $status['memory_usage']['cache_full']=$status['cache_full']; }
echo '<h2 id="memory">memory</h2>';
print_table($status['memory_usage']);
unset($status[CACHEPREFIX.'statistics']['start_time'],$status[CACHEPREFIX.'statistics']['last_restart_time']);
echo '<h2 id="statistics">statistics</h2>';
print_table($status[CACHEPREFIX.'statistics']);
}
if ( empty($_GET['ALL']) ) { meta_display(); exit; }
if ( !empty($configuration['blacklist']) ) { echo '<h2 id="blacklist">blacklist</h2>'; print_table($configuration['blacklist']); }
if ( !empty($opcache[3]) ) { echo '<h2 id="runtime">runtime</h2>'; echo $opcache[3]; }
$name='zend opcache'; $functions=get_extension_funcs($name);
if (!$functions) { $name='zend optimizer+'; $functions=get_extension_funcs($name); }
if ($functions) { echo '<h2 id="functions">functions</h2>'; print_table($functions); } else { $name=''; }
$level=trim(CACHEPREFIX,'_').'.optimization_level';
if (isset($configuration['directives'][$level])) {
echo '<h2 id="optimization">optimization levels</h2>';
$levelset=strrev(base_convert($configuration['directives'][$level], 10, 2));
$levels=array(
1=>'<a href="http://wikipedia.org/wiki/Common_subexpression_elimination">Constants subexpressions elimination</a> (CSE) true, false, null, etc.<br />Optimize series of ADD_STRING / ADD_CHAR<br />Convert CAST(IS_BOOL,x) into BOOL(x)<br />Convert <a href="http://www.php.net/manual/internals2.opcodes.init-fcall-by-name.php">INIT_FCALL_BY_NAME</a> + <a href="http://www.php.net/manual/internals2.opcodes.do-fcall-by-name.php">DO_FCALL_BY_NAME</a> into <a href="http://www.php.net/manual/internals2.opcodes.do-fcall.php">DO_FCALL</a>',
2=>'Convert constant operands to expected types<br />Convert conditional <a href="http://php.net/manual/internals2.opcodes.jmp.php">JMP</a> with constant operands<br />Optimize static <a href="http://php.net/manual/internals2.opcodes.brk.php">BRK</a> and <a href="<a href="http://php.net/manual/internals2.opcodes.cont.php">CONT</a>',
3=>'Convert $a = $a + expr into $a += expr<br />Convert $a++ into ++$a<br />Optimize series of <a href="http://php.net/manual/internals2.opcodes.jmp.php">JMP</a>',
4=>'PRINT and ECHO optimization (<a href="https://github.com/zend-dev/ZendOptimizerPlus/issues/73">defunct</a>)',
5=>'Block Optimization - most expensive pass<br />Performs many different optimization patterns based on <a href="http://wikipedia.org/wiki/Control_flow_graph">control flow graph</a> (CFG)',
9=>'Optimize <a href="http://wikipedia.org/wiki/Register_allocation">register allocation</a> (allows re-usage of temporary variables)',
10=>'Remove NOPs'
);
echo '<table width="600" border="0" cellpadding="3"><tbody><tr class="h"><th>Pass</th><th>Description</th></tr>';
foreach ($levels as $pass=>$description) {
$disabled=substr($levelset,$pass-1,1)!=='1' || $pass==4 ? ' white':'';
echo '<tr><td class="v center middle'.$disabled.'">'.$pass.'</td><td class="v'.$disabled.'">'.$description.'</td></tr>';
}
echo '</table>';
}
if ( isset($_GET['DUMP']) ) {
if ($name) { echo '<h2 id="ini">ini</h2>'; print_table(ini_get_all($name,true)); }
foreach ($configuration as $key=>$value) { echo '<h2>',$key,'</h2>'; print_table($configuration[$key]); }
exit;
}
meta_display();
echo '</div></body></html>';
exit;
function time_since($time,$original,$extended=0,$text='ago') {
$time = $time - $original;
$day = $extended? floor($time/86400) : round($time/86400,0);
$amount=0; $unit='';
if ( $time < 86400) {
if ( $time < 60) { $amount=$time; $unit='second'; }
elseif ( $time < 3600) { $amount=floor($time/60); $unit='minute'; }
else { $amount=floor($time/3600); $unit='hour'; }
}
elseif ( $day < 14) { $amount=$day; $unit='day'; }
elseif ( $day < 56) { $amount=floor($day/7); $unit='week'; }
elseif ( $day < 672) { $amount=floor($day/30); $unit='month'; }
else { $amount=intval(2*($day/365))/2; $unit='year'; }
if ( $amount!=1) {$unit.='s';}
if ($extended && $time>60) { $text=' and '.time_since($time,$time<86400?($time<3600?$amount*60:$amount*3600):$day*86400,0,'').$text; }
return $amount.' '.$unit.' '.$text;
}
function print_table($array,$headers=false) {
if ( empty($array) || !is_array($array) ) {return;}
echo '<table border="0" cellpadding="3" width="600">';
if (!empty($headers)) {
if (!is_array($headers)) {$headers=array_keys(reset($array));}
echo '<tr class="h">';
foreach ($headers as $value) { echo '<th>',$value,'</th>'; }
echo '</tr>';
}
foreach ($array as $key=>$value) {
echo '<tr>';
if ( !is_numeric($key) ) {
$key=ucwords(str_replace('_',' ',$key));
echo '<td class="e">',$key,'</td>';
if ( is_numeric($value) ) {
if ( $value>1048576) { $value=round($value/1048576,1).'M'; }
elseif ( is_float($value) ) { $value=round($value,1); }
}
}
if ( is_array($value) ) {
foreach ($value as $column) {
echo '<td class="v">',$column,'</td>';
}
echo '</tr>';
}
else { echo '<td class="v">',$value,'</td></tr>'; }
}
echo '</table>';
}
function files_display() {
$status=call_user_func(CACHEPREFIX.'get_status');
if ( empty($status['scripts']) ) {return;}
if ( isset($_GET['DUMP']) ) { print_table($status['scripts']); exit;}
$time=time(); $sort=0;
$nogroup=preg_replace('/\&?GROUP\=[\-0-9]+/','',$_SERVER['REQUEST_URI']);
$nosort=preg_replace('/\&?SORT\=[\-0-9]+/','',$_SERVER['REQUEST_URI']);
$group=empty($_GET['GROUP'])?0:intval($_GET['GROUP']); if ( $group<0 || $group>9) { $group=1;}
$groupset=array_fill(0,9,''); $groupset[$group]=' class="b" ';
echo '<div class="meta">
<a ',$groupset[0],'href="',$nogroup,'">ungroup</a> |
<a ',$groupset[1],'href="',$nogroup,'&GROUP=1">1</a> |
<a ',$groupset[2],'href="',$nogroup,'&GROUP=2">2</a> |
<a ',$groupset[3],'href="',$nogroup,'&GROUP=3">3</a> |
<a ',$groupset[4],'href="',$nogroup,'&GROUP=4">4</a> |
<a ',$groupset[5],'href="',$nogroup,'&GROUP=5">5</a>
</div>';
if ( !$group ) { $files =& $status['scripts']; }
else {
$files=array();
foreach ($status['scripts'] as $data) {
if ( preg_match('@^[/]([^/]+[/]){'.$group.'}@',$data['full_path'],$path) ) {
if ( empty($files[$path[0]])) { $files[$path[0]]=array('full_path'=>'','files'=>0,'hits'=>0,'memory_consumption'=>0,'last_used_timestamp'=>'','timestamp'=>''); }
$files[$path[0]]['full_path']=$path[0];
$files[$path[0]]['files']++;
$files[$path[0]]['memory_consumption']+=$data['memory_consumption'];
$files[$path[0]]['hits']+=$data['hits'];
if ( $data['last_used_timestamp']>$files[$path[0]]['last_used_timestamp']) {$files[$path[0]]['last_used_timestamp']=$data['last_used_timestamp'];}
if ( $data['timestamp']>$files[$path[0]]['timestamp']) {$files[$path[0]]['timestamp']=$data['timestamp'];}
}
}
}
if ( !empty($_GET['SORT']) ) {
$keys=array(
'full_path'=>SORT_STRING,
'files'=>SORT_NUMERIC,
'memory_consumption'=>SORT_NUMERIC,
'hits'=>SORT_NUMERIC,
'last_used_timestamp'=>SORT_NUMERIC,
'timestamp'=>SORT_NUMERIC
);
$titles=array('','path',$group?'files':'','size','hits','last used','created');
$offsets=array_keys($keys);
$key=intval($_GET['SORT']);
$direction=$key>0?1:-1;
$key=abs($key)-1;
$key=isset($offsets[$key])&&!($key==1&&empty($group))?$offsets[$key]:reset($offsets);
$sort=array_search($key,$offsets)+1;
$sortflip=range(0,7); $sortflip[$sort]=-$direction*$sort;
if ( $keys[$key]==SORT_STRING) {$direction=-$direction; }
$arrow=array_fill(0,7,''); $arrow[$sort]=$direction>0?' &#x25BC;':' &#x25B2;';
$direction=$direction>0?SORT_DESC:SORT_ASC;
$column=array(); foreach ($files as $data) { $column[]=$data[$key]; }
array_multisort($column, $keys[$key], $direction, $files);
}
echo '<table border="0" cellpadding="3" width="960" id="files">
<tr class="h">';
foreach ($titles as $column=>$title) {
if ($title) echo '<th><a href="',$nosort,'&SORT=',$sortflip[$column],'">',$title,$arrow[$column],'</a></th>';
}
echo ' </tr>';
foreach ($files as $data) {
echo '<tr>
<td class="v" nowrap><a title="recheck" href="?RECHECK=',rawurlencode($data['full_path']),'">x</a>',$data['full_path'],'</td>',
($group?'<td class="vr">'.number_format($data['files']).'</td>':''),
'<td class="vr">',number_format(round($data['memory_consumption']/1024)),'K</td>',
'<td class="vr">',number_format($data['hits']),'</td>',
'<td class="vr">',time_since($time,$data['last_used_timestamp']),'</td>',
'<td class="vr">',empty($data['timestamp'])?'':time_since($time,$data['timestamp']),'</td>
</tr>';
}
echo '</table>';
}
function graphs_display() {
$graphs=array();
$colors=array('green','brown','red');
$primes=array(223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987);
$configuration=call_user_func(CACHEPREFIX.'get_configuration');
$status=call_user_func(CACHEPREFIX.'get_status');
$graphs['memory']['total']=$configuration['directives']['opcache.memory_consumption'];
$graphs['memory']['free']=$status['memory_usage']['free_memory'];
$graphs['memory']['used']=$status['memory_usage']['used_memory'];
$graphs['memory']['wasted']=$status['memory_usage']['wasted_memory'];
$graphs['keys']['total']=$status[CACHEPREFIX.'statistics']['max_cached_keys'];
foreach ($primes as $prime) { if ($prime>=$graphs['keys']['total']) { $graphs['keys']['total']=$prime; break;} }
$graphs['keys']['free']=$graphs['keys']['total']-$status[CACHEPREFIX.'statistics']['num_cached_keys'];
$graphs['keys']['scripts']=$status[CACHEPREFIX.'statistics']['num_cached_scripts'];
$graphs['keys']['wasted']=$status[CACHEPREFIX.'statistics']['num_cached_keys']-$status[CACHEPREFIX.'statistics']['num_cached_scripts'];
$graphs['hits']['total']=0;
$graphs['hits']['hits']=$status[CACHEPREFIX.'statistics']['hits'];
$graphs['hits']['misses']=$status[CACHEPREFIX.'statistics']['misses'];
$graphs['hits']['blacklist']=$status[CACHEPREFIX.'statistics']['blacklist_misses'];
$graphs['hits']['total']=array_sum($graphs['hits']);
$graphs['restarts']['total']=0;
$graphs['restarts']['manual']=$status[CACHEPREFIX.'statistics']['manual_restarts'];
$graphs['restarts']['keys']=$status[CACHEPREFIX.'statistics']['hash_restarts'];
$graphs['restarts']['memory']=$status[CACHEPREFIX.'statistics']['oom_restarts'];
$graphs['restarts']['total']=array_sum($graphs['restarts']);
foreach ( $graphs as $caption=>$graph) {
echo '<div class="graph"><div class="h">',$caption,'</div><table border="0" cellpadding="0" cellspacing="0">';
foreach ($graph as $label=>$value) {
if ($label=='total') { $key=0; $total=$value; $totaldisplay='<td rowspan="3" class="total"><span>'.($total>999999?round($total/1024/1024).'M':($total>9999?round($total/1024).'K':$total)).'</span><div></div></td>'; continue;}
$percent=$total?floor($value*100/$total):''; $percent=!$percent||$percent>99?'':$percent.'%';
echo '<tr>',$totaldisplay,'<td class="actual">', ($value>999999?round($value/1024/1024).'M':($value>9999?round($value/1024).'K':$value)),'</td><td class="bar ',$colors[$key],'" height="',$percent,'">',$percent,'</td><td>',$label,'</td></tr>';
$key++; $totaldisplay='';
}
echo '</table></div>',"\n";
}
}
function meta_display() {
?>
<div class="meta">
<a href="http://files.zend.com/help/Zend-Server-6/content/zendoptimizerplus.html">directives guide</a> |
<a href="http://files.zend.com/help/Zend-Server-6/content/zend_optimizer+_-_php_api.htm">functions guide</a> |
<a href="https://wiki.php.net/rfc/optimizerplus">wiki.php.net</a> |
<a href="http://pecl.php.net/package/ZendOpcache">pecl</a> |
<a href="https://github.com/zend-dev/ZendOptimizerPlus/">Zend source</a> |
<a href="https://gist.github.com/ck-on/4959032/?ocp.php">OCP latest</a>
</div>
<?php
}

View File

@ -1,4 +1,5 @@
<?php
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
return array (
'stats_api' => 'Server',
'slabs_api' => 'Server',

View File

@ -10,7 +10,7 @@
* @package PhpMyAdmin
*/
error_reporting(-1);
error_reporting(0);
$cfg['TempDir'] = '/tmp';
$cfg['CheckConfigurationPermissions'] = false;
$cfg['blowfish_secret'] = 'GObO60^(04#^5637%fdUGo(*6$%6#dy4';

View File

@ -1,139 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in documentation in the doc/ folder
* or at <https://docs.phpmyadmin.net/>.
*
* @package PhpMyAdmin
*/
/*
* This is needed for cookie based authentication to encrypt password in
* cookie. Needs to be 32 chars long.
*/
$cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
/*
* phpMyAdmin configuration storage settings.
*/
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
/*
* End of servers configuration
*/
/*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/**
* Defines whether a user should be displayed a "show all (records)"
* button in browse mode or not.
* default = false
*/
//$cfg['ShowAll'] = true;
/**
* Number of rows displayed when browsing a result set. If the result
* set contains more rows, "Previous" and "Next".
* default = 30
*/
//$cfg['MaxRows'] = 50;
/**
* disallow editing of binary fields
* valid values are:
* false allow editing
* 'blob' allow editing except for BLOB fields
* 'noblob' disallow editing except for BLOB fields
* 'all' disallow editing
* default = blob
*/
//$cfg['ProtectBinary'] = 'false';
/**
* Default language to use, if not browser-defined or user-defined
* (you find all languages in the locale folder)
* uncomment the desired line:
* default = 'en'
*/
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';
/**
* default display direction (horizontal|vertical|horizontalflipped)
*/
//$cfg['DefaultDisplay'] = 'vertical';
/**
* How many columns should be used for table display of a database?
* (a value larger than 1 results in some information being hidden)
* default = 1
*/
//$cfg['PropertiesNumColumns'] = 2;
/**
* Set to true if you want DB-based query history.If false, this utilizes
* JS-routines to display query history (lost by window close)
*
* This requires configuration storage enabled, see above.
* default = false
*/
//$cfg['QueryHistoryDB'] = true;
/**
* When using DB-based query history, how many entries should be kept?
*
* default = 25
*/
//$cfg['QueryHistoryMax'] = 100;
/*
* You can find more configuration options in the documentation
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
*/
?>

View File

@ -1,17 +0,0 @@
# EditorConfig.org
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
[*.{js,php,twig,phtml,json,css}]
indent_style = space
indent_size = 4
[{*.sql,package.json,.travis.yml}]
indent_style = space
indent_size = 2

View File

@ -1,3 +0,0 @@
js/vendor/
tmp/
vendor/

View File

@ -1,42 +0,0 @@
{
"env": {
"browser": true,
"jquery": true
},
"rules": {
"array-bracket-spacing": "error",
"brace-style": "error",
"camelcase": "warn",
"comma-style": ["error", "last"],
"curly": "error",
"dot-notation": "error",
"eol-last": "error",
"eqeqeq": "error",
"indent": ["error", 4],
"keyword-spacing": "error",
"new-cap": "warn",
"no-array-constructor": "warn",
"no-eval": "warn",
"no-loop-func": "warn",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-param-reassign": "warn",
"no-trailing-spaces": "error",
"no-underscore-dangle": "warn",
"no-unneeded-ternary": "error",
"no-useless-escape": "warn",
"object-curly-spacing": ["error", "always"],
"one-var": ["error", "never"],
"padded-blocks": ["error", "never"],
"quotes": ["error", "single"],
"semi": "error",
"space-before-blocks": "error",
"space-before-function-paren": "error",
"space-in-parens": "error",
"space-infix-ops": "error",
"spaced-comment": ["error", "always"],
"wrap-iife": "error"
}
}

View File

@ -1,46 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@phpmyadmin.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@ -1,43 +0,0 @@
# Contributing to phpMyAdmin
As an open source project, phpMyAdmin welcomes contributions of many forms.
## Bug reporting
We appreciate your effort to improve phpMyAdmin by submitting a bug report. Before doing so, please check the following things:
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.
2. Specify the phpMyAdmin, server, PHP, MySQL and browser information that may be helpful to fix the problem, especially exact **version numbers**.
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.
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.
5. **Security problems** should not be reported here. See [our security page](https://www.phpmyadmin.net/security/).
Thanks for your help!
Please report [bugs on GitHub][1].
[1]: https://github.com/phpmyadmin/phpmyadmin/issues/new
## Patches submission
Patches are welcome as [pull requests on GitHub][2]. Please include a
Signed-off-by tag in the commit message (you can do this by passing `--signoff`
parameter to Git).
When creating the commit on GitHub or using some other tool which does not have
direct support for this, it is the same as adding
`Signed-off-by: Your name <email@example.com>`
as the last line of the commit message.
Note that by submitting patches with the Signed-off-by tag, you are giving
permission to license the patch as GPLv2-or-later. See [the DCO file][3] for
details.
[2]: https://github.com/phpmyadmin/phpmyadmin/pulls
[3]: https://github.com/phpmyadmin/phpmyadmin/blob/master/DCO
## More information
You can find more information on our website:
https://www.phpmyadmin.net/contribute/

View File

@ -1,145 +0,0 @@
phpMyAdmin - ChangeLog
======================
4.8.4 (2018-12-11)
- issue #14452 Remove hash param in edit query URL
- issue #14295 Issue in Changing theme
- issue #13267 Ensure that database names with '.' are handled properly when DisableIS is true
- issue #14438 Invisible Icon "Show Full Queries"
- issue #14133 CSS issue in Designer
- issue #14447 Error while copying database (pma__column_info)
- issue #14571 "No database selected" - DROP a view
- issue #14636 Move operation causes SELECT * FROM `undefined`
- issue #14630 Enum '0' produces incorrect search SQL
- issue #14223 Fix TypeError in database designer
- issue #13621 QBE selenium tests broken since merge of #13342
- issue #14672 When logging with $cfg['AuthLog'] to syslog, successful login messages were not logged even if $cfg['AuthLogSuccess'] was true.
- issue #14339 Fix infinite loop when sorting table rows by key.
- issue #14658 Regression on multi table query functionality (foreign keys)
- issue #14617 Fix designer errors when database is empty
- issue #13032 Fix designer errors when database contains special chars
- issue #14352 Fix designer javascript errors
- issue #14764 Fix left/right icons hidden
- issue [security] Local file inclusion flaw in the Transformation feature (PMASA-2018-6)
- issue [security] Multiple CSRF/XSRF vulnerabilities (PMASA-2018-7)
- issue [security] XSS vulnerability in the navigation tree (PMASA-2018-8)
4.8.3 (2018-08-22)
- issue #14314 Error when naming a database '0'
- issue #14333 Fix NULL as default not shown
- issue #14229 Fixes issue with recent table list
- issue #14045 Fix slow performance on DB structure filtering
- issue #14327 Fix Editing server variable not showing save or cancel option
- issue #14377 Populate options for view create and edit
- issue #14171 2FA configuration fails if PHP doesn't have GD support
- issue #14390 Can't unhide tables
- issue #14382 "Visualize GIS data" icon missing
- issue #14435 Event scheduler status toggle doesn't work
- issue #14365 View not working on multiple servers
- issue #14207 Partition actions in table structure do not work
- issue #14375 Fixes ERR_BLOCKED_BY_XSS_AUDITOR on export table
- issue #14552 Blank message shown instead of MySQL error when adding trigger and other locations
- issue #14525 Fix PHP 7.3 warning: "continue" in "switch" is equal to "break"
- issue #14554 Icon missing when creating a new trigger, routine, and event
- issue #14422 Table comment not showing since 4.8.1
- issue #14426 Drop table doesn't work when you copy tables to another database
- issue #14581 Escaped HTML in 'Add a new server' setup
- issue #14548 [security] HTML injection in import warning messages, see PMASA-2018-5
4.8.2 (2018-06-21)
- issue #14370 WHERE 0 causes Fatal error
- issue #14225 Fix missing index icon
- issue [security] XSS vulnerability in Designer, see PMASA-2018-3
- issue [security] File inclusion and remote code execution vulnerability, see PMASA-2018-4
4.8.1 (2018-05-24)
- issue #12772 Fix case where the central columns attributes don't get filled in
- issue #14049 Fix case where the query builder doesn't work when selected column is *
- issue #14029 Revert "Browse" table CSS overflow
- issue #14241 Dropping indexes and foreign keys fail
- issue #14227 Relational linking broken
- issue #14246 Fixed error in configuration storage zero config
- issue #14128 Show 2FA Secret next to QR code
- issue #14212 XML Export from single table throws fatal error
- issue #14239 Line and some other charts ignore result set order of values chosen for the x-axis
- issue #14260 Fixed configuration for DefaultLang and Lang
- issue #14264 Linking for 'Distinct values' broken
- issue #13968 Fix MariaDB 10.2 current_timestamp()
- issue #14249 Fix for missing go button in view edit
- issue #14125 Fix for issues with spatial fields
- issue #14189 Remember table's sorting broken
- issue #14289 Fix multi-column sorting
- issue #14278 Fix central columns in-line edit bug
- issue #14066 Fix AUTO_INCREMENT error when only exporting table structure in database-level exports
- issue #13893 Simulating queries produces unexpected results
- issue #14309 Setup script icons missing
4.8.0.1 (2018-04-19)
- issue [security] Multiple CSRF vulnerabilities, See PMASA-2018-02
4.8.0 (2018-04-07)
- issue #12946 Allow to export JSON with unescaped unicode chars
- issue #12983 Disable login button without solved reCaptcha
- issue #12315 Allow to remove individual segments from pie charts
- issue Change label from "Improve table structure" to "Normalize" to match standard terminology
- issue #13087 Offer login as different user on access denied from MySQL
- issue #13110 Indicate when HTTPS is not properly reported on the server
- issue #13119 No database selected error when adding foreign key
- issue #12388 Improved database search to allow search for exact phrase match
- issue #13099 Report error when trying to copy database to same name
- issue #13167 Themes now have to contain metadata in theme.json
- issue #6363 phpMyAdmin no longer requires eval() in PHP
- issue #12386 The mbstring dependency is now optional
- issue #13269 Small refactoring in preparation to CSP
- issue #13384 Database link broken in Databases Page
- issue #13391 Configurable authentication logging using $cfg['AuthLog']
- issue #13086 Add support for Google Invisible Captcha
- issue #13058 Improved error reporting for reCAPTCHA
- issue #12899 Improved rendering of server variables table
- issue #12948 Fixed javascript editor for TIME values
- issue #13095 Fixed alignment of foreign keys editing
- issue #12944 Improved inline editor for JSON
- issue #13145 Improved layout of operations pages
- issue #13448 Add "format" query button in edit view form
- issue #6241 Implement Responsive Design/mobile interface
- issue Use a single location for classes under PhpMyAdmin namespace
- issue #12354 Indicate SSL status on main page
- issue #5666 Configuration directives for defaults of Transformation options
- issue #12261 Remove inline JavaScript
- issue #13408 Show MySQL warnings when executing SQL queries
- issue #5827 Allow Designer to show tables from other databases
- issue #13268 Replace Query-By-Example with multi-table query generator interface
- issue #13576 Add privileges export to per-database listing
- issue Consolidate functions into class files
- issue #13560 Add support for changing collation for all tables and columns in database
- issue #13303 Add support for creating fulltext index from table structure
- issue #13711 Lower default value for $cfg['MaxExactCount']
- issue #13722 DisableIS is not fully honored
- issue #6197 Added support for authentication using U2F and 2FA
- issue #13480 Avoid removing cookies on upgrade
- issue #13397 Remember state of navigation panel
- issue #11688 Reduced cookie usage
- issue #13466 Better utilization of user preferences
- issue #14042 Rename PMD to Designer
- issue #13940 Honor arg_separator in AJAX requests
- issue #14060 Can't edit rows in Internet Explorer
- issue #14096 Internet Explorer compatibility; fixes JavaScript error Object doesn't support property or method 'startsWith'
4.7.9 (2018-03-05)
- issue #13931 Fixed browsing tables with more results
- issue #13927 "Not an integer" when browsing a table
- issue #13887 "Input variables exceeded 1000" error relating to PHP's max_input_vars directive
4.7.8 (2018-02-20)
- issue #13914 Fixed resetting default setting values.
- issue #13758 Fixed fallback value for collation connection.
- issue #13938 Fixed error handling in PHP 7.2
- issue [security] Fix XSS in Central Columns Feature, See PMASA-2018-01
--- Older ChangeLogs can be found on our project website ---
https://www.phpmyadmin.net/old-stuff/ChangeLogs/
# vim: et ts=4 sw=4 sts=4
# vim: ft=changelog fenc=utf-8
# vim: fde=getline(v\:lnum-1)=~'^\\s*$'&&getline(v\:lnum)=~'\\S'?'>1'\:1&&v\:lnum>4&&getline(v\:lnum)!~'^#'
# vim: fdn=1 fdm=expr

View File

@ -1,44 +0,0 @@
If you would like to make a contribution to the phpMyAdmin Project, please
certify to the following:
***
phpMyAdmin Developer's Certificate of Origin. Version 1.0
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I have the
right to submit it under the license of "GNU General Public License or
any later version" ("GPLv2-or-later"); or
(b) The contribution is based upon previous work that, to the best of my
knowledge, is covered under an appropriate open source license and I have
the right under that license to submit that work with modifications,
whether created in whole or in part by me, under GPLv2-or-later; or
(c) The contribution was provided directly to me by some other person who
certified (a) or (b) and I have not modified it.
(d) I understand and agree that this project and the contribution are public
and that a record of the contribution (including all metadata and
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
phpMyAdmin's policies and the requirements of the GPLv2-or-later where
they are relevant.
(e) I am granting this work to this project under the terms of the
GPLv2-or-later.
https://www.gnu.org/licenses/gpl-2.0.html
***
***
And please confirm your certification to the above by adding the following
line to your patch:
Signed-off-by: Jane Developer <jane@example.org>
using your real name (sorry, no pseudonyms or anonymous contributions).
If you are a developer who is authorized to contribute to phpMyAdmin on
behalf of your employer, then please use your corporate email address in the
Signed-off-by tag. If not, then please use a personal email address.

View File

@ -1,52 +0,0 @@
phpMyAdmin - Readme
===================
Version 4.8.4
A web interface for MySQL and MariaDB.
https://www.phpmyadmin.net/
Summary
-------
phpMyAdmin is intended to handle the administration of MySQL over the web.
For a summary of features, list of requirements, and installation instructions,
please see the documentation in the ./doc/ folder or at https://docs.phpmyadmin.net/
Copyright
---------
Copyright © 1998 onwards -- the phpMyAdmin team
Certain libraries are copyrighted by their respective authors;
see the full copyright list for details.
For full copyright information, please see ./doc/copyright.rst
License
-------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2, as published by the
Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Licensing of current contributions
----------------------------------
Beginning on 2013-12-01, new contributions to this codebase are all licensed
under terms compatible with GPLv2-or-later. phpMyAdmin is currently
transitioning older code to GPLv2-or-later, but work is not yet complete.
Enjoy!
------
The phpMyAdmin team

View File

@ -1 +0,0 @@
Tue Dec 11 02:02:39 UTC 2018

View File

@ -1,97 +0,0 @@
{
"name": "phpmyadmin/phpmyadmin",
"type": "project",
"description": "MySQL web administration tool",
"keywords": ["phpmyadmin","mysql","web"],
"homepage": "https://www.phpmyadmin.net/",
"support": {
"forum": "https://www.phpmyadmin.net/support/",
"issues": "https://github.com/phpmyadmin/phpmyadmin/issues",
"wiki": "https://wiki.phpmyadmin.net/",
"docs": "https://docs.phpmyadmin.net/",
"source": "https://github.com/phpmyadmin/phpmyadmin"
},
"license": "GPL-2.0-only",
"authors": [
{
"name": "The phpMyAdmin Team",
"email": "developers@phpmyadmin.net",
"homepage": "https://www.phpmyadmin.net/team/"
}
],
"non-feature-branches": ["RELEASE_.*"],
"autoload": {
"psr-4": {
"PhpMyAdmin\\": "libraries/classes",
"PhpMyAdmin\\Setup\\": "setup/lib"
}
},
"autoload-dev": {
"psr-4": {
"PhpMyAdmin\\Tests\\": "test/classes",
"PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/"
}
},
"repositories": [
{
"type": "composer",
"url": "https://www.phpmyadmin.net"
}
],
"require": {
"php": ">=5.5.0",
"ext-mysqli": "*",
"ext-xml": "*",
"ext-pcre": "*",
"ext-json": "*",
"ext-ctype": "*",
"ext-hash": "*",
"phpmyadmin/sql-parser": "^4.2.3",
"phpmyadmin/motranslator": "^4.0",
"phpmyadmin/shapefile": "^2.0",
"phpseclib/phpseclib": "^2.0",
"google/recaptcha": "^1.1",
"psr/container": "^1.0",
"twig/twig": "^1.34",
"twig/extensions": "~1.5.1",
"symfony/expression-language": "^3.2 || ^2.8",
"symfony/polyfill-mbstring": "^1.3"
},
"conflict": {
"phpseclib/phpseclib": "2.0.8",
"tecnickcom/tcpdf": "<6.2",
"pragmarx/google2fa": "<3.0.1",
"bacon/bacon-qr-code": "<1.0",
"samyoul/u2f-php-server": "<1.1"
},
"suggest": {
"ext-openssl": "Cookie encryption",
"ext-curl": "Updates checking",
"ext-opcache": "Better performance",
"ext-zlib": "For gz import and export",
"ext-bz2": "For bzip2 import and export",
"ext-zip": "For zip import and export",
"ext-gd2": "For image transformations",
"ext-mbstring": "For best performance",
"tecnickcom/tcpdf": "For PDF support",
"pragmarx/google2fa": "For 2FA authentication",
"bacon/bacon-qr-code": "For 2FA authentication",
"samyoul/u2f-php-server": "For FIDO U2F authentication"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.7",
"codacy/coverage": "^1.3.0",
"phpunit/phpunit-selenium": "~1.2 || ^3.0",
"squizlabs/php_codesniffer": "^3.0",
"tecnickcom/tcpdf": "^6.2",
"pragmarx/google2fa": "^3.0",
"bacon/bacon-qr-code": "^1.0",
"samyoul/u2f-php-server": "^1.1",
"phpmyadmin/coding-standard": "^0.3"
},
"extra": {
"branch-alias": {
"dev-master": "4.8.x-dev"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in documentation in the doc/ folder
* or at <https://docs.phpmyadmin.net/>.
*
* @package PhpMyAdmin
*/
error_reporting(-1);
$cfg['TempDir'] = '/tmp';
$cfg['CheckConfigurationPermissions'] = false;
$cfg['blowfish_secret'] = 'a;guurOrep[[hoge7p[jgde7reouHoy5590hjgffuJ676FGd434&%*09UJHogfT%$#F64';
/**
* Servers configuration
*/
$i = 0;
/**
* First server
*/
$i++;
/* Authentication type */
if (getenv('DEVILBOX_VENDOR_PHPMYADMIN_AUTOLOGIN') == 1) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = getenv('MYSQL_ROOT_PASSWORD');
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
/**
* phpMyAdmin configuration storage settings.
*/
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
/**
* End of servers configuration
*/
/**
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/**
* Whether to display icons or text or both icons and text in table row
* action segment. Value can be either of 'icons', 'text' or 'both'.
* default = 'both'
*/
//$cfg['RowActionType'] = 'icons';
/**
* Defines whether a user should be displayed a "show all (records)"
* button in browse mode or not.
* default = false
*/
//$cfg['ShowAll'] = true;
/**
* Number of rows displayed when browsing a result set. If the result
* set contains more rows, "Previous" and "Next".
* Possible values: 25, 50, 100, 250, 500
* default = 25
*/
//$cfg['MaxRows'] = 50;
/**
* Disallow editing of binary fields
* valid values are:
* false allow editing
* 'blob' allow editing except for BLOB fields
* 'noblob' disallow editing except for BLOB fields
* 'all' disallow editing
* default = 'blob'
*/
//$cfg['ProtectBinary'] = false;
/**
* Default language to use, if not browser-defined or user-defined
* (you find all languages in the locale folder)
* uncomment the desired line:
* default = 'en'
*/
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';
/**
* How many columns should be used for table display of a database?
* (a value larger than 1 results in some information being hidden)
* default = 1
*/
//$cfg['PropertiesNumColumns'] = 2;
/**
* Set to true if you want DB-based query history.If false, this utilizes
* JS-routines to display query history (lost by window close)
*
* This requires configuration storage enabled, see above.
* default = false
*/
//$cfg['QueryHistoryDB'] = true;
/**
* When using DB-based query history, how many entries should be kept?
* default = 25
*/
//$cfg['QueryHistoryMax'] = 100;
/**
* Whether or not to query the user before sending the error report to
* the phpMyAdmin team when a JavaScript error occurs
*
* Available options
* ('ask' | 'always' | 'never')
* default = 'ask'
*/
$cfg['SendErrorReports'] = 'never';
/**
* You can find more configuration options in the documentation
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
*/

View File

@ -1,154 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in documentation in the doc/ folder
* or at <https://docs.phpmyadmin.net/>.
*
* @package PhpMyAdmin
*/
/**
* This is needed for cookie based authentication to encrypt password in
* cookie. Needs to be 32 chars long.
*/
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
/**
* Servers configuration
*/
$i = 0;
/**
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
/**
* phpMyAdmin configuration storage settings.
*/
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
/**
* End of servers configuration
*/
/**
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/**
* Whether to display icons or text or both icons and text in table row
* action segment. Value can be either of 'icons', 'text' or 'both'.
* default = 'both'
*/
//$cfg['RowActionType'] = 'icons';
/**
* Defines whether a user should be displayed a "show all (records)"
* button in browse mode or not.
* default = false
*/
//$cfg['ShowAll'] = true;
/**
* Number of rows displayed when browsing a result set. If the result
* set contains more rows, "Previous" and "Next".
* Possible values: 25, 50, 100, 250, 500
* default = 25
*/
//$cfg['MaxRows'] = 50;
/**
* Disallow editing of binary fields
* valid values are:
* false allow editing
* 'blob' allow editing except for BLOB fields
* 'noblob' disallow editing except for BLOB fields
* 'all' disallow editing
* default = 'blob'
*/
//$cfg['ProtectBinary'] = false;
/**
* Default language to use, if not browser-defined or user-defined
* (you find all languages in the locale folder)
* uncomment the desired line:
* default = 'en'
*/
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';
/**
* How many columns should be used for table display of a database?
* (a value larger than 1 results in some information being hidden)
* default = 1
*/
//$cfg['PropertiesNumColumns'] = 2;
/**
* Set to true if you want DB-based query history.If false, this utilizes
* JS-routines to display query history (lost by window close)
*
* This requires configuration storage enabled, see above.
* default = false
*/
//$cfg['QueryHistoryDB'] = true;
/**
* When using DB-based query history, how many entries should be kept?
* default = 25
*/
//$cfg['QueryHistoryMax'] = 100;
/**
* Whether or not to query the user before sending the error report to
* the phpMyAdmin team when a JavaScript error occurs
*
* Available options
* ('ask' | 'always' | 'never')
* default = 'ask'
*/
//$cfg['SendErrorReports'] = 'always';
/**
* You can find more configuration options in the documentation
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
*/

View File

@ -1,215 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin designer general code
*
* @package PhpMyAdmin-Designer
*/
use PhpMyAdmin\Database\Designer;
use PhpMyAdmin\Database\Designer\Common;
use PhpMyAdmin\Response;
require_once 'libraries/common.inc.php';
$response = Response::getInstance();
$databaseDesigner = new Designer();
$designerCommon = new Common();
if (isset($_REQUEST['dialog'])) {
if ($_GET['dialog'] == 'edit') {
$html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage');
} elseif ($_GET['dialog'] == 'delete') {
$html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage');
} elseif ($_GET['dialog'] == 'save_as') {
$html = $databaseDesigner->getHtmlForPageSaveAs($GLOBALS['db']);
} elseif ($_GET['dialog'] == 'export') {
$html = $databaseDesigner->getHtmlForSchemaExport(
$GLOBALS['db'], $_GET['selected_page']
);
} elseif ($_POST['dialog'] == 'add_table') {
$script_display_field = $designerCommon->getTablesInfo();
$required = $GLOBALS['db'] . '.' . $GLOBALS['table'];
$tab_column = $designerCommon->getColumnsInfo();
$tables_all_keys = $designerCommon->getAllKeys();
$tables_pk_or_unique_keys = $designerCommon->getPkOrUniqueKeys();
$req_key = array_search($required, $GLOBALS['designer']['TABLE_NAME']);
$GLOBALS['designer']['TABLE_NAME'] = array($GLOBALS['designer']['TABLE_NAME'][$req_key]);
$GLOBALS['designer_url']['TABLE_NAME_SMALL'] = array($GLOBALS['designer_url']['TABLE_NAME_SMALL'][$req_key]);
$GLOBALS['designer']['TABLE_NAME_SMALL'] = array($GLOBALS['designer']['TABLE_NAME_SMALL'][$req_key]);
$GLOBALS['designer_out']['TABLE_NAME_SMALL'] = array($GLOBALS['designer_out']['TABLE_NAME_SMALL'][$req_key]);
$GLOBALS['designer']['TABLE_TYPE'] = array($GLOBALS['designer_url']['TABLE_TYPE'][$req_key]);
$GLOBALS['designer_out']['OWNER'] = array($GLOBALS['designer_out']['OWNER'][$req_key]);
$html = $databaseDesigner->getDatabaseTables(
array(), -1, $tab_column,
$tables_all_keys, $tables_pk_or_unique_keys
);
}
if (! empty($html)) {
$response->addHTML($html);
}
return;
}
if (isset($_POST['operation'])) {
if ($_POST['operation'] == 'deletePage') {
$success = $designerCommon->deletePage($_POST['selected_page']);
$response->setRequestStatus($success);
} elseif ($_POST['operation'] == 'savePage') {
if ($_POST['save_page'] == 'same') {
$page = $_POST['selected_page'];
} else { // new
$page = $designerCommon->createNewPage($_POST['selected_value'], $GLOBALS['db']);
$response->addJSON('id', $page);
}
$success = $designerCommon->saveTablePositions($page);
$response->setRequestStatus($success);
} elseif ($_POST['operation'] == 'setDisplayField') {
$designerCommon->saveDisplayField(
$_POST['db'], $_POST['table'], $_POST['field']
);
$response->setRequestStatus(true);
} elseif ($_POST['operation'] == 'addNewRelation') {
list($success, $message) = $designerCommon->addNewRelation(
$_POST['db'],
$_POST['T1'],
$_POST['F1'],
$_POST['T2'],
$_POST['F2'],
$_POST['on_delete'],
$_POST['on_update'],
$_POST['DB1'],
$_POST['DB2']
);
$response->setRequestStatus($success);
$response->addJSON('message', $message);
} elseif ($_POST['operation'] == 'removeRelation') {
list($success, $message) = $designerCommon->removeRelation(
$_POST['T1'],
$_POST['F1'],
$_POST['T2'],
$_POST['F2']
);
$response->setRequestStatus($success);
$response->addJSON('message', $message);
} elseif ($_POST['operation'] == 'save_setting_value') {
$success = $designerCommon->saveSetting($_POST['index'], $_POST['value']);
$response->setRequestStatus($success);
}
return;
}
require 'libraries/db_common.inc.php';
$script_display_field = $designerCommon->getTablesInfo();
$tab_column = $designerCommon->getColumnsInfo();
$script_tables = $designerCommon->getScriptTabs();
$tables_pk_or_unique_keys = $designerCommon->getPkOrUniqueKeys();
$tables_all_keys = $designerCommon->getAllKeys();
$classes_side_menu = $databaseDesigner->returnClassNamesFromMenuButtons();
$display_page = -1;
$selected_page = null;
if (isset($_GET['query'])) {
$display_page = $designerCommon->getDefaultPage($_GET['db']);
} else {
if (! empty($_GET['page'])) {
$display_page = $_GET['page'];
} else {
$display_page = $designerCommon->getLoadingPage($_GET['db']);
}
}
if ($display_page != -1) {
$selected_page = $designerCommon->getPageName($display_page);
}
$tab_pos = $designerCommon->getTablePositions($display_page);
$script_contr = $designerCommon->getScriptContr();
$params = array('lang' => $GLOBALS['lang']);
if (isset($_GET['db'])) {
$params['db'] = $_GET['db'];
}
$response = Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setBodyId('designer_body');
$scripts = $header->getScripts();
$scripts->addFile('vendor/jquery/jquery.fullscreen.js');
$scripts->addFile('designer/database.js');
$scripts->addFile('designer/objects.js');
$scripts->addFile('designer/page.js');
$scripts->addFile('designer/history.js');
$scripts->addFile('designer/move.js');
$scripts->addFile('designer/init.js');
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = PhpMyAdmin\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
// Embed some data into HTML, later it will be read
// by designer/init.js and converted to JS variables.
$response->addHTML(
$databaseDesigner->getHtmlForJsFields(
$script_tables, $script_contr, $script_display_field, $display_page
)
);
$response->addHTML(
$databaseDesigner->getPageMenu(
isset($_GET['query']),
$selected_page,
$classes_side_menu
)
);
$response->addHTML('<div id="canvas_outer">');
$response->addHTML(
'<form action="" id="container-form" method="post" name="form1">'
);
$response->addHTML($databaseDesigner->getHtmlCanvas());
$response->addHTML($databaseDesigner->getHtmlTableList($tab_pos, $display_page));
$response->addHTML(
$databaseDesigner->getDatabaseTables(
$tab_pos, $display_page, $tab_column,
$tables_all_keys, $tables_pk_or_unique_keys
)
);
$response->addHTML('</form>');
$response->addHTML('</div>'); // end canvas_outer
$response->addHTML('<div id="designer_hint"></div>');
$response->addHTML($databaseDesigner->getNewRelationPanel());
$response->addHTML($databaseDesigner->getDeleteRelationPanel());
if (isset($_GET['query'])) {
$response->addHTML($databaseDesigner->getOptionsPanel());
$response->addHTML($databaseDesigner->getRenameToPanel());
$response->addHTML($databaseDesigner->getHavingQueryPanel());
$response->addHTML($databaseDesigner->getAggregateQueryPanel());
$response->addHTML($databaseDesigner->getWhereQueryPanel());
$response->addHTML($databaseDesigner->getQueryDetails($_GET['db']));
}
$response->addHTML('<div id="PMA_disable_floating_menubar"></div>');

View File

@ -1,159 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* dumps a database
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Config\PageSettings;
use PhpMyAdmin\Display\Export as DisplayExport;
use PhpMyAdmin\Export;
use PhpMyAdmin\Message;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
/**
* Gets some core libraries
*/
require_once 'libraries/common.inc.php';
PageSettings::showGroup('Export');
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('export.js');
// $sub_part is used in Util::getDbInfo() to see if we are coming from
// db_export.php, in which case we don't obey $cfg['MaxTableList']
$sub_part = '_export';
require_once 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_export.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
/**
* Displays the form
*/
$export_page_title = __('View dump (schema) of database');
// exit if no tables in db found
if ($num_tables < 1) {
$response->addHTML(
Message::error(__('No tables found in database.'))->getDisplay()
);
exit;
} // end if
$multi_values = '<div class="export_table_list_container">';
if (isset($_POST['structure_or_data_forced'])) {
$force_val = htmlspecialchars($_POST['structure_or_data_forced']);
} else {
$force_val = 0;
}
$multi_values .= '<input type="hidden" name="structure_or_data_forced" value="'
. $force_val . '">';
$multi_values .= '<table class="export_table_select">'
. '<thead><tr><th></th>'
. '<th>' . __('Tables') . '</th>'
. '<th class="export_structure">' . __('Structure') . '</th>'
. '<th class="export_data">' . __('Data') . '</th>'
. '</tr><tr>'
. '<td></td>'
. '<td class="export_table_name all">' . __('Select all') . '</td>'
. '<td class="export_structure all">'
. '<input type="checkbox" id="table_structure_all" /></td>'
. '<td class="export_data all"><input type="checkbox" id="table_data_all" />'
. '</td>'
. '</tr></thead>'
. '<tbody>';
$multi_values .= "\n";
// when called by libraries/mult_submits.inc.php
if (!empty($_POST['selected_tbl']) && empty($table_select)) {
$table_select = $_POST['selected_tbl'];
}
// Check if the selected tables are defined in $_POST
// (from clicking Back button on export.php)
foreach (array('table_select', 'table_structure', 'table_data') as $one_key) {
if (isset($_POST[$one_key])) {
$_POST[$one_key] = urldecode($_POST[$one_key]);
$_POST[$one_key] = explode(",", $_POST[$one_key]);
}
}
foreach ($tables as $each_table) {
if (isset($_POST['table_select']) && is_array($_POST['table_select'])) {
$is_checked = Export::getCheckedClause(
$each_table['Name'], $_POST['table_select']
);
} elseif (isset($table_select)) {
$is_checked = Export::getCheckedClause(
$each_table['Name'], $table_select
);
} else {
$is_checked = ' checked="checked"';
}
if (isset($_POST['table_structure']) && is_array($_POST['table_structure'])) {
$structure_checked = Export::getCheckedClause(
$each_table['Name'], $_POST['table_structure']
);
} else {
$structure_checked = $is_checked;
}
if (isset($_POST['table_data']) && is_array($_POST['table_data'])) {
$data_checked = Export::getCheckedClause(
$each_table['Name'], $_POST['table_data']
);
} else {
$data_checked = $is_checked;
}
$table_html = htmlspecialchars($each_table['Name']);
$multi_values .= '<tr class="marked">';
$multi_values .= '<td><input type="checkbox" name="table_select[]"'
. ' value="' . $table_html . '"' . $is_checked . ' class="checkall"/></td>';
$multi_values .= '<td class="export_table_name">'
. str_replace(' ', '&nbsp;', $table_html) . '</td>';
$multi_values .= '<td class="export_structure">'
. '<input type="checkbox" name="table_structure[]"'
. ' value="' . $table_html . '"' . $structure_checked . ' /></td>';
$multi_values .= '<td class="export_data">'
. '<input type="checkbox" name="table_data[]"'
. ' value="' . $table_html . '"' . $data_checked . ' /></td>';
$multi_values .= '</tr>';
} // end for
$multi_values .= "\n";
$multi_values .= '</tbody></table></div>';
if (! isset($sql_query)) {
$sql_query = '';
}
if (! isset($num_tables)) {
$num_tables = 0;
}
if (! isset($unlim_num_rows)) {
$unlim_num_rows = 0;
}
if (! isset($multi_values)) {
$multi_values = '';
}
$response = Response::getInstance();
$displayExport = new DisplayExport();
$response->addHTML(
$displayExport->getDisplay(
'database', $db, $table, $sql_query, $num_tables,
$unlim_num_rows, $multi_values
)
);

View File

@ -1,79 +0,0 @@
.. _bookmarks:
Bookmarks
=========
.. note::
You need to have configured the :ref:`linked-tables` for using bookmarks
feature.
Storing bookmarks
-----------------
Any query you have executed can be stored as a bookmark on the page
where the results are displayed. You will find a button labeled
:guilabel:`Bookmark this query` just at the end of the page. As soon as you have
stored a bookmark, it is related to the database you run the query on.
You can now access a bookmark dropdown on each page, the query box
appears on for that database.
Variables inside bookmarks
--------------------------
You can also have, inside the query, placeholders for variables.
This is done by inserting into the query SQL comments between ``/*`` and
``*/``. Inside the comments, the special strings ``[VARIABLE{variable-number}]`` is used.
Be aware that the whole query minus the SQL comments must be
valid by itself, otherwise you won't be able to store it as a bookmark.
Note also that the text 'VARIABLE' is case-sensitive.
When you execute the bookmark, everything typed into the *Variables*
input boxes on the query box page will replace the strings ``/*[VARIABLE{variable-number}]*/`` in
your stored query.
Also remember, that everything else inside the ``/*[VARIABLE{variable-number}]*/`` string for
your query will remain the way it is, but will be stripped of the ``/**/``
chars. So you can use:
.. code-block:: mysql
/*, [VARIABLE1] AS myname */
which will be expanded to
.. code-block:: mysql
, VARIABLE1 as myname
in your query, where VARIABLE1 is the string you entered in the Variable 1 input box.
A more complex example. Say you have stored
this query:
.. code-block:: mysql
SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE1]%' */
Say, you now enter "phpMyAdmin" as the variable for the stored query, the full
query will be:
.. code-block:: mysql
SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%'
**NOTE THE ABSENCE OF SPACES** inside the ``/**/`` construct. Any spaces
inserted there will be later also inserted as spaces in your query and may lead
to unexpected results especially when using the variable expansion inside of a
"LIKE ''" expression.
Browsing table using bookmark
-----------------------------
When bookmark is named same as table, it will be used as query when browsing
this table.
.. seealso::
:ref:`faqbookmark`,
:ref:`faq6_22`

View File

@ -1,143 +0,0 @@
.. _charts:
Charts
======
.. versionadded:: 3.4.0
Since phpMyAdmin version 3.4.0, you can easily generate charts from a SQL query
by clicking the "Display chart" link in the "Query results operations" area.
.. image:: images/query_result_operations.png
A window layer "Display chart" is shown in which you can customize the chart with the following options.
- Chart type: Allows you choose the type of the chart. Supported types are bar charts, column charts, line charts, spline charts, area charts, pie charts and timeline charts (only the chart types applicable for current series selection are offered).
- X-axis: Allows to choose the field for the main axis.
- Series: Allows to choose series for the chart. You can choose multiple series.
- Title: Allows specifying a title for the chart which is displayed above the chart.
- X-axis and Y-axis labels: Allows specifying labels for axes.
- Start row and number of rows: Allows generating charts only for a specified number of rows of the results set.
.. image:: images/chart.png
Chart implementation
--------------------
Charts in phpMyAdmin are drawn using `jqPlot <http://www.jqplot.com/>`_ jQuery library.
Examples
--------
Pie chart
+++++++++
Query results for a simple pie chart can be generated with:
.. code-block:: mysql
SELECT 'Food' AS 'expense',
1250 AS 'amount' UNION
SELECT 'Accommodation', 500 UNION
SELECT 'Travel', 720 UNION
SELECT 'Misc', 220
And the result of this query is:
+---------------+--------+
| expense | amount |
+===============+========+
| Food | 1250 |
+---------------+--------+
| Accommodation | 500 |
+---------------+--------+
| Travel | 720 |
+---------------+--------+
| Misc | 220 |
+---------------+--------+
Choosing expense as the X-axis and amount in series:
.. image:: images/pie_chart.png
Bar and column chart
++++++++++++++++++++
Both bar charts and column chats support stacking. Upon selecting one of these types a checkbox is displayed to select stacking.
Query results for a simple bar or column chart can be generated with:
.. code-block:: mysql
SELECT
'ACADEMY DINOSAUR' AS 'title',
0.99 AS 'rental_rate',
20.99 AS 'replacement_cost' UNION
SELECT 'ACE GOLDFINGER', 4.99, 12.99 UNION
SELECT 'ADAPTATION HOLES', 2.99, 18.99 UNION
SELECT 'AFFAIR PREJUDICE', 2.99, 26.99 UNION
SELECT 'AFRICAN EGG', 2.99, 22.99
And the result of this query is:
+------------------+--------------+-------------------+
| title | rental_rate | replacement_cost |
+==================+==============+===================+
| ACADEMY DINOSAUR | 0.99 | 20.99 |
+------------------+--------------+-------------------+
| ACE GOLDFINGER | 4.99 | 12.99 |
+------------------+--------------+-------------------+
| ADAPTATION HOLES | 2.99 | 18.99 |
+------------------+--------------+-------------------+
| AFFAIR PREJUDICE | 2.99 | 26.99 |
+------------------+--------------+-------------------+
| AFRICAN EGG | 2.99 | 22.99 |
+------------------+--------------+-------------------+
Choosing title as the X-axis and rental_rate and replacement_cost as series:
.. image:: images/column_chart.png
Scatter chart
+++++++++++++
Scatter charts are useful in identifying the movement of one or more variable(s) compared to another variable.
Using the same data set from bar and column charts section and choosing replacement_cost as the X-axis and rental_rate in series:
.. image:: images/scatter_chart.png
Line, spline and timeline charts
++++++++++++++++++++++++++++++++
These charts can be used to illustrate trends in underlying data. Spline charts draw smooth lines while timeline charts draw X-axis taking the distances between the dates/time into consideration.
Query results for a simple line, spline or timeline chart can be generated with:
.. code-block:: mysql
SELECT
DATE('2006-01-08') AS 'date',
2056 AS 'revenue',
1378 AS 'cost' UNION
SELECT DATE('2006-01-09'), 1898, 2301 UNION
SELECT DATE('2006-01-15'), 1560, 600 UNION
SELECT DATE('2006-01-17'), 3457, 1565
And the result of this query is:
+------------+---------+------+
| date | revenue | cost |
+============+=========+======+
| 2016-01-08 | 2056 | 1378 |
+------------+---------+------+
| 2006-01-09 | 1898 | 2301 |
+------------+---------+------+
| 2006-01-15 | 1560 | 600 |
+------------+---------+------+
| 2006-01-17 | 3457 | 1565 |
+------------+---------+------+
.. image:: images/line_chart.png
.. image:: images/spline_chart.png
.. image:: images/timeline_chart.png

File diff suppressed because it is too large Load Diff

View File

@ -1,42 +0,0 @@
.. _copyright:
Copyright
=========
.. code-block:: none
Copyright (C) 1998-2000 Tobias Ratschiller <tobias_at_ratschiller.com>
Copyright (C) 2001-2018 Marc Delisle <marc_at_infomarc.info>
Olivier Müller <om_at_omnis.ch>
Robin Johnson <robbat2_at_users.sourceforge.net>
Alexander M. Turek <me_at_derrabus.de>
Michal Čihař <michal_at_cihar.com>
Garvin Hicking <me_at_supergarv.de>
Michael Keck <mkkeck_at_users.sourceforge.net>
Sebastian Mendel <cybot_tm_at_users.sourceforge.net>
[check credits for more details]
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Third party licenses
++++++++++++++++++++
phpMyAdmin includes several third party libraries which come under their
respective licenses.
jQuery's license, which is where we got the files under js/vendor/jquery/ is
(MIT|GPL), a copy of each license is available in this repository (GPL
is available as LICENSE, MIT as js/vendor/jquery/MIT-LICENSE.txt).
The download kit additionally includes several composer libraries. See their
licensing information in the vendor/ directory.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,426 +0,0 @@
.. _glossary:
Glossary
========
From Wikipedia, the free encyclopedia
.. glossary::
.htaccess
the default name of Apache's directory-level configuration file.
.. seealso:: <https://en.wikipedia.org/wiki/.htaccess>
ACL
Access Contol List
Blowfish
a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier.
.. seealso:: <https://en.wikipedia.org/wiki/Blowfish_(cipher)>
Browser
a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web.
.. seealso:: <https://en.wikipedia.org/wiki/Web_browser>
bzip2
a free software/open source data compression algorithm and program developed by Julian Seward.
.. seealso:: <https://en.wikipedia.org/wiki/Bzip2>
CGI
Common Gateway Interface is an important World Wide Web technology that
enables a client web browser to request data from a program executed on
the Web server.
.. seealso:: <https://en.wikipedia.org/wiki/Common_Gateway_Interface>
Changelog
a log or record of changes made to a project.
.. seealso:: <https://en.wikipedia.org/wiki/Changelog>
Client
a computer system that accesses a (remote) service on another computer by some kind of network.
.. seealso:: <https://en.wikipedia.org/wiki/Client_(computing)>
column
a set of data values of a particular simple type, one for each row of the table.
.. seealso:: <https://en.wikipedia.org/wiki/Column_(database)>
Cookie
a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server.
.. seealso:: <https://en.wikipedia.org/wiki/HTTP_cookie>
CSV
Comma- separated values
.. seealso:: <https://en.wikipedia.org/wiki/Comma-separated_values>
DB
look at :term:`database`
database
an organized collection of data.
.. seealso:: <https://en.wikipedia.org/wiki/Database>
Engine
look at :term:`storage engines`
extension
a PHP module that extends PHP with additional functionality.
.. seealso:: <https://en.wikipedia.org/wiki/Software_extension>
FAQ
Frequently Asked Questions is a list of commonly asked question and there
answers.
.. seealso:: <https://en.wikipedia.org/wiki/FAQ>
Field
one part of divided data/columns.
.. seealso:: <https://en.wikipedia.org/wiki/Field_(computer_science)>
foreign key
a column or group of columns in a database row that point to a key column
or group of columns forming a key of another database row in some
(usually different) table.
.. seealso:: <https://en.wikipedia.org/wiki/Foreign_key>
GD
Graphics Library by Thomas Boutell and others for dynamically manipulating images.
.. seealso:: <https://en.wikipedia.org/wiki/GD_Graphics_Library>
GD2
look at :term:`gd`
gzip
gzip is short for GNU zip, a GNU free software file compression program.
.. seealso:: <https://en.wikipedia.org/wiki/Gzip>
host
any machine connected to a computer network, a node that has a hostname.
.. seealso:: <https://en.wikipedia.org/wiki/Host>
hostname
the unique name by which a network attached device is known on a network.
.. seealso:: <https://en.wikipedia.org/wiki/Hostname>
HTTP
HyperText Transfer Protocol is the primary method used to transfer or
convey information on the World Wide Web.
.. seealso:: <https://en.wikipedia.org/wiki/HyperText_Transfer_Protocol>
https
a :term:`HTTP`-connection with additional security measures.
.. seealso:: <https://en.wikipedia.org/wiki/Https:_URI_scheme>
IEC
International Electrotechnical Commission
IIS
Internet Information Services is a set of Internet-based services for
servers using Microsoft Windows.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_Information_Services>
Index
a feature that allows quick access to the rows in a table.
.. seealso:: <https://en.wikipedia.org/wiki/Index_(database)>
IP
Internet Protocol is a data-oriented protocol used by source and
destination hosts for communicating data across a packet-switched
internetwork.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_Protocol>
IP Address
a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard.
.. seealso:: <https://en.wikipedia.org/wiki/IP_Address>
IPv6
IPv6 (Internet Protocol version 6) is the latest revision of the
Internet Protocol (:term:`IP`), designed to deal with the
long-anticipated problem of its precedessor IPv4 running out of addresses.
.. seealso:: <https://en.wikipedia.org/wiki/IPv6>
ISAPI
Internet Server Application Programming Interface is the API of Internet Information Services (IIS).
.. seealso:: <https://en.wikipedia.org/wiki/ISAPI>
ISP
Internet service provider is a business or organization that offers users
access to the Internet and related services.
.. seealso:: <https://en.wikipedia.org/wiki/ISP>
ISO
International Standards Organisation
JPEG
a most commonly used standard method of lossy compression for photographic images.
.. seealso:: <https://en.wikipedia.org/wiki/JPEG>
JPG
look at :term:`jpeg`
Key
look at :term:`index`
LATEX
a document preparation system for the TEX typesetting program.
.. seealso:: <https://en.wikipedia.org/wiki/LaTeX>
Mac
Apple Macintosh is line of personal computers is designed, developed, manufactured, and marketed by Apple Computer.
.. seealso:: <https://en.wikipedia.org/wiki/Mac>
Mac OS X
the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets.
.. seealso:: <https://en.wikipedia.org/wiki/Mac_OS_X>
mbstring
The PHP `mbstring` functions provide support for languages represented by multi-byte character sets, most notably UTF-8.
If you have troubles installing this extension, please follow :ref:`faqmysql`, it provides useful hints.
.. seealso:: <https://secure.php.net/manual/en/book.mbstring.php>
MCrypt
a cryptographic library.
.. seealso:: <https://en.wikipedia.org/wiki/MCrypt>
mcrypt
the MCrypt PHP extension.
.. seealso:: <https://secure.php.net/mcrypt>
MIME
Multipurpose Internet Mail Extensions is
an Internet Standard for the format of e-mail.
.. seealso:: <https://en.wikipedia.org/wiki/MIME>
module
some sort of extension for the Apache Webserver.
.. seealso:: <https://en.wikipedia.org/wiki/Apache_HTTP_Server>
mod_proxy_fcgi
an Apache module implmenting a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or
directly as an Apache module.
MySQL
a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS).
.. seealso:: <https://en.wikipedia.org/wiki/MySQL>
mysqli
the improved MySQL client PHP extension.
.. seealso:: <https://secure.php.net/manual/en/book.mysqli.php>
mysql
the MySQL client PHP extension.
.. seealso:: <https://secure.php.net/manual/en/book.mysql.php>
OpenDocument
open standard for office documents.
.. seealso:: <https://en.wikipedia.org/wiki/OpenDocument>
OS X
look at :term:`Mac OS X`.
.. seealso:: <https://en.wikipedia.org/wiki/OS_X>
PDF
Portable Document Format is a file format developed by Adobe Systems for
representing two dimensional documents in a device independent and
resolution independent format.
.. seealso:: <https://en.wikipedia.org/wiki/Portable_Document_Format>
PEAR
the PHP Extension and Application Repository.
.. seealso:: <https://pear.php.net/>
PCRE
Perl Compatible Regular Expressions is the perl-compatible regular
expression functions for PHP
.. seealso:: <https://secure.php.net/pcre>
PHP
short for "PHP: Hypertext Preprocessor", is an open-source, reflective
programming language used mainly for developing server-side applications
and dynamic web content, and more recently, a broader range of software
applications.
.. seealso:: <https://en.wikipedia.org/wiki/PHP>
port
a connection through which data is sent and received.
.. seealso:: <https://en.wikipedia.org/wiki/Port_(computing)>
primary key
A primary key is an index over one or more fields in a table with
unique values for each single row in this table. Every table should have
a primary key for easier accessing/identifying data in this table. There
can only be one primary key per table and it is named always **PRIMARY**.
In fact a primary key is just an :term:`unique key` with the name
**PRIMARY**. If no primary key is defined MySQL will use first *unique
key* as primary key if there is one.
You can create the primary key when creating the table (in phpMyAdmin
just check the primary key radio buttons for each field you wish to be
part of the primary key).
You can also add a primary key to an existing table with `ALTER` `TABLE`
or `CREATE` `INDEX` (in phpMyAdmin you can just click on 'add index' on
the table structure page below the listed fields).
RFC
Request for Comments (RFC) documents are a series of memoranda
encompassing new research, innovations, and methodologies applicable to
Internet technologies.
.. seealso:: <https://en.wikipedia.org/wiki/Request_for_Comments>
RFC 1952
GZIP file format specification version 4.3
.. seealso:: :rfc:`1952`
Row (record, tuple)
represents a single, implicitly structured data item in a table.
.. seealso:: <https://en.wikipedia.org/wiki/Row_(database)>
Server
a computer system that provides services to other computing systems over a network.
.. seealso:: <https://en.wikipedia.org/wiki/Server_(computing)>
Storage Engines
MySQL can use several different formats for storing data on disk, these
are called storage engines or table types. phpMyAdmin allows a user to
change their storage engine for a particular table through the operations
tab.
Common table types are InnoDB and MyISAM, though many others exist and
may be desirable in some situations.
.. seealso:: <https://dev.mysql.com/doc/refman/5.7/en/storage-engines.html>
socket
a form of inter-process communication.
.. seealso:: <https://en.wikipedia.org/wiki/Unix_domain_socket>
SSL
Secure Sockets Layer is a cryptographic protocol which provides secure
communication on the Internet.
.. seealso:: <https://en.wikipedia.org/wiki/Secure_Sockets_Layer>
Stored procedure
a subroutine available to applications accessing a relational database system
.. seealso:: <https://en.wikipedia.org/wiki/Stored_procedure>
SQL
Structured Query Language
.. seealso:: <https://en.wikipedia.org/wiki/SQL>
table
a set of data elements (cells) that is organized, defined and stored as
horizontal rows and vertical columns where each item can be uniquely
identified by a label or key or by it?s position in relation to other
items.
.. seealso:: <https://en.wikipedia.org/wiki/Table_(database)>
tar
a type of archive file format: the Tape ARchive format.
.. seealso:: <https://en.wikipedia.org/wiki/Tar_(file_format)>
TCP
Transmission Control Protocol is one of the core protocols of the
Internet protocol suite.
.. seealso:: <https://en.wikipedia.org/wiki/TCP>
TCPDF
PHP library to generate PDF files.
.. seealso:: <https://tcpdf.org/>
trigger
a procedural code that is automatically executed in response to certain events on a particular table or view in a database
.. seealso:: <https://en.wikipedia.org/wiki/Database_trigger>
unique key
An unique key is an index over one or more fields in a table which has a
unique value for each row. The first unique key will be treated as
:term:`primary key` if there is no *primary key* defined.
URL
Uniform Resource Locator is a sequence of characters, conforming to a
standardized format, that is used for referring to resources, such as
documents and images on the Internet, by their location.
.. seealso:: <https://en.wikipedia.org/wiki/URL>
Webserver
A computer (program) that is responsible for accepting HTTP requests from clients and serving them Web pages.
.. seealso:: <https://en.wikipedia.org/wiki/Webserver>
XML
Extensible Markup Language is a W3C-recommended general- purpose markup
language for creating special-purpose markup languages, capable of
describing many different kinds of data.
.. seealso:: <https://en.wikipedia.org/wiki/XML>
ZIP
a popular data compression and archival format.
.. seealso:: <https://en.wikipedia.org/wiki/ZIP_(file_format)>
zlib
an open-source, cross- platform data compression library by Jean-loup Gailly and Mark Adler.
.. seealso:: <https://en.wikipedia.org/wiki/Zlib>

View File

@ -1,350 +0,0 @@
Import and export
=================
Import
++++++
To import data, go to the "Import" tab in phpMyAdmin. To import data into a
specific database or table, open the database or table before going to the
"Import" tab.
In addition to the standard Import and Export tab, you can also import an SQL
file directly by dragging and dropping it from your local file manager to the
phpMyAdmin interface in your web browser.
If you are having troubles importing big files, please consult :ref:`faq1_16`.
You can import using following methods:
Form based upload
Can be used with any supported format, also (b|g)zipped files, e.g., mydump.sql.gz .
Form based SQL Query
Can be used with valid SQL dumps.
Using upload directory
You can specify an upload directory on your web server where phpMyAdmin is installed, after uploading your file into this directory you can select this file in the import dialog of phpMyAdmin, see :config:option:`$cfg['UploadDir']`.
phpMyAdmin can import from several various commonly used formats.
CSV
---
Comma separated values format which is often used by spreadsheets or various other programs for export/import.
.. note::
When importing data into a table from a CSV file where the table has an
'auto_increment' field, make the 'auto_increment' value for each record in
the CSV field to be '0' (zero). This allows the 'auto_increment' field to
populate correctly.
It is now possible to import a CSV file at the server or database level.
Instead of having to create a table to import the CSV file into, a best-fit
structure will be determined for you and the data imported into it, instead.
All other features, requirements, and limitations are as before.
CSV using LOAD DATA
-------------------
Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one.
ESRI Shape File
---------------
The ESRI shapefile or simply a shapefile is a popular geospatial vector data
format for geographic information systems software. It is developed and
regulated by Esri as a (mostly) open specification for data interoperability
among Esri and other software products.
MediaWiki
---------
MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later),
can now also be imported. This is the format used by Wikipedia to display
tables.
Open Document Spreadsheet (ODS)
-------------------------------
OpenDocument workbooks containing one or more spreadsheets can now be directly imported.
When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the
import as simple as possible.
Table name
~~~~~~~~~~
During import, phpMyAdmin uses the sheet name as the table name; you should rename the
sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create,
though this is less of a concern since you could quickly rename the new table from the Operations tab).
Column names
~~~~~~~~~~~~
You should also make the first row of your spreadsheet a header with the names of the columns (this can be
accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the
checkbox for "The first line of the file contains the table column names;" this way your newly imported
data will go to the proper columns.
.. note::
Formulas and calculations will NOT be evaluated, rather, their value from
the most recent save will be loaded. Please ensure that all values in the
spreadsheet are as needed before importing it.
SQL
---
SQL can be used to make any manipulation on data, it is also useful for restoring backed up data.
XML
---
XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported.
Structures (databases, tables, views, triggers, etc.) and/or data will be
created depending on the contents of the file.
The supported xml schemas are not yet documented in this wiki.
Export
++++++
phpMyAdmin can export into text files (even compressed) on your local disk (or
a special the webserver :config:option:`$cfg['SaveDir']` folder) in various
commonly used formats:
CodeGen
-------
`NHibernate <https://en.wikipedia.org/wiki/NHibernate>`_ file format. Planned
versions: Java, Hibernate, PHP PDO, JSON, etc. So the preliminary name is
codegen.
CSV
---
Comma separated values format which is often used by spreadsheets or various
other programs for export/import.
CSV for Microsoft Excel
-----------------------
This is just preconfigured version of CSV export which can be imported into
most English versions of Microsoft Excel. Some localised versions (like
"Danish") are expecting ";" instead of "," as field separator.
Microsoft Word 2000
-------------------
If you're using Microsoft Word 2000 or newer (or compatible such as
OpenOffice.org), you can use this export.
JSON
----
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It
is easy for humans to read and write and it is easy for machines to parse and
generate.
.. versionchanged:: 4.7.0
The generated JSON structure has been changed in phpMyAdmin 4.7.0 to
produce valid JSON data.
The generated JSON is list of objects with following attributes:
.. js:data:: type
Type of given object, can be one of:
``header``
Export header containing comment and phpMyAdmin version.
``database``
Start of a database marker, containing name of database.
``table``
Table data export.
.. js:data:: version
Used in ``header`` :js:data:`type` and indicates phpMyAdmin version.
.. js:data:: comment
Optional textual comment.
.. js:data:: name
Object name - either table or database based on :js:data:`type`.
.. js:data:: database
Database name for ``table`` :js:data:`type`.
.. js:data:: data
Table content for ``table`` :js:data:`type`.
Sample output:
.. code-block:: json
[
{
"comment": "Export to JSON plugin for PHPMyAdmin",
"type": "header",
"version": "4.7.0-dev"
},
{
"name": "cars",
"type": "database"
},
{
"data": [
{
"car_id": "1",
"description": "Green Chrysler 300",
"make_id": "5",
"mileage": "113688",
"price": "13545.00",
"transmission": "automatic",
"yearmade": "2007"
}
],
"database": "cars",
"name": "cars",
"type": "table"
},
{
"data": [
{
"make": "Chrysler",
"make_id": "5"
}
],
"database": "cars",
"name": "makes",
"type": "table"
}
]
LaTeX
-----
If you want to embed table data or structure in LaTeX, this is right choice for you.
LaTeX is a typesetting system that is very suitable for producing scientific
and mathematical documents of high typographical quality. It is also suitable
for producing all sorts of other documents, from simple letters to complete
books. LaTeX uses TeX as its formatting engine. Learn more about TeX and
LaTeX on `the Comprehensive TeX Archive Network <https://www.ctan.org/>`_
also see the `short description od TeX <https://www.ctan.org/tex/>`_.
The output needs to be embedded into a LaTeX document before it can be
rendered, for example in following document:
.. code-block:: latex
\documentclass{article}
\title{phpMyAdmin SQL output}
\author{}
\usepackage{longtable,lscape}
\date{}
\setlength{\parindent}{0pt}
\usepackage[left=2cm,top=2cm,right=2cm,nohead,nofoot]{geometry}
\pdfpagewidth 210mm
\pdfpageheight 297mm
\begin{document}
\maketitle
% insert phpMyAdmin LaTeX Dump here
\end{document}
MediaWiki
---------
Both tables and databases can be exported in the MediaWiki format, which is
used by Wikipedia to display tables. It can export structure, data or both,
including table names or headers.
OpenDocument Spreadsheet
------------------------
Open standard for spreadsheet data, which is being widely adopted. Many recent
spreadsheet programs, such as LibreOffice, OpenOffice, Microsoft Office or
Google Docs can handle this format.
OpenDocument Text
-----------------
New standard for text data which is being widely addopted. Most recent word
processors (such as LibreOffice, OpenOffice, Microsoft Word, AbiWord or KWord)
can handle this.
PDF
---
For presentation purposes, non editable PDF might be best choice for you.
PHP Array
---------
You can generate a php file which will declare a multidimensional array with
the contents of the selected table or database.
SQL
---
Export in SQL can be used to restore your database, thus it is useful for
backing up.
The option 'Maximal length of created query' seems to be undocumented. But
experiments has shown that it splits large extended INSERTS so each one is no
bigger than the given number of bytes (or characters?). Thus when importing the
file, for large tables you avoid the error "Got a packet bigger than
'max_allowed_packet' bytes".
.. seealso::
https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html
Data Options
~~~~~~~~~~~~
**Complete inserts** adds the column names to the SQL dump. This parameter
improves the readability and reliability of the dump. Adding the column names
increases the size of the dump, but when combined with Extended inserts it's
negligible.
**Extended inserts** combines multiple rows of data into a single INSERT query.
This will significantly decrease filesize for large SQL dumps, increases the
INSERT speed when imported, and is generally recommended.
.. seealso::
http://www.scriptalicious.com/blog/2009/04/complete-inserts-or-extended-inserts-in-phpmyadmin/
Texy!
-----
`Texy! <https://texy.info/>`_ markup format. You can see example on `Texy! demo
<https://texy.info/en/try/4q5we>`_.
XML
---
Easily parsable export for use with custom scripts.
.. versionchanged:: 3.3.0
The XML schema used has changed as of version 3.3.0
YAML
----
YAML is a data serialization format which is both human readable and
computationally powerful ( <http://yaml.org> ).

View File

@ -1,60 +0,0 @@
.. _require:
Requirements
============
Web server
----------
Since phpMyAdmin's interface is based entirely in your browser, you'll need a
web server (such as Apache, nginx, :term:`IIS`) to install phpMyAdmin's files into.
PHP
---
* You need PHP 5.5.0 or newer, with ``session`` support, the Standard PHP Library
(SPL) extension, hash, ctype, and JSON support.
* The ``mbstring`` extension (see :term:`mbstring`) is strongly recommended
for performance reasons.
* To support uploading of ZIP files, you need the PHP ``zip`` extension.
* You need GD2 support in PHP to display inline thumbnails of JPEGs
("image/jpeg: inline") with their original aspect ratio.
* When using the cookie authentication (the default), the `openssl
<https://secure.php.net/openssl>`_ extension is strongly suggested.
* To support upload progress bars, see :ref:`faq2_9`.
* To support XML and Open Document Spreadsheet importing, you need the
`libxml <https://secure.php.net/libxml>`_ extension.
* To support reCAPTCHA on the login page, you need the
`openssl <https://secure.php.net/openssl>`_ extension.
* To support displaying phpMyAdmin's latest version, you need to enable
``allow_url_open`` in your :file:`php.ini` or to have the
`curl <https://secure.php.net/curl>`_ extension.
.. seealso:: :ref:`faq1_31`, :ref:`authentication_modes`
Database
--------
phpMyAdmin supports MySQL-compatible databases.
* MySQL 5.5 or newer
* MariaDB 5.5 or newer
.. seealso:: :ref:`faq1_17`
Web browser
-----------
To access phpMyAdmin you need a web browser with cookies and JavaScript
enabled.
You need browser which is supported by jQuery 2.0, see
<https://jquery.com/browser-support/>.

File diff suppressed because it is too large Load Diff

View File

@ -1,143 +0,0 @@
.. _transformations:
Transformations
===============
.. note::
You need to have configured the :ref:`linked-tables` for using transformations
feature.
.. _transformationsintro:
Introduction
++++++++++++
To enable transformations, you have to setup the ``column_info``
table and the proper directives. Please see the :ref:`config` on how to do so.
You can apply different transformations to the contents of each
column. The transformation will take the content of each column and
transform it with certain rules defined in the selected
transformation.
Say you have a column 'filename' which contains a filename. Normally
you would see in phpMyAdmin only this filename. Using transformations
you can transform that filename into a HTML link, so you can click
inside of the phpMyAdmin structure on the column's link and will see
the file displayed in a new browser window. Using transformation
options you can also specify strings to append/prepend to a string or
the format you want the output stored in.
For a general overview of all available transformations and their
options, you can consult your *<www.your-host.com>/<your-install-
dir>/transformation\_overview.php* installation.
For a tutorial on how to effectively use transformations, see our
`Link section <https://www.phpmyadmin.net/docs/>`_ on the
official phpMyAdmin homepage.
.. _transformationshowto:
Usage
+++++
Go to your *tbl\_structure.php* page (i.e. reached through clicking on
the 'Structure' link for a table). There click on "Change" (or change
icon) and there you will see three new fields at the end of the line.
They are called 'MIME-type', 'Browser transformation' and
'Transformation options'.
* The field 'MIME-type' is a drop-down field. Select the MIME-type that
corresponds to the column's contents. Please note that transformations
are inactive as long as no MIME-type is selected.
* The field 'Browser transformation' is a drop-down field. You can
choose from a hopefully growing amount of pre-defined transformations.
See below for information on how to build your own transformation.
There are global transformations and mimetype-bound transformations.
Global transformations can be used for any mimetype. They will take
the mimetype, if necessary, into regard. Mimetype-bound
transformations usually only operate on a certain mimetype. There are
transformations which operate on the main mimetype (like 'image'),
which will most likely take the subtype into regard, and those who
only operate on a specific subtype (like 'image/jpeg'). You can use
transformations on mimetypes for which the function was not defined
for. There is no security check for you selected the right
transformation, so take care of what the output will be like.
* The field 'Transformation options' is a free-type textfield. You have
to enter transform-function specific options here. Usually the
transforms can operate with default options, but it is generally a
good idea to look up the overview to see which options are necessary.
Much like the ENUM/SET-Fields, you have to split up several options
using the format 'a','b','c',...(NOTE THE MISSING BLANKS). This is
because internally the options will be parsed as an array, leaving the
first value the first element in the array, and so forth. If you want
to specify a MIME character set you can define it in the
transformation\_options. You have to put that outside of the pre-
defined options of the specific mime-transform, as the last value of
the set. Use the format "'; charset=XXX'". If you use a transform, for
which you can specify 2 options and you want to append a character
set, enter "'first parameter','second parameter','charset=us-ascii'".
You can, however use the defaults for the parameters: "'','','charset
=us-ascii'". The default options can be configured using
:config:option:`$cfg['DefaultTransformations']`
.. _transformationsfiles:
File structure
++++++++++++++
All specific transformations for mimetypes are defined through class
files in the directory 'libraries/classes/Plugins/Transformations/'. Each of
them extends a certain transformation abstract class declared in
libraries/classes/Plugins/Transformations/Abs.
They are stored in files to ease up customization and easy adding of
new transformations.
Because the user cannot enter own mimetypes, it is kept sure that
transformations always work. It makes no sense to apply a
transformation to a mimetype the transform-function doesn't know to
handle.
There is a file called '*transformations.lib.php*' that provides some
basic functions which can be included by any other transform function.
The file name convention is ``[Mimetype]_[Subtype]_[Transformation
Name].class.php``, while the abtract class that it extends has the
name ``[Transformation Name]TransformationsPlugin``. All of the
methods that have to be implemented by a transformations plug-in are:
#. getMIMEType() and getMIMESubtype() in the main class;
#. getName(), getInfo() and applyTransformation() in the abstract class
it extends.
The getMIMEType(), getMIMESubtype() and getName() methods return the
name of the MIME type, MIME Subtype and transformation accordingly.
getInfo() returns the transformation's description and possible
options it may receive and applyTransformation() is the method that
does the actual work of the transformation plug-in.
Please see the libraries/classes/Plugins/Transformations/TEMPLATE and
libraries/classes/Plugins/Transformations/TEMPLATE\_ABSTRACT files for adding
your own transformation plug-in. You can also generate a new
transformation plug-in (with or without the abstract transformation
class), by using
:file:`scripts/transformations_generator_plugin.sh` or
:file:`scripts/transformations_generator_main_class.sh`.
The applyTransformation() method always gets passed three variables:
#. **$buffer** - Contains the text inside of the column. This is the
text, you want to transform.
#. **$options** - Contains any user-passed options to a transform
function as an array.
#. **$meta** - Contains an object with information about your column. The
data is drawn from the output of the `mysql\_fetch\_field()
<https://secure.php.net/mysql_fetch_field>`_ function. This means, all
object properties described on the `manual page
<https://secure.php.net/mysql_fetch_field>`_ are available in this
variable and can be used to transform a column accordingly to
unsigned/zerofill/not\_null/... properties. The $meta->mimetype
variable contains the original MIME-type of the column (i.e.
'text/plain', 'image/jpeg' etc.)

View File

@ -1,67 +0,0 @@
.. _2fa:
Two-factor authentication
=========================
.. versionadded:: 4.8.0
Since phpMyAdmin 4.8.0 you can configure two-factor authentication to be
used when logging in. To use this, you first need to configure the
:ref:`linked-tables`. Once this is done, every user can opt-in for second
authentication factor in the :guilabel:`Settings`.
When running phpMyAdmin from the Git source repository, the dependencies must be installed
manually; the typical way of doing so is with the command:
.. code-block:: sh
composer require pragmarx/google2fa bacon/bacon-qr-code
Or when using a hardware security key with FIDO U2F:
.. code-block:: sh
composer require samyoul/u2f-php-server
Authentication Application (2FA)
--------------------------------
Using application for authentication is quite common approach based on HOTP and
`TOTP <https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm>`_.
It is based on transmitting private key from phpMyAdmin to the authentication
application and the application is then able to generate one time codes based
on this key.
There are dozens of applications available for mobile phones to implement these
standards, the most widely used include:
* `FreeOTP for iOS, Android and Pebble <https://freeotp.github.io/>`_
* `Authy for iOS, Android, Chrome, OS X <https://authy.com/>`_
* `Google Authenticator for iOS <https://itunes.apple.com/us/app/google-authenticator/id388497605>`_
* `Google Authenticator for Android <https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2>`_
* `LastPass Authenticator for iOS, Android, OS X, Windows <https://lastpass.com/auth/>`_
Hardware Security Key (FIDO U2F)
--------------------------------
Using hardware tokens is considered to be more secure than software based
solution. phpMyAdmin supports `FIDO U2F <https://en.wikipedia.org/wiki/Universal_2nd_Factor>`_
tokens.
There are several manufacturers of these tokens, for example:
* `youbico FIDO U2F Security Key <https://www.yubico.com/solutions/fido-u2f/>`_
* `HyperFIDO <https://www.hypersecu.com/products/hyperfido>`_
* `TREZOR Bitcoin wallet <https://shop.trezor.io?a=572b241135e1>`_ can `act as an U2F token <https://doc.satoshilabs.com/trezor-user/u2f.html>`_
.. _simple2fa:
Simple two-factor authentication
--------------------------------
This authentication is included for testing and demostration purposes only as
it really does not provide two-factor authentication, it just asks user to confirm login by
clicking on the button.
It should not be used in the production and is disabled unless
:config:option:`$cfg['DBG']['simple2fa']` is set.

View File

@ -1,611 +0,0 @@
/*
* basic.css
* ~~~~~~~~~
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/* -- main layout ----------------------------------------------------------- */
div.clearer {
clear: both;
}
/* -- relbar ---------------------------------------------------------------- */
div.related {
width: 100%;
font-size: 90%;
}
div.related h3 {
display: none;
}
div.related ul {
margin: 0;
padding: 0 0 0 10px;
list-style: none;
}
div.related li {
display: inline;
}
div.related li.right {
float: right;
margin-right: 5px;
}
/* -- sidebar --------------------------------------------------------------- */
div.sphinxsidebarwrapper {
padding: 10px 5px 0 10px;
}
div.sphinxsidebar {
float: left;
width: 230px;
margin-left: -100%;
font-size: 90%;
word-wrap: break-word;
overflow-wrap : break-word;
}
div.sphinxsidebar ul {
list-style: none;
}
div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points {
margin-left: 20px;
list-style: square;
}
div.sphinxsidebar ul ul {
margin-top: 0;
margin-bottom: 0;
}
div.sphinxsidebar form {
margin-top: 10px;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
}
img {
border: 0;
max-width: 100%;
}
/* -- search page ----------------------------------------------------------- */
ul.search {
margin: 10px 0 0 20px;
padding: 0;
}
ul.search li {
padding: 5px 0 5px 20px;
background-image: url(file.png);
background-repeat: no-repeat;
background-position: 0 7px;
}
ul.search li a {
font-weight: bold;
}
ul.search li div.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
}
ul.keywordmatches li.goodmatch a {
font-weight: bold;
}
/* -- index page ------------------------------------------------------------ */
table.contentstable {
width: 90%;
}
table.contentstable p.biglink {
line-height: 150%;
}
a.biglink {
font-size: 1.3em;
}
span.linkdescr {
font-style: italic;
padding-top: 5px;
font-size: 90%;
}
/* -- general index --------------------------------------------------------- */
table.indextable {
width: 100%;
}
table.indextable td {
text-align: left;
vertical-align: top;
}
table.indextable dl, table.indextable dd {
margin-top: 0;
margin-bottom: 0;
}
table.indextable tr.pcap {
height: 10px;
}
table.indextable tr.cap {
margin-top: 10px;
background-color: #f2f2f2;
}
img.toggler {
margin-right: 3px;
margin-top: 3px;
cursor: pointer;
}
div.modindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
div.genindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
/* -- general body styles --------------------------------------------------- */
div.body p, div.body dd, div.body li, div.body blockquote {
-moz-hyphens: auto;
-ms-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
a.headerlink {
visibility: hidden;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink,
caption:hover > a.headerlink,
p.caption:hover > a.headerlink,
div.code-block-caption:hover > a.headerlink {
visibility: visible;
}
div.body p.caption {
text-align: inherit;
}
div.body td {
text-align: left;
}
.field-list ul {
padding-left: 1em;
}
.first {
margin-top: 0 !important;
}
p.rubric {
margin-top: 30px;
font-weight: bold;
}
img.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
img.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left;
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
/* -- sidebars -------------------------------------------------------------- */
div.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px 7px 0 7px;
background-color: #ffe;
width: 40%;
float: right;
}
p.sidebar-title {
font-weight: bold;
}
/* -- topics ---------------------------------------------------------------- */
div.topic {
border: 1px solid #ccc;
padding: 7px 7px 0 7px;
margin: 10px 0 10px 0;
}
p.topic-title {
font-size: 1.1em;
font-weight: bold;
margin-top: 10px;
}
/* -- admonitions ----------------------------------------------------------- */
div.admonition {
margin-top: 10px;
margin-bottom: 10px;
padding: 7px;
}
div.admonition dt {
font-weight: bold;
}
div.admonition dl {
margin-bottom: 0;
}
p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
}
div.body p.centered {
text-align: center;
margin-top: 25px;
}
/* -- tables ---------------------------------------------------------------- */
table.docutils {
border: 0;
border-collapse: collapse;
}
table caption span.caption-number {
font-style: italic;
}
table caption span.caption-text {
}
table.docutils td, table.docutils th {
padding: 1px 8px 1px 5px;
border-top: 0;
border-left: 0;
border-right: 0;
border-bottom: 1px solid #aaa;
}
table.field-list td, table.field-list th {
border: 0 !important;
}
table.footnote td, table.footnote th {
border: 0 !important;
}
th {
text-align: left;
padding-right: 5px;
}
table.citation {
border-left: solid 1px gray;
margin-left: 1px;
}
table.citation td {
border-bottom: none;
}
/* -- figures --------------------------------------------------------------- */
div.figure {
margin: 0.5em;
padding: 0.5em;
}
div.figure p.caption {
padding: 0.3em;
}
div.figure p.caption span.caption-number {
font-style: italic;
}
div.figure p.caption span.caption-text {
}
/* -- other body styles ----------------------------------------------------- */
ol.arabic {
list-style: decimal;
}
ol.loweralpha {
list-style: lower-alpha;
}
ol.upperalpha {
list-style: upper-alpha;
}
ol.lowerroman {
list-style: lower-roman;
}
ol.upperroman {
list-style: upper-roman;
}
dl {
margin-bottom: 15px;
}
dd p {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
dt:target, .highlighted {
background-color: #fbe54e;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
.field-list ul {
margin: 0;
padding-left: 1em;
}
.field-list p {
margin: 0;
}
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.versionmodified {
font-style: italic;
}
.system-message {
background-color: #fda;
padding: 5px;
border: 3px solid red;
}
.footnote:target {
background-color: #ffa;
}
.line-block {
display: block;
margin-top: 1em;
margin-bottom: 1em;
}
.line-block .line-block {
margin-top: 0;
margin-bottom: 0;
margin-left: 1.5em;
}
.guilabel, .menuselection {
font-family: sans-serif;
}
.accelerator {
text-decoration: underline;
}
.classifier {
font-style: oblique;
}
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
}
/* -- code displays --------------------------------------------------------- */
pre {
overflow: auto;
overflow-y: hidden; /* fixes display issues on Chrome browsers */
}
span.pre {
-moz-hyphens: none;
-ms-hyphens: none;
-webkit-hyphens: none;
hyphens: none;
}
td.linenos pre {
padding: 5px 0px;
border: 0;
background-color: transparent;
color: #aaa;
}
table.highlighttable {
margin-left: 0.5em;
}
table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
div.code-block-caption {
padding: 2px 5px;
font-size: small;
}
div.code-block-caption code {
background-color: transparent;
}
div.code-block-caption + div > div.highlight > pre {
margin-top: 0;
}
div.code-block-caption span.caption-number {
padding: 0.1em 0.3em;
font-style: italic;
}
div.code-block-caption span.caption-text {
}
div.literal-block-wrapper {
padding: 1em 1em 0;
}
div.literal-block-wrapper div.highlight {
margin: 0;
}
code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
code.descclassname {
background-color: transparent;
}
code.xref, a code {
background-color: transparent;
font-weight: bold;
}
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}
.viewcode-link {
float: right;
}
.viewcode-back {
float: right;
font-family: sans-serif;
}
div.viewcode-block:target {
margin: -1px -10px;
padding: 0 10px;
}
/* -- math display ---------------------------------------------------------- */
img.math {
vertical-align: middle;
}
div.body div.math p {
text-align: center;
}
span.eqno {
float: right;
}
/* -- printout stylesheet --------------------------------------------------- */
@media print {
div.document,
div.documentwrapper,
div.bodywrapper {
margin: 0 !important;
width: 100%;
}
div.sphinxsidebar,
div.related,
div.footer,
#top-link {
display: none;
}
}

View File

@ -1,261 +0,0 @@
/*
* default.css_t
* ~~~~~~~~~~~~~
*
* Sphinx stylesheet -- default theme.
*
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: sans-serif;
font-size: 100%;
background-color: #11303d;
color: #000;
margin: 0;
padding: 0;
}
div.document {
background-color: #1c4e63;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 230px;
}
div.body {
background-color: #ffffff;
color: #000000;
padding: 0 20px 30px 20px;
}
div.footer {
color: #ffffff;
width: 100%;
padding: 9px 0 9px 0;
text-align: center;
font-size: 75%;
}
div.footer a {
color: #ffffff;
text-decoration: underline;
}
div.related {
background-color: #133f52;
line-height: 30px;
color: #ffffff;
}
div.related a {
color: #ffffff;
}
div.sphinxsidebar {
}
div.sphinxsidebar h3 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.4em;
font-weight: normal;
margin: 0;
padding: 0;
}
div.sphinxsidebar h3 a {
color: #ffffff;
}
div.sphinxsidebar h4 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.3em;
font-weight: normal;
margin: 5px 0 0 0;
padding: 0;
}
div.sphinxsidebar p {
color: #ffffff;
}
div.sphinxsidebar p.topless {
margin: 5px 10px 10px 10px;
}
div.sphinxsidebar ul {
margin: 10px;
padding: 0;
color: #ffffff;
}
div.sphinxsidebar a {
color: #98dbcc;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
/* -- hyperlink styles ------------------------------------------------------ */
a {
color: #355f7c;
text-decoration: none;
}
a:visited {
color: #355f7c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* -- body styles ----------------------------------------------------------- */
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Trebuchet MS', sans-serif;
background-color: #f2f2f2;
font-weight: normal;
color: #20435c;
border-bottom: 1px solid #ccc;
margin: 20px -20px 10px -20px;
padding: 3px 0 3px 10px;
}
div.body h1 { margin-top: 0; font-size: 200%; }
div.body h2 { font-size: 160%; }
div.body h3 { font-size: 140%; }
div.body h4 { font-size: 120%; }
div.body h5 { font-size: 110%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
div.body p, div.body dd, div.body li, div.body blockquote {
text-align: justify;
line-height: 130%;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.admonition p {
margin-bottom: 5px;
}
div.admonition pre {
margin-bottom: 5px;
}
div.admonition ul, div.admonition ol {
margin-bottom: 5px;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre {
padding: 5px;
background-color: #eeffcc;
color: #333333;
line-height: 120%;
border: 1px solid #ac9;
border-left: none;
border-right: none;
}
code {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
}
th {
background-color: #ede;
}
.warning code {
background: #efc2c2;
}
.note code {
background: #d6d6d6;
}
.viewcode-back {
font-family: sans-serif;
}
div.viewcode-block:target {
background-color: #f4debf;
border-top: 1px solid #ac9;
border-bottom: 1px solid #ac9;
}
div.code-block-caption {
color: #efefef;
background-color: #1c4e63;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,287 +0,0 @@
/*
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/**
* make the code below compatible with browsers without
* an installed firebug like debugger
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
"profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
}
*/
/**
* small helper function to urldecode strings
*/
jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' ');
};
/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s == 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node) {
if (node.nodeType == 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
var span = document.createElement("span");
span.className = className;
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this);
});
}
}
return this.each(function() {
highlight(this);
});
};
/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
/**
* Small JavaScript module for the documentation.
*/
var Documentation = {
init : function() {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
},
/**
* i18n support
*/
TRANSLATIONS : {},
PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
LOCALE : 'unknown',
// gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext)
gettext : function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
return string;
return (typeof translated == 'string') ? translated : translated[0];
},
ngettext : function(singular, plural, n) {
var translated = Documentation.TRANSLATIONS[singular];
if (typeof translated == 'undefined')
return (n == 1) ? singular : plural;
return translated[Documentation.PLURALEXPR(n)];
},
addTranslations : function(catalog) {
for (var key in catalog.messages)
this.TRANSLATIONS[key] = catalog.messages[key];
this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
this.LOCALE = catalog.locale;
},
/**
* add context elements like header anchor links
*/
addContextElements : function() {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
$('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this definition')).
appendTo(this);
});
},
/**
* workaround a firefox stupidity
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash)
window.setTimeout(function() {
document.location.href += '';
}, 10);
},
/**
* highlight the search words provided in the url in the text
*/
highlightSearchWords : function() {
var params = $.getQueryParameters();
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
if (!body.length) {
body = $('body');
}
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
}
},
/**
* init the domain index toggle buttons
*/
initIndexTable : function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
$('tr.cg-' + idnum).toggle();
if (src.substr(-9) == 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
},
/**
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('#searchbox .highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},
/**
* make the url absolute
*/
makeURL : function(relativeURL) {
return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
},
/**
* get the current relative url
*/
getCurrentURL : function() {
var path = document.location.pathname;
var parts = path.split(/\//);
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (this == '..')
parts.pop();
});
var url = parts.join('/');
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
},
initOnKeyListeners: function() {
$(document).keyup(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box or textarea
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
if (prevHref) {
window.location.href = prevHref;
return false;
}
case 39: // right
var nextHref = $('link[rel="next"]').prop('href');
if (nextHref) {
window.location.href = nextHref;
return false;
}
}
}
});
}
};
// quick alias for translations
_ = Documentation.gettext;
$(document).ready(function() {
Documentation.init();
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

View File

@ -1,751 +0,0 @@
/*
* searchtools.js_t
* ~~~~~~~~~~~~~~~~
*
* Sphinx JavaScript utilities for the full-text search.
*
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
var Stemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
};
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
}
}
/**
* Simple result scoring code.
*/
var Scorer = {
// Implement the following function to further tweak the score for each result
// The function takes a result array [filename, title, anchor, descr, score]
// and returns the new score.
/*
score: function(result) {
return result[4];
},
*/
// query matches the full name of an object
objNameMatch: 11,
// or matches in the last dotted part of the object name
objPartialMatch: 6,
// Additive scores depending on the priority of the object
objPrio: {0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5}, // used to be unimportantResults
// Used when the priority is not in the mapping.
objPrioDefault: 0,
// query found in title
title: 15,
// query found in terms
term: 5
};
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
var i, j, start, end;
for (i = 0; i < singles.length; i++) {
result[singles[i]] = true;
}
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
for (i = 0; i < ranges.length; i++) {
start = ranges[i][0];
end = ranges[i][1];
for (j = start; j <= end; j++) {
result[j] = true;
}
}
return result;
})();
function splitQuery(query) {
var result = [];
var start = -1;
for (var i = 0; i < query.length; i++) {
if (splitChars[query.charCodeAt(i)]) {
if (start !== -1) {
result.push(query.slice(start, i));
start = -1;
}
} else if (start === -1) {
start = i;
}
}
if (start !== -1) {
result.push(query.slice(start));
}
return result;
}
/**
* Search Module
*/
var Search = {
_index : null,
_queued_query : null,
_pulse_status : -1,
init : function() {
var params = $.getQueryParameters();
if (params.q) {
var query = params.q[0];
$('input[name="q"]')[0].value = query;
this.performSearch(query);
}
},
loadIndex : function(url) {
$.ajax({type: "GET", url: url, data: null,
dataType: "script", cache: true,
complete: function(jqxhr, textstatus) {
if (textstatus != "success") {
document.getElementById("searchindexloader").src = url;
}
}});
},
setIndex : function(index) {
var q;
this._index = index;
if ((q = this._queued_query) !== null) {
this._queued_query = null;
Search.query(q);
}
},
hasIndex : function() {
return this._index !== null;
},
deferQuery : function(query) {
this._queued_query = query;
},
stopPulse : function() {
this._pulse_status = 0;
},
startPulse : function() {
if (this._pulse_status >= 0)
return;
function pulse() {
var i;
Search._pulse_status = (Search._pulse_status + 1) % 4;
var dotString = '';
for (i = 0; i < Search._pulse_status; i++)
dotString += '.';
Search.dots.text(dotString);
if (Search._pulse_status > -1)
window.setTimeout(pulse, 500);
}
pulse();
},
/**
* perform a search for something (or wait until index is loaded)
*/
performSearch : function(query) {
// create the required interface elements
this.out = $('#search-results');
this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
this.dots = $('<span></span>').appendTo(this.title);
this.status = $('<p style="display: none"></p>').appendTo(this.out);
this.output = $('<ul class="search"/>').appendTo(this.out);
$('#search-progress').text(_('Preparing search...'));
this.startPulse();
// index already loaded, the browser was quick!
if (this.hasIndex())
this.query(query);
else
this.deferQuery(query);
},
/**
* execute search (requires search index to be loaded)
*/
query : function(query) {
var i;
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
// stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = splitQuery(query);
var objectterms = [];
for (i = 0; i < tmp.length; i++) {
if (tmp[i] !== "") {
objectterms.push(tmp[i].toLowerCase());
}
if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] === "") {
// skip this "word"
continue;
}
// stem the word
var word = stemmer.stemWord(tmp[i].toLowerCase());
var toAppend;
// select the correct list
if (word[0] == '-') {
toAppend = excluded;
word = word.substr(1);
}
else {
toAppend = searchterms;
hlterms.push(tmp[i].toLowerCase());
}
// only add if not already in the list
if (!$u.contains(toAppend, word))
toAppend.push(word);
}
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
// console.debug('SEARCH: searching for:');
// console.info('required: ', searchterms);
// console.info('excluded: ', excluded);
// prepare search
var terms = this._index.terms;
var titleterms = this._index.titleterms;
// array of [filename, title, anchor, descr, score]
var results = [];
$('#search-progress').empty();
// lookup as object
for (i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0, i),
objectterms.slice(i+1, objectterms.length));
results = results.concat(this.performObjectSearch(objectterms[i], others));
}
// lookup as search terms in fulltext
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
// let the scorer override scores with a custom scoring function
if (Scorer.score) {
for (i = 0; i < results.length; i++)
results[i][4] = Scorer.score(results[i]);
}
// now sort the results by score (in opposite order of appearance, since the
// display function below uses pop() to retrieve items) and then
// alphabetically
results.sort(function(a, b) {
var left = a[4];
var right = b[4];
if (left > right) {
return 1;
} else if (left < right) {
return -1;
} else {
// same score: sort alphabetically
left = a[1].toLowerCase();
right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
}
});
// for debugging
//Search.lastresults = results.slice(); // a copy
//console.info('search results:', Search.lastresults);
// print the results
var resultCount = results.length;
function displayNextItem() {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
// dirhtml builder
var dirname = item[0] + '/';
if (dirname.match(/\/index\/$/)) {
dirname = dirname.substring(0, dirname.length-6);
} else if (dirname == 'index/') {
dirname = '';
}
listItem.append($('<a/>').attr('href',
DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
highlightstring + item[2]).html(item[1]));
} else {
// normal html builders
listItem.append($('<a/>').attr('href',
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
highlightstring + item[2]).html(item[1]));
}
if (item[3]) {
listItem.append($('<span> (' + item[3] + ')</span>'));
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt',
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;
if (data !== '' && data !== undefined) {
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
}
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
}});
} else {
// no source available, just display title
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
}
}
// search finished, update title and status message
else {
Search.stopPulse();
Search.title.text(_('Search Results'));
if (!resultCount)
Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
else
Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
Search.status.fadeIn(500);
}
}
displayNextItem();
},
/**
* search for object names
*/
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
var i;
var results = [];
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
var score = 0;
var parts = fullname.split('.');
// check for different match types: exact matches of full name or
// "last name" (i.e. last dotted part)
if (fullname == object || parts[parts.length - 1] == object) {
score += Scorer.objNameMatch;
// matches in last name
} else if (parts[parts.length - 1].indexOf(object) > -1) {
score += Scorer.objPartialMatch;
}
var match = objects[prefix][name];
var objname = objnames[match[1]][2];
var title = titles[match[0]];
// If more than one term searched for, we require other words to be
// found in the name/title/description
if (otherterms.length > 0) {
var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase();
var allfound = true;
for (i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false;
break;
}
}
if (!allfound) {
continue;
}
}
var descr = objname + _(', in ') + title;
var anchor = match[3];
if (anchor === '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
// add custom score for some objects according to scorer
if (Scorer.objPrio.hasOwnProperty(match[2])) {
score += Scorer.objPrio[match[2]];
} else {
score += Scorer.objPrioDefault;
}
results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
}
}
}
return results;
},
/**
* search for full-text terms in the index
*/
performTermsSearch : function(searchterms, excluded, terms, titleterms) {
var filenames = this._index.filenames;
var titles = this._index.titles;
var i, j, file;
var fileMap = {};
var scoreMap = {};
var results = [];
// perform the search on the required terms
for (i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
var files = [];
var _o = [
{files: terms[word], score: Scorer.term},
{files: titleterms[word], score: Scorer.title}
];
// no match but word was a required one
if ($u.every(_o, function(o){return o.files === undefined;})) {
break;
}
// found search word in contents
$u.each(_o, function(o) {
var _files = o.files;
if (_files === undefined)
return
if (_files.length === undefined)
_files = [_files];
files = files.concat(_files);
// set score for the word in each file to Scorer.term
for (j = 0; j < _files.length; j++) {
file = _files[j];
if (!(file in scoreMap))
scoreMap[file] = {}
scoreMap[file][word] = o.score;
}
});
// create the mapping
for (j = 0; j < files.length; j++) {
file = files[j];
if (file in fileMap)
fileMap[file].push(word);
else
fileMap[file] = [word];
}
}
// now check if the files don't contain excluded terms
for (file in fileMap) {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
continue;
// ensure that none of the excluded terms is in the search result
for (i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
titleterms[excluded[i]] == file ||
$u.contains(terms[excluded[i]] || [], file) ||
$u.contains(titleterms[excluded[i]] || [], file)) {
valid = false;
break;
}
}
// if we have still a valid result we can add it to the result list
if (valid) {
// select one (max) score for the file.
// for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
results.push([filenames[file], titles[file], '', null, score]);
}
}
return results;
},
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurrence, the
* latter for highlighting it.
*/
makeSearchSummary : function(text, keywords, hlwords) {
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
};
$(document).ready(function() {
Search.init();
});

View File

@ -1,159 +0,0 @@
/*
* sidebar.js
* ~~~~~~~~~~
*
* This script makes the Sphinx sidebar collapsible.
*
* .sphinxsidebar contains .sphinxsidebarwrapper. This script adds
* in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
* used to collapse and expand the sidebar.
*
* When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
* and the width of the sidebar and the margin-left of the document
* are decreased. When the sidebar is expanded the opposite happens.
* This script saves a per-browser/per-session cookie used to
* remember the position of the sidebar among the pages.
* Once the browser is closed the cookie is deleted and the position
* reset to the default (expanded).
*
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
$(function() {
// global elements used by the functions.
// the 'sidebarbutton' element is defined as global after its
// creation, in the add_sidebar_button function
var bodywrapper = $('.bodywrapper');
var sidebar = $('.sphinxsidebar');
var sidebarwrapper = $('.sphinxsidebarwrapper');
// for some reason, the document has no sidebar; do not run into errors
if (!sidebar.length) return;
// original margin-left of the bodywrapper and width of the sidebar
// with the sidebar expanded
var bw_margin_expanded = bodywrapper.css('margin-left');
var ssb_width_expanded = sidebar.width();
// margin-left of the bodywrapper and width of the sidebar
// with the sidebar collapsed
var bw_margin_collapsed = '.8em';
var ssb_width_collapsed = '.8em';
// colors used by the current theme
var dark_color = $('.related').css('background-color');
var light_color = $('.document').css('background-color');
function sidebar_is_collapsed() {
return sidebarwrapper.is(':not(:visible)');
}
function toggle_sidebar() {
if (sidebar_is_collapsed())
expand_sidebar();
else
collapse_sidebar();
}
function collapse_sidebar() {
sidebarwrapper.hide();
sidebar.css('width', ssb_width_collapsed);
bodywrapper.css('margin-left', bw_margin_collapsed);
sidebarbutton.css({
'margin-left': '0',
'height': bodywrapper.height()
});
sidebarbutton.find('span').text('»');
sidebarbutton.attr('title', _('Expand sidebar'));
document.cookie = 'sidebar=collapsed';
}
function expand_sidebar() {
bodywrapper.css('margin-left', bw_margin_expanded);
sidebar.css('width', ssb_width_expanded);
sidebarwrapper.show();
sidebarbutton.css({
'margin-left': ssb_width_expanded-12,
'height': bodywrapper.height()
});
sidebarbutton.find('span').text('«');
sidebarbutton.attr('title', _('Collapse sidebar'));
document.cookie = 'sidebar=expanded';
}
function add_sidebar_button() {
sidebarwrapper.css({
'float': 'left',
'margin-right': '0',
'width': ssb_width_expanded - 28
});
// create the button
sidebar.append(
'<div id="sidebarbutton"><span>&laquo;</span></div>'
);
var sidebarbutton = $('#sidebarbutton');
light_color = sidebarbutton.css('background-color');
// find the height of the viewport to center the '<<' in the page
var viewport_height;
if (window.innerHeight)
viewport_height = window.innerHeight;
else
viewport_height = $(window).height();
sidebarbutton.find('span').css({
'display': 'block',
'margin-top': (viewport_height - sidebar.position().top - 20) / 2
});
sidebarbutton.click(toggle_sidebar);
sidebarbutton.attr('title', _('Collapse sidebar'));
sidebarbutton.css({
'color': '#FFFFFF',
'border-left': '1px solid ' + dark_color,
'font-size': '1.2em',
'cursor': 'pointer',
'height': bodywrapper.height(),
'padding-top': '1px',
'margin-left': ssb_width_expanded - 12
});
sidebarbutton.hover(
function () {
$(this).css('background-color', dark_color);
},
function () {
$(this).css('background-color', light_color);
}
);
}
function set_position_from_cookie() {
if (!document.cookie)
return;
var items = document.cookie.split(';');
for(var k=0; k<items.length; k++) {
var key_val = items[k].split('=');
var key = key_val[0].replace(/ /, ""); // strip leading spaces
if (key == 'sidebar') {
var value = key_val[1];
if ((value == 'collapsed') && (!sidebar_is_collapsed()))
collapse_sidebar();
else if ((value == 'expanded') && (sidebar_is_collapsed()))
expand_sidebar();
}
}
}
add_sidebar_button();
var sidebarbutton = $('#sidebarbutton');
set_position_from_cookie();
});

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

View File

@ -1,808 +0,0 @@
/*
* websupport.js
* ~~~~~~~~~~~~~
*
* sphinx.websupport utilities for all documentation.
*
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
(function($) {
$.fn.autogrow = function() {
return this.each(function() {
var textarea = this;
$.fn.autogrow.resize(textarea);
$(textarea)
.focus(function() {
textarea.interval = setInterval(function() {
$.fn.autogrow.resize(textarea);
}, 500);
})
.blur(function() {
clearInterval(textarea.interval);
});
});
};
$.fn.autogrow.resize = function(textarea) {
var lineHeight = parseInt($(textarea).css('line-height'), 10);
var lines = textarea.value.split('\n');
var columns = textarea.cols;
var lineCount = 0;
$.each(lines, function() {
lineCount += Math.ceil(this.length / columns) || 1;
});
var height = lineHeight * (lineCount + 1);
$(textarea).css('height', height);
};
})(jQuery);
(function($) {
var comp, by;
function init() {
initEvents();
initComparator();
}
function initEvents() {
$(document).on("click", 'a.comment-close', function(event) {
event.preventDefault();
hide($(this).attr('id').substring(2));
});
$(document).on("click", 'a.vote', function(event) {
event.preventDefault();
handleVote($(this));
});
$(document).on("click", 'a.reply', function(event) {
event.preventDefault();
openReply($(this).attr('id').substring(2));
});
$(document).on("click", 'a.close-reply', function(event) {
event.preventDefault();
closeReply($(this).attr('id').substring(2));
});
$(document).on("click", 'a.sort-option', function(event) {
event.preventDefault();
handleReSort($(this));
});
$(document).on("click", 'a.show-proposal', function(event) {
event.preventDefault();
showProposal($(this).attr('id').substring(2));
});
$(document).on("click", 'a.hide-proposal', function(event) {
event.preventDefault();
hideProposal($(this).attr('id').substring(2));
});
$(document).on("click", 'a.show-propose-change', function(event) {
event.preventDefault();
showProposeChange($(this).attr('id').substring(2));
});
$(document).on("click", 'a.hide-propose-change', function(event) {
event.preventDefault();
hideProposeChange($(this).attr('id').substring(2));
});
$(document).on("click", 'a.accept-comment', function(event) {
event.preventDefault();
acceptComment($(this).attr('id').substring(2));
});
$(document).on("click", 'a.delete-comment', function(event) {
event.preventDefault();
deleteComment($(this).attr('id').substring(2));
});
$(document).on("click", 'a.comment-markup', function(event) {
event.preventDefault();
toggleCommentMarkupBox($(this).attr('id').substring(2));
});
}
/**
* Set comp, which is a comparator function used for sorting and
* inserting comments into the list.
*/
function setComparator() {
// If the first three letters are "asc", sort in ascending order
// and remove the prefix.
if (by.substring(0,3) == 'asc') {
var i = by.substring(3);
comp = function(a, b) { return a[i] - b[i]; };
} else {
// Otherwise sort in descending order.
comp = function(a, b) { return b[by] - a[by]; };
}
// Reset link styles and format the selected sort option.
$('a.sel').attr('href', '#').removeClass('sel');
$('a.by' + by).removeAttr('href').addClass('sel');
}
/**
* Create a comp function. If the user has preferences stored in
* the sortBy cookie, use those, otherwise use the default.
*/
function initComparator() {
by = 'rating'; // Default to sort by rating.
// If the sortBy cookie is set, use that instead.
if (document.cookie.length > 0) {
var start = document.cookie.indexOf('sortBy=');
if (start != -1) {
start = start + 7;
var end = document.cookie.indexOf(";", start);
if (end == -1) {
end = document.cookie.length;
by = unescape(document.cookie.substring(start, end));
}
}
}
setComparator();
}
/**
* Show a comment div.
*/
function show(id) {
$('#ao' + id).hide();
$('#ah' + id).show();
var context = $.extend({id: id}, opts);
var popup = $(renderTemplate(popupTemplate, context)).hide();
popup.find('textarea[name="proposal"]').hide();
popup.find('a.by' + by).addClass('sel');
var form = popup.find('#cf' + id);
form.submit(function(event) {
event.preventDefault();
addComment(form);
});
$('#s' + id).after(popup);
popup.slideDown('fast', function() {
getComments(id);
});
}
/**
* Hide a comment div.
*/
function hide(id) {
$('#ah' + id).hide();
$('#ao' + id).show();
var div = $('#sc' + id);
div.slideUp('fast', function() {
div.remove();
});
}
/**
* Perform an ajax request to get comments for a node
* and insert the comments into the comments tree.
*/
function getComments(id) {
$.ajax({
type: 'GET',
url: opts.getCommentsURL,
data: {node: id},
success: function(data, textStatus, request) {
var ul = $('#cl' + id);
var speed = 100;
$('#cf' + id)
.find('textarea[name="proposal"]')
.data('source', data.source);
if (data.comments.length === 0) {
ul.html('<li>No comments yet.</li>');
ul.data('empty', true);
} else {
// If there are comments, sort them and put them in the list.
var comments = sortComments(data.comments);
speed = data.comments.length * 100;
appendComments(comments, ul);
ul.data('empty', false);
}
$('#cn' + id).slideUp(speed + 200);
ul.slideDown(speed);
},
error: function(request, textStatus, error) {
showError('Oops, there was a problem retrieving the comments.');
},
dataType: 'json'
});
}
/**
* Add a comment via ajax and insert the comment into the comment tree.
*/
function addComment(form) {
var node_id = form.find('input[name="node"]').val();
var parent_id = form.find('input[name="parent"]').val();
var text = form.find('textarea[name="comment"]').val();
var proposal = form.find('textarea[name="proposal"]').val();
if (text == '') {
showError('Please enter a comment.');
return;
}
// Disable the form that is being submitted.
form.find('textarea,input').attr('disabled', 'disabled');
// Send the comment to the server.
$.ajax({
type: "POST",
url: opts.addCommentURL,
dataType: 'json',
data: {
node: node_id,
parent: parent_id,
text: text,
proposal: proposal
},
success: function(data, textStatus, error) {
// Reset the form.
if (node_id) {
hideProposeChange(node_id);
}
form.find('textarea')
.val('')
.add(form.find('input'))
.removeAttr('disabled');
var ul = $('#cl' + (node_id || parent_id));
if (ul.data('empty')) {
$(ul).empty();
ul.data('empty', false);
}
insertComment(data.comment);
var ao = $('#ao' + node_id);
ao.find('img').attr({'src': opts.commentBrightImage});
if (node_id) {
// if this was a "root" comment, remove the commenting box
// (the user can get it back by reopening the comment popup)
$('#ca' + node_id).slideUp();
}
},
error: function(request, textStatus, error) {
form.find('textarea,input').removeAttr('disabled');
showError('Oops, there was a problem adding the comment.');
}
});
}
/**
* Recursively append comments to the main comment list and children
* lists, creating the comment tree.
*/
function appendComments(comments, ul) {
$.each(comments, function() {
var div = createCommentDiv(this);
ul.append($(document.createElement('li')).html(div));
appendComments(this.children, div.find('ul.comment-children'));
// To avoid stagnating data, don't store the comments children in data.
this.children = null;
div.data('comment', this);
});
}
/**
* After adding a new comment, it must be inserted in the correct
* location in the comment tree.
*/
function insertComment(comment) {
var div = createCommentDiv(comment);
// To avoid stagnating data, don't store the comments children in data.
comment.children = null;
div.data('comment', comment);
var ul = $('#cl' + (comment.node || comment.parent));
var siblings = getChildren(ul);
var li = $(document.createElement('li'));
li.hide();
// Determine where in the parents children list to insert this comment.
for(i=0; i < siblings.length; i++) {
if (comp(comment, siblings[i]) <= 0) {
$('#cd' + siblings[i].id)
.parent()
.before(li.html(div));
li.slideDown('fast');
return;
}
}
// If we get here, this comment rates lower than all the others,
// or it is the only comment in the list.
ul.append(li.html(div));
li.slideDown('fast');
}
function acceptComment(id) {
$.ajax({
type: 'POST',
url: opts.acceptCommentURL,
data: {id: id},
success: function(data, textStatus, request) {
$('#cm' + id).fadeOut('fast');
$('#cd' + id).removeClass('moderate');
},
error: function(request, textStatus, error) {
showError('Oops, there was a problem accepting the comment.');
}
});
}
function deleteComment(id) {
$.ajax({
type: 'POST',
url: opts.deleteCommentURL,
data: {id: id},
success: function(data, textStatus, request) {
var div = $('#cd' + id);
if (data == 'delete') {
// Moderator mode: remove the comment and all children immediately
div.slideUp('fast', function() {
div.remove();
});
return;
}
// User mode: only mark the comment as deleted
div
.find('span.user-id:first')
.text('[deleted]').end()
.find('div.comment-text:first')
.text('[deleted]').end()
.find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id +
', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id)
.remove();
var comment = div.data('comment');
comment.username = '[deleted]';
comment.text = '[deleted]';
div.data('comment', comment);
},
error: function(request, textStatus, error) {
showError('Oops, there was a problem deleting the comment.');
}
});
}
function showProposal(id) {
$('#sp' + id).hide();
$('#hp' + id).show();
$('#pr' + id).slideDown('fast');
}
function hideProposal(id) {
$('#hp' + id).hide();
$('#sp' + id).show();
$('#pr' + id).slideUp('fast');
}
function showProposeChange(id) {
$('#pc' + id).hide();
$('#hc' + id).show();
var textarea = $('#pt' + id);
textarea.val(textarea.data('source'));
$.fn.autogrow.resize(textarea[0]);
textarea.slideDown('fast');
}
function hideProposeChange(id) {
$('#hc' + id).hide();
$('#pc' + id).show();
var textarea = $('#pt' + id);
textarea.val('').removeAttr('disabled');
textarea.slideUp('fast');
}
function toggleCommentMarkupBox(id) {
$('#mb' + id).toggle();
}
/** Handle when the user clicks on a sort by link. */
function handleReSort(link) {
var classes = link.attr('class').split(/\s+/);
for (var i=0; i<classes.length; i++) {
if (classes[i] != 'sort-option') {
by = classes[i].substring(2);
}
}
setComparator();
// Save/update the sortBy cookie.
var expiration = new Date();
expiration.setDate(expiration.getDate() + 365);
document.cookie= 'sortBy=' + escape(by) +
';expires=' + expiration.toUTCString();
$('ul.comment-ul').each(function(index, ul) {
var comments = getChildren($(ul), true);
comments = sortComments(comments);
appendComments(comments, $(ul).empty());
});
}
/**
* Function to process a vote when a user clicks an arrow.
*/
function handleVote(link) {
if (!opts.voting) {
showError("You'll need to login to vote.");
return;
}
var id = link.attr('id');
if (!id) {
// Didn't click on one of the voting arrows.
return;
}
// If it is an unvote, the new vote value is 0,
// Otherwise it's 1 for an upvote, or -1 for a downvote.
var value = 0;
if (id.charAt(1) != 'u') {
value = id.charAt(0) == 'u' ? 1 : -1;
}
// The data to be sent to the server.
var d = {
comment_id: id.substring(2),
value: value
};
// Swap the vote and unvote links.
link.hide();
$('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
.show();
// The div the comment is displayed in.
var div = $('div#cd' + d.comment_id);
var data = div.data('comment');
// If this is not an unvote, and the other vote arrow has
// already been pressed, unpress it.
if ((d.value !== 0) && (data.vote === d.value * -1)) {
$('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
$('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
}
// Update the comments rating in the local data.
data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
data.vote = d.value;
div.data('comment', data);
// Change the rating text.
div.find('.rating:first')
.text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));
// Send the vote information to the server.
$.ajax({
type: "POST",
url: opts.processVoteURL,
data: d,
error: function(request, textStatus, error) {
showError('Oops, there was a problem casting that vote.');
}
});
}
/**
* Open a reply form used to reply to an existing comment.
*/
function openReply(id) {
// Swap out the reply link for the hide link
$('#rl' + id).hide();
$('#cr' + id).show();
// Add the reply li to the children ul.
var div = $(renderTemplate(replyTemplate, {id: id})).hide();
$('#cl' + id)
.prepend(div)
// Setup the submit handler for the reply form.
.find('#rf' + id)
.submit(function(event) {
event.preventDefault();
addComment($('#rf' + id));
closeReply(id);
})
.find('input[type=button]')
.click(function() {
closeReply(id);
});
div.slideDown('fast', function() {
$('#rf' + id).find('textarea').focus();
});
}
/**
* Close the reply form opened with openReply.
*/
function closeReply(id) {
// Remove the reply div from the DOM.
$('#rd' + id).slideUp('fast', function() {
$(this).remove();
});
// Swap out the hide link for the reply link
$('#cr' + id).hide();
$('#rl' + id).show();
}
/**
* Recursively sort a tree of comments using the comp comparator.
*/
function sortComments(comments) {
comments.sort(comp);
$.each(comments, function() {
this.children = sortComments(this.children);
});
return comments;
}
/**
* Get the children comments from a ul. If recursive is true,
* recursively include childrens' children.
*/
function getChildren(ul, recursive) {
var children = [];
ul.children().children("[id^='cd']")
.each(function() {
var comment = $(this).data('comment');
if (recursive)
comment.children = getChildren($(this).find('#cl' + comment.id), true);
children.push(comment);
});
return children;
}
/** Create a div to display a comment in. */
function createCommentDiv(comment) {
if (!comment.displayed && !opts.moderator) {
return $('<div class="moderate">Thank you! Your comment will show up '
+ 'once it is has been approved by a moderator.</div>');
}
// Prettify the comment rating.
comment.pretty_rating = comment.rating + ' point' +
(comment.rating == 1 ? '' : 's');
// Make a class (for displaying not yet moderated comments differently)
comment.css_class = comment.displayed ? '' : ' moderate';
// Create a div for this comment.
var context = $.extend({}, opts, comment);
var div = $(renderTemplate(commentTemplate, context));
// If the user has voted on this comment, highlight the correct arrow.
if (comment.vote) {
var direction = (comment.vote == 1) ? 'u' : 'd';
div.find('#' + direction + 'v' + comment.id).hide();
div.find('#' + direction + 'u' + comment.id).show();
}
if (opts.moderator || comment.text != '[deleted]') {
div.find('a.reply').show();
if (comment.proposal_diff)
div.find('#sp' + comment.id).show();
if (opts.moderator && !comment.displayed)
div.find('#cm' + comment.id).show();
if (opts.moderator || (opts.username == comment.username))
div.find('#dc' + comment.id).show();
}
return div;
}
/**
* A simple template renderer. Placeholders such as <%id%> are replaced
* by context['id'] with items being escaped. Placeholders such as <#id#>
* are not escaped.
*/
function renderTemplate(template, context) {
var esc = $(document.createElement('div'));
function handle(ph, escape) {
var cur = context;
$.each(ph.split('.'), function() {
cur = cur[this];
});
return escape ? esc.text(cur || "").html() : cur;
}
return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
return handle(arguments[2], arguments[1] == '%' ? true : false);
});
}
/** Flash an error message briefly. */
function showError(message) {
$(document.createElement('div')).attr({'class': 'popup-error'})
.append($(document.createElement('div'))
.attr({'class': 'error-message'}).text(message))
.appendTo('body')
.fadeIn("slow")
.delay(2000)
.fadeOut("slow");
}
/** Add a link the user uses to open the comments popup. */
$.fn.comment = function() {
return this.each(function() {
var id = $(this).attr('id').substring(1);
var count = COMMENT_METADATA[id];
var title = count + ' comment' + (count == 1 ? '' : 's');
var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
var addcls = count == 0 ? ' nocomment' : '';
$(this)
.append(
$(document.createElement('a')).attr({
href: '#',
'class': 'sphinx-comment-open' + addcls,
id: 'ao' + id
})
.append($(document.createElement('img')).attr({
src: image,
alt: 'comment',
title: title
}))
.click(function(event) {
event.preventDefault();
show($(this).attr('id').substring(2));
})
)
.append(
$(document.createElement('a')).attr({
href: '#',
'class': 'sphinx-comment-close hidden',
id: 'ah' + id
})
.append($(document.createElement('img')).attr({
src: opts.closeCommentImage,
alt: 'close',
title: 'close'
}))
.click(function(event) {
event.preventDefault();
hide($(this).attr('id').substring(2));
})
);
});
};
var opts = {
processVoteURL: '/_process_vote',
addCommentURL: '/_add_comment',
getCommentsURL: '/_get_comments',
acceptCommentURL: '/_accept_comment',
deleteCommentURL: '/_delete_comment',
commentImage: '/static/_static/comment.png',
closeCommentImage: '/static/_static/comment-close.png',
loadingImage: '/static/_static/ajax-loader.gif',
commentBrightImage: '/static/_static/comment-bright.png',
upArrow: '/static/_static/up.png',
downArrow: '/static/_static/down.png',
upArrowPressed: '/static/_static/up-pressed.png',
downArrowPressed: '/static/_static/down-pressed.png',
voting: false,
moderator: false
};
if (typeof COMMENT_OPTIONS != "undefined") {
opts = jQuery.extend(opts, COMMENT_OPTIONS);
}
var popupTemplate = '\
<div class="sphinx-comments" id="sc<%id%>">\
<p class="sort-options">\
Sort by:\
<a href="#" class="sort-option byrating">best rated</a>\
<a href="#" class="sort-option byascage">newest</a>\
<a href="#" class="sort-option byage">oldest</a>\
</p>\
<div class="comment-header">Comments</div>\
<div class="comment-loading" id="cn<%id%>">\
loading comments... <img src="<%loadingImage%>" alt="" /></div>\
<ul id="cl<%id%>" class="comment-ul"></ul>\
<div id="ca<%id%>">\
<p class="add-a-comment">Add a comment\
(<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
<div class="comment-markup-box" id="mb<%id%>">\
reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
<code>``code``</code>, \
code blocks: <code>::</code> and an indented block after blank line</div>\
<form method="post" id="cf<%id%>" class="comment-form" action="">\
<textarea name="comment" cols="80"></textarea>\
<p class="propose-button">\
<a href="#" id="pc<%id%>" class="show-propose-change">\
Propose a change &#9657;\
</a>\
<a href="#" id="hc<%id%>" class="hide-propose-change">\
Propose a change &#9663;\
</a>\
</p>\
<textarea name="proposal" id="pt<%id%>" cols="80"\
spellcheck="false"></textarea>\
<input type="submit" value="Add comment" />\
<input type="hidden" name="node" value="<%id%>" />\
<input type="hidden" name="parent" value="" />\
</form>\
</div>\
</div>';
var commentTemplate = '\
<div id="cd<%id%>" class="sphinx-comment<%css_class%>">\
<div class="vote">\
<div class="arrow">\
<a href="#" id="uv<%id%>" class="vote" title="vote up">\
<img src="<%upArrow%>" />\
</a>\
<a href="#" id="uu<%id%>" class="un vote" title="vote up">\
<img src="<%upArrowPressed%>" />\
</a>\
</div>\
<div class="arrow">\
<a href="#" id="dv<%id%>" class="vote" title="vote down">\
<img src="<%downArrow%>" id="da<%id%>" />\
</a>\
<a href="#" id="du<%id%>" class="un vote" title="vote down">\
<img src="<%downArrowPressed%>" />\
</a>\
</div>\
</div>\
<div class="comment-content">\
<p class="tagline comment">\
<span class="user-id"><%username%></span>\
<span class="rating"><%pretty_rating%></span>\
<span class="delta"><%time.delta%></span>\
</p>\
<div class="comment-text comment"><#text#></div>\
<p class="comment-opts comment">\
<a href="#" class="reply hidden" id="rl<%id%>">reply &#9657;</a>\
<a href="#" class="close-reply" id="cr<%id%>">reply &#9663;</a>\
<a href="#" id="sp<%id%>" class="show-proposal">proposal &#9657;</a>\
<a href="#" id="hp<%id%>" class="hide-proposal">proposal &#9663;</a>\
<a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\
<span id="cm<%id%>" class="moderation hidden">\
<a href="#" id="ac<%id%>" class="accept-comment">accept</a>\
</span>\
</p>\
<pre class="proposal" id="pr<%id%>">\
<#proposal_diff#>\
</pre>\
<ul class="comment-children" id="cl<%id%>"></ul>\
</div>\
<div class="clearleft"></div>\
</div>\
</div>';
var replyTemplate = '\
<li>\
<div class="reply-div" id="rd<%id%>">\
<form id="rf<%id%>">\
<textarea name="comment" cols="80"></textarea>\
<input type="submit" value="Add reply" />\
<input type="button" value="Cancel" />\
<input type="hidden" name="parent" value="<%id%>" />\
<input type="hidden" name="node" value="" />\
</form>\
</div>\
</li>';
$(document).ready(function() {
init();
});
})(jQuery);
$(document).ready(function() {
// add comment anchors for all paragraphs that are commentable
$('.sphinx-has-comment').comment();
// highlight search words in search results
$("div.context").each(function() {
var params = $.getQueryParameters();
var terms = (params.q) ? params.q[0].split(/\s+/) : [];
var result = $(this);
$.each(terms, function() {
result.highlightText(this.toLowerCase(), 'highlighted');
});
});
// directly open comment window if requested
var anchor = document.location.hash;
if (anchor.substring(0, 9) == '#comment-') {
$('#ao' + anchor.substring(9)).click();
document.location.hash = '#s' + anchor.substring(9);
}
});

View File

@ -1,186 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bookmarks &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="User management" href="privileges.html" />
<link rel="prev" title="Transformations" href="transformations.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="privileges.html" title="User management"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="transformations.html" title="Transformations"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="bookmarks">
<span id="id1"></span><h1>Bookmarks<a class="headerlink" href="#bookmarks" title="Permalink to this headline"></a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You need to have configured the <a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> for using bookmarks
feature.</p>
</div>
<div class="section" id="storing-bookmarks">
<h2>Storing bookmarks<a class="headerlink" href="#storing-bookmarks" title="Permalink to this headline"></a></h2>
<p>Any query you have executed can be stored as a bookmark on the page
where the results are displayed. You will find a button labeled
<span class="guilabel">Bookmark this query</span> just at the end of the page. As soon as you have
stored a bookmark, it is related to the database you run the query on.
You can now access a bookmark dropdown on each page, the query box
appears on for that database.</p>
</div>
<div class="section" id="variables-inside-bookmarks">
<h2>Variables inside bookmarks<a class="headerlink" href="#variables-inside-bookmarks" title="Permalink to this headline"></a></h2>
<p>You can also have, inside the query, placeholders for variables.
This is done by inserting into the query SQL comments between <code class="docutils literal"><span class="pre">/*</span></code> and
<code class="docutils literal"><span class="pre">*/</span></code>. Inside the comments, the special strings <code class="docutils literal"><span class="pre">[VARIABLE{variable-number}]</span></code> is used.
Be aware that the whole query minus the SQL comments must be
valid by itself, otherwise you won&#8217;t be able to store it as a bookmark.
Note also that the text &#8216;VARIABLE&#8217; is case-sensitive.</p>
<p>When you execute the bookmark, everything typed into the <em>Variables</em>
input boxes on the query box page will replace the strings <code class="docutils literal"><span class="pre">/*[VARIABLE{variable-number}]*/</span></code> in
your stored query.</p>
<p>Also remember, that everything else inside the <code class="docutils literal"><span class="pre">/*[VARIABLE{variable-number}]*/</span></code> string for
your query will remain the way it is, but will be stripped of the <code class="docutils literal"><span class="pre">/**/</span></code>
chars. So you can use:</p>
<div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="cm">/*, [VARIABLE1] AS myname */</span>
</pre></div>
</div>
<p>which will be expanded to</p>
<div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="p">,</span> <span class="n">VARIABLE1</span> <span class="k">as</span> <span class="n">myname</span>
</pre></div>
</div>
<p>in your query, where VARIABLE1 is the string you entered in the Variable 1 input box.</p>
<p>A more complex example. Say you have stored
this query:</p>
<div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="k">SELECT</span> <span class="n">Name</span><span class="p">,</span> <span class="n">Address</span> <span class="k">FROM</span> <span class="n">addresses</span> <span class="k">WHERE</span> <span class="mi">1</span> <span class="cm">/* AND Name LIKE &#39;%[VARIABLE1]%&#39; */</span>
</pre></div>
</div>
<p>Say, you now enter &#8220;phpMyAdmin&#8221; as the variable for the stored query, the full
query will be:</p>
<div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="k">SELECT</span> <span class="n">Name</span><span class="p">,</span> <span class="n">Address</span> <span class="k">FROM</span> <span class="n">addresses</span> <span class="k">WHERE</span> <span class="mi">1</span> <span class="k">AND</span> <span class="n">Name</span> <span class="k">LIKE</span> <span class="s1">&#39;%phpMyAdmin%&#39;</span>
</pre></div>
</div>
<p><strong>NOTE THE ABSENCE OF SPACES</strong> inside the <code class="docutils literal"><span class="pre">/**/</span></code> construct. Any spaces
inserted there will be later also inserted as spaces in your query and may lead
to unexpected results especially when using the variable expansion inside of a
&#8220;LIKE &#8216;&#8217;&#8221; expression.</p>
</div>
<div class="section" id="browsing-table-using-bookmark">
<h2>Browsing table using bookmark<a class="headerlink" href="#browsing-table-using-bookmark" title="Permalink to this headline"></a></h2>
<p>When bookmark is named same as table, it will be used as query when browsing
this table.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="faq.html#faqbookmark"><span class="std std-ref">6.18 Bookmarks: Where can I store bookmarks? Why can&#8217;t I see any bookmarks below the query box? What are these variables for?</span></a>,
<a class="reference internal" href="faq.html#faq6-22"><span class="std std-ref">6.22 Bookmarks: Can I execute a default bookmark automatically when entering Browse mode for a table?</span></a></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Bookmarks</a><ul>
<li><a class="reference internal" href="#storing-bookmarks">Storing bookmarks</a></li>
<li><a class="reference internal" href="#variables-inside-bookmarks">Variables inside bookmarks</a></li>
<li><a class="reference internal" href="#browsing-table-using-bookmark">Browsing table using bookmark</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="transformations.html"
title="previous chapter">Transformations</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="privileges.html"
title="next chapter">User management</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/bookmarks.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="privileges.html" title="User management"
>next</a> |</li>
<li class="right" >
<a href="transformations.html" title="Transformations"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,300 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Charts &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Import and export" href="import_export.html" />
<link rel="prev" title="Relations" href="relations.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="import_export.html" title="Import and export"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="relations.html" title="Relations"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="charts">
<span id="id1"></span><h1>Charts<a class="headerlink" href="#charts" title="Permalink to this headline"></a></h1>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.4.0.</span></p>
</div>
<p>Since phpMyAdmin version 3.4.0, you can easily generate charts from a SQL query
by clicking the &#8220;Display chart&#8221; link in the &#8220;Query results operations&#8221; area.</p>
<img alt="_images/query_result_operations.png" src="_images/query_result_operations.png" />
<p>A window layer &#8220;Display chart&#8221; is shown in which you can customize the chart with the following options.</p>
<ul class="simple">
<li>Chart type: Allows you choose the type of the chart. Supported types are bar charts, column charts, line charts, spline charts, area charts, pie charts and timeline charts (only the chart types applicable for current series selection are offered).</li>
<li>X-axis: Allows to choose the field for the main axis.</li>
<li>Series: Allows to choose series for the chart. You can choose multiple series.</li>
<li>Title: Allows specifying a title for the chart which is displayed above the chart.</li>
<li>X-axis and Y-axis labels: Allows specifying labels for axes.</li>
<li>Start row and number of rows: Allows generating charts only for a specified number of rows of the results set.</li>
</ul>
<img alt="_images/chart.png" src="_images/chart.png" />
<div class="section" id="chart-implementation">
<h2>Chart implementation<a class="headerlink" href="#chart-implementation" title="Permalink to this headline"></a></h2>
<p>Charts in phpMyAdmin are drawn using <a class="reference external" href="http://www.jqplot.com/">jqPlot</a> jQuery library.</p>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="section" id="pie-chart">
<h3>Pie chart<a class="headerlink" href="#pie-chart" title="Permalink to this headline"></a></h3>
<p>Query results for a simple pie chart can be generated with:</p>
<div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="k">SELECT</span> <span class="s1">&#39;Food&#39;</span> <span class="k">AS</span> <span class="s1">&#39;expense&#39;</span><span class="p">,</span>
<span class="mi">1250</span> <span class="k">AS</span> <span class="s1">&#39;amount&#39;</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="s1">&#39;Accommodation&#39;</span><span class="p">,</span> <span class="mi">500</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="s1">&#39;Travel&#39;</span><span class="p">,</span> <span class="mi">720</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="s1">&#39;Misc&#39;</span><span class="p">,</span> <span class="mi">220</span>
</pre></div>
</div>
<p>And the result of this query is:</p>
<table border="1" class="docutils">
<colgroup>
<col width="65%" />
<col width="35%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">expense</th>
<th class="head">amount</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>Food</td>
<td>1250</td>
</tr>
<tr class="row-odd"><td>Accommodation</td>
<td>500</td>
</tr>
<tr class="row-even"><td>Travel</td>
<td>720</td>
</tr>
<tr class="row-odd"><td>Misc</td>
<td>220</td>
</tr>
</tbody>
</table>
<p>Choosing expense as the X-axis and amount in series:</p>
<img alt="_images/pie_chart.png" src="_images/pie_chart.png" />
</div>
<div class="section" id="bar-and-column-chart">
<h3>Bar and column chart<a class="headerlink" href="#bar-and-column-chart" title="Permalink to this headline"></a></h3>
<p>Both bar charts and column chats support stacking. Upon selecting one of these types a checkbox is displayed to select stacking.</p>
<p>Query results for a simple bar or column chart can be generated with:</p>
<div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="k">SELECT</span>
<span class="s1">&#39;ACADEMY DINOSAUR&#39;</span> <span class="k">AS</span> <span class="s1">&#39;title&#39;</span><span class="p">,</span>
<span class="mi">0</span><span class="p">.</span><span class="mi">99</span> <span class="k">AS</span> <span class="s1">&#39;rental_rate&#39;</span><span class="p">,</span>
<span class="mi">20</span><span class="p">.</span><span class="mi">99</span> <span class="k">AS</span> <span class="s1">&#39;replacement_cost&#39;</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="s1">&#39;ACE GOLDFINGER&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">.</span><span class="mi">99</span><span class="p">,</span> <span class="mi">12</span><span class="p">.</span><span class="mi">99</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="s1">&#39;ADAPTATION HOLES&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">.</span><span class="mi">99</span><span class="p">,</span> <span class="mi">18</span><span class="p">.</span><span class="mi">99</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="s1">&#39;AFFAIR PREJUDICE&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">.</span><span class="mi">99</span><span class="p">,</span> <span class="mi">26</span><span class="p">.</span><span class="mi">99</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="s1">&#39;AFRICAN EGG&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">.</span><span class="mi">99</span><span class="p">,</span> <span class="mi">22</span><span class="p">.</span><span class="mi">99</span>
</pre></div>
</div>
<p>And the result of this query is:</p>
<table border="1" class="docutils">
<colgroup>
<col width="35%" />
<col width="27%" />
<col width="37%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">title</th>
<th class="head">rental_rate</th>
<th class="head">replacement_cost</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>ACADEMY DINOSAUR</td>
<td>0.99</td>
<td>20.99</td>
</tr>
<tr class="row-odd"><td>ACE GOLDFINGER</td>
<td>4.99</td>
<td>12.99</td>
</tr>
<tr class="row-even"><td>ADAPTATION HOLES</td>
<td>2.99</td>
<td>18.99</td>
</tr>
<tr class="row-odd"><td>AFFAIR PREJUDICE</td>
<td>2.99</td>
<td>26.99</td>
</tr>
<tr class="row-even"><td>AFRICAN EGG</td>
<td>2.99</td>
<td>22.99</td>
</tr>
</tbody>
</table>
<p>Choosing title as the X-axis and rental_rate and replacement_cost as series:</p>
<img alt="_images/column_chart.png" src="_images/column_chart.png" />
</div>
<div class="section" id="scatter-chart">
<h3>Scatter chart<a class="headerlink" href="#scatter-chart" title="Permalink to this headline"></a></h3>
<p>Scatter charts are useful in identifying the movement of one or more variable(s) compared to another variable.</p>
<p>Using the same data set from bar and column charts section and choosing replacement_cost as the X-axis and rental_rate in series:</p>
<img alt="_images/scatter_chart.png" src="_images/scatter_chart.png" />
</div>
<div class="section" id="line-spline-and-timeline-charts">
<h3>Line, spline and timeline charts<a class="headerlink" href="#line-spline-and-timeline-charts" title="Permalink to this headline"></a></h3>
<p>These charts can be used to illustrate trends in underlying data. Spline charts draw smooth lines while timeline charts draw X-axis taking the distances between the dates/time into consideration.</p>
<p>Query results for a simple line, spline or timeline chart can be generated with:</p>
<div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="k">SELECT</span>
<span class="kt">DATE</span><span class="p">(</span><span class="s1">&#39;2006-01-08&#39;</span><span class="p">)</span> <span class="k">AS</span> <span class="s1">&#39;date&#39;</span><span class="p">,</span>
<span class="mi">2056</span> <span class="k">AS</span> <span class="s1">&#39;revenue&#39;</span><span class="p">,</span>
<span class="mi">1378</span> <span class="k">AS</span> <span class="s1">&#39;cost&#39;</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="kt">DATE</span><span class="p">(</span><span class="s1">&#39;2006-01-09&#39;</span><span class="p">),</span> <span class="mi">1898</span><span class="p">,</span> <span class="mi">2301</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="kt">DATE</span><span class="p">(</span><span class="s1">&#39;2006-01-15&#39;</span><span class="p">),</span> <span class="mi">1560</span><span class="p">,</span> <span class="mi">600</span> <span class="k">UNION</span>
<span class="k">SELECT</span> <span class="kt">DATE</span><span class="p">(</span><span class="s1">&#39;2006-01-17&#39;</span><span class="p">),</span> <span class="mi">3457</span><span class="p">,</span> <span class="mi">1565</span>
</pre></div>
</div>
<p>And the result of this query is:</p>
<table border="1" class="docutils">
<colgroup>
<col width="44%" />
<col width="33%" />
<col width="22%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">date</th>
<th class="head">revenue</th>
<th class="head">cost</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>2016-01-08</td>
<td>2056</td>
<td>1378</td>
</tr>
<tr class="row-odd"><td>2006-01-09</td>
<td>1898</td>
<td>2301</td>
</tr>
<tr class="row-even"><td>2006-01-15</td>
<td>1560</td>
<td>600</td>
</tr>
<tr class="row-odd"><td>2006-01-17</td>
<td>3457</td>
<td>1565</td>
</tr>
</tbody>
</table>
<img alt="_images/line_chart.png" src="_images/line_chart.png" />
<img alt="_images/spline_chart.png" src="_images/spline_chart.png" />
<img alt="_images/timeline_chart.png" src="_images/timeline_chart.png" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Charts</a><ul>
<li><a class="reference internal" href="#chart-implementation">Chart implementation</a></li>
<li><a class="reference internal" href="#examples">Examples</a><ul>
<li><a class="reference internal" href="#pie-chart">Pie chart</a></li>
<li><a class="reference internal" href="#bar-and-column-chart">Bar and column chart</a></li>
<li><a class="reference internal" href="#scatter-chart">Scatter chart</a></li>
<li><a class="reference internal" href="#line-spline-and-timeline-charts">Line, spline and timeline charts</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="relations.html"
title="previous chapter">Relations</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="import_export.html"
title="next chapter">Import and export</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/charts.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="import_export.html" title="Import and export"
>next</a> |</li>
<li class="right" >
<a href="relations.html" title="Relations"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,151 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Copyright &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="#" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="next" title="Credits" href="credits.html" />
<link rel="prev" title="Distributing and packaging phpMyAdmin" href="vendors.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="credits.html" title="Credits"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="vendors.html" title="Distributing and packaging phpMyAdmin"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="copyright">
<span id="id1"></span><h1>Copyright<a class="headerlink" href="#copyright" title="Permalink to this headline"></a></h1>
<div class="highlight-none"><div class="highlight"><pre><span></span>Copyright (C) 1998-2000 Tobias Ratschiller &lt;tobias_at_ratschiller.com&gt;
Copyright (C) 2001-2018 Marc Delisle &lt;marc_at_infomarc.info&gt;
Olivier Müller &lt;om_at_omnis.ch&gt;
Robin Johnson &lt;robbat2_at_users.sourceforge.net&gt;
Alexander M. Turek &lt;me_at_derrabus.de&gt;
Michal Čihař &lt;michal_at_cihar.com&gt;
Garvin Hicking &lt;me_at_supergarv.de&gt;
Michael Keck &lt;mkkeck_at_users.sourceforge.net&gt;
Sebastian Mendel &lt;cybot_tm_at_users.sourceforge.net&gt;
[check credits for more details]
</pre></div>
</div>
<p>This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2, as
published by the Free Software Foundation.</p>
<p>This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;<a class="reference external" href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>&gt;.</p>
<div class="section" id="third-party-licenses">
<h2>Third party licenses<a class="headerlink" href="#third-party-licenses" title="Permalink to this headline"></a></h2>
<p>phpMyAdmin includes several third party libraries which come under their
respective licenses.</p>
<p>jQuery&#8217;s license, which is where we got the files under js/vendor/jquery/ is
(MIT|GPL), a copy of each license is available in this repository (GPL
is available as LICENSE, MIT as js/vendor/jquery/MIT-LICENSE.txt).</p>
<p>The download kit additionally includes several composer libraries. See their
licensing information in the vendor/ directory.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Copyright</a><ul>
<li><a class="reference internal" href="#third-party-licenses">Third party licenses</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="vendors.html"
title="previous chapter">Distributing and packaging phpMyAdmin</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="credits.html"
title="next chapter">Credits</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/copyright.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="credits.html" title="Credits"
>next</a> |</li>
<li class="right" >
<a href="vendors.html" title="Distributing and packaging phpMyAdmin"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="#">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Developers Information &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="next" title="Security policy" href="security.html" />
<link rel="prev" title="FAQ - Frequently Asked Questions" href="faq.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="security.html" title="Security policy"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="faq.html" title="FAQ - Frequently Asked Questions"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="developers-information">
<span id="developers"></span><h1>Developers Information<a class="headerlink" href="#developers-information" title="Permalink to this headline"></a></h1>
<p>phpMyAdmin is Open Source, so you&#8217;re invited to contribute to it. Many
great features have been written by other people and you too can help
to make phpMyAdmin a useful tool.</p>
<p>You can check out all the possibilities to contribute in the
<a class="reference external" href="https://www.phpmyadmin.net/contribute/">contribute section on our website</a>.</p>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="faq.html"
title="previous chapter">FAQ - Frequently Asked Questions</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="security.html"
title="next chapter">Security policy</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/developers.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="security.html" title="Security policy"
>next</a> |</li>
<li class="right" >
<a href="faq.html" title="FAQ - Frequently Asked Questions"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,638 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Glossary &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="prev" title="Credits" href="credits.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="credits.html" title="Credits"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="glossary">
<span id="id1"></span><h1>Glossary<a class="headerlink" href="#glossary" title="Permalink to this headline"></a></h1>
<p>From Wikipedia, the free encyclopedia</p>
<dl class="glossary docutils">
<dt id="term-htaccess">.htaccess</dt>
<dd><p class="first">the default name of Apache&#8217;s directory-level configuration file.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/.htaccess">https://en.wikipedia.org/wiki/.htaccess</a>&gt;</p>
</div>
</dd>
<dt id="term-acl">ACL</dt>
<dd>Access Contol List</dd>
<dt id="term-blowfish">Blowfish</dt>
<dd><p class="first">a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Blowfish_(cipher)">https://en.wikipedia.org/wiki/Blowfish_(cipher)</a>&gt;</p>
</div>
</dd>
<dt id="term-browser">Browser</dt>
<dd><p class="first">a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Web_browser">https://en.wikipedia.org/wiki/Web_browser</a>&gt;</p>
</div>
</dd>
<dt id="term-bzip2">bzip2</dt>
<dd><p class="first">a free software/open source data compression algorithm and program developed by Julian Seward.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Bzip2">https://en.wikipedia.org/wiki/Bzip2</a>&gt;</p>
</div>
</dd>
<dt id="term-cgi">CGI</dt>
<dd><p class="first">Common Gateway Interface is an important World Wide Web technology that
enables a client web browser to request data from a program executed on
the Web server.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Common_Gateway_Interface">https://en.wikipedia.org/wiki/Common_Gateway_Interface</a>&gt;</p>
</div>
</dd>
<dt id="term-changelog">Changelog</dt>
<dd><p class="first">a log or record of changes made to a project.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Changelog">https://en.wikipedia.org/wiki/Changelog</a>&gt;</p>
</div>
</dd>
<dt id="term-client">Client</dt>
<dd><p class="first">a computer system that accesses a (remote) service on another computer by some kind of network.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Client_(computing)">https://en.wikipedia.org/wiki/Client_(computing)</a>&gt;</p>
</div>
</dd>
<dt id="term-column">column</dt>
<dd><p class="first">a set of data values of a particular simple type, one for each row of the table.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Column_(database)">https://en.wikipedia.org/wiki/Column_(database)</a>&gt;</p>
</div>
</dd>
<dt id="term-cookie">Cookie</dt>
<dd><p class="first">a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/HTTP_cookie">https://en.wikipedia.org/wiki/HTTP_cookie</a>&gt;</p>
</div>
</dd>
<dt id="term-csv">CSV</dt>
<dd><p class="first">Comma- separated values</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Comma-separated_values">https://en.wikipedia.org/wiki/Comma-separated_values</a>&gt;</p>
</div>
</dd>
<dt id="term-db">DB</dt>
<dd>look at <a class="reference internal" href="#term-database"><span class="xref std std-term">database</span></a></dd>
<dt id="term-database">database</dt>
<dd><p class="first">an organized collection of data.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Database">https://en.wikipedia.org/wiki/Database</a>&gt;</p>
</div>
</dd>
<dt id="term-engine">Engine</dt>
<dd>look at <a class="reference internal" href="#term-storage-engines"><span class="xref std std-term">storage engines</span></a></dd>
<dt id="term-extension">extension</dt>
<dd><p class="first">a PHP module that extends PHP with additional functionality.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Software_extension">https://en.wikipedia.org/wiki/Software_extension</a>&gt;</p>
</div>
</dd>
<dt id="term-faq">FAQ</dt>
<dd><p class="first">Frequently Asked Questions is a list of commonly asked question and there
answers.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/FAQ">https://en.wikipedia.org/wiki/FAQ</a>&gt;</p>
</div>
</dd>
<dt id="term-field">Field</dt>
<dd><p class="first">one part of divided data/columns.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Field_(computer_science)">https://en.wikipedia.org/wiki/Field_(computer_science)</a>&gt;</p>
</div>
</dd>
<dt id="term-foreign-key">foreign key</dt>
<dd><p class="first">a column or group of columns in a database row that point to a key column
or group of columns forming a key of another database row in some
(usually different) table.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Foreign_key">https://en.wikipedia.org/wiki/Foreign_key</a>&gt;</p>
</div>
</dd>
<dt id="term-gd">GD</dt>
<dd><p class="first">Graphics Library by Thomas Boutell and others for dynamically manipulating images.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/GD_Graphics_Library">https://en.wikipedia.org/wiki/GD_Graphics_Library</a>&gt;</p>
</div>
</dd>
<dt id="term-gd2">GD2</dt>
<dd>look at <a class="reference internal" href="#term-gd"><span class="xref std std-term">gd</span></a></dd>
<dt id="term-gzip">gzip</dt>
<dd><p class="first">gzip is short for GNU zip, a GNU free software file compression program.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Gzip">https://en.wikipedia.org/wiki/Gzip</a>&gt;</p>
</div>
</dd>
<dt id="term-host">host</dt>
<dd><p class="first">any machine connected to a computer network, a node that has a hostname.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Host">https://en.wikipedia.org/wiki/Host</a>&gt;</p>
</div>
</dd>
<dt id="term-hostname">hostname</dt>
<dd><p class="first">the unique name by which a network attached device is known on a network.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Hostname">https://en.wikipedia.org/wiki/Hostname</a>&gt;</p>
</div>
</dd>
<dt id="term-http">HTTP</dt>
<dd><p class="first">HyperText Transfer Protocol is the primary method used to transfer or
convey information on the World Wide Web.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/HyperText_Transfer_Protocol">https://en.wikipedia.org/wiki/HyperText_Transfer_Protocol</a>&gt;</p>
</div>
</dd>
<dt id="term-https">https</dt>
<dd><p class="first">a <a class="reference internal" href="#term-http"><span class="xref std std-term">HTTP</span></a>-connection with additional security measures.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Https:_URI_scheme">https://en.wikipedia.org/wiki/Https:_URI_scheme</a>&gt;</p>
</div>
</dd>
<dt id="term-iec">IEC</dt>
<dd>International Electrotechnical Commission</dd>
<dt id="term-iis">IIS</dt>
<dd><p class="first">Internet Information Services is a set of Internet-based services for
servers using Microsoft Windows.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Internet_Information_Services">https://en.wikipedia.org/wiki/Internet_Information_Services</a>&gt;</p>
</div>
</dd>
<dt id="term-index">Index</dt>
<dd><p class="first">a feature that allows quick access to the rows in a table.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Index_(database)">https://en.wikipedia.org/wiki/Index_(database)</a>&gt;</p>
</div>
</dd>
<dt id="term-ip">IP</dt>
<dd><p class="first">Internet Protocol is a data-oriented protocol used by source and
destination hosts for communicating data across a packet-switched
internetwork.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Internet_Protocol">https://en.wikipedia.org/wiki/Internet_Protocol</a>&gt;</p>
</div>
</dd>
<dt id="term-ip-address">IP Address</dt>
<dd><p class="first">a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/IP_Address">https://en.wikipedia.org/wiki/IP_Address</a>&gt;</p>
</div>
</dd>
<dt id="term-ipv6">IPv6</dt>
<dd><p class="first">IPv6 (Internet Protocol version 6) is the latest revision of the
Internet Protocol (<a class="reference internal" href="#term-ip"><span class="xref std std-term">IP</span></a>), designed to deal with the
long-anticipated problem of its precedessor IPv4 running out of addresses.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/IPv6">https://en.wikipedia.org/wiki/IPv6</a>&gt;</p>
</div>
</dd>
<dt id="term-isapi">ISAPI</dt>
<dd><p class="first">Internet Server Application Programming Interface is the API of Internet Information Services (IIS).</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/ISAPI">https://en.wikipedia.org/wiki/ISAPI</a>&gt;</p>
</div>
</dd>
<dt id="term-isp">ISP</dt>
<dd><p class="first">Internet service provider is a business or organization that offers users
access to the Internet and related services.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/ISP">https://en.wikipedia.org/wiki/ISP</a>&gt;</p>
</div>
</dd>
<dt id="term-iso">ISO</dt>
<dd>International Standards Organisation</dd>
<dt id="term-jpeg">JPEG</dt>
<dd><p class="first">a most commonly used standard method of lossy compression for photographic images.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/JPEG">https://en.wikipedia.org/wiki/JPEG</a>&gt;</p>
</div>
</dd>
<dt id="term-jpg">JPG</dt>
<dd>look at <a class="reference internal" href="#term-jpeg"><span class="xref std std-term">jpeg</span></a></dd>
<dt id="term-key">Key</dt>
<dd>look at <a class="reference internal" href="#term-index"><span class="xref std std-term">index</span></a></dd>
<dt id="term-latex">LATEX</dt>
<dd><p class="first">a document preparation system for the TEX typesetting program.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/LaTeX">https://en.wikipedia.org/wiki/LaTeX</a>&gt;</p>
</div>
</dd>
<dt id="term-mac">Mac</dt>
<dd><p class="first">Apple Macintosh is line of personal computers is designed, developed, manufactured, and marketed by Apple Computer.</p>
<p class="last">. seealso:: &lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Mac">https://en.wikipedia.org/wiki/Mac</a>&gt;</p>
</dd>
<dt id="term-mac-os-x">Mac OS X</dt>
<dd><p class="first">the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Mac_OS_X">https://en.wikipedia.org/wiki/Mac_OS_X</a>&gt;</p>
</div>
</dd>
<dt id="term-mbstring">mbstring</dt>
<dd><p class="first">The PHP <cite>mbstring</cite> functions provide support for languages represented by multi-byte character sets, most notably UTF-8.</p>
<p>If you have troubles installing this extension, please follow <a class="reference internal" href="faq.html#faqmysql"><span class="std std-ref">1.20 I receive an error about missing mysqli and mysql extensions.</span></a>, it provides useful hints.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://secure.php.net/manual/en/book.mbstring.php">https://secure.php.net/manual/en/book.mbstring.php</a>&gt;</p>
</div>
</dd>
<dt id="term-mcrypt">MCrypt</dt>
<dd><p class="first">a cryptographic library.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/MCrypt">https://en.wikipedia.org/wiki/MCrypt</a>&gt;</p>
</div>
</dd>
<dt id="term-42">mcrypt</dt>
<dd><p class="first">the MCrypt PHP extension.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://secure.php.net/mcrypt">https://secure.php.net/mcrypt</a>&gt;</p>
</div>
</dd>
<dt id="term-mime">MIME</dt>
<dd><p class="first">Multipurpose Internet Mail Extensions is
an Internet Standard for the format of e-mail.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/MIME">https://en.wikipedia.org/wiki/MIME</a>&gt;</p>
</div>
</dd>
<dt id="term-module">module</dt>
<dd><p class="first">some sort of extension for the Apache Webserver.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Apache_HTTP_Server">https://en.wikipedia.org/wiki/Apache_HTTP_Server</a>&gt;</p>
</div>
</dd>
<dt id="term-mod-proxy-fcgi">mod_proxy_fcgi</dt>
<dd>an Apache module implmenting a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or
directly as an Apache module.</dd>
<dt id="term-mysql">MySQL</dt>
<dd><p class="first">a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS).</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/MySQL">https://en.wikipedia.org/wiki/MySQL</a>&gt;</p>
</div>
</dd>
<dt id="term-mysqli">mysqli</dt>
<dd><p class="first">the improved MySQL client PHP extension.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://secure.php.net/manual/en/book.mysqli.php">https://secure.php.net/manual/en/book.mysqli.php</a>&gt;</p>
</div>
</dd>
<dt id="term-48">mysql</dt>
<dd><p class="first">the MySQL client PHP extension.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://secure.php.net/manual/en/book.mysql.php">https://secure.php.net/manual/en/book.mysql.php</a>&gt;</p>
</div>
</dd>
<dt id="term-opendocument">OpenDocument</dt>
<dd><p class="first">open standard for office documents.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/OpenDocument">https://en.wikipedia.org/wiki/OpenDocument</a>&gt;</p>
</div>
</dd>
<dt id="term-os-x">OS X</dt>
<dd><p class="first">look at <a class="reference internal" href="#term-mac-os-x"><span class="xref std std-term">Mac OS X</span></a>.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/OS_X">https://en.wikipedia.org/wiki/OS_X</a>&gt;</p>
</div>
</dd>
<dt id="term-pdf">PDF</dt>
<dd><p class="first">Portable Document Format is a file format developed by Adobe Systems for
representing two dimensional documents in a device independent and
resolution independent format.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Portable_Document_Format">https://en.wikipedia.org/wiki/Portable_Document_Format</a>&gt;</p>
</div>
</dd>
<dt id="term-pear">PEAR</dt>
<dd><p class="first">the PHP Extension and Application Repository.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://pear.php.net/">https://pear.php.net/</a>&gt;</p>
</div>
</dd>
<dt id="term-pcre">PCRE</dt>
<dd><p class="first">Perl Compatible Regular Expressions is the perl-compatible regular
expression functions for PHP</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://secure.php.net/pcre">https://secure.php.net/pcre</a>&gt;</p>
</div>
</dd>
<dt id="term-php">PHP</dt>
<dd><p class="first">short for &#8220;PHP: Hypertext Preprocessor&#8221;, is an open-source, reflective
programming language used mainly for developing server-side applications
and dynamic web content, and more recently, a broader range of software
applications.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/PHP">https://en.wikipedia.org/wiki/PHP</a>&gt;</p>
</div>
</dd>
<dt id="term-port">port</dt>
<dd><p class="first">a connection through which data is sent and received.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Port_(computing)">https://en.wikipedia.org/wiki/Port_(computing)</a>&gt;</p>
</div>
</dd>
<dt id="term-primary-key">primary key</dt>
<dd><p class="first">A primary key is an index over one or more fields in a table with
unique values for each single row in this table. Every table should have
a primary key for easier accessing/identifying data in this table. There
can only be one primary key per table and it is named always <strong>PRIMARY</strong>.
In fact a primary key is just an <a class="reference internal" href="#term-unique-key"><span class="xref std std-term">unique key</span></a> with the name
<strong>PRIMARY</strong>. If no primary key is defined MySQL will use first <em>unique
key</em> as primary key if there is one.</p>
<p>You can create the primary key when creating the table (in phpMyAdmin
just check the primary key radio buttons for each field you wish to be
part of the primary key).</p>
<p class="last">You can also add a primary key to an existing table with <cite>ALTER</cite> <cite>TABLE</cite>
or <cite>CREATE</cite> <cite>INDEX</cite> (in phpMyAdmin you can just click on &#8216;add index&#8217; on
the table structure page below the listed fields).</p>
</dd>
<dt id="term-rfc">RFC</dt>
<dd><p class="first">Request for Comments (RFC) documents are a series of memoranda
encompassing new research, innovations, and methodologies applicable to
Internet technologies.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Request_for_Comments">https://en.wikipedia.org/wiki/Request_for_Comments</a>&gt;</p>
</div>
</dd>
<dt id="term-rfc-1952">RFC 1952</dt>
<dd><p class="first">GZIP file format specification version 4.3</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><span class="target" id="index-0"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc1952.html"><strong>RFC 1952</strong></a></p>
</div>
</dd>
<dt id="term-row-record-tuple">Row (record, tuple)</dt>
<dd><p class="first">represents a single, implicitly structured data item in a table.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Row_(database)">https://en.wikipedia.org/wiki/Row_(database)</a>&gt;</p>
</div>
</dd>
<dt id="term-server">Server</dt>
<dd><p class="first">a computer system that provides services to other computing systems over a network.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Server_(computing)">https://en.wikipedia.org/wiki/Server_(computing)</a>&gt;</p>
</div>
</dd>
<dt id="term-storage-engines">Storage Engines</dt>
<dd><p class="first">MySQL can use several different formats for storing data on disk, these
are called storage engines or table types. phpMyAdmin allows a user to
change their storage engine for a particular table through the operations
tab.</p>
<p>Common table types are InnoDB and MyISAM, though many others exist and
may be desirable in some situations.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://dev.mysql.com/doc/refman/5.7/en/storage-engines.html">https://dev.mysql.com/doc/refman/5.7/en/storage-engines.html</a>&gt;</p>
</div>
</dd>
<dt id="term-socket">socket</dt>
<dd><p class="first">a form of inter-process communication.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Unix_domain_socket">https://en.wikipedia.org/wiki/Unix_domain_socket</a>&gt;</p>
</div>
</dd>
<dt id="term-ssl">SSL</dt>
<dd><p class="first">Secure Sockets Layer is a cryptographic protocol which provides secure
communication on the Internet.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Secure_Sockets_Layer">https://en.wikipedia.org/wiki/Secure_Sockets_Layer</a>&gt;</p>
</div>
</dd>
<dt id="term-stored-procedure">Stored procedure</dt>
<dd><p class="first">a subroutine available to applications accessing a relational database system</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Stored_procedure">https://en.wikipedia.org/wiki/Stored_procedure</a>&gt;</p>
</div>
</dd>
<dt id="term-sql">SQL</dt>
<dd><p class="first">Structured Query Language</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/SQL">https://en.wikipedia.org/wiki/SQL</a>&gt;</p>
</div>
</dd>
<dt id="term-table">table</dt>
<dd><p class="first">a set of data elements (cells) that is organized, defined and stored as
horizontal rows and vertical columns where each item can be uniquely
identified by a label or key or by it?s position in relation to other
items.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Table_(database)">https://en.wikipedia.org/wiki/Table_(database)</a>&gt;</p>
</div>
</dd>
<dt id="term-tar">tar</dt>
<dd><p class="first">a type of archive file format: the Tape ARchive format.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Tar_(file_format)">https://en.wikipedia.org/wiki/Tar_(file_format)</a>&gt;</p>
</div>
</dd>
<dt id="term-tcp">TCP</dt>
<dd><p class="first">Transmission Control Protocol is one of the core protocols of the
Internet protocol suite.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/TCP">https://en.wikipedia.org/wiki/TCP</a>&gt;</p>
</div>
</dd>
<dt id="term-tcpdf">TCPDF</dt>
<dd><p class="first">PHP library to generate PDF files.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://tcpdf.org/">https://tcpdf.org/</a>&gt;</p>
</div>
</dd>
<dt id="term-trigger">trigger</dt>
<dd><p class="first">a procedural code that is automatically executed in response to certain events on a particular table or view in a database</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Database_trigger">https://en.wikipedia.org/wiki/Database_trigger</a>&gt;</p>
</div>
</dd>
<dt id="term-unique-key">unique key</dt>
<dd>An unique key is an index over one or more fields in a table which has a
unique value for each row. The first unique key will be treated as
<a class="reference internal" href="#term-primary-key"><span class="xref std std-term">primary key</span></a> if there is no <em>primary key</em> defined.</dd>
<dt id="term-url">URL</dt>
<dd><p class="first">Uniform Resource Locator is a sequence of characters, conforming to a
standardized format, that is used for referring to resources, such as
documents and images on the Internet, by their location.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/URL">https://en.wikipedia.org/wiki/URL</a>&gt;</p>
</div>
</dd>
<dt id="term-webserver">Webserver</dt>
<dd><p class="first">A computer (program) that is responsible for accepting HTTP requests from clients and serving them Web pages.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Webserver">https://en.wikipedia.org/wiki/Webserver</a>&gt;</p>
</div>
</dd>
<dt id="term-xml">XML</dt>
<dd><p class="first">Extensible Markup Language is a W3C-recommended general- purpose markup
language for creating special-purpose markup languages, capable of
describing many different kinds of data.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/XML">https://en.wikipedia.org/wiki/XML</a>&gt;</p>
</div>
</dd>
<dt id="term-zip">ZIP</dt>
<dd><p class="first">a popular data compression and archival format.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/ZIP_(file_format)">https://en.wikipedia.org/wiki/ZIP_(file_format)</a>&gt;</p>
</div>
</dd>
<dt id="term-zlib">zlib</dt>
<dd><p class="first">an open-source, cross- platform data compression library by Jean-loup Gailly and Mark Adler.</p>
<div class="last admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">&lt;<a class="reference external" href="https://en.wikipedia.org/wiki/Zlib">https://en.wikipedia.org/wiki/Zlib</a>&gt;</p>
</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="credits.html"
title="previous chapter">Credits</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/glossary.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="credits.html" title="Credits"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,470 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Import and export &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Custom Themes" href="themes.html" />
<link rel="prev" title="Charts" href="charts.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="themes.html" title="Custom Themes"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="charts.html" title="Charts"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="import-and-export">
<h1>Import and export<a class="headerlink" href="#import-and-export" title="Permalink to this headline"></a></h1>
<div class="section" id="import">
<h2>Import<a class="headerlink" href="#import" title="Permalink to this headline"></a></h2>
<p>To import data, go to the &#8220;Import&#8221; tab in phpMyAdmin. To import data into a
specific database or table, open the database or table before going to the
&#8220;Import&#8221; tab.</p>
<p>In addition to the standard Import and Export tab, you can also import an SQL
file directly by dragging and dropping it from your local file manager to the
phpMyAdmin interface in your web browser.</p>
<p>If you are having troubles importing big files, please consult <a class="reference internal" href="faq.html#faq1-16"><span class="std std-ref">1.16 I cannot upload big dump files (memory, HTTP or timeout problems).</span></a>.</p>
<p>You can import using following methods:</p>
<p>Form based upload</p>
<blockquote>
<div>Can be used with any supported format, also (b|g)zipped files, e.g., mydump.sql.gz .</div></blockquote>
<p>Form based SQL Query</p>
<blockquote>
<div>Can be used with valid SQL dumps.</div></blockquote>
<p>Using upload directory</p>
<blockquote>
<div>You can specify an upload directory on your web server where phpMyAdmin is installed, after uploading your file into this directory you can select this file in the import dialog of phpMyAdmin, see <span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_UploadDir"><code class="xref config config-option docutils literal"><span class="pre">$cfg['UploadDir']</span></code></a>.</div></blockquote>
<p>phpMyAdmin can import from several various commonly used formats.</p>
<div class="section" id="csv">
<h3>CSV<a class="headerlink" href="#csv" title="Permalink to this headline"></a></h3>
<p>Comma separated values format which is often used by spreadsheets or various other programs for export/import.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">When importing data into a table from a CSV file where the table has an
&#8216;auto_increment&#8217; field, make the &#8216;auto_increment&#8217; value for each record in
the CSV field to be &#8216;0&#8217; (zero). This allows the &#8216;auto_increment&#8217; field to
populate correctly.</p>
</div>
<p>It is now possible to import a CSV file at the server or database level.
Instead of having to create a table to import the CSV file into, a best-fit
structure will be determined for you and the data imported into it, instead.
All other features, requirements, and limitations are as before.</p>
</div>
<div class="section" id="csv-using-load-data">
<h3>CSV using LOAD DATA<a class="headerlink" href="#csv-using-load-data" title="Permalink to this headline"></a></h3>
<p>Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one.</p>
</div>
<div class="section" id="esri-shape-file">
<h3>ESRI Shape File<a class="headerlink" href="#esri-shape-file" title="Permalink to this headline"></a></h3>
<p>The ESRI shapefile or simply a shapefile is a popular geospatial vector data
format for geographic information systems software. It is developed and
regulated by Esri as a (mostly) open specification for data interoperability
among Esri and other software products.</p>
</div>
<div class="section" id="mediawiki">
<h3>MediaWiki<a class="headerlink" href="#mediawiki" title="Permalink to this headline"></a></h3>
<p>MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later),
can now also be imported. This is the format used by Wikipedia to display
tables.</p>
</div>
<div class="section" id="open-document-spreadsheet-ods">
<h3>Open Document Spreadsheet (ODS)<a class="headerlink" href="#open-document-spreadsheet-ods" title="Permalink to this headline"></a></h3>
<p>OpenDocument workbooks containing one or more spreadsheets can now be directly imported.</p>
<p>When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the
import as simple as possible.</p>
<div class="section" id="table-name">
<h4>Table name<a class="headerlink" href="#table-name" title="Permalink to this headline"></a></h4>
<p>During import, phpMyAdmin uses the sheet name as the table name; you should rename the
sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create,
though this is less of a concern since you could quickly rename the new table from the Operations tab).</p>
</div>
<div class="section" id="column-names">
<h4>Column names<a class="headerlink" href="#column-names" title="Permalink to this headline"></a></h4>
<p>You should also make the first row of your spreadsheet a header with the names of the columns (this can be
accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the
checkbox for &#8220;The first line of the file contains the table column names;&#8221; this way your newly imported
data will go to the proper columns.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Formulas and calculations will NOT be evaluated, rather, their value from
the most recent save will be loaded. Please ensure that all values in the
spreadsheet are as needed before importing it.</p>
</div>
</div>
</div>
<div class="section" id="sql">
<h3>SQL<a class="headerlink" href="#sql" title="Permalink to this headline"></a></h3>
<p>SQL can be used to make any manipulation on data, it is also useful for restoring backed up data.</p>
</div>
<div class="section" id="xml">
<h3>XML<a class="headerlink" href="#xml" title="Permalink to this headline"></a></h3>
<p>XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported.
Structures (databases, tables, views, triggers, etc.) and/or data will be
created depending on the contents of the file.</p>
<p>The supported xml schemas are not yet documented in this wiki.</p>
</div>
</div>
<div class="section" id="export">
<h2>Export<a class="headerlink" href="#export" title="Permalink to this headline"></a></h2>
<p>phpMyAdmin can export into text files (even compressed) on your local disk (or
a special the webserver <span class="target" id="index-1"></span><a class="reference internal" href="config.html#cfg_SaveDir"><code class="xref config config-option docutils literal"><span class="pre">$cfg['SaveDir']</span></code></a> folder) in various
commonly used formats:</p>
<div class="section" id="codegen">
<h3>CodeGen<a class="headerlink" href="#codegen" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="https://en.wikipedia.org/wiki/NHibernate">NHibernate</a> file format. Planned
versions: Java, Hibernate, PHP PDO, JSON, etc. So the preliminary name is
codegen.</p>
</div>
<div class="section" id="id1">
<h3>CSV<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
<p>Comma separated values format which is often used by spreadsheets or various
other programs for export/import.</p>
</div>
<div class="section" id="csv-for-microsoft-excel">
<h3>CSV for Microsoft Excel<a class="headerlink" href="#csv-for-microsoft-excel" title="Permalink to this headline"></a></h3>
<p>This is just preconfigured version of CSV export which can be imported into
most English versions of Microsoft Excel. Some localised versions (like
&#8220;Danish&#8221;) are expecting &#8221;;&#8221; instead of &#8221;,&#8221; as field separator.</p>
</div>
<div class="section" id="microsoft-word-2000">
<h3>Microsoft Word 2000<a class="headerlink" href="#microsoft-word-2000" title="Permalink to this headline"></a></h3>
<p>If you&#8217;re using Microsoft Word 2000 or newer (or compatible such as
OpenOffice.org), you can use this export.</p>
</div>
<div class="section" id="json">
<h3>JSON<a class="headerlink" href="#json" title="Permalink to this headline"></a></h3>
<p>JSON (JavaScript Object Notation) is a lightweight data-interchange format. It
is easy for humans to read and write and it is easy for machines to parse and
generate.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 4.7.0: </span>The generated JSON structure has been changed in phpMyAdmin 4.7.0 to
produce valid JSON data.</p>
</div>
<p>The generated JSON is list of objects with following attributes:</p>
<dl class="data">
<dt id="type">
<code class="descname">type</code><a class="headerlink" href="#type" title="Permalink to this definition"></a></dt>
<dd><p>Type of given object, can be one of:</p>
<dl class="docutils">
<dt><code class="docutils literal"><span class="pre">header</span></code></dt>
<dd>Export header containing comment and phpMyAdmin version.</dd>
<dt><code class="docutils literal"><span class="pre">database</span></code></dt>
<dd>Start of a database marker, containing name of database.</dd>
<dt><code class="docutils literal"><span class="pre">table</span></code></dt>
<dd>Table data export.</dd>
</dl>
</dd></dl>
<dl class="data">
<dt id="version">
<code class="descname">version</code><a class="headerlink" href="#version" title="Permalink to this definition"></a></dt>
<dd><p>Used in <code class="docutils literal"><span class="pre">header</span></code> <a class="reference internal" href="#type" title="type"><code class="xref js js-data docutils literal"><span class="pre">type</span></code></a> and indicates phpMyAdmin version.</p>
</dd></dl>
<dl class="data">
<dt id="comment">
<code class="descname">comment</code><a class="headerlink" href="#comment" title="Permalink to this definition"></a></dt>
<dd><p>Optional textual comment.</p>
</dd></dl>
<dl class="data">
<dt id="name">
<code class="descname">name</code><a class="headerlink" href="#name" title="Permalink to this definition"></a></dt>
<dd><p>Object name - either table or database based on <a class="reference internal" href="#type" title="type"><code class="xref js js-data docutils literal"><span class="pre">type</span></code></a>.</p>
</dd></dl>
<dl class="data">
<dt id="database">
<code class="descname">database</code><a class="headerlink" href="#database" title="Permalink to this definition"></a></dt>
<dd><p>Database name for <code class="docutils literal"><span class="pre">table</span></code> <a class="reference internal" href="#type" title="type"><code class="xref js js-data docutils literal"><span class="pre">type</span></code></a>.</p>
</dd></dl>
<dl class="data">
<dt id="data">
<code class="descname">data</code><a class="headerlink" href="#data" title="Permalink to this definition"></a></dt>
<dd><p>Table content for <code class="docutils literal"><span class="pre">table</span></code> <a class="reference internal" href="#type" title="type"><code class="xref js js-data docutils literal"><span class="pre">type</span></code></a>.</p>
</dd></dl>
<p>Sample output:</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;comment&quot;</span><span class="p">:</span> <span class="s2">&quot;Export to JSON plugin for PHPMyAdmin&quot;</span><span class="p">,</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;header&quot;</span><span class="p">,</span>
<span class="nt">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;4.7.0-dev&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;cars&quot;</span><span class="p">,</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;database&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;data&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;car_id&quot;</span><span class="p">:</span> <span class="s2">&quot;1&quot;</span><span class="p">,</span>
<span class="nt">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;Green Chrysler 300&quot;</span><span class="p">,</span>
<span class="nt">&quot;make_id&quot;</span><span class="p">:</span> <span class="s2">&quot;5&quot;</span><span class="p">,</span>
<span class="nt">&quot;mileage&quot;</span><span class="p">:</span> <span class="s2">&quot;113688&quot;</span><span class="p">,</span>
<span class="nt">&quot;price&quot;</span><span class="p">:</span> <span class="s2">&quot;13545.00&quot;</span><span class="p">,</span>
<span class="nt">&quot;transmission&quot;</span><span class="p">:</span> <span class="s2">&quot;automatic&quot;</span><span class="p">,</span>
<span class="nt">&quot;yearmade&quot;</span><span class="p">:</span> <span class="s2">&quot;2007&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="nt">&quot;database&quot;</span><span class="p">:</span> <span class="s2">&quot;cars&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;cars&quot;</span><span class="p">,</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;table&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;data&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;make&quot;</span><span class="p">:</span> <span class="s2">&quot;Chrysler&quot;</span><span class="p">,</span>
<span class="nt">&quot;make_id&quot;</span><span class="p">:</span> <span class="s2">&quot;5&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="nt">&quot;database&quot;</span><span class="p">:</span> <span class="s2">&quot;cars&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;makes&quot;</span><span class="p">,</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;table&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
</pre></div>
</div>
</div>
<div class="section" id="latex">
<h3>LaTeX<a class="headerlink" href="#latex" title="Permalink to this headline"></a></h3>
<p>If you want to embed table data or structure in LaTeX, this is right choice for you.</p>
<p>LaTeX is a typesetting system that is very suitable for producing scientific
and mathematical documents of high typographical quality. It is also suitable
for producing all sorts of other documents, from simple letters to complete
books. LaTeX uses TeX as its formatting engine. Learn more about TeX and
LaTeX on <a class="reference external" href="https://www.ctan.org/">the Comprehensive TeX Archive Network</a>
also see the <a class="reference external" href="https://www.ctan.org/tex/">short description od TeX</a>.</p>
<p>The output needs to be embedded into a LaTeX document before it can be
rendered, for example in following document:</p>
<div class="highlight-latex"><div class="highlight"><pre><span></span><span class="k">\documentclass</span><span class="nb">{</span>article<span class="nb">}</span>
<span class="k">\title</span><span class="nb">{</span>phpMyAdmin SQL output<span class="nb">}</span>
<span class="k">\author</span><span class="nb">{}</span>
<span class="k">\usepackage</span><span class="nb">{</span>longtable,lscape<span class="nb">}</span>
<span class="k">\date</span><span class="nb">{}</span>
<span class="k">\setlength</span><span class="nb">{</span><span class="k">\parindent</span><span class="nb">}{</span>0pt<span class="nb">}</span>
<span class="k">\usepackage</span><span class="na">[left=2cm,top=2cm,right=2cm,nohead,nofoot]</span><span class="nb">{</span>geometry<span class="nb">}</span>
<span class="k">\pdfpagewidth</span> 210mm
<span class="k">\pdfpageheight</span> 297mm
<span class="k">\begin</span><span class="nb">{</span>document<span class="nb">}</span>
<span class="k">\maketitle</span>
<span class="c">% insert phpMyAdmin LaTeX Dump here</span>
<span class="k">\end</span><span class="nb">{</span>document<span class="nb">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h3>MediaWiki<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
<p>Both tables and databases can be exported in the MediaWiki format, which is
used by Wikipedia to display tables. It can export structure, data or both,
including table names or headers.</p>
</div>
<div class="section" id="opendocument-spreadsheet">
<h3>OpenDocument Spreadsheet<a class="headerlink" href="#opendocument-spreadsheet" title="Permalink to this headline"></a></h3>
<p>Open standard for spreadsheet data, which is being widely adopted. Many recent
spreadsheet programs, such as LibreOffice, OpenOffice, Microsoft Office or
Google Docs can handle this format.</p>
</div>
<div class="section" id="opendocument-text">
<h3>OpenDocument Text<a class="headerlink" href="#opendocument-text" title="Permalink to this headline"></a></h3>
<p>New standard for text data which is being widely addopted. Most recent word
processors (such as LibreOffice, OpenOffice, Microsoft Word, AbiWord or KWord)
can handle this.</p>
</div>
<div class="section" id="pdf">
<h3>PDF<a class="headerlink" href="#pdf" title="Permalink to this headline"></a></h3>
<p>For presentation purposes, non editable PDF might be best choice for you.</p>
</div>
<div class="section" id="php-array">
<h3>PHP Array<a class="headerlink" href="#php-array" title="Permalink to this headline"></a></h3>
<p>You can generate a php file which will declare a multidimensional array with
the contents of the selected table or database.</p>
</div>
<div class="section" id="id3">
<h3>SQL<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h3>
<p>Export in SQL can be used to restore your database, thus it is useful for
backing up.</p>
<p>The option &#8216;Maximal length of created query&#8217; seems to be undocumented. But
experiments has shown that it splits large extended INSERTS so each one is no
bigger than the given number of bytes (or characters?). Thus when importing the
file, for large tables you avoid the error &#8220;Got a packet bigger than
&#8216;max_allowed_packet&#8217; bytes&#8221;.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference external" href="https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html">https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html</a></p>
</div>
<div class="section" id="data-options">
<h4>Data Options<a class="headerlink" href="#data-options" title="Permalink to this headline"></a></h4>
<p><strong>Complete inserts</strong> adds the column names to the SQL dump. This parameter
improves the readability and reliability of the dump. Adding the column names
increases the size of the dump, but when combined with Extended inserts it&#8217;s
negligible.</p>
<p><strong>Extended inserts</strong> combines multiple rows of data into a single INSERT query.
This will significantly decrease filesize for large SQL dumps, increases the
INSERT speed when imported, and is generally recommended.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference external" href="http://www.scriptalicious.com/blog/2009/04/complete-inserts-or-extended-inserts-in-phpmyadmin/">http://www.scriptalicious.com/blog/2009/04/complete-inserts-or-extended-inserts-in-phpmyadmin/</a></p>
</div>
</div>
</div>
<div class="section" id="texy">
<h3>Texy!<a class="headerlink" href="#texy" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="https://texy.info/">Texy!</a> markup format. You can see example on <a class="reference external" href="https://texy.info/en/try/4q5we">Texy! demo</a>.</p>
</div>
<div class="section" id="id5">
<h3>XML<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h3>
<p>Easily parsable export for use with custom scripts.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 3.3.0: </span>The XML schema used has changed as of version 3.3.0</p>
</div>
</div>
<div class="section" id="yaml">
<h3>YAML<a class="headerlink" href="#yaml" title="Permalink to this headline"></a></h3>
<p>YAML is a data serialization format which is both human readable and
computationally powerful ( &lt;<a class="reference external" href="http://yaml.org">http://yaml.org</a>&gt; ).</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Import and export</a><ul>
<li><a class="reference internal" href="#import">Import</a><ul>
<li><a class="reference internal" href="#csv">CSV</a></li>
<li><a class="reference internal" href="#csv-using-load-data">CSV using LOAD DATA</a></li>
<li><a class="reference internal" href="#esri-shape-file">ESRI Shape File</a></li>
<li><a class="reference internal" href="#mediawiki">MediaWiki</a></li>
<li><a class="reference internal" href="#open-document-spreadsheet-ods">Open Document Spreadsheet (ODS)</a><ul>
<li><a class="reference internal" href="#table-name">Table name</a></li>
<li><a class="reference internal" href="#column-names">Column names</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sql">SQL</a></li>
<li><a class="reference internal" href="#xml">XML</a></li>
</ul>
</li>
<li><a class="reference internal" href="#export">Export</a><ul>
<li><a class="reference internal" href="#codegen">CodeGen</a></li>
<li><a class="reference internal" href="#id1">CSV</a></li>
<li><a class="reference internal" href="#csv-for-microsoft-excel">CSV for Microsoft Excel</a></li>
<li><a class="reference internal" href="#microsoft-word-2000">Microsoft Word 2000</a></li>
<li><a class="reference internal" href="#json">JSON</a></li>
<li><a class="reference internal" href="#latex">LaTeX</a></li>
<li><a class="reference internal" href="#id2">MediaWiki</a></li>
<li><a class="reference internal" href="#opendocument-spreadsheet">OpenDocument Spreadsheet</a></li>
<li><a class="reference internal" href="#opendocument-text">OpenDocument Text</a></li>
<li><a class="reference internal" href="#pdf">PDF</a></li>
<li><a class="reference internal" href="#php-array">PHP Array</a></li>
<li><a class="reference internal" href="#id3">SQL</a><ul>
<li><a class="reference internal" href="#data-options">Data Options</a></li>
</ul>
</li>
<li><a class="reference internal" href="#texy">Texy!</a></li>
<li><a class="reference internal" href="#id5">XML</a></li>
<li><a class="reference internal" href="#yaml">YAML</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="charts.html"
title="previous chapter">Charts</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="themes.html"
title="next chapter">Custom Themes</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/import_export.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="themes.html" title="Custom Themes"
>next</a> |</li>
<li class="right" >
<a href="charts.html" title="Charts"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,228 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to phpMyAdmins documentation! &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="#" />
<link rel="next" title="Introduction" href="intro.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="intro.html" title="Introduction"
accesskey="N">next</a> |</li>
<li class="nav-item nav-item-0"><a href="#">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="welcome-to-phpmyadmin-s-documentation">
<h1>Welcome to phpMyAdmin&#8217;s documentation!<a class="headerlink" href="#welcome-to-phpmyadmin-s-documentation" title="Permalink to this headline"></a></h1>
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro.html#supported-features">Supported features</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#shortcut-keys">Shortcut keys</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#a-word-about-users">A word about users</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="require.html">Requirements</a><ul>
<li class="toctree-l2"><a class="reference internal" href="require.html#web-server">Web server</a></li>
<li class="toctree-l2"><a class="reference internal" href="require.html#php">PHP</a></li>
<li class="toctree-l2"><a class="reference internal" href="require.html#database">Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="require.html#web-browser">Web browser</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="setup.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="setup.html#linux-distributions">Linux distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#installing-on-windows">Installing on Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#installing-from-git">Installing from Git</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#installing-using-composer">Installing using Composer</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#installing-using-docker">Installing using Docker</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#quick-install">Quick Install</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#verifying-phpmyadmin-releases">Verifying phpMyAdmin releases</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#phpmyadmin-configuration-storage">phpMyAdmin configuration storage</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#upgrading-from-an-older-version">Upgrading from an older version</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#using-authentication-modes">Using authentication modes</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#securing-your-phpmyadmin-installation">Securing your phpMyAdmin installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#using-ssl-for-connection-to-database-server">Using SSL for connection to database server</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#known-issues">Known issues</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="config.html">Configuration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="config.html#basic-settings">Basic settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#server-connection-settings">Server connection settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#generic-settings">Generic settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#cookie-authentication-options">Cookie authentication options</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#navigation-panel-setup">Navigation panel setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#main-panel">Main panel</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#database-structure">Database structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#browse-mode">Browse mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#editing-mode">Editing mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#export-and-import-settings">Export and import settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#tabs-display-settings">Tabs display settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#pdf-options">PDF Options</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#languages">Languages</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#web-server-settings">Web server settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#theme-settings">Theme settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#design-customization">Design customization</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#text-fields">Text fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#sql-query-box-settings">SQL query box settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#web-server-upload-save-import-directories">Web server upload/save/import directories</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#various-display-setting">Various display setting</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#page-titles">Page titles</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#theme-manager-settings">Theme manager settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#default-queries">Default queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#mysql-settings">MySQL settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#default-options-for-transformations">Default options for Transformations</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#console-settings">Console settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#developer">Developer</a></li>
<li class="toctree-l2"><a class="reference internal" href="config.html#examples">Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="user.html">User Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="settings.html">Configuring phpMyAdmin</a></li>
<li class="toctree-l2"><a class="reference internal" href="two_factor.html">Two-factor authentication</a></li>
<li class="toctree-l2"><a class="reference internal" href="transformations.html">Transformations</a></li>
<li class="toctree-l2"><a class="reference internal" href="bookmarks.html">Bookmarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="privileges.html">User management</a></li>
<li class="toctree-l2"><a class="reference internal" href="relations.html">Relations</a></li>
<li class="toctree-l2"><a class="reference internal" href="charts.html">Charts</a></li>
<li class="toctree-l2"><a class="reference internal" href="import_export.html">Import and export</a></li>
<li class="toctree-l2"><a class="reference internal" href="themes.html">Custom Themes</a></li>
<li class="toctree-l2"><a class="reference internal" href="other.html">Other sources of information</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ - Frequently Asked Questions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="faq.html#server">Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#configuration">Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#known-limitations">Known limitations</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#isps-multi-user-installations">ISPs, multi-user installations</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#browsers-or-client-os">Browsers or client OS</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#using-phpmyadmin">Using phpMyAdmin</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#phpmyadmin-project">phpMyAdmin project</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#security">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#synchronization">Synchronization</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="developers.html">Developers Information</a></li>
<li class="toctree-l1"><a class="reference internal" href="security.html">Security policy</a><ul>
<li class="toctree-l2"><a class="reference internal" href="security.html#typical-vulnerabilities">Typical vulnerabilities</a></li>
<li class="toctree-l2"><a class="reference internal" href="security.html#reporting-security-issues">Reporting security issues</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="vendors.html">Distributing and packaging phpMyAdmin</a><ul>
<li class="toctree-l2"><a class="reference internal" href="vendors.html#external-libraries">External libraries</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="copyright.html">Copyright</a><ul>
<li class="toctree-l2"><a class="reference internal" href="copyright.html#third-party-licenses">Third party licenses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a><ul>
<li class="toctree-l2"><a class="reference internal" href="credits.html#credits-in-chronological-order">Credits, in chronological order</a></li>
<li class="toctree-l2"><a class="reference internal" href="credits.html#translators">Translators</a></li>
<li class="toctree-l2"><a class="reference internal" href="credits.html#documentation-translators">Documentation translators</a></li>
<li class="toctree-l2"><a class="reference internal" href="credits.html#original-credits-of-version-2-1-0">Original Credits of Version 2.1.0</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
</ul>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
<li><a class="reference internal" href="glossary.html#glossary"><span class="std std-ref">Glossary</span></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome to phpMyAdmin&#8217;s documentation!</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
<h4>Next topic</h4>
<p class="topless"><a href="intro.html"
title="next chapter">Introduction</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="intro.html" title="Introduction"
>next</a> |</li>
<li class="nav-item nav-item-0"><a href="#">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,195 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="next" title="Requirements" href="require.html" />
<link rel="prev" title="Welcome to phpMyAdmins documentation!" href="index.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="require.html" title="Requirements"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to phpMyAdmins documentation!"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="introduction">
<span id="intro"></span><h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h1>
<p>phpMyAdmin is a free software tool written in PHP that is intended to handle the
administration of a MySQL or MariaDB database server. You can use phpMyAdmin to
perform most administration tasks, including creating a database, running queries,
and adding user accounts.</p>
<div class="section" id="supported-features">
<h2>Supported features<a class="headerlink" href="#supported-features" title="Permalink to this headline"></a></h2>
<p>Currently phpMyAdmin can:</p>
<ul class="simple">
<li>create, browse, edit, and drop databases, tables, views, columns, and indexes</li>
<li>display multiple results sets through stored procedures or queries</li>
<li>create, copy, drop, rename and alter databases, tables, columns and
indexes</li>
<li>maintenance server, databases and tables, with proposals on server
configuration</li>
<li>execute, edit and bookmark any <a class="reference internal" href="glossary.html#term-sql"><span class="xref std std-term">SQL</span></a>-statement, even batch-queries</li>
<li>load text files into tables</li>
<li>create <a class="footnote-reference" href="#f1" id="id1">[1]</a> and read dumps of tables</li>
<li>export <a class="footnote-reference" href="#f1" id="id2">[1]</a> data to various formats: <a class="reference internal" href="glossary.html#term-csv"><span class="xref std std-term">CSV</span></a>, <a class="reference internal" href="glossary.html#term-xml"><span class="xref std std-term">XML</span></a>, <a class="reference internal" href="glossary.html#term-pdf"><span class="xref std std-term">PDF</span></a>,
<a class="reference internal" href="glossary.html#term-iso"><span class="xref std std-term">ISO</span></a>/<a class="reference internal" href="glossary.html#term-iec"><span class="xref std std-term">IEC</span></a> 26300 - <a class="reference internal" href="glossary.html#term-opendocument"><span class="xref std std-term">OpenDocument</span></a> Text and Spreadsheet, Microsoft
Word 2000, and LATEX formats</li>
<li>import data and <a class="reference internal" href="glossary.html#term-48"><span class="xref std std-term">MySQL</span></a> structures from <a class="reference internal" href="glossary.html#term-opendocument"><span class="xref std std-term">OpenDocument</span></a> spreadsheets, as
well as <a class="reference internal" href="glossary.html#term-xml"><span class="xref std std-term">XML</span></a>, <a class="reference internal" href="glossary.html#term-csv"><span class="xref std std-term">CSV</span></a>, and <a class="reference internal" href="glossary.html#term-sql"><span class="xref std std-term">SQL</span></a> files</li>
<li>administer multiple servers</li>
<li>add, edit, and remove MySQL user accounts and privileges</li>
<li>check referential integrity in MyISAM tables</li>
<li>using Query-by-example (QBE), create complex queries automatically
connecting required tables</li>
<li>create <a class="reference internal" href="glossary.html#term-pdf"><span class="xref std std-term">PDF</span></a> graphics of your
database layout</li>
<li>search globally in a database or a subset of it</li>
<li>transform stored data into any format using a set of predefined
functions, like displaying BLOB-data as image or download-link</li>
<li>track changes on databases, tables and views</li>
<li>support InnoDB tables and foreign keys</li>
<li>support mysqli, the improved MySQL extension see <a class="reference internal" href="faq.html#faq1-17"><span class="std std-ref">1.17 Which Database versions does phpMyAdmin support?</span></a></li>
<li>create, edit, call, export and drop stored procedures and functions</li>
<li>create, edit, export and drop events and triggers</li>
<li>communicate in <a class="reference external" href="https://www.phpmyadmin.net/translations/">80 different languages</a></li>
</ul>
</div>
<div class="section" id="shortcut-keys">
<h2>Shortcut keys<a class="headerlink" href="#shortcut-keys" title="Permalink to this headline"></a></h2>
<p>Currently phpMyAdmin supports following shortcuts:</p>
<ul class="simple">
<li>k - Toggle console</li>
<li>h - Go to home page</li>
<li>s - Open settings</li>
<li>d + s - Go to database structure (Provided you are in database related page)</li>
<li>d + f - Search database (Provided you are in database related page)</li>
<li>t + s - Go to table structure (Provided you are in table related page)</li>
<li>t + f - Search table (Provided you are in table related page)</li>
<li>backspace - Takes you to older page.</li>
</ul>
</div>
<div class="section" id="a-word-about-users">
<h2>A word about users<a class="headerlink" href="#a-word-about-users" title="Permalink to this headline"></a></h2>
<p>Many people have difficulty understanding the concept of user
management with regards to phpMyAdmin. When a user logs in to
phpMyAdmin, that username and password are passed directly to MySQL.
phpMyAdmin does no account management on its own (other than allowing
one to manipulate the MySQL user account information); all users must
be valid MySQL users.</p>
<p class="rubric">Footnotes</p>
<table class="docutils footnote" frame="void" id="f1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>)</em> phpMyAdmin can compress (<a class="reference internal" href="glossary.html#term-zip"><span class="xref std std-term">Zip</span></a>, <a class="reference internal" href="glossary.html#term-gzip"><span class="xref std std-term">GZip</span></a> or <a class="reference internal" href="glossary.html#term-rfc-1952"><span class="xref std std-term">RFC 1952</span></a>
formats) dumps and <a class="reference internal" href="glossary.html#term-csv"><span class="xref std std-term">CSV</span></a> exports if you use PHP with
<a class="reference internal" href="glossary.html#term-zlib"><span class="xref std std-term">Zlib</span></a> support (<code class="docutils literal"><span class="pre">--with-zlib</span></code>).
Proper support may also need changes in <code class="file docutils literal"><span class="pre">php.ini</span></code>.</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Introduction</a><ul>
<li><a class="reference internal" href="#supported-features">Supported features</a></li>
<li><a class="reference internal" href="#shortcut-keys">Shortcut keys</a></li>
<li><a class="reference internal" href="#a-word-about-users">A word about users</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Welcome to phpMyAdmin&#8217;s documentation!</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="require.html"
title="next chapter">Requirements</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/intro.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="require.html" title="Requirements"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to phpMyAdmins documentation!"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,158 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Other sources of information &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="FAQ - Frequently Asked Questions" href="faq.html" />
<link rel="prev" title="Custom Themes" href="themes.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="faq.html" title="FAQ - Frequently Asked Questions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="themes.html" title="Custom Themes"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="other-sources-of-information">
<h1>Other sources of information<a class="headerlink" href="#other-sources-of-information" title="Permalink to this headline"></a></h1>
<div class="section" id="printed-book">
<h2>Printed Book<a class="headerlink" href="#printed-book" title="Permalink to this headline"></a></h2>
<p>The definitive guide to using phpMyAdmin is the book Mastering phpMyAdmin for
Effective MySQL Management by Marc Delisle. You can get information on that
book and other officially endorsed <a class="reference external" href="https://www.phpmyadmin.net/docs/">books at the phpMyAdmin site</a>.</p>
</div>
<div class="section" id="tutorials">
<h2>Tutorials<a class="headerlink" href="#tutorials" title="Permalink to this headline"></a></h2>
<p>Third party tutorials and articles which you might find interesting:</p>
<div class="section" id="cesky-czech">
<h3>Česky (Czech)<a class="headerlink" href="#cesky-czech" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><a class="reference external" href="https://cihar.com/publications/linuxsoft/">Seriál o phpMyAdminovi</a></li>
</ul>
</div>
<div class="section" id="english">
<h3>English<a class="headerlink" href="#english" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><a class="reference external" href="https://garv.in/tops/texte/mimetutorial">Having fun with phpMyAdmin&#8217;s MIME-transformations &amp; PDF-features</a></li>
<li><a class="reference external" href="http://www.php-editors.com/articles/sql_phpmyadmin.php">Learning SQL Using phpMyAdmin (old tutorial)</a></li>
</ul>
</div>
<div class="section" id="russian">
<h3>Русский (Russian)<a class="headerlink" href="#russian" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><a class="reference external" href="https://php-myadmin.ru/">Russian server about phpMyAdmin</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Other sources of information</a><ul>
<li><a class="reference internal" href="#printed-book">Printed Book</a></li>
<li><a class="reference internal" href="#tutorials">Tutorials</a><ul>
<li><a class="reference internal" href="#cesky-czech">Česky (Czech)</a></li>
<li><a class="reference internal" href="#english">English</a></li>
<li><a class="reference internal" href="#russian">Русский (Russian)</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="themes.html"
title="previous chapter">Custom Themes</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="faq.html"
title="next chapter">FAQ - Frequently Asked Questions</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/other.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="faq.html" title="FAQ - Frequently Asked Questions"
>next</a> |</li>
<li class="right" >
<a href="themes.html" title="Custom Themes"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,188 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>User management &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Relations" href="relations.html" />
<link rel="prev" title="Bookmarks" href="bookmarks.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="relations.html" title="Relations"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="bookmarks.html" title="Bookmarks"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="user-management">
<h1>User management<a class="headerlink" href="#user-management" title="Permalink to this headline"></a></h1>
<p>User management is the process of controlling which users are allowed to
connect to the MySQL server and what permissions they have on each database.
phpMyAdmin does not handle user management, rather it passes the username and
password on to MySQL, which then determines whether a user is permitted to
perform a particular action. Within phpMyAdmin, administrators have full
control over creating users, viewing and editing privileges for existing users,
and removing users.</p>
<p>Within phpMyAdmin, user management is controlled via the <span class="guilabel">Users</span> link
from the main page. Users can be created, edited, and removed.</p>
<div class="section" id="creating-a-new-user">
<h2>Creating a new user<a class="headerlink" href="#creating-a-new-user" title="Permalink to this headline"></a></h2>
<p>To create a new user, click the <span class="guilabel">Add a new user</span> link near the bottom
of the <span class="guilabel">Users</span> page (you must be a &#8220;superuser&#8221;, e.g., user &#8220;root&#8221;).
Use the textboxes and drop-downs to configure the user to your particular
needs. You can then select whether to create a database for that user and grant
specific global privileges. Once you&#8217;ve created the user (by clicking Go), you
can define that user&#8217;s permissions on a specific database (don&#8217;t grant global
privileges in that case). In general, users do not need any global privileges
(other than USAGE), only permissions for their specific database.</p>
</div>
<div class="section" id="editing-an-existing-user">
<h2>Editing an existing user<a class="headerlink" href="#editing-an-existing-user" title="Permalink to this headline"></a></h2>
<p>To edit an existing user, simply click the pencil icon to the right of that
user in the <span class="guilabel">Users</span> page. You can then edit their global- and
database-specific privileges, change their password, or even copy those
privileges to a new user.</p>
</div>
<div class="section" id="deleting-a-user">
<h2>Deleting a user<a class="headerlink" href="#deleting-a-user" title="Permalink to this headline"></a></h2>
<p>From the <span class="guilabel">Users</span> page, check the checkbox for the user you wish to
remove, select whether or not to also remove any databases of the same name (if
they exist), and click Go.</p>
</div>
<div class="section" id="assigning-privileges-to-user-for-a-specific-database">
<h2>Assigning privileges to user for a specific database<a class="headerlink" href="#assigning-privileges-to-user-for-a-specific-database" title="Permalink to this headline"></a></h2>
<p>Users are assigned to databases by editing the user record (from the
<span class="guilabel">User accounts</span> link on the home page).
If you are creating a user specifically for a given table
you will have to create the user first (with no global privileges) and then go
back and edit that user to add the table and privileges for the individual
table.</p>
</div>
<div class="section" id="configurable-menus-and-user-groups">
<span id="configurablemenus"></span><h2>Configurable menus and user groups<a class="headerlink" href="#configurable-menus-and-user-groups" title="Permalink to this headline"></a></h2>
<p>By enabling <span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_Servers_usergroups"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['usergroups']</span></code></a> and
<span class="target" id="index-1"></span><a class="reference internal" href="config.html#cfg_Servers_usergroups"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['usergroups']</span></code></a> you can customize what users
will see in the phpMyAdmin navigation.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This feature only limits what a user sees, he is still able to use all the
functions. So this can not be considered as a security limitation. Should
you want to limit what users can do, use MySQL privileges to achieve that.</p>
</div>
<p>With this feature enabled, the <span class="guilabel">User accounts</span> management interface gains
a second tab for managing <span class="guilabel">User groups</span>, where you can define what each
group will view (see image below) and you can then assign each user to one of
these groups. Users will be presented with a simplified user interface, which might be
useful for inexperienced users who could be overwhelmed by all the features
phpMyAdmin provides.</p>
<img alt="_images/usergroups.png" src="_images/usergroups.png" />
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">User management</a><ul>
<li><a class="reference internal" href="#creating-a-new-user">Creating a new user</a></li>
<li><a class="reference internal" href="#editing-an-existing-user">Editing an existing user</a></li>
<li><a class="reference internal" href="#deleting-a-user">Deleting a user</a></li>
<li><a class="reference internal" href="#assigning-privileges-to-user-for-a-specific-database">Assigning privileges to user for a specific database</a></li>
<li><a class="reference internal" href="#configurable-menus-and-user-groups">Configurable menus and user groups</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="bookmarks.html"
title="previous chapter">Bookmarks</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="relations.html"
title="next chapter">Relations</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/privileges.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="relations.html" title="Relations"
>next</a> |</li>
<li class="right" >
<a href="bookmarks.html" title="Bookmarks"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,194 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Relations &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Charts" href="charts.html" />
<link rel="prev" title="User management" href="privileges.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="charts.html" title="Charts"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="privileges.html" title="User management"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="relations">
<span id="id1"></span><h1>Relations<a class="headerlink" href="#relations" title="Permalink to this headline"></a></h1>
<p>phpMyAdmin allows relationships (similar to foreign keys) using MySQL-native
(InnoDB) methods when available and falling back on special phpMyAdmin-only
features when needed. There are two ways of editing these relations, with the
<em>relation view</em> and the drag-and-drop <em>designer</em> &#8211; both of which are explained
on this page.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You need to have configured the <a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> for using phpMyAdmin
only relations.</p>
</div>
<div class="section" id="technical-info">
<h2>Technical info<a class="headerlink" href="#technical-info" title="Permalink to this headline"></a></h2>
<p>Currently the only MySQL table type that natively supports relationships is
InnoDB. When using an InnoDB table, phpMyAdmin will create real InnoDB
relations which will be enforced by MySQL no matter which application accesses
the database. In the case of any other table type, phpMyAdmin enforces the
relations internally and those relations are not applied to any other
application.</p>
</div>
<div class="section" id="relation-view">
<h2>Relation view<a class="headerlink" href="#relation-view" title="Permalink to this headline"></a></h2>
<p>In order to get it working, you first have to properly create the
[[pmadb|pmadb]]. Once that is setup, select a table&#8217;s &#8220;Structure&#8221; page. Below
the table definition, a link called &#8220;Relation view&#8221; is shown. If you click that
link, a page will be shown that offers you to create a link to another table
for any (most) fields. Only PRIMARY KEYS are shown there, so if the field you
are referring to is not shown, you most likely are doing something wrong. The
drop-down at the bottom is the field which will be used as the name for a
record.</p>
<div class="section" id="relation-view-example">
<h3>Relation view example<a class="headerlink" href="#relation-view-example" title="Permalink to this headline"></a></h3>
<img alt="_images/pma-relations-relation-view-link.png" src="_images/pma-relations-relation-view-link.png" />
<img alt="_images/pma-relations-relation-link.png" src="_images/pma-relations-relation-link.png" />
<p>Let&#8217;s say you have categories and links and one category can contain several links. Your table structure would be something like this:</p>
<ul class="simple">
<li><cite>category.category_id</cite> (must be unique)</li>
<li><cite>category.name</cite></li>
<li><cite>link.link_id</cite></li>
<li><cite>link.category_id</cite></li>
<li><cite>link.uri</cite>.</li>
</ul>
<p>Open the relation view (below the table structure) page for the <cite>link</cite> table and for <cite>category_id</cite> field, you select <cite>category.category_id</cite> as master record.</p>
<p>If you now browse the link table, the <cite>category_id</cite> field will be a clickable hyperlink to the proper category record. But all you see is just the <cite>category_id</cite>, not the name of the category.</p>
<img alt="_images/pma-relations-relation-name.png" src="_images/pma-relations-relation-name.png" />
<p>To fix this, open the relation view of the <cite>category</cite> table and in the drop down at the bottom, select &#8220;name&#8221;. If you now browse the link table again and hover the mouse over the <cite>category_id</cite> hyperlink, the value from the related category will be shown as tooltip.</p>
<img alt="_images/pma-relations-links.png" src="_images/pma-relations-links.png" />
</div>
</div>
<div class="section" id="designer">
<h2>Designer<a class="headerlink" href="#designer" title="Permalink to this headline"></a></h2>
<p>The Designer feature is a graphical way of creating, editing, and displaying
phpMyAdmin relations. These relations are compatible with those created in
phpMyAdmin&#8217;s relation view.</p>
<p>To use this feature, you need a properly configured <a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> and
must have the <span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_Servers_table_coords"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['table_coords']</span></code></a> configured.</p>
<p>To use the designer, select a database&#8217;s structure page, then look for the
<span class="guilabel">Designer</span> tab.</p>
<p>To export the view into PDF, you have to create PDF pages first. The Designer
creates the layout, how the tables shall be displayed. To finally export the
view, you have to create this with a PDF page and select your layout, which you
have created with the designer.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="faq.html#faqpdf"><span class="std std-ref">6.8 How can I produce a PDF schema of my database?</span></a></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Relations</a><ul>
<li><a class="reference internal" href="#technical-info">Technical info</a></li>
<li><a class="reference internal" href="#relation-view">Relation view</a><ul>
<li><a class="reference internal" href="#relation-view-example">Relation view example</a></li>
</ul>
</li>
<li><a class="reference internal" href="#designer">Designer</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="privileges.html"
title="previous chapter">User management</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="charts.html"
title="next chapter">Charts</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/relations.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="charts.html" title="Charts"
>next</a> |</li>
<li class="right" >
<a href="privileges.html" title="User management"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,172 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Requirements &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="next" title="Installation" href="setup.html" />
<link rel="prev" title="Introduction" href="intro.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="setup.html" title="Installation"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="intro.html" title="Introduction"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="requirements">
<span id="require"></span><h1>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h1>
<div class="section" id="web-server">
<h2>Web server<a class="headerlink" href="#web-server" title="Permalink to this headline"></a></h2>
<p>Since phpMyAdmin&#8217;s interface is based entirely in your browser, you&#8217;ll need a
web server (such as Apache, nginx, <a class="reference internal" href="glossary.html#term-iis"><span class="xref std std-term">IIS</span></a>) to install phpMyAdmin&#8217;s files into.</p>
</div>
<div class="section" id="php">
<h2>PHP<a class="headerlink" href="#php" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>You need PHP 5.5.0 or newer, with <code class="docutils literal"><span class="pre">session</span></code> support, the Standard PHP Library
(SPL) extension, hash, ctype, and JSON support.</li>
<li>The <code class="docutils literal"><span class="pre">mbstring</span></code> extension (see <a class="reference internal" href="glossary.html#term-mbstring"><span class="xref std std-term">mbstring</span></a>) is strongly recommended
for performance reasons.</li>
<li>To support uploading of ZIP files, you need the PHP <code class="docutils literal"><span class="pre">zip</span></code> extension.</li>
<li>You need GD2 support in PHP to display inline thumbnails of JPEGs
(&#8220;image/jpeg: inline&#8221;) with their original aspect ratio.</li>
<li>When using the cookie authentication (the default), the <a class="reference external" href="https://secure.php.net/openssl">openssl</a> extension is strongly suggested.</li>
<li>To support upload progress bars, see <a class="reference internal" href="faq.html#faq2-9"><span class="std std-ref">2.9 Seeing an upload progress bar</span></a>.</li>
<li>To support XML and Open Document Spreadsheet importing, you need the
<a class="reference external" href="https://secure.php.net/libxml">libxml</a> extension.</li>
<li>To support reCAPTCHA on the login page, you need the
<a class="reference external" href="https://secure.php.net/openssl">openssl</a> extension.</li>
<li>To support displaying phpMyAdmin&#8217;s latest version, you need to enable
<code class="docutils literal"><span class="pre">allow_url_open</span></code> in your <code class="file docutils literal"><span class="pre">php.ini</span></code> or to have the
<a class="reference external" href="https://secure.php.net/curl">curl</a> extension.</li>
</ul>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="faq.html#faq1-31"><span class="std std-ref">1.31 Which PHP versions does phpMyAdmin support?</span></a>, <a class="reference internal" href="setup.html#authentication-modes"><span class="std std-ref">Using authentication modes</span></a></p>
</div>
</div>
<div class="section" id="database">
<h2>Database<a class="headerlink" href="#database" title="Permalink to this headline"></a></h2>
<p>phpMyAdmin supports MySQL-compatible databases.</p>
<ul class="simple">
<li>MySQL 5.5 or newer</li>
<li>MariaDB 5.5 or newer</li>
</ul>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="faq.html#faq1-17"><span class="std std-ref">1.17 Which Database versions does phpMyAdmin support?</span></a></p>
</div>
</div>
<div class="section" id="web-browser">
<h2>Web browser<a class="headerlink" href="#web-browser" title="Permalink to this headline"></a></h2>
<p>To access phpMyAdmin you need a web browser with cookies and JavaScript
enabled.</p>
<p>You need browser which is supported by jQuery 2.0, see
&lt;<a class="reference external" href="https://jquery.com/browser-support/">https://jquery.com/browser-support/</a>&gt;.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Requirements</a><ul>
<li><a class="reference internal" href="#web-server">Web server</a></li>
<li><a class="reference internal" href="#php">PHP</a></li>
<li><a class="reference internal" href="#database">Database</a></li>
<li><a class="reference internal" href="#web-browser">Web browser</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="intro.html"
title="previous chapter">Introduction</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="setup.html"
title="next chapter">Installation</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/require.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="setup.html" title="Installation"
>next</a> |</li>
<li class="right" >
<a href="intro.html" title="Introduction"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,102 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="#" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
<script type="text/javascript" id="searchindexloader"></script>
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1 id="search-documentation">Search</h1>
<div id="fallback" class="admonition warning">
<script type="text/javascript">$('#fallback').hide();</script>
<p>
Please activate JavaScript to enable the search
functionality.
</p>
</div>
<p>
From here you can search these documents. Enter your search
words into the box below and click "search". Note that the search
function will automatically search for all of the words. Pages
containing fewer words won't appear in the result list.
</p>
<form action="" method="get">
<input type="text" name="q" value="" />
<input type="submit" value="search" />
<span id="search-progress" style="padding-left: 10px"></span>
</form>
<div id="search-results">
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,219 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Security policy &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="next" title="Distributing and packaging phpMyAdmin" href="vendors.html" />
<link rel="prev" title="Developers Information" href="developers.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="vendors.html" title="Distributing and packaging phpMyAdmin"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="developers.html" title="Developers Information"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="security-policy">
<h1>Security policy<a class="headerlink" href="#security-policy" title="Permalink to this headline"></a></h1>
<p>The phpMyAdmin developer team is putting lot of effort to make phpMyAdmin as
secure as possible. But still web application like phpMyAdmin can be vulnerable
to a number of attacks and new ways to exploit are still being explored.</p>
<p>For every reported vulnerability we issue a phpMyAdmin Security Announcement
(PMASA) and it get&#8217;s assigne CVE ID as well. We might group similar
vulnerabilities to one PMASA (eg. multiple XSS vulnerabilities can be announced
under one PMASA).</p>
<p>If you think you&#8217;ve found a vulnerability, please see <a class="reference internal" href="#reporting-security"><span class="std std-ref">Reporting security issues</span></a>.</p>
<div class="section" id="typical-vulnerabilities">
<h2>Typical vulnerabilities<a class="headerlink" href="#typical-vulnerabilities" title="Permalink to this headline"></a></h2>
<p>In this secion, we will describe typical vulnerabilities, which can appear in
our code base. This list is by no means complete, it is intended to show
typical attack surface.</p>
<div class="section" id="cross-site-scripting-xss">
<h3>Cross-site scripting (XSS)<a class="headerlink" href="#cross-site-scripting-xss" title="Permalink to this headline"></a></h3>
<p>When phpMyAdmin shows a piece of user data, e.g. something inside a user&#8217;s
database, all html special chars have to be escaped. When this escaping is
missing somewhere a malicious user might fill a database with specially crafted
content to trick an other user of that database into executing something. This
could for example be a piece of JavaScript code that would do any number of
nasty things.</p>
<p>phpMyAdmin tries to escape all userdata before it is rendered into html for the
browser.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference external" href="https://en.wikipedia.org/wiki/Cross-site_scripting">Cross-site scripting on Wikipedia</a></p>
</div>
</div>
<div class="section" id="cross-site-request-forgery-csrf">
<h3>Cross-site request forgery (CSRF)<a class="headerlink" href="#cross-site-request-forgery-csrf" title="Permalink to this headline"></a></h3>
<p>An attacker would trick a phpMyAdmin user into clicking on a link to provoke
some action in phpMyAdmin. This link could either be sent via email or some
random website. If successful this the attacker would be able to perform some
action with the users privileges.</p>
<p>To mitigate this phpMyAdmin requires a token to be sent on sensitive requests.
The idea is that an attacker does not poses the currently valid token to
include in the presented link.</p>
<p>The token is regenerated for every login, so it&#8217;s generally valid only for
limited time, what makes it harder for attacker to obtain valid one.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference external" href="https://en.wikipedia.org/wiki/Cross-site_request_forgery">Cross-site request forgery on Wikipedia</a></p>
</div>
</div>
<div class="section" id="sql-injection">
<h3>SQL injection<a class="headerlink" href="#sql-injection" title="Permalink to this headline"></a></h3>
<p>As the whole purpose of phpMyAdmin is to preform sql queries, this is not our
first concern. SQL injection is sensitive to us though when it concerns the
mysql control connection. This controlconnection can have additional privileges
which the logged in user does not poses. E.g. access the <a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a>.</p>
<p>User data that is included in (administrative) queries should always be run
through DatabaseInterface::escapeSring().</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference external" href="https://en.wikipedia.org/wiki/SQL_injection">SQL injection on Wikipedia</a></p>
</div>
</div>
<div class="section" id="brute-force-attack">
<h3>Brute force attack<a class="headerlink" href="#brute-force-attack" title="Permalink to this headline"></a></h3>
<p>phpMyAdmin on its own does not rate limit authentication attempts in any way.
This is caused by need to work in stateless environment, where there is no way
to protect against such kind of things.</p>
<p>To mitigate this, you can use Captcha or utilize external tools such as
fail2ban, this is more details described in <a class="reference internal" href="setup.html#securing"><span class="std std-ref">Securing your phpMyAdmin installation</span></a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference external" href="https://en.wikipedia.org/wiki/Brute-force_attack">Brute force attack on Wikipedia</a></p>
</div>
</div>
</div>
<div class="section" id="reporting-security-issues">
<span id="reporting-security"></span><h2>Reporting security issues<a class="headerlink" href="#reporting-security-issues" title="Permalink to this headline"></a></h2>
<p>Should you find a security issue in the phpMyAdmin programming code, please
contact the <a class="reference external" href="mailto:security&#37;&#52;&#48;phpmyadmin&#46;net">phpMyAdmin security team</a> in
advance before publishing it. This way we can prepare a fix and release the fix together with your
announcement. You will be also given credit in our security announcement.
You can optionally encrypt your report with PGP key ID
<code class="docutils literal"><span class="pre">DA68AB39218AB947</span></code> with following fingerprint:</p>
<div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">pub 4096R/DA68AB39218AB947 2016-08-02</span>
<span class="go"> Key fingerprint = 5BAD 38CF B980 50B9 4BD7 FB5B DA68 AB39 218A B947</span>
<span class="go">uid phpMyAdmin Security Team &amp;lt;security@phpmyadmin.net&amp;gt;</span>
<span class="go">sub 4096R/5E4176FB497A31F7 2016-08-02</span>
</pre></div>
</div>
<p>The key can be either obtained from the keyserver or is available in
<a class="reference external" href="https://files.phpmyadmin.net/phpmyadmin.keyring">phpMyAdmin keyring</a>
available on our download server or using <a class="reference external" href="https://keybase.io/phpmyadmin_sec">Keybase</a>.</p>
<p>Should you have suggestion on improving phpMyAdmin to make it more secure, please
report that to our <a class="reference external" href="https://github.com/phpmyadmin/phpmyadmin/issues">issue tracker</a>.
Existing improvement suggestions can be found by
<a class="reference external" href="https://github.com/phpmyadmin/phpmyadmin/labels/hardening">hardening label</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Security policy</a><ul>
<li><a class="reference internal" href="#typical-vulnerabilities">Typical vulnerabilities</a><ul>
<li><a class="reference internal" href="#cross-site-scripting-xss">Cross-site scripting (XSS)</a></li>
<li><a class="reference internal" href="#cross-site-request-forgery-csrf">Cross-site request forgery (CSRF)</a></li>
<li><a class="reference internal" href="#sql-injection">SQL injection</a></li>
<li><a class="reference internal" href="#brute-force-attack">Brute force attack</a></li>
</ul>
</li>
<li><a class="reference internal" href="#reporting-security-issues">Reporting security issues</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="developers.html"
title="previous chapter">Developers Information</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="vendors.html"
title="next chapter">Distributing and packaging phpMyAdmin</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/security.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="vendors.html" title="Distributing and packaging phpMyAdmin"
>next</a> |</li>
<li class="right" >
<a href="developers.html" title="Developers Information"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,130 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configuring phpMyAdmin &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Two-factor authentication" href="two_factor.html" />
<link rel="prev" title="User Guide" href="user.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="two_factor.html" title="Two-factor authentication"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="user.html" title="User Guide"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="configuring-phpmyadmin">
<h1>Configuring phpMyAdmin<a class="headerlink" href="#configuring-phpmyadmin" title="Permalink to this headline"></a></h1>
<p>There are many configuration settings that can be used to customize the
interface. Those settings are described in
<a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a>. There are several layers of the configuration.</p>
<p>The global settings can be configured in <code class="file docutils literal"><span class="pre">config.inc.php</span></code> as described in
<a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a>. This is only way to configure connections to databases and other
system wide settings.</p>
<p>On top of this there are user settings which can be persistently stored in
<a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a>, possibly automatically configured through
<a class="reference internal" href="setup.html#zeroconf"><span class="std std-ref">Zero configuration</span></a>. If the <a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> are not configured, the settings
are temporarily stored in the session data; these are valid only until you
logout.</p>
<p>You can also save the user configuration for further use, either download them
as a file or to the browser local storage. You can find both those options in
the <span class="guilabel">Settings</span> tab. The settings stored in browser local storage will
be automatically offered for loading upon your login to phpMyAdmin.</p>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="user.html"
title="previous chapter">User Guide</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="two_factor.html"
title="next chapter">Two-factor authentication</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/settings.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="two_factor.html" title="Two-factor authentication"
>next</a> |</li>
<li class="right" >
<a href="user.html" title="User Guide"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,224 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Custom Themes &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Other sources of information" href="other.html" />
<link rel="prev" title="Import and export" href="import_export.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="other.html" title="Other sources of information"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="import_export.html" title="Import and export"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="custom-themes">
<span id="themes"></span><h1>Custom Themes<a class="headerlink" href="#custom-themes" title="Permalink to this headline"></a></h1>
<p>phpMyAdmin comes with support for third party themes. You can download
additonal themes from our website at &lt;<a class="reference external" href="https://www.phpmyadmin.net/themes/">https://www.phpmyadmin.net/themes/</a>&gt;.</p>
<div class="section" id="configuration">
<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h2>
<p>Themes are configured with <span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_ThemeManager"><code class="xref config config-option docutils literal"><span class="pre">$cfg['ThemeManager']</span></code></a> and
<span class="target" id="index-1"></span><a class="reference internal" href="config.html#cfg_ThemeDefault"><code class="xref config config-option docutils literal"><span class="pre">$cfg['ThemeDefault']</span></code></a>. Under <code class="file docutils literal"><span class="pre">./themes/</span></code>, you should not
delete the directory <code class="docutils literal"><span class="pre">pmahomme</span></code> or its underlying structure, because this is
the system theme used by phpMyAdmin. <code class="docutils literal"><span class="pre">pmahomme</span></code> contains all images and
styles, for backwards compatibility and for all themes that would not include
images or css-files. If <span class="target" id="index-2"></span><a class="reference internal" href="config.html#cfg_ThemeManager"><code class="xref config config-option docutils literal"><span class="pre">$cfg['ThemeManager']</span></code></a> is enabled, you
can select your favorite theme on the main page. Your selected theme will be
stored in a cookie.</p>
</div>
<div class="section" id="creating-custom-theme">
<h2>Creating custom theme<a class="headerlink" href="#creating-custom-theme" title="Permalink to this headline"></a></h2>
<p>To create a theme:</p>
<ul class="simple">
<li>make a new subdirectory (for example &#8220;your_theme_name&#8221;) under <code class="file docutils literal"><span class="pre">./themes/</span></code>.</li>
<li>copy the files and directories from <code class="docutils literal"><span class="pre">pmahomme</span></code> to &#8220;your_theme_name&#8221;</li>
<li>edit the css-files in &#8220;your_theme_name/css&#8221;</li>
<li>put your new images in &#8220;your_theme_name/img&#8221;</li>
<li>edit <code class="file docutils literal"><span class="pre">layout.inc.php</span></code> in &#8220;your_theme_name&#8221;</li>
<li>edit <code class="file docutils literal"><span class="pre">theme.json</span></code> in &#8220;your_theme_name&#8221; to contain theme metadata (see below)</li>
<li>make a new screenshot of your theme and save it under
&#8220;your_theme_name/screen.png&#8221;</li>
</ul>
<div class="section" id="theme-metadata">
<h3>Theme metadata<a class="headerlink" href="#theme-metadata" title="Permalink to this headline"></a></h3>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 4.8.0: </span>Before 4.8.0 the theme metadata was passed in the <code class="file docutils literal"><span class="pre">info.inc.php</span></code> file.
It has been replaced by <code class="file docutils literal"><span class="pre">theme.json</span></code> to allow easier parsing (without
need to handle PHP code) and to support additional features.</p>
</div>
<p>In theme directory there is file <code class="file docutils literal"><span class="pre">theme.json</span></code> which contains theme
metadata. Currently it consists of:</p>
<dl class="describe">
<dt>
<code class="descname">name</code></dt>
<dd><p>Display name of the theme.</p>
<p><strong>This field is required.</strong></p>
</dd></dl>
<dl class="describe">
<dt>
<code class="descname">version</code></dt>
<dd><p>Theme version, can be quite arbirary and does not have to match phpMyAdmin version.</p>
<p><strong>This field is required.</strong></p>
</dd></dl>
<dl class="describe">
<dt>
<code class="descname">desciption</code></dt>
<dd><p>Theme description. this will be shown on the website.</p>
<p><strong>This field is required.</strong></p>
</dd></dl>
<dl class="describe">
<dt>
<code class="descname">author</code></dt>
<dd><p>Theme author name.</p>
<p><strong>This field is required.</strong></p>
</dd></dl>
<dl class="describe">
<dt>
<code class="descname">url</code></dt>
<dd><p>Link to theme author website. It&#8217;s good idea to have way for getting
support there.</p>
</dd></dl>
<dl class="describe">
<dt>
<code class="descname">supports</code></dt>
<dd><p>Array of supported phpMyAdmin major versions.</p>
<p><strong>This field is required.</strong></p>
</dd></dl>
<p>For example, the definition for Original theme shipped with phpMyAdnin 4.8:</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Original&quot;</span><span class="p">,</span>
<span class="nt">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;4.8&quot;</span><span class="p">,</span>
<span class="nt">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;Original phpMyAdmin theme&quot;</span><span class="p">,</span>
<span class="nt">&quot;author&quot;</span><span class="p">:</span> <span class="s2">&quot;phpMyAdmin developers&quot;</span><span class="p">,</span>
<span class="nt">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://www.phpmyadmin.net/&quot;</span><span class="p">,</span>
<span class="nt">&quot;supports&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;4.8&quot;</span><span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="sharing-images">
<h3>Sharing images<a class="headerlink" href="#sharing-images" title="Permalink to this headline"></a></h3>
<p>If you do not want to use your own symbols and buttons, remove the
directory &#8220;img&#8221; in &#8220;your_theme_name&#8221;. phpMyAdmin will use the
default icons and buttons (from the system-theme <code class="docutils literal"><span class="pre">pmahomme</span></code>).</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Custom Themes</a><ul>
<li><a class="reference internal" href="#configuration">Configuration</a></li>
<li><a class="reference internal" href="#creating-custom-theme">Creating custom theme</a><ul>
<li><a class="reference internal" href="#theme-metadata">Theme metadata</a></li>
<li><a class="reference internal" href="#sharing-images">Sharing images</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="import_export.html"
title="previous chapter">Import and export</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="other.html"
title="next chapter">Other sources of information</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/themes.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="other.html" title="Other sources of information"
>next</a> |</li>
<li class="right" >
<a href="import_export.html" title="Import and export"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,245 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Transformations &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Bookmarks" href="bookmarks.html" />
<link rel="prev" title="Two-factor authentication" href="two_factor.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="bookmarks.html" title="Bookmarks"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="two_factor.html" title="Two-factor authentication"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="transformations">
<span id="id1"></span><h1>Transformations<a class="headerlink" href="#transformations" title="Permalink to this headline"></a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You need to have configured the <a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> for using transformations
feature.</p>
</div>
<div class="section" id="introduction">
<span id="transformationsintro"></span><h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>To enable transformations, you have to setup the <code class="docutils literal"><span class="pre">column_info</span></code>
table and the proper directives. Please see the <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a> on how to do so.</p>
<p>You can apply different transformations to the contents of each
column. The transformation will take the content of each column and
transform it with certain rules defined in the selected
transformation.</p>
<p>Say you have a column &#8216;filename&#8217; which contains a filename. Normally
you would see in phpMyAdmin only this filename. Using transformations
you can transform that filename into a HTML link, so you can click
inside of the phpMyAdmin structure on the column&#8217;s link and will see
the file displayed in a new browser window. Using transformation
options you can also specify strings to append/prepend to a string or
the format you want the output stored in.</p>
<p>For a general overview of all available transformations and their
options, you can consult your <em>&lt;www.your-host.com&gt;/&lt;your-install-
dir&gt;/transformation_overview.php</em> installation.</p>
<p>For a tutorial on how to effectively use transformations, see our
<a class="reference external" href="https://www.phpmyadmin.net/docs/">Link section</a> on the
official phpMyAdmin homepage.</p>
</div>
<div class="section" id="usage">
<span id="transformationshowto"></span><h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<p>Go to your <em>tbl_structure.php</em> page (i.e. reached through clicking on
the &#8216;Structure&#8217; link for a table). There click on &#8220;Change&#8221; (or change
icon) and there you will see three new fields at the end of the line.
They are called &#8216;MIME-type&#8217;, &#8216;Browser transformation&#8217; and
&#8216;Transformation options&#8217;.</p>
<ul class="simple">
<li>The field &#8216;MIME-type&#8217; is a drop-down field. Select the MIME-type that
corresponds to the column&#8217;s contents. Please note that transformations
are inactive as long as no MIME-type is selected.</li>
<li>The field &#8216;Browser transformation&#8217; is a drop-down field. You can
choose from a hopefully growing amount of pre-defined transformations.
See below for information on how to build your own transformation.
There are global transformations and mimetype-bound transformations.
Global transformations can be used for any mimetype. They will take
the mimetype, if necessary, into regard. Mimetype-bound
transformations usually only operate on a certain mimetype. There are
transformations which operate on the main mimetype (like &#8216;image&#8217;),
which will most likely take the subtype into regard, and those who
only operate on a specific subtype (like &#8216;image/jpeg&#8217;). You can use
transformations on mimetypes for which the function was not defined
for. There is no security check for you selected the right
transformation, so take care of what the output will be like.</li>
<li>The field &#8216;Transformation options&#8217; is a free-type textfield. You have
to enter transform-function specific options here. Usually the
transforms can operate with default options, but it is generally a
good idea to look up the overview to see which options are necessary.
Much like the ENUM/SET-Fields, you have to split up several options
using the format &#8216;a&#8217;,&#8217;b&#8217;,&#8217;c&#8217;,...(NOTE THE MISSING BLANKS). This is
because internally the options will be parsed as an array, leaving the
first value the first element in the array, and so forth. If you want
to specify a MIME character set you can define it in the
transformation_options. You have to put that outside of the pre-
defined options of the specific mime-transform, as the last value of
the set. Use the format &#8220;&#8217;; charset=XXX&#8217;&#8221;. If you use a transform, for
which you can specify 2 options and you want to append a character
set, enter &#8220;&#8216;first parameter&#8217;,&#8217;second parameter&#8217;,&#8217;charset=us-ascii&#8217;&#8221;.
You can, however use the defaults for the parameters: &#8220;&#8217;&#8216;,&#8217;&#8216;,&#8217;charset
=us-ascii&#8217;&#8221;. The default options can be configured using
<span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_DefaultTransformations"><code class="xref config config-option docutils literal"><span class="pre">$cfg['DefaultTransformations']</span></code></a></li>
</ul>
</div>
<div class="section" id="file-structure">
<span id="transformationsfiles"></span><h2>File structure<a class="headerlink" href="#file-structure" title="Permalink to this headline"></a></h2>
<p>All specific transformations for mimetypes are defined through class
files in the directory &#8216;libraries/classes/Plugins/Transformations/&#8217;. Each of
them extends a certain transformation abstract class declared in
libraries/classes/Plugins/Transformations/Abs.</p>
<p>They are stored in files to ease up customization and easy adding of
new transformations.</p>
<p>Because the user cannot enter own mimetypes, it is kept sure that
transformations always work. It makes no sense to apply a
transformation to a mimetype the transform-function doesn&#8217;t know to
handle.</p>
<p>There is a file called &#8216;<em>transformations.lib.php</em>&#8216; that provides some
basic functions which can be included by any other transform function.</p>
<p>The file name convention is <code class="docutils literal"><span class="pre">[Mimetype]_[Subtype]_[Transformation</span>
<span class="pre">Name].class.php</span></code>, while the abtract class that it extends has the
name <code class="docutils literal"><span class="pre">[Transformation</span> <span class="pre">Name]TransformationsPlugin</span></code>. All of the
methods that have to be implemented by a transformations plug-in are:</p>
<ol class="arabic simple">
<li>getMIMEType() and getMIMESubtype() in the main class;</li>
<li>getName(), getInfo() and applyTransformation() in the abstract class
it extends.</li>
</ol>
<p>The getMIMEType(), getMIMESubtype() and getName() methods return the
name of the MIME type, MIME Subtype and transformation accordingly.
getInfo() returns the transformation&#8217;s description and possible
options it may receive and applyTransformation() is the method that
does the actual work of the transformation plug-in.</p>
<p>Please see the libraries/classes/Plugins/Transformations/TEMPLATE and
libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT files for adding
your own transformation plug-in. You can also generate a new
transformation plug-in (with or without the abstract transformation
class), by using
<code class="file docutils literal"><span class="pre">scripts/transformations_generator_plugin.sh</span></code> or
<code class="file docutils literal"><span class="pre">scripts/transformations_generator_main_class.sh</span></code>.</p>
<p>The applyTransformation() method always gets passed three variables:</p>
<ol class="arabic simple">
<li><strong>$buffer</strong> - Contains the text inside of the column. This is the
text, you want to transform.</li>
<li><strong>$options</strong> - Contains any user-passed options to a transform
function as an array.</li>
<li><strong>$meta</strong> - Contains an object with information about your column. The
data is drawn from the output of the <a class="reference external" href="https://secure.php.net/mysql_fetch_field">mysql_fetch_field()</a> function. This means, all
object properties described on the <a class="reference external" href="https://secure.php.net/mysql_fetch_field">manual page</a> are available in this
variable and can be used to transform a column accordingly to
unsigned/zerofill/not_null/... properties. The $meta-&gt;mimetype
variable contains the original MIME-type of the column (i.e.
&#8216;text/plain&#8217;, &#8216;image/jpeg&#8217; etc.)</li>
</ol>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Transformations</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#usage">Usage</a></li>
<li><a class="reference internal" href="#file-structure">File structure</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="two_factor.html"
title="previous chapter">Two-factor authentication</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="bookmarks.html"
title="next chapter">Bookmarks</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/transformations.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="bookmarks.html" title="Bookmarks"
>next</a> |</li>
<li class="right" >
<a href="two_factor.html" title="Two-factor authentication"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,178 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Two-factor authentication &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="up" title="User Guide" href="user.html" />
<link rel="next" title="Transformations" href="transformations.html" />
<link rel="prev" title="Configuring phpMyAdmin" href="settings.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="transformations.html" title="Transformations"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="settings.html" title="Configuring phpMyAdmin"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" accesskey="U">User Guide</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="two-factor-authentication">
<span id="fa"></span><h1>Two-factor authentication<a class="headerlink" href="#two-factor-authentication" title="Permalink to this headline"></a></h1>
<div class="versionadded">
<p><span class="versionmodified">New in version 4.8.0.</span></p>
</div>
<p>Since phpMyAdmin 4.8.0 you can configure two-factor authentication to be
used when logging in. To use this, you first need to configure the
<a class="reference internal" href="setup.html#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a>. Once this is done, every user can opt-in for second
authentication factor in the <span class="guilabel">Settings</span>.</p>
<p>When running phpMyAdmin from the Git source repository, the dependencies must be installed
manually; the typical way of doing so is with the command:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>composer require pragmarx/google2fa bacon/bacon-qr-code
</pre></div>
</div>
<p>Or when using a hardware security key with FIDO U2F:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>composer require samyoul/u2f-php-server
</pre></div>
</div>
<div class="section" id="authentication-application-2fa">
<h2>Authentication Application (2FA)<a class="headerlink" href="#authentication-application-2fa" title="Permalink to this headline"></a></h2>
<p>Using application for authentication is quite common approach based on HOTP and
<a class="reference external" href="https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm">TOTP</a>.
It is based on transmitting private key from phpMyAdmin to the authentication
application and the application is then able to generate one time codes based
on this key.</p>
<p>There are dozens of applications available for mobile phones to implement these
standards, the most widely used include:</p>
<ul class="simple">
<li><a class="reference external" href="https://freeotp.github.io/">FreeOTP for iOS, Android and Pebble</a></li>
<li><a class="reference external" href="https://authy.com/">Authy for iOS, Android, Chrome, OS X</a></li>
<li><a class="reference external" href="https://itunes.apple.com/us/app/google-authenticator/id388497605">Google Authenticator for iOS</a></li>
<li><a class="reference external" href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2">Google Authenticator for Android</a></li>
<li><a class="reference external" href="https://lastpass.com/auth/">LastPass Authenticator for iOS, Android, OS X, Windows</a></li>
</ul>
</div>
<div class="section" id="hardware-security-key-fido-u2f">
<h2>Hardware Security Key (FIDO U2F)<a class="headerlink" href="#hardware-security-key-fido-u2f" title="Permalink to this headline"></a></h2>
<p>Using hardware tokens is considered to be more secure than software based
solution. phpMyAdmin supports <a class="reference external" href="https://en.wikipedia.org/wiki/Universal_2nd_Factor">FIDO U2F</a>
tokens.</p>
<p>There are several manufacturers of these tokens, for example:</p>
<ul class="simple">
<li><a class="reference external" href="https://www.yubico.com/solutions/fido-u2f/">youbico FIDO U2F Security Key</a></li>
<li><a class="reference external" href="https://www.hypersecu.com/products/hyperfido">HyperFIDO</a></li>
<li><a class="reference external" href="https://shop.trezor.io?a=572b241135e1">TREZOR Bitcoin wallet</a> can <a class="reference external" href="https://doc.satoshilabs.com/trezor-user/u2f.html">act as an U2F token</a></li>
</ul>
</div>
<div class="section" id="simple-two-factor-authentication">
<span id="simple2fa"></span><h2>Simple two-factor authentication<a class="headerlink" href="#simple-two-factor-authentication" title="Permalink to this headline"></a></h2>
<p>This authentication is included for testing and demostration purposes only as
it really does not provide two-factor authentication, it just asks user to confirm login by
clicking on the button.</p>
<p>It should not be used in the production and is disabled unless
<span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_DBG_simple2fa"><code class="xref config config-option docutils literal"><span class="pre">$cfg['DBG']['simple2fa']</span></code></a> is set.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Two-factor authentication</a><ul>
<li><a class="reference internal" href="#authentication-application-2fa">Authentication Application (2FA)</a></li>
<li><a class="reference internal" href="#hardware-security-key-fido-u2f">Hardware Security Key (FIDO U2F)</a></li>
<li><a class="reference internal" href="#simple-two-factor-authentication">Simple two-factor authentication</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="settings.html"
title="previous chapter">Configuring phpMyAdmin</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="transformations.html"
title="next chapter">Transformations</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/two_factor.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="transformations.html" title="Transformations"
>next</a> |</li>
<li class="right" >
<a href="settings.html" title="Configuring phpMyAdmin"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="user.html" >User Guide</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,169 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>User Guide &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="next" title="Configuring phpMyAdmin" href="settings.html" />
<link rel="prev" title="Configuration" href="config.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="settings.html" title="Configuring phpMyAdmin"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="config.html" title="Configuration"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="user-guide">
<h1>User Guide<a class="headerlink" href="#user-guide" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="settings.html">Configuring phpMyAdmin</a></li>
<li class="toctree-l1"><a class="reference internal" href="two_factor.html">Two-factor authentication</a><ul>
<li class="toctree-l2"><a class="reference internal" href="two_factor.html#authentication-application-2fa">Authentication Application (2FA)</a></li>
<li class="toctree-l2"><a class="reference internal" href="two_factor.html#hardware-security-key-fido-u2f">Hardware Security Key (FIDO U2F)</a></li>
<li class="toctree-l2"><a class="reference internal" href="two_factor.html#simple-two-factor-authentication">Simple two-factor authentication</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="transformations.html">Transformations</a><ul>
<li class="toctree-l2"><a class="reference internal" href="transformations.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="transformations.html#usage">Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="transformations.html#file-structure">File structure</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="bookmarks.html">Bookmarks</a><ul>
<li class="toctree-l2"><a class="reference internal" href="bookmarks.html#storing-bookmarks">Storing bookmarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="bookmarks.html#variables-inside-bookmarks">Variables inside bookmarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="bookmarks.html#browsing-table-using-bookmark">Browsing table using bookmark</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="privileges.html">User management</a><ul>
<li class="toctree-l2"><a class="reference internal" href="privileges.html#creating-a-new-user">Creating a new user</a></li>
<li class="toctree-l2"><a class="reference internal" href="privileges.html#editing-an-existing-user">Editing an existing user</a></li>
<li class="toctree-l2"><a class="reference internal" href="privileges.html#deleting-a-user">Deleting a user</a></li>
<li class="toctree-l2"><a class="reference internal" href="privileges.html#assigning-privileges-to-user-for-a-specific-database">Assigning privileges to user for a specific database</a></li>
<li class="toctree-l2"><a class="reference internal" href="privileges.html#configurable-menus-and-user-groups">Configurable menus and user groups</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="relations.html">Relations</a><ul>
<li class="toctree-l2"><a class="reference internal" href="relations.html#technical-info">Technical info</a></li>
<li class="toctree-l2"><a class="reference internal" href="relations.html#relation-view">Relation view</a></li>
<li class="toctree-l2"><a class="reference internal" href="relations.html#designer">Designer</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="charts.html">Charts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="charts.html#chart-implementation">Chart implementation</a></li>
<li class="toctree-l2"><a class="reference internal" href="charts.html#examples">Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="import_export.html">Import and export</a><ul>
<li class="toctree-l2"><a class="reference internal" href="import_export.html#import">Import</a></li>
<li class="toctree-l2"><a class="reference internal" href="import_export.html#export">Export</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="themes.html">Custom Themes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="themes.html#configuration">Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="themes.html#creating-custom-theme">Creating custom theme</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="other.html">Other sources of information</a><ul>
<li class="toctree-l2"><a class="reference internal" href="other.html#printed-book">Printed Book</a></li>
<li class="toctree-l2"><a class="reference internal" href="other.html#tutorials">Tutorials</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="config.html"
title="previous chapter">Configuration</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="settings.html"
title="next chapter">Configuring phpMyAdmin</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/user.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="settings.html" title="Configuring phpMyAdmin"
>next</a> |</li>
<li class="right" >
<a href="config.html" title="Configuration"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,145 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Distributing and packaging phpMyAdmin &#8212; phpMyAdmin 4.8.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.8.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="top" title="phpMyAdmin 4.8.4 documentation" href="index.html" />
<link rel="next" title="Copyright" href="copyright.html" />
<link rel="prev" title="Security policy" href="security.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="copyright.html" title="Copyright"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="security.html" title="Security policy"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="distributing-and-packaging-phpmyadmin">
<h1>Distributing and packaging phpMyAdmin<a class="headerlink" href="#distributing-and-packaging-phpmyadmin" title="Permalink to this headline"></a></h1>
<p>This document is intended to give advices to people who want to
redistribute phpMyAdmin inside other software package such as Linux
distribution or some all in one package including web server and MySQL
server.</p>
<p>Generally you can customize some basic aspects (paths to some files and
behavior) in <code class="file docutils literal"><span class="pre">libraries/vendor_config.php</span></code>.</p>
<p>For example if you want setup script to generate config file in var, change
<code class="docutils literal"><span class="pre">SETUP_CONFIG_FILE</span></code> to <code class="file docutils literal"><span class="pre">/var/lib/phpmyadmin/config.inc.php</span></code> and you
will also probably want to skip directory writable check, so set
<code class="docutils literal"><span class="pre">SETUP_DIR_WRITABLE</span></code> to false.</p>
<div class="section" id="external-libraries">
<h2>External libraries<a class="headerlink" href="#external-libraries" title="Permalink to this headline"></a></h2>
<p>phpMyAdmin includes several external libraries, you might want to
replace them with system ones if they are available, but please note
that you should test whether version you provide is compatible with the
one we ship.</p>
<p>Currently known list of external libraries:</p>
<dl class="docutils">
<dt>js/jquery</dt>
<dd>jQuery js framework and various jQuery based libraries.</dd>
<dt>vendor/</dt>
<dd>The download kit includes various Composer packages as
dependencies.</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Distributing and packaging phpMyAdmin</a><ul>
<li><a class="reference internal" href="#external-libraries">External libraries</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="security.html"
title="previous chapter">Security policy</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="copyright.html"
title="next chapter">Copyright</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/vendors.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="copyright.html" title="Copyright"
>next</a> |</li>
<li class="right" >
<a href="security.html" title="Security policy"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.4 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>

View File

@ -1,135 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Handle error report submission
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\ErrorReport;
use PhpMyAdmin\Message;
use PhpMyAdmin\Response;
use PhpMyAdmin\UserPreferences;
use PhpMyAdmin\Utils\HttpRequest;
require_once 'libraries/common.inc.php';
if (!isset($_POST['exception_type'])
||!in_array($_POST['exception_type'], array('js', 'php'))
) {
die('Oops, something went wrong!!');
}
$response = Response::getInstance();
$errorReport = new ErrorReport(new HttpRequest());
if (isset($_POST['send_error_report'])
&& ($_POST['send_error_report'] == true
|| $_POST['send_error_report'] == '1')
) {
if ($_POST['exception_type'] == 'php') {
/**
* Prevent infinite error submission.
* Happens in case error submissions fails.
* If reporting is done in some time interval,
* just clear them & clear json data too.
*/
if (isset($_SESSION['prev_error_subm_time'])
&& isset($_SESSION['error_subm_count'])
&& $_SESSION['error_subm_count'] >= 3
&& ($_SESSION['prev_error_subm_time']-time()) <= 3000
) {
$_SESSION['error_subm_count'] = 0;
$_SESSION['prev_errors'] = '';
$response->addJSON('_stopErrorReportLoop', '1');
} else {
$_SESSION['prev_error_subm_time'] = time();
$_SESSION['error_subm_count'] = (
(isset($_SESSION['error_subm_count']))
? ($_SESSION['error_subm_count']+1)
: (0)
);
}
}
$reportData = $errorReport->getData($_POST['exception_type']);
// report if and only if there were 'actual' errors.
if (count($reportData) > 0) {
$server_response = $errorReport->send($reportData);
if ($server_response === false) {
$success = false;
} else {
$decoded_response = json_decode($server_response, true);
$success = !empty($decoded_response) ?
$decoded_response["success"] : false;
}
/* Message to show to the user */
if ($success) {
if ((isset($_POST['automatic'])
&& $_POST['automatic'] === "true")
|| $GLOBALS['cfg']['SendErrorReports'] == 'always'
) {
$msg = __(
'An error has been detected and an error report has been '
. 'automatically submitted based on your settings.'
);
} else {
$msg = __('Thank you for submitting this report.');
}
} else {
$msg = __(
'An error has been detected and an error report has been '
. 'generated but failed to be sent.'
)
. ' '
. __(
'If you experience any '
. 'problems please submit a bug report manually.'
);
}
$msg .= ' ' . __('You may want to refresh the page.');
/* Create message object */
if ($success) {
$msg = Message::notice($msg);
} else {
$msg = Message::error($msg);
}
/* Add message to response */
if ($response->isAjax()) {
if ($_POST['exception_type'] == 'js') {
$response->addJSON('message', $msg);
} else {
$response->addJSON('_errSubmitMsg', $msg);
}
} elseif ($_POST['exception_type'] == 'php') {
$jsCode = 'PMA_ajaxShowMessage("<div class=\"error\">'
. $msg
. '</div>", false);';
$response->getFooter()->getScripts()->addCode($jsCode);
}
if ($_POST['exception_type'] == 'php') {
// clear previous errors & save new ones.
$GLOBALS['error_handler']->savePreviousErrors();
}
/* Persist always send settings */
if (isset($_POST['always_send'])
&& $_POST['always_send'] === "true"
) {
$userPreferences = new UserPreferences();
$userPreferences->persistOption("SendErrorReports", "always", "ask");
}
}
} elseif (! empty($_POST['get_settings'])) {
$response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
} else {
if ($_POST['exception_type'] == 'js') {
$response->addHTML($errorReport->getForm());
} else {
// clear previous errors & save new ones.
$GLOBALS['error_handler']->savePreviousErrors();
}
}

View File

@ -1,552 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Main export handling code
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Core;
use PhpMyAdmin\Encoding;
use PhpMyAdmin\Export;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\ExportPlugin;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Sanitize;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
use PhpMyAdmin\Response;
/**
* Get the variables sent or posted to this script and a core script
*/
include_once 'libraries/common.inc.php';
/**
* If we are sending the export file (as opposed to just displaying it
* as text), we have to bypass the usual PhpMyAdmin\Response mechanism
*/
if (isset($_POST['output_format']) && $_POST['output_format'] == 'sendit') {
$response = Response::getInstance();
$response->disable();
}
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('export_output.js');
//check if it's the GET request to check export time out
if (isset($_GET['check_time_out'])) {
if (isset($_SESSION['pma_export_error'])) {
$err = $_SESSION['pma_export_error'];
unset($_SESSION['pma_export_error']);
echo "timeout";
} else {
echo "success";
}
exit;
}
/**
* Sets globals from $_POST
*
* - Please keep the parameters in order of their appearance in the form
* - Some of these parameters are not used, as the code below directly
* verifies from the superglobal $_POST or $_REQUEST
* TODO: this should be removed to avoid passing user input to GLOBALS
* without checking
*/
$post_params = array(
'db',
'table',
'what',
'single_table',
'export_type',
'export_method',
'quick_or_custom',
'db_select',
'table_select',
'table_structure',
'table_data',
'limit_to',
'limit_from',
'allrows',
'lock_tables',
'output_format',
'filename_template',
'maxsize',
'remember_template',
'charset',
'compression',
'as_separate_files',
'knjenc',
'xkana',
'htmlword_structure_or_data',
'htmlword_null',
'htmlword_columns',
'mediawiki_headers',
'mediawiki_structure_or_data',
'mediawiki_caption',
'pdf_structure_or_data',
'odt_structure_or_data',
'odt_relation',
'odt_comments',
'odt_mime',
'odt_columns',
'odt_null',
'codegen_structure_or_data',
'codegen_format',
'excel_null',
'excel_removeCRLF',
'excel_columns',
'excel_edition',
'excel_structure_or_data',
'yaml_structure_or_data',
'ods_null',
'ods_structure_or_data',
'ods_columns',
'json_structure_or_data',
'json_pretty_print',
'json_unicode',
'xml_structure_or_data',
'xml_export_events',
'xml_export_functions',
'xml_export_procedures',
'xml_export_tables',
'xml_export_triggers',
'xml_export_views',
'xml_export_contents',
'texytext_structure_or_data',
'texytext_columns',
'texytext_null',
'phparray_structure_or_data',
'sql_include_comments',
'sql_header_comment',
'sql_dates',
'sql_relation',
'sql_mime',
'sql_use_transaction',
'sql_disable_fk',
'sql_compatibility',
'sql_structure_or_data',
'sql_create_database',
'sql_drop_table',
'sql_procedure_function',
'sql_create_table',
'sql_create_view',
'sql_create_trigger',
'sql_if_not_exists',
'sql_auto_increment',
'sql_backquotes',
'sql_truncate',
'sql_delayed',
'sql_ignore',
'sql_type',
'sql_insert_syntax',
'sql_max_query_size',
'sql_hex_for_binary',
'sql_utc_time',
'sql_drop_database',
'sql_views_as_tables',
'sql_metadata',
'csv_separator',
'csv_enclosed',
'csv_escaped',
'csv_terminated',
'csv_null',
'csv_removeCRLF',
'csv_columns',
'csv_structure_or_data',
// csv_replace should have been here but we use it directly from $_POST
'latex_caption',
'latex_structure_or_data',
'latex_structure_caption',
'latex_structure_continued_caption',
'latex_structure_label',
'latex_relation',
'latex_comments',
'latex_mime',
'latex_columns',
'latex_data_caption',
'latex_data_continued_caption',
'latex_data_label',
'latex_null',
'aliases'
);
foreach ($post_params as $one_post_param) {
if (isset($_POST[$one_post_param])) {
$GLOBALS[$one_post_param] = $_POST[$one_post_param];
}
}
$table = $GLOBALS['table'];
PhpMyAdmin\Util::checkParameters(array('what', 'export_type'));
// sanitize this parameter which will be used below in a file inclusion
$what = Core::securePath($_POST['what']);
// export class instance, not array of properties, as before
/* @var $export_plugin ExportPlugin */
$export_plugin = Plugins::getPlugin(
"export",
$what,
'libraries/classes/Plugins/Export/',
array(
'export_type' => $export_type,
'single_table' => isset($single_table)
)
);
// Check export type
if (empty($export_plugin)) {
Core::fatalError(__('Bad type!'));
}
/**
* valid compression methods
*/
$compression_methods = array(
'zip',
'gzip'
);
/**
* init and variable checking
*/
$compression = false;
$onserver = false;
$save_on_server = false;
$buffer_needed = false;
$back_button = '';
$refreshButton = '';
$save_filename = '';
$file_handle = '';
$err_url = '';
$filename = '';
$separate_files = '';
// Is it a quick or custom export?
if (isset($_POST['quick_or_custom'])
&& $_POST['quick_or_custom'] == 'quick'
) {
$quick_export = true;
} else {
$quick_export = false;
}
if ($_POST['output_format'] == 'astext') {
$asfile = false;
} else {
$asfile = true;
if (isset($_POST['as_separate_files'])
&& ! empty($_POST['as_separate_files'])
) {
if (isset($_POST['compression'])
&& ! empty($_POST['compression'])
&& $_POST['compression'] == 'zip'
) {
$separate_files = $_POST['as_separate_files'];
}
}
if (in_array($_POST['compression'], $compression_methods)) {
$compression = $_POST['compression'];
$buffer_needed = true;
}
if (($quick_export && ! empty($_POST['quick_export_onserver']))
|| (! $quick_export && ! empty($_POST['onserver']))
) {
if ($quick_export) {
$onserver = $_POST['quick_export_onserver'];
} else {
$onserver = $_POST['onserver'];
}
// Will we save dump on server?
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
}
}
// Generate error url and check for needed variables
if ($export_type == 'server') {
$err_url = 'server_export.php' . Url::getCommon();
} elseif ($export_type == 'database' && strlen($db) > 0) {
$err_url = 'db_export.php' . Url::getCommon(array('db' => $db));
// Check if we have something to export
if (isset($table_select)) {
$tables = $table_select;
} else {
$tables = array();
}
} elseif ($export_type == 'table' && strlen($db) > 0 && strlen($table) > 0) {
$err_url = 'tbl_export.php' . Url::getCommon(
array(
'db' => $db, 'table' => $table
)
);
} else {
Core::fatalError(__('Bad parameters!'));
}
// Merge SQL Query aliases with Export aliases from
// export page, Export page aliases are given more
// preference over SQL Query aliases.
$parser = new \PhpMyAdmin\SqlParser\Parser($sql_query);
$aliases = array();
if ((!empty($parser->statements[0]))
&& ($parser->statements[0] instanceof \PhpMyAdmin\SqlParser\Statements\SelectStatement)
) {
$aliases = \PhpMyAdmin\SqlParser\Utils\Misc::getAliases($parser->statements[0], $db);
}
if (!empty($_POST['aliases'])) {
$aliases = Export::mergeAliases($aliases, $_POST['aliases']);
$_SESSION['tmpval']['aliases'] = $_POST['aliases'];
}
/**
* Increase time limit for script execution and initializes some variables
*/
Util::setTimeLimit();
if (! empty($cfg['MemoryLimit'])) {
ini_set('memory_limit', $cfg['MemoryLimit']);
}
register_shutdown_function('PhpMyAdmin\Export::shutdown');
// Start with empty buffer
$dump_buffer = '';
$dump_buffer_len = 0;
// Array of dump_buffers - used in separate file exports
$dump_buffer_objects = array();
// We send fake headers to avoid browser timeout when buffering
$time_start = time();
// Defines the default <CR><LF> format.
// For SQL always use \n as MySQL wants this on all platforms.
if ($what == 'sql') {
$crlf = "\n";
} else {
$crlf = PHP_EOL;
}
$output_kanji_conversion = Encoding::canConvertKanji();
// Do we need to convert charset?
$output_charset_conversion = $asfile
&& Encoding::isSupported()
&& isset($charset) && $charset != 'utf-8';
// Use on the fly compression?
$GLOBALS['onfly_compression'] = $GLOBALS['cfg']['CompressOnFly']
&& $compression == 'gzip';
if ($GLOBALS['onfly_compression']) {
$GLOBALS['memory_limit'] = Export::getMemoryLimit();
}
// Generate filename and mime type if needed
if ($asfile) {
if (empty($remember_template)) {
$remember_template = '';
}
list($filename, $mime_type) = Export::getFilenameAndMimetype(
$export_type, $remember_template, $export_plugin, $compression,
$filename_template
);
} else {
$mime_type = '';
}
// Open file on server if needed
if ($save_on_server) {
list($save_filename, $message, $file_handle) = Export::openFile(
$filename, $quick_export
);
// problem opening export file on server?
if (! empty($message)) {
Export::showPage($db, $table, $export_type);
}
} else {
/**
* Send headers depending on whether the user chose to download a dump file
* or not
*/
if ($asfile) {
// Download
// (avoid rewriting data containing HTML with anchors and forms;
// this was reported to happen under Plesk)
ini_set('url_rewriter.tags', '');
$filename = Sanitize::sanitizeFilename($filename);
Core::downloadHeader($filename, $mime_type);
} else {
// HTML
if ($export_type == 'database') {
$num_tables = count($tables);
if ($num_tables == 0) {
$message = PhpMyAdmin\Message::error(
__('No tables found in database.')
);
$active_page = 'db_export.php';
include 'db_export.php';
exit();
}
}
list($html, $back_button, $refreshButton) = Export::getHtmlForDisplayedExportHeader(
$export_type, $db, $table
);
echo $html;
unset($html);
} // end download
}
$relation = new Relation();
// Fake loop just to allow skip of remain of this code by break, I'd really
// need exceptions here :-)
do {
// Re - initialize
$dump_buffer = '';
$dump_buffer_len = 0;
// Add possibly some comments to export
if (! $export_plugin->exportHeader()) {
break;
}
// Will we need relation & co. setup?
$do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_include_comments'])
|| isset($GLOBALS[$what . '_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
$cfgRelation = $relation->getRelationsParam();
}
// Include dates in export?
$do_dates = isset($GLOBALS[$what . '_dates']);
$whatStrucOrData = $GLOBALS[$what . '_structure_or_data'];
/**
* Builds the dump
*/
if ($export_type == 'server') {
if (! isset($db_select)) {
$db_select = '';
}
Export::exportServer(
$db_select, $whatStrucOrData, $export_plugin, $crlf, $err_url,
$export_type, $do_relation, $do_comments, $do_mime, $do_dates,
$aliases, $separate_files
);
} elseif ($export_type == 'database') {
if (!isset($table_structure) || !is_array($table_structure)) {
$table_structure = array();
}
if (!isset($table_data) || !is_array($table_data)) {
$table_data = array();
}
if (!empty($_POST['structure_or_data_forced'])) {
$table_structure = $tables;
$table_data = $tables;
}
if (isset($lock_tables)) {
Export::lockTables($db, $tables, "READ");
try {
Export::exportDatabase(
$db, $tables, $whatStrucOrData, $table_structure,
$table_data, $export_plugin, $crlf, $err_url, $export_type,
$do_relation, $do_comments, $do_mime, $do_dates, $aliases,
$separate_files
);
} finally {
Export::unlockTables();
}
} else {
Export::exportDatabase(
$db, $tables, $whatStrucOrData, $table_structure, $table_data,
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
$do_comments, $do_mime, $do_dates, $aliases, $separate_files
);
}
} else {
// We export just one table
// $allrows comes from the form when "Dump all rows" has been selected
if (! isset($allrows)) {
$allrows = '';
}
if (! isset($limit_to)) {
$limit_to = 0;
}
if (! isset($limit_from)) {
$limit_from = 0;
}
if (isset($lock_tables)) {
try {
Export::lockTables($db, array($table), "READ");
Export::exportTable(
$db, $table, $whatStrucOrData, $export_plugin, $crlf,
$err_url, $export_type, $do_relation, $do_comments,
$do_mime, $do_dates, $allrows, $limit_to, $limit_from,
$sql_query, $aliases
);
} finally {
Export::unlockTables();
}
} else {
Export::exportTable(
$db, $table, $whatStrucOrData, $export_plugin, $crlf, $err_url,
$export_type, $do_relation, $do_comments, $do_mime, $do_dates,
$allrows, $limit_to, $limit_from, $sql_query, $aliases
);
}
}
if (! $export_plugin->exportFooter()) {
break;
}
} while (false);
// End of fake loop
if ($save_on_server && ! empty($message)) {
Export::showPage($db, $table, $export_type);
}
/**
* Send the dump as a file...
*/
if (empty($asfile)) {
echo Export::getHtmlForDisplayedExportFooter($back_button, $refreshButton);
return;
} // end if
// Convert the charset if required.
if ($output_charset_conversion) {
$dump_buffer = Encoding::convertString(
'utf-8',
$GLOBALS['charset'],
$dump_buffer
);
}
// Compression needed?
if ($compression) {
if (! empty($separate_files)) {
$dump_buffer = Export::compress(
$dump_buffer_objects, $compression, $filename
);
} else {
$dump_buffer = Export::compress($dump_buffer, $compression, $filename);
}
}
/* If we saved on server, we have to close file now */
if ($save_on_server) {
$message = Export::closeFile(
$file_handle, $dump_buffer, $save_filename
);
Export::showPage($db, $table, $export_type);
} else {
echo $dump_buffer;
}

View File

@ -1,434 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Editor for Geometry data types.
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Core;
use PhpMyAdmin\Gis\GisFactory;
use PhpMyAdmin\Gis\GisVisualization;
use PhpMyAdmin\Response;
use PhpMyAdmin\Url;
/**
* Escapes special characters if the variable is set.
* Returns an empty string otherwise.
*
* @param string $variable variable to be escaped
*
* @return string escaped variable
*/
function escape($variable)
{
return isset($variable) ? htmlspecialchars($variable) : '';
}
require_once 'libraries/common.inc.php';
if (! isset($_POST['field'])) {
PhpMyAdmin\Util::checkParameters(array('field'));
}
// Get data if any posted
$gis_data = array();
if (Core::isValid($_POST['gis_data'], 'array')) {
$gis_data = $_POST['gis_data'];
}
$gis_types = array(
'POINT',
'MULTIPOINT',
'LINESTRING',
'MULTILINESTRING',
'POLYGON',
'MULTIPOLYGON',
'GEOMETRYCOLLECTION'
);
// Extract type from the initial call and make sure that it's a valid one.
// Extract from field's values if available, if not use the column type passed.
if (! isset($gis_data['gis_type'])) {
if (isset($_POST['type']) && $_POST['type'] != '') {
$gis_data['gis_type'] = mb_strtoupper($_POST['type']);
}
if (isset($_POST['value']) && trim($_POST['value']) != '') {
$start = (substr($_POST['value'], 0, 1) == "'") ? 1 : 0;
$gis_data['gis_type'] = mb_substr(
$_POST['value'],
$start,
mb_strpos($_POST['value'], "(") - $start
);
}
if ((! isset($gis_data['gis_type']))
|| (! in_array($gis_data['gis_type'], $gis_types))
) {
$gis_data['gis_type'] = $gis_types[0];
}
}
$geom_type = htmlspecialchars($gis_data['gis_type']);
// Generate parameters from value passed.
$gis_obj = GisFactory::factory($geom_type);
if (isset($_POST['value'])) {
$gis_data = array_merge(
$gis_data, $gis_obj->generateParams($_POST['value'])
);
}
// Generate Well Known Text
$srid = (isset($gis_data['srid']) && $gis_data['srid'] != '')
? htmlspecialchars($gis_data['srid']) : 0;
$wkt = $gis_obj->generateWkt($gis_data, 0);
$wkt_with_zero = $gis_obj->generateWkt($gis_data, 0, '0');
$result = "'" . $wkt . "'," . $srid;
// Generate SVG based visualization
$visualizationSettings = array(
'width' => 450,
'height' => 300,
'spatialColumn' => 'wkt'
);
$data = array(array('wkt' => $wkt_with_zero, 'srid' => $srid));
$visualization = GisVisualization::getByData($data, $visualizationSettings)
->toImage('svg');
$open_layers = GisVisualization::getByData($data, $visualizationSettings)
->asOl();
// If the call is to update the WKT and visualization make an AJAX response
if (isset($_POST['generate']) && $_POST['generate'] == true) {
$extra_data = array(
'result' => $result,
'visualization' => $visualization,
'openLayers' => $open_layers,
);
$response = Response::getInstance();
$response->addJSON($extra_data);
exit;
}
ob_start();
echo '<form id="gis_data_editor_form" action="gis_data_editor.php" method="post">';
echo '<input type="hidden" id="pmaThemeImage"'
, ' value="' , $GLOBALS['pmaThemeImage'] , '" />';
echo '<div id="gis_data_editor">';
echo '<h3>';
printf(
__('Value for the column "%s"'),
htmlspecialchars($_POST['field'])
);
echo '</h3>';
echo '<input type="hidden" name="field" value="'
, htmlspecialchars($_POST['field']) , '" />';
// The input field to which the final result should be added
// and corresponding null checkbox
if (isset($_POST['input_name'])) {
echo '<input type="hidden" name="input_name" value="'
, htmlspecialchars($_POST['input_name']) , '" />';
}
echo Url::getHiddenInputs();
echo '<!-- Visualization section -->';
echo '<div id="placeholder" '
, ($srid != 0 ? 'class="hide' : '') , '">';
echo $visualization;
echo '</div>';
echo '<div id="openlayersmap" '
, ($srid == 0 ? 'class="hide' : '') , '">';
echo '</div>';
echo '<div class="choice floatright">';
echo '<input type="checkbox" id="choice" value="useBaseLayer"'
, ($srid != 0 ? ' checked="checked"' : '') , '/>';
echo '<label for="choice">' , __("Use OpenStreetMaps as Base Layer") , '</label>';
echo '</div>';
echo '<script language="javascript" type="text/javascript">';
echo $open_layers;
echo '</script>';
echo '<!-- End of visualization section -->';
echo '<!-- Header section - Inclueds GIS type selector and input field for SRID -->';
echo '<div id="gis_data_header">';
echo '<select name="gis_data[gis_type]" class="gis_type">';
foreach ($gis_types as $gis_type) {
echo '<option value="' , $gis_type , '"';
if ($geom_type == $gis_type) {
echo ' selected="selected"';
}
echo '>' , $gis_type , '</option>';
}
echo '</select>';
echo '&nbsp;&nbsp;&nbsp;&nbsp;';
/* l10n: Spatial Reference System Identifier */
echo '<label for="srid">' , __('SRID:') , '</label>';
echo '<input name="gis_data[srid]" type="text" value="' , $srid , '" />';
echo '</div>';
echo '<!-- End of header section -->';
echo '<!-- Data section -->';
echo '<div id="gis_data">';
$geom_count = 1;
if ($geom_type == 'GEOMETRYCOLLECTION') {
$geom_count = (isset($gis_data[$geom_type]['geom_count']))
? intval($gis_data[$geom_type]['geom_count']) : 1;
if (isset($gis_data[$geom_type]['add_geom'])) {
$geom_count++;
}
echo '<input type="hidden" name="gis_data[GEOMETRYCOLLECTION][geom_count]"'
, ' value="' , $geom_count , '" />';
}
for ($a = 0; $a < $geom_count; $a++) {
if (! isset($gis_data[$a])) {
continue;
}
if ($geom_type == 'GEOMETRYCOLLECTION') {
echo '<br/><br/>';
printf(__('Geometry %d:'), $a + 1);
echo '<br/>';
if (isset($gis_data[$a]['gis_type'])) {
$type = htmlspecialchars($gis_data[$a]['gis_type']);
} else {
$type = $gis_types[0];
}
echo '<select name="gis_data[' , $a , '][gis_type]" class="gis_type">';
foreach (array_slice($gis_types, 0, 6) as $gis_type) {
echo '<option value="' , $gis_type , '"';
if ($type == $gis_type) {
echo ' selected="selected"';
}
echo '>' , $gis_type , '</option>';
}
echo '</select>';
} else {
$type = $geom_type;
}
if ($type == 'POINT') {
echo '<br/>';
echo __('Point:');
echo '<label for="x">' , __("X") , '</label>';
echo '<input name="gis_data[' , $a , '][POINT][x]" type="text"'
, ' value="' , escape($gis_data[$a]['POINT']['x']) , '" />';
echo '<label for="y">' , __("Y") , '</label>';
echo '<input name="gis_data[' , $a , '][POINT][y]" type="text"'
, ' value="' , escape($gis_data[$a]['POINT']['y']) , '" />';
} elseif ($type == 'MULTIPOINT' || $type == 'LINESTRING') {
$no_of_points = isset($gis_data[$a][$type]['no_of_points'])
? intval($gis_data[$a][$type]['no_of_points']) : 1;
if ($type == 'LINESTRING' && $no_of_points < 2) {
$no_of_points = 2;
}
if ($type == 'MULTIPOINT' && $no_of_points < 1) {
$no_of_points = 1;
}
if (isset($gis_data[$a][$type]['add_point'])) {
$no_of_points++;
}
echo '<input type="hidden" value="' , $no_of_points , '"'
, ' name="gis_data[' , $a , '][' , $type , '][no_of_points]" />';
for ($i = 0; $i < $no_of_points; $i++) {
echo '<br/>';
printf(__('Point %d'), $i + 1);
echo ': ';
echo '<label for="x">' , __("X") , '</label>';
echo '<input type="text"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $i , '][x]"'
, ' value="' , escape($gis_data[$a][$type][$i]['x']) , '" />';
echo '<label for="y">' , __("Y") , '</label>';
echo '<input type="text"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $i , '][y]"'
, ' value="' , escape($gis_data[$a][$type][$i]['y']) , '" />';
}
echo '<input type="submit"'
, ' name="gis_data[' , $a , '][' , $type , '][add_point]"'
, ' class="add addPoint" value="' , __("Add a point") , '" />';
} elseif ($type == 'MULTILINESTRING' || $type == 'POLYGON') {
$no_of_lines = isset($gis_data[$a][$type]['no_of_lines'])
? intval($gis_data[$a][$type]['no_of_lines']) : 1;
if ($no_of_lines < 1) {
$no_of_lines = 1;
}
if (isset($gis_data[$a][$type]['add_line'])) {
$no_of_lines++;
}
echo '<input type="hidden" value="' , $no_of_lines , '"'
, ' name="gis_data[' , $a , '][' , $type , '][no_of_lines]" />';
for ($i = 0; $i < $no_of_lines; $i++) {
echo '<br/>';
if ($type == 'MULTILINESTRING') {
printf(__('Linestring %d:'), $i + 1);
} else {
if ($i == 0) {
echo __('Outer ring:');
} else {
printf(__('Inner ring %d:'), $i);
}
}
$no_of_points = isset($gis_data[$a][$type][$i]['no_of_points'])
? intval($gis_data[$a][$type][$i]['no_of_points']) : 2;
if ($type == 'MULTILINESTRING' && $no_of_points < 2) {
$no_of_points = 2;
}
if ($type == 'POLYGON' && $no_of_points < 4) {
$no_of_points = 4;
}
if (isset($gis_data[$a][$type][$i]['add_point'])) {
$no_of_points++;
}
echo '<input type="hidden" value="' , $no_of_points , '"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $i
, '][no_of_points]" />';
for ($j = 0; $j < $no_of_points; $j++) {
echo('<br/>');
printf(__('Point %d'), $j + 1);
echo ': ';
echo '<label for="x">' , __("X") , '</label>';
echo '<input type="text" name="gis_data[' , $a , '][' , $type . ']['
, $i , '][' , $j , '][x]" value="'
, escape($gis_data[$a][$type][$i][$j]['x']) , '" />';
echo '<label for="y">' , __("Y") , '</label>';
echo '<input type="text" name="gis_data[' , $a , '][' , $type , ']['
, $i , '][' , $j , '][y]"' , ' value="'
, escape($gis_data[$a][$type][$i][$j]['y']) , '" />';
}
echo '<input type="submit" name="gis_data[' , $a , '][' , $type , ']['
, $i , '][add_point]"'
, ' class="add addPoint" value="' , __("Add a point") , '" />';
}
$caption = ($type == 'MULTILINESTRING')
? __('Add a linestring')
: __('Add an inner ring');
echo '<br/>';
echo '<input type="submit"'
, ' name="gis_data[' , $a , '][' , $type , '][add_line]"'
, ' class="add addLine" value="' , $caption , '" />';
} elseif ($type == 'MULTIPOLYGON') {
$no_of_polygons = isset($gis_data[$a][$type]['no_of_polygons'])
? intval($gis_data[$a][$type]['no_of_polygons']) : 1;
if ($no_of_polygons < 1) {
$no_of_polygons = 1;
}
if (isset($gis_data[$a][$type]['add_polygon'])) {
$no_of_polygons++;
}
echo '<input type="hidden"'
, ' name="gis_data[' , $a , '][' , $type , '][no_of_polygons]"'
, ' value="' , $no_of_polygons , '" />';
for ($k = 0; $k < $no_of_polygons; $k++) {
echo '<br/>';
printf(__('Polygon %d:'), $k + 1);
$no_of_lines = isset($gis_data[$a][$type][$k]['no_of_lines'])
? intval($gis_data[$a][$type][$k]['no_of_lines']) : 1;
if ($no_of_lines < 1) {
$no_of_lines = 1;
}
if (isset($gis_data[$a][$type][$k]['add_line'])) {
$no_of_lines++;
}
echo '<input type="hidden"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $k
, '][no_of_lines]"' , ' value="' , $no_of_lines , '" />';
for ($i = 0; $i < $no_of_lines; $i++) {
echo '<br/><br/>';
if ($i == 0) {
echo __('Outer ring:');
} else {
printf(__('Inner ring %d:'), $i);
}
$no_of_points = isset($gis_data[$a][$type][$k][$i]['no_of_points'])
? intval($gis_data[$a][$type][$k][$i]['no_of_points']) : 4;
if ($no_of_points < 4) {
$no_of_points = 4;
}
if (isset($gis_data[$a][$type][$k][$i]['add_point'])) {
$no_of_points++;
}
echo '<input type="hidden"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $k , '][' , $i
, '][no_of_points]"' , ' value="' , $no_of_points , '" />';
for ($j = 0; $j < $no_of_points; $j++) {
echo '<br/>';
printf(__('Point %d'), $j + 1);
echo ': ';
echo '<label for="x">' , __("X") , '</label>';
echo '<input type="text"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $k , ']['
, $i , '][' , $j , '][x]"'
, ' value="' , escape($gis_data[$a][$type][$k][$i][$j]['x'])
, '" />';
echo '<label for="y">' , __("Y") , '</label>';
echo '<input type="text"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $k , ']['
, $i , '][' , $j , '][y]"'
, ' value="' , escape($gis_data[$a][$type][$k][$i][$j]['y'])
, '" />';
}
echo '<input type="submit"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $k , '][' , $i
, '][add_point]"'
, ' class="add addPoint" value="' , __("Add a point") , '" />';
}
echo '<br/>';
echo '<input type="submit"'
, ' name="gis_data[' , $a , '][' , $type , '][' , $k , '][add_line]"'
, ' class="add addLine" value="' , __('Add an inner ring') , '" />';
echo '<br/>';
}
echo '<br/>';
echo '<input type="submit"'
, ' name="gis_data[' , $a , '][' , $type , '][add_polygon]"'
, ' class="add addPolygon" value="' , __('Add a polygon') , '" />';
}
}
if ($geom_type == 'GEOMETRYCOLLECTION') {
echo '<br/><br/>';
echo '<input type="submit" name="gis_data[GEOMETRYCOLLECTION][add_geom]"'
, 'class="add addGeom" value="' , __("Add geometry") , '" />';
}
echo '</div>';
echo '<!-- End of data section -->';
echo '<br/>';
echo '<input type="submit" name="gis_data[save]" value="' , __('Go') , '" />';
echo '<div id="gis_data_output">';
echo '<h3>' , __('Output') , '</h3>';
echo '<p>';
echo __(
'Choose "GeomFromText" from the "Function" column and paste the'
. ' string below into the "Value" field.'
);
echo '</p>';
echo '<textarea id="gis_data_textarea" cols="95" rows="5">';
echo htmlspecialchars($result);
echo '</textarea>';
echo '</div>';
echo '</div>';
echo '</form>';
Response::getInstance()->addJSON('gis_editor', ob_get_contents());
ob_end_clean();

View File

@ -1,784 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Core script for import, this is just the glue around all other stuff
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Bookmark;
use PhpMyAdmin\Core;
use PhpMyAdmin\Encoding;
use PhpMyAdmin\File;
use PhpMyAdmin\Import;
use PhpMyAdmin\ParseAnalyze;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\ImportPlugin;
use PhpMyAdmin\Response;
use PhpMyAdmin\Sql;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/* Enable LOAD DATA LOCAL INFILE for LDI plugin */
if (isset($_POST['format']) && $_POST['format'] == 'ldi') {
define('PMA_ENABLE_LDI', 1);
}
/**
* Get the variables sent or posted to this script and a core script
*/
require_once 'libraries/common.inc.php';
if (isset($_POST['show_as_php'])) {
$GLOBALS['show_as_php'] = $_POST['show_as_php'];
}
// If there is a request to 'Simulate DML'.
if (isset($_POST['simulate_dml'])) {
Import::handleSimulateDmlRequest();
exit;
}
$response = Response::getInstance();
$sql = new Sql();
// If it's a refresh console bookmarks request
if (isset($_GET['console_bookmark_refresh'])) {
$response->addJSON(
'console_message_bookmark', PhpMyAdmin\Console::getBookmarkContent()
);
exit;
}
// If it's a console bookmark add request
if (isset($_POST['console_bookmark_add'])) {
if (isset($_POST['label']) && isset($_POST['db'])
&& isset($_POST['bookmark_query']) && isset($_POST['shared'])
) {
$cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']);
$bookmarkFields = array(
'bkm_database' => $_POST['db'],
'bkm_user' => $cfgBookmark['user'],
'bkm_sql_query' => $_POST['bookmark_query'],
'bkm_label' => $_POST['label']
);
$isShared = ($_POST['shared'] == 'true' ? true : false);
$bookmark = Bookmark::createBookmark(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['user'],
$bookmarkFields,
$isShared
);
if ($bookmark !== false && $bookmark->save()) {
$response->addJSON('message', __('Succeeded'));
$response->addJSON('data', $bookmarkFields);
$response->addJSON('isShared', $isShared);
} else {
$response->addJSON('message', __('Failed'));
}
die();
} else {
$response->addJSON('message', __('Incomplete params'));
die();
}
}
$format = '';
/**
* Sets globals from $_POST
*/
$post_params = array(
'charset_of_file',
'format',
'import_type',
'is_js_confirmed',
'MAX_FILE_SIZE',
'message_to_show',
'noplugin',
'skip_queries',
'local_import_file'
);
foreach ($post_params as $one_post_param) {
if (isset($_POST[$one_post_param])) {
$GLOBALS[$one_post_param] = $_POST[$one_post_param];
}
}
// reset import messages for ajax request
$_SESSION['Import_message']['message'] = null;
$_SESSION['Import_message']['go_back_url'] = null;
// default values
$GLOBALS['reload'] = false;
// Use to identify current cycle is executing
// a multiquery statement or stored routine
if (!isset($_SESSION['is_multi_query'])) {
$_SESSION['is_multi_query'] = false;
}
$ajax_reload = array();
// Are we just executing plain query or sql file?
// (eg. non import, but query box/window run)
if (! empty($sql_query)) {
// apply values for parameters
if (! empty($_POST['parameterized'])
&& ! empty($_POST['parameters'])
&& is_array($_POST['parameters'])
) {
$parameters = $_POST['parameters'];
foreach ($parameters as $parameter => $replacement) {
$quoted = preg_quote($parameter, '/');
// making sure that :param does not apply values to :param1
$sql_query = preg_replace(
'/' . $quoted . '([^a-zA-Z0-9_])/',
$GLOBALS['dbi']->escapeString($replacement) . '${1}',
$sql_query
);
// for parameters the appear at the end of the string
$sql_query = preg_replace(
'/' . $quoted . '$/',
$GLOBALS['dbi']->escapeString($replacement),
$sql_query
);
}
}
// run SQL query
$import_text = $sql_query;
$import_type = 'query';
$format = 'sql';
$_SESSION['sql_from_query_box'] = true;
// If there is a request to ROLLBACK when finished.
if (isset($_POST['rollback_query'])) {
Import::handleRollbackRequest($import_text);
}
// refresh navigation and main panels
if (preg_match('/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) {
$GLOBALS['reload'] = true;
$ajax_reload['reload'] = true;
}
// refresh navigation panel only
if (preg_match(
'/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i',
$sql_query
)) {
$ajax_reload['reload'] = true;
}
// do a dynamic reload if table is RENAMED
// (by sending the instruction to the AJAX response handler)
if (preg_match(
'/^RENAME\s+TABLE\s+(.*?)\s+TO\s+(.*?)($|;|\s)/i',
$sql_query,
$rename_table_names
)) {
$ajax_reload['reload'] = true;
$ajax_reload['table_name'] = PhpMyAdmin\Util::unQuote(
$rename_table_names[2]
);
}
$sql_query = '';
} elseif (! empty($sql_file)) {
// run uploaded SQL file
$import_file = $sql_file;
$import_type = 'queryfile';
$format = 'sql';
unset($sql_file);
} elseif (! empty($_POST['id_bookmark'])) {
// run bookmark
$import_type = 'query';
$format = 'sql';
}
// If we didn't get any parameters, either user called this directly, or
// upload limit has been reached, let's assume the second possibility.
if ($_POST == array() && $_GET == array()) {
$message = PhpMyAdmin\Message::error(
__(
'You probably tried to upload a file that is too large. Please refer ' .
'to %sdocumentation%s for a workaround for this limit.'
)
);
$message->addParam('[doc@faq1-16]');
$message->addParam('[/doc]');
// so we can obtain the message
$_SESSION['Import_message']['message'] = $message->getDisplay();
$_SESSION['Import_message']['go_back_url'] = $GLOBALS['goto'];
$response->setRequestStatus(false);
$response->addJSON('message', $message);
exit; // the footer is displayed automatically
}
// Add console message id to response output
if (isset($_POST['console_message_id'])) {
$response->addJSON('console_message_id', $_POST['console_message_id']);
}
/**
* Sets globals from $_POST patterns, for import plugins
* We only need to load the selected plugin
*/
if (! in_array(
$format,
array(
'csv',
'ldi',
'mediawiki',
'ods',
'shp',
'sql',
'xml'
)
)
) {
// this should not happen for a normal user
// but only during an attack
Core::fatalError('Incorrect format parameter');
}
$post_patterns = array(
'/^force_file_/',
'/^' . $format . '_/'
);
Core::setPostAsGlobal($post_patterns);
// Check needed parameters
PhpMyAdmin\Util::checkParameters(array('import_type', 'format'));
// We don't want anything special in format
$format = Core::securePath($format);
if (strlen($table) > 0 && strlen($db) > 0) {
$urlparams = array('db' => $db, 'table' => $table);
} elseif (strlen($db) > 0) {
$urlparams = array('db' => $db);
} else {
$urlparams = array();
}
// Create error and goto url
if ($import_type == 'table') {
$goto = 'tbl_import.php';
} elseif ($import_type == 'database') {
$goto = 'db_import.php';
} elseif ($import_type == 'server') {
$goto = 'server_import.php';
} else {
if (empty($goto) || !preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) {
if (strlen($table) > 0 && strlen($db) > 0) {
$goto = 'tbl_structure.php';
} elseif (strlen($db) > 0) {
$goto = 'db_structure.php';
} else {
$goto = 'server_sql.php';
}
}
}
$err_url = $goto . Url::getCommon($urlparams);
$_SESSION['Import_message']['go_back_url'] = $err_url;
// Avoid setting selflink to 'import.php'
// problem similar to bug 4276
if (basename($_SERVER['SCRIPT_NAME']) === 'import.php') {
$_SERVER['SCRIPT_NAME'] = $goto;
}
if (strlen($db) > 0) {
$GLOBALS['dbi']->selectDb($db);
}
Util::setTimeLimit();
if (! empty($cfg['MemoryLimit'])) {
ini_set('memory_limit', $cfg['MemoryLimit']);
}
$timestamp = time();
if (isset($_POST['allow_interrupt'])) {
$maximum_time = ini_get('max_execution_time');
} else {
$maximum_time = 0;
}
// set default values
$timeout_passed = false;
$error = false;
$read_multiply = 1;
$finished = false;
$offset = 0;
$max_sql_len = 0;
$file_to_unlink = '';
$sql_query = '';
$sql_query_disabled = false;
$go_sql = false;
$executed_queries = 0;
$run_query = true;
$charset_conversion = false;
$reset_charset = false;
$bookmark_created = false;
$result = false;
$msg = 'Sorry an unexpected error happened!';
// Bookmark Support: get a query back from bookmark if required
if (! empty($_POST['id_bookmark'])) {
$id_bookmark = (int)$_POST['id_bookmark'];
switch ($_POST['action_bookmark']) {
case 0: // bookmarked query that have to be run
$bookmark = Bookmark::get(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['user'],
$db,
$id_bookmark,
'id',
isset($_POST['action_bookmark_all'])
);
if (! empty($_POST['bookmark_variable'])) {
$import_text = $bookmark->applyVariables(
$_POST['bookmark_variable']
);
} else {
$import_text = $bookmark->getQuery();
}
// refresh navigation and main panels
if (preg_match(
'/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i',
$import_text
)) {
$GLOBALS['reload'] = true;
$ajax_reload['reload'] = true;
}
// refresh navigation panel only
if (preg_match(
'/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i',
$import_text
)
) {
$ajax_reload['reload'] = true;
}
break;
case 1: // bookmarked query that have to be displayed
$bookmark = Bookmark::get(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['user'],
$db,
$id_bookmark
);
$import_text = $bookmark->getQuery();
if ($response->isAjax()) {
$message = PhpMyAdmin\Message::success(__('Showing bookmark'));
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('sql_query', $import_text);
$response->addJSON('action_bookmark', $_POST['action_bookmark']);
exit;
} else {
$run_query = false;
}
break;
case 2: // bookmarked query that have to be deleted
$bookmark = Bookmark::get(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['user'],
$db,
$id_bookmark
);
if (! empty($bookmark)) {
$bookmark->delete();
if ($response->isAjax()) {
$message = PhpMyAdmin\Message::success(
__('The bookmark has been deleted.')
);
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('action_bookmark', $_POST['action_bookmark']);
$response->addJSON('id_bookmark', $id_bookmark);
exit;
} else {
$run_query = false;
$error = true; // this is kind of hack to skip processing the query
}
}
break;
}
} // end bookmarks reading
// Do no run query if we show PHP code
if (isset($GLOBALS['show_as_php'])) {
$run_query = false;
$go_sql = true;
}
// We can not read all at once, otherwise we can run out of memory
$memory_limit = trim(ini_get('memory_limit'));
// 2 MB as default
if (empty($memory_limit)) {
$memory_limit = 2 * 1024 * 1024;
}
// In case no memory limit we work on 10MB chunks
if ($memory_limit == -1) {
$memory_limit = 10 * 1024 * 1024;
}
// Calculate value of the limit
$memoryUnit = mb_strtolower(substr($memory_limit, -1));
if ('m' == $memoryUnit) {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
} elseif ('k' == $memoryUnit) {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
} elseif ('g' == $memoryUnit) {
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
} else {
$memory_limit = (int)$memory_limit;
}
// Just to be sure, there might be lot of memory needed for uncompression
$read_limit = $memory_limit / 8;
// handle filenames
if (isset($_FILES['import_file'])) {
$import_file = $_FILES['import_file']['tmp_name'];
}
if (! empty($local_import_file) && ! empty($cfg['UploadDir'])) {
// sanitize $local_import_file as it comes from a POST
$local_import_file = Core::securePath($local_import_file);
$import_file = PhpMyAdmin\Util::userDir($cfg['UploadDir'])
. $local_import_file;
/*
* Do not allow symlinks to avoid security issues
* (user can create symlink to file he can not access,
* but phpMyAdmin can).
*/
if (@is_link($import_file)) {
$import_file = 'none';
}
} elseif (empty($import_file) || ! is_uploaded_file($import_file)) {
$import_file = 'none';
}
// Do we have file to import?
if ($import_file != 'none' && ! $error) {
/**
* Handle file compression
*/
$import_handle = new File($import_file);
$import_handle->checkUploadedFile();
if ($import_handle->isError()) {
Import::stop($import_handle->getError());
}
$import_handle->setDecompressContent(true);
$import_handle->open();
if ($import_handle->isError()) {
Import::stop($import_handle->getError());
}
} elseif (! $error) {
if (! isset($import_text) || empty($import_text)) {
$message = PhpMyAdmin\Message::error(
__(
'No data was received to import. Either no file name was ' .
'submitted, or the file size exceeded the maximum size permitted ' .
'by your PHP configuration. See [doc@faq1-16]FAQ 1.16[/doc].'
)
);
Import::stop($message);
}
}
// so we can obtain the message
//$_SESSION['Import_message'] = $message->getDisplay();
// Convert the file's charset if necessary
if (Encoding::isSupported() && isset($charset_of_file)) {
if ($charset_of_file != 'utf-8') {
$charset_conversion = true;
}
} elseif (isset($charset_of_file) && $charset_of_file != 'utf-8') {
$GLOBALS['dbi']->query('SET NAMES \'' . $charset_of_file . '\'');
// We can not show query in this case, it is in different charset
$sql_query_disabled = true;
$reset_charset = true;
}
// Something to skip? (because timeout has passed)
if (! $error && isset($_POST['skip'])) {
$original_skip = $skip = intval($_POST['skip']);
while ($skip > 0 && ! $finished) {
Import::getNextChunk($skip < $read_limit ? $skip : $read_limit);
// Disable read progressivity, otherwise we eat all memory!
$read_multiply = 1;
$skip -= $read_limit;
}
unset($skip);
}
// This array contain the data like numberof valid sql queries in the statement
// and complete valid sql statement (which affected for rows)
$sql_data = array('valid_sql' => array(), 'valid_queries' => 0);
if (! $error) {
/* @var $import_plugin ImportPlugin */
$import_plugin = Plugins::getPlugin(
"import",
$format,
'libraries/classes/Plugins/Import/',
$import_type
);
if ($import_plugin == null) {
$message = PhpMyAdmin\Message::error(
__('Could not load import plugins, please check your installation!')
);
Import::stop($message);
} else {
// Do the real import
try {
$default_fk_check = PhpMyAdmin\Util::handleDisableFKCheckInit();
$import_plugin->doImport($sql_data);
PhpMyAdmin\Util::handleDisableFKCheckCleanup($default_fk_check);
} catch (Exception $e) {
PhpMyAdmin\Util::handleDisableFKCheckCleanup($default_fk_check);
throw $e;
}
}
}
if (isset($import_handle)) {
$import_handle->close();
}
// Cleanup temporary file
if ($file_to_unlink != '') {
unlink($file_to_unlink);
}
// Reset charset back, if we did some changes
if ($reset_charset) {
$GLOBALS['dbi']->query('SET CHARACTER SET ' . $GLOBALS['charset_connection']);
$GLOBALS['dbi']->setCollationConnection($collation_connection);
}
// Show correct message
if (! empty($id_bookmark) && $_POST['action_bookmark'] == 2) {
$message = PhpMyAdmin\Message::success(__('The bookmark has been deleted.'));
$display_query = $import_text;
$error = false; // unset error marker, it was used just to skip processing
} elseif (! empty($id_bookmark) && $_POST['action_bookmark'] == 1) {
$message = PhpMyAdmin\Message::notice(__('Showing bookmark'));
} elseif ($bookmark_created) {
$special_message = '[br]' . sprintf(
__('Bookmark %s has been created.'),
htmlspecialchars($_POST['bkm_label'])
);
} elseif ($finished && ! $error) {
// Do not display the query with message, we do it separately
$display_query = ';';
if ($import_type != 'query') {
$message = PhpMyAdmin\Message::success(
'<em>'
. _ngettext(
'Import has been successfully finished, %d query executed.',
'Import has been successfully finished, %d queries executed.',
$executed_queries
)
. '</em>'
);
$message->addParam($executed_queries);
if (! empty($import_notice)) {
$message->addHtml($import_notice);
}
if (! empty($local_import_file)) {
$message->addText('(' . $local_import_file . ')');
} else {
$message->addText('(' . $_FILES['import_file']['name'] . ')');
}
}
}
// Did we hit timeout? Tell it user.
if ($timeout_passed) {
$urlparams['timeout_passed'] = '1';
$urlparams['offset'] = $GLOBALS['offset'];
if (isset($local_import_file)) {
$urlparams['local_import_file'] = $local_import_file;
}
$importUrl = $err_url = $goto . Url::getCommon($urlparams);
$message = PhpMyAdmin\Message::error(
__(
'Script timeout passed, if you want to finish import,'
. ' please %sresubmit the same file%s and import will resume.'
)
);
$message->addParamHtml('<a href="' . $importUrl . '">');
$message->addParamHtml('</a>');
if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) {
$message->addText(
__(
'However on last run no data has been parsed,'
. ' this usually means phpMyAdmin won\'t be able to'
. ' finish this import unless you increase php time limits.'
)
);
}
}
// if there is any message, copy it into $_SESSION as well,
// so we can obtain it by AJAX call
if (isset($message)) {
$_SESSION['Import_message']['message'] = $message->getDisplay();
}
// Parse and analyze the query, for correct db and table name
// in case of a query typed in the query window
// (but if the query is too large, in case of an imported file, the parser
// can choke on it so avoid parsing)
$sqlLength = mb_strlen($sql_query);
if ($sqlLength <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
list(
$analyzed_sql_results,
$db,
$table_from_sql
) = ParseAnalyze::sqlQuery($sql_query, $db);
// @todo: possibly refactor
extract($analyzed_sql_results);
if ($table != $table_from_sql && !empty($table_from_sql)) {
$table = $table_from_sql;
}
}
// There was an error?
if (isset($my_die)) {
foreach ($my_die as $key => $die) {
PhpMyAdmin\Util::mysqlDie(
$die['error'], $die['sql'], false, $err_url, $error
);
}
}
if ($go_sql) {
if (! empty($sql_data) && ($sql_data['valid_queries'] > 1)) {
$_SESSION['is_multi_query'] = true;
$sql_queries = $sql_data['valid_sql'];
} else {
$sql_queries = array($sql_query);
}
$html_output = '';
foreach ($sql_queries as $sql_query) {
// parse sql query
list(
$analyzed_sql_results,
$db,
$table_from_sql
) = ParseAnalyze::sqlQuery($sql_query, $db);
// @todo: possibly refactor
extract($analyzed_sql_results);
// Check if User is allowed to issue a 'DROP DATABASE' Statement
if ($sql->hasNoRightsToDropDatabase(
$analyzed_sql_results, $cfg['AllowUserDropDatabase'], $GLOBALS['dbi']->isSuperuser()
)) {
PhpMyAdmin\Util::mysqlDie(
__('"DROP DATABASE" statements are disabled.'),
'',
false,
$_SESSION['Import_message']['go_back_url']
);
return;
} // end if
if ($table != $table_from_sql && !empty($table_from_sql)) {
$table = $table_from_sql;
}
$html_output .= $sql->executeQueryAndGetQueryResponse(
$analyzed_sql_results, // analyzed_sql_results
false, // is_gotofile
$db, // db
$table, // table
null, // find_real_end
null, // sql_query_for_bookmark - see below
null, // extra_data
null, // message_to_show
null, // message
null, // sql_data
$goto, // goto
$pmaThemeImage, // pmaThemeImage
null, // disp_query
null, // disp_message
null, // query_type
$sql_query, // sql_query
null, // selectedTables
null // complete_query
);
}
// sql_query_for_bookmark is not included in Sql::executeQueryAndGetQueryResponse
// since only one bookmark has to be added for all the queries submitted through
// the SQL tab
if (! empty($_POST['bkm_label']) && ! empty($import_text)) {
$cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']);
$sql->storeTheQueryAsBookmark(
$db, $cfgBookmark['user'],
$_POST['sql_query'], $_POST['bkm_label'],
isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null
);
}
$response->addJSON('ajax_reload', $ajax_reload);
$response->addHTML($html_output);
exit();
} elseif ($result) {
// Save a Bookmark with more than one queries (if Bookmark label given).
if (! empty($_POST['bkm_label']) && ! empty($import_text)) {
$cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']);
$sql->storeTheQueryAsBookmark(
$db, $cfgBookmark['user'],
$_POST['sql_query'], $_POST['bkm_label'],
isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null
);
}
$response->setRequestStatus(true);
$response->addJSON('message', PhpMyAdmin\Message::success($msg));
$response->addJSON(
'sql_query',
PhpMyAdmin\Util::getMessage($msg, $sql_query, 'success')
);
} elseif ($result == false) {
$response->setRequestStatus(false);
$response->addJSON('message', PhpMyAdmin\Message::error($msg));
} else {
$active_page = $goto;
include '' . $goto;
}
// If there is request for ROLLBACK in the end.
if (isset($_POST['rollback_query'])) {
$GLOBALS['dbi']->query('ROLLBACK');
}

View File

@ -1,121 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Import progress bar backend
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Core;
use PhpMyAdmin\Display\ImportAjax;
/* PHP 5.4 stores upload progress data only in the default session.
* After calling session_name(), we won't find the progress data anymore.
*
* https://bugs.php.net/bug.php?id=64075
*
* The bug should be somewhere in
* https://github.com/php/php-src/blob/master/ext/session/session.c#L2342
*
* Until this is fixed, we need to load the default session to load the data,
* export the upload progress information from there,
* and re-import after switching to our session.
*
* However, since https://github.com/phpmyadmin/phpmyadmin/commit/063a2d99
* we have deactivated this feature, so the corresponding code is now
* commented out.
*/
/*
if (ini_get('session.upload_progress.enabled')) {
$sessionupload = array();
define('UPLOAD_PREFIX', ini_get('session.upload_progress.prefix'));
session_start();
foreach ($_SESSION as $key => $value) {
// only copy session-prefixed data
if (substr($key, 0, strlen(UPLOAD_PREFIX))
== UPLOAD_PREFIX) {
$sessionupload[$key] = $value;
}
}
// PMA will kill all variables, so let's use a constant
define('SESSIONUPLOAD', serialize($sessionupload));
session_write_close();
session_name('phpMyAdmin');
session_id($_COOKIE['phpMyAdmin']);
}
*/
define('PMA_MINIMUM_COMMON', 1);
require_once 'libraries/common.inc.php';
list(
$SESSION_KEY,
$upload_id,
$plugins
) = ImportAjax::uploadProgressSetup();
/*
if (defined('SESSIONUPLOAD')) {
// write sessionupload back into the loaded PMA session
$sessionupload = unserialize(SESSIONUPLOAD);
foreach ($sessionupload as $key => $value) {
$_SESSION[$key] = $value;
}
// remove session upload data that are not set anymore
foreach ($_SESSION as $key => $value) {
if (substr($key, 0, strlen(UPLOAD_PREFIX))
== UPLOAD_PREFIX
&& ! isset($sessionupload[$key])
) {
unset($_SESSION[$key]);
}
}
}
*/
// $_GET["message"] is used for asking for an import message
if (isset($_GET["message"]) && $_GET["message"]) {
// AJAX requests can't be cached!
Core::noCacheHeader();
header('Content-type: text/html');
// wait 0.3 sec before we check for $_SESSION variable,
// which is set inside import.php
usleep(300000);
$maximumTime = ini_get('max_execution_time');
$timestamp = time();
// wait until message is available
while ($_SESSION['Import_message']['message'] == null) {
// close session before sleeping
session_write_close();
// sleep
usleep(250000); // 0.25 sec
// reopen session
session_start();
if ((time() - $timestamp) > $maximumTime) {
$_SESSION['Import_message']['message'] = PhpMyAdmin\Message::error(
__('Could not load the progress of the import.')
)->getDisplay();
break;
}
}
echo $_SESSION['Import_message']['message'];
echo '<fieldset class="tblFooters">' , "\n";
echo ' [ <a href="' , $_SESSION['Import_message']['go_back_url']
. '">' , __('Back') , '</a> ]' , "\n";
echo '</fieldset>' , "\n";
} else {
ImportAjax::status($_GET["id"]);
}

View File

@ -1,687 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Main loader script
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Charsets;
use PhpMyAdmin\Config;
use PhpMyAdmin\Core;
use PhpMyAdmin\Display\GitRevision;
use PhpMyAdmin\LanguageManager;
use PhpMyAdmin\Message;
use PhpMyAdmin\RecentFavoriteTable;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Sanitize;
use PhpMyAdmin\Server\Select;
use PhpMyAdmin\ThemeManager;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
use PhpMyAdmin\UserPreferences;
/**
* Gets some core libraries and displays a top message if required
*/
require_once 'libraries/common.inc.php';
/**
* pass variables to child pages
*/
$drops = array(
'lang',
'server',
'collation_connection',
'db',
'table'
);
foreach ($drops as $each_drop) {
if (array_key_exists($each_drop, $_GET)) {
unset($_GET[$each_drop]);
}
}
unset($drops, $each_drop);
/*
* Black list of all scripts to which front-end must submit data.
* Such scripts must not be loaded on home page.
*
*/
$target_blacklist = array (
'import.php', 'export.php'
);
// If we have a valid target, let's load that script instead
if (! empty($_REQUEST['target'])
&& is_string($_REQUEST['target'])
&& ! preg_match('/^index/', $_REQUEST['target'])
&& ! in_array($_REQUEST['target'], $target_blacklist)
&& Core::checkPageValidity($_REQUEST['target'], [], true)
) {
include $_REQUEST['target'];
exit;
}
if (isset($_REQUEST['ajax_request']) && ! empty($_REQUEST['access_time'])) {
exit;
}
// user selected font size
if (isset($_POST['set_fontsize']) && preg_match('/^[0-9.]+(px|em|pt|\%)$/', $_POST['set_fontsize'])) {
$GLOBALS['PMA_Config']->setUserValue(
null,
'FontSize',
$_POST['set_fontsize'],
'82%'
);
header('Location: index.php' . Url::getCommonRaw());
exit();
}
// if user selected a theme
if (isset($_POST['set_theme'])) {
$tmanager = ThemeManager::getInstance();
$tmanager->setActiveTheme($_POST['set_theme']);
$tmanager->setThemeCookie();
$userPreferences = new UserPreferences();
$prefs = $userPreferences->load();
$prefs["config_data"]["ThemeDefault"] = $_POST['set_theme'];
$userPreferences->save($prefs["config_data"]);
header('Location: index.php' . Url::getCommonRaw());
exit();
}
// Change collation connection
if (isset($_POST['collation_connection'])) {
$GLOBALS['PMA_Config']->setUserValue(
null,
'DefaultConnectionCollation',
$_POST['collation_connection'],
'utf8mb4_unicode_ci'
);
header('Location: index.php' . Url::getCommonRaw());
exit();
}
// See FAQ 1.34
if (! empty($_REQUEST['db'])) {
$page = null;
if (! empty($_REQUEST['table'])) {
$page = Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
);
} else {
$page = Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabDatabase'], 'database'
);
}
include $page;
exit;
}
$response = Response::getInstance();
/**
* Check if it is an ajax request to reload the recent tables list.
*/
if ($response->isAjax() && ! empty($_REQUEST['recent_table'])) {
$response->addJSON(
'list',
RecentFavoriteTable::getInstance('recent')->getHtmlList()
);
exit;
}
if ($GLOBALS['PMA_Config']->isGitRevision()) {
if (isset($_REQUEST['git_revision']) && $response->isAjax()) {
GitRevision::display();
exit;
}
echo '<div id="is_git_revision"></div>';
}
// Handles some variables that may have been sent by the calling script
$GLOBALS['db'] = '';
$GLOBALS['table'] = '';
$show_query = '1';
// Any message to display?
if (! empty($message)) {
echo Util::getMessage($message);
unset($message);
}
if (isset($_SESSION['partial_logout'])) {
Message::success(
__('You were logged out from one server, to logout completely from phpMyAdmin, you need to logout from all servers.')
)->display();
unset($_SESSION['partial_logout']);
}
$common_url_query = Url::getCommon();
$mysql_cur_user_and_host = '';
// when $server > 0, a server has been chosen so we can display
// all MySQL-related information
if ($server > 0) {
include 'libraries/server_common.inc.php';
// Use the verbose name of the server instead of the hostname
// if a value is set
$server_info = '';
if (! empty($cfg['Server']['verbose'])) {
$server_info .= htmlspecialchars($cfg['Server']['verbose']);
if ($GLOBALS['cfg']['ShowServerInfo']) {
$server_info .= ' (';
}
}
if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) {
$server_info .= $GLOBALS['dbi']->getHostInfo();
}
if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) {
$server_info .= ')';
}
$mysql_cur_user_and_host = $GLOBALS['dbi']->fetchValue('SELECT USER();');
// should we add the port info here?
$short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
? $GLOBALS['cfg']['Server']['verbose']
: $GLOBALS['cfg']['Server']['host']);
}
echo '<div id="maincontainer">' , "\n";
// Anchor for favorite tables synchronization.
echo RecentFavoriteTable::getInstance('favorite')->getHtmlSyncFavoriteTables();
echo '<div id="main_pane_left">';
if ($server > 0 || count($cfg['Servers']) > 1
) {
if ($cfg['DBG']['demo']) {
echo '<div class="group">';
echo '<h2>' , __('phpMyAdmin Demo Server') , '</h2>';
echo '<p class="cfg_dbg_demo">';
printf(
__(
'You are using the demo server. You can do anything here, but '
. 'please do not change root, debian-sys-maint and pma users. '
. 'More information is available at %s.'
),
'<a href="url.php?url=https://demo.phpmyadmin.net/" target="_blank" rel="noopener noreferrer">demo.phpmyadmin.net</a>'
);
echo '</p>';
echo '</div>';
}
echo '<div class="group">';
echo '<h2>' , __('General settings') , '</h2>';
echo '<ul>';
/**
* Displays the MySQL servers choice form
*/
if ($cfg['ServerDefault'] == 0
|| (! $cfg['NavigationDisplayServers']
&& (count($cfg['Servers']) > 1
|| ($server == 0 && count($cfg['Servers']) == 1)))
) {
echo '<li id="li_select_server" class="no_bullets" >';
echo Util::getImage('s_host') , " "
, Select::render(true, true);
echo '</li>';
}
/**
* Displays the mysql server related links
*/
if ($server > 0) {
include_once 'libraries/check_user_privileges.inc.php';
// Logout for advanced authentication
if ($cfg['Server']['auth_type'] != 'config') {
if ($cfg['ShowChgPassword']) {
$conditional_class = 'ajax';
Core::printListItem(
Util::getImage('s_passwd') . "&nbsp;" . __(
'Change password'
),
'li_change_password',
'user_password.php' . $common_url_query,
null,
null,
'change_password_anchor',
"no_bullets",
$conditional_class
);
}
} // end if
echo ' <li id="li_select_mysql_collation" class="no_bullets" >';
echo ' <form class="disableAjax" method="post" action="index.php">' , "\n"
. Url::getHiddenInputs(null, null, 4, 'collation_connection')
. ' <label for="select_collation_connection">' . "\n"
. ' ' . Util::getImage('s_asci')
. "&nbsp;" . __('Server connection collation') . "\n"
// put the doc link in the form so that it appears on the same line
. Util::showMySQLDocu('Charset-connection')
. ': ' . "\n"
. ' </label>' . "\n"
. Charsets::getCollationDropdownBox(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['DisableIS'],
'collation_connection',
'select_collation_connection',
$collation_connection,
true,
true
)
. ' </form>' . "\n"
. ' </li>' . "\n";
} // end of if ($server > 0)
echo '</ul>';
echo '</div>';
}
echo '<div class="group">';
echo '<h2>' , __('Appearance settings') , '</h2>';
echo ' <ul>';
// Displays language selection combo
$language_manager = LanguageManager::getInstance();
if (empty($cfg['Lang']) && $language_manager->hasChoice()) {
echo '<li id="li_select_lang" class="no_bullets">';
echo Util::getImage('s_lang') , " "
, $language_manager->getSelectorDisplay();
echo '</li>';
}
// ThemeManager if available
if ($GLOBALS['cfg']['ThemeManager']) {
echo '<li id="li_select_theme" class="no_bullets">';
echo Util::getImage('s_theme') , " "
, ThemeManager::getInstance()->getHtmlSelectBox();
echo '</li>';
}
echo '<li id="li_select_fontsize">';
echo Config::getFontsizeForm();
echo '</li>';
echo '</ul>';
// User preferences
if ($server > 0) {
echo '<ul>';
Core::printListItem(
Util::getImage('b_tblops') . "&nbsp;" . __(
'More settings'
),
'li_user_preferences',
'prefs_manage.php' . $common_url_query,
null,
null,
null,
"no_bullets"
);
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '<div id="main_pane_right">';
if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
echo '<div class="group">';
echo '<h2>' , __('Database server') , '</h2>';
echo '<ul>' , "\n";
Core::printListItem(
__('Server:') . ' ' . $server_info,
'li_server_info'
);
Core::printListItem(
__('Server type:') . ' ' . Util::getServerType(),
'li_server_type'
);
Core::printListItem(
__('Server connection:') . ' ' . Util::getServerSSL(),
'li_server_type'
);
Core::printListItem(
__('Server version:')
. ' '
. $GLOBALS['dbi']->getVersionString() . ' - ' . $GLOBALS['dbi']->getVersionComment(),
'li_server_version'
);
Core::printListItem(
__('Protocol version:') . ' ' . $GLOBALS['dbi']->getProtoInfo(),
'li_mysql_proto'
);
Core::printListItem(
__('User:') . ' ' . htmlspecialchars($mysql_cur_user_and_host),
'li_user_info'
);
echo ' <li id="li_select_mysql_charset">';
echo ' ' , __('Server charset:') , ' '
. ' <span lang="en" dir="ltr">';
$unicode = Charsets::$mysql_charset_map['utf-8'];
$charsets = Charsets::getMySQLCharsetsDescriptions(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['DisableIS']
);
echo ' ' , $charsets[$unicode], ' (' . $unicode, ')';
echo ' </span>'
. ' </li>'
. ' </ul>'
. ' </div>';
}
if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) {
echo '<div class="group">';
echo '<h2>' , __('Web server') , '</h2>';
echo '<ul>';
if ($GLOBALS['cfg']['ShowServerInfo']) {
Core::printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software');
if ($server > 0) {
$client_version_str = $GLOBALS['dbi']->getClientInfo();
if (preg_match('#\d+\.\d+\.\d+#', $client_version_str)) {
$client_version_str = 'libmysql - ' . $client_version_str;
}
Core::printListItem(
__('Database client version:') . ' ' . $client_version_str,
'li_mysql_client_version'
);
$php_ext_string = __('PHP extension:') . ' ';
$extensions = Util::listPHPExtensions();
foreach ($extensions as $extension) {
$php_ext_string .= ' ' . $extension
. Util::showPHPDocu('book.' . $extension . '.php');
}
Core::printListItem(
$php_ext_string,
'li_used_php_extension'
);
$php_version_string = __('PHP version:') . ' ' . phpversion();
Core::printListItem(
$php_version_string,
'li_used_php_version'
);
}
}
if ($cfg['ShowPhpInfo']) {
Core::printListItem(
__('Show PHP information'),
'li_phpinfo',
'phpinfo.php' . $common_url_query,
null,
'_blank'
);
}
echo ' </ul>';
echo ' </div>';
}
echo '<div class="group pmagroup">';
echo '<h2>phpMyAdmin</h2>';
echo '<ul>';
$class = null;
if ($GLOBALS['cfg']['VersionCheck']) {
$class = 'jsversioncheck';
}
Core::printListItem(
__('Version information:') . ' <span class="version">' . PMA_VERSION . '</span>',
'li_pma_version',
null,
null,
null,
null,
$class
);
Core::printListItem(
__('Documentation'),
'li_pma_docs',
Util::getDocuLink('index'),
null,
'_blank'
);
// does not work if no target specified, don't know why
Core::printListItem(
__('Official Homepage'),
'li_pma_homepage',
Core::linkURL('https://www.phpmyadmin.net/'),
null,
'_blank'
);
Core::printListItem(
__('Contribute'),
'li_pma_contribute',
Core::linkURL('https://www.phpmyadmin.net/contribute/'),
null,
'_blank'
);
Core::printListItem(
__('Get support'),
'li_pma_support',
Core::linkURL('https://www.phpmyadmin.net/support/'),
null,
'_blank'
);
Core::printListItem(
__('List of changes'),
'li_pma_changes',
'changelog.php' . Url::getCommon(),
null,
'_blank'
);
Core::printListItem(
__('License'),
'li_pma_license',
'license.php' . Url::getCommon(),
null,
'_blank'
);
echo ' </ul>';
echo ' </div>';
echo '</div>';
echo '</div>';
/**
* mbstring is used for handling multibytes inside parser, so it is good
* to tell user something might be broken without it, see bug #1063149.
*/
if (! extension_loaded('mbstring')) {
trigger_error(
__(
'The mbstring PHP extension was not found and you seem to be using'
. ' a multibyte charset. Without the mbstring extension phpMyAdmin'
. ' is unable to split strings correctly and it may result in'
. ' unexpected results.'
),
E_USER_WARNING
);
}
/**
* Missing functionality
*/
if (! extension_loaded('curl') && ! ini_get('allow_url_fopen')) {
trigger_error(
__(
'The curl extension was not found and allow_url_fopen is '
. 'disabled. Due to this some features such as error reporting '
. 'or version check are disabled.'
)
);
}
if ($cfg['LoginCookieValidityDisableWarning'] == false) {
/**
* Check whether session.gc_maxlifetime limits session validity.
*/
$gc_time = (int)ini_get('session.gc_maxlifetime');
if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) {
trigger_error(
__(
'Your PHP parameter [a@https://secure.php.net/manual/en/session.' .
'configuration.php#ini.session.gc-maxlifetime@_blank]session.' .
'gc_maxlifetime[/a] is lower than cookie validity configured ' .
'in phpMyAdmin, because of this, your login might expire sooner ' .
'than configured in phpMyAdmin.'
),
E_USER_WARNING
);
}
}
/**
* Check whether LoginCookieValidity is limited by LoginCookieStore.
*/
if ($GLOBALS['cfg']['LoginCookieStore'] != 0
&& $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']
) {
trigger_error(
__(
'Login cookie store is lower than cookie validity configured in ' .
'phpMyAdmin, because of this, your login will expire sooner than ' .
'configured in phpMyAdmin.'
),
E_USER_WARNING
);
}
/**
* Check if user does not have defined blowfish secret and it is being used.
*/
if (! empty($_SESSION['encryption_key'])) {
if (empty($GLOBALS['cfg']['blowfish_secret'])) {
trigger_error(
__(
'The configuration file now needs a secret passphrase (blowfish_secret).'
),
E_USER_WARNING
);
} elseif (strlen($GLOBALS['cfg']['blowfish_secret']) < 32) {
trigger_error(
__(
'The secret passphrase in configuration (blowfish_secret) is too short.'
),
E_USER_WARNING
);
}
}
/**
* Check for existence of config directory which should not exist in
* production environment.
*/
if (@file_exists('config')) {
trigger_error(
__(
'Directory [code]config[/code], which is used by the setup script, ' .
'still exists in your phpMyAdmin directory. It is strongly ' .
'recommended to remove it once phpMyAdmin has been configured. ' .
'Otherwise the security of your server may be compromised by ' .
'unauthorized people downloading your configuration.'
),
E_USER_WARNING
);
}
$relation = new Relation();
if ($server > 0) {
$cfgRelation = $relation->getRelationsParam();
if (! $cfgRelation['allworks']
&& $cfg['PmaNoRelation_DisableWarning'] == false
) {
$msg_text = __(
'The phpMyAdmin configuration storage is not completely '
. 'configured, some extended features have been deactivated. '
. '%sFind out why%s. '
);
if ($cfg['ZeroConf'] == true) {
$msg_text .= '<br>' .
__(
'Or alternately go to \'Operations\' tab of any database '
. 'to set it up there.'
);
}
$msg = Message::notice($msg_text);
$msg->addParamHtml('<a href="./chk_rel.php" data-post="' . $common_url_query . '">');
$msg->addParamHtml('</a>');
/* Show error if user has configured something, notice elsewhere */
if (!empty($cfg['Servers'][$server]['pmadb'])) {
$msg->isError(true);
}
$msg->display();
} // end if
}
/**
* Warning about Suhosin only if its simulation mode is not enabled
*/
if ($cfg['SuhosinDisableWarning'] == false
&& ini_get('suhosin.request.max_value_length')
&& ini_get('suhosin.simulation') == '0'
) {
trigger_error(
sprintf(
__(
'Server running with Suhosin. Please refer to %sdocumentation%s ' .
'for possible issues.'
),
'[doc@faq1-38]',
'[/doc]'
),
E_USER_WARNING
);
}
/* Missing template cache */
if (is_null($GLOBALS['PMA_Config']->getTempDir('twig'))) {
trigger_error(
sprintf(
__('The $cfg[\'TempDir\'] (%s) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.'),
$GLOBALS['PMA_Config']->get('TempDir')
),
E_USER_WARNING
);
}
/**
* Warning about incomplete translations.
*
* The data file is created while creating release by ./scripts/remove-incomplete-mo
*/
if (@file_exists('libraries/language_stats.inc.php')) {
include 'libraries/language_stats.inc.php';
/*
* This message is intentionally not translated, because we're
* handling incomplete translations here and focus on english
* speaking users.
*/
if (isset($GLOBALS['language_stats'][$lang])
&& $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']
) {
trigger_error(
'You are using an incomplete translation, please help to make it '
. 'better by [a@https://www.phpmyadmin.net/translate/'
. '@_blank]contributing[/a].',
E_USER_NOTICE
);
}
}

View File

@ -1,550 +0,0 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
$(function () {
checkNumberOfFields();
});
/**
* Holds common parameters such as server, db, table, etc
*
* The content for this is normally loaded from Header.php or
* Response.php and executed by ajax.js
*/
var PMA_commonParams = (function () {
/**
* @var hash params An associative array of key value pairs
* @access private
*/
var params = {};
// The returned object is the public part of the module
return {
/**
* Saves all the key value pair that
* are provided in the input array
*
* @param obj hash The input array
*
* @return void
*/
setAll: function (obj) {
var reload = false;
var updateNavigation = false;
for (var i in obj) {
if (params[i] !== undefined && params[i] !== obj[i]) {
if (i === 'db' || i === 'table') {
updateNavigation = true;
}
reload = true;
}
params[i] = obj[i];
}
if (updateNavigation &&
$('#pma_navigation_tree').hasClass('synced')
) {
PMA_showCurrentNavigation();
}
},
/**
* Retrieves a value given its key
* Returns empty string for undefined values
*
* @param name string The key
*
* @return string
*/
get: function (name) {
return params[name];
},
/**
* Saves a single key value pair
*
* @param name string The key
* @param value string The value
*
* @return self For chainability
*/
set: function (name, value) {
var updateNavigation = false;
if (name === 'db' || name === 'table' &&
params[name] !== value
) {
updateNavigation = true;
}
params[name] = value;
if (updateNavigation &&
$('#pma_navigation_tree').hasClass('synced')
) {
PMA_showCurrentNavigation();
}
return this;
},
/**
* Returns the url query string using the saved parameters
*
* @return string
*/
getUrlQuery: function () {
var common = this.get('common_query');
var separator = '?';
var argsep = PMA_commonParams.get('arg_separator');
if (common.length > 0) {
separator = argsep;
}
return PMA_sprintf(
'%s%sserver=%s' + argsep + 'db=%s' + argsep + 'table=%s',
this.get('common_query'),
separator,
encodeURIComponent(this.get('server')),
encodeURIComponent(this.get('db')),
encodeURIComponent(this.get('table'))
);
}
};
}());
/**
* Holds common parameters such as server, db, table, etc
*
* The content for this is normally loaded from Header.php or
* Response.php and executed by ajax.js
*/
var PMA_commonActions = {
/**
* Saves the database name when it's changed
* and reloads the query window, if necessary
*
* @param new_db string new_db The name of the new database
*
* @return void
*/
setDb: function (new_db) {
if (new_db !== PMA_commonParams.get('db')) {
PMA_commonParams.setAll({ 'db': new_db, 'table': '' });
}
},
/**
* Opens a database in the main part of the page
*
* @param new_db string The name of the new database
*
* @return void
*/
openDb: function (new_db) {
PMA_commonParams
.set('db', new_db)
.set('table', '');
this.refreshMain(
PMA_commonParams.get('opendb_url')
);
},
/**
* Refreshes the main frame
*
* @param mixed url Undefined to refresh to the same page
* String to go to a different page, e.g: 'index.php'
*
* @return void
*/
refreshMain: function (url, callback) {
if (! url) {
url = $('#selflink').find('a').attr('href');
url = url.substring(0, url.indexOf('?'));
}
url += PMA_commonParams.getUrlQuery();
$('<a />', { href: url })
.appendTo('body')
.click()
.remove();
AJAX._callback = callback;
}
};
/**
* Class to handle PMA Drag and Drop Import
* feature
*/
PMA_DROP_IMPORT = {
/**
* @var int, count of total uploads in this view
*/
uploadCount: 0,
/**
* @var int, count of live uploads
*/
liveUploadCount: 0,
/**
* @var string array, allowed extensions
*/
allowedExtensions: ['sql', 'xml', 'ldi', 'mediawiki', 'shp'],
/**
* @var string array, allowed extensions for compressed files
*/
allowedCompressedExtensions: ['gz', 'bz2', 'zip'],
/**
* @var obj array to store message returned by import_status.php
*/
importStatus: [],
/**
* Checks if any dropped file has valid extension or not
*
* @param file filename
*
* @return string, extension for valid extension, '' otherwise
*/
_getExtension: function (file) {
var arr = file.split('.');
ext = arr[arr.length - 1];
// check if compressed
if (jQuery.inArray(ext.toLowerCase(),
PMA_DROP_IMPORT.allowedCompressedExtensions) !== -1) {
ext = arr[arr.length - 2];
}
// Now check for extension
if (jQuery.inArray(ext.toLowerCase(),
PMA_DROP_IMPORT.allowedExtensions) !== -1) {
return ext;
}
return '';
},
/**
* Shows upload progress for different sql uploads
*
* @param: hash (string), hash for specific file upload
* @param: percent (float), file upload percentage
*
* @return void
*/
_setProgress: function (hash, percent) {
$('.pma_sql_import_status div li[data-hash="' + hash + '"]')
.children('progress').val(percent);
},
/**
* Function to upload the file asynchronously
*
* @param formData FormData object for a specific file
* @param hash hash of the current file upload
*
* @return void
*/
_sendFileToServer: function (formData, hash) {
var uploadURL = './import.php'; // Upload URL
var extraData = {};
var jqXHR = $.ajax({
xhr: function () {
var xhrobj = $.ajaxSettings.xhr();
if (xhrobj.upload) {
xhrobj.upload.addEventListener('progress', function (event) {
var percent = 0;
var position = event.loaded || event.position;
var total = event.total;
if (event.lengthComputable) {
percent = Math.ceil(position / total * 100);
}
// Set progress
PMA_DROP_IMPORT._setProgress(hash, percent);
}, false);
}
return xhrobj;
},
url: uploadURL,
type: 'POST',
contentType:false,
processData: false,
cache: false,
data: formData,
success: function (data) {
PMA_DROP_IMPORT._importFinished(hash, false, data.success);
if (!data.success) {
PMA_DROP_IMPORT.importStatus[PMA_DROP_IMPORT.importStatus.length] = {
hash: hash,
message: data.error
};
}
}
});
// -- provide link to cancel the upload
$('.pma_sql_import_status div li[data-hash="' + hash +
'"] span.filesize').html('<span hash="' +
hash + '" class="pma_drop_file_status" task="cancel">' +
PMA_messages.dropImportMessageCancel + '</span>');
// -- add event listener to this link to abort upload operation
$('.pma_sql_import_status div li[data-hash="' + hash +
'"] span.filesize span.pma_drop_file_status')
.on('click', function () {
if ($(this).attr('task') === 'cancel') {
jqXHR.abort();
$(this).html('<span>' + PMA_messages.dropImportMessageAborted + '</span>');
PMA_DROP_IMPORT._importFinished(hash, true, false);
} else if ($(this).children('span').html() ===
PMA_messages.dropImportMessageFailed) {
// -- view information
var $this = $(this);
$.each(PMA_DROP_IMPORT.importStatus,
function (key, value) {
if (value.hash === hash) {
$('.pma_drop_result:visible').remove();
var filename = $this.parent('span').attr('data-filename');
$('body').append('<div class="pma_drop_result"><h2>' +
PMA_messages.dropImportImportResultHeader + ' - ' +
filename + '<span class="close">x</span></h2>' + value.message + '</div>');
$('.pma_drop_result').draggable(); // to make this dialog draggable
}
});
}
});
},
/**
* Triggered when an object is dragged into the PMA UI
*
* @param event obj
*
* @return void
*/
_dragenter : function (event) {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
return;
}
event.stopPropagation();
event.preventDefault();
if (!PMA_DROP_IMPORT._hasFiles(event)) {
return;
}
if (PMA_commonParams.get('db') === '') {
$('.pma_drop_handler').html(PMA_messages.dropImportSelectDB);
} else {
$('.pma_drop_handler').html(PMA_messages.dropImportDropFiles);
}
$('.pma_drop_handler').fadeIn();
},
/**
* Check if dragged element contains Files
*
* @param event the event object
*
* @return bool
*/
_hasFiles: function (event) {
return !(typeof event.originalEvent.dataTransfer.types === 'undefined' ||
$.inArray('Files', event.originalEvent.dataTransfer.types) < 0 ||
$.inArray(
'application/x-moz-nativeimage',
event.originalEvent.dataTransfer.types
) >= 0);
},
/**
* Triggered when dragged file is being dragged over PMA UI
*
* @param event obj
*
* @return void
*/
_dragover: function (event) {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
return;
}
event.stopPropagation();
event.preventDefault();
if (!PMA_DROP_IMPORT._hasFiles(event)) {
return;
}
$('.pma_drop_handler').fadeIn();
},
/**
* Triggered when dragged objects are left
*
* @param event obj
*
* @return void
*/
_dragleave: function (event) {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
return;
}
event.stopPropagation();
event.preventDefault();
var $pma_drop_handler = $('.pma_drop_handler');
$pma_drop_handler.clearQueue().stop();
$pma_drop_handler.fadeOut();
$pma_drop_handler.html(PMA_messages.dropImportDropFiles);
},
/**
* Called when upload has finished
*
* @param string, unique hash for a certain upload
* @param bool, true if upload was aborted
* @param bool, status of sql upload, as sent by server
*
* @return void
*/
_importFinished: function (hash, aborted, status) {
$('.pma_sql_import_status div li[data-hash="' + hash + '"]')
.children('progress').hide();
var icon = 'icon ic_s_success';
// -- provide link to view upload status
if (!aborted) {
if (status) {
$('.pma_sql_import_status div li[data-hash="' + hash +
'"] span.filesize span.pma_drop_file_status')
.html('<span>' + PMA_messages.dropImportMessageSuccess + '</a>');
} else {
$('.pma_sql_import_status div li[data-hash="' + hash +
'"] span.filesize span.pma_drop_file_status')
.html('<span class="underline">' + PMA_messages.dropImportMessageFailed +
'</a>');
icon = 'icon ic_s_error';
}
} else {
icon = 'icon ic_s_notice';
}
$('.pma_sql_import_status div li[data-hash="' + hash +
'"] span.filesize span.pma_drop_file_status')
.attr('task', 'info');
// Set icon
$('.pma_sql_import_status div li[data-hash="' + hash + '"]')
.prepend('<img src="./themes/dot.gif" title="finished" class="' +
icon + '"> ');
// Decrease liveUploadCount by one
$('.pma_import_count').html(--PMA_DROP_IMPORT.liveUploadCount);
if (!PMA_DROP_IMPORT.liveUploadCount) {
$('.pma_sql_import_status h2 .close').fadeIn();
}
},
/**
* Triggered when dragged objects are dropped to UI
* From this function, the AJAX Upload operation is initiated
*
* @param event object
*
* @return void
*/
_drop: function (event) {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
return;
}
var dbname = PMA_commonParams.get('db');
var server = PMA_commonParams.get('server');
// if no database is selected -- no
if (dbname !== '') {
var files = event.originalEvent.dataTransfer.files;
if (!files || files.length === 0) {
// No files actually transferred
$('.pma_drop_handler').fadeOut();
event.stopPropagation();
event.preventDefault();
return;
}
$('.pma_sql_import_status').slideDown();
for (var i = 0; i < files.length; i++) {
var ext = (PMA_DROP_IMPORT._getExtension(files[i].name));
var hash = AJAX.hash(++PMA_DROP_IMPORT.uploadCount);
var $pma_sql_import_status_div = $('.pma_sql_import_status div');
$pma_sql_import_status_div.append('<li data-hash="' + hash + '">' +
((ext !== '') ? '' : '<img src="./themes/dot.gif" title="invalid format" class="icon ic_s_notice"> ') +
escapeHtml(files[i].name) + '<span class="filesize" data-filename="' +
escapeHtml(files[i].name) + '">' + (files[i].size / 1024).toFixed(2) +
' kb</span></li>');
// scroll the UI to bottom
$pma_sql_import_status_div.scrollTop(
$pma_sql_import_status_div.scrollTop() + 50
); // 50 hardcoded for now
if (ext !== '') {
// Increment liveUploadCount by one
$('.pma_import_count').html(++PMA_DROP_IMPORT.liveUploadCount);
$('.pma_sql_import_status h2 .close').fadeOut();
$('.pma_sql_import_status div li[data-hash="' + hash + '"]')
.append('<br><progress max="100" value="2"></progress>');
// uploading
var fd = new FormData();
fd.append('import_file', files[i]);
fd.append('noplugin', Math.random().toString(36).substring(2, 12));
fd.append('db', dbname);
fd.append('server', server);
fd.append('token', PMA_commonParams.get('token'));
fd.append('import_type', 'database');
// todo: method to find the value below
fd.append('MAX_FILE_SIZE', '4194304');
// todo: method to find the value below
fd.append('charset_of_file','utf-8');
// todo: method to find the value below
fd.append('allow_interrupt', 'yes');
fd.append('skip_queries', '0');
fd.append('format',ext);
fd.append('sql_compatibility','NONE');
fd.append('sql_no_auto_value_on_zero','something');
fd.append('ajax_request','true');
fd.append('hash', hash);
// init uploading
PMA_DROP_IMPORT._sendFileToServer(fd, hash);
} else if (!PMA_DROP_IMPORT.liveUploadCount) {
$('.pma_sql_import_status h2 .close').fadeIn();
}
}
}
$('.pma_drop_handler').fadeOut();
event.stopPropagation();
event.preventDefault();
}
};
/**
* Called when some user drags, dragover, leave
* a file to the PMA UI
* @param object Event data
* @return void
*/
$(document).on('dragenter', PMA_DROP_IMPORT._dragenter);
$(document).on('dragover', PMA_DROP_IMPORT._dragover);
$(document).on('dragleave', '.pma_drop_handler', PMA_DROP_IMPORT._dragleave);
// when file is dropped to PMA UI
$(document).on('drop', 'body', PMA_DROP_IMPORT._drop);
// minimizing-maximising the sql ajax upload status
$(document).on('click', '.pma_sql_import_status h2 .minimize', function () {
if ($(this).attr('toggle') === 'off') {
$('.pma_sql_import_status div').css('height','270px');
$(this).attr('toggle','on');
$(this).html('-'); // to minimize
} else {
$('.pma_sql_import_status div').css('height','0px');
$(this).attr('toggle','off');
$(this).html('+'); // to maximise
}
});
// closing sql ajax upload status
$(document).on('click', '.pma_sql_import_status h2 .close', function () {
$('.pma_sql_import_status').fadeOut(function () {
$('.pma_sql_import_status div').html('');
PMA_DROP_IMPORT.importStatus = []; // clear the message array
});
});
// Closing the import result box
$(document).on('click', '.pma_drop_result h2 .close', function () {
$(this).parent('h2').parent('div').remove();
});

View File

@ -1,866 +0,0 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in configuration forms and on user preferences pages
*/
/**
* checks whether browser supports web storage
*
* @param type the type of storage i.e. localStorage or sessionStorage
*
* @returns bool
*/
function isStorageSupported (type, warn) {
try {
window[type].setItem('PMATest', 'test');
// Check whether key-value pair was set successfully
if (window[type].getItem('PMATest') === 'test') {
// Supported, remove test variable from storage
window[type].removeItem('PMATest');
return true;
}
} catch (error) {
// Not supported
if (warn) {
PMA_ajaxShowMessage(PMA_messages.strNoLocalStorage, false);
}
}
return false;
}
/**
* Unbind all event handlers before tearing down a page
*/
AJAX.registerTeardown('config.js', function () {
$('.optbox input[id], .optbox select[id], .optbox textarea[id]').off('change').off('keyup');
$('.optbox input[type=button][name=submit_reset]').off('click');
$('div.tabs_contents').off();
$('#import_local_storage, #export_local_storage').off('click');
$('form.prefs-form').off('change').off('submit');
$(document).off('click', 'div.click-hide-message');
$('#prefs_autoload').find('a').off('click');
});
AJAX.registerOnload('config.js', function () {
var $topmenu_upt = $('#topmenu2.user_prefs_tabs');
$topmenu_upt.find('li.active a').attr('rel', 'samepage');
$topmenu_upt.find('li:not(.active) a').attr('rel', 'newpage');
});
// default values for fields
var defaultValues = {};
/**
* Returns field type
*
* @param {Element} field
*/
function getFieldType (field) {
var $field = $(field);
var tagName = $field.prop('tagName');
if (tagName === 'INPUT') {
return $field.attr('type');
} else if (tagName === 'SELECT') {
return 'select';
} else if (tagName === 'TEXTAREA') {
return 'text';
}
return '';
}
/**
* Enables or disables the "restore default value" button
*
* @param {Element} field
* @param {boolean} display
*/
function setRestoreDefaultBtn (field, display) {
var $el = $(field).closest('td').find('.restore-default img');
$el[display ? 'show' : 'hide']();
}
/**
* Marks field depending on its value (system default or custom)
*
* @param {Element} field
*/
function markField (field) {
var $field = $(field);
var type = getFieldType($field);
var isDefault = checkFieldDefault($field, type);
// checkboxes uses parent <span> for marking
var $fieldMarker = (type === 'checkbox') ? $field.parent() : $field;
setRestoreDefaultBtn($field, !isDefault);
$fieldMarker[isDefault ? 'removeClass' : 'addClass']('custom');
}
/**
* Sets field value
*
* value must be of type:
* o undefined (omitted) - restore default value (form default, not PMA default)
* o String - if field_type is 'text'
* o boolean - if field_type is 'checkbox'
* o Array of values - if field_type is 'select'
*
* @param {Element} field
* @param {String} field_type see {@link #getFieldType}
* @param {String|Boolean} value
*/
function setFieldValue (field, field_type, value) {
var $field = $(field);
switch (field_type) {
case 'text':
case 'number':
$field.val(value);
break;
case 'checkbox':
$field.prop('checked', value);
break;
case 'select':
var options = $field.prop('options');
var i;
var imax = options.length;
var i, imax = options.length;
for (i = 0; i < imax; i++) {
options[i].selected = (value.indexOf(options[i].value) != -1);
}
break;
}
markField($field);
}
/**
* Gets field value
*
* Will return one of:
* o String - if type is 'text'
* o boolean - if type is 'checkbox'
* o Array of values - if type is 'select'
*
* @param {Element} field
* @param {String} field_type returned by {@link #getFieldType}
* @type Boolean|String|String[]
*/
function getFieldValue (field, field_type) {
var $field = $(field);
switch (field_type) {
case 'text':
case 'number':
return $field.prop('value');
case 'checkbox':
return $field.prop('checked');
case 'select':
var options = $field.prop('options');
var i;
var imax = options.length;
var items = [];
for (i = 0; i < imax; i++) {
if (options[i].selected) {
items.push(options[i].value);
}
}
return items;
}
return null;
}
/**
* Returns values for all fields in fieldsets
*/
function getAllValues () {
var $elements = $('fieldset input, fieldset select, fieldset textarea');
var values = {};
var type;
var value;
for (var i = 0; i < $elements.length; i++) {
type = getFieldType($elements[i]);
value = getFieldValue($elements[i], type);
if (typeof value !== 'undefined') {
// we only have single selects, fatten array
if (type === 'select') {
value = value[0];
}
values[$elements[i].name] = value;
}
}
return values;
}
/**
* Checks whether field has its default value
*
* @param {Element} field
* @param {String} type
* @return boolean
*/
function checkFieldDefault (field, type) {
var $field = $(field);
var field_id = $field.attr('id');
if (typeof defaultValues[field_id] === 'undefined') {
return true;
}
var isDefault = true;
var currentValue = getFieldValue($field, type);
if (type !== 'select') {
isDefault = currentValue === defaultValues[field_id];
} else {
// compare arrays, will work for our representation of select values
if (currentValue.length !== defaultValues[field_id].length) {
isDefault = false;
} else {
for (var i = 0; i < currentValue.length; i++) {
if (currentValue[i] !== defaultValues[field_id][i]) {
isDefault = false;
break;
}
}
}
}
return isDefault;
}
/**
* Returns element's id prefix
* @param {Element} element
*/
function getIdPrefix (element) {
return $(element).attr('id').replace(/[^-]+$/, '');
}
// ------------------------------------------------------------------
// Form validation and field operations
//
// form validator assignments
var validate = {};
// form validator list
var validators = {
// regexp: numeric value
_regexp_numeric: /^[0-9]+$/,
// regexp: extract parts from PCRE expression
_regexp_pcre_extract: /(.)(.*)\1(.*)?/,
/**
* Validates positive number
*
* @param {boolean} isKeyUp
*/
PMA_validatePositiveNumber: function (isKeyUp) {
if (isKeyUp && this.value === '') {
return true;
}
var result = this.value !== '0' && validators._regexp_numeric.test(this.value);
return result ? true : PMA_messages.error_nan_p;
},
/**
* Validates non-negative number
*
* @param {boolean} isKeyUp
*/
PMA_validateNonNegativeNumber: function (isKeyUp) {
if (isKeyUp && this.value === '') {
return true;
}
var result = validators._regexp_numeric.test(this.value);
return result ? true : PMA_messages.error_nan_nneg;
},
/**
* Validates port number
*
* @param {boolean} isKeyUp
*/
PMA_validatePortNumber: function (isKeyUp) {
if (this.value === '') {
return true;
}
var result = validators._regexp_numeric.test(this.value) && this.value !== '0';
return result && this.value <= 65535 ? true : PMA_messages.error_incorrect_port;
},
/**
* Validates value according to given regular expression
*
* @param {boolean} isKeyUp
* @param {string} regexp
*/
PMA_validateByRegex: function (isKeyUp, regexp) {
if (isKeyUp && this.value === '') {
return true;
}
// convert PCRE regexp
var parts = regexp.match(validators._regexp_pcre_extract);
var valid = this.value.match(new RegExp(parts[2], parts[3])) !== null;
return valid ? true : PMA_messages.error_invalid_value;
},
/**
* Validates upper bound for numeric inputs
*
* @param {boolean} isKeyUp
* @param {int} max_value
*/
PMA_validateUpperBound: function (isKeyUp, max_value) {
var val = parseInt(this.value, 10);
if (isNaN(val)) {
return true;
}
return val <= max_value ? true : PMA_sprintf(PMA_messages.error_value_lte, max_value);
},
// field validators
_field: {
},
// fieldset validators
_fieldset: {
}
};
/**
* Registers validator for given field
*
* @param {String} id field id
* @param {String} type validator (key in validators object)
* @param {boolean} onKeyUp whether fire on key up
* @param {Array} params validation function parameters
*/
function validateField (id, type, onKeyUp, params) {
if (typeof validators[type] === 'undefined') {
return;
}
if (typeof validate[id] === 'undefined') {
validate[id] = [];
}
validate[id].push([type, params, onKeyUp]);
}
/**
* Returns validation functions associated with form field
*
* @param {String} field_id form field id
* @param {boolean} onKeyUpOnly see validateField
* @type Array
* @return array of [function, parameters to be passed to function]
*/
function getFieldValidators (field_id, onKeyUpOnly) {
// look for field bound validator
var name = field_id && field_id.match(/[^-]+$/)[0];
if (typeof validators._field[name] !== 'undefined') {
return [[validators._field[name], null]];
}
// look for registered validators
var functions = [];
if (typeof validate[field_id] !== 'undefined') {
// validate[field_id]: array of [type, params, onKeyUp]
for (var i = 0, imax = validate[field_id].length; i < imax; i++) {
if (onKeyUpOnly && !validate[field_id][i][2]) {
continue;
}
functions.push([validators[validate[field_id][i][0]], validate[field_id][i][1]]);
}
}
return functions;
}
/**
* Displays errors for given form fields
*
* WARNING: created DOM elements must be identical with the ones made by
* PhpMyAdmin\Config\FormDisplayTemplate::displayInput()!
*
* @param {Object} error_list list of errors in the form {field id: error array}
*/
function displayErrors (error_list) {
var tempIsEmpty = function (item) {
return item !== '';
};
for (var field_id in error_list) {
var errors = error_list[field_id];
var $field = $('#' + field_id);
var isFieldset = $field.attr('tagName') === 'FIELDSET';
var $errorCnt;
if (isFieldset) {
$errorCnt = $field.find('dl.errors');
} else {
$errorCnt = $field.siblings('.inline_errors');
}
// remove empty errors (used to clear error list)
errors = $.grep(errors, tempIsEmpty);
// CSS error class
if (!isFieldset) {
// checkboxes uses parent <span> for marking
var $fieldMarker = ($field.attr('type') === 'checkbox') ? $field.parent() : $field;
$fieldMarker[errors.length ? 'addClass' : 'removeClass']('field-error');
}
if (errors.length) {
// if error container doesn't exist, create it
if ($errorCnt.length === 0) {
if (isFieldset) {
$errorCnt = $('<dl class="errors" />');
$field.find('table').before($errorCnt);
} else {
$errorCnt = $('<dl class="inline_errors" />');
$field.closest('td').append($errorCnt);
}
}
var html = '';
for (var i = 0, imax = errors.length; i < imax; i++) {
html += '<dd>' + errors[i] + '</dd>';
}
$errorCnt.html(html);
} else if ($errorCnt !== null) {
// remove useless error container
$errorCnt.remove();
}
}
}
/**
* Validates fieldset and puts errors in 'errors' object
*
* @param {Element} fieldset
* @param {boolean} isKeyUp
* @param {Object} errors
*/
function validate_fieldset (fieldset, isKeyUp, errors) {
var $fieldset = $(fieldset);
if ($fieldset.length && typeof validators._fieldset[$fieldset.attr('id')] !== 'undefined') {
var fieldset_errors = validators._fieldset[$fieldset.attr('id')].apply($fieldset[0], [isKeyUp]);
for (var field_id in fieldset_errors) {
if (typeof errors[field_id] === 'undefined') {
errors[field_id] = [];
}
if (typeof fieldset_errors[field_id] === 'string') {
fieldset_errors[field_id] = [fieldset_errors[field_id]];
}
$.merge(errors[field_id], fieldset_errors[field_id]);
}
}
}
/**
* Validates form field and puts errors in 'errors' object
*
* @param {Element} field
* @param {boolean} isKeyUp
* @param {Object} errors
*/
function validate_field (field, isKeyUp, errors) {
var args;
var result;
var $field = $(field);
var field_id = $field.attr('id');
errors[field_id] = [];
var functions = getFieldValidators(field_id, isKeyUp);
for (var i = 0; i < functions.length; i++) {
if (typeof functions[i][1] !== 'undefined' && functions[i][1] !== null) {
args = functions[i][1].slice(0);
} else {
args = [];
}
args.unshift(isKeyUp);
result = functions[i][0].apply($field[0], args);
if (result !== true) {
if (typeof result === 'string') {
result = [result];
}
$.merge(errors[field_id], result);
}
}
}
/**
* Validates form field and parent fieldset
*
* @param {Element} field
* @param {boolean} isKeyUp
*/
function validate_field_and_fieldset (field, isKeyUp) {
var $field = $(field);
var errors = {};
validate_field($field, isKeyUp, errors);
validate_fieldset($field.closest('fieldset.optbox'), isKeyUp, errors);
displayErrors(errors);
}
function loadInlineConfig () {
if (!Array.isArray(configInlineParams)) {
return;
}
for (var i = 0; i < configInlineParams.length; ++i) {
if (typeof configInlineParams[i] === 'function') {
configInlineParams[i]();
}
}
}
function setupValidation () {
validate = {};
configScriptLoaded = true;
if (configScriptLoaded && typeof configInlineParams !== 'undefined') {
loadInlineConfig();
}
// register validators and mark custom values
var $elements = $('.optbox input[id], .optbox select[id], .optbox textarea[id]');
$elements.each(function () {
markField(this);
var $el = $(this);
$el.on('change', function () {
validate_field_and_fieldset(this, false);
markField(this);
});
var tagName = $el.attr('tagName');
// text fields can be validated after each change
if (tagName === 'INPUT' && $el.attr('type') === 'text') {
$el.keyup(function () {
validate_field_and_fieldset($el, true);
markField($el);
});
}
// disable textarea spellcheck
if (tagName === 'TEXTAREA') {
$el.attr('spellcheck', false);
}
});
// check whether we've refreshed a page and browser remembered modified
// form values
var $check_page_refresh = $('#check_page_refresh');
if ($check_page_refresh.length === 0 || $check_page_refresh.val() === '1') {
// run all field validators
var errors = {};
for (var i = 0; i < $elements.length; i++) {
validate_field($elements[i], false, errors);
}
// run all fieldset validators
$('fieldset.optbox').each(function () {
validate_fieldset(this, false, errors);
});
displayErrors(errors);
} else if ($check_page_refresh) {
$check_page_refresh.val('1');
}
}
AJAX.registerOnload('config.js', function () {
setupValidation();
});
//
// END: Form validation and field operations
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// Tabbed forms
//
/**
* Sets active tab
*
* @param {String} tab_id
*/
function setTab (tab_id) {
$('ul.tabs').each(function () {
var $this = $(this);
if (!$this.find('li a[href="#' + tab_id + '"]').length) {
return;
}
$this.find('li').removeClass('active').find('a[href="#' + tab_id + '"]').parent().addClass('active');
$this.parent().find('div.tabs_contents fieldset').hide().filter('#' + tab_id).show();
var hashValue = 'tab_' + tab_id;
location.hash = hashValue;
$this.parent().find('input[name=tab_hash]').val(hashValue);
});
}
function setupConfigTabs () {
var forms = $('form.config-form');
forms.each(function () {
var $this = $(this);
var $tabs = $this.find('ul.tabs');
if (!$tabs.length) {
return;
}
// add tabs events and activate one tab (the first one or indicated by location hash)
$tabs.find('li').removeClass('active');
$tabs.find('a')
.click(function (e) {
e.preventDefault();
setTab($(this).attr('href').substr(1));
})
.filter(':first')
.parent()
.addClass('active');
$this.find('div.tabs_contents fieldset').hide().filter(':first').show();
});
}
function adjustPrefsNotification () {
var $prefsAutoLoad = $('#prefs_autoload');
var $tableNameControl = $('#table_name_col_no');
var $prefsAutoShowing = ($prefsAutoLoad.css('display') !== 'none');
if ($prefsAutoShowing && $tableNameControl.length) {
$tableNameControl.css('top', '55px');
}
}
AJAX.registerOnload('config.js', function () {
setupConfigTabs();
adjustPrefsNotification();
// tab links handling, check each 200ms
// (works with history in FF, further browser support here would be an overkill)
var prev_hash;
var tab_check_fnc = function () {
if (location.hash !== prev_hash) {
prev_hash = location.hash;
if (prev_hash.match(/^#tab_[a-zA-Z0-9_]+$/)) {
// session ID is sometimes appended here
var hash = prev_hash.substr(5).split('&')[0];
if ($('#' + hash).length) {
setTab(hash);
}
}
}
};
tab_check_fnc();
setInterval(tab_check_fnc, 200);
});
//
// END: Tabbed forms
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// Form reset buttons
//
AJAX.registerOnload('config.js', function () {
$('.optbox input[type=button][name=submit_reset]').on('click', function () {
var fields = $(this).closest('fieldset').find('input, select, textarea');
for (var i = 0, imax = fields.length; i < imax; i++) {
setFieldValue(fields[i], getFieldType(fields[i]), defaultValues[fields[i].id]);
}
});
});
//
// END: Form reset buttons
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// "Restore default" and "set value" buttons
//
/**
* Restores field's default value
*
* @param {String} field_id
*/
function restoreField (field_id) {
var $field = $('#' + field_id);
if ($field.length === 0 || defaultValues[field_id] === undefined) {
return;
}
setFieldValue($field, getFieldType($field), defaultValues[field_id]);
}
function setupRestoreField () {
$('div.tabs_contents')
.on('mouseenter', '.restore-default, .set-value', function () {
$(this).css('opacity', 1);
})
.on('mouseleave', '.restore-default, .set-value', function () {
$(this).css('opacity', 0.25);
})
.on('click', '.restore-default, .set-value', function (e) {
e.preventDefault();
var href = $(this).attr('href');
var field_sel;
if ($(this).hasClass('restore-default')) {
field_sel = href;
restoreField(field_sel.substr(1));
} else {
field_sel = href.match(/^[^=]+/)[0];
var value = href.match(/\=(.+)$/)[1];
setFieldValue($(field_sel), 'text', value);
}
$(field_sel).trigger('change');
})
.find('.restore-default, .set-value')
// inline-block for IE so opacity inheritance works
.css({ display: 'inline-block', opacity: 0.25 });
}
AJAX.registerOnload('config.js', function () {
setupRestoreField();
});
//
// END: "Restore default" and "set value" buttons
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// User preferences import/export
//
AJAX.registerOnload('config.js', function () {
offerPrefsAutoimport();
var $radios = $('#import_local_storage, #export_local_storage');
if (!$radios.length) {
return;
}
// enable JavaScript dependent fields
$radios
.prop('disabled', false)
.add('#export_text_file, #import_text_file')
.click(function () {
var enable_id = $(this).attr('id');
var disable_id;
if (enable_id.match(/local_storage$/)) {
disable_id = enable_id.replace(/local_storage$/, 'text_file');
} else {
disable_id = enable_id.replace(/text_file$/, 'local_storage');
}
$('#opts_' + disable_id).addClass('disabled').find('input').prop('disabled', true);
$('#opts_' + enable_id).removeClass('disabled').find('input').prop('disabled', false);
});
// detect localStorage state
var ls_supported = isStorageSupported('localStorage', true);
var ls_exists = ls_supported ? (window.localStorage.config || false) : false;
$('div.localStorage-' + (ls_supported ? 'un' : '') + 'supported').hide();
$('div.localStorage-' + (ls_exists ? 'empty' : 'exists')).hide();
if (ls_exists) {
updatePrefsDate();
}
$('form.prefs-form').change(function () {
var $form = $(this);
var disabled = false;
if (!ls_supported) {
disabled = $form.find('input[type=radio][value$=local_storage]').prop('checked');
} else if (!ls_exists && $form.attr('name') === 'prefs_import' &&
$('#import_local_storage')[0].checked
) {
disabled = true;
}
$form.find('input[type=submit]').prop('disabled', disabled);
}).submit(function (e) {
var $form = $(this);
if ($form.attr('name') === 'prefs_export' && $('#export_local_storage')[0].checked) {
e.preventDefault();
// use AJAX to read JSON settings and save them
savePrefsToLocalStorage($form);
} else if ($form.attr('name') === 'prefs_import' && $('#import_local_storage')[0].checked) {
// set 'json' input and submit form
$form.find('input[name=json]').val(window.localStorage.config);
}
});
$(document).on('click', 'div.click-hide-message', function () {
$(this)
.hide()
.parent('.group')
.css('height', '')
.next('form')
.show();
});
});
/**
* Saves user preferences to localStorage
*
* @param {Element} form
*/
function savePrefsToLocalStorage (form) {
$form = $(form);
var submit = $form.find('input[type=submit]');
submit.prop('disabled', true);
$.ajax({
url: 'prefs_manage.php',
cache: false,
type: 'POST',
data: {
ajax_request: true,
server: PMA_commonParams.get('server'),
submit_get_json: true
},
success: function (data) {
if (typeof data !== 'undefined' && data.success === true) {
window.localStorage.config = data.prefs;
window.localStorage.config_mtime = data.mtime;
window.localStorage.config_mtime_local = (new Date()).toUTCString();
updatePrefsDate();
$('div.localStorage-empty').hide();
$('div.localStorage-exists').show();
var group = $form.parent('.group');
group.css('height', group.height() + 'px');
$form.hide('fast');
$form.prev('.click-hide-message').show('fast');
} else {
PMA_ajaxShowMessage(data.error);
}
},
complete: function () {
submit.prop('disabled', false);
}
});
}
/**
* Updates preferences timestamp in Import form
*/
function updatePrefsDate () {
var d = new Date(window.localStorage.config_mtime_local);
var msg = PMA_messages.strSavedOn.replace(
'@DATE@',
PMA_formatDateTime(d)
);
$('#opts_import_local_storage').find('div.localStorage-exists').html(msg);
}
/**
* Prepares message which informs that localStorage preferences are available and can be imported or deleted
*/
function offerPrefsAutoimport () {
var has_config = (isStorageSupported('localStorage')) && (window.localStorage.config || false);
var $cnt = $('#prefs_autoload');
if (!$cnt.length || !has_config) {
return;
}
$cnt.find('a').click(function (e) {
e.preventDefault();
var $a = $(this);
if ($a.attr('href') === '#no') {
$cnt.remove();
$.post('index.php', {
server: PMA_commonParams.get('server'),
prefs_autoload: 'hide'
}, null, 'html');
return;
} else if ($a.attr('href') === '#delete') {
$cnt.remove();
localStorage.clear();
$.post('index.php', {
server: PMA_commonParams.get('server'),
prefs_autoload: 'hide'
}, null, 'html');
return;
}
$cnt.find('input[name=json]').val(window.localStorage.config);
$cnt.find('form').submit();
});
$cnt.show();
}
//
// END: User preferences import/export
// ------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -1,855 +0,0 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* @fileoverview function used in this file builds history tab and generates query.
*
* @requires jQuery
* @requires moves.js
* @version $Id$
*/
var history_array = []; // Global array to store history objects
var select_field = []; // Global array to store informaation for columns which are used in select clause
var g_index;
var vqb_editor = null;
/**
* To display details of objects(where,rename,Having,aggregate,groupby,orderby,having)
*
* @param index index of history_array where change is to be made
*
**/
function detail (index) {
var type = history_array[index].get_type();
var str;
if (type === 'Where') {
str = 'Where ' + history_array[index].get_column_name() + history_array[index].get_obj().getrelation_operator() + history_array[index].get_obj().getquery();
}
if (type === 'Rename') {
str = 'Rename ' + history_array[index].get_column_name() + ' To ' + history_array[index].get_obj().getrename_to();
}
if (type === 'Aggregate') {
str = 'Select ' + history_array[index].get_obj().get_operator() + '( ' + history_array[index].get_column_name() + ' )';
}
if (type === 'GroupBy') {
str = 'GroupBy ' + history_array[index].get_column_name();
}
if (type === 'OrderBy') {
str = 'OrderBy ' + history_array[index].get_column_name() + ' ' + history_array[index].get_obj().get_order();
}
if (type === 'Having') {
str = 'Having ';
if (history_array[index].get_obj().get_operator() !== 'None') {
str += history_array[index].get_obj().get_operator() + '( ' + history_array[index].get_column_name() + ' )';
str += history_array[index].get_obj().getrelation_operator() + history_array[index].get_obj().getquery();
} else {
str = 'Having ' + history_array[index].get_column_name() + history_array[index].get_obj().getrelation_operator() + history_array[index].get_obj().getquery();
}
}
return str;
}
/**
* Sorts history_array[] first,using table name as the key and then generates the HTML code for history tab,
* clubbing all objects of same tables together
* This function is called whenever changes are made in history_array[]
*
*
* @param {int} init starting index of unsorted array
* @param {int} finit last index of unsorted array
*
**/
function display (init, finit) {
var str;
var i;
var j;
var k;
var sto;
var temp;
// this part sorts the history array based on table name,this is needed for clubbing all object of same name together.
for (i = init; i < finit; i++) {
sto = history_array[i];
temp = history_array[i].get_tab();// + '.' + history_array[i].get_obj_no(); for Self JOINS
for (j = 0; j < i; j++) {
if (temp > (history_array[j].get_tab())) {// + '.' + history_array[j].get_obj_no())) { //for Self JOINS
for (k = i; k > j; k--) {
history_array[k] = history_array[k - 1];
}
history_array[j] = sto;
break;
}
}
}
// this part generates HTML code for history tab.adds delete,edit,and/or and detail features with objects.
str = ''; // string to store Html code for history tab
for (i = 0; i < history_array.length; i++) {
temp = history_array[i].get_tab(); // + '.' + history_array[i].get_obj_no(); for Self JOIN
str += '<h3 class="tiger"><a href="#">' + temp + '</a></h3>';
str += '<div class="toggle_container">\n';
while ((history_array[i].get_tab()) === temp) { // + '.' + history_array[i].get_obj_no()) === temp) {
str += '<div class="block"> <table width ="250">';
str += '<thead><tr><td>';
if (history_array[i].get_and_or()) {
str += '<img src="' + pmaThemeImage + 'designer/or_icon.png" onclick="and_or(' + i + ')" title="OR"/></td>';
} else {
str += '<img src="' + pmaThemeImage + 'designer/and_icon.png" onclick="and_or(' + i + ')" title="AND"/></td>';
}
str += '<td style="padding-left: 5px;" class="right">' + PMA_getImage('b_sbrowse', 'column name') + '</td>' +
'<td width="175" style="padding-left: 5px">' + history_array[i].get_column_name() + '<td>';
if (history_array[i].get_type() === 'GroupBy' || history_array[i].get_type() === 'OrderBy') {
str += '<td class="center">' + PMA_getImage('s_info', detail(i)) + '</td>' +
'<td title="' + detail(i) + '">' + history_array[i].get_type() + '</td>' +
'<td onclick=history_delete(' + i + ')>' + PMA_getImage('b_drop', PMA_messages.strDelete) + '</td>';
} else {
str += '<td class="center">' + PMA_getImage('s_info', detail(i)) + '</td>' +
'<td title="' + detail(i) + '">' + history_array[i].get_type() + '</td>' +
'<td onclick=history_edit(' + i + ')>' + PMA_getImage('b_edit', PMA_messages.strEdit) + '</td>' +
'<td onclick=history_delete(' + i + ')>' + PMA_getImage('b_drop', PMA_messages.strDelete) + '</td>';
}
str += '</tr></thead>';
i++;
if (i >= history_array.length) {
break;
}
str += '</table></div>';
}
i--;
str += '</div>';
}
return str;
}
/**
* To change And/Or relation in history tab
*
*
* @param {int} index of history_array where change is to be made
*
**/
function and_or (index) {
if (history_array[index].get_and_or()) {
history_array[index].set_and_or(0);
} else {
history_array[index].set_and_or(1);
}
var existingDiv = document.getElementById('ab');
existingDiv.innerHTML = display(0, 0);
$('#ab').accordion('refresh');
}
/**
* Deletes entry in history_array
*
* @param index index of history_array[] which is to be deleted
*
**/
function history_delete (index) {
for (var k = 0; k < from_array.length; k++) {
if (from_array[k] === history_array[index].get_tab()) {
from_array.splice(k, 1);
break;
}
}
history_array.splice(index, 1);
var existingDiv = document.getElementById('ab');
existingDiv.innerHTML = display(0, 0);
$('#ab').accordion('refresh');
}
/**
* To show where,rename,aggregate,having forms to edit a object
*
* @param{int} index index of history_array where change is to be made
*
**/
function history_edit (index) {
g_index = index;
var type = history_array[index].get_type();
if (type === 'Where') {
document.getElementById('eQuery').value = history_array[index].get_obj().getquery();
document.getElementById('erel_opt').value = history_array[index].get_obj().getrelation_operator();
document.getElementById('query_where').style.left = '530px';
document.getElementById('query_where').style.top = '130px';
document.getElementById('query_where').style.position = 'absolute';
document.getElementById('query_where').style.zIndex = '103';
document.getElementById('query_where').style.visibility = 'visible';
document.getElementById('query_where').style.display = 'block';
}
if (type === 'Having') {
document.getElementById('hQuery').value = history_array[index].get_obj().getquery();
document.getElementById('hrel_opt').value = history_array[index].get_obj().getrelation_operator();
document.getElementById('hoperator').value = history_array[index].get_obj().get_operator();
document.getElementById('query_having').style.left = '530px';
document.getElementById('query_having').style.top = '130px';
document.getElementById('query_having').style.position = 'absolute';
document.getElementById('query_having').style.zIndex = '103';
document.getElementById('query_having').style.visibility = 'visible';
document.getElementById('query_having').style.display = 'block';
}
if (type === 'Rename') {
document.getElementById('e_rename').value = history_array[index].get_obj().getrename_to();
document.getElementById('query_rename_to').style.left = '530px';
document.getElementById('query_rename_to').style.top = '130px';
document.getElementById('query_rename_to').style.position = 'absolute';
document.getElementById('query_rename_to').style.zIndex = '103';
document.getElementById('query_rename_to').style.visibility = 'visible';
document.getElementById('query_rename_to').style.display = 'block';
}
if (type === 'Aggregate') {
document.getElementById('e_operator').value = history_array[index].get_obj().get_operator();
document.getElementById('query_Aggregate').style.left = '530px';
document.getElementById('query_Aggregate').style.top = '130px';
document.getElementById('query_Aggregate').style.position = 'absolute';
document.getElementById('query_Aggregate').style.zIndex = '103';
document.getElementById('query_Aggregate').style.visibility = 'visible';
document.getElementById('query_Aggregate').style.display = 'block';
}
}
/**
* Make changes in history_array when Edit button is clicked
* checks for the type of object and then sets the new value
*
* @param index index of history_array where change is to be made
**/
function edit (type) {
if (type === 'Rename') {
if (document.getElementById('e_rename').value !== '') {
history_array[g_index].get_obj().setrename_to(document.getElementById('e_rename').value);
document.getElementById('e_rename').value = '';
}
document.getElementById('query_rename_to').style.visibility = 'hidden';
}
if (type === 'Aggregate') {
if (document.getElementById('e_operator').value !== '---') {
history_array[g_index].get_obj().set_operator(document.getElementById('e_operator').value);
document.getElementById('e_operator').value = '---';
}
document.getElementById('query_Aggregate').style.visibility = 'hidden';
}
if (type === 'Where') {
if (document.getElementById('erel_opt').value !== '--' && document.getElementById('eQuery').value !== '') {
history_array[g_index].get_obj().setquery(document.getElementById('eQuery').value);
history_array[g_index].get_obj().setrelation_operator(document.getElementById('erel_opt').value);
}
document.getElementById('query_where').style.visibility = 'hidden';
}
if (type === 'Having') {
if (document.getElementById('hrel_opt').value !== '--' && document.getElementById('hQuery').value !== '') {
history_array[g_index].get_obj().setquery(document.getElementById('hQuery').value);
history_array[g_index].get_obj().setrelation_operator(document.getElementById('hrel_opt').value);
history_array[g_index].get_obj().set_operator(document.getElementById('hoperator').value);
}
document.getElementById('query_having').style.visibility = 'hidden';
}
var existingDiv = document.getElementById('ab');
existingDiv.innerHTML = display(0, 0);
$('#ab').accordion('refresh');
}
/**
* history object closure
*
* @param ncolumn_name name of the column on which conditions are put
* @param nobj object details(where,rename,orderby,groupby,aggregate)
* @param ntab table name of the column on which conditions are applied
* @param nobj_no object no used for inner join
* @param ntype type of object
*
**/
function history_obj (ncolumn_name, nobj, ntab, nobj_no, ntype) {
var and_or;
var obj;
var tab;
var column_name;
var obj_no;
var type;
this.set_column_name = function (ncolumn_name) {
column_name = ncolumn_name;
};
this.get_column_name = function () {
return column_name;
};
this.set_and_or = function (nand_or) {
and_or = nand_or;
};
this.get_and_or = function () {
return and_or;
};
this.get_relation = function () {
return and_or;
};
this.set_obj = function (nobj) {
obj = nobj;
};
this.get_obj = function () {
return obj;
};
this.set_tab = function (ntab) {
tab = ntab;
};
this.get_tab = function () {
return tab;
};
this.set_obj_no = function (nobj_no) {
obj_no = nobj_no;
};
this.get_obj_no = function () {
return obj_no;
};
this.set_type = function (ntype) {
type = ntype;
};
this.get_type = function () {
return type;
};
this.set_obj_no(nobj_no);
this.set_tab(ntab);
this.set_and_or(0);
this.set_obj(nobj);
this.set_column_name(ncolumn_name);
this.set_type(ntype);
}
/**
* where object closure, makes an object with all information of where
*
* @param nrelation_operator type of relation operator to be applied
* @param nquery stores value of value/sub-query
*
**/
var where = function (nrelation_operator, nquery) {
var relation_operator;
var query;
this.setrelation_operator = function (nrelation_operator) {
relation_operator = nrelation_operator;
};
this.setquery = function (nquery) {
query = nquery;
};
this.getquery = function () {
return query;
};
this.getrelation_operator = function () {
return relation_operator;
};
this.setquery(nquery);
this.setrelation_operator(nrelation_operator);
};
/**
* Orderby object closure
*
* @param norder order, ASC or DESC
*/
var orderby = function (norder) {
var order;
this.set_order = function (norder) {
order = norder;
};
this.get_order = function () {
return order;
};
this.set_order(norder);
};
/**
* Having object closure, makes an object with all information of where
*
* @param nrelation_operator type of relation operator to be applied
* @param nquery stores value of value/sub-query
* @param noperator operator
**/
var having = function (nrelation_operator, nquery, noperator) {
var relation_operator;
var query;
var operator;
this.set_operator = function (noperator) {
operator = noperator;
};
this.setrelation_operator = function (nrelation_operator) {
relation_operator = nrelation_operator;
};
this.setquery = function (nquery) {
query = nquery;
};
this.getquery = function () {
return query;
};
this.getrelation_operator = function () {
return relation_operator;
};
this.get_operator = function () {
return operator;
};
this.setquery(nquery);
this.setrelation_operator(nrelation_operator);
this.set_operator(noperator);
};
/**
* rename object closure,makes an object with all information of rename
*
* @param nrename_to new name information
*
**/
var rename = function (nrename_to) {
var rename_to;
this.setrename_to = function (nrename_to) {
rename_to = nrename_to;
};
this.getrename_to = function () {
return rename_to;
};
this.setrename_to(nrename_to);
};
/**
* aggregate object closure
*
* @param noperator aggregte operator
*
**/
var aggregate = function (noperator) {
var operator;
this.set_operator = function (noperator) {
operator = noperator;
};
this.get_operator = function () {
return operator;
};
this.set_operator(noperator);
};
/**
* This function returns unique element from an array
*
* @param arrayName array from which duplicate elem are to be removed.
* @return unique array
*/
function unique (arrayName) {
var newArray = [];
uniquetop:
for (var i = 0; i < arrayName.length; i++) {
for (var j = 0; j < newArray.length; j++) {
if (newArray[j] === arrayName[i]) {
continue uniquetop;
}
}
newArray[newArray.length] = arrayName[i];
}
return newArray;
}
/**
* This function takes in array and a value as input and returns 1 if values is present in array
* else returns -1
*
* @param arrayName array
* @param value value which is to be searched in the array
*/
function found (arrayName, value) {
for (var i = 0; i < arrayName.length; i++) {
if (arrayName[i] === value) {
return 1;
}
}
return -1;
}
/**
* This function concatenates two array
*
* @params add array elements of which are pushed in
* @params arr array in which elements are added
*/
function add_array (add, arr) {
for (var i = 0; i < add.length; i++) {
arr.push(add[i]);
}
return arr;
}
/* This function removes all elements present in one array from the other.
*
* @params rem array from which each element is removed from other array.
* @params arr array from which elements are removed.
*
*/
function remove_array (rem, arr) {
for (var i = 0; i < rem.length; i++) {
for (var j = 0; j < arr.length; j++) {
if (rem[i] === arr[j]) {
arr.splice(j, 1);
}
}
}
return arr;
}
/**
* This function builds the groupby clause from history object
*
*/
function query_groupby () {
var i;
var str = '';
for (i = 0; i < history_array.length;i++) {
if (history_array[i].get_type() === 'GroupBy') {
str += '`' + history_array[i].get_column_name() + '`, ';
}
}
str = str.substr(0, str.length - 2);
return str;
}
/**
* This function builds the Having clause from the history object.
*
*/
function query_having () {
var i;
var and = '(';
for (i = 0; i < history_array.length;i++) {
if (history_array[i].get_type() === 'Having') {
if (history_array[i].get_obj().get_operator() !== 'None') {
and += history_array[i].get_obj().get_operator() + '(`' + history_array[i].get_column_name() + '`) ' + history_array[i].get_obj().getrelation_operator();
and += ' ' + history_array[i].get_obj().getquery() + ', ';
} else {
and += '`' + history_array[i].get_column_name() + '` ' + history_array[i].get_obj().getrelation_operator() + ' ' + history_array[i].get_obj().getquery() + ', ';
}
}
}
if (and === '(') {
and = '';
} else {
and = and.substr(0, and.length - 2) + ')';
}
return and;
}
/**
* This function builds the orderby clause from the history object.
*
*/
function query_orderby () {
var i;
var str = '';
for (i = 0; i < history_array.length;i++) {
if (history_array[i].get_type() === 'OrderBy') {
str += '`' + history_array[i].get_column_name() + '` ' +
history_array[i].get_obj().get_order() + ', ';
}
}
str = str.substr(0, str.length - 2);
return str;
}
/**
* This function builds the Where clause from the history object.
*
*/
function query_where () {
var i;
var and = '(';
var or = '(';
for (i = 0; i < history_array.length;i++) {
if (history_array[i].get_type() === 'Where') {
if (history_array[i].get_and_or() === 0) {
and += '( `' + history_array[i].get_column_name() + '` ' + history_array[i].get_obj().getrelation_operator() + ' ' + history_array[i].get_obj().getquery() + ')';
and += ' AND ';
} else {
or += '( `' + history_array[i].get_column_name() + '` ' + history_array[i].get_obj().getrelation_operator() + ' ' + history_array[i].get_obj().getquery() + ')';
or += ' OR ';
}
}
}
if (or !== '(') {
or = or.substring(0, (or.length - 4)) + ')';
} else {
or = '';
}
if (and !== '(') {
and = and.substring(0, (and.length - 5)) + ')';
} else {
and = '';
}
if (or !== '') {
and = and + ' OR ' + or + ' )';
}
return and;
}
function check_aggregate (id_this) {
var i;
for (i = 0; i < history_array.length; i++) {
var temp = '`' + history_array[i].get_tab() + '`.`' + history_array[i].get_column_name() + '`';
if (temp === id_this && history_array[i].get_type() === 'Aggregate') {
return history_array[i].get_obj().get_operator() + '(' + id_this + ')';
}
}
return '';
}
function check_rename (id_this) {
var i;
for (i = 0; i < history_array.length; i++) {
var temp = '`' + history_array[i].get_tab() + '`.`' + history_array[i].get_column_name() + '`';
if (temp === id_this && history_array[i].get_type() === 'Rename') {
return ' AS `' + history_array[i].get_obj().getrename_to() + '`';
}
}
return '';
}
/**
* This function builds from clause of query
* makes automatic joins.
*
*
*/
function query_from () {
var i;
var tab_left = [];
var tab_used = [];
var t_tab_used = [];
var t_tab_left = [];
var temp;
var query = '';
var quer = '';
var parts = [];
var t_array = [];
t_array = from_array;
var K = 0;
var k;
var key;
var key2;
var key3;
var parts1;
// the constraints that have been used in the LEFT JOIN
var constraints_added = [];
for (i = 0; i < history_array.length; i++) {
from_array.push(history_array[i].get_tab());
}
from_array = unique(from_array);
tab_left = from_array;
temp = tab_left.shift();
quer = '`' + temp + '`';
tab_used.push(temp);
// if master table (key2) matches with tab used get all keys and check if tab_left matches
// after this check if master table (key2) matches with tab left then check if any foreign matches with master .
for (i = 0; i < 2; i++) {
for (K in contr) {
for (key in contr[K]) {// contr name
for (key2 in contr[K][key]) {// table name
parts = key2.split('.');
if (found(tab_used, parts[1]) > 0) {
for (key3 in contr[K][key][key2]) {
parts1 = contr[K][key][key2][key3][0].split('.');
if (found(tab_left, parts1[1]) > 0) {
if (found(constraints_added, key) > 0) {
query += ' AND ' + '`' + parts[1] + '`.`' + key3 + '` = ';
query += '`' + parts1[1] + '`.`' + contr[K][key][key2][key3][1] + '` ';
} else {
query += '\n' + 'LEFT JOIN ';
query += '`' + parts[1] + '` ON ';
query += '`' + parts1[1] + '`.`' + contr[K][key][key2][key3][1] + '` = ';
query += '`' + parts[1] + '`.`' + key3 + '` ';
constraints_added.push(key);
}
t_tab_left.push(parts[1]);
}
}
}
}
}
}
K = 0;
t_tab_left = unique(t_tab_left);
tab_used = add_array(t_tab_left, tab_used);
tab_left = remove_array(t_tab_left, tab_left);
t_tab_left = [];
for (K in contr) {
for (key in contr[K]) {
for (key2 in contr[K][key]) {// table name
parts = key2.split('.');
if (found(tab_left, parts[1]) > 0) {
for (key3 in contr[K][key][key2]) {
parts1 = contr[K][key][key2][key3][0].split('.');
if (found(tab_used, parts1[1]) > 0) {
if (found(constraints_added, key) > 0) {
query += ' AND ' + '`' + parts[1] + '`.`' + key3 + '` = ';
query += '`' + parts1[1] + '`.`' + contr[K][key][key2][key3][1] + '` ';
} else {
query += '\n' + 'LEFT JOIN ';
query += '`' + parts[1] + '` ON ';
query += '`' + parts1[1] + '`.`' + contr[K][key][key2][key3][1] + '` = ';
query += '`' + parts[1] + '`.`' + key3 + '` ';
constraints_added.push(key);
}
t_tab_left.push(parts[1]);
}
}
}
}
}
}
t_tab_left = unique(t_tab_left);
tab_used = add_array(t_tab_left, tab_used);
tab_left = remove_array(t_tab_left, tab_left);
t_tab_left = [];
}
for (k in tab_left) {
quer += ' , `' + tab_left[k] + '`';
}
query = quer + query;
from_array = t_array;
return query;
}
/**
* This function is the main function for query building.
* uses history object details for this.
*
* @ uses query_where()
* @ uses query_groupby()
* @ uses query_having()
* @ uses query_orderby()
*
* @param formtitle title for the form
* @param fadin
*/
function build_query (formtitle, fadin) {
var q_select = 'SELECT ';
var temp;
if (select_field.length > 0) {
for (var i = 0; i < select_field.length; i++) {
temp = check_aggregate(select_field[i]);
if (temp !== '') {
q_select += temp;
temp = check_rename(select_field[i]);
q_select += temp + ', ';
} else {
temp = check_rename(select_field[i]);
q_select += select_field[i] + temp + ', ';
}
}
q_select = q_select.substring(0, q_select.length - 2);
} else {
q_select += '* ';
}
q_select += '\nFROM ' + query_from();
var q_where = query_where();
if (q_where !== '') {
q_select += '\nWHERE ' + q_where;
}
var q_groupby = query_groupby();
if (q_groupby !== '') {
q_select += '\nGROUP BY ' + q_groupby;
}
var q_having = query_having();
if (q_having !== '') {
q_select += '\nHAVING ' + q_having;
}
var q_orderby = query_orderby();
if (q_orderby !== '') {
q_select += '\nORDER BY ' + q_orderby;
}
/**
* @var button_options Object containing options
* for jQueryUI dialog buttons
*/
var button_options = {};
button_options[PMA_messages.strClose] = function () {
$(this).dialog('close');
};
button_options[PMA_messages.strSubmit] = function () {
if (vqb_editor) {
var $elm = $ajaxDialog.find('textarea');
vqb_editor.save();
$elm.val(vqb_editor.getValue());
}
$('#vqb_form').submit();
};
var $ajaxDialog = $('#box').dialog({
appendTo: '#page_content',
width: 500,
buttons: button_options,
modal: true,
title: 'SELECT'
});
// Attach syntax highlighted editor to query dialog
/**
* @var $elm jQuery object containing the reference
* to the query textarea.
*/
var $elm = $ajaxDialog.find('textarea');
if (! vqb_editor) {
vqb_editor = PMA_getSQLEditor($elm);
}
if (vqb_editor) {
vqb_editor.setValue(q_select);
vqb_editor.focus();
} else {
$elm.val(q_select);
$elm.focus();
}
}
AJAX.registerTeardown('designer/history.js', function () {
vqb_editor = null;
history_array = [];
select_field = [];
$('#ok_edit_rename').off('click');
$('#ok_edit_having').off('click');
$('#ok_edit_Aggr').off('click');
$('#ok_edit_where').off('click');
});
AJAX.registerOnload('designer/history.js', function () {
$('#ok_edit_rename').click(function () {
edit('Rename');
});
$('#ok_edit_having').click(function () {
edit('Having');
});
$('#ok_edit_Aggr').click(function () {
edit('Aggregate');
});
$('#ok_edit_where').click(function () {
edit('Where');
});
$('#ab').accordion({ collapsible : true, active : 'none' });
});

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +0,0 @@
function PDFPage (db_name, page_descr, tbl_cords) {
this.pg_nr = null;
this.db_name = db_name;
this.page_descr = page_descr;
this.tbl_cords = tbl_cords;
}
function TableCoordinate (db_name, table_name, pdf_pg_nr, x, y) {
this.id = null;
this.db_name = db_name;
this.table_name = table_name;
this.pdf_pg_nr = pdf_pg_nr;
this.x = x;
this.y = y;
}

View File

@ -1,309 +0,0 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* general function, usually for data manipulation pages
*
*/
var ErrorReport = {
/**
* @var object stores the last exception info
*/
_last_exception: null,
/**
* handles thrown error exceptions based on user preferences
*
* @return void
*/
error_handler: function (exception) {
if (exception.name === null || typeof(exception.name) === 'undefined') {
exception.name = ErrorReport._extractExceptionName(exception);
}
ErrorReport._last_exception = exception;
$.post('error_report.php', {
ajax_request: true,
server: PMA_commonParams.get('server'),
get_settings: true,
exception_type: 'js'
}, function (data) {
if (data.success !== true) {
PMA_ajaxShowMessage(data.error, false);
return;
}
if (data.report_setting === 'ask') {
ErrorReport._showErrorNotification();
} else if (data.report_setting === 'always') {
report_data = ErrorReport._get_report_data(exception);
post_data = $.extend(report_data, {
send_error_report: true,
automatic: true
});
$.post('error_report.php', post_data, function (data) {
if (data.success === false) {
// in the case of an error, show the error message returned.
PMA_ajaxShowMessage(data.error, false);
} else {
PMA_ajaxShowMessage(data.message, false);
}
});
}
});
},
/**
* Shows the modal dialog previewing the report
*
* @param exception object error report info
*
* @return void
*/
_showReportDialog: function (exception) {
var report_data = ErrorReport._get_report_data(exception);
/* Remove the hidden dialogs if there are*/
if ($('#error_report_dialog').length !== 0) {
$('#error_report_dialog').remove();
}
var $div = $('<div id="error_report_dialog"></div>');
$div.css('z-index', '1000');
var button_options = {};
button_options[PMA_messages.strSendErrorReport] = function () {
var $dialog = $(this);
var post_data = $.extend(report_data, {
send_error_report: true,
description: $('#report_description').val(),
always_send: $('#always_send_checkbox')[0].checked
});
$.post('error_report.php', post_data, function (data) {
$dialog.dialog('close');
if (data.success === false) {
// in the case of an error, show the error message returned.
PMA_ajaxShowMessage(data.error, false);
} else {
PMA_ajaxShowMessage(data.message, 3000);
}
});
};
button_options[PMA_messages.strCancel] = function () {
$(this).dialog('close');
};
$.post('error_report.php', report_data, function (data) {
if (data.success === false) {
// in the case of an error, show the error message returned.
PMA_ajaxShowMessage(data.error, false);
} else {
// Show dialog if the request was successful
$div
.append(data.message)
.dialog({
title: PMA_messages.strSubmitErrorReport,
width: 650,
modal: true,
buttons: button_options,
close: function () {
$(this).remove();
}
});
}
});
},
/**
* Shows the small notification that asks for user permission
*
* @return void
*/
_showErrorNotification: function () {
ErrorReport._removeErrorNotification();
var $div = $(
'<div style="position:fixed;bottom:0;left:0;right:0;margin:0;' +
'z-index:1000" class="error" id="error_notification"></div>'
).append(
PMA_getImage('s_error') + PMA_messages.strErrorOccurred
);
var $buttons = $('<div class="floatright"></div>');
var button_html = '<button id="show_error_report">';
button_html += PMA_messages.strShowReportDetails;
button_html += '</button>';
button_html += '<a id="change_error_settings">';
button_html += PMA_getImage('s_cog', PMA_messages.strChangeReportSettings);
button_html += '</a>';
button_html += '<a href="#" id="ignore_error">';
button_html += PMA_getImage('b_close', PMA_messages.strIgnore);
button_html += '</a>';
$buttons.html(button_html);
$div.append($buttons);
$div.appendTo(document.body);
$(document).on('click', '#change_error_settings', ErrorReport._redirect_to_settings);
$(document).on('click', '#show_error_report', ErrorReport._createReportDialog);
$(document).on('click', '#ignore_error', ErrorReport._removeErrorNotification);
},
/**
* Removes the notification if it was displayed before
*
* @return void
*/
_removeErrorNotification: function (e) {
if (e) {
// don't remove the hash fragment by navigating to #
e.preventDefault();
}
$('#error_notification').fadeOut(function () {
$(this).remove();
});
},
/**
* Extracts Exception name from message if it exists
*
* @return String
*/
_extractExceptionName: function (exception) {
if (exception.message === null || typeof(exception.message) === 'undefined') {
return '';
}
var reg = /([a-zA-Z]+):/;
var regex_result = reg.exec(exception.message);
if (regex_result && regex_result.length === 2) {
return regex_result[1];
}
return '';
},
/**
* Shows the modal dialog previewing the report
*
* @return void
*/
_createReportDialog: function () {
ErrorReport._removeErrorNotification();
ErrorReport._showReportDialog(ErrorReport._last_exception);
},
/**
* Redirects to the settings page containing error report
* preferences
*
* @return void
*/
_redirect_to_settings: function () {
window.location.href = 'prefs_forms.php';
},
/**
* Returns the report data to send to the server
*
* @param exception object exception info
*
* @return object
*/
_get_report_data: function (exception) {
var report_data = {
'ajax_request': true,
'exception': exception,
'current_url': window.location.href,
'exception_type': 'js'
};
if (AJAX.scriptHandler._scripts.length > 0) {
report_data.scripts = AJAX.scriptHandler._scripts.map(
function (script) {
return script.name;
}
);
}
return report_data;
},
/**
* Wraps all global functions that start with PMA_
*
* @return void
*/
wrap_global_functions: function () {
for (var key in window) {
if (key.indexOf('PMA_') === 0) {
var global = window[key];
if (typeof(global) === 'function') {
window[key] = ErrorReport.wrap_function(global);
}
}
}
},
/**
* Wraps given function in error reporting code and returns wrapped function
*
* @param func function to be wrapped
*
* @return function
*/
wrap_function: function (func) {
if (!func.wrapped) {
var new_func = function () {
try {
return func.apply(this, arguments);
} catch (x) {
TraceKit.report(x);
}
};
new_func.wrapped = true;
// Set guid of wrapped function same as original function, so it can be removed
// See bug#4146 (problem with jquery draggable and sortable)
new_func.guid = func.guid = func.guid || new_func.guid || jQuery.guid++;
return new_func;
} else {
return func;
}
},
/**
* Automatically wraps the callback in AJAX.registerOnload
*
* @return void
*/
_wrap_ajax_onload_callback: function () {
var oldOnload = AJAX.registerOnload;
AJAX.registerOnload = function (file, func) {
func = ErrorReport.wrap_function(func);
oldOnload.call(this, file, func);
};
},
/**
* Automatically wraps the callback in $.fn.on
*
* @return void
*/
_wrap_$_on_callback: function () {
var oldOn = $.fn.on;
$.fn.on = function () {
for (var i = 1; i <= 3; i++) {
if (typeof(arguments[i]) === 'function') {
arguments[i] = ErrorReport.wrap_function(arguments[i]);
break;
}
}
return oldOn.apply(this, arguments);
};
},
/**
* Wraps all global functions that start with PMA_
* also automatically wraps the callback in AJAX.registerOnload
*
* @return void
*/
set_up_error_reporting: function () {
ErrorReport.wrap_global_functions();
ErrorReport._wrap_ajax_onload_callback();
ErrorReport._wrap_$_on_callback();
}
};
AJAX.registerOnload('error_report.js', function () {
TraceKit.report.subscribe(ErrorReport.error_handler);
ErrorReport.set_up_error_reporting();
ErrorReport.wrap_global_functions();
});

View File

@ -1,996 +0,0 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in the export tab
*
*/
/**
* Disables the "Dump some row(s)" sub-options
*/
function disable_dump_some_rows_sub_options () {
$('label[for=\'limit_to\']').fadeTo('fast', 0.4);
$('label[for=\'limit_from\']').fadeTo('fast', 0.4);
$('input[type=\'text\'][name=\'limit_to\']').prop('disabled', 'disabled');
$('input[type=\'text\'][name=\'limit_from\']').prop('disabled', 'disabled');
}
/**
* Enables the "Dump some row(s)" sub-options
*/
function enable_dump_some_rows_sub_options () {
$('label[for=\'limit_to\']').fadeTo('fast', 1);
$('label[for=\'limit_from\']').fadeTo('fast', 1);
$('input[type=\'text\'][name=\'limit_to\']').prop('disabled', '');
$('input[type=\'text\'][name=\'limit_from\']').prop('disabled', '');
}
/**
* Return template data as a json object
*
* @returns template data
*/
function getTemplateData () {
var $form = $('form[name="dump"]');
var blacklist = ['token', 'server', 'db', 'table', 'single_table',
'export_type', 'export_method', 'sql_query', 'template_id'];
var obj = {};
var arr = $form.serializeArray();
$.each(arr, function () {
if ($.inArray(this.name, blacklist) < 0) {
if (obj[this.name] !== undefined) {
if (! obj[this.name].push) {
obj[this.name] = [obj[this.name]];
}
obj[this.name].push(this.value || '');
} else {
obj[this.name] = this.value || '';
}
}
});
// include unchecked checboxes (which are ignored by serializeArray()) with null
// to uncheck them when loading the template
$form.find('input[type="checkbox"]:not(:checked)').each(function () {
if (obj[this.name] === undefined) {
obj[this.name] = null;
}
});
// include empty multiselects
$form.find('select').each(function () {
if ($(this).find('option:selected').length === 0) {
obj[this.name] = [];
}
});
return obj;
}
/**
* Create a template with selected options
*
* @param name name of the template
*/
function createTemplate (name) {
var templateData = getTemplateData();
var params = {
ajax_request : true,
server : PMA_commonParams.get('server'),
db : PMA_commonParams.get('db'),
table : PMA_commonParams.get('table'),
exportType : $('input[name="export_type"]').val(),
templateAction : 'create',
templateName : name,
templateData : JSON.stringify(templateData)
};
PMA_ajaxShowMessage();
$.post('tbl_export.php', params, function (response) {
if (response.success === true) {
$('#templateName').val('');
$('#template').html(response.data);
$('#template').find('option').each(function () {
if ($(this).text() === name) {
$(this).prop('selected', true);
}
});
PMA_ajaxShowMessage(PMA_messages.strTemplateCreated);
} else {
PMA_ajaxShowMessage(response.error, false);
}
});
}
/**
* Loads a template
*
* @param id ID of the template to load
*/
function loadTemplate (id) {
var params = {
ajax_request : true,
server : PMA_commonParams.get('server'),
db : PMA_commonParams.get('db'),
table : PMA_commonParams.get('table'),
exportType : $('input[name="export_type"]').val(),
templateAction : 'load',
templateId : id,
};
PMA_ajaxShowMessage();
$.post('tbl_export.php', params, function (response) {
if (response.success === true) {
var $form = $('form[name="dump"]');
var options = JSON.parse(response.data);
$.each(options, function (key, value) {
var $element = $form.find('[name="' + key + '"]');
if ($element.length) {
if (($element.is('input') && $element.attr('type') === 'checkbox') && value === null) {
$element.prop('checked', false);
} else {
if (($element.is('input') && $element.attr('type') === 'checkbox') ||
($element.is('input') && $element.attr('type') === 'radio') ||
($element.is('select') && $element.attr('multiple') === 'multiple')) {
if (! value.push) {
value = [value];
}
}
$element.val(value);
}
$element.trigger('change');
}
});
$('input[name="template_id"]').val(id);
PMA_ajaxShowMessage(PMA_messages.strTemplateLoaded);
} else {
PMA_ajaxShowMessage(response.error, false);
}
});
}
/**
* Updates an existing template with current options
*
* @param id ID of the template to update
*/
function updateTemplate (id) {
var templateData = getTemplateData();
var params = {
ajax_request : true,
server : PMA_commonParams.get('server'),
db : PMA_commonParams.get('db'),
table : PMA_commonParams.get('table'),
exportType : $('input[name="export_type"]').val(),
templateAction : 'update',
templateId : id,
templateData : JSON.stringify(templateData)
};
PMA_ajaxShowMessage();
$.post('tbl_export.php', params, function (response) {
if (response.success === true) {
PMA_ajaxShowMessage(PMA_messages.strTemplateUpdated);
} else {
PMA_ajaxShowMessage(response.error, false);
}
});
}
/**
* Delete a template
*
* @param id ID of the template to delete
*/
function deleteTemplate (id) {
var params = {
ajax_request : true,
server : PMA_commonParams.get('server'),
db : PMA_commonParams.get('db'),
table : PMA_commonParams.get('table'),
exportType : $('input[name="export_type"]').val(),
templateAction : 'delete',
templateId : id,
};
PMA_ajaxShowMessage();
$.post('tbl_export.php', params, function (response) {
if (response.success === true) {
$('#template').find('option[value="' + id + '"]').remove();
PMA_ajaxShowMessage(PMA_messages.strTemplateDeleted);
} else {
PMA_ajaxShowMessage(response.error, false);
}
});
}
/**
* Unbind all event handlers before tearing down a page
*/
AJAX.registerTeardown('export.js', function () {
$('#plugins').off('change');
$('input[type=\'radio\'][name=\'sql_structure_or_data\']').off('change');
$('input[type=\'radio\'][name$=\'_structure_or_data\']').off('change');
$('input[type=\'radio\'][name=\'output_format\']').off('change');
$('#checkbox_sql_include_comments').off('change');
$('input[type=\'radio\'][name=\'quick_or_custom\']').off('change');
$('input[type=\'radio\'][name=\'allrows\']').off('change');
$('#btn_alias_config').off('click');
$('.alias_remove').off('click');
$('#db_alias_button').off('click');
$('#table_alias_button').off('click');
$('#column_alias_button').off('click');
$('input[name="table_select[]"]').off('change');
$('input[name="table_structure[]"]').off('change');
$('input[name="table_data[]"]').off('change');
$('#table_structure_all').off('change');
$('#table_data_all').off('change');
$('input[name="createTemplate"]').off('click');
$('select[name="template"]').off('change');
$('input[name="updateTemplate"]').off('click');
$('input[name="deleteTemplate"]').off('click');
});
AJAX.registerOnload('export.js', function () {
/**
* Export template handling code
*/
// create a new template
$('input[name="createTemplate"]').on('click', function (e) {
e.preventDefault();
var name = $('input[name="templateName"]').val();
if (name.length) {
createTemplate(name);
}
});
// load an existing template
$('select[name="template"]').on('change', function (e) {
e.preventDefault();
var id = $(this).val();
if (id.length) {
loadTemplate(id);
}
});
// udpate an existing template with new criteria
$('input[name="updateTemplate"]').on('click', function (e) {
e.preventDefault();
var id = $('select[name="template"]').val();
if (id.length) {
updateTemplate(id);
}
});
// delete an existing template
$('input[name="deleteTemplate"]').on('click', function (e) {
e.preventDefault();
var id = $('select[name="template"]').val();
if (id.length) {
deleteTemplate(id);
}
});
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
$('#plugins').change(function () {
$('#format_specific_opts').find('div.format_specific_options').hide();
var selected_plugin_name = $('#plugins').find('option:selected').val();
$('#' + selected_plugin_name + '_options').show();
});
/**
* Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
*/
$('input[type=\'radio\'][name=\'sql_structure_or_data\']').change(function () {
var comments_are_present = $('#checkbox_sql_include_comments').prop('checked');
var show = $('input[type=\'radio\'][name=\'sql_structure_or_data\']:checked').val();
if (show === 'data') {
// disable the SQL comment options
if (comments_are_present) {
$('#checkbox_sql_dates').prop('disabled', true).parent().fadeTo('fast', 0.4);
}
$('#checkbox_sql_relation').prop('disabled', true).parent().fadeTo('fast', 0.4);
$('#checkbox_sql_mime').prop('disabled', true).parent().fadeTo('fast', 0.4);
} else {
// enable the SQL comment options
if (comments_are_present) {
$('#checkbox_sql_dates').prop('disabled', false).parent().fadeTo('fast', 1);
}
$('#checkbox_sql_relation').prop('disabled', false).parent().fadeTo('fast', 1);
$('#checkbox_sql_mime').prop('disabled', false).parent().fadeTo('fast', 1);
}
if (show === 'structure') {
$('#checkbox_sql_auto_increment').prop('disabled', true).parent().fadeTo('fast', 0.4);
} else {
$('#checkbox_sql_auto_increment').prop('disabled', false).parent().fadeTo('fast', 1);
}
});
// For separate-file exports only ZIP compression is allowed
$('input[type="checkbox"][name="as_separate_files"]').change(function () {
if ($(this).is(':checked')) {
$('#compression').val('zip');
}
});
$('#compression').change(function () {
if ($('option:selected').val() !== 'zip') {
$('input[type="checkbox"][name="as_separate_files"]').prop('checked', false);
}
});
});
function setup_table_structure_or_data () {
if ($('input[name=\'export_type\']').val() !== 'database') {
return;
}
var pluginName = $('#plugins').find('option:selected').val();
var formElemName = pluginName + '_structure_or_data';
var force_structure_or_data = !($('input[name=\'' + formElemName + '_default\']').length);
if (force_structure_or_data === true) {
$('input[name="structure_or_data_forced"]').val(1);
$('.export_structure input[type="checkbox"], .export_data input[type="checkbox"]')
.prop('disabled', true);
$('.export_structure, .export_data').fadeTo('fast', 0.4);
} else {
$('input[name="structure_or_data_forced"]').val(0);
$('.export_structure input[type="checkbox"], .export_data input[type="checkbox"]')
.prop('disabled', false);
$('.export_structure, .export_data').fadeTo('fast', 1);
var structure_or_data = $('input[name="' + formElemName + '_default"]').val();
if (structure_or_data === 'structure') {
$('.export_data input[type="checkbox"]')
.prop('checked', false);
} else if (structure_or_data === 'data') {
$('.export_structure input[type="checkbox"]')
.prop('checked', false);
}
if (structure_or_data === 'structure' || structure_or_data === 'structure_and_data') {
if (!$('.export_structure input[type="checkbox"]:checked').length) {
$('input[name="table_select[]"]:checked')
.closest('tr')
.find('.export_structure input[type="checkbox"]')
.prop('checked', true);
}
}
if (structure_or_data === 'data' || structure_or_data === 'structure_and_data') {
if (!$('.export_data input[type="checkbox"]:checked').length) {
$('input[name="table_select[]"]:checked')
.closest('tr')
.find('.export_data input[type="checkbox"]')
.prop('checked', true);
}
}
check_selected_tables();
check_table_select_all();
check_table_select_struture_or_data();
}
}
/**
* Toggles the hiding and showing of plugin structure-specific and data-specific
* options
*/
function toggle_structure_data_opts () {
var pluginName = $('select#plugins').val();
var radioFormName = pluginName + '_structure_or_data';
var dataDiv = '#' + pluginName + '_data';
var structureDiv = '#' + pluginName + '_structure';
var show = $('input[type=\'radio\'][name=\'' + radioFormName + '\']:checked').val();
if (show === 'data') {
$(dataDiv).slideDown('slow');
$(structureDiv).slideUp('slow');
} else {
$(structureDiv).slideDown('slow');
if (show === 'structure') {
$(dataDiv).slideUp('slow');
} else {
$(dataDiv).slideDown('slow');
}
}
}
/**
* Toggles the disabling of the "save to file" options
*/
function toggle_save_to_file () {
var $ulSaveAsfile = $('#ul_save_asfile');
if (!$('#radio_dump_asfile').prop('checked')) {
$ulSaveAsfile.find('> li').fadeTo('fast', 0.4);
$ulSaveAsfile.find('> li > input').prop('disabled', true);
$ulSaveAsfile.find('> li > select').prop('disabled', true);
} else {
$ulSaveAsfile.find('> li').fadeTo('fast', 1);
$ulSaveAsfile.find('> li > input').prop('disabled', false);
$ulSaveAsfile.find('> li > select').prop('disabled', false);
}
}
AJAX.registerOnload('export.js', function () {
toggle_save_to_file();
$('input[type=\'radio\'][name=\'output_format\']').change(toggle_save_to_file);
});
/**
* For SQL plugin, toggles the disabling of the "display comments" options
*/
function toggle_sql_include_comments () {
$('#checkbox_sql_include_comments').change(function () {
var $ulIncludeComments = $('#ul_include_comments');
if (!$('#checkbox_sql_include_comments').prop('checked')) {
$ulIncludeComments.find('> li').fadeTo('fast', 0.4);
$ulIncludeComments.find('> li > input').prop('disabled', true);
} else {
// If structure is not being exported, the comment options for structure should not be enabled
if ($('#radio_sql_structure_or_data_data').prop('checked')) {
$('#text_sql_header_comment').prop('disabled', false).parent('li').fadeTo('fast', 1);
} else {
$ulIncludeComments.find('> li').fadeTo('fast', 1);
$ulIncludeComments.find('> li > input').prop('disabled', false);
}
}
});
}
function check_table_select_all () {
var total = $('input[name="table_select[]"]').length;
var str_checked = $('input[name="table_structure[]"]:checked').length;
var data_checked = $('input[name="table_data[]"]:checked').length;
var str_all = $('#table_structure_all');
var data_all = $('#table_data_all');
if (str_checked === total) {
str_all
.prop('indeterminate', false)
.prop('checked', true);
} else if (str_checked === 0) {
str_all
.prop('indeterminate', false)
.prop('checked', false);
} else {
str_all
.prop('indeterminate', true)
.prop('checked', false);
}
if (data_checked === total) {
data_all
.prop('indeterminate', false)
.prop('checked', true);
} else if (data_checked === 0) {
data_all
.prop('indeterminate', false)
.prop('checked', false);
} else {
data_all
.prop('indeterminate', true)
.prop('checked', false);
}
}
function check_table_select_struture_or_data () {
var str_checked = $('input[name="table_structure[]"]:checked').length;
var data_checked = $('input[name="table_data[]"]:checked').length;
var auto_increment = $('#checkbox_sql_auto_increment');
var pluginName = $('select#plugins').val();
var dataDiv = '#' + pluginName + '_data';
var structureDiv = '#' + pluginName + '_structure';
if (str_checked === 0) {
$(structureDiv).slideUp('slow');
} else {
$(structureDiv).slideDown('slow');
}
if (data_checked === 0) {
$(dataDiv).slideUp('slow');
auto_increment.prop('disabled', true).parent().fadeTo('fast', 0.4);
} else {
$(dataDiv).slideDown('slow');
auto_increment.prop('disabled', false).parent().fadeTo('fast', 1);
}
}
function toggle_table_select_all_str () {
var str_all = $('#table_structure_all').is(':checked');
if (str_all) {
$('input[name="table_structure[]"]').prop('checked', true);
} else {
$('input[name="table_structure[]"]').prop('checked', false);
}
}
function toggle_table_select_all_data () {
var data_all = $('#table_data_all').is(':checked');
if (data_all) {
$('input[name="table_data[]"]').prop('checked', true);
} else {
$('input[name="table_data[]"]').prop('checked', false);
}
}
function check_selected_tables (argument) {
$('.export_table_select tbody tr').each(function () {
check_table_selected(this);
});
}
function check_table_selected (row) {
var $row = $(row);
var table_select = $row.find('input[name="table_select[]"]');
var str_check = $row.find('input[name="table_structure[]"]');
var data_check = $row.find('input[name="table_data[]"]');
var data = data_check.is(':checked:not(:disabled)');
var structure = str_check.is(':checked:not(:disabled)');
if (data && structure) {
table_select.prop({ checked: true, indeterminate: false });
$row.addClass('marked');
} else if (data || structure) {
table_select.prop({ checked: true, indeterminate: true });
$row.removeClass('marked');
} else {
table_select.prop({ checked: false, indeterminate: false });
$row.removeClass('marked');
}
}
function toggle_table_select (row) {
var $row = $(row);
var table_selected = $row.find('input[name="table_select[]"]').is(':checked');
if (table_selected) {
$row.find('input[type="checkbox"]:not(:disabled)').prop('checked', true);
$row.addClass('marked');
} else {
$row.find('input[type="checkbox"]:not(:disabled)').prop('checked', false);
$row.removeClass('marked');
}
}
function handleAddProcCheckbox () {
if ($('#table_structure_all').is(':checked') === true
&& $('#table_data_all').is(':checked') === true
) {
$('#checkbox_sql_procedure_function').prop('checked', true);
} else {
$('#checkbox_sql_procedure_function').prop('checked', false);
}
}
AJAX.registerOnload('export.js', function () {
/**
* For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options
*/
var $create = $('#checkbox_sql_create_table_statements');
var $create_options = $('#ul_create_table_statements').find('input');
$create.change(function () {
$create_options.prop('checked', $(this).prop('checked'));
});
$create_options.change(function () {
if ($create_options.is(':checked')) {
$create.prop('checked', true);
}
});
/**
* Disables the view output as text option if the output must be saved as a file
*/
$('#plugins').change(function () {
var active_plugin = $('#plugins').find('option:selected').val();
var force_file = $('#force_file_' + active_plugin).val();
if (force_file === 'true') {
if ($('#radio_dump_asfile').prop('checked') !== true) {
$('#radio_dump_asfile').prop('checked', true);
toggle_save_to_file();
}
$('#radio_view_as_text').prop('disabled', true).parent().fadeTo('fast', 0.4);
} else {
$('#radio_view_as_text').prop('disabled', false).parent().fadeTo('fast', 1);
}
});
$('input[type=\'radio\'][name$=\'_structure_or_data\']').on('change', function () {
toggle_structure_data_opts();
});
$('input[name="table_select[]"]').on('change', function () {
toggle_table_select($(this).closest('tr'));
check_table_select_all();
handleAddProcCheckbox();
check_table_select_struture_or_data();
});
$('input[name="table_structure[]"]').on('change', function () {
check_table_selected($(this).closest('tr'));
check_table_select_all();
handleAddProcCheckbox();
check_table_select_struture_or_data();
});
$('input[name="table_data[]"]').on('change', function () {
check_table_selected($(this).closest('tr'));
check_table_select_all();
handleAddProcCheckbox();
check_table_select_struture_or_data();
});
$('#table_structure_all').on('change', function () {
toggle_table_select_all_str();
check_selected_tables();
handleAddProcCheckbox();
check_table_select_struture_or_data();
});
$('#table_data_all').on('change', function () {
toggle_table_select_all_data();
check_selected_tables();
handleAddProcCheckbox();
check_table_select_struture_or_data();
});
if ($('input[name=\'export_type\']').val() === 'database') {
// Hide structure or data radio buttons
$('input[type=\'radio\'][name$=\'_structure_or_data\']').each(function () {
var $this = $(this);
var name = $this.prop('name');
var val = $('input[name="' + name + '"]:checked').val();
var name_default = name + '_default';
if (!$('input[name="' + name_default + '"]').length) {
$this
.after(
$('<input type="hidden" name="' + name_default + '" value="' + val + '" disabled>')
)
.after(
$('<input type="hidden" name="' + name + '" value="structure_and_data">')
);
$this.parent().find('label').remove();
} else {
$this.parent().remove();
}
});
$('input[type=\'radio\'][name$=\'_structure_or_data\']').remove();
// Disable CREATE table checkbox for sql
var createTableCheckbox = $('#checkbox_sql_create_table');
createTableCheckbox.prop('checked', true);
var dummyCreateTable = $('#checkbox_sql_create_table')
.clone()
.removeAttr('id')
.attr('type', 'hidden');
createTableCheckbox
.prop('disabled', true)
.after(dummyCreateTable)
.parent()
.fadeTo('fast', 0.4);
setup_table_structure_or_data();
}
/**
* Handle force structure_or_data
*/
$('#plugins').change(setup_table_structure_or_data);
});
/**
* Toggles display of options when quick and custom export are selected
*/
function toggle_quick_or_custom () {
if ($('input[name=\'quick_or_custom\']').length === 0 // custom_no_form option
|| $('#radio_custom_export').prop('checked') // custom
) {
$('#databases_and_tables').show();
$('#rows').show();
$('#output').show();
$('#format_specific_opts').show();
$('#output_quick_export').hide();
var selected_plugin_name = $('#plugins').find('option:selected').val();
$('#' + selected_plugin_name + '_options').show();
} else { // quick
$('#databases_and_tables').hide();
$('#rows').hide();
$('#output').hide();
$('#format_specific_opts').hide();
$('#output_quick_export').show();
}
}
var time_out;
function check_time_out (time_limit) {
if (typeof time_limit === 'undefined' || time_limit === 0) {
return true;
}
// margin of one second to avoid race condition to set/access session variable
time_limit = time_limit + 1;
var href = 'export.php';
var params = {
'ajax_request' : true,
'check_time_out' : true
};
clearTimeout(time_out);
time_out = setTimeout(function () {
$.get(href, params, function (data) {
if (data.message === 'timeout') {
PMA_ajaxShowMessage(
'<div class="error">' +
PMA_messages.strTimeOutError +
'</div>',
false
);
}
});
}, time_limit * 1000);
}
/**
* Handler for Database/table alias select
*
* @param event object the event object
*
* @return void
*/
function aliasSelectHandler (event) {
var sel = event.data.sel;
var type = event.data.type;
var inputId = $(this).val();
var $label = $(this).next('label');
$('input#' + $label.attr('for')).addClass('hide');
$('input#' + inputId).removeClass('hide');
$label.attr('for', inputId);
$('#alias_modal ' + sel + '[id$=' + type + ']:visible').addClass('hide');
var $inputWrapper = $('#alias_modal ' + sel + '#' + inputId + type);
$inputWrapper.removeClass('hide');
if (type === '_cols' && $inputWrapper.length > 0) {
var outer = $inputWrapper[0].outerHTML;
// Replace opening tags
var regex = /<dummy_inp/gi;
if (outer.match(regex)) {
var newTag = outer.replace(regex, '<input');
// Replace closing tags
regex = /<\/dummy_inp/gi;
newTag = newTag.replace(regex, '</input');
// Assign replacement
$inputWrapper.replaceWith(newTag);
}
} else if (type === '_tables') {
$('.table_alias_select:visible').change();
}
$('#alias_modal').dialog('option', 'position', 'center');
}
/**
* Handler for Alias dialog box
*
* @param event object the event object
*
* @return void
*/
function createAliasModal (event) {
event.preventDefault();
var dlgButtons = {};
dlgButtons[PMA_messages.strSaveAndClose] = function () {
$(this).dialog('close');
$('#alias_modal').parent().appendTo($('form[name="dump"]'));
};
$('#alias_modal').dialog({
width: Math.min($(window).width() - 100, 700),
maxHeight: $(window).height(),
modal: true,
dialogClass: 'alias-dialog',
buttons: dlgButtons,
create: function () {
$(this).css('maxHeight', $(window).height() - 150);
var db = PMA_commonParams.get('db');
if (db) {
var option = $('<option></option>');
option.text(db);
option.attr('value', db);
$('#db_alias_select').append(option).val(db).change();
} else {
var params = {
ajax_request : true,
server : PMA_commonParams.get('server'),
type: 'list-databases'
};
$.post('ajax.php', params, function (response) {
if (response.success === true) {
$.each(response.databases, function (idx, value) {
var option = $('<option></option>');
option.text(value);
option.attr('value', value);
$('#db_alias_select').append(option);
});
} else {
PMA_ajaxShowMessage(response.error, false);
}
});
}
},
close: function () {
var isEmpty = true;
$(this).find('input[type="text"]').each(function () {
// trim empty input fields on close
if ($(this).val()) {
isEmpty = false;
} else {
$(this).parents('tr').remove();
}
});
// Toggle checkbox based on aliases
$('input#btn_alias_config').prop('checked', !isEmpty);
},
position: { my: 'center top', at: 'center top', of: window }
});
}
function aliasToggleRow (elm) {
var inputs = elm.parents('tr').find('input,button');
if (elm.val()) {
inputs.attr('disabled', false);
} else {
inputs.attr('disabled', true);
}
}
function addAlias (type, name, field, value) {
if (value === '') {
return;
}
var row = $('#alias_data tfoot tr').clone();
row.find('th').text(type);
row.find('td:first').text(name);
row.find('input').attr('name', field);
row.find('input').val(value);
row.find('.alias_remove').on('click', function () {
$(this).parents('tr').remove();
});
var matching = $('#alias_data [name="' + $.escapeSelector(field) + '"]');
if (matching.length > 0) {
matching.parents('tr').remove();
}
$('#alias_data tbody').append(row);
}
AJAX.registerOnload('export.js', function () {
$('input[type=\'radio\'][name=\'quick_or_custom\']').change(toggle_quick_or_custom);
$('#scroll_to_options_msg').hide();
$('#format_specific_opts').find('div.format_specific_options')
.hide()
.css({
'border': 0,
'margin': 0,
'padding': 0
})
.find('h3')
.remove();
toggle_quick_or_custom();
toggle_structure_data_opts();
toggle_sql_include_comments();
check_table_select_all();
handleAddProcCheckbox();
/**
* Initially disables the "Dump some row(s)" sub-options
*/
disable_dump_some_rows_sub_options();
/**
* Disables the "Dump some row(s)" sub-options when it is not selected
*/
$('input[type=\'radio\'][name=\'allrows\']').change(function () {
if ($('input[type=\'radio\'][name=\'allrows\']').prop('checked')) {
enable_dump_some_rows_sub_options();
} else {
disable_dump_some_rows_sub_options();
}
});
// Open Alias Modal Dialog on click
$('#btn_alias_config').on('click', createAliasModal);
$('.alias_remove').on('click', function () {
$(this).parents('tr').remove();
});
$('#db_alias_select').on('change', function () {
aliasToggleRow($(this));
var db = $(this).val();
var table = PMA_commonParams.get('table');
if (table) {
var option = $('<option></option>');
option.text(table);
option.attr('value', table);
$('#table_alias_select').append(option).val(table).change();
} else {
var params = {
ajax_request : true,
server : PMA_commonParams.get('server'),
db : $(this).val(),
type: 'list-tables'
};
$.post('ajax.php', params, function (response) {
if (response.success === true) {
$.each(response.tables, function (idx, value) {
var option = $('<option></option>');
option.text(value);
option.attr('value', value);
$('#table_alias_select').append(option);
});
} else {
PMA_ajaxShowMessage(response.error, false);
}
});
}
});
$('#table_alias_select').on('change', function () {
aliasToggleRow($(this));
var params = {
ajax_request : true,
server : PMA_commonParams.get('server'),
db : $('#db_alias_select').val(),
table: $(this).val(),
type: 'list-columns'
};
$.post('ajax.php', params, function (response) {
if (response.success === true) {
$.each(response.columns, function (idx, value) {
var option = $('<option></option>');
option.text(value);
option.attr('value', value);
$('#column_alias_select').append(option);
});
} else {
PMA_ajaxShowMessage(response.error, false);
}
});
});
$('#column_alias_select').on('change', function () {
aliasToggleRow($(this));
});
$('#db_alias_button').on('click', function (e) {
e.preventDefault();
var db = $('#db_alias_select').val();
addAlias(
PMA_messages.strAliasDatabase,
db,
'aliases[' + db + '][alias]',
$('#db_alias_name').val()
);
$('#db_alias_name').val('');
});
$('#table_alias_button').on('click', function (e) {
e.preventDefault();
var db = $('#db_alias_select').val();
var table = $('#table_alias_select').val();
addAlias(
PMA_messages.strAliasTable,
db + '.' + table,
'aliases[' + db + '][tables][' + table + '][alias]',
$('#table_alias_name').val()
);
$('#table_alias_name').val('');
});
$('#column_alias_button').on('click', function (e) {
e.preventDefault();
var db = $('#db_alias_select').val();
var table = $('#table_alias_select').val();
var column = $('#column_alias_select').val();
addAlias(
PMA_messages.strAliasColumn,
db + '.' + table + '.' + column,
'aliases[' + db + '][tables][' + table + '][colums][' + column + ']',
$('#column_alias_name').val()
);
$('#column_alias_name').val('');
});
});

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