summaryrefslogtreecommitdiff
path: root/ext/pdo/php_pdo.h
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2006-05-11 22:43:44 +0000
committerMarcus Boerger <helly@php.net>2006-05-11 22:43:44 +0000
commit7bbab02633f2f89285115be576e5183b66b303ce (patch)
tree02f9ba2856ee073b93e68d939e06df63c6d8079d /ext/pdo/php_pdo.h
parent7412202c43e74d24c55669dedc36542e43b4f2bb (diff)
downloadphp-git-7bbab02633f2f89285115be576e5183b66b303ce.tar.gz
- MFH
. Fix iterator based access . Add new attribute ATTR_DEFAULT_FETCH_MODE: $bdh->setAttribute() . Add new fetch mode: FETCH_PROPS_LATE, this fills object member variables after calling the constructor (fixes #36428).
Diffstat (limited to 'ext/pdo/php_pdo.h')
-rwxr-xr-xext/pdo/php_pdo.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
index b8758eeed9..ae3c15606d 100755
--- a/ext/pdo/php_pdo.h
+++ b/ext/pdo/php_pdo.h
@@ -62,14 +62,17 @@ ZEND_END_MODULE_GLOBALS(pdo)
# define PDOG(v) (pdo_globals.v)
#endif
-PDO_API void php_pdo_declare_long_constant(const char *const_name, size_t name_len, long value TSRMLS_DC);
-PDO_API void php_pdo_declare_stringl_constant(const char *const_name, size_t name_len, const char *value, size_t value_len TSRMLS_DC);
-
#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \
- php_pdo_declare_long_constant(const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
+ zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
+
+#define REGISTER_PDO_CONST_LONG(const_name, value) { \
+ zend_class_entry **pce; \
+ if (zend_hash_find(CG(class_table), "pdo", sizeof("pdo"), (void **) &pce) != FAILURE) \
+ zend_declare_class_constant_long(*pce, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); \
+} \
#define REGISTER_PDO_CLASS_CONST_STRING(const_name, value) \
- php_pdo_declare_stringl_constant(const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
+ zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
#define PDO_CONSTRUCT_CHECK \
if (!dbh->driver) { \