Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16368

DI container always rebuilds itself when defined('DEBUG') is true and extensions use Composer for dependencies due to out-of-order freshness checks

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.3.0
    • 3.3.1-RC1
    • Extensions
    • None

    Description

      The newer version of Symfony used by phpBB 3.3 includes a new ComposerResource type which tracks vendor dependencies installed via Composer.

      If any extensions with their own Composer dependencies are loaded by phpBB, the vendor directories of those extensions will be serialised into the $config_cache in phpbb\di\container_builder::get_container.

      If debug mode is enabled on the config cache (which is determined by defined('DEBUG')), ComposerResource will test for freshness by comparing the current list of vendor directory autoloaders with the saved list, and it will always fail because the extensions’ autoloaders aren’t loaded at the time of the freshness check, so it will think those directories were deleted and the cache is stale, even though it is not.

      To fix this, $config_cache->isFresh() should be called only after the extensions’ autoloaders have been loaded. A patch is included with this ticket.

      Attachments

        Activity

          People

            Marc Marc
            Snover Snover [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: