PageRenderTime 26ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/www/.metadata/.plugins/org.eclipse.php.core/__language__/ea1b290a/tidy.php

http://iprn.googlecode.com/
PHP | 585 lines | 190 code | 58 blank | 337 comment | 0 complexity | a605cfac20c4ec8361a4c005886cb884 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, LGPL-2.0, Apache-2.0, MPL-2.0-no-copyleft-exception, GPL-3.0
  1. <?php
  2. // Start of tidy v.2.0
  3. class tidy {
  4. /**
  5. * Returns the value of the specified configuration option for the tidy document
  6. * @link http://www.php.net/manual/en/tidy.getopt.php
  7. * @param option string <p>
  8. * You will find a list with each configuration option and their types
  9. * at: &url.tidy.conf;.
  10. * </p>
  11. * @return mixed the value of the specified option.
  12. * The return type depends on the type of the specified one.
  13. */
  14. public function getOpt ($option) {}
  15. /**
  16. * Execute configured cleanup and repair operations on parsed markup
  17. * @link http://www.php.net/manual/en/tidy.cleanrepair.php
  18. * @return bool Returns true on success or false on failure.
  19. */
  20. public function cleanRepair () {}
  21. /**
  22. * Parse markup in file or URI
  23. * @link http://www.php.net/manual/en/tidy.parsefile.php
  24. * @param filename string <p>
  25. * If the filename parameter is given, this function
  26. * will also read that file and initialize the object with the file,
  27. * acting like tidy_parse_file.
  28. * </p>
  29. * @param config mixed[optional] <p>
  30. * The config config can be passed either as an
  31. * array or as a string. If a string is passed, it is interpreted as the
  32. * name of the configuration file, otherwise, it is interpreted as the
  33. * options themselves.
  34. * </p>
  35. * <p>
  36. * For an explanation about each option, see
  37. * &url.tidy.conf;.
  38. * </p>
  39. * @param encoding string[optional] <p>
  40. * The encoding parameter sets the encoding for
  41. * input/output documents. The possible values for encoding are:
  42. * ascii, latin0, latin1,
  43. * raw, utf8, iso2022,
  44. * mac, win1252, ibm858,
  45. * utf16, utf16le, utf16be,
  46. * big5, and shiftjis.
  47. * </p>
  48. * @param use_include_path bool[optional] <p>
  49. * Search for the file in the include_path.
  50. * </p>
  51. * @return bool Returns true on success or false on failure.
  52. */
  53. public function parseFile ($filename, $config = null, $encoding = null, $use_include_path = null) {}
  54. /**
  55. * Parse a document stored in a string
  56. * @link http://www.php.net/manual/en/tidy.parsestring.php
  57. * @param input string <p>
  58. * The data to be parsed.
  59. * </p>
  60. * @param config mixed[optional] <p>
  61. * The config config can be passed either as an
  62. * array or as a string. If a string is passed, it is interpreted as the
  63. * name of the configuration file, otherwise, it is interpreted as the
  64. * options themselves.
  65. * </p>
  66. * <p>
  67. * For an explanation about each option, visit &url.tidy.conf;.
  68. * </p>
  69. * @param encoding string[optional] <p>
  70. * The encoding parameter sets the encoding for
  71. * input/output documents. The possible values for encoding are:
  72. * ascii, latin0, latin1,
  73. * raw, utf8, iso2022,
  74. * mac, win1252, ibm858,
  75. * utf16, utf16le, utf16be,
  76. * big5, and shiftjis.
  77. * </p>
  78. * @return bool a new tidy instance.
  79. */
  80. public function parseString ($input, $config = null, $encoding = null) {}
  81. /**
  82. * Repair a string using an optionally provided configuration file
  83. * @link http://www.php.net/manual/en/tidy.repairstring.php
  84. * @param data string <p>
  85. * The data to be repaired.
  86. * </p>
  87. * @param config mixed[optional] <p>
  88. * The config config can be passed either as an
  89. * array or as a string. If a string is passed, it is interpreted as the
  90. * name of the configuration file, otherwise, it is interpreted as the
  91. * options themselves.
  92. * </p>
  93. * <p>
  94. * Check &url.tidy.conf; for
  95. * an explanation about each option.
  96. * </p>
  97. * @param encoding string[optional] <p>
  98. * The encoding parameter sets the encoding for
  99. * input/output documents. The possible values for encoding are:
  100. * ascii, latin0, latin1,
  101. * raw, utf8, iso2022,
  102. * mac, win1252, ibm858,
  103. * utf16, utf16le, utf16be,
  104. * big5, and shiftjis.
  105. * </p>
  106. * @return string the repaired string.
  107. */
  108. public function repairString ($data, $config = null, $encoding = null) {}
  109. /**
  110. * Repair a file and return it as a string
  111. * @link http://www.php.net/manual/en/tidy.repairfile.php
  112. * @param filename string <p>
  113. * The file to be repaired.
  114. * </p>
  115. * @param config mixed[optional] <p>
  116. * The config config can be passed either as an
  117. * array or as a string. If a string is passed, it is interpreted as the
  118. * name of the configuration file, otherwise, it is interpreted as the
  119. * options themselves.
  120. * </p>
  121. * <p>
  122. * Check http://tidy.sourceforge.net/docs/quickref.html for an
  123. * explanation about each option.
  124. * </p>
  125. * @param encoding string[optional] <p>
  126. * The encoding parameter sets the encoding for
  127. * input/output documents. The possible values for encoding are:
  128. * ascii, latin0, latin1,
  129. * raw, utf8, iso2022,
  130. * mac, win1252, ibm858,
  131. * utf16, utf16le, utf16be,
  132. * big5, and shiftjis.
  133. * </p>
  134. * @param use_include_path bool[optional] <p>
  135. * Search for the file in the include_path.
  136. * </p>
  137. * @return string the repaired contents as a string.
  138. */
  139. public function repairFile ($filename, $config = null, $encoding = null, $use_include_path = null) {}
  140. /**
  141. * Run configured diagnostics on parsed and repaired markup
  142. * @link http://www.php.net/manual/en/function.tidy-diagnose.php
  143. * @return bool Returns true on success or false on failure.
  144. */
  145. public function diagnose () {}
  146. /**
  147. * Get release date (version) for Tidy library
  148. * @link http://www.php.net/manual/en/tidy.getrelease.php
  149. * @return string a string with the release date of the Tidy library.
  150. */
  151. public function getRelease () {}
  152. /**
  153. * Get current Tidy configuration
  154. * @link http://www.php.net/manual/en/tidy.getconfig.php
  155. * @return array an array of configuration options.
  156. * </p>
  157. * <p>
  158. * For an explanation about each option, visit &url.tidy.conf;.
  159. */
  160. public function getConfig () {}
  161. /**
  162. * Get status of specified document
  163. * @link http://www.php.net/manual/en/tidy.getstatus.php
  164. * @return int 0 if no error/warning was raised, 1 for warnings or accessibility
  165. * errors, or 2 for errors.
  166. */
  167. public function getStatus () {}
  168. public function getHtmlVer () {}
  169. /**
  170. * Indicates if the document is a XHTML document
  171. * @link http://www.php.net/manual/en/tidy.isxhtml.php
  172. * @return bool This function returns true if the specified tidy
  173. * object is a XHTML document, or false otherwise.
  174. * </p>
  175. * <p>
  176. * This function is not yet implemented in the Tidylib itself, so it always
  177. * return false.
  178. */
  179. public function isXhtml () {}
  180. /**
  181. * Indicates if the document is a generic (non HTML/XHTML) XML document
  182. * @link http://www.php.net/manual/en/tidy.isxml.php
  183. * @return bool This function returns true if the specified tidy
  184. * object is a generic XML document (non HTML/XHTML),
  185. * or false otherwise.
  186. * </p>
  187. * <p>
  188. * This function is not yet implemented in the Tidylib itself, so it always
  189. * return false.
  190. */
  191. public function isXml () {}
  192. /**
  193. * Returns a <classname>tidyNode</classname> object representing the root of the tidy parse tree
  194. * @link http://www.php.net/manual/en/tidy.root.php
  195. * @return tidyNode the tidyNode object.
  196. */
  197. public function root () {}
  198. /**
  199. * Returns a <classname>tidyNode</classname> object starting from the &lt;head&gt; tag of the tidy parse tree
  200. * @link http://www.php.net/manual/en/tidy.head.php
  201. * @return tidyNode the tidyNode object.
  202. */
  203. public function head () {}
  204. /**
  205. * Returns a <classname>tidyNode</classname> object starting from the &lt;html&gt; tag of the tidy parse tree
  206. * @link http://www.php.net/manual/en/tidy.html.php
  207. * @return tidyNode the tidyNode object.
  208. */
  209. public function html () {}
  210. /**
  211. * Returns a <classname>tidyNode</classname> object starting from the &lt;body&gt; tag of the tidy parse tree
  212. * @link http://www.php.net/manual/en/tidy.body.php
  213. * @return tidyNode the detected HTML version.
  214. * </p>
  215. * <p>
  216. * This function is not yet implemented in the Tidylib itself, so it always
  217. * return 0.
  218. */
  219. public function body () {}
  220. /**
  221. * Constructs a new <classname>tidy</classname> object
  222. * @link http://www.php.net/manual/en/tidy.construct.php
  223. * @param filename string[optional] <p>
  224. * If the filename parameter is given, this function
  225. * will also read that file and initialize the object with the file,
  226. * acting like tidy_parse_file.
  227. * </p>
  228. * @param config mixed[optional] <p>
  229. * The config config can be passed either as an
  230. * array or as a string. If a string is passed, it is interpreted as the
  231. * name of the configuration file, otherwise, it is interpreted as the
  232. * options themselves.
  233. * </p>
  234. * <p>
  235. * For an explanation about each option, visit &url.tidy.conf;.
  236. * </p>
  237. * @param encoding string[optional] <p>
  238. * The encoding parameter sets the encoding for
  239. * input/output documents. The possible values for encoding are:
  240. * ascii, latin0, latin1,
  241. * raw, utf8, iso2022,
  242. * mac, win1252, ibm858,
  243. * utf16, utf16le, utf16be,
  244. * big5, and shiftjis.
  245. * </p>
  246. * @param use_include_path bool[optional] <p>
  247. * Search for the file in the include_path.
  248. * </p>
  249. * @return tidy the new tidy instance.
  250. */
  251. public function __construct ($filename = null, $config = null, $encoding = null, $use_include_path = null) {}
  252. }
  253. final class tidyNode {
  254. /**
  255. * Checks if a node has children
  256. * @link http://www.php.net/manual/en/tidynode.haschildren.php
  257. * @return bool true if the node has children, false otherwise.
  258. */
  259. public function hasChildren () {}
  260. /**
  261. * Checks if a node has siblings
  262. * @link http://www.php.net/manual/en/tidynode.hassiblings.php
  263. * @return bool true if the node has siblings, false otherwise.
  264. */
  265. public function hasSiblings () {}
  266. /**
  267. * Checks if a node represents a comment
  268. * @link http://www.php.net/manual/en/tidynode.iscomment.php
  269. * @return bool true if the node is a comment, false otherwise.
  270. */
  271. public function isComment () {}
  272. /**
  273. * Checks if a node is part of a HTML document
  274. * @link http://www.php.net/manual/en/tidynode.ishtml.php
  275. * @return bool true if the node is part of a HTML document, false otherwise.
  276. */
  277. public function isHtml () {}
  278. /**
  279. * Checks if a node represents text (no markup)
  280. * @link http://www.php.net/manual/en/tidynode.istext.php
  281. * @return bool true if the node represent a text, false otherwise.
  282. */
  283. public function isText () {}
  284. /**
  285. * Checks if this node is JSTE
  286. * @link http://www.php.net/manual/en/tidynode.isjste.php
  287. * @return bool true if the node is JSTE, false otherwise.
  288. */
  289. public function isJste () {}
  290. /**
  291. * Checks if this node is ASP
  292. * @link http://www.php.net/manual/en/tidynode.isasp.php
  293. * @return bool true if the node is ASP, false otherwise.
  294. */
  295. public function isAsp () {}
  296. /**
  297. * Checks if a node is PHP
  298. * @link http://www.php.net/manual/en/tidynode.isphp.php
  299. * @return bool true if the current node is PHP code, false otherwise.
  300. */
  301. public function isPhp () {}
  302. /**
  303. * Returns the parent node of the current node
  304. * @link http://www.php.net/manual/en/tidynode.getparent.php
  305. * @return tidyNode a tidyNode if the node has a parent, or &null;
  306. * otherwise.
  307. */
  308. public function getParent () {}
  309. }
  310. function tidy_getopt () {}
  311. function tidy_parse_string () {}
  312. function tidy_parse_file () {}
  313. /**
  314. * Return a string representing the parsed tidy markup
  315. * @link http://www.php.net/manual/en/function.tidy-get-output.php
  316. * @param object tidy <p>
  317. * &tidy.object;
  318. * </p>
  319. * @return string the parsed tidy markup.
  320. */
  321. function tidy_get_output (tidy $object) {}
  322. /**
  323. * Return warnings and errors which occurred parsing the specified document
  324. * @link http://www.php.net/manual/en/function.tidy-get-error-buffer.php
  325. * @param object tidy <p>
  326. * &tidy.object;
  327. * </p>
  328. * @return string the error buffer as a string.
  329. */
  330. function tidy_get_error_buffer (tidy $object) {}
  331. function tidy_clean_repair () {}
  332. function tidy_repair_string () {}
  333. function tidy_repair_file () {}
  334. function tidy_diagnose () {}
  335. function tidy_get_release () {}
  336. function tidy_get_config () {}
  337. function tidy_get_status () {}
  338. function tidy_get_html_ver () {}
  339. function tidy_is_xhtml () {}
  340. function tidy_is_xml () {}
  341. /**
  342. * Returns the Number of Tidy errors encountered for specified document
  343. * @link http://www.php.net/manual/en/function.tidy-error-count.php
  344. * @param object tidy <p>
  345. * &tidy.object;
  346. * </p>
  347. * @return int the number of errors.
  348. */
  349. function tidy_error_count (tidy $object) {}
  350. /**
  351. * Returns the Number of Tidy warnings encountered for specified document
  352. * @link http://www.php.net/manual/en/function.tidy-warning-count.php
  353. * @param object tidy <p>
  354. * &tidy.object;
  355. * </p>
  356. * @return int the number of warnings.
  357. */
  358. function tidy_warning_count (tidy $object) {}
  359. /**
  360. * Returns the Number of Tidy accessibility warnings encountered for specified document
  361. * @link http://www.php.net/manual/en/function.tidy-access-count.php
  362. * @param object tidy <p>
  363. * &tidy.object;
  364. * </p>
  365. * @return int the number of warnings.
  366. */
  367. function tidy_access_count (tidy $object) {}
  368. /**
  369. * Returns the Number of Tidy configuration errors encountered for specified document
  370. * @link http://www.php.net/manual/en/function.tidy-config-count.php
  371. * @param object tidy <p>
  372. * &tidy.object;
  373. * </p>
  374. * @return int the number of errors.
  375. */
  376. function tidy_config_count (tidy $object) {}
  377. function tidy_get_root () {}
  378. function tidy_get_head () {}
  379. function tidy_get_html () {}
  380. function tidy_get_body () {}
  381. /**
  382. * ob_start callback function to repair the buffer
  383. * @link http://www.php.net/manual/en/function.ob-tidyhandler.php
  384. * @param input string <p>
  385. * The buffer.
  386. * </p>
  387. * @param mode int[optional] <p>
  388. * The buffer mode.
  389. * </p>
  390. * @return string the modified buffer.
  391. */
  392. function ob_tidyhandler ($input, $mode = null) {}
  393. define ('TIDY_TAG_UNKNOWN', 0);
  394. define ('TIDY_TAG_A', 1);
  395. define ('TIDY_TAG_ABBR', 2);
  396. define ('TIDY_TAG_ACRONYM', 3);
  397. define ('TIDY_TAG_ADDRESS', 4);
  398. define ('TIDY_TAG_ALIGN', 5);
  399. define ('TIDY_TAG_APPLET', 6);
  400. define ('TIDY_TAG_AREA', 7);
  401. define ('TIDY_TAG_B', 8);
  402. define ('TIDY_TAG_BASE', 9);
  403. define ('TIDY_TAG_BASEFONT', 10);
  404. define ('TIDY_TAG_BDO', 11);
  405. define ('TIDY_TAG_BGSOUND', 12);
  406. define ('TIDY_TAG_BIG', 13);
  407. define ('TIDY_TAG_BLINK', 14);
  408. define ('TIDY_TAG_BLOCKQUOTE', 15);
  409. define ('TIDY_TAG_BODY', 16);
  410. define ('TIDY_TAG_BR', 17);
  411. define ('TIDY_TAG_BUTTON', 18);
  412. define ('TIDY_TAG_CAPTION', 19);
  413. define ('TIDY_TAG_CENTER', 20);
  414. define ('TIDY_TAG_CITE', 21);
  415. define ('TIDY_TAG_CODE', 22);
  416. define ('TIDY_TAG_COL', 23);
  417. define ('TIDY_TAG_COLGROUP', 24);
  418. define ('TIDY_TAG_COMMENT', 25);
  419. define ('TIDY_TAG_DD', 26);
  420. define ('TIDY_TAG_DEL', 27);
  421. define ('TIDY_TAG_DFN', 28);
  422. define ('TIDY_TAG_DIR', 29);
  423. define ('TIDY_TAG_DIV', 30);
  424. define ('TIDY_TAG_DL', 31);
  425. define ('TIDY_TAG_DT', 32);
  426. define ('TIDY_TAG_EM', 33);
  427. define ('TIDY_TAG_EMBED', 34);
  428. define ('TIDY_TAG_FIELDSET', 35);
  429. define ('TIDY_TAG_FONT', 36);
  430. define ('TIDY_TAG_FORM', 37);
  431. define ('TIDY_TAG_FRAME', 38);
  432. define ('TIDY_TAG_FRAMESET', 39);
  433. define ('TIDY_TAG_H1', 40);
  434. define ('TIDY_TAG_H2', 41);
  435. define ('TIDY_TAG_H3', 42);
  436. define ('TIDY_TAG_H4', 43);
  437. define ('TIDY_TAG_H5', 44);
  438. define ('TIDY_TAG_H6', 45);
  439. define ('TIDY_TAG_HEAD', 46);
  440. define ('TIDY_TAG_HR', 47);
  441. define ('TIDY_TAG_HTML', 48);
  442. define ('TIDY_TAG_I', 49);
  443. define ('TIDY_TAG_IFRAME', 50);
  444. define ('TIDY_TAG_ILAYER', 51);
  445. define ('TIDY_TAG_IMG', 52);
  446. define ('TIDY_TAG_INPUT', 53);
  447. define ('TIDY_TAG_INS', 54);
  448. define ('TIDY_TAG_ISINDEX', 55);
  449. define ('TIDY_TAG_KBD', 56);
  450. define ('TIDY_TAG_KEYGEN', 57);
  451. define ('TIDY_TAG_LABEL', 58);
  452. define ('TIDY_TAG_LAYER', 59);
  453. define ('TIDY_TAG_LEGEND', 60);
  454. define ('TIDY_TAG_LI', 61);
  455. define ('TIDY_TAG_LINK', 62);
  456. define ('TIDY_TAG_LISTING', 63);
  457. define ('TIDY_TAG_MAP', 64);
  458. define ('TIDY_TAG_MARQUEE', 65);
  459. define ('TIDY_TAG_MENU', 66);
  460. define ('TIDY_TAG_META', 67);
  461. define ('TIDY_TAG_MULTICOL', 68);
  462. define ('TIDY_TAG_NOBR', 69);
  463. define ('TIDY_TAG_NOEMBED', 70);
  464. define ('TIDY_TAG_NOFRAMES', 71);
  465. define ('TIDY_TAG_NOLAYER', 72);
  466. define ('TIDY_TAG_NOSAVE', 73);
  467. define ('TIDY_TAG_NOSCRIPT', 74);
  468. define ('TIDY_TAG_OBJECT', 75);
  469. define ('TIDY_TAG_OL', 76);
  470. define ('TIDY_TAG_OPTGROUP', 77);
  471. define ('TIDY_TAG_OPTION', 78);
  472. define ('TIDY_TAG_P', 79);
  473. define ('TIDY_TAG_PARAM', 80);
  474. define ('TIDY_TAG_PLAINTEXT', 81);
  475. define ('TIDY_TAG_PRE', 82);
  476. define ('TIDY_TAG_Q', 83);
  477. define ('TIDY_TAG_RB', 84);
  478. define ('TIDY_TAG_RBC', 85);
  479. define ('TIDY_TAG_RP', 86);
  480. define ('TIDY_TAG_RT', 87);
  481. define ('TIDY_TAG_RTC', 88);
  482. define ('TIDY_TAG_RUBY', 89);
  483. define ('TIDY_TAG_S', 90);
  484. define ('TIDY_TAG_SAMP', 91);
  485. define ('TIDY_TAG_SCRIPT', 92);
  486. define ('TIDY_TAG_SELECT', 93);
  487. define ('TIDY_TAG_SERVER', 94);
  488. define ('TIDY_TAG_SERVLET', 95);
  489. define ('TIDY_TAG_SMALL', 96);
  490. define ('TIDY_TAG_SPACER', 97);
  491. define ('TIDY_TAG_SPAN', 98);
  492. define ('TIDY_TAG_STRIKE', 99);
  493. define ('TIDY_TAG_STRONG', 100);
  494. define ('TIDY_TAG_STYLE', 101);
  495. define ('TIDY_TAG_SUB', 102);
  496. define ('TIDY_TAG_SUP', 103);
  497. define ('TIDY_TAG_TABLE', 104);
  498. define ('TIDY_TAG_TBODY', 105);
  499. define ('TIDY_TAG_TD', 106);
  500. define ('TIDY_TAG_TEXTAREA', 107);
  501. define ('TIDY_TAG_TFOOT', 108);
  502. define ('TIDY_TAG_TH', 109);
  503. define ('TIDY_TAG_THEAD', 110);
  504. define ('TIDY_TAG_TITLE', 111);
  505. define ('TIDY_TAG_TR', 112);
  506. define ('TIDY_TAG_TT', 113);
  507. define ('TIDY_TAG_U', 114);
  508. define ('TIDY_TAG_UL', 115);
  509. define ('TIDY_TAG_VAR', 116);
  510. define ('TIDY_TAG_WBR', 117);
  511. define ('TIDY_TAG_XMP', 118);
  512. define ('TIDY_NODETYPE_ROOT', 0);
  513. define ('TIDY_NODETYPE_DOCTYPE', 1);
  514. define ('TIDY_NODETYPE_COMMENT', 2);
  515. define ('TIDY_NODETYPE_PROCINS', 3);
  516. define ('TIDY_NODETYPE_TEXT', 4);
  517. define ('TIDY_NODETYPE_START', 5);
  518. define ('TIDY_NODETYPE_END', 6);
  519. define ('TIDY_NODETYPE_STARTEND', 7);
  520. define ('TIDY_NODETYPE_CDATA', 8);
  521. define ('TIDY_NODETYPE_SECTION', 9);
  522. define ('TIDY_NODETYPE_ASP', 10);
  523. define ('TIDY_NODETYPE_JSTE', 11);
  524. define ('TIDY_NODETYPE_PHP', 12);
  525. define ('TIDY_NODETYPE_XMLDECL', 13);
  526. // End of tidy v.2.0
  527. ?>