-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp_include.v
More file actions
57 lines (44 loc) · 1.18 KB
/
php_include.v
File metadata and controls
57 lines (44 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module vphp
import vphp.zval
pub struct PhpIncludeFile {
path string
}
pub fn PhpIncludeFile.at(path string) PhpIncludeFile {
return PhpIncludeFile{
path: path
}
}
pub fn (file PhpIncludeFile) path() string {
return file.path
}
fn (file PhpIncludeFile) load_with_once_flag(once bool) ZVal {
retval := zval.include_file(file.path, once)
if !retval.is_valid() {
return invalid_zval()
}
return adopt_handle_with_ownership(retval, .owned_request)
}
pub fn (file PhpIncludeFile) load_zval() ZVal {
return file.load_with_once_flag(false)
}
pub fn (file PhpIncludeFile) load_once_zval() ZVal {
return file.load_with_once_flag(true)
}
pub fn (file PhpIncludeFile) load() PhpValue {
return PhpValue.adopt_zval(file.load_zval())
}
pub fn (file PhpIncludeFile) load_once() PhpValue {
return PhpValue.adopt_zval(file.load_once_zval())
}
pub fn include_zval(path string) ZVal {
return PhpIncludeFile.at(path).load_zval()
}
pub fn include_once_zval(path string) ZVal {
return PhpIncludeFile.at(path).load_once_zval()
}
pub fn include(path string) PhpValue {
return PhpIncludeFile.at(path).load()
}
pub fn include_once(path string) PhpValue {
return PhpIncludeFile.at(path).load_once()
}