summaryrefslogtreecommitdiff
path: root/ext/pdo/php_pdo.h
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-09-20 00:33:42 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-09-20 00:33:42 +0000
commit3953b14024b6da7da2edbe026f3dfdc7e2db4119 (patch)
tree31a45363b4cc77f0bc3a199b86cc7837297d1c32 /ext/pdo/php_pdo.h
parent2c6cf58a961ba08ace3dfd64a3e295f2512df6b5 (diff)
downloadphp-git-3953b14024b6da7da2edbe026f3dfdc7e2db4119.tar.gz
Make PDO use class constants
Diffstat (limited to 'ext/pdo/php_pdo.h')
-rwxr-xr-xext/pdo/php_pdo.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
index c9fbb5606c..ba63cbfb97 100755
--- a/ext/pdo/php_pdo.h
+++ b/ext/pdo/php_pdo.h
@@ -58,6 +58,18 @@ ZEND_END_MODULE_GLOBALS(pdo)
# define PDOG(v) (pdo_globals.v)
#endif
+#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \
+ zend_declare_class_constant_long(pdo_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) \
+ zend_declare_class_constant_stringl(pdo_dbh_ce, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
+
#endif /* PHP_PDO_H */