ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
AMFReader Class Reference
+ Collaboration diagram for AMFReader:

Public Member Functions

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

Data Fields

 $stream
 

Detailed Description

Definition at line 332 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.

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

References $stream.

Member Function Documentation

◆ AMFReader()

AMFReader::AMFReader ( $stream)

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

335 {
336 $this->stream =& $stream;
337 }

References $stream.

◆ readArray() [1/2]

AMFReader::readArray ( )

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

465 {
466 $length = $this->stream->readLong();
467
468 $data = array();
469
470 for ($i = 0; $i < count($length); $i++) {
471 $data[] = $this->readData();
472 }
473
474 return $data;
475 }
$data

References $data, and readData().

Referenced by readData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readArray() [2/2]

AMFReader::readArray ( )

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

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 }

References $data, and readData().

+ Here is the call graph for this function:

◆ readBoolean() [1/2]

AMFReader::readBoolean ( )

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

413 {
414 return $this->stream->readByte() == 1;
415 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readBoolean() [2/2]

AMFReader::readBoolean ( )

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

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

◆ readData() [1/2]

AMFReader::readData ( )

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

339 {
340 $value = null;
341
342 $type = $this->stream->readByte();
343
344 switch($type) {
345 // Double
346 case 0:
347 $value = $this->readDouble();
348 break;
349
350 // Boolean
351 case 1:
352 $value = $this->readBoolean();
353 break;
354
355 // String
356 case 2:
357 $value = $this->readString();
358 break;
359
360 // Object
361 case 3:
362 $value = $this->readObject();
363 break;
364
365 // null
366 case 6:
367 return null;
368 break;
369
370 // Mixed array
371 case 8:
372 $value = $this->readMixedArray();
373 break;
374
375 // Array
376 case 10:
377 $value = $this->readArray();
378 break;
379
380 // Date
381 case 11:
382 $value = $this->readDate();
383 break;
384
385 // Long string
386 case 13:
387 $value = $this->readLongString();
388 break;
389
390 // XML (handled as string)
391 case 15:
392 $value = $this->readXML();
393 break;
394
395 // Typed object (handled as object)
396 case 16:
397 $value = $this->readTypedObject();
398 break;
399
400 // Long string
401 default:
402 $value = '(unknown or unsupported data type)';
403 break;
404 }
405
406 return $value;
407 }

References readArray(), readBoolean(), readDate(), readDouble(), readLongString(), readMixedArray(), readObject(), readString(), readTypedObject(), and readXML().

Referenced by readArray(), readMixedArray(), and readObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readData() [2/2]

AMFReader::readData ( )

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

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 }

References readArray(), readBoolean(), readDate(), readDouble(), readLongString(), readMixedArray(), readObject(), readString(), readTypedObject(), and readXML().

+ Here is the call graph for this function:

◆ readDate() [1/2]

AMFReader::readDate ( )

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

477 {
478 $timestamp = $this->stream->readDouble();
479 $timezone = $this->stream->readInt();
480 return $timestamp;
481 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81

References $timestamp.

Referenced by readData().

+ Here is the caller graph for this function:

◆ readDate() [2/2]

AMFReader::readDate ( )

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

610 {
611 $timestamp = $this->stream->readDouble();
612 $timezone = $this->stream->readInt();
613 return $timestamp;
614 }

References $timestamp.

◆ readDouble() [1/2]

AMFReader::readDouble ( )

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

409 {
410 return $this->stream->readDouble();
411 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readDouble() [2/2]

AMFReader::readDouble ( )

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

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

◆ readLongString() [1/2]

AMFReader::readLongString ( )

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

483 {
484 return $this->stream->readLongUTF();
485 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readLongString() [2/2]

AMFReader::readLongString ( )

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

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

◆ readMixedArray() [1/2]

AMFReader::readMixedArray ( )

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

441 {
442 // Get highest numerical index - ignored
443 $highestIndex = $this->stream->readLong();
444
445 $data = array();
446
447 while ($key = $this->stream->readUTF()) {
448 // Mixed array record ends with empty string (0x00 0x00) and 0x09
449 if (($key == '') && ($this->stream->peekByte() == 0x09)) {
450 // Consume byte
451 $this->stream->readByte();
452 break;
453 }
454
455 if (is_numeric($key)) {
456 $key = (float) $key;
457 }
458
459 $data[$key] = $this->readData();
460 }
461
462 return $data;
463 }

References $data, and readData().

Referenced by readData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readMixedArray() [2/2]

AMFReader::readMixedArray ( )

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

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 }

References $data, and readData().

+ Here is the call graph for this function:

◆ readObject() [1/2]

AMFReader::readObject ( )

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

421 {
422 // Get highest numerical index - ignored
423 $highestIndex = $this->stream->readLong();
424
425 $data = array();
426
427 while ($key = $this->stream->readUTF()) {
428 // Mixed array record ends with empty string (0x00 0x00) and 0x09
429 if (($key == '') && ($this->stream->peekByte() == 0x09)) {
430 // Consume byte
431 $this->stream->readByte();
432 break;
433 }
434
435 $data[$key] = $this->readData();
436 }
437
438 return $data;
439 }

References $data, and readData().

Referenced by readData(), and readTypedObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readObject() [2/2]

AMFReader::readObject ( )

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

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 }

References $data, and readData().

+ Here is the call graph for this function:

◆ readString() [1/2]

AMFReader::readString ( )

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

417 {
418 return $this->stream->readUTF();
419 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readString() [2/2]

AMFReader::readString ( )

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

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

◆ readTypedObject() [1/2]

AMFReader::readTypedObject ( )

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

491 {
492 $className = $this->stream->readUTF();
493 return $this->readObject();
494 }

References readObject().

Referenced by readData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readTypedObject() [2/2]

AMFReader::readTypedObject ( )

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

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

References readObject().

+ Here is the call graph for this function:

◆ readXML() [1/2]

AMFReader::readXML ( )

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

487 {
488 return $this->stream->readLongUTF();
489 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readXML() [2/2]

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 333 of file module.audio-video.flv.php.

Referenced by __construct(), and AMFReader().


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