Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-16178

Container_builder and Container don't use the same cache_dir when cache dir is overridden via env parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3.3-RC1
    • 3.2.8
    • Caching (ACM)

      The container_builder allows for the cache directory to be overridden by $SERVER['PHPBB____core__cache_dir']. This is because get_core_parameters wants it values to be extended and overwritten by get_env_parameters, which will read PHPBB__ keys from $_SERVER.

      So we can set a custom cache directory via:

      ```
      $_SERVER['PHPBB____core__cache_dir'] = '/some/path';
      ```

      When the container is built (via get_container) the application will use our supplied cache directory, but, the container_builder will create the autoloader and container cache files in phpbb_root_path/cache/<env>. This seems like inconsistent behavior. It would be more consistent if the container_builder would also use the overwritten cache_dir.

      This also solves/relates to tickets the following tickets PHPBB3-15649, PHPBB3-10113, PHPBB3-9610 and PHPBB3-10398, and maybe more.

      I've attached a test file which demonstrates the buggy behavior, and contains a (skipped) test for the desired behavior.

      The Pull Request for this fix can be found here: https://github.com/phpbb/phpbb/pull/5707

            Marc Marc
            j-angnoe j-angnoe [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: