Permalink
Browse files

This commit was manufactured by cvs2svn to create tag

'BEFORE_NEW_OUTPUT_API'.
  • Loading branch information...
1 parent 653007c commit 5b1558c01fa9c4c1ba4c918a51a59f2e670e954c SVN Migration committed Jun 2, 2006
Showing with 0 additions and 16,945 deletions.
  1. +0 −2 ext/enchant/CREDITS
  2. +0 −36 ext/enchant/config.m4
  3. +0 −13 ext/enchant/config.w32
  4. +0 −25 ext/enchant/docs/examples/example1.php
  5. +0 −776 ext/enchant/enchant.c
  6. +0 −148 ext/enchant/package.xml
  7. +0 −81 ext/enchant/php_enchant.h
  8. +0 −28 ext/enchant/tests/broker_describe.phpt
  9. +0 −21 ext/enchant/tests/broker_free.phpt
  10. +0 −15 ext/enchant/tests/broker_init.phpt
  11. +0 −31 ext/enchant/tests/broker_request_dict.phpt
  12. +0 −1 ext/enchant/tests/hindi_correct.txt
  13. +0 −1 ext/enchant/tests/hindi_incorrect.txt
  14. +0 −2 ext/fileinfo/CREDITS
  15. 0 ext/fileinfo/EXPERIMENTAL
  16. +0 −62 ext/fileinfo/config.m4
  17. +0 −13 ext/fileinfo/config.w32
  18. +0 −437 ext/fileinfo/fileinfo.c
  19. +0 −29 ext/fileinfo/fileinfo.php
  20. +0 −43 ext/fileinfo/package.xml
  21. +0 −61 ext/fileinfo/php_fileinfo.h
  22. +0 −2 ext/filter/CREDITS
  23. +0 −68 ext/filter/callback_filter.c
  24. +0 −95 ext/filter/config.m4
  25. +0 −8 ext/filter/config.w32
  26. +0 −331 ext/filter/docs/filter.txt
  27. +0 −41 ext/filter/docs/input_get_args.php
  28. +0 −867 ext/filter/filter.c
  29. +0 −90 ext/filter/filter_private.h
  30. +0 −98 ext/filter/package.xml
  31. +0 −127 ext/filter/package2.xml
  32. +0 −106 ext/filter/php_filter.h
  33. +0 −340 ext/filter/sanitizing_filters.c
  34. +0 −8 ext/filter/tests/001.phpt
  35. +0 −11 ext/filter/tests/002.phpt
  36. +0 −22 ext/filter/tests/003.phpt
  37. +0 −24 ext/filter/tests/004.phpt
  38. +0 −21 ext/filter/tests/005.phpt
  39. +0 −10 ext/filter/tests/006.phpt
  40. +0 −68 ext/filter/tests/007.phpt
  41. +0 −88 ext/filter/tests/008.phpt
  42. +0 −30 ext/filter/tests/009.phpt
  43. +0 −60 ext/filter/tests/010.phpt
  44. +0 −49 ext/filter/tests/011.phpt
  45. +0 −16 ext/filter/tests/012.phpt
  46. +0 −72 ext/filter/tests/013.phpt
  47. +0 −41 ext/filter/tests/014.phpt
  48. +0 −72 ext/filter/tests/015.phpt
  49. +0 −32 ext/filter/tests/016.phpt
  50. +0 −24 ext/filter/tests/017.phpt
  51. +0 −50 ext/filter/tests/018.phpt
  52. +0 −20 ext/filter/tests/019.phpt
  53. +0 −18 ext/filter/tests/020.phpt
  54. +0 −44 ext/filter/tests/021.phpt
  55. +0 −20 ext/filter/tests/022.phpt
  56. +0 −20 ext/filter/tests/023.phpt
  57. +0 −18 ext/filter/tests/024.phpt
  58. +0 −24 ext/filter/tests/025.phpt
  59. +0 −30 ext/filter/tests/026.phpt
  60. +0 −30 ext/filter/tests/027.phpt
  61. +0 −35 ext/filter/tests/028.phpt
  62. +0 −103 ext/filter/tests/029.phpt
  63. +0 −35 ext/filter/tests/030.phpt
  64. +0 −54 ext/filter/tests/031.phpt
  65. +0 −55 ext/filter/tests/032.phpt
  66. +0 −25 ext/filter/tests/033.phpt
  67. +0 −23 ext/filter/tests/033_run.php
  68. +0 −53 ext/filter/tests/bug7586.phpt
  69. +0 −27 ext/filter/tests/bug7715.phpt
  70. +0 −27 ext/filter/tests/bug7733.phpt
  71. +0 −71 ext/filter/tests/filter_data.phpt
  72. +0 −103 ext/imap/imap.h
  73. +0 −757 ext/json/JSON_parser.c
  74. +0 −8 ext/json/JSON_parser.h
  75. +0 −76 ext/json/README
  76. +0 −88 ext/json/config.m4
  77. +0 −10 ext/json/config.w32
  78. +0 −449 ext/json/json.c
  79. +0 −135 ext/json/json.dsp
  80. +0 −152 ext/json/package.xml
  81. +0 −60 ext/json/php_json.h
  82. +0 −166 ext/json/tests/fail001.phpt
  83. +0 −895 ext/json/tests/pass001.1.phpt
  84. +0 −709 ext/json/tests/pass001.phpt
  85. +0 −276 ext/json/tests/pass002.phpt
  86. +0 −95 ext/json/tests/pass003.phpt
  87. +0 −179 ext/json/utf8_decode.c
  88. +0 −18 ext/json/utf8_decode.h
  89. +0 −56 ext/json/utf8_to_utf16.c
  90. +0 −3 ext/json/utf8_to_utf16.h
  91. +0 −2 ext/phar/CREDITS
  92. +0 −7 ext/phar/EXPERIMENTAL
  93. +0 −68 ext/phar/LICENSE
  94. +0 −12 ext/phar/config.m4
  95. +0 −11 ext/phar/config.w32
  96. +0 −88 ext/phar/package.xml
  97. +0 −1,922 ext/phar/phar.c
  98. +0 −21 ext/phar/phar.php
  99. +0 −64 ext/phar/php_phar.h
  100. +0 −12 ext/phar/tests/001.phpt
  101. +0 −21 ext/phar/tests/002.phpt
  102. +0 −13 ext/phar/tests/003.phpt
  103. +0 −10 ext/phar/tests/004.phpt
  104. +0 −10 ext/phar/tests/005.phpt
  105. +0 −10 ext/phar/tests/006.phpt
  106. +0 −10 ext/phar/tests/007.phpt
  107. +0 −17 ext/phar/tests/008.phpt
  108. +0 −17 ext/phar/tests/009.phpt
  109. +0 −23 ext/phar/tests/010.phpt
  110. +0 −35 ext/phar/tests/011.phpt
  111. +0 −33 ext/phar/tests/012.phpt
  112. +0 −34 ext/phar/tests/013.phpt
  113. +0 −34 ext/phar/tests/014.phpt
  114. +0 −34 ext/phar/tests/015.phpt
  115. +0 −33 ext/phar/tests/015b.phpt
  116. +0 −51 ext/phar/tests/016.phpt
  117. +0 −35 ext/phar/tests/016b.phpt
  118. +0 −34 ext/phar/tests/017.phpt
  119. +0 −41 ext/phar/tests/018.phpt
  120. +0 −43 ext/phar/tests/019.phpt
  121. +0 −74 ext/phar/tests/019b.phpt
  122. +0 −82 ext/phar/tests/019c.phpt
  123. +0 −143 ext/phar/tests/020.phpt
  124. +0 −91 ext/phar/tests/021.phpt
  125. +0 −116 ext/phar/tests/022.phpt
  126. +0 −40 ext/phar/tests/023.phpt
  127. +0 −40 ext/phar/tests/024.phpt
  128. +0 −40 ext/phar/tests/025.phpt
  129. +0 −45 ext/phar/tests/026.phpt
  130. +0 −73 ext/phar/tests/027.phpt
  131. +0 −57 ext/phar/tests/028.phpt
  132. +0 −50 ext/phar/tests/029.phpt
  133. +0 −49 ext/phar/tests/030.phpt
  134. +0 −29 ext/phar/tests/031.phpt
  135. +0 −42 ext/phar/tests/phar_oo_001.phpt
  136. +0 −133 ext/phar/tests/phar_oo_002.phpt
  137. +0 −42 ext/phar/tests/phar_oo_003.phpt
  138. +0 −123 ext/phar/tests/phar_oo_004.phpt
  139. +0 −56 ext/phar/tests/phar_oo_005.phpt
  140. +0 −49 ext/phar/tests/phar_oo_006.phpt
  141. +0 −84 ext/phar/tests/phar_oo_007.phpt
  142. +0 −94 ext/phar/tests/phar_oo_008.phpt
  143. +0 −54 ext/phar/tests/phar_oo_009.phpt
  144. +0 −52 ext/phar/tests/phar_oo_010.phpt
  145. +0 −61 ext/phar/tests/phar_oo_test.inc
  146. +0 −285 main/php_realpath.c
  147. +0 −3 sapi/litespeed/Makefile.frag
  148. +0 −118 sapi/litespeed/README
  149. +0 −36 sapi/litespeed/config.m4
  150. +0 −781 sapi/litespeed/lsapi_main.c
  151. +0 −181 sapi/litespeed/lsapidef.h
  152. +0 −1,127 sapi/litespeed/lsapilib.c
  153. +0 −287 sapi/litespeed/lsapilib.h
View
2 ext/enchant/CREDITS
@@ -1,2 +0,0 @@
-enchant
-Pierre-Alain Joye, Ilia Alshanetsky
View
36 ext/enchant/config.m4
@@ -1,36 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-PHP_ARG_WITH(enchant,for ENCHANT support,
-[ --with-enchant[=DIR] Include enchant support.
- GNU Aspell version 1.1.3 or higher required.])
-
-if test "$PHP_ENCHANT" != "no"; then
- PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
- if test "$PHP_ENCHANT" != "yes"; then
- ENCHANT_SEARCH_DIRS=$PHP_ENCHANT
- else
- ENCHANT_SEARCH_DIRS="/usr/local /usr"
- fi
- for i in $ENCHANT_SEARCH_DIRS; do
- if test -f $i/include/enchant/enchant.h; then
- ENCHANT_DIR=$i
- ENCHANT_INCDIR=$i/include/enchant
- elif test -f $i/include/enchant.h; then
- ENCHANT_DIR=$i
- ENCHANT_INCDIR=$i/include
- fi
- done
-
- if test -z "$ENCHANT_DIR"; then
- AC_MSG_ERROR(Cannot find enchant)
- fi
-
- ENCHANT_LIBDIR=$ENCHANT_DIR/lib
-
- AC_DEFINE(HAVE_ENCHANT,1,[ ])
- PHP_SUBST(ENCHANT_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD)
- PHP_ADD_INCLUDE($ENCHANT_INCDIR)
-fi
View
13 ext/enchant/config.w32
@@ -1,13 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-ARG_ENABLE("enchant", "Enchant Support", "no");
-
-if (PHP_ENCHANT == "yes") {
- if (CHECK_HEADER_ADD_INCLUDE("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT)) {
- EXTENSION("enchant", "enchant.c");
- AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
- } else {
- WARNING('Could not find enchant.h; skipping');
- }
-}
View
25 ext/enchant/docs/examples/example1.php
@@ -1,25 +0,0 @@
-<?php
-$tag = 'en_US';
-$r = enchant_broker_init();
-$bprovides = enchant_broker_describe($r);
-echo "Current broker provides the following backend(s):\n";
-print_r($bprovides);
-
-
-if (enchant_broker_dict_exists($r,$tag)) {
- $d = enchant_broker_request_dict($r, $tag);
- $dprovides = enchant_dict_describe($d);
- echo "dictionary $tag provides:\n";
- $spellerrors = enchant_dict_check($d, "soong");
- print_r($dprovides);
- echo "found $spellerrors spell errors\n";
- if ($spellerrors) {
- $suggs = enchant_dict_suggest($d, "soong");
- echo "Suggestions for 'soong':";
- print_r($suggs);
- }
- enchant_broker_free_dict($d);
-} else {
-}
-enchant_broker_free($r);
-?>
View
776 ext/enchant/enchant.c
@@ -1,776 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 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 at through the world-wide-web at |
- | 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: Pierre-Alain Joye <paj@pearfr.org> |
- | Ilia Alshanetsky <ilia@prohost.org> |
- +----------------------------------------------------------------------+
-
- $Id$
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include "enchant.h"
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_enchant.h"
-
-
-typedef EnchantBroker * EnchantBrokerPtr;
-typedef struct _broker_struct enchant_broker;
-typedef struct _dict_struct enchant_dict;
-
-typedef enchant_broker * enchant_brokerPtr;
-typedef enchant_dict * enchant_dictPtr;
-
-typedef struct _broker_struct {
- EnchantBroker *pbroker;
- enchant_dict **dict;
- unsigned int dictcnt;
- zval *rsrc_id;
-} _enchant_broker;
-
-typedef struct _dict_struct {
- unsigned int id;
- EnchantDict *pdict;
- enchant_broker *pbroker;
- zval *rsrc_id;
- enchant_dict *next;
- enchant_dict *prev;
-} _enchant_dict;
-
-
-/* True global resources - no need for thread safety here */
-static int le_enchant_broker;
-static int le_enchant_dict;
-
-/* If you declare any globals in php_enchant.h uncomment this:*/
-/*ZEND_DECLARE_MODULE_GLOBALS(enchant)*/
-
-/* {{{ enchant_functions[]
- *
- * Every user visible function must have an entry in enchant_functions[].
- */
-function_entry enchant_functions[] = {
- PHP_FE(enchant_broker_init, NULL)
- PHP_FE(enchant_broker_free, NULL)
- PHP_FE(enchant_broker_get_error, NULL)
- PHP_FE(enchant_broker_list_dicts, NULL)
- PHP_FE(enchant_broker_request_dict, NULL)
- PHP_FE(enchant_broker_request_pwl_dict, NULL)
- PHP_FE(enchant_broker_free_dict, NULL)
- PHP_FE(enchant_broker_dict_exists, NULL)
- PHP_FE(enchant_broker_set_ordering, NULL)
- PHP_FE(enchant_broker_describe, NULL)
- PHP_FE(enchant_dict_check, NULL)
- PHP_FE(enchant_dict_suggest, NULL)
- PHP_FE(enchant_dict_add_to_personal, NULL)
- PHP_FE(enchant_dict_add_to_session, NULL)
- PHP_FE(enchant_dict_is_in_session, NULL)
- PHP_FE(enchant_dict_store_replacement, NULL)
- PHP_FE(enchant_dict_get_error, NULL)
- PHP_FE(enchant_dict_describe, NULL)
- PHP_FE(enchant_dict_quick_check, third_arg_force_ref)
-
- {NULL, NULL, NULL} /* Must be the last line in enchant_functions[] */
-};
-/* }}} */
-
-/* {{{ enchant_module_entry
- */
-zend_module_entry enchant_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
- STANDARD_MODULE_HEADER,
-#endif
- "enchant",
- enchant_functions,
- PHP_MINIT(enchant),
- PHP_MSHUTDOWN(enchant),
- NULL, /* Replace with NULL if there's nothing to do at request start */
- NULL, /* Replace with NULL if there's nothing to do at request end */
- PHP_MINFO(enchant),
-#if ZEND_MODULE_API_NO >= 20010901
- "0.1", /* Replace with version number for your extension */
-#endif
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-#ifdef COMPILE_DL_ENCHANT
-ZEND_GET_MODULE(enchant)
-#endif
-
-static void
-enumerate_providers_fn (const char * const name,
- const char * const desc,
- const char * const file,
- void * ud) /* {{{ */
-{
- zval *zdesc = (zval *) ud;
- zval *tmp_array;
-
- MAKE_STD_ZVAL(tmp_array);
- array_init(tmp_array);
-
- add_assoc_string(tmp_array, "name", (char *)name, 1);
- add_assoc_string(tmp_array, "desc", (char *)desc, 1);
- add_assoc_string(tmp_array, "file", (char *)file, 1);
-
- if (Z_TYPE_P(zdesc)!=IS_ARRAY) {
- array_init(zdesc);
- }
-
- add_next_index_zval(zdesc, tmp_array);
-}
-/* }}} */
-
-static void
-describe_dict_fn (const char * const lang,
- const char * const name,
- const char * const desc,
- const char * const file,
- void * ud) /* {{{ */
-{
- zval *zdesc = (zval *) ud;
- array_init(zdesc);
- add_assoc_string(zdesc, "lang", (char *)lang, 1);
- add_assoc_string(zdesc, "name", (char *)name, 1);
- add_assoc_string(zdesc, "desc", (char *)desc, 1);
- add_assoc_string(zdesc, "file", (char *)file, 1);
-}
-/* }}} */
-
-static void php_enchant_list_dicts_fn( const char * const lang_tag,
- const char * const provider_name, const char * const provider_desc,
- const char * const provider_file, void * ud) /* {{{ */
-{
- zval *zdesc = (zval *) ud;
- zval *tmp_array;
-
- MAKE_STD_ZVAL(tmp_array);
- array_init(tmp_array);
- add_assoc_string(tmp_array, "lang_tag", (char *)lang_tag, 1);
- add_assoc_string(tmp_array, "provider_name", (char *)provider_name, 1);
- add_assoc_string(tmp_array, "provider_desc", (char *)provider_desc, 1);
- add_assoc_string(tmp_array, "provider_file", (char *)provider_file, 1);
-
- if (Z_TYPE_P(zdesc) != IS_ARRAY) {
- array_init(zdesc);
- }
- add_next_index_zval(zdesc, tmp_array);
-
-}
-/* }}} */
-
-static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
-{
- if (rsrc->ptr) {
- enchant_broker *broker = (enchant_broker *)rsrc->ptr;
- if (broker) {
- if (broker->pbroker) {
- if (broker->dictcnt && broker->dict) {
- if (broker->dict) {
- int total, tofree;
- tofree = total = broker->dictcnt-1;
- do {
- zend_list_delete(Z_RESVAL_P(broker->dict[total]->rsrc_id));
- efree(broker->dict[total]);
- total--;
- } while (total>=0);
- }
- efree(broker->dict);
- broker->dict = NULL;
- }
- enchant_broker_free(broker->pbroker);
- }
- efree(broker);
- }
- }
-}
-/* }}} */
-
-static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
-
-{
- if (rsrc->ptr) {
- enchant_dict *pdict = (enchant_dict *)rsrc->ptr;
- if (pdict) {
- if (pdict->pdict && pdict->pbroker) {
- enchant_broker_free_dict(pdict->pbroker->pbroker, pdict->pdict);
- }
- if (pdict->id) {
- pdict->pbroker->dict[pdict->id-1]->next = NULL;
- }
- }
- }
-}
-/* }}} */
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(enchant)
-{
- le_enchant_broker = zend_register_list_destructors_ex(php_enchant_broker_free, NULL, "enchant broker", module_number);
- le_enchant_dict = zend_register_list_destructors_ex(php_enchant_dict_free, NULL, "enchant dict", module_number);
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(enchant)
-{
- return SUCCESS;
-}
-/* }}} */
-
-static void __enumerate_providers_fn (const char * const name,
- const char * const desc,
- const char * const file,
- void * ud) /* {{{ */
-{
- php_info_print_table_row(3, name, desc, file);
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(enchant)
-{
- EnchantBroker *pbroker;
-
- pbroker = enchant_broker_init();
- php_info_print_table_start();
- php_info_print_table_header(2, "enchant support", "enabled");
- php_info_print_table_row(2, "Version", "@package_version@");
- php_info_print_table_row(2, "Revision", "$Revision$");
- php_info_print_table_end();
-
- php_info_print_table_start();
- enchant_broker_describe(pbroker, __enumerate_providers_fn, NULL);
- php_info_print_table_end();
- enchant_broker_free(pbroker);
-}
-/* }}} */
-
-#define PHP_ENCHANT_GET_BROKER \
- ZEND_FETCH_RESOURCE(pbroker, enchant_broker *, &broker, -1, "enchant_broker", le_enchant_broker); \
- if (!pbroker || !pbroker->pbroker) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Resource broker invalid"); \
- RETURN_FALSE; \
- }
-
-#define PHP_ENCHANT_GET_DICT \
- ZEND_FETCH_RESOURCE(pdict, enchant_dict *, &dict, -1, "enchant dict", le_enchant_dict); \
- if (!pdict || !pdict->pdict) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Invalid dictionary resource."); \
- RETURN_FALSE; \
- }
-
-/* {{{ proto resource enchant_broker_init()
- create a new broker object capable of requesting */
-PHP_FUNCTION(enchant_broker_init)
-{
- enchant_broker *broker;
- EnchantBroker *pbroker;
-
- if (ZEND_NUM_ARGS()) {
- ZEND_WRONG_PARAM_COUNT();
- }
-
- pbroker = enchant_broker_init();
-
- if (pbroker) {
- broker = (enchant_broker *) emalloc(sizeof(enchant_broker));
- broker->pbroker = pbroker;
- broker->dict = NULL;
- broker->dictcnt = 0;
- ZEND_REGISTER_RESOURCE(return_value, broker, le_enchant_broker);
- broker->rsrc_id = return_value;
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-
-/* {{{ proto boolean enchant_broker_free(resource broker)
- Destroys the broker object and its dictionnaries */
-PHP_FUNCTION(enchant_broker_free)
-{
- zval *broker;
- enchant_broker *pbroker;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
- RETURN_FALSE;
- }
- PHP_ENCHANT_GET_BROKER;
-
- zend_list_delete(Z_RESVAL_P(broker));
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto string enchant_broker_get_error(resource broker)
- Returns the last error of the broker */
-PHP_FUNCTION(enchant_broker_get_error)
-{
- zval *broker;
- enchant_broker *pbroker;
- char *msg;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_BROKER;
-
- msg = enchant_broker_get_error(pbroker->pbroker);
- if (msg) {
- RETURN_STRING((char *)msg, 1);
- }
- RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto string enchant_broker_list_dicts(resource broker)
- Returns the last error of the broker */
-PHP_FUNCTION(enchant_broker_list_dicts)
-{
- zval *broker;
- enchant_broker *pbroker;
- EnchantDictDescribeFn describetozval = php_enchant_list_dicts_fn;
-
- char *msg;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_BROKER;
-
- enchant_broker_list_dicts(pbroker->pbroker, php_enchant_list_dicts_fn, (void *)return_value);
-}
-/* }}} */
-
-/* {{{ proto resource enchant_broker_request_dict(resource broker, string tag)
- create a new dictionary using tag, the non-empty language tag you wish to request
- a dictionary for ("en_US", "de_DE", ...) */
-PHP_FUNCTION(enchant_broker_request_dict)
-{
- zval *broker;
- enchant_broker *pbroker;
- enchant_dict *dict;
- EnchantDict *d;
- char *tag;
- int taglen;
- int pos;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_BROKER;
-
- d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
- if (d) {
- if (pbroker->dictcnt) {
- pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
- pos = pbroker->dictcnt++;
- } else {
- pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
- pos = 0;
- pbroker->dictcnt++;
- }
-
- dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
- dict->id = pos;
- dict->pbroker = pbroker;
- dict->pdict = d;
- dict->rsrc_id = return_value;
- dict->prev = pos ? pbroker->dict[pos-1] : NULL;
- dict->next = NULL;
- pbroker->dict[pos] = dict;
-
- if (pos) {
- pbroker->dict[pos-1]->next = dict;
- }
-
- ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict);
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-
-/* {{{ proto resource enchant_broker_request_pwl_dict(resource dict, string filename)
- creates a dictionary using a PWL file. A PWL file is personal word file one word per line.
- It must exist before the call.*/
-PHP_FUNCTION(enchant_broker_request_pwl_dict)
-{
- zval *broker;
- enchant_broker *pbroker;
- enchant_dict *dict;
- EnchantDict *d;
- char *pwl;
- int pwllen;
- int pos;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &pwl, &pwllen) == FAILURE) {
- RETURN_FALSE;
- }
-
- if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_BROKER;
-
- d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
- if (d) {
- if (pbroker->dictcnt) {
- pos = pbroker->dictcnt++;
- pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
- } else {
- pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
- pos = 0;
- pbroker->dictcnt++;
- }
- dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
- dict->id = pos;
- dict->pbroker = pbroker;
- dict->pdict = d;
- dict->rsrc_id = return_value;
- dict->prev = pos?pbroker->dict[pos-1]:NULL;
- dict->next = NULL;
- pbroker->dict[pos] = dict;
- if (pos) {
- pbroker->dict[pos-1]->next = dict;
- }
- ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict);
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-
-/* {{{ proto resource enchant_broker_free_dict(resource dict)
- Free the dictionary resource */
-PHP_FUNCTION(enchant_broker_free_dict)
-{
- zval *dict;
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- zend_list_delete(Z_RESVAL_P(dict));
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag)
- Wether a dictionary exists or not. Using non-empty tag */
-PHP_FUNCTION(enchant_broker_dict_exists)
-{
- zval *broker;
- char *tag;
- int taglen;
- enchant_broker * pbroker;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_BROKER;
-
- RETURN_BOOL(enchant_broker_dict_exists(pbroker->pbroker, tag));
-}
-/* }}} */
-
-/* {{{ proto bool enchant_broker_set_ordering(resource broker, string tag, string ordering)
- Declares a preference of dictionaries to use for the language
- described/referred to by 'tag'. The ordering is a comma delimited
- list of provider names. As a special exception, the "*" tag can
- be used as a language tag to declare a default ordering for any
- language that does not explictly declare an ordering. */
-
-PHP_FUNCTION(enchant_broker_set_ordering)
-{
- zval *broker;
- char *pordering;
- int porderinglen;
- char *ptag;
- int ptaglen;
- enchant_broker * pbroker;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_BROKER;
-
- enchant_broker_set_ordering(pbroker->pbroker, ptag, pordering);
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto array enchant_broker_describe(resource broker)
- Enumerates the Enchant providers and tells
- you some rudimentary information about them. The same info is provided through phpinfo() */
-PHP_FUNCTION(enchant_broker_describe)
-{
- EnchantBrokerDescribeFn describetozval = enumerate_providers_fn;
- zval *broker;
- enchant_broker * pbroker;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_BROKER;
-
- enchant_broker_describe(pbroker->pbroker, describetozval, (void *)return_value);
-}
-/* }}} */
-
-/* {{{ proto bool enchant_dict_quick_check(resource dict, string word [, array &suggestions])
- If the word is correctly spelled return true, otherwise return false, if suggestions variable
- is provided, fill it with spelling alternatives. */
-PHP_FUNCTION(enchant_dict_quick_check)
-{
- zval *dict, *sugg = NULL;
- char *word;
- int wordlen;
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
- RETURN_FALSE;
- }
-
- if (sugg) {
- zval_dtor(sugg);
- }
-
- PHP_ENCHANT_GET_DICT;
-
- if (enchant_dict_check(pdict->pdict, word, wordlen) > 0) {
- if (!sugg && ZEND_NUM_ARGS() == 2) {
- RETURN_FALSE;
- }
-
- int n_sugg;
- char **suggs;
-
- array_init(sugg);
-
- suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, (size_t *) &n_sugg);
- if (suggs && n_sugg) {
- int i;
- for (i = 0; i < n_sugg; i++) {
- add_next_index_string(sugg, suggs[i], 1);
- }
- enchant_dict_free_suggestions(pdict->pdict, suggs);
- }
-
-
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool enchant_dict_check(resource dict, string word)
- If the word is correctly spelled return true, otherwise return false */
-PHP_FUNCTION(enchant_dict_check)
-{
- zval *dict;
- char *word;
- int wordlen;
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- RETURN_BOOL(!enchant_dict_check(pdict->pdict, word, wordlen));
-}
-/* }}} */
-
-/* {{{ proto array enchant_dict_suggest(resource dict, string word)
- Will return a list of values if any of those pre-conditions are not met.*/
-PHP_FUNCTION(enchant_dict_suggest)
-{
- zval *dict;
- char *word;
- int wordlen;
- char **suggs;
- enchant_dict *pdict;
- int n_sugg;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, (size_t *)&n_sugg);
- if (suggs && n_sugg) {
- int i;
-
- array_init(return_value);
- for (i = 0; i < n_sugg; i++) {
- add_next_index_string(return_value, suggs[i], 1);
- }
-
- enchant_dict_free_suggestions(pdict->pdict, suggs);
- }
-}
-/* }}} */
-
-/* {{{ proto void enchant_dict_add_to_personal(resource dict, string word)
- add 'word' to personal word list */
-PHP_FUNCTION(enchant_dict_add_to_personal)
-{
- zval *dict;
- char *word;
- int wordlen;
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-}
-/* }}} */
-
-/* {{{ proto void enchant_dict_add_to_session(resource dict, string word)
- add 'word' to this spell-checking session */
-PHP_FUNCTION(enchant_dict_add_to_session)
-{
- zval *dict;
- char *word;
- int wordlen;
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- enchant_dict_add_to_session(pdict->pdict, word, wordlen);
-}
-/* }}} */
-
-/* {{{ proto bool enchant_dict_is_in_session(resource dict, string word)
- whether or not 'word' exists in this spelling-session */
-PHP_FUNCTION(enchant_dict_is_in_session)
-{
- zval *dict;
- char *word;
- int wordlen;
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-}
-/* }}} */
-
-/* {{{ proto void enchant_dict_store_replacement(resource dict, string mis, string cor)
- add a correction for 'mis' using 'cor'.
- Notes that you replaced @mis with @cor, so it's possibly more likely
- that future occurrences of @mis will be replaced with @cor. So it might
- bump @cor up in the suggestion list.*/
-PHP_FUNCTION(enchant_dict_store_replacement)
-{
- zval *dict;
- char *mis, *cor;
- int mislen, corlen;
-
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- enchant_dict_store_replacement(pdict->pdict, mis, mislen, cor, corlen);
-}
-/* }}} */
-
-/* {{{ proto string enchant_dict_get_error(resource dict)
- Returns the last error of the current spelling-session */
-PHP_FUNCTION(enchant_dict_get_error)
-{
- zval *dict;
- enchant_dict *pdict;
- char *msg;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- msg = enchant_dict_get_error(pdict->pdict);
- if (msg) {
- RETURN_STRING((char *)msg, 1);
- }
-
- RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto array enchant_dict_describe(resource dict)
- Describes an individual dictionary 'dict' */
-PHP_FUNCTION(enchant_dict_describe)
-{
- zval *dict;
- enchant_dict *pdict;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
- RETURN_FALSE;
- }
-
- PHP_ENCHANT_GET_DICT;
-
- enchant_dict_describe(pdict->pdict, describe_dict_fn, (void *)return_value);
-}
-/* }}} */
-
-/*
- * 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
- */
View
148 ext/enchant/package.xml
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.4.8" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>enchant</name>
- <channel>pecl.php.net</channel>
- <summary>libenchant binder, support near all spelling tools</summary>
- <description>Enchant is a binder for libenchant. Libenchant provides a common
-API for many spell libraries:
-- aspell/pspell (intended to replace ispell)
-- hspell (hebrew)
-- ispell
-- myspell/hunspell (OpenOffice project, mozilla)
-- uspell (primarily Yiddish, Hebrew, and Eastern European languages)
-A plugin system allows to add custom spell support.
-see www.abisource.com/enchant/
- </description>
- <lead>
- <name>Pierre-Alain Joye</name>
- <user>pajoye</user>
- <email>paj@pearfr.org</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Ilia Alshanetsky</name>
- <user>iliaa</user>
- <email>ilia@php.net</email>
- <active>yes</active>
- </lead>
- <date>2006-03-21</date>
- <version>
- <release>1.0.1</release>
- <api>1.1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- add enchant_broker_list_dicts to get a list of available dictionaries
-- fix compilation warnings
-- add examples
-- add tests</notes>
- <contents>
- <dir name="/">
- <dir name="docs">
- <dir name="examples">
- <file name="example1.php" role="doc"/>
- </dir>
-<!-- //docs/examples -->
- </dir>
-<!-- //docs -->
- <file name="config.m4" role="src"/>
- <file name="config.w32" role="src"/>
- <file name="CREDITS" role="doc"/>
- <file name="enchant.c" role="src">
- <tasks:replace from="@package_version@" to="version" type="package-info"/>
- </file>
- <file name="php_enchant.h" role="src"/>
- <dir name="tests">
- <file name="broker_describe.phpt" role="test"/>
- <file name="broker_free.phpt" role="test"/>
- <file name="broker_init.phpt" role="test"/>
- <file name="broker_request_dict.phpt" role="test"/>
- <file name="hindi_correct.txt" role="test"/>
- <file name="hindi_incorrect.txt" role="test"/>
- </dir>
- </dir>
-<!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5</min>
- </php>
- <pearinstaller>
- <min>1.4.0b1</min>
- </pearinstaller>
- </required>
- </dependencies>
- <providesextension>enchant</providesextension>
- <extsrcrelease>
- <configureoption default="shared" name="with-enchant" prompt="libenchant prefix?"/>
- </extsrcrelease>
- <changelog>
- <release>
- <date>2004-08-11</date>
- <version>
- <release>1.0</release>
- <api>1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- Fixed leak inside MINFO function.
-- Fixed crash inside enchant_dict_suggest() when there are no suggestions.
-- Added missing safe_mode/open_basedir check inside enchant_broker_request_pwl_dict().
-- Fixed various function prototypes.
-- Fixed possible leak in suggestions result.
- </notes>
- </release>
- <release>
- <version>
- <release>0.2.1</release>
- <api>0.2.1</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2004-03-11</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- Fix possible leak in suggestions result
-- Move to beta status
- </notes>
- </release>
- <release>
- <version>
- <release>0.2.0</release>
- <api>0.2.0</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2006-03-21</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- Add Ilia Alshanetsky as maintainer
-- Cleanup sources codes (ilia)
-- Add enchant_dict_quick_check (ilia)
- </notes>
- </release>
- <release>
- <version>
- <release>0.1</release>
- <api>0.1</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2003-03-08</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>Initial release
- </notes>
- </release>
- </changelog>
-</package>
View
81 ext/enchant/php_enchant.h
@@ -1,81 +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 at through the world-wide-web at |
- | 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: Pierre-Alain Joye <paj@pearfr.org> |
- +----------------------------------------------------------------------+
-
- $Id$
-*/
-
-#ifndef PHP_ENCHANT_H
-#define PHP_ENCHANT_H
-
-extern zend_module_entry enchant_module_entry;
-#define phpext_enchant_ptr &enchant_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_ENCHANT_API __declspec(dllexport)
-#else
-#define PHP_ENCHANT_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
-static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
-
-PHP_MINIT_FUNCTION(enchant);
-PHP_MSHUTDOWN_FUNCTION(enchant);
-PHP_MINFO_FUNCTION(enchant);
-
-PHP_FUNCTION(enchant_broker_init);
-PHP_FUNCTION(enchant_broker_free);
-PHP_FUNCTION(enchant_broker_get_error);
-PHP_FUNCTION(enchant_broker_list_dicts);
-PHP_FUNCTION(enchant_broker_request_dict);
-PHP_FUNCTION(enchant_broker_request_pwl_dict);
-PHP_FUNCTION(enchant_broker_free_dict);
-PHP_FUNCTION(enchant_broker_dict_exists);
-PHP_FUNCTION(enchant_broker_set_ordering);
-PHP_FUNCTION(enchant_broker_describe);
-
-PHP_FUNCTION(enchant_dict_check);
-PHP_FUNCTION(enchant_dict_suggest);
-PHP_FUNCTION(enchant_dict_add_to_personal);
-PHP_FUNCTION(enchant_dict_add_to_session);
-PHP_FUNCTION(enchant_dict_is_in_session);
-PHP_FUNCTION(enchant_dict_store_replacement);
-PHP_FUNCTION(enchant_dict_get_error);
-PHP_FUNCTION(enchant_dict_describe);
-PHP_FUNCTION(enchant_dict_quick_check);
-
-#ifdef ZTS
-#define ENCHANT_G(v) TSRMG(enchant_globals_id, zend_enchant_globals *, v)
-#else
-#define ENCHANT_G(v) (enchant_globals.v)
-#endif
-
-#endif /* PHP_ENCHANT_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * indent-tabs-mode: t
- * End:
- */
-
View
28 ext/enchant/tests/broker_describe.phpt
@@ -1,28 +0,0 @@
---TEST--
-enchant_broker_describe() function
---SKIPIF--
-<?php
-if(!extension_loaded('enchant')) die('skip, enchant not loader');
-
- ?>
---FILE--
-<?php
-$broker = enchant_broker_init();
-
-if(!$broker) exit("failed, broker_init failure\n");
-
-$provides = enchant_broker_describe($broker);
-
-if (is_array($provides)) {
- foreach ($provides as $backend) {
- if (!(isset($backend['name']) && isset($backend['desc']) && isset($backend['file']))) {
- exit("failed\n");
- }
- }
- exit("OK\n");
-} else {
- echo "failed";
-}
-?>
---EXPECTF--
-OK
View
21 ext/enchant/tests/broker_free.phpt
@@ -1,21 +0,0 @@
---TEST--
-enchant_broker_free() function
---SKIPIF--
-<?php
-if(!extension_loaded('enchant')) die('skip, enchant not loader');
-
- ?>
---FILE--
-<?php
-$broker = enchant_broker_init();
-if (is_resource($broker)) {
- echo "OK\n";
- enchant_broker_free($broker);
-} else {
- exit("init failed\n");
-}
-echo "OK\n";
-?>
---EXPECT--
-OK
-OK
View
15 ext/enchant/tests/broker_init.phpt
@@ -1,15 +0,0 @@
---TEST--
-enchant_broker_init() function
---SKIPIF--
-<?php
-if(!extension_loaded('enchant')) die('skip, enchant not loader');
-
- ?>
---FILE--
-<?php
-$broker = enchant_broker_init();
-echo is_resource($broker) ? "OK" : "Failure";
-echo "\n";
-?>
---EXPECT--
-OK
View
31 ext/enchant/tests/broker_request_dict.phpt
@@ -1,31 +0,0 @@
---TEST--
-enchant_broker_request_dict() function
---SKIPIF--
-<?php
-if(!extension_loaded('enchant')) die('skip, enchant not loader');
-?>
---FILE--
-<?php
-$broker = enchant_broker_init();
-if (!is_resource($broker)) {
- exit("init failed\n");
-}
-
-$dicts = enchant_broker_list_dicts($broker);
-if (is_array($dicts)) {
- if (count($dicts)) {
- $dict = enchant_broker_request_dict($broker, $dicts[0]['lang_tag']);
- if (is_resource($dict)) {
- echo "OK\n";
- } else {
- echo "fail to request " . $dicts[0]['lang_tag'];
- }
- }
-} else {
- exit("list dicts failed\n");
-}
-echo "OK\n";
-?>
---EXPECT--
-OK
-OK
View
1 ext/enchant/tests/hindi_correct.txt
@@ -1 +0,0 @@
-इस पृष्ठ में एक लिंक बनाने के लिये इस प्रतीक को खीचें व छोड़ें
View
1 ext/enchant/tests/hindi_incorrect.txt
@@ -1 +0,0 @@
-इस पृष्ठ में एक लिंक बनाने के लिये इस प्रतीक को खच व छड
View
2 ext/fileinfo/CREDITS
@@ -1,2 +0,0 @@
-fileinfo
-Ilia Alshanetsky
View
0 ext/fileinfo/EXPERIMENTAL
No changes.
View
62 ext/fileinfo/config.m4
@@ -1,62 +0,0 @@
-dnl $Id$
-dnl config.m4 for extension fileinfo
-
-PHP_ARG_WITH(fileinfo, for fileinfo support,
-[ --with-fileinfo=DIR Include fileinfo support])
-
-if test "$PHP_FILEINFO" != "no"; then
- SEARCH_PATH="/usr/local /usr /usr/share/file"
- if test -r $PHP_FILEINFO/include/magic.h || test -r $PHP_FILEINFO/magic.h; then
- FILEINFO_DIR=$PHP_FILEINFO
- else
- AC_MSG_CHECKING([for magic files in default path])
- for i in $SEARCH_PATH ; do
- if test -r $i/include/magic.h || test -r $i/magic.h; then
- FILEINFO_DIR=$i
- AC_MSG_RESULT(found in $i)
- break
- fi
- done
- fi
-
- if test -z "$FILEINFO_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Please reinstall the libmagic distribution])
- fi
-
- if test -r "$FILEINFO_DIR/include/magic.h"; then
- PHP_ADD_INCLUDE($FILEINFO_DIR/include)
- else
- PHP_ADD_INCLUDE($FILEINFO_DIR)
- fi
-
- LIBNAME=magic
- LIBSYMBOL=magic_open
-
- PHP_CHECK_FUNC(dl, dlopen)
- PHP_CHECK_FUNC(gzgets, z)
- PHP_CHECK_FUNC(round, m)
-
- PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- [
- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $FILEINFO_DIR/lib, FILEINFO_SHARED_LIBADD)
- AC_DEFINE(HAVE_FILEINFOLIB,1,[ ])
- ],[
- AC_MSG_ERROR([wrong magic lib version or lib not found])
- ],[
- -L$FILEINFO_DIR/lib
- ])
-
- MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /usr/share/misc/file/magic /etc/magic /usr/share/misc"
- for i in $MAGIC_MIME_LOCATIONS; do
- if test -f $i; then
- PHP_DEFAULT_MAGIC_FILE=$i
- break
- fi
- done
- AC_DEFINE_UNQUOTED(PHP_DEFAULT_MAGIC_FILE,"$PHP_DEFAULT_MAGIC_FILE",[magic file path])
-
- PHP_SUBST(FILEINFO_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION(fileinfo, fileinfo.c, $ext_shared)
-fi
View
13 ext/fileinfo/config.w32
@@ -1,13 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-ARG_WITH("fileinfo", "fileinfo support", "no");
-
-if (PHP_FILEINFO != 'no' &&
- CHECK_HEADER_ADD_INCLUDE('magic.h', 'CFLAGS_FILEINFO') &&
- CHECK_LIB(PHP_DEBUG != 'no'?'libmagic-staticd.lib':'libmagic-static.lib',
- 'fileinfo', PHP_FILEINFO)) {
- EXTENSION('fileinfo', 'fileinfo.c');
- AC_DEFINE('USE_MAGIC_STATIC', '', '');
-}
-
View
437 ext/fileinfo/fileinfo.c
@@ -1,437 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 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: Ilia Alshanetsky <ilia@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include "php.h"
-
-#include <magic.h>
-/*
- * HOWMANY specifies the maximum offset libmagic will look at
- * this is currently hardcoded in the libmagic source but not exported
- */
-#ifndef HOWMANY
-#define HOWMANY 65536
-#endif
-
-
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "ext/standard/file.h" /* needed for context stuff */
-#include "php_fileinfo.h"
-#include "fopen_wrappers.h" /* needed for is_url */
-
-struct php_fileinfo {
- long options;
- struct magic_set *magic;
-};
-
-#ifndef PHP_DEFAULT_MAGIC_FILE
-#define PHP_DEFAULT_MAGIC_FILE NULL
-#endif
-
-#ifdef ZEND_ENGINE_2
-
-static zend_object_handlers finfo_object_handlers;
-zend_class_entry *finfo_class_entry;
-
-struct finfo_object {
- zend_object zo;
- struct php_fileinfo *ptr;
-};
-
-#define FILEINFO_DECLARE_INIT_OBJECT(object) \
- zval *object = getThis();
-
-#define FILEINFO_REGISTER_OBJECT(_object, _ptr) \
-{ \
- struct finfo_object *obj; \
- obj = (struct finfo_object*)zend_object_store_get_object(_object TSRMLS_CC); \
- obj->ptr = _ptr; \
-}
-
-#define FILEINFO_FROM_OBJECT(finfo, object) \
-{ \
- struct finfo_object *obj = zend_object_store_get_object(object TSRMLS_CC); \
- finfo = obj->ptr; \
- if (!finfo) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The invalid fileinfo object."); \
- RETURN_FALSE; \
- } \
-}
-
-/* {{{ finfo_objects_dtor
- */
-static void finfo_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC)
-{
- struct finfo_object *intern = (struct finfo_object *) object;
-
- if (intern->ptr) {
- magic_close(intern->ptr->magic);
- efree(intern->ptr);
- }
-
- efree(intern);
-}
-/* }}} */
-
-/* {{{ finfo_objects_new
- */
-PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_type TSRMLS_DC)
-{
- zend_object_value retval;
- struct finfo_object *intern;
-
- intern = ecalloc(1, sizeof(struct finfo_object));
- intern->zo.ce = class_type;
- intern->zo.properties = NULL;
-#if ZEND_MODULE_API_NO >= 20050922
- intern->zo.guards = NULL;
-#else
- intern->zo.in_get = 0;
- intern->zo.in_set = 0;
-#endif
- intern->ptr = NULL;
-
- retval.handle = zend_objects_store_put(intern, finfo_objects_dtor, NULL, NULL TSRMLS_CC);
- retval.handlers = (zend_object_handlers *) &finfo_object_handlers;
-
- return retval;
-}
-/* }}} */
-
-/* {{{ finfo_class_functions
- */
-function_entry finfo_class_functions[] = {
- ZEND_ME_MAPPING(finfo, finfo_open, NULL)
- ZEND_ME_MAPPING(set_flags, finfo_set_flags,NULL)
- ZEND_ME_MAPPING(file, finfo_file, NULL)
- ZEND_ME_MAPPING(buffer, finfo_buffer, NULL)
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-#else
-
-#define FILEINFO_REGISTER_OBJECT(_object, _ptr) {}
-#define FILEINFO_FROM_OBJECT(socket_id, object) {}
-
-#define FILEINFO_DECLARE_INIT_OBJECT(object)
-#define object 0
-
-#endif
-
-#define FINFO_SET_OPTION(magic, options) \
- if (magic_setflags(magic, options) == -1) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%ld' %d:%s", \
- options, magic_errno(magic), magic_error(magic)); \
- RETURN_FALSE; \
- }
-
-/* True global resources - no need for thread safety here */
-static int le_fileinfo;
-
-void finfo_resource_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- if (rsrc->ptr) {
- struct php_fileinfo *finfo = (struct php_fileinfo *) rsrc->ptr;
- magic_close(finfo->magic);
- efree(rsrc->ptr);
- rsrc->ptr = NULL;
- }
-}
-
-/* {{{ fileinfo_functions[]
- */
-function_entry fileinfo_functions[] = {
- PHP_FE(finfo_open, NULL)
- PHP_FE(finfo_close, NULL)
- PHP_FE(finfo_set_flags, NULL)
- PHP_FE(finfo_file, NULL)
- PHP_FE(finfo_buffer, NULL)
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(finfo)
-{
-#ifdef ZEND_ENGINE_2
- zend_class_entry _finfo_class_entry;
- INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", finfo_class_functions);
- _finfo_class_entry.create_object = finfo_objects_new;
- finfo_class_entry = zend_register_internal_class(&_finfo_class_entry TSRMLS_CC);
-
- /* copy the standard object handlers to you handler table */
- memcpy(&finfo_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
-#endif /* ZEND_ENGINE_2 */
-
- le_fileinfo = zend_register_list_destructors_ex(finfo_resource_destructor, NULL, "file_info", module_number);
-
- REGISTER_LONG_CONSTANT("FILEINFO_NONE", MAGIC_NONE, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FILEINFO_SYMLINK", MAGIC_SYMLINK, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FILEINFO_MIME", MAGIC_MIME, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FILEINFO_COMPRESS", MAGIC_COMPRESS, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FILEINFO_DEVICES", MAGIC_DEVICES, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FILEINFO_CONTINUE", MAGIC_CONTINUE, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FILEINFO_PRESERVE_ATIME", MAGIC_PRESERVE_ATIME, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FILEINFO_RAW", MAGIC_RAW, CONST_CS|CONST_PERSISTENT);
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ fileinfo_module_entry
- */
-zend_module_entry fileinfo_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
- STANDARD_MODULE_HEADER,
-#endif
- "fileinfo",
- fileinfo_functions,
- PHP_MINIT(finfo),
- NULL,
- NULL,
- NULL,
- PHP_MINFO(fileinfo),
-#if ZEND_MODULE_API_NO >= 20010901
- "0.1", /* Replace with version number for your extension */
-#endif
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-#ifdef COMPILE_DL_FILEINFO
-ZEND_GET_MODULE(fileinfo)
-#endif
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(fileinfo)
-{
- php_info_print_table_start();
- php_info_print_table_header(2, "fileinfo support", "enabled");
- php_info_print_table_end();
-}
-/* }}} */
-
-/* {{{ proto resource finfo_open([int options [, string arg]])
- Create a new fileinfo resource. */
-PHP_FUNCTION(finfo_open)
-{
- long options = MAGIC_NONE;
- char *file = PHP_DEFAULT_MAGIC_FILE;
- int file_len = 0;
- struct php_fileinfo *finfo;
- FILEINFO_DECLARE_INIT_OBJECT(object)
- char resolved_path[MAXPATHLEN];
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &options, &file, &file_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- if (file_len) { /* user specified filed, perform open_basedir checks */
- if (!VCWD_REALPATH(file, resolved_path)) {
- RETURN_FALSE;
- }
- file = resolved_path;
-
- if ((PG(safe_mode) && (!php_checkuid(file, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(file TSRMLS_CC)) {
- RETURN_FALSE;
- }
- }
-
- finfo = emalloc(sizeof(struct php_fileinfo));
-
- finfo->options = options;
- finfo->magic = magic_open(options);
-
- if (finfo->magic == NULL) {
- efree(finfo);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%ld'.", options);
- RETURN_FALSE;
- }
-
- if (magic_load(finfo->magic, file) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database at '%s'.", file);
- magic_close(finfo->magic);
- efree(finfo);
- RETURN_FALSE;
- }
-
- if (object) {
- FILEINFO_REGISTER_OBJECT(object, finfo);
- } else {
- ZEND_REGISTER_RESOURCE(return_value, finfo, le_fileinfo);
- }
-}
-/* }}} */
-
-/* {{{ proto resource finfo_close(resource finfo)
- Close fileinfo resource. */
-PHP_FUNCTION(finfo_close)
-{
- struct php_fileinfo *finfo;
- zval *zfinfo;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zfinfo) == FAILURE) {
- RETURN_FALSE;
- }
- ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo);
-
- zend_list_delete(Z_RESVAL_P(zfinfo));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool finfo_set_flags(resource finfo, int options)
- Set libmagic configuration options. */
-PHP_FUNCTION(finfo_set_flags)
-{
- long options;
- struct php_fileinfo *finfo;
- zval *zfinfo;
- FILEINFO_DECLARE_INIT_OBJECT(object)
-
- if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &options) == FAILURE) {
- RETURN_FALSE;
- }
- FILEINFO_FROM_OBJECT(finfo, object);
- } else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &zfinfo, &options) == FAILURE) {
- RETURN_FALSE;
- }
- ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo);
- }
-
- FINFO_SET_OPTION(finfo->magic, options)
- finfo->options = options;
-
- RETURN_TRUE;
-}
-/* }}} */
-
-static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode)
-{
- long options = 0;
- char *buffer, *tmp, *ret_val;
- int buffer_len;
- struct php_fileinfo *finfo;
- zval *zfinfo, *zcontext = NULL;
- FILEINFO_DECLARE_INIT_OBJECT(object)
-
- if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbz", &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
- RETURN_FALSE;
- }
- FILEINFO_FROM_OBJECT(finfo, object);
- } else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|lbz", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
- RETURN_FALSE;
- }
- ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo);
- }
-
- /* Set options for the current file/buffer. */
- if (options) {
- FINFO_SET_OPTION(finfo->magic, options)
- }
-
- if (mode) { /* file */
- /* determine if the file is a local file or remote URL */
- char *tmp2;
- php_stream_wrapper *wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
- if (wrap && wrap->is_url) {
-#ifdef ZEND_ENGINE_2
- php_stream_context *context = php_stream_context_from_zval(zcontext, 0);
-#else
- php_stream_context *context = NULL;
-#endif
- php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb",
- ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
- if (!stream) {
- RETURN_FALSE;
- }
- buffer_len = php_stream_copy_to_mem(stream, &tmp, HOWMANY, 0);
- php_stream_close(stream);
-
- if (buffer_len == 0) {
- RETURN_FALSE;
- }
- } else { /* local file */
- char resolved_path[MAXPATHLEN];
- if (!VCWD_REALPATH(buffer, resolved_path)) {
- RETURN_FALSE;
- }
-
- ret_val = (char *) magic_file(finfo->magic, buffer);
- goto common;
- }
- } else { /* buffer */
- tmp = buffer;
- }
-
- ret_val = (char *) magic_buffer(finfo->magic, tmp, buffer_len);
- if (mode) {
- efree(tmp);
- }
-common:
- /* Restore options */
- if (options) {
- FINFO_SET_OPTION(finfo->magic, finfo->options)
- }
-
- if (!ret_val) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed identify data %d:%s",
- magic_errno(finfo->magic), magic_error(finfo->magic));
- RETURN_FALSE;
- } else {
- RETURN_STRING(ret_val, 1);
- }
-}
-
-/* {{{ proto string finfo_file(resource finfo, char *file_name [, int options [, resource context]])
- Return information about a file. */
-PHP_FUNCTION(finfo_file)
-{
- _php_finfo_get_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-}
-/* }}} */
-
-/* {{{ proto string finfo_buffer(resource finfo, char *string [, int options])
- Return infromation about a string buffer. */
-PHP_FUNCTION(finfo_buffer)
-{
- _php_finfo_get_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
-/* }}} */
-
-/*
- * 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
- */
View
29 ext/fileinfo/fileinfo.php
@@ -1,29 +0,0 @@
-<?php
-if(!extension_loaded('fileinfo')) {
- dl('fileinfo.' . PHP_SHLIB_SUFFIX);
-}
-if(!extension_loaded('fileinfo')) {
- die("fileinfo extension is not avaliable, please compile it.\n");
-}
-
-// normal operation
-$res = finfo_open(FILEINFO_MIME); /* return mime type ala mimetype extension */
-$files = glob("*");
-foreach ($files as $file) {
- echo finfo_file($res, $file) . "\n";
-}
-finfo_close($res);
-
-// OO mode
-/*
- * FILEINFO_PRESERVE_ATIME - if possible preserve the original access time
- * FILEINFO_SYMLINK - follow symlinks
- * FILEINFO_DEVICES - look at the contents of blocks or character special devices
- * FILEINFO_COMPRESS - decompress compressed files
- */
-$fi = new finfo(FILEINFO_PRESERVE_ATIME|FILEINFO_SYMLINK|FILEINFO_DEVICES|FILEINFO_COMPRESS);
-$files = glob("*");
-foreach ($files as $file) {
- echo $fi->buffer(file_get_contents($file)) . "\n";
-}
-?>
View
43 ext/fileinfo/package.xml
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>Fileinfo</name>
- <summary>libmagic bindings</summary>
- <maintainers>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>ilia@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-This extension allows retrieval of information regarding vast majority of file.
-This information may include dimensions, quality, length etc...
-
-Additionally it can also be used to retrieve the mime type for a particular
-file and for text files proper language encoding.
- </description>
- <license>PHP</license>
- <release>
- <state>stable</state>
- <version>1.0.2</version>
- <date>2005-12-05</date>
- <notes>
- 1) Allow build against 5.1 and 5.0 versions of PHP
- </notes>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="fileinfo.c"/>
- <file role="src" name="php_fileinfo.h"/>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="EXPERIMENTAL"/>
- <file role="doc" name="fileinfo.php"/>
- </filelist>
- <deps>
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
View
61 ext/fileinfo/php_fileinfo.h
@@ -1,61 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 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: Ilia Alshanetsky <ilia@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef PHP_FILEINFO_H
-#define PHP_FILEINFO_H
-
-extern zend_module_entry fileinfo_module_entry;
-#define phpext_fileinfo_ptr &fileinfo_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_FILEINFO_API __declspec(dllexport)
-#else
-#define PHP_FILEINFO_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-PHP_MINFO_FUNCTION(fileinfo);
-
-PHP_FUNCTION(finfo_open);
-PHP_FUNCTION(finfo_close);
-PHP_FUNCTION(finfo_set_flags);
-PHP_FUNCTION(finfo_file);
-PHP_FUNCTION(finfo_buffer);
-
-#ifdef ZTS
-#define FILEINFO_G(v) TSRMG(fileinfo_globals_id, zend_fileinfo_globals *, v)
-#else
-#define FILEINFO_G(v) (fileinfo_globals.v)
-#endif
-
-#endif /* PHP_FILEINFO_H */
-
-
-/*
- * 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
- */
View
2 ext/filter/CREDITS
@@ -1,2 +0,0 @@
-Input Filter
-Rasmus Lerdorf, Derick Rethans
View
68 ext/filter/callback_filter.c
@@ -1,68 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 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_01.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. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#include "php_filter.h"
-
-void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
-{
- char *name = NULL;
- zval *retval_ptr;
- zval ***args;
- int status;
-
- if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, &name)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
- if (name) {
- efree(name);
- }
- zval_dtor(value);
- Z_TYPE_P(value) = IS_NULL;
- return;
- }
- efree(name);
-
- args = safe_emalloc(sizeof(zval **), 1, 0);
- args[0] = &value;
-
- status = call_user_function_ex(EG(function_table), NULL, option_array, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
-
- if (status == SUCCESS && retval_ptr != NULL) {
- zval_dtor(value);
- *value = *retval_ptr;
- zval_copy_ctor(value);
- } else {
- zval_dtor(value);
- Z_TYPE_P(value) = IS_NULL;
- }
-
- if (retval_ptr) {
- zval_ptr_dtor(&retval_ptr);
- }
- efree(args);
-}
-
-/*
- * 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
- */
View
95 ext/filter/config.m4
@@ -1,95 +0,0 @@
-dnl $Id$
-dnl config.m4 for input filtering extension
-
-PHP_ARG_ENABLE(filter, whether to enable input filter support,
-[ --disable-filter Disable input filter support], yes)
-
-PHP_ARG_WITH(pcre-dir, pcre install prefix,
-[ --with-pcre-dir FILTER: pcre install prefix], no, no)
-
-if test "$PHP_FILTER" != "no"; then
-
- dnl Check if configure is the PHP core configure
- if test -n "$PHP_VERSION"; then
- dnl This extension can not be build as shared when in PHP core
- ext_shared=no
- else
- dnl This is PECL build, check if bundled PCRE library is used
- old_CPPFLAGS=$CPPFLAGS
- CPPFLAGS=$INCLUDES
- AC_EGREP_CPP(yes,[
-#include <main/php_config.h>
-#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
-yes
-#endif
- ],[
- PHP_PCRE_REGEX=yes
- ],[
- AC_EGREP_CPP(yes,[
-#include <main/php_config.h>
-#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
-yes
-#endif
- ],[
- PHP_PCRE_REGEX=pecl
- ],[
- PHP_PCRE_REGEX=no
- ])
- ])
- CPPFLAGS=$old_CPPFLAGS
- fi
-
- if test "$PHP_PCRE_REGEX" != "yes"; then
- dnl
- dnl If PCRE extension is enabled we can use the already found paths,
- dnl otherwise we have to detect them here:
- dnl
- if test "$PHP_PCRE_REGEX" = "no" || test "$PHP_PCRE_REGEX" = "pecl"; then
- dnl Set the PCRE search dirs correctly
- case "$PHP_PCRE_DIR" in
- yes|no)
- PCRE_SEARCH_DIR="/usr/local /usr"
- ;;
- *)
- PCRE_SEARCH_DIR="$PHP_PCRE_DIR"
- ;;
- esac
-
- for i in $PCRE_SEARCH_DIR; do
- if test -f $i/include/pcre/pcre.h; then
- PCRE_INCDIR=$i/include/pcre
- break
- elif test -f $i/include/pcre.h; then
- PCRE_INCDIR=$i/include
- break
- elif test -f $i/pcre.h; then
- PCRE_INCDIR=$i
- break
- fi
- done
-
- if test -z "$PCRE_INCDIR"; then
- AC_MSG_ERROR([Could not find pcre.h anywhere under $PCRE_SEARCH_DIR])
- fi
-
- for j in $PCRE_SEARCH_DIR/$PHP_LIBDIR $PCRE_SEARCH_DIR; do
- if test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME; then
- PCRE_LIBDIR=$j
- break
- fi
- done
-
- if test -z "$PCRE_LIBDIR" ; then
- AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) anywhere under $PCRE_SEARCH_DIR])
- fi
- fi
-
- PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, FILTER_SHARED_LIBADD)
- PHP_ADD_INCLUDE($PCRE_INCDIR)
- fi
-
- PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared)
- PHP_SUBST(FILTER_SHARED_LIBADD)
-
- PHP_INSTALL_HEADERS([$ext_srcdir/php_filter.h])
-fi
View
8 ext/filter/config.w32
@@ -1,8 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-ARG_ENABLE("filter", "Filter Support", "yes");
-
-if (PHP_FILTER == "yes") {
- EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
-}
View
331 ext/filter/docs/filter.txt
@@ -1,331 +0,0 @@
-Input Filter Extension
-~~~~~~~~~~~~~~~~~~~~~~
-
-Introduction
-============
-We all know that you should always check input variables, but PHP does not
-offer really good functionality for doing this in a safe way. The Input Filter
-extension is meant to address this issue by implementing a set of filters and
-mechanisms that users can use to safely access their input data.
-
-
-Change Log
-==========
-2005-10-27
- * Updated filter_data prototype
- * Added filter constants
- * Fixed minor problems
- * Changes by David Tulloh
-
-2005-10-05
- * Changed "input_filter.paranoid_admin_default_filter" to
- "filter.default".
- * Updated API prototypes to reflect implementation.
- * Added 'on' and 'off' to the boolean filter.
- * Removed min_range and max_range flags from the float filter.
- * Added validate_url, validate_email and validate_ip filters.
- * Updated allows flags for all filters.
-
-2005-08-15
- * Unmade *source* a bitmask, it doesn't make sense to do.
- * Changed return value of filters which got invalid data from 'false' to
- 'null.
- * Failed filters do not throw an E_NOTICE any longer.
- * Added a magic_quotes sanitizing filter.
-
-
-General Considerations
-======================
-* If the filter's expected input data mask does not match the provided data
- for logical filters the filter function returns "false". If the data was
- not found, "null" is returned.
-* Character filters always return a string.
-* With the input filter extension enabled, and the
- input_filter.paranoid_admin_default_filter is set to something != 'raw',
- then all entries in the affected super globals will be passed through the
- configured filter. The 'callback' filter can not be used here, as that
- requieres a PHP script to be running already.
-* As the input filter acts on input data before the magic quotes function
- mangles data, all access through the filter() function will not have any
- quotes or slashes added - it will be the pure data as send by the browser.
-* All flags mentioned here should be prepended with `FILTER_FLAG_` when used
- with PHP.
-
-
-API
-===
-mixed *input_get* (int *source*, string *name*, [, int *filter* [, mixed *filter_options*, [ string *characterset* ] ]);
- Returns the filtered variable *$name* from source *$source*. It uses the
- filter as specified in *$filter* with a constant, and additional options
- to the filter through *$filter_options*.
-
-mixed *input_get_args* (array *definitions*, int *source*, [, array *data*]);
- Returns an array with all filtered variables defined in 'definition'.
- The keys are used as the name of the argument. The value can be either
- an integer (flags) or an array of options. This array can contain
- the 'filter' type, the 'flags', the 'otptions' or the 'charset'
-
-bool *input_has_variable (int *source*, string *name*);
- Returns *true* if the variable with the name *name* exists in *source*, or
- *false* otherwise.
-
-array *input_filters_list* ();
- Returns a list with all supported filter names.
-
-mixed *filter_data* (mixed *variable*, int *filter* [, mixed *filter_options*, [ string *characterset* ] ]);
- Filters the user supplied variable *$variable* in the same manner as
- *input_get*.
-
-*$source*:
-
-* INPUT_POST 0
-* INPUT_GET 1
-* INPUT_COOKIE 2
-* INPUT_ENV 4
-* INPUT_SERVER 5 (not implemented yet)
-* INPUT_SESSION 6 (not implemented yet)
-
-
-General flags
-=============
-
-* FILTER_FLAG_SCALAR
-* FILTER_FLAG_ARRAY
-
-These two constants define whether to allow arrays in the source values. The
-default value is SCALAR for input_get_args and ARRAY for the other functions
-(< 0.9.5). These constants also insure that the function returns the correct
-type, if you ask for an array, you will get an array even if the source is
-only one value. However, if you ask for a scalar and the source is an array,
-the result will be FALSE (invalid).
-
-
-Logical Filters
-===============
-
-These filters check whether passed data was valid, and do never mangle input
-variables, but ofcourse they can deny the whole input variable getting to the
-application by returning false.
-
-The constants should be prepended by `FILTER_VALIDATE_` when used with php.
-
-================ ========== =========== ==================================================
-Name Constant Return Type Description
-================ ========== =========== ==================================================
-int INT integer Returns the input variable as an integer
-
- $filter_options - an array with the optional
- elements:
-
- * min_range: Minimal number that is allowed
- (inclusive)
- * max_range: Maximum number that is allowed
- (inclusive)
- * flags: A bitmask supporting the following flags:
-
- - ALLOW_OCTAL: allow octal numbers with the format
- 0nn as input too.
- - ALLOW_HEX: allow hexadecimal numbers with the
- format 0xnn or 0Xnn too.
-
-boolean BOOLEAN boolean Returns *true* for '1', 'on' and 'true' and *false*
- for '0', 'off' and 'false'
-
-float FLOAT float Returns the input variable as a floating point value
-
-validate_regexp REGEXP string Matches the input value as a string against the
- regular expression. If there is a match then the
- string is returned, otherwise the filter returns
- *null*.
- Remarks: Only available if pcre has been compiled
- into PHP.
-
-validate_url URL string Validates an URL's format.
-
- $filter_options - an bitmask that supports the
- following flags:
-
- * SCHEME_REQUIRED: The 'schema' part of the URL
- needs to in the passed URL.
- * HOST_REQUIRED: The 'host' part of the URL
- needs to in the passed URL.
- * PATH_REQUIRED: The 'path' part of the URL
- needs to in the passed URL.
- * QUERY_REQUIRED: The 'query' part of the URL
- needs to in the passed URL.
-
-valida