ILIAS  release_7 Revision v7.30-3-g800a261c036
PHPStreamFunctions.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
5
17{
18
25 public static function ftell($handle)
26 {
27 return ftell($handle);
28 }
29
35 public static function fclose($handle)
36 {
37 fclose($handle);
38 }
39
47 public static function fseek($stream, $offset, $whence)
48 {
49 return fseek($stream, $offset, $whence);
50 }
51
59 public static function fread($handle, $length)
60 {
61 return fread($handle, $length);
62 }
63
71 public static function stream_get_contents($handle, $length = -1)
72 {
73 return stream_get_contents($handle, $length);
74 }
75
84 public static function fwrite($handle, $string, $length = null)
85 {
86
87 //it seems like php juggles the null to 0 and pass it to the function which leads to a write operation of zero length ...
88 if (is_null($length)) {
89 return fwrite($handle, $string);
90 }
91
92 return fwrite($handle, $string, $length);
93 }
94}
An exception for terminatinating execution or to throw for unit testing.
Class PHPFunctions The purpose of this class is to wrap all stream handling php functions.
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...