Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

This commit was manufactured by cvs2svn to create tag

'PRE_NEW_VM_GEN_PATCH'.
  • Loading branch information...
commit 435216395ba372856379e7b6572292865c43c1cc 1 parent b20d2ba
SVN Migration authored

Showing 128 changed files with 0 additions and 16,535 deletions. Show diff stats Hide diff stats

  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 731 ext/enchant/enchant.c
  6. +0 83 ext/enchant/package.xml
  7. +0 80 ext/enchant/php_enchant.h
  8. +0 2  ext/fileinfo/CREDITS
  9. 0  ext/fileinfo/EXPERIMENTAL
  10. +0 54 ext/fileinfo/config.m4
  11. +0 433 ext/fileinfo/fileinfo.c
  12. +0 29 ext/fileinfo/fileinfo.php
  13. +0 43 ext/fileinfo/package.xml
  14. +0 61 ext/fileinfo/php_fileinfo.h
  15. +0 103 ext/imap/imap.h
  16. +0 56 ext/pcre/config0.m4
  17. +0 2  ext/pdo/CREDITS
  18. 0  ext/pdo/EXPERIMENTAL
  19. +0 31 ext/pdo/Makefile.frag
  20. +0 56 ext/pdo/README
  21. +0 21 ext/pdo/TODO
  22. +0 10 ext/pdo/config.m4
  23. +0 9 ext/pdo/config.w32
  24. +0 84 ext/pdo/package.xml
  25. +0 327 ext/pdo/pdo.c
  26. +0 35 ext/pdo/pdo.php
  27. +0 865 ext/pdo/pdo_dbh.c
  28. +0 317 ext/pdo/pdo_sql_parser.c
  29. +0 201 ext/pdo/pdo_sql_parser.re
  30. +0 1,157 ext/pdo/pdo_stmt.c
  31. +0 71 ext/pdo/php_pdo.h
  32. +0 467 ext/pdo/php_pdo_driver.h
  33. +0 63 ext/pdo/php_pdo_int.h
  34. +0 27 ext/pdo/php_pdo_sql_parser.h
  35. +0 2  ext/pdo_firebird/CREDITS
  36. 0  ext/pdo_firebird/EXPERIMENTAL
  37. +0 49 ext/pdo_firebird/config.m4
  38. +0 18 ext/pdo_firebird/config.w32
  39. +0 660 ext/pdo_firebird/firebird_driver.c
  40. +0 696 ext/pdo_firebird/firebird_statement.c
  41. +0 55 ext/pdo_firebird/package.xml
  42. +0 87 ext/pdo_firebird/pdo_firebird.c
  43. +0 58 ext/pdo_firebird/php_pdo_firebird.h
  44. +0 127 ext/pdo_firebird/php_pdo_firebird_int.h
  45. +0 16 ext/pdo_firebird/tests/connect.phpt
  46. +0 37 ext/pdo_firebird/tests/ddl.phpt
  47. +0 65 ext/pdo_firebird/tests/execute.phpt
  48. +0 5 ext/pdo_firebird/tests/skipif.inc
  49. +0 34 ext/pdo_firebird/tests/testdb.inc
  50. +0 2  ext/pdo_mysql/CREDITS
  51. +0 71 ext/pdo_mysql/config.m4
  52. +0 15 ext/pdo_mysql/config.w32
  53. +0 345 ext/pdo_mysql/mysql_driver.c
  54. +0 260 ext/pdo_mysql/mysql_statement.c
  55. +0 48 ext/pdo_mysql/package.xml
  56. +0 94 ext/pdo_mysql/pdo_mysql.c
  57. +0 53 ext/pdo_mysql/php_pdo_mysql.h
  58. +0 69 ext/pdo_mysql/php_pdo_mysql_int.h
  59. +0 2  ext/pdo_oci/CREDITS
  60. 0  ext/pdo_oci/EXPERIMENTAL
  61. +0 142 ext/pdo_oci/config.m4
  62. +0 42 ext/pdo_oci/config.w32
  63. +0 483 ext/pdo_oci/oci_driver.c
  64. +0 429 ext/pdo_oci/oci_statement.c
  65. +0 47 ext/pdo_oci/package.xml
  66. +0 120 ext/pdo_oci/pdo_oci.c
  67. +0 53 ext/pdo_oci/php_pdo_oci.h
  68. +0 89 ext/pdo_oci/php_pdo_oci_int.h
  69. +0 17 ext/pdo_oci/tests/connect.phpt
  70. +0 13 ext/pdo_oci/tests/settings.inc
  71. +0 2  ext/pdo_odbc/CREDITS
  72. 0  ext/pdo_odbc/EXPERIMENTAL
  73. +0 111 ext/pdo_odbc/config.m4
  74. +0 15 ext/pdo_odbc/config.w32
  75. +0 411 ext/pdo_odbc/odbc_driver.c
  76. +0 262 ext/pdo_odbc/odbc_stmt.c
  77. +0 53 ext/pdo_odbc/package.xml
  78. +0 155 ext/pdo_odbc/pdo_odbc.c
  79. +0 81 ext/pdo_odbc/php_pdo_odbc.h
  80. +0 163 ext/pdo_odbc/php_pdo_odbc_int.h
  81. +0 2  ext/pdo_pgsql/CREDITS
  82. +0 102 ext/pdo_pgsql/config.m4
  83. +0 16 ext/pdo_pgsql/config.w32
  84. +0 53 ext/pdo_pgsql/package.xml
  85. +0 113 ext/pdo_pgsql/pdo_pgsql.c
  86. +0 397 ext/pdo_pgsql/pgsql_driver.c
  87. +0 157 ext/pdo_pgsql/pgsql_statement.c
  88. +0 58 ext/pdo_pgsql/php_pdo_pgsql.h
  89. +0 80 ext/pdo_pgsql/php_pdo_pgsql_int.h
  90. +0 2  ext/pdo_sqlite/CREDITS
  91. 0  ext/pdo_sqlite/EXPERIMENTAL
  92. +0 55 ext/pdo_sqlite/config.m4
  93. +0 16 ext/pdo_sqlite/config.w32
  94. +0 54 ext/pdo_sqlite/package.xml
  95. +0 122 ext/pdo_sqlite/pdo_sqlite.c
  96. +0 71 ext/pdo_sqlite/php_pdo_sqlite.h
  97. +0 52 ext/pdo_sqlite/php_pdo_sqlite_int.h
  98. +0 357 ext/pdo_sqlite/sqlite_driver.c
  99. +0 285 ext/pdo_sqlite/sqlite_statement.c
  100. +0 2  ext/xmlreader/CREDITS
  101. +0 5 ext/xmlreader/README
  102. +0 8 ext/xmlreader/TODO
  103. +0 22 ext/xmlreader/config.m4
  104. +0 14 ext/xmlreader/config.w32
  105. +0 8 ext/xmlreader/examples/dtdexample.dtd
  106. +0 15 ext/xmlreader/examples/dtdexample.xml
  107. +0 11 ext/xmlreader/examples/relaxNG.rng
  108. +0 1  ext/xmlreader/examples/relaxNG.xml
  109. +0 23 ext/xmlreader/examples/relaxNG2.rng
  110. +0 8 ext/xmlreader/examples/relaxNG3.rng
  111. +0 10 ext/xmlreader/examples/xmlreader.xml
  112. +0 20 ext/xmlreader/examples/xmlreader_file.php
  113. +0 25 ext/xmlreader/examples/xmlreader_relaxNG.php
  114. +0 31 ext/xmlreader/examples/xmlreader_string.php
  115. +0 18 ext/xmlreader/examples/xmlreader_validatedtd.php
  116. +0 77 ext/xmlreader/package.xml
  117. +0 1,174 ext/xmlreader/php_xmlreader.c
  118. +0 72 ext/xmlreader/php_xmlreader.h
  119. +0 114 ext/xmlreader/xmlreader.dsp
  120. +0 2  ext/xmlwriter/CREDITS
  121. +0 4 ext/xmlwriter/EXPERIMENTAL
  122. +0 5 ext/xmlwriter/TODO
  123. +0 61 ext/xmlwriter/config.m4
  124. +0 18 ext/xmlwriter/config.w32
  125. +0 49 ext/xmlwriter/package.xml
  126. +0 1,317 ext/xmlwriter/php_xmlwriter.c
  127. +0 94 ext/xmlwriter/php_xmlwriter.h
  128. +0 285 main/php_realpath.c
2  ext/enchant/CREDITS
... ... @@ -1,2 +0,0 @@
1   -enchant
2   -Pierre-Alain Joye, Ilia Alshanetsky
36 ext/enchant/config.m4
... ... @@ -1,36 +0,0 @@
1   -dnl
2   -dnl $Id$
3   -dnl
4   -
5   -PHP_ARG_WITH(enchant,for ENCHANT support,
6   -[ --with-enchant[=DIR] Include enchant support.
7   - GNU Aspell version 1.1.3 or higher required.])
8   -
9   -if test "$PHP_ENCHANT" != "no"; then
10   - PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
11   - if test "$PHP_ENCHANT" != "yes"; then
12   - ENCHANT_SEARCH_DIRS=$PHP_ENCHANT
13   - else
14   - ENCHANT_SEARCH_DIRS="/usr/local /usr"
15   - fi
16   - for i in $ENCHANT_SEARCH_DIRS; do
17   - if test -f $i/include/enchant/enchant.h; then
18   - ENCHANT_DIR=$i
19   - ENCHANT_INCDIR=$i/include/enchant
20   - elif test -f $i/include/enchant.h; then
21   - ENCHANT_DIR=$i
22   - ENCHANT_INCDIR=$i/include
23   - fi
24   - done
25   -
26   - if test -z "$ENCHANT_DIR"; then
27   - AC_MSG_ERROR(Cannot find enchant)
28   - fi
29   -
30   - ENCHANT_LIBDIR=$ENCHANT_DIR/lib
31   -
32   - AC_DEFINE(HAVE_ENCHANT,1,[ ])
33   - PHP_SUBST(ENCHANT_SHARED_LIBADD)
34   - PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD)
35   - PHP_ADD_INCLUDE($ENCHANT_INCDIR)
36   -fi
13 ext/enchant/config.w32
... ... @@ -1,13 +0,0 @@
1   -// $Id$
2   -// vim:ft=javascript
3   -
4   -ARG_ENABLE("enchant", "Enchant Support", "no");
5   -
6   -if (PHP_ENCHANT == "yes") {
7   - if (CHECK_HEADER_ADD_INCLUDE("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT)) {
8   - EXTENSION("enchant", "enchant.c");
9   - AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
10   - } else {
11   - WARNING('Could not find enchant.h; skipping');
12   - }
13   -}
25 ext/enchant/docs/examples/example1.php
... ... @@ -1,25 +0,0 @@
1   -<?php
2   -$tag = 'en_US';
3   -$r = enchant_broker_init();
4   -$bprovides = enchant_broker_describe($r);
5   -echo "Current broker provides the following backend(s):\n";
6   -print_r($bprovides);
7   -
8   -
9   -if (enchant_broker_dict_exists($r,$tag)) {
10   - $d = enchant_broker_request_dict($r, $tag);
11   - $dprovides = enchant_dict_describe($d);
12   - echo "dictionary $tag provides:\n";
13   - $spellerrors = enchant_dict_check($d, "soong");
14   - print_r($dprovides);
15   - echo "found $spellerrors spell errors\n";
16   - if ($spellerrors) {
17   - $suggs = enchant_dict_suggest($d, "soong");
18   - echo "Suggestions for 'soong':";
19   - print_r($suggs);
20   - }
21   - enchant_broker_free_dict($d);
22   -} else {
23   -}
24   -enchant_broker_free($r);
25   -?>
731 ext/enchant/enchant.c
... ... @@ -1,731 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 5 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2004 The PHP Group |
6   - +----------------------------------------------------------------------+
7   - | This source file is subject to version 3.0 of the PHP license, |
8   - | that is bundled with this package in the file LICENSE, and is |
9   - | available at through the world-wide-web at |
10   - | http://www.php.net/license/3_0.txt. |
11   - | If you did not receive a copy of the PHP license and are unable to |
12   - | obtain it through the world-wide-web, please send a note to |
13   - | license@php.net so we can mail you a copy immediately. |
14   - +----------------------------------------------------------------------+
15   - | Author: Pierre-Alain Joye <paj@pearfr.org> |
16   - | Ilia Alshanetsky <ilia@prohost.org> |
17   - +----------------------------------------------------------------------+
18   -
19   - $Id$
20   -*/
21   -
22   -#ifdef HAVE_CONFIG_H
23   -#include "config.h"
24   -#endif
25   -#include "enchant.h"
26   -#include "php.h"
27   -#include "php_ini.h"
28   -#include "ext/standard/info.h"
29   -#include "php_enchant.h"
30   -
31   -
32   -typedef EnchantBroker * EnchantBrokerPtr;
33   -typedef struct _broker_struct enchant_broker;
34   -typedef struct _dict_struct enchant_dict;
35   -
36   -typedef enchant_broker * enchant_brokerPtr;
37   -typedef enchant_dict * enchant_dictPtr;
38   -
39   -typedef struct _broker_struct {
40   - EnchantBroker *pbroker;
41   - enchant_dict **dict;
42   - unsigned int dictcnt;
43   - zval *rsrc_id;
44   -} _enchant_broker;
45   -
46   -typedef struct _dict_struct {
47   - unsigned int id;
48   - EnchantDict *pdict;
49   - enchant_broker *pbroker;
50   - zval *rsrc_id;
51   - enchant_dict *next;
52   - enchant_dict *prev;
53   -} _enchant_dict;
54   -
55   -
56   -/* True global resources - no need for thread safety here */
57   -static int le_enchant_broker;
58   -static int le_enchant_dict;
59   -
60   -/* If you declare any globals in php_enchant.h uncomment this:*/
61   -/*ZEND_DECLARE_MODULE_GLOBALS(enchant)*/
62   -
63   -/* {{{ enchant_functions[]
64   - *
65   - * Every user visible function must have an entry in enchant_functions[].
66   - */
67   -function_entry enchant_functions[] = {
68   - PHP_FE(enchant_broker_init, NULL)
69   - PHP_FE(enchant_broker_free, NULL)
70   - PHP_FE(enchant_broker_get_error, NULL)
71   - PHP_FE(enchant_broker_request_dict, NULL)
72   - PHP_FE(enchant_broker_request_pwl_dict, NULL)
73   - PHP_FE(enchant_broker_free_dict, NULL)
74   - PHP_FE(enchant_broker_dict_exists, NULL)
75   - PHP_FE(enchant_broker_set_ordering, NULL)
76   - PHP_FE(enchant_broker_describe, NULL)
77   - PHP_FE(enchant_dict_check, NULL)
78   - PHP_FE(enchant_dict_suggest, NULL)
79   - PHP_FE(enchant_dict_add_to_personal, NULL)
80   - PHP_FE(enchant_dict_add_to_session, NULL)
81   - PHP_FE(enchant_dict_is_in_session, NULL)
82   - PHP_FE(enchant_dict_store_replacement, NULL)
83   - PHP_FE(enchant_dict_get_error, NULL)
84   - PHP_FE(enchant_dict_describe, NULL)
85   - PHP_FE(enchant_dict_quick_check, third_arg_force_ref)
86   -
87   - {NULL, NULL, NULL} /* Must be the last line in enchant_functions[] */
88   -};
89   -/* }}} */
90   -
91   -/* {{{ enchant_module_entry
92   - */
93   -zend_module_entry enchant_module_entry = {
94   -#if ZEND_MODULE_API_NO >= 20010901
95   - STANDARD_MODULE_HEADER,
96   -#endif
97   - "enchant",
98   - enchant_functions,
99   - PHP_MINIT(enchant),
100   - PHP_MSHUTDOWN(enchant),
101   - NULL, /* Replace with NULL if there's nothing to do at request start */
102   - NULL, /* Replace with NULL if there's nothing to do at request end */
103   - PHP_MINFO(enchant),
104   -#if ZEND_MODULE_API_NO >= 20010901
105   - "0.1", /* Replace with version number for your extension */
106   -#endif
107   - STANDARD_MODULE_PROPERTIES
108   -};
109   -/* }}} */
110   -
111   -#ifdef COMPILE_DL_ENCHANT
112   -ZEND_GET_MODULE(enchant)
113   -#endif
114   -
115   -static void
116   -enumerate_providers_fn (const char * const name,
117   - const char * const desc,
118   - const char * const file,
119   - void * ud)
120   -{
121   - zval *zdesc = (zval *) ud;
122   - zval *tmp_array;
123   -
124   - MAKE_STD_ZVAL(tmp_array);
125   - array_init(tmp_array);
126   -
127   - add_assoc_string(tmp_array, "name", (char *)name, 1);
128   - add_assoc_string(tmp_array, "desc", (char *)desc, 1);
129   - add_assoc_string(tmp_array, "file", (char *)file, 1);
130   -
131   - if (Z_TYPE_P(zdesc)!=IS_ARRAY) {
132   - array_init(zdesc);
133   - }
134   -
135   - add_next_index_zval(zdesc, tmp_array);
136   -}
137   -
138   -static void
139   -describe_dict_fn (const char * const lang,
140   - const char * const name,
141   - const char * const desc,
142   - const char * const file,
143   - void * ud)
144   -{
145   - zval *zdesc = (zval *) ud;
146   - array_init(zdesc);
147   - add_assoc_string(zdesc, "lang", (char *)lang, 1);
148   - add_assoc_string(zdesc, "name", (char *)name, 1);
149   - add_assoc_string(zdesc, "desc", (char *)desc, 1);
150   - add_assoc_string(zdesc, "file", (char *)file, 1);
151   -}
152   -
153   -static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
154   -{
155   - if (rsrc->ptr) {
156   - enchant_broker *broker = (enchant_broker *)rsrc->ptr;
157   - if (broker) {
158   - if (broker->pbroker) {
159   - if (broker->dictcnt && broker->dict) {
160   - if (broker->dict) {
161   - int total, tofree;
162   - tofree = total = broker->dictcnt-1;
163   - do {
164   - zend_list_delete(Z_RESVAL_P(broker->dict[total]->rsrc_id));
165   - efree(broker->dict[total]);
166   - total--;
167   - } while (total>=0);
168   - }
169   - efree(broker->dict);
170   - broker->dict = NULL;
171   - }
172   - enchant_broker_free(broker->pbroker);
173   - }
174   - efree(broker);
175   - }
176   - }
177   -}
178   -
179   -static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
180   -{
181   - if (rsrc->ptr) {
182   - enchant_dict *pdict = (enchant_dict *)rsrc->ptr;
183   - if (pdict) {
184   - if (pdict->pdict && pdict->pbroker) {
185   - enchant_broker_free_dict(pdict->pbroker->pbroker, pdict->pdict);
186   - }
187   - if (pdict->id) {
188   - pdict->pbroker->dict[pdict->id-1]->next = NULL;
189   - }
190   - }
191   - }
192   -}
193   -
194   -/* {{{ PHP_MINIT_FUNCTION
195   - */
196   -PHP_MINIT_FUNCTION(enchant)
197   -{
198   - le_enchant_broker = zend_register_list_destructors_ex(php_enchant_broker_free, NULL, "enchant broker", module_number);
199   - le_enchant_dict = zend_register_list_destructors_ex(php_enchant_dict_free, NULL, "enchant dict", module_number);
200   -
201   - return SUCCESS;
202   -}
203   -/* }}} */
204   -
205   -/* {{{ PHP_MSHUTDOWN_FUNCTION
206   - */
207   -PHP_MSHUTDOWN_FUNCTION(enchant)
208   -{
209   - return SUCCESS;
210   -}
211   -/* }}} */
212   -
213   -/* {{{ PHP_MINFO_FUNCTION
214   - */
215   -static void __enumerate_providers_fn (const char * const name,
216   - const char * const desc,
217   - const char * const file,
218   - void * ud)
219   -{
220   - php_info_print_table_row(3, name, desc, file);
221   -}
222   -/* }}} */
223   -
224   -/* {{{ PHP_MINFO_FUNCTION
225   - */
226   -PHP_MINFO_FUNCTION(enchant)
227   -{
228   - EnchantBroker *pbroker;
229   -
230   - pbroker = enchant_broker_init();
231   - php_info_print_table_start();
232   - php_info_print_table_header(2, "enchant support", "enabled");
233   - php_info_print_table_row(2, "Version", "@version@");
234   - php_info_print_table_row(2, "Revision", "$Revision$");
235   - php_info_print_table_end();
236   -
237   - php_info_print_table_start();
238   - enchant_broker_describe(pbroker, __enumerate_providers_fn, NULL);
239   - php_info_print_table_end();
240   - enchant_broker_free(pbroker);
241   -}
242   -/* }}} */
243   -
244   -#define PHP_ENCHANT_GET_BROKER \
245   - ZEND_FETCH_RESOURCE(pbroker, enchant_broker *, &broker, -1, "enchant_broker", le_enchant_broker); \
246   - if (!pbroker || !pbroker->pbroker) { \
247   - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Resource broker invalid"); \
248   - RETURN_FALSE; \
249   - }
250   -
251   -#define PHP_ENCHANT_GET_DICT \
252   - ZEND_FETCH_RESOURCE(pdict, enchant_dict *, &dict, -1, "enchant dict", le_enchant_dict); \
253   - if (!pdict || !pdict->pdict) { \
254   - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Invalid dictionary resource."); \
255   - RETURN_FALSE; \
256   - }
257   -
258   -/* {{{ proto resource enchant_broker_init()
259   - create a new broker object capable of requesting */
260   -PHP_FUNCTION(enchant_broker_init)
261   -{
262   - enchant_broker *broker;
263   - EnchantBroker *pbroker;
264   -
265   - if (ZEND_NUM_ARGS()) {
266   - ZEND_WRONG_PARAM_COUNT();
267   - }
268   -
269   - pbroker = enchant_broker_init();
270   -
271   - if (pbroker) {
272   - broker = (enchant_broker *) emalloc(sizeof(enchant_broker));
273   - broker->pbroker = pbroker;
274   - broker->dict = NULL;
275   - broker->dictcnt = 0;
276   - ZEND_REGISTER_RESOURCE(return_value, broker, le_enchant_broker);
277   - broker->rsrc_id = return_value;
278   - } else {
279   - RETURN_FALSE;
280   - }
281   -}
282   -/* }}} */
283   -
284   -/* {{{ proto boolean enchant_free(resource broker)
285   - Destroys the broker object and its dictionnaries */
286   -PHP_FUNCTION(enchant_broker_free)
287   -{
288   - zval *broker;
289   - enchant_broker *pbroker;
290   -
291   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
292   - RETURN_FALSE;
293   - }
294   - PHP_ENCHANT_GET_BROKER;
295   -
296   - zend_list_delete(Z_RESVAL_P(broker));
297   - RETURN_TRUE;
298   -}
299   -/* }}} */
300   -
301   -/* {{{ proto string enchant_broker_get_error(resource broker)
302   - Returns the last error of the broker */
303   -PHP_FUNCTION(enchant_broker_get_error)
304   -{
305   - zval *broker;
306   - enchant_broker *pbroker;
307   - char *msg;
308   -
309   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
310   - RETURN_FALSE;
311   - }
312   -
313   - PHP_ENCHANT_GET_BROKER;
314   -
315   - msg = enchant_broker_get_error(pbroker->pbroker);
316   - if (msg) {
317   - RETURN_STRING((char *)msg, 1);
318   - }
319   - RETURN_FALSE;
320   -}
321   -/* }}} */
322   -
323   -/* {{{ proto resource enchant_broker_request_dict(resource broker, string tag)
324   - create a new dictionary using tag, the non-empty language tag you wish to request
325   - a dictionary for ("en_US", "de_DE", ...) */
326   -PHP_FUNCTION(enchant_broker_request_dict)
327   -{
328   - zval *broker;
329   - enchant_broker *pbroker;
330   - enchant_dict *dict;
331   - EnchantDict *d;
332   - char *tag;
333   - int taglen;
334   - int pos;
335   -
336   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
337   - RETURN_FALSE;
338   - }
339   -
340   - PHP_ENCHANT_GET_BROKER;
341   -
342   - d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
343   - if (d) {
344   - if (pbroker->dictcnt) {
345   - pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
346   - pos = pbroker->dictcnt++;
347   - } else {
348   - pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
349   - pos = 0;
350   - pbroker->dictcnt++;
351   - }
352   -
353   - dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
354   - dict->id = pos;
355   - dict->pbroker = pbroker;
356   - dict->pdict = d;
357   - dict->rsrc_id = return_value;
358   - dict->prev = pos ? pbroker->dict[pos-1] : NULL;
359   - dict->next = NULL;
360   - pbroker->dict[pos] = dict;
361   -
362   - if (pos) {
363   - pbroker->dict[pos-1]->next = dict;
364   - }
365   -
366   - ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict);
367   - } else {
368   - RETURN_FALSE;
369   - }
370   -}
371   -/* }}} */
372   -
373   -/* {{{ proto resource enchant_broker_request_pwl_dict(resource dict, string filename)
374   - creates a dictionary using a PWL file. A PWL file is personal word file one word per line.
375   - It must exist before the call.*/
376   -PHP_FUNCTION(enchant_broker_request_pwl_dict)
377   -{
378   - zval *broker;
379   - enchant_broker *pbroker;
380   - enchant_dict *dict;
381   - EnchantDict *d;
382   - char *pwl;
383   - int pwllen;
384   - int pos;
385   -
386   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &pwl, &pwllen) == FAILURE) {
387   - RETURN_FALSE;
388   - }
389   -
390   - if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) {
391   - RETURN_FALSE;
392   - }
393   -
394   - PHP_ENCHANT_GET_BROKER;
395   -
396   - d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
397   - if (d) {
398   - if (pbroker->dictcnt) {
399   - pos = pbroker->dictcnt++;
400   - pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
401   - } else {
402   - pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
403   - pos = 0;
404   - pbroker->dictcnt++;
405   - }
406   - dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
407   - dict->id = pos;
408   - dict->pbroker = pbroker;
409   - dict->pdict = d;
410   - dict->rsrc_id = return_value;
411   - dict->prev = pos?pbroker->dict[pos-1]:NULL;
412   - dict->next = NULL;
413   - pbroker->dict[pos] = dict;
414   - if (pos) {
415   - pbroker->dict[pos-1]->next = dict;
416   - }
417   - ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict);
418   - } else {
419   - RETURN_FALSE;
420   - }
421   -}
422   -/* }}} */
423   -
424   -/* {{{ proto resource enchant_broker_free_dict(resource dict)
425   - Free the dictionary resource */
426   -PHP_FUNCTION(enchant_broker_free_dict)
427   -{
428   - zval *dict;
429   - enchant_dict *pdict;
430   -
431   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
432   - RETURN_FALSE;
433   - }
434   -
435   - PHP_ENCHANT_GET_DICT;
436   -
437   - zend_list_delete(Z_RESVAL_P(dict));
438   - RETURN_TRUE;
439   -}
440   -/* }}} */
441   -
442   -/* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag)
443   - Wether a dictionary exists or not. Using non-empty tag */
444   -PHP_FUNCTION(enchant_broker_dict_exists)
445   -{
446   - zval *broker;
447   - char *tag;
448   - int taglen;
449   - enchant_broker * pbroker;
450   -
451   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
452   - RETURN_FALSE;
453   - }
454   -
455   - PHP_ENCHANT_GET_BROKER;
456   -
457   - RETURN_BOOL(enchant_broker_dict_exists(pbroker->pbroker, tag));
458   -}
459   -/* }}} */
460   -
461   -
462   -/* {{{ proto bool enchant_broker_set_ordering(resource broker, string tag, string ordering)
463   - Declares a preference of dictionaries to use for the language
464   - described/referred to by 'tag'. The ordering is a comma delimited
465   - list of provider names. As a special exception, the "*" tag can
466   - be used as a language tag to declare a default ordering for any
467   - language that does not explictly declare an ordering. */
468   -
469   -PHP_FUNCTION(enchant_broker_set_ordering)
470   -{
471   - zval *broker;
472   - char *pordering;
473   - int porderinglen;
474   - char *ptag;
475   - int ptaglen;
476   - enchant_broker * pbroker;
477   -
478   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) {
479   - RETURN_FALSE;
480   - }
481   -
482   - PHP_ENCHANT_GET_BROKER;
483   -
484   - enchant_broker_set_ordering(pbroker->pbroker, ptag, pordering);
485   - RETURN_TRUE;
486   -}
487   -/* }}} */
488   -
489   -/* {{{ proto array enchant_broker_describe(resource broker)
490   - Enumerates the Enchant providers and tells
491   - you some rudimentary information about them. The same info is provided through phpinfo() */
492   -PHP_FUNCTION(enchant_broker_describe)
493   -{
494   - EnchantBrokerDescribeFn describetozval = enumerate_providers_fn;
495   - zval *broker;
496   - enchant_broker * pbroker;
497   -
498   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
499   - RETURN_FALSE;
500   - }
501   -
502   - PHP_ENCHANT_GET_BROKER;
503   -
504   - enchant_broker_describe(pbroker->pbroker, describetozval, (void *)return_value);
505   -}
506   -/* }}} */
507   -
508   -/* {{{ proto bool enchant_dict_quick_check(resource dict, string word [, array &suggestions])
509   - If the word is correctly spelled return true, otherwise return false, if suggestions variable
510   - is provided, fill it with spelling alternatives. */
511   -PHP_FUNCTION(enchant_dict_quick_check)
512   -{
513   - zval *dict, *sugg = NULL;
514   - char *word;
515   - int wordlen;
516   - enchant_dict *pdict;
517   -
518   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
519   - RETURN_FALSE;
520   - }
521   -
522   - if (sugg) {
523   - zval_dtor(sugg);
524   - }
525   -
526   - PHP_ENCHANT_GET_DICT;
527   -
528   - if (enchant_dict_check(pdict->pdict, word, wordlen) > 0) {
529   - if (!sugg && ZEND_NUM_ARGS() == 2) {
530   - RETURN_FALSE;
531   - }
532   -
533   - int n_sugg;
534   - char **suggs;
535   -
536   - array_init(sugg);
537   -
538   - suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg);
539   - if (suggs && n_sugg) {
540   - int i;
541   - for (i = 0; i < n_sugg; i++) {
542   - add_next_index_string(sugg, suggs[i], 1);
543   - }
544   - enchant_dict_free_suggestions(pdict->pdict, suggs);
545   - }
546   -
547   -
548   - RETURN_FALSE;
549   - }
550   - RETURN_TRUE;
551   -}
552   -/* }}} */
553   -
554   -/* {{{ proto bool enchant_dict_check(resource dict, string word)
555   - If the word is correctly spelled return true, otherwise return false */
556   -PHP_FUNCTION(enchant_dict_check)
557   -{
558   - zval *dict;
559   - char *word;
560   - int wordlen;
561   - enchant_dict *pdict;
562   -
563   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
564   - RETURN_FALSE;
565   - }
566   -
567   - PHP_ENCHANT_GET_DICT;
568   -
569   - RETURN_BOOL(!enchant_dict_check(pdict->pdict, word, wordlen));
570   -}
571   -/* }}} */
572   -
573   -/* {{{ proto array enchant_dict_suggest(resource dict, string word)
574   - Will return a list of values if any of those pre-conditions are not met.*/
575   -PHP_FUNCTION(enchant_dict_suggest)
576   -{
577   - zval *dict;
578   - char *word;
579   - int wordlen;
580   - char **suggs;
581   - enchant_dict *pdict;
582   - int n_sugg;
583   -
584   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
585   - RETURN_FALSE;
586   - }
587   -
588   - PHP_ENCHANT_GET_DICT;
589   -
590   - suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg);
591   - if (suggs && n_sugg) {
592   - int i;
593   -
594   - array_init(return_value);
595   - for (i = 0; i < n_sugg; i++) {
596   - add_next_index_string(return_value, suggs[i], 1);
597   - }
598   -
599   - enchant_dict_free_suggestions(pdict->pdict, suggs);
600   - }
601   -}
602   -/* }}} */
603   -
604   -/* {{{ proto void enchant_dict_add_to_personal(resource dict, string word)
605   - add 'word' to personal word list */
606   -PHP_FUNCTION(enchant_dict_add_to_personal)
607   -{
608   - zval *dict;
609   - char *word;
610   - int wordlen;
611   - enchant_dict *pdict;
612   -
613   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
614   - RETURN_FALSE;
615   - }
616   -
617   - PHP_ENCHANT_GET_DICT;
618   -
619   - enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
620   -}
621   -/* }}} */
622   -
623   -/* {{{ proto void enchant_dict_add_to_session(resource dict, string word)
624   - add 'word' to this spell-checking session */
625   -PHP_FUNCTION(enchant_dict_add_to_session)
626   -{
627   - zval *dict;
628   - char *word;
629   - int wordlen;
630   - enchant_dict *pdict;
631   -
632   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
633   - RETURN_FALSE;
634   - }
635   -
636   - PHP_ENCHANT_GET_DICT;
637   -
638   - enchant_dict_add_to_session(pdict->pdict, word, wordlen);
639   -}
640   -/* }}} */
641   -
642   -/* {{{ proto bool enchant_dict_is_in_session(resource dict, string word)
643   - whether or not 'word' exists in this spelling-session */
644   -PHP_FUNCTION(enchant_dict_is_in_session)
645   -{
646   - zval *dict;
647   - char *word;
648   - int wordlen;
649   - enchant_dict *pdict;
650   -
651   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
652   - RETURN_FALSE;
653   - }
654   -
655   - PHP_ENCHANT_GET_DICT;
656   -
657   - RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
658   -}
659   -/* }}} */
660   -
661   -/* {{{ proto void enchant_dict_store_replacement(resource dict, string mis, string cor)
662   - add a correction for 'mis' using 'cor'.
663   - Notes that you replaced @mis with @cor, so it's possibly more likely
664   - that future occurrences of @mis will be replaced with @cor. So it might
665   - bump @cor up in the suggestion list.*/
666   -PHP_FUNCTION(enchant_dict_store_replacement)
667   -{
668   - zval *dict;
669   - char *mis, *cor;
670   - int mislen, corlen;
671   -
672   - enchant_dict *pdict;
673   -
674   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) {
675   - RETURN_FALSE;
676   - }
677   -
678   - PHP_ENCHANT_GET_DICT;
679   -
680   - enchant_dict_store_replacement(pdict->pdict, mis, mislen, cor, corlen);
681   -}
682   -/* }}} */
683   -
684   -/* {{{ proto string enchant_dict_get_error(resource dict)
685   - Returns the last error of the current spelling-session */
686   -PHP_FUNCTION(enchant_dict_get_error)
687   -{
688   - zval *dict;
689   - enchant_dict *pdict;
690   - char *msg;
691   -
692   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
693   - RETURN_FALSE;
694   - }
695   -
696   - PHP_ENCHANT_GET_DICT;
697   -
698   - msg = enchant_dict_get_error(pdict->pdict);
699   - if (msg) {
700   - RETURN_STRING((char *)msg, 1);
701   - }
702   -
703   - RETURN_FALSE;
704   -}
705   -/* }}} */
706   -
707   -/* {{{ proto array enchant_dict_describe(resource dict)
708   - Describes an individual dictionary 'dict' */
709   -PHP_FUNCTION(enchant_dict_describe)
710   -{
711   - zval *dict;
712   - enchant_dict *pdict;
713   -
714   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
715   - RETURN_FALSE;
716   - }
717   -
718   - PHP_ENCHANT_GET_DICT;
719   -
720   - enchant_dict_describe(pdict->pdict, describe_dict_fn, (void *)return_value);
721   -}
722   -/* }}} */
723   -
724   -/*
725   - * Local variables:
726   - * tab-width: 4
727   - * c-basic-offset: 4
728   - * End:
729   - * vim600: noet sw=4 ts=4 fdm=marker
730   - * vim<600: noet sw=4 ts=4
731   - */
83 ext/enchant/package.xml
... ... @@ -1,83 +0,0 @@
1   -<?xml version="1.0" encoding="ISO-8859-1" ?>
2   -<!DOCTYPE package SYSTEM "../pear/package.dtd">
3   -<package>
4   - <name>enchant</name>
5   - <summary>libenchant binder, support near all spelling tools</summary>
6   - <maintainers>
7   - <maintainer>
8   - <user>pajoye</user>
9   - <name>Pierre-Alain Joye</name>
10   - <email>paj@pearfr.org</email>
11   - <role>lead</role>
12   - </maintainer>
13   - <maintainer>
14   - <user>iliaa</user>
15   - <name>Ilia Alshanetsky</name>
16   - <email>ilia@php.net</email>
17   - <role>lead</role>
18   - </maintainer>
19   - </maintainers>
20   - <description>Enchant is a binder for libenchant. Libenchant provides a common
21   -API for many spell libraries:
22   -- aspell/pspell (intended to replace ispell)
23   -- hspell (hebrew)
24   -- ispell
25   -- myspell (OpenOffice project, mozilla)
26   -- uspell (primarily Yiddish, Hebrew, and Eastern European languages)
27   -A plugin system allows to add custom spell support.
28   -see www.abisource.com/enchant/</description>
29   - <license>PHP</license>
30   - <release>
31   - <state>stable</state>
32   - <version>1.0</version>
33   - <date>2004-08-11</date>
34   - <notes>- Fixed leak inside MINFO function.
35   -- Fixed crash inside enchant_dict_suggest() when there are no suggestions.
36   -- Added missing safe_mode/open_basedir check inside enchant_broker_request_pwl_dict().
37   -- Fixed various function prototypes.
38   -- Fixed possible leak in suggestions result.</notes>
39   - <filelist>
40   - <file role="src" name="config.m4"/>
41   - <file role="src" name="config.w32"/>
42   - <file role="src" name="enchant.c"/>
43   - <file role="src" name="php_enchant.h"/>
44   - <file role="doc" name="CREDITS"/>
45   - <dir name="docs" role="doc">
46   - <dir name="examples">
47   - <file name="example1.php"/>
48   - </dir>
49   - </dir>
50   - </filelist>
51   - <configureoptions>
52   - <configureoption name="with-enchant" default="shared" prompt="libenchant prefix?"/>
53   - </configureoptions>
54   - <deps>
55   - <dep type="php" rel="ge" version="5" />
56   - </deps>
57   - </release>
58   - <changelog>
59   - <release>
60   - <state>beta</state>
61   - <version>0.2.1</version>
62   - <date>2004-03-11</date>
63   - <notes>- Fix possible leak in suggestions result
64   -- Move to beta status</notes>
65   - </release>
66   - <release>
67   - <state>alpha</state>
68   - <version>0.2.0</version>
69   - <notes>- Add Ilia Alshanetsky as maintainer
70   -- Cleanup sources codes (ilia)
71   -- Add enchant_dict_quick_check (ilia)</notes>
72   - </release>
73   - <release>
74   - <version>0.1</version>
75   - <state>alpha</state>
76   - <date>2003-03-08</date>
77   - <notes>Initial release</notes>
78   - </release>
79   - </changelog>
80   -</package>
81   -<!--
82   -vim:et:ts=1:sw=1
83   --->
80 ext/enchant/php_enchant.h
... ... @@ -1,80 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 4 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2003 The PHP Group |
6   - +----------------------------------------------------------------------+
7   - | This source file is subject to version 3.0 of the PHP license, |
8   - | that is bundled with this package in the file LICENSE, and is |
9   - | available at through the world-wide-web at |
10   - | http://www.php.net/license/3_0.txt. |
11   - | If you did not receive a copy of the PHP license and are unable to |
12   - | obtain it through the world-wide-web, please send a note to |
13   - | license@php.net so we can mail you a copy immediately. |
14   - +----------------------------------------------------------------------+
15   - | Author: Pierre-Alain Joye <paj@pearfr.org> |
16   - +----------------------------------------------------------------------+
17   -
18   - $Id$
19   -*/
20   -
21   -#ifndef PHP_ENCHANT_H
22   -#define PHP_ENCHANT_H
23   -
24   -extern zend_module_entry enchant_module_entry;
25   -#define phpext_enchant_ptr &enchant_module_entry
26   -
27   -#ifdef PHP_WIN32
28   -#define PHP_ENCHANT_API __declspec(dllexport)
29   -#else
30   -#define PHP_ENCHANT_API
31   -#endif
32   -
33   -#ifdef ZTS
34   -#include "TSRM.h"
35   -#endif
36   -
37   -static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
38   -static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
39   -
40   -PHP_MINIT_FUNCTION(enchant);
41   -PHP_MSHUTDOWN_FUNCTION(enchant);
42   -PHP_MINFO_FUNCTION(enchant);
43   -
44   -PHP_FUNCTION(enchant_broker_init);
45   -PHP_FUNCTION(enchant_broker_free);
46   -PHP_FUNCTION(enchant_broker_get_error);
47   -PHP_FUNCTION(enchant_broker_request_dict);
48   -PHP_FUNCTION(enchant_broker_request_pwl_dict);
49   -PHP_FUNCTION(enchant_broker_free_dict);
50   -PHP_FUNCTION(enchant_broker_dict_exists);
51   -PHP_FUNCTION(enchant_broker_set_ordering);
52   -PHP_FUNCTION(enchant_broker_describe);
53   -
54   -PHP_FUNCTION(enchant_dict_check);
55   -PHP_FUNCTION(enchant_dict_suggest);
56   -PHP_FUNCTION(enchant_dict_add_to_personal);
57   -PHP_FUNCTION(enchant_dict_add_to_session);
58   -PHP_FUNCTION(enchant_dict_is_in_session);
59   -PHP_FUNCTION(enchant_dict_store_replacement);
60   -PHP_FUNCTION(enchant_dict_get_error);
61   -PHP_FUNCTION(enchant_dict_describe);
62   -PHP_FUNCTION(enchant_dict_quick_check);
63   -
64   -#ifdef ZTS
65   -#define ENCHANT_G(v) TSRMG(enchant_globals_id, zend_enchant_globals *, v)
66   -#else
67   -#define ENCHANT_G(v) (enchant_globals.v)
68   -#endif
69   -
70   -#endif /* PHP_ENCHANT_H */
71   -
72   -
73   -/*
74   - * Local variables:
75   - * tab-width: 4
76   - * c-basic-offset: 4
77   - * indent-tabs-mode: t
78   - * End:
79   - */
80   -
2  ext/fileinfo/CREDITS
... ... @@ -1,2 +0,0 @@
1   -fileinfo
2   -Ilia Alshanetsky
0  ext/fileinfo/EXPERIMENTAL
No changes.
54 ext/fileinfo/config.m4
... ... @@ -1,54 +0,0 @@
1   -dnl $Id$
2   -dnl config.m4 for extension fileinfo
3   -
4   -PHP_ARG_WITH(fileinfo, for fileinfo support,
5   -[ --with-fileinfo=DIR Include fileinfo support])
6   -
7   -if test "$PHP_FILEINFO" != "no"; then
8   - SEARCH_PATH="/usr/local /usr"
9   - SEARCH_FOR="/include/magic.h"
10   - if test -r $PHP_FILEINFO/$SEARCH_FOR; then
11   - FILEINFO_DIR=$PHP_FILEINFO
12   - else
13   - AC_MSG_CHECKING([for magic files in default path])
14   - for i in $SEARCH_PATH ; do
15   - if test -r $i/$SEARCH_FOR; then
16   - FILEINFO_DIR=$i
17   - AC_MSG_RESULT(found in $i)
18   - fi
19   - done
20   - fi
21   -
22   - if test -z "$FILEINFO_DIR"; then
23   - AC_MSG_RESULT([not found])
24   - AC_MSG_ERROR([Please reinstall the libmagic distribution])
25   - fi
26   -
27   - PHP_ADD_INCLUDE($FILEINFO_DIR/include)
28   -
29   - LIBNAME=magic
30   - LIBSYMBOL=magic_open
31   -
32   - PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
33   - [
34   - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $FILEINFO_DIR/lib, FILEINFO_SHARED_LIBADD)
35   - AC_DEFINE(HAVE_FILEINFOLIB,1,[ ])
36   - ],[
37   - AC_MSG_ERROR([wrong magic lib version or lib not found])
38   - ],[
39   - -L$FILEINFO_DIR/lib -lm -ldl
40   - ])
41   -
42   - MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /usr/share/misc/file/magic /etc/magic"
43   - for i in $MAGIC_MIME_LOCATIONS; do
44   - if test -f $i; then
45   - PHP_DEFAULT_MAGIC_FILE=$i
46   - break
47   - fi
48   - done
49   - AC_DEFINE_UNQUOTED(PHP_DEFAULT_MAGIC_FILE,"$PHP_DEFAULT_MAGIC_FILE",[magic file path])
50   -
51   - PHP_SUBST(FILEINFO_SHARED_LIBADD)
52   -
53   - PHP_NEW_EXTENSION(fileinfo, fileinfo.c, $ext_shared)
54   -fi
433 ext/fileinfo/fileinfo.c
... ... @@ -1,433 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 5 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2004 The PHP Group |
6   - +----------------------------------------------------------------------+
7   - | This source file is subject to version 3.0 of the PHP license, |
8   - | that is bundled with this package in the file LICENSE, and is |
9   - | available through the world-wide-web at the following url: |
10   - | http://www.php.net/license/3_0.txt. |
11   - | If you did not receive a copy of the PHP license and are unable to |
12   - | obtain it through the world-wide-web, please send a note to |
13   - | license@php.net so we can mail you a copy immediately. |
14   - +----------------------------------------------------------------------+
15   - | Author: Ilia Alshanetsky <ilia@php.net> |
16   - +----------------------------------------------------------------------+
17   -*/
18   -
19   -/* $Id$ */
20   -
21   -#ifdef HAVE_CONFIG_H
22   -#include "config.h"
23   -#endif
24   -
25   -#include <magic.h>
26   -/*
27   - * HOWMANY specifies the maximum offset libmagic will look at
28   - * this is currently hardcoded in the libmagic source but not exported
29   - */
30   -#ifndef HOWMANY
31   -#define HOWMANY 65536
32   -#endif
33   -
34   -
35   -#include "php.h"
36   -#include "php_ini.h"
37   -#include "ext/standard/info.h"
38   -#include "ext/standard/file.h" /* needed for context stuff */
39   -#include "php_fileinfo.h"
40   -#include "fopen_wrappers.h" /* needed for is_url */
41   -
42   -struct php_fileinfo {
43   - long options;
44   - struct magic_set *magic;
45   -};
46   -
47   -#ifndef PHP_DEFAULT_MAGIC_FILE
48   -#define PHP_DEFAULT_MAGIC_FILE NULL
49   -#endif
50   -
51   -#ifdef ZEND_ENGINE_2
52   -
53   -static zend_object_handlers finfo_object_handlers;
54   -zend_class_entry *finfo_class_entry;
55   -
56   -struct finfo_object {
57   - zend_object zo;
58   - struct php_fileinfo *ptr;
59   -};
60   -
61   -#define FILEINFO_DECLARE_INIT_OBJECT(object) \
62   - zval *object = getThis();
63   -
64   -#define FILEINFO_REGISTER_OBJECT(_object, _ptr) \
65   -{ \
66   - struct finfo_object *obj; \
67   - obj = (struct finfo_object*)zend_object_store_get_object(_object TSRMLS_CC); \
68   - obj->ptr = _ptr; \
69   -}
70   -
71   -#define FILEINFO_FROM_OBJECT(finfo, object) \
72   -{ \
73   - struct finfo_object *obj = zend_object_store_get_object(object TSRMLS_CC); \
74   - finfo = obj->ptr; \
75   - if (!finfo) { \