ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PHPStreamFunctions.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Filesystem\Util;
22
34{
43 public static function ftell($handle): bool|int
44 {
45 return ftell($handle);
46 }
47
52 public static function fseek($stream, int $offset, int $whence): int
53 {
54 return fseek($stream, $offset, $whence);
55 }
56
61 public static function fclose($handle): void
62 {
63 fclose($handle);
64 }
65
70 public static function fread($handle, int $length): bool|string
71 {
72 return fread($handle, $length);
73 }
74
79 public static function stream_get_contents($handle, $length = -1): bool|string
80 {
81 return stream_get_contents($handle, $length);
82 }
83
89 public static function fwrite($handle, string $string, ?int $length = null): bool|int
90 {
91 if (is_null($length)) {
92 return fwrite($handle, $string);
93 }
94
95 return fwrite($handle, $string, $length);
96 }
97}
The purpose of this class is to wrap all stream handling php functions.
static stream_get_contents($handle, $length=-1)
static fseek($stream, int $offset, int $whence)
static fwrite($handle, string $string, ?int $length=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...