@@ -130,8 +130,13 @@ extern zend_class_entry *pcbc_binary_collection_ce;
130
130
#define PCBC_RESOLVE_COLLECTION PCBC_RESOLVE_COLLECTION_EX(pcbc_collection_ce)
131
131
#define PCBC_RESOLVE_BINARY_COLLECTION PCBC_RESOLVE_COLLECTION_EX(pcbc_binary_collection_ce)
132
132
133
+ #define PCBC_OPCODE_UNSPEC (-1)
134
+ #define PCBC_OPCODE_REPLACE (1)
135
+ #define PCBC_OPCODE_DELETE (2)
136
+ #define PCBC_OPCODE_UNLOCK (3)
137
+
133
138
void pcbc_create_lcb_exception (zval * return_value , long code , zend_string * context , zend_string * ref , int http_code ,
134
- const char * http_msg TSRMLS_DC );
139
+ const char * http_msg , int opcode TSRMLS_DC );
135
140
136
141
void pcbc_exception_init (zval * return_value , long code , const char * message TSRMLS_DC );
137
142
#define throw_pcbc_exception (__pcbc_message , __pcbc_code ) \
@@ -142,7 +147,7 @@ void pcbc_exception_init(zval *return_value, long code, const char *message TSRM
142
147
zend_throw_exception_object(&__pcbc_error TSRMLS_CC); \
143
148
} while (0)
144
149
145
- #define throw_lcb_exception (code , result_ce ) \
150
+ #define throw_lcb_exception_ex (code , opcode , result_ce ) \
146
151
do { \
147
152
zend_string *ctx = NULL, *ref = NULL; \
148
153
zval *zref, __rv1, *zctx, __rv2; \
@@ -158,15 +163,18 @@ void pcbc_exception_init(zval *return_value, long code, const char *message TSRM
158
163
} \
159
164
zval __pcbc_error; \
160
165
ZVAL_UNDEF(&__pcbc_error); \
161
- pcbc_create_lcb_exception(&__pcbc_error, code, ctx, ref, 0, NULL TSRMLS_CC); \
166
+ pcbc_create_lcb_exception(&__pcbc_error, code, ctx, ref, 0, NULL, opcode TSRMLS_CC); \
162
167
zend_throw_exception_object(&__pcbc_error TSRMLS_CC); \
163
168
} while (0)
164
169
170
+ #define throw_lcb_exception (code , result_ce ) throw_lcb_exception_ex((code), PCBC_OPCODE_UNSPEC, (result_ce))
171
+
165
172
#define throw_http_exception (code , query_code , query_msg ) \
166
173
do { \
167
174
zval __pcbc_error; \
168
175
ZVAL_UNDEF(&__pcbc_error); \
169
- pcbc_create_lcb_exception(&__pcbc_error, code, NULL, NULL, query_code, query_msg TSRMLS_CC); \
176
+ pcbc_create_lcb_exception(&__pcbc_error, code, NULL, NULL, query_code, query_msg, \
177
+ PCBC_OPCODE_UNSPEC TSRMLS_CC); \
170
178
zend_throw_exception_object(&__pcbc_error TSRMLS_CC); \
171
179
} while (0)
172
180
0 commit comments