public function PoStreamReader::open in Service Container 7.2
Same name and namespace in other branches
- 7 lib/Drupal/Component/Gettext/PoStreamReader.php \Drupal\Component\Gettext\PoStreamReader::open()
Implements Drupal\Component\Gettext\PoStreamInterface::open().
Opens the stream and reads the header. The stream is ready for reading items after.
Throws
Exception If the URI is not yet set.
Overrides PoStreamInterface::open
File
- lib/
Drupal/ Component/ Gettext/ PoStreamReader.php, line 157 - Contains \Drupal\Component\Gettext\PoStreamReader.
Class
- PoStreamReader
- Implements Gettext PO stream reader.
Namespace
Drupal\Component\GettextCode
public function open() {
if (!empty($this->_uri)) {
$this->_fd = fopen($this->_uri, 'rb');
$this
->readHeader();
}
else {
throw new \Exception('Cannot open stream without URI set.');
}
}