ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SAML2\Utilities\File Class Reference

Various File Utilities. More...

+ Collaboration diagram for SAML2\Utilities\File:

Static Public Member Functions

static getFileContents ($file)
 

Detailed Description

Various File Utilities.

Definition at line 11 of file File.php.

Member Function Documentation

◆ getFileContents()

static SAML2\Utilities\File::getFileContents (   $file)
static
Parameters
string$filefull absolute path to the file
Returns
string

Definition at line 18 of file File.php.

19 {
20 if (!is_string($file)) {
21 throw InvalidArgumentException::invalidType('string', $file);
22 }
23
24 if (!is_readable($file)) {
25 throw new RuntimeException(sprintf(
26 'File "%s" does not exist or is not readable',
27 $file
28 ));
29 }
30
31 $contents = file_get_contents($file);
32 if ($contents === false) {
33 throw new RuntimeException(sprintf(
34 'Could not read from existing and readable file "%s"',
35 $file
36 ));
37 }
38
39 return $contents;
40 }

References SAML2\Exception\InvalidArgumentException\invalidType().

Referenced by SAML2\Certificate\KeyLoader\loadCertificateFile(), and SAML2\Certificate\PrivateKeyLoader\loadPrivateKey().

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

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