Commit Graph

41 Commits

Author SHA1 Message Date
Kamil Tekiela
47959814a4 Remove globals charset_connection & collation_connection
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-08-04 21:32:05 +01:00
Maurício Meneghini Fauth
19dad3b153
Add a isAjax() method to ServerRequest class
This method belongs to the ServerRequest class instead of the
ResponseRenderer class, as it's a request property.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-26 16:01:37 -03:00
Maurício Meneghini Fauth
1f935e57f7
Move the Import class to the Import namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-06-28 12:44:04 -03:00
Maurício Meneghini Fauth
1be42d13de
Create the Identifiers\Identifier interface
Changes Dbal\DatabaseName, Dbal\TableName and Triggers\TriggerName to
implements the new Identifier\Identifier interface.
Moves Dbal\DatabaseName, Dbal\TableName and Triggers\TriggerName to the
Identifiers namespace.
Renames the tryFromValue() and fromValue() methods to just tryFrom() and
from() respectively.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-06-01 19:09:25 -03:00
Kamil Tekiela
56d1eed358 Remove MAX_FILE_SIZE
This is not used anywhere in frontend or backend.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-04-20 16:53:19 +01:00
Maurício Meneghini Fauth
dd885dc7b8
Use single-line arrays when possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-27 17:39:17 -03:00
Maurício Meneghini Fauth
e5698c85e9
Require single line for function calls
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-26 23:10:10 -03:00
Maurício Meneghini Fauth
437215cab2
Rename variables to use camel case format
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-26 21:47:50 -03:00
Maurício Meneghini Fauth
556594b4cd
Fix coding standard spacing issues
- Fixes one line doc comments
- Fixes parent call spacing
- Fixes constant spacing

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 21:06:17 -03:00
Maurício Meneghini Fauth
77957a69a5
Add trailing comma for multi-line functions
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 20:48:46 -03:00
Kamil Tekiela
e8c5eef6f8
Remove annoying empty statements (#18114)
* Remove annoying empty statements

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Make $extra strict and stop passing false to it

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Make $page strict and stop passing null

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

---------

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-24 20:11:37 -03:00
Maurício Meneghini Fauth
785f8c1c00
Use constructor property promotion where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 19:39:02 -03:00
Maurício Meneghini Fauth
613678f8f5
Replace assignments with null coalesce equal operator
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 17:03:05 -03:00
Kamil Tekiela
2b35303aae
Remove redundant code (#18063)
PHPStorm has been a little annoying with showing all these code issues. I took some time to analyse most of them and fix whichever were easy to fix. This kind of change should improve future maintenance as developers do not need to wonder what a line of code does. Code that has no impact on functionality should be removed.

* Remove redundant variables
* Invert condition for better clarity
* Remove some of the redundant casts
* Replace switch with an if
* Fix foreach variable
* Remove redundant variable concat
* Remove redundant concats
* Replace for loop with str_repeat
* Remove always true param
* Turn property $position into local var
* Turn Pdf properties into local vars
* Remove unused properties in Pdf
* Change ternary into condition
* Remove redundant assignments
   They are immediately overwritten with a different value.
* Redundant array append
* Collapse if statements into assignments
* Use boolean constants instead of variables
* Remove unneeded parameter
* Remove null-coalesce
* Unnecessary assignment
* Remove redundant isset
* Remove readOnly flag for InsertEdit fields
* Remove function_exists and $mode var
* Remove duplicate condition
* Remove redundant elseif
* Remove redundant isset
* Use hasBodyParam()
* Simplify isRoutesCacheFileValid()
   Psalm complains but is wrong.

https://github.com/phpmyadmin/phpmyadmin/pull/18063

---------

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 09:11:05 -03:00
Kamil Tekiela
8a1d6f1eaa Convert var annotations to typed properties
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-12 21:31:04 +00:00
Maurício Meneghini Fauth
7cde53ed0d
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-09 18:41:44 -03:00
Maurício Meneghini Fauth
dfd5f13078
Fix some errors detected by Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-05 16:27:20 -03:00
Maurício Meneghini Fauth
cdc2f37a1d
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-03 19:38:50 -03:00
William Desportes
9eec5d8be8
Add a reservation of 1 second to allow interrupt shutdown code to render
Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-01-01 09:54:52 +04:00
Kamil Tekiela
6264f6f1ea
Various refactorings 2 (#17965)
* Remove extra blank lines
* Remove useless param annotations
* Refactor Index::singleton
* Refactor Config.php
* Refactor Header::addRecentTable()
* Collapse return statement into a single line
* Refactor Message.php
* Convert $getUniqueCondition into a scalar
* Code style
* Fix invalid return phpdoc
* Remove unused variable
* Remove redundant empty array checks
* Refactor Export::closeFile()
* Simplify else statement
* Remove redundant else
* Refactor TablePartitionDefinition::getDetails
* Simpler returns
* Add types for getCellContent()
* Remove useless method mngInsideStructComm

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-24 12:54:23 -03:00
Maurício Meneghini Fauth
47238d6c8c
Fix ImportController failing test and other minor fixes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-14 13:33:37 -03:00
ru-asdx
3794031ebc
Ref #17769 - Replace superglobals with ServerRequest in Import & Export Controllers (#17949)
* Replace superglobals with ServerRequest in Import & Export Controllers

Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>

* small fixes

Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>

* fixes

Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>

Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
2022-12-14 12:04:38 -03:00
Maurício Meneghini Fauth
5ab7640bc7
Remove force_file_* global vars and param
Uses a HTML data attribute instead.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-21 17:30:55 -03:00
Maurício Meneghini Fauth
de9884f562
Replace escapeString with quoteString in ImportController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-12 11:42:09 -03:00
William Desportes
e56633effc
Merge branch 'QA_5_2'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-11-12 14:25:32 +01:00
Kamil Tekiela
b4e22b83d7
Fix import/export escaping
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-03 21:16:42 +01:00
Maurício Meneghini Fauth
66e2650e06
Replace Core::fatalError() calls in controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-31 20:25:55 -03:00
SIVADAS P R
12656141f6 Refactored Bookmark::get() for DatabaseName
Signed-off-by: SIVADAS P R <sivadasrajan@gmail.com>
2022-10-21 01:52:09 +05:30
Maurício Meneghini Fauth
3890d11dd8
Fix some coding style issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-16 17:18:54 -03:00
Maurício Meneghini Fauth
059705f06e
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-11 19:53:54 -03:00
Maurício Meneghini Fauth
72a6045f06 Fix some errors reported by Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-11 18:19:07 -03:00
Maurício Meneghini Fauth
a56b425a2a
Extract /console/bookmark/add action from ImportController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-21 00:06:14 -03:00
Maurício Meneghini Fauth
c2018c4c21
Extract /console/bookmark/refresh action from ImportController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-20 21:55:28 -03:00
Maurício Meneghini Fauth
3c618c22a9
Add ServerRequest parameter to all controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-28 01:00:08 -03:00
Maurício Meneghini Fauth
10b937511d
Replace $analyzedSqlResults array with StatementInfo object
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-05-24 21:35:30 -03:00
Kamil Tekiela
d043ceedc6 Refactor $sql_data
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-03-17 20:46:27 +00:00
Maurício Meneghini Fauth
5950693fb3
Fix possible undefined globals
Related to https://github.com/phpmyadmin/phpmyadmin/pull/17427.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-10 18:05:21 -03:00
Maurício Meneghini Fauth
f940693c75
Move Util::checkParameters method to the AbstractController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 22:59:33 -03:00
Maurício Meneghini Fauth
1438cb211e
Replace global keyword with $GLOBALS
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 17:31:11 -03:00
Maurício Meneghini Fauth
58ed5bfa9e
Extract Simulate DML action from ImportController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-27 18:37:15 -03:00
Maurício Meneghini Fauth
2d56a8baac
Move Import and ImportStatus ctrls to Controllers\Import ns
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-27 10:27:28 -03:00