/src/idl/class.idl.php

https://github.com/babannasd/hiphop-php · PHP · 456 lines · 368 code · 21 blank · 67 comment · 19 complexity · f5bfec3b34409193f135c17c45c96410 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. 'taint_observer' => false,
  56. ));
  57. DefineFunction(
  58. array(
  59. 'name' => "get_declared_interfaces",
  60. 'desc' => "Gets the declared interfaces.",
  61. 'flags' => HasDocComment,
  62. 'return' => array(
  63. 'type' => VariantMap,
  64. 'desc' => "Returns an array of the names of the declared interfaces in the current script.",
  65. ),
  66. 'taint_observer' => false,
  67. ));
  68. DefineFunction(
  69. array(
  70. 'name' => "get_declared_traits",
  71. 'desc' => "Gets the declared traits.",
  72. 'flags' => HasDocComment,
  73. 'return' => array(
  74. 'type' => VariantMap,
  75. 'desc' => "Returns an array of the names of the declared traits in the current script.",
  76. ),
  77. ));
  78. DefineFunction(
  79. array(
  80. 'name' => "class_exists",
  81. 'desc' => "This function checks whether or not the given class has been defined.",
  82. 'flags' => HasDocComment,
  83. 'return' => array(
  84. 'type' => Boolean,
  85. 'desc' => "Returns TRUE if class_name is a defined class, FALSE otherwise.",
  86. ),
  87. 'args' => array(
  88. array(
  89. 'name' => "class_name",
  90. 'type' => String,
  91. 'desc' => "The class name. The name is matched in a case-insensitive manner.",
  92. ),
  93. array(
  94. 'name' => "autoload",
  95. 'type' => Boolean,
  96. 'value' => "true",
  97. 'desc' => "Whether or not to call __autoload by default.",
  98. ),
  99. ),
  100. 'taint_observer' => false,
  101. ));
  102. DefineFunction(
  103. array(
  104. 'name' => "interface_exists",
  105. 'desc' => "Checks if the given interface has been defined.",
  106. 'flags' => HasDocComment,
  107. 'return' => array(
  108. 'type' => Boolean,
  109. 'desc' => "Returns TRUE if the interface given by interface_name has been defined, FALSE otherwise.",
  110. ),
  111. 'args' => array(
  112. array(
  113. 'name' => "interface_name",
  114. 'type' => String,
  115. 'desc' => "The interface name",
  116. ),
  117. array(
  118. 'name' => "autoload",
  119. 'type' => Boolean,
  120. 'value' => "true",
  121. 'desc' => "Whether to call __autoload or not by default.",
  122. ),
  123. ),
  124. 'taint_observer' => false,
  125. ));
  126. DefineFunction(
  127. array(
  128. 'name' => "trait_exists",
  129. 'desc' => "Checks if the given trait has been defined.",
  130. 'flags' => HasDocComment,
  131. 'return' => array(
  132. 'type' => Boolean,
  133. 'desc' => "Returns TRUE if the trait given by trait_name has been defined, FALSE otherwise.",
  134. ),
  135. 'args' => array(
  136. array(
  137. 'name' => "trait_name",
  138. 'type' => String,
  139. 'desc' => "The trait name",
  140. ),
  141. array(
  142. 'name' => "autoload",
  143. 'type' => Boolean,
  144. 'value' => "true",
  145. 'desc' => "Whether to call __autoload or not by default.",
  146. ),
  147. ),
  148. ));
  149. DefineFunction(
  150. array(
  151. 'name' => "get_class_methods",
  152. 'desc' => "Gets the class methods names.",
  153. 'flags' => HasDocComment,
  154. 'return' => array(
  155. 'type' => VariantMap,
  156. 'desc' => "Returns an array of method names defined for the class specified by class_name. In case of an error, it returns NULL.",
  157. ),
  158. 'args' => array(
  159. array(
  160. 'name' => "class_or_object",
  161. 'type' => Variant,
  162. 'desc' => "The class name or an object instance",
  163. ),
  164. ),
  165. 'taint_observer' => false,
  166. ));
  167. DefineFunction(
  168. array(
  169. 'name' => "get_class_vars",
  170. 'desc' => "Get the default properties of the given class.",
  171. 'flags' => HasDocComment,
  172. 'return' => array(
  173. 'type' => VariantMap,
  174. '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.",
  175. ),
  176. 'args' => array(
  177. array(
  178. 'name' => "class_name",
  179. 'type' => String,
  180. 'desc' => "The class name",
  181. ),
  182. ),
  183. 'taint_observer' => false,
  184. ));
  185. DefineFunction(
  186. array(
  187. 'name' => "get_class_constants",
  188. 'desc' => "Get the constants of the given class.",
  189. 'flags' => HasDocComment,
  190. 'return' => array(
  191. 'type' => VariantMap,
  192. 'desc' => "Returns an associative array of constants with their values."
  193. ),
  194. 'args' => array(
  195. array(
  196. 'name' => "class_name",
  197. 'type' => String,
  198. 'desc' => "The class name",
  199. ),
  200. ),
  201. 'taint_observer' => false,
  202. ));
  203. DefineFunction(
  204. array(
  205. 'name' => "get_class",
  206. 'desc' => "Gets the name of the class of the given object.",
  207. 'flags' => HasDocComment,
  208. 'return' => array(
  209. 'type' => Variant,
  210. '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.",
  211. ),
  212. 'args' => array(
  213. array(
  214. 'name' => "object",
  215. 'type' => Variant,
  216. 'value' => "null_variant",
  217. 'desc' => "The tested object. This parameter may be omitted when inside a class.",
  218. ),
  219. ),
  220. 'taint_observer' => false,
  221. ));
  222. DefineFunction(
  223. array(
  224. 'name' => "get_parent_class",
  225. 'desc' => "Retrieves the parent class name for object or class.",
  226. 'flags' => HasDocComment,
  227. 'return' => array(
  228. 'type' => Variant,
  229. '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.",
  230. ),
  231. 'args' => array(
  232. array(
  233. 'name' => "object",
  234. 'type' => Variant,
  235. 'value' => "null_variant",
  236. 'desc' => "The tested object or class name",
  237. ),
  238. ),
  239. 'taint_observer' => false,
  240. ));
  241. DefineFunction(
  242. array(
  243. 'name' => "is_a",
  244. 'desc' => "Checks if the given object is of this class or has this class as one of its parents.",
  245. 'flags' => HasDocComment,
  246. 'return' => array(
  247. 'type' => Boolean,
  248. 'desc' => "Returns TRUE if the object is of this class or has this class as one of its parents, FALSE otherwise.",
  249. ),
  250. 'args' => array(
  251. array(
  252. 'name' => "object",
  253. 'type' => Object,
  254. 'desc' => "The tested object",
  255. ),
  256. array(
  257. 'name' => "class_name",
  258. 'type' => String,
  259. 'desc' => "The class name",
  260. ),
  261. ),
  262. 'taint_observer' => false,
  263. ));
  264. DefineFunction(
  265. array(
  266. 'name' => "is_subclass_of",
  267. 'desc' => "Checks if the given object has the class class_name as one of its parents.",
  268. 'flags' => HasDocComment,
  269. 'return' => array(
  270. 'type' => Boolean,
  271. 'desc' => "This function returns TRUE if the object object, belongs to a class which is a subclass of class_name, FALSE otherwise.",
  272. ),
  273. 'args' => array(
  274. array(
  275. 'name' => "class_or_object",
  276. 'type' => Variant,
  277. 'desc' => "A class name or an object instance",
  278. ),
  279. array(
  280. 'name' => "class_name",
  281. 'type' => String,
  282. 'desc' => "The class name",
  283. ),
  284. ),
  285. 'taint_observer' => false,
  286. ));
  287. DefineFunction(
  288. array(
  289. 'name' => "method_exists",
  290. 'desc' => "Checks if the class method exists in the given object.",
  291. 'flags' => HasDocComment,
  292. 'return' => array(
  293. 'type' => Boolean,
  294. 'desc' => "Returns TRUE if the method given by method_name has been defined for the given object, FALSE otherwise.",
  295. ),
  296. 'args' => array(
  297. array(
  298. 'name' => "class_or_object",
  299. 'type' => Variant,
  300. 'desc' => "An object instance or a class name",
  301. ),
  302. array(
  303. 'name' => "method_name",
  304. 'type' => String,
  305. 'desc' => "The method name",
  306. ),
  307. ),
  308. 'taint_observer' => false,
  309. ));
  310. DefineFunction(
  311. array(
  312. 'name' => "property_exists",
  313. '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.",
  314. 'flags' => HasDocComment,
  315. 'return' => array(
  316. 'type' => Boolean,
  317. 'desc' => "Returns TRUE if the property exists, FALSE if it doesn't exist or NULL in case of an error.",
  318. ),
  319. 'args' => array(
  320. array(
  321. 'name' => "class_or_object",
  322. 'type' => Variant,
  323. 'desc' => "The class name or an object of the class to test for",
  324. ),
  325. array(
  326. 'name' => "property",
  327. 'type' => String,
  328. 'desc' => "The name of the property",
  329. ),
  330. ),
  331. 'taint_observer' => false,
  332. ));
  333. DefineFunction(
  334. array(
  335. 'name' => "get_object_vars",
  336. 'desc' => "Gets the accessible non-static properties of the given object according to scope.",
  337. 'flags' => HasDocComment,
  338. 'return' => array(
  339. 'type' => Variant,
  340. '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.",
  341. ),
  342. 'args' => array(
  343. array(
  344. 'name' => "object",
  345. 'type' => Variant,
  346. 'desc' => "An object instance.",
  347. ),
  348. ),
  349. 'taint_observer' => false,
  350. ));
  351. DefineFunction(
  352. array(
  353. 'name' => "call_user_method_array",
  354. 'flags' => HasDocComment,
  355. 'return' => array(
  356. 'type' => Variant,
  357. ),
  358. 'args' => array(
  359. array(
  360. 'name' => "method_name",
  361. 'type' => String,
  362. 'desc' => "The method name being called.",
  363. ),
  364. array(
  365. 'name' => "obj",
  366. 'type' => Variant | Reference,
  367. 'desc' => "The object that method_name is being called on.",
  368. ),
  369. array(
  370. 'name' => "paramarr",
  371. 'type' => VariantVec,
  372. 'desc' => "An array of parameters.",
  373. ),
  374. ),
  375. 'taint_observer' => false,
  376. ));
  377. DefineFunction(
  378. array(
  379. 'name' => "call_user_method",
  380. 'flags' => HasDocComment | VariableArguments,
  381. 'return' => array(
  382. 'type' => Variant,
  383. ),
  384. 'args' => array(
  385. array(
  386. 'name' => "method_name",
  387. 'type' => String,
  388. 'desc' => "The method name being called.",
  389. ),
  390. array(
  391. 'name' => "obj",
  392. 'type' => Variant | Reference,
  393. 'desc' => "The object that method_name is being called on.",
  394. ),
  395. ),
  396. 'taint_observer' => false,
  397. ));
  398. ///////////////////////////////////////////////////////////////////////////////
  399. // Classes
  400. //
  401. // BeginClass
  402. // array (
  403. // 'name' => name of the class
  404. // 'desc' => description of the class's purpose
  405. // 'flags' => attributes of the class, see base.php for possible values
  406. // 'note' => additional note about this class's schema
  407. // 'parent' => parent class name, if any
  408. // 'ifaces' => array of interfaces tihs class implements
  409. // 'bases' => extra internal and special base classes this class requires
  410. // 'footer' => extra C++ inserted at end of class declaration
  411. // )
  412. //
  413. // DefineConstant(..)
  414. // DefineConstant(..)
  415. // ...
  416. // DefineFunction(..)
  417. // DefineFunction(..)
  418. // ...
  419. // DefineProperty
  420. // DefineProperty
  421. //
  422. // array (
  423. // 'name' => name of the property
  424. // 'type' => type of the property
  425. // 'flags' => attributes of the property
  426. // 'desc' => description of the property
  427. // 'note' => additional note about this property's schema
  428. // )
  429. //
  430. // EndClass()