42 private $mBuffer =
'';
54 self::$sourceRegistrations[$id] =
$source;
64 if ( !isset( self::$sourceRegistrations[$id] ) ) {
67 return self::$sourceRegistrations[$id]->isSeekable();
75 public static function seekSource(
string $id,
int $offset ) {
76 if ( !isset( self::$sourceRegistrations[$id] ) ) {
79 return self::$sourceRegistrations[$id]->seek( $offset );
90 $url = parse_url(
$path );
91 if ( !isset( $url[
'host'] ) ) {
96 if ( !isset( self::$sourceRegistrations[$id] ) ) {
100 $this->mSource = self::$sourceRegistrations[$id];
113 while ( !$leave && !$this->mSource->atEnd() &&
114 strlen( $this->mBuffer ) < $count
116 $read = $this->mSource->readChunk();
118 if ( !strlen( $read ) ) {
122 $this->mBuffer .= $read;
125 if ( strlen( $this->mBuffer ) ) {
126 $return = substr( $this->mBuffer, 0, $count );
127 $this->mBuffer = substr( $this->mBuffer, $count );
130 $this->mPosition += strlen( $return );
147 return $this->mPosition;
154 return $this->mSource->atEnd();
163 $result[
'dev'] = $result[0] = 0;
164 $result[
'ino'] = $result[1] = 0;
165 $result[
'mode'] = $result[2] = 0;
166 $result[
'nlink'] = $result[3] = 0;
167 $result[
'uid'] = $result[4] = 0;
168 $result[
'gid'] = $result[5] = 0;
169 $result[
'rdev'] = $result[6] = 0;
170 $result[
'size'] = $result[7] = 0;
171 $result[
'atime'] = $result[8] = 0;
172 $result[
'mtime'] = $result[9] = 0;
173 $result[
'ctime'] = $result[10] = 0;
174 $result[
'blksize'] = $result[11] = 0;
175 $result[
'blocks'] = $result[12] = 0;
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.
This is a horrible hack used to keep source compatibility.
resource null $context
Must exists on stream wrapper class.
stream_open( $path, $mode, $options, &$opened_path)
static ImportSource[] $sourceRegistrations
static seekSource(string $id, int $offset)
static isSeekableSource(string $id)
static registerSource(ImportSource $source)
Source interface for XML import.