- typos & allow passing NULL as curl handle in http_request() again'
[m6w6/ext-http] / http_exception_object.c
1 /*
2 +----------------------------------------------------------------------+
3 | PECL :: http |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.0 of the PHP license, that |
6 | is bundled with this package in the file LICENSE, and is available |
7 | through the world-wide-web at http://www.php.net/license/3_0.txt. |
8 | If you did not receive a copy of the PHP license and are unable to |
9 | obtain it through the world-wide-web, please send a note to |
10 | license@php.net so we can mail you a copy immediately. |
11 +----------------------------------------------------------------------+
12 | Copyright (c) 2004-2005 Michael Wallner <mike@php.net> |
13 +----------------------------------------------------------------------+
14 */
15
16 /* $Id$ */
17
18
19 #ifdef HAVE_CONFIG_H
20 # include "config.h"
21 #endif
22
23 #include "php.h"
24
25 #include "php_http.h"
26 #include "php_http_std_defs.h"
27
28 #ifdef ZEND_ENGINE_2
29
30 #include "php_http_exception_object.h"
31 #include "zend_exceptions.h"
32
33 zend_class_entry *http_exception_object_ce;
34 zend_function_entry http_exception_object_fe[] = {{NULL, NULL, NULL}};
35
36 void _http_exception_object_init(INIT_FUNC_ARGS)
37 {
38 HTTP_REGISTER_CLASS(HttpException, http_exception_object, zend_exception_get_default(), 0);
39
40 HTTP_LONG_CONSTANT("HTTP_E_UNKNOWN", HTTP_E_UNKOWN);
41 HTTP_LONG_CONSTANT("HTTP_E_PARSE", HTTP_E_PARSE);
42 HTTP_LONG_CONSTANT("HTTP_E_HEADER", HTTP_E_HEADER);
43 HTTP_LONG_CONSTANT("HTTP_E_OBUFFER", HTTP_E_OBUFFER);
44 HTTP_LONG_CONSTANT("HTTP_E_CURL", HTTP_E_CURL);
45 HTTP_LONG_CONSTANT("HTTP_E_ENCODE", HTTP_E_ENCODE);
46 HTTP_LONG_CONSTANT("HTTP_E_PARAM", HTTP_E_PARAM);
47 HTTP_LONG_CONSTANT("HTTP_E_URL", HTTP_E_URL);
48 HTTP_LONG_CONSTANT("HTTP_E_MSG", HTTP_E_MSG);
49 }
50
51 zend_class_entry *_http_exception_get_default()
52 {
53 return http_exception_object_ce;
54 }
55
56 zend_class_entry *_http_exception_get_for_code(long code)
57 {
58 return http_exception_object_ce;
59 }
60
61 #endif
62
63 /*
64 * Local variables:
65 * tab-width: 4
66 * c-basic-offset: 4
67 * End:
68 * vim600: noet sw=4 ts=4 fdm=marker
69 * vim<600: noet sw=4 ts=4
70 */
71