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()
116 static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /*…
132 if (!param->name) {
134 if ((name = zend_hash_index_find_ptr(stmt->bound_param_map, param->paramno)) != NULL) {
135 param->name = zend_string_init(name, strlen(name), 0);
143 if (strncmp(name, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1)) {
147 if (param->paramno >= 0) {
151 param->paramno = position;
165 struct pdo_bound_param_data *param; in dispatch_param_event() local
176 ZEND_HASH_FOREACH_PTR(ht, param) { in dispatch_param_event()
177 if (!stmt->methods->param_hook(stmt, param, event_type)) { in dispatch_param_event()
229 struct pdo_bound_param_data *param; in pdo_stmt_describe_columns()
232 stmt->columns[col].namelen, (void**)&param)) { in pdo_stmt_describe_columns()
233 param->paramno = col; in pdo_stmt_describe_columns()
238 struct pdo_bound_param_data *param; in pdo_stmt_describe_columns() local
240 if ((param = zend_hash_find_ptr(stmt->bound_columns, in pdo_stmt_describe_columns()
242 param->paramno = col; in pdo_stmt_describe_columns()
268 struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)Z_PTR_P(el); in param_dtor() local
271 if (param->stmt->methods->param_hook) { in param_dtor()
272 param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE); in param_dtor()
275 if (param->name) { in param_dtor()
276 zend_string_release(param->name); in param_dtor()
279 if (!Z_ISUNDEF(param->parameter)) { in param_dtor()
280 zval_ptr_dtor(&param->parameter); in param_dtor()
281 ZVAL_UNDEF(&param->parameter); in param_dtor()
283 if (!Z_ISUNDEF(param->driver_params)) { in param_dtor()
284 zval_ptr_dtor(&param->driver_params); in param_dtor()
286 efree(param); in param_dtor()
290 static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is… in really_register_bound_param() argument
309 if (!Z_ISREF(param->parameter)) { in really_register_bound_param()
310 parameter = &param->parameter; in really_register_bound_param()
312 parameter = Z_REFVAL(param->parameter); in really_register_bound_param()
315 …if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P… in really_register_bound_param()
324 …} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE … in really_register_bound_param()
326 } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(parameter) == IS_LONG) { in really_register_bound_param()
330 param->stmt = stmt; in really_register_bound_param()
331 param->is_param = is_param; in really_register_bound_param()
333 if (Z_REFCOUNTED(param->driver_params)) { in really_register_bound_param()
334 Z_ADDREF(param->driver_params); in really_register_bound_param()
337 if (!is_param && param->name && stmt->columns) { in really_register_bound_param()
342 if (ZSTR_LEN(stmt->columns[i].name) == ZSTR_LEN(param->name) && in really_register_bound_param()
343 … strncmp(ZSTR_VAL(stmt->columns[i].name), ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1) == 0) { in really_register_bound_param()
344 param->paramno = i; in really_register_bound_param()
351 if (param->paramno == -1) { in really_register_bound_param()
353 …id not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); in really_register_bound_param()
359 if (param->name) { in really_register_bound_param()
360 if (is_param && ZSTR_VAL(param->name)[0] != ':') { in really_register_bound_param()
361 zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0); in really_register_bound_param()
363 memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1); in really_register_bound_param()
364 param->name = temp; in really_register_bound_param()
366 param->name = zend_string_init(ZSTR_VAL(param->name), ZSTR_LEN(param->name), 0); in really_register_bound_param()
370 if (is_param && !rewrite_name_to_position(stmt, param)) { in really_register_bound_param()
371 if (param->name) { in really_register_bound_param()
372 zend_string_release(param->name); in really_register_bound_param()
373 param->name = NULL; in really_register_bound_param()
383 if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE in really_register_bound_param()
385 if (param->name) { in really_register_bound_param()
386 zend_string_release(param->name); in really_register_bound_param()
387 param->name = NULL; in really_register_bound_param()
396 if (param->paramno >= 0) { in really_register_bound_param()
397 zend_hash_index_del(hash, param->paramno); in really_register_bound_param()
401 if (param->name) { in really_register_bound_param()
402 pparam = zend_hash_update_mem(hash, param->name, param, sizeof(struct pdo_bound_param_data)); in really_register_bound_param()
404 …pparam = zend_hash_index_update_mem(hash, param->paramno, param, sizeof(struct pdo_bound_param_dat… in really_register_bound_param()
419 ZVAL_UNDEF(&param->parameter); in really_register_bound_param()
442 struct pdo_bound_param_data param; in PHP_METHOD() local
454 memset(&param, 0, sizeof(param)); in PHP_METHOD()
458 param.name = key; in PHP_METHOD()
459 param.paramno = -1; in PHP_METHOD()
468 param.paramno = num_index; in PHP_METHOD()
471 param.param_type = PDO_PARAM_STR; in PHP_METHOD()
472 ZVAL_COPY(&param.parameter, tmp); in PHP_METHOD()
474 if (!really_register_bound_param(&param, stmt, 1)) { in PHP_METHOD()
475 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
476 zval_ptr_dtor(&param.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 *)&param->param_type); in do_fetch_common()
1534 struct pdo_bound_param_data param; in register_bound_param() local
1538 memset(&param, 0, sizeof(param)); in register_bound_param()
1539 param.paramno = -1; in register_bound_param()
1542 "lz|llz!", &param.paramno, &parameter, &param_type, &param.max_value_len, in register_bound_param()
1544 if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", &param.name, in register_bound_param()
1545 &parameter, &param_type, &param.max_value_len, in register_bound_param()
1551 param.param_type = (int) param_type; in register_bound_param()
1553 if (param.paramno > 0) { in register_bound_param()
1554 --param.paramno; /* make it zero-based internally */ in register_bound_param()
1555 } else if (!param.name) { in register_bound_param()
1561 ZVAL_COPY(&param.driver_params, driver_params); in register_bound_param()
1564 ZVAL_COPY(&param.parameter, parameter); in register_bound_param()
1565 if (!really_register_bound_param(&param, stmt, is_param)) { in register_bound_param()
1566 if (!Z_ISUNDEF(param.parameter)) { in register_bound_param()
1567 zval_ptr_dtor(&(param.parameter)); in register_bound_param()
1578 struct pdo_bound_param_data param; in PHP_METHOD() local
1583 memset(&param, 0, sizeof(param)); in PHP_METHOD()
1584 param.paramno = -1; in PHP_METHOD()
1587 "lz/|l", &param.paramno, &parameter, &param_type)) { in PHP_METHOD()
1588 if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz/|l", &param.name, in PHP_METHOD()
1594 param.param_type = (int) param_type; in PHP_METHOD()
1596 if (param.paramno > 0) { in PHP_METHOD()
1597 --param.paramno; /* make it zero-based internally */ in PHP_METHOD()
1598 } else if (!param.name) { in PHP_METHOD()
1603 ZVAL_COPY(&param.parameter, parameter); in PHP_METHOD()
1604 if (!really_register_bound_param(&param, stmt, TRUE)) { in PHP_METHOD()
1605 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
1606 zval_ptr_dtor(&(param.parameter)); in PHP_METHOD()
1607 ZVAL_UNDEF(&param.parameter); in PHP_METHOD()
2102 struct pdo_bound_param_data *param; in PHP_METHOD() local
2120 ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) { in PHP_METHOD()
2129param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name)… in PHP_METHOD()
2130 param->name ? ZSTR_VAL(param->name) : "", in PHP_METHOD()
2131 param->is_param, in PHP_METHOD()
2132 param->param_type); in PHP_METHOD()