本文整理匯總了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));
}