update from docs
authorMichael Wallner <mike@php.net>
Fri, 26 Sep 2014 13:05:40 +0000 (15:05 +0200)
committerMichael Wallner <mike@php.net>
Fri, 26 Sep 2014 13:05:40 +0000 (15:05 +0200)
src/php_pqconn.c
src/php_pqres.c
src/php_pqstm.c
src/php_pqtxn.c
src/php_pqtypes.c

index daf2c79..b978bb0 100644 (file)
@@ -1970,7 +1970,7 @@ PHP_MINIT_FUNCTION(pqconn)
        php_pqconn_object_handlers.get_properties = php_pq_object_properties;
        php_pqconn_object_handlers.get_debug_info = php_pq_object_debug_info;
 
-       zend_hash_init(&php_pqconn_object_prophandlers, 14, NULL, NULL, 1);
+       zend_hash_init(&php_pqconn_object_prophandlers, 19, NULL, NULL, 1);
 
        zend_declare_property_long(php_pqconn_class_entry, ZEND_STRL("status"), CONNECTION_BAD, ZEND_ACC_PUBLIC TSRMLS_CC);
        ph.read = php_pqconn_object_read_status;
index 2c75655..0197732 100644 (file)
@@ -1136,7 +1136,7 @@ PHP_MINIT_FUNCTION(pqres)
        php_pqres_object_handlers.get_properties = php_pq_object_properties;
        php_pqres_object_handlers.count_elements = php_pqres_count_elements;
 
-       zend_hash_init(&php_pqres_object_prophandlers, 6, NULL, NULL, 1);
+       zend_hash_init(&php_pqres_object_prophandlers, 8, NULL, NULL, 1);
 
        zend_declare_property_null(php_pqres_class_entry, ZEND_STRL("status"), ZEND_ACC_PUBLIC TSRMLS_CC);
        ph.read = php_pqres_object_read_status;
index d9ec1ea..4b71038 100644 (file)
@@ -165,8 +165,14 @@ ZEND_END_ARG_INFO();
 static PHP_METHOD(pqstm, bind) {
        long param_no;
        zval *param_ref;
+       zend_error_handling zeh;
+       STATUS rv;
+
+       zend_replace_error_handling(EH_THROW, exce(EX_INVALID_ARGUMENT), &zeh TSRMLS_CC);
+       rv = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &param_no, &param_ref);
+       zend_restore_error_handling(&zeh TSRMLS_CC);
 
-       if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &param_no, &param_ref)) {
+       if (SUCCESS == rv) {
                php_pqstm_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
 
                if (!obj->intern) {
index fcf7a4b..5fc1e9d 100644 (file)
@@ -355,7 +355,7 @@ static PHP_METHOD(pqtxn, commit) {
                if (!obj->intern) {
                        throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Transacation not initialized");
                } else if (!obj->intern->open) {
-                       throw_exce(EX_RUNTIME TSRMLS_CC, "pq\\Transacation already closed");
+                       throw_exce(EX_RUNTIME TSRMLS_CC, "pq\\Transaction already closed");
                } else {
                        PGresult *res;
                        smart_str cmd = {0};
index ff9c10d..8f4b53d 100644 (file)
@@ -207,7 +207,7 @@ static PHP_METHOD(pqtypes, __construct) {
                        obj->intern = ecalloc(1, sizeof(*obj->intern));
                        obj->intern->conn = conn_obj;
                        php_pq_object_addref(conn_obj TSRMLS_CC);
-                       zend_hash_init(&obj->intern->types, 300, NULL, ZVAL_PTR_DTOR, 0);
+                       zend_hash_init(&obj->intern->types, 512, NULL, ZVAL_PTR_DTOR, 0);
 
                        if (znsp) {
                                zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "refresh", &retval, znsp);
@@ -337,6 +337,10 @@ PHP_MINIT_FUNCTION(pqtypes)
        php_pqtypes_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);
        php_pqtypes_class_entry->create_object = php_pqtypes_create_object;
 
+       /*
+       zend_class_implements(php_pqtypes_class_entry TSRMLS_CC, 1, zend_ce_arrayaccess);
+       */
+
        memcpy(&php_pqtypes_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
        php_pqtypes_object_handlers.read_property = php_pq_object_read_prop;
        php_pqtypes_object_handlers.write_property = php_pq_object_write_prop;