void php_pq_callback_dtor(php_pq_callback_t *cb);
void php_pq_callback_addref(php_pq_callback_t *cb);
zval *php_pq_callback_to_zval(php_pq_callback_t *cb);
-zend_bool php_pq_callback_is_locked(php_pq_callback_t *cb);
+zend_bool php_pq_callback_is_locked(php_pq_callback_t *cb TSRMLS_DC);
void php_pq_callback_recurse(php_pq_callback_t *old, php_pq_callback_t *new TSRMLS_DC);
#endif
typedef int STATUS; /* SUCCESS/FAILURE */
+/* TSRM morony */
+#if PHP_VERSION_ID >= 50700
+# define z_is_true(z) zend_is_true(z TSRMLS_CC)
+#else
+# define z_is_true zend_is_true
+#endif
+
/* trim LF from EOL */
char *rtrim(char *e);
{
php_pqconn_object_t *obj = o;
- obj->intern->unbuffered = zend_is_true(value);
+ obj->intern->unbuffered = z_is_true(value);
}
static void php_pqconn_object_read_db(zval *object, void *o, zval *return_value TSRMLS_DC)
} else if (obj->intern->conn->intern->unbuffered && !PQsetSingleRowMode(obj->intern->conn->intern->conn)) {
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to enable unbuffered mode (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
} else {
- php_pq_callback_recurse(&obj->intern->conn->intern->onevent, &resolver);
+ php_pq_callback_recurse(&obj->intern->conn->intern->onevent, &resolver TSRMLS_CC);
obj->intern->conn->intern->poller = PQconsumeInput;
}
} else {
php_pqcur_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
if (!obj->intern) {
- throw_exce(EX_UNINITIALIZED, "pq\\Cursor not initialized");
+ throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Cursor not initialized");
} else if (!obj->intern->open) {
- if (SUCCESS == php_pqconn_declare(NULL, obj->intern->conn, obj->intern->decl)) {
+ if (SUCCESS == php_pqconn_declare(NULL, obj->intern->conn, obj->intern->decl TSRMLS_CC)) {
obj->intern->open = 1;
}
}
php_pqcur_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
if (!obj->intern) {
- throw_exce(EX_UNINITIALIZED, "pq\\Cursor not initialized");
+ throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Cursor not initialized");
} else {
cur_close(obj TSRMLS_CC);
}
php_pqtxn_object_t *obj = o;
PGresult *res;
- if ((obj->intern->readonly = zend_is_true(value))) {
+ if ((obj->intern->readonly = z_is_true(value))) {
res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION READ ONLY");
} else {
res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION READ WRITE");
php_pqtxn_object_t *obj = o;
PGresult *res;
- if ((obj->intern->deferrable = zend_is_true(value))) {
+ if ((obj->intern->deferrable = z_is_true(value))) {
res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION DEFERRABLE");
} else {
res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION NOT DEFERRABLE");