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