ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

References $contents, $file, and SAML2\Exception\InvalidArgumentException\invalidType().

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

19  {
20  if (!is_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  }
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ 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: