phpmyadmin icon indicating copy to clipboard operation
phpmyadmin copied to clipboard

Extract `/setup/index.php` entry point to the `/setup` route

Open MauricioFauth opened this issue 3 years ago • 4 comments

The /setup entry point were removed and was moved to the /setup route.

For example:

- http://localhost/setup/index.php
+ http://localhost/index.php?route=/setup

This was made basically for two reasons. To have only one entry point (index.php) and to have only one call to Common::run method. This will make easier to improve the Common class.

MauricioFauth avatar Aug 09 '22 06:08 MauricioFauth

I'm not sure if this should be done in 5.3.0 or 6.0.0. What do you think about this? @ibennetch @williamdes

MauricioFauth avatar Aug 09 '22 06:08 MauricioFauth

Codecov Report

Merging #17681 (45e8c38) into master (d85cb55) will increase coverage by 0.02%. The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master   #17681      +/-   ##
============================================
+ Coverage     53.77%   53.79%   +0.02%     
- Complexity    16873    16903      +30     
============================================
  Files           615      614       -1     
  Lines         60068    60044      -24     
============================================
+ Hits          32301    32302       +1     
+ Misses        27767    27742      -25     
Flag Coverage Δ
dbase-extension 53.70% <0.00%> (+0.02%) :arrow_up:
recode-extension 53.68% <0.00%> (+0.02%) :arrow_up:
unit-7.2-ubuntu-latest 53.68% <0.00%> (+0.07%) :arrow_up:
unit-7.3-ubuntu-latest 53.95% <0.00%> (+0.01%) :arrow_up:
unit-7.4-ubuntu-latest 53.97% <0.00%> (+0.01%) :arrow_up:
unit-8.0-ubuntu-latest 54.03% <0.00%> (+<0.01%) :arrow_up:
unit-8.1-ubuntu-latest 53.89% <0.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
libraries/classes/Common.php 15.25% <0.00%> (-0.82%) :arrow_down:
...aries/classes/Controllers/Setup/MainController.php 0.00% <0.00%> (ø)
...classes/Controllers/Setup/ShowConfigController.php 0.00% <0.00%> (ø)
...s/classes/Controllers/Setup/ValidateController.php 0.00% <0.00%> (ø)
libraries/routes.php 0.00% <0.00%> (ø)
libraries/services_controllers.php 0.00% <ø> (ø)
libraries/classes/Header.php 86.86% <0.00%> (-1.10%) :arrow_down:
libraries/classes/Plugins/Export/ExportOdt.php 89.17% <0.00%> (+0.25%) :arrow_up:
libraries/classes/Template.php 85.10% <0.00%> (+6.38%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 09 '22 06:08 codecov[bot]

I think that for some packaging reasons and historical reasons we should keep the setup folder But if the folder is removed all the setup routes should not work

We should think the setup feature as a separate feature that users should be able to remove by simple file deletes (many users do that in fact and do file guessing for that)

Besides that maybe for other users it could also be nice that the main router is able to handle setup routes (Google app platform for example) But if it is too complicated I think we can conclude they can do the setup by other means

What about the having a file (/setup/index.php) that redirects to /index.php?route=/setup and if this file/directory is deleted, then the /setup route is disabled?

We could also introduce a configuration directive that disables the /setup route, even if the setup directory is available.

MauricioFauth avatar Sep 01 '22 20:09 MauricioFauth

What about the having a file (/setup/index.php) that redirects to /index.php?route=/setup and if this file/directory is deleted, then the /setup route is disabled?

That an interesting idea But I would prefer the setup routes to be separated in a separate file so they can be thrown out my a simple rm command

We could also introduce a configuration directive that disables the /setup route, even if the setup directory is available.

I am not sure this is a good thing for us, let's keep the setup feature as a separate module that file deletes can remove. We still can have a setup/index.php file and libraries/setup code files. That would mean a folder and an entry point to delete for any user or package maintainer

williamdes avatar Sep 01 '22 21:09 williamdes