public function warmUp($cacheDir)
{
foreach ($this->paths as $path) {
if (!is_dir($path)) {
if (false === @mkdir($path, 0777, true)) {
throw new \RuntimeException(sprintf('Unable to create the HTMLPurifier Serializer cache directory "%s".', $path));
}
} elseif (!is_writable($path)) {
throw new \RuntimeException(sprintf('The HTMLPurifier Serializer cache directory "%s" is not writeable for the current system user.', $path));
}
}
// build htmlPurifier cache for HTML/CSS & URIs with the other Symfony cache warmups. Fixes issue #22
$this->htmlPurifier->purify('<div style="border: thick">-2</div>');
$this->htmlPurifier->purify('<div style="background:url(\'http://www.example.com/x.gif\');">');
}