? ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
9 Jan 2021

Closes #31901 replaces #31914

Summary of Changes

Improvements to the update:joomla:remove-old-files CLI Command

  • Adds an option for --dry-run
  • Adds an output change for very verbose mode -vv
  • Adds an output change for debug mode -vvv

--dry-run option is a standard for all Symfony based commands that do destructive things.

-v -vv -vvv options are a standard Symfony command option for increasing the verbosity to assist with debugging and gathering additional information from a command.

Also See #31941 for a proposal to rename this command to Joomla:update:cleanup but this PR can be applied without that one.

Testing Instructions

run these commands to create yourself some folders and files to then go on to delete with the CLI from this PR:

touch administrator/components/com_actionlogs/actionlogs.php
touch administrator/components/com_actionlogs/controller.php
mkdir -p templates/system/images
mkdir -p templates/system/html
mkdir -p templates/protostar/less
mkdir -p templates/protostar/language/en-GB
mkdir -p templates/protostar/language
mkdir -p templates/protostar/js
mkdir -p templates/protostar/img
mkdir -p templates/protostar/images/system

Apply PR.

Run these commands as a test of each new feature:

This command should show s summary, but not delete anything:
php cli/joomla.php update:joomla:remove-old-files --dry-run

Screenshot 2021-01-09 at 15 54 48

--

This command should show what files and folders will be deleted
php cli/joomla.php update:joomla:remove-old-files --dry-run -vv

Screenshot 2021-01-09 at 15 56 24

--

This command should show what files and folders are checked and what will be deleted (output is huge, so screenshots below are snipped to show important bits)
php cli/joomla.php update:joomla:remove-old-files --dry-run -vvv

Screenshot 2021-01-09 at 15 57 42

Screenshot 2021-01-09 at 15 57 53

--

You can then set up your folders/files with the test script above, and run any of these commands to ACTUALLY DELETE the files and folders.

php cli/joomla.php update:joomla:remove-old-files

Screenshot 2021-01-09 at 15 58 42

php cli/joomla.php update:joomla:remove-old-files -vv

Screenshot 2021-01-09 at 16 00 27

and lastly php cli/joomla.php update:joomla:remove-old-files -vvv but Im not going to show that output as its huge and meant for debugging.

Actual result BEFORE applying this Pull Request

Screenshot 2021-01-09 at 16 02 23

Expected result AFTER applying this Pull Request

As explained above

Documentation Changes Required

113ba90 9 Jan 2021 avatar PhilETaylor typo
avatar PhilETaylor PhilETaylor - open - 9 Jan 2021
avatar PhilETaylor PhilETaylor - change - 9 Jan 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Jan 2021
Category Administration com_admin Libraries
0a2266d 9 Jan 2021 avatar PhilETaylor typo
avatar PhilETaylor PhilETaylor - change - 9 Jan 2021
Labels Added: ?
avatar PhilETaylor PhilETaylor - change - 9 Jan 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 9 Jan 2021
avatar PhilETaylor PhilETaylor - change - 9 Jan 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 9 Jan 2021
avatar PhilETaylor PhilETaylor - change - 9 Jan 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 9 Jan 2021
avatar toivo
toivo - comment - 9 Jan 2021

I have tested this item successfully on 0a2266d

Tested successfully in Beta7-dev of 9 January.

PHP notices were reported each time the remove-old-files command was run
Notice: Undefined variable: supressOutput in C:\www\joomla4\administrator\components\com_admin\script.php on line 6275
Notice: Undefined variable: supressOutput in C:\www\joomla4\administrator\components\com_admin\script.php on line 6280


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31943.
avatar toivo
toivo - comment - 9 Jan 2021

I have tested this item successfully on 0a2266d

Tested successfully in Beta7-dev of 9 January.

PHP notices were reported each time the remove-old-files command was run
Notice: Undefined variable: supressOutput in C:\www\joomla4\administrator\components\com_admin\script.php on line 6275
Notice: Undefined variable: supressOutput in C:\www\joomla4\administrator\components\com_admin\script.php on line 6280


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31943.
avatar toivo toivo - test_item - 9 Jan 2021 - Tested successfully
e2f6bd6 9 Jan 2021 avatar PhilETaylor cs
avatar PhilETaylor
PhilETaylor - comment - 9 Jan 2021

@toivo supressOutput was renamed suppressOutput during my code style attempts - sorry - ready to test again now I have squashed the commits

avatar ceford
ceford - comment - 10 Jan 2021

I have tested this item successfully on 3f9d3ce

Works as described. But at the delete stage - best to delete with the -vv option first!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31943.

avatar ceford ceford - test_item - 10 Jan 2021 - Tested successfully
avatar alikon alikon - change - 10 Jan 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 10 Jan 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31943.

avatar alikon alikon - change - 10 Jan 2021
Status Ready to Commit Pending
avatar alikon
alikon - comment - 10 Jan 2021

I have tested this item successfully on 3f9d3ce


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31943.

avatar alikon alikon - test_item - 10 Jan 2021 - Tested successfully
avatar alikon alikon - change - 10 Jan 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 10 Jan 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31943.

avatar PhilETaylor
PhilETaylor - comment - 10 Jan 2021

@ceford Works as described. But at the delete stage - best to delete with the -vv option first!

Well not that level of control is in the hands of the person running the commands to delete things. Before there was no feedback at all. :-)

If you mean for testing this PR, then yes, you will need to run the creation commands to give you some test files/folders to delete after every delete (non --dry-run) command to give something for the next delete command to actually delete.

avatar ceford
ceford - comment - 10 Jan 2021

Sorry if my comment seemed unkind. It was meant for other testers. The testing instructions were excellent - amongst the best I have encountered.

avatar PhilETaylor
PhilETaylor - comment - 10 Jan 2021

Not unkind at all - I never took it that way at all :) Thanks for testing.

avatar drmenzelit drmenzelit - change - 12 Jan 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-01-12 10:08:51
Closed_By drmenzelit
Labels Added: ?
avatar drmenzelit drmenzelit - close - 12 Jan 2021
avatar drmenzelit drmenzelit - merge - 12 Jan 2021
avatar drmenzelit
drmenzelit - comment - 12 Jan 2021

Thanks

Add a Comment

Login with GitHub to post a comment