moved dav, msql and oracle to ext/

This commit is contained in:
Stig Bakken 1999-04-21 22:49:16 +00:00
parent 96660d9a8c
commit f67a9bdc52
29 changed files with 7479 additions and 295 deletions

View File

@ -71,18 +71,16 @@ OBJS = main.o internal_functions.o snprintf.o php3_sprintf.o \
FUNCTIONS_SOURCE = functions/apache.c functions/fhttpd.c \
functions/crypt.c functions/db.c functions/dl.c \
functions/head.c functions/imap.c functions/mime.c \
functions/msql.c \
functions/oracle.c functions/oci8.c functions/pgsql.c \
functions/post.c functions/sybase.c \
functions/pgsql.c functions/post.c functions/sybase.c \
functions/sybase-ct.c @BCMATH_SRC@ functions/xml.c \
functions/ldap.c functions/zlib.c functions/COM.c functions/ifx.c \
functions/pdf.c functions/hw.c functions/hg_comm.c functions/dlist.c \
functions/fdf.c functions/snmp.c functions/interbase.c \
functions/sysvsem.c functions/sysvshm.c functions/dav.c
functions/sysvsem.c functions/sysvshm.c
FUNCTIONS = $(FUNCTIONS_SOURCE:.c=.o)
PHPLIBS = -L@top_srcdir@/libzend -lzend -Lext -lphpext
LIBS = $(PHPLIBS) $(EXTRA_LIBS) @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @FHTTPD_LIB@ @REGEX_LIB@ @DBM_LIB@ @ORACLE_LFLAGS@ @ORACLE_LIBS@ @SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @MYSQL_LFLAGS@ @MYSQL_LIBS@ @MSQL_LFLAGS@ @MSQL_LIBS@ @PGSQL_LFLAGS@ @PGSQL_LIBS@ @LDAP_LFLAGS@ @LDAP_LIBS@ @IMAP_LIBS@ @ZLIB_LIBS@ @PDFLIB_LIBS@ @FDFLIB_LIBS@ @IFX_LFLAGS@ @IFX_LIBS@ @SNMP_LFLAGS@ @SNMP_LIBS@ @IBASE_LFLAGS@ @IBASE_LIBS@ @XML_LIBS@ @LIBS@
LIBS = $(PHPLIBS) $(EXTRA_LIBS) @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @FHTTPD_LIB@ @REGEX_LIB@ @DBM_LIB@ @SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @MYSQL_LFLAGS@ @MYSQL_LIBS@ @PGSQL_LFLAGS@ @PGSQL_LIBS@ @LDAP_LFLAGS@ @LDAP_LIBS@ @IMAP_LIBS@ @ZLIB_LIBS@ @PDFLIB_LIBS@ @FDFLIB_LIBS@ @IFX_LFLAGS@ @IFX_LIBS@ @SNMP_LFLAGS@ @SNMP_LIBS@ @IBASE_LFLAGS@ @IBASE_LIBS@ @XML_LIBS@ @LIBS@
all: $(BINNAME)

View File

@ -70,12 +70,6 @@
/* Define if you have the crypt() function */
#define HAVE_CRYPT 1
/* Define if you have the Oracle database client libraries */
#define HAVE_ORACLE 0
/* Define if you have the Oracle version 8 database client libraries */
#define HAVE_OCI8 0
/* Define if you want the LDAP directory interface */
#define HAVE_LDAP 0
@ -124,10 +118,6 @@
#define HAVE_SYBASE 0
#define HAVE_SYBASE_CT 0
#ifndef HAVE_MSQL
#define HAVE_MSQL 0
#endif
#ifndef HAVE_PGSQL
#define HAVE_PGSQL 0
#endif
@ -150,8 +140,6 @@
#define HAVE_PQCMDTUPLES 0
#endif
#define MSQL1 0
#ifndef DEBUG /* should be set to ZEND_DEBUG */
#define DEBUG 0
#endif
@ -209,6 +197,3 @@
/* Define if you have the fdftk library */
#define HAVE_FDFLIB 0
/* Define to compile with mod_dav support */
#define HAVE_MOD_DAV 0

View File

@ -2,37 +2,6 @@ dnl $Id$
dnl
dnl This file contains local autoconf functions.
AC_DEFUN(AC_ORACLE_VERSION,[
AC_MSG_CHECKING([Oracle version])
if test -f "$ORACLEINST_TOP/orainst/unix.rgs"
then
ORACLE_VERSION=`grep '"ocommon"' $ORACLEINST_TOP/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
test -z "$ORACLE_VERSION" && ORACLE_VERSION=7.3
else
ORACLE_VERSION=8.0
fi
AC_MSG_RESULT($ORACLE_VERSION)
])
dnl
dnl Test mSQL version by checking if msql.h has "IDX_TYPE" defined.
dnl
AC_DEFUN(AC_MSQL_VERSION,[
AC_MSG_CHECKING([mSQL version])
ac_php_oldcflags=$CFLAGS
CFLAGS="$MSQL_INCLUDE $CFLAGS";
AC_TRY_COMPILE([#include <sys/types.h>
#include "msql.h"],[int i = IDX_TYPE],[
AC_DEFINE(MSQL1,0)
MSQL_VERSION="2.0 or newer"
],[
AC_DEFINE(MSQL1,1)
MSQL_VERSION="1.0"
])
CFLAGS=$ac_php_oldcflags
AC_MSG_RESULT($MSQL_VERSION)
])
dnl
dnl See if we have broken header files like SunOS has.
dnl

View File

@ -315,7 +315,7 @@ AC_ARG_WITH(apxs,
withval=apxs
fi
APXS="$withval"
APXS_LDFLAGS="@ORACLE_LFLAGS@ @ORACLE_LIBS@ @IODBC_LFLAGS@ @IODBC_LIBS@ @SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @MSQL_LFLAGS@ @MSQL_LIBS@ @ADA_LFLAGS@ @ADA_LIBS@ @SOLID_LIBS@ @EMPRESS_LIBS@ @OPENLINK_LIBS@ @PGSQL_LFLAGS@ @PGSQL_LIBS@ @LDAP_LFLAGS@ @LDAP_LIBS@ @VELOCIS_LIBS@ @CODBC_LFLAGS@ @CODBC_LIBS@ @ZLIB_LIBS@ @PDFLIB_LIBS@ @FDFTK_LIBS@ @IFX_LFLAGS@ @IFX_LIBS@ @IBASE_LFLAGS@ @IBASE_LIBS@"
APXS_LDFLAGS="@ORACLE_LFLAGS@ @ORACLE_LIBS@ @SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @PGSQL_LFLAGS@ @PGSQL_LIBS@ @LDAP_LFLAGS@ @LDAP_LIBS@ @ZLIB_LIBS@ @PDFLIB_LIBS@ @FDFTK_LIBS@ @IFX_LFLAGS@ @IFX_LIBS@ @IBASE_LFLAGS@ @IBASE_LIBS@"
APACHE_INCLUDE="-I`$APXS -q INCLUDEDIR`"
BINNAME=libphp3.so
INSTALL_IT="\$(APXS) -i -a -n php3 $BINNAME"
@ -871,158 +871,6 @@ dnl## AC_SUBST(IMAP_INCLUDE)
])
AC_MSG_CHECKING(for Oracle support)
AC_ARG_WITH(oracle,
[ --with-oracle[=DIR] Include Oracle database support. DIR is Oracle's
home directory, defaults to \$ORACLE_HOME.],
[
case "$withval" in
yes)
ORACLEINST_TOP=$ORACLE_HOME
AC_MSG_RESULT(yes)
;;
no)
ORACLEINST_TOP=
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
ORACLEINST_TOP=$withval
;;
esac
if test "$ORACLEINST_TOP" != ""
then
# Oracle include files
if test -f "$ORACLEINST_TOP/rdbms/public/ocidfn.h"
then
# V8.0.5
ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/rdbms/public"
elif test -f "$ORACLEINST_TOP/rdbms/demo/ocidfn.h"
then
# V7.[0123]
ORACLE_INCLUDE=-I$ORACLEINST_TOP/rdbms/demo
fi
if test -d "$ORACLEINST_TOP/network/public"
then
# V8
ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/network/public"
fi
if test -d "$ORACLEINST_TOP/plsql/public"
then
# V8
ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/plsql/public"
fi
# Need to know the version, otherwhise we will mixup nlsrtl
AC_ORACLE_VERSION($ORACLEINST_TOP)
# Oracle libs - nightmare :-)
ORACLE_LIBDIR=lib
ORACLE_LFLAGS="-L$ORACLEINST_TOP/$ORACLE_LIBDIR ${ld_runpath_switch}$ORACLEINST_TOP/$ORACLE_LIBDIR"
if test -f "$ORACLEINST_TOP/rdbms/lib/sysliblist"
then
ORA_SYSLIB="`cat $ORACLEINST_TOP/rdbms/lib/sysliblist`"
else
ORA_SYSLIB="-lm"
fi
# Oracle Static libs
case $ORACLE_VERSION in
7.0|7.1)
ORACLE_STLIBS="-locic $ORACLEINST_TOP/$ORACLE_LIBDIR/osntab.o \
-lsqlnet -lora -lsqlnet -lnlsrtl -lcv6 -lcore -lnlsrtl -lcv6 \
-lcore $ORA_SYSLIB -lcore $ORA_SYSLIB"
if test "`uname -s 2>/dev/null`" = "AIX"; then
ORACLE_STLIBS="$ORACLE_STLIBS -bI:$ORACLE_HOME/lib/mili.exp"
fi
;;
7.2)
ORACLE_STLIBS="-locic $ORACLEINST_TOP/$ORACLE_LIBDIR/osntab.o \
-lsqlnet -lora -lsqlnet -lora -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 \
-lcore3 $ORA_SYSLIB -lcore3 $ORA_SYSLIB"
;;
7.3)
ORACLE_STLIBS="-lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \
-lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \
-lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 \
$ORA_SYSLIB -lcore3 $ORA_SYSLIB"
;;
8.0)
ORACLE_STLIBS="-lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \
-lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \
-lepc -lnlsrtl3 -lc3v6 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 \
$ORA_SYSLIB -lcore3 $ORA_SYSLIB"
;;
*)
ORACLE_STLIBS=
;;
esac
# Oracle shared libs
case $ORACLE_VERSION in
7.0)
# shared libs not supported
ORACLE_SHLIBS="$ORACLE_STLIBS"
;;
7.1)
if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/liboracle.s?
then
ORACLE_SHLIBS="-loracle $ORA_SYSLIB"
else
ORACLE_SHLIBS="$ORACLE_STLIBS"
fi
;;
7.2|7.3)
if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.s?
then
ORACLE_SHLIBS="-lclntsh $ORA_SYSLIB"
else
ORACLE_SHLIBS="$ORACLE_STLIBS"
fi
;;
8.0)
if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.s? -o \
-f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.a # AIX
then
if test "$CC" = "gcc" -a "`uname -sv`" = "AIX 4"; then
# for Oracle 8 on AIX 4
ORA_SYSLIB="$ORA_SYSLIB -nostdlib /lib/crt0_r.o /usr/lib/libpthreads.a /usr/lib/libc_r.a -lgcc"
fi
ORACLE_SHLIBS="-lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh $ORA_SYSLIB"
else
ORACLE_SHLIBS="$ORACLE_STLIBS"
fi
AC_DEFINE(HAVE_OCI8)
;;
*)
ORACLE_SHLIBS=
;;
esac
# only using shared libs right now
ORACLE_LIBS=$ORACLE_SHLIBS
AC_DEFINE(HAVE_ORACLE)
fi
],[AC_MSG_RESULT(no)])
AC_SUBST(ORACLE_SHLIBS)
AC_SUBST(ORACLE_STLIBS)
AC_SUBST(ORACLE_LIBS)
AC_SUBST(ORACLE_LFLAGS)
dnl## AC_SUBST(ORACLE_INCLUDE)
INCLUDES="$INCLUDES $ORACLE_INCLUDE"
AC_SUBST(ORACLE_HOME)
AC_SUBST(ORACLE_VERSION)
AC_MSG_CHECKING(for Sybase support)
AC_ARG_WITH(sybase,
[ --with-sybase[=DIR] Include Sybase-DB support. DIR is the Sybase home
@ -1095,37 +943,6 @@ dnl## AC_SUBST(SYBASE_CT_INCLUDE)
INCLUDES="$INCLUDES $SYBASE_CT_INCLUDE"
AC_MSG_CHECKING(for mSQL support)
AC_ARG_WITH(msql,
[ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base
install directory, defaults to /usr/local/Hughes.],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
MSQL_INCDIR=/usr/local/Hughes/include
MSQL_LIBDIR=/usr/local/Hughes/lib
else
MSQL_INCDIR=$withval/include
MSQL_LIBDIR=$withval/lib
fi
MSQL_INCLUDE=-I$MSQL_INCDIR
MSQL_LFLAGS=-L$MSQL_LIBDIR
MSQL_LIBS=-lmsql
AC_DEFINE(HAVE_MSQL)
AC_MSG_RESULT(yes)
AC_MSQL_VERSION
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
AC_SUBST(MSQL_LIBS)
AC_SUBST(MSQL_LFLAGS)
dnl## AC_SUBST(MSQL_INCLUDE)
INCLUDES="$INCLUDES $MSQL_INCLUDE"
AC_MSG_CHECKING(for PostgresSQL support)
AC_ARG_WITH(pgsql,
[ --with-pgsql[=DIR] Include PostgresSQL support. DIR is the PostgresSQL
@ -1471,32 +1288,6 @@ dnl## AC_SUBST(FDFLIB_INCLUDE)
INCLUDES="$INCLUDES $FDFLIB_INCLUDE"
AC_MSG_CHECKING(whether to enable DAV support through mod_dav)
AC_ARG_WITH(mod-dav,
[ --with-mod-dav=DIR Include DAV support through Apache's mod_dav,
DIR is mod_dav's installation directory (Apache
module version only!)],
[
if test "$withval" = "yes"; then
AC_MSG_ERROR(Must give parameter to --with-mod-dav!)
else
if test "$withval" != "no"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MOD_DAV, 1)
MOD_DAV_CFLAGS="-DHAVE_MOD_DAV -I$withval"
INCLUDES="$INCLUDES -I$withval"
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MOD_DAV, 0)
fi
fi
],[
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MOD_DAV, 0)
])
AC_SUBST(MOD_DAV_CFLAGS)
AC_MSG_CHECKING(whether to enable System V semaphore support)
AC_ARG_ENABLE(sysvsem,
[ --enable-sysvsem Enable System V semaphore support.],

6
ext/dav/Makefile.am Normal file
View File

@ -0,0 +1,6 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_dav.a
libphpext_dav_a_SOURCES=dav.c

2
ext/dav/config.h.stub Normal file
View File

@ -0,0 +1,2 @@
/* Define to compile with mod_dav support */
#define HAVE_MOD_DAV 0

29
ext/dav/config.m4 Normal file
View File

@ -0,0 +1,29 @@
dnl $Id$
dnl config.m4 for extension dav
dnl don't forget to call PHP_EXTENSION(dav)
AC_MSG_CHECKING(whether to enable DAV support through mod_dav)
AC_ARG_WITH(mod-dav,
[ --with-mod-dav=DIR Include DAV support through Apache's mod_dav,
DIR is mod_dav's installation directory (Apache
module version only!)],
[
if test "$withval" = "yes"; then
AC_MSG_ERROR(Must give parameter to --with-mod-dav!)
else
if test "$withval" != "no"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MOD_DAV, 1)
CFLAGS="$CFLAGS -DHAVE_MOD_DAV -I$withval"
INCLUDES="$INCLUDES -I$withval"
PHP_EXTENSION(dav)
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MOD_DAV, 0)
fi
fi
],[
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MOD_DAV, 0)
])

300
ext/dav/dav.c Normal file
View File

@ -0,0 +1,300 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#define IS_EXT_MODULE
#if COMPILE_DL
# if PHP_31
# include "../phpdl.h"
# else
# include "dl/phpdl.h"
# endif
#endif
#include "php.h"
#include "php3_dav.h"
#if defined(THREAD_SAFE) && !PHP_31
# undef THREAD_SAFE
#endif
#if HAVE_MOD_DAV
# include "mod_dav.h"
# include "phpdav.h"
# include "variables.h"
/* {{{ thread safety stuff */
# ifdef THREAD_SAFE
# define DAV_GLOBAL(a) phpdav_globals->a
# define DAV_TLS_VARS phpdav_global_struct *phpdav_globals = TlsGetValue(PHPDAVTls);
void *phpdav_mutex;
DWORD PHPDAVTls;
static int numthreads=0;
typedef struct phpdav_global_struct {
phpdav_module php3_dav_module;
} phpdav_global_struct;
# else /* !defined(THREAD_SAFE) */
# define DAV_GLOBAL(a) a
# define DAV_TLS_VARS
phpdav_module php3_dav_module;
# endif /* defined(THREAD_SAFE) */
# define DAV_HANDLER(a) DAV_GLOBAL(php3_dav_module).a##_handler
# define DAV_SET_HANDLER(a,b) \
dav_set_handler(&DAV_GLOBAL(php3_dav_module).a##_handler,(b))
/* }}} */
/* {{{ dynamically loadable module stuff */
# if COMPILE_DL
DLEXPORT php3_module_entry *get_module() { return &phpdav_module_entry; };
# endif /* COMPILE_DL */
/* }}} */
/* {{{ function prototypes */
int php3_minit_phpdav(INIT_FUNC_ARGS);
int php3_rinit_phpdav(INIT_FUNC_ARGS);
int php3_mshutdown_phpdav(SHUTDOWN_FUNC_ARGS);
int php3_rshutdown_phpdav(SHUTDOWN_FUNC_ARGS);
void php3_info_phpdav(void);
/* }}} */
/* {{{ extension definition structures */
function_entry phpdav_functions[] = {
PHP_FE(dav_set_mkcol_handlers, NULL)
{NULL, NULL, NULL}
};
php3_module_entry phpdav_module_entry = {
"DAV", /* extension name */
phpdav_functions, /* extension function list */
php3_minit_phpdav, /* extension-wide startup function */
php3_mshutdown_phpdav, /* extension-wide shutdown function */
php3_rinit_phpdav, /* per-request startup function */
php3_rshutdown_phpdav, /* per-request shutdown function */
php3_info_phpdav, /* information function */
STANDARD_MODULE_PROPERTIES
};
/* }}} */
/* {{{ startup, shutdown and info functions */
/* {{{ php3_minit_phpdav */
int php3_minit_phpdav(INIT_FUNC_ARGS)
{
#if defined(THREAD_SAFE)
phpdav_global_struct *phpdav_globals;
PHP3_MUTEX_ALLOC(phpdav_mutex);
PHP3_MUTEX_LOCK(phpdav_mutex);
numthreads++;
if (numthreads==1){
if (!PHP3_TLS_PROC_STARTUP(PHPDAVTls)){
PHP3_MUTEX_UNLOCK(phpdav_mutex);
PHP3_MUTEX_FREE(phpdav_mutex);
return FAILURE;
}
}
PHP3_MUTEX_UNLOCK(phdpav_mutex);
if(!PHP3_TLS_THREAD_INIT(PHPDAVTls,phpdav_globals,phpdav_global_struct)){
PHP3_MUTEX_FREE(phpdav_mutex);
return FAILURE;
}
#endif
return SUCCESS;
}
/* }}} */
/* {{{ php3_rinit_phpdav */
int php3_rinit_phpdav(INIT_FUNC_ARGS)
{
return SUCCESS;
}
/* }}} */
/* {{{ php3_mshutdown_phpdav() */
int php3_mshutdown_phpdav(SHUTDOWN_FUNC_ARGS)
{
DAV_TLS_VARS;
#ifdef THREAD_SAFE
PHP3_TLS_THREAD_FREE(phpdav_globals);
PHP3_MUTEX_LOCK(phpdav_mutex);
numthreads--;
if (numthreads < 1) {
PHP3_TLS_PROC_SHUTDOWN(PHPDAVTls);
PHP3_MUTEX_UNLOCK(phpdav_mutex);
PHP3_MUTEX_FREE(phpdav_mutex);
return SUCCESS;
}
PHP3_MUTEX_UNLOCK(phpdav_mutex);
#endif
return SUCCESS;
}
/* }}} */
/* {{{ php3_rshutdown_phpdav() */
int php3_rshutdown_phpdav(SHUTDOWN_FUNC_ARGS)
{
if (DAV_HANDLER(mkcol_test)) {
efree(DAV_HANDLER(mkcol_test));
}
if (DAV_HANDLER(mkcol_create)) {
efree(DAV_HANDLER(mkcol_create));
}
return SUCCESS;
}
/* }}} */
/* {{{ php3_info_phpdav() */
void php3_info_phpdav()
{
}
/* }}} */
/* }}} */
/* {{{ extension-internal functions */
/* {{{ dav_set_handler() */
static void
dav_set_handler(char **nameBufp, pval *data)
{
if (data->value.str.len > 0) {
if (*nameBufp != NULL) {
efree(*nameBufp);
}
*nameBufp = php3i_pval_strdup(data);
} else {
if (*nameBufp != NULL) {
efree(*nameBufp);
}
*nameBufp = NULL;
}
}
/* }}} */
/* {{{ dav_call_handler() */
static int
dav_call_handler(char *funcName, int argc, pval **argv)
{
if (funcName) {
pval *retval, *func;
int i, ret;
HashTable *function_table;
func = php3i_string_pval(funcName);
retval = emalloc(sizeof(pval));
function_table = php3i_get_function_table();
if (call_user_function(function_table, NULL, func, retval, argc, argv) == FAILURE) {
php3tls_pval_destructor(retval);
efree(retval);
return HTTP_INTERNAL_SERVER_ERROR;
}
php3tls_pval_destructor(func);
efree(func);
for (i = 0; i < argc; i++) {
php3tls_pval_destructor(argv[i]);
efree(argv[i]);
}
convert_to_long(retval);
ret = retval->value.lval;
efree(retval);
return ret;
}
return DECLINED;
}
/* }}} */
int phpdav_mkcol_test_handler(request_rec *r)
{
pval *arg;
if (DAV_HANDLER(mkcol_test) == NULL) {
return DECLINED;
}
arg = php3i_string_pval(r->filename);
return dav_call_handler(DAV_HANDLER(mkcol_test), 1, &arg);
}
int phpdav_mkcol_create_handler(request_rec *r)
{
pval *arg;
if (DAV_HANDLER(mkcol_create) == NULL) {
return DECLINED;
}
arg = php3i_string_pval(r->filename);
return dav_call_handler(DAV_HANDLER(mkcol_create), 1, &arg);
}
/* }}} */
/************************* EXTENSION FUNCTIONS *************************/
/* {{{ proto void dav_set_mkcol_handlers(string test, string create)
Sets the function to test whether a DAV collection exists for MKCOL */
PHP_FUNCTION(dav_set_mkcol_handlers)
{
pval *test, *create;
DAV_TLS_VARS;
if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &test, &create) == FAILURE) {
WRONG_PARAM_COUNT;
}
DAV_SET_HANDLER(mkcol_test, test);
DAV_SET_HANDLER(mkcol_create, create);
RETVAL_TRUE;
}
/* }}} */
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/

63
ext/dav/php3_dav.h Normal file
View File

@ -0,0 +1,63 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
+----------------------------------------------------------------------+
*/
/* $Id */
#ifndef _PHP_DAV_H
# define _PHP_DAV_H
# if HAVE_MOD_DAV
typedef struct {
int foo;
char *mkcol_test_handler;
char *mkcol_create_handler;
} phpdav_module;
extern php3_module_entry phpdav_module_entry;
# define phpdav_module_ptr &phpdav_module_entry
int phpdav_mkcol_test_handler(request_rec *);
PHP_FUNCTION(dav_set_mkcol_handlers);
# else /* !HAVE_MOD_DAV */
# define phpdav_module_ptr NULL
# endif /* HAVE_MOD_DAV */
#endif /* _PHP_DAV_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/

2
ext/dav/setup.stub Normal file
View File

@ -0,0 +1,2 @@
# $Id$
# This extension is still very much under construction.

View File

@ -35,11 +35,11 @@ eof
echo -n " setup.stub"
cat >setup.stub <<eof
# \$Source\$
# \$Id\$
define_option with-$extname '$extname support?' yesnodir \\
"defs" \\
' Whether to include $extname support.'
define_option with-$extname '$extname support?' yesnodir no \\
' Whether to build the $extname extension.'
eof

6
ext/msql/Makefile.am Normal file
View File

@ -0,0 +1,6 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_msql.a
libphpext_msql_a_SOURCES=msql.c

2
ext/msql/config.h.stub Normal file
View File

@ -0,0 +1,2 @@
#define HAVE_MSQL 0
#define MSQL1 0

49
ext/msql/config.m4 Normal file
View File

@ -0,0 +1,49 @@
dnl $Id$
dnl
dnl Test mSQL version by checking if msql.h has "IDX_TYPE" defined.
dnl
AC_DEFUN(AC_MSQL_VERSION,[
AC_MSG_CHECKING([mSQL version])
ac_php_oldcflags=$CFLAGS
CFLAGS="$MSQL_INCLUDE $CFLAGS";
AC_TRY_COMPILE([#include <sys/types.h>
#include "msql.h"],[int i = IDX_TYPE],[
AC_DEFINE(MSQL1,0)
MSQL_VERSION="2.0 or newer"
],[
AC_DEFINE(MSQL1,1)
MSQL_VERSION="1.0"
])
CFLAGS=$ac_php_oldcflags
AC_MSG_RESULT($MSQL_VERSION)
])
AC_MSG_CHECKING(for mSQL support)
AC_ARG_WITH(msql,
[ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base
install directory, defaults to /usr/local/Hughes.],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
MSQL_INCDIR=/usr/local/Hughes/include
MSQL_LIBDIR=/usr/local/Hughes/lib
else
MSQL_INCDIR=$withval/include
MSQL_LIBDIR=$withval/lib
fi
MSQL_INCLUDE=-I$MSQL_INCDIR
MSQL_LFLAGS=-L$MSQL_LIBDIR
MSQL_LIBS=-lmsql
AC_DEFINE(HAVE_MSQL)
AC_MSG_RESULT(yes)
PHP_EXTENSION(msql)
AC_MSQL_VERSION
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
EXTRA_LIBS="$EXTRA_LIBS $MSQL_LFLAGS $MSQL_LIBS"
INCLUDES="$INCLUDES $MSQL_INCLUDE"

1452
ext/msql/msql.c Normal file

File diff suppressed because it is too large Load Diff

100
ext/msql/php3_msql.h Normal file
View File

@ -0,0 +1,100 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef _PHP3_MSQL_H
#define _PHP3_MSQL_H
#if COMPILE_DL
#undef HAVE_MSQL
#define HAVE_MSQL 1
#define php3_minit_msql dl_init
#endif
#if HAVE_MSQL
extern php3_module_entry msql_module_entry;
#define msql_module_ptr &msql_module_entry
/* mSQL functions */
extern DLEXPORT int php3_minit_msql(INIT_FUNC_ARGS);
extern DLEXPORT int php3_rinit_msql(INIT_FUNC_ARGS);
extern DLEXPORT int php3_mshutdown_msql(SHUTDOWN_FUNC_ARGS);
extern DLEXPORT void php3_info_msql(void);
extern DLEXPORT void php3_msql_connect(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_pconnect(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_close(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_select_db(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_create_db(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_drop_db(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_list_dbs(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_list_tables(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_list_fields(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_error(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_affected_rows(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_query(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_db_query(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_result(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_num_rows(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_num_fields(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_fetch_row(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_data_seek(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_fetch_field(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_field_seek(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_free_result(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_field_name(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_field_table(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_field_len(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_field_type(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_field_flags(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_fetch_array(INTERNAL_FUNCTION_PARAMETERS);
extern DLEXPORT void php3_msql_fetch_object(INTERNAL_FUNCTION_PARAMETERS);
typedef struct {
long default_link;
long num_links,num_persistent;
long max_links,max_persistent;
long allow_persistent;
int le_query;
int le_link;
int le_plink;
} msql_module;
#ifndef THREAD_SAFE
extern msql_module php3_msql_module;
#endif
#else
#define msql_module_ptr NULL
#endif
#endif /* _PHP3_MSQL_H */

11
ext/msql/setup.stub Normal file
View File

@ -0,0 +1,11 @@
# $Source$
# $Id$
define_option with-msql 'mSQL support?' yesnodir \
'no /usr/local/Hughes mSQL install' \
' Whether to build PHP with mSQL support. PHP supports both mSQL 1.0 and\n
mSQL 2.0. However, if you build PHP with mSQL 1.0 libraries, you will\n
only be able to access mSQL 1.0 databases, ditto for mSQL 2.0.\n
More info about mSQL can be found at http://www.hughes.com.au/.'

View File

@ -1,6 +1,7 @@
# $Source$
# $Id$
define_option with-mysql 'mysql support?' yesnodir \
"defs" \
' Whether to include mysql support.'
define_option with-mysql 'MySQL support?' yesnodir \
'no /usr/local MySQL install' \
' Whether to build PHP with MySQL support.\n
More info about MySQL can be found at http://www.mysql.com/.'

5
ext/oracle/Makefile.am Normal file
View File

@ -0,0 +1,5 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_oracle.a
libphpext_oracle_a_SOURCES=oracle.c oci8.c

6
ext/oracle/config.h.stub Normal file
View File

@ -0,0 +1,6 @@
/* Define if you have the Oracle database client libraries */
#define HAVE_ORACLE 0
/* Define if you have the Oracle version 8 database client libraries */
#define HAVE_OCI8 0

162
ext/oracle/config.m4 Normal file
View File

@ -0,0 +1,162 @@
dnl $Id$
AC_DEFUN(AC_ORACLE_VERSION,[
AC_MSG_CHECKING([Oracle version])
if test -f "$ORACLEINST_TOP/orainst/unix.rgs"
then
ORACLE_VERSION=`grep '"ocommon"' $ORACLEINST_TOP/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
test -z "$ORACLE_VERSION" && ORACLE_VERSION=7.3
else
ORACLE_VERSION=8.0
fi
AC_MSG_RESULT($ORACLE_VERSION)
])
AC_MSG_CHECKING(for Oracle support)
AC_ARG_WITH(oracle,
[ --with-oracle[=DIR] Include Oracle database support. DIR is Oracle's
home directory, defaults to \$ORACLE_HOME.],
[
case "$withval" in
yes)
ORACLEINST_TOP=$ORACLE_HOME
AC_MSG_RESULT(yes)
PHP_EXTENSION(oracle)
;;
no)
ORACLEINST_TOP=
AC_MSG_RESULT(no)
;;
*)
ORACLEINST_TOP=$withval
AC_MSG_RESULT(yes)
PHP_EXTENSION(oracle)
;;
esac
if test "$ORACLEINST_TOP" != ""
then
# Oracle include files
if test -f "$ORACLEINST_TOP/rdbms/public/ocidfn.h"
then
# V8.0.5
ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/rdbms/public"
elif test -f "$ORACLEINST_TOP/rdbms/demo/ocidfn.h"
then
# V7.[0123]
ORACLE_INCLUDE=-I$ORACLEINST_TOP/rdbms/demo
fi
if test -d "$ORACLEINST_TOP/network/public"
then
# V8
ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/network/public"
fi
if test -d "$ORACLEINST_TOP/plsql/public"
then
# V8
ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/plsql/public"
fi
# Need to know the version, otherwhise we will mixup nlsrtl
AC_ORACLE_VERSION($ORACLEINST_TOP)
# Oracle libs - nightmare :-)
ORACLE_LIBDIR=lib
ORACLE_LFLAGS="-L$ORACLEINST_TOP/$ORACLE_LIBDIR ${ld_runpath_switch}$ORACLEINST_TOP/$ORACLE_LIBDIR"
if test -f "$ORACLEINST_TOP/rdbms/lib/sysliblist"
then
ORA_SYSLIB="`cat $ORACLEINST_TOP/rdbms/lib/sysliblist`"
else
ORA_SYSLIB="-lm"
fi
# Oracle Static libs
case $ORACLE_VERSION in
7.0|7.1)
ORACLE_STLIBS="-locic $ORACLEINST_TOP/$ORACLE_LIBDIR/osntab.o \
-lsqlnet -lora -lsqlnet -lnlsrtl -lcv6 -lcore -lnlsrtl -lcv6 \
-lcore $ORA_SYSLIB -lcore $ORA_SYSLIB"
if test "`uname -s 2>/dev/null`" = "AIX"; then
ORACLE_STLIBS="$ORACLE_STLIBS -bI:$ORACLE_HOME/lib/mili.exp"
fi
;;
7.2)
ORACLE_STLIBS="-locic $ORACLEINST_TOP/$ORACLE_LIBDIR/osntab.o \
-lsqlnet -lora -lsqlnet -lora -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 \
-lcore3 $ORA_SYSLIB -lcore3 $ORA_SYSLIB"
;;
7.3)
ORACLE_STLIBS="-lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \
-lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \
-lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 \
$ORA_SYSLIB -lcore3 $ORA_SYSLIB"
;;
8.0)
ORACLE_STLIBS="-lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \
-lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \
-lepc -lnlsrtl3 -lc3v6 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 \
$ORA_SYSLIB -lcore3 $ORA_SYSLIB"
;;
*)
ORACLE_STLIBS=
;;
esac
# Oracle shared libs
case $ORACLE_VERSION in
7.0)
# shared libs not supported
ORACLE_SHLIBS="$ORACLE_STLIBS"
;;
7.1)
if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/liboracle.s?
then
ORACLE_SHLIBS="-loracle $ORA_SYSLIB"
else
ORACLE_SHLIBS="$ORACLE_STLIBS"
fi
;;
7.2|7.3)
if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.s?
then
ORACLE_SHLIBS="-lclntsh $ORA_SYSLIB"
else
ORACLE_SHLIBS="$ORACLE_STLIBS"
fi
;;
8.0)
if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.s? -o \
-f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.a # AIX
then
if test "$CC" = "gcc" -a "`uname -sv`" = "AIX 4"; then
# for Oracle 8 on AIX 4
ORA_SYSLIB="$ORA_SYSLIB -nostdlib /lib/crt0_r.o /usr/lib/libpthreads.a /usr/lib/libc_r.a -lgcc"
fi
ORACLE_SHLIBS="-lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh $ORA_SYSLIB"
else
ORACLE_SHLIBS="$ORACLE_STLIBS"
fi
AC_DEFINE(HAVE_OCI8)
;;
*)
ORACLE_SHLIBS=
;;
esac
# only using shared libs right now
ORACLE_LIBS=$ORACLE_SHLIBS
AC_DEFINE(HAVE_ORACLE)
fi
],[AC_MSG_RESULT(no)])
EXTRA_LIBS="$EXTRA_LIBS $ORACLE_SHLIBS $ORACLE_STLIBS $ORACLE_LIBS $ORACLE_LFLAGS"
INCLUDES="$INCLUDES $ORACLE_INCLUDE"
AC_SUBST(ORACLE_HOME)
AC_SUBST(ORACLE_VERSION)

3172
ext/oracle/oci8.c Normal file

File diff suppressed because it is too large Load Diff

1715
ext/oracle/oracle.c Normal file

File diff suppressed because it is too large Load Diff

157
ext/oracle/oracle.h Normal file
View File

@ -0,0 +1,157 @@
#ifndef _PHP3_ORACLE_H
#define _PHP3_ORACLE_H
#if HAVE_ORACLE
#if (defined(__osf__) && defined(__alpha))
# ifndef A_OSF
# define A_OSF
# endif
# ifndef OSF1
# define OSF1
# endif
# ifndef _INTRINSICS
# define _INTRINSICS
# endif
#endif /* osf alpha */
#include "oratypes.h"
#include "ocidfn.h"
#ifdef __STDC__
#include "ociapr.h"
#endif
extern php3_module_entry oracle_module_entry;
#define oracle_module_ptr &oracle_module_entry
/* oparse flags */
#define DEFER_PARSE 1
#define NATIVE 1
#define VERSION_7 2
#define ORANUMWIDTH 38
#if (defined(__osf__) && defined(__alpha)) || defined(CRAY) || defined(KSR)
#define HDA_SIZE 512
#else
#define HDA_SIZE 256
#endif
#define ORAUIDLEN 32
#define ORAPWLEN 32
#define ORANAMELEN 32
#define ORABUFLEN 2000
/* Some Oracle error codes */
#define VAR_NOT_IN_LIST 1007
#define NO_DATA_FOUND 1403
#define NULL_VALUE_RETURNED 1405
/* Some SQL and OCI function codes */
#define FT_INSERT 3
#define FT_SELECT 4
#define FT_UPDATE 5
#define FT_DELETE 9
#define FC_OOPEN 14
typedef struct {
int open;
Lda_Def lda;
ub1 hda[HDA_SIZE];
} oraConnection;
typedef struct oraColumn {
sb4 dbsize;
sb2 dbtype;
text cbuf[ORANAMELEN+1];
sb4 cbufl;
sb4 dsize;
sb2 prec;
sb2 scale;
sb2 nullok;
ub1 *buf;
sb2 indp;
ub2 col_retlen, col_retcode;
} oraColumn;
typedef struct oraParam {
text *progv;
sword progvl;
sb2 type;
ub2 alen;
} oraParam;
typedef struct oraCursor {
int open;
Cda_Def cda;
text *query;
HashTable *params;
int nparams;
oraColumn *columns;
int ncols;
int fetched;
oraConnection *conn_ptr;
} oraCursor;
typedef struct {
char *defDB;
char *defUser;
char *defPW;
long allow_persistent;
long max_persistent;
long max_links;
long num_persistent;
long num_links;
int le_conn, le_pconn, le_cursor;
HashTable *resource_list;
HashTable *resource_plist;
} oracle_module;
extern void php3_Ora_Bind(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Close(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Commit(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_CommitOff(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_CommitOn(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Do(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Error(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_ErrorCode(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Exec(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Fetch(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_FetchInto(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_ColumnType(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_ColumnName(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_ColumnSize(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_GetColumn(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_NumCols(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_NumRows(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Logoff(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Logon(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_PLogon(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Open(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Parse(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_Ora_Rollback(INTERNAL_FUNCTION_PARAMETERS);
extern int php3_minit_oracle(INIT_FUNC_ARGS);
extern int php3_mshutdown_oracle(SHUTDOWN_FUNC_ARGS);
extern void php3_info_oracle(void);
extern int php3_rinit_oracle(INIT_FUNC_ARGS);
#else
#define oracle_module_ptr NULL
#endif /* HAVE_ORACLE */
#endif /* _PHP3_ORACLE_H */
/*
* Local Variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/

24
ext/oracle/oracle_hack.c Normal file
View File

@ -0,0 +1,24 @@
/*
This file needs to be compiled in with php on windows so that the
oracle dll will work (and can be compiled). preferably, I would
like to see if there is another way accomplish what needs to be
done with the symbol_table in ora_set_param_values() in oracle.c.
This is just a quick hack to get this out.
Shane
*/
#include "php.h"
PHPAPI HashTable *php3i_get_symbol_table(void) {
TLS_VARS;
return &GLOBAL(symbol_table);
}
/* This is becoming a general callback file, rather than an oracle hack
* file. Seems we need the following now for xml. */
PHPAPI HashTable *php3i_get_function_table(void) {
TLS_VARS;
return &GLOBAL(function_table);
}

190
ext/oracle/php3_oci8.h Normal file
View File

@ -0,0 +1,190 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundatbion; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
| |
| Initial work sponsored by Thies Arntzen <thies@digicol.de> of |
| Digital Collections, http://www.digicol.de/ |
+----------------------------------------------------------------------+
*/
/* $Id */
#if HAVE_OCI8
# ifndef _PHP_OCI8_H
# define _PHP_OCI8_H
# endif
# if (defined(__osf__) && defined(__alpha))
# ifndef A_OSF
# define A_OSF
# endif
# ifndef OSF1
# define OSF1
# endif
# ifndef _INTRINSICS
# define _INTRINSICS
# endif
# endif /* osf alpha */
# include <oci.h>
typedef struct {
int id;
int persistent;
char dbname[ 64 ];
OCIError *pError;
OCIServer *pServer;
} oci8_server;
typedef struct {
int id;
int persistent;
oci8_server *server;
OCIError *pError;
OCISession *pSession;
} oci8_session;
typedef struct {
int id;
oci8_session *session;
OCISvcCtx *pServiceContext;
OCIError *pError;
HashTable *descriptors;
int descriptors_count;
} oci8_connection;
typedef struct {
dvoid *ocidescr;
ub4 type;
} oci8_descriptor;
typedef struct {
pval *pval;
text *name;
ub4 name_len;
ub4 type;
char *data; /* for pval cache */
} oci8_define;
typedef struct {
int id;
oci8_connection *conn;
OCIError *pError;
OCIStmt *pStmt;
text *last_query;
HashTable *columns;
int ncolumns;
HashTable *binds;
HashTable *defines;
int executed;
} oci8_statement;
typedef struct {
OCIBind *pBind;
pval *value;
dvoid *descr; /* used for binding of LOBS etc */
ub4 maxsize;
sb2 indicator;
ub2 retcode;
} oci8_bind;
typedef struct {
oci8_statement *statement;
OCIDefine *pDefine;
char *name;
ub4 name_len;
ub2 type;
ub4 size4;
ub4 storage_size4;
ub2 size2;
sb2 indicator;
ub2 retcode;
ub4 rlen;
ub2 is_descr;
int descr;
oci8_descriptor *pdescr;
void *data;
oci8_define *define;
} oci8_out_column;
typedef struct {
OCIError *pError;
char *default_username;
char *default_password;
char *default_dbname;
long debug_mode;
long allow_persistent;
long max_persistent;
long max_links;
long num_persistent;
long num_links;
int le_conn; /* active connections */
int le_stmt; /* active statements */
int le_server; /* server-handles */
int le_pserver; /* pesistent server-handles */
int le_session; /* session-handles */
int le_psession;/* pesistent session-handles */
OCIEnv *pEnv;
} oci8_module;
extern php3_module_entry oci8_module_entry;
# define oci8_module_ptr &oci8_module_entry
# define OCI8_MAX_NAME_LEN 64
# define OCI8_MAX_DATA_SIZE 2097152 /* two megs */
/* this one has to be changed to include persistent connections as well */
# define OCI8_SERVER_TYPE(x) (((x)==OCI8_GLOBAL(php3_oci8_module).le_server) || ((x)==OCI8_GLOBAL(php3_oci8_module).le_pserver))
# define OCI8_SESSION_TYPE(x) (((x)==OCI8_GLOBAL(php3_oci8_module).le_session) || ((x)==OCI8_GLOBAL(php3_oci8_module).le_psession))
# define OCI8_CONN_TYPE(x) ((x)==OCI8_GLOBAL(php3_oci8_module).le_conn)
# define OCI8_STMT_TYPE(x) ((x)==OCI8_GLOBAL(php3_oci8_module).le_stmt)
# define RETURN_OUT_OF_MEMORY \
php3_error(E_WARNING, "Out of memory");\
RETURN_FALSE
# define OCI8_FAIL(c,f,r) \
php3i_oci8_error((c)->pError,(f),(r));\
RETURN_FALSE
#else /* !HAVE_OCI8 */
# define oci8_module_ptr NULL
#endif /* HAVE_OCI8 */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/

9
ext/oracle/setup.stub Normal file
View File

@ -0,0 +1,9 @@
# $Source$
# $Id$
define_option with-oracle 'Oracle support?' yesnodir \
"no $oradir Oracle home" \
' Whether to build PHP with Oracle support. Has been confirmed to\n
work with Oracle versions 7.0 to 7.3. If you have not set up your\n
Oracle environment, enter what $ORACLE_HOME is usually set to here.\n
More info about Oracle can be found at http://www.oracle.com/.'

View File

@ -51,9 +51,9 @@
#include "functions/php3_ldap.h"
#include "ext/mysql/php3_mysql.h"
#include "functions/php3_bcmath.h"
#include "functions/php3_msql.h"
#include "functions/php3_oci8.h"
#include "functions/oracle.h"
#include "ext/msql/php3_msql.h"
#include "ext/oracle/php3_oci8.h"
#include "ext/oracle/oracle.h"
#include "functions/php3_pgsql.h"
#include "functions/php3_sybase.h"
#include "functions/php3_sybase-ct.h"
@ -62,7 +62,7 @@
#include "functions/head.h"
#include "functions/post.h"
#include "functions/hw.h"
#include "functions/filepro.h"
#include "ext/filepro/filepro.h"
#include "functions/db.h"
#include "dl/snmp/php3_snmp.h"
#include "functions/php3_zlib.h"
@ -73,7 +73,7 @@
#include "functions/php3_fdf.h"
#include "functions/php3_sysvsem.h"
#include "functions/php3_sysvshm.h"
#include "functions/php3_dav.h"
#include "ext/dav/php3_dav.h"
unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE };
unsigned char first_arg_allow_ref[] = { 1, BYREF_ALLOW };

22
setup
View File

@ -239,13 +239,6 @@ for stub in ext/*/setup.stub; do
test -f $stub && . $stub
done
define_option with-oracle 'Oracle support?' yesnodir \
"no $oradir Oracle home" \
' Whether to build PHP with Oracle support. Has been confirmed to\n
work with Oracle versions 7.0 to 7.3. If you have not set up your\n
Oracle environment, enter what $ORACLE_HOME is usually set to here.\n
More info about Oracle can be found at http://www.oracle.com/.'
define_option with-sybase 'Sybase support?' yesnodir \
'no /home/sybase Sybase install' \
' Whether to build PHP with Sybase support (DBLib only).\n
@ -255,18 +248,6 @@ define_option with-sybase-ct 'Sybase-CT support?' yesnodir \
'no /home/sybase Sybase-CT install' \
' Whether to build PHP with Sybase-CT support.'
define_option with-mysql 'MySQL support?' yesnodir \
'no /usr/local MySQL install' \
' Whether to build PHP with MySQL support.\n
More info about MySQL can be found at http://www.tcx.se/.'
define_option with-msql 'mSQL support?' yesnodir \
'no /usr/local/Hughes mSQL install' \
' Whether to build PHP with mSQL support. PHP supports both mSQL 1.0 and\n
mSQL 2.0. However, if you build PHP with mSQL 1.0 libraries, you will\n
only be able to access mSQL 1.0 databases, ditto for mSQL 2.0.\n
More info about mSQL can be found at http://www.hughes.com.au/.'
define_option with-pgsql 'PostgreSQL support?' yesnodir \
'no /usr/local/pgsql PostgreSQL base install' \
' Whether to build PHP with PostgreSQL support.\n
@ -301,9 +282,6 @@ define_option with-imap 'IMAP support?' yesnodir \
support.\n
More information about LDAP can be found in RFC1777 and RFC1778.'
define_option with-filepro 'filePro support? ' yesno no \
' Whether to use the bundled filePro library. Read-access only.'
define_option with-pdflib 'pdflib 0.6 support? ' yesnodir \
'no /usr/local pdflib install' \
' Whether to use the pdflib support to write .pdf-files.\n