ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
PHPStreamFunctions.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
5
20{
21
31 public static function ftell($handle)
32 {
33 return ftell($handle);
34 }
35
36
44 public static function fclose($handle)
45 {
46 fclose($handle);
47 }
48
49
59 public static function fseek($stream, $offset, $whence)
60 {
61 return fseek($stream, $offset, $whence);
62 }
63
64
75 public static function fread($handle, $length)
76 {
77 return fread($handle, $length);
78 }
79
80
91 public static function stream_get_contents($handle, $length = -1)
92 {
93 return stream_get_contents($handle, $length);
94 }
95
96
108 public static function fwrite($handle, $string, $length = null)
109 {
110
111 //it seems like php juggles the null to 0 and pass it to the function which leads to a write operation of zero length ...
112 if (is_null($length)) {
113 return fwrite($handle, $string);
114 }
115
116 return fwrite($handle, $string, $length);
117 }
118}
An exception for terminatinating execution or to throw for unit testing.
static fwrite($handle, $string, $length=null)
fwrite wrapper
static fread($handle, $length)
fread wrapper
static stream_get_contents($handle, $length=-1)
stream_get_contents wrapper
static fclose($handle)
fclose wrapper
static fseek($stream, $offset, $whence)
fseek wrapper.