Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70362

Add showdebugging and showsql options to admin/cli/uninstall_plugins.php

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_311_STABLE
    • Pull from Repository:
    • Pull 3.11 Branch:
      MOODLE_311_MDL-70362
    • Pull Master Branch:
      master-MDL-70362
    • Testing Instructions:
      Hide

      1. Turn off debugging:

      php admin/cli/cfg.php --name=debug --set=0

      2. Run the command from CLI:

      php admin/cli/uninstall_plugins.php

      3. Confirm, that help section has showsql and showdebugging mentioned.

      4. Run the command from CLI:

      php admin/cli/uninstall_plugins.php --plugins=auth_none --showsql
      

      5. Confirm, that the output shows SQLs.

      6. In order to emulate exception, edit /admin/cli/uninstall_plugins.php file and add the following code here (line 103):

      throw new coding_exception("Test"); 
      

      7. Run the command from CLI:

      php admin/cli/uninstall_plugins.php --plugins=auth_none --showdebugging
      

      8. Confirm, that the output shows debugging, something similar to:

      Default exception handler: Coding error detected, it must be fixed by a programmer: Test Debug: 
      Error code: codingerror
      * line 103 of /admin/cli/uninstall_plugins.php: coding_exception thrown
      !!! Coding error detected, it must be fixed by a programmer: Test !!!
      !! 
      Error code: codingerror !!
      !! Stack trace: * line 103 of /admin/cli/uninstall_plugins.php: coding_exception thrown
       !!
      

       

      Show
      1. Turn off debugging: php admin/cli/cfg.php --name=debug --set= 0 2. Run the command from CLI: php admin/cli/uninstall_plugins.php 3. Confirm , that help section has  showsql and  showdebugging mentioned. 4. Run the command from CLI: php admin/cli/uninstall_plugins.php --plugins=auth_none --showsql 5. Confirm , that the output shows SQLs. 6. In order to emulate exception, edit /admin/cli/uninstall_plugins.php file and add the following code  here  (line 103): throw new coding_exception( "Test" );  7. Run the command from CLI: php admin/cli/uninstall_plugins.php --plugins=auth_none --showdebugging 8. Confirm , that the output shows debugging, something similar to: Default exception handler: Coding error detected, it must be fixed by a programmer: Test Debug: Error code: codingerror * line 103 of /admin/cli/uninstall_plugins.php: coding_exception thrown !!! Coding error detected, it must be fixed by a programmer: Test !!! !! Error code: codingerror !! !! Stack trace: * line 103 of /admin/cli/uninstall_plugins.php: coding_exception thrown !!  

      Description

      Investigating long running "admin/cli/uninstall_plugins.php" CLI I found that it doesn't have showdebugging and showsql options as other CLI do.

      Would be good to add these two options.

        Attachments

          Activity

            People

            Assignee:
            mikhailgolenkov Mikhail Golenkov
            Reporter:
            mikhailgolenkov Mikhail Golenkov
            Peer reviewer:
            Dmitrii Metelkin Dmitrii Metelkin
            Integrator:
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Tester:
            Anna Carissa Sadia Anna Carissa Sadia
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/May/21

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 20 minutes
                1h 20m