abies Fri May 28 19:39:33 2004 EDT
Modified files:
/php-src/ext/interbase interbase.c php_ibase_includes.h
Log:
Changed default date format to ISO
Enable sync flag in connect()
http://cvs.php.net/diff.php/php-src/ext/interbase/interbase.c?r1=1.216&r2=1.217&ty=u
Index: php-src/ext/interbase/interbase.c
diff -u php-src/ext/interbase/interbase.c:1.216 php-src/ext/interbase/interbase.c:1.217
--- php-src/ext/interbase/interbase.c:1.216 Fri May 28 16:11:34 2004
+++ php-src/ext/interbase/interbase.c Fri May 28 19:39:33 2004
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interbase.c,v 1.216 2004/05/28 20:11:34 abies Exp $ */
+/* $Id: interbase.c,v 1.217 2004/05/28 23:39:33 abies Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -28,7 +28,7 @@
#include "php.h"
-#define FILE_REVISION "$Revision: 1.216 $"
+#define FILE_REVISION "$Revision: 1.217 $"
#if HAVE_IBASE
@@ -431,16 +431,16 @@
/* {{{ startup, shutdown and info functions */
PHP_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("ibase.allow_persistent", "1", PHP_INI_SYSTEM,
OnUpdateLong, allow_persistent, zend_ibase_globals, ibase_globals)
+ STD_PHP_INI_BOOLEAN("ibase.allow_persistent", "1", PHP_INI_SYSTEM,
OnUpdateBool, allow_persistent, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY_EX("ibase.max_persistent", "-1", PHP_INI_SYSTEM,
OnUpdateLong, max_persistent, zend_ibase_globals, ibase_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX("ibase.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong,
max_links, zend_ibase_globals, ibase_globals, display_link_numbers)
STD_PHP_INI_ENTRY("ibase.default_db", NULL, PHP_INI_SYSTEM, OnUpdateString,
default_db, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY("ibase.default_user", NULL, PHP_INI_ALL, OnUpdateString,
default_user, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY("ibase.default_password", NULL, PHP_INI_ALL, OnUpdateString,
default_password, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY("ibase.default_charset", NULL, PHP_INI_ALL, OnUpdateString,
default_charset, zend_ibase_globals, ibase_globals)
- STD_PHP_INI_ENTRY("ibase.timestampformat", "%m/%d/%Y %H:%M:%S", PHP_INI_ALL,
OnUpdateString, cfg_timestampformat, zend_ibase_globals, ibase_globals)
- STD_PHP_INI_ENTRY("ibase.dateformat", "%m/%d/%Y", PHP_INI_ALL, OnUpdateString,
cfg_dateformat, zend_ibase_globals, ibase_globals)
- STD_PHP_INI_ENTRY("ibase.timeformat", "%H:%M:%S", PHP_INI_ALL, OnUpdateString,
cfg_timeformat, zend_ibase_globals, ibase_globals)
+ STD_PHP_INI_ENTRY("ibase.timestampformat", IB_DEF_DATE_FMT " "
IB_DEF_TIME_FMT, PHP_INI_ALL, OnUpdateString, cfg_timestampformat, zend_ibase_globals,
ibase_globals)
+ STD_PHP_INI_ENTRY("ibase.dateformat", IB_DEF_DATE_FMT, PHP_INI_ALL,
OnUpdateString, cfg_dateformat, zend_ibase_globals, ibase_globals)
+ STD_PHP_INI_ENTRY("ibase.timeformat", IB_DEF_TIME_FMT, PHP_INI_ALL,
OnUpdateString, cfg_timeformat, zend_ibase_globals, ibase_globals)
PHP_INI_END()
static void php_ibase_init_globals(zend_ibase_globals *ibase_globals)
@@ -628,10 +628,10 @@
}
/* }}} */
-enum connect_args { DB = 0, USER = 1, PASS = 2, CSET = 3, ROLE = 4, BUF = 0, DLECT =
1 };
+enum connect_args { DB = 0, USER = 1, PASS = 2, CSET = 3, ROLE = 4, BUF = 0, DLECT =
1, SYNC = 2 };
static char const dpb_args[] = {
- 0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name
+ 0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype,
isc_dpb_sql_role_name, 0
};
int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db
TSRMLS_DC)
@@ -650,6 +650,9 @@
dpb += sprintf(dpb, "%c\2%c%c", isc_dpb_num_buffers,
(char)(largs[BUF] >> 8), (char)(largs[BUF] & 0xff));
}
+ if (largs[SYNC]) {
+ dpb += sprintf(dpb, "%c\1%c", isc_dpb_force_write, largs[SYNC] ==
isc_spb_prp_wm_sync ? 1 : 0);
+ }
if (isc_attach_database(IB_STATUS, (short)len[DB], args[DB], db,
(short)(dpb-dpb_buffer), dpb_buffer)) {
_php_ibase_error(TSRMLS_C);
return FAILURE;
@@ -662,7 +665,7 @@
{
char hash[16], *args[] = { NULL, NULL, NULL, NULL, NULL };
int i, len[] = { 0, 0, 0, 0, 0 };
- long largs[] = { 0, 0 };
+ long largs[] = { 0, 0, 0 };
PHP_MD5_CTX hash_context;
list_entry new_index_ptr, *le;
isc_db_handle db_handle = NULL;
@@ -670,9 +673,10 @@
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sssslls",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssllsl",
&args[DB], &len[DB], &args[USER], &len[USER], &args[PASS],
&len[PASS],
- &args[CSET], &len[CSET], &largs[BUF], &largs[DLECT],
&args[ROLE], &len[ROLE])) {
+ &args[CSET], &len[CSET], &largs[BUF], &largs[DLECT],
&args[ROLE], &len[ROLE],
+ &largs[SYNC])) {
RETURN_FALSE;
}
http://cvs.php.net/diff.php/php-src/ext/interbase/php_ibase_includes.h?r1=1.10&r2=1.11&ty=u
Index: php-src/ext/interbase/php_ibase_includes.h
diff -u php-src/ext/interbase/php_ibase_includes.h:1.10
php-src/ext/interbase/php_ibase_includes.h:1.11
--- php-src/ext/interbase/php_ibase_includes.h:1.10 Fri May 21 09:14:56 2004
+++ php-src/ext/interbase/php_ibase_includes.h Fri May 28 19:39:33 2004
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ibase_includes.h,v 1.10 2004/05/21 13:14:56 abies Exp $ */
+/* $Id: php_ibase_includes.h,v 1.11 2004/05/28 23:39:33 abies Exp $ */
#ifndef PHP_IBASE_INCLUDES_H
#define PHP_IBASE_INCLUDES_H
@@ -49,6 +49,9 @@
#define IBASE_MSGSIZE 256
#define MAX_ERRMSG (IBASE_MSGSIZE*2)
+
+#define IB_DEF_DATE_FMT "%Y-%m-%d"
+#define IB_DEF_TIME_FMT "%H:%M:%S"
/* this value should never be > USHRT_MAX */
#define IBASE_BLOB_SEG 4096
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php