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

New callback / hook xxx_before_session_start

    XMLWordPrintable

Details

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-75014-before-session
    • Hide
      1. Pick a random plugin and add a test callback:

        // mod/resource/lib.php
        function mod_resource_before_session_start() {
            error_log("hello world");
        }
        

      2. Purge caches:

        php admin/cli/purge_caches.php
        

      3. Tail the apache error log:

        tail -f /var/log/apache2/error.log
        

        Note: This may be in a different location depending on system.

      4. Load any page in Moodle
        1. Confirm that you see the string "hello world" in the error log
      5. Replace the call to error log with an exception:

        function mod_resource_before_session_start(){
            throw new Exception('test');
        }
        

      6. Reload the page
        1. Confirm that you there was an error shown on screen, and in the error log
        2. Confirm that the page still loaded as normal 
      Show
      Pick a random plugin and add a test callback: // mod/resource/lib.php function mod_resource_before_session_start() { error_log("hello world"); } Purge caches: php admin/cli/purge_caches.php Tail the apache error log: tail -f /var/log/apache2/error.log Note: This may be in a different location depending on system. Load any page in Moodle Confirm that you see the string "hello world" in the error log Replace the call to error log with an exception: function mod_resource_before_session_start(){ throw new Exception('test'); } Reload the page Confirm that you there was an error shown on screen, and in the error log Confirm that the page still loaded as normal  

    Description

      Very similar to xxx_after_config but fires a little earlier in the bootstrap:

      https://github.com/moodle/moodle/blob/master/lib/setup.php#L820

      Split from MDL-74954 and hopefully that will get resolved quickly and not block this one.

      Attachments

        Issue Links

          Activity

            People

              brendanheywood Brendan Heywood
              brendanheywood Brendan Heywood
              Kevin Pham Kevin Pham
              Ilya Tregubov Ilya Tregubov
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                28/Nov/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 25 minutes
                  25m