Fixes #14811: Fixed yii\filters\HttpCache to work with PHP 7.2

This commit is contained in:
Alexander Makarov
2018-02-11 12:08:01 +03:00
committed by GitHub
parent e6f5c46cdc
commit 25f8b263e5
4 changed files with 28 additions and 2 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.14 under development
------------------------
- Bug #14811: Fixed `yii\filters\HttpCache` to work with PHP 7.2 (samdark)
- Bug #8983: Only truncate the original log file for rotation (matthewyang, developeruz)
- Bug #11401: Fixed `yii\web\DbSession` concurrency issues when writing and regenerating IDs (samdark, andreasanta, cebe)
- Bug #13034: Fixed `normalizePath` for windows network shares that start with two backslashes (developeruz)

View File

@ -189,7 +189,8 @@ class HttpCache extends ActionFilter
header_remove('Last-Modified');
header_remove('Pragma');
}
session_cache_limiter($this->sessionCacheLimiter);
Yii::$app->getSession()->setCacheLimiter($this->sessionCacheLimiter);
}
$headers = Yii::$app->getResponse()->getHeaders();

View File

@ -954,4 +954,28 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
$this->frozenSessionData = null;
}
}
/**
* Set cache limiter
*
* @param string $cacheLimiter
* @since 2.0.14
*/
public function setCacheLimiter($cacheLimiter)
{
$this->freeze();
session_cache_limiter($cacheLimiter);
$this->unfreeze();
}
/**
* Returns current cache limiter
*
* @return string current cache limiter
* @since 2.0.14
*/
public function getCacheLimiter()
{
return session_cache_limiter();
}
}