diff options
Diffstat (limited to 'ext/dba')
| -rw-r--r-- | ext/dba/dba.c | 6 | ||||
| -rw-r--r-- | ext/dba/dba_cdb.c | 4 | ||||
| -rwxr-xr-x | ext/dba/dba_db1.c | 394 | ||||
| -rw-r--r-- | ext/dba/dba_db2.c | 4 | ||||
| -rw-r--r-- | ext/dba/dba_db3.c | 4 | ||||
| -rw-r--r-- | ext/dba/dba_db4.c | 15 | ||||
| -rw-r--r-- | ext/dba/dba_dbm.c | 4 | ||||
| -rw-r--r-- | ext/dba/dba_flatfile.c | 4 | ||||
| -rw-r--r-- | ext/dba/dba_gdbm.c | 4 | ||||
| -rw-r--r-- | ext/dba/dba_inifile.c | 4 | ||||
| -rw-r--r-- | ext/dba/dba_ndbm.c | 4 | ||||
| -rwxr-xr-x | ext/dba/dba_qdbm.c | 4 | ||||
| -rw-r--r-- | ext/dba/libcdb/cdb.c | 6 | ||||
| -rw-r--r-- | ext/dba/libcdb/cdb.h | 4 | ||||
| -rw-r--r-- | ext/dba/libcdb/cdb_make.c | 6 | ||||
| -rw-r--r-- | ext/dba/libcdb/cdb_make.h | 4 | ||||
| -rw-r--r-- | ext/dba/libcdb/uint32.c | 4 | ||||
| -rw-r--r-- | ext/dba/libcdb/uint32.h | 4 | ||||
| -rw-r--r-- | ext/dba/libflatfile/flatfile.c | 6 | ||||
| -rw-r--r-- | ext/dba/libflatfile/flatfile.h | 4 | ||||
| -rw-r--r-- | ext/dba/libinifile/inifile.c | 10 | ||||
| -rw-r--r-- | ext/dba/libinifile/inifile.h | 4 | ||||
| -rw-r--r-- | ext/dba/php_dba.h | 4 | ||||
| -rw-r--r-- | ext/dba/tests/dba_db4.phpt | 18 |
24 files changed, 270 insertions, 255 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c index ec3bf5e71..e33d7f9f5 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba.c,v 1.111.2.4.2.6 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba.c,v 1.111.2.4.2.8 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -360,7 +360,7 @@ static dba_handler handler[] = { DBA_HND(db3, DBA_LOCK_ALL) /* No lock in lib */ #endif #if DBA_DB4 - DBA_HND(db4, DBA_LOCK_EXT) /* Locking done in library itself */ + DBA_HND(db4, DBA_LOCK_ALL) /* No lock in lib */ #endif #if DBA_INIFILE DBA_HND(inifile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_CAST_AS_FD) /* No lock in lib */ diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c index c8d2eaa3d..60bb38603 100644 --- a/ext/dba/dba_cdb.c +++ b/ext/dba/dba_cdb.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_cdb.c,v 1.32.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_cdb.c,v 1.32.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c index 91d408da0..35e28c9d2 100755 --- a/ext/dba/dba_db1.c +++ b/ext/dba/dba_db1.c @@ -1,197 +1,197 @@ -/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Shen Cheng-Da <cdsheen@gmail.com> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: dba_db1.c,v 1.3.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-
-#if DBA_DB1
-#include "php_db1.h"
-
-#ifdef DB1_INCLUDE_FILE
-#include DB1_INCLUDE_FILE
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#define DB1_DATA dba_db1_data *dba = info->dbf
-#define DB1_GKEY DBT gkey; gkey.data = (char *) key; gkey.size = keylen
-
-typedef struct {
- DB *dbp;
-} dba_db1_data;
-
-DBA_OPEN_FUNC(db1)
-{
- dba_db1_data *dba;
- DB *db;
-
- int gmode;
- int filemode = 0644;
-
- if (info->argc > 0) {
- convert_to_long_ex(info->argv[0]);
- filemode = Z_LVAL_PP(info->argv[0]);
- }
-
- gmode = 0;
- switch (info->mode) {
- case DBA_READER:
- gmode = O_RDONLY;
- break;
- case DBA_WRITER:
- gmode = O_RDWR;
- break;
- case DBA_CREAT:
- gmode = O_RDWR | O_CREAT;
- break;
- case DBA_TRUNC:
- gmode = O_RDWR | O_CREAT | O_TRUNC;
- break;
- default:
- return FAILURE; /* not possible */
- }
-
- db = dbopen((char *)info->path, gmode, filemode, DB_HASH, NULL);
-
- if (db == NULL) {
- return FAILURE;
- }
-
- dba = pemalloc(sizeof(*dba), info->flags&DBA_PERSISTENT);
- dba->dbp = db;
-
- info->dbf = dba;
-
- return SUCCESS;
-}
-
-DBA_CLOSE_FUNC(db1)
-{
- DB1_DATA;
- dba->dbp->close(dba->dbp);
- pefree(info->dbf, info->flags&DBA_PERSISTENT);
-}
-
-DBA_FETCH_FUNC(db1)
-{
- DBT gval;
- DB1_DATA;
- DB1_GKEY;
-
- memset(&gval, 0, sizeof(gval));
- if (dba->dbp->get(dba->dbp, &gkey, &gval, 0) == RET_SUCCESS) {
- if (newlen) *newlen = gval.size;
- return estrndup(gval.data, gval.size);
- }
- return NULL;
-}
-
-DBA_UPDATE_FUNC(db1)
-{
- DBT gval;
- DB1_DATA;
- DB1_GKEY;
-
- gval.data = (char *) val;
- gval.size = vallen;
-
- return dba->dbp->put(dba->dbp, &gkey, &gval, mode == 1 ? R_NOOVERWRITE : 0) != RET_SUCCESS ? FAILURE : SUCCESS;
-}
-
-DBA_EXISTS_FUNC(db1)
-{
- DBT gval;
- DB1_DATA;
- DB1_GKEY;
-
- return dba->dbp->get(dba->dbp, &gkey, &gval, 0) != RET_SUCCESS ? FAILURE : SUCCESS;
-}
-
-DBA_DELETE_FUNC(db1)
-{
- DB1_DATA;
- DB1_GKEY;
-
- return dba->dbp->del(dba->dbp, &gkey, 0) != RET_SUCCESS ? FAILURE : SUCCESS;
-}
-
-DBA_FIRSTKEY_FUNC(db1)
-{
- DBT gkey;
- DBT gval;
- DB1_DATA;
-
- memset(&gkey, 0, sizeof(gkey));
- memset(&gval, 0, sizeof(gval));
-
- if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_FIRST) == RET_SUCCESS) {
- if (newlen) *newlen = gkey.size;
- return estrndup(gkey.data, gkey.size);
- }
- return NULL;
-}
-
-DBA_NEXTKEY_FUNC(db1)
-{
- DBT gkey;
- DBT gval;
- DB1_DATA;
-
- memset(&gkey, 0, sizeof(gkey));
- memset(&gval, 0, sizeof(gval));
-
- if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_NEXT) == RET_SUCCESS) {
- if (newlen) *newlen = gkey.size;
- return estrndup(gkey.data, gkey.size);
- }
- return NULL;
-}
-
-DBA_OPTIMIZE_FUNC(db1)
-{
- /* dummy */
- return SUCCESS;
-}
-
-DBA_SYNC_FUNC(db1)
-{
- return SUCCESS;
-}
-
-DBA_INFO_FUNC(db1)
-{
- return estrdup(DB1_VERSION);
-}
-
-#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */
+/* + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2009 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Shen Cheng-Da <cdsheen@gmail.com> | + +----------------------------------------------------------------------+ + */ + +/* $Id: dba_db1.c,v 1.3.2.1.2.4 2008/12/31 11:17:36 sebastian Exp $ */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" + +#if DBA_DB1 +#include "php_db1.h" + +#ifdef DB1_INCLUDE_FILE +#include DB1_INCLUDE_FILE +#endif + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#define DB1_DATA dba_db1_data *dba = info->dbf +#define DB1_GKEY DBT gkey; gkey.data = (char *) key; gkey.size = keylen + +typedef struct { + DB *dbp; +} dba_db1_data; + +DBA_OPEN_FUNC(db1) +{ + dba_db1_data *dba; + DB *db; + + int gmode; + int filemode = 0644; + + if (info->argc > 0) { + convert_to_long_ex(info->argv[0]); + filemode = Z_LVAL_PP(info->argv[0]); + } + + gmode = 0; + switch (info->mode) { + case DBA_READER: + gmode = O_RDONLY; + break; + case DBA_WRITER: + gmode = O_RDWR; + break; + case DBA_CREAT: + gmode = O_RDWR | O_CREAT; + break; + case DBA_TRUNC: + gmode = O_RDWR | O_CREAT | O_TRUNC; + break; + default: + return FAILURE; /* not possible */ + } + + db = dbopen((char *)info->path, gmode, filemode, DB_HASH, NULL); + + if (db == NULL) { + return FAILURE; + } + + dba = pemalloc(sizeof(*dba), info->flags&DBA_PERSISTENT); + dba->dbp = db; + + info->dbf = dba; + + return SUCCESS; +} + +DBA_CLOSE_FUNC(db1) +{ + DB1_DATA; + dba->dbp->close(dba->dbp); + pefree(info->dbf, info->flags&DBA_PERSISTENT); +} + +DBA_FETCH_FUNC(db1) +{ + DBT gval; + DB1_DATA; + DB1_GKEY; + + memset(&gval, 0, sizeof(gval)); + if (dba->dbp->get(dba->dbp, &gkey, &gval, 0) == RET_SUCCESS) { + if (newlen) *newlen = gval.size; + return estrndup(gval.data, gval.size); + } + return NULL; +} + +DBA_UPDATE_FUNC(db1) +{ + DBT gval; + DB1_DATA; + DB1_GKEY; + + gval.data = (char *) val; + gval.size = vallen; + + return dba->dbp->put(dba->dbp, &gkey, &gval, mode == 1 ? R_NOOVERWRITE : 0) != RET_SUCCESS ? FAILURE : SUCCESS; +} + +DBA_EXISTS_FUNC(db1) +{ + DBT gval; + DB1_DATA; + DB1_GKEY; + + return dba->dbp->get(dba->dbp, &gkey, &gval, 0) != RET_SUCCESS ? FAILURE : SUCCESS; +} + +DBA_DELETE_FUNC(db1) +{ + DB1_DATA; + DB1_GKEY; + + return dba->dbp->del(dba->dbp, &gkey, 0) != RET_SUCCESS ? FAILURE : SUCCESS; +} + +DBA_FIRSTKEY_FUNC(db1) +{ + DBT gkey; + DBT gval; + DB1_DATA; + + memset(&gkey, 0, sizeof(gkey)); + memset(&gval, 0, sizeof(gval)); + + if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_FIRST) == RET_SUCCESS) { + if (newlen) *newlen = gkey.size; + return estrndup(gkey.data, gkey.size); + } + return NULL; +} + +DBA_NEXTKEY_FUNC(db1) +{ + DBT gkey; + DBT gval; + DB1_DATA; + + memset(&gkey, 0, sizeof(gkey)); + memset(&gval, 0, sizeof(gval)); + + if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_NEXT) == RET_SUCCESS) { + if (newlen) *newlen = gkey.size; + return estrndup(gkey.data, gkey.size); + } + return NULL; +} + +DBA_OPTIMIZE_FUNC(db1) +{ + /* dummy */ + return SUCCESS; +} + +DBA_SYNC_FUNC(db1) +{ + return SUCCESS; +} + +DBA_INFO_FUNC(db1) +{ + return estrdup(DB1_VERSION); +} + +#endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: sw=4 ts=4 fdm=marker + * vim<600: sw=4 ts=4 + */ diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c index 79d835d01..56d145149 100644 --- a/ext/dba/dba_db2.c +++ b/ext/dba/dba_db2.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_db2.c,v 1.39.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_db2.c,v 1.39.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c index 5fbcdf851..0209cb8ca 100644 --- a/ext/dba/dba_db3.c +++ b/ext/dba/dba_db3.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_db3.c,v 1.33.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_db3.c,v 1.33.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c index b2bdec8e8..9bb3e9726 100644 --- a/ext/dba/dba_db4.c +++ b/ext/dba/dba_db4.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_db4.c,v 1.15.2.3.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_db4.c,v 1.15.2.3.2.4 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -36,7 +36,11 @@ #include <db.h> #endif -static void php_dba_db4_errcall_fcn(const char *errpfx, char *msg) +static void php_dba_db4_errcall_fcn( +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) + const DB_ENV *dbenv, +#endif + const char *errpfx, const char *msg) { TSRMLS_FETCH(); @@ -81,7 +85,6 @@ DBA_OPEN_FUNC(db4) return FAILURE; /* not possible */ } - gmode |= DB_INIT_LOCK; if (info->flags & DBA_PERSISTENT) { gmode |= DB_THREAD; } @@ -91,10 +94,6 @@ DBA_OPEN_FUNC(db4) filemode = Z_LVAL_PP(info->argv[0]); } -#ifdef DB_FCNTL_LOCKING - gmode |= DB_FCNTL_LOCKING; -#endif - if ((err=db_create(&dbp, NULL, 0)) == 0) { dbp->set_errcall(dbp, php_dba_db4_errcall_fcn); if ( diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c index a7896be85..27e196b90 100644 --- a/ext/dba/dba_dbm.c +++ b/ext/dba/dba_dbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_dbm.c,v 1.29.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_dbm.c,v 1.29.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c index 30f8bf4ac..f57d1e4c4 100644 --- a/ext/dba/dba_flatfile.c +++ b/ext/dba/dba_flatfile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_flatfile.c,v 1.19.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_flatfile.c,v 1.19.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c index de915f950..0a821b1f8 100644 --- a/ext/dba/dba_gdbm.c +++ b/ext/dba/dba_gdbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_gdbm.c,v 1.23.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_gdbm.c,v 1.23.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index 291258283..6fa9a80ad 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_inifile.c,v 1.5.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_inifile.c,v 1.5.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c index 8414385f6..8062d67c2 100644 --- a/ext/dba/dba_ndbm.c +++ b/ext/dba/dba_ndbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_ndbm.c,v 1.19.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_ndbm.c,v 1.19.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c index da9a0bd4a..4cfcbbfcd 100755 --- a/ext/dba/dba_qdbm.c +++ b/ext/dba/dba_qdbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dba_qdbm.c,v 1.4.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: dba_qdbm.c,v 1.4.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c index d84214b1c..597ab02b8 100644 --- a/ext/dba/libcdb/cdb.c +++ b/ext/dba/libcdb/cdb.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cdb.c,v 1.10.2.1.2.4 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: cdb.c,v 1.10.2.1.2.5 2008/12/31 11:17:36 sebastian Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ @@ -189,6 +189,6 @@ int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC) /* {{{ cdb_version */ char *cdb_version() { - return "0.75, $Revision: 1.10.2.1.2.4 $"; + return "0.75, $Revision: 1.10.2.1.2.5 $"; } /* }}} */ diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h index 38af71e28..e5a828104 100644 --- a/ext/dba/libcdb/cdb.h +++ b/ext/dba/libcdb/cdb.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cdb.h,v 1.7.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: cdb.h,v 1.7.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c index c68451367..79a15c1cf 100644 --- a/ext/dba/libcdb/cdb_make.c +++ b/ext/dba/libcdb/cdb_make.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cdb_make.c,v 1.9.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: cdb_make.c,v 1.9.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ @@ -240,5 +240,5 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC) /* {{{ cdb_make_version */ char *cdb_make_version() { - return "0.75, $Revision: 1.9.2.1.2.2 $"; + return "0.75, $Revision: 1.9.2.1.2.3 $"; } diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h index b93028181..d121ea85a 100644 --- a/ext/dba/libcdb/cdb_make.h +++ b/ext/dba/libcdb/cdb_make.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cdb_make.h,v 1.7.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: cdb_make.h,v 1.7.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c index 955edbdd0..06dcc40a6 100644 --- a/ext/dba/libcdb/uint32.c +++ b/ext/dba/libcdb/uint32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: uint32.c,v 1.6.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: uint32.c,v 1.6.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h index 35591e49e..8dcdb2b35 100644 --- a/ext/dba/libcdb/uint32.h +++ b/ext/dba/libcdb/uint32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: uint32.h,v 1.6.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: uint32.h,v 1.6.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c index 7d8b3ff9f..0e7d1c8c4 100644 --- a/ext/dba/libflatfile/flatfile.c +++ b/ext/dba/libflatfile/flatfile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: flatfile.c,v 1.14.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: flatfile.c,v 1.14.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -307,7 +307,7 @@ datum flatfile_nextkey(flatfile *dba TSRMLS_DC) { /* {{{ flatfile_version */ char *flatfile_version() { - return "1.0, $Revision: 1.14.2.1.2.2 $"; + return "1.0, $Revision: 1.14.2.1.2.3 $"; } /* }}} */ diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h index 3ec25a396..4ad468427 100644 --- a/ext/dba/libflatfile/flatfile.h +++ b/ext/dba/libflatfile/flatfile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: flatfile.h,v 1.11.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: flatfile.h,v 1.11.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifndef PHP_LIB_FLATFILE_H #define PHP_LIB_FLATFILE_H diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index c87025314..080124ff7 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: inifile.c,v 1.14.2.1.2.4 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: inifile.c,v 1.14.2.1.2.6 2008/12/31 11:17:36 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -43,7 +43,7 @@ /* {{{ inifile_version */ char *inifile_version() { - return "1.0, $Revision: 1.14.2.1.2.4 $"; + return "1.0, $Revision: 1.14.2.1.2.6 $"; } /* }}} */ @@ -508,7 +508,9 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons /* 5 */ if (ret == SUCCESS) { - ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */ + if (!value || (key->name && strlen(key->name))) { + ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */ + } } if (ret == SUCCESS) { diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h index f50806acb..34268209c 100644 --- a/ext/dba/libinifile/inifile.h +++ b/ext/dba/libinifile/inifile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: inifile.h,v 1.5.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: inifile.h,v 1.5.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifndef PHP_LIB_INIFILE_H #define PHP_LIB_INIFILE_H diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h index f7fd95d41..2440cba40 100644 --- a/ext/dba/php_dba.h +++ b/ext/dba/php_dba.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dba.h,v 1.29.2.1.2.2 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: php_dba.h,v 1.29.2.1.2.3 2008/12/31 11:17:36 sebastian Exp $ */ #ifndef PHP_DBA_H #define PHP_DBA_H diff --git a/ext/dba/tests/dba_db4.phpt b/ext/dba/tests/dba_db4.phpt index 252797bf4..fcf089a1e 100644 --- a/ext/dba/tests/dba_db4.phpt +++ b/ext/dba/tests/dba_db4.phpt @@ -9,7 +9,6 @@ DBA DB4 handler test <?php $handler = 'db4'; require_once('test.inc'); - $lock_flag = ''; // lock in library require_once('dba_handler.inc'); ?> ===DONE=== @@ -18,7 +17,22 @@ database handler: db4 3NYNYY Content String 2 Content 2 replaced -Read during write: allowed +Read during write: not allowed +Content 2 replaced 2nd time +The 6th value +array(3) { + ["key number 6"]=> + string(13) "The 6th value" + ["key2"]=> + string(27) "Content 2 replaced 2nd time" + ["key5"]=> + string(23) "The last content string" +} +--NO-LOCK-- +3NYNYY +Content String 2 +Content 2 replaced +Read during write: not allowed Content 2 replaced 2nd time The 6th value array(3) { |
