Doctrine\Common\Cache\FileCache::__construct PHP Method

__construct() public method

Constructor.
public __construct ( string $directory, string $extension = '', $umask = 2 )
$directory string The cache directory.
$extension string The cache file extension.
    public function __construct($directory, $extension = '', $umask = 02)
    {
        // YES, this needs to be *before* createPathIfNeeded()
        if (!is_int($umask)) {
            throw new \InvalidArgumentException(sprintf('The umask parameter is required to be integer, was: %s', gettype($umask)));
        }
        $this->umask = $umask;
        if (!$this->createPathIfNeeded($directory)) {
            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));
        }
        // YES, this needs to be *after* createPathIfNeeded()
        $this->directory = realpath($directory);
        $this->extension = (string) $extension;
        $this->directoryStringLength = strlen($this->directory);
        $this->extensionStringLength = strlen($this->extension);
        $this->isRunningOnWindows = defined('PHP_WINDOWS_VERSION_BUILD');
    }