-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphp_execdir.h
More file actions
146 lines (126 loc) · 4.01 KB
/
php_execdir.h
File metadata and controls
146 lines (126 loc) · 4.01 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*
+----------------------------------------------------------------------+
| mod_exec v1 |
+----------------------------------------------------------------------+
| Copyright 2022. JoungKyun.Kim All rights reserved. |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: JoungKyun.Kim <http://oops.org> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_EXECDIR_H
#define PHP_EXECDIR_H
#ifndef PHP_EXECDIR
#define PHP_EXECDIR ""
#endif
#define EXECDIR_EXT_VERSION "1.0.7"
extern zend_module_entry execdir_module_entry;
#define execdir_module_ptr &execdir_module_entry
#define phpext_execdir_ptr execdir_module_ptr
#ifdef PHP_WIN32
#define PHP_EXECDIR_API __declspec(dllexport)
#else
#define PHP_EXECDIR_API
#endif
#ifdef ZTS
#include "TSRM.h"
#define EXECDIR_G(v) TSRMG(execdir_globals_id, zend_execdir_globals *, v)
#else
#define EXECDIR_G(v) (execdir_globals.v)
#endif
struct execdir_overload_func {
char *orig_func;
char *ovld_func;
char *save_func;
};
ZEND_BEGIN_MODULE_GLOBALS(execdir)
char * exec_dir;
ZEND_END_MODULE_GLOBALS(execdir)
PHP_MINIT_FUNCTION (execdir);
PHP_MSHUTDOWN_FUNCTION (execdir);
PHP_RINIT_FUNCTION (execdir);
PHP_RSHUTDOWN_FUNCTION (execdir);
PHP_MINFO_FUNCTION (execdir);
PHP_FUNCTION (exec_re);
PHP_FUNCTION (system_re);
PHP_FUNCTION (passthru_re);
PHP_FUNCTION (shell_exec_re);
PHP_FUNCTION (popen_re);
PHP_FUNCTION (pcntl_exec_re);
PHP_FUNCTION (jailed_shellcmd);
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
PHP_MINIT_FUNCTION (proc_open_re);
PHP_FUNCTION (proc_open_re);
PHP_FUNCTION (proc_get_status_re);
PHP_FUNCTION (proc_close_re);
PHP_FUNCTION (proc_terminate_re);
#endif
#if PHP_VERSION_ID >= 60000
#ifdef PHP_EXECDIR_COMPAT
PHP_FUNCTION (exec_orig);
PHP_FUNCTION (system_orig);
PHP_FUNCTION (passthru_orig);
PHP_FUNCTION (shell_exec_orig);
PHP_FUNCTION (popen_orig);
PHP_FUNCTION (pcntl_exec_orig);
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
PHP_FUNCTION (proc_open_orig);
PHP_FUNCTION (proc_get_status_orig);
PHP_FUNCTION (proc_close_orig);
PHP_FUNCTION (proc_terminate_orig);
#endif
#endif
#endif
#define EXEC_STRING(s) s, strlen(s)
#if PHP_VERSION_ID < 50500
#if ZEND_DEBUG
#define ZEND_ASSERT(c) assert(c)
#else
#define ZEND_ASSERT(c)
#endif
#endif
#if PHP_VERSION_ID < 50600
#if ! defined(SIZE_MAX)
#include <stdint.h>
#endif
#endif
#if PHP_VERSION_ID < 60000
#define RETURN_EXECDIR_STRING(s,i) RETURN_STRING(s,i)
#define RETVAL_EXECDIR_STRING(s,i) RETVAL_STRINGL(s,i,1)
#define execdir_hash_exists(ht,key) zend_hash_exists(ht,key,strlen(key)+1)
#define zend_ini_entry_def zend_ini_entry
#define zend_hash_str_add_empty_element zend_hash_add_empty_element
#else
#define RETURN_EXECDIR_STRING(s,i) RETURN_STRING(s)
#define RETVAL_EXECDIR_STRING(s,i) RETVAL_STRINGL(s,i)
#define execdir_hash_exists(ht,key) zend_hash_str_exists(ht,key,strlen(key))
#endif
#if PHP_VERSION_D < 70300
#define execdir_string_release(x) zend_string_release(x)
#else
#define execdir_string_release(x) zend_string_release_ex(x,0)
#endif
/* for >= PHP8 {{{
*
* Since PHP 8, TSRMLS_CC, and TSRMLS_C constants have been removed.
*/
#if PHP_VERSION_ID >= 80000
#define TSRMLS_CC
#define TSRMLS_C
#endif /* }}} */
#endif /* PHP_EXECDIR_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/