本文整理汇总了PHP中Symfony\Component\HttpKernel\HttpCache\HttpCache::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpCache::__construct方法的具体用法?PHP HttpCache::__construct怎么用?PHP HttpCache::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\HttpCache\HttpCache
的用法示例。
在下文中一共展示了HttpCache::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param HttpKernelInterface $kernel An HttpKernelInterface instance
*/
public function __construct(HttpKernelInterface $kernel)
{
$store = new Store($kernel->getCacheDir().'/http_cache');
$esi = new Esi();
parent::__construct($kernel, $store, $esi, array_merge(array('debug' => $kernel->isDebug()), $this->getOptions()));
}
示例2: __construct
/**
* Constructor.
*
* @param HttpKernelInterface $kernel An HttpKernelInterface instance
* @param array $options
*/
public function __construct(HttpKernelInterface $kernel, $options)
{
$this->kernel = $kernel;
if (isset($options['cache_dir'])) {
$this->cacheDir = $options['cache_dir'];
}
$this->options = array_merge(array('purge_allowed_ips' => array('127.0.0.1', '::1'), 'debug' => false, 'cache_cookies' => array('shop', 'currency', 'x-cache-context-hash')), $options);
parent::__construct($kernel, $this->createStore(), $this->createEsi(), $this->options);
}
示例3: __construct
/**
* Constructor.
*
* @param HttpKernelInterface $kernel An HttpKernelInterface instance
* @param array $options
*/
public function __construct(HttpKernelInterface $kernel, $options)
{
$this->kernel = $kernel;
if (isset($options['cache_dir'])) {
$this->cacheDir = $options['cache_dir'];
}
parent::__construct(
$kernel,
$this->store = $this->createStore(),
$this->esi = $this->createEsi(),
$options
);
}
示例4: __construct
/**
* Constructor.
*
* @param HttpKernelInterface $kernel An HttpKernelInterface instance
* @param string $cacheDir The cache directory (default used if null)
*/
public function __construct(HttpKernelInterface $kernel, $cacheDir = null)
{
$this->kernel = $kernel;
$this->cacheDir = $cacheDir;
parent::__construct($kernel, $this->createStore(), $this->createEsi(), array_merge(array('debug' => $kernel->isDebug()), $this->getOptions()));
}
示例5: __construct
public function __construct(HttpKernelInterface $kernel, $options = array())
{
parent::__construct($kernel, new Store($kernel->getCacheDir() . '/http_cache'), new Esi(), array_merge(array('debug' => $kernel->isDebug()), $options));
}