Lines Matching refs:param

71 	ZEND_ARG_INFO(0, param)  in ZEND_END_ARG_INFO()
77 ZEND_ARG_INFO(1, param) in ZEND_END_ARG_INFO()
85 ZEND_ARG_INFO(1, param) in ZEND_END_ARG_INFO()
122 static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /*… in rewrite_name_to_position() argument
138 if (!param->name) { in rewrite_name_to_position()
140 if ((name = zend_hash_index_find_ptr(stmt->bound_param_map, param->paramno)) != NULL) { in rewrite_name_to_position()
141 param->name = zend_string_init(name, strlen(name), 0); in rewrite_name_to_position()
149 if (strncmp(name, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1)) { in rewrite_name_to_position()
153 if (param->paramno >= 0) { in rewrite_name_to_position()
157 param->paramno = position; in rewrite_name_to_position()
171 struct pdo_bound_param_data *param; in dispatch_param_event() local
182 ZEND_HASH_FOREACH_PTR(ht, param) { in dispatch_param_event()
183 if (!stmt->methods->param_hook(stmt, param, event_type)) { in dispatch_param_event()
235 struct pdo_bound_param_data *param; in pdo_stmt_describe_columns()
238 stmt->columns[col].namelen, (void**)&param)) { in pdo_stmt_describe_columns()
239 param->paramno = col; in pdo_stmt_describe_columns()
244 struct pdo_bound_param_data *param; in pdo_stmt_describe_columns() local
246 if ((param = zend_hash_find_ptr(stmt->bound_columns, in pdo_stmt_describe_columns()
248 param->paramno = col; in pdo_stmt_describe_columns()
274 struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)Z_PTR_P(el); in param_dtor() local
277 if (param->stmt->methods->param_hook) { in param_dtor()
278 param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE); in param_dtor()
281 if (param->name) { in param_dtor()
282 zend_string_release(param->name); in param_dtor()
285 if (!Z_ISUNDEF(param->parameter)) { in param_dtor()
286 zval_ptr_dtor(&param->parameter); in param_dtor()
287 ZVAL_UNDEF(&param->parameter); in param_dtor()
289 if (!Z_ISUNDEF(param->driver_params)) { in param_dtor()
290 zval_ptr_dtor(&param->driver_params); in param_dtor()
292 efree(param); in param_dtor()
296 static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is… in really_register_bound_param() argument
315 if (!Z_ISREF(param->parameter)) { in really_register_bound_param()
316 parameter = &param->parameter; in really_register_bound_param()
318 parameter = Z_REFVAL(param->parameter); in really_register_bound_param()
321 …if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P… in really_register_bound_param()
330 …} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE … in really_register_bound_param()
332 } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(parameter) == IS_LONG) { in really_register_bound_param()
336 param->stmt = stmt; in really_register_bound_param()
337 param->is_param = is_param; in really_register_bound_param()
339 if (Z_REFCOUNTED(param->driver_params)) { in really_register_bound_param()
340 Z_ADDREF(param->driver_params); in really_register_bound_param()
343 if (!is_param && param->name && stmt->columns) { in really_register_bound_param()
348 if (ZSTR_LEN(stmt->columns[i].name) == ZSTR_LEN(param->name) && in really_register_bound_param()
349 … strncmp(ZSTR_VAL(stmt->columns[i].name), ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1) == 0) { in really_register_bound_param()
350 param->paramno = i; in really_register_bound_param()
357 if (param->paramno == -1) { in really_register_bound_param()
359 …id not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); in really_register_bound_param()
365 if (param->name) { in really_register_bound_param()
366 if (is_param && ZSTR_VAL(param->name)[0] != ':') { in really_register_bound_param()
367 zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0); in really_register_bound_param()
369 memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1); in really_register_bound_param()
370 param->name = temp; in really_register_bound_param()
372 param->name = zend_string_init(ZSTR_VAL(param->name), ZSTR_LEN(param->name), 0); in really_register_bound_param()
376 if (is_param && !rewrite_name_to_position(stmt, param)) { in really_register_bound_param()
377 if (param->name) { in really_register_bound_param()
378 zend_string_release(param->name); in really_register_bound_param()
379 param->name = NULL; in really_register_bound_param()
389 if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE in really_register_bound_param()
391 if (param->name) { in really_register_bound_param()
392 zend_string_release(param->name); in really_register_bound_param()
393 param->name = NULL; in really_register_bound_param()
402 if (param->paramno >= 0) { in really_register_bound_param()
403 zend_hash_index_del(hash, param->paramno); in really_register_bound_param()
407 if (param->name) { in really_register_bound_param()
408 pparam = zend_hash_update_mem(hash, param->name, param, sizeof(struct pdo_bound_param_data)); in really_register_bound_param()
410 …pparam = zend_hash_index_update_mem(hash, param->paramno, param, sizeof(struct pdo_bound_param_dat… in really_register_bound_param()
425 ZVAL_UNDEF(&param->parameter); in really_register_bound_param()
448 struct pdo_bound_param_data param; in PHP_METHOD() local
460 memset(&param, 0, sizeof(param)); in PHP_METHOD()
464 param.name = key; in PHP_METHOD()
465 param.paramno = -1; in PHP_METHOD()
474 param.paramno = num_index; in PHP_METHOD()
477 param.param_type = PDO_PARAM_STR; in PHP_METHOD()
478 ZVAL_COPY(&param.parameter, tmp); in PHP_METHOD()
480 if (!really_register_bound_param(&param, stmt, 1)) { in PHP_METHOD()
481 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
482 zval_ptr_dtor(&param.parameter); in PHP_METHOD()
703 struct pdo_bound_param_data *param; in do_fetch_common() local
705 ZEND_HASH_FOREACH_PTR(stmt->bound_columns, param) { in do_fetch_common()
706 if (param->paramno >= 0) { in do_fetch_common()
707 if (!Z_ISREF(param->parameter)) { in do_fetch_common()
712 zval_ptr_dtor(Z_REFVAL(param->parameter)); in do_fetch_common()
715 fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, (int *)&param->param_type); in do_fetch_common()
1542 struct pdo_bound_param_data param = {{{0}}}; in register_bound_param() local
1546 param.paramno = -1; in register_bound_param()
1549 "lz|llz!", &param.paramno, &parameter, &param_type, &param.max_value_len, in register_bound_param()
1551 if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", &param.name, in register_bound_param()
1552 &parameter, &param_type, &param.max_value_len, in register_bound_param()
1558 param.param_type = (int) param_type; in register_bound_param()
1560 if (param.paramno > 0) { in register_bound_param()
1561 --param.paramno; /* make it zero-based internally */ in register_bound_param()
1562 } else if (!param.name) { in register_bound_param()
1568 ZVAL_COPY(&param.driver_params, driver_params); in register_bound_param()
1571 ZVAL_COPY(&param.parameter, parameter); in register_bound_param()
1572 if (!really_register_bound_param(&param, stmt, is_param)) { in register_bound_param()
1573 if (!Z_ISUNDEF(param.parameter)) { in register_bound_param()
1574 zval_ptr_dtor(&(param.parameter)); in register_bound_param()
1585 struct pdo_bound_param_data param = {{{0}}}; in PHP_METHOD() local
1590 param.paramno = -1; in PHP_METHOD()
1593 "lz/|l", &param.paramno, &parameter, &param_type)) { in PHP_METHOD()
1594 if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz/|l", &param.name, in PHP_METHOD()
1600 param.param_type = (int) param_type; in PHP_METHOD()
1602 if (param.paramno > 0) { in PHP_METHOD()
1603 --param.paramno; /* make it zero-based internally */ in PHP_METHOD()
1604 } else if (!param.name) { in PHP_METHOD()
1609 ZVAL_COPY(&param.parameter, parameter); in PHP_METHOD()
1610 if (!really_register_bound_param(&param, stmt, TRUE)) { in PHP_METHOD()
1611 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
1612 zval_ptr_dtor(&(param.parameter)); in PHP_METHOD()
1613 ZVAL_UNDEF(&param.parameter); in PHP_METHOD()
2108 struct pdo_bound_param_data *param; in PHP_METHOD() local
2126 ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) { in PHP_METHOD()
2135param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name)… in PHP_METHOD()
2136 param->name ? ZSTR_VAL(param->name) : "", in PHP_METHOD()
2137 param->is_param, in PHP_METHOD()
2138 param->param_type); in PHP_METHOD()