Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 with 0 additions and 16,535 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 −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
View
@@ -1,2 +0,0 @@
-enchant
-Pierre-Alain Joye, Ilia Alshanetsky
36 ext/enchant/config.m4
View
@@ -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
13 ext/enchant/config.w32
View
@@ -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');
- }
-}
25 ext/enchant/docs/examples/example1.php
View
@@ -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);
-?>
731 ext/enchant/enchant.c
View
@@ -1,731 +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_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_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;
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-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", "@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_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 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, &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, &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
- */
83 ext/enchant/package.xml
View
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>enchant</name>
- <summary>libenchant binder, support near all spelling tools</summary>
- <maintainers>
- <maintainer>
- <user>pajoye</user>
- <name>Pierre-Alain Joye</name>
- <email>paj@pearfr.org</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>ilia@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <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 (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>
- <license>PHP</license>
- <release>
- <state>stable</state>
- <version>1.0</version>
- <date>2004-08-11</date>
- <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>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="enchant.c"/>
- <file role="src" name="php_enchant.h"/>
- <file role="doc" name="CREDITS"/>
- <dir name="docs" role="doc">
- <dir name="examples">
- <file name="example1.php"/>
- </dir>
- </dir>
- </filelist>
- <configureoptions>
- <configureoption name="with-enchant" default="shared" prompt="libenchant prefix?"/>
- </configureoptions>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
- <changelog>
- <release>
- <state>beta</state>
- <version>0.2.1</version>
- <date>2004-03-11</date>
- <notes>- Fix possible leak in suggestions result
-- Move to beta status</notes>
- </release>
- <release>
- <state>alpha</state>
- <version>0.2.0</version>
- <notes>- Add Ilia Alshanetsky as maintainer
-- Cleanup sources codes (ilia)
-- Add enchant_dict_quick_check (ilia)</notes>
- </release>
- <release>
- <version>0.1</version>
- <state>alpha</state>
- <date>2003-03-08</date>
- <notes>Initial release</notes>
- </release>
- </changelog>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
80 ext/enchant/php_enchant.h
View
@@ -1,80 +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_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:
- */
-
2  ext/fileinfo/CREDITS
View
@@ -1,2 +0,0 @@
-fileinfo
-Ilia Alshanetsky
0  ext/fileinfo/EXPERIMENTAL
View
No changes.
54 ext/fileinfo/config.m4
View
@@ -1,54 +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"
- SEARCH_FOR="/include/magic.h"
- if test -r $PHP_FILEINFO/$SEARCH_FOR; 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/$SEARCH_FOR; then
- FILEINFO_DIR=$i
- AC_MSG_RESULT(found in $i)
- fi
- done
- fi
-
- if test -z "$FILEINFO_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Please reinstall the libmagic distribution])
- fi
-
- PHP_ADD_INCLUDE($FILEINFO_DIR/include)
-
- LIBNAME=magic
- LIBSYMBOL=magic_open
-
- 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 -lm -ldl
- ])
-
- MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /usr/share/misc/file/magic /etc/magic"
- 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
433 ext/fileinfo/fileinfo.c
View
@@ -1,433 +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 <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.h"
-#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 = emalloc(sizeof(struct finfo_object));
- intern->zo.ce = class_type;
- intern->zo.in_get = 0;
- intern->zo.in_set = 0;
- intern->zo.properties = NULL;
- 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);
- efree(finfo);
- magic_close(finfo->magic);
- 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_DC);
- 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
- */
29 ext/fileinfo/fileinfo.php
View
@@ -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";
-}
-?>
43 ext/fileinfo/package.xml
View
@@ -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>beta</state>
- <version>0.2</version>
- <date>2004-05-26</date>
- <notes>
- Fixed bug that caused PHP to refuse to recognize fileinfo.so.
- </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
--->
61 ext/fileinfo/php_fileinfo.h
View
@@ -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
- */
103 ext/imap/imap.h
View
@@ -1,103 +0,0 @@
-#ifndef _INCLUDED_IMAP_H
-#define _INCLUDED_IMAP_H
-
-#if COMPILE_DL
-#undef HAVE_IMAP
-#define HAVE_IMAP 1
-#endif
-
-#if HAVE_IMAP
-
-#ifndef PHP_WIN32
-#include "build-defs.h"
-#endif
-
-/* Functions accessable to PHP */
-extern zend_module_entry imap_module_entry;
-#define imap_module_ptr &imap_module_entry
-
-extern PHP_MINIT_FUNCTION(imap);
-extern PHP_RINIT_FUNCTION(imap);
-extern PHP_RSHUTDOWN_FUNCTION(imap);
-PHP_MINFO_FUNCTION(imap);
-PHP_FUNCTION(imap_open);
-PHP_FUNCTION(imap_popen);
-PHP_FUNCTION(imap_reopen);
-PHP_FUNCTION(imap_num_msg);
-PHP_FUNCTION(imap_num_recent);
-PHP_FUNCTION(imap_headers);
-PHP_FUNCTION(imap_headerinfo);
-PHP_FUNCTION(imap_rfc822_parse_headers);
-PHP_FUNCTION(imap_body);
-PHP_FUNCTION(imap_fetchstructure);
-PHP_FUNCTION(imap_fetchbody);
-PHP_FUNCTION(imap_expunge);
-PHP_FUNCTION(imap_delete);
-PHP_FUNCTION(imap_undelete);
-PHP_FUNCTION(imap_check);
-PHP_FUNCTION(imap_close);
-PHP_FUNCTION(imap_mail_copy);
-PHP_FUNCTION(imap_mail_move);
-PHP_FUNCTION(imap_createmailbox);
-PHP_FUNCTION(imap_renamemailbox);
-PHP_FUNCTION(imap_deletemailbox);
-PHP_FUNCTION(imap_listmailbox);
-PHP_FUNCTION(imap_scanmailbox);
-PHP_FUNCTION(imap_subscribe);
-PHP_FUNCTION(imap_unsubscribe);
-PHP_FUNCTION(imap_append);
-PHP_FUNCTION(imap_ping);
-PHP_FUNCTION(imap_base64);
-PHP_FUNCTION(imap_qprint);
-PHP_FUNCTION(imap_8bit);
-PHP_FUNCTION(imap_binary);
-PHP_FUNCTION(imap_mailboxmsginfo);
-PHP_FUNCTION(imap_rfc822_write_address);
-PHP_FUNCTION(imap_rfc822_parse_adrlist);
-PHP_FUNCTION(imap_setflag_full);
-PHP_FUNCTION(imap_clearflag_full);
-PHP_FUNCTION(imap_sort);
-PHP_FUNCTION(imap_fetchheader);
-PHP_FUNCTION(imap_fetchtext);
-PHP_FUNCTION(imap_uid);
-PHP_FUNCTION(imap_msgno);
-PHP_FUNCTION(imap_list);
-PHP_FUNCTION(imap_list_full);
-PHP_FUNCTION(imap_listscan);
-PHP_FUNCTION(imap_lsub);
-PHP_FUNCTION(imap_lsub_full);
-PHP_FUNCTION(imap_create);
-PHP_FUNCTION(imap_rename);
-PHP_FUNCTION(imap_status);
-PHP_FUNCTION(imap_bodystruct);
-PHP_FUNCTION(imap_fetch_overview);
-PHP_FUNCTION(imap_mail_compose);
-PHP_FUNCTION(imap_alerts);
-PHP_FUNCTION(imap_errors);
-PHP_FUNCTION(imap_last_error);
-PHP_FUNCTION(imap_mail);
-PHP_FUNCTION(imap_search);
-PHP_FUNCTION(imap_utf8);
-PHP_FUNCTION(imap_utf7_decode);
-PHP_FUNCTION(imap_utf7_encode);
-PHP_FUNCTION(imap_mime_header_decode);
-#else
-#define imap_module_ptr NULL
-#endif /* HAVE_IMAP */
-
-#endif
-
-
-
-
-
-
-#define phpext_imap_ptr imap_module_ptr
-
-
-
-
-
-
-
-
56 ext/pcre/config0.m4
View
@@ -1,56 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-dnl By default we'll compile and link against the bundled PCRE library
-dnl if DIR is supplied, we'll use that for linking
-
-PHP_ARG_WITH(pcre-regex,for PCRE support,
-[ --without-pcre-regex Do not include Perl Compatible Regular Expressions
- support. Use --with-pcre-regex=DIR to specify DIR
- where PCRE's include and library files are located,
- if not using bundled library.],yes)
-
-if test "$PHP_PCRE_REGEX" != "no"; then
- if test "$PHP_PCRE_REGEX" = "yes"; then
- PHP_NEW_EXTENSION(pcre, pcrelib/maketables.c pcrelib/get.c pcrelib/study.c pcrelib/pcre.c php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -I@ext_srcdir@/pcrelib)
- PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
- AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
- else
- for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do
- test -f $i/pcre.h && PCRE_INCDIR=$i
- done
-
- if test -z "$PCRE_INCDIR"; then
- AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX])
- fi
-
- for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/lib; do
- test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
- done
-
- if test -z "$PCRE_LIBDIR" ; then
- AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX])
- fi
-
- changequote({,})
- pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
- pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
- changequote([,])
- pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'`
- if test "$pcre_minor_length" -eq 2 ; then
- pcre_minor="$pcre_minor"0
- fi
- pcre_version=$pcre_major$pcre_minor
- if test "$pcre_version" -lt 208; then
- AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 2.08])
- fi
-
- PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
-
- AC_DEFINE(HAVE_PCRE, 1, [ ])
- PHP_ADD_INCLUDE($PCRE_INCDIR)
- PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10)
- fi
- PHP_SUBST(PCRE_SHARED_LIBADD)
-fi
2  ext/pdo/CREDITS
View
@@ -1,2 +0,0 @@
-PHP Data Objects
-Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle
0  ext/pdo/EXPERIMENTAL
View
No changes.
31 ext/pdo/Makefile.frag
View
@@ -1,31 +0,0 @@
-phpincludedir=$(prefix)/include/php
-
-PDO_HEADER_FILES= \
- php_pdo.h \
- php_pdo_driver.h
-
-install-pdo-headers:
- echo "Installing PDO headers: $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/"
- $(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/pdo
- for f in $(PDO_HEADER_FILES); do \
- if test -f "$(top_srcdir)/$$f"; then \
- $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
- elif test -f "$(top_builddir)/$$f"; then \
- $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
- elif test -f "$(top_srcdir)/ext/pdo/$$f"; then \
- $(INSTALL_DATA) $(top_srcdir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
- elif test -f "$(top_builddir)/ext/pdo/$$f"; then \
- $(INSTALL_DATA) $(top_builddir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
- else \
- echo "hmmm"; \
- fi \
- done;
-
-# mini hack
-install: $(all_targets) $(install_targets) install-pdo-headers
-
-$(top_srcdir)/ext/pdo/pdo_sql_parser.c: $(top_srcdir)/ext/pdo/pdo_sql_parser.re
- re2c -b $(top_srcdir)/ext/pdo/pdo_sql_parser.re > $@
-
-$(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re
- re2c -b $(srcdir)/pdo_sql_parser.re > $@
56 ext/pdo/README
View
@@ -1,56 +0,0 @@
-$Id$
-
-PHP Data Objects
-================
-
-Concept: Data Access Abstraction
-
-Goals:
-
-1/ Be light-weight
-2/ Provide common API for common database operations
-3/ Be performant
-4/ Keep majority of PHP specific stuff in the PDO core (such as persistent
- resource management); drivers should only have to worry about getting the
- data and not about PHP internals.
-
-
-Transactions and autocommit
-===========================
-
-When you create a database handle, you *should* specify the autocommit
-behaviour that you require. PDO will default to autocommit on.
-
-$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => true));
-
-When auto-commit is on, the driver will implicitly commit each query as it is
-executed. This works fine for most simple tasks but can be significantly
-slower when you are making a large number of udpates.
-
-$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => false));
-
-When auto-commit is off, you must then use $dbh->beginWork() to initiate a
-transaction. When your work is done, you then call $dbh->commit() or
-$dbh->rollBack() to persist or abort your changes respectively.
-Not all databases support transactions.
-
-You can change the auto-commit mode at run-time:
-
-$dbh->setAttribute(PDO_ATTR_AUTOCOMMIT, false);
-
-Regardless of the error handling mode set on the database handle, if the
-autocommit mode cannot be changed, an exception will be thrown.
-
-Some drivers will allow you to temporarily disable autocommit if you call
-$dbh->beginWork(). When you commit() or rollBack() such a transaction, the
-handle will switch back to autocommit mode again. If the mode could not be
-changed, an exception will be raised, as noted above.
-
-When the database handle is closed or destroyed (or at request end for
-persistent handles), the driver will implicitly rollBack(). It is your
-responsibility to call commit() when you are done making changes and
-autocommit is turned off.
-
-vim:tw=78:et
-
-
21 ext/pdo/TODO
View
@@ -1,21 +0,0 @@
-$Id$
-
-In no particular order:
-
-Low-level:
-
-- $dbh->quote()
-- Scrollable cursors
-- meta data from driver, such as server version and supported features
-- field meta data from statement handles
-- LOB support via Streams API
-- iterator support
-- make errors generated at the pdo level (as opposed to driver level) use the
- selected error mode.
-
-Not-so-low-level:
-- fetchAll(), single row, single column fetches etc.
-
-Could be more...
-
-vim:tw=78:et
10 ext/pdo/config.m4
View
@@ -1,10 +0,0 @@
-dnl $Id$
-dnl config.m4 for extension pdo
-
-PHP_ARG_ENABLE(pdo, whether to enable PDO support,
-[ --enable-pdo Enable PHP Data Objects support])
-
-if test "$PHP_PDO" != "no"; then
- PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c, $ext_shared)
- PHP_ADD_MAKEFILE_FRAGMENT
-fi
9 ext/pdo/config.w32
View
@@ -1,9 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-ARG_ENABLE("pdo", "Enable PHP Data Objects support", "no");
-
-if (PHP_PDO != "no") {
- EXTENSION('pdo', 'pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c');
-}
-
84 ext/pdo/package.xml
View
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package version="1.0">
- <name>PDO</name>
- <summary>PHP Data Objects Interface</summary>
- <maintainers>
- <maintainer>
- <user>wez</user>
- <name>Wez Furlong</name>
- <email>wez@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>helly</user>
- <name>Marcus Boerger</name>
- <email>helly@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>iliaa@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>gschlossnagle</user>
- <name>George Schlossnagle</name>
- <email>george@omniti.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
- PDO provides a uniform data access interface, sporting advanced features such
- as prepared statements and bound parameters. PDO drivers are dynamically
- loadable and may be developed independently from the core, but still accessed
- using the same API.
- </description>
- <license>PHP</license>
- <release>
- <state>alpha</state>
- <version>0.1.1</version>
- <date>2004-05-21</date>
-
- <notes>
-Note that PDO on its own is useless.
-You need to install a PDO database driver to make use of it,
-check http://pecl.php.net for a list of available PDO drivers.
-
-It is highly recommended that you update to the latest PHP 5 snapshot before using PDO.
-You can obtain it from http://snaps.php.net.
-
-If you are running on Windows, you should download:
-http://snaps.php.net/win32/php5-win32-latest.zip
-http://snaps.php.net/win32/PECL_5_0/php_pdo.dll
-
-You can find additional PDO drivers at:
-http://snaps.php.net/win32/PECL_5_0/
-
- </notes>
-
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="pdo.c"/>
- <file role="src" name="pdo_dbh.c"/>
- <file role="src" name="pdo_stmt.c"/>
- <file role="src" name="php_pdo.h"/>
- <file role="src" name="php_pdo_driver.h"/>
- <file role="src" name="php_pdo_int.h"/>
- <file role="src" name="pdo_sql_parser.re"/>
- <file role="src" name="pdo_sql_parser.c"/>
- <file role="src" name="php_pdo_sql_parser.h"/>
- <file role="src" name="Makefile.frag"/>
-
- <file role="doc" name="README"/>
- <file role="doc" name="TODO"/>
- <file role="doc" name="pdo.php"/>
- <file role="doc" name="CREDITS"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5.0.0RC3-dev"/>
- </deps>
- </release>
-</package>
327 ext/pdo/pdo.c
View
@@ -1,327 +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: Wez Furlong <wez@php.net> |
- | Marcus Boerger <helly@php.net> |
- | Sterling Hughes <sterling@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_pdo.h"
-#include "php_pdo_driver.h"
-#include "php_pdo_int.h"
-#include "zend_exceptions.h"
-
-ZEND_DECLARE_MODULE_GLOBALS(pdo)
-
-/* True global resources - no need for thread safety here */
-
-/* the registry of PDO drivers */
-static HashTable pdo_driver_hash;
-
-/* we use persistent resources for the driver connection stuff */
-static int le_ppdo;
-
-int php_pdo_list_entry(void)
-{
- return le_ppdo;
-}
-
-/* for exceptional circumstances */
-zend_class_entry *pdo_exception_ce;
-
-PDO_API zend_class_entry *php_pdo_get_exception(void)
-{
- return pdo_exception_ce;
-}
-
-zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
-
-/* {{{ pdo_functions[] */
-function_entry pdo_functions[] = {
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ pdo_module_entry */
-zend_module_entry pdo_module_entry = {
- STANDARD_MODULE_HEADER,
- "PDO",
- pdo_functions,
- PHP_MINIT(pdo),
- PHP_MSHUTDOWN(pdo),
- PHP_RINIT(pdo),
- PHP_RSHUTDOWN(pdo),
- PHP_MINFO(pdo),
- "0.1.1",
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-#ifdef COMPILE_DL_PDO
-ZEND_GET_MODULE(pdo)
-#endif
-
-/* {{{ PHP_INI */
-PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("pdo.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_pdo_globals, pdo_globals)
-PHP_INI_END()
-/* }}} */
-
-/* {{{ php_pdo_init_globals */
-static void php_pdo_init_globals(zend_pdo_globals *pdo_globals)
-{
- pdo_globals->global_value = 0;
-}
-/* }}} */
-
-PDO_API int php_pdo_register_driver(pdo_driver_t *driver)
-{
- if (driver->api_version != PDO_DRIVER_API) {
- zend_error(E_ERROR, "PDO: driver %s requires PDO API version %ld; this is PDO version %d",
- driver->driver_name, driver->api_version, PDO_DRIVER_API);
- return FAILURE;
- }
- if (!zend_hash_exists(&module_registry, "pdo", sizeof("pdo"))) {
- zend_error(E_ERROR, "You MUST load PDO before loading any PDO drivers");
- return FAILURE; /* NOTREACHED */
- }
-
- return zend_hash_add(&pdo_driver_hash, (char*)driver->driver_name, driver->driver_name_len,
- (void**)&driver, sizeof(driver), NULL);
-}
-
-PDO_API void php_pdo_unregister_driver(pdo_driver_t *driver)
-{
- if (!zend_hash_exists(&module_registry, "pdo", sizeof("pdo"))) {
- return;
- }
-
- zend_hash_del(&pdo_driver_hash, (char*)driver->driver_name, driver->driver_name_len);
-}
-
-pdo_driver_t *pdo_find_driver(const char *name, int namelen)
-{
- pdo_driver_t **driver = NULL;
-
- zend_hash_find(&pdo_driver_hash, (char*)name, namelen, (void**)&driver);
-
- return driver ? *driver : NULL;
-}
-
-PDO_API int php_pdo_parse_data_source(const char *data_source,
- unsigned long data_source_len, struct pdo_data_src_parser *parsed,
- int nparams)
-{
- int i, j;
- int valstart = -1;
- int semi = -1;
- int optstart = 0;
- int nlen;
- int n_matches = 0;
-
- i = 0;
- while (i < data_source_len) {
- /* looking for NAME= */
-
- if (data_source[i] == '\0') {
- break;
- }
-
- if (data_source[i] != '=') {
- ++i;
- continue;
- }
-
- valstart = ++i;
-
- /* now we're looking for VALUE; or just VALUE<NUL> */
- semi = -1;
- while (i < data_source_len) {
- if (data_source[i] == '\0') {
- semi = i++;
- break;
- }
- if (data_source[i] == ';') {
- semi = i++;
- break;
- }
- ++i;
- }
-
- if (semi == -1) {
- semi = i;
- }
-
- /* find the entry in the array */
- nlen = valstart - optstart - 1;
- for (j = 0; j < nparams; j++) {
- if (0 == strncmp(data_source + optstart, parsed[j].optname, nlen) && parsed[j].optname[nlen] == '\0') {
- /* got a match */
- if (parsed[j].freeme) {
- efree(parsed[j].optval);
- }
- parsed[j].optval = estrndup(data_source + valstart, semi - valstart);
- parsed[j].freeme = 1;
- ++n_matches;
- break;
- }
- }
-
- while (i < data_source_len && isspace(data_source[i])) {
- i++;
- }
-
- optstart = i;
- }
-
- return n_matches;
-}
-
-
-/* {{{ PHP_MINIT_FUNCTION */
-PHP_MINIT_FUNCTION(pdo)
-{
- zend_class_entry ce;
-
- ZEND_INIT_MODULE_GLOBALS(pdo, php_pdo_init_globals, NULL);
- REGISTER_INI_ENTRIES();
-
- zend_hash_init(&pdo_driver_hash, 0, NULL, NULL, 1);
-
- le_ppdo = zend_register_list_destructors_ex(NULL, php_pdo_pdbh_dtor,
- "PDO persistent database", module_number);
-
- REGISTER_LONG_CONSTANT("PDO_PARAM_NULL", (long)PDO_PARAM_NULL, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_PARAM_INT", (long)PDO_PARAM_INT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_PARAM_STR", (long)PDO_PARAM_STR, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_PARAM_LOB", (long)PDO_PARAM_LOB, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_PARAM_STMT", (long)PDO_PARAM_STMT, CONST_CS|CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("PDO_FETCH_LAZY", (long)PDO_FETCH_LAZY, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_FETCH_ASSOC",(long)PDO_FETCH_ASSOC, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_FETCH_NUM", (long)PDO_FETCH_NUM, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_FETCH_BOTH", (long)PDO_FETCH_BOTH, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_FETCH_OBJ", (long)PDO_FETCH_OBJ, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_FETCH_BOUND",(long)PDO_FETCH_BOUND, CONST_CS|CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("PDO_ATTR_AUTOCOMMIT", (long)PDO_ATTR_AUTOCOMMIT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_SCROLL", (long)PDO_ATTR_SCROLL, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_PREFETCH", (long)PDO_ATTR_PREFETCH, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_TIMEOUT", (long)PDO_ATTR_TIMEOUT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_ERRMODE", (long)PDO_ATTR_ERRMODE, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_SERVER_VERSION", (long)PDO_ATTR_SERVER_VERSION, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_CLIENT_VERSION", (long)PDO_ATTR_CLIENT_VERSION, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_SERVER_INFO", (long)PDO_ATTR_SERVER_INFO, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_CONNECTION_STATUS", (long)PDO_ATTR_CONNECTION_STATUS, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_CASE", (long)PDO_ATTR_CASE, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_CURSOR_NAME", (long)PDO_ATTR_CURSOR_NAME, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_CURSOR", (long)PDO_ATTR_CURSOR, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_ORACLE_NULLS", (long)PDO_ATTR_ORACLE_NULLS, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ATTR_PERSISTENT", (long)PDO_ATTR_PERSISTENT, CONST_CS|CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("PDO_ERRMODE_SILENT", (long)PDO_ERRMODE_SILENT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERRMODE_WARNING", (long)PDO_ERRMODE_WARNING, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERRMODE_EXCEPTION", (long)PDO_ERRMODE_EXCEPTION, CONST_CS|CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("PDO_CASE_NATURAL", (long)PDO_CASE_NATURAL, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_CASE_LOWER", (long)PDO_CASE_LOWER, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_CASE_UPPER", (long)PDO_CASE_UPPER, CONST_CS|CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("PDO_ERR_NONE", (long)PDO_ERR_NONE, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_CANT_MAP", (long)PDO_ERR_CANT_MAP, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_SYNTAX", (long)PDO_ERR_SYNTAX, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_CONSTRAINT", (long)PDO_ERR_CONSTRAINT, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_NOT_FOUND", (long)PDO_ERR_NOT_FOUND, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_ALREADY_EXISTS", (long)PDO_ERR_ALREADY_EXISTS, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_NOT_IMPLEMENTED", (long)PDO_ERR_NOT_IMPLEMENTED, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_MISMATCH", (long)PDO_ERR_MISMATCH, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_TRUNCATED", (long)PDO_ERR_TRUNCATED, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_DISCONNECTED", (long)PDO_ERR_DISCONNECTED, CONST_CS|CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("PDO_ERR_NO_PERM", (long)PDO_ERR_NO_PERM, CONST_CS|CONST_PERSISTENT);
-
- INIT_CLASS_ENTRY(ce, "PDOException", NULL);
- pdo_exception_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC);
- zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
-
- INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions);
- ce.create_object = pdo_dbh_new;
- pdo_dbh_ce = zend_register_internal_class(&ce TSRMLS_CC);
-
- INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions);
- ce.create_object = pdo_dbstmt_new;
- pdo_dbstmt_ce = zend_register_internal_class(&ce TSRMLS_CC);
-
- INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions);
- ce.create_object = pdo_row_new;
- pdo_row_ce = zend_register_internal_class(&ce TSRMLS_CC);
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION */
-PHP_MSHUTDOWN_FUNCTION(pdo)
-{
- UNREGISTER_INI_ENTRIES();
- zend_hash_destroy(&pdo_driver_hash);
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RINIT_FUNCTION */
-PHP_RINIT_FUNCTION(pdo)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION */
-PHP_RSHUTDOWN_FUNCTION(pdo)
-{
- /* TODO: visit persistent handles: for each persistent statement handle,
- * remove bound parameter associations */
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION */
-PHP_MINFO_FUNCTION(pdo)
-{
- php_info_print_table_start();
- php_info_print_table_header(2, "pdo support", "enabled");
- php_info_print_table_end();
-
- DISPLAY_INI_ENTRIES();
-}
-/* }}} */
-
-/*
- * 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
- */
35 ext/pdo/pdo.php
View
@@ -1,35 +0,0 @@
-<?php
-
-//$x = new PDO("oci:dbname=hostname", 'php', 'php');
-$x = new PDO("odbc:ram", 'php', 'php', array(PDO_ATTR_AUTOCOMMIT => 0));
-$stmt = $x->prepare("select NAME, VALUE from test where value like ?");
-
-$the_name = 'bar%';
-$stmt->execute(array($the_name)) or die("failed to execute!");
-$stmt->bindColumn('VALUE', $value);
-
-while ($row = $stmt->fetch()) {
- echo "name=$row[NAME] value=$row[VALUE]\n";
- echo "value is $value\n";
- echo "\n";
-}
-
-echo "Let's try an update\n";
-
-$stmt = $x->prepare("INSERT INTO test (NAME, VALUE) VALUES (:name, :value)");
-
-$stmt->bindParam(":name", $the_name, PDO_PARAM_STR, 32);
-$stmt->bindParam(":value", $the_value, PDO_PARAM_STR, 32);
-
-for ($i = 0; $i < 4; $i++) {
- $the_name = "foo" . rand();
- $the_value = "bar" . rand();
-
- if (!$stmt->execute()) {
- break;
- }
-}
-
-echo "All done\n";
-
-?>
865 ext/pdo/pdo_dbh.c
View
@@ -1,865 +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: Wez Furlong <wez@php.net> |
- | Marcus Boerger <helly@php.net> |
- | Sterling Hughes <sterling@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-/* The PDO Database Handle Class */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_pdo.h"
-#include "php_pdo_driver.h"
-#include "php_pdo_int.h"
-#include "zend_exceptions.h"
-#include "zend_object_handlers.h"
-
-void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC)
-{
- enum pdo_error_type *pdo_err = &dbh->error_code;
- const char *msg = "<<Unknown>>";
- char *supp = NULL;
- long native_code = 0;
- char *message = NULL;
- zval *info = NULL;
-
- if (dbh->error_mode == PDO_ERRMODE_SILENT) {
- return;
- }
-
- if (stmt) {
- pdo_err = &stmt->error_code;
- }
-
- switch (*pdo_err) {
- case PDO_ERR_NONE: msg = "No error"; break;
- case PDO_ERR_CANT_MAP: msg = "Consult errorInfo() for more details"; break;
- case PDO_ERR_SYNTAX: msg = "Syntax Error"; break;
- case PDO_ERR_CONSTRAINT:msg = "Constraint violation"; break;
- case PDO_ERR_NOT_FOUND: msg = "Not found"; break;
- case PDO_ERR_ALREADY_EXISTS: msg = "Already exists"; break;
- case PDO_ERR_NOT_IMPLEMENTED: msg = "Not Implemented"; break;
- case PDO_ERR_MISMATCH: msg = "Mismatch"; break;
- case PDO_ERR_TRUNCATED: msg = "Truncated"; break;
- case PDO_ERR_DISCONNECTED: msg = "Disconnected"; break;
- case PDO_ERR_NO_PERM: msg = "No permission"; break;
- default: msg = "<<Invalid>>";
- }
-
- if (dbh->methods->fetch_err) {
-
- MAKE_STD_ZVAL(info);
- array_init(info);
-
- add_next_index_long(info, *pdo_err);
-
- if (dbh->methods->fetch_err(dbh, stmt, info TSRMLS_CC)) {
- zval **item;
-
- if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(info), 1, (void**)&item)) {
- native_code = Z_LVAL_PP(item);
- }
-
- if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(info), 2, (void**)&