summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2004-12-12 15:10:59 +0000
committerSVN Migration <svn@php.net>2004-12-12 15:10:59 +0000
commitdb7b5b196a00f14cb626758257a42b9c8c02cd1c (patch)
tree6ad7387035b15a81e6f0936c833a686103a1f97d
parentfff93cdb7f3e6e348ed88d0f4044e133e823c195 (diff)
downloadphp-git-SQLITE_4_3_20041227.tar.gz
This commit was manufactured by cvs2svn to create tag 'SQLITE_4_3_20041227'.SQLITE_4_3_20041227
-rw-r--r--ext/tidy/CREDITS2
-rw-r--r--ext/tidy/README52
-rw-r--r--ext/tidy/TODO3
-rw-r--r--ext/tidy/config.m435
-rw-r--r--ext/tidy/examples/cleanhtml.php38
-rw-r--r--ext/tidy/package.xml64
-rw-r--r--ext/tidy/php_tidy.h128
-rw-r--r--ext/tidy/tests/001.phpt24
-rw-r--r--ext/tidy/tests/002.phpt22
-rw-r--r--ext/tidy/tests/003.phpt25
-rw-r--r--ext/tidy/tests/004.phpt21
-rw-r--r--ext/tidy/tests/005.html1
-rw-r--r--ext/tidy/tests/005.phpt23
-rw-r--r--ext/tidy/tests/006.phpt21
-rw-r--r--ext/tidy/tests/007.phpt36
-rw-r--r--ext/tidy/tidy.c876
-rwxr-xr-xext/tidy/tidy.dsp108
17 files changed, 0 insertions, 1479 deletions
diff --git a/ext/tidy/CREDITS b/ext/tidy/CREDITS
deleted file mode 100644
index 1c77b2ff3b..0000000000
--- a/ext/tidy/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-tidy
-John Coggeshall, Ilia Alshanetsky
diff --git a/ext/tidy/README b/ext/tidy/README
deleted file mode 100644
index 1ae64ff629..0000000000
--- a/ext/tidy/README
+++ /dev/null
@@ -1,52 +0,0 @@
-
-README FOR ext/tidy by John Coggeshall <john@php.net>
-
-Tidy is an extension based on Libtidy (http://tidy.sf.net/) and allows a PHP developer
-to clean, repair, and traverse HTML, XHTML, and XML documents -- including ones with
-embedded scripting languages such as PHP or ASP within them using OO constructs.
-
-
-The general API is provided below:
-
- tidy_create() Reinitialize the tidy engine
- tidy_parse_file($file) Parse the document stored in $file
- tidy_parse_string($str) Parse the string stored in $str
-
- tidy_clean_repair() Clean and repair the document
- tidy_diagnose() Diagnose a parsed document
-
- tidy_setopt($opt, $val) Set a configuration option $opt to $val
- tidy_getopt($opt) Retrieve a configuration option
-
- ** note: $opt is a string representing the option. Although no formal
- documentation yet exists for PHP, you can find a description of many
- of them at http://www.w3.org/People/Raggett/tidy/ and a list of supported
- options in the phpinfo(); output**
-
- tidy_get_output() Return the cleaned tidy HTML as a string
- tidy_get_error_buffer() Return a log of the errors and warnings
- returned by tidy
-
- tidy_get_release() Return the Libtidy release date
- tidy_get_status() Return the status of the document
- tidy_get_html_ver() Return the major HTML version detected for
- the document;
-
- tidy_is_xhtml() Determines if the document is XHTML
- tidy_is_xml() Determines if the document is a generic XML
-
- tidy_error_count() Returns the number of errors in the document
- tidy_warning_count() Returns the number of warnings in the document
- tidy_access_count() Returns the number of accessibility-related
- warnings in the document.
- tidy_config_count() Returns the number of configuration errors found
-
- tidy_load_config($file) Loads the specified configuration file
- tidY_load_config_enc($file,
- $enc) Loads the specified config file using the specified
- character encoding
- tidy_set_encoding($enc) Sets the current character encoding for the document
- tidy_save_config($file) Saves the current config to $file
-
-
-E-mail thoughts, suggestions, patches, etc. to <john@php.net>
diff --git a/ext/tidy/TODO b/ext/tidy/TODO
deleted file mode 100644
index f23a764794..0000000000
--- a/ext/tidy/TODO
+++ /dev/null
@@ -1,3 +0,0 @@
-TODO
-
-
diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4
deleted file mode 100644
index 069b3ee6b4..0000000000
--- a/ext/tidy/config.m4
+++ /dev/null
@@ -1,35 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-PHP_ARG_WITH(tidy,for TIDY support,
-[ --with-tidy[=DIR] Include TIDY support])
-
-if test "$PHP_TIDY" != "no"; then
- PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
- if test "$PHP_TIDY" != "yes"; then
- TIDY_SEARCH_DIRS=$PHP_TIDY
- else
- TIDY_SEARCH_DIRS="/usr/local /usr"
- fi
- for i in $TIDY_SEARCH_DIRS; do
- if test -f $i/include/tidy/tidy.h; then
- TIDY_DIR=$i
- TIDY_INCDIR=$i/include/tidy
- elif test -f $i/include/tidy.h; then
- TIDY_DIR=$i
- TIDY_INCDIR=$i/include
- fi
- done
-
- if test -z "$TIDY_DIR"; then
- AC_MSG_ERROR(Cannot find libtidy)
- fi
-
- TIDY_LIBDIR=$TIDY_DIR/lib
-
- AC_DEFINE(HAVE_TIDY,1,[ ])
- PHP_SUBST(TIDY_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
- PHP_ADD_INCLUDE($TIDY_INCDIR)
-fi
diff --git a/ext/tidy/examples/cleanhtml.php b/ext/tidy/examples/cleanhtml.php
deleted file mode 100644
index 9d054cda4f..0000000000
--- a/ext/tidy/examples/cleanhtml.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
- /*
- * cleanhtml.php
- *
- * A simple script to clean and repair HTML,XHTML,PHP,ASP,etc. documents
- * if no file is provided, it reads from standard input.
- *
- * By: John Coggeshall <john@php.net>
- *
- * Usage: php cleanhtml.php [filename]
- *
- */
-
- if(!isset($_SERVER['argv'][1])) {
- $data = file_get_contents("php://stdin");
- tidy_parse_string($data);
- } else {
- tidy_parse_file($_SERVER['argv'][1]);
- }
-
- tidy_clean_repair();
-
- if(tidy_warning_count() ||
- tidy_error_count()) {
-
- echo "\n\nThe following errors or warnings occured:\n";
- echo tidy_get_error_buffer();
- echo "\n";
- }
-
- echo tidy_get_output();
-
-?>
-
-
-
- \ No newline at end of file
diff --git a/ext/tidy/package.xml b/ext/tidy/package.xml
deleted file mode 100644
index 266cc5d7c6..0000000000
--- a/ext/tidy/package.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>tidy</name>
- <summary>Tidy HTML Repairing and Parsing</summary>
- <maintainers>
- <maintainer>
- <user>john</user>
- <name>John Coggeshall</name>
- <email>john@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>ilia@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-Tidy is a binding for the Tidy HTML clean and repair utility which
-allows you to not only clean and otherwise manipluate HTML documents,
-but also traverse the document tree using the Zend Engine 2 OO semantics.
- </description>
- <license>PHP</license>
- <release>
- <state>stable</state>
- <version>1.0</version>
- <date>2003-11-13</date>
- <notes>
- Fixed a few PHP5-specific bugs when working with node objects.
- </notes>
- <configureoptions>
- <configureoption name="with-tidy" default="autodetect" prompt="Tidy library installation dir?"/>
- </configureoptions>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="tidy.c"/>
- <file role="src" name="php_tidy.h"/>
-
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="doc" name="TODO"/>
- <file role="doc" name="examples/cleanhtml.php"/>
- <file role="doc" name="examples/dumpit.php"/>
- <file role="doc" name="examples/urlgrab.php"/>
-
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/003.phpt"/>
- <file role="test" name="tests/004.phpt"/>
- <file role="test" name="tests/005.phpt"/>
- <file role="test" name="tests/005.html"/>
- <file role="test" name="tests/006.phpt"/>
- <file role="test" name="tests/007.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge">4.3.0</dep>
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h
deleted file mode 100644
index 1d649a52cc..0000000000
--- a/ext/tidy/php_tidy.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 4 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2003 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: John Coggeshall <john@php.net> |
- | Ilia Alshanetsky <ilia@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef PHP_TIDY_H
-#define PHP_TIDY_H
-
-extern zend_module_entry tidy_module_entry;
-#define phpext_tidy_ptr &tidy_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_TIDY_API __declspec(dllexport)
-#else
-#define PHP_TIDY_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-#include "tidyenum.h"
-#include "tidy.h"
-#include "buffio.h"
-
-#ifdef ZTS
-#define TG(v) TSRMG(tidy_globals_id, zend_tidy_globals *, v)
-#else
-#define TG(v) (tidy_globals.v)
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
-#define TIDY_RV_FALSE(__t) __t->type = IS_BOOL; __t->value.lval = FALSE
-#define TIDY_RV_TRUE(__t) __t->type = IS_BOOL; __t->value.lval = TRUE
-
-#define REMOVE_NEWLINE(_z) _z->value.str.val[_z->value.str.len-1] = '\0'; _z->value.str.len--;
-
-struct _PHPTidyDoc {
-
- TidyDoc doc;
- TidyBuffer *errbuf;
- zend_bool parsed;
-};
-
-typedef struct _PHPTidyDoc PHPTidyDoc;
-
-
-PHP_MINIT_FUNCTION(tidy);
-PHP_MSHUTDOWN_FUNCTION(tidy);
-PHP_RINIT_FUNCTION(tidy);
-PHP_RSHUTDOWN_FUNCTION(tidy);
-PHP_MINFO_FUNCTION(tidy);
-
-PHP_FUNCTION(tidy_setopt);
-PHP_FUNCTION(tidy_getopt);
-PHP_FUNCTION(tidy_parse_string);
-PHP_FUNCTION(tidy_parse_file);
-PHP_FUNCTION(tidy_clean_repair);
-PHP_FUNCTION(tidy_repair_string);
-PHP_FUNCTION(tidy_repair_file);
-PHP_FUNCTION(tidy_diagnose);
-PHP_FUNCTION(tidy_get_output);
-PHP_FUNCTION(tidy_get_error_buffer);
-PHP_FUNCTION(tidy_get_release);
-PHP_FUNCTION(tidy_reset_config);
-PHP_FUNCTION(tidy_get_config);
-PHP_FUNCTION(tidy_get_status);
-PHP_FUNCTION(tidy_get_html_ver);
-PHP_FUNCTION(tidy_is_xhtml);
-PHP_FUNCTION(tidy_is_xml);
-PHP_FUNCTION(tidy_error_count);
-PHP_FUNCTION(tidy_warning_count);
-PHP_FUNCTION(tidy_access_count);
-PHP_FUNCTION(tidy_config_count);
-PHP_FUNCTION(tidy_load_config);
-PHP_FUNCTION(tidy_load_config_enc);
-PHP_FUNCTION(tidy_set_encoding);
-PHP_FUNCTION(tidy_save_config);
-
-/* resource dtor */
-void dtor_TidyDoc(zend_rsrc_list_entry * TSRMLS_DC);
-
-ZEND_BEGIN_MODULE_GLOBALS(tidy)
- PHPTidyDoc *tdoc;
- zend_bool used;
- char *default_config;
-ZEND_END_MODULE_GLOBALS(tidy)
-
-#ifdef ZTS
-#define TG(v) TSRMG(tidy_globals_id, zend_tidy_globals *, v)
-#else
-#define TG(v) (tidy_globals.v)
-#endif
-
-
-
-
-#endif
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/tidy/tests/001.phpt b/ext/tidy/tests/001.phpt
deleted file mode 100644
index 17da6f9874..0000000000
--- a/ext/tidy/tests/001.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Check for tidy presence
---SKIPIF--
-<?php if (!extension_loaded("tidy")) print "skip"; ?>
---POST--
---GET--
---INI--
---FILE--
-<?php
-echo "tidy extension is available";
-/*
- you can add regression tests for your extension here
-
- the output of your test code has to be equal to the
- text in the --EXPECT-- section below for the tests
- to pass, differences between the output and the
- expected text are interpreted as failure
-
- see php4/README.TESTING for further information on
- writing regression tests
-*/
-?>
---EXPECT--
-tidy extension is available
diff --git a/ext/tidy/tests/002.phpt b/ext/tidy/tests/002.phpt
deleted file mode 100644
index 83456091f7..0000000000
--- a/ext/tidy/tests/002.phpt
+++ /dev/null
@@ -1,22 +0,0 @@
---TEST--
-tidy_parse_string()
---SKIPIF--
-<?php if (!extension_loaded("tidy")) print "skip"; ?>
---POST--
---GET--
---INI--
---FILE--
-<?php
- tidy_parse_string("<HTML></HTML>");
-
- echo tidy_get_output();
-
-?>
---EXPECT--
-<html>
-<head>
-<title></title>
-</head>
-<body>
-</body>
-</html> \ No newline at end of file
diff --git a/ext/tidy/tests/003.phpt b/ext/tidy/tests/003.phpt
deleted file mode 100644
index b008acecdb..0000000000
--- a/ext/tidy/tests/003.phpt
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-tidy_clean_repair()
---SKIPIF--
-<?php if (!extension_loaded("tidy")) print "skip"; ?>
---POST--
---GET--
---INI--
---FILE--
-<?php
-
- tidy_parse_string("<HTML></HTML>");
- tidy_clean_repair();
-
- echo tidy_get_output();
-
-?>
---EXPECT--
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-<title></title>
-</head>
-<body>
-</body>
-</html>
diff --git a/ext/tidy/tests/004.phpt b/ext/tidy/tests/004.phpt
deleted file mode 100644
index ed60a39b27..0000000000
--- a/ext/tidy/tests/004.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-tidy_diagnose()
---SKIPIF--
-<?php if (!extension_loaded("tidy")) print "skip"; ?>
---POST--
---GET--
---INI--
---FILE--
-<?php
- tidy_parse_string("<HTML></HTML>");
- tidy_diagnose();
- echo tidy_get_error_buffer();
-
-?>
---EXPECT--
-
-line 1 column 1 - Warning: missing <!DOCTYPE> declaration
-line 1 column 7 - Warning: discarding unexpected </html>
-line 1 column 14 - Warning: inserting missing 'title' element
-Info: Document content looks like HTML 3.2
-3 warnings, 0 errors were found! \ No newline at end of file
diff --git a/ext/tidy/tests/005.html b/ext/tidy/tests/005.html
deleted file mode 100644
index 8c17451f91..0000000000
--- a/ext/tidy/tests/005.html
+++ /dev/null
@@ -1 +0,0 @@
-<HTML></HTML>
diff --git a/ext/tidy/tests/005.phpt b/ext/tidy/tests/005.phpt
deleted file mode 100644
index d69a726c8f..0000000000
--- a/ext/tidy/tests/005.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-tidy_parse_file()
---SKIPIF--
-<?php if (!extension_loaded("tidy")) print "skip"; ?>
---POST--
---GET--
---INI--
---FILE--
-<?php
-
- tidy_parse_file("ext/tidy/tests/005.html");
-
- echo tidy_get_output();
-
-?>
---EXPECT--
-<html>
-<head>
-<title></title>
-</head>
-<body>
-</body>
-</html> \ No newline at end of file
diff --git a/ext/tidy/tests/006.phpt b/ext/tidy/tests/006.phpt
deleted file mode 100644
index 7ea28e79c5..0000000000
--- a/ext/tidy/tests/006.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-Verbose tidy_get_error_buffer()
---SKIPIF--
-<?php if (!extension_loaded("tidy")) print "skip"; ?>
---POST--
---GET--
---INI--
---FILE--
-<?php
-
- tidy_parse_string("<HTML><asd asdf></HTML>");
-
- echo tidy_get_error_buffer(true);
-
-?>
---EXPECT--
-line 1 column 1 - Warning: missing <!DOCTYPE> declaration
-line 1 column 7 - Error: <asd> is not recognized!
-line 1 column 7 - Warning: discarding unexpected <asd>
-line 1 column 17 - Warning: discarding unexpected </html>
-line 1 column 7 - Warning: inserting missing 'title' element \ No newline at end of file
diff --git a/ext/tidy/tests/007.phpt b/ext/tidy/tests/007.phpt
deleted file mode 100644
index aab956427f..0000000000
--- a/ext/tidy/tests/007.phpt
+++ /dev/null
@@ -1,36 +0,0 @@
---TEST--
-Verbose tidy_setopt() / tidy_getopt()
---SKIPIF--
-<?php if (!extension_loaded("tidy")) print "skip"; ?>
---POST--
---GET--
---INI--
---FILE--
-<?php
-
- echo "Current Value of 'tidy-mark': ";
- var_dump(tidy_getopt("tidy-mark"));
- tidy_setopt("tidy-mark", true);
- echo "\nNew Value of 'tidy-mark': ";
- var_dump(tidy_getopt("tidy-mark"));
- echo "Current Value of 'error-file': ";
- var_dump(tidy_getopt("error-file"));
- tidy_setopt("error-file", "foobar");
- echo "\nNew Value of 'error-file': ";
- var_dump(tidy_getopt("error-file"));
- echo "Current Value of 'tab-size': ";
- var_dump(tidy_getopt("tab-size"));
- tidy_setopt("tab-size", 10);
- echo "\nNew Value of 'tab-size': ";
- var_dump(tidy_getopt("tab-size"));
-?>
---EXPECT--
-Current Value of 'tidy-mark': NULL
-
-New Value of 'tidy-mark': bool(true)
-Current Value of 'error-file': string(0) ""
-
-New Value of 'error-file': string(6) "foobar"
-Current Value of 'tab-size': int(8)
-
-New Value of 'tab-size': int(10) \ No newline at end of file
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
deleted file mode 100644
index 09ea630c07..0000000000
--- a/ext/tidy/tidy.c
+++ /dev/null
@@ -1,876 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 4 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2003 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: John Coggeshall <john@php.net> |
- | Ilia Alshanetsky <ilia@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_tidy.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "Zend/zend_API.h"
-#include "Zend/zend_hash.h"
-#include "safe_mode.h"
-
-ZEND_DECLARE_MODULE_GLOBALS(tidy);
-
-#define TIDY_PARSED_CHECK() \
-if(!TG(tdoc)->parsed) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A document must be parsed before executing this function."); \
- RETURN_FALSE; \
-} \
-
-#define TIDY_SAFE_MODE_CHECK(filename) \
-if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) { \
- RETURN_FALSE; \
-} \
-
-#define TIDY_CLEAR_ERROR if (TG(tdoc)->errbuf && TG(tdoc)->errbuf->bp) { tidyBufClear(TG(tdoc)->errbuf); }
-
-function_entry tidy_functions[] = {
- PHP_FE(tidy_setopt, NULL)
- PHP_FE(tidy_getopt, NULL)
- PHP_FE(tidy_parse_string, NULL)
- PHP_FE(tidy_parse_file, NULL)
- PHP_FE(tidy_get_output, NULL)
- PHP_FE(tidy_get_error_buffer, NULL)
- PHP_FE(tidy_clean_repair, NULL)
- PHP_FE(tidy_repair_string, NULL)
- PHP_FE(tidy_repair_file, NULL)
- PHP_FE(tidy_diagnose, NULL)
- PHP_FE(tidy_get_release, NULL)
- PHP_FE(tidy_get_config, NULL)
- PHP_FE(tidy_get_status, NULL)
- PHP_FE(tidy_get_html_ver, NULL)
- PHP_FE(tidy_is_xhtml, NULL)
- PHP_FE(tidy_is_xml, NULL)
- PHP_FE(tidy_error_count, NULL)
- PHP_FE(tidy_warning_count, NULL)
- PHP_FE(tidy_access_count, NULL)
- PHP_FE(tidy_config_count, NULL)
- PHP_FE(tidy_load_config, NULL)
- PHP_FE(tidy_load_config_enc, NULL)
- PHP_FE(tidy_set_encoding, NULL)
- PHP_FE(tidy_save_config, NULL)
- {NULL, NULL, NULL}
-};
-
-
-zend_module_entry tidy_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
- STANDARD_MODULE_HEADER,
-#endif
- "tidy",
- tidy_functions,
- PHP_MINIT(tidy),
- PHP_MSHUTDOWN(tidy),
- PHP_RINIT(tidy),
- NULL,
- PHP_MINFO(tidy),
-#if ZEND_MODULE_API_NO >= 20010901
- "1.0",
-#endif
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_TIDY
-ZEND_GET_MODULE(tidy)
-#endif
-
-/* {{{ PHP_INI
- */
-PHP_INI_BEGIN()
-STD_PHP_INI_ENTRY("tidy.default_config", "", PHP_INI_SYSTEM, OnUpdateString, default_config, zend_tidy_globals, tidy_globals)
-PHP_INI_END()
-/* }}} */
-
-static void tidy_globals_ctor(zend_tidy_globals *g TSRMLS_DC)
-{
- g->used = 0;
- g->tdoc = pemalloc(sizeof(PHPTidyDoc), 1);
- g->tdoc->doc = tidyCreate();
- g->tdoc->parsed = 0;
- g->tdoc->errbuf = pemalloc(sizeof(TidyBuffer), 1);
- tidyBufInit(g->tdoc->errbuf);
-
- if(tidySetErrorBuffer(g->tdoc->doc, g->tdoc->errbuf) != 0) {
- zend_error(E_ERROR, "Could not set Tidy error buffer");
- }
-
- tidyOptSetBool(g->tdoc->doc, TidyForceOutput, yes);
- tidyOptSetBool(g->tdoc->doc, TidyMark, no);
-
- /* remember settings so that we can restore them */
- tidyOptSnapshot(g->tdoc->doc);
-}
-
-static void tidy_globals_dtor(zend_tidy_globals *g TSRMLS_DC)
-{
- tidyBufFree(g->tdoc->errbuf);
- pefree(g->tdoc->errbuf, 1);
- tidyRelease(g->tdoc->doc);
- pefree(g->tdoc, 1);
- g->used = 0;
-}
-
-static void *php_tidy_get_opt_val(TidyOption opt, TidyOptionType *type TSRMLS_DC)
-{
- *type = tidyOptGetType(opt);
-
- switch (*type) {
- case TidyString: {
- char *val = (char *) tidyOptGetValue(TG(tdoc)->doc, tidyOptGetId(opt));
- if (val) {
- return (void *) estrdup(val);
- } else {
- return (void *) estrdup("");
- }
- }
- break;
-
- case TidyInteger:
- return (void *) tidyOptGetInt(TG(tdoc)->doc, tidyOptGetId(opt));
- break;
-
- case TidyBoolean:
- return (void *) tidyOptGetBool(TG(tdoc)->doc, tidyOptGetId(opt));
- break;
- }
-
- /* should not happen */
- return NULL;
-}
-
-static int _php_tidy_set_tidy_opt(char *optname, zval *value TSRMLS_DC)
-{
- TidyOption opt;
- zval conv = *value;
-
- if (!(opt = tidyGetOptionByName(TG(tdoc)->doc, optname))) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname);
- return FAILURE;
- }
-
- if (tidyOptIsReadOnly(opt)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Attempting to set read-only option '%s'", optname);
- return FAILURE;
- }
-
- switch(tidyOptGetType(opt)) {
- case TidyString:
- if (Z_TYPE(conv) != IS_STRING) {
- zval_copy_ctor(&conv);
- convert_to_string(&conv);
- }
- if (tidyOptSetValue(TG(tdoc)->doc, tidyOptGetId(opt), Z_STRVAL(conv))) {
- if (Z_TYPE(conv) != Z_TYPE_P(value)) {
- zval_dtor(&conv);
- }
- return SUCCESS;
- }
- if (Z_TYPE(conv) != Z_TYPE_P(value)) {
- zval_dtor(&conv);
- }
- break;
-
- case TidyInteger:
- if (Z_TYPE(conv) != IS_LONG) {
- zval_copy_ctor(&conv);
- convert_to_long(&conv);
- }
- if (tidyOptSetInt(TG(tdoc)->doc, tidyOptGetId(opt), Z_LVAL(conv))) {
- return SUCCESS;
- }
- break;
-
- case TidyBoolean:
- if (Z_TYPE(conv) != IS_LONG) {
- zval_copy_ctor(&conv);
- convert_to_long(&conv);
- }
- if (tidyOptSetBool(TG(tdoc)->doc, tidyOptGetId(opt), Z_LVAL(conv))) {
- return SUCCESS;
- }
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option");
- break;
- }
-
- return FAILURE;
-}
-
-static char *php_tidy_file_to_mem(char *filename, zend_bool use_include_path TSRMLS_DC)
-{
- php_stream *stream;
- int len;
- char *data = NULL;
-
- if (!(stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL))) {
- return NULL;
- }
- if ((len = php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0)) > 0) {
- /* noop */
- } else if (len == 0) {
- data = estrdup("");
- }
- php_stream_close(stream);
-
- return data;
-}
-
-static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file)
-{
- char *data=NULL, *arg1;
- int arg1_len;
- zend_bool use_include_path = 0;
- zval *cfg=NULL;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zb", &arg1, &arg1_len, &cfg, &use_include_path) == FAILURE) {
- RETURN_FALSE;
- }
-
- if (is_file) {
- if (!(data = php_tidy_file_to_mem(arg1, use_include_path TSRMLS_CC))) {
- RETURN_FALSE;
- }
- } else {
- data = arg1;
- }
-
- TIDY_CLEAR_ERROR;
-
- if (cfg) {
- if(Z_TYPE_P(cfg) == IS_ARRAY) {
- char *opt_name = NULL;
- zval **opt_val;
- ulong opt_indx;
-
- for (zend_hash_internal_pointer_reset(HASH_OF(cfg));
- zend_hash_get_current_data(HASH_OF(cfg), (void **)&opt_val) == SUCCESS;
- zend_hash_move_forward(HASH_OF(cfg))) {
-
- if(zend_hash_get_current_key(HASH_OF(cfg), &opt_name, &opt_indx, FALSE) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not retrieve key from option array");
- }
-
- if(opt_name) {
- if (_php_tidy_set_tidy_opt(opt_name, *opt_val TSRMLS_CC) != FAILURE) {
- TG(used) = 1;
- }
- opt_name = NULL;
- }
- }
- } else {
- convert_to_string_ex(&cfg);
- if (Z_STRVAL_P(cfg) && Z_STRVAL_P(cfg)[0]) {
- TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(cfg));
- if(tidyLoadConfig(TG(tdoc)->doc, Z_STRVAL_P(cfg)) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(cfg));
- RETVAL_FALSE;
- }
- TG(used) = 1;
- }
- }
- }
-
- if (data) {
- if(tidyParseString(TG(tdoc)->doc, data) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[Tidy error] %s", TG(tdoc)->errbuf->bp);
- RETVAL_FALSE;
- } else {
- TG(tdoc)->parsed = TRUE;
- if (tidyCleanAndRepair(TG(tdoc)->doc) >= 0) {
- TidyBuffer output = {0};
-
- tidySaveBuffer (TG(tdoc)->doc, &output);
- RETVAL_STRING(output.bp, 1);
- tidyBufFree(&output);
- } else {
- RETVAL_FALSE;
- }
- }
- }
-
- if (is_file) {
- efree(data);
- }
-}
-
-PHP_MINIT_FUNCTION(tidy)
-{
- ZEND_INIT_MODULE_GLOBALS(tidy, tidy_globals_ctor, tidy_globals_dtor);
- REGISTER_INI_ENTRIES();
-
- return SUCCESS;
-}
-
-PHP_MSHUTDOWN_FUNCTION(tidy)
-{
-#ifndef ZTS
- tidy_globals_dtor(&tidy_globals TSRMLS_CC);
-#endif
- return SUCCESS;
-}
-
-PHP_RINIT_FUNCTION(tidy)
-{
- if (TG(used) && tidyOptDiffThanSnapshot((TG(tdoc))->doc)) {
- tidyOptResetToSnapshot((TG(tdoc))->doc);
- TG(used) = 0;
- }
- /* if a user provided a default configuration file, use it */
- if (TG(default_config) && TG(default_config)[0]) {
- if (tidyLoadConfig((TG(tdoc))->doc, TG(default_config)) < 0) {
- zend_error(E_ERROR, "Unable to load Tidy configuration file at '%s'.", TG(default_config));
- }
- TG(used) = 1;
- }
-
- TIDY_CLEAR_ERROR;
-
- return SUCCESS;
-}
-
-PHP_MINFO_FUNCTION(tidy)
-{
- TidyIterator itOpt = tidyGetOptionList(TG(tdoc)->doc);
- void *opt_value;
- TidyOptionType optt;
- char buf[255];
-
- php_info_print_table_start();
- php_info_print_table_header(2, "Tidy support", "enabled");
- php_info_print_table_row(2, "libTidy Build Date", (char *)tidyReleaseDate());
- php_info_print_table_end();
-
- DISPLAY_INI_ENTRIES();
-
- php_info_print_table_start();
- php_info_print_table_header(2, "Tidy Configuration Directive", "Value");
- while (itOpt) {
- TidyOption opt = tidyGetNextOption(TG(tdoc)->doc, &itOpt);
-
- opt_value = php_tidy_get_opt_val(opt, &optt TSRMLS_CC);
- switch (optt) {
- case TidyString:
- php_info_print_table_row(2, (char *)tidyOptGetName(opt), (char*)opt_value);
- efree(opt_value);
- break;
-
- case TidyInteger:
- sprintf(buf, "%d", (int)opt_value);
- php_info_print_table_row(2, (char *)tidyOptGetName(opt), (char*)buf);
- break;
-
- case TidyBoolean:
- php_info_print_table_row(2, (char *)tidyOptGetName(opt), (opt_value ? "TRUE" : "FALSE"));
- break;
- }
- }
- php_info_print_table_end();
-}
-
-/* {{{ proto bool tidy_parse_string(string input)
- Parse a document stored in a string */
-PHP_FUNCTION(tidy_parse_string)
-{
- char *input;
- int input_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &input, &input_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- TIDY_CLEAR_ERROR;
-
- if(tidyParseString(TG(tdoc)->doc, input) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[Tidy error] %s", TG(tdoc)->errbuf->bp);
- RETURN_FALSE;
- }
-
- TG(tdoc)->parsed = TRUE;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto string tidy_get_error_buffer([boolean detailed])
- Return warnings and errors which occured parsing the specified document*/
-PHP_FUNCTION(tidy_get_error_buffer)
-{
- zend_bool detailed = 0;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &detailed) == FAILURE) {
- RETURN_FALSE;
- }
-
- TIDY_PARSED_CHECK();
-
- if (detailed) {
- tidyErrorSummary(TG(tdoc)->doc);
- }
- if (!TG(tdoc)->errbuf || !TG(tdoc)->errbuf->bp) {
- RETURN_FALSE;
- }
- RETVAL_STRING(TG(tdoc)->errbuf->bp, 1);
- tidyBufClear(TG(tdoc)->errbuf);
-}
-/* }}} */
-
-/* {{{ proto string tidy_get_output()
- Return a string representing the parsed tidy markup */
-PHP_FUNCTION(tidy_get_output)
-{
- TidyBuffer output = {0};
-
- if (ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- tidySaveBuffer (TG(tdoc)->doc, &output);
-
- RETVAL_STRING(output.bp, 1);
-
- tidyBufFree(&output);
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_parse_file(string file [, bool use_include_path])
- Parse markup in file or URI */
-PHP_FUNCTION(tidy_parse_file)
-{
- char *inputfile;
- int input_len;
- zend_bool use_include_path = 0;
- char *contents;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &inputfile, &input_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path TSRMLS_CC))) {
- RETURN_FALSE;
- }
-
- TIDY_CLEAR_ERROR;
-
- if(tidyParseString(TG(tdoc)->doc, contents) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[Tidy error] %s", TG(tdoc)->errbuf->bp);
- RETVAL_FALSE;
- } else {
- TG(tdoc)->parsed = TRUE;
- RETVAL_TRUE;
- }
-
- efree(contents);
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_clean_repair()
- Execute configured cleanup and repair operations on parsed markup */
-PHP_FUNCTION(tidy_clean_repair)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- if (tidyCleanAndRepair(TG(tdoc)->doc) >= 0) {
- RETURN_TRUE;
- }
-
- RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_repair_string(string data [, string config_file])
- Repair a string using an optionally provided configuration file */
-PHP_FUNCTION(tidy_repair_string)
-{
- php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_repair_file(string filename [, string config_file [, bool use_include_path]])
- Repair a file using an optionally provided configuration file */
-PHP_FUNCTION(tidy_repair_file)
-{
- php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_diagnose()
- Run configured diagnostics on parsed and repaired markup. */
-PHP_FUNCTION(tidy_diagnose)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- if (tidyRunDiagnostics(TG(tdoc)->doc) >= 0) {
- RETURN_TRUE;
- }
-
- RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto string tidy_get_release()
- Get release date (version) for Tidy library */
-PHP_FUNCTION(tidy_get_release)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- RETURN_STRING((char *)tidyReleaseDate(), 1);
-}
-/* }}} */
-
-/* {{{ proto string tidy_reset_config()
- Restore Tidy configuration to default values */
-PHP_FUNCTION(tidy_reset_config)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- RETURN_BOOL(tidyOptResetToSnapshot(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto array tidy_get_config()
- Get current Tidy configuarion */
-PHP_FUNCTION(tidy_get_config)
-{
- TidyIterator itOpt = tidyGetOptionList(TG(tdoc)->doc);
- char *opt_name;
- void *opt_value;
- TidyOptionType optt;
-
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- array_init(return_value);
-
- while (itOpt) {
- TidyOption opt = tidyGetNextOption(TG(tdoc)->doc, &itOpt);
-
- opt_name = (char *)tidyOptGetName(opt);
- opt_value = php_tidy_get_opt_val(opt, &optt TSRMLS_CC);
- switch (optt) {
- case TidyString:
- add_assoc_string(return_value, opt_name, (char*)opt_value, 0);
- break;
-
- case TidyInteger:
- add_assoc_long(return_value, opt_name, (long)opt_value);
- break;
-
- case TidyBoolean:
- add_assoc_bool(return_value, opt_name, (long)opt_value);
- break;
- }
-
- }
-
- return;
-}
-/* }}} */
-
-
-/* {{{ proto int tidy_get_status()
- Get status of specfied document. */
-PHP_FUNCTION(tidy_get_status)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- RETURN_LONG(tidyStatus(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto int tidy_get_html_ver()
- Get the Detected HTML version for the specified document. */
-PHP_FUNCTION(tidy_get_html_ver)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- RETURN_LONG(tidyDetectedHtmlVersion(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_is_xhtml()
- Indicates if the document is a XHTML document. */
-PHP_FUNCTION(tidy_is_xhtml)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- RETURN_BOOL(tidyDetectedXhtml(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_is_xhtml()
- Indicates if the document is a generic (non HTML/XHTML) XML document. */
-PHP_FUNCTION(tidy_is_xml)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- RETURN_BOOL(tidyDetectedGenericXml(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto int tidy_error_count()
- Returns the Number of Tidy errors encountered for specified document. */
-PHP_FUNCTION(tidy_error_count)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- RETURN_LONG(tidyErrorCount(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto int tidy_warning_count()
- Returns the Number of Tidy warnings encountered for specified document. */
-PHP_FUNCTION(tidy_warning_count)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- RETURN_LONG(tidyWarningCount(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto int tidy_access_count()
- Returns the Number of Tidy accessibility warnings encountered for specified document. */
-PHP_FUNCTION(tidy_access_count)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- RETURN_LONG(tidyAccessWarningCount(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto int tidy_config_count()
- Returns the Number of Tidy configuration errors encountered for specified document. */
-PHP_FUNCTION(tidy_config_count)
-{
- if(ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- TIDY_PARSED_CHECK();
-
- RETURN_LONG(tidyConfigErrorCount(TG(tdoc)->doc));
-}
-/* }}} */
-
-/* {{{ proto void tidy_load_config(string filename)
- Load an ASCII Tidy configuration file */
-PHP_FUNCTION(tidy_load_config)
-{
- char *filename;
- int filename_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- TIDY_SAFE_MODE_CHECK(filename);
-
- if(tidyLoadConfig(TG(tdoc)->doc, filename) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", filename);
- RETURN_FALSE;
- }
-
- TG(used) = 1;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto void tidy_load_config(string filename, string encoding)
- Load an ASCII Tidy configuration file with the specified encoding */
-PHP_FUNCTION(tidy_load_config_enc)
-{
- char *filename, *encoding;
- int enc_len, file_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &filename, &file_len, &encoding, &enc_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- TIDY_SAFE_MODE_CHECK(filename);
-
- if(tidyLoadConfigEnc(TG(tdoc)->doc, filename, encoding) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s' using encoding '%s'", filename, encoding);
- RETURN_FALSE;
- }
-
- TG(used) = 1;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_set_encoding(string encoding)
- Set the input/output character encoding for parsing markup.
- Values include: ascii, latin1, raw, utf8, iso2022, mac, win1252, utf16le,
- utf16be, utf16, big5 and shiftjis. */
-PHP_FUNCTION(tidy_set_encoding)
-{
- char *encoding;
- int enc_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &encoding, &enc_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- if(tidySetCharEncoding(TG(tdoc)->doc, encoding) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", encoding);
- RETURN_FALSE;
- }
-
- TG(used) = 1;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto boolean tidy_save_config(string filename)
- Save current settings to named file. Only non-default values are written. */
-PHP_FUNCTION(tidy_save_config)
-{
- char *filename;
- int file_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &file_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- TIDY_SAFE_MODE_CHECK(filename);
-
- if(tidyOptSaveFile(TG(tdoc)->doc, filename) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not write tidy configuration file '%s'", filename);
- RETURN_FALSE;
- }
-
- RETURN_TRUE;
-}
-/* }}} */
-
-
-/* {{{ proto boolean tidy_setopt(string option, mixed newvalue)
- Updates the configuration settings for the specified tidy document. */
-PHP_FUNCTION(tidy_setopt)
-{
- zval *value;
- char *optname;
- int optname_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &optname, &optname_len, &value) == FAILURE) {
- RETURN_FALSE;
- }
-
- if (_php_tidy_set_tidy_opt(optname, value TSRMLS_CC) == FAILURE) {
- RETURN_FALSE;
- } else {
- TG(used) = 1;
- RETURN_TRUE;
- }
-}
-/* }}} */
-
-/* {{{ proto mixed tidy_getopt(string option)
- Returns the value of the specified configuration option for the tidy document. */
-PHP_FUNCTION(tidy_getopt)
-{
- char *optname;
- void *optval;
- int optname_len;
- TidyOption opt;
- TidyOptionType optt;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- opt = tidyGetOptionByName(TG(tdoc)->doc, optname);
- if (!opt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
- RETURN_FALSE;
- }
-
- optval = php_tidy_get_opt_val(opt, &optt TSRMLS_CC);
- switch (optt) {
- case TidyString:
- RETVAL_STRING((char *)optval, 0);
- break;
-
- case TidyInteger:
- RETURN_LONG((long)optval);
- break;
-
- case TidyBoolean:
- if (optval) {
- RETURN_TRUE;
- } else {
- RETURN_NULL();
- }
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of Tidy configuration constant to get");
- break;
- }
-
- RETURN_FALSE;
-}
-/* }}} */
diff --git a/ext/tidy/tidy.dsp b/ext/tidy/tidy.dsp
deleted file mode 100755
index 75e33ec8cf..0000000000
--- a/ext/tidy/tidy.dsp
+++ /dev/null
@@ -1,108 +0,0 @@
-# Microsoft Developer Studio Project File - Name="tidy" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=tidy - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tidy.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tidy.mak" CFG="tidy - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tidy - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "tidy - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tidy - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php4ts.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tidy.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
-
-!ELSEIF "$(CFG)" == "tidy - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php4ts_debug.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tidy.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "tidy - Win32 Release_TS"
-# Name "tidy - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\tidy.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_tidy.h
-# End Source File
-# End Group
-# End Target
-# End Project