node: implement func_get_contents
This commit is contained in:
parent
ac093a05a3
commit
9b88dee9ef
8
node.go
8
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}}
|
||||
|
Loading…
Reference in New Issue
Block a user