diff --git a/node.go b/node.go index 6e007f3..e20eb26 100644 --- a/node.go +++ b/node.go @@ -1194,6 +1194,14 @@ func (this *conversionState) convertNoFreeFloating(n_ node.Node) (string, error) this.importPackages["strings"] = struct{}{} funcName = `strings.ToUpper` + } else if funcName == `file_get_contents` { + if len(callParams) != 2 { + return "", parseErr{n, arityErr{funcName, len(callParams), 1, 1}} + } + + this.importPackages["io/ioutil"] = struct{}{} + funcName = `ioutil.ReadFile` // (string filename) + } else if funcName == `file_put_contents` { if len(callParams) != 2 { return "", parseErr{n, arityErr{funcName, len(callParams), 2, 2}}