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

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

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE
    • MOODLE_311_MDL-70362
    • master-MDL-70362
    • 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

            mikhailgolenkov Misha Golenkov
            mikhailgolenkov Misha Golenkov
            Dmitrii Metelkin Dmitrii Metelkin
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Anna Carissa Sadia Anna Carissa Sadia
            David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              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