PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/system/idl/error.idl.json

http://github.com/facebook/hiphop-php
JSON | 297 lines | 297 code | 0 blank | 0 comment | 0 complexity | c5fed82b87af9e3de3ee984e947131a2 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. {
  2. "preamble": "",
  3. "consts": [
  4. {
  5. "name": "DEBUG_BACKTRACE_PROVIDE_OBJECT",
  6. "type": "Int64"
  7. },
  8. {
  9. "name": "DEBUG_BACKTRACE_IGNORE_ARGS",
  10. "type": "Int64"
  11. }
  12. ],
  13. "funcs": [
  14. {
  15. "name": "debug_backtrace",
  16. "desc": "debug_backtrace() generates a PHP backtrace.",
  17. "flags": [
  18. "NeedsActRec"
  19. ],
  20. "return": {
  21. "type": "StringVec",
  22. "desc": "Returns an associative array. The possible returned elements are as follows:\n\nPossible returned elements from debug_backtrace() Name Type Description function string The current function name. See also __FUNCTION__. line integer The current line number. See also __LINE__. file string The current file name. See also __FILE__. class string The current class name. See also __CLASS__ object object The current object. type string The current call type. If a method call, \"->\" is returned. If a static method call, \"::\" is returned. If a function call, nothing is returned. args array If inside a function, this lists the functions arguments. If inside an included file, this lists the included file name(s)."
  23. },
  24. "args": [
  25. {
  26. "name": "options",
  27. "type": "Int64",
  28. "value": "1",
  29. "desc": "Whether or not to populate the \"object\" index.\n\nDEBUG_BACKTRACE_PROVIDE_OBJECT: Whether or not to populate the \"object\" index.\nDEBUG_BACKTRACE_IGNORE_ARGS: Whether or not to omit the \"args\" index, and thus all the function/method arguments, to save memory."
  30. },
  31. {
  32. "name": "limit",
  33. "type": "Int64",
  34. "value": "0",
  35. "desc": "This parameter can be used to limit the number of stack frames returned. By default (limit=0) it returns all stack frames."
  36. }
  37. ]
  38. },
  39. {
  40. "name": "debug_print_backtrace",
  41. "desc": "debug_print_backtrace() prints a PHP backtrace. It prints the function calls, included\/required files and eval()ed stuff.\nThis function has no parameters.",
  42. "flags": [
  43. "NeedsActRec"
  44. ],
  45. "return": {
  46. "type": null,
  47. "desc": "No value is returned."
  48. },
  49. "args": [
  50. {
  51. "name": "options",
  52. "type": "Int64",
  53. "value": "0",
  54. "desc": "Whether or not to populate the \"object\" index.\n\nDEBUG_BACKTRACE_IGNORE_ARGS: Whether or not to omit the \"args\" index, and thus all the function/method arguments, to save memory."
  55. },
  56. {
  57. "name": "limit",
  58. "type": "Int64",
  59. "value": "0",
  60. "desc": "This parameter can be used to limit the number of stack frames returned. By default (limit=0) it returns all stack frames."
  61. }
  62. ]
  63. },
  64. {
  65. "name": "error_get_last",
  66. "desc": "Gets information about the last error that occurred.",
  67. "flags": [
  68. ],
  69. "return": {
  70. "type": "StringVec",
  71. "desc": "Returns an associative array describing the last error with keys \"type\", \"message\", \"file\" and \"line\". Returns NULL if there hasn't been an error yet."
  72. },
  73. "args": [
  74. ]
  75. },
  76. {
  77. "name": "error_log",
  78. "desc": "Sends an error message to the web server's error log, a TCP port or to a file.",
  79. "flags": [
  80. ],
  81. "return": {
  82. "type": "Boolean",
  83. "desc": "Returns TRUE on success or FALSE on failure."
  84. },
  85. "args": [
  86. {
  87. "name": "message",
  88. "type": "String",
  89. "desc": "The error message that should be logged."
  90. },
  91. {
  92. "name": "message_type",
  93. "type": "Int32",
  94. "value": "0",
  95. "desc": "Says where the error should go. The possible message types are as follows:\n\nerror_log() log types 0 message is sent to PHP's system logger, using the Operating System's system logging mechanism or a file, depending on what the error_log configuration directive is set to. This is the default option. 1 message is sent by email to the address in the destination parameter. This is the only message type where the fourth parameter, extra_headers is used. 2 No longer an option. 3 message is appended to the file destination. A newline is not automatically added to the end of the message string. 4 message is sent directly to the SAPI logging handler."
  96. },
  97. {
  98. "name": "destination",
  99. "type": "String",
  100. "value": "null_string",
  101. "desc": "The destination. Its meaning depends on the message_type parameter as described above."
  102. },
  103. {
  104. "name": "extra_headers",
  105. "type": "String",
  106. "value": "null_string",
  107. "desc": "The extra headers. It's used when the message_type parameter is set to 1. This message type uses the same internal function as mail() does."
  108. }
  109. ]
  110. },
  111. {
  112. "name": "error_reporting",
  113. "desc": "The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level.",
  114. "flags": [
  115. ],
  116. "return": {
  117. "type": "Int64",
  118. "desc": "Returns the old error_reporting level or the current level if no level parameter is given."
  119. },
  120. "args": [
  121. {
  122. "name": "level",
  123. "type": "Variant",
  124. "value": "null",
  125. "desc": "The new error_reporting level. It takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions. As error levels are added, the range of integers increases, so older integer-based error levels will not always behave as expected.\n\nThe available error level constants and the actual meanings of these error levels are described in the predefined constants."
  126. }
  127. ]
  128. },
  129. {
  130. "name": "restore_error_handler",
  131. "desc": "Used after changing the error handler function using set_error_handler(), to revert to the previous error handler (which could be the built-in or a user defined function).",
  132. "flags": [
  133. ],
  134. "return": {
  135. "type": "Boolean",
  136. "desc": "This function always returns TRUE."
  137. },
  138. "args": [
  139. ]
  140. },
  141. {
  142. "name": "restore_exception_handler",
  143. "desc": "Used after changing the exception handler function using set_exception_handler(), to revert to the previous exception handler (which could be the built-in or a user defined function).",
  144. "flags": [
  145. ],
  146. "return": {
  147. "type": "Boolean",
  148. "desc": "This function always returns TRUE."
  149. },
  150. "args": [
  151. ]
  152. },
  153. {
  154. "name": "set_error_handler",
  155. "desc": "Sets a user function (error_handler) to handle errors in a script.\n\nThis function can be used for defining your own way of handling errors during runtime, for example in applications in which you need to do cleanup of data\/files when a critical error happens, or when you need to trigger an error under certain conditions (using trigger_error()).\n\nIt is important to remember that the standard PHP error handler is completely bypassed for the error types specified by error_types unless the callback function returns FALSE. error_reporting() settings will have no effect and your error handler will be called regardless - however you are still able to read the current value of error_reporting and act appropriately. Of particular note is that this value will be 0 if the statement that caused the error was prepended by the @ error-control operator.\n\nAlso note that it is your responsibility to die() if necessary. If the error-handler function returns, script execution will continue with the next statement after the one that caused an error.\n\nThe following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.\n\nIf errors occur before the script is executed (e.g. on file uploads) the custom error handler cannot be called since it is not registered at that time.",
  156. "flags": [
  157. ],
  158. "return": {
  159. "type": "Variant",
  160. "desc": "Returns a string containing the previously defined error handler (if any). If the built-in error handler is used NULL is returned. NULL is also returned in case of an error such as an invalid callback. If the previous error handler was a class method, this function will return an indexed array with the class and the method name."
  161. },
  162. "args": [
  163. {
  164. "name": "error_handler",
  165. "type": "Variant",
  166. "desc": "The user function needs to accept two parameters: the error code, and a string describing the error. Then there are three optional parameters that may be supplied: the filename in which the error occurred, the line number in which the error occurred, and the context in which the error occurred (an array that points to the active symbol table at the point the error occurred). The function can be shown as:\n\nhandler ( int $errno , string $errstr [, string $errfile [, int $errline [, array $errcontext ]]] ) errno The first parameter, errno, contains the level of the error raised, as an integer."
  167. },
  168. {
  169. "name": "error_types",
  170. "type": "Int32",
  171. "value": "k_E_ALL",
  172. "desc": "The second parameter, errstr, contains the error message, as a string."
  173. }
  174. ]
  175. },
  176. {
  177. "name": "set_exception_handler",
  178. "desc": "Sets the default exception handler if an exception is not caught within a try\/catch block. Execution will stop after the exception_handler is called.",
  179. "flags": [
  180. ],
  181. "return": {
  182. "type": "Variant",
  183. "desc": "Returns the name of the previously defined exception handler, or NULL on error. If no previous handler was defined, NULL is also returned."
  184. },
  185. "args": [
  186. {
  187. "name": "exception_handler",
  188. "type": "Variant",
  189. "desc": "Name of the function to be called when an uncaught exception occurs. This function must be defined before calling set_exception_handler(). This handler function needs to accept one parameter, which will be the exception object that was thrown."
  190. }
  191. ]
  192. },
  193. {
  194. "name": "hphp_set_error_page",
  195. "desc": "Displays fatal errors with this PHP document. When 500 fatal error is about to display, it will invoke this PHP page with all global states right at when the error happens. This is useful for gracefully displaying something helpful information to end users when a fatal error has happened. Otherwise, a blank page will be displayed by default.",
  196. "flags": [
  197. "HipHopSpecific"
  198. ],
  199. "return": {
  200. "type": null
  201. },
  202. "args": [
  203. {
  204. "name": "page",
  205. "type": "String",
  206. "desc": "Relative path of the PHP document."
  207. }
  208. ]
  209. },
  210. {
  211. "name": "hphp_throw_fatal_error",
  212. "desc": "Raises a fatal error.",
  213. "flags": [
  214. "HipHopSpecific"
  215. ],
  216. "return": {
  217. "type": null
  218. },
  219. "args": [
  220. {
  221. "name": "error_msg",
  222. "type": "String",
  223. "desc": "The error message for the fatal."
  224. }
  225. ]
  226. },
  227. {
  228. "name": "hphp_clear_unflushed",
  229. "desc": "Clears any output contents that have not been flushed to networked. This is useful when handling a fatal error. Before displaying a customized PHP page, one may call this function to clear previously written content, so to replay what will be displayed.",
  230. "flags": [
  231. "HipHopSpecific"
  232. ],
  233. "return": {
  234. "type": null
  235. },
  236. "args": [
  237. ]
  238. },
  239. {
  240. "name": "hphp_debug_caller_info",
  241. "desc": "Retrieves information about the caller that invoked the current function or method",
  242. "flags": [
  243. "HipHopSpecific"
  244. ],
  245. "return": {
  246. "type": "StringVec",
  247. "desc": "Returns an associative array. On success, the array will contain two keys 'file' and 'line' which indicate the filename and line number of the callsite that invoked the current function or method."
  248. },
  249. "args": [
  250. ]
  251. },
  252. {
  253. "name": "trigger_error",
  254. "desc": "Used to trigger a user error condition, it can be used by in conjunction with the built-in error handler, or with a user defined function that has been set as the new error handler (set_error_handler()).\n\nThis function is useful when you need to generate a particular response to an exception at runtime.",
  255. "flags": [
  256. ],
  257. "return": {
  258. "type": "Boolean",
  259. "desc": "This function returns FALSE if wrong error_type is specified, TRUE otherwise."
  260. },
  261. "args": [
  262. {
  263. "name": "error_msg",
  264. "type": "String",
  265. "desc": "The designated error message for this error. It's limited to 1024 characters in length. Any additional characters beyond 1024 will be truncated."
  266. },
  267. {
  268. "name": "error_type",
  269. "type": "Int32",
  270. "value": "k_E_USER_NOTICE",
  271. "desc": "The designated error type for this error. It only works with the E_USER family of constants, and will default to E_USER_NOTICE."
  272. }
  273. ]
  274. },
  275. {
  276. "name": "user_error",
  277. "flags": [
  278. ],
  279. "return": {
  280. "type": "Boolean"
  281. },
  282. "args": [
  283. {
  284. "name": "error_msg",
  285. "type": "String"
  286. },
  287. {
  288. "name": "error_type",
  289. "type": "Int32",
  290. "value": "k_E_USER_NOTICE"
  291. }
  292. ]
  293. }
  294. ],
  295. "classes": [
  296. ]
  297. }