Browse Source

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

tags/2.0.14
Alexander Makarov 7 years ago committed by GitHub
parent
commit
25f8b263e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      framework/CHANGELOG.md
  2. 3
      framework/filters/HttpCache.php
  3. 24
      framework/web/Session.php
  4. 2
      tests/framework/web/session/CacheSessionTest.php

1
framework/CHANGELOG.md

@ -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)

3
framework/filters/HttpCache.php

@ -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();

24
framework/web/Session.php

@ -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();
}
}

2
tests/framework/web/CacheSessionTest.php → tests/framework/web/session/CacheSessionTest.php

@ -5,7 +5,7 @@
* @license http://www.yiiframework.com/license/
*/
namespace yiiunit\framework\web;
namespace yiiunit\framework\web\session;
use Yii;
use yii\caching\FileCache;
Loading…
Cancel
Save