MediaWiki master
ImportStringSource.php
Go to the documentation of this file.
1<?php
13namespace MediaWiki\Import;
14
23 private bool $mRead = false;
24
25 public function __construct(
26 private readonly string $string,
27 ) {
28 }
29
33 public function atEnd() {
34 return $this->mRead;
35 }
36
40 public function readChunk() {
41 if ( $this->atEnd() ) {
42 return false;
43 }
44 $this->mRead = true;
45 return $this->string;
46 }
47
51 public function isSeekable() {
52 return true;
53 }
54
59 public function seek( int $offset ) {
60 $this->mRead = false;
61 return 0;
62 }
63}
64
66class_alias( ImportStringSource::class, 'ImportStringSource' );
Used for importing XML dumps where the content of the dump is in a string.
__construct(private readonly string $string,)
Source interface for XML import.