Moodle
  1. Moodle
  2. MDL-36047

Cache API breaks on master using minimum required PHP version.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Libraries
    • Labels:
      None

      Description

      Using PHP 5.3.2 and perhaps close issues to that the Cache API causes a fatal error as soon as you visit the site:

      Fatal error: Can't inherit abstract function cache_is_key_aware::has() (previously declared abstract in cache_loader) in
      moodle/cache/classes/loaders.php on line 43 Call Stack: 0.0009 826960

      1. main() moodle/index.php:0 0.0011 839256
      2. require_once('moodle/config.php') moodle/index.php:31 0.0024 1170264
      3. require_once('moodle/lib/setup.php') moodle/config.php:31 0.1017 23470864
      4. require_once('moodle/cache/lib.php') moodle/lib/setup.php:479 0.1054 24507664
      5. require_once('moodle/cache/classes/loaders.php') moodle/cache/lib.php:38

      Cheers
      Sam

        Gliffy Diagrams

          Activity

          Hide
          Sam Hemelryk added a comment -

          Also one more bug for PHP versions <= 5.3.6:

          Errors in locallib_test.php:
          There were 3 errors:

          1) cache_config_writer_phpunit_tests::test_add_edit_delete_plugin_instance
          cache_exception: cache/Invalid cache plugin specified. The plugin does not extend the required class.

          moodle/cache/locallib.php:140
          moodle/cache/tests/locallib_test.php:168
          moodle/lib/phpunit/classes/advanced_testcase.php:76

          To re-run:
          phpunit cache_config_writer_phpunit_tests cache/tests/locallib_test.php

          2) cache_config_writer_phpunit_tests::test_set_mode_mappings
          cache_exception: cache/Invalid cache plugin specified. The plugin does not extend the required class.

          moodle/cache/locallib.php:140
          moodle/cache/tests/locallib_test.php:235
          moodle/lib/phpunit/classes/advanced_testcase.php:76

          To re-run:
          phpunit cache_config_writer_phpunit_tests cache/tests/locallib_test.php

          3) cache_config_writer_phpunit_tests::test_set_definition_mappings
          cache_exception: cache/Invalid cache plugin specified. The plugin does not extend the required class.

          moodle/cache/locallib.php:140
          moodle/cache/tests/locallib_test.php:263
          moodle/lib/phpunit/classes/advanced_testcase.php:76

          To re-run:
          phpunit cache_config_writer_phpunit_tests cache/tests/locallib_test.php

          FAILURES!
          Tests: 6, Assertions: 45, Errors: 3.

          Show
          Sam Hemelryk added a comment - Also one more bug for PHP versions <= 5.3.6: Errors in locallib_test.php: There were 3 errors: 1) cache_config_writer_phpunit_tests::test_add_edit_delete_plugin_instance cache_exception: cache/Invalid cache plugin specified. The plugin does not extend the required class. moodle/cache/locallib.php:140 moodle/cache/tests/locallib_test.php:168 moodle/lib/phpunit/classes/advanced_testcase.php:76 To re-run: phpunit cache_config_writer_phpunit_tests cache/tests/locallib_test.php 2) cache_config_writer_phpunit_tests::test_set_mode_mappings cache_exception: cache/Invalid cache plugin specified. The plugin does not extend the required class. moodle/cache/locallib.php:140 moodle/cache/tests/locallib_test.php:235 moodle/lib/phpunit/classes/advanced_testcase.php:76 To re-run: phpunit cache_config_writer_phpunit_tests cache/tests/locallib_test.php 3) cache_config_writer_phpunit_tests::test_set_definition_mappings cache_exception: cache/Invalid cache plugin specified. The plugin does not extend the required class. moodle/cache/locallib.php:140 moodle/cache/tests/locallib_test.php:263 moodle/lib/phpunit/classes/advanced_testcase.php:76 To re-run: phpunit cache_config_writer_phpunit_tests cache/tests/locallib_test.php FAILURES! Tests: 6, Assertions: 45, Errors: 3.
          Hide
          Sam Hemelryk added a comment -

          I've uploaded a patch to fix these two issues.

          Issue 1: was a bug when inheriting from multiple interfaces in PHP <= 5.3.3
          Issue 2: was a bug caused by using is_subclass_of in PHP <= 5.3.6

          Up for integration now, I'll talk nicely to the integrators

          Show
          Sam Hemelryk added a comment - I've uploaded a patch to fix these two issues. Issue 1: was a bug when inheriting from multiple interfaces in PHP <= 5.3.3 Issue 2: was a bug caused by using is_subclass_of in PHP <= 5.3.6 Up for integration now, I'll talk nicely to the integrators
          Hide
          Dan Poltawski added a comment -

          Integrated to master

          Show
          Dan Poltawski added a comment - Integrated to master
          Hide
          Dan Poltawski added a comment -

          Tested here an on ci servers, looks good.

          Show
          Dan Poltawski added a comment - Tested here an on ci servers, looks good.

            People

            • Assignee:
              Sam Hemelryk
              Reporter:
              Sam Hemelryk
              Integrator:
              Dan Poltawski
              Tester:
              Dan Poltawski
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: