Lines Matching refs:param
69 ZEND_ARG_INFO(0, param) in ZEND_END_ARG_INFO()
75 ZEND_ARG_INFO(1, param) in ZEND_END_ARG_INFO()
83 ZEND_ARG_INFO(1, param) in ZEND_END_ARG_INFO()
114 static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /*…
130 if (!param->name) {
132 if ((name = zend_hash_index_find_ptr(stmt->bound_param_map, param->paramno)) != NULL) {
133 param->name = zend_string_init(name, strlen(name), 0);
141 if (strncmp(name, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1)) {
145 if (param->paramno >= 0) {
149 param->paramno = position;
163 struct pdo_bound_param_data *param; in dispatch_param_event() local
178 ZEND_HASH_FOREACH_PTR(ht, param) { in dispatch_param_event()
179 if (!stmt->methods->param_hook(stmt, param, event_type)) { in dispatch_param_event()
230 struct pdo_bound_param_data *param; in pdo_stmt_describe_columns() local
232 if ((param = zend_hash_find_ptr(stmt->bound_columns, in pdo_stmt_describe_columns()
234 param->paramno = col; in pdo_stmt_describe_columns()
260 struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)Z_PTR_P(el); in param_dtor() local
263 if (param->stmt->methods->param_hook) { in param_dtor()
264 param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE); in param_dtor()
267 if (param->name) { in param_dtor()
268 zend_string_release_ex(param->name, 0); in param_dtor()
271 if (!Z_ISUNDEF(param->parameter)) { in param_dtor()
272 zval_ptr_dtor(¶m->parameter); in param_dtor()
273 ZVAL_UNDEF(¶m->parameter); in param_dtor()
275 if (!Z_ISUNDEF(param->driver_params)) { in param_dtor()
276 zval_ptr_dtor(¶m->driver_params); in param_dtor()
278 efree(param); in param_dtor()
282 static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is… in really_register_bound_param() argument
301 if (!Z_ISREF(param->parameter)) { in really_register_bound_param()
302 parameter = ¶m->parameter; in really_register_bound_param()
304 parameter = Z_REFVAL(param->parameter); in really_register_bound_param()
307 …if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P… in really_register_bound_param()
318 …} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE … in really_register_bound_param()
320 } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(parameter) == IS_LONG) { in really_register_bound_param()
324 param->stmt = stmt; in really_register_bound_param()
325 param->is_param = is_param; in really_register_bound_param()
327 if (Z_REFCOUNTED(param->driver_params)) { in really_register_bound_param()
328 Z_ADDREF(param->driver_params); in really_register_bound_param()
331 if (!is_param && param->name && stmt->columns) { in really_register_bound_param()
336 if (ZSTR_LEN(stmt->columns[i].name) == ZSTR_LEN(param->name) && in really_register_bound_param()
337 … strncmp(ZSTR_VAL(stmt->columns[i].name), ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1) == 0) { in really_register_bound_param()
338 param->paramno = i; in really_register_bound_param()
345 if (param->paramno == -1) { in really_register_bound_param()
347 …id not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); in really_register_bound_param()
353 if (param->name) { in really_register_bound_param()
354 if (is_param && ZSTR_VAL(param->name)[0] != ':') { in really_register_bound_param()
355 zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0); in really_register_bound_param()
357 memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1); in really_register_bound_param()
358 param->name = temp; in really_register_bound_param()
360 param->name = zend_string_init(ZSTR_VAL(param->name), ZSTR_LEN(param->name), 0); in really_register_bound_param()
364 if (is_param && !rewrite_name_to_position(stmt, param)) { in really_register_bound_param()
365 if (param->name) { in really_register_bound_param()
366 zend_string_release_ex(param->name, 0); in really_register_bound_param()
367 param->name = NULL; in really_register_bound_param()
377 if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE in really_register_bound_param()
379 if (param->name) { in really_register_bound_param()
380 zend_string_release_ex(param->name, 0); in really_register_bound_param()
381 param->name = NULL; in really_register_bound_param()
390 if (param->paramno >= 0) { in really_register_bound_param()
391 zend_hash_index_del(hash, param->paramno); in really_register_bound_param()
395 if (param->name) { in really_register_bound_param()
396 pparam = zend_hash_update_mem(hash, param->name, param, sizeof(struct pdo_bound_param_data)); in really_register_bound_param()
398 …pparam = zend_hash_index_update_mem(hash, param->paramno, param, sizeof(struct pdo_bound_param_dat… in really_register_bound_param()
413 ZVAL_UNDEF(¶m->parameter); in really_register_bound_param()
437 struct pdo_bound_param_data param; in PHP_METHOD() local
449 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
453 param.name = key; in PHP_METHOD()
454 param.paramno = -1; in PHP_METHOD()
463 param.paramno = num_index; in PHP_METHOD()
466 param.param_type = PDO_PARAM_STR; in PHP_METHOD()
467 ZVAL_COPY(¶m.parameter, tmp); in PHP_METHOD()
469 if (!really_register_bound_param(¶m, stmt, 1)) { in PHP_METHOD()
470 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
471 zval_ptr_dtor(¶m.parameter); in PHP_METHOD()
697 struct pdo_bound_param_data *param; in do_fetch_common() local
699 ZEND_HASH_FOREACH_PTR(stmt->bound_columns, param) { in do_fetch_common()
700 if (param->paramno >= 0) { in do_fetch_common()
701 if (!Z_ISREF(param->parameter)) { in do_fetch_common()
706 zval_ptr_dtor(Z_REFVAL(param->parameter)); in do_fetch_common()
709 fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, (int *)¶m->param_type); in do_fetch_common()
1530 struct pdo_bound_param_data param; in register_bound_param() local
1534 memset(¶m, 0, sizeof(param)); in register_bound_param()
1535 param.paramno = -1; in register_bound_param()
1538 "lz|llz!", ¶m.paramno, ¶meter, ¶m_type, ¶m.max_value_len, in register_bound_param()
1540 if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", ¶m.name, in register_bound_param()
1541 ¶meter, ¶m_type, ¶m.max_value_len, in register_bound_param()
1547 param.param_type = (int) param_type; in register_bound_param()
1549 if (param.paramno > 0) { in register_bound_param()
1550 --param.paramno; /* make it zero-based internally */ in register_bound_param()
1551 } else if (!param.name) { in register_bound_param()
1557 ZVAL_COPY(¶m.driver_params, driver_params); in register_bound_param()
1560 ZVAL_COPY(¶m.parameter, parameter); in register_bound_param()
1561 if (!really_register_bound_param(¶m, stmt, is_param)) { in register_bound_param()
1562 if (!Z_ISUNDEF(param.parameter)) { in register_bound_param()
1563 zval_ptr_dtor(&(param.parameter)); in register_bound_param()
1574 struct pdo_bound_param_data param; in PHP_METHOD() local
1579 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
1580 param.paramno = -1; in PHP_METHOD()
1583 "lz|l", ¶m.paramno, ¶meter, ¶m_type)) { in PHP_METHOD()
1584 if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", ¶m.name, in PHP_METHOD()
1590 param.param_type = (int) param_type; in PHP_METHOD()
1592 if (param.paramno > 0) { in PHP_METHOD()
1593 --param.paramno; /* make it zero-based internally */ in PHP_METHOD()
1594 } else if (!param.name) { in PHP_METHOD()
1599 ZVAL_COPY(¶m.parameter, parameter); in PHP_METHOD()
1600 if (!really_register_bound_param(¶m, stmt, TRUE)) { in PHP_METHOD()
1601 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
1602 zval_ptr_dtor(&(param.parameter)); in PHP_METHOD()
1603 ZVAL_UNDEF(¶m.parameter); in PHP_METHOD()
2101 struct pdo_bound_param_data *param; in PHP_METHOD() local
2128 ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) { in PHP_METHOD()
2141 …param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name)… in PHP_METHOD()
2142 param->name ? ZSTR_VAL(param->name) : "", in PHP_METHOD()
2143 param->is_param, in PHP_METHOD()
2144 param->param_type); in PHP_METHOD()