Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 931 lines (818 sloc) 27.637 kb
651e232 Zeev Suraski Testing 123
zsuraski authored
1 /*
2 +----------------------------------------------------------------------+
dbeb415 andigutmans - A belated happy holidays and PHP 5
andigutmans authored
3 | PHP Version 5 |
651e232 Zeev Suraski Testing 123
zsuraski authored
4 +----------------------------------------------------------------------+
08659c2 MFH: Bump copyright year, 3 of 3.
Sebastian Bergmann authored
5 | Copyright (c) 1997-2009 The PHP Group |
651e232 Zeev Suraski Testing 123
zsuraski authored
6 +----------------------------------------------------------------------+
5bd9322 bump year and license version
foobar authored
7 | This source file is subject to version 3.01 of the PHP license, |
9d1817e Fix bug: #10323. Every value outputted is now escaped.
foobar authored
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff updating license information in the headers.
James Cox authored
9 | available through the world-wide-web at the following url: |
5bd9322 bump year and license version
foobar authored
10 | http://www.php.net/license/3_01.txt |
c5724cb Zeev Suraski License update
zsuraski authored
11 | If you did not receive a copy of the PHP license and are unable to |
9d1817e Fix bug: #10323. Every value outputted is now escaped.
foobar authored
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
651e232 Zeev Suraski Testing 123
zsuraski authored
14 +----------------------------------------------------------------------+
9d1817e Fix bug: #10323. Every value outputted is now escaped.
foobar authored
15 | Author: Zeev Suraski <zeev@zend.com> |
651e232 Zeev Suraski Testing 123
zsuraski authored
16 +----------------------------------------------------------------------+
17 */
18
46a7b0c Frank M. Kromann Killing compiler warning on Win32
fmk authored
19 /* $Id$ */
651e232 Zeev Suraski Testing 123
zsuraski authored
20
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
21 #include "php.h"
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
22 #include "ext/standard/info.h"
1fd0913 Zeev Suraski Initial steps to move the INI mechanism to the Zend engine
zsuraski authored
23 #include "zend_ini.h"
09b6f37 MFH:
Jani Taskinen authored
24 #include "zend_ini_scanner.h"
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
25 #include "php_ini.h"
26 #include "ext/standard/dl.h"
27 #include "zend_extensions.h"
9d1817e Fix bug: #10323. Every value outputted is now escaped.
foobar authored
28 #include "zend_highlight.h"
ab25640 Removed CWD from php_ini_search_path when using CLI SAPI.
Edin Kadribasic authored
29 #include "SAPI.h"
46a7b0c Frank M. Kromann Killing compiler warning on Win32
fmk authored
30 #include "php_main.h"
ec11fe0 Fix the possible conflicts with other libs (like libc-client)
foobar authored
31 #include "php_scandir.h"
06aae4b Stanislav Malyshev Enable setting php.ini path via the registry
smalyshev authored
32 #ifdef PHP_WIN32
33 #include "win32/php_registry.h"
34 #endif
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
35
ec11fe0 Fix the possible conflicts with other libs (like libc-client)
foobar authored
36 #if HAVE_SCANDIR && HAVE_ALPHASORT && HAVE_DIRENT_H
37 #include <dirent.h>
82f6cef Fix broken build by adding scandir and alphasort for win32
Shane Caraveo authored
38 #endif
8d352d2 Fixed bug #21625 (When scanning a directory for ini files, do so in
Ilia Alshanetsky authored
39
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
40 #ifndef S_ISREG
41 #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
42 #endif
43
8e5a00e - changed ini file directives [PATH=](on Win32) and [HOST=](on all) to b...
Garrett Serack authored
44 #ifdef PHP_WIN32
45 #define TRANSLATE_SLASHES(path) \
46 { \
47 char *tmp = path; \
48 while (*tmp) { \
49 if (*tmp == '\\') *tmp = '/'; \
50 tmp++; \
51 } \
52 }
53 #else
54 #define TRANSLATE_SLASHES(path)
55 #endif
56
57
d294f46 Zeev Suraski - Remove the ini_extension_list global
zsuraski authored
58 typedef struct _php_extension_lists {
42c82bb Revert the last patches.
foobar authored
59 zend_llist engine;
60 zend_llist functions;
d294f46 Zeev Suraski - Remove the ini_extension_list global
zsuraski authored
61 } php_extension_lists;
58e24ac Zeev Suraski - Add PHP Modules workspace
zsuraski authored
62
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
63 /* True globals */
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
64 static int is_special_section = 0;
09b6f37 MFH:
Jani Taskinen authored
65 static HashTable *active_ini_hash;
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
66 static HashTable configuration_hash;
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
67 static int has_per_dir_config = 0;
68 static int has_per_host_config = 0;
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
69 PHPAPI char *php_ini_opened_path=NULL;
70 static php_extension_lists extension_lists;
e5e6f55 MFH
Jani Taskinen authored
71 PHPAPI char *php_ini_scanned_path=NULL;
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
72 PHPAPI char *php_ini_scanned_files=NULL;
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
73
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
74 /* {{{ php_ini_displayer_cb
75 */
09b6f37 MFH:
Jani Taskinen authored
76 static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC)
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
77 {
42c82bb Revert the last patches.
foobar authored
78 if (ini_entry->displayer) {
79 ini_entry->displayer(ini_entry, type);
80 } else {
81 char *display_string;
82 uint display_string_length, esc_html=0;
83
7e3b508 ws/style fixes
foobar authored
84 if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
42c82bb Revert the last patches.
foobar authored
85 if (ini_entry->orig_value && ini_entry->orig_value[0]) {
86 display_string = ini_entry->orig_value;
87 display_string_length = ini_entry->orig_value_length;
b5c97d8 fix phpinfo() & php -i
Marcus Boerger authored
88 esc_html = !sapi_module.phpinfo_as_text;
42c82bb Revert the last patches.
foobar authored
89 } else {
b5c97d8 fix phpinfo() & php -i
Marcus Boerger authored
90 if (!sapi_module.phpinfo_as_text) {
d6497fc - reenable "no value" output. thanks to sebastian for pointing that out...
Jan Lehnardt authored
91 display_string = "<i>no value</i>";
7e3b508 ws/style fixes
foobar authored
92 display_string_length = sizeof("<i>no value</i>") - 1;
d6497fc - reenable "no value" output. thanks to sebastian for pointing that out...
Jan Lehnardt authored
93 } else {
94 display_string = "no value";
7e3b508 ws/style fixes
foobar authored
95 display_string_length = sizeof("no value") - 1;
9be89ed MFH: ws fixes
Jani Taskinen authored
96 }
42c82bb Revert the last patches.
foobar authored
97 }
98 } else if (ini_entry->value && ini_entry->value[0]) {
99 display_string = ini_entry->value;
100 display_string_length = ini_entry->value_length;
b5c97d8 fix phpinfo() & php -i
Marcus Boerger authored
101 esc_html = !sapi_module.phpinfo_as_text;
42c82bb Revert the last patches.
foobar authored
102 } else {
b5c97d8 fix phpinfo() & php -i
Marcus Boerger authored
103 if (!sapi_module.phpinfo_as_text) {
d6497fc - reenable "no value" output. thanks to sebastian for pointing that out...
Jan Lehnardt authored
104 display_string = "<i>no value</i>";
7e3b508 ws/style fixes
foobar authored
105 display_string_length = sizeof("<i>no value</i>") - 1;
d6497fc - reenable "no value" output. thanks to sebastian for pointing that out...
Jan Lehnardt authored
106 } else {
107 display_string = "no value";
7e3b508 ws/style fixes
foobar authored
108 display_string_length = sizeof("no value") - 1;
9be89ed MFH: ws fixes
Jani Taskinen authored
109 }
42c82bb Revert the last patches.
foobar authored
110 }
7e3b508 ws/style fixes
foobar authored
111
112 if (esc_html) {
a769454 reenable php_html_puts
Sascha Schumann authored
113 php_html_puts(display_string, display_string_length TSRMLS_CC);
42c82bb Revert the last patches.
foobar authored
114 } else {
115 PHPWRITE(display_string, display_string_length);
116 }
117 }
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
118 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
119 /* }}} */
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
120
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
121 /* {{{ php_ini_displayer
122 */
d76cf1d Zeev Suraski More TSRMLS_FETCH work
zsuraski authored
123 static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number TSRMLS_DC)
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
124 {
42c82bb Revert the last patches.
foobar authored
125 if (ini_entry->module_number != module_number) {
126 return 0;
127 }
b5c97d8 fix phpinfo() & php -i
Marcus Boerger authored
128 if (!sapi_module.phpinfo_as_text) {
14a6cc8 Change phpinfo() to use CSS styling instead of HTML code.
Colin Viebrock authored
129 PUTS("<tr>");
c7c275b fix phpinfo() output for better browser BC
Colin Viebrock authored
130 PUTS("<td class=\"e\">");
7e3b508 ws/style fixes
foobar authored
131 PHPWRITE(ini_entry->name, ini_entry->name_length - 1);
c7c275b fix phpinfo() output for better browser BC
Colin Viebrock authored
132 PUTS("</td><td class=\"v\">");
09b6f37 MFH:
Jani Taskinen authored
133 php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC);
c7c275b fix phpinfo() output for better browser BC
Colin Viebrock authored
134 PUTS("</td><td class=\"v\">");
09b6f37 MFH:
Jani Taskinen authored
135 php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC);
6676617 - add phpinfo() support for CLI.
Jan Lehnardt authored
136 PUTS("</td></tr>\n");
137 } else {
7e3b508 ws/style fixes
foobar authored
138 PHPWRITE(ini_entry->name, ini_entry->name_length - 1);
6676617 - add phpinfo() support for CLI.
Jan Lehnardt authored
139 PUTS(" => ");
09b6f37 MFH:
Jani Taskinen authored
140 php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC);
6676617 - add phpinfo() support for CLI.
Jan Lehnardt authored
141 PUTS(" => ");
09b6f37 MFH:
Jani Taskinen authored
142 php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC);
6676617 - add phpinfo() support for CLI.
Jan Lehnardt authored
143 PUTS("\n");
9be89ed MFH: ws fixes
Jani Taskinen authored
144 }
42c82bb Revert the last patches.
foobar authored
145 return 0;
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
146 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
147 /* }}} */
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
148
d6d4121 - MFH Do not show empty ini directive tables for modules without ini ent...
Marcus Boerger authored
149 /* {{{ php_ini_available
150 */
151 static int php_ini_available(zend_ini_entry *ini_entry, int *module_number_available TSRMLS_DC)
152 {
153 if (ini_entry->module_number == *module_number_available) {
154 *module_number_available = -1;
155 return ZEND_HASH_APPLY_STOP;
156 } else {
157 return ZEND_HASH_APPLY_KEEP;
158 }
159 }
160 /* }}} */
161
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
162 /* {{{ display_ini_entries
163 */
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
164 PHPAPI void display_ini_entries(zend_module_entry *module)
165 {
d6d4121 - MFH Do not show empty ini directive tables for modules without ini ent...
Marcus Boerger authored
166 int module_number, module_number_available;
42c82bb Revert the last patches.
foobar authored
167 TSRMLS_FETCH();
168
169 if (module) {
170 module_number = module->module_number;
9be89ed MFH: ws fixes
Jani Taskinen authored
171 } else {
42c82bb Revert the last patches.
foobar authored
172 module_number = 0;
173 }
d6d4121 - MFH Do not show empty ini directive tables for modules without ini ent...
Marcus Boerger authored
174 module_number_available = module_number;
175 zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_available, &module_number_available TSRMLS_CC);
176 if (module_number_available == -1) {
177 php_info_print_table_start();
178 php_info_print_table_header(3, "Directive", "Local Value", "Master Value");
179 zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (zend_intptr_t) module_number TSRMLS_CC);
180 php_info_print_table_end();
181 }
bc415d5 Zeev Suraski * Finalizing the PHP version of SAPI. Support POST and cookies among ot...
zsuraski authored
182 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
183 /* }}} */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
184
185 /* php.ini support */
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
186 #define PHP_EXTENSION_TOKEN "extension"
d29d244 - MFH: Get rid of the four different versions of zend_extension* and onl...
Derick Rethans authored
187 #define ZEND_EXTENSION_TOKEN "zend_extension"
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
188
09b6f37 MFH:
Jani Taskinen authored
189 /* {{{ config_zval_dtor
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
190 */
1674976 MFH: Fixed win32 build.
Jani Taskinen authored
191 PHPAPI void config_zval_dtor(zval *zvalue)
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
192 {
09b6f37 MFH:
Jani Taskinen authored
193 if (Z_TYPE_P(zvalue) == IS_ARRAY) {
194 zend_hash_destroy(Z_ARRVAL_P(zvalue));
195 free(Z_ARRVAL_P(zvalue));
196 } else if (Z_TYPE_P(zvalue) == IS_STRING) {
197 free(Z_STRVAL_P(zvalue));
198 }
199 }
200 /* Reset / free active_ini_sectin global */
201 #define RESET_ACTIVE_INI_HASH() do { \
202 active_ini_hash = NULL; \
203 } while (0)
204 /* }}} */
205
206 /* {{{ php_ini_parser_cb
207 */
208 static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, HashTable *target_hash)
209 {
210 zval *entry;
211 HashTable *active_hash;
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
212 char *extension_name;
09b6f37 MFH:
Jani Taskinen authored
213
214 if (active_ini_hash) {
215 active_hash = active_ini_hash;
216 } else {
217 active_hash = target_hash;
218 }
219
42c82bb Revert the last patches.
foobar authored
220 switch (callback_type) {
221 case ZEND_INI_PARSER_ENTRY: {
222 if (!arg2) {
09b6f37 MFH:
Jani Taskinen authored
223 /* bare string - nothing to do */
42c82bb Revert the last patches.
foobar authored
224 break;
225 }
09b6f37 MFH:
Jani Taskinen authored
226
227 /* PHP and Zend extensions are not added into configuration hash! */
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
228 if (!is_special_section && !strcasecmp(Z_STRVAL_P(arg1), PHP_EXTENSION_TOKEN)) { /* load PHP extension */
229 extension_name = estrndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2));
230 zend_llist_add_element(&extension_lists.functions, &extension_name);
231 } else if (!is_special_section && !strcasecmp(Z_STRVAL_P(arg1), ZEND_EXTENSION_TOKEN)) { /* load Zend extension */
232 extension_name = estrndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2));
42c82bb Revert the last patches.
foobar authored
233 zend_llist_add_element(&extension_lists.engine, &extension_name);
09b6f37 MFH:
Jani Taskinen authored
234
235 /* All other entries are added into either configuration_hash or active ini section array */
42c82bb Revert the last patches.
foobar authored
236 } else {
09b6f37 MFH:
Jani Taskinen authored
237 /* Store in active hash */
238 zend_hash_update(active_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, arg2, sizeof(zval), (void **) &entry);
42c82bb Revert the last patches.
foobar authored
239 Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry));
240 }
241 }
242 break;
b51b6f0 ini patch to allow 'entry[] = value' entries
Harald Radi authored
243
244 case ZEND_INI_PARSER_POP_ENTRY: {
09b6f37 MFH:
Jani Taskinen authored
245 zval *option_arr;
246 zval *find_arr;
b51b6f0 ini patch to allow 'entry[] = value' entries
Harald Radi authored
247
248 if (!arg2) {
249 /* bare string - nothing to do */
250 break;
251 }
252
09b6f37 MFH:
Jani Taskinen authored
253 /* fprintf(stdout, "ZEND_INI_PARSER_POP_ENTRY: %s[%s] = %s\n",Z_STRVAL_P(arg1), Z_STRVAL_P(arg3), Z_STRVAL_P(arg2)); */
254
255 /* If option not found in hash or is not an array -> create array, otherwise add to existing array */
256 if (zend_hash_find(active_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, (void **) &find_arr) == FAILURE || Z_TYPE_P(find_arr) != IS_ARRAY) {
257 option_arr = (zval *) pemalloc(sizeof(zval), 1);
258 INIT_PZVAL(option_arr);
259 Z_TYPE_P(option_arr) = IS_ARRAY;
260 Z_ARRVAL_P(option_arr) = (HashTable *) pemalloc(sizeof(HashTable), 1);
261 zend_hash_init(Z_ARRVAL_P(option_arr), 0, NULL, (dtor_func_t) config_zval_dtor, 1);
262 zend_hash_update(active_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, option_arr, sizeof(zval), (void **) &find_arr);
263 free(option_arr);
264 }
b51b6f0 ini patch to allow 'entry[] = value' entries
Harald Radi authored
265
09b6f37 MFH:
Jani Taskinen authored
266 /* arg3 is possible option offset name */
267 if (arg3 && Z_STRLEN_P(arg3) > 0) {
268 zend_symtable_update(Z_ARRVAL_P(find_arr), Z_STRVAL_P(arg3), Z_STRLEN_P(arg3) + 1, arg2, sizeof(zval), (void **) &entry);
b51b6f0 ini patch to allow 'entry[] = value' entries
Harald Radi authored
269 } else {
09b6f37 MFH:
Jani Taskinen authored
270 zend_hash_next_index_insert(Z_ARRVAL_P(find_arr), arg2, sizeof(zval), (void **) &entry);
b51b6f0 ini patch to allow 'entry[] = value' entries
Harald Radi authored
271 }
09b6f37 MFH:
Jani Taskinen authored
272 Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry));
b51b6f0 ini patch to allow 'entry[] = value' entries
Harald Radi authored
273 }
274 break;
275
09b6f37 MFH:
Jani Taskinen authored
276 case ZEND_INI_PARSER_SECTION: { /* Create an array of entries of each section */
277
278 /* fprintf(stdout, "ZEND_INI_PARSER_SECTION: %s\n",Z_STRVAL_P(arg1)); */
279
280 char *key = NULL;
281 uint key_len;
282
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
283 /* PATH sections */
09b6f37 MFH:
Jani Taskinen authored
284 if (!strncasecmp(Z_STRVAL_P(arg1), "PATH", sizeof("PATH") - 1)) {
285 key = Z_STRVAL_P(arg1);
286 key = key + sizeof("PATH") - 1;
287 key_len = Z_STRLEN_P(arg1) - sizeof("PATH") + 1;
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
288 is_special_section = 1;
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
289 has_per_dir_config = 1;
8e5a00e - changed ini file directives [PATH=](on Win32) and [HOST=](on all) to b...
Garrett Serack authored
290 #ifdef PHP_WIN32
994307d Felipe Pena - Fixed build and comment-style
felipensp authored
291 /* make the path lowercase on Windows, for case insensitivty. */
8e5a00e - changed ini file directives [PATH=](on Win32) and [HOST=](on all) to b...
Garrett Serack authored
292 strlwr(key);
293
294 TRANSLATE_SLASHES(key);
295 #endif
09b6f37 MFH:
Jani Taskinen authored
296
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
297 /* HOST sections */
09b6f37 MFH:
Jani Taskinen authored
298 } else if (!strncasecmp(Z_STRVAL_P(arg1), "HOST", sizeof("HOST") - 1)) {
299 key = Z_STRVAL_P(arg1);
300 key = key + sizeof("HOST") - 1;
301 key_len = Z_STRLEN_P(arg1) - sizeof("HOST") + 1;
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
302 is_special_section = 1;
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
303 has_per_host_config = 1;
994307d Felipe Pena - Fixed build and comment-style
felipensp authored
304 zend_str_tolower(key, key_len); /* host names are case-insensitive. */
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
305
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
306 } else {
307 is_special_section = 0;
09b6f37 MFH:
Jani Taskinen authored
308 }
309
310 if (key && key_len > 0) {
311 /* Strip any trailing slashes */
312 while (key_len > 0 && (key[key_len - 1] == '/' || key[key_len - 1] == '\\')) {
313 key_len--;
314 key[key_len] = 0;
315 }
316
317 /* Strip any leading whitespace and '=' */
318 while (*key && (
319 *key == '=' ||
320 *key == ' ' ||
321 *key == '\t'
322 )) {
323 key++;
324 key_len--;
325 }
326
327 /* Search for existing entry and if it does not exist create one */
328 if (zend_hash_find(target_hash, key, key_len + 1, (void **) &entry) == FAILURE) {
329 zval *section_arr;
330
331 section_arr = (zval *) pemalloc(sizeof(zval), 1);
332 INIT_PZVAL(section_arr);
333 Z_TYPE_P(section_arr) = IS_ARRAY;
334 Z_ARRVAL_P(section_arr) = (HashTable *) pemalloc(sizeof(HashTable), 1);
335 zend_hash_init(Z_ARRVAL_P(section_arr), 0, NULL, (dtor_func_t) config_zval_dtor, 1);
336 zend_hash_update(target_hash, key, key_len + 1, section_arr, sizeof(zval), (void **) &entry);
337 free(section_arr);
338 }
339 active_ini_hash = Z_ARRVAL_P(entry);
340 }
341 }
42c82bb Revert the last patches.
foobar authored
342 break;
343 }
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
344 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
345 /* }}} */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
346
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
347 /* {{{ php_load_php_extension_cb
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
348 */
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
349 static void php_load_php_extension_cb(void *arg TSRMLS_DC)
db0b8bc Defer loading of extensions until all configuration entries have been
Sascha Schumann authored
350 {
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
351 php_load_extension(*((char **) arg), MODULE_PERSISTENT, 0 TSRMLS_CC);
d294f46 Zeev Suraski - Remove the ini_extension_list global
zsuraski authored
352 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
353 /* }}} */
d294f46 Zeev Suraski - Remove the ini_extension_list global
zsuraski authored
354
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
355 /* {{{ php_load_zend_extension_cb
356 */
d76cf1d Zeev Suraski More TSRMLS_FETCH work
zsuraski authored
357 static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
d294f46 Zeev Suraski - Remove the ini_extension_list global
zsuraski authored
358 {
42c82bb Revert the last patches.
foobar authored
359 zend_load_extension(*((char **) arg));
db0b8bc Defer loading of extensions until all configuration entries have been
Sascha Schumann authored
360 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
361 /* }}} */
db0b8bc Defer loading of extensions until all configuration entries have been
Sascha Schumann authored
362
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
363 /* {{{ php_init_config
364 */
64cfbf5 MFH: - Fixed bug #34307 (OnUpdateStringUnempty INI options can be set em...
foobar authored
365 int php_init_config(TSRMLS_D)
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
366 {
c946b4d In addtion to path to php.ini, PHPRC now may specify full file name
Dmitry Stogov authored
367 char *php_ini_file_name = NULL;
f66d5f0 - Fixed few logic errors in php*.ini search path creation as documented ...
foobar authored
368 char *php_ini_search_path = NULL;
1463a82 pierrejoye - move declaration on top and fix build error
pierrejoye authored
369 int php_ini_scanned_path_len;
42c82bb Revert the last patches.
foobar authored
370 int safe_mode_state;
371 char *open_basedir;
f66d5f0 - Fixed few logic errors in php*.ini search path creation as documented ...
foobar authored
372 int free_ini_search_path = 0;
42c82bb Revert the last patches.
foobar authored
373 zend_file_handle fh;
374
09b6f37 MFH:
Jani Taskinen authored
375 if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) config_zval_dtor, 1) == FAILURE) {
1890173 Revert
foobar authored
376 return FAILURE;
377 }
378
63739c7 give sapi modules the possibility to overwrite default ini settings
Marcus Boerger authored
379 if (sapi_module.ini_defaults) {
380 sapi_module.ini_defaults(&configuration_hash);
381 }
382
42c82bb Revert the last patches.
foobar authored
383 zend_llist_init(&extension_lists.engine, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
c75b887 MFH: No zval is stored here
Jani Taskinen authored
384 zend_llist_init(&extension_lists.functions, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
9be89ed MFH: ws fixes
Jani Taskinen authored
385
42c82bb Revert the last patches.
foobar authored
386 safe_mode_state = PG(safe_mode);
387 open_basedir = PG(open_basedir);
388
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
389 if (sapi_module.php_ini_path_override) {
c946b4d In addtion to path to php.ini, PHPRC now may specify full file name
Dmitry Stogov authored
390 php_ini_file_name = sapi_module.php_ini_path_override;
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
391 php_ini_search_path = sapi_module.php_ini_path_override;
392 free_ini_search_path = 0;
f66d5f0 - Fixed few logic errors in php*.ini search path creation as documented ...
foobar authored
393 } else if (!sapi_module.php_ini_ignore) {
112462d Antony Dovgal MFH
tony2001 authored
394 int search_path_size;
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
395 char *default_location;
f66d5f0 - Fixed few logic errors in php*.ini search path creation as documented ...
foobar authored
396 char *env_location;
397 char *binary_location;
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
398 static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 };
2479384 Fixed unused variable warning on *nix.
Ilia Alshanetsky authored
399 #ifdef PHP_WIN32
06aae4b Stanislav Malyshev Enable setting php.ini path via the registry
smalyshev authored
400 char *reg_location;
2479384 Fixed unused variable warning on *nix.
Ilia Alshanetsky authored
401 #endif
6de4f3a Add check for php.ini in same directory as php.exe (or equivalent execut...
Preston L. Bannister authored
402
f66d5f0 - Fixed few logic errors in php*.ini search path creation as documented ...
foobar authored
403 env_location = getenv("PHPRC");
404 if (!env_location) {
405 env_location = "";
406 }
407
408 /*
409 * Prepare search path
410 */
411
112462d Antony Dovgal MFH
tony2001 authored
412 search_path_size = MAXPATHLEN * 4 + strlen(env_location) + 3 + 1;
413 php_ini_search_path = (char *) emalloc(search_path_size);
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
414 free_ini_search_path = 1;
415 php_ini_search_path[0] = 0;
6de4f3a Add check for php.ini in same directory as php.exe (or equivalent execut...
Preston L. Bannister authored
416
acb1e07 Changed priority of PHPRC environment variable on win32 to be higher the...
Dmitry Stogov authored
417 /* Add environment location */
418 if (env_location[0]) {
419 if (*php_ini_search_path) {
112462d Antony Dovgal MFH
tony2001 authored
420 strlcat(php_ini_search_path, paths_separator, search_path_size);
acb1e07 Changed priority of PHPRC environment variable on win32 to be higher the...
Dmitry Stogov authored
421 }
112462d Antony Dovgal MFH
tony2001 authored
422 strlcat(php_ini_search_path, env_location, search_path_size);
c946b4d In addtion to path to php.ini, PHPRC now may specify full file name
Dmitry Stogov authored
423 php_ini_file_name = env_location;
acb1e07 Changed priority of PHPRC environment variable on win32 to be higher the...
Dmitry Stogov authored
424 }
425
06aae4b Stanislav Malyshev Enable setting php.ini path via the registry
smalyshev authored
426 #ifdef PHP_WIN32
427 /* Add registry location */
428 reg_location = GetIniPathFromRegistry();
f66d5f0 - Fixed few logic errors in php*.ini search path creation as documented ...
foobar authored
429 if (reg_location != NULL) {
06aae4b Stanislav Malyshev Enable setting php.ini path via the registry
smalyshev authored
430 if (*php_ini_search_path) {
112462d Antony Dovgal MFH
tony2001 authored
431 strlcat(php_ini_search_path, paths_separator, search_path_size);
06aae4b Stanislav Malyshev Enable setting php.ini path via the registry
smalyshev authored
432 }
112462d Antony Dovgal MFH
tony2001 authored
433 strlcat(php_ini_search_path, reg_location, search_path_size);
06aae4b Stanislav Malyshev Enable setting php.ini path via the registry
smalyshev authored
434 efree(reg_location);
435 }
436 #endif
42c82bb Revert the last patches.
foobar authored
437
ef058cd Search for php.ini in CWD in all sapi's *but* CLI.
Edin Kadribasic authored
438 /* Add cwd (not with CLI) */
439 if (strcmp(sapi_module.name, "cli") != 0) {
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
440 if (*php_ini_search_path) {
112462d Antony Dovgal MFH
tony2001 authored
441 strlcat(php_ini_search_path, paths_separator, search_path_size);
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
442 }
112462d Antony Dovgal MFH
tony2001 authored
443 strlcat(php_ini_search_path, ".", search_path_size);
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
444 }
42c82bb Revert the last patches.
foobar authored
445
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
446 /* Add binary directory */
6de4f3a Add check for php.ini in same directory as php.exe (or equivalent execut...
Preston L. Bannister authored
447 #ifdef PHP_WIN32
b9fd107 Zeev Suraski Use portable #define
zsuraski authored
448 binary_location = (char *) emalloc(MAXPATHLEN);
7e3b508 ws/style fixes
foobar authored
449 if (GetModuleFileName(0, binary_location, MAXPATHLEN) == 0) {
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
450 efree(binary_location);
451 binary_location = NULL;
42c82bb Revert the last patches.
foobar authored
452 }
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
453 #else
454 if (sapi_module.executable_location) {
0db4f06 Antony Dovgal MFH
tony2001 authored
455 binary_location = (char *)emalloc(MAXPATHLEN);
448dbac Hannes Magnusson MFH: Fixed PHP CLI to use the php.ini from the binary location
bjori authored
456 if (!strchr(sapi_module.executable_location, '/')) {
9098946 Hannes Magnusson MFH: bug#41361 (shell_exec() does not find binaries)
bjori authored
457 char *envpath, *path;
448dbac Hannes Magnusson MFH: Fixed PHP CLI to use the php.ini from the binary location
bjori authored
458 int found = 0;
459
9098946 Hannes Magnusson MFH: bug#41361 (shell_exec() does not find binaries)
bjori authored
460 if ((envpath = getenv("PATH")) != NULL) {
448dbac Hannes Magnusson MFH: Fixed PHP CLI to use the php.ini from the binary location
bjori authored
461 char *search_dir, search_path[MAXPATHLEN];
63c1173 Hannes Magnusson use php_strtok_r() rather than strsep()
bjori authored
462 char *last;
448dbac Hannes Magnusson MFH: Fixed PHP CLI to use the php.ini from the binary location
bjori authored
463
d85fc29 Antony Dovgal MFH
tony2001 authored
464 path = estrdup(envpath);
63c1173 Hannes Magnusson use php_strtok_r() rather than strsep()
bjori authored
465 search_dir = php_strtok_r(path, ":", &last);
d85fc29 Antony Dovgal MFH
tony2001 authored
466
63c1173 Hannes Magnusson use php_strtok_r() rather than strsep()
bjori authored
467 while (search_dir) {
448dbac Hannes Magnusson MFH: Fixed PHP CLI to use the php.ini from the binary location
bjori authored
468 snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location);
469 if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK)) {
470 found = 1;
471 break;
472 }
63c1173 Hannes Magnusson use php_strtok_r() rather than strsep()
bjori authored
473 search_dir = php_strtok_r(NULL, ":", &last);
448dbac Hannes Magnusson MFH: Fixed PHP CLI to use the php.ini from the binary location
bjori authored
474 }
d85fc29 Antony Dovgal MFH
tony2001 authored
475 efree(path);
448dbac Hannes Magnusson MFH: Fixed PHP CLI to use the php.ini from the binary location
bjori authored
476 }
477 if (!found) {
478 efree(binary_location);
479 binary_location = NULL;
480 }
481 } else if (!VCWD_REALPATH(sapi_module.executable_location, binary_location) || VCWD_ACCESS(binary_location, X_OK)) {
7e071d9 php.ini search logic needs to use the absolute path of the running binar...
Hartmut Holzgraefe authored
482 efree(binary_location);
9be89ed MFH: ws fixes
Jani Taskinen authored
483 binary_location = NULL;
98694f9 Antony Dovgal ws fix
tony2001 authored
484 }
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
485 } else {
486 binary_location = NULL;
6de4f3a Add check for php.ini in same directory as php.exe (or equivalent execut...
Preston L. Bannister authored
487 }
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
488 #endif
489 if (binary_location) {
490 char *separator_location = strrchr(binary_location, DEFAULT_SLASH);
9be89ed MFH: ws fixes
Jani Taskinen authored
491
882cb20 edge case: do not remove trailing slash for root directory (Bug #33882)
Hartmut Holzgraefe authored
492 if (separator_location && separator_location != binary_location) {
7e071d9 php.ini search logic needs to use the absolute path of the running binar...
Hartmut Holzgraefe authored
493 *(separator_location) = 0;
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
494 }
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
495 if (*php_ini_search_path) {
112462d Antony Dovgal MFH
tony2001 authored
496 strlcat(php_ini_search_path, paths_separator, search_path_size);
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
497 }
112462d Antony Dovgal MFH
tony2001 authored
498 strlcat(php_ini_search_path, binary_location, search_path_size);
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
499 efree(binary_location);
500 }
501
502 /* Add default location */
503 #ifdef PHP_WIN32
7e3b508 ws/style fixes
foobar authored
504 default_location = (char *) emalloc(MAXPATHLEN + 1);
9be89ed MFH: ws fixes
Jani Taskinen authored
505
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
506 if (0 < GetWindowsDirectory(default_location, MAXPATHLEN)) {
507 if (*php_ini_search_path) {
112462d Antony Dovgal MFH
tony2001 authored
508 strlcat(php_ini_search_path, paths_separator, search_path_size);
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
509 }
112462d Antony Dovgal MFH
tony2001 authored
510 strlcat(php_ini_search_path, default_location, search_path_size);
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
511 }
512 efree(default_location);
fcdda2e Wez Furlong Fix a problem resolving the php.ini path under win32 terminal services e...
wez authored
513
514 {
515 /* For people running under terminal services, GetWindowsDirectory will
516 * return their personal Windows directory, so lets add the system
517 * windows directory too */
518 typedef UINT (WINAPI *get_system_windows_directory_func)(char *buffer, UINT size);
519 static get_system_windows_directory_func get_system_windows_directory = NULL;
520 HMODULE kern;
521
522 if (get_system_windows_directory == NULL) {
523 kern = LoadLibrary("kernel32.dll");
524 if (kern) {
525 get_system_windows_directory = (get_system_windows_directory_func)GetProcAddress(kern, "GetSystemWindowsDirectoryA");
526 }
527 }
528 if (get_system_windows_directory != NULL) {
529 default_location = (char *) emalloc(MAXPATHLEN + 1);
530 if (0 < get_system_windows_directory(default_location, MAXPATHLEN)) {
531 if (*php_ini_search_path) {
112462d Antony Dovgal MFH
tony2001 authored
532 strlcat(php_ini_search_path, paths_separator, search_path_size);
fcdda2e Wez Furlong Fix a problem resolving the php.ini path under win32 terminal services e...
wez authored
533 }
112462d Antony Dovgal MFH
tony2001 authored
534 strlcat(php_ini_search_path, default_location, search_path_size);
fcdda2e Wez Furlong Fix a problem resolving the php.ini path under win32 terminal services e...
wez authored
535 }
536 efree(default_location);
537 }
538 }
6de4f3a Add check for php.ini in same directory as php.exe (or equivalent execut...
Preston L. Bannister authored
539 #else
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
540 default_location = PHP_CONFIG_FILE_PATH;
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
541 if (*php_ini_search_path) {
112462d Antony Dovgal MFH
tony2001 authored
542 strlcat(php_ini_search_path, paths_separator, search_path_size);
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
543 }
112462d Antony Dovgal MFH
tony2001 authored
544 strlcat(php_ini_search_path, default_location, search_path_size);
6de4f3a Add check for php.ini in same directory as php.exe (or equivalent execut...
Preston L. Bannister authored
545 #endif
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
546 }
6de4f3a Add check for php.ini in same directory as php.exe (or equivalent execut...
Preston L. Bannister authored
547
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
548 PG(safe_mode) = 0;
549 PG(open_basedir) = NULL;
550
e5e6f55 MFH
Jani Taskinen authored
551 /*
552 * Find and open actual ini file
553 */
554
e52aac9 Wez Furlong Implement simple stream support in the ZE scanners.
wez authored
555 memset(&fh, 0, sizeof(fh));
e5e6f55 MFH
Jani Taskinen authored
556
557 /* If SAPI does not want to ignore all ini files OR an overriding file/path is given.
558 * This allows disabling scanning for ini files in the PHP_CONFIG_FILE_SCAN_DIR but still
559 * load an optional ini file. */
560 if (!sapi_module.php_ini_ignore || sapi_module.php_ini_path_override) {
561
562 /* Check if php_ini_file_name is a file and can be opened */
c946b4d In addtion to path to php.ini, PHPRC now may specify full file name
Dmitry Stogov authored
563 if (php_ini_file_name && php_ini_file_name[0]) {
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by Wez...
Marcus Boerger authored
564 struct stat statbuf;
9be89ed MFH: ws fixes
Jani Taskinen authored
565
c946b4d In addtion to path to php.ini, PHPRC now may specify full file name
Dmitry Stogov authored
566 if (!VCWD_STAT(php_ini_file_name, &statbuf)) {
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by Wez...
Marcus Boerger authored
567 if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) {
c946b4d In addtion to path to php.ini, PHPRC now may specify full file name
Dmitry Stogov authored
568 fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r");
569 if (fh.handle.fp) {
570 fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL TSRMLS_CC);
571 }
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by Wez...
Marcus Boerger authored
572 }
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
573 }
574 }
e5e6f55 MFH
Jani Taskinen authored
575
576 /* Otherwise search for php-%sapi-module-name%.ini file in search path */
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by Wez...
Marcus Boerger authored
577 if (!fh.handle.fp) {
578 const char *fmt = "php-%s.ini";
50ea267 - Avoid sprintf, even when checked copy'n'paste or changes lead to error...
Marcus Boerger authored
579 char *ini_fname;
580 spprintf(&ini_fname, 0, fmt, sapi_module.name);
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by Wez...
Marcus Boerger authored
581 fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
582 efree(ini_fname);
583 if (fh.handle.fp) {
584 fh.filename = php_ini_opened_path;
585 }
e1658ed Minor cleanups to path building and php*.ini search logic.
Preston L. Bannister authored
586 }
e5e6f55 MFH
Jani Taskinen authored
587
588 /* If still no ini file found, search for php.ini file in search path */
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by Wez...
Marcus Boerger authored
589 if (!fh.handle.fp) {
590 fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
591 if (fh.handle.fp) {
592 fh.filename = php_ini_opened_path;
593 }
8f94a8a First try to open php-SAPI.ini and if it fails fall back to regular
Edin Kadribasic authored
594 }
751cd67 get_cfg_var("get_file_path") didn't work correctly when an alternative
Sander Roobol authored
595 }
7e3b508 ws/style fixes
foobar authored
596
5af649e Zeev Suraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
597 if (free_ini_search_path) {
598 efree(php_ini_search_path);
599 }
7e3b508 ws/style fixes
foobar authored
600
42c82bb Revert the last patches.
foobar authored
601 PG(safe_mode) = safe_mode_state;
602 PG(open_basedir) = open_basedir;
603
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
604 if (fh.handle.fp) {
605 fh.type = ZEND_HANDLE_FP;
09b6f37 MFH:
Jani Taskinen authored
606 RESET_ACTIVE_INI_HASH();
42c82bb Revert the last patches.
foobar authored
607
09b6f37 MFH:
Jani Taskinen authored
608 zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC);
9be89ed MFH: ws fixes
Jani Taskinen authored
609
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
610 {
611 zval tmp;
9be89ed MFH: ws fixes
Jani Taskinen authored
612
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
613 Z_STRLEN(tmp) = strlen(fh.filename);
614 Z_STRVAL(tmp) = zend_strndup(fh.filename, Z_STRLEN(tmp));
615 Z_TYPE(tmp) = IS_STRING;
4b4d634 MFH: Added macros for managing zval refcounts and is_ref statuses
Yiduo (David) Wang authored
616 Z_SET_REFCOUNT(tmp, 0);
09b6f37 MFH:
Jani Taskinen authored
617
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
618 zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"), (void *) &tmp, sizeof(zval), NULL);
7e3b508 ws/style fixes
foobar authored
619 if (php_ini_opened_path) {
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
620 efree(php_ini_opened_path);
7e3b508 ws/style fixes
foobar authored
621 }
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
622 php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
623 }
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by Wez...
Marcus Boerger authored
624 }
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
625
e5e6f55 MFH
Jani Taskinen authored
626 /* Check for PHP_INI_SCAN_DIR environment variable to override/set config file scan directory */
627 php_ini_scanned_path = getenv("PHP_INI_SCAN_DIR");
628 if (!php_ini_scanned_path) {
629 /* Or fall back using possible --with-config-file-scan-dir setting (defaults to empty string!) */
630 php_ini_scanned_path = PHP_CONFIG_FILE_SCAN_DIR;
631 }
1463a82 pierrejoye - move declaration on top and fix build error
pierrejoye authored
632 php_ini_scanned_path_len = strlen(php_ini_scanned_path);
e5e6f55 MFH
Jani Taskinen authored
633
634 /* Scan and parse any .ini files found in scan path if path not empty. */
635 if (!sapi_module.php_ini_ignore && php_ini_scanned_path_len) {
8d352d2 Fixed bug #21625 (When scanning a directory for ini files, do so in
Ilia Alshanetsky authored
636 struct dirent **namelist;
637 int ndir, i;
09b6f37 MFH:
Jani Taskinen authored
638 struct stat sb;
639 char ini_file[MAXPATHLEN];
640 char *p;
641 zend_file_handle fh;
642 zend_llist scanned_ini_list;
643 zend_llist_element *element;
644 int l, total_l = 0;
645
646 /* Reset active ini section */
647 RESET_ACTIVE_INI_HASH();
8d352d2 Fixed bug #21625 (When scanning a directory for ini files, do so in
Ilia Alshanetsky authored
648
e5e6f55 MFH
Jani Taskinen authored
649 if ((ndir = php_scandir(php_ini_scanned_path, &namelist, 0, php_alphasort)) > 0) {
09b6f37 MFH:
Jani Taskinen authored
650 zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
651 memset(&fh, 0, sizeof(fh));
652
8d352d2 Fixed bug #21625 (When scanning a directory for ini files, do so in
Ilia Alshanetsky authored
653 for (i = 0; i < ndir; i++) {
09b6f37 MFH:
Jani Taskinen authored
654
655 /* check for any file with .ini extension */
8d352d2 Fixed bug #21625 (When scanning a directory for ini files, do so in
Ilia Alshanetsky authored
656 if (!(p = strrchr(namelist[i]->d_name, '.')) || (p && strcmp(p, ".ini"))) {
657 free(namelist[i]);
d454bec - Whitespace
Derick Rethans authored
658 continue;
659 }
e5e6f55 MFH
Jani Taskinen authored
660 if (IS_SLASH(php_ini_scanned_path[php_ini_scanned_path_len - 1])) {
661 snprintf(ini_file, MAXPATHLEN, "%s%s", php_ini_scanned_path, namelist[i]->d_name);
662 } else {
663 snprintf(ini_file, MAXPATHLEN, "%s%c%s", php_ini_scanned_path, DEFAULT_SLASH, namelist[i]->d_name);
664 }
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
665 if (VCWD_STAT(ini_file, &sb) == 0) {
666 if (S_ISREG(sb.st_mode)) {
667 if ((fh.handle.fp = VCWD_FOPEN(ini_file, "r"))) {
668 fh.filename = ini_file;
1ad304c Rasmus Lerdorf MFB config-file-scan-dir crash fix
rlerdorf authored
669 fh.type = ZEND_HANDLE_FP;
09b6f37 MFH:
Jani Taskinen authored
670
671 if (zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC) == SUCCESS) {
672 /* Here, add it to the list of ini files read */
673 l = strlen(ini_file);
674 total_l += l + 2;
675 p = estrndup(ini_file, l);
676 zend_llist_add_element(&scanned_ini_list, &p);
677 }
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
678 }
679 }
680 }
8d352d2 Fixed bug #21625 (When scanning a directory for ini files, do so in
Ilia Alshanetsky authored
681 free(namelist[i]);
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
682 }
8d352d2 Fixed bug #21625 (When scanning a directory for ini files, do so in
Ilia Alshanetsky authored
683 free(namelist);
684
3781af5 - Fixed zero bytes memory allocation when no extra ini files are found i...
Derick Rethans authored
685 if (total_l) {
09b6f37 MFH:
Jani Taskinen authored
686 int php_ini_scanned_files_len = (php_ini_scanned_files) ? strlen(php_ini_scanned_files) + 1 : 0;
687 php_ini_scanned_files = (char *) realloc(php_ini_scanned_files, php_ini_scanned_files_len + total_l + 1);
688 if (!php_ini_scanned_files_len) {
689 *php_ini_scanned_files = '\0';
690 }
691 total_l += php_ini_scanned_files_len;
3781af5 - Fixed zero bytes memory allocation when no extra ini files are found i...
Derick Rethans authored
692 for (element = scanned_ini_list.head; element; element = element->next) {
09b6f37 MFH:
Jani Taskinen authored
693 if (php_ini_scanned_files_len) {
694 strlcat(php_ini_scanned_files, ",\n", total_l);
695 }
112462d Antony Dovgal MFH
tony2001 authored
696 strlcat(php_ini_scanned_files, *(char **)element->data, total_l);
697 strlcat(php_ini_scanned_files, element->next ? ",\n" : "\n", total_l);
9be89ed MFH: ws fixes
Jani Taskinen authored
698 }
3781af5 - Fixed zero bytes memory allocation when no extra ini files are found i...
Derick Rethans authored
699 }
ac9f4cc - We always need to destroy the llist though.
Derick Rethans authored
700 zend_llist_destroy(&scanned_ini_list);
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
701 }
e5e6f55 MFH
Jani Taskinen authored
702 } else {
703 /* Make sure an empty php_ini_scanned_path ends up as NULL */
704 php_ini_scanned_path = NULL;
42c82bb Revert the last patches.
foobar authored
705 }
7d14dad MFH: Fixed mess with CGI/CLI -d command line option (now it works with c...
Dmitry Stogov authored
706
707 if (sapi_module.ini_entries) {
09b6f37 MFH:
Jani Taskinen authored
708 /* Reset active ini section */
709 RESET_ACTIVE_INI_HASH();
710 zend_parse_ini_string(sapi_module.ini_entries, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC);
7d14dad MFH: Fixed mess with CGI/CLI -d command line option (now it works with c...
Dmitry Stogov authored
711 }
712
42c82bb Revert the last patches.
foobar authored
713 return SUCCESS;
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
714 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
715 /* }}} */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
716
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
717 /* {{{ php_shutdown_config
718 */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
719 int php_shutdown_config(void)
720 {
42c82bb Revert the last patches.
foobar authored
721 zend_hash_destroy(&configuration_hash);
722 if (php_ini_opened_path) {
723 free(php_ini_opened_path);
2a2d49b Fixed bug #30050 (Possible crash inside php_shutdown_config()).
Ilia Alshanetsky authored
724 php_ini_opened_path = NULL;
42c82bb Revert the last patches.
foobar authored
725 }
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
726 if (php_ini_scanned_files) {
727 free(php_ini_scanned_files);
2a2d49b Fixed bug #30050 (Possible crash inside php_shutdown_config()).
Ilia Alshanetsky authored
728 php_ini_scanned_files = NULL;
989a61e Rasmus Lerdorf As discussed, add --with-config-file-scan-dir compile-time switch defini...
rlerdorf authored
729 }
42c82bb Revert the last patches.
foobar authored
730 return SUCCESS;
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
731 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
732 /* }}} */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
733
f47c784 Improved PHP extension loading mechanism with support for module depende...
Dmitry Stogov authored
734 /* {{{ php_ini_register_extensions
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
735 */
f47c784 Improved PHP extension loading mechanism with support for module depende...
Dmitry Stogov authored
736 void php_ini_register_extensions(TSRMLS_D)
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
737 {
42c82bb Revert the last patches.
foobar authored
738 zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC);
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
739 zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb TSRMLS_CC);
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
740
42c82bb Revert the last patches.
foobar authored
741 zend_llist_destroy(&extension_lists.engine);
742 zend_llist_destroy(&extension_lists.functions);
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
743 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
744 /* }}} */
9db5589 Zeev Suraski Recode delayed loading in a much simpler way (switched back to php_ini.c...
zsuraski authored
745
09b6f37 MFH:
Jani Taskinen authored
746 /* {{{ php_parse_user_ini_file
747 */
cf7384a Felipe Pena - MFH: Constness (Added const qualifier to several function parameters)
felipensp authored
748 PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, HashTable *target_hash TSRMLS_DC)
09b6f37 MFH:
Jani Taskinen authored
749 {
750 struct stat sb;
751 char ini_file[MAXPATHLEN];
752 zend_file_handle fh;
753
754 snprintf(ini_file, MAXPATHLEN, "%s%c%s", dirname, DEFAULT_SLASH, ini_filename);
755
756 if (VCWD_STAT(ini_file, &sb) == 0) {
757 if (S_ISREG(sb.st_mode)) {
758 memset(&fh, 0, sizeof(fh));
759 if ((fh.handle.fp = VCWD_FOPEN(ini_file, "r"))) {
760 fh.filename = ini_file;
761 fh.type = ZEND_HANDLE_FP;
762
763 /* Reset active ini section */
764 RESET_ACTIVE_INI_HASH();
765
766 if (zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, target_hash TSRMLS_CC) == SUCCESS) {
767 /* FIXME: Add parsed file to the list of user files read? */
768 return SUCCESS;
769 }
770 return FAILURE;
771 }
772 }
773 }
774 return FAILURE;
775 }
776 /* }}} */
777
778 /* {{{ php_ini_activate_config
779 */
780 PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage TSRMLS_DC)
781 {
782 char *str;
783 zval *data;
784 uint str_len;
785 ulong num_index;
786
787 /* Walk through config hash and alter matching ini entries using the values found in the hash */
788 for (zend_hash_internal_pointer_reset(source_hash);
789 zend_hash_get_current_key_ex(source_hash, &str, &str_len, &num_index, 0, NULL) == HASH_KEY_IS_STRING;
790 zend_hash_move_forward(source_hash)
791 ) {
792 zend_hash_get_current_data(source_hash, (void **) &data);
793 zend_alter_ini_entry_ex(str, str_len, Z_STRVAL_P(data), Z_STRLEN_P(data), modify_type, stage, 0 TSRMLS_CC);
794 }
795 }
796 /* }}} */
797
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
798 /* {{{ php_ini_has_per_dir_config
799 */
800 PHPAPI int php_ini_has_per_dir_config(void)
801 {
802 return has_per_dir_config;
803 }
804 /* }}} */
805
09b6f37 MFH:
Jani Taskinen authored
806 /* {{{ php_ini_activate_per_dir_config
807 */
808 PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len TSRMLS_DC)
809 {
810 zval *tmp;
811 char *ptr;
812
813 /* Walk through each directory in path and apply any found per-dir-system-configuration from configuration_hash */
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
814 if (has_per_dir_config && path && path_len) {
09b6f37 MFH:
Jani Taskinen authored
815 ptr = path + 1;
816 while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
817 *ptr = 0;
818 /* Search for source array matching the path from configuration_hash */
819 if (zend_hash_find(&configuration_hash, path, path_len, (void **) &tmp) == SUCCESS) {
820 php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
821 }
822 *ptr = '/';
823 ptr++;
824 }
825 }
826 }
827 /* }}} */
828
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
829 /* {{{ php_ini_has_per_host_config
830 */
831 PHPAPI int php_ini_has_per_host_config(void)
832 {
833 return has_per_host_config;
834 }
835 /* }}} */
836
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
837 /* {{{ php_ini_activate_per_host_config
838 */
cf7384a Felipe Pena - MFH: Constness (Added const qualifier to several function parameters)
felipensp authored
839 PHPAPI void php_ini_activate_per_host_config(const char *host, uint host_len TSRMLS_DC)
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
840 {
841 zval *tmp;
842
ba8e317 Optimized request startup sequence for php.ini without per dir and per h...
Dmitry Stogov authored
843 if (has_per_host_config && host && host_len) {
02d966c MFH:- Added support for [HOST=www.example.com] special sections
Jani Taskinen authored
844 /* Search for source array matching the host from configuration_hash */
845 if (zend_hash_find(&configuration_hash, host, host_len, (void **) &tmp) == SUCCESS) {
846 php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
847 }
848 }
849 }
850 /* }}} */
851
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
852 /* {{{ cfg_get_entry
853 */
cf7384a Felipe Pena - MFH: Constness (Added const qualifier to several function parameters)
felipensp authored
854 PHPAPI zval *cfg_get_entry(const char *name, uint name_length)
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
855 {
42c82bb Revert the last patches.
foobar authored
856 zval *tmp;
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
857
7e3b508 ws/style fixes
foobar authored
858 if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp) == SUCCESS) {
42c82bb Revert the last patches.
foobar authored
859 return tmp;
860 } else {
861 return NULL;
862 }
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
863 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
864 /* }}} */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
865
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
866 /* {{{ cfg_get_long
867 */
cf7384a Felipe Pena - MFH: Constness (Added const qualifier to several function parameters)
felipensp authored
868 PHPAPI int cfg_get_long(const char *varname, long *result)
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
869 {
42c82bb Revert the last patches.
foobar authored
870 zval *tmp, var;
b9ddb5c MFH
Jani Taskinen authored
871
7e3b508 ws/style fixes
foobar authored
872 if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) {
e1814f0 WIN64 support
Dmitry Stogov authored
873 *result = 0;
42c82bb Revert the last patches.
foobar authored
874 return FAILURE;
875 }
876 var = *tmp;
877 zval_copy_ctor(&var);
878 convert_to_long(&var);
879 *result = Z_LVAL(var);
880 return SUCCESS;
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
881 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
882 /* }}} */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
883
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
884 /* {{{ cfg_get_double
885 */
cf7384a Felipe Pena - MFH: Constness (Added const qualifier to several function parameters)
felipensp authored
886 PHPAPI int cfg_get_double(const char *varname, double *result)
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
887 {
42c82bb Revert the last patches.
foobar authored
888 zval *tmp, var;
b9ddb5c MFH
Jani Taskinen authored
889
7e3b508 ws/style fixes
foobar authored
890 if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) {
891 *result = (double) 0;
42c82bb Revert the last patches.
foobar authored
892 return FAILURE;
893 }
894 var = *tmp;
895 zval_copy_ctor(&var);
896 convert_to_double(&var);
897 *result = Z_DVAL(var);
898 return SUCCESS;
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
899 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
900 /* }}} */
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
901
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
902 /* {{{ cfg_get_string
903 */
cf7384a Felipe Pena - MFH: Constness (Added const qualifier to several function parameters)
felipensp authored
904 PHPAPI int cfg_get_string(const char *varname, char **result)
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
905 {
42c82bb Revert the last patches.
foobar authored
906 zval *tmp;
907
7e3b508 ws/style fixes
foobar authored
908 if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp) == FAILURE) {
909 *result = NULL;
42c82bb Revert the last patches.
foobar authored
910 return FAILURE;
911 }
912 *result = Z_STRVAL_P(tmp);
913 return SUCCESS;
78194a4 Zeev Suraski - Complete the move to the new INI parser. (Side effect: at last, peop...
zsuraski authored
914 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
915 /* }}} */
2cf1b8d * expanded the following constants and made them available in PHP:
Stig Bakken authored
916
fa94dab - MFH Rename dump_config_hash() to get_config_hash() as it doesn't dump
Marcus Boerger authored
917 PHPAPI HashTable* php_ini_get_configuration_hash(void) /* {{{ */
09b6f37 MFH:
Jani Taskinen authored
918 {
fa94dab - MFH Rename dump_config_hash() to get_config_hash() as it doesn't dump
Marcus Boerger authored
919 return &configuration_hash;
920 } /* }}} */
09b6f37 MFH:
Jani Taskinen authored
921
2cf1b8d * expanded the following constants and made them available in PHP:
Stig Bakken authored
922 /*
923 * Local variables:
924 * tab-width: 4
925 * c-basic-offset: 4
926 * indent-tabs-mode: t
927 * End:
78747bd - Don't wrap lines... this is annoying while coding.
Derick Rethans authored
928 * vim600: sw=4 ts=4 fdm=marker
929 * vim<600: sw=4 ts=4
2cf1b8d * expanded the following constants and made them available in PHP:
Stig Bakken authored
930 */
Something went wrong with that request. Please try again.