using Php;

namespace PhpNative {
    public string file_get_contents_static (string filename, string php_file, int php_line) throws Error {
        string contents;
        FileUtils.get_contents (filename, out contents);
        return contents;
    }

    public zval file_get_contents_zval (zval filename, string php_file, int php_line) throws Error {
        try {
            return zval.string_value (file_get_contents_static (Php.zval_to_string (filename), php_file, php_line));
        } catch (Error e) {
            return zval.boolean (false);
        }
    }
}
