-
Notifications
You must be signed in to change notification settings - Fork 32
/
psr_http_message.c
211 lines (177 loc) · 8.88 KB
/
psr_http_message.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/spl/spl_exceptions.h"
#include "zend_API.h"
#include "zend_interfaces.h"
#include "php_psr.h"
#include "psr_http_message.h"
#include "psr_private.h"
/* {{{ Psr\Http\Message\MessageInterface */
PHP_PSR_API zend_class_entry * PsrHttpMessageMessageInterface_ce_ptr;
static zend_function_entry PsrHttpMessageMessageInterface_methods[] = {
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getProtocolVersion)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withProtocolVersion)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getHeaders)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, hasHeader)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getHeader)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getHeaderLine)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withHeader)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withAddedHeader)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withoutHeader)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getBody)
PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withBody)
PHP_FE_END
};
static zend_always_inline void php_register_PsrHttpMessageMessageInterface(INIT_FUNC_ARGS)
{
PHP_PSR_REGISTER_INTERFACE2(Http, Message, MessageInterface);
}
/* }}} Psr\Http\Message\MessageInterface */
/* {{{ Psr\Http\Message\RequestInterface */
PHP_PSR_API zend_class_entry * PsrHttpMessageRequestInterface_ce_ptr;
static zend_function_entry PsrHttpMessageRequestInterface_methods[] = {
PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, getRequestTarget)
PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, withRequestTarget)
PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, getMethod)
PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, withMethod)
PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, getUri)
PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, withUri)
PHP_FE_END
};
static zend_always_inline void php_register_PsrHttpMessageRequestInterface(INIT_FUNC_ARGS)
{
PHP_PSR_REGISTER_INTERFACE2(Http, Message, RequestInterface);
// @todo make sure this is right
zend_class_implements(PsrHttpMessageRequestInterface_ce_ptr, 1, PsrHttpMessageMessageInterface_ce_ptr);
}
/* }}} Psr\Http\Message\RequestInterface */
/* {{{ Psr\Http\Message\ResponseInterface */
PHP_PSR_API zend_class_entry * PsrHttpMessageResponseInterface_ce_ptr;
static zend_function_entry PsrHttpMessageResponseInterface_methods[] = {
PHP_PSR_ABSTRACT_ME(HttpMessage, ResponseInterface, getStatusCode)
PHP_PSR_ABSTRACT_ME(HttpMessage, ResponseInterface, withStatus)
PHP_PSR_ABSTRACT_ME(HttpMessage, ResponseInterface, getReasonPhrase)
PHP_FE_END
};
static zend_always_inline void php_register_PsrHttpMessageResponseInterface(INIT_FUNC_ARGS)
{
PHP_PSR_REGISTER_INTERFACE2(Http, Message, ResponseInterface);
zend_class_implements(PsrHttpMessageResponseInterface_ce_ptr, 1, PsrHttpMessageMessageInterface_ce_ptr);
}
/* }}} Psr\Http\Message\ResponseInterface */
/* {{{ Psr\Http\Message\ServerRequestInterface */
PHP_PSR_API zend_class_entry * PsrHttpMessageServerRequestInterface_ce_ptr;
static zend_function_entry PsrHttpMessageServerRequestInterface_methods[] = {
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getServerParams)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getCookieParams)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withCookieParams)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getQueryParams)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withQueryParams)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getUploadedFiles)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withUploadedFiles)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getParsedBody)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withParsedBody)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getAttributes)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getAttribute)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withAttribute)
PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withoutAttribute)
PHP_FE_END
};
static zend_always_inline void php_register_PsrHttpMessageServerRequestInterface(INIT_FUNC_ARGS)
{
PHP_PSR_REGISTER_INTERFACE2(Http, Message, ServerRequestInterface);
zend_class_implements(PsrHttpMessageServerRequestInterface_ce_ptr, 1, PsrHttpMessageRequestInterface_ce_ptr);
}
/* }}} Psr\Http\Message\ServerRequestInterface */
/* {{{ Psr\Http\Message\StreamInterface */
PHP_PSR_API zend_class_entry * PsrHttpMessageStreamInterface_ce_ptr;
static zend_function_entry PsrHttpMessageStreamInterface_methods[] = {
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, __toString)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, close)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, detach)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, getSize)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, tell)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, eof)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, isSeekable)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, seek)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, rewind)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, isWritable)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, write)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, isReadable)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, read)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, getContents)
PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, getMetadata)
PHP_FE_END
};
static zend_always_inline void php_register_PsrHttpMessageStreamInterface(INIT_FUNC_ARGS)
{
PHP_PSR_REGISTER_INTERFACE2(Http, Message, StreamInterface);
}
/* }}} Psr\Http\Message\StreamInterface */
/* {{{ Psr\Http\Message\UploadedFileInterface */
PHP_PSR_API zend_class_entry * PsrHttpMessageUploadedFileInterface_ce_ptr;
static zend_function_entry PsrHttpMessageUploadedFileInterface_methods[] = {
PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getStream)
PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, moveTo)
PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getSize)
PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getError)
PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getClientFilename)
PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getClientMediaType)
PHP_FE_END
};
static zend_always_inline void php_register_PsrHttpMessageUploadedFileInterface(INIT_FUNC_ARGS)
{
PHP_PSR_REGISTER_INTERFACE2(Http, Message, UploadedFileInterface);
}
/* }}} Psr\Http\Message\UploadedFileInterface */
/* {{{ Psr\Http\Message\UriInterface */
PHP_PSR_API zend_class_entry * PsrHttpMessageUriInterface_ce_ptr;
static zend_function_entry PsrHttpMessageUriInterface_methods[] = {
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getScheme)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getAuthority)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getUserInfo)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getHost)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getPort)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getPath)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getQuery)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getFragment)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withScheme)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withUserInfo)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withHost)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withPort)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withPath)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withQuery)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withFragment)
PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, __toString)
PHP_FE_END
};
static zend_always_inline void php_register_PsrHttpMessageUriInterface(INIT_FUNC_ARGS)
{
PHP_PSR_REGISTER_INTERFACE2(Http, Message, UriInterface);
}
/* }}} Psr\Http\Message\UriInterface */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(psr_http_message)
{
php_register_PsrHttpMessageMessageInterface(INIT_FUNC_ARGS_PASSTHRU);
php_register_PsrHttpMessageRequestInterface(INIT_FUNC_ARGS_PASSTHRU);
php_register_PsrHttpMessageResponseInterface(INIT_FUNC_ARGS_PASSTHRU);
php_register_PsrHttpMessageServerRequestInterface(INIT_FUNC_ARGS_PASSTHRU);
php_register_PsrHttpMessageStreamInterface(INIT_FUNC_ARGS_PASSTHRU);
php_register_PsrHttpMessageUploadedFileInterface(INIT_FUNC_ARGS_PASSTHRU);
php_register_PsrHttpMessageUriInterface(INIT_FUNC_ARGS_PASSTHRU);
return SUCCESS;
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: fdm=marker
* vim: et sw=4 ts=4
*/