MediaWiki
master
ImportStringSource.php
Go to the documentation of this file.
1
<?php
13
namespace
MediaWiki\Import
;
14
22
class
ImportStringSource
implements
ImportSource
{
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
66
class_alias( ImportStringSource::class,
'ImportStringSource'
);
MediaWiki\Import\ImportStringSource
Used for importing XML dumps where the content of the dump is in a string.
Definition
ImportStringSource.php:22
MediaWiki\Import\ImportStringSource\readChunk
readChunk()
Definition
ImportStringSource.php:40
MediaWiki\Import\ImportStringSource\isSeekable
isSeekable()
Definition
ImportStringSource.php:51
MediaWiki\Import\ImportStringSource\seek
seek(int $offset)
Definition
ImportStringSource.php:59
MediaWiki\Import\ImportStringSource\__construct
__construct(private readonly string $string,)
Definition
ImportStringSource.php:25
MediaWiki\Import\ImportStringSource\atEnd
atEnd()
Definition
ImportStringSource.php:33
MediaWiki\Import\ImportSource
Source interface for XML import.
Definition
ImportSource.php:20
MediaWiki\Import
includes
Import
ImportStringSource.php
Generated on Mon Sep 7 2026 18:25:54 for MediaWiki by
1.10.0