src/PhpSigep/Cache/Storage/Adapter/FileSystemOptions.php
public function setCacheDir($cacheDir)
    {
        if ($cacheDir !== null) {
            if (!is_dir($cacheDir)) {
                throw new Exception\InvalidArgumentException(
                    "Cache directory '{$cacheDir}' not found or not a directory"
                );
            } elseif (!is_writable($cacheDir)) {
                throw new Exception\InvalidArgumentException(
                    "Cache directory '{$cacheDir}' not writable"
                );
            } elseif (!is_readable($cacheDir)) {
                throw new Exception\InvalidArgumentException(
                    "Cache directory '{$cacheDir}' not readable"
                );
            }

            $cacheDir = rtrim(realpath($cacheDir), DIRECTORY_SEPARATOR);
        } else {
            $cacheDir = sys_get_temp_dir();
        }

        $this->cacheDir = $cacheDir;

        return $this;
    }
public function setCacheDir($cacheDir)
    {
        if ($cacheDir !== null) {
            if (!is_dir($cacheDir)) {
                throw new Exception\InvalidArgumentException(
                    "Cache directory '{$cacheDir}' not found or not a directory"
                );
            } elseif (!is_writable($cacheDir)) {
                throw new Exception\InvalidArgumentException(
                    "Cache directory '{$cacheDir}' not writable"
                );
            } elseif (!is_readable($cacheDir)) {
                throw new Exception\InvalidArgumentException(
                    "Cache directory '{$cacheDir}' not readable"
                );
            }

            $cacheDir = rtrim(realpath($cacheDir), DIRECTORY_SEPARATOR);
        } else {
            $cacheDir = sys_get_temp_dir();
        }

        $this->cacheDir = $cacheDir;

        return $this;
    }
public function setCacheDir ( $ cacheDir ) { if ( $ cacheDir !== null ) { if ( ! is_dir ( $ cacheDir ) ) { throw new Exception \ InvalidArgumentException ( "Cache directory '{$cacheDir}' not found or not a directory" ) ; } elseif ( ! is_writable ( $ cacheDir ) ) { throw new Exception \ InvalidArgumentException ( "Cache directory '{$cacheDir}' not writable" ) ; } elseif ( ! is_readable ( $ cacheDir ) ) { throw new Exception \ InvalidArgumentException ( "Cache directory '{$cacheDir}' not readable" ) ; } $ cacheDir = rtrim ( realpath ( $ cacheDir ) , DIRECTORY_SEPARATOR ) ; } else { $ cacheDir = sys_get_temp_dir ( ) ; } $ this -> cacheDir = $ cacheDir ; return $ this ; }
Set cache dir

@param  string $cacheDir
@return FilesystemOptions
@throws Exception\InvalidArgumentException
Set cache dir