Constructor
string $directory Cache directory.:
string $directory Cache file extension.:
\InvalidArgumentException
public function __construct($directory, $extension = null) {
if (!is_dir($directory) && !@mkdir($directory, 0777, true)) {
throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $directory));
}
if (!is_writable($directory)) {
throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable.', $directory));
}
$this->directory = realpath($directory);
$this->extension = $extension ?: $this->extension;
}