diff options
Diffstat (limited to 'lang/php_db4')
-rw-r--r-- | lang/php_db4/INSTALL | 8 | ||||
-rw-r--r-- | lang/php_db4/config.m4 | 4 | ||||
-rw-r--r-- | lang/php_db4/config.m4.in | 2 | ||||
-rw-r--r-- | lang/php_db4/config.w32 | 2 | ||||
-rw-r--r-- | lang/php_db4/db4.cpp | 10 | ||||
-rw-r--r-- | lang/php_db4/php_db4.h | 2 | ||||
-rw-r--r-- | lang/php_db4/samples/simple_counter.php | 4 | ||||
-rw-r--r-- | lang/php_db4/samples/transactional_counter.php | 4 |
8 files changed, 19 insertions, 17 deletions
diff --git a/lang/php_db4/INSTALL b/lang/php_db4/INSTALL index ef0c3747..96c4d088 100644 --- a/lang/php_db4/INSTALL +++ b/lang/php_db4/INSTALL @@ -31,8 +31,8 @@ the php.ini file you use: extension=db4.so See examples in the "samples" directory. The samples create their data in -/var/tmp by default and the transaction_counter.php example requires -that /var/tmp/dbhome exist. The samples can be edited to change these +the executing directory by default and the transaction_counter.php example +requires that ./dbhome exist. The samples can be edited to change these requirements. Apache 2 Configuration @@ -88,7 +88,7 @@ extension=db4.so http://<path-to-server>/simple_counter.php Refresh your page to see the counter increment. - This example creates a database in /var/tmp. It can be modified to - change the location of the database. + This example creates a database in the executing directory. The example + can be modified to change the location of the database. diff --git a/lang/php_db4/config.m4 b/lang/php_db4/config.m4 index 86bf1690..0c4449c4 100644 --- a/lang/php_db4/config.m4 +++ b/lang/php_db4/config.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved. # # http://www.apache.org/licenses/LICENSE-2.0.txt # @@ -16,7 +16,7 @@ PHP_ARG_WITH(db4, whether to enable db4 support, if test "$PHP_DB4" != "no"; then if test "$PHP_DB4" != "no"; then - for i in $PHP_DB4 /usr/local/BerkeleyDB.5.3 /usr/local /usr; do + for i in $PHP_DB4 /usr/local/BerkeleyDB.6.1 /usr/local /usr; do if test -f "$i/db4/db.h"; then THIS_PREFIX=$i INC_DIR=$i/db4 diff --git a/lang/php_db4/config.m4.in b/lang/php_db4/config.m4.in index da9deb92..ceb66086 100644 --- a/lang/php_db4/config.m4.in +++ b/lang/php_db4/config.m4.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved. # # http://www.apache.org/licenses/LICENSE-2.0.txt # diff --git a/lang/php_db4/config.w32 b/lang/php_db4/config.w32 index ccf0ef9f..d3388f0d 100644 --- a/lang/php_db4/config.w32 +++ b/lang/php_db4/config.w32 @@ -20,7 +20,7 @@ ARG_ENABLE("db4","Berkeley DB support","no,shared");
if (PHP_DB4 != "no") {
EXTENSION("db4", "db4.cpp", null, "", "php_db4.dll");
- CHECK_LIB("libdb53.lib", "db4", "<path_to_lib>;");
+ CHECK_LIB("libdb61.lib", "db4", "<path_to_lib>;");
CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DB4", "<path_to_build_windows>;../db4;");
ADD_FLAG("CFLAGS_DB4", "/EHsc");
}
diff --git a/lang/php_db4/db4.cpp b/lang/php_db4/db4.cpp index f76e04b0..0e041b42 100644 --- a/lang/php_db4/db4.cpp +++ b/lang/php_db4/db4.cpp @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004, 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved. * * http://www.apache.org/licenses/LICENSE-2.0.txt * @@ -146,7 +146,7 @@ static struct my_llist *my_llist_del(struct my_llist *list, void *data) { * * Every user visible function must have an entry in db4_functions[]. */ -function_entry db4_functions[] = { +zend_function_entry db4_functions[] = { /* PHP_FE(db4_dbenv_create, NULL) */ {NULL, NULL, NULL} /* Must be the last line in db4_functions[] */ }; @@ -341,8 +341,10 @@ static zend_function_entry Db4_functions[] = { #ifdef COMPILE_DL_DB4 #ifdef PHP_WIN32 +#if !(PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3) #include "zend_arg_defs.c" #endif +#endif BEGIN_EXTERN_C() ZEND_GET_MODULE(db4) END_EXTERN_C() @@ -640,7 +642,7 @@ void setDbEnv(zval *z, DB_ENV *dbenv TSRMLS_DC) long rsrc_id; struct php_DB_ENV *pdb = (struct php_DB_ENV *) emalloc(sizeof(*pdb)); pdb->dbenv = dbenv; - rsrc_id = zend_register_resource(NULL, pdb, le_dbenv); + rsrc_id = ZEND_REGISTER_RESOURCE(NULL, pdb, le_dbenv); zend_list_addref(rsrc_id); add_property_resource(z, "_dbenv_ptr", rsrc_id); } @@ -849,7 +851,7 @@ void setDbc(zval *z, DBC *dbc, struct php_DB_TXN *txn TSRMLS_DC) pdbc->parent_txn = txn; txn->open_cursors = my_llist_add(txn->open_cursors, pdbc); } - rsrc_id = zend_register_resource(NULL, pdbc, le_dbc); + rsrc_id = ZEND_REGISTER_RESOURCE(NULL, pdbc, le_dbc); zend_list_addref(rsrc_id); add_property_resource(z, "_dbc_ptr", rsrc_id); } diff --git a/lang/php_db4/php_db4.h b/lang/php_db4/php_db4.h index 49225267..5aef6d0d 100644 --- a/lang/php_db4/php_db4.h +++ b/lang/php_db4/php_db4.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004, 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved. * * http://www.apache.org/licenses/LICENSE-2.0.txt * diff --git a/lang/php_db4/samples/simple_counter.php b/lang/php_db4/samples/simple_counter.php index 80ba693b..b391f8bc 100644 --- a/lang/php_db4/samples/simple_counter.php +++ b/lang/php_db4/samples/simple_counter.php @@ -2,9 +2,9 @@ // Create a new Db4 Instance $db = new Db4(); -// Open it outside a Db4Env environment with datafile /var/lib/db4 +// Open it outside a Db4Env environment with datafile db4 // and database name "test." This creates a non-transactional database -$db->open(null, "/var/tmp/db4", "test"); +$db->open(null, "./db4", "test"); // Get the current value of "counter" $counter = $db->get("counter"); diff --git a/lang/php_db4/samples/transactional_counter.php b/lang/php_db4/samples/transactional_counter.php index 489ff91d..93330cf1 100644 --- a/lang/php_db4/samples/transactional_counter.php +++ b/lang/php_db4/samples/transactional_counter.php @@ -3,8 +3,8 @@ // Open a new Db4Env. By default it is transactional. The directory // path in the open() call must exist. $dbenv = new Db4Env(); -$dbenv->set_data_dir("/var/tmp/dbhome"); -$dbenv->open("/var/tmp/dbhome"); +$dbenv->set_data_dir("."); +$dbenv->open("."); // Open a database in $dbenv. $db = new Db4($dbenv); |