mirror of
https://github.com/php/php-src.git
synced 2024-10-01 23:06:11 +00:00
Merge branch 'PHP-5.5'
This commit is contained in:
commit
9d88c8d904
@ -88,14 +88,15 @@ DBA_UPDATE_FUNC(flatfile)
|
||||
gval.dsize = vallen;
|
||||
|
||||
switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE TSRMLS_CC)) {
|
||||
case 0:
|
||||
return SUCCESS;
|
||||
case 1:
|
||||
return FAILURE;
|
||||
case -1:
|
||||
php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible");
|
||||
return FAILURE;
|
||||
default:
|
||||
case 0:
|
||||
return SUCCESS;
|
||||
case 1:
|
||||
php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Key already exists");
|
||||
php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value");
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -104,11 +104,18 @@ DBA_UPDATE_FUNC(gdbm)
|
||||
gval.dptr = (char *) val;
|
||||
gval.dsize = vallen;
|
||||
|
||||
if(gdbm_store(dba->dbf, gkey, gval,
|
||||
mode == 1 ? GDBM_INSERT : GDBM_REPLACE) == 0)
|
||||
switch (gdbm_store(dba->dbf, gkey, gval, mode == 1 ? GDBM_INSERT : GDBM_REPLACE)) {
|
||||
case 0:
|
||||
return SUCCESS;
|
||||
case 1:
|
||||
return FAILURE;
|
||||
case -1:
|
||||
php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno));
|
||||
return FAILURE;
|
||||
default:
|
||||
php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value");
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
DBA_EXISTS_FUNC(gdbm)
|
||||
|
@ -101,7 +101,6 @@ DBA_UPDATE_FUNC(inifile)
|
||||
case 0:
|
||||
return SUCCESS;
|
||||
case 1:
|
||||
php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Key already exists");
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -96,13 +96,15 @@ DBA_FETCH_FUNC(qdbm)
|
||||
DBA_UPDATE_FUNC(qdbm)
|
||||
{
|
||||
QDBM_DATA;
|
||||
int result;
|
||||
|
||||
result = dpput(dba->dbf, key, keylen, val, vallen, mode == 1 ? DP_DKEEP : DP_DOVER);
|
||||
if (result)
|
||||
if (dpput(dba->dbf, key, keylen, val, vallen, mode == 1 ? DP_DKEEP : DP_DOVER)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (dpecode != DP_EKEEP) {
|
||||
php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", dperrmsg(dpecode));
|
||||
}
|
||||
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@ database handler: db1
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -33,6 +35,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -18,6 +18,8 @@ database handler: db2
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -33,6 +35,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -18,6 +18,8 @@ database handler: db3
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -33,6 +35,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -22,6 +22,8 @@ database handler: db4
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -37,6 +39,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -18,6 +18,8 @@ database handler: dbm
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -33,6 +35,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -22,6 +22,8 @@ database handler: flatfile
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -37,6 +39,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -21,6 +21,8 @@ database handler: gdbm
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write:%sallowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -46,8 +46,16 @@ do {
|
||||
echo "Read during write: allowed\n";
|
||||
}
|
||||
if ($db_writer!==FALSE) {
|
||||
dba_insert("key number 6", "The 6th value", $db_writer);
|
||||
@dba_insert("key number 6", "The 6th value inserted again would be an error", $db_writer);
|
||||
if (dba_insert("key number 6", "The 6th value", $db_writer)) {
|
||||
echo '"key number 6" written' . "\n";
|
||||
} else {
|
||||
echo 'Failed to write "key number 6"' . "\n";
|
||||
}
|
||||
if (dba_insert("key number 6", "The 6th value inserted again would be an error", $db_writer)) {
|
||||
echo '"key number 6" written 2nd time' . "\n";
|
||||
} else {
|
||||
echo 'Failed to write "key number 6" 2nd time' . "\n";
|
||||
}
|
||||
dba_replace("key2", "Content 2 replaced 2nd time", $db_writer);
|
||||
dba_delete("key4", $db_writer);
|
||||
echo dba_fetch("key2", $db_writer)."\n";
|
||||
|
@ -18,6 +18,8 @@ database handler: inifile
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -33,6 +35,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -18,6 +18,8 @@ database handler: ndbm
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -33,6 +35,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -19,6 +19,8 @@ database handler: qdbm
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write:%sallowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
@ -22,6 +22,8 @@ database handler: tcadb
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
@ -37,6 +39,8 @@ array(3) {
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
"key number 6" written
|
||||
Failed to write "key number 6" 2nd time
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
|
Loading…
Reference in New Issue
Block a user