phplibrary/src/File.php

19 lines
385 B
PHP

<?php
namespace ctiso;
use Exception;
class File {
/**
* @param string $filename
* @return string
* @throws Exception
*/
static function getContents($filename) {
$buffer = @file_get_contents($filename);
if ($buffer !== false) {
return $buffer;
}
throw new Exception("Unable to read file: " . $filename);
}
}