这篇教程C++ zend_string_init函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zend_string_init函数的典型用法代码示例。如果您正苦于以下问题:C++ zend_string_init函数的具体用法?C++ zend_string_init怎么用?C++ zend_string_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zend_string_init函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: zend_register_bool_constantZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number){ zend_constant c; ZVAL_BOOL(&c.value, bval); c.flags = flags; c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT); c.module_number = module_number; zend_register_constant(&c);}
开发者ID:dzuelke,项目名称:php-src,代码行数:10,
示例2: _pdo_pgsql_escape_credentialsstatic zend_string* _pdo_pgsql_escape_credentials(char *str){ if (str) { zend_string *tmp = zend_string_init(str, strlen(str), 0); return php_addcslashes(tmp, 1, "//'", sizeof("//'")); } return NULL;}
开发者ID:AxiosCros,项目名称:php-src,代码行数:10,
示例3: php_startup_auto_globalsvoid php_startup_auto_globals(void){ zend_register_auto_global(zend_string_init("_GET", sizeof("_GET")-1, 1), 0, php_auto_globals_create_get); zend_register_auto_global(zend_string_init("_POST", sizeof("_POST")-1, 1), 0, php_auto_globals_create_post); zend_register_auto_global(zend_string_init("_COOKIE", sizeof("_COOKIE")-1, 1), 0, php_auto_globals_create_cookie); zend_register_auto_global(zend_string_init("_SERVER", sizeof("_SERVER")-1, 1), PG(auto_globals_jit), php_auto_globals_create_server); zend_register_auto_global(zend_string_init("_ENV", sizeof("_ENV")-1, 1), PG(auto_globals_jit), php_auto_globals_create_env); zend_register_auto_global(zend_string_init("_REQUEST", sizeof("_REQUEST")-1, 1), PG(auto_globals_jit), php_auto_globals_create_request); zend_register_auto_global(zend_string_init("_FILES", sizeof("_FILES")-1, 1), 0, php_auto_globals_create_files);}
开发者ID:Crell,项目名称:php-src,代码行数:10,
示例4: zend_string_init/* This function is meant to unify the headers passed to to mail() * This means, use PCRE to transform single occurrences of /n or /r in /r/n * As a second step we also eleminate all /r/n occurrences which are: * 1) At the start of the header * 2) At the end of the header * 3) Two or more occurrences in the header are removed so only one is left * * Returns NULL on error, or the new char* buffer on success. * You have to take care and efree() the buffer on your own. */static zend_string *php_win32_mail_trim_header(char *header){ zend_string *result, *result2; zend_string *replace; zend_string *regex; if (!header) { return NULL; } replace = zend_string_init(PHP_WIN32_MAIL_UNIFY_REPLACE, strlen(PHP_WIN32_MAIL_UNIFY_REPLACE), 0); regex = zend_string_init(PHP_WIN32_MAIL_UNIFY_PATTERN, sizeof(PHP_WIN32_MAIL_UNIFY_PATTERN)-1, 0); result = php_pcre_replace(regex, NULL, header, strlen(header), replace, -1, NULL); zend_string_release_ex(replace, 0); zend_string_release_ex(regex, 0); if (NULL == result) { return NULL; } replace = zend_string_init(PHP_WIN32_MAIL_RMVDBL_PATTERN, strlen(PHP_WIN32_MAIL_RMVDBL_PATTERN), 0); regex = zend_string_init(PHP_WIN32_MAIL_RMVDBL_PATTERN, sizeof(PHP_WIN32_MAIL_RMVDBL_PATTERN)-1, 0); result2 = php_pcre_replace(regex, result, ZSTR_VAL(result), ZSTR_LEN(result), replace, -1, NULL); zend_string_release_ex(replace, 0); zend_string_release_ex(regex, 0); zend_string_release_ex(result, 0); return result2;}
开发者ID:auroraeosrose,项目名称:php-src,代码行数:50,
示例5: zend_register_constantZEND_API int zend_register_constant(zend_constant *c){ zend_string *lowercase_name = NULL; zend_string *name; int ret = SUCCESS;#if 0 printf("Registering constant for module %d/n", c->module_number);#endif if (c->module_number != PHP_USER_CONSTANT) { c->name = zend_new_interned_string(c->name); } if (!(c->flags & CONST_CS)) { lowercase_name = zend_string_alloc(ZSTR_LEN(c->name), c->flags & CONST_PERSISTENT); zend_str_tolower_copy(ZSTR_VAL(lowercase_name), ZSTR_VAL(c->name), ZSTR_LEN(c->name)); lowercase_name = zend_new_interned_string(lowercase_name); name = lowercase_name; } else { char *slash = strrchr(ZSTR_VAL(c->name), '//'); if (slash) { lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), c->flags & CONST_PERSISTENT); zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name)); lowercase_name = zend_new_interned_string(lowercase_name); name = lowercase_name; } else { name = c->name; } } /* Check if the user is trying to define the internal pseudo constant name __COMPILER_HALT_OFFSET__ */ if ((ZSTR_LEN(c->name) == sizeof("__COMPILER_HALT_OFFSET__")-1 && !memcmp(ZSTR_VAL(name), "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) || zend_hash_add_constant(EG(zend_constants), name, c) == NULL) { /* The internal __COMPILER_HALT_OFFSET__ is prefixed by NULL byte */ if (ZSTR_VAL(c->name)[0] == '/0' && ZSTR_LEN(c->name) > sizeof("/0__COMPILER_HALT_OFFSET__")-1 && memcmp(ZSTR_VAL(name), "/0__COMPILER_HALT_OFFSET__", sizeof("/0__COMPILER_HALT_OFFSET__")) == 0) { } zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name)); zend_string_release(c->name); if (!(c->flags & CONST_PERSISTENT)) { zval_dtor(&c->value); } ret = FAILURE; } if (lowercase_name) { zend_string_release(lowercase_name); } return ret;}
开发者ID:dzuelke,项目名称:php-src,代码行数:52,
示例6: pdo_dblib_stmt_describestatic int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno){ pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; struct pdo_column_data *col; char *fname; if(colno >= stmt->column_count || colno < 0) { return FAILURE; } if (colno == 0) { S->computed_column_name_count = 0; } col = &stmt->columns[colno]; fname = (char*)dbcolname(H->link, colno+1); if (fname && *fname) { col->name = zend_string_init(fname, strlen(fname), 0); } else { if (S->computed_column_name_count > 0) { char buf[16]; int len; len = snprintf(buf, sizeof(buf), "computed%d", S->computed_column_name_count); col->name = zend_string_init(buf, len, 0); } else { col->name = zend_string_init("computed", strlen("computed"), 0); } S->computed_column_name_count++; } col->maxlen = dbcollen(H->link, colno+1); col->param_type = PDO_PARAM_ZVAL; return 1;}
开发者ID:SammyK,项目名称:php-src,代码行数:39,
示例7: phpdbg_switch_framevoid phpdbg_switch_frame(int frame) /* {{{ */{ zend_execute_data *execute_data = PHPDBG_FRAME(num)?PHPDBG_FRAME(execute_data):EG(current_execute_data); int i = 0; if (PHPDBG_FRAME(num) == frame) { phpdbg_notice("frame", "id=/"%d/"", "Already in frame #%d", frame); return; } phpdbg_try_access { while (execute_data) { if (i++ == frame) { break; } do { execute_data = execute_data->prev_execute_data; } while (execute_data && execute_data->opline == NULL); } } phpdbg_catch_access { phpdbg_error("signalsegv", "", "Couldn't switch frames, invalid data source"); return; } phpdbg_end_try_access(); if (execute_data == NULL) { phpdbg_error("frame", "type=/"maxnum/" id=/"%d/"", "No frame #%d", frame); return; } phpdbg_restore_frame(); if (frame > 0) { PHPDBG_FRAME(num) = frame; /* backup things and jump back */ PHPDBG_FRAME(execute_data) = EG(current_execute_data); EG(current_execute_data) = execute_data; EG(scope) = PHPDBG_EX(func)->op_array.scope; } phpdbg_notice("frame", "id=/"%d/"", "Switched to frame #%d", frame); { const char *file_chr = zend_get_executed_filename(); zend_string *file = zend_string_init(file_chr, strlen(file_chr), 0); phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); efree(file); }} /* }}} */
开发者ID:Furgas,项目名称:php-src,代码行数:51,
示例8: zend_string_initPHP_MAILPARSE_API char *php_mimepart_attribute_get(struct php_mimeheader_with_attributes *attr, char *attrname){ zval *attrval; zend_string *hash_key; hash_key = zend_string_init(attrname, strlen(attrname), 0); attrval = zend_hash_find(Z_ARRVAL_P(&attr->attributes), hash_key); zend_string_release(hash_key); if (attrval != NULL) { return Z_STRVAL_P(attrval); } return NULL;}
开发者ID:php,项目名称:pecl-mail-mailparse,代码行数:14,
示例9: pecallocstruct psi_const *psi_const_init(struct psi_impl_type *type, zend_string *name, struct psi_impl_def_val *val){ struct psi_const *c = pecalloc(1, sizeof(*c), 1); if (name->val[0] == '//') { c->name = zend_string_init(&name->val[1], name->len-1, 1); } else { c->name = zend_string_copy(name); } c->type = type; c->val = val; return c;}
开发者ID:m6w6,项目名称:ext-psi,代码行数:14,
示例10: zend_inline_hash_funcstatic zend_string *zend_string_init_interned_permanent(const char *str, size_t size, int permanent){ zend_string *ret; zend_ulong h = zend_inline_hash_func(str, size); ret = zend_interned_string_ht_lookup_ex(h, str, size, &interned_strings_permanent); if (ret) { return ret; } ret = zend_string_init(str, size, permanent); ZSTR_H(ret) = h; return zend_add_interned_string(ret, &interned_strings_permanent, IS_STR_PERMANENT);}
开发者ID:eaglewu,项目名称:php-src,代码行数:14,
示例11: phpdbg_create_recursive_ht_watchstatic int phpdbg_create_recursive_ht_watch(phpdbg_watchpoint_t *watch) { zval *zv; zend_string *key; zend_long h; size_t str_len; ZEND_ASSERT(watch->type == WATCH_ON_HASHTABLE); ZEND_HASH_FOREACH_KEY_VAL(HT_WATCH_HT(watch), h, key, zv) { char *str = NULL; phpdbg_watchpoint_t *new_watch = emalloc(sizeof(phpdbg_watchpoint_t)); new_watch->flags = PHPDBG_WATCH_RECURSIVE; new_watch->parent = watch; new_watch->parent_container = HT_WATCH_HT(watch); if (key) { new_watch->name_in_parent = key; ++GC_REFCOUNT(key); } else { str_len = spprintf(&str, 0, "%lld", h); new_watch->name_in_parent = zend_string_init(str, str_len, 0); efree(str); } str_len = spprintf(&str, 0, "%.*s%s%s%s", (int) ZSTR_LEN(watch->str) - 2, ZSTR_VAL(watch->str), (watch->flags & PHPDBG_WATCH_ARRAY) ? "[" : "->", phpdbg_get_property_key(ZSTR_VAL(new_watch->name_in_parent)), (watch->flags & PHPDBG_WATCH_ARRAY) ? "]" : ""); new_watch->str = zend_string_init(str, str_len, 0); efree(str); while (Z_TYPE_P(zv) == IS_INDIRECT) { zv = Z_INDIRECT_P(zv); } phpdbg_create_zval_watchpoint(zv, new_watch); new_watch = phpdbg_create_watchpoint(new_watch); phpdbg_create_recursive_zval_watch(new_watch); } ZEND_HASH_FOREACH_END();
开发者ID:Furgas,项目名称:php-src,代码行数:37,
示例12: ZEND_MNZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object) /* {{{ */{ zend_closure *closure = (zend_closure *)object; zend_function *invoke = (zend_function*)emalloc(sizeof(zend_function)); invoke->common = closure->func.common; /* TODO: return ZEND_INTERNAL_FUNCTION, but arg_info representation is suitable for ZEND_USER_FUNCTION ??? */ invoke->type = ZEND_INTERNAL_FUNCTION; invoke->internal_function.fn_flags = ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure->func.common.fn_flags & ZEND_ACC_RETURN_REFERENCE); invoke->internal_function.handler = ZEND_MN(Closure___invoke); invoke->internal_function.module = 0; invoke->internal_function.scope = zend_ce_closure; invoke->internal_function.function_name = zend_string_init(ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1, 0); return invoke;}
开发者ID:ahamid,项目名称:php-src,代码行数:15,
示例13: php_register_variable_safe/* binary-safe version */PHPAPI void php_register_variable_safe(char *var, char *strval, size_t str_len, zval *track_vars_array){ zval new_entry; assert(strval != NULL); /* Prepare value */ if (str_len == 0) { ZVAL_EMPTY_STRING(&new_entry); } else if (str_len == 1) { ZVAL_INTERNED_STR(&new_entry, ZSTR_CHAR((zend_uchar)*strval)); } else { ZVAL_NEW_STR(&new_entry, zend_string_init(strval, str_len, 0)); } php_register_variable_ex(var, &new_entry, track_vars_array);}
开发者ID:IMSoP,项目名称:php-src,代码行数:16,
示例14: PHP_METHOD// extern TF_Buffer TF_GetBuffer(TF_Buffer* buffer);static PHP_METHOD(TensorFlow_Buffer, __toString){ zend_string* result; // this t_tf_buffer_object* intern; t_tf_buffer* node; TF_Buffer* tf_buffer; intern = TF_BUFFER_P_ZV(getThis()); node = intern->ptr; tf_buffer = node->src; RETURN_STR(zend_string_init(tf_buffer->data, tf_buffer->length, 0));}
开发者ID:cenzige,项目名称:php-tensorflow,代码行数:17,
示例15: createObject// Create a PHP object given a typename and call the ctor, optionally passing up to 2 argumentsstaticvoid createObject(const char* obj_typename, zval* return_value, int nargs = 0, zval* arg1 = nullptr, zval* arg2 = nullptr) { /* is there a better way to do that on the stack ? */ zend_string *obj_name = zend_string_init(obj_typename, strlen(obj_typename), 0); zend_class_entry* ce = zend_fetch_class(obj_name, ZEND_FETCH_CLASS_DEFAULT); zend_string_release(obj_name); if (! ce) { php_error_docref(nullptr, E_ERROR, "Class %s does not exist", obj_typename); RETURN_NULL(); } object_and_properties_init(return_value, ce, nullptr); zend_function* constructor = zend_std_get_constructor(Z_OBJ_P(return_value)); zval ctor_rv; zend_call_method(return_value, ce, &constructor, NULL, 0, &ctor_rv, nargs, arg1, arg2); zval_dtor(&ctor_rv);}
开发者ID:apupier,项目名称:fn,代码行数:19,
示例16: strlenUzend_string *sapuc_to_zend_string(SAP_UC *str){ RFC_ERROR_INFO error_info; unsigned utf8size, result_length; char *utf8; zend_string *out; utf8size = strlenU(str) * 2 + 1; utf8 = calloc(1, utf8size); result_length = 0; RfcSAPUCToUTF8(str, strlenU(str), (RFC_BYTE *)utf8, &utf8size, &result_length, &error_info); out = zend_string_init(utf8, result_length, 0); free(utf8); return out;}
开发者ID:ThaDafinser,项目名称:php7-sapnwrfc,代码行数:18,
示例17: pdo_dblib_stmt_describestatic int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno){ pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; struct pdo_column_data *col; zend_string *str; if(colno >= stmt->column_count || colno < 0) { return FAILURE; } col = &stmt->columns[colno]; str = dbcolname(H->link, colno+1); col->name = zend_string_init(str, strlen(str), 0); col->maxlen = dbcollen(H->link, colno+1); col->param_type = PDO_PARAM_STR; return 1;}
开发者ID:0xhacking,项目名称:php-src,代码行数:19,
示例18: php_ssh2_set_method/* {{{ php_ssh2_set_method * Try to set a method if it's passed in with the hash table */static int php_ssh2_set_method(LIBSSH2_SESSION *session, HashTable *ht, char *method, int method_len, int method_type){ zval *value; zend_string *method_zstring; method_zstring = zend_string_init(method, method_len, 0); if ((value = zend_hash_find(ht, method_zstring)) == NULL) { zend_string_release(method_zstring); return 0; } zend_string_release(method_zstring); if ((Z_TYPE_P(value) != IS_STRING)) { return -1; } return libssh2_session_method_pref(session, method_type, Z_STRVAL_P(value));}
开发者ID:Sean-Der,项目名称:pecl-networking-ssh2,代码行数:22,
示例19: ZEND_INI_MHstatic ZEND_INI_MH(OnUpdateMaxAcceleratedFiles){ zend_long *p; zend_long size;#ifndef ZTS char *base = (char *) mh_arg2;#else char *base = (char *) ts_resource(*((int *) mh_arg2));#endif /* keep the compiler happy */ (void)entry; (void)mh_arg2; (void)mh_arg3; (void)stage; p = (zend_long *) (base + (size_t)mh_arg1); size = atoi(new_value->val); /* sanity check we must use a value between MIN_ACCEL_FILES and MAX_ACCEL_FILES */ if (size < MIN_ACCEL_FILES || size > MAX_ACCEL_FILES) { const char *new_new_value; zend_ini_entry *ini_entry; if (size < MIN_ACCEL_FILES) { size = MIN_ACCEL_FILES; new_new_value = TOKENTOSTR(MIN_ACCEL_FILES); zend_accel_error(ACCEL_LOG_WARNING, "opcache.max_accelerated_files is set below the required minimum (%d)./n", MIN_ACCEL_FILES); zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use the minimal configuration./n"); } if (size > MAX_ACCEL_FILES) { size = MAX_ACCEL_FILES; new_new_value = TOKENTOSTR(MAX_ACCEL_FILES); zend_accel_error(ACCEL_LOG_WARNING, "opcache.max_accelerated_files is set above the limit (%d)./n", MAX_ACCEL_FILES); zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use the maximal configuration./n"); } if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives), "opcache.max_accelerated_files", sizeof("opcache.max_accelerated_files")-1)) == NULL) { return FAILURE; } ini_entry->value = zend_string_init(new_new_value, strlen(new_new_value), 1); } *p = size; return SUCCESS;}
开发者ID:0x1111,项目名称:php-src,代码行数:43,
示例20: s_lock_sessionstaticzend_bool s_lock_session(memcached_st *memc, zend_string *sid){ memcached_return rc; char *lock_key; size_t lock_key_len; time_t expiration; zend_long wait_time, retries; php_memcached_user_data *user_data = memcached_get_user_data(memc); lock_key_len = spprintf(&lock_key, 0, "lock.%s", sid->val); expiration = s_lock_expiration(); wait_time = MEMC_SESS_INI(lock_wait_min); retries = MEMC_SESS_INI(lock_retries); do { rc = memcached_add(memc, lock_key, lock_key_len, "1", sizeof ("1") - 1, expiration, 0); switch (rc) { case MEMCACHED_SUCCESS: user_data->lock_key = zend_string_init(lock_key, lock_key_len, user_data->is_persistent); user_data->is_locked = 1; break; case MEMCACHED_NOTSTORED: case MEMCACHED_DATA_EXISTS: if (retries > 0) { usleep(wait_time * 1000); wait_time = MIN(MEMC_SESS_INI(lock_wait_max), wait_time * 2); } break; default: php_error_docref(NULL, E_WARNING, "Failed to write session lock: %s", memcached_strerror (memc, rc)); break; } } while (!user_data->is_locked && retries-- > 0); efree(lock_key); return user_data->is_locked;}
开发者ID:TysonAndre,项目名称:php-memcached,代码行数:43,
示例21: alter_inistatic int alter_ini( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ){#if PHP_MAJOR_VERSION >= 7 zend_string * psKey;#endif int type = ZEND_INI_PERDIR; int stage = PHP_INI_STAGE_RUNTIME; if ( '/001' == *pKey ) { ++pKey; if ( *pKey == 4 ) { type = ZEND_INI_SYSTEM; } else { stage = PHP_INI_STAGE_HTACCESS; } ++pKey; --keyLen; if (( keyLen == 7 )&&( strncasecmp( pKey, "engine", 6 )== 0 )) { if ( *pValue == '0' ) engine = 0; } else {#if PHP_MAJOR_VERSION >= 7 --keyLen; psKey = zend_string_init(pKey, keyLen, 1); zend_alter_ini_entry_chars(psKey, (char *)pValue, valLen, type, stage); zend_string_release(psKey);#else zend_alter_ini_entry((char *)pKey, keyLen, (char *)pValue, valLen, type, stage);#endif } } return 1;}
开发者ID:RyanNerd,项目名称:php-src,代码行数:42,
示例22: php_zlib_output_encoding/* {{{ php_zlib_output_encoding() */static int php_zlib_output_encoding(TSRMLS_D){ zval *enc; if (!ZLIBG(compression_coding)) { zend_string *name = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0); zend_is_auto_global(name TSRMLS_CC); zend_string_release(name); if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && (enc = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING") - 1))) { convert_to_string(enc); if (strstr(Z_STRVAL_P(enc), "gzip")) { ZLIBG(compression_coding) = PHP_ZLIB_ENCODING_GZIP; } else if (strstr(Z_STRVAL_P(enc), "deflate")) { ZLIBG(compression_coding) = PHP_ZLIB_ENCODING_DEFLATE; } } } return ZLIBG(compression_coding);}
开发者ID:KomaBeyond,项目名称:php-src,代码行数:21,
示例23: ZEND_MNZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object) /* {{{ */{ zend_closure *closure = (zend_closure *)object; zend_function *invoke = (zend_function*)emalloc(sizeof(zend_function)); const uint32_t keep_flags = ZEND_ACC_RETURN_REFERENCE | ZEND_ACC_VARIADIC | ZEND_ACC_HAS_RETURN_TYPE; invoke->common = closure->func.common; /* We return ZEND_INTERNAL_FUNCTION, but arg_info representation is the * same as for ZEND_USER_FUNCTION (uses zend_string* instead of char*). * This is not a problem, because ZEND_ACC_HAS_TYPE_HINTS is never set, * and we won't check arguments on internal function */ invoke->type = ZEND_INTERNAL_FUNCTION; invoke->internal_function.fn_flags = ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure->func.common.fn_flags & keep_flags); invoke->internal_function.handler = ZEND_MN(Closure___invoke); invoke->internal_function.module = 0; invoke->internal_function.scope = zend_ce_closure; invoke->internal_function.function_name = zend_string_init(ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1, 0); return invoke;}
开发者ID:sonivaibhv,项目名称:php-src,代码行数:21,
示例24: zephir_get_class/** * Returns a class name into a zval result */void zephir_get_class(zval *result, zval *object, int lower){ zend_class_entry *ce; zend_string *class_name; if (Z_TYPE_P(object) == IS_OBJECT) { ce = Z_OBJCE_P(object); //zval_ptr_dtor(result); class_name = zend_string_init(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), 0); ZVAL_STR(result, class_name); if (lower) { zend_str_tolower(Z_STRVAL_P(result), Z_STRLEN_P(result)); } } else { ZVAL_NULL(result); php_error_docref(NULL, E_WARNING, "zephir_get_class expects an object"); }}
开发者ID:phalcon,项目名称:zephir,代码行数:24,
示例25: skyray_http_request_resolve_cookies_if_neededvoid skyray_http_request_resolve_cookies_if_needed(skyray_http_request_t *self){ if (!ZVAL_IS_NULL(&self->cookie_params)) { return; } zval *lines = skyray_http_message_get_header(&self->message, intern_str_cookie, 0); if (!lines) { return; } array_init(&self->cookie_params); zend_array *ht = Z_ARR_P(lines); zend_array *ht2; zval tmp, *data;; zend_hash_internal_pointer_reset(ht); while(zend_hash_has_more_elements(ht) == SUCCESS) { array_init(&tmp); data = zend_hash_get_current_data(ht); php_explode(intern_str_param_delimiter, Z_STR_P(data), &tmp, ZEND_LONG_MAX); ht2 = Z_ARR_P(&tmp); zend_hash_internal_pointer_reset(ht2); while (zend_hash_has_more_elements(ht2) == SUCCESS) { data = zend_hash_get_current_data(ht2); char *c = strchr(Z_STR_P(data)->val, '='); int len = c - Z_STR_P(data)->val; add_assoc_str_ex(&self->cookie_params, Z_STR_P(data)->val, len, zend_string_init(c + 1, Z_STR_P(data)->len - len - 1, 0)); zend_hash_move_forward(ht2); } zval_ptr_dtor(&tmp); zend_hash_move_forward(ht); }}
开发者ID:Lucups,项目名称:Skyray,代码行数:40,
示例26: ZEND_INI_MHstatic ZEND_INI_MH(OnUpdateMemoryConsumption){ zend_long *p; zend_long memsize;#ifndef ZTS char *base = (char *) mh_arg2;#else char *base = (char *) ts_resource(*((int *) mh_arg2));#endif /* keep the compiler happy */ (void)entry; (void)mh_arg2; (void)mh_arg3; (void)stage; p = (zend_long *) (base + (size_t)mh_arg1); memsize = atoi(ZSTR_VAL(new_value)); /* sanity check we must use at least 8 MB */ if (memsize < 8) { const char *new_new_value = "8"; zend_ini_entry *ini_entry; memsize = 8; zend_accel_error(ACCEL_LOG_WARNING, "opcache.memory_consumption is set below the required 8MB./n"); zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use the minimal 8MB configuration./n"); if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives), "opcache.memory_consumption", sizeof("opcache.memory_consumption")-1)) == NULL) { return FAILURE; } ini_entry->value = zend_string_init(new_new_value, 1, 1); } if (UNEXPECTED(memsize > ZEND_ULONG_MAX / (1024 * 1024))) { *p = ZEND_ULONG_MAX; } else { *p = memsize * (1024 * 1024); } return SUCCESS;}
开发者ID:ttoohey,项目名称:php-src,代码行数:39,
示例27: skyray_http_request_resolve_queries_if_neededvoid skyray_http_request_resolve_queries_if_needed(skyray_http_request_t *self){ if (!ZVAL_IS_NULL(&self->query_params) || ZVAL_IS_NULL(&self->uri)) { return; } array_init(&self->query_params); php_url *url = php_url_parse_ex(Z_STR(self->uri)->val, Z_STR(self->uri)->len); if (!url->query) { php_url_free(url); return; } zend_string *query = zend_string_init(url->query, strlen(url->query), 0); char *res = estrdup(url->query); sapi_module.treat_data(PARSE_STRING, res, &self->query_params); zend_string_free(query); php_url_free(url);}
开发者ID:Lucups,项目名称:Skyray,代码行数:22,
示例28: fpm_php_zend_ini_alter_masterstatic int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int mode, int stage TSRMLS_DC) /* {{{ */{ zend_ini_entry *ini_entry; zend_string *duplicate; if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length))) { return FAILURE; } duplicate = zend_string_init(new_value, new_value_length, 1); if (!ini_entry->on_modify || ini_entry->on_modify(ini_entry, duplicate, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) { ini_entry->value = duplicate; ini_entry->modifiable = mode; } else { zend_string_release(duplicate); } return SUCCESS;}
开发者ID:0x1111,项目名称:php-src,代码行数:22,
注:本文中的zend_string_init函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zend_string_release函数代码示例 C++ zend_string_free函数代码示例 |