ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
AMFReader Class Reference
+ Collaboration diagram for AMFReader:

Public Member Functions

 __construct (&$stream)
 
 readData ()
 
 readDouble ()
 
 readBoolean ()
 
 readString ()
 
 readObject ()
 
 readMixedArray ()
 
 readArray ()
 
 readDate ()
 
 readLongString ()
 
 readXML ()
 
 readTypedObject ()
 

Data Fields

 $stream
 

Detailed Description

Definition at line 473 of file module.audio-video.flv.php.

Constructor & Destructor Documentation

◆ __construct()

AMFReader::__construct ( $stream)

Definition at line 476 of file module.audio-video.flv.php.

References GuzzleHttp\Psr7\$stream.

476  {
477  $this->stream =& $stream;
478  }

Member Function Documentation

◆ readArray()

AMFReader::readArray ( )

Definition at line 600 of file module.audio-video.flv.php.

References $data, $i, and array.

600  {
601  $length = $this->stream->readLong();
602  $data = array();
603 
604  for ($i = 0; $i < $length; $i++) {
605  $data[] = $this->readData();
606  }
607  return $data;
608  }
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19

◆ readBoolean()

AMFReader::readBoolean ( )

Definition at line 554 of file module.audio-video.flv.php.

554  {
555  return $this->stream->readByte() == 1;
556  }

◆ readData()

AMFReader::readData ( )

Definition at line 480 of file module.audio-video.flv.php.

References $type.

480  {
481  $value = null;
482 
483  $type = $this->stream->readByte();
484  switch ($type) {
485 
486  // Double
487  case 0:
488  $value = $this->readDouble();
489  break;
490 
491  // Boolean
492  case 1:
493  $value = $this->readBoolean();
494  break;
495 
496  // String
497  case 2:
498  $value = $this->readString();
499  break;
500 
501  // Object
502  case 3:
503  $value = $this->readObject();
504  break;
505 
506  // null
507  case 6:
508  return null;
509  break;
510 
511  // Mixed array
512  case 8:
513  $value = $this->readMixedArray();
514  break;
515 
516  // Array
517  case 10:
518  $value = $this->readArray();
519  break;
520 
521  // Date
522  case 11:
523  $value = $this->readDate();
524  break;
525 
526  // Long string
527  case 13:
528  $value = $this->readLongString();
529  break;
530 
531  // XML (handled as string)
532  case 15:
533  $value = $this->readXML();
534  break;
535 
536  // Typed object (handled as object)
537  case 16:
538  $value = $this->readTypedObject();
539  break;
540 
541  // Long string
542  default:
543  $value = '(unknown or unsupported data type)';
544  break;
545  }
546 
547  return $value;
548  }
$type

◆ readDate()

AMFReader::readDate ( )

Definition at line 610 of file module.audio-video.flv.php.

References $timestamp.

610  {
611  $timestamp = $this->stream->readDouble();
612  $timezone = $this->stream->readInt();
613  return $timestamp;
614  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81

◆ readDouble()

AMFReader::readDouble ( )

Definition at line 550 of file module.audio-video.flv.php.

550  {
551  return $this->stream->readDouble();
552  }

◆ readLongString()

AMFReader::readLongString ( )

Definition at line 616 of file module.audio-video.flv.php.

616  {
617  return $this->stream->readLongUTF();
618  }

◆ readMixedArray()

AMFReader::readMixedArray ( )

Definition at line 579 of file module.audio-video.flv.php.

References $data, $key, and array.

579  {
580  // Get highest numerical index - ignored
581  $highestIndex = $this->stream->readLong();
582 
583  $data = array();
584 
585  while ($key = $this->stream->readUTF()) {
586  if (is_numeric($key)) {
587  $key = (float) $key;
588  }
589  $data[$key] = $this->readData();
590  }
591  // Mixed array record ends with empty string (0x00 0x00) and 0x09
592  if (($key == '') && ($this->stream->peekByte() == 0x09)) {
593  // Consume byte
594  $this->stream->readByte();
595  }
596 
597  return $data;
598  }
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18

◆ readObject()

AMFReader::readObject ( )

Definition at line 562 of file module.audio-video.flv.php.

References $data, $key, and array.

562  {
563  // Get highest numerical index - ignored
564 // $highestIndex = $this->stream->readLong();
565 
566  $data = array();
567 
568  while ($key = $this->stream->readUTF()) {
569  $data[$key] = $this->readData();
570  }
571  // Mixed array record ends with empty string (0x00 0x00) and 0x09
572  if (($key == '') && ($this->stream->peekByte() == 0x09)) {
573  // Consume byte
574  $this->stream->readByte();
575  }
576  return $data;
577  }
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18

◆ readString()

AMFReader::readString ( )

Definition at line 558 of file module.audio-video.flv.php.

558  {
559  return $this->stream->readUTF();
560  }

◆ readTypedObject()

AMFReader::readTypedObject ( )

Definition at line 624 of file module.audio-video.flv.php.

624  {
625  $className = $this->stream->readUTF();
626  return $this->readObject();
627  }

◆ readXML()

AMFReader::readXML ( )

Definition at line 620 of file module.audio-video.flv.php.

620  {
621  return $this->stream->readLongUTF();
622  }

Field Documentation

◆ $stream

AMFReader::$stream

Definition at line 474 of file module.audio-video.flv.php.


The documentation for this class was generated from the following file: