You are here

public function XmlSitemapWriter::openUri in XML sitemap 8

Same name and namespace in other branches
  1. 2.x src/XmlSitemapWriter.php \Drupal\xmlsitemap\XmlSitemapWriter::openUri()

Opens and uri.

Parameters

string $uri: Uri to be opened.

Return value

bool Returns TRUE when uri was successfully opened.

Throws

XmlSitemapGenerationException If the file URI cannot be opened.

1 call to XmlSitemapWriter::openUri()
XmlSitemapWriter::__construct in src/XmlSitemapWriter.php
Constructors and XmlSitemapWriter object.

File

src/XmlSitemapWriter.php, line 85

Class

XmlSitemapWriter
Extended class for writing XML sitemap files.

Namespace

Drupal\xmlsitemap

Code

public function openUri($uri) {
  $return = parent::openUri($uri);
  if (!$return) {
    throw new XmlSitemapGenerationException("Could not open file {$uri} for writing.");
  }
  return $return;
}