mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	Fixes #14811: Fixed yii\filters\HttpCache to work with PHP 7.2
				
					
				
			This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							e6f5c46cdc
						
					
				
				
					commit
					25f8b263e5
				
			@ -4,6 +4,7 @@ Yii Framework 2 Change Log
 | 
				
			|||||||
2.0.14 under development
 | 
					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 #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 #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)
 | 
					- Bug #13034: Fixed `normalizePath` for windows network shares that start with two backslashes (developeruz)
 | 
				
			||||||
 | 
				
			|||||||
@ -189,7 +189,8 @@ class HttpCache extends ActionFilter
 | 
				
			|||||||
                header_remove('Last-Modified');
 | 
					                header_remove('Last-Modified');
 | 
				
			||||||
                header_remove('Pragma');
 | 
					                header_remove('Pragma');
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            session_cache_limiter($this->sessionCacheLimiter);
 | 
					
 | 
				
			||||||
 | 
					            Yii::$app->getSession()->setCacheLimiter($this->sessionCacheLimiter);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $headers = Yii::$app->getResponse()->getHeaders();
 | 
					        $headers = Yii::$app->getResponse()->getHeaders();
 | 
				
			||||||
 | 
				
			|||||||
@ -954,4 +954,28 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
 | 
				
			|||||||
            $this->frozenSessionData = null;
 | 
					            $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();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@
 | 
				
			|||||||
 * @license http://www.yiiframework.com/license/
 | 
					 * @license http://www.yiiframework.com/license/
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace yiiunit\framework\web;
 | 
					namespace yiiunit\framework\web\session;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use Yii;
 | 
					use Yii;
 | 
				
			||||||
use yii\caching\FileCache;
 | 
					use yii\caching\FileCache;
 | 
				
			||||||
		Reference in New Issue
	
	Block a user