PageRenderTime 55ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/stubs/xml.php

http://github.com/nnmatveev/php-stubs
PHP | 576 lines | 53 code | 28 blank | 495 comment | 0 complexity | cce3b19655aab6a81c9ecb49cbe7711a MD5 | raw file
  1. <?php
  2. // Start of xml v.
  3. /**
  4. * (PHP 4, PHP 5)<br/>
  5. * Create an XML parser
  6. * @link http://php.net/manual/en/function.xml-parser-create.php
  7. * @param string $encoding [optional] <p>
  8. * The optional encoding specifies the character
  9. * encoding for the input/output in PHP 4. Starting from PHP 5, the input
  10. * encoding is automatically detected, so that the
  11. * encoding parameter specifies only the output
  12. * encoding. In PHP 4, the default output encoding is the same as the
  13. * input charset. If empty string is passed, the parser attempts to identify
  14. * which encoding the document is encoded in by looking at the heading 3 or
  15. * 4 bytes. In PHP 5.0.0 and 5.0.1, the default output charset is
  16. * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
  17. * encodings are ISO-8859-1, UTF-8 and
  18. * US-ASCII.
  19. * </p>
  20. * @return resource a resource handle for the new XML parser.
  21. */
  22. function xml_parser_create ($encoding = null) {}
  23. /**
  24. * (PHP 4 &gt;= 4.0.5, PHP 5)<br/>
  25. * Create an XML parser with namespace support
  26. * @link http://php.net/manual/en/function.xml-parser-create-ns.php
  27. * @param string $encoding [optional] <p>
  28. * The optional encoding specifies the character
  29. * encoding for the input/output in PHP 4. Starting from PHP 5, the input
  30. * encoding is automatically detected, so that the
  31. * encoding parameter specifies only the output
  32. * encoding. In PHP 4, the default output encoding is the same as the
  33. * input charset. In PHP 5.0.0 and 5.0.1, the default output charset is
  34. * ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported
  35. * encodings are ISO-8859-1, UTF-8 and
  36. * US-ASCII.
  37. * </p>
  38. * @param string $separator [optional] <p>
  39. * With a namespace aware parser tag parameters passed to the various
  40. * handler functions will consist of namespace and tag name separated by
  41. * the string specified in seperator or
  42. * ':' by default.
  43. * </p>
  44. * @return resource a resource handle for the new XML parser.
  45. */
  46. function xml_parser_create_ns ($encoding = null, $separator = null) {}
  47. /**
  48. * (PHP 4, PHP 5)<br/>
  49. * Use XML Parser within an object
  50. * @link http://php.net/manual/en/function.xml-set-object.php
  51. * @param resource $parser <p>
  52. * </p>
  53. * @param object $object <p>
  54. * </p>
  55. * @return bool Returns true on success or false on failure.
  56. */
  57. function xml_set_object ($parser, &$object) {}
  58. /**
  59. * (PHP 4, PHP 5)<br/>
  60. * Set up start and end element handlers
  61. * @link http://php.net/manual/en/function.xml-set-element-handler.php
  62. * @param resource $parser <p>
  63. * </p>
  64. * @param callback $start_element_handler <p>
  65. * The function named by start_element_handler
  66. * must accept three parameters:
  67. * start_element_handler
  68. * resourceparser
  69. * stringname
  70. * arrayattribs
  71. * parser
  72. * The first parameter, parser, is a
  73. * reference to the XML parser calling the handler.
  74. * @param callback $end_element_handler <p>
  75. * The function named by end_element_handler
  76. * must accept two parameters:
  77. * end_element_handler
  78. * resourceparser
  79. * stringname
  80. * parser
  81. * The first parameter, parser, is a
  82. * reference to the XML parser calling the handler.
  83. * @return bool Returns true on success or false on failure.
  84. */
  85. function xml_set_element_handler ($parser, $start_element_handler, $end_element_handler) {}
  86. /**
  87. * (PHP 4, PHP 5)<br/>
  88. * Set up character data handler
  89. * @link http://php.net/manual/en/function.xml-set-character-data-handler.php
  90. * @param resource $parser <p>
  91. * </p>
  92. * @param callback $handler <p>
  93. * handler is a string containing the name of a
  94. * function that must exist when xml_parse is called
  95. * for parser.
  96. * </p>
  97. * <p>
  98. * The function named by handler must accept
  99. * two parameters:
  100. * handler
  101. * resourceparser
  102. * stringdata
  103. * parser
  104. * The first parameter, parser, is a
  105. * reference to the XML parser calling the handler.
  106. * @return bool Returns true on success or false on failure.
  107. */
  108. function xml_set_character_data_handler ($parser, $handler) {}
  109. /**
  110. * (PHP 4, PHP 5)<br/>
  111. * Set up processing instruction (PI) handler
  112. * @link http://php.net/manual/en/function.xml-set-processing-instruction-handler.php
  113. * @param resource $parser <p>
  114. * </p>
  115. * @param callback $handler <p>
  116. * handler is a string containing the name of a
  117. * function that must exist when xml_parse is called
  118. * for parser.
  119. * </p>
  120. * <p>
  121. * The function named by handler must accept
  122. * three parameters:
  123. * handler
  124. * resourceparser
  125. * stringtarget
  126. * stringdata
  127. * parser
  128. * The first parameter, parser, is a
  129. * reference to the XML parser calling the handler.
  130. * @return bool Returns true on success or false on failure.
  131. */
  132. function xml_set_processing_instruction_handler ($parser, $handler) {}
  133. /**
  134. * (PHP 4, PHP 5)<br/>
  135. * Set up default handler
  136. * @link http://php.net/manual/en/function.xml-set-default-handler.php
  137. * @param resource $parser <p>
  138. * </p>
  139. * @param callback $handler <p>
  140. * handler is a string containing the name of a
  141. * function that must exist when xml_parse is called
  142. * for parser.
  143. * </p>
  144. * <p>
  145. * The function named by handler must accept
  146. * two parameters:
  147. * handler
  148. * resourceparser
  149. * stringdata
  150. * parser
  151. * The first parameter, parser, is a
  152. * reference to the XML parser calling the handler.
  153. * @return bool Returns true on success or false on failure.
  154. */
  155. function xml_set_default_handler ($parser, $handler) {}
  156. /**
  157. * (PHP 4, PHP 5)<br/>
  158. * Set up unparsed entity declaration handler
  159. * @link http://php.net/manual/en/function.xml-set-unparsed-entity-decl-handler.php
  160. * @param resource $parser <p>
  161. * </p>
  162. * @param callback $handler <p>
  163. * handler is a string containing the name of a
  164. * function that must exist when xml_parse is called
  165. * for parser.
  166. * </p>
  167. * <p>
  168. * The function named by handler must accept six
  169. * parameters:
  170. * handler
  171. * resourceparser
  172. * stringentity_name
  173. * stringbase
  174. * stringsystem_id
  175. * stringpublic_id
  176. * stringnotation_name
  177. * parser
  178. * The first parameter, parser, is a
  179. * reference to the XML parser calling the
  180. * handler.
  181. * @return bool Returns true on success or false on failure.
  182. */
  183. function xml_set_unparsed_entity_decl_handler ($parser, $handler) {}
  184. /**
  185. * (PHP 4, PHP 5)<br/>
  186. * Set up notation declaration handler
  187. * @link http://php.net/manual/en/function.xml-set-notation-decl-handler.php
  188. * @param resource $parser <p>
  189. * </p>
  190. * @param callback $handler <p>
  191. * handler is a string containing the name of a
  192. * function that must exist when xml_parse is called
  193. * for parser.
  194. * </p>
  195. * <p>
  196. * The function named by handler must accept
  197. * five parameters:
  198. * handler
  199. * resourceparser
  200. * stringnotation_name
  201. * stringbase
  202. * stringsystem_id
  203. * stringpublic_id
  204. * parser
  205. * The first parameter, parser, is a
  206. * reference to the XML parser calling the handler.
  207. * @return bool Returns true on success or false on failure.
  208. */
  209. function xml_set_notation_decl_handler ($parser, $handler) {}
  210. /**
  211. * (PHP 4, PHP 5)<br/>
  212. * Set up external entity reference handler
  213. * @link http://php.net/manual/en/function.xml-set-external-entity-ref-handler.php
  214. * @param resource $parser
  215. * @param callback $handler <p>
  216. * handler is a string containing the name of a
  217. * function that must exist when xml_parse is called
  218. * for parser.
  219. * </p>
  220. * <p>
  221. * The function named by handler must accept
  222. * five parameters, and should return an integer value.If the
  223. * value returned from the handler is false (which it will be if no
  224. * value is returned), the XML parser will stop parsing and
  225. * xml_get_error_code will return
  226. * XML_ERROR_EXTERNAL_ENTITY_HANDLING.
  227. * handler
  228. * resourceparser
  229. * stringopen_entity_names
  230. * stringbase
  231. * stringsystem_id
  232. * stringpublic_id
  233. * parser
  234. * The first parameter, parser, is a
  235. * reference to the XML parser calling the handler.
  236. * @return bool Returns true on success or false on failure.
  237. */
  238. function xml_set_external_entity_ref_handler ($parser, $handler) {}
  239. /**
  240. * (PHP 4 &gt;= 4.0.5, PHP 5)<br/>
  241. * Set up start namespace declaration handler
  242. * @link http://php.net/manual/en/function.xml-set-start-namespace-decl-handler.php
  243. * @param resource $parser <p>
  244. * A reference to the XML parser.
  245. * </p>
  246. * @param callback $handler <p>
  247. * handler is a string containing the name of a
  248. * function that must exist when xml_parse is called
  249. * for parser.
  250. * </p>
  251. * <p>
  252. * The function named by handler must accept
  253. * four parameters, and should return an integer value. If the
  254. * value returned from the handler is false (which it will be if no
  255. * value is returned), the XML parser will stop parsing and
  256. * xml_get_error_code will return
  257. * XML_ERROR_EXTERNAL_ENTITY_HANDLING.
  258. * handler
  259. * resourceparser
  260. * stringuser_data
  261. * stringprefix
  262. * stringuri
  263. * parser
  264. * The first parameter, parser, is a
  265. * reference to the XML parser calling the handler.
  266. * @return bool Returns true on success or false on failure.
  267. */
  268. function xml_set_start_namespace_decl_handler ($parser, $handler) {}
  269. /**
  270. * (PHP 4 &gt;= 4.0.5, PHP 5)<br/>
  271. * Set up end namespace declaration handler
  272. * @link http://php.net/manual/en/function.xml-set-end-namespace-decl-handler.php
  273. * @param resource $parser <p>
  274. * A reference to the XML parser.
  275. * </p>
  276. * @param callback $handler <p>
  277. * handler is a string containing the name of a
  278. * function that must exist when xml_parse is called
  279. * for parser.
  280. * </p>
  281. * <p>
  282. * The function named by handler must accept
  283. * three parameters, and should return an integer value. If the
  284. * value returned from the handler is false (which it will be if no
  285. * value is returned), the XML parser will stop parsing and
  286. * xml_get_error_code will return
  287. * XML_ERROR_EXTERNAL_ENTITY_HANDLING.
  288. * handler
  289. * resourceparser
  290. * stringuser_data
  291. * stringprefix
  292. * parser
  293. * The first parameter, parser, is a
  294. * reference to the XML parser calling the handler.
  295. * @return bool Returns true on success or false on failure.
  296. */
  297. function xml_set_end_namespace_decl_handler ($parser, $handler) {}
  298. /**
  299. * (PHP 4, PHP 5)<br/>
  300. * Start parsing an XML document
  301. * @link http://php.net/manual/en/function.xml-parse.php
  302. * @param resource $parser <p>
  303. * A reference to the XML parser to use.
  304. * </p>
  305. * @param string $data <p>
  306. * Chunk of data to parse. A document may be parsed piece-wise by
  307. * calling xml_parse several times with new data,
  308. * as long as the is_final parameter is set and
  309. * true when the last data is parsed.
  310. * </p>
  311. * @param bool $is_final [optional] <p>
  312. * If set and true, data is the last piece of
  313. * data sent in this parse.
  314. * </p>
  315. * @return int 1 on success or 0 on failure.
  316. * </p>
  317. * <p>
  318. * For unsuccessful parses, error information can be retrieved with
  319. * xml_get_error_code,
  320. * xml_error_string,
  321. * xml_get_current_line_number,
  322. * xml_get_current_column_number and
  323. * xml_get_current_byte_index.
  324. * </p>
  325. * <p>
  326. * Entity errors are reported at the end of the data thus only if
  327. * is_final is set and true.
  328. */
  329. function xml_parse ($parser, $data, $is_final = null) {}
  330. /**
  331. * (PHP 4, PHP 5)<br/>
  332. * Parse XML data into an array structure
  333. * @link http://php.net/manual/en/function.xml-parse-into-struct.php
  334. * @param resource $parser <p>
  335. * </p>
  336. * @param string $data <p>
  337. * </p>
  338. * @param array $values <p>
  339. * </p>
  340. * @param array $index [optional] <p>
  341. * </p>
  342. * @return int xml_parse_into_struct returns 0 for failure and 1 for
  343. * success. This is not the same as false and true, be careful with
  344. * operators such as ===.
  345. */
  346. function xml_parse_into_struct ($parser, $data, array &$values, array &$index = null) {}
  347. /**
  348. * (PHP 4, PHP 5)<br/>
  349. * Get XML parser error code
  350. * @link http://php.net/manual/en/function.xml-get-error-code.php
  351. * @param resource $parser <p>
  352. * A reference to the XML parser to get error code from.
  353. * </p>
  354. * @return int This function returns false if parser does
  355. * not refer to a valid parser, or else it returns one of the error
  356. * codes listed in the error codes
  357. * section.
  358. */
  359. function xml_get_error_code ($parser) {}
  360. /**
  361. * (PHP 4, PHP 5)<br/>
  362. * Get XML parser error string
  363. * @link http://php.net/manual/en/function.xml-error-string.php
  364. * @param int $code <p>
  365. * An error code from xml_get_error_code.
  366. * </p>
  367. * @return string a string with a textual description of the error
  368. * code, or false if no description was found.
  369. */
  370. function xml_error_string ($code) {}
  371. /**
  372. * (PHP 4, PHP 5)<br/>
  373. * Get current line number for an XML parser
  374. * @link http://php.net/manual/en/function.xml-get-current-line-number.php
  375. * @param resource $parser <p>
  376. * A reference to the XML parser to get line number from.
  377. * </p>
  378. * @return int This function returns false if parser does
  379. * not refer to a valid parser, or else it returns which line the
  380. * parser is currently at in its data buffer.
  381. */
  382. function xml_get_current_line_number ($parser) {}
  383. /**
  384. * (PHP 4, PHP 5)<br/>
  385. * Get current column number for an XML parser
  386. * @link http://php.net/manual/en/function.xml-get-current-column-number.php
  387. * @param resource $parser <p>
  388. * A reference to the XML parser to get column number from.
  389. * </p>
  390. * @return int This function returns false if parser does
  391. * not refer to a valid parser, or else it returns which column on
  392. * the current line (as given by
  393. * xml_get_current_line_number) the parser is
  394. * currently at.
  395. */
  396. function xml_get_current_column_number ($parser) {}
  397. /**
  398. * (PHP 4, PHP 5)<br/>
  399. * Get current byte index for an XML parser
  400. * @link http://php.net/manual/en/function.xml-get-current-byte-index.php
  401. * @param resource $parser <p>
  402. * A reference to the XML parser to get byte index from.
  403. * </p>
  404. * @return int This function returns false if parser does
  405. * not refer to a valid parser, or else it returns which byte index
  406. * the parser is currently at in its data buffer (starting at 0).
  407. */
  408. function xml_get_current_byte_index ($parser) {}
  409. /**
  410. * (PHP 4, PHP 5)<br/>
  411. * Free an XML parser
  412. * @link http://php.net/manual/en/function.xml-parser-free.php
  413. * @param resource $parser A reference to the XML parser to free.
  414. * @return bool This function returns false if parser does not
  415. * refer to a valid parser, or else it frees the parser and returns true.
  416. */
  417. function xml_parser_free ($parser) {}
  418. /**
  419. * Set options in an XML parser
  420. * @link http://php.net/manual/en/function.xml-parser-set-option.php
  421. * @param parser resource <p>
  422. * A reference to the XML parser to set an option in.
  423. * </p>
  424. * @param int $option <p>
  425. * Which option to set. See below.
  426. * </p>
  427. * <p>
  428. * The following options are available:
  429. * <table>
  430. * XML parser options
  431. * <tr valign="top">
  432. * <td>Option constant</td>
  433. * <td>Data type</td>
  434. * <td>Description</td>
  435. * </tr>
  436. * <tr valign="top">
  437. * <td>XML_OPTION_CASE_FOLDING</td>
  438. * <td>integer</td>
  439. * <td>
  440. * Controls whether case-folding is enabled for this
  441. * XML parser. Enabled by default.
  442. * </td>
  443. * </tr>
  444. * <tr valign="top">
  445. * <td>XML_OPTION_SKIP_TAGSTART</td>
  446. * <td>integer</td>
  447. * <td>
  448. * Specify how many characters should be skipped in the beginning of a
  449. * tag name.
  450. * </td>
  451. * </tr>
  452. * <tr valign="top">
  453. * <td>XML_OPTION_SKIP_WHITE</td>
  454. * <td>integer</td>
  455. * <td>
  456. * Whether to skip values consisting of whitespace characters.
  457. * </td>
  458. * </tr>
  459. * <tr valign="top">
  460. * <td>XML_OPTION_TARGET_ENCODING</td>
  461. * <td>string</td>
  462. * <td>
  463. * Sets which target encoding to
  464. * use in this XML parser.By default, it is set to the same as the
  465. * source encoding used by xml_parser_create.
  466. * Supported target encodings are ISO-8859-1,
  467. * US-ASCII and UTF-8.
  468. * </td>
  469. * </tr>
  470. * </table>
  471. * </p>
  472. * @param mixed $value <p>
  473. * The option's new value.
  474. * </p>
  475. * @return bool This function returns false if parser does not
  476. * refer to a valid parser, or if the option could not be set. Else the
  477. * option is set and true is returned.
  478. */
  479. function xml_parser_set_option ($parser, $option, $value) {}
  480. /**
  481. * (PHP 4, PHP 5)<br/>
  482. * Get options from an XML parser
  483. * @link http://php.net/manual/en/function.xml-parser-get-option.php
  484. * @param resource $parser A reference to the XML parser to get an option from.
  485. * @param int $option Which option to fetch. XML_OPTION_CASE_FOLDING
  486. * and XML_OPTION_TARGET_ENCODING are available.
  487. * See xml_parser_set_option for their description.
  488. * @return mixed This function returns false if parser does
  489. * not refer to a valid parser or if option isn't
  490. * valid (generates also a E_WARNING).
  491. * Else the option's value is returned.
  492. */
  493. function xml_parser_get_option ($parser, $option) {}
  494. /**
  495. * (PHP 4, PHP 5)<br/>
  496. * Encodes an ISO-8859-1 string to UTF-8
  497. * @link http://php.net/manual/en/function.utf8-encode.php
  498. * @param string $data <p>
  499. * An ISO-8859-1 string.
  500. * </p>
  501. * @return string the UTF-8 translation of data.
  502. */
  503. function utf8_encode ($data) {}
  504. /**
  505. * (PHP 4, PHP 5)<br/>
  506. * Converts a string with ISO-8859-1 characters encoded with UTF-8
  507. to single-byte ISO-8859-1
  508. * @link http://php.net/manual/en/function.utf8-decode.php
  509. * @param string $data <p>
  510. * An UTF-8 encoded string.
  511. * </p>
  512. * @return string the ISO-8859-1 translation of data.
  513. */
  514. function utf8_decode ($data) {}
  515. define ('XML_ERROR_NONE', 0);
  516. define ('XML_ERROR_NO_MEMORY', 1);
  517. define ('XML_ERROR_SYNTAX', 2);
  518. define ('XML_ERROR_NO_ELEMENTS', 3);
  519. define ('XML_ERROR_INVALID_TOKEN', 4);
  520. define ('XML_ERROR_UNCLOSED_TOKEN', 5);
  521. define ('XML_ERROR_PARTIAL_CHAR', 6);
  522. define ('XML_ERROR_TAG_MISMATCH', 7);
  523. define ('XML_ERROR_DUPLICATE_ATTRIBUTE', 8);
  524. define ('XML_ERROR_JUNK_AFTER_DOC_ELEMENT', 9);
  525. define ('XML_ERROR_PARAM_ENTITY_REF', 10);
  526. define ('XML_ERROR_UNDEFINED_ENTITY', 11);
  527. define ('XML_ERROR_RECURSIVE_ENTITY_REF', 12);
  528. define ('XML_ERROR_ASYNC_ENTITY', 13);
  529. define ('XML_ERROR_BAD_CHAR_REF', 14);
  530. define ('XML_ERROR_BINARY_ENTITY_REF', 15);
  531. define ('XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', 16);
  532. define ('XML_ERROR_MISPLACED_XML_PI', 17);
  533. define ('XML_ERROR_UNKNOWN_ENCODING', 18);
  534. define ('XML_ERROR_INCORRECT_ENCODING', 19);
  535. define ('XML_ERROR_UNCLOSED_CDATA_SECTION', 20);
  536. define ('XML_ERROR_EXTERNAL_ENTITY_HANDLING', 21);
  537. define ('XML_OPTION_CASE_FOLDING', 1);
  538. define ('XML_OPTION_TARGET_ENCODING', 2);
  539. define ('XML_OPTION_SKIP_TAGSTART', 3);
  540. define ('XML_OPTION_SKIP_WHITE', 4);
  541. /**
  542. * Holds the SAX implementation method.
  543. * Can be libxml or expat.
  544. * @link http://php.net/manual/en/xml.constants.php
  545. */
  546. define ('XML_SAX_IMPL', "libxml");
  547. // End of xml v.
  548. ?>