Compare commits

..

122 Commits

Author SHA1 Message Date
Deven Bansod
019bc58ea2
Merge pull request #14639 from Piyush3079/Mod_Js_Common_Files
Modular code for some of the common files
2018-10-18 18:23:59 +05:30
Piyush Vijay
673e82e6a6
version fixture for webpack to prevent updated version installation.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-10-10 08:37:05 +05:30
Piyush Vijay
fd4e5f0c54
Remove some of the duplicate files for code cleanup.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-09-20 05:25:39 +05:30
Piyush Vijay
b5824ef13e
Structure some code for replication.js and tbl_operation.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-09-20 05:24:35 +05:30
Piyush Vijay
074c5063ab
Whitelist RTE.js in modular code and add some related function for sliding messages in show_ajax_messages.js.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-09-20 04:38:09 +05:30
Piyush Vijay
12781a3f97
Add Routines, Triggers and Events in the modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-09-20 04:36:42 +05:30
Piyush Vijay
b7371e418d
Add Table Normalization in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-09-07 19:59:12 +05:30
Piyush Vijay
66ddb3a6af
Add Drag and Drop Import in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-09-07 18:56:52 +05:30
Piyush Vijay
747bf54f99
Add KeyHandler and CrossFramingProtection file in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-09-07 18:24:57 +05:30
Deven Bansod
e12e38bd37
Merge pull request #14584 from Piyush3079/Mod_Js_DST_Cleanup
Code cleanup for Server, Database and Table related files
2018-08-28 10:30:16 +05:30
Piyush Vijay
f08db2e8a8
Some code structured for PMA Console
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-23 07:28:10 +05:30
Piyush Vijay
2950e2b269
Some common files removed for code cleanup.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-23 06:46:16 +05:30
Piyush Vijay
2bd0206f22
Some code structuring for database related files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-21 06:10:48 +05:30
Piyush Vijay
1084952b1f
Remove duplicate files for database related pages.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-21 06:08:09 +05:30
Piyush Vijay
bb72bc2ddc Some code structuring for table related files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-21 05:52:53 +05:30
Piyush Vijay
181bfb5849 Remove table related files not needed in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-21 05:52:41 +05:30
Piyush Vijay
f7b33b00e9 Code restructuring and comments for serve related files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-21 05:51:53 +05:30
Piyush Vijay
d1e4477191 Sync the branch with master.
Remove server related files for code cleanup.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-21 05:51:40 +05:30
Deven Bansod
d031dec87a
Merge pull request #14564 from Piyush3079/Mod_Js_Tbl_Structure
Modular code for table structure and table related files
2018-08-19 16:24:09 +05:30
Piyush Vijay
5f4db91d71
Resolve merge conflicts and add tbl import and export in modular code
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 15:29:58 +05:30
Piyush Vijay
0ce9714c19 Modular code for tbl_find_replace.php
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
65a54b8d74 Modular code for tbl_select.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
c1f6c86a6d Edit php files for changes related to tbl_change.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
0f7a7c33c8 Modular code for tbl_change.php.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
5647d8c84c Modular code for tbl_tracking.php
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
302eaf5767 Remove .js extention from tbl_operations.php file to allow dynamic import.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
dcad9d0c79 Modular code for tbl_operations.php
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
0e44376dc8 Remove .js extension from files and remove jqplot plugins which are not deened to be loaded in head of page.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
f6b5d2d345 Modular code for tbl_chart for dawing charts on Table Browsing
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
8ac17c037e Remove .js extension from tbl_relation.php related files for dynamic loading.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
d521643f7d Modular code for tbl_relation.php.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
83519079bb Remove .js extension from tbl_structure.php related files to allow dynamic imports.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
aebde04e00 Modular code for tbl_structure.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
17958e8d8b Remove .js extension from php files for indexes.js to allow dynami import.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:44:00 +05:30
Piyush Vijay
3e8e825d35 Modular code for indexes.js being used on different pages.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:43:58 +05:30
Piyush Vijay
2558661648 Add PMA_showHints function in show_ajax_messages.js in js/src/utils and PMA_initSlider in Slider.js.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-19 13:34:04 +05:30
Deven Bansod
0c3411587a
Merge pull request #14533 from Piyush3079/Mod_Js_Db_Structure
Modular code for Database Structure and some other database related files
2018-08-19 10:01:20 +05:30
Piyush Vijay
03c0067343
Bug fix for multi table actions on db_structure.php
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-18 12:26:48 +05:30
Piyush Vijay
c0856b2310
Resolve merge conflicts and some code cleanup for functions.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:57:21 +05:30
Piyush Vijay
bfc9d62d43 Replace .js extension from db_export and db_import.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:25 +05:30
Piyush Vijay
b8bbd86558 Add central columns to the modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:25 +05:30
Piyush Vijay
353fa83e2a Add db_tracking.js for tracking tables of database in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:25 +05:30
Piyush Vijay
9fc572d4fc Create FileHandler class to manage loading of files on the basis of page and on the basis of user preferences.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:25 +05:30
Piyush Vijay
0a979865e1 Add db_operations.js to modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:24 +05:30
Piyush Vijay
5e10b2c6b7 Edit js/src/functions.js to add functions required for create table in db_structure.php.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:12 +05:30
Piyush Vijay
6e790e72e5 Add CreateTable and TableColumns module for adding table in db_structure.php.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:12 +05:30
Piyush Vijay
eae0c753bb Add prepare_ajax_request and preview_sql to modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:55:10 +05:30
Piyush Vijay
f2cc2344d5 Bug fix for ajax server side error.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-17 13:54:29 +05:30
Piyush Vijay
65943162ae Add db_structure.js in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-16 20:37:21 +05:30
Deven Bansod
5b1c1a2ce1
Merge pull request #14518 from Piyush3079/Mod_Js_Sql_Profiling
Add modular code for profiling of sql queries on related pages and structured some code
2018-08-16 20:26:51 +05:30
Piyush Vijay
fd21247e53
Resolve merge conflicts
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-15 15:28:25 +05:30
Piyush Vijay
6a4496ee42 Add multi column sort for tbl_sql.php and db_sql.php
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-15 15:15:00 +05:30
Piyush Vijay
a407ac90fc Bug fix for teardown of page.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-15 15:15:00 +05:30
Piyush Vijay
5b7079e9ff Profiling working on table browsing and on running sql queries.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-15 15:14:42 +05:30
Deven Bansod
fc72f0d739
Merge pull request #14493 from Piyush3079/Mod_Js_Sql_Js
Add Modular code for sql query box (page) and codemirror related pages
2018-08-14 09:52:04 -07:00
Piyush Vijay
5240ca612d Add jsoc to create documentation of JavaScript code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-14 18:31:52 +05:30
Piyush Vijay
6f20ffdf64 Resolving merge errors.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-14 18:31:51 +05:30
Piyush Vijay
1e00de8e3a Separating sorting functions from multi_column_sort file.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-14 18:11:20 +05:30
Piyush Vijay
1c3660d213 Comment code in js/functions.js to disable tirggering of codemirror loading from js/functions.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-14 18:11:18 +05:30
Piyush Vijay
5e3e36e61d Add multi column sort in server_sql for add and remove column sort on table browse.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:38:47 +05:30
Piyush Vijay
3ae93ad307 Add modular Sql.js to table sql and database sql and SqlQueryForm modified accordingly
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:38:47 +05:30
Piyush Vijay
661c9f74d4 Ctrl plus enter to submit query event in functions.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:38:47 +05:30
Piyush Vijay
cc754839e7 Updating Sql utility function file, sql source file containing code for various sql related events, adding function for sql editor and inline sql editor in functions.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:38:47 +05:30
Piyush Vijay
7d472508b7 Adding variable used for codemirror in the head of the page at the top of the scripts.
Imports changes as per new directory stucture for sql.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:38:42 +05:30
Piyush Vijay
8506ce9d91 Adding codemirror in pma console.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:38:32 +05:30
Piyush Vijay
2c9118e781 Edit codemirror sql plugin for modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:38:21 +05:30
Piyush Vijay
c9ac456d97 Separating basic functions needed for initialising codemirror and inline codemirror, saving and getting saved queries and making profiling charts.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:37:39 +05:30
Piyush Vijay
91afae1798 No need to review this commit as these files are directly copied from old vendor and plugins folder. These files can be ignored during review.
They are not availabe as npm mpdule right now and their alternative are largerr in size with the same functionality.
So they are being used as it is.
Their size will be reduced in the outpul bundle after using webpack plugins to emove comments from js files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:37:39 +05:30
Piyush Vijay
63a54d14f3 Adding jQplot package and its plugins and tablesorter are as module in js files and removed from php files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:37:25 +05:30
Piyush Vijay
2c643597fd Edit package.json for updated-jqplot package. Adding eslint scripts and script for creating production build edited
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:36:58 +05:30
Piyush Vijay
8c986d8308 Weekly progress.
1). Microhistory added in classes for modular code
2). Code is structured and camel casing of varables is done for removing linter warnings.
3). JQuery plugins are added in some files.
4). jQplot is working for server_status_queries and server_status_monitor.
5). Work started for Dabatase, SQl and Table files.
Some changes are stll left for server_status_monitor and sql.js
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-10 13:36:58 +05:30
Deven Bansod
24f91b16f9
Merge pull request #14524 from Piyush3079/Mod_Js_Structuring_1
Modularize JS files related to Structure
2018-08-09 06:52:30 -07:00
Piyush Vijay
b4237acf18
Use import * for files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-09 19:12:28 +05:30
Piyush Vijay
c0810f98b2 Some more javascript files structured properly.
Shortcut handler and page settings js files added in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-09 18:44:36 +05:30
Piyush Vijay
91340d18e5 Test files changed as per the new chages in FormDisplayTemplate.
Js code is stuctured properly with comments.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-07 18:34:12 +05:30
Deven Bansod
0e16cc519e
Merge pull request #14470 from Piyush3079/Mod_Js_Config_Js
Modularized Config.js and add build script
2018-08-06 17:41:04 -07:00
Piyush Vijay
733b0296b3
Test fixtures for travis.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-03 18:04:59 +05:30
Piyush Vijay
61e97801d4 Pass env variable to webpack.config file for making production build.
Build script for js files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-02 20:54:53 +05:30
Piyush Vijay
0b5c9b3eea Add isStorageSupport in functions.js for code compatibility and add config.js in file loading object.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-02 20:54:53 +05:30
Piyush Vijay
5463dabca7 Commented code removed and debug statements removed.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-02 20:54:50 +05:30
Piyush Vijay
3a754dc340 Config.js is modularised.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-01 20:03:06 +05:30
Piyush Vijay
5e04669d74
Add config related imports in files to use config.js in modular code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-08-01 20:02:33 +05:30
Deven Bansod
5e9d70540b
Merge pull request #14469 from Piyush3079/Mod_Js_Import_Export
Modularize Import and Export related JS files
2018-08-01 16:48:17 +05:30
Piyush Vijay
d111a2ca81 Add event for submit of export sql form to remove error of undefined function.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-30 23:10:53 +05:30
Piyush Vijay
85c16c14f8 Remove some functions to make this pr reproduceable on local machine.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-30 23:10:44 +05:30
Piyush Vijay
a99acfef71 Modularize server related remaining files like replication, plugins, queries, processes.
Sever monitor is also modularised and is not working but jQplot is not imported as it is giving error with webpack.
Another issue with these files is that table sorter is also not woking
working properly as it is not available on npm as plugin.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-30 23:08:28 +05:30
Piyush Vijay
f92e1ebccd Edit ndex files and more files whitelisted in ajax.js and files.js for
adding them in modular code.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-30 23:07:43 +05:30
Deven Bansod
00e9049f44
Merge pull request #14468 from Piyush3079/Mod_Js_Navigation
Modularize PMA Navigation JS files
2018-07-30 16:05:27 +05:30
Piyush Vijay
9727a9450f Remove caching of common_params.php to avoid stoing token in cache on login and logout again.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-30 01:37:44 +05:30
Piyush Vijay
2f3eeae68d Fallback for new Modularize navigation. Both old and new code included in Header.php
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-30 01:37:44 +05:30
Piyush Vijay
5c54cdcb69 File names changed for revamped javascript files in php files.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-30 01:37:42 +05:30
Piyush Vijay
b52b7a3422 Navigation revamped, navigation functions separated from main file. More file names added in ajax and index.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-29 17:08:10 +05:30
Piyush Vijay
0ae42e5aa9 Import highlight_sql module in show_ajax_messages.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-29 17:07:42 +05:30
Deven Bansod
ed6f106470
Merge pull request #14467 from Piyush3079/Mod_Js_Server_Status
Modularize Server Status JS files
2018-07-28 18:19:16 +05:30
Piyush Vijay
84d0e8045b
Big fix for kill button and autoRefresh button on server_status_processes.php page.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-28 18:02:58 +05:30
Piyush Vijay
b7ee22a203 remove .js extension from relevant php files and add those files in ajax for dynamic loading.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-27 22:19:42 +05:30
Piyush Vijay
30b5f072f9 Commented code and debug statements removed from server status related files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-27 22:19:42 +05:30
Piyush Vijay
a85fb3d3f6 Revamp server_status_advisor, server_status_variables, sever_status_processes.
Add codemirror package in server_privileges.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-27 22:19:17 +05:30
Deven Bansod
ff81454539
Merge pull request #14466 from Piyush3079/Mod_Js_Console
Modularize Console and Error Report files
2018-07-27 20:55:01 +05:30
Piyush Vijay
de78e7911b Bug fix for undefined variables and PMA_Console in working state now.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-27 20:53:09 +05:30
Piyush Vijay
e18c6b9818 Fix error reporting functionality ajax callback errors .
TODO: To find a way to wrap the exported functions containing PMA_ prefix into the error handler to generate backtrace.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-27 20:52:15 +05:30
Piyush Vijay
91178f0029 Break PMA_Console JS code into classes and imports.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-27 20:51:52 +05:30
Deven Bansod
dfcca3c46e
Merge pull request #14465 from Piyush3079/Mod_Js_Server_Privileges
server_privileges and server_databases modularized
2018-07-26 19:50:48 +05:30
Piyush Vijay
ae20a38e97 Add babel-eslint package to use eslint for features not yet included in eslint.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:26 +05:30
Piyush Vijay
d5eb59bb62 Bug fix for token mismatch error on server_databases.php page.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:26 +05:30
Piyush Vijay
177e101379 Bux fix for onload and teardown of pages on refresh and ajax requests.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:26 +05:30
Piyush Vijay
5402f43840 Modify ajax.js and Header.php for compatibility of both old code and new code.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:26 +05:30
Piyush Vijay
ce8d11c858 Add todo for code that will not be used in future after revamping all
the files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:26 +05:30
Piyush Vijay
8111151049 Replace default validation strings with custom strings to enable localization for validation messages with jquery.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:26 +05:30
Piyush Vijay
9d51a83625 Review changes for adding file level comments for some files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:26 +05:30
Piyush Vijay
491b4871a7 Commented code, debug statements and unused variable in Script.php is removed.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:25 +05:30
Piyush Vijay
b712019735 AJAX handler modified and initial loading of the first page handled
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:25 +05:30
Piyush Vijay
56ea9d27fc server_privilages and server_databases modularized
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:25 +05:30
Piyush Vijay
c67854e2a3 New directory Stucture having modules imported and exported.
This commit needs proper discussion as many of the upcoming changes are based on this commit.
These files contains the working code only.
Right now the code has the functionality to work with both old js files and new js files.
Commeting style is yet to decide
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:25 +05:30
Piyush Vijay
38cfa4630c Some functions moved from server_privilages.js to functions.js and typo error removed
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-26 02:31:25 +05:30
Deven Bansod
224ae6d86b
Merge pull request #14464 from Piyush3079/Mod_Js_Config
* Files for babel, eslint and webpack base configuration and add respective modules in package manager.
Add script in package.json for building js files using webpack.

* Module for importing variable defined in messages.php.

* Some changes in the configuration to revamp file by file not whole directory, environment variable introduced

* Update documentation for the new configuration variables introduced
and adding comments for some code handleing new js files.

* Update node version for scrutinizer. Add webpack environment directives in default.config. Introduce webpack_host and webpack_port
directive and updating package.json build scripts.

* Typo fixes for documentation and comments and webpack configuration directives are added in webpack.config
2018-07-18 17:12:43 +05:30
Piyush Vijay
4d3a8c9e5c
Typo fixes for documentation and comments and webpack configuration directives are added in webpack.config
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-16 20:58:33 +05:30
Piyush Vijay
3d9e65674c Update node version for scrutinizer. Add webpack environment directives in default.config. Introduce webpack_host and webpack_port
directive and updating package.json build scripts.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-15 22:00:49 +05:30
Piyush Vijay
3e56b17bc6 Update documentation for the new configuration variables introduced
and adding comments for some code handleing new js files.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-15 22:00:31 +05:30
Piyush Vijay
59ef2b9159 Some changes in the configuration to revamp file by file not whole directory, environment variable introduced
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-15 22:00:21 +05:30
Piyush Vijay
10d545c621 Module for importing variable defined in messages.php.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-15 22:00:17 +05:30
Piyush Vijay
d80a8ba3dd Files for babel, eslint and webpack base configuration and add respective modules in package manager.
Add script in package.json for building js files using webpack.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
2018-07-15 21:58:14 +05:30
4746 changed files with 2093854 additions and 2342088 deletions

4
.babelrc Normal file
View File

@ -0,0 +1,4 @@
{
"presets": ["env"],
"plugins": ["syntax-dynamic-import"]
}

View File

@ -1,11 +0,0 @@
# https://github.com/browserslist/browserslist#readme
>= 0.5%
last 2 major versions
not dead
Chrome >= 60
Firefox >= 60
Firefox ESR
iOS >= 12
Safari >= 12
not Explorer <= 11

View File

@ -7,18 +7,11 @@ 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,scss,css,twig,yml},package.json}]
[{*.sql,package.json,.travis.yml}]
indent_style = space
indent_size = 2
[*.svg]
insert_final_newline = false
[tests/test_data/*]
insert_final_newline = false
[tests/unit/**/Fixtures/*.html]
insert_final_newline = false
trim_trailing_whitespace = false

View File

@ -1,4 +1,6 @@
public/js/
js/vendor/
tmp/
vendor/
webpack.config.cjs
js/dist/
js/lib/
js/src/plugins/

View File

@ -1,28 +1,24 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:no-jquery/deprecated",
"plugin:compat/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [ "@typescript-eslint", "no-jquery" ],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"browser": true,
"jquery": true,
"node": true,
"es6": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"allowImportExportEverywhere": true,
"codeFrame": false,
"ecmaFeatures": {
"jsx": false
}
},
"rules": {
"array-bracket-spacing": "error",
"array-bracket-newline": ["error", { "multiline": true }],
"array-element-newline": ["error", "consistent"],
"brace-style": "error",
"camelcase": "error",
"comma-dangle": ["error", "only-multiline"],
"camelcase": "warn",
"comma-style": ["error", "last"],
"curly": "error",
"dot-notation": "error",
@ -30,33 +26,22 @@
"eqeqeq": "error",
"indent": ["error", 4],
"keyword-spacing": "error",
"lines-between-class-members": "error",
"new-cap": "error",
"no-array-constructor": "error",
"no-eval": "error",
"no-loop-func": "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": "error",
"no-prototype-builtins": "off",
"no-redeclare": ["error", { "builtinGlobals": false }],
"no-param-reassign": "warn",
"no-trailing-spaces": "error",
"no-underscore-dangle": "error",
"no-underscore-dangle": "warn",
"no-unneeded-ternary": "error",
"no-var": "off",
"no-useless-escape": "warn",
"object-curly-spacing": ["error", "always"],
"one-var": ["error", "never"],
"padded-blocks": ["error", "never"],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "block-like", "next": "*" },
{ "blankLine": "always", "prev": "multiline-expression", "next": "*" },
{ "blankLine": "always", "prev": "*", "next": "return" }
],
"prefer-const": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"quotes": ["error", "single"],
"semi": "error",
"space-before-blocks": "error",
@ -64,11 +49,6 @@
"space-in-parens": "error",
"space-infix-ops": "error",
"spaced-comment": ["error", "always"],
"wrap-iife": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-this-alias": "off"
"wrap-iife": "error"
}
}

32
.gitattributes vendored
View File

@ -1,34 +1,10 @@
*.php text diff=php
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
.phpstorm.meta.php export-ignore
.travis.yml export-ignore
.scrutinizer.yml export-ignore
.jshintrc export-ignore
.stylelintrc.json export-ignore
.eslintrc.json export-ignore
.eslintignore export-ignore
.weblate export-ignore
codecov.yml export-ignore
infection.json5.dist export-ignore
phpcs.xml.dist export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.neon export-ignore
psalm.xml export-ignore
psalm-baseline.xml export-ignore
DCO export-ignore
.editorconfig export-ignore
# Exclude only the following files and not all files in tests/
# This is because some packaging teams need our test files but not the CI related files
tests/doctum-config.php export-ignore
tests/bootstrap-static.php export-ignore
tests/config.e2e.inc.php export-ignore
tests/phpstan-constants.php export-ignore
tests/*-local-server export-ignore
tests/*.conf export-ignore
tests/*.ini export-ignore
tests/ci-phplint export-ignore
.browserslistrc export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
codeconv.yml export-ignore
.php_cs export-ignore
build.xml export-ignore

View File

@ -1,25 +0,0 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_create_environment:
- python -m pip install sphinx-rtd-theme
# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub
- htmlzip

1
.github/FUNDING.yml vendored
View File

@ -1 +0,0 @@
custom: https://www.phpmyadmin.net/donate/

26
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,26 @@
### Steps to reproduce
1.
2.
3.
### Expected behaviour
Tell us what should happen
### Actual behaviour
Tell us what happens instead
### Server configuration
**Operating system**:
**Web server:**
**Database:**
**PHP version:**
**phpMyAdmin version:**
### Client configuration
**Browser:**
**Operating system:**

View File

@ -1,89 +0,0 @@
name: Bug report
description: Create a report to help us improve phpMyAdmin
title: "[Bug]: "
labels: ["Bug"]
body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: When ...
validations:
required: true
- type: textarea
id: how-to-reproduce
attributes:
label: How to Reproduce
description: Give us the steps to reproduce the bug on our side.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
- type: textarea
id: expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
placeholder: I expected ...
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain the bug.
- type: dropdown
id: operating-systems
attributes:
label: Operating System
description: In which operating system this bug appears?
multiple: true
options:
- Linux
- macOS
- Windows
- type: input
id: web-server
attributes:
label: Web Server
placeholder: Apache/2.4.63
- type: dropdown
id: database-server
attributes:
label: Database Server
description: In which database server this bug appears?
multiple: true
options:
- MySQL
- MariaDB
- PerconaDB
- AuroraDB (by AWS)
- Other
- type: input
id: database-version
attributes:
label: Database version
placeholder: SELECT @@version;
- type: input
id: php-version
attributes:
label: PHP version
placeholder: 8.3.1
- type: input
id: phpmyadmin-version
attributes:
label: phpMyAdmin version
placeholder: 5.2.1
validations:
required: true
- type: input
id: browser
attributes:
label: browser
placeholder: Firefox v136.0.2
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the bug here.

View File

@ -1,45 +0,0 @@
name: Feature request
description: Suggest an idea for phpMyAdmin
title: "[Feat]: "
labels: ["Enhancement"]
body:
- type: input
id: phpmyadmin-version
attributes:
label: phpMyAdmin version
placeholder: 5.2.1
validations:
required: true
- type: textarea
id: feat-description
attributes:
label: Describe the feature
description: Is your feature request related to a problem? Please describe.
placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: solution-description
attributes:
label: Describe the solution
description: Describe the solution you'd like
placeholder: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives-description
attributes:
label: Describe the alternatives
description: Describe alternatives you've considered
placeholder: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add additional context here
placeholder: Add any other context or screenshots about the feature request here.
validations:
required: false

View File

@ -1,18 +0,0 @@
name: Security report
description: Disclose a security vulnerability responsibly by first reporting it to us privately
title: "[Security]: "
labels: ["Bug"]
body:
- type: textarea
id: description
attributes:
label: DON'T REPORT IN HERE
placeholder: |
Security problems should not be reported here.
See our security page: https://www.phpmyadmin.net/security/
Thanks for your help!
validations:
required: true

View File

@ -1,14 +1,6 @@
### Description
Before submitting pull request, please check that every commit:
Please describe your pull request.
Fixes #
Before submitting pull request, please review the following checklist:
- [ ] Make sure you have read our [CONTRIBUTING.md](https://github.com/phpmyadmin/phpmyadmin/blob/master/CONTRIBUTING.md) document.
- [ ] Make sure you are making a pull request against the correct branch. For example, for bug fixes in a released version use the corresponding QA branch and for new features use the _master_ branch. If you have a doubt, you can ask as a comment in the bug report or on the mailing list.
- [ ] Every commit has proper `Signed-off-by` line as described in our [DCO](https://github.com/phpmyadmin/phpmyadmin/blob/master/DCO). This ensures that the work you're submitting is your own creation.
- [ ] Every commit has a descriptive commit message.
- [ ] Every commit is needed on its own, if you have just minor fixes to previous commits, you can squash them.
- [ ] Any new functionality is covered by tests.
- [ ] Has proper Signed-Off-By
- [ ] Has commit message which describes it
- [ ] Is needed on it's own, if you have just minor fixes to previous commits, you can squash them
- [ ] Any new functionality is covered by tests

23
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,23 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale Issue or Pull Request is closed
daysUntilClose: 7
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
# Label to use when marking as stale
staleLabel: wontfix
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label. Set to `false` to disable
unmarkComment: false
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: pulls

View File

@ -1,85 +0,0 @@
name: Daily snapshots
on:
pull_request:
paths:
- '.github/workflows/daily-snapshots.yml'
- 'bin/**'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
generate-snapshots:
name: Generate ${{ matrix.version }} snapshots
runs-on: ubuntu-latest
if: (github.event_name == 'schedule' && github.repository == 'phpmyadmin/phpmyadmin') || (github.event_name != 'schedule')
strategy:
fail-fast: false
matrix:
include:
- { version: '5.2', branch: 'QA_5_2', php-version: '7.2', node-version: '12', python-version: '3.11' }
- { version: '6.0', branch: 'master', php-version: '8.2', node-version: '20', python-version: '3.11' }
steps:
- name: Check out code
uses: actions/checkout@v6
with:
ref: ${{ matrix.branch }}
- name: Install Gettext
run: sudo apt-get install -y gettext
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, iconv, mysqli, zip, gd
coverage: none
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Install Yarn modules
run: yarn install --non-interactive
- name: Install Sphinx for the documentation build
run: pip install 'Sphinx'
- name: Build the release
if: matrix.branch == 'master'
run: ./bin/internal/create-release.sh --daily ${{ matrix.version }}+snapshot ${{ matrix.branch }}
- name: Build the release
if: matrix.branch != 'master'
run: ./scripts/create-release.sh --daily ${{ matrix.version }}+snapshot ${{ matrix.branch }}
- name: Check release excludes
if: matrix.branch == 'master'
run: ./bin/internal/check-release-excludes.sh release/phpMyAdmin-${{ matrix.version }}+snapshot-all-languages.tar.gz
continue-on-error: true
- name: Check release excludes
if: matrix.branch != 'master'
run: ./scripts/check-release-excludes.sh release/phpMyAdmin-${{ matrix.version }}+snapshot-all-languages.tar.gz
continue-on-error: true
- name: Upload snapshots
uses: actions/upload-artifact@v6
with:
name: phpMyAdmin-${{ matrix.version }}-snapshots
path: release/*
retention-days: 1

View File

@ -1,76 +0,0 @@
name: Frontend analysis and tests
on:
push:
pull_request:
paths:
- 'resources/js/**'
- '**.s?css'
- 'tests/javascript/**'
- '.browserslistrc'
- '.eslint*'
- '*.cjs'
- 'package.json'
- 'tsconfig.json'
- 'yarn.lock'
permissions:
contents: read
jobs:
javascript-test:
name: Test JavaScript files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Run tests
run: yarn test
javascript-lint:
name: Lint JavaScript files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Lint JavaScript files
run: yarn run js-lint --quiet
css-lint:
name: Lint CSS files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Lint CSS files
run: yarn run css-lint

View File

@ -1,87 +0,0 @@
name: Lint and analyse php files
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
lint-php-files:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install Composer dependencies
# Allow the previous check to fail but not abort
if: always()
uses: ramsey/composer-install@v3
with:
# Ignore zip for php-webdriver/webdriver
composer-options: "--ignore-platform-req=ext-zip"
- name: Cache coding-standard
# Allow the previous check to fail but not abort
if: always()
uses: actions/cache@v5
with:
path: .phpcs-cache
key: phpcs-cache
- name: Lint PHP files
# Allow the previous check to fail but not abort
if: always()
run: ./tests/ci-phplint
- name: Check coding-standard
# Allow the previous check to fail but not abort
if: always()
run: composer phpcs
- name: Check Twig templates
# Allow the previous check to fail but not abort
if: always()
run: composer run twig-lint
analyse-php:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, iconv, mysqli, zip, gd, bz2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Analyse files with PHPStan
run: composer phpstan -- --memory-limit 2G
- name: Analyse files with Psalm
# Allow the previous check to fail but not abort
if: always()
run: composer psalm -- --shepherd

View File

@ -1,26 +0,0 @@
name: Lint php documentation
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
lint-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Lint phpdoc blocks
uses: sudo-bot/action-doctum@v5
with:
config-file: tests/doctum-config.php
method: "parse"
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors"

View File

@ -1,20 +0,0 @@
name: 'Lock threads'
on:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
lock:
permissions:
issues: write # for dessant/lock-threads to lock issues
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
process-only: 'issues'
issue-inactive-days: 365

View File

@ -1,76 +0,0 @@
# https://docs.github.com/en/actions
name: Mutation tests
on:
push:
branches:
- master
paths:
- 'src/**.php'
- 'tests/unit/**.php'
pull_request:
branches:
- master
paths:
- 'src/**.php'
- 'tests/unit/**.php'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
infection:
name: Infection
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php-version:
- "8.2"
operating-system:
- ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Checkout base ref code
if: github.event_name == 'pull_request'
uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}
- name: Install Gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2, infection:0.27.11
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Run Infection for changed files only
if: github.event_name == 'push' || github.event_name == 'pull_request'
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then \
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_REF_NAME^"; else \
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_BASE_REF"; fi
infection --threads=max --git-diff-lines --git-diff-base="$INFECTION_GIT_DIFF_BASE" \
--logger-github --ignore-msi-with-no-mutations --only-covered --no-interaction --no-progress
- name: Run Infection for all files
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
run: infection --threads=max --no-interaction --log-verbosity=none --logger-github=false

View File

@ -1,66 +0,0 @@
name: Check other tools and scripts
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
build-documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Sphinx for the documentation build
run: |
sudo apt-get update
sudo apt-get install -y sphinx-doc python3-sphinx
- name: Build the documentation
run: make -C docs html SPHINXOPTS='-n -W -a'
build-release:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, iconv, mysqli, zip, gd
tools: composer:v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Sphinx for the documentation build
run: pip install 'Sphinx'
- name: Build the release
run: ./bin/internal/create-release.sh --ci

View File

@ -1,27 +0,0 @@
name: ShellCheck
on:
push:
paths:
- 'bin/**'
pull_request:
paths:
- 'bin/**'
permissions:
contents: read
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Run ShellCheck
uses: reviewdog/action-shellcheck@v1
with:
path: bin
check_all_files_with_shebangs: true
fail_on_error: true

View File

@ -1,24 +0,0 @@
name: "Manage stale PRs/issues"
permissions:
issues: write
on:
schedule:
- cron: "30 1 * * *"
jobs:
run-stale-check:
name: Check for stale PRs/issues
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v9
with:
days-before-stale: 15
days-before-close: -1
only-issue-labels: "Awaiting Author Updates"
close-issue-message: >
The phpMyAdmin team is awaiting an update on this issue.
Please check that all the questions have been answered.

View File

@ -1,152 +0,0 @@
name: "End-to-End tests"
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
env:
php-version: "8.2"
node-version: "20"
jobs:
generate-matrix:
name: Generate the matrix of Selenium tests
if: "!contains(github.event.head_commit.message, '[ci selenium skip]')"
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.tests-list.outputs.tests }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- id: tests-list
name: Send test names to outputs
run: |
set -euo pipefail
TEST_NAMES="[$(find $PWD/tests/end-to-end/ -type f -name '*Test.php' -print |sed -E "s,$PWD/tests/end-to-end/(.*)Test.php,{\"test-name\": \"\1\"}," | paste -sd ",")]"
echo "tests=$(printf "$TEST_NAMES")" >> $GITHUB_OUTPUT
selenium:
name: "Selenium"
if: "!contains(github.event.head_commit.message, '[ci selenium skip]')"
needs: generate-matrix
runs-on: "ubuntu-latest"
services:
database-server:
image: "mysql:5.7"
env:
MYSQL_ROOT_PASSWORD: testbench
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
selenium-server:
image: selenium/standalone-chrome:4
volumes:
- /dev/shm:/dev/shm
options: >-
--health-cmd "/opt/bin/check-grid.sh"
env:
SCREEN_WIDTH: 1920
SCREEN_HEIGHT: 1080
ports:
- "4444:4444"
docker-host-bridge:
# Allow accessing localhost ports from docker containers.
# See https://github.com/qoomon/docker-host
image: qoomon/docker-host
options: >-
--name docker-host-bridge
--hostname docker-host-bridge
--add-host docker-host-bridge:127.0.0.1
--cap-add=NET_ADMIN
--cap-add=NET_RAW
--restart on-failure
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.generate-matrix.outputs.tests) }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install gettext
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ env.php-version }}
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: ${{ env.php-version }}
extensions: :opcache, mbstring, iconv, mysqli, zip, gd, bz2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '${{ env.node-version }}'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive --production
- name: Copy the config
run: cp tests/config.e2e.inc.php config.inc.php
- name: Start server
env:
CI_MODE: selenium
FPM_PATH: php-fpm${{ env.php-version }}
SKIP_STANDALONE: 1
run: |
sudo chown -R runner:docker /var/lib/nginx/
sudo chown -R runner:docker /var/log/nginx/
./tests/start-local-server
echo "SELENIUM_TEMPDIR=$(cat /tmp/last_temp_dir_phpMyAdminTests)" >> $GITHUB_OUTPUT
id: start-local-server
- name: Run Selenium tests
env:
CI_MODE: selenium
TESTSUITE_SELENIUM_BROWSER: chrome
TESTSUITE_USER: root
TESTSUITE_PASSWORD: testbench
# Port defined in tests/nginx.conf
TESTSUITE_URL: http://docker-host-bridge:8000
TESTSUITE_DATABASE_PREFIX: "selenium"
TESTSUITE_SELENIUM_HOST: "127.0.0.1"
TESTSUITE_SELENIUM_PORT: "4444"
run: ./vendor/bin/phpunit --testsuite end-to-end --no-logging --no-coverage --stop-on-skipped --testdox tests/end-to-end/${{ matrix.test-name }}Test.php
- name: Output logs and stop server
env:
CI_MODE: selenium
SELENIUM_TEMPDIR: ${{ steps.start-local-server.outputs.SELENIUM_TEMPDIR }}
if: ${{ success() || failure() }}
run: |
if [ -f "${SELENIUM_TEMPDIR}/php.log" ] ; then cat "${SELENIUM_TEMPDIR}/php.log" ; fi
if [ -f "${SELENIUM_TEMPDIR}/nginx-error.log" ] ; then cat "${SELENIUM_TEMPDIR}/nginx-error.log" ; fi
./tests/stop-local-server
- name: Upload screenshots
uses: actions/upload-artifact@v6
if: ${{ failure() }}
with:
name: selenium-screenshots-${{ strategy.job-index }}
path: ${{ github.workspace }}/build/selenium/**/*
retention-days: 3

View File

@ -1,188 +0,0 @@
name: Run tests
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
multi-arch-tests-php:
name: Test on PHP ${{ matrix.php-version }} (${{ matrix.arch }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- { php-version: '82', experimental: false, arch: 'amd64', exclude-phpunit-groups: '--exclude-group extension-iconv' }
- { php-version: '82', experimental: false, arch: 'arm64/v8', exclude-phpunit-groups: '--exclude-group extension-iconv' }
- { php-version: '82', experimental: false, arch: 'arm/v7', exclude-phpunit-groups: '--exclude-group extension-iconv --exclude-group 32bit-incompatible' }
- { php-version: '82', experimental: false, arch: 'i386', exclude-phpunit-groups: '--exclude-group extension-iconv --exclude-group 32bit-incompatible' }
- { php-version: '82', experimental: true, arch: 'ppc64le', exclude-phpunit-groups: '--exclude-group extension-iconv' }
- { php-version: '82', experimental: false, arch: 's390x', exclude-phpunit-groups: '--exclude-group extension-iconv --exclude-group 32bit-incompatible' }
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Write script
# tcpdf allowed memory exhausted needs the memory_limit workaround
# musl-locales and musl-locales-lang are needed to run some locale specific tests
# gettext is needed to run generate-mo
# git is needed to work around a version detection issue with composer, see: https://github.com/Roave/SecurityAdvisories/issues/76
# ctype for psalm
run: |
printf "set -exu && \
export V='%s' && \
apk add --update --no-cache \
php\$V-cli php\$V-mysqli php\$V-session php\$V-mbstring php\$V-ctype php\$V-sodium \
php\$V-iconv php\$V-xml php\$V-tokenizer php\$V-xmlwriter php\$V-simplexml \
php\$V-dom php\$V-json php\$V-bz2 php\$V-curl php\$V-gd php\$V-zip php\$V-bcmath \
musl-locales musl-locales-lang \
gettext composer git && \
composer config version "$(php -r "define('VERSION_SUFFIX', ''); require_once('src/Version.php'); echo \PhpMyAdmin\Version::VERSION;")" && \
composer install && \
./bin/generate-mo && \
php\$V -d memory_limit=512M ./vendor/bin/phpunit --no-logging --no-coverage --testsuite unit %s" \
"${{ matrix.php-version }}" "${{ matrix.exclude-phpunit-groups }}" > ./do-tests.sh
- name: Set up multi arch support
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Print arch
run: docker run --rm --platform linux/${{ matrix.arch }} alpine:3.19 uname -a
- name: Run tests on php ${{ matrix.php-version }}
run: docker run -v $PWD:/app --workdir /app --rm --platform linux/${{ matrix.arch }} alpine:3.19 sh /app/do-tests.sh
test-php:
name: Test on PHP ${{ matrix.php-version }}, ${{ matrix.composer-dependency }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.php-version == '8.5' }}
strategy:
matrix:
php-version: ['8.2', '8.3', '8.4']
os: [ubuntu-latest]
composer-dependency: [locked, highest]
php-extensions: ['mbstring, iconv, mysqli, zip, gd, bz2']
include:
- php-version: '8.5'
os: ubuntu-latest
composer-dependency: locked
composer-options: '--ignore-platform-req=php+'
php-extensions: 'mbstring, iconv, mysqli, zip, bz2'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# Fetch some commits for Scrutinizer coverage upload
fetch-depth: 15
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.php-extensions }}
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.composer-dependency }}
composer-options: ${{ matrix.composer-options }}
- name: Run PHP tests
run: composer run phpunit -- --testsuite unit --display-deprecations --display-notices --display-warnings --display-errors
- name: Send coverage
uses: codecov/codecov-action@v3
with:
flags: unit-${{ matrix.php-version }}-${{ matrix.os }}
name: phpunit-${{ matrix.php-version }}-${{ matrix.os }}
- name: Send coverage to Scrutinizer
uses: sudo-bot/action-scrutinizer@latest
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
continue-on-error: true
with:
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
- name: Send coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
# Upload can fail on forks or if the secret is missing
continue-on-error: true
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/logs/clover.xml
test-php-optional-extensions:
name: Test on PHP (+ ext-${{ matrix.extension }}) ${{ matrix.php-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
php-version: ["8.2"]
os: [ubuntu-latest]
extension: ["dbase"]
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# Fetch some commits for Scrutinizer coverage upload
fetch-depth: 15
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.extension }}, mbstring, iconv, mysqli, zip, gd
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Run PHP tests
run: composer run phpunit -- --testsuite unit
- name: Send coverage
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.extension }}-extension
name: php-${{ matrix.php-version }}-${{ matrix.extension }}-enabled
- name: Send coverage to Scrutinizer
uses: sudo-bot/action-scrutinizer@latest
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
continue-on-error: true
with:
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
- name: Send coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
# Upload can fail on forks or if the secret is missing
continue-on-error: true
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/logs/clover.xml

View File

@ -1,50 +0,0 @@
name: Update translation files
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
update-po:
permissions:
contents: write # for Git to git push
name: Update po files
runs-on: ubuntu-latest
# Source: https://github.community/t/do-not-run-cron-workflows-in-forks/17636/2?u=williamdes
if: (github.event_name == 'schedule' && github.repository == 'phpmyadmin/phpmyadmin') || (github.event_name != 'schedule')
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Gettext
run: |
sudo apt-get install -y gettext
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Set up git config
run: |
git config user.name "phpMyAdmin bot"
git config user.email bot@phpmyadmin.net
- name: Update PO files
run: |
./bin/update-po
- name: Push changes
run: |
git push

67
.gitignore vendored
View File

@ -1,22 +1,17 @@
# Directory for creating releases
/release/
# Configuration files
/config.inc.php
/config.header.inc.php
/config.footer.inc.php
# Upload/save dirs
/upload/
/save/
/tmp/
# For setup script
/config/
# ctags
tags
# Editor files
phpmyadmin.wpj
.projectOptions
@ -27,88 +22,40 @@ phpmyadmin.wpj
.cache
.idea
.netbeans
.vscode
*.sw[op]
# Web server files
web.config
.htaccess
# Locales
/locale/
/resources/locale/
# Temporary files to generate locales for Twig
/twig-templates/
# Backups
*~
# API documentation
/apidoc/
/docs/_build
/docs/doctrees
/docs/html
/docs/linkcheck/
/docs/locale
/docs/**/*.pyc
/doc/linkcheck/
# Demo server
revision-info.php
# PHP_CodeSniffer
phpcs.xml
.phpcs-cache
# PHPUnit
.phpunit.result.cache
phpunit.xml
/tests/bootstrap.php
/tests/gis/*-actual.json
/tests/gis/*-actual.pdf
/tests/gis/*-actual.png
/tests/gis/*-actual.svg
/test/bootstrap.php
# Jenkins
/build/
# Netbeans ide stuff
/nbproject/
# Eclipse ide stuff
/.pydevproject
# Ant cache
cache.properties
# Composer
composer.lock
/vendor/
# NPM
/node_modules/
phpstan.neon
# Infection
infection.json5
/js/
/setup/
/themes/
# App
/app/cache/*
!/app/cache/.gitkeep
/app/language_stats_inc.php
# public
/public/js/*
!/public/js/.gitkeep
/public/setup/*.css
/public/setup/*.css.map
/public/themes/*
!/public/themes/dot.gif
!/public/themes/bootstrap/
!/public/themes/metro/
!/public/themes/original/
!/public/themes/pmahomme/
/public/themes/*/css/*.css
/public/themes/*/css/*.css.map
yarn.lock
# Javascript Bundle
js/dist/
js/lib/

30
.jsdoc.json Normal file
View File

@ -0,0 +1,30 @@
{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc", "closure"]
},
"recurseDepth": 10,
"source": {
"include": ["js/src/", "package.json"],
"includePattern": ".js$",
"exclude": ["js/src/plugins"],
"excludePattern": "(node_modules/|docs)"
},
"sourceType": "module",
"plugins": [
"plugins/markdown"
],
"templates": {
"cleverLinks": true,
"monospaceLinks": true,
"useLongnameInNav": false,
"showInheritedInNav": true
},
"opts": {
"destination": "./doc/js/",
"encoding": "utf8",
"private": true,
"recurse": true,
"template": "./node_modules/minami"
}
}

View File

@ -1,12 +1,13 @@
{
"esversion" : 6,
// Show more errors
"maxerr" : 1000,
// Globals
"jquery" : true,
// ES6
"esversion": 6,
// Stricter checking
"curly" : true,
"immed" : true,

View File

@ -1,5 +0,0 @@
<?php
namespace PHPSTORM_META {
override(\Psr\Container\ContainerInterface::get(0), map(['@']));
}

View File

@ -1,35 +1,28 @@
# scrutinizer-ci.com configuration
imports:
- javascript
- php
- javascript
- php
filter:
excluded_paths:
- build/
- node_modules/
- public/js/
- tmp/
- vendor/
- tests/doctum-config.php
excluded_paths: [js/vendor/*]
checks:
javascript: true
php: true
tools:
external_code_coverage:
runs: 4 # php 7.x versions
timeout: 900 # 15 min
javascript: true
php: true
build:
image: default-jammy # New NodeJS versions require newer versions of glibc (noble was not available on 12/09/2025)
nodes:
analysis:
environment:
php: 8.2
node: 20 # Scrutinizer uses nvm
dependencies:
before:
- composer config --unset repositories.0
- composer install
- composer require tecnickcom/tcpdf pragmarx/google2fa-qrcode bacon/bacon-qr-code code-lts/u2f-php-server
tests:
override:
- php-scrutinizer-run
- phpcs-run
nodes:
test:
environment:
php: 7.1
node: '8.11.3'
dependencies:
before:
- composer install
- composer require tecnickcom/tcpdf pragmarx/google2fa bacon/bacon-qr-code samyoul/u2f-php-server
- ./vendor/bin/phpcs --config-set installed_paths `pwd`/vendor/phpmyadmin/coding-standard
tests:
override:
- php-scrutinizer-run
-
command: './vendor/bin/phpcs --standard=PMAStandard ./ --report=checkstyle --report-file=cs-data --ignore=*/vendor/*,*/build/*'
analysis:
file: 'cs-data' # The reporter filename
format: 'php-cs-checkstyle' # The supported format by Scrutinizer

View File

@ -1,38 +0,0 @@
{
"extends": [
"stylelint-config-standard",
"stylelint-config-recommended-scss"
],
"rules": {
"selector-class-pattern": null,
"import-notation": null,
"selector-attribute-quotes": null,
"shorthand-property-no-redundant-values": null,
"function-url-quotes": null,
"selector-id-pattern": null,
"alpha-value-notation": null,
"color-function-notation": null,
"scss/no-global-function-names": null,
"scss/function-quote-no-quoted-strings-inside": null,
"property-no-vendor-prefix": null,
"declaration-block-no-redundant-longhand-properties": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"at-rule-empty-line-before": ["always", {
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": ["after-comment"],
"ignoreAtRules": ["else"]
}],
"value-keyword-case": [
"lower",
{
"ignoreProperties": [
"$font-family-monospace"
]
}
]
}
}

101
.travis.yml Normal file
View File

@ -0,0 +1,101 @@
# The Travis setup:
# - run testsuite for every PHP version
# - run lint for every PHP version
# - run Selenium for single PHP version
dist: trusty
language: php
services:
- mysql
php:
- "7.2"
- "7.1"
- "nightly"
sudo: required
env:
matrix:
- CI_MODE=test
global:
- TESTSUITE_USER=root
- TESTSUITE_URL=http://127.0.0.1:8000
install:
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi
- ./test/ci-install-$CI_MODE
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi
before_script:
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
- export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
- export PATH=~/.composer/vendor/bin/:$PATH
- mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
- mysql -uroot < sql/create_tables.sql
- mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
- ./test/start-local-server
script:
- ./scripts/generate-mo --quiet
- if [ $CI_MODE = test ] ; then ./test/ci-phplint ; fi
- ./test/ci-$CI_MODE
after_script:
- if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
- if [ -f php.log ] ; then cat php.log ; fi
- if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
- if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi
- if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
after_success:
- bash <(curl -s https://codecov.io/bash)
matrix:
fast_finish: true
include:
- php: "7.1"
env: CI_MODE=selenium
- php: "7.1"
env: CI_MODE=lint
- php: "7.1"
env: CI_MODE=release
- php: "7.1"
env: CI_MODE=docs
- php: "7.1"
env: CI_MODE=apidocs
- php: "7.2"
env: CI_MODE=phpstan
- os: osx
language: generic
env: CI_MODE=test
before_install:
- brew update
- brew install gettext php72 mariadb
- brew link --force gettext
- sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /usr/local/etc/php/7.2/php.ini
- curl https://getcomposer.org/installer | php
- ln -s "`pwd`/composer.phar" /usr/local/bin/composer
- mysql.server start
allow_failures:
- php: "nightly"
env: CI_MODE=test
- php: "7.2"
env: CI_MODE=phpstan
cache:
pip: true
directories:
- $HOME/.composer/cache/
- $HOME/browserstack
# Install APT packages
# - git > 2.5.1 needed for worktrees
# - mysql server does not seem to be always present on Travis Trusty environment
addons:
apt:
packages:
- git
- mysql-server-5.6
- nginx

View File

@ -1,102 +0,0 @@
# Changes in phpMyAdmin 6.0
All notable changes of the phpMyAdmin 6.0 release series are documented in this file following the [Keep a Changelog](https://keepachangelog.com/) format.
## [6.0.0] - YYYY-MM-DD
### Added
* [#17029](https://github.com/phpmyadmin/phpmyadmin/pull/17029): Enable Twig's `strict_variables` option in development environment
* [#17361](https://github.com/phpmyadmin/phpmyadmin/pull/17361): Add webpack bundler
* [#16500](https://github.com/phpmyadmin/phpmyadmin/pull/16500): Add paging to Routines page
* [#17753](https://github.com/phpmyadmin/phpmyadmin/pull/17753): Adding `inputmode` numeric to integer fields
* [#17765](https://github.com/phpmyadmin/phpmyadmin/pull/17765): Make search input field types match columns types (integer and float)
* [#17809](https://github.com/phpmyadmin/phpmyadmin/pull/17809): Adds support for SHA2 function
* [#18098](https://github.com/phpmyadmin/phpmyadmin/pull/18098): Added reCaptcha example for Cloudflare Turnstile
* [#18223](https://github.com/phpmyadmin/phpmyadmin/pull/18223): Add a configuration option to (dis)allow shared bookmarks: `$cfg['AllowSharedBookmarks'] = true;`
* [#18225](https://github.com/phpmyadmin/phpmyadmin/pull/18225): Make database and web server info separately configurable on `$cfg['ShowServerInfo']`
* [#18257](https://github.com/phpmyadmin/phpmyadmin/pull/18257): Add support for theme color modes
* [#17009](https://github.com/phpmyadmin/phpmyadmin/issues/17009): Implement the security header `Permissions-Policy`
* [#18349](https://github.com/phpmyadmin/phpmyadmin/pull/18349): Allow rollbacking SET queries
* [#18589](https://github.com/phpmyadmin/phpmyadmin/pull/18589): Add support for PSR-15 middleware
* [#18649](https://github.com/phpmyadmin/phpmyadmin/pull/18649): Add color mode toggle at the top navigation bar
* [#18668](https://github.com/phpmyadmin/phpmyadmin/pull/18668): Add number formatting to Total on Browse
* [#18747](https://github.com/phpmyadmin/phpmyadmin/pull/18747): Add `composer.lock` to version control
* [#18799](https://github.com/phpmyadmin/phpmyadmin/pull/18799): Add an user account menu button at top right
* [#18812](https://github.com/phpmyadmin/phpmyadmin/pull/18812): Add role based auth for MySQL 8.x and compatibles
* [#18916](https://github.com/phpmyadmin/phpmyadmin/pull/18916): Add format button to routine, event and trigger
* [#18537](https://github.com/phpmyadmin/phpmyadmin/pull/18537): Add copy to clipboard for export as text
* [#19287](https://github.com/phpmyadmin/phpmyadmin/pull/19287): Add optional support for binary data in database search
* [#19308](https://github.com/phpmyadmin/phpmyadmin/pull/19308): Added an option in the SQL box to "Format as a single line"
* [#19352](https://github.com/phpmyadmin/phpmyadmin/pull/19352): Added support for `BETWEEN` and `NOT BETWEEN` on the query generator
* [#19525](https://github.com/phpmyadmin/phpmyadmin/pull/19525): Add support for `INSERT IGNORE` into for non table imports
* [#19555](https://github.com/phpmyadmin/phpmyadmin/pull/19555): Add button for Copy Query in Query Generator
* [#19691](https://github.com/phpmyadmin/phpmyadmin/pull/19691): Show hostname on main page
* [#19751](https://github.com/phpmyadmin/phpmyadmin/pull/19751): Add Go button at the top of the insert row table
* [#19812](https://github.com/phpmyadmin/phpmyadmin/pull/19812): Add show create table shortcuts when viewing tables
### Changed
* [#17116](https://github.com/phpmyadmin/phpmyadmin/pull/17116): Replace Change Password dialog to modal
* [#17125](https://github.com/phpmyadmin/phpmyadmin/pull/17125): Replace Add Index dialog with modal
* [#17127](https://github.com/phpmyadmin/phpmyadmin/pull/17127): Replace Page settings dialog with modal
* [#17278](https://github.com/phpmyadmin/phpmyadmin/pull/17278): Improve NULL div design
* [#17280](https://github.com/phpmyadmin/phpmyadmin/pull/17280): Improve theme card heights
* [#17399](https://github.com/phpmyadmin/phpmyadmin/pull/17399): Handle connection errors with Exception instead of warnings
* [#17515](https://github.com/phpmyadmin/phpmyadmin/pull/17515): Bump js-cookie version from 2.2.1 to 3.0.1
* [#17561](https://github.com/phpmyadmin/phpmyadmin/pull/17561): Improve Change Password modal UI
* [#17676](https://github.com/phpmyadmin/phpmyadmin/pull/17676): Extract `url.php` entry point into a route
* [#17677](https://github.com/phpmyadmin/phpmyadmin/pull/17677): Extract `js/messages.php` entry point into `/messages` route
* [#17801](https://github.com/phpmyadmin/phpmyadmin/pull/17801): Export page of Settings is not responsive
* [#17842](https://github.com/phpmyadmin/phpmyadmin/issues/17842): Change js.cookie.js to js.cookie.min.js
* [#17632](https://github.com/phpmyadmin/phpmyadmin/issues/17632): Improve tab keypress to text fields on the login form
* [#18124](https://github.com/phpmyadmin/phpmyadmin/pull/18124): Invert svg gis viewer mouse wheel zoom direction
* [#18136](https://github.com/phpmyadmin/phpmyadmin/pull/18136): Force a full page reload for top menu links
* [#18145](https://github.com/phpmyadmin/phpmyadmin/pull/18145): Move public files to the public directory
* [#18300](https://github.com/phpmyadmin/phpmyadmin/pull/18300): Convert JavaScript files to TypeScript
* [#18310](https://github.com/phpmyadmin/phpmyadmin/pull/18310): Minimize form label column width in Routine, Event and Trigger modals
* [#18311](https://github.com/phpmyadmin/phpmyadmin/pull/18311): Only allow resizing textarea vertically
* [#18365](https://github.com/phpmyadmin/phpmyadmin/pull/18365): Change 'reCaptcha' text to 'Captcha'
* [#18439](https://github.com/phpmyadmin/phpmyadmin/pull/18439): Redesign the SQL message card
* [#18576](https://github.com/phpmyadmin/phpmyadmin/pull/18576): Wrap the Application::run() code with an HTTP handler
* [#18652](https://github.com/phpmyadmin/phpmyadmin/pull/18652): Disable AJAX for navigation sidebar links
* [#18658](https://github.com/phpmyadmin/phpmyadmin/pull/18658): Update OpenLayers
* [#18703](https://github.com/phpmyadmin/phpmyadmin/pull/18703): Limit label width in create-view table
* [#18512](https://github.com/phpmyadmin/phpmyadmin/issues/18512): New directory structure
* [#18994](https://github.com/phpmyadmin/phpmyadmin/pull/18994): Refactor name generation of file imports
* [#19110](https://github.com/phpmyadmin/phpmyadmin/pull/19110): Refactor recent/favorite tables buttons
* [#19182](https://github.com/phpmyadmin/phpmyadmin/pull/19182): Refactor GIS editor modal
* [#19214](https://github.com/phpmyadmin/phpmyadmin/pull/19214): Replace jqPlot library with Chart.js library
* [#19294](https://github.com/phpmyadmin/phpmyadmin/pull/19294): Simplify IN, NOT IN criteria text in Query Generator
* [#19327](https://github.com/phpmyadmin/phpmyadmin/pull/19327): Prevent IN / NOT IN duplicates in Query Generator
* [835fc27](https://github.com/phpmyadmin/phpmyadmin/commit/835fc2715d6f7330fa5ed680e8315b98eaa96cec): Redesign the User Groups form page
* [624126e](https://github.com/phpmyadmin/phpmyadmin/commit/624126edc8ea629ebbb222496bb4dad6cac9c6dd): Redesign the database and table privileges pages
* [#19398](https://github.com/phpmyadmin/phpmyadmin/issues/19398): Use `application/json` instead of `text/plain` for JSON export
* [#19496](https://github.com/phpmyadmin/phpmyadmin/pull/19496): Update CODE_OF_CONDUCT.md
* [#19513](https://github.com/phpmyadmin/phpmyadmin/pull/19513): Hide unwanted input depending on chosen Op type in Query Generator
* [#19536](https://github.com/phpmyadmin/phpmyadmin/pull/19536): Disable Search input on unary operators
* [#19542](https://github.com/phpmyadmin/phpmyadmin/pull/19542): Made Search operators `= ''`/`!= ''` more obvious
* [#19651](https://github.com/phpmyadmin/phpmyadmin/pull/19651): Stay the on same page when deleting a foreign key
* [#19712](https://github.com/phpmyadmin/phpmyadmin/pull/19712): Import OpenLayers and Bootstrap directly using Webpack
* [#19794](https://github.com/phpmyadmin/phpmyadmin/pull/19794): Use `jquery-ui-timepicker-addon.min.js` instead of `jquery-ui-timepicker-addon.js`
* [#19795](https://github.com/phpmyadmin/phpmyadmin/pull/19795): Use `additional-methods.min.js` instead of `additional-methods.js`
* [#19564](https://github.com/phpmyadmin/phpmyadmin/pull/19564): Update the table comment field to a textarea
* [#19947](https://github.com/phpmyadmin/phpmyadmin/pull/19947): Export ODS column headers by default
### Removed
* [#17351](https://github.com/phpmyadmin/phpmyadmin/pull/17351): Drop `stripslashes`
* [#17516](https://github.com/phpmyadmin/phpmyadmin/pull/17516): Remove `jquery-debounce-throttle` JavaScript dependency
* [#17752](https://github.com/phpmyadmin/phpmyadmin/pull/17752): Remove Sodium polyfill and require the PHP sodium extension
* [#18430](https://github.com/phpmyadmin/phpmyadmin/pull/18430): Remove Query-By-Example feature
* [#18547](https://github.com/phpmyadmin/phpmyadmin/pull/18547): Remove support for the Recode extension
* [#18587](https://github.com/phpmyadmin/phpmyadmin/pull/18587): Remove the `public/show_config_errors.php` file
* [#19128](https://github.com/phpmyadmin/phpmyadmin/pull/19128): Remove the `phpmyadmin/twig-i18n-extension` package
* [#19243](https://github.com/phpmyadmin/phpmyadmin/pull/19243): Bump minimum PHP version to 8.2.0
* [#19408](https://github.com/phpmyadmin/phpmyadmin/pull/19408): Removed the popup that warned about having an auto-saved query
* [#19409](https://github.com/phpmyadmin/phpmyadmin/pull/19409): Drop Protocol version
* [#19550](https://github.com/phpmyadmin/phpmyadmin/pull/19550): Replace jQuery UI's tooltip with Bootstrap's Tooltip
* [#19852](https://github.com/phpmyadmin/phpmyadmin/pull/19852): Bump Node version to 20
* [#19854](https://github.com/phpmyadmin/phpmyadmin/pull/19854): Drop support for BaconQrCode v2
[6.0.0]: https://github.com/phpmyadmin/phpmyadmin/compare/QA_5_2...master

View File

@ -2,131 +2,45 @@
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
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 a positive environment for our
community include:
Examples of behavior that contributes to creating a positive environment include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
* 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 include:
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* 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 email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
* 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
## Enforcement Responsibilities
## Our Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
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.
Community leaders 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, and will communicate reasons for moderation
decisions when appropriate.
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 within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
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 to the community leaders responsible for enforcement at
info@phpmyadmin.net.
All complaints will be reviewed and investigated promptly and fairly.
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.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
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 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@ -1,22 +1,17 @@
# Contributing to phpMyAdmin
As an open-source project, phpMyAdmin welcomes contributions of many forms.
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 take us time, that we could be used to fix other bugs or make improvements.
2. Please specify the phpMyAdmin, server, PHP, MySQL, and browser information that may be helpful in resolving the issue, especially the exact **version numbers**.
3. If you got some error, please **describe what happened** and add an error message. Reports like "I get an 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.
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!
Thanks for your help!
Please report [bugs on GitHub][1].
@ -25,25 +20,21 @@ Please report [bugs on GitHub][1].
## 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`][4] parameter to Git).
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>`
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.
Example: `Signed-off-by: Jane Smith <jane.smith@example.org>`
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.
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
[4]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff
## Triage issues [![Open Source Helpers](https://www.codetriage.com/phpmyadmin/phpmyadmin/badges/users.svg)](https://www.codetriage.com/phpmyadmin/phpmyadmin)
You can triage issues, which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to phpMyAdmin on CodeTriage](https://www.codetriage.com/phpmyadmin/phpmyadmin).
## More information

386
ChangeLog Normal file
View File

@ -0,0 +1,386 @@
phpMyAdmin - ChangeLog
======================
5.0.0 (not yet released)
- issue #13896 Drop support for PHP 5.5, PHP 5.6, PHP 7.0 and HHVM
- issue #14007 Enable columns names by default for CSV exports
- issue #13919 Remove font size feature
- issue #12373 Add Metro theme
- issue #14155 Add move columns preview SQL button
- issue #14296 Enable strict mode in PHP files
4.8.3 (not yet released)
- 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
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
4.7.7 (2017-12-23)
- issue #13865 Fixed displaying of formatted numeric values for some locales
- issue #13856 Ensure datetimepicker is always loaded for datetime fields
- issue #13848 Fixed PHP error when browsing certain results
- issue [security] Fix XSRF/CSRF vulnerability, see PMASA-2017-09
4.7.6 (2017-11-29)
- issue #13517 Fixed check all interaction with filtering
- issue #13803 Add SJIS-win to default list of allowed charsets
- issue #13436 Improve detection that MySQL server needs SSL connection
- issue #13038 Support JSON datatype on MariaDB 10.2.7 and newer
- issue #13824 Fixed constructing ALTER query with AFTER
- issue #13821 Lock page when changes are done in the SQL editor
- issue #13842 Prefer iconv for encoding conversions
- issue #13737 Fixed changing password on MariaDB cluster
4.7.5 (2017-10-23)
- issue #13615 Avoid problems with browsing unknown query types
- issue #13612 Integrate tooltip into datetime pickers
- issue #13628 Fixed javascript error in server monitor
- issue #13444 Fixed server monitor on non Linux and Windows systems
- issue #13633 Reload javscript messages when changing language
- issue #13604 Fixed crash on invalid ordering data
- issue #13639 Fixed error when browsing non SELECT results
- issue #13533 Fixed saving column to display
- issue #13647 Fixed export of tables with VIRTUAL columns
- issue #13669 Fixed selecting multiple rows accidentally selects the next row too
- issue #13513 Fixed edit index Column alignment issue
- issue #13515 Fixed rendering of add index dialog
- issue #13710 Fixed possible error in server advisor
- issue #13477 Fixed setting input transformations
- issue #13552 Fixed IPv4/IPv6 To Binary input transformation
- issue #13686 Clicking on column name to trigger sort with an active search leads to logout
- issue #13725 Fixed copying tables with specific PARTITION definition
- issue #13761 Fixed listing of bookmarks for a database
- issue #13800 Database lost when renaming to similar name and lower_case_table_names=1
4.7.4 (2017-08-23)
- issue #13415 Remove shadow from the logo
- issue #13507 Fixed per server theme feature
- issue #13523 Missing newline in ALTER exports
- issue #13414 Fixed several compatibility issues with PHP 7.2
- issue #13550 Fixed copy results to clipboard
- issue #13562 Add limitation for user group length
- issue #13561 Fixed edit variable link in advisor
- issue #13579 Optimize table link should not be visible in print page
- issue #13553 Improved error handling on corrupted tables
- issue #13512 Fixed rendering of add index dialog
- issue #13606 Fixed refreshing server variables
4.7.3 (2017-07-20)
- issue #13447 Large multi-line query removes Export operation and blanks query box options
- issue #13445 Fixed rendering of query results
- issue #13437 Fixed version check when not connected to a database
- issue #13465 Fixed creating relation
- issue #13475 Fixed export without backquotes
- issue #13482 Improved handling of uploaded files with open_basedir
- issue #13387 Fixed inline editing of hex values
- issue #13382 Fixed size of index edit dialog
- issue #13489 Fixed rendering SQL lint errors
- issue #13468 Avoid breakage if set_time_limit is disabled
- issue #13471 Fail if ini_set/ini_get are disabled
- issue #13436 Automatically connect using SSL when server is configured so
- issue #13478 Fixed usage of some browser transformations
4.7.2 (2017-06-29)
- issue #13314 Make theme selection keep current server
- issue #13311 Fixed direct login for accounts without password
- issue #13316 Fixed check for mbstring.func_overload
- issue #13323 Fixed wrong encoding of table at triggers
- issue #12976 Fixed natural sorting in several places
- issue #12718 Show warning for users removed from mysql.user table
- issue #13362 Fixed loading additional javascripts
- issue #13343 Fixed editing QBE
- issue #13193 Improved documentation on user settings
- issue #13092 Gracefully handle early fatal errors in AJAX requests
- issue #13327 Fixed Incorrect NavigationTreeEnableExpansion default value in the documentation
- issue #13008 Fixed export of database with a lot of tables
- issue #13318 Improved performance when importing with enabled tracking
- issue #13386 Avoid PHP errors with non existing configuration on OS X
- issue #13388 Show only supported charsets for conversion
- issue #13392 Fixed operation with session.auto_start enabled
- issue #13383 "Create PHP code" is broken
- issue #13189 Fixed links to resume timeouted import
4.7.1 (2017-05-25)
- issue #13132 Always execute tracking queries as controluser
- issue #13125 Focus on SQL editor after inserting field name
- issue #13133 Fixed broken links in setup
- issue #13135 Database list Tooltips: Show wrong value
- issue #13150 Fixed pagination while browsing resuls
- issue #13149 Fixed outbound links in changelog.php
- issue #13146 Do not include devel dependencies in the release
- issue #13144 Do not show New as a database in database dropdown
- issue #13130 Fixed handling of errors in AJAX requests
- issue #13152 Fixed PHP error in case of invalid table preferences
- issue #13154 Fixed PHP error on password change
- issue #13219 Fix Refresh of Process List
- issue #13182 Fix refresh of long queries
- issue #12301 Improved handling of logout with disabled LoginCookieDeleteAll
- issue #13216 Add support for MySQL 8.0 collations
- issue #13218 Fixed rendering of phpMyAdmin logos
- issue #13234 Properly report not working sessions
- issue #13256 Fixed password check on server replication
- issue #13252 Fixed grid editing time column
- issue #13258 Fixed detection of Amazon RDS
- issue #13241 Redirect user to last page that has any tables to display
- issue #13266 Fix link to User accounts overview page
- issue #13274 Fix error in query builder
- issue #13177 Grid editing repeats action after error
4.7.0 (2017-03-28)
- patch #12233 [Display] Improve message when renaming database to same name
- issue #6146 Log authentication attempts to syslog
- issue #11981 Remove support for Swekey authentication
- issue #11987 Remove code for no longer supported MSIE versions
+ issue #11962 Remove embedded PHP libraries, use composer to install them
+ issue #12017 Cannot easily select multiple tables when exporting
+ issue #12047 Add javascript filtering for databases
- issue #12166 More compact rendering of navigation tree
+ issue #12129 Improve performance with SkipLockedTables
- issue #12173 Do not hide indexes under a slider
- issue Improve performance of zip file import
- issue #12196 Removed $cfg['ThemePath']
- issue #6274 Add support for export user settings as config.inc.php snippet
- issue #5555 Better report query errors while generating SQL exports
- issue #12307 Produce valid JSON on export
- issue #12325 Setup script icons broken
- issue #12378 Support IPv6 proxies
- issue Removed MySQL connection retry without password
- issue #12218 Allow to specify further parameters for control connection
- issue #12162 Show charset for each table on Database structure page
- issue #12463 Incorrect link in the href of icon at Hide/Show unhide links
- issue #12330 Shortcut for closing console
- issue #12465 Improved handling of http requests
- issue #12474 Broken links in Setup forms Navigation
- issue #12494 Can't add a new User
- issue #12523 Add 'token' Parameter in all POST requests (Fix 'Token mismatch' errors)
- issue #12302 Improved usage of number_format
- issue #12656 Server selection not working
- issue #12543 NULL results in dataset are colored grey
- issue #12664 Create Bookmark broken
- issue #12688 Use unsigned int for storing bookmark ID
- issue #12352 Added password strength indicator
- issue #12713 Correctly handle HTTP status when doing requests
- issue #12247 Add option to delete settings from browser storage
- issue #12783 Remove unused PMA_addJSCode function
- issue #12069 Add table filtering to database structure
- issue #12799 Allow to configure signon session parameters
- issue #12854 Drop database is broken
- issue #12863 Can't toggle Event Scheduler on
- issue #12742 Finish removing dead code references to xls/xlsx import and export, which was removed some time ago.
- issue #12536 Rename "Relations" to "Relationships" in many places as it's the more proper term
- issue #12834 Fixed margins in central columns feature
- issue #12903 Document more export configuration options
- issue #12897 Use consistent numeric format for table overhead
- issue #12901 Use server returned table name on renaming table
- issue #12918 Always use \r\n as newline when editing fields
- issue #12923 Fixed server side search in navigation panel
- issue #12929 Undefined index warning with ssl_ca_paths
- issue #12924 Do not show errors from OpenSSL cookie encryption/decryption
- issue #12945 Fixed hint rendering on adding new user
- issue #12941 Fixed sorting of tables in relation view
- issue #12936 Fixed tables pagination in navigation panel
- issue #12904 Do not collapse add form for central columns if there are none
- issue #12955 Fixed database renaming
- issue #12954 Fixed export of tracking data
- issue #12960 Enclose exports in transaction by default
- issue #12966 After adding a column ADD INDEX option won't be displayed when enabling AI
- issue #12972 Better error message when Composer has not been run
- issue #12988 Do not show language selector without choices
- issue #12993 Fixed external links to php documentation
- issue #12990 Fixed error when loading favorite tables to console
- issue #12981 Improved rendering of new version information
- issue #12922 Fixed bookmarks ordering
- issue #12964 Fixed table search in navigation
- issue #12985 Fixed rendering of foreign key browsing
- issue #12957 Fixed manipulation with GIS data having zero coordinates
- issue #12804 Fixed various designer javascript errors
- issue #12934 Fixed possible javascript error on server status page
- issue #12927 Fixed javascript error on 3NF normalization
- issue #12996 List all databses in navigation panel database dropdown
- issue #12980 Better defaults when creating multi field foreign key
- issue #12976 Improved foreign key editor behavior
- issue #12958 Always show error reporting dialog on top
- issue #12693 Improved support for TokuDB
- issue #11231 Try harder to honor LoginCookieValidity setting
- issue #13016 and #13017 Slight improvements to the table layout of Relation view
- issue #12345 Correctly show affected rows for LOAD DATA queries
- issue #13010 Copy database: SQL error for copying PMADB metadata
- issue #13002 Fixed OpenDocument exports
- issue #13000 Align NULL values according to the column alignment
- issue #13021 Show phpMyAdmin errors even with error_reporting set to 0
- issue #13020 Removed warning about client and server versions mismatch
- issue Hide comments on table Structure tab when no comment is set
- issue Fixed submission of error reports
- issue #13033 Use Referrer-Policy header to specify referrer policy
- issue Fixed javascript confirmation of dangerous queries
- issue #13040 Compatibility with hhvm 3.18
- issue #13031 Fixed displaying of all rows
- issue #12967 Fixed related field selection for native relations
- issue #13045 Properly escape MIME transformatoin names
- issue #13028 Always show 100% in font selector
- issue #13047 Fix query simulating for more servers
- issue #12846 Fix new version check for sites with wrongly configured curl
- issue #12951 When exporting to Excel, the default is now to include column names in the first row
- issue #13059 Removed debugging code
- issue #13029 Fixed table tracking for nested table groups
- issue #13053 Fixed broken links in setup
- issue #12708 Removed phpMyAdmin version from User-Agent header
- issue #13084 Do not point users to setup when it is disabled
- issue #12660 Delete only phpMyAdmin cookies on upgrade
- issue #13088 Fixed editing of rows with text primary key
- issue #13092 Do not try to sync favorite tables if configuration storage is not enabled
- issue #13105 Fixed changing attribute for virtual field
- issue #12757 Fixed setting password on recent MariaDB with non working plugins
- issue #12349 Fixed undefined variable on import from some formats
- issue #13103 Do not offer default names for copying/renaming databases
- issue [security] Possible to bypass $cfg['Servers'][$i]['AllowNoPassword'], see PMASA-2017-08
4.6.6 (2017-01-23)
- issue #12759 Fix Notice regarding 'Undefined index: old_usergroup'
- issue #12760 Fix Notice regarding 'Undefined index: users'
- issue #12762 Fixed parsing of SQL with BINARY function
- issue #12588 ReCaptcha now works without allow_url_fopen
- issue #12699 Show no local storage warning only on settings tab
- issue #12778 Syntax Error in Adding/Changing TIMESTAMP columns with default value as NULL
- issue #12769 Edit/Export links are not clickable under Routines tab
- issue #12757 Fixed creating new user with older MariaDB
- issue #12784 Remove ctype installation suggestion
- issue #12780 Format button replaces all text with blank spaces
- issue #12786 Fixed database searching
- issue #12792 Fixed javascript error on new version link
- issue #12785 Add information about required and suggested extensions to composer.json
- issue #12801 Custom header shown twice with cookie login form
- issue #12802 Custom footer not shown with auth_type http login failure
- issue #12434 Improve documentation for servers running with Suhosin
- issue #12800 Updated embedded phpSecLib to 2.0.4
- issue #12800 Fixed various issues with PHP 7.1
- issue #11816 Fixed operation with lower_case_table_names=2
- issue #12813 Fixed stored procedure execution
- issue #12826 Honor user configured connection collation
- issue #12293 Correctly report OpenSSL errors from cookie encryption
- issue #12814 DateTime won't allow to input length in Routine editor
- issue #12840 Fix Notice regarding 'Undefined index: row_format' when altering table options
- issue #12841 Fixed moving of columns with whitespace in name
- issue #12847 Fixed editing of virtual columns
- issue #12859 Changed WHERE condition to 0 instead of 1 for SQL query window to avoid accidents
- issue #12872 Use same query for display and execution when dropping index
- issue #12868 Fix check for user groups freatures being enabled
- issue #12876 Fix notices and warning related to dbs_to_test global
- issue #12831 Fix table formatting on Insert tab, which mostly affected row highlighting
- issue #12495 Reintroduced phpinfo page with limited capabilities
- issue #12861 Fix renaming tables with lower_case_table_names=2
- issue #12876 Fix possible PHP error in navigation
- issue #12881 Fix database search with newer php-gettext
- issue #12894 Fix linter error on unterminated variable name
- issue #12732 Fixed filtering for active processes
- issue [security] Multiple vulnerabilities in setup script, see PMASA-2016-44.
- issue [security] Open redirect, see PMASA-2017-1.
- issue [security] php-gettext code execution, see PMASA-2017-2.
- issue [security] DOS vulnerabiltiy in table editing, see PMASA-2017-3.
- issue [security] CSS injection in themes, see PMASA-2017-4.
- issue [security] Cookie attribute injection attack, see PMASA-2017-5.
- issue [security] SSRF in replication, see PMASA-2017-6.
- issue [security] DOS in replication status, see PMASA-2017-7.
--- 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

2
DCO
View File

@ -34,7 +34,7 @@ By making a contribution to this project, I certify that:
And please confirm your certification to the above by adding the following
line to your patch:
Signed-off-by: Jane Smith <jane.smith@example.org>
Signed-off-by: Jane Developer <jane@example.org>
using your real name (sorry, no pseudonyms or anonymous contributions).

6
README
View File

@ -1,7 +1,7 @@
phpMyAdmin - Readme
===================
Version 6.0.0-dev
Version 5.0.0-dev
A web interface for MySQL and MariaDB.
@ -12,7 +12,7 @@ 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 ./docs/ folder or at https://docs.phpmyadmin.net/
please see the documentation in the ./doc/ folder or at https://docs.phpmyadmin.net/
Copyright
---------
@ -22,7 +22,7 @@ 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 ./docs/copyright.rst
For full copyright information, please see ./doc/copyright.rst
License
-------

View File

@ -8,41 +8,27 @@ https://www.phpmyadmin.net/
Code status
-----------
.. image:: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/tests.yml/badge.svg?branch=master
:alt: Testsuite
:target: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/tests.yml?query=branch%3Amaster
.. image:: https://travis-ci.org/phpmyadmin/phpmyadmin.svg?branch=master
:alt: Build status
:target: https://travis-ci.org/phpmyadmin/phpmyadmin
.. image:: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/test-selenium.yml/badge.svg?branch=master
:alt: End-to-End tests
:target: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/test-selenium.yml?query=branch%3Amaster
.. image:: https://readthedocs.org/projects/phpmyadmin/badge/?version=master
:target: https://docs.phpmyadmin.net/en/master/
:alt: Documentation build status
.. image:: https://hosted.weblate.org/widgets/phpmyadmin/-/master/svg-badge.svg
.. image:: https://hosted.weblate.org/widgets/phpmyadmin/-/svg-badge.svg
:alt: Translation status
:target: https://hosted.weblate.org/engage/phpmyadmin/?utm_source=widget
.. image:: https://codecov.io/gh/phpmyadmin/phpmyadmin/branch/master/graph/badge.svg
:alt: Coverage percentage
:target: https://codecov.io/gh/phpmyadmin/phpmyadmin
.. image:: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/badges/quality-score.png
:alt: Code quality score
.. image:: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/badges/quality-score.png?s=93dfde29ffa5771d9c254b7ffb11c4e673315035
:target: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/
.. image:: https://bestpractices.coreinfrastructure.org/projects/213/badge
:alt: CII Best Practices
:target: https://bestpractices.coreinfrastructure.org/projects/213
.. image:: https://shepherd.dev/github/phpmyadmin/phpmyadmin/coverage.svg
:alt: Type coverage
:target: https://shepherd.dev/github/phpmyadmin/phpmyadmin
.. image:: https://img.shields.io/endpoint?url=https://badge-api.stryker-mutator.io/github.com/phpmyadmin/phpmyadmin/master
:alt: Infection MSI
:target: https://infection.github.io
.. image:: https://www.browserstack.com/automate/badge.svg?badge_key=V1ppZHdzTThicjY4Ujk5akxYT2xYUT09LS1PVncrNCtkUW9BZXE1Q2xCQkdTMFZRPT0=--91913a0e155fda6f7c942e9dd2da64b3da571c30
:alt: BrowserStack
:target: https://www.browserstack.com/automate/public-build/V1ppZHdzTThicjY4Ujk5akxYT2xYUT09LS1PVncrNCtkUW9BZXE1Q2xCQkdTMFZRPT0=--91913a0e155fda6f7c942e9dd2da64b3da571c30
Download
@ -50,23 +36,20 @@ Download
You can get the newest release at https://www.phpmyadmin.net/.
If you prefer to follow the Git repository, the following branch and tag names may be of interest:
If you prefer to follow the git repository, the following branch and tag names may be of interest:
* ``STABLE`` is the current stable release.
* ``master`` is the development branch.
* Releases are tagged; for example, version 5.0.1 was tagged as ``RELEASE_5_0_1``.
* Releases are tagged, for example version 4.0.1 was tagged as ``RELEASE_4_0_1``.
Note that phpMyAdmin uses `Composer <https://getcomposer.org/>`_ to manage library dependencies; when using Git
development versions, you must manually run Composer.
Note that phpMyAdmin uses Composer to manage library dependencies, when using git
development versions you must manually run Composer.
Please see `the documentation <https://docs.phpmyadmin.net/en/latest/setup.html#installing-from-git>`_ for details.
More Information
----------------
Please see https://docs.phpmyadmin.net/, or browse the documentation in the docs folder.
Please see the documentation in the doc folder or at https://docs.phpmyadmin.net/.
For `support <https://www.phpmyadmin.net/support/>`_ or `security issues, <https://www.phpmyadmin.net/security/>`_ you can visit https://www.phpmyadmin.net/
Translations are welcome. You can `translate phpMyAdmin into your language <https://hosted.weblate.org/projects/phpmyadmin/>`_.
If you would like to contribute to the phpMyAdmin's codebase, you can read the `code contribution file <CONTRIBUTING.md>`_ or browse our website's `contributing page <https://www.phpmyadmin.net/contribute/>`_.
For support or to learn how to contribute code or by translating to your language,
visit https://www.phpmyadmin.net/

52
ajax.php Normal file
View File

@ -0,0 +1,52 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Generic AJAX endpoint for getting information about database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
use PhpMyAdmin\Core;
$_GET['ajax_request'] = 'true';
require_once 'libraries/common.inc.php';
$response = Response::getInstance();
$response->setAJAX(true);
if (empty($_POST['type'])) {
Core::fatalError(__('Bad type!'));
}
switch ($_POST['type']) {
case 'list-databases':
$response->addJSON('databases', $GLOBALS['dblist']->databases);
break;
case 'list-tables':
Util::checkParameters(['db'], true);
$response->addJSON('tables', $GLOBALS['dbi']->getTables($_REQUEST['db']));
break;
case 'list-columns':
Util::checkParameters(['db', 'table'], true);
$response->addJSON('columns', $GLOBALS['dbi']->getColumnNames($_REQUEST['db'], $_REQUEST['table']));
break;
case 'config-get':
Util::checkParameters(['key'], true);
$response->addJSON('value', $GLOBALS['PMA_Config']->get($_REQUEST['key']));
break;
case 'config-set':
Util::checkParameters(['key', 'value'], true);
$result = $GLOBALS['PMA_Config']->setUserValue(null, $_REQUEST['key'], json_decode($_REQUEST['value']));
if ($result !== true) {
$response = Response::getInstance();
$response->setRequestStatus(false);
$response->addJSON('message', $result);
}
break;
default:
Core::fatalError(__('Bad type!'));
}

0
app/cache/.gitkeep vendored
View File

View File

@ -1,49 +0,0 @@
<?php
declare(strict_types=1);
$vendorConfig = require_once ROOT_PATH . 'app/vendor_config.php';
if (
! is_array($vendorConfig) || ! isset(
$vendorConfig['autoloadFile'],
$vendorConfig['tempDir'],
$vendorConfig['changeLogFile'],
$vendorConfig['licenseFile'],
$vendorConfig['sqlDir'],
$vendorConfig['configFile'],
$vendorConfig['customHeaderFile'],
$vendorConfig['customFooterFile'],
$vendorConfig['versionCheckDefault'],
$vendorConfig['localePath'],
$vendorConfig['cacheDir'],
$vendorConfig['versionSuffix'],
)
) {
exit;
}
// phpcs:disable PSR1.Files.SideEffects
define('AUTOLOAD_FILE', (string) $vendorConfig['autoloadFile']);
define('TEMP_DIR', (string) $vendorConfig['tempDir']);
define('CHANGELOG_FILE', (string) $vendorConfig['changeLogFile']);
define('LICENSE_FILE', (string) $vendorConfig['licenseFile']);
define('SQL_DIR', (string) $vendorConfig['sqlDir']);
define('CONFIG_FILE', (string) $vendorConfig['configFile']);
define('CUSTOM_HEADER_FILE', (string) $vendorConfig['customHeaderFile']);
define('CUSTOM_FOOTER_FILE', (string) $vendorConfig['customFooterFile']);
define('VERSION_CHECK_DEFAULT', (bool) $vendorConfig['versionCheckDefault']);
define('LOCALE_PATH', (string) $vendorConfig['localePath']);
define('CACHE_DIR', (string) $vendorConfig['cacheDir']);
define('VERSION_SUFFIX', (string) $vendorConfig['versionSuffix']);
/**
* TCPDF workaround. Avoid referring to nonexistent files (causes warnings when open_basedir is used).
* This is defined to avoid the TCPDF code to search for a directory outside of open_basedir.
* This value if not used but is useful, no header logic is used for PDF exports.
*
* @see https://github.com/phpmyadmin/phpmyadmin/issues/16709
*/
define('K_PATH_IMAGES', ROOT_PATH);
// phpcs:enable
unset($vendorConfig);

View File

@ -1,416 +0,0 @@
<?php
declare(strict_types=1);
use PhpMyAdmin\Advisory\Advisor;
use PhpMyAdmin\Application;
use PhpMyAdmin\Bookmarks\BookmarkRepository;
use PhpMyAdmin\BrowseForeigners;
use PhpMyAdmin\Clock\Clock;
use PhpMyAdmin\Config;
use PhpMyAdmin\Config\UserPreferences;
use PhpMyAdmin\Config\UserPreferencesHandler;
use PhpMyAdmin\ConfigStorage\Relation;
use PhpMyAdmin\ConfigStorage\RelationCleanup;
use PhpMyAdmin\Console\Console;
use PhpMyAdmin\Console\History;
use PhpMyAdmin\CreateAddField;
use PhpMyAdmin\Database\CentralColumns;
use PhpMyAdmin\Database\Designer;
use PhpMyAdmin\Database\Designer\Common;
use PhpMyAdmin\Database\Events;
use PhpMyAdmin\Database\Routines;
use PhpMyAdmin\Dbal\DatabaseInterface;
use PhpMyAdmin\DbTableExists;
use PhpMyAdmin\Error\ErrorHandler;
use PhpMyAdmin\Error\ErrorReport;
use PhpMyAdmin\Export\Export;
use PhpMyAdmin\Export\Options;
use PhpMyAdmin\Export\OutputHandler;
use PhpMyAdmin\Export\TemplateModel;
use PhpMyAdmin\FileListing;
use PhpMyAdmin\FlashMessenger;
use PhpMyAdmin\Footer;
use PhpMyAdmin\Header;
use PhpMyAdmin\Http\Factory\ResponseFactory;
use PhpMyAdmin\Http\Middleware;
use PhpMyAdmin\I18n\LanguageManager;
use PhpMyAdmin\Import\Import;
use PhpMyAdmin\Import\SimulateDml;
use PhpMyAdmin\InsertEdit;
use PhpMyAdmin\Navigation\Navigation;
use PhpMyAdmin\Normalization;
use PhpMyAdmin\Operations;
use PhpMyAdmin\Partitioning\Maintenance;
use PhpMyAdmin\Plugins\AuthenticationPluginFactory;
use PhpMyAdmin\Replication\Replication;
use PhpMyAdmin\Replication\ReplicationGui;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Server\Plugins;
use PhpMyAdmin\Server\Privileges;
use PhpMyAdmin\Server\Privileges\AccountLocking;
use PhpMyAdmin\Server\Status\Data;
use PhpMyAdmin\Server\Status\Monitor;
use PhpMyAdmin\Server\Status\Processes;
use PhpMyAdmin\Sql;
use PhpMyAdmin\SqlQueryForm;
use PhpMyAdmin\Table\ColumnsDefinition;
use PhpMyAdmin\Table\Indexes;
use PhpMyAdmin\Table\Search;
use PhpMyAdmin\Table\TableMover;
use PhpMyAdmin\Template;
use PhpMyAdmin\Theme\ThemeManager;
use PhpMyAdmin\Tracking\Tracking;
use PhpMyAdmin\Tracking\TrackingChecker;
use PhpMyAdmin\Transformations;
use PhpMyAdmin\Triggers\Triggers;
use PhpMyAdmin\UrlRedirector;
use PhpMyAdmin\UserPassword;
use PhpMyAdmin\UserPrivilegesFactory;
use PhpMyAdmin\Utils\HttpRequest;
use PhpMyAdmin\VersionInformation;
use Psr\Clock\ClockInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
return [
Advisor::class => ['class' => Advisor::class, 'arguments' => [DatabaseInterface::class, ExpressionLanguage::class]],
Application::class => [
'class' => Application::class,
'arguments' => [ResponseFactory::class, ResponseRenderer::class],
],
BrowseForeigners::class => [
'class' => BrowseForeigners::class,
'arguments' => [Template::class, Config::class, ThemeManager::class],
],
Config::class => ['class' => Config::class, 'factory' => [Config::class, 'getInstance']],
Config\PageSettings::class => [
'class' => Config\PageSettings::class,
'arguments' => [UserPreferences::class, ResponseRenderer::class],
],
CentralColumns::class => ['class' => CentralColumns::class, 'arguments' => [DatabaseInterface::class]],
CreateAddField::class => ['class' => CreateAddField::class, 'arguments' => [DatabaseInterface::class]],
DatabaseInterface::class => [
'class' => DatabaseInterface::class,
'factory' => [DatabaseInterface::class, 'getInstance'],
'arguments' => [Config::class],
],
DbTableExists::class => ['class' => DbTableExists::class, 'arguments' => [DatabaseInterface::class]],
Designer::class => [
'class' => Designer::class,
'arguments' => [DatabaseInterface::class, Relation::class, Template::class, Config::class],
],
Common::class => [
'class' => Common::class,
'arguments' => [DatabaseInterface::class, Relation::class, Config::class],
],
ErrorHandler::class => ['class' => ErrorHandler::class, 'factory' => [ErrorHandler::class, 'getInstance']],
ErrorReport::class => [
'class' => ErrorReport::class,
'arguments' => [HttpRequest::class, Relation::class, Template::class, Config::class],
],
Events::class => ['class' => Events::class, 'arguments' => [DatabaseInterface::class, Config::class]],
Export::class => ['class' => Export::class, 'arguments' => [DatabaseInterface::class, OutputHandler::class]],
Options::class => [
'class' => Options::class,
'arguments' => [Relation::class, TemplateModel::class, UserPreferencesHandler::class],
],
TemplateModel::class => ['class' => TemplateModel::class, 'arguments' => [DatabaseInterface::class]],
ExpressionLanguage::class => ['class' => ExpressionLanguage::class],
FileListing::class => ['class' => FileListing::class],
FlashMessenger::class => ['class' => FlashMessenger::class],
Header::class => [
'class' => Header::class,
'arguments' => [
Template::class,
Console::class,
Config::class,
DatabaseInterface::class,
Relation::class,
UserPreferences::class,
UserPreferencesHandler::class,
],
],
HttpRequest::class => ['class' => HttpRequest::class],
ResponseFactory::class => ['class' => ResponseFactory::class, 'factory' => [ResponseFactory::class, 'create']],
Import::class => [
'class' => Import::class,
'arguments' => [DatabaseInterface::class, ResponseRenderer::class, Config::class],
],
SimulateDml::class => ['class' => SimulateDml::class, 'arguments' => [DatabaseInterface::class]],
InsertEdit::class => [
'class' => InsertEdit::class,
'arguments' => [
DatabaseInterface::class,
Relation::class,
Transformations::class,
FileListing::class,
Template::class,
Config::class,
ResponseRenderer::class,
],
],
Middleware\ErrorHandling::class => [
'class' => Middleware\ErrorHandling::class,
'arguments' => [ErrorHandler::class],
],
Middleware\OutputBuffering::class => ['class' => Middleware\OutputBuffering::class],
Middleware\PhpExtensionsChecking::class => [
'class' => Middleware\PhpExtensionsChecking::class,
'arguments' => [Template::class, ResponseFactory::class],
],
Middleware\ServerConfigurationChecking::class => [
'class' => Middleware\ServerConfigurationChecking::class,
'arguments' => [Template::class, ResponseFactory::class],
],
Middleware\PhpSettingsConfiguration::class => ['class' => Middleware\PhpSettingsConfiguration::class],
Middleware\RouteParsing::class => ['class' => Middleware\RouteParsing::class],
Middleware\ConfigLoading::class => [
'class' => Middleware\ConfigLoading::class,
'arguments' => [Config::class, Template::class, ResponseFactory::class],
],
Middleware\UriSchemeUpdating::class => [
'class' => Middleware\UriSchemeUpdating::class,
'arguments' => [Config::class],
],
Middleware\SessionHandling::class => [
'class' => Middleware\SessionHandling::class,
'arguments' => [Config::class, ErrorHandler::class, Template::class, ResponseFactory::class],
],
Middleware\EncryptedQueryParamsHandling::class => ['class' => Middleware\EncryptedQueryParamsHandling::class],
Middleware\UrlParamsSetting::class => [
'class' => Middleware\UrlParamsSetting::class,
'arguments' => [Config::class],
],
Middleware\TokenRequestParamChecking::class => [
'class' => Middleware\TokenRequestParamChecking::class,
'arguments' => [ResponseRenderer::class],
],
Middleware\DatabaseAndTableSetting::class => ['class' => Middleware\DatabaseAndTableSetting::class],
Middleware\SqlQueryGlobalSetting::class => ['class' => Middleware\SqlQueryGlobalSetting::class],
Middleware\LanguageLoading::class => ['class' => Middleware\LanguageLoading::class],
Middleware\ConfigErrorAndPermissionChecking::class => [
'class' => Middleware\ConfigErrorAndPermissionChecking::class,
'arguments' => [Config::class, Template::class, ResponseFactory::class],
],
Middleware\RequestProblemChecking::class => [
'class' => Middleware\RequestProblemChecking::class,
'arguments' => [Template::class, ResponseFactory::class],
],
Middleware\CurrentServerGlobalSetting::class => [
'class' => Middleware\CurrentServerGlobalSetting::class,
'arguments' => [Config::class],
],
Middleware\ThemeInitialization::class => ['class' => Middleware\ThemeInitialization::class],
Middleware\UrlRedirection::class => [
'class' => Middleware\UrlRedirection::class,
'arguments' => [UrlRedirector::class, UserPreferencesHandler::class],
],
Middleware\SetupPageRedirection::class => [
'class' => Middleware\SetupPageRedirection::class,
'arguments' => [Config::class, ResponseFactory::class, UserPreferencesHandler::class, ResponseRenderer::class],
],
Middleware\MinimumCommonRedirection::class => [
'class' => Middleware\MinimumCommonRedirection::class,
'arguments' => [ResponseFactory::class, UserPreferencesHandler::class, ResponseRenderer::class],
],
Middleware\LanguageAndThemeCookieSaving::class => [
'class' => Middleware\LanguageAndThemeCookieSaving::class,
'arguments' => [Config::class],
],
Middleware\LoginCookieValiditySetting::class => [
'class' => Middleware\LoginCookieValiditySetting::class,
'arguments' => [Config::class, UserPreferencesHandler::class],
],
Middleware\Authentication::class => [
'class' => Middleware\Authentication::class,
'arguments' => [
Config::class,
Template::class,
ResponseFactory::class,
AuthenticationPluginFactory::class,
DatabaseInterface::class,
Relation::class,
ResponseRenderer::class,
],
],
Middleware\DatabaseServerVersionChecking::class => [
'class' => Middleware\DatabaseServerVersionChecking::class,
'arguments' => [Config::class, Template::class, ResponseFactory::class],
],
Middleware\SqlDelimiterSetting::class => [
'class' => Middleware\SqlDelimiterSetting::class,
'arguments' => [Config::class],
],
Middleware\ResponseRendererLoading::class => [
'class' => Middleware\ResponseRendererLoading::class,
'arguments' => [Config::class, ResponseRenderer::class],
],
Middleware\ProfilingChecking::class => [
'class' => Middleware\ProfilingChecking::class,
'arguments' => [ResponseRenderer::class, DatabaseInterface::class],
],
Middleware\UserPreferencesLoading::class => [
'class' => Middleware\UserPreferencesLoading::class,
'arguments' => [UserPreferencesHandler::class],
],
Middleware\RecentTableHandling::class => [
'class' => Middleware\RecentTableHandling::class,
'arguments' => [Config::class],
],
Middleware\StatementHistory::class => [
'class' => Middleware\StatementHistory::class,
'arguments' => [Config::class, History::class],
],
Navigation::class => [
'class' => Navigation::class,
'arguments' => [Template::class, Relation::class, DatabaseInterface::class, Config::class],
],
Normalization::class => [
'class' => Normalization::class,
'arguments' => [DatabaseInterface::class, Relation::class, Transformations::class, Template::class],
],
Operations::class => [
'class' => Operations::class,
'arguments' => [DatabaseInterface::class, Relation::class, TableMover::class],
],
OutputHandler::class => ['class' => OutputHandler::class],
Maintenance::class => ['class' => Maintenance::class, 'arguments' => [DatabaseInterface::class]],
AuthenticationPluginFactory::class => [
'class' => AuthenticationPluginFactory::class,
'arguments' => [ResponseRenderer::class],
],
Relation::class => ['class' => Relation::class, 'arguments' => [DatabaseInterface::class, Config::class]],
RelationCleanup::class => [
'class' => RelationCleanup::class,
'arguments' => [DatabaseInterface::class, Relation::class],
],
Replication::class => ['class' => Replication::class, 'arguments' => [DatabaseInterface::class]],
ReplicationGui::class => ['class' => ReplicationGui::class, 'arguments' => [Replication::class, Template::class]],
ResponseRenderer::class => [
'class' => ResponseRenderer::class,
'factory' => [ResponseRenderer::class, 'getInstance'],
'arguments' => [
Config::class,
Template::class,
Header::class,
Footer::class,
ErrorHandler::class,
DatabaseInterface::class,
ResponseFactory::class,
],
],
Routines::class => ['class' => Routines::class, 'arguments' => [DatabaseInterface::class, Config::class]],
Plugins::class => ['class' => Plugins::class, 'arguments' => [DatabaseInterface::class]],
Privileges::class => [
'class' => Privileges::class,
'arguments' => [
Template::class,
DatabaseInterface::class,
Relation::class,
RelationCleanup::class,
Plugins::class,
Config::class,
],
],
AccountLocking::class => ['class' => AccountLocking::class, 'arguments' => [DatabaseInterface::class]],
Sql::class => [
'class' => Sql::class,
'arguments' => [
DatabaseInterface::class,
Relation::class,
RelationCleanup::class,
Transformations::class,
Template::class,
BookmarkRepository::class,
Config::class,
ResponseRenderer::class,
],
],
SqlQueryForm::class => [
'class' => SqlQueryForm::class,
'arguments' => [Template::class, DatabaseInterface::class, BookmarkRepository::class],
],
Data::class => ['class' => Data::class, 'arguments' => [DatabaseInterface::class, Config::class]],
Monitor::class => ['class' => Monitor::class, 'arguments' => [DatabaseInterface::class]],
Processes::class => ['class' => Processes::class, 'arguments' => [DatabaseInterface::class]],
ColumnsDefinition::class => [
'class' => ColumnsDefinition::class,
'arguments' => [DatabaseInterface::class, Relation::class, Transformations::class],
],
Indexes::class => ['class' => Indexes::class, 'arguments' => [DatabaseInterface::class]],
\PhpMyAdmin\Table\Maintenance::class => [
'class' => \PhpMyAdmin\Table\Maintenance::class,
'arguments' => [DatabaseInterface::class],
],
Search::class => ['class' => Search::class, 'arguments' => [DatabaseInterface::class]],
Template::class => ['class' => Template::class, 'arguments' => [Config::class]],
ThemeManager::class => ['class' => ThemeManager::class],
Tracking::class => [
'class' => Tracking::class,
'arguments' => [
SqlQueryForm::class,
Template::class,
Relation::class,
DatabaseInterface::class,
TrackingChecker::class,
],
],
TrackingChecker::class => [
'class' => TrackingChecker::class,
'arguments' => [DatabaseInterface::class, Relation::class],
],
Transformations::class => [
'class' => Transformations::class,
'arguments' => [DatabaseInterface::class, Relation::class],
],
Triggers::class => ['class' => Triggers::class, 'arguments' => [DatabaseInterface::class]],
UserPassword::class => [
'class' => UserPassword::class,
'arguments' => [Privileges::class, AuthenticationPluginFactory::class, DatabaseInterface::class],
],
UserPreferences::class => [
'class' => UserPreferences::class,
'arguments' => [
DatabaseInterface::class,
Relation::class,
Template::class,
Config::class,
ClockInterface::class,
],
],
UserPrivilegesFactory::class => [
'class' => UserPrivilegesFactory::class,
'arguments' => [DatabaseInterface::class],
],
VersionInformation::class => ['class' => VersionInformation::class],
BookmarkRepository::class => [
'class' => BookmarkRepository::class,
'arguments' => [DatabaseInterface::class, Relation::class, Config::class],
],
Console::class => [
'class' => Console::class,
'arguments' => [Relation::class, Template::class, BookmarkRepository::class, History::class],
],
TableMover::class => ['class' => TableMover::class, 'arguments' => [DatabaseInterface::class, Relation::class]],
History::class => [
'class' => History::class,
'arguments' => [DatabaseInterface::class, Relation::class, Config::class],
],
UserPreferencesHandler::class => [
'class' => UserPreferencesHandler::class,
'arguments' => [
Config::class,
DatabaseInterface::class,
UserPreferences::class,
LanguageManager::class,
ThemeManager::class,
],
],
LanguageManager::class => ['class' => LanguageManager::class, 'factory' => [LanguageManager::class, 'getInstance']],
ClockInterface::class => ['class' => Clock::class],
Footer::class => ['class' => Footer::class, 'arguments' => [Template::class, Config::class]],
UrlRedirector::class => [
'class' => UrlRedirector::class,
'arguments' => [ResponseRenderer::class, Template::class, ResponseFactory::class],
],
];

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
<?php
declare(strict_types=1);
use PhpMyAdmin\Container\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $configurator): void {
$services = $configurator->services();
/** @var array<string, array{class: string, arguments?: array<string>, factory?: callable}> $servicesFile */
$servicesFile = include ROOT_PATH . 'app/services.php';
ContainerBuilder::loadServices($servicesFile, $services);
/** @var array<string, array{class: string, arguments?: array<string>, factory?: callable}> $servicesFile */
$servicesFile = include ROOT_PATH . 'app/services_controllers.php';
ContainerBuilder::loadServices($servicesFile, $services);
};

View File

@ -1,73 +0,0 @@
<?php
/**
* File for vendor customization, you can change here paths or some behaviour,
* which vendors such as Linux distributions might want to change.
*
* For changing this file you should know what you are doing. For this reason
* options here are not part of normal configuration.
*/
declare(strict_types=1);
return [
/**
* Path to vendor autoload file. Useful when you want to have vendor dependencies somewhere else.
*/
'autoloadFile' => ROOT_PATH . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php',
/**
* Directory where cache files are stored.
*/
'tempDir' => ROOT_PATH . 'tmp' . DIRECTORY_SEPARATOR,
/**
* Path to changelog file, can be gzip compressed.
* Useful when you want to have documentation somewhere else, e.g. /usr/share/doc.
*/
'changeLogFile' => ROOT_PATH . 'CHANGELOG-6.0.md',
/**
* Path to license file. Useful when you want to have documentation somewhere else, e.g. /usr/share/doc.
*/
'licenseFile' => ROOT_PATH . 'LICENSE',
/**
* Directory where SQL scripts to create/upgrade configuration storage reside.
*/
'sqlDir' => ROOT_PATH . 'resources' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR,
/**
* Filename of a configuration file.
*/
'configFile' => ROOT_PATH . 'config.inc.php',
/**
* Filename of custom header file.
*/
'customHeaderFile' => ROOT_PATH . 'config.header.inc.php',
/**
* Filename of custom footer file.
*/
'customFooterFile' => ROOT_PATH . 'config.footer.inc.php',
/**
* Default value for check for version upgrades.
*/
'versionCheckDefault' => true,
/**
* Path to files with compiled locales (*.mo)
*/
'localePath' => ROOT_PATH . 'resources' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR,
/**
* Define the cache directory for routing cache and other cache files
*/
'cacheDir' => ROOT_PATH . 'app' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR,
/**
* Suffix to add to the phpMyAdmin version
*/
'versionSuffix' => '',
];

View File

@ -1,13 +0,0 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-typescript"
]
}

View File

@ -1,43 +0,0 @@
#!/usr/bin/env php
<?php
use PhpMyAdmin\Command\CacheWarmupCommand;
use PhpMyAdmin\Command\FixPoTwigCommand;
use PhpMyAdmin\Command\SetVersionCommand;
use PhpMyAdmin\Command\TwigLintCommand;
use PhpMyAdmin\Command\WriteGitRevisionCommand;
use PhpMyAdmin\Config;
use PhpMyAdmin\Container\ContainerBuilder;
use PhpMyAdmin\Dbal\DatabaseInterface;
use PhpMyAdmin\Tests\Stubs\DbiDummy;
use Symfony\Component\Console\Application;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'app/constants.php';
require_once AUTOLOAD_FILE;
if (! class_exists(Application::class)) {
echo 'Be sure to have dev-dependencies installed.' . PHP_EOL;
echo 'Command aborted.' . PHP_EOL;
exit(1);
}
$containerBuilder = ContainerBuilder::getContainer();
$cfg['environment'] = 'production';
$config = new Config();
$config->loadFromFile(CONFIG_FILE);
$config->set('environment', $cfg['environment']);
$dbi = DatabaseInterface::getInstanceForTest(new DbiDummy());
$application = new Application('phpMyAdmin Console Tool');
$application->add(new CacheWarmupCommand());
$application->add(new TwigLintCommand());
$application->add(new SetVersionCommand());
$application->add(new WriteGitRevisionCommand());
$application->add(new FixPoTwigCommand());
$application->run();

View File

@ -1,40 +0,0 @@
#!/bin/sh
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
if [ "$1" = --quiet ] ; then
stats=""
shift
else
stats="--statistics"
fi
compile() {
lang=$(echo "$1" | sed 's@resources/po/\(.*\)\.po@\1@')
if [ -n "$stats" ] ; then
printf "%s: " "$lang"
fi
mkdir -p resources/locale/"$lang"/LC_MESSAGES
msgfmt $stats --check -o resources/locale/"$lang"/LC_MESSAGES/phpmyadmin.mo "$1"
return $?
}
if [ -n "$1" ] ; then
compile resources/po/"$1".po
exit $?
fi
result=0
for x in resources/po/*.po ; do
compile "$x"
ret=$?
if [ $ret != 0 ] ; then
echo Error when compiling "$x" >&2
result=$ret
fi
done
exit $result

View File

@ -1,358 +0,0 @@
#!/bin/bash
set -e
FILE="$1"
if [ ! -f "${FILE}" ]; then
echo 'Please provide a file as a first argument.'
exit 1
fi
FILE_LIST="$(tar --list --file="${FILE}")"
found=0;
echo 'Searching for files'
foundFile() {
found=1
printf "Found: %s\n" "${filePath}"
}
foundFileExt() {
found=1
printf "Found unexpected file: %s with extension %s\n" "${pathWithoutFirst}" "${extension}"
}
validateExtension() {
if [ "${filePath: -1}" = "/" ]; then
return;
fi
pathWithoutFirst="$(echo "$filePath" | cut -d / -f 2-)"
filename=$(basename -- "$pathWithoutFirst")
extension="${filename##*.}"
case $pathWithoutFirst in
public/docs/*)
if [ "${extension}" != "png" ] && [ "${extension}" != "txt" ] &&
[ "${extension}" != "html" ] && [ "${extension}" != "js" ] &&
[ "${extension}" != "css" ] && [ "${extension}" != "gif" ]; then
foundFileExt
fi
;;
resources/js/global.d.ts)
;;
public/js/vendor/*)
if [ "${extension}" != "js" ] && [ "${extension}" != "map" ] &&
[ "${extension}" != "css" ] && [ "${filename}" != "LICENSE" ] &&
[ "${extension}" != "txt" ]; then
foundFileExt
fi
;;
public/js/*)
if [ "${extension}" != "js" ] && [ "${extension}" != "map" ]; then
foundFileExt
fi
;;
resources/js/*)
if [ "${extension}" != "ts" ]; then
foundFileExt
fi
;;
resources/sql/*)
if [ "${extension}" != "sql" ]; then
foundFileExt
fi
;;
examples/*)
if [ "${extension}" != "php" ]; then
foundFileExt
fi
;;
resources/locale/*)
if [ "${extension}" != "mo" ]; then
foundFileExt
fi
;;
public/setup/*)
if [ "${extension}" != "php" ] && [ "${extension}" != "twig" ] &&
[ "${extension}" != "css" ] && [ "${extension}" != "scss" ] &&
[ "${extension}" != "gif" ] && [ "${extension}" != "map" ]; then
foundFileExt
fi
;;
resources/templates/*)
if [ "${extension}" != "twig" ]; then
foundFileExt
fi
;;
app/*)
if [ "${extension}" != "php" ]; then
foundFileExt
fi
;;
src/*)
if [ "${extension}" != "php" ] && [ "${extension}" != "md" ] &&
[ "${filename}" != "README" ] && [ "${filename}" != "TEMPLATE" ] &&
[ "${filename}" != "TEMPLATE_ABSTRACT" ]; then
foundFileExt
fi
;;
public/themes/*)
if [ "${extension}" != "css" ] && [ "${extension}" != "png" ] &&
[ "${extension}" != "scss" ] && [ "${extension}" != "map" ] &&
[ "${extension}" != "svg" ] && [ "${extension}" != "ico" ] &&
[ "${extension}" != "gif" ] && [ "${extension}" != "json" ]; then
foundFileExt
fi
;;
vendor/phpmyadmin/sql-parser/locale/*)
if [ "${extension}" != "mo" ]; then
foundFileExt
fi
;;
vendor/composer/ca-bundle/res/cacert.pem)
;;
vendor/pragmarx/google2fa-qrcode/composer.lock)
;;
vendor/williamdes/mariadb-mysql-kbs/cliff.toml)
;;
vendor/williamdes/mariadb-mysql-kbs/dist/merged-ultraslim.json)
;;
vendor/composer/installed.json)
;;
vendor/tecnickcom/tcpdf/*)
if [ "${extension}" != "php" ] && [ "${filename}" != "LICENSE.TXT" ] &&
[ "${filename}" != "README.md" ] && [ "${filename}" != "CHANGELOG.TXT" ] &&
[ "${filename}" != "VERSION" ] && [ "${filename}" != "composer.json" ] &&
[ "${extension}" != "z" ]; then
foundFileExt
fi
;;
vendor/*)
if [ "${extension}" != "php" ] && [ "${filename}" != "LICENSE" ] &&
[ "${filename}" != "README" ] && [ "${filename}" != "CHANGELOG" ] &&
[ "${filename}" != "composer.json" ] && [ "${filename}" != "CHANGELOG.md" ] &&
[ "${filename}" != "README.md" ] && [ "${filename}" != "BACKERS.md" ] &&
[ "${filename}" != "LICENSE.md" ] && [ "${filename}" != "ARCHITECTURE.md" ] &&
[ "${filename}" != "LICENSE.txt" ] && [ "${filename}" != "AUTHORS" ] &&
[ "${filename}" != "LICENCE.md" ] && [ "${filename}" != "LICENCE" ] &&
[ "${filename}" != "COPYRIGHT.md" ]; then
foundFileExt
fi
;;
CHANGELOG-[5-9].[0-9].md)
;;
LICENSE)
;;
RELEASE-DATE-[1-9].[0-9].[0-9])
;;
RELEASE-DATE-[1-9].[0-9].[0-9]-dev)
;;
RELEASE-DATE-[1-9].[0-9]+snapshot)
;;
CONTRIBUTING.md)
;;
README)
;;
public/favicon.ico)
;;
tsconfig.json)
;;
webpack.config.cjs)
;;
babel.config.json)
;;
package.json)
;;
composer.json)
;;
composer.lock)
;;
yarn.lock)
;;
public/robots.txt)
;;
index.php)
;;
public/index.php)
;;
config.sample.inc.php)
;;
*)
foundFileExt
;;
esac
}
for filePath in ${FILE_LIST}; do
validateExtension
case $filePath in
*/composer-require-checker.json)
foundFile;;
*/CLAUDE.MD)
foundFile;;
*/Readme.php)
foundFile;;
*/rector*.php)
foundFile;;
*/.editorconfig)
foundFile;;
*/easy-coding-standard.neon)
foundFile;;
*/.travis.yml)
foundFile;;
*/psalm.xml.dist)
foundFile;;
*/phpdoc.xml)
foundFile;;
*/phpdoc.dist.xml)
foundFile;;
*/.coveralls.yml)
foundFile;;
*/.yamllint.yaml)
foundFile;;
*/appveyor.yml)
foundFile;;
*/phpunit.xml)
foundFile;;
*/phpunit.xml.dist)
foundFile;;
*/phive.xml)
foundFile;;
*/Makefile)
foundFile;;
*/splitsh.json)
foundFile;;
*/phpbench.json)
foundFile;;
*/phpbench.json.dist)
foundFile;;
*/.php-cs-fixer.dist.php)
foundFile;;
*/.php_cs)
foundFile;;
*/.php_cs.dist)
foundFile;;
*/.php_cs.cache)
foundFile;;
*/.php-cs-fixer.php)
foundFile;;
*/psalm.xml)
foundFile;;
*/phpcs.xml)
foundFile;;
*/phpcs.xml.dist)
foundFile;;
*/ecs.php)
foundFile;;
*/.scrutinizer.yml)
foundFile;;
*/.phpstorm.meta.php)
foundFile;;
*/codecov.yml)
foundFile;;
*/.gitattributes)
foundFile;;
*/.gitignore)
foundFile;;
*/.gitkeep)
foundFile;;
*/.mailmap)
foundFile;;
*/.env)
foundFile;;
*/infection.json.dist)
foundFile;;
*/infection.json)
foundFile;;
*/infection.json5.dist)
foundFile;;
*/infection.json5)
foundFile;;
*/makefile)
foundFile;;
*/.phpunit.result.cache)
foundFile;;
*/phpstan.neon)
foundFile;;
*/phpstan.neon.dist)
foundFile;;
*/phpstan-baseline.neon)
foundFile;;
*/phpmd.xml.dist)
foundFile;;
*/.travis.php.ini)
foundFile;;
*/vendor/*/tests/*)
foundFile;;
*/vendor/*/Tests/*)
foundFile;;
*/vendor/*/test/*)
foundFile;;
*/twig/twig/lib/Twig/Node/Expression/Test/*)
;;
*/twig/twig/lib/Twig/Test/*)
;;
*twig/twig/src/Node/Expression/Test/*)
;;
*/vendor/*/Test/*)
foundFile;;
*/.dependabot/*)
foundFile;;
*/.github/*)
foundFile;;
*/.circleci/*)
foundFile;;
*/vendor/examples/*)
foundFile;;
*/.git/*)
foundFile;;
*vendor/*.rst)
foundFile;;
*vendor/*.po)
foundFile;;
*vendor/*.pot)
foundFile;;
*vendor/*.m4)
foundFile;;
*vendor/*.c)
foundFile;;
*vendor/*.h)
foundFile;;
*vendor/*.sh)
foundFile;;
*vendor/*.w32)
foundFile;;
*.hhconfig)
foundFile;;
*.hhi)
foundFile;;
*.xsd)
foundFile;;
*.xml)
foundFile;;
*vendor/*CONTRIBUTING.md*)
foundFile;;
*CODE_OF_CONDUCT.md*)
foundFile;;
*PERFORMANCE.md*)
foundFile;;
*phar*)
foundFile;;
*) ;;
esac
done
if [ ${found} -gt 0 ]; then
echo 'Some new files to be excluded were found.'
echo 'Please update create-release.sh'
exit 1
else
echo 'Everything looks okay'
exit 0
fi

View File

@ -1,755 +0,0 @@
#!/bin/sh
#
# vim: expandtab sw=4 ts=4 sts=4:
#
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
# More documentation about making a release is available at:
# https://wiki.phpmyadmin.net/pma/Releasing
# Fail on undefined variables
set -u
# Fail on failure
set -e
KITS="all-languages english source"
COMPRESSIONS="zip-7z txz tgz"
# The version series this script is allowed to handle
VERSION_SERIES="6.0"
# Process parameters
version=""
branch=""
do_tag=0
do_stable=0
do_test=0
do_ci=0
do_sign=1
do_pull=0
do_daily=0
do_revision=0
while [ $# -gt 0 ] ; do
case "$1" in
--tag)
do_tag=1
;;
--stable)
do_stable=1
;;
--test)
do_test=1
;;
--revision-info)
do_revision=1
;;
--daily)
do_sign=0
do_pull=1
do_daily=1
do_test=1
;;
--ci)
do_test=1
do_ci=1
if [ -z "$branch" ] ; then
git branch ci
branch="ci"
fi
;;
--no-sign)
do_sign=0
;;
--kits)
KITS="$2"
# Skip one position, the value
shift
;;
--compressions)
COMPRESSIONS="$2"
# Skip one position, the value
shift
;;
--help)
echo "Usages:"
echo " create-release.sh <version> <from_branch> [--tag] [--stable] [--test] [--ci] [--daily] [--revision-info] [--compressions] [--kits] [--no-sign]"
echo ""
echo "If --tag is specified, release tag is automatically created (use this for all releases including pre-releases)"
echo "If --stable is specified, the STABLE branch is updated with this release"
echo "If --test is specified, the testsuite is executed before creating the release"
echo "If --ci is specified, the testsuite is executed and no actual release is created"
echo "If --no-sign is specified, the output files will not be signed"
echo "If --daily is specified, the output files will have snapshot information"
echo "If --revision-info is specified, the output files will contain git revision info"
echo "If --compressions is specified, it changes the compressions available. Space separated values. Valid values: $COMPRESSIONS"
echo "If --kits is specified, it changes the kits to be built. Space separated values. Valid values: $KITS"
echo ""
echo "Examples:"
echo " create-release.sh 5.2.2-dev QA_5_2"
echo " create-release.sh 5.2.2 QA_5_2 --tag --stable"
exit 65
;;
*)
do_test=1
if [ -z "$version" ] ; then
version=$(echo "$1" | tr -d -c '0-9a-z.+-')
if [ "x$version" != "x$1" ] ; then
echo "Invalid version: $1"
exit 1
fi
elif [ -z "$branch" ] ; then
branch=$(echo "$1" | tr -d -c '/0-9A-Za-z_-')
if [ "x$branch" != "x$1" ] ; then
echo "Invalid branch: $1"
exit 1
fi
else
echo "Unknown parameter: $1!"
echo "Use --help to check the syntax."
exit 1
fi
esac
shift
done
if [ -z "$version" ] && [ $do_ci -eq 0 ]; then
echo "Version must be specified!"
exit 1
fi
if [ -z "$branch" ]; then
echo "Branch must be specified!"
exit 1
fi
kit_prefix="phpMyAdmin-$version"
# Checks whether remote branch has local tracking branch
ensure_local_branch() {
if ! git branch | grep -q '^..'"$1"'$' ; then
git branch --track "$1" origin/"$1"
fi
}
# Marks current head of given branch as head of other branch
# Used for STABLE tracking
mark_as_release() {
branch=$1
rel_branch=$2
echo "* Marking release as $rel_branch"
ensure_local_branch "$rel_branch"
git checkout "$rel_branch"
git merge -s recursive -X theirs "$branch"
git checkout master
}
cleanup_composer_vendors() {
echo "* Cleanup of composer packages"
rm -r \
vendor/phpmyadmin/sql-parser/tests/ \
vendor/phpmyadmin/sql-parser/src/Tools/ \
vendor/phpmyadmin/sql-parser/locale/sqlparser.pot \
vendor/phpmyadmin/sql-parser/locale/*/LC_MESSAGES/sqlparser.po \
vendor/phpmyadmin/sql-parser/bin/ \
vendor/phpmyadmin/sql-parser/phpunit.xml.dist \
vendor/phpmyadmin/motranslator/phpunit.xml.dist \
vendor/phpmyadmin/motranslator/psalm-baseline.xml \
vendor/phpmyadmin/motranslator/psalm.xml \
vendor/phpmyadmin/motranslator/tests/ \
vendor/phpmyadmin/shapefile/phpunit.xml.dist \
vendor/phpmyadmin/shapefile/tests/ \
vendor/phpmyadmin/shapefile/examples/ \
vendor/phpmyadmin/shapefile/data/ \
vendor/symfony/service-contracts/Test/ \
vendor/symfony/expression-language/Resources/ \
vendor/symfony/dependency-injection/Loader/schema/services.schema.json \
vendor/symfony/dependency-injection/Loader/schema/dic/services/services-1.0.xsd \
vendor/tecnickcom/tcpdf/tools/ \
vendor/tecnickcom/tcpdf/fonts/ae_fonts_*/ \
vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.*/ \
vendor/tecnickcom/tcpdf/fonts/freefont-*/ \
vendor/tecnickcom/tcpdf/include/sRGB.icc \
vendor/williamdes/mariadb-mysql-kbs/schemas/ \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-raw.json \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-raw.md \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-slim.json \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-ultraslim.php \
vendor/google/recaptcha/app.yaml \
vendor/laminas/laminas-httphandlerrunner/.laminas-ci.json \
vendor/nikic/fast-route/.travis.yml \
vendor/nikic/fast-route/.hhconfig \
vendor/nikic/fast-route/FastRoute.hhi \
vendor/nikic/fast-route/phpunit.xml \
vendor/nikic/fast-route/psalm.xml \
vendor/nikic/fast-route/test/ \
vendor/twig/twig/README.rst \
vendor/webmozart/assert/.php-cs-fixer.php \
vendor/twig/twig/src/Test/ \
vendor/psr/event-dispatcher/.editorconfig \
vendor/psr/http-message/docs/ \
vendor/pragmarx/google2fa/.github/ \
vendor/pragmarx/google2fa-qrcode/.scrutinizer.yml \
vendor/pragmarx/google2fa-qrcode/.travis.yml \
vendor/pragmarx/google2fa-qrcode/phpunit.xml \
vendor/pragmarx/google2fa-qrcode/tests \
vendor/slim/psr7/phpunit.xml.dist \
vendor/slim/psr7/tests/
rm \
vendor/phpmyadmin/motranslator/CODE_OF_CONDUCT.md \
vendor/phpmyadmin/motranslator/CONTRIBUTING.md \
vendor/phpmyadmin/motranslator/PERFORMANCE.md \
vendor/phpmyadmin/shapefile/CONTRIBUTING.md \
vendor/spomky-labs/cbor-php/CODE_OF_CONDUCT.md \
vendor/spomky-labs/cbor-php/RELEASES.md \
vendor/spomky-labs/cbor-php/SECURITY.md \
vendor/spomky-labs/pki-framework/SECURITY.md \
vendor/web-auth/cose-lib/CODE_OF_CONDUCT.md \
vendor/web-auth/cose-lib/RELEASES.md \
vendor/web-auth/cose-lib/SECURITY.md
find vendor/tecnickcom/tcpdf/fonts/ -maxdepth 1 -type f \
-not -name 'dejavusans.*' \
-not -name 'dejavusansb.*' \
-not -name 'helvetica.php' \
-print0 | xargs -0 rm
}
backup_vendor_folder() {
TEMP_FOLDER="$(mktemp -d /tmp/phpMyAdmin.XXXXXXXXX)"
cp -rp ./vendor "${TEMP_FOLDER}"
}
restore_vendor_folder() {
if [ ! -d "${TEMP_FOLDER}" ]; then
echo 'No backup to restore'
exit 1;
fi
rm -r ./vendor
mv "${TEMP_FOLDER}/vendor" ./vendor
rmdir "${TEMP_FOLDER}"
}
get_composer_package_version() {
awk '/require-dev/ {printline = 1; print; next } printline' composer.json | grep "$1" | awk -F [\"] '{print $4}'
}
create_phpunit_sandbox() {
PHPUNIT_VERSION="$(get_composer_package_version 'phpunit/phpunit')"
TEMP_PHPUNIT_FOLDER="$(mktemp -d /tmp/phpMyAdmin-phpunit.XXXXXXXXX)"
cd "${TEMP_PHPUNIT_FOLDER}"
composer require --no-interaction --dev "phpunit/phpunit:${PHPUNIT_VERSION}"
cd -
}
delete_phpunit_sandbox() {
if [ ! -d "${TEMP_PHPUNIT_FOLDER}" ]; then
echo 'No phpunit sandbox to delete'
exit 1;
fi
rm -r "${TEMP_PHPUNIT_FOLDER}"
}
security_checkup() {
if [ ! -f vendor/tecnickcom/tcpdf/tcpdf.php ]; then
echo 'TCPDF should be installed, detection failed !'
exit 1;
fi
if [ ! -f vendor/web-auth/webauthn-lib/src/PublicKeyCredential.php ]; then
echo 'Webauthn-lib should be installed, detection failed !'
exit 1;
fi
if [ ! -f vendor/code-lts/u2f-php-server/src/U2FServer.php ]; then
echo 'U2F-server should be installed, detection failed !'
exit 1;
fi
if [ ! -f vendor/pragmarx/google2fa-qrcode/src/Google2FA.php ]; then
echo 'Google 2FA should be installed, detection failed !'
exit 1;
fi
}
autoload_checkup() {
php <<'CODE'
<?php
$classMapFiles = require __DIR__ . '/vendor/composer/autoload_classmap.php';
$foundFiles = 0;
$notFoundFiles = 0;
foreach ($classMapFiles as $classMapFile) {
if (! file_exists($classMapFile)) {
echo 'Does not exist: ' . $classMapFile . PHP_EOL;
$notFoundFiles++;
continue;
}
$foundFiles++;
}
echo '[autoload class map checkup] Found files: ' . $foundFiles . PHP_EOL;
echo '[autoload class map checkup] NOT found files: ' . $notFoundFiles . PHP_EOL;
$minFilesToHave = 1100;// An arbitrary value based on how many files the autoload has on average
if ($foundFiles < $minFilesToHave) {
echo '[autoload class map checkup] The project expects at least ' . $minFilesToHave . ' in the autoload class map' . PHP_EOL;
exit(1);
}
if ($notFoundFiles > 0) {
echo '[autoload class map checkup] There is some missing files documented in the class map' . PHP_EOL;
exit(1);
}
echo '[autoload class map checkup] The autoload class map seems okay' . PHP_EOL;
CODE
}
# Ensure we have tracking branch
ensure_local_branch "$branch"
VERSION_FILE=src/Version.php
# Keep in sync with update-po script
fetchReleaseFromFile() {
SUFFIX="${1:-}"
php -r "define('VERSION_SUFFIX', '$SUFFIX'); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::VERSION;"
}
fetchVersionSeriesFromFile() {
php -r "define('VERSION_SUFFIX', ''); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::SERIES;"
}
VERSION_FROM_FILE="$(fetchReleaseFromFile)"
VERSION_SERIES_FROM_FILE="$(fetchVersionSeriesFromFile)"
if [ $do_ci -eq 1 ]; then
VERSION_FROM_FILE="$(fetchReleaseFromFile '+ci')"
version="${VERSION_FROM_FILE}"
fi
if [ "${VERSION_SERIES_FROM_FILE}" != "${VERSION_SERIES}" ]; then
echo "This script can not handle ${VERSION_SERIES_FROM_FILE} version series."
echo "Only ${VERSION_SERIES} version series are allowed, please use your target branch directly or another branch."
echo "By changing branches you will have a release script that was designed for your version series."
exit 1;
fi
echo "The actual configured release is: $VERSION_FROM_FILE"
echo "The actual configured release series is: $VERSION_SERIES_FROM_FILE"
if [ $do_ci -eq 0 ] && [ $do_daily -eq 0 ] ; then
cat <<END
Please ensure you have incremented rc count or version in the repository :
- run ./bin/console set-version $version
- in $VERSION_FILE Version class:
- check that VERSION, MAJOR, MINOR and PATCH are correct.
- in docs/conf.py the line
" version = '$version' "
- in README the "Version" line
- in package.json the line
" "version": "$version", "
- set release date in ChangeLog
Continue (y/n)?
END
read -r do_release
if [ "$do_release" != 'y' ]; then
exit 100
fi
echo "The actual configured release is now: $(fetchReleaseFromFile)"
fi
# Create working copy
mkdir -p release
git worktree prune
workdir_name=phpMyAdmin-$version
workdir=release/$workdir_name
if [ -d "$workdir" ] ; then
echo "Working directory '$workdir' already exists, please move it out of the way"
exit 1
fi
# Add worktree with chosen branch
git worktree add --force "$workdir" "$branch"
cd "$workdir"
if [ $do_pull -eq 1 ] ; then
git pull -q
fi
if [ $do_daily -eq 1 ] ; then
git_head=$(git log -n 1 --format=%H)
git_head_short=$(git log -n 1 --format=%h)
today_date=$(date +'%Y%m%d' -u)
fi
if [ $do_daily -eq 1 ] ; then
echo '* setting the version suffix for the snapshot'
sed -i "s/'versionSuffix' => '.*'/'versionSuffix' => '+$today_date.$git_head_short'/" app/vendor_config.php
php -l app/vendor_config.php
# Fetch it back and refresh $version
VERSION_FROM_FILE="$(fetchReleaseFromFile "+$today_date.$git_head_short")"
version="${VERSION_FROM_FILE}"
echo "The actual configured release is: $VERSION_FROM_FILE"
fi
# Check release version
if [ $do_ci -eq 0 ] && [ -$do_daily -eq 0 ] ; then
if ! grep -q "VERSION = '$version'" $VERSION_FILE ; then
echo "There seems to be wrong version in $VERSION_FILE!"
exit 2
fi
if ! grep -q "version = '$version'" docs/conf.py ; then
echo "There seems to be wrong version in docs/conf.py"
exit 2
fi
if ! grep -q "Version $version\$" README ; then
echo "There seems to be wrong version in README"
exit 2
fi
if ! grep -q "\"version\": \"$version\"," package.json ; then
echo "There seems to be wrong version in package.json"
exit 2
fi
fi
# Save the build date
if [ $do_daily -eq 1 ] ; then
LC_ALL=C date -u > RELEASE-DATE-"$VERSION_SERIES_FROM_FILE"+snapshot
else
LC_ALL=C date -u > RELEASE-DATE-"$version"
fi
# Building documentation
echo "* Running sphinx-build (version: $(sphinx-build --version))"
echo "* Generating documentation"
LC_ALL=C make -C docs html
find docs -name '*.pyc' -print0 | xargs -0 -r rm -f
# Check for gettext support
if [ -d resources/po ] ; then
echo "* Generating mo files"
./bin/generate-mo
if [ -f ./bin/remove-incomplete-mo ] ; then
echo "* Removing incomplete translations"
./bin/remove-incomplete-mo
fi
fi
if [ -f ./bin/line-counts.sh ] ; then
echo "* Generating line counts"
./bin/line-counts.sh
fi
echo "* Removing unneeded files"
# Remove developer information
rm -r .github CODE_OF_CONDUCT.md DCO
# Testsuite setup
rm .scrutinizer.yml .weblate codecov.yml
# Remove Doctum config file
rm tests/doctum-config.php
# Remove readme for github
rm README.rst
if [ -f ./bin/console ]; then
# Update the vendors to have the dev vendors
composer install --no-interaction
# Warm up the routing cache for 5.1+ releases
./bin/console cache:warmup --routing
if [ $do_revision -eq 1 ] ; then
./bin/console write-revision-info
fi
fi
echo "* Writing the version to composer.json (version: $version)"
composer config version "$version"
# Okay, there is no way to tell composer to install
# suggested package. Let's require it and then revert
# composer.json to original state.
cp composer.json composer.json.backup
COMPOSER_VERSION="$(composer --version)"
echo "* Running composer (version: $COMPOSER_VERSION)"
composer install --no-interaction --no-dev
# Parse the required versions from composer.json
PACKAGE_LIST='tecnickcom/tcpdf pragmarx/google2fa-qrcode bacon/bacon-qr-code code-lts/u2f-php-server web-auth/webauthn-lib'
set --
for PACKAGES in $PACKAGE_LIST
do
PKG_VERSION="$(get_composer_package_version "$PACKAGES")"
set -- "$@" "$PACKAGES:$PKG_VERSION"
done
echo "* Installing composer packages '$*'"
# Allows word splitting
# shellcheck disable=SC2086
composer require --no-interaction --update-no-dev "$@"
echo "* Running a security checkup"
security_checkup
echo "* Cleaning up vendor folders"
mv composer.json.backup composer.json
cleanup_composer_vendors
echo "* Re-generating the autoload class map"
# https://getcomposer.org/doc/articles/autoloader-optimization.md#what-does-it-do-
# We removed some files, we also need that composer removes them from autoload class maps
# If the class is in the class map (as explained in the link above) then it is assumed to exist as a file
composer dump-autoload --no-interaction --optimize --dev
echo "* Running an autoload checkup"
autoload_checkup
echo "* Running a security checkup"
security_checkup
if [ -f package.json ] ; then
echo "* Running Yarn"
yarn install --production
fi
# Remove git metadata
rm .git
find . -name .gitignore -print0 | xargs -0 -r rm
find . -name .gitkeep -print0 | xargs -0 -r rm
find . -name .gitattributes -print0 | xargs -0 -r rm
if [ $do_test -eq 1 ] ; then
# Move the folder out and install dev vendors
create_phpunit_sandbox
# Backup the files because the new autoloader will change the composer vendor
backup_vendor_folder
# Generate an autoload for test class files (and include dev namespaces)
composer dump-autoload --dev || php -r "echo 'Requires: composer >= v2.1.2' . PHP_EOL; exit(1);"
"${TEMP_PHPUNIT_FOLDER}/vendor/bin/phpunit" --no-coverage --testsuite unit
test_ret=$?
if [ $do_ci -eq 1 ] ; then
cd ../..
rm -r "$workdir"
git worktree prune
if [ "$branch" = "ci" ] ; then
git branch -D ci
fi
exit $test_ret
fi
if [ $test_ret -ne 0 ] ; then
exit $test_ret
fi
# Remove PHPUnit cache file
rm -f .phpunit.result.cache
# Generate an normal autoload (this is just a security, because normally the vendor folder will be restored)
composer dump-autoload
# Remove libs installed for testing
rm -r build
delete_phpunit_sandbox
restore_vendor_folder
fi
security_checkup
cd ..
SIGN_FILES=""
# Prepare all kits
for kit in $KITS ; do
echo "* Building kit: $kit"
# Copy all files
name=$kit_prefix-$kit
cp -r "$workdir_name" "$name"
# Cleanup translations
cd "$name"
./bin/internal/lang-cleanup.sh "$kit"
# Remove tests, source code,...
if [ "$kit" != source ] ; then
echo "* Removing source files"
# Testsuite
rm -r tests/
# Template test files
rm -r resources/templates/test/
rm phpunit.xml.*
rm .editorconfig .browserslistrc .eslintignore .jshintrc .eslintrc.json .stylelintrc.json psalm.xml psalm-baseline.xml phpstan.neon.dist phpstan-baseline.neon phpcs.xml.dist jest.config.cjs infection.json5.dist .phpstorm.meta.php
# Gettext po files (if they were not removed by ./bin/internal/lang-cleanup.sh)
rm -rf resources/po
# Documentation source code
mv docs/html htmldoc
rm -r docs
mkdir public/docs
mv htmldoc public/docs/html
rm public/docs/html/.buildinfo public/docs/html/objects.inv
rm -r node_modules
# Remove bin files for non source version
# https://github.com/phpmyadmin/phpmyadmin/issues/16033
rm -r vendor/bin
# Remove developer scripts
rm -r bin
fi
# Remove possible tmp folder
rm -rf tmp
cd ..
# Remove tar file possibly left from previous run
rm -f "$name".tar
# Prepare distributions
for comp in $COMPRESSIONS ; do
case $comp in
tbz|tgz|txz)
if [ ! -f "$name".tar ] ; then
echo "* Creating $name.tar"
tar --owner=root --group=root --numeric-owner --sort=name -cf "$name".tar "$name"
fi
if [ "$comp" = txz ] ; then
echo "* Creating $name.tar.xz"
xz -9k "$name".tar
SIGN_FILES="$SIGN_FILES $name.tar.xz"
fi
if [ "$comp" = tgz ] ; then
echo "* Creating $name.tar.gz"
gzip -9c "$name".tar > "$name".tar.gz
SIGN_FILES="$SIGN_FILES $name.tar.gz"
fi
;;
zip-7z)
echo "* Creating $name.zip"
7za a -bd -tzip "$name".zip "$name" > /dev/null
SIGN_FILES="$SIGN_FILES $name.zip"
;;
*)
echo "WARNING: ignoring compression '$comp', not known!"
;;
esac
done
# Cleanup
rm -f "$name".tar
# Remove directory with current dist set
rm -r "$name"
done
# Cleanup
rm -r "$workdir_name"
git worktree prune
# Signing of files with default GPG key
if [ $do_sign -eq 1 ] ; then
echo "* Signing and making .sha{1,256} files"
else
echo "* Making .sha{1,256} files"
fi
for file in $SIGN_FILES; do
if [ $do_sign -eq 1 ] ; then
gpg --detach-sign --armor "$file"
fi
sha1sum "$file" > "$file".sha1
sha256sum "$file" > "$file".sha256
done
if [ $do_daily -eq 1 ] ; then
cat > "$kit_prefix".json << EOT
{
"date": "$(date --iso-8601=seconds)",
"commit": "$git_head"
}
EOT
exit 0
fi
echo ""
echo ""
echo ""
echo "Files:"
echo "------"
ls -la $SIGN_FILES
cd ..
# Tag as release
if [ $do_tag -eq 1 ] ; then
echo
echo "Additional tasks:"
tagname=RELEASE_$(echo "$version" | tr . _ | tr '[:lower:]' '[:upper:]' | tr -d -)
echo "* Tagging release as $tagname"
git tag -s -a -m "Released $version" "$tagname" "$branch"
echo " Dont forget to push tags using: git push --tags"
fi
# Mark as stable release
if [ $do_stable -eq 1 ] ; then
mark_as_release "$branch" STABLE
fi
cat <<END
Todo now:
---------
1. Push the new tag upstream, with a command like git push origin --tags
2. Push the new STABLE branch upstream
3. prepare a release/phpMyAdmin-$version-notes.html explaining in short the goal of
this release and paste into it the ChangeLog for this release, followed
by the notes of all previous incremental versions (i.e. 4.4.9 through 4.4.0)
4. upload the files to our file server, use bin/internal/upload-release, eg.:
./bin/internal/upload-release $version release
5. add a news item to our website; a good idea is to include a link to the release notes such as https://www.phpmyadmin.net/files/4.4.10/
6. send a short mail (with list of major changes) to
developers@phpmyadmin.net
news@phpmyadmin.net
Don't forget to update the Description section in the announcement,
based on documentation.
7. increment rc count or version in the repository :
- run ./bin/console set-version $version
- in $VERSION_FILE Version class:
- check that VERSION, MAJOR, MINOR and PATCH are correct.
- in README the "Version" line
" Version 2.7.1-dev "
- in package.json the line
" "version": " 2.7.1-dev", "
- in docs/conf.py (if it exists) the line
" version = '2.7.1-dev' "
8. on https://github.com/phpmyadmin/phpmyadmin/milestones close the milestone corresponding to the released version (if this is a stable release) and open a new one for the next minor release
9. for a major release, update demo/php/versions.ini in the scripts repository so that the demo server shows current versions
10. in case of a new major release ('y' in x.y.0), update the pmaweb/settings.py in website repository to include the new major releases
11. update the Dockerfile in the docker repository to reflect the new version and create a new annotated tag (such as with git tag -s -a 4.7.9-1 -m "Version 4.7.9-1"). Remember to push the tag with git push origin {tagName}
END

View File

@ -1,52 +0,0 @@
#!/bin/sh
#
# vim: expandtab sw=4 ts=4 sts=4:
#
# Script for removing language selection from phpMyAdmin
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
if [ $# -lt 1 ] ; then
echo "Usage: lang-cleanup.sh type"
echo "Type can be one of:"
echo " all-languages - nothing will be done"
echo " source - nothing will be done"
echo " english - no translations will be kept"
echo " langcode - keeps language"
echo
echo "Languages can be specified multiple times"
exit 1
fi
# Expression for find
match=""
for type in "$@" ; do
case $type in
all-languages|source)
exit 0
;;
english)
rm -rf resources/po
rm -rf resources/locale
rm -rf vendor/phpmyadmin/sql-parser/locale
exit 0
;;
*)
match="$match -and -not -name $type.po -and -not -path resources/locale/$type/LC_MESSAGES/phpmyadmin.mo -and -not -path vendor/phpmyadmin/sql-parser/locale/$type/LC_MESSAGES/sqlparser.mo"
;;
esac
done
# Delete unwanted languages
# shellcheck disable=SC2086
find resources/po resources/locale vendor/phpmyadmin/sql-parser/locale -type f $match -print0 | xargs -0r rm
# Delete empty directories
rmdir --ignore-fail-on-non-empty resources/locale/*/*
rmdir --ignore-fail-on-non-empty resources/locale/*
rmdir --ignore-fail-on-non-empty vendor/phpmyadmin/sql-parser/locale/*/*
rmdir --ignore-fail-on-non-empty vendor/phpmyadmin/sql-parser/locale/*

View File

@ -1,11 +0,0 @@
#!/bin/sh
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
for x in resources/po/*.po ; do
grep 'Team' "$x" | sed 's/.*: \(.*\)<.*/\1/'
git shortlog -sne --no-merges -- "$x" | grep '^ [ 0-9][0-9]\{3\}'
done

View File

@ -1,76 +0,0 @@
#!/bin/bash
#
# vim: expandtab sw=4 ts=4 sts=4:
#
# This requires Bash for the search and replace substitution to escape dots
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
# Fail on undefined variables
set -u
# Fail on failure
set -e
printHelp () {
echo
echo "Please pass the new version number as a command line argument such as"
echo "$0 -v 5.0.0-dev"
echo
}
if [ $# -eq 0 ]
then
printHelp
exit 1
fi
if [ "$1" = '-v' ]
then
newVersion=$2
else
printHelp
exit 2
fi
# If we're in the scripts directory, we need to do all our work up a directory level
if [ "$(basename "$(pwd)")" = 'bin' ]
then
dir='../'
else
dir=''
fi
# There are half a dozen ways to do this, including individually recreating the line of
# each file (search for 'version =' in conf.py and replace it with 'version = 5.0.0-dev'
# for instance), and while that's more precise this should work with less to fix if a line changes.
# This method wasn't selected for any particular strength.
oldVersion="$(grep 'version =' "${dir}"docs/conf.py | cut -d "'" -f2)"
echo "Changing from ${oldVersion} to ${newVersion}..."
# Escape the dot for sed
oldVersion=${oldVersion//./\.}
newVersion=${newVersion//./\.}
for f in README docs/conf.py package.json
do
if ! grep --quiet "${oldVersion}" "${dir}${f}"
then
# There may be a better way to test for a failure of the substitution itself, such as using the 'q' directive with sed
# See https://stackoverflow.com/questions/15965073/return-code-of-sed-for-no-match
echo "FAILED! Substitution string ${oldVersion} not found in ${dir}${f}"
fi
sed -i "s/${oldVersion}/${newVersion}/g" "${dir}${f}"
done
echo
echo "- Next, you need to manually edit ChangeLog to manually change the version number and set the release date, and verify the changes with 'git diff'."
echo "- You will probably want to call: \"./bin/console set-version ${newVersion}\" afterwards"
echo "- You should check if you need to change the composer.json file and the theme.json file for each bundled theme."
echo " To change the composer.json file you can call something like: \"composer config extra.branch-alias.dev-master \"5.2.x-dev\"\""
echo "- Suggested commit message: Prepare for version ${newVersion}"

View File

@ -1,30 +0,0 @@
#!/usr/bin/env php
<?php
/* vim: set expandtab sw=4 ts=4 sts=4 ft=php: */
declare(strict_types=1);
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}
$tmpDir = ROOT_PATH . 'twig-templates';
/* Read replacements file */
$replacements = json_decode(file_get_contents($tmpDir . '/replace.json'), true);
/* Read files list */
$filesList = file_get_contents($tmpDir . '/filesList');
$options = getopt('', ['reverse::']);
foreach ($replacements as $templateName => $data) {
if (isset($options['reverse'])) {
$filesList = str_replace($data[0], $templateName, $filesList);
} else {
$filesList = str_replace($templateName, $data[0], $filesList);
}
}
/* Write back files list */
file_put_contents($tmpDir . '/filesList', $filesList);

View File

@ -1,75 +0,0 @@
#!/bin/sh
#
# Removes mo files for incomplete translations
#
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
set -e
#
# How many percent needs to be translated
#
THRESHOLD=40
#
# Generated output file
#
TMPOUTPUTFILE=app/language_stats.inc.php.tmp
OUTPUTFILE=app/language_stats.inc.php
if [ -n "$1" ] ; then
THRESHOLD=$1
fi
{
echo '<?php'
echo '/**'
echo ' * Automatically generated file, do not edit!'
echo ' * Generated by bin/remove-incomplete-mo'
echo ' */'
echo ''
echo "return ["
} > $TMPOUTPUTFILE
check() {
TMPOUTPUTFILE=$2
lang=$(echo "$1" | sed 's@resources/po/\(.*\)\.po@\1@')
STATS=$(LC_ALL=C msgfmt --statistics -o /dev/null "$1" 2>&1)
if echo "$STATS" | grep -q ' translated ' ; then
TRANSLATED=$(echo "$STATS" | sed 's/\(^\|.* \)\([0-9]*\) translated.*/\2/')
else
TRANSLATED=0
fi
if echo "$STATS" | grep -q ' fuzzy ' ; then
FUZZY=$(echo "$STATS" | sed 's/\(^\|.* \)\([0-9]*\) fuzzy.*/\2/')
else
FUZZY=0
fi
if echo "$STATS" | grep -q ' untranslated ' ; then
UNTRANSLATED=$(echo "$STATS" | sed 's/\(^\|.* \)\([0-9]*\) untranslated.*/\2/')
else
UNTRANSLATED=0
fi
PERCENT=$((100 * TRANSLATED / ( TRANSLATED + FUZZY + UNTRANSLATED )))
echo " '$lang' => $PERCENT," >> "$TMPOUTPUTFILE"
if [ "$PERCENT" -lt "$THRESHOLD" ] ; then
echo "Removing $lang, only $PERCENT%"
rm -f resources/locale/"$lang"/LC_MESSAGES/phpmyadmin.mo
rmdir resources/locale/"$lang"/LC_MESSAGES
rmdir resources/locale/"$lang"
fi
}
for x in resources/po/*.po ; do
check "$x" "$TMPOUTPUTFILE"
done
echo '];' >> "$TMPOUTPUTFILE"
mv "$TMPOUTPUTFILE" $OUTPUTFILE

View File

@ -1,63 +0,0 @@
#!/bin/bash
#
# Shell script that creates a new transformation plug-in (both main and
# abstract class) using a template.
#
# The 'description' parameter will add a new entry in the language file.
# Watch out for special escaping.
#
# $1: MIMEType
# $2: MIMESubtype
# $3: Transformation Name
# $4: (optional) Description
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
if [ $# -ne 3 ] && [ $# -ne 4 ]; then
echo -e "Usage: ./generator_plugin.sh MIMEType MIMESubtype TransformationName [Description]\n"
exit 65
fi
# make sure that the MIME Type, MIME Subtype and Transformation names
# are in the correct format
# make all names lowercase
MT="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
MS="$(echo "$2" | tr '[:upper:]' '[:lower:]')"
TN="$(echo "$3" | tr '[:upper:]' '[:lower:]')"
# make first letter uppercase
MT="${MT^}"
MS="${MS^}"
TN="${TN^}"
# make the first letter after each underscore uppercase
# define the name of the main class file and of its template
CLASS_NAME=$(echo "$MT"_"$MS"_"$TN" | sed -e 's/_./\U&\E/g')
BASE_DIR="./src/Plugins/Transformations"
ClassFile="$BASE_DIR"/"$CLASS_NAME".php
Template="$BASE_DIR"/TEMPLATE
# define the name of the abstract class file and its template
AbstractClassFile="$BASE_DIR"/Abs/"$TN"TransformationsPlugin.php
AbstractTemplate="$BASE_DIR"/TEMPLATE_ABSTRACT
# replace template names with argument names
sed "s/\[MIMEType]/$MT/; s/\[MIMESubtype\]/$MS/; s/\[TransformationName\]/$TN/;" < $Template > "$ClassFile"
echo "Created $ClassFile"
GenerateAbstractClass=1
if [ -n "$4" ]; then
if [ "$4" == "--generate_only_main_class" ]; then
if [ -e "$AbstractClassFile" ]; then
GenerateAbstractClass=0
fi
fi
fi
if [ $GenerateAbstractClass -eq 1 ]; then
# replace template names with argument names
sed "s/\[TransformationName\]/$TN/; s/Description of the transformation./$4/;" < $AbstractTemplate > "$AbstractClassFile"
echo "Created $AbstractClassFile"
fi

View File

@ -1,79 +0,0 @@
#!/bin/sh
# vim: expandtab sw=4 ts=4 sts=4:
export LC_ALL=C
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
# Exit on failure
set -e
# Generate Twig template cache in clean dir
rm -rf twig-templates/
php bin/console cache:warmup --twig-po --env development
# Update pot (template), ensure that advisor is at the end
LOCS=$(find resources/po -name '*.po' | sed 's@.*/\(.*\)\.po@\1@')
find . -name '*.php' -not -path './tests/*' -not -path './resources/po/*' -not -path './tmp/*' -not -path './release/*' -not -path './node_modules/*' -not -path './vendor/*' > twig-templates/filesList
php ./bin/match-twig-cache
sort --dictionary-order --ignore-case --output ./twig-templates/filesListTemp < ./twig-templates/filesList
mv ./twig-templates/filesListTemp ./twig-templates/filesList
php ./bin/match-twig-cache --reverse
# Allows word splitting for files list.
# shellcheck disable=SC2046
xgettext \
-d phpmyadmin \
--msgid-bugs-address=translators@phpmyadmin.net \
-o resources/po/phpmyadmin.pot \
--language=PHP \
--add-comments=l10n \
--add-location \
--debug \
--from-code=utf-8 \
--keyword=__ --keyword=_gettext --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
--copyright-holder="phpMyAdmin devel team" \
$(cat ./twig-templates/filesList)
# Fixup filenames for Twig templates
php bin/console fix-po-twig
# Remote twig templates
rm -rf twig-templates/
# Keep in sync with create-release.sh
fetchReleaseFromFile() {
php -r "define('VERSION_SUFFIX', ''); require_once('src/Version.php'); echo \PhpMyAdmin\Version::VERSION;"
}
ver="$(fetchReleaseFromFile)"
sed -i.~ '
s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
s/PACKAGE/phpMyAdmin/;
s/(C) YEAR/(C) 2003 - '"$(date +%Y)"'/;
s/VERSION/'"$ver"'/;
' resources/po/phpmyadmin.pot
# Update po files (translations)
for loc in $LOCS ; do
sed -i.~ '
s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
s/PACKAGE/phpMyAdmin/;
s/(C) YEAR/(C) 2003 - '"$(date +%Y)"'/;
s/VERSION/'"$ver"'/;
s/Project-Id-Version: phpMyAdmin .*/Project-Id-Version: phpMyAdmin '"$ver"'\\n"/;
' resources/po/"$loc".po
msgmerge --previous -U resources/po/"$loc".po resources/po/phpmyadmin.pot
done
# Commit changes
git add resources/po/*.po resources/po/phpmyadmin.pot
git commit -s -m 'Update po files
[ci skip]'

77
browse_foreigners.php Normal file
View File

@ -0,0 +1,77 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* display selection for relational field values
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\BrowseForeigners;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
require_once 'libraries/common.inc.php';
/**
* Sets globals from $_REQUEST
*/
$request_params = [
'data',
'field'
];
foreach ($request_params as $one_request_param) {
if (isset($_REQUEST[$one_request_param])) {
$GLOBALS[$one_request_param] = $_REQUEST[$one_request_param];
}
}
Util::checkParameters(['db', 'table', 'field']);
$response = Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenuAndConsole();
$header->setBodyId('body_browse_foreigners');
$relation = new Relation();
/**
* Displays the frame
*/
$foreigners = $relation->getForeigners($db, $table);
$browseForeigners = new BrowseForeigners(
$GLOBALS['cfg']['LimitChars'],
$GLOBALS['cfg']['MaxRows'],
$GLOBALS['cfg']['RepeatCells'],
$GLOBALS['cfg']['ShowAll'],
$GLOBALS['pmaThemeImage']
);
$foreign_limit = $browseForeigners->getForeignLimit(
isset($_REQUEST['foreign_showAll']) ? $_REQUEST['foreign_showAll'] : null
);
$foreignData = $relation->getForeignData(
$foreigners,
$_REQUEST['field'],
true,
isset($_REQUEST['foreign_filter'])
? $_REQUEST['foreign_filter']
: '',
isset($foreign_limit) ? $foreign_limit : null,
true // for getting value in $foreignData['the_total']
);
// HTML output
$html = $browseForeigners->getHtmlForRelationalFieldSelection(
$db,
$table,
$_REQUEST['field'],
$foreignData,
isset($fieldkey) ? $fieldkey : '',
isset($data) ? $data : ''
);
$response->addHtml($html);

161
build.xml Normal file
View File

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="phpMyAdmin" default="build" basedir=".">
<property name="source" value="."/>
<property name="source_comma_sep" value="."/>
<property environment="env"/>
<property name="env.PHPUNIT_XML" value="phpunit.xml.dist"/>
<property name="env.PHPUNIT_XML_NOCOVERAGE" value="phpunit.xml.nocoverage"/>
<property name="env.PHPUNIT_XML_HHVM" value="phpunit.xml.hhvm"/>
<property name="env.PHPUNIT_ARGS" value="--exclude-group selenium"/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration ${env.PHPUNIT_XML} ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration ${env.PHPUNIT_XML_NOCOVERAGE} ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="phpunit-hhvm" description="Run unit tests using PHPUnit with HHVM specific config">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration ${env.PHPUNIT_XML_HHVM} ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<exec executable="pdepend">
<arg line="'--jdepend-xml=${basedir}/build/logs/jdepend.xml'
'--jdepend-chart=${basedir}/build/pdepend/dependencies.svg'
'--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg'
${source_comma_sep}" />
</exec>
</target>
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<exec executable="phpmd">
<arg line="${source_comma_sep}
xml
codesize,design,naming,unusedcode
--exclude test,build,vendor,tmp
--reportfile '${basedir}/build/logs/pmd.xml'" />
</exec>
</target>
<target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
<exec executable="phpcpd">
<arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml'
--exclude test
--exclude tmp
--exclude build
--exclude vendor
${source}" />
</exec>
</target>
<target name="phploc" description="Generate phploc.csv">
<exec executable="phploc">
<arg line="--log-csv '${basedir}/build/logs/phploc.csv'
--exclude test
--exclude build
--exclude vendor
--exclude tmp
${source}" />
</exec>
</target>
<target name="phpcs-config" description="PHPCS configuration tweaking">
<exec executable="${basedir}/vendor/bin/phpcs">
<arg line="--config-set installed_paths ${basedir}/vendor/phpmyadmin/coding-standard" />
</exec>
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding third party libraries" depends="phpcs-config">
<exec executable="${basedir}/vendor/bin/phpcs">
<arg line="
--ignore=*/vendor/*,*/build/*,*/tmp/*
--report=checkstyle
--extensions=php
--report-file='${basedir}/build/logs/checkstyle.xml'
--standard=PMAStandard
${source}" />
</exec>
</target>
<target name="phpdoc" description="Generate API documentation using PHPDocumentor">
<exec executable="phpdoc">
<arg line="-d ${source} -t '${basedir}/build/api'" />
</exec>
</target>
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg line="--log '${basedir}/build/logs'
--source '${source}'
--output '${basedir}/build/code-browser'" />
</exec>
</target>
<target name="jshint" description="Javascript checks">
<apply executable="jshint" output="${basedir}/build/logs/jshint-jslint.xml" parallel="true">
<arg line="--config ./.jshintrc --reporter=jslint" />
<fileset dir="${basedir}">
<include name="js/designer/*.js" />
<include name="js/*.js" />
<include name="setup/*.js" />
</fileset>
</apply>
</target>
<target name="jshint-checkstyle" description="Javascript checks">
<apply executable="jshint" output="${basedir}/build/logs/jshint-checkstyle.xml" parallel="true">
<arg line="--config ./.jshintrc --reporter=checkstyle" />
<fileset dir="${basedir}">
<include name="js/designer/*.js" />
<include name="js/*.js" />
<include name="setup/*.js" />
</fileset>
</apply>
</target>
<target name="locales" description="Generate locales">
<exec executable="./scripts/generate-mo" failonerror="true">
<arg line="--quiet" />
</exec>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}">
<include name="libraries/**/*.php" />
<include name="templates/**/*.phtml" />
<include name="setup/**/*.php" />
<include name="test/**/*.php" />
<include name="*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint,locales"/>
</project>

118
changelog.php Normal file
View File

@ -0,0 +1,118 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Simple script to set correct charset for changelog
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Response;
/**
* Gets core libraries and defines some variables
*/
require 'libraries/common.inc.php';
$response = Response::getInstance();
$response->disable();
$response->getHeader()->sendHttpHeaders();
$filename = CHANGELOG_FILE;
/**
* Read changelog.
*/
// Check if the file is available, some distributions remove these.
if (@is_readable($filename)) {
// Test if the if is in a compressed format
if (substr($filename, -3) == '.gz') {
ob_start();
readgzfile($filename);
$changelog = ob_get_contents();
ob_end_clean();
} else {
$changelog = file_get_contents($filename);
}
} else {
printf(
__(
'The %s file is not available on this system, please visit ' .
'%s for more information.'
),
$filename,
'<a href="https://www.phpmyadmin.net/">phpmyadmin.net</a>'
);
exit;
}
/**
* Whole changelog in variable.
*/
$changelog = htmlspecialchars($changelog);
$github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
$faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html';
$replaces = [
'@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
=> '<a href="url.php?url=\\1">\\1</a>',
// mail address
'/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
=> '\\1 <a href="mailto:\\3">\\2</a>',
// FAQ entries
'/FAQ ([0-9]+)\.([0-9a-z]+)/i'
=> '<a href="url.php?url=' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
// GitHub issues
'/issue\s*#?([0-9]{4,5}) /i'
=> '<a href="url.php?url=' . $github_url . 'issues/\\1">issue #\\1</a> ',
// CVE/CAN entries
'/((CAN|CVE)-[0-9]+-[0-9]+)/'
=> '<a href="url.php?url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
// PMASAentries
'/(PMASA-[0-9]+-[0-9]+)/'
=> '<a href="url.php?url=https://www.phpmyadmin.net/security/\\1/">\\1</a>',
// Highlight releases (with links)
'/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
=> '<a name="\\1_\\2_\\3"></a>'
. '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
. '\\1.\\2.\\3.0 \\4</a>',
'/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
=> '<a name="\\1_\\2_\\3_\\4"></a>'
. '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
. '\\1.\\2.\\3.\\4 \\5</a>',
// Highlight releases (not linkable)
'/( ### )(.*)/'
=> '\\1<b>\\2</b>',
// Links target and rel
'/a href="/' => 'a target="_blank" rel="noopener noreferrer" href="'
];
header('Content-type: text/html; charset=utf-8');
?>
<!DOCTYPE HTML>
<html lang="en" dir="ltr">
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>phpMyAdmin - ChangeLog</title>
<meta charset="utf-8" />
</head>
<body>
<h1>phpMyAdmin - ChangeLog</h1>
<?php
echo '<pre>';
echo preg_replace(array_keys($replaces), $replaces, $changelog);
echo '</pre>';
?>
</body>
</html>

38
chk_rel.php Normal file
View File

@ -0,0 +1,38 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays status of phpMyAdmin configuration storage
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
require_once 'libraries/common.inc.php';
$relation = new Relation();
// If request for creating the pmadb
if (isset($_REQUEST['create_pmadb'])) {
if ($relation->createPmaDatabase()) {
$relation->fixPmaTables('phpmyadmin');
}
}
// If request for creating all PMA tables.
if (isset($_REQUEST['fixall_pmadb'])) {
$relation->fixPmaTables($GLOBALS['db']);
}
$cfgRelation = $relation->getRelationsParam();
// If request for creating missing PMA tables.
if (isset($_REQUEST['fix_pmadb'])) {
$relation->fixPmaTables($cfgRelation['db']);
}
$response = Response::getInstance();
$response->addHTML(
$relation->getRelationsParamDiagnostic($cfgRelation)
);

View File

@ -1,2 +1,3 @@
github_checks:
annotations: false
comment:
layout: header, changes, diff
coverage: {}

View File

@ -1,11 +1,10 @@
{
"name": "phpmyadmin/phpmyadmin",
"type": "project",
"description": "A web interface for MySQL and MariaDB",
"description": "MySQL web administration tool",
"keywords": ["phpmyadmin","mysql","web"],
"homepage": "https://www.phpmyadmin.net/",
"support": {
"security": "https://www.phpmyadmin.net/security/",
"forum": "https://www.phpmyadmin.net/support/",
"issues": "https://github.com/phpmyadmin/phpmyadmin/issues",
"wiki": "https://wiki.phpmyadmin.net/",
@ -23,21 +22,14 @@
"non-feature-branches": ["RELEASE_.*"],
"autoload": {
"psr-4": {
"PhpMyAdmin\\": "src"
},
"exclude-from-classmap": [
"/tests/",
"/vendor/tecnickcom/tcpdf/tcpdf_barcodes_*.php",
"/vendor/tecnickcom/tcpdf/tcpdf_import.php",
"/vendor/tecnickcom/tcpdf/tcpdf_parser.php",
"/vendor/tecnickcom/tcpdf/include/tcpdf_filters.php",
"/vendor/tecnickcom/tcpdf/include/barcodes"
]
"PhpMyAdmin\\": "libraries/classes",
"PhpMyAdmin\\Setup\\": "setup/lib"
}
},
"autoload-dev": {
"psr-4": {
"PhpMyAdmin\\Tests\\": "tests/unit",
"PhpMyAdmin\\Tests\\Selenium\\": "tests/end-to-end/"
"PhpMyAdmin\\Tests\\": "test/classes",
"PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/"
}
},
"repositories": [
@ -47,47 +39,33 @@
}
],
"require": {
"php": "^8.2",
"ext-hash": "*",
"ext-iconv": "*",
"ext-json": "*",
"php": "^7.1",
"ext-mysqli": "*",
"ext-openssl": "*",
"ext-pcre": "*",
"ext-sodium": "*",
"ext-xml": "*",
"composer/ca-bundle": "^1.2",
"fig/http-message-util": "^1.1",
"google/recaptcha": "^1.3",
"laminas/laminas-httphandlerrunner": "^2.6",
"nikic/fast-route": "^1.3",
"phpmyadmin/motranslator": "^6.0",
"phpmyadmin/shapefile": "^4.0",
"phpmyadmin/sql-parser": "^6.0",
"psr/clock": "^1.0",
"psr/container": "^2.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^2",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"slim/psr7": "^1.6.1",
"symfony/config": "^7.1",
"symfony/dependency-injection": "^7.1",
"symfony/expression-language": "^7.1",
"symfony/polyfill-ctype": "^1.24",
"symfony/polyfill-iconv": "^1.33",
"symfony/polyfill-mbstring": "^1.24",
"symfony/polyfill-php84": "^1.33",
"twig/twig": "^3.21",
"webmozart/assert": "^1.10",
"williamdes/mariadb-mysql-kbs": "^1.2"
"ext-pcre": "*",
"ext-json": "*",
"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": "^2.4",
"twig/extensions": "~1.5.1",
"symfony/expression-language": "^3.2",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"bacon/bacon-qr-code": "<2.0",
"pragmarx/google2fa-qrcode": "<2.1",
"tecnickcom/tcpdf": "<6.4.4"
"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",
@ -96,67 +74,25 @@
"ext-gd2": "For image transformations",
"ext-mbstring": "For best performance",
"tecnickcom/tcpdf": "For PDF support",
"pragmarx/google2fa-qrcode": "^2.1 or ^3.0 - For 2FA authentication",
"bacon/bacon-qr-code": "^3.0 - For 2FA authentication",
"code-lts/u2f-php-server": "For FIDO U2F authentication",
"web-auth/webauthn-lib": "For better WebAuthn/FIDO2 authentication support"
"pragmarx/google2fa": "For 2FA authentication",
"bacon/bacon-qr-code": "For 2FA authentication",
"samyoul/u2f-php-server": "For FIDO U2F authentication"
},
"require-dev": {
"bacon/bacon-qr-code": "^3.0",
"code-lts/u2f-php-server": "^1.2",
"guzzlehttp/psr7": "^2.5",
"httpsoft/http-message": "^1.1",
"laminas/laminas-diactoros": "^3.0",
"nyholm/psr7": "^1.8",
"php-webdriver/webdriver": "^1.14",
"phpmyadmin/coding-standard": "^4.0",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^11.5",
"pragmarx/google2fa-qrcode": "^3.0",
"psalm/plugin-phpunit": "^0.19",
"symfony/console": "^7.1",
"tecnickcom/tcpdf": "^6.4.4",
"vimeo/psalm": "^6.0",
"web-auth/webauthn-lib": "^4.9"
"phpunit/phpunit": "^6.5",
"codacy/coverage": "^1.3.0",
"phpunit/phpunit-selenium": "^4.1",
"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",
"phpstan/phpstan": "^0.9.2"
},
"extra": {
"branch-alias": {
"dev-master": "6.0.x-dev"
}
},
"scripts": {
"phpcbf": "@php phpcbf",
"phpcs": "@php phpcs",
"phpstan": "@php phpstan analyse",
"psalm": "@php psalm --no-diff",
"phpunit": "@php phpunit --color=always",
"test": [
"@phpcs",
"@phpstan",
"@psalm",
"@phpunit"
],
"update:baselines": [
"@php phpstan analyse --generate-baseline",
"@php psalm --no-cache --threads=max --set-baseline=psalm-baseline.xml"
],
"twig-lint": "@php bin/console lint:twig --ansi --show-deprecations"
},
"config":{
"sort-packages": true,
"discard-changes": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"composer/package-versions-deprecated": true
},
"platform": {
"php": "8.2.99"
"dev-master": "5.0.x-dev"
}
}
}

8949
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,19 @@
<?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 docs/ folder
* All directives are explained in documentation in the doc/ folder
* or at <https://docs.phpmyadmin.net/>.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
/**
* This is needed for cookie based authentication to encrypt the cookie.
* Needs to be a 32-bytes long string of random bytes. See FAQ 2.10.
* 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! */
@ -108,7 +110,7 @@ $cfg['SaveDir'] = '';
/**
* Default language to use, if not browser-defined or user-defined
* (you find all languages in the 'resources/locale' folder)
* (you find all languages in the locale folder)
* uncomment the desired line:
* default = 'en'
*/
@ -147,14 +149,7 @@ $cfg['SaveDir'] = '';
*/
//$cfg['SendErrorReports'] = 'always';
/**
* 'URLQueryEncryption' defines whether phpMyAdmin will encrypt sensitive data from the URL query string.
* 'URLQueryEncryptionSecretKey' is a 32 bytes long secret key used to encrypt/decrypt the URL query string.
*/
//$cfg['URLQueryEncryption'] = true;
//$cfg['URLQueryEncryptionSecretKey'] = '';
/**
* You can find more configuration options in the documentation
* in the docs/ folder or at <https://docs.phpmyadmin.net/>.
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
*/

148
db_central_columns.php Normal file
View File

@ -0,0 +1,148 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Central Columns view/edit
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\CentralColumns;
use PhpMyAdmin\Core;
use PhpMyAdmin\Message;
use PhpMyAdmin\Response;
use PhpMyAdmin\Url;
/**
* Gets some core libraries
*/
require_once 'libraries/common.inc.php';
$centralColumns = new CentralColumns($GLOBALS['dbi']);
if (isset($_POST['edit_save']) || isset($_POST['add_new_column'])) {
$col_name = $_POST['col_name'];
if (isset($_POST['edit_save'])) {
$orig_col_name = $_POST['orig_col_name'];
}
$col_default = $_POST['col_default'];
if ($col_default == 'NONE' && $_POST['col_default_sel'] != 'USER_DEFINED') {
$col_default = "";
}
$col_extra = isset($_POST['col_extra']) ? $_POST['col_extra'] : '';
$col_isNull = isset($_POST['col_isNull']) ? 1 : 0;
$col_length = $_POST['col_length'];
$col_attribute = $_POST['col_attribute'];
$col_type = $_POST['col_type'];
$collation = $_POST['collation'];
if (isset($orig_col_name) && $orig_col_name) {
echo $centralColumns->updateOneColumn(
$db,
$orig_col_name,
$col_name,
$col_type,
$col_attribute,
$col_length,
$col_isNull,
$collation,
$col_extra,
$col_default
);
exit;
} else {
$tmp_msg = $centralColumns->updateOneColumn(
$db,
"",
$col_name,
$col_type,
$col_attribute,
$col_length,
$col_isNull,
$collation,
$col_extra,
$col_default
);
}
}
if (isset($_POST['populateColumns'])) {
$selected_tbl = $_POST['selectedTable'];
echo $centralColumns->getHtmlForColumnDropdown(
$db,
$selected_tbl
);
exit;
}
if (isset($_POST['getColumnList'])) {
echo $centralColumns->getListRaw(
$db,
$_POST['cur_table']
);
exit;
}
if (isset($_POST['add_column'])) {
$selected_col = [];
$selected_tbl = $_POST['table-select'];
$selected_col[] = $_POST['column-select'];
$tmp_msg = $centralColumns->syncUniqueColumns(
$selected_col,
false,
$selected_tbl
);
}
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('db_central_columns');
$cfgCentralColumns = $centralColumns->getParams();
$pmadb = $cfgCentralColumns['db'];
$pmatable = $cfgCentralColumns['table'];
$max_rows = intval($GLOBALS['cfg']['MaxRows']);
if (isset($_REQUEST['edit_central_columns_page'])) {
$selected_fld = $_REQUEST['selected_fld'];
$selected_db = $_REQUEST['db'];
$edit_central_column_page = $centralColumns->getHtmlForEditingPage(
$selected_fld,
$selected_db
);
$response->addHTML($edit_central_column_page);
exit;
}
if (isset($_POST['multi_edit_central_column_save'])) {
$message = $centralColumns->updateMultipleColumn();
if (!is_bool($message)) {
$response->setRequestStatus(false);
$response->addJSON('message', $message);
}
}
if (isset($_POST['delete_save'])) {
$col_name = [];
parse_str($_POST['col_name'], $col_name);
$tmp_msg = $centralColumns->deleteColumnsFromList(
$col_name['selected_fld'],
false
);
}
if (!empty($_REQUEST['total_rows'])
&& Core::isValid($_REQUEST['total_rows'], 'integer')
) {
$total_rows = $_REQUEST['total_rows'];
} else {
$total_rows = $centralColumns->getCount($db);
}
if (Core::isValid($_REQUEST['pos'], 'integer')) {
$pos = intval($_REQUEST['pos']);
} else {
$pos = 0;
}
$main = $centralColumns->getHtmlForMain($db, $total_rows, $pos, $pmaThemeImage, $text_dir);
$response->addHTML($main);
$num_cols = $centralColumns->getColumnsCount($db, $pos, $max_rows);
$message = Message::success(
sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + $num_cols))
);
if (isset($tmp_msg) && $tmp_msg !== true) {
$message = $tmp_msg;
}

219
db_datadict.php Normal file
View File

@ -0,0 +1,219 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Renders data dictionary
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Transformations;
use PhpMyAdmin\Url;
/**
* Gets the variables sent or posted to this script, then displays headers
*/
require_once 'libraries/common.inc.php';
if (! isset($selected_tbl)) {
include 'libraries/db_common.inc.php';
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 : '');
}
$response = Response::getInstance();
$header = $response->getHeader();
$header->enablePrintView();
$relation = new Relation();
$transformations = new Transformations();
/**
* Gets the relations settings
*/
$cfgRelation = $relation->getRelationsParam();
/**
* Check parameters
*/
PhpMyAdmin\Util::checkParameters(['db']);
/**
* Defines the url to return to in case of error in a sql statement
*/
$err_url = 'db_sql.php' . Url::getCommon(['db' => $db]);
if ($cfgRelation['commwork']) {
$comment = $relation->getDbComment($db);
/**
* Displays DB comment
*/
if ($comment) {
echo '<p>' , __('Database comment')
, '<br /><i>' , htmlspecialchars($comment) , '</i></p>';
} // end if
}
/**
* Selects the database and gets tables names
*/
$GLOBALS['dbi']->selectDb($db);
$tables = $GLOBALS['dbi']->getTables($db);
$count = 0;
foreach ($tables as $table) {
$comments = $relation->getComments($db, $table);
echo '<div>' , "\n";
echo '<h2>' , htmlspecialchars($table) , '</h2>' , "\n";
/**
* Gets table information
*/
$show_comment = $GLOBALS['dbi']->getTable($db, $table)
->getStatusInfo('TABLE_COMMENT');
/**
* Gets table keys and retains them
*/
$GLOBALS['dbi']->selectDb($db);
$indexes = $GLOBALS['dbi']->getTableIndexes($db, $table);
list($primary, $pk_array, $indexes_info, $indexes_data)
= PhpMyAdmin\Util::processIndexData($indexes);
/**
* Gets columns properties
*/
$columns = $GLOBALS['dbi']->getColumns($db, $table);
// Check if we can use Relations
list($res_rel, $have_rel) = $relation->getRelationsAndStatus(
! empty($cfgRelation['relation']),
$db,
$table
);
/**
* Displays the comments of the table if MySQL >= 3.23
*/
if (!empty($show_comment)) {
echo __('Table comments:') , ' ';
echo htmlspecialchars($show_comment) , '<br /><br />';
}
/**
* Displays the table structure
*/
echo '<table width="100%" class="print">';
echo '<tr><th width="50">' , __('Column') , '</th>';
echo '<th width="80">' , __('Type') , '</th>';
echo '<th width="40">' , __('Null') , '</th>';
echo '<th width="70">' , __('Default') , '</th>';
if ($have_rel) {
echo ' <th>' , __('Links to') , '</th>' , "\n";
}
echo ' <th>' , __('Comments') , '</th>' , "\n";
if ($cfgRelation['mimework']) {
echo ' <th>MIME</th>' , "\n";
}
echo '</tr>';
foreach ($columns as $row) {
if ($row['Null'] == '') {
$row['Null'] = 'NO';
}
$extracted_columnspec
= PhpMyAdmin\Util::extractColumnSpec($row['Type']);
// reformat mysql query output
// set or enum types: slashes single quotes inside options
$type = htmlspecialchars($extracted_columnspec['print_type']);
$attribute = $extracted_columnspec['attribute'];
if (! isset($row['Default'])) {
if ($row['Null'] != 'NO') {
$row['Default'] = '<i>NULL</i>';
}
} else {
$row['Default'] = htmlspecialchars($row['Default']);
}
$column_name = $row['Field'];
echo '<tr>';
echo '<td class="nowrap">';
echo htmlspecialchars($column_name);
if (isset($pk_array[$row['Field']])) {
echo ' <em>(' , __('Primary') , ')</em>';
}
echo '</td>';
echo '<td'
, PhpMyAdmin\Util::getClassForType(
$extracted_columnspec['type']
)
, ' lang="en" dir="ltr">' , $type , '</td>';
echo '<td>';
echo (($row['Null'] == 'NO') ? __('No') : __('Yes'));
echo '</td>';
echo '<td class="nowrap">';
if (isset($row['Default'])) {
echo $row['Default'];
}
echo '</td>';
if ($have_rel) {
echo ' <td>';
if ($foreigner = $relation->searchColumnInForeigners($res_rel, $column_name)) {
echo htmlspecialchars(
$foreigner['foreign_table']
. ' -> '
. $foreigner['foreign_field']
);
}
echo '</td>' , "\n";
}
echo ' <td>';
if (isset($comments[$column_name])) {
echo htmlspecialchars($comments[$column_name]);
}
echo '</td>' , "\n";
if ($cfgRelation['mimework']) {
$mime_map = $transformations->getMime($db, $table, true);
echo ' <td>';
if (isset($mime_map[$column_name])) {
echo htmlspecialchars(
str_replace('_', '/', $mime_map[$column_name]['mimetype'])
);
}
echo '</td>' , "\n";
}
echo '</tr>';
} // end foreach
$count++;
echo '</table>';
// display indexes information
if (count(PhpMyAdmin\Index::getFromTable($table, $db)) > 0) {
echo PhpMyAdmin\Index::getHtmlForIndexes($table, $db, true);
}
echo '</div>';
} //ends main while
/**
* Displays the footer
*/
echo PhpMyAdmin\Util::getButton();

193
db_designer.php Normal file
View File

@ -0,0 +1,193 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin designer general code
*
* @package PhpMyAdmin-Designer
*/
declare(strict_types=1);
use PhpMyAdmin\Database\Designer;
use PhpMyAdmin\Database\Designer\Common;
use PhpMyAdmin\Response;
require_once 'libraries/common.inc.php';
$response = Response::getInstance();
$databaseDesigner = new Designer($GLOBALS['dbi']);
$designerCommon = new Common($GLOBALS['dbi']);
if (isset($_REQUEST['dialog'])) {
if ($_REQUEST['dialog'] == 'edit') {
$html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage');
} elseif ($_REQUEST['dialog'] == 'delete') {
$html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage');
} elseif ($_REQUEST['dialog'] == 'save_as') {
$html = $databaseDesigner->getHtmlForPageSaveAs($GLOBALS['db']);
} elseif ($_REQUEST['dialog'] == 'export') {
$html = $databaseDesigner->getHtmlForSchemaExport(
$GLOBALS['db'],
$_REQUEST['selected_page']
);
} elseif ($_REQUEST['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'] = [$GLOBALS['designer']['TABLE_NAME'][$req_key]];
$GLOBALS['designer_url']['TABLE_NAME_SMALL'] = [$GLOBALS['designer_url']['TABLE_NAME_SMALL'][$req_key]];
$GLOBALS['designer']['TABLE_NAME_SMALL'] = [$GLOBALS['designer']['TABLE_NAME_SMALL'][$req_key]];
$GLOBALS['designer_out']['TABLE_NAME_SMALL'] = [$GLOBALS['designer_out']['TABLE_NAME_SMALL'][$req_key]];
$GLOBALS['designer']['TABLE_TYPE'] = [$GLOBALS['designer_url']['TABLE_TYPE'][$req_key]];
$GLOBALS['designer_out']['OWNER'] = [$GLOBALS['designer_out']['OWNER'][$req_key]];
$html = $databaseDesigner->getDatabaseTables(
[],
-1,
$tab_column,
$tables_all_keys,
$tables_pk_or_unique_keys
);
}
if (! empty($html)) {
$response->addHTML($html);
}
return;
}
if (isset($_REQUEST['operation'])) {
if ($_REQUEST['operation'] == 'deletePage') {
$success = $designerCommon->deletePage($_REQUEST['selected_page']);
$response->setRequestStatus($success);
} elseif ($_REQUEST['operation'] == 'savePage') {
if ($_REQUEST['save_page'] == 'same') {
$page = $_REQUEST['selected_page'];
} else { // new
$page = $designerCommon->createNewPage($_REQUEST['selected_value'], $GLOBALS['db']);
$response->addJSON('id', $page);
}
$success = $designerCommon->saveTablePositions($page);
$response->setRequestStatus($success);
} elseif ($_REQUEST['operation'] == 'setDisplayField') {
$designerCommon->saveDisplayField(
$_REQUEST['db'],
$_REQUEST['table'],
$_REQUEST['field']
);
$response->setRequestStatus(true);
} elseif ($_REQUEST['operation'] == 'addNewRelation') {
list($success, $message) = $designerCommon->addNewRelation(
$_REQUEST['db'],
$_REQUEST['T1'],
$_REQUEST['F1'],
$_REQUEST['T2'],
$_REQUEST['F2'],
$_REQUEST['on_delete'],
$_REQUEST['on_update'],
$_REQUEST['DB1'],
$_REQUEST['DB2']
);
$response->setRequestStatus($success);
$response->addJSON('message', $message);
} elseif ($_REQUEST['operation'] == 'removeRelation') {
list($success, $message) = $designerCommon->removeRelation(
$_REQUEST['T1'],
$_REQUEST['F1'],
$_REQUEST['T2'],
$_REQUEST['F2']
);
$response->setRequestStatus($success);
$response->addJSON('message', $message);
} elseif ($_REQUEST['operation'] == 'save_setting_value') {
$success = $designerCommon->saveSetting($_REQUEST['index'], $_REQUEST['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($_REQUEST['query'])) {
$display_page = $designerCommon->getDefaultPage($_REQUEST['db']);
} else {
if (! empty($_REQUEST['page'])) {
$display_page = $_REQUEST['page'];
} else {
$display_page = $designerCommon->getLoadingPage($_REQUEST['db']);
}
}
if ($display_page != -1) {
$selected_page = $designerCommon->getPageName($display_page);
}
$tab_pos = $designerCommon->getTablePositions($display_page);
$script_contr = $designerCommon->getScriptContr();
$params = ['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->getHtmlForMain(
$db,
$_GET['db'],
$script_tables,
$script_contr,
$script_display_field,
$display_page,
isset($_REQUEST['query']),
$selected_page,
$classes_side_menu,
$tab_pos,
$tab_column,
$tables_all_keys,
$tables_pk_or_unique_keys
)
);
$response->addHTML('<div id="PMA_disable_floating_menubar"></div>');

19
db_events.php Normal file
View File

@ -0,0 +1,19 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Events management.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
/**
* Include required files
*/
require_once 'libraries/common.inc.php';
/**
* Do the magic
*/
$_PMA_RTE = 'EVN';
require_once 'libraries/rte/rte_main.inc.php';

172
db_export.php Normal file
View File

@ -0,0 +1,172 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* dumps a database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
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');
$export = new Export();
// $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($_GET['structure_or_data_forced'])) {
$force_val = htmlspecialchars($_GET['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 $_GET
// (from clicking Back button on export.php)
foreach (['table_select', 'table_structure', 'table_data'] as $one_key) {
if (isset($_GET[$one_key])) {
$_GET[$one_key] = urldecode($_GET[$one_key]);
$_GET[$one_key] = explode(",", $_GET[$one_key]);
}
}
foreach ($tables as $each_table) {
if (isset($_GET['table_select']) && is_array($_GET['table_select'])) {
$is_checked = $export->getCheckedClause(
$each_table['Name'],
$_GET['table_select']
);
} elseif (isset($table_select)) {
$is_checked = $export->getCheckedClause(
$each_table['Name'],
$table_select
);
} else {
$is_checked = ' checked="checked"';
}
if (isset($_GET['table_structure']) && is_array($_GET['table_structure'])) {
$structure_checked = $export->getCheckedClause(
$each_table['Name'],
$_GET['table_structure']
);
} else {
$structure_checked = $is_checked;
}
if (isset($_GET['table_data']) && is_array($_GET['table_data'])) {
$data_checked = $export->getCheckedClause(
$each_table['Name'],
$_GET['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
)
);

50
db_import.php Normal file
View File

@ -0,0 +1,50 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Database import page
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Config\PageSettings;
use PhpMyAdmin\Display\Import;
use PhpMyAdmin\Response;
require_once 'libraries/common.inc.php';
PageSettings::showGroup('Import');
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('import');
$import = new Import();
/**
* Gets tables information and displays top links
*/
require 'libraries/db_common.inc.php';
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 : '');
$response = Response::getInstance();
$response->addHTML(
$import->get(
'database',
$db,
$table,
$max_upload_size
)
);

32
db_multi_table_query.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Handles database multi-table querying
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Database\MultiTableQuery;
use PhpMyAdmin\Response;
require_once 'libraries/common.inc.php';
if (isset($_POST['sql_query'])) {
MultiTableQuery::displayResults(
$_POST['sql_query'],
$_REQUEST['db'],
$pmaThemeImage
);
} else {
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('vendor/jquery/jquery.md5.js');
$scripts->addFile('db_multi_table_query.js');
$queryInstance = new MultiTableQuery($GLOBALS['dbi'], $db);
$response->addHTML($queryInstance->getFormHtml());
}

314
db_operations.php Normal file
View File

@ -0,0 +1,314 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* handles miscellaneous db operations:
* - move/rename
* - copy
* - changing collation
* - changing comment
* - adding tables
* - viewing PDF schemas
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Display\CreateTable;
use PhpMyAdmin\Message;
use PhpMyAdmin\Operations;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Export\ExportSql;
use PhpMyAdmin\Relation;
use PhpMyAdmin\RelationCleanup;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
/**
* requirements
*/
require_once 'libraries/common.inc.php';
/**
* functions implementation for this script
*/
require_once 'libraries/check_user_privileges.inc.php';
// add a javascript file for jQuery functions to handle Ajax actions
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('db_operations');
$sql_query = '';
$operations = new Operations();
/**
* Rename/move or copy database
*/
if (strlen($GLOBALS['db']) > 0
&& (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy']))
) {
if (! empty($_REQUEST['db_rename'])) {
$move = true;
} else {
$move = false;
}
if (! isset($_REQUEST['newname']) || strlen($_REQUEST['newname']) === 0) {
$message = Message::error(__('The database name is empty!'));
} else {
// lower_case_table_names=1 `DB` becomes `db`
if ($GLOBALS['dbi']->getLowerCaseNames() === '1') {
$_REQUEST['newname'] = mb_strtolower(
$_REQUEST['newname']
);
}
if ($_REQUEST['newname'] === $_REQUEST['db']) {
$message = Message::error(
__('Cannot copy database to the same name. Change the name and try again.')
);
} else {
$_error = false;
if ($move || ! empty($_REQUEST['create_database_before_copying'])) {
$operations->createDbBeforeCopy();
}
// here I don't use DELIMITER because it's not part of the
// language; I have to send each statement one by one
// to avoid selecting alternatively the current and new db
// we would need to modify the CREATE definitions to qualify
// the db name
$operations->runProcedureAndFunctionDefinitions($GLOBALS['db']);
// go back to current db, just in case
$GLOBALS['dbi']->selectDb($GLOBALS['db']);
$tables_full = $GLOBALS['dbi']->getTablesFull($GLOBALS['db']);
// remove all foreign key constraints, otherwise we can get errors
/* @var $export_sql_plugin ExportSql */
$export_sql_plugin = Plugins::getPlugin(
"export",
"sql",
'libraries/classes/Plugins/Export/',
[
'single_table' => isset($single_table),
'export_type' => 'database'
]
);
// create stand-in tables for views
$views = $operations->getViewsAndCreateSqlViewStandIn(
$tables_full,
$export_sql_plugin,
$GLOBALS['db']
);
// copy tables
$sqlConstratints = $operations->copyTables(
$tables_full,
$move,
$GLOBALS['db']
);
// handle the views
if (! $_error) {
$operations->handleTheViews($views, $move, $GLOBALS['db']);
}
unset($views);
// now that all tables exist, create all the accumulated constraints
if (! $_error && count($sqlConstratints) > 0) {
$operations->createAllAccumulatedConstraints($sqlConstratints);
}
unset($sqlConstratints);
if ($GLOBALS['dbi']->getVersion() >= 50100) {
// here DELIMITER is not used because it's not part of the
// language; each statement is sent one by one
$operations->runEventDefinitionsForDb($GLOBALS['db']);
}
// go back to current db, just in case
$GLOBALS['dbi']->selectDb($GLOBALS['db']);
// Duplicate the bookmarks for this db (done once for each db)
$operations->duplicateBookmarks($_error, $GLOBALS['db']);
if (! $_error && $move) {
if (isset($_REQUEST['adjust_privileges'])
&& ! empty($_REQUEST['adjust_privileges'])
) {
$operations->adjustPrivilegesMoveDb($GLOBALS['db'], $_REQUEST['newname']);
}
/**
* cleanup pmadb stuff for this db
*/
RelationCleanup::database($GLOBALS['db']);
// if someday the RENAME DATABASE reappears, do not DROP
$local_query = 'DROP DATABASE '
. Util::backquote($GLOBALS['db']) . ';';
$sql_query .= "\n" . $local_query;
$GLOBALS['dbi']->query($local_query);
$message = Message::success(
__('Database %1$s has been renamed to %2$s.')
);
$message->addParam($GLOBALS['db']);
$message->addParam($_REQUEST['newname']);
} elseif (! $_error) {
if (isset($_REQUEST['adjust_privileges'])
&& ! empty($_REQUEST['adjust_privileges'])
) {
$operations->adjustPrivilegesCopyDb($GLOBALS['db'], $_REQUEST['newname']);
}
$message = Message::success(
__('Database %1$s has been copied to %2$s.')
);
$message->addParam($GLOBALS['db']);
$message->addParam($_REQUEST['newname']);
} else {
$message = Message::error();
}
$reload = true;
/* Change database to be used */
if (! $_error && $move) {
$GLOBALS['db'] = $_REQUEST['newname'];
} elseif (! $_error) {
if (isset($_REQUEST['switch_to_new'])
&& $_REQUEST['switch_to_new'] == 'true'
) {
$_SESSION['pma_switch_to_new'] = true;
$GLOBALS['db'] = $_REQUEST['newname'];
} else {
$_SESSION['pma_switch_to_new'] = false;
}
}
}
}
/**
* Database has been successfully renamed/moved. If in an Ajax request,
* generate the output with {@link PhpMyAdmin\Response} and exit
*/
if ($response->isAjax()) {
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('newname', $_REQUEST['newname']);
$response->addJSON(
'sql_query',
Util::getMessage(null, $sql_query)
);
$response->addJSON('db', $GLOBALS['db']);
exit;
}
}
/**
* Settings for relations stuff
*/
$relation = new Relation();
$cfgRelation = $relation->getRelationsParam();
/**
* Check if comments were updated
* (must be done before displaying the menu tabs)
*/
if (isset($_REQUEST['comment'])) {
$relation->setDbComment($GLOBALS['db'], $_REQUEST['comment']);
}
require 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_operations.php';
// Gets the database structure
$sub_part = '_structure';
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 : '');
echo "\n";
if (isset($message)) {
echo Util::getMessage($message, $sql_query);
unset($message);
}
$_REQUEST['db_collation'] = $GLOBALS['dbi']->getDbCollation($GLOBALS['db']);
$is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']);
if (!$is_information_schema) {
if ($cfgRelation['commwork']) {
/**
* database comment
*/
$response->addHTML($operations->getHtmlForDatabaseComment($GLOBALS['db']));
}
$response->addHTML('<div>');
$response->addHTML(CreateTable::getHtml($db));
$response->addHTML('</div>');
/**
* rename database
*/
if ($GLOBALS['db'] != 'mysql') {
$response->addHTML($operations->getHtmlForRenameDatabase($GLOBALS['db']));
}
// Drop link if allowed
// Don't even try to drop information_schema.
// You won't be able to. Believe me. You won't.
// Don't allow to easily drop mysql database, RFE #1327514.
if (($GLOBALS['dbi']->isSuperuser() || $GLOBALS['cfg']['AllowUserDropDatabase'])
&& ! $db_is_system_schema
&& $GLOBALS['db'] != 'mysql'
) {
$response->addHTML($operations->getHtmlForDropDatabaseLink($GLOBALS['db']));
}
/**
* Copy database
*/
$response->addHTML($operations->getHtmlForCopyDatabase($GLOBALS['db']));
/**
* Change database charset
*/
$response->addHTML($operations->getHtmlForChangeDatabaseCharset($GLOBALS['db'], $table));
if (! $cfgRelation['allworks']
&& $cfg['PmaNoRelation_DisableWarning'] == false
) {
$message = Message::notice(
__(
'The phpMyAdmin configuration storage has been deactivated. ' .
'%sFind out why%s.'
)
);
$message->addParamHtml('<a href="./chk_rel.php' . $url_query . '">');
$message->addParamHtml('</a>');
/* Show error if user has configured something, notice elsewhere */
if (!empty($cfg['Servers'][$server]['pmadb'])) {
$message->isError(true);
}
} // end if
} // end if (!$is_information_schema)

162
db_qbe.php Normal file
View File

@ -0,0 +1,162 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* query by example the whole database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Database\Qbe;
use PhpMyAdmin\Message;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\SavedSearches;
use PhpMyAdmin\Sql;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
* requirements
*/
require_once 'libraries/common.inc.php';
$response = Response::getInstance();
// Gets the relation settings
$relation = new Relation();
$cfgRelation = $relation->getRelationsParam();
$savedSearchList = [];
$savedSearch = null;
$currentSearchId = null;
if ($cfgRelation['savedsearcheswork']) {
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('db_qbe.js');
//Get saved search list.
$savedSearch = new SavedSearches($GLOBALS);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($_REQUEST['db']);
if (!empty($_REQUEST['searchId'])) {
$savedSearch->setId($_REQUEST['searchId']);
}
//Action field is sent.
if (isset($_REQUEST['action'])) {
$savedSearch->setSearchName($_REQUEST['searchName']);
if ('create' === $_REQUEST['action']) {
$saveResult = $savedSearch->setId(null)
->setCriterias($_REQUEST)
->save();
} elseif ('update' === $_REQUEST['action']) {
$saveResult = $savedSearch->setCriterias($_REQUEST)
->save();
} elseif ('delete' === $_REQUEST['action']) {
$deleteResult = $savedSearch->delete();
//After deletion, reset search.
$savedSearch = new SavedSearches($GLOBALS);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($_REQUEST['db']);
$_REQUEST = [];
} elseif ('load' === $_REQUEST['action']) {
if (empty($_REQUEST['searchId'])) {
//when not loading a search, reset the object.
$savedSearch = new SavedSearches($GLOBALS);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($_REQUEST['db']);
$_REQUEST = [];
} else {
$loadResult = $savedSearch->load();
}
}
//Else, it's an "update query"
}
$savedSearchList = $savedSearch->getList();
$currentSearchId = $savedSearch->getId();
}
/**
* A query has been submitted -> (maybe) execute it
*/
$message_to_display = false;
if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
if (! preg_match('@^SELECT@i', $sql_query)) {
$message_to_display = true;
} else {
$goto = 'db_sql.php';
$sql = new Sql();
$sql->executeQueryAndSendQueryResponse(
null, // analyzed_sql_results
false, // is_gotofile
$_REQUEST['db'], // db
null, // table
false, // find_real_end
null, // sql_query_for_bookmark
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
);
}
}
$sub_part = '_qbe';
require 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_qbe.php';
$url_params['goto'] = 'db_qbe.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 : '');
if ($message_to_display) {
Message::error(
__('You have to choose at least one column to display!')
)
->display();
}
unset($message_to_display);
// create new qbe search instance
$db_qbe = new Qbe($GLOBALS['dbi'], $GLOBALS['db'], $savedSearchList, $savedSearch);
$url = 'db_designer.php' . Url::getCommon(
array_merge(
$url_params,
['query' => 1]
)
);
$response->addHTML(
Message::notice(
sprintf(
__('Switch to %svisual builder%s'),
'<a href="' . $url . '">',
'</a>'
)
)
);
/**
* Displays the Query by example form
*/
$response->addHTML($db_qbe->getSelectionForm());

24
db_routines.php Normal file
View File

@ -0,0 +1,24 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Routines management.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
/**
* Include required files
*/
require_once 'libraries/common.inc.php';
/**
* Include all other files
*/
require_once 'libraries/check_user_privileges.inc.php';
/**
* Do the magic
*/
$_PMA_RTE = 'RTN';
require_once 'libraries/rte/rte_main.inc.php';

70
db_search.php Normal file
View File

@ -0,0 +1,70 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* searches the entire database
*
* @todo make use of UNION when searching multiple tables
* @todo display executed query, optional?
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Database\Search;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
/**
* Gets some core libraries
*/
require_once 'libraries/common.inc.php';
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('db_search');
$scripts->addFile('sql');
require 'libraries/db_common.inc.php';
// If config variable $GLOBALS['cfg']['UseDbSearch'] is on false : exit.
if (! $GLOBALS['cfg']['UseDbSearch']) {
Util::mysqlDie(
__('Access denied!'),
'',
false,
$err_url
);
} // end if
$url_query .= '&amp;goto=db_search.php';
$url_params['goto'] = 'db_search.php';
// Create a database search instance
$db_search = new Search($GLOBALS['dbi'], $GLOBALS['db']);
// Display top links if we are not in an Ajax request
if (! $response->isAjax()) {
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 : '');
}
// Main search form has been submitted, get results
if (isset($_REQUEST['submit_search'])) {
$response->addHTML($db_search->getSearchResults());
}
// If we are in an Ajax request, we need to exit after displaying all the HTML
if ($response->isAjax() && empty($_REQUEST['ajax_page_request'])) {
exit;
}
// Display the search form
$response->addHTML($db_search->getMainHtml());

49
db_sql.php Normal file
View File

@ -0,0 +1,49 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Database SQL executor
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Config\PageSettings;
use PhpMyAdmin\Response;
use PhpMyAdmin\SqlQueryForm;
/**
*
*/
require_once 'libraries/common.inc.php';
PageSettings::showGroup('Sql');
/**
* Runs common work
*/
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('sql');
require 'libraries/db_common.inc.php';
$sqlQueryForm = new SqlQueryForm();
// After a syntax error, we return to this script
// with the typed query in the textarea.
$goto = 'db_sql.php';
$back = 'db_sql.php';
/**
* Query box, bookmark, insert data from textfile
*/
$response->addHTML(
$sqlQueryForm->getHtml(
true,
false,
isset($_REQUEST['delimiter'])
? htmlspecialchars($_REQUEST['delimiter'])
: ';'
)
);

30
db_sql_autocomplete.php Normal file
View File

@ -0,0 +1,30 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Table/Column autocomplete in SQL editors
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Response;
require_once 'libraries/common.inc.php';
if ($GLOBALS['cfg']['EnableAutocompleteForTablesAndColumns']) {
$db = isset($_POST['db']) ? $_POST['db'] : $GLOBALS['db'];
$sql_autocomplete = [];
if ($db) {
$tableNames = $GLOBALS['dbi']->getTables($db);
foreach ($tableNames as $tableName) {
$sql_autocomplete[$tableName] = $GLOBALS['dbi']->getColumns(
$db,
$tableName
);
}
}
} else {
$sql_autocomplete = true;
}
$response = Response::getInstance();
$response->addJSON("tables", json_encode($sql_autocomplete));

23
db_sql_format.php Normal file
View File

@ -0,0 +1,23 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Format SQL for SQL editors
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Response;
/**
* Loading common files. Used to check for authorization, localization and to
* load the parsing library.
*/
require_once 'libraries/common.inc.php';
$query = !empty($_POST['sql']) ? $_POST['sql'] : '';
$query = PhpMyAdmin\SqlParser\Utils\Formatter::format($query);
$response = Response::getInstance();
$response->addJSON("sql", $query);

39
db_structure.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Database structure manipulation
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\DatabaseStructureController;
use PhpMyAdmin\Di\Container;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
require_once 'libraries/common.inc.php';
require_once 'libraries/db_common.inc.php';
$container = Container::getDefaultContainer();
$container->factory(
'PhpMyAdmin\Controllers\Database\DatabaseStructureController'
);
$container->alias(
'DatabaseStructureController',
'PhpMyAdmin\Controllers\Database\DatabaseStructureController'
);
$container->set('PhpMyAdmin\Response', Response::getInstance());
$container->alias('response', 'PhpMyAdmin\Response');
/* Define dependencies for the concerned controller */
$dependency_definitions = [
'db' => $db,
];
/** @var DatabaseStructureController $controller */
$controller = $container->get(
'DatabaseStructureController',
$dependency_definitions
);
$controller->indexAction();

125
db_tracking.php Normal file
View File

@ -0,0 +1,125 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Tracking configuration for database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Display\CreateTable;
use PhpMyAdmin\Message;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Tracker;
use PhpMyAdmin\Tracking;
use PhpMyAdmin\Util;
/**
* Run common work
*/
require_once 'libraries/common.inc.php';
//Get some js files needed for Ajax requests
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('db_tracking');
$tracking = new Tracking();
/**
* If we are not in an Ajax request, then do the common work and show the links etc.
*/
require 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=tbl_tracking.php&amp;back=db_tracking.php';
// Get the database structure
$sub_part = '_structure';
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 : '');
// Work to do?
// (here, do not use $_REQUEST['db] as it can be crafted)
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif (isset($_REQUEST['submit_create_version'])) {
$tracking->createTrackingForMultipleTables($_REQUEST['selected']);
Message::success(
sprintf(
__(
'Version %1$s was created for selected tables,'
. ' tracking is active for them.'
),
htmlspecialchars($_REQUEST['version'])
)
)->display();
} elseif (isset($_REQUEST['submit_mult'])) {
if (! empty($_REQUEST['selected_tbl'])) {
if ($_REQUEST['submit_mult'] == 'delete_tracking') {
foreach ($_REQUEST['selected_tbl'] as $table) {
Tracker::deleteTracking($GLOBALS['db'], $table);
}
Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif ($_REQUEST['submit_mult'] == 'track') {
echo $tracking->getHtmlForDataDefinitionAndManipulationStatements(
'db_tracking.php' . $url_query,
0,
$GLOBALS['db'],
$_REQUEST['selected_tbl']
);
exit;
}
} else {
Message::notice(
__('No tables selected.')
)->display();
}
}
// Get tracked data about the database
$data = Tracker::getTrackedData($_REQUEST['db'], '', '1');
// No tables present and no log exist
if ($num_tables == 0 && count($data['ddlog']) == 0) {
echo '<p>' , __('No tables found in database.') , '</p>' , "\n";
if (empty($db_is_system_schema)) {
echo CreateTable::getHtml($db);
}
exit;
}
// ---------------------------------------------------------------------------
echo $tracking->getHtmlForDbTrackingTables(
$GLOBALS['db'],
$_REQUEST['db'],
$url_query,
$pmaThemeImage,
$text_dir
);
// If available print out database log
if (count($data['ddlog']) > 0) {
$log = '';
foreach ($data['ddlog'] as $entry) {
$log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n"
. $entry['statement'] . "\n";
}
echo Util::getMessage(__('Database Log'), $log);
}

19
db_triggers.php Normal file
View File

@ -0,0 +1,19 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Triggers management.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
/**
* Include required files
*/
require_once 'libraries/common.inc.php';
/**
* Do the magic
*/
$_PMA_RTE = 'TRI';
require_once 'libraries/rte/rte_main.inc.php';

6
doc/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
*.swp
/_build
/doctrees
/html
/locale
*.pyc

View File

@ -9,7 +9,7 @@ BUILDDIR = .
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.

79
doc/bookmarks.rst Normal file
View File

@ -0,0 +1,79 @@
.. _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

@ -12,19 +12,19 @@ by clicking the "Display chart" link in the "Query results operations" area.
A window layer "Display chart" is shown in which you can customize the chart with the following options.
- Chart type: Allows you to choose the type of 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).
- 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 a number of rows: Allows generating charts only for a specified number of rows of the results set.
- 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 the `Chart.js <https://www.chartjs.org/>`_ library.
Charts in phpMyAdmin are drawn using `jqPlot <http://www.jqplot.com/>`_ jQuery library.
Examples
--------

View File

@ -44,14 +44,14 @@ master_doc = 'index'
# General information about the project.
project = u'phpMyAdmin'
copyright = u'2012 - 2026, The phpMyAdmin devel team'
copyright = u'2012 - 2018, The phpMyAdmin devel team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '6.0.0-dev'
version = '5.0.0-dev'
# The full version, including alpha/beta/rc tags.
release = version
@ -100,12 +100,6 @@ pygments_style = 'sphinx'
# a list of builtin themes.
html_theme = 'default'
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
except:
print('WARNING: The python module sphinx_rtd_theme was not found, using the default theme. Debian package: python3-sphinx-rtd-theme')
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
@ -317,8 +311,6 @@ linkcheck_ignore = [
# Site is often down
r'https://software.opensuse.org/package/.*',
r'https://pecl.php.net/.*',
# 403 Client Error: Forbidden
r'https://authy.com/.*',
# Site often changes links and reverts changes (9362bde02d0535a2f8cb74a18797249cb734c4b0)
r'https://www.yubico.com/.*',
# Expired SSL certificate
r'https://texy.info/.*',
]

File diff suppressed because it is too large Load Diff

View File

@ -31,12 +31,12 @@ 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
phpMyAdmin includes several third party libraries which come under their
respective licenses.
jQuery's license, which is where we got the files under public/js/vendor/jquery/ is
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 public/js/vendor/jquery/MIT-LICENSE.txt).
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.

View File

@ -8,7 +8,7 @@ Credits, in chronological order
* Tobias Ratschiller <tobias\_at\_ratschiller.com>
* creator of the phpMyAdmin project
* creator of the phpmyadmin project
* maintainer from 1998 to summer 2000
@ -178,7 +178,7 @@ Credits, in chronological order
* Maxime Delorme <delorme.maxime\_at\_free.fr>
* :term:`PDF` schema output, thanks also to
Olivier Plathey for the "FPDF" library (see <https://www.fpdf.org/>), Steven
Olivier Plathey for the "FPDF" library (see <http://www.fpdf.org/>), Steven
Wittens for the "UFPDF" library and
Nicola Asuni for the "TCPDF" library (see <https://tcpdf.org/>).
@ -439,43 +439,6 @@ Credits, in chronological order
* Other UI improvements
* Maurício Meneghini Fauth
* Major improvements and upgrades to the JavaScript core
* Modernize JavaScript library functionality
* Modernize templating and introduce Twig
* William Desportes
* Coding style improvements based on PHPStan
* Improve links to external MySQL and MariaDB documentation
* Numerous other bug fixes
* Emanuel Bronshtein
* Comprehensive security assessment and suggestions
* Lakshya Arora (Google Summer of Code 2018)
* Various improvements including:
* Integrate user preferences with local storage
* Use a modal login after session expiration
* Add support for CHECK CONSTRAINTS
* and more!
* Saksham Gupta (Google Summer of Code 2018)
* Automated theme generator tool
* Leonardo Strozzi (Google Summer of Code 2018)
* Refactoring Twig templates and other internal code improvements
* Piyush Vijay (Google Summer of Code 2018)
* Modernize the JavaScript code including introducing Webpack, Babel, and Yarn as well as eslint and Jsdoc
And also to the following people who have contributed minor changes,
enhancements, bugfixes or support for a new language since version
2.1.0:
@ -825,7 +788,6 @@ Following people have contributed to translation of phpMyAdmin:
* Spanish
* Daniel Hinostroza, MD <phpmyadmin\_at\_cerebroperiferico.com>
* Luis García Sevillano <floss.dev\_at\_gmail.com>
* Franco <fulanodetal.github1\_at\_openaliasbox.org>
* Luis Ruiz <luisan00\_at\_hotmail.com>

View File

@ -18,7 +18,7 @@ Server
1.1 My server is crashing each time a specific action is required or phpMyAdmin sends a blank page or a page full of cryptic characters to my browser, what can I do?
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in your
Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in your
:file:`config.inc.php` file and the ``zlib.output_compression`` directive to
``Off`` in your php configuration file.
@ -63,7 +63,7 @@ Please use instead the cookie authentication mode.
This seems to be a PWS bug. Filippo Simoncini found a workaround (at
this time there is no better fix): remove or comment the ``DOCTYPE``
declarations (2 lines) from the scripts :file:`src/Header.php`
declarations (2 lines) from the scripts :file:`libraries/Header.class.php`
and :file:`index.php`.
.. _faq1_7:
@ -167,14 +167,14 @@ to the latest version to take advantage of the new import features.
The first things to check (or ask your host provider to check) are the values
of ``max_execution_time``, ``upload_max_filesize``, ``memory_limit`` and
``post_max_size`` in the :file:`php.ini` configuration file. All of these
``post_max_size`` in the :file:`php.ini` configuration file. All of these three
settings limit the maximum size of data that can be submitted and handled by
PHP. Please note that ``post_max_size`` needs to be larger than
``upload_max_filesize``. There exist several workarounds if your upload is too
big or your hosting provider is unwilling to change the settings:
* Look at the :config:option:`$cfg['UploadDir']` feature. This allows one to upload a file to the server
via scp, FTP, or your favorite file transfer method. PhpMyAdmin is
via scp, ftp, or your favorite file transfer method. PhpMyAdmin is
then able to import the files from the temporary directory. More
information is available in the :ref:`config` of this document.
* Using a utility (such as `BigDump
@ -212,7 +212,7 @@ your server - as mentioned in :ref:`faq1_17`. This problem is
generally caused by using MySQL version 4.1 or newer. MySQL changed
the authentication hash and your PHP is trying to use the old method.
The proper solution is to use the `mysqli extension
<https://www.php.net/mysqli>`_ with the proper client library to match
<https://secure.php.net/mysqli>`_ with the proper client library to match
your MySQL installation. More
information (and several workarounds) are located in the `MySQL
Documentation <https://dev.mysql.com/doc/refman/5.7/en/common-errors.html>`_.
@ -244,8 +244,8 @@ phpMyAdmin tried to load the extension but failed. Usually, the
problem is solved by installing a software package called "PHP-MySQL"
or something similar.
There was two interfaces PHP provided as MySQL extensions - ``mysql``
and ``mysqli``. The ``mysql`` interface was removed in PHP 7.0.
There are currently two interfaces PHP provides as MySQL extensions - ``mysql``
and ``mysqli``. The ``mysqli`` is tried first, because it's the best one.
This problem can be also caused by wrong paths in the :file:`php.ini` or using
wrong :file:`php.ini`.
@ -268,9 +268,10 @@ can tell it to use specific path for this file using ``PHPIniDir`` directive:
.. code-block:: apache
LoadModule php7_module "C:/php7/php7apache2_4.dll"
<IfModule php7_module>
PHPIniDir "C:/php7"
LoadFile "C:/php/php5ts.dll"
LoadModule php5_module "C:/php/php5apache2_2.dll"
<IfModule php5_module>
PHPIniDir "C:/PHP"
<Location>
AddType text/html .php
AddHandler application/x-httpd-php .php
@ -279,7 +280,7 @@ can tell it to use specific path for this file using ``PHPIniDir`` directive:
In some rare cases this problem can be also caused by other extensions loaded
in PHP which prevent MySQL extensions to be loaded. If anything else fails, you
can try commenting out extensions for other databases from :file:`php.ini`.
can try commenting out extensions for other databses from :file:`php.ini`.
.. _faq1_21:
@ -354,7 +355,7 @@ PHP scripts. Of course you have to restart Apache.
This is a permission problem. Right-click on the phpmyadmin folder and
choose properties. Under the tab Security, click on "Add" and select
the user "IUSR\_machine" from the list. Now set their permissions and it
the user "IUSR\_machine" from the list. Now set his permissions and it
should work.
.. _faq1_27:
@ -435,8 +436,6 @@ PHP 7.2 is supported since 4.7.4.
HHVM is supported up to phpMyAdmin 4.8.
Since release 5.0, phpMyAdmin supports only PHP 7.1 and newer.
Since release 5.2, phpMyAdmin supports only PHP 7.2 and newer.
Since release 6.0, phpMyAdmin supports only PHP 8.2 and newer.
.. _faq1_32:
@ -464,22 +463,20 @@ Yes. This procedure was tested with phpMyAdmin 2.6.1, PHP 4.3.9 in
.. _faq1_34:
1.34 Can I directly access a database or table pages?
-----------------------------------------------------
1.34 Can I access directly to database or table pages?
------------------------------------------------------
Yes. Out of the box, you can use a :term:`URL` like
Yes. Out of the box, you can use :term:`URL` like
``http://server/phpMyAdmin/index.php?server=X&db=database&table=table&target=script``.
For ``server`` you can use the server number
which refers to the numeric host index (from ``$i``) in
:file:`config.inc.php`. The table and script parts are optional.
If you want a URL like
``http://server/phpMyAdmin/database[/table][/script]``, you need to do some additional configuration. The following
lines apply only for the `Apache <https://httpd.apache.org>`_ web server.
First, make sure that you have enabled some features within the Apache global
For ``server`` you use the server number
which refers to the order of the server paragraph in
:file:`config.inc.php`. Table and script parts are optional. If you want
``http://server/phpMyAdmin/database[/table][/script]`` :term:`URL`, you need to do some configuration. Following
lines apply only for `Apache <https://httpd.apache.org>`_ web server.
First make sure, that you have enabled some features within global
configuration. You need ``Options SymLinksIfOwnerMatch`` and ``AllowOverride
FileInfo`` enabled for directory where phpMyAdmin is installed and you
need mod\_rewrite to be enabled. Then you just need to create the
need mod\_rewrite to be enabled. Then you just need to create
following :term:`.htaccess` file in root folder of phpMyAdmin installation (don't
forget to change directory name inside of it):
@ -492,13 +489,6 @@ forget to change directory name inside of it):
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R]
RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R]
.. seealso:: :ref:`faq4_8`
.. versionchanged:: 5.1.0
Support for using the ``target`` parameter was removed in phpMyAdmin 5.1.0.
Use the ``route`` parameter instead.
.. _faq1_35:
1.35 Can I use HTTP authentication with Apache CGI?
@ -526,14 +516,71 @@ error log file might give a clue.
-----------------------------------------------------------------------------------------------------------
If your cluster consist of different architectures, PHP code used for
encryption/decryption won't work correctly. This is caused by use of
pack/unpack functions in code. Only solution is to use openssl
encryption/decryption won't work correct. This is caused by use of
pack/unpack functions in code. Only solution is to use mcrypt
extension which works fine in this case.
.. _faq1_38:
1.38 (withdrawn).
-----------------
1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled?
------------------------------------------------------------------
Yes but the default configuration values of Suhosin are known to cause
problems with some operations, for example editing a table with many
columns and no :term:`primary key` or with textual :term:`primary key`.
Suhosin configuration might lead to malfunction in some cases and it
can not be fully avoided as phpMyAdmin is kind of application which
needs to transfer big amounts of columns in single HTTP request, what
is something what Suhosin tries to prevent. Generally all
``suhosin.request.*``, ``suhosin.post.*`` and ``suhosin.get.*``
directives can have negative effect on phpMyAdmin usability. You can
always find in your error logs which limit did cause dropping of
variable, so you can diagnose the problem and adjust matching
configuration variable.
The default values for most Suhosin configuration options will work in
most scenarios, however you might want to adjust at least following
parameters:
* `suhosin.request.max\_vars <https://suhosin.org/stories/configuration.html#suhosin-request-max-vars>`_ should
be increased (eg. 2048)
* `suhosin.post.max\_vars <https://suhosin.org/stories/configuration.html#suhosin-post-max-vars>`_ should be
increased (eg. 2048)
* `suhosin.request.max\_array\_index\_length <https://suhosin.org/stories/configuration.html#suhosin-request-max-array-index-length>`_
should be increased (eg. 256)
* `suhosin.post.max\_array\_index\_length <https://suhosin.org/stories/configuration.html#suhosin-post-max-array-index-length>`_
should be increased (eg. 256)
* `suhosin.request.max\_totalname\_length <https://suhosin.org/stories/configuration.html#suhosin-request-max-totalname-length>`_
should be increased (eg. 8192)
* `suhosin.post.max\_totalname\_length <https://suhosin.org/stories/configuration.html#suhosin-post-max-totalname-length>`_ should be
increased (eg. 8192)
* `suhosin.get.max\_value\_length <https://suhosin.org/stories/configuration.html#suhosin-get-max-value-length>`_
should be increased (eg. 1024)
* `suhosin.sql.bailout\_on\_error <https://suhosin.org/stories/configuration.html#suhosin-sql-bailout-on-error>`_
needs to be disabled (the default)
* `suhosin.log.\* <https://suhosin.org/stories/configuration.html#logging-configuration>`_ should not
include :term:`SQL`, otherwise you get big
slowdown
* `suhosin.sql.union <https://suhosin.org/stories/configuration.html#suhosin-
sql-union>`_ must be disabled (which is the default).
* `suhosin.sql.multiselect <https://suhosin.org/stories/configuration.html#
suhosin-sql-multiselect>`_ must be disabled (which is the default).
* `suhosin.sql.comment <https://suhosin.org/stories/configuration.html#suhosin-
sql-comment>`_ must be disabled (which is the default).
To further improve security, we also recommend these modifications:
* `suhosin.executor.include.max\_traversal <https://suhosin.org/stories/
configuration.html#suhosin-executor-include-max-traversal>`_ should be
enabled as a mitigation against local file inclusion attacks. We suggest
setting this to 2 as ``../`` is used with the ReCaptcha library.
* `suhosin.cookie.encrypt <https://suhosin.org/stories/configuration.html#
suhosin-cookie-encrypt>`_ should be enabled.
* `suhosin.executor.disable_emodifier <https://suhosin.org/stories/config
uration.html#suhosin-executor-disable-emodifier>`_ should be enabled.
You can also disable the warning using the :config:option:`$cfg['SuhosinDisableWarning']`.
.. _faq1_39:
@ -630,64 +677,16 @@ Some users have requested to be able to reduce the size of the phpMyAdmin instal
This is not recommended and could lead to confusion over missing features, but can be done.
A list of files and corresponding functionality which degrade gracefully when removed include:
* :file:`./resources/locale/` folder, or unused subfolders (interface translations)
* Any unused themes in :file:`./public/themes/` except the default theme `pmahomme`.
* :file:`./app/language_stats.inc.php` (translation statistics)
* :file:`./docs/` (documentation)
* :file:`./vendor/tecnickcom/tcpdf` folder (exporting to PDF)
* :file:`./locale/` folder, or unused subfolders (interface translations)
* Any unused themes in :file:`./themes/`
* :file:`./js/vendor/jquery/src/` (included for licensing reasons)
* :file:`./js/line_counts.php` (removed in phpMyAdmin 4.8)
* :file:`./doc/` (documentation)
* :file:`./setup/` (setup script)
* :file:`./examples/` (configuration examples)
* :file:`./resources/sql/` (SQL scripts to configure advanced functionalities)
* :file:`./resources/js/` (Source files to re-build `./public/js/`)
* Run `rm -rv vendor/tecnickcom/tcpdf && composer dump-autoload --no-interaction --optimize --dev` (exporting to PDF)
* Run `rm -rv vendor/williamdes/mariadb-mysql-kbs && composer dump-autoload --no-interaction --optimize --dev` (external links to MariaDB and MySQL documentations)
* Run `rm -rv vendor/code-lts/u2f-php-server && composer dump-autoload --no-interaction --optimize --dev` (U2F second factor authentication)
* Run `rm -rv vendor/pragmarx/* && composer dump-autoload --no-interaction --optimize --dev` (2FA second factor authentication)
* Run `rm -rv vendor/bacon/bacon-qr-code && composer dump-autoload --no-interaction --optimize --dev` (QRcode generation for 2FA second factor authentication)
.. _faq1_45:
1.45 I get an error message about unknown authentication method caching_sha2_password when trying to log in
-----------------------------------------------------------------------------------------------------------
When logging in using MySQL version 8 or newer, you may encounter an error message like this:
mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client
This error is because of a version compatibility problem between PHP and MySQL. The MySQL project introduced a new authentication
method (our tests show this began with version 8.0.11) however PHP did not include the ability to use that authentication method.
PHP reports that this was fixed in PHP version 7.4.
Users experiencing this are encouraged to upgrade their PHP installation, however a workaround exists. Your MySQL user account
can be set to use the older authentication with a command such as
.. code-block:: mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
.. seealso:: <https://github.com/phpmyadmin/phpmyadmin/issues/14220>, <https://stackoverflow.com/questions/49948350/phpmyadmin-on-mysql-8-0>, <https://bugs.php.net/bug.php?id=76243>
.. _faq1_46:
1.46 Missing ``HTTP_HOST`` variable when using nginx with HTTP/3
-----------------------------------------------------------------------------------------------------------
When using phpMyAdmin with nginx and HTTP/3 enabled, the ``HTTP_HOST`` variable may be missing due to a known issue with nginx's HTTP/3 implementation, which can cause several issues:
- Two-factor authentication won't work
- Exported settings have no hostname in the filename (e.g., ``phpMyAdmin-config-.json``)
- The hostname is missing from the page title (empty ``@HTTP_HOST@``)
To fix this issue, add the following line to your nginx configuration:
.. code-block:: nginx
fastcgi_param HTTP_HOST $host;
This line should be placed in the server block of your nginx configuration where the PHP-FPM settings are defined.
.. seealso:: <https://github.com/php/php-src/issues/13021>, <https://github.com/nginx/nginx/issues/455>, <https://trac.nginx.org/nginx/ticket/2281>, <https://mailman.nginx.org/pipermail/nginx-devel/2024-January/3CQEHII5QU2BTQ7L7DAVCBWK3OQS3GU6.html>
* :file:`./examples/`
* :file:`./sql/` (SQL scripts to configure advanced functionality)
* :file:`./js/vendor/openlayers/` (GIS visualization)
.. _faqconfig:
@ -814,6 +813,8 @@ Here are a few points to check:
Dorninger for the hint).
* In the :file:`php.ini` directive ``arg_separator.input``, a value of ";"
will cause this error. Replace it with "&;".
* If you are using `Suhosin <https://suhosin.org/stories/index.html>`_, you
might want to increase `request limits <https://suhosin.org/stories/faq.html>`_.
* The directory specified in the :file:`php.ini` directive
``session.save_path`` does not exist or is read-only (this can be caused
by `bug in the PHP installer <https://bugs.php.net/bug.php?id=39842>`_).
@ -824,42 +825,19 @@ Here are a few points to check:
---------------------------------
To be able to see a progress bar during your uploads, your server must
have the `uploadprogress <https://pecl.php.net/package/uploadprogress>`_ extension enabled.
have the `APC <https://secure.php.net/manual/en/book.apc.php>`_ extension, the
`uploadprogress <https://pecl.php.net/package/uploadprogress>`_ one, or
you must be running PHP 5.4.0 or higher. Moreover, the JSON extension
has to be enabled in your PHP.
You must set ``session.upload_progress.enabled`` to ``1`` in your :file:`php.ini`.
However, starting from phpMyAdmin version 4.0.4, session-based upload progress has
If using APC, you must set ``apc.rfc1867`` to ``on`` in your :file:`php.ini`.
If using PHP 5.4.0 or higher, you must set
``session.upload_progress.enabled`` to ``1`` in your :file:`php.ini`. However,
starting from phpMyAdmin version 4.0.4, session-based upload progress has
been temporarily deactivated due to its problematic behavior.
.. _faq2_10:
2.10 How to generate a string of random bytes
---------------------------------------------
One way to generate a string of random bytes suitable for cryptographic use is using the
`random_bytes <https://www.php.net/random_bytes>`_ :term:`PHP` function. Since this function returns a binary string,
the returned value should be converted to printable format before being able to copy it.
For example, the :config:option:`$cfg['blowfish_secret']` configuration directive requires a 32-bytes long string. The
following command can be used to generate a hexadecimal representation of this string.
.. code-block:: sh
php -r 'echo bin2hex(random_bytes(32)) . PHP_EOL;'
The above example will output something similar to:
.. code-block:: sh
f16ce59f45714194371b48fe362072dc3b019da7861558cd4ad29e4d6fb13851
And then this hexadecimal value can be used in the configuration file.
.. code-block:: php
$cfg['blowfish_secret'] = sodium_hex2bin('f16ce59f45714194371b48fe362072dc3b019da7861558cd4ad29e4d6fb13851');
The `sodium_hex2bin <https://www.php.net/sodium_hex2bin>`_ function is used here to convert the hexadecimal value back to the
binary format.
.. seealso:: :rfc:`1867`
.. _faqlimitations:
@ -1076,7 +1054,7 @@ is no way for PHP to set the charset before authenticating.
.. seealso::
`phpMyAdmin issue 12232 <https://github.com/phpmyadmin/phpmyadmin/issues/12232>`_,
`MySQL documentation note <https://www.php.net/manual/en/mysqli.real-connect.php#refsect1-mysqli.real-connect-notes>`_
`MySQL documentation note <https://secure.php.net/manual/en/mysqli.real-connect.php#refsect1-mysqli.real-connect-notes>`_
.. _faqmultiuser:
@ -1146,7 +1124,7 @@ Starting with 2.2.5, in the user management page, you can enter a
wildcard database name for a user (for example "joe%"), and put the
privileges you want. For example, adding ``SELECT, INSERT, UPDATE,
DELETE, CREATE, DROP, INDEX, ALTER`` would let a user create/manage
their database(s).
his/her database(s).
.. _faq4_6:
@ -1168,13 +1146,13 @@ network :term:`IP` blocks.
//block root from logging in except from the private networks
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = [
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
'deny root from all',
'allow root from localhost',
'allow root from 10.0.0.0/8',
'allow root from 192.168.0.0/16',
'allow root from 172.16.0.0/12',
];
);
.. _faq4_7:
@ -1191,20 +1169,20 @@ name is defined in the config file.
4.8 Which parameters can I use in the URL that starts phpMyAdmin?
-----------------------------------------------------------------
When starting phpMyAdmin, you can use the ``db``
and ``server`` parameters. This last one can contain
When starting phpMyAdmin, you can use the ``db``, ``pma_username``,
``pma_password`` and ``server`` parameters. This last one can contain
either the numeric host index (from ``$i`` of the configuration file)
or one of the host names present in the configuration file.
or one of the host names present in the configuration file. Using
``pma_username`` and ``pma_password`` has been tested along with the
usage of 'cookie' ``auth_type``.
For example, to jump directly to a particular database, a URL can be constructed as
``https://example.com/phpmyadmin/?db=sakila``.
For example direct login URL can be constructed as
``https://example.com/phpmyadmin/?pma_username=user&pma_password=password``.
.. seealso:: :ref:`faq1_34`
.. warning::
.. versionchanged:: 4.9.0
Support for using the ``pma_username`` and ``pma_password`` parameters was removed
in phpMyAdmin 4.9.0 (see `PMASA-2019-4 <https://www.phpmyadmin.net/security/PMASA-2019-4/>`_).
Passing password and username in URL is insecure and should not be used in
production environments.
.. _faqbrowsers:
@ -1305,7 +1283,7 @@ by the recent versions of the most browsers.
5.12 Mac OS X Safari browser changes special characters to "?".
---------------------------------------------------------------
This issue has been reported by a :term:`macOS` user, who adds that Chimera,
This issue has been reported by a :term:`Mac OS X` user, who adds that Chimera,
Netscape and Mozilla do not have this problem.
.. _faq5_13:
@ -1403,7 +1381,7 @@ This is usually caused by web application firewall doing requests filtering. It
tries to prevent SQL injection, however phpMyAdmin is tool designed to execute
SQL queries, thus it makes it unusable.
Please allow phpMyAdmin scripts from the web application firewall settings
Please whitelist phpMyAdmin scripts from the web application firewall settings
or disable it completely for phpMyAdmin path.
Programs known to cause these kind of errors:
@ -1499,7 +1477,7 @@ create the example tables:
country_code char(1) NOT NULL default '',
description varchar(10) NOT NULL default '',
PRIMARY KEY (country_code)
) ENGINE=MyISAM;
) TYPE=MyISAM;
INSERT INTO REL_countries VALUES ('C', 'Canada');
@ -1509,16 +1487,16 @@ create the example tables:
town_code varchar(5) default '0',
country_code char(1) NOT NULL default '',
PRIMARY KEY (id)
) ENGINE=MyISAM;
) TYPE=MyISAM;
INSERT INTO REL_persons VALUES (11, 'Marc', 'S', 'C');
INSERT INTO REL_persons VALUES (11, 'Marc', 'S', '');
INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C');
CREATE TABLE REL_towns (
town_code varchar(5) NOT NULL default '0',
description varchar(30) NOT NULL default '',
PRIMARY KEY (town_code)
) ENGINE=MyISAM;
) TYPE=MyISAM;
INSERT INTO REL_towns VALUES ('S', 'Sherbrooke');
INSERT INTO REL_towns VALUES ('M', 'Montréal');
@ -1526,7 +1504,7 @@ create the example tables:
To setup appropriate links and display information:
* on table "REL\_persons" click Structure, then Relation view
* for "town\_code", choose from dropdowns, "mydb", "REL\_towns", "town\_code"
* for "town\_code", choose from dropdowns, "mydb", "REL\_towns", "code"
for foreign database, table and column respectively
* for "country\_code", choose from dropdowns, "mydb", "REL\_countries",
"country\_code" for foreign database, table and column respectively
@ -1565,15 +1543,33 @@ enables: drop-down list of possible values.
--------------------------------------------------
First the configuration variables "relation", "table\_coords" and
"pdf\_pages" have to be filled in.
"pdf\_pages" have to be filled in. Then you need to think about your
schema layout. Which tables will go on which pages?
* Select your database in the navigation panel.
* Choose ":guilabel:`Designer`" in the navigation bar at the top.
* Move the tables the way you want them.
* Choose ":guilabel:`Export schema`" in the left menu.
* The export modal will open.
* Select the type of export to :term:`PDF`, you may adjust the other settings.
* Submit the form and the file will start downloading.
* Choose "Operations" in the navigation bar at the top.
* Choose "Edit :term:`PDF` Pages" near the
bottom of the page.
* Enter a name for the first :term:`PDF` page
and click Go. If you like, you can use the "automatic layout," which
will put all your linked tables onto the new page.
* Select the name of the new page (making sure the Edit radio button is
selected) and click Go.
* Select a table from the list, enter its coordinates and click Save.
Coordinates are relative; your diagram will be automatically scaled to
fit the page. When initially placing tables on the page, just pick any
coordinates -- say, 50x50. After clicking Save, you can then use the
:ref:`wysiwyg` to position the element correctly.
* When you'd like to look at your :term:`PDF`, first be sure to click the Save
button beneath the list of tables and coordinates, to save any changes you
made there. Then scroll all the way down, select the :term:`PDF` options you
want, and click Go.
* Internet Explorer for Windows may suggest an incorrect filename when
you try to save a generated :term:`PDF`.
When saving a generated :term:`PDF`, be
sure that the filename ends in ".pdf", for example "schema.pdf".
Browsers on other operating systems, and other browsers on Windows, do
not have this problem.
.. seealso::
@ -1623,7 +1619,7 @@ It means "average".
any) will be included in backup.
* "Enclose table and column names with backquotes" ensures that column
and table names formed with special characters are protected.
* "Add into comments" includes column comments, relations, and media
* "Add into comments" includes column comments, relations, and MIME
types set in the pmadb in the dump as :term:`SQL` comments
(*/\* xxx \*/*).
@ -1689,7 +1685,7 @@ user-input situation. Instead you have to initialize mimetypes using
functions or empty mimetype definitions.
Plus, you have a whole overview of available mimetypes. Who knows all those
mimetypes by heart so they can enter it at will?
mimetypes by heart so he/she can enter it at will?
.. _faqbookmark:
@ -1796,7 +1792,7 @@ in Browse mode or on the Structure page.
-----------------------------------
In all places where phpMyAdmin accepts format strings, you can use
``@VARIABLE@`` expansion and `strftime <https://www.php.net/strftime>`_
``@VARIABLE@`` expansion and `strftime <https://secure.php.net/strftime>`_
format strings. The expanded variables depend on a context (for
example, if you haven't chosen a table, you can not get the table
name), but the following variables can be used:
@ -1818,10 +1814,31 @@ name), but the following variables can be used:
``@PHPMYADMIN@``
phpMyAdmin with version
.. _faq6_28:
.. _wysiwyg:
6.28 (withdrawn).
-----------------
6.28 How can I easily edit relational schema for export?
--------------------------------------------------------
By clicking on the button 'toggle scratchboard' on the page where you
edit x/y coordinates of those elements you can activate a scratchboard
where all your elements are placed. By clicking on an element, you can
move them around in the pre-defined area and the x/y coordinates will
get updated dynamically. Likewise, when entering a new position
directly into the input field, the new position in the scratchboard
changes after your cursor leaves the input field.
You have to click on the 'OK'-button below the tables to save the new
positions. If you want to place a new element, first add it to the
table of elements and then you can drag the new element around.
By changing the paper size and the orientation you can change the size
of the scratchboard as well. You can do so by just changing the
dropdown field below, and the scratchboard will resize automatically,
without interfering with the current placement of the elements.
If ever an element gets out of range you can either enlarge the paper
size or click on the 'reset' button to place all elements below each
other.
.. _faq6_29:
@ -1899,7 +1916,7 @@ to plot' field. Once you have decided over your criteria, click 'Go'
to display the plot.
After the plot is generated, you can use the
mouse wheel to zoom in and out of the plot. In addition, panning
mousewheel to zoom in and out of the plot. In addition, panning
feature is enabled to navigate through the plot. You can zoom-in to a
certain level of detail and use panning to locate your area of
interest. Clicking on a point opens a dialogue box, displaying field
@ -2190,13 +2207,12 @@ authentication to the Apache environment and it can be used in Apache
logs. Currently there are two variables available:
``userID``
User name of currently active user (they do not have to be logged in).
User name of currently active user (he does not have to be logged in).
``userStatus``
Status of currently active user, one of ``ok`` (user is logged in),
``server-denied`` (database server denied user login), ``allow-denied`` (user denied
``mysql-denied`` (MySQL denied user login), ``allow-denied`` (user denied
by allow/deny rules), ``root-denied`` (root is denied in configuration),
``empty-denied`` (empty password is denied),
``no-activity`` (automatically logged out due to inactivity).
``empty-denied`` (empty password is denied).
``LogFormat`` directive for Apache can look like following:
@ -2228,7 +2244,7 @@ differentiate between a desired text output and a formula that should be escaped
definitions should not be interpreted anyway. We have discussed this at length and feel it is the responsibility of the
spreadsheet program to properly parse and sanitize such data on input instead.
Google also has a `similar view <https://bughunters.google.com/learn/invalid-reports/google-products/4965108570390528/csv-formula-injection>`_.
Google also has a `similar view <https://sites.google.com/site/bughunteruniversity/nonvuln/csv-excel-formula-injection>`_.
.. _faqsynchronization:

426
doc/glossary.rst Normal file
View File

@ -0,0 +1,426 @@
.. _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

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

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