PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.28
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.28
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / vendor / openspout / openspout / src / Reader / ODS / Reader.php

Reader.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.28, at vendor/openspout/openspout/src/Reader/ODS/Reader.php

66 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\OpenSpout\Reader\ODS;
4
5 use FluentCart\OpenSpout\Common\Exception\IOException;
6 use FluentCart\OpenSpout\Reader\ODS\Creator\InternalEntityFactory;
7 use FluentCart\OpenSpout\Reader\ReaderAbstract;
8 /**
9 * This class provides support to read data from a ODS file.
10 */
11 class Reader extends ReaderAbstract
12 {
13 /** @var \ZipArchive */
14 protected $zip;
15 /** @var SheetIterator To iterator over the ODS sheets */
16 protected $sheetIterator;
17 /**
18 * Returns whether stream wrappers are supported.
19 *
20 * @return bool
21 */
22 protected function doesSupportStreamWrapper()
23 {
24 return \false;
25 }
26 /**
27 * Opens the file at the given file path to make it ready to be read.
28 *
29 * @param string $filePath Path of the file to be read
30 *
31 * @throws \OpenSpout\Common\Exception\IOException If the file at the given path or its content cannot be read
32 * @throws \OpenSpout\Reader\Exception\NoSheetsFoundException If there are no sheets in the file
33 */
34 protected function openReader($filePath)
35 {
36 /** @var InternalEntityFactory $entityFactory */
37 $entityFactory = $this->entityFactory;
38 $this->zip = $entityFactory->createZipArchive();
39 if (\true === $this->zip->open($filePath)) {
40 /** @var InternalEntityFactory $entityFactory */
41 $entityFactory = $this->entityFactory;
42 $this->sheetIterator = $entityFactory->createSheetIterator($filePath, $this->optionsManager);
43 } else {
44 throw new IOException("Could not open {$filePath} for reading.");
45 }
46 }
47 /**
48 * Returns an iterator to iterate over sheets.
49 *
50 * @return SheetIterator To iterate over sheets
51 */
52 protected function getConcreteSheetIterator()
53 {
54 return $this->sheetIterator;
55 }
56 /**
57 * Closes the reader. To be used after reading the file.
58 */
59 protected function closeReader()
60 {
61 if (null !== $this->zip) {
62 $this->zip->close();
63 }
64 }
65 }
66