for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EmanueleMinotto\DomainParserBundle\CacheWarmer;
use Pdp\HttpAdapter\HttpAdapterInterface;
use Pdp\PublicSuffixListManager;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmer;
/**
* Refresh domains list on cache warmup.
*
* @author Emanuele Minotto <[email protected]>
*/
class CachedDomainsListWarmer extends CacheWarmer
{
* Pdp Public Suffix List Manager HTTP adapter.
* @var HttpAdapterInterface|null
private $httpAdapter;
* Cache warmer constructor with optional dependency.
* @param HttpAdapterInterface|null $httpAdapter
public function __construct(HttpAdapterInterface $httpAdapter = null)
$this->httpAdapter = $httpAdapter;
}
* {@inheritdoc}
public function isOptional()
return true;
public function warmUp($cacheDir)
$manager = new PublicSuffixListManager($cacheDir);
if (null !== $this->httpAdapter) {
$manager->setHttpAdapter($this->httpAdapter);
$manager->refreshPublicSuffixList();