tractorcow / silverstripe-dynamiccache

Simple on the fly caching of dynamic content for Silverstripe
39 stars 27 forks source link

PHP 7.2 - session_cache_limiter warning #78

Open christopherdarling opened 6 years ago

christopherdarling commented 6 years ago

When running on PHP 7.2 and after fixing the Object issue (see https://github.com/christopherdarling/silverstripe-dynamiccache/tree/feature/php7.2) I'm getting a session warning on every request.

PR #76 will help with this but will still exist on those pages that do require a session to be started.

ERROR [Warning]: session_cache_limiter(): Cannot change cache limiter when session is active
IN GET /url
Line 61 in framework\main.php

Source
======
  52:   * @see Director::direct()
  53:   */
  54:  
  55:  /**
  56:   * Include the defines that set BASE_PATH, etc
  57:   */
  58:  require_once('core/Constants.php');
  59:  
  60:  // we handle our own cache headers in this application
* 61:  session_cache_limiter('');
  62:  
  63:  // IIS will sometimes generate this.
  64:  if(!empty($_SERVER['HTTP_X_ORIGINAL_URL'])) {
  65:   $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
  66:  }
  67:  

Trace
=====
session_cache_limiter()
main.php:61

include(framework\main.php)
DynamicCache.php:192

DynamicCache->yieldControl()
DynamicCache.php:422

DynamicCache->run(/url)
cache-main.php:89