public function setDir($dir)
    {
        if (!is_dir($dir) && !@mkdir($dir, 0755, true)) {
            $message = sprintf('Failed to create directory "%s"', $dir);
            ($e = error_get_last()) && $message .= ': ' . $e['message'];
            throw new \RuntimeException($message);
        }
        $this->dir = realpath($dir);
        return $this;
    }
public function setDir($dir)
    {
        if (!is_dir($dir) && !@mkdir($dir, 0755, true)) {
            $message = sprintf('Failed to create directory "%s"', $dir);
            ($e = error_get_last()) && $message .= ': ' . $e['message'];
            throw new \RuntimeException($message);
        }
        $this->dir = realpath($dir);
        return $this;
    }
public function setDir ( $ dir ) { if ( ! is_dir ( $ dir ) && ! @ mkdir ( $ dir , 0755 , true ) ) { $ message = sprintf ( 'Failed to create directory "%s"' , $ dir ) ; ( $ e = error_get_last ( ) ) && $ message .= ': ' . $ e [ 'message' ] ; throw new \ RuntimeException ( $ message ) ; } $ this -> dir = realpath ( $ dir ) ; return $ this ; }
Set the cache directory

@param string $dir
@return $this
@throws \RuntimeException When failed to create the cache directory
Set the cache directory