PageRenderTime 43ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/src/idl/class.idl.php

https://github.com/tmjnaid/hiphop-php
PHP | 387 lines | 302 code | 18 blank | 67 comment | 17 complexity | bdd52a0dc1f997e984a36acb45a72c70 MD5 | raw file
  1. <?php
  2. /**
  3. * Automatically generated by running "php schema.php class".
  4. *
  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.
  10. */
  11. ///////////////////////////////////////////////////////////////////////////////
  12. // Preamble: C++ code inserted at beginning of ext_{name}.h
  13. DefinePreamble(<<<CPP
  14. CPP
  15. );
  16. ///////////////////////////////////////////////////////////////////////////////
  17. // Constants
  18. //
  19. // array (
  20. // 'name' => name of the constant
  21. // 'type' => type of the constant
  22. // 'note' => additional note about this constant's schema
  23. // )
  24. ///////////////////////////////////////////////////////////////////////////////
  25. // Functions
  26. //
  27. // array (
  28. // 'name' => name of the function
  29. // 'desc' => description of the function's purpose
  30. // 'flags' => attributes of the function, see base.php for possible values
  31. // 'opt' => optimization callback function's name for compiler
  32. // 'note' => additional note about this function's schema
  33. // 'return' =>
  34. // array (
  35. // 'type' => return type, use Reference for ref return
  36. // 'desc' => description of the return value
  37. // )
  38. // 'args' => arguments
  39. // array (
  40. // 'name' => name of the argument
  41. // 'type' => type of the argument, use Reference for output parameter
  42. // 'value' => default value of the argument
  43. // 'desc' => description of the argument
  44. // )
  45. // )
  46. DefineFunction(
  47. array(
  48. 'name' => "get_declared_classes",
  49. 'desc' => "Gets the declared classes.",
  50. 'flags' => HasDocComment,
  51. 'return' => array(
  52. 'type' => VariantMap,
  53. 'desc' => "Returns an array of the names of the declared classes in the current script.\n\nNote that depending on what extensions you have compiled or loaded into PHP, additional classes could be present. This means that you will not be able to define your own classes using these names. There is a list of predefined classes in the Predefined Classes section of the appendices.",
  54. ),
  55. ));
  56. DefineFunction(
  57. array(
  58. 'name' => "get_declared_interfaces",
  59. 'desc' => "Gets the declared interfaces.",
  60. 'flags' => HasDocComment,
  61. 'return' => array(
  62. 'type' => VariantMap,
  63. 'desc' => "Returns an array of the names of the declared interfaces in the current script.",
  64. ),
  65. ));
  66. DefineFunction(
  67. array(
  68. 'name' => "class_exists",
  69. 'desc' => "This function checks whether or not the given class has been defined.",
  70. 'flags' => HasDocComment,
  71. 'return' => array(
  72. 'type' => Boolean,
  73. 'desc' => "Returns TRUE if class_name is a defined class, FALSE otherwise.",
  74. ),
  75. 'args' => array(
  76. array(
  77. 'name' => "class_name",
  78. 'type' => String,
  79. 'desc' => "The class name. The name is matched in a case-insensitive manner.",
  80. ),
  81. array(
  82. 'name' => "autoload",
  83. 'type' => Boolean,
  84. 'value' => "true",
  85. 'desc' => "Whether or not to call __autoload by default.",
  86. ),
  87. ),
  88. ));
  89. DefineFunction(
  90. array(
  91. 'name' => "interface_exists",
  92. 'desc' => "Checks if the given interface has been defined.",
  93. 'flags' => HasDocComment,
  94. 'return' => array(
  95. 'type' => Boolean,
  96. 'desc' => "Returns TRUE if the interface given by interface_name has been defined, FALSE otherwise.",
  97. ),
  98. 'args' => array(
  99. array(
  100. 'name' => "interface_name",
  101. 'type' => String,
  102. 'desc' => "The interface name",
  103. ),
  104. array(
  105. 'name' => "autoload",
  106. 'type' => Boolean,
  107. 'value' => "true",
  108. 'desc' => "Whether to call __autoload or not by default.",
  109. ),
  110. ),
  111. ));
  112. DefineFunction(
  113. array(
  114. 'name' => "get_class_methods",
  115. 'desc' => "Gets the class methods names.",
  116. 'flags' => HasDocComment,
  117. 'return' => array(
  118. 'type' => VariantMap,
  119. 'desc' => "Returns an array of method names defined for the class specified by class_name. In case of an error, it returns NULL.",
  120. ),
  121. 'args' => array(
  122. array(
  123. 'name' => "class_or_object",
  124. 'type' => Variant,
  125. 'desc' => "The class name or an object instance",
  126. ),
  127. ),
  128. ));
  129. DefineFunction(
  130. array(
  131. 'name' => "get_class_vars",
  132. 'desc' => "Get the default properties of the given class.",
  133. 'flags' => HasDocComment,
  134. 'return' => array(
  135. 'type' => VariantMap,
  136. 'desc' => "Returns an associative array of declared properties visible from the current scope, with their default value. The resulting array elements are in the form of varname => value.",
  137. ),
  138. 'args' => array(
  139. array(
  140. 'name' => "class_name",
  141. 'type' => String,
  142. 'desc' => "The class name",
  143. ),
  144. ),
  145. ));
  146. DefineFunction(
  147. array(
  148. 'name' => "get_class",
  149. 'desc' => "Gets the name of the class of the given object.",
  150. 'flags' => HasDocComment,
  151. 'return' => array(
  152. 'type' => Variant,
  153. 'desc' => "Returns the name of the class of which object is an instance. Returns FALSE if object is not an object.\n\nIf object is omitted when inside a class, the name of that class is returned.",
  154. ),
  155. 'args' => array(
  156. array(
  157. 'name' => "object",
  158. 'type' => Variant,
  159. 'value' => "null_variant",
  160. 'desc' => "The tested object. This parameter may be omitted when inside a class.",
  161. ),
  162. ),
  163. ));
  164. DefineFunction(
  165. array(
  166. 'name' => "get_parent_class",
  167. 'desc' => "Retrieves the parent class name for object or class.",
  168. 'flags' => HasDocComment,
  169. 'return' => array(
  170. 'type' => Variant,
  171. 'desc' => "Returns the name of the parent class of the class of which object is an instance or the name.\n\nIf the object does not have a parent FALSE will be returned.\n\nIf called without parameter outside object, this function returns FALSE.",
  172. ),
  173. 'args' => array(
  174. array(
  175. 'name' => "object",
  176. 'type' => Variant,
  177. 'value' => "null_variant",
  178. 'desc' => "The tested object or class name",
  179. ),
  180. ),
  181. ));
  182. DefineFunction(
  183. array(
  184. 'name' => "is_a",
  185. 'desc' => "Checks if the given object is of this class or has this class as one of its parents.",
  186. 'flags' => HasDocComment,
  187. 'return' => array(
  188. 'type' => Boolean,
  189. 'desc' => "Returns TRUE if the object is of this class or has this class as one of its parents, FALSE otherwise.",
  190. ),
  191. 'args' => array(
  192. array(
  193. 'name' => "object",
  194. 'type' => Object,
  195. 'desc' => "The tested object",
  196. ),
  197. array(
  198. 'name' => "class_name",
  199. 'type' => String,
  200. 'desc' => "The class name",
  201. ),
  202. ),
  203. ));
  204. DefineFunction(
  205. array(
  206. 'name' => "is_subclass_of",
  207. 'desc' => "Checks if the given object has the class class_name as one of its parents.",
  208. 'flags' => HasDocComment,
  209. 'return' => array(
  210. 'type' => Boolean,
  211. 'desc' => "This function returns TRUE if the object object, belongs to a class which is a subclass of class_name, FALSE otherwise.",
  212. ),
  213. 'args' => array(
  214. array(
  215. 'name' => "class_or_object",
  216. 'type' => Variant,
  217. 'desc' => "A class name or an object instance",
  218. ),
  219. array(
  220. 'name' => "class_name",
  221. 'type' => String,
  222. 'desc' => "The class name",
  223. ),
  224. ),
  225. ));
  226. DefineFunction(
  227. array(
  228. 'name' => "method_exists",
  229. 'desc' => "Checks if the class method exists in the given object.",
  230. 'flags' => HasDocComment,
  231. 'return' => array(
  232. 'type' => Boolean,
  233. 'desc' => "Returns TRUE if the method given by method_name has been defined for the given object, FALSE otherwise.",
  234. ),
  235. 'args' => array(
  236. array(
  237. 'name' => "class_or_object",
  238. 'type' => Variant,
  239. 'desc' => "An object instance or a class name",
  240. ),
  241. array(
  242. 'name' => "method_name",
  243. 'type' => String,
  244. 'desc' => "The method name",
  245. ),
  246. ),
  247. ));
  248. DefineFunction(
  249. array(
  250. 'name' => "property_exists",
  251. 'desc' => "This function checks if the given property exists in the specified class.\n\nAs opposed with isset(), property_exists() returns TRUE even if the property has the value NULL.",
  252. 'flags' => HasDocComment,
  253. 'return' => array(
  254. 'type' => Boolean,
  255. 'desc' => "Returns TRUE if the property exists, FALSE if it doesn't exist or NULL in case of an error.",
  256. ),
  257. 'args' => array(
  258. array(
  259. 'name' => "class_or_object",
  260. 'type' => Variant,
  261. 'desc' => "The class name or an object of the class to test for",
  262. ),
  263. array(
  264. 'name' => "property",
  265. 'type' => String,
  266. 'desc' => "The name of the property",
  267. ),
  268. ),
  269. ));
  270. DefineFunction(
  271. array(
  272. 'name' => "get_object_vars",
  273. 'desc' => "Gets the accessible non-static properties of the given object according to scope.",
  274. 'flags' => HasDocComment,
  275. 'return' => array(
  276. 'type' => Variant,
  277. 'desc' => "Returns an associative array of defined object accessible non-static properties for the specified object in scope. If a property have not been assigned a value, it will be returned with a NULL value.",
  278. ),
  279. 'args' => array(
  280. array(
  281. 'name' => "object",
  282. 'type' => Variant,
  283. 'desc' => "An object instance.",
  284. ),
  285. ),
  286. ));
  287. DefineFunction(
  288. array(
  289. 'name' => "call_user_method_array",
  290. 'flags' => HasDocComment,
  291. 'return' => array(
  292. 'type' => Variant,
  293. ),
  294. 'args' => array(
  295. array(
  296. 'name' => "method_name",
  297. 'type' => String,
  298. 'desc' => "The method name being called.",
  299. ),
  300. array(
  301. 'name' => "obj",
  302. 'type' => Variant | Reference,
  303. 'desc' => "The object that method_name is being called on.",
  304. ),
  305. array(
  306. 'name' => "paramarr",
  307. 'type' => VariantVec,
  308. 'desc' => "An array of parameters.",
  309. ),
  310. ),
  311. ));
  312. DefineFunction(
  313. array(
  314. 'name' => "call_user_method",
  315. 'flags' => HasDocComment | VariableArguments,
  316. 'return' => array(
  317. 'type' => Variant,
  318. ),
  319. 'args' => array(
  320. array(
  321. 'name' => "method_name",
  322. 'type' => String,
  323. 'desc' => "The method name being called.",
  324. ),
  325. array(
  326. 'name' => "obj",
  327. 'type' => Variant | Reference,
  328. 'desc' => "The object that method_name is being called on.",
  329. ),
  330. ),
  331. ));
  332. ///////////////////////////////////////////////////////////////////////////////
  333. // Classes
  334. //
  335. // BeginClass
  336. // array (
  337. // 'name' => name of the class
  338. // 'desc' => description of the class's purpose
  339. // 'flags' => attributes of the class, see base.php for possible values
  340. // 'note' => additional note about this class's schema
  341. // 'parent' => parent class name, if any
  342. // 'ifaces' => array of interfaces tihs class implements
  343. // 'bases' => extra internal and special base classes this class requires
  344. // 'footer' => extra C++ inserted at end of class declaration
  345. // )
  346. //
  347. // DefineConstant(..)
  348. // DefineConstant(..)
  349. // ...
  350. // DefineFunction(..)
  351. // DefineFunction(..)
  352. // ...
  353. // DefineProperty
  354. // DefineProperty
  355. //
  356. // array (
  357. // 'name' => name of the property
  358. // 'type' => type of the property
  359. // 'flags' => attributes of the property
  360. // 'desc' => description of the property
  361. // 'note' => additional note about this property's schema
  362. // )
  363. //
  364. // EndClass()