Fix heredoc/nowdoc bugs with large docs, docs crossing buffer boundaries
[hiphop-php.git] / hphp / idl / server.idl.php
blob3c1018e5c26dc8163de1dc888ef2a81d7f0101b7
1 <?php
2 /**
3 * Automatically generated by running "php schema.php server".
5 * You may modify the file, but re-running schema.php against this file will
6 * standardize the format without losing your schema changes. It does lose
7 * any changes that are not part of schema. Use "note" field to comment on
8 * schema itself, and "note" fields are not used in any code generation but
9 * only staying within this file.
11 ///////////////////////////////////////////////////////////////////////////////
12 // Preamble: C++ code inserted at beginning of ext_{name}.h
14 DefinePreamble(<<<CPP
16 CPP
19 ///////////////////////////////////////////////////////////////////////////////
20 // Constants
22 // array (
23 // 'name' => name of the constant
24 // 'type' => type of the constant
25 // 'note' => additional note about this constant's schema
26 // )
29 ///////////////////////////////////////////////////////////////////////////////
30 // Functions
32 // array (
33 // 'name' => name of the function
34 // 'desc' => description of the function's purpose
35 // 'flags' => attributes of the function, see base.php for possible values
36 // 'opt' => optimization callback function's name for compiler
37 // 'note' => additional note about this function's schema
38 // 'return' =>
39 // array (
40 // 'type' => return type, use Reference for ref return
41 // 'desc' => description of the return value
42 // )
43 // 'args' => arguments
44 // array (
45 // 'name' => name of the argument
46 // 'type' => type of the argument, use Reference for output parameter
47 // 'value' => default value of the argument
48 // 'desc' => description of the argument
49 // )
50 // )
52 DefineFunction(
53 array(
54 'name' => "dangling_server_proxy_old_request",
55 'desc' => "When I'm running a newer version of the server software and I'm getting an HTTP request that's from old version of a web page, proxy it to a local instance that is still running or dangling just for handling old version of requests. Please read server documentation for more details.",
56 'flags' => HasDocComment | HipHopSpecific,
57 'return' => array(
58 'type' => Boolean,
59 'desc' => "TRUE if successful, FALSE otherwise.",
61 ));
63 DefineFunction(
64 array(
65 'name' => "dangling_server_proxy_new_request",
66 'desc' => "When I'm still running an old version of the server software and I'm getting an HTTP request that's newer, proxy it to a specified host that already has the new version of the software running. Please read server documentation for more details.",
67 'flags' => HasDocComment | HipHopSpecific,
68 'return' => array(
69 'type' => Boolean,
70 'desc' => "TRUE if successful, FALSE otherwise.",
72 'args' => array(
73 array(
74 'name' => "host",
75 'type' => String,
76 'desc' => "The machine to proxy to.",
79 ));
81 DefineConstant(
82 array(
83 'name' => "PAGELET_NOT_READY", // no data is available
84 'type' => Int64,
85 ));
87 DefineConstant(
88 array(
89 'name' => "PAGELET_READY", // data available (flushed)
90 'type' => Int64,
91 ));
93 DefineConstant(
94 array(
95 'name' => "PAGELET_DONE", // the pagelet request is finished
96 'type' => Int64,
97 ));
99 DefineFunction(
100 array(
101 'name' => "pagelet_server_is_enabled",
102 'desc' => "Whether pagelet server is enabled or not. Please read server documentation for what a pagelet server is.",
103 'flags' => HasDocComment | HipHopSpecific,
104 'return' => array(
105 'type' => Boolean,
106 'desc' => "TRUE if it's enabled, FALSE otherwise.",
110 DefineFunction(
111 array(
112 'name' => "pagelet_server_task_start",
113 'desc' => "Processes a pagelet server request.",
114 'flags' => HasDocComment | HipHopSpecific,
115 'return' => array(
116 'type' => Resource,
117 'desc' => "An object that can be used with pagelet_server_task_status() or pagelet_server_task_result().",
119 'args' => array(
120 array(
121 'name' => "url",
122 'type' => String,
123 'desc' => "The URL we're running this pagelet with.",
125 array(
126 'name' => "headers",
127 'type' => StringMap,
128 'value' => "null_array",
129 'desc' => "HTTP headers to send to the pagelet.",
131 array(
132 'name' => "post_data",
133 'type' => String,
134 'value' => "null_string",
135 'desc' => "POST data to send.",
137 array(
138 'name' => "files",
139 'type' => VariantVec,
140 'value' => "null_array",
141 'desc' => "$_FILES for the pagelet.",
146 DefineFunction(
147 array(
148 'name' => "pagelet_server_task_status",
149 'desc' => "Checks finish status of a pagelet task.",
150 'flags' => HasDocComment | HipHopSpecific,
151 'return' => array(
152 'type' => Int64,
153 'desc' => "PAGELET_NOT_READY if there is no data available, PAGELET_READY if (partial) data is available from pagelet_server_flush(), and PAGELET_DONE if the pagelet request is done.",
155 'args' => array(
156 array(
157 'name' => "task",
158 'type' => Resource,
159 'desc' => "The pagelet task handle returned from pagelet_server_task_start().",
164 DefineFunction(
165 array(
166 'name' => "pagelet_server_task_result",
167 'desc' => "Block and wait until pagelet task finishes or times out.",
168 'flags' => HasDocComment | HipHopSpecific,
169 'return' => array(
170 'type' => String,
171 'desc' => "HTTP response from the pagelet.",
173 'args' => array(
174 array(
175 'name' => "task",
176 'type' => Resource,
177 'desc' => "The pagelet task handle returned from pagelet_server_task_start().",
179 array(
180 'name' => "headers",
181 'type' => Variant | Reference,
182 'desc' => "HTTP response headers.",
184 array(
185 'name' => "code",
186 'type' => Variant | Reference,
187 'desc' => "HTTP response code. Set to -1 in the event of a timeout.",
189 array(
190 'name' => "timeout_ms",
191 'type' => Int64,
192 'value' => "0",
193 'desc' => "How many milliseconds to wait. A timeout of zero is interpreted as an infinite timeout.",
198 DefineFunction(
199 array(
200 'name' => "pagelet_server_flush",
201 'desc' => "Flush all the currently buffered output, so that the main thread can read it with pagelet_server_task_result(). This is only meaningful in a pagelet thread.",
202 'flags' => HasDocComment | HipHopSpecific,
203 'return' => array(
204 'type' => null,
205 'desc' => "No value is returned.",
209 DefineFunction(
210 array(
211 'name' => "xbox_send_message",
212 'desc' => "Sends an xbox message and waits for response. Please read server documentation for what an xbox is.",
213 'flags' => HasDocComment | HipHopSpecific,
214 'return' => array(
215 'type' => Boolean,
216 'desc' => "TRUE if successful, FALSE otherwise.",
218 'args' => array(
219 array(
220 'name' => "msg",
221 'type' => String,
222 'desc' => "The message.",
224 array(
225 'name' => "ret",
226 'type' => Variant | Reference,
227 'desc' => "The response.",
229 array(
230 'name' => "timeout_ms",
231 'type' => Int64,
232 'desc' => "How many milli-seconds to wait.",
234 array(
235 'name' => "host",
236 'type' => String,
237 'value' => "\"localhost\"",
238 'desc' => "Which machine to send to.",
243 DefineFunction(
244 array(
245 'name' => "xbox_post_message",
246 'desc' => "Posts an xbox message without waiting. Please read server documentation for more details.",
247 'flags' => HasDocComment | HipHopSpecific,
248 'return' => array(
249 'type' => Boolean,
250 'desc' => "TRUE if successful, FALSE otherwise.",
252 'args' => array(
253 array(
254 'name' => "msg",
255 'type' => String,
256 'desc' => "The response.",
258 array(
259 'name' => "host",
260 'type' => String,
261 'value' => "\"localhost\"",
262 'desc' => "Which machine to post to.",
267 DefineFunction(
268 array(
269 'name' => "xbox_task_start",
270 'desc' => "Starts a local xbox task.",
271 'flags' => HasDocComment | HipHopSpecific,
272 'return' => array(
273 'type' => Resource,
274 'desc' => "A task handle xbox_task_status() and xbox_task_result() can use.",
276 'args' => array(
277 array(
278 'name' => "message",
279 'type' => String,
280 'desc' => "A message to send to xbox's message processing function.",
285 DefineFunction(
286 array(
287 'name' => "xbox_task_status",
288 'desc' => "Checks an xbox task's status.",
289 'flags' => HasDocComment | HipHopSpecific,
290 'return' => array(
291 'type' => Boolean,
292 'desc' => "TRUE if finished, FALSE otherwise.",
294 'args' => array(
295 array(
296 'name' => "task",
297 'type' => Resource,
298 'desc' => "The xbox task object created by xbox_task_start().",
303 DefineFunction(
304 array(
305 'name' => "xbox_task_result",
306 'desc' => "Block and wait for xbox task's result.",
307 'flags' => HasDocComment | HipHopSpecific,
308 'return' => array(
309 'type' => Int64,
310 'desc' => "Response code following HTTP's responses. For example, 200 for success and 500 for server error.",
312 'args' => array(
313 array(
314 'name' => "task",
315 'type' => Resource,
316 'desc' => "The xbox task object created by xbox_task_start().",
318 array(
319 'name' => "timeout_ms",
320 'type' => Int64,
321 'desc' => "How many milli-seconds to wait.",
323 array(
324 'name' => "ret",
325 'type' => Variant | Reference,
326 'desc' => "xbox message processing function's return value.",
331 DefineFunction(
332 array(
333 'name' => "xbox_process_call_message",
334 'desc' => "This function is invoked by the xbox facility to start an xbox call task. This function is not intended to be called directly by user code.",
335 'flags' => HasDocComment | HipHopSpecific,
336 'return' => array(
337 'type' => Variant,
338 'desc' => "The return value of the xbox call task.",
340 'args' => array(
341 array(
342 'name' => "msg",
343 'type' => String,
344 'desc' => "The call message.",
349 DefineFunction(
350 array(
351 'name' => "xbox_get_thread_timeout",
352 'desc' => "Gets the timeout (maximum duration), in seconds, of the current xbox thread. Throws for non-xbox threads.",
353 'flags' => HasDocComment | HipHopSpecific,
354 'return' => array(
355 'type' => Int64,
356 'desc' => "The current timeout (maximum duration).",
360 DefineFunction(
361 array(
362 'name' => "xbox_set_thread_timeout",
363 'desc' => "Sets the timeout (maximum duration), in seconds, of the current xbox thread. The xbox thread would reset when this amount of time has passed since the previous reset. Throws for non-xbox threads.",
364 'flags' => HasDocComment | HipHopSpecific,
365 'return' => array(
366 'type' => null,
368 'args' => array(
369 array(
370 'name' => "timeout",
371 'type' => Int32,
372 'desc' => "The new timeout (maximum duration).",
377 DefineFunction(
378 array(
379 'name' => "xbox_schedule_thread_reset",
380 'desc' => "Schedules a reset of the current xbox thread, when the next request comes in. Throws for non-xbox threads.",
381 'flags' => HasDocComment | HipHopSpecific,
382 'return' => array(
383 'type' => null,
387 DefineFunction(
388 array(
389 'name' => "xbox_get_thread_time",
390 'desc' => "Returns the time that the current xbox thread has been running without a reset, in seconds, and throws for non-xbox threads.",
391 'flags' => HasDocComment | HipHopSpecific,
392 'return' => array(
393 'type' => Int64,
394 'desc' => "The time that the current xbox thread has been running without a reset.",
399 ///////////////////////////////////////////////////////////////////////////////
400 // Classes
402 // BeginClass
403 // array (
404 // 'name' => name of the class
405 // 'desc' => description of the class's purpose
406 // 'flags' => attributes of the class, see base.php for possible values
407 // 'note' => additional note about this class's schema
408 // 'parent' => parent class name, if any
409 // 'ifaces' => array of interfaces tihs class implements
410 // 'bases' => extra internal and special base classes this class requires
411 // 'footer' => extra C++ inserted at end of class declaration
412 // )
414 // DefineConstant(..)
415 // DefineConstant(..)
416 // ...
417 // DefineFunction(..)
418 // DefineFunction(..)
419 // ...
420 // DefineProperty
421 // DefineProperty
423 // array (
424 // 'name' => name of the property
425 // 'type' => type of the property
426 // 'flags' => attributes of the property
427 // 'desc' => description of the property
428 // 'note' => additional note about this property's schema
429 // )
431 // EndClass()