|
@@ 217-227 (lines=11) @@
|
| 214 |
|
*/ |
| 215 |
|
public function getReader($reInitiate = false) : ReaderInterface |
| 216 |
|
{ |
| 217 |
|
if ($reInitiate === true || $this->reader === null) { |
| 218 |
|
$directory = $this->getDataDirectory(); |
| 219 |
|
|
| 220 |
|
if (!$this->isDirectoryReadable($directory)) { |
| 221 |
|
throw new ParserConfigurationException("Directory '$directory' is not readable.", 1458974128); |
| 222 |
|
} |
| 223 |
|
|
| 224 |
|
$this->reader = new Reader($directory); |
| 225 |
|
$this->reader->setPropertyFilter($this->getPropertyFilter()); |
| 226 |
|
$this->reader->setDataVersionHash($this->getDataVersionHash()); |
| 227 |
|
} |
| 228 |
|
|
| 229 |
|
return $this->reader; |
| 230 |
|
} |
|
@@ 244-254 (lines=11) @@
|
| 241 |
|
*/ |
| 242 |
|
public function getWriter() : WriterInterface |
| 243 |
|
{ |
| 244 |
|
if ($this->writer === null) { |
| 245 |
|
$directory = $this->getDataDirectory(); |
| 246 |
|
|
| 247 |
|
if (!$this->isDirectoryWritable($directory)) { |
| 248 |
|
throw new ParserConfigurationException("Directory '$directory' is not writable.", 1458974129); |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
$this->writer = new Writer($directory, $this->getSource()); |
| 252 |
|
$this->writer->setPropertyFilter($this->getPropertyFilter()); |
| 253 |
|
$this->writer->setDataVersionHash($this->getDataVersionHash()); |
| 254 |
|
} |
| 255 |
|
|
| 256 |
|
return $this->writer; |
| 257 |
|
} |