Fix php_http_message.c:136:14: warning: comparison between 'enum <anonymous>' and...
[m6w6/ext-http] / php_http_url.c
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2011, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 #include "php_http_api.h"
14
15 static inline char *localhostname(void)
16 {
17 char hostname[1024] = {0};
18
19 #ifdef PHP_WIN32
20 if (SUCCESS == gethostname(hostname, lenof(hostname))) {
21 return estrdup(hostname);
22 }
23 #elif defined(HAVE_GETHOSTNAME)
24 if (SUCCESS == gethostname(hostname, lenof(hostname))) {
25 # if defined(HAVE_GETDOMAINNAME)
26 size_t hlen = strlen(hostname);
27 if (hlen <= lenof(hostname) - lenof("(none)")) {
28 hostname[hlen++] = '.';
29 if (SUCCESS == getdomainname(&hostname[hlen], lenof(hostname) - hlen)) {
30 if (!strcmp(&hostname[hlen], "(none)")) {
31 hostname[hlen - 1] = '\0';
32 }
33 return estrdup(hostname);
34 }
35 }
36 # endif
37 if (strcmp(hostname, "(none)")) {
38 return estrdup(hostname);
39 }
40 }
41 #endif
42 return estrndup("localhost", lenof("localhost"));
43 }
44
45 static php_url *php_http_url_from_env(php_url *url TSRMLS_DC)
46 {
47 zval *https, *zhost, *zport;
48 long port;
49 #ifdef HAVE_GETSERVBYPORT
50 struct servent *se;
51 #endif
52
53 if (!url) {
54 url = ecalloc(1, sizeof(*url));
55 }
56
57 /* port */
58 zport = php_http_env_get_server_var(ZEND_STRL("SERVER_PORT"), 1 TSRMLS_CC);
59 if (zport && IS_LONG == is_numeric_string(Z_STRVAL_P(zport), Z_STRLEN_P(zport), &port, NULL, 0)) {
60 url->port = port;
61 }
62
63 /* scheme */
64 https = php_http_env_get_server_var(ZEND_STRL("HTTPS"), 1 TSRMLS_CC);
65 if (https && !strcasecmp(Z_STRVAL_P(https), "ON")) {
66 url->scheme = estrndup("https", lenof("https"));
67 } else switch (url->port) {
68 case 443:
69 url->scheme = estrndup("https", lenof("https"));
70 break;
71
72 #ifndef HAVE_GETSERVBYPORT
73 default:
74 #endif
75 case 80:
76 case 0:
77 url->scheme = estrndup("http", lenof("http"));
78 break;
79
80 #ifdef HAVE_GETSERVBYPORT
81 default:
82 if ((se = getservbyport(htons(url->port), "tcp")) && se->s_name) {
83 url->scheme = estrdup(se->s_name);
84 } else {
85 url->scheme = estrndup("http", lenof("http"));
86 }
87 break;
88 #endif
89 }
90
91 /* host */
92 if ((((zhost = php_http_env_get_server_var(ZEND_STRL("HTTP_HOST"), 1 TSRMLS_CC)) ||
93 (zhost = php_http_env_get_server_var(ZEND_STRL("SERVER_NAME"), 1 TSRMLS_CC)) ||
94 (zhost = php_http_env_get_server_var(ZEND_STRL("SERVER_ADDR"), 1 TSRMLS_CC)))) && Z_STRLEN_P(zhost)) {
95 size_t stop_at = strspn(Z_STRVAL_P(zhost), "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-.");
96
97 url->host = estrndup(Z_STRVAL_P(zhost), stop_at);
98 } else {
99 url->host = localhostname();
100 }
101
102 /* path */
103 if (SG(request_info).request_uri && SG(request_info).request_uri[0]) {
104 const char *q = strchr(SG(request_info).request_uri, '?');
105
106 if (q) {
107 url->path = estrndup(SG(request_info).request_uri, q - SG(request_info).request_uri);
108 } else {
109 url->path = estrdup(SG(request_info).request_uri);
110 }
111 }
112
113 /* query */
114 if (SG(request_info).query_string && SG(request_info).query_string[0]) {
115 url->query = estrdup(SG(request_info).query_string);
116 }
117
118 return url;
119 }
120
121 PHP_HTTP_API void php_http_url(int flags, const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC)
122 {
123 php_url *url, *tmp_url = NULL;
124 #ifdef HAVE_GETSERVBYNAME
125 struct servent *se;
126 #endif
127
128 /* set from env if requested */
129 if (flags & PHP_HTTP_URL_FROM_ENV) {
130 php_url *env_url = php_http_url_from_env(NULL TSRMLS_CC);
131
132 php_http_url(flags ^ PHP_HTTP_URL_FROM_ENV, env_url, old_url, &tmp_url, NULL, NULL TSRMLS_CC);
133
134 php_url_free(env_url);
135 old_url = tmp_url;
136 }
137
138 url = ecalloc(1, sizeof(*url));
139
140 #define __URLSET(u,n) \
141 ((u)&&(u)->n)
142 #define __URLCPY(n) \
143 url->n = __URLSET(new_url,n) ? estrdup(new_url->n) : (__URLSET(old_url,n) ? estrdup(old_url->n) : NULL)
144
145 if (!(flags & PHP_HTTP_URL_STRIP_PORT)) {
146 url->port = __URLSET(new_url, port) ? new_url->port : ((old_url) ? old_url->port : 0);
147 }
148 if (!(flags & PHP_HTTP_URL_STRIP_USER)) {
149 __URLCPY(user);
150 }
151 if (!(flags & PHP_HTTP_URL_STRIP_PASS)) {
152 __URLCPY(pass);
153 }
154
155 __URLCPY(scheme);
156 __URLCPY(host);
157
158 if (!(flags & PHP_HTTP_URL_STRIP_PATH)) {
159 if ((flags & PHP_HTTP_URL_JOIN_PATH) && __URLSET(old_url, path) && __URLSET(new_url, path) && *new_url->path != '/') {
160 size_t old_path_len = strlen(old_url->path), new_path_len = strlen(new_url->path);
161
162 url->path = ecalloc(1, old_path_len + new_path_len + 1 + 1);
163
164 strcat(url->path, old_url->path);
165 if (url->path[old_path_len - 1] != '/') {
166 php_dirname(url->path, old_path_len);
167 strcat(url->path, "/");
168 }
169 strcat(url->path, new_url->path);
170 } else {
171 __URLCPY(path);
172 }
173 }
174 if (!(flags & PHP_HTTP_URL_STRIP_QUERY)) {
175 if ((flags & PHP_HTTP_URL_JOIN_QUERY) && __URLSET(new_url, query) && __URLSET(old_url, query)) {
176 zval qarr, qstr;
177
178 INIT_PZVAL(&qstr);
179 INIT_PZVAL(&qarr);
180 array_init(&qarr);
181
182 ZVAL_STRING(&qstr, old_url->query, 0);
183 php_http_querystring_update(&qarr, &qstr, NULL TSRMLS_CC);
184 ZVAL_STRING(&qstr, new_url->query, 0);
185 php_http_querystring_update(&qarr, &qstr, NULL TSRMLS_CC);
186
187 ZVAL_NULL(&qstr);
188 php_http_querystring_update(&qarr, NULL, &qstr TSRMLS_CC);
189 url->query = Z_STRVAL(qstr);
190 zval_dtor(&qarr);
191 } else {
192 __URLCPY(query);
193 }
194 }
195 if (!(flags & PHP_HTTP_URL_STRIP_FRAGMENT)) {
196 __URLCPY(fragment);
197 }
198
199 /* done with copy & combine & strip */
200
201 if (flags & PHP_HTTP_URL_FROM_ENV) {
202 /* free old_url we tainted above */
203 php_url_free(tmp_url);
204 }
205
206 /* set some sane defaults */
207
208 if (!url->scheme) {
209 url->scheme = estrndup("http", lenof("http"));
210 }
211
212 if (!url->host) {
213 url->host = estrndup("localhost", lenof("localhost"));
214 }
215
216 if (!url->path) {
217 url->path = estrndup("/", 1);
218 } else if (url->path[0] != '/') {
219 size_t plen = strlen(url->path);
220 char *path = emalloc(plen + 1 + 1);
221
222 path[0] = '/';
223 memcpy(&path[1], url->path, plen + 1);
224 STR_SET(url->path, path);
225 }
226 /* replace directory references if path is not a single slash */
227 if ((flags & PHP_HTTP_URL_SANITIZE_PATH)
228 && url->path[0] && (url->path[0] != '/' || url->path[1])) {
229 char *ptr, *end = url->path + strlen(url->path) + 1;
230
231 for (ptr = strchr(url->path, '/'); ptr; ptr = strchr(ptr, '/')) {
232 switch (ptr[1]) {
233 case '/':
234 memmove(&ptr[1], &ptr[2], end - &ptr[2]);
235 break;
236
237 case '.':
238 switch (ptr[2]) {
239 case '\0':
240 ptr[1] = '\0';
241 break;
242
243 case '/':
244 memmove(&ptr[1], &ptr[3], end - &ptr[3]);
245 break;
246
247 case '.':
248 if (ptr[3] == '/') {
249 char *pos = &ptr[4];
250 while (ptr != url->path) {
251 if (*--ptr == '/') {
252 break;
253 }
254 }
255 memmove(&ptr[1], pos, end - pos);
256 break;
257 } else if (!ptr[3]) {
258 /* .. at the end */
259 ptr[1] = '\0';
260 }
261 /* no break */
262
263 default:
264 /* something else */
265 ++ptr;
266 break;
267 }
268 break;
269
270 default:
271 ++ptr;
272 break;
273 }
274 }
275 }
276 /* unset default ports */
277 if (url->port) {
278 if ( ((url->port == 80) && !strcmp(url->scheme, "http"))
279 || ((url->port ==443) && !strcmp(url->scheme, "https"))
280 #ifdef HAVE_GETSERVBYNAME
281 || ((se = getservbyname(url->scheme, "tcp")) && se->s_port &&
282 (url->port == ntohs(se->s_port)))
283 #endif
284 ) {
285 url->port = 0;
286 }
287 }
288
289 if (url_str) {
290 size_t len;
291
292 *url_str = emalloc(PHP_HTTP_URL_MAXLEN + 1);
293
294 **url_str = '\0';
295 strlcat(*url_str, url->scheme, PHP_HTTP_URL_MAXLEN);
296 strlcat(*url_str, "://", PHP_HTTP_URL_MAXLEN);
297
298 if (url->user && *url->user) {
299 strlcat(*url_str, url->user, PHP_HTTP_URL_MAXLEN);
300 if (url->pass && *url->pass) {
301 strlcat(*url_str, ":", PHP_HTTP_URL_MAXLEN);
302 strlcat(*url_str, url->pass, PHP_HTTP_URL_MAXLEN);
303 }
304 strlcat(*url_str, "@", PHP_HTTP_URL_MAXLEN);
305 }
306
307 strlcat(*url_str, url->host, PHP_HTTP_URL_MAXLEN);
308
309 if (url->port) {
310 char port_str[8];
311
312 snprintf(port_str, sizeof(port_str), "%d", (int) url->port);
313 strlcat(*url_str, ":", PHP_HTTP_URL_MAXLEN);
314 strlcat(*url_str, port_str, PHP_HTTP_URL_MAXLEN);
315 }
316
317 strlcat(*url_str, url->path, PHP_HTTP_URL_MAXLEN);
318
319 if (url->query && *url->query) {
320 strlcat(*url_str, "?", PHP_HTTP_URL_MAXLEN);
321 strlcat(*url_str, url->query, PHP_HTTP_URL_MAXLEN);
322 }
323
324 if (url->fragment && *url->fragment) {
325 strlcat(*url_str, "#", PHP_HTTP_URL_MAXLEN);
326 strlcat(*url_str, url->fragment, PHP_HTTP_URL_MAXLEN);
327 }
328
329 if (PHP_HTTP_URL_MAXLEN == (len = strlen(*url_str))) {
330 php_http_error(HE_NOTICE, PHP_HTTP_E_URL, "Length of URL exceeds PHP_HTTP_URL_MAXLEN");
331 }
332 if (url_len) {
333 *url_len = len;
334 }
335 }
336
337 if (url_ptr) {
338 *url_ptr = url;
339 } else {
340 php_url_free(url);
341 }
342 }
343
344 PHP_HTTP_API STATUS php_http_url_encode_hash(HashTable *hash, const char *pre_encoded_str, size_t pre_encoded_len, char **encoded_str, size_t *encoded_len TSRMLS_DC)
345 {
346 const char *arg_sep_str;
347 size_t arg_sep_len;
348 php_http_buffer_t *qstr = php_http_buffer_new();
349
350 php_http_url_argsep(&arg_sep_str, &arg_sep_len TSRMLS_CC);
351
352 if (SUCCESS != php_http_url_encode_hash_ex(hash, qstr, arg_sep_str, arg_sep_len, "=", 1, pre_encoded_str, pre_encoded_len TSRMLS_CC)) {
353 php_http_buffer_free(&qstr);
354 return FAILURE;
355 }
356
357 php_http_buffer_data(qstr, encoded_str, encoded_len);
358 php_http_buffer_free(&qstr);
359
360 return SUCCESS;
361 }
362
363 PHP_HTTP_API STATUS php_http_url_encode_hash_ex(HashTable *hash, php_http_buffer_t *qstr, const char *arg_sep_str, size_t arg_sep_len, const char *val_sep_str, size_t val_sep_len, const char *pre_encoded_str, size_t pre_encoded_len TSRMLS_DC)
364 {
365 if (pre_encoded_len && pre_encoded_str) {
366 php_http_buffer_append(qstr, pre_encoded_str, pre_encoded_len);
367 }
368
369 if (!php_http_params_to_string(qstr, hash, arg_sep_str, arg_sep_len, "", 0, val_sep_str, val_sep_len, PHP_HTTP_PARAMS_QUERY TSRMLS_CC)) {
370 return FAILURE;
371 }
372
373 return SUCCESS;
374 }
375
376 #define PHP_HTTP_BEGIN_ARGS(method, req_args) PHP_HTTP_BEGIN_ARGS_EX(HttpUrl, method, 0, req_args)
377 #define PHP_HTTP_EMPTY_ARGS(method) PHP_HTTP_EMPTY_ARGS_EX(HttpUrl, method, 0)
378 #define PHP_HTTP_URL_ME(method, visibility) PHP_ME(HttpUrl, method, PHP_HTTP_ARGS(HttpUrl, method), visibility)
379
380 PHP_HTTP_BEGIN_ARGS(__construct, 0)
381 PHP_HTTP_ARG_VAL(old_url, 0)
382 PHP_HTTP_ARG_VAL(new_url, 0)
383 PHP_HTTP_ARG_VAL(flags, 0)
384 PHP_HTTP_END_ARGS;
385 PHP_HTTP_EMPTY_ARGS(toString);
386 PHP_HTTP_EMPTY_ARGS(toArray);
387
388 PHP_HTTP_BEGIN_ARGS(mod, 1)
389 PHP_HTTP_ARG_VAL(more_url_parts, 0)
390 PHP_HTTP_ARG_VAL(flags, 0)
391 PHP_HTTP_END_ARGS;
392
393 static zend_class_entry *php_http_url_class_entry;
394
395 zend_class_entry *php_http_url_get_class_entry(void)
396 {
397 return php_http_url_class_entry;
398 }
399
400 static zend_function_entry php_http_url_method_entry[] = {
401 PHP_HTTP_URL_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
402 PHP_HTTP_URL_ME(mod, ZEND_ACC_PUBLIC)
403 PHP_HTTP_URL_ME(toString, ZEND_ACC_PUBLIC)
404 ZEND_MALIAS(HttpUrl, __toString, toString, PHP_HTTP_ARGS(HttpUrl, toString), ZEND_ACC_PUBLIC)
405 PHP_HTTP_URL_ME(toArray, ZEND_ACC_PUBLIC)
406 EMPTY_FUNCTION_ENTRY
407 };
408
409 PHP_METHOD(HttpUrl, __construct)
410 {
411 with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
412 zval *new_url = NULL, *old_url = NULL;
413 long flags = PHP_HTTP_URL_FROM_ENV;
414
415 if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!z!l", &old_url, &new_url, &flags)) {
416 with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
417 php_url *res_purl, *new_purl = NULL, *old_purl = NULL;
418
419 if (new_url) {
420 switch (Z_TYPE_P(new_url)) {
421 case IS_OBJECT:
422 case IS_ARRAY:
423 new_purl = php_http_url_from_struct(NULL, HASH_OF(new_url) TSRMLS_CC);
424 break;
425 default: {
426 zval *cpy = php_http_ztyp(IS_STRING, new_url);
427
428 new_purl = php_url_parse(Z_STRVAL_P(cpy));
429 zval_ptr_dtor(&cpy);
430 break;
431 }
432 }
433 if (!new_purl) {
434 return;
435 }
436 }
437 if (old_url) {
438 switch (Z_TYPE_P(old_url)) {
439 case IS_OBJECT:
440 case IS_ARRAY:
441 old_purl = php_http_url_from_struct(NULL, HASH_OF(old_url) TSRMLS_CC);
442 break;
443 default: {
444 zval *cpy = php_http_ztyp(IS_STRING, old_url);
445
446 old_purl = php_url_parse(Z_STRVAL_P(cpy));
447 zval_ptr_dtor(&cpy);
448 break;
449 }
450 }
451 if (!old_purl) {
452 if (new_purl) {
453 php_url_free(new_purl);
454 }
455 return;
456 }
457 }
458
459 php_http_url(flags, old_purl, new_purl, &res_purl, NULL, NULL TSRMLS_CC);
460 php_http_url_to_struct(res_purl, getThis() TSRMLS_CC);
461
462 php_url_free(res_purl);
463 if (old_purl) {
464 php_url_free(old_purl);
465 }
466 if (new_purl) {
467 php_url_free(new_purl);
468 }
469 } end_error_handling();
470 }
471 } end_error_handling();
472 }
473
474 PHP_METHOD(HttpUrl, mod)
475 {
476 zval *new_url = NULL;
477 long flags = PHP_HTTP_URL_JOIN_PATH | PHP_HTTP_URL_JOIN_QUERY;
478
479 if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!|l", &new_url, &flags)) {
480 php_url *new_purl = NULL, *old_purl = NULL;
481
482 if (new_url) {
483 switch (Z_TYPE_P(new_url)) {
484 case IS_OBJECT:
485 case IS_ARRAY:
486 new_purl = php_http_url_from_struct(NULL, HASH_OF(new_url) TSRMLS_CC);
487 break;
488 default: {
489 zval *cpy = php_http_ztyp(IS_STRING, new_url);
490
491 new_purl = php_url_parse(Z_STRVAL_P(new_url));
492 zval_ptr_dtor(&cpy);
493 break;
494 }
495 }
496 if (!new_purl) {
497 return;
498 }
499 }
500
501 if ((old_purl = php_http_url_from_struct(NULL, HASH_OF(getThis()) TSRMLS_CC))) {
502 php_url *res_purl;
503
504 ZVAL_OBJVAL(return_value, zend_objects_clone_obj(getThis() TSRMLS_CC), 0);
505
506 php_http_url(flags, old_purl, new_purl, &res_purl, NULL, NULL TSRMLS_CC);
507 php_http_url_to_struct(res_purl, return_value TSRMLS_CC);
508
509 php_url_free(res_purl);
510 php_url_free(old_purl);
511 }
512 if (new_purl) {
513 php_url_free(new_purl);
514 }
515 }
516 }
517
518 PHP_METHOD(HttpUrl, toString)
519 {
520 if (SUCCESS == zend_parse_parameters_none()) {
521 php_url *purl;
522
523 if ((purl = php_http_url_from_struct(NULL, HASH_OF(getThis()) TSRMLS_CC))) {
524 char *str;
525 size_t len;
526
527 php_http_url(0, purl, NULL, NULL, &str, &len TSRMLS_CC);
528 php_url_free(purl);
529 RETURN_STRINGL(str, len, 0);
530 }
531 }
532 RETURN_EMPTY_STRING();
533 }
534
535 PHP_METHOD(HttpUrl, toArray)
536 {
537 if (SUCCESS != zend_parse_parameters_none()) {
538 RETURN_FALSE;
539 }
540 array_init(return_value);
541 array_copy(HASH_OF(getThis()), HASH_OF(return_value));
542 }
543
544 PHP_MINIT_FUNCTION(http_url)
545 {
546 PHP_HTTP_REGISTER_CLASS(http, Url, http_url, php_http_object_get_class_entry(), 0);
547
548 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("scheme"), ZEND_ACC_PUBLIC TSRMLS_CC);
549 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("user"), ZEND_ACC_PUBLIC TSRMLS_CC);
550 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("pass"), ZEND_ACC_PUBLIC TSRMLS_CC);
551 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("host"), ZEND_ACC_PUBLIC TSRMLS_CC);
552 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("port"), ZEND_ACC_PUBLIC TSRMLS_CC);
553 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("path"), ZEND_ACC_PUBLIC TSRMLS_CC);
554 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("query"), ZEND_ACC_PUBLIC TSRMLS_CC);
555 zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("fragment"), ZEND_ACC_PUBLIC TSRMLS_CC);
556
557 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("REPLACE"), PHP_HTTP_URL_REPLACE TSRMLS_CC);
558 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("JOIN_PATH"), PHP_HTTP_URL_JOIN_PATH TSRMLS_CC);
559 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("JOIN_QUERY"), PHP_HTTP_URL_JOIN_QUERY TSRMLS_CC);
560 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_USER"), PHP_HTTP_URL_STRIP_USER TSRMLS_CC);
561 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_PASS"), PHP_HTTP_URL_STRIP_PASS TSRMLS_CC);
562 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_AUTH"), PHP_HTTP_URL_STRIP_AUTH TSRMLS_CC);
563 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_PORT"), PHP_HTTP_URL_STRIP_PORT TSRMLS_CC);
564 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_PATH"), PHP_HTTP_URL_STRIP_PATH TSRMLS_CC);
565 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_QUERY"), PHP_HTTP_URL_STRIP_QUERY TSRMLS_CC);
566 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_FRAGMENT"), PHP_HTTP_URL_STRIP_FRAGMENT TSRMLS_CC);
567 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STRIP_ALL"), PHP_HTTP_URL_STRIP_ALL TSRMLS_CC);
568 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("FROM_ENV"), PHP_HTTP_URL_FROM_ENV TSRMLS_CC);
569 zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("SANITIZE_PATH"), PHP_HTTP_URL_SANITIZE_PATH TSRMLS_CC);
570
571 return SUCCESS;
572 }
573
574
575 /*
576 * Local variables:
577 * tab-width: 4
578 * c-basic-offset: 4
579 * End:
580 * vim600: noet sw=4 ts=4 fdm=marker
581 * vim<600: noet sw=4 ts=4
582 */
583