Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3.1-RC1
    • 3.3.0
    • Extensions
    • None

      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.

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

              Created:
              Updated:
              Resolved: