Commit Graph

217 Commits

Author SHA1 Message Date
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
c7855f6e95
Create the PhpMyAdmin\Replication namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-20 14:16:01 -03:00
Kamil Tekiela
1c0264f043 Small refactoring in Server/Plugins
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-03 20:44:49 -03:00
Kamil Tekiela
276577ca2a
Remove $GLOBALS['PMA_PHP_SELF'] (#18149)
* Remove $GLOBALS['PMA_PHP_SELF']

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

* Remove $GLOBALS['PMA_PHP_SELF'] from tests

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

* Moved cleanupPathInfo to Routing

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

* Remove parse_url from getRootPath

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

* Update baselines

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

* Remove invalid tests

Surely, we never expect PATH to be backslash delimited. The code is not designed to handle this and the tests for this don't make much sense.

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

* Fix trailing slash in path

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

---------

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-27 17:56:27 -03:00
Maurício Meneghini Fauth
16a0660a78
Add native property types to test classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-27 01:17:22 -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
Maurício Meneghini Fauth
cb67fa306d
Remove Reflection's setAccessible() method
This method is no-op since PHP 8.1.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-21 20:35:45 -03:00
Kamil Tekiela
cfe54a501b Add union types
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 15:23:28 +00:00
Kamil Tekiela
f7524fd3b9
Minor code refactoring of Privileges.php (#17993)
* Small fixes
* Replace escapeString with quoteString
This also fixes bug with $_POST['old_username'].
* Add userExists() method
* Merge if statements
* Use ServerRequest for $initial
* Extract getExportPageTitle from getExportUserDefinitionTextarea
* Update baselines
* Complete redesign of getCurrentAuthenticationPlugin()
* Add method getEmptyUserNotice()
* Remove redundant variable sets and unsets
* Add method checkStructureOfPrivilegeTable()
* Remove testGetHtmlForViewUsersError()
* Privatize getAddUserHtmlFieldset
* Improve tests for mysql.user table checks

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-28 20:40:30 -03:00
Maurício Meneghini Fauth
41dec1effc
Extract connection type constants to the Connection class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-17 02:21:27 -03:00
Maurício Meneghini Fauth
c95b64afeb
Remove globals from the Replication class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-13 17:12:23 -03:00
Kamil Tekiela
65ab1608f8 Remove dependency in DatabasesController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-16 20:58:48 +00:00
Kamil Tekiela
b29eccd70b Remove $params
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-30 22:20:19 +00:00
Maurício Meneghini Fauth
5f7ab155fd
Update Psalm and PHPStan baselines
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-30 15:46:06 -03:00
ru-asdx
eff7e23b60
Ref #17769 - Replace superglobals with ServerRequest in Server/Status (#17912)
* Replace superglobals with ServerRequest in Server/Status

Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
2022-11-30 14:30:46 -03:00
Maurício Meneghini Fauth
d0d90551c3 Remove the dblist global variable
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-13 21:08:00 -03:00
Kamil Tekiela
656ddda704 Refactor BinlogController.php
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-08 11:59:05 +00:00
Maurício Meneghini Fauth
456be438ea
Merge pull request #17872 from kamil-tekiela/Remove-$params-2
Refactoring of Processes.php
2022-11-06 17:01:07 -03:00
Kamil Tekiela
94ba7d69d2 Remove $params array
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-05 21:24:10 +00:00
Kamil Tekiela
aa3b4ed737 Refactoring of Processes.php
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-05 21:13:12 +00:00
Kamil Tekiela
a5a81d159f Send DBI to Data using DI
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-02 15:15:58 +00: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
346923e20a
Set dbi only when the test needs it
Related to https://github.com/phpmyadmin/phpmyadmin/pull/17637

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-14 02:21:45 -03:00
Maurício Meneghini Fauth
63d57b1f1c
Push dbi and dummyDbi members down
The idea is to only load the DBI when needed.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-13 00:15:53 -03:00
Maurício Meneghini Fauth
72a69471e8
Remove the AbstractTestCase::assertAllSelectsConsumed method
Uses the DummyDbi method instead.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-11 16:38:37 -03:00
Maurício Meneghini Fauth
065d6d618c
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-06-10 00:40:13 -03:00
Maurício Meneghini Fauth
3412fb2c03
Add ChangeLog entry for #17271
Fixes #17271

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-06-10 00:27:14 -03:00
Maurício Meneghini Fauth
eb3703882b
Move Routing::getCurrentRoute to ServerRequest
The route is retrieved from the request, so it makes sense to move the
method to the Http\ServerRequest class.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-06-06 23:36:57 -03:00
Liviu-Mihail Concioiu
fb1afbe444 Fix database names dissapearing from Processes tab
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
2022-05-30 00:44:38 +02:00
Liviu-Mihail Concioiu
e9a5ec01f5 Revert "Fix database names dissapearing from Processes tab"
This reverts commit af4434dee2.
2022-05-30 00:39:39 +02:00
Liviu-Mihail Concioiu
af4434dee2 Fix database names dissapearing from Processes tab
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
2022-05-29 19:54:04 +02:00
Maurício Meneghini Fauth
d58057daec
Extract Database\PrivilegesController from Server\PrivilegesController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-05-27 17:13:23 -03:00
Maurício Meneghini Fauth
4d7cb34a68
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-05-15 17:27:03 -03:00
Maurício Meneghini Fauth
9f076774e5
Remove table-light CSS classes
These classes were added by 6408b7179a.
However they aren't exactly the same as thead-light classes that exists
in Bootstrap 4.

Related to https://github.com/phpmyadmin/phpmyadmin/issues/17455.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-05-14 17:31:31 -03:00
Maurício Meneghini Fauth
a9de979397 Inline dbi creation in some test classes
Creates a new instance of DatabaseInterface class for each test.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-18 21:50:18 -03:00
Maurício Meneghini Fauth
aa829af98c
Add factory for Dbi in AbstractTestCase class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-17 15:22:45 -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
81cfa99df4
Move Advisor class to PhpMyAdmin\Advisory namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-02-24 13:16:19 -03:00
Maurício Meneghini Fauth
b3104dfa6d
Add basic test for Server\PrivilegesController class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-28 14:23:54 -03:00
Kamil Tekiela
f38d3baa31 Remove $options parameter from fetchResult
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-01 01:46:17 +00:00
Kamil Tekiela
47a039d70c Implement ResultInterface & MysqliResult
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-31 23:59:24 +00:00
Maurício Meneghini Fauth
fa5c684f27
Replace the master/slave terminology
Replaces master with primary and slave with replica.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-18 14:26:56 -03:00
Maurício Meneghini Fauth
aaee7961c1
Remove Template dependency from Relation class
Related to 2299a62e49.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-17 12:09:14 -03:00
Maurício Meneghini Fauth
c411121fd8
Move Relation classes into the ConfigStorage namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-17 12:09:13 -03:00
Kamil Tekiela
51f4017b32
Refactor destroy controller (#17194)
* Remove redundant conditions

They were always true. First, the variable is set to -1.
If the variable is -1, then set it to Message.
If the variable is Message then set the JSON array. All of this is
redundant.

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

* $sqlQuery is not used anywhere

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

* Enforce $selected to be an array

I can't remove it as it is a global. Previously, it was set to a POST
variable. Since we validate that the variable is set and is not null,
we can use the value from $params. If we validate that it's also an
array we can replace for loop with foreach.
There is no passing by reference, so this change should be safe.

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

* Replace $rebuildDatabaseList with input validation

The validation message says 'No databases selected.' so I assume that
we should check that we actually got at least one entry in the list.
If that is true, then the $rebuildDatabaseList is not needed and the
condition redundant.

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

* drop_selected_dbs is always set and is redundant

I am not sure if this is necessary. The AJAX request sends a value of "1"
but the code doesn't really do anything with it other than checking if
it is actually set. Is there some other path possible?

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

* Flatten the array with a single element

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

* Remove redundant isset

The variable is set, so !isset === is_null. Why check for null if we can
check just for !is_array.

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

* Update psalm-baseline.xml

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

* Adhere to the coding standard

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-19 14:26:04 -03:00
Maurício Meneghini Fauth
3e0856c77b
Remove useless string concatenations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-27 21:40:22 -03:00
Maurício Meneghini Fauth
f00d70cccb
Remove useless whitespaces
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-15 17:05:40 -03:00
Maurício Meneghini Fauth
83091680cc
Extract actions from controllers to new controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-10 17:55:05 -03:00