Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
@@ -16,20 +16,17 @@ namespace Symfony\Component\HttpKernel\CacheWarmer;
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @final since version 3.4
|
||||
* @final
|
||||
*/
|
||||
class CacheWarmerAggregate implements CacheWarmerInterface
|
||||
{
|
||||
protected $warmers = array();
|
||||
protected $optionalsEnabled = false;
|
||||
private $triggerDeprecation = false;
|
||||
private $warmers;
|
||||
private $optionalsEnabled = false;
|
||||
private $onlyOptionalsEnabled = false;
|
||||
|
||||
public function __construct($warmers = array())
|
||||
public function __construct(iterable $warmers = array())
|
||||
{
|
||||
foreach ($warmers as $warmer) {
|
||||
$this->add($warmer);
|
||||
}
|
||||
$this->triggerDeprecation = true;
|
||||
$this->warmers = $warmers;
|
||||
}
|
||||
|
||||
public function enableOptionalWarmers()
|
||||
@@ -37,6 +34,11 @@ class CacheWarmerAggregate implements CacheWarmerInterface
|
||||
$this->optionalsEnabled = true;
|
||||
}
|
||||
|
||||
public function enableOnlyOptionalWarmers()
|
||||
{
|
||||
$this->onlyOptionalsEnabled = $this->optionalsEnabled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warms up the cache.
|
||||
*
|
||||
@@ -48,6 +50,9 @@ class CacheWarmerAggregate implements CacheWarmerInterface
|
||||
if (!$this->optionalsEnabled && $warmer->isOptional()) {
|
||||
continue;
|
||||
}
|
||||
if ($this->onlyOptionalsEnabled && !$warmer->isOptional()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$warmer->warmUp($cacheDir);
|
||||
}
|
||||
@@ -62,29 +67,4 @@ class CacheWarmerAggregate implements CacheWarmerInterface
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since version 3.4, to be removed in 4.0, inject the list of clearers as a constructor argument instead.
|
||||
*/
|
||||
public function setWarmers(array $warmers)
|
||||
{
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
|
||||
$this->warmers = array();
|
||||
foreach ($warmers as $warmer) {
|
||||
$this->add($warmer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since version 3.4, to be removed in 4.0, inject the list of clearers as a constructor argument instead.
|
||||
*/
|
||||
public function add(CacheWarmerInterface $warmer)
|
||||
{
|
||||
if ($this->triggerDeprecation) {
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->warmers[] = $warmer;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user