Обертка для file_get_contents
This commit is contained in:
parent
bfd53ecc09
commit
0d92ebad86
5 changed files with 17 additions and 6 deletions
11
src/File.php
Normal file
11
src/File.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
class File {
|
||||
static function getContents($filename) {
|
||||
$buffer = file_get_contents($filename);
|
||||
if ($buffer !== false) {
|
||||
return $buffer;
|
||||
}
|
||||
throw new Exception("Unable to read file: " . $filename);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue