本文整理汇总了C++中zephir_get_arrval函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_get_arrval函数的具体用法?C++ zephir_get_arrval怎么用?C++ zephir_get_arrval使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zephir_get_arrval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* @inheritdoc
*/
PHP_METHOD(Owl_Log_AbstractWriter, commit) {
int ZEPHIR_LAST_CALL_STATUS;
zval *records_param = NULL, *_0, *_1, *_2 = NULL, *_3, *_4;
zval *records = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &records_param);
zephir_get_arrval(records, records_param);
ZEPHIR_INIT_VAR(_0);
_1 = zephir_fetch_nproperty_this(this_ptr, SL("records"), PH_NOISY_CC);
ZEPHIR_CALL_METHOD(&_2, this_ptr, "filterrecords", NULL, 0, records);
zephir_check_call_status();
zephir_fast_array_merge(_0, &(_1), &(_2) TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("records"), _0 TSRMLS_CC);
_3 = zephir_fetch_nproperty_this(this_ptr, SL("records"), PH_NOISY_CC);
_4 = zephir_fetch_nproperty_this(this_ptr, SL("recordsInterval"), PH_NOISY_CC);
if (ZEPHIR_LE_LONG(_4, zephir_fast_count_int(_3 TSRMLS_CC))) {
ZEPHIR_CALL_METHOD(NULL, this_ptr, "push", NULL, 0);
zephir_check_call_status();
}
ZEPHIR_MM_RESTORE();
}
示例2: PHP_METHOD
PHP_METHOD(OAuth2_ResponseType_AuthorizationCode, __construct) {
zval *config = NULL, *_1;
zval *storage, *config_param = NULL, *_0;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &storage, &config_param);
if (!config_param) {
ZEPHIR_INIT_VAR(config);
array_init(config);
} else {
zephir_get_arrval(config, config_param);
}
if (!(zephir_instance_of_ev(storage, oauth2_storage_authorizationcodeinterface_ce TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Parameter 'storage' must be an instance of 'OAuth2\\Storage\\AuthorizationCodeInterface'", "", 0);
return;
}
zephir_update_property_this(this_ptr, SL("storage"), storage TSRMLS_CC);
ZEPHIR_INIT_VAR(_0);
ZEPHIR_INIT_VAR(_1);
array_init_size(_1, 3);
zephir_array_update_string(&_1, SL("enforce_redirect"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE);
add_assoc_long_ex(_1, SS("auth_code_lifetime"), 30);
zephir_fast_array_merge(_0, &(_1), &(config) TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("config"), _0 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例3: PHP_METHOD
/**
* Phalcon\Queue\Beanstalk
*/
PHP_METHOD(Phalcon_Queue_Beanstalk, __construct) {
zval *parameters_param = NULL, *_0$$3, *_1$$4;
zval *parameters = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, ¶meters_param);
if (!parameters_param) {
ZEPHIR_INIT_VAR(parameters);
array_init(parameters);
} else {
zephir_get_arrval(parameters, parameters_param);
}
if (!(zephir_array_isset_string(parameters, SS("host")))) {
ZEPHIR_INIT_VAR(_0$$3);
ZVAL_STRING(_0$$3, "127.0.0.1", 1);
zephir_array_update_string(¶meters, SL("host"), &_0$$3, PH_COPY | PH_SEPARATE);
}
if (!(zephir_array_isset_string(parameters, SS("port")))) {
ZEPHIR_INIT_VAR(_1$$4);
ZVAL_LONG(_1$$4, 11300);
zephir_array_update_string(¶meters, SL("port"), &_1$$4, PH_COPY | PH_SEPARATE);
}
if (!(zephir_array_isset_string(parameters, SS("persistent")))) {
zephir_array_update_string(¶meters, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE);
}
zephir_update_property_this(this_ptr, SL("_parameters"), parameters TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例4: PHP_METHOD
/**
* Phalcon\Paginator\Adapter\QueryBuilder
*/
PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, __construct) {
int ZEPHIR_LAST_CALL_STATUS;
zval *config_param = NULL, *builder, *limit, *page;
zval *config = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &config_param);
zephir_get_arrval(config, config_param);
zephir_update_property_this(this_ptr, SL("_config"), config TSRMLS_CC);
ZEPHIR_OBS_VAR(builder);
if (!(zephir_array_isset_string_fetch(&builder, config, SS("builder"), 0 TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Parameter 'builder' is required", "phalcon/paginator/adapter/querybuilder.zep", 67);
return;
}
ZEPHIR_OBS_VAR(limit);
if (!(zephir_array_isset_string_fetch(&limit, config, SS("limit"), 0 TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Parameter 'limit' is required", "phalcon/paginator/adapter/querybuilder.zep", 71);
return;
}
ZEPHIR_CALL_METHOD(NULL, this_ptr, "setquerybuilder", NULL, builder);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, this_ptr, "setlimit", NULL, limit);
zephir_check_call_status();
ZEPHIR_OBS_VAR(page);
if (zephir_array_isset_string_fetch(&page, config, SS("page"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcurrentpage", NULL, page);
zephir_check_call_status();
}
ZEPHIR_MM_RESTORE();
}
示例5: PHP_METHOD
/**
* Renders the element widget returning html
*/
PHP_METHOD(Phalcon_Forms_Element_Numeric, render) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_0 = NULL;
zval *attributes_param = NULL, _1;
zval attributes;
zval *this_ptr = getThis();
ZVAL_UNDEF(&attributes);
ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &attributes_param);
if (!attributes_param) {
ZEPHIR_INIT_VAR(&attributes);
array_init(&attributes);
} else {
zephir_get_arrval(&attributes, attributes_param);
}
ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, &attributes);
zephir_check_call_status();
ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "numericfield", &_0, 0, &_1);
zephir_check_call_status();
RETURN_MM();
}
示例6: PHP_METHOD
/**
* Writes the log to the stream itself
*/
PHP_METHOD(Phalcon_Logger_Adapter_Stream, logInternal) {
zval *context = NULL;
int type, time, ZEPHIR_LAST_CALL_STATUS;
zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, *stream = NULL, *_0 = NULL, *_1 = NULL, *_2, *_3;
zval *message = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param);
zephir_get_strval(message, message_param);
type = zephir_get_intval(type_param);
time = zephir_get_intval(time_param);
zephir_get_arrval(context, context_param);
ZEPHIR_OBS_VAR(stream);
zephir_read_property_this(&stream, this_ptr, SL("_stream"), PH_NOISY_CC);
if (Z_TYPE_P(stream) != IS_RESOURCE) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Cannot send message to the log because it is invalid", "phalcon/logger/adapter/stream.zep", 100);
return;
}
ZEPHIR_CALL_METHOD(&_0, this_ptr, "getformatter", NULL, 0);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_2);
ZVAL_LONG(_2, type);
ZEPHIR_INIT_VAR(_3);
ZVAL_LONG(_3, time);
ZEPHIR_CALL_METHOD(&_1, _0, "format", NULL, 0, message, _2, _3, context);
zephir_check_call_status();
zephir_fwrite(NULL, stream, _1 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例7: PHP_METHOD
/**
* Render view
*/
PHP_METHOD(Owl_Mvc_View, render) {
int ZEPHIR_LAST_CALL_STATUS;
zval *parameters = NULL;
zval *path_param = NULL, *parameters_param = NULL, *_0, *_1, *_2, *_3, *_4, *tmp = NULL;
zval *path = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &path_param, ¶meters_param);
if (unlikely(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(path_param) == IS_STRING)) {
zephir_get_strval(path, path_param);
} else {
ZEPHIR_INIT_VAR(path);
ZVAL_EMPTY_STRING(path);
}
if (!parameters_param) {
ZEPHIR_INIT_VAR(parameters);
array_init(parameters);
} else {
zephir_get_arrval(parameters, parameters_param);
}
_0 = zephir_fetch_nproperty_this(this_ptr, SL("path"), PH_NOISY_CC);
ZEPHIR_INIT_VAR(_1);
ZEPHIR_CONCAT_VV(_1, _0, path);
if (!((zephir_file_exists(_1 TSRMLS_CC) == SUCCESS))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(owl_exception_ce, "File is not exists", "owl/Mvc/View.zep", 21);
return;
}
ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 23);
zephir_check_call_status();
if (!(Z_TYPE_P(parameters) == IS_NULL)) {
ZEPHIR_INIT_VAR(_2);
ZVAL_LONG(_2, 0);
Z_SET_ISREF_P(parameters);
ZEPHIR_CALL_FUNCTION(NULL, "extract", NULL, 24, parameters, _2);
Z_UNSET_ISREF_P(parameters);
zephir_check_call_status();
}
_3 = zephir_fetch_nproperty_this(this_ptr, SL("path"), PH_NOISY_CC);
ZEPHIR_INIT_VAR(_4);
ZEPHIR_CONCAT_VV(_4, _3, path);
if (zephir_require_zval(_4 TSRMLS_CC) == FAILURE) {
RETURN_MM_NULL();
}
ZEPHIR_CALL_FUNCTION(&tmp, "ob_get_contents", NULL, 25);
zephir_check_call_status();
ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 26);
zephir_check_call_status();
RETURN_CCTOR(tmp);
}
示例8: PHP_METHOD
/**
* @param array data
* @return \Phal\Link
*/
PHP_METHOD(Phal_Format_Reader_Hal_JsonReader, doTransformLink) {
int ZEPHIR_LAST_CALL_STATUS;
zval *data_param = NULL, *link, *key = NULL;
zval *data = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &data_param);
zephir_get_arrval(data, data_param);
ZEPHIR_INIT_VAR(link);
object_init_ex(link, phal_link_ce);
ZEPHIR_CALL_METHOD(NULL, link, "__construct", NULL);
zephir_check_call_status();
ZEPHIR_OBS_VAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("href"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "sethref", NULL, key);
zephir_check_call_status();
}
ZEPHIR_OBS_NVAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("templated"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "settemplated", NULL, key);
zephir_check_call_status();
}
ZEPHIR_OBS_NVAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("type"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "settype", NULL, key);
zephir_check_call_status();
}
ZEPHIR_OBS_NVAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("deprecation"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "setdeprecation", NULL, key);
zephir_check_call_status();
}
ZEPHIR_OBS_NVAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("name"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "setname", NULL, key);
zephir_check_call_status();
}
ZEPHIR_OBS_NVAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("profile"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "setprofile", NULL, key);
zephir_check_call_status();
}
ZEPHIR_OBS_NVAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("title"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "settitle", NULL, key);
zephir_check_call_status();
}
ZEPHIR_OBS_NVAR(key);
if (zephir_array_isset_string_fetch(&key, data, SS("hreflang"), 0 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, link, "sethreflang", NULL, key);
zephir_check_call_status();
}
RETURN_CCTOR(link);
}
示例9: PHP_METHOD
/**
* Inserts jobs into the queue
*/
PHP_METHOD(Phalcon_Queue_Beanstalk, put) {
zend_bool _2;
zephir_fcall_cache_entry *_1 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *options = NULL;
zval *data, *options_param = NULL, *priority = NULL, *delay = NULL, *ttr = NULL, *serialized = NULL, *response = NULL, *status = NULL, *length = NULL, *_0, *_3;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &data, &options_param);
if (!options_param) {
ZEPHIR_INIT_VAR(options);
array_init(options);
} else {
zephir_get_arrval(options, options_param);
}
ZEPHIR_OBS_VAR(priority);
if (!(zephir_array_isset_string_fetch(&priority, options, SS("priority"), 0 TSRMLS_CC))) {
ZEPHIR_INIT_NVAR(priority);
ZVAL_LONG(priority, 100);
}
ZEPHIR_OBS_VAR(delay);
if (!(zephir_array_isset_string_fetch(&delay, options, SS("delay"), 0 TSRMLS_CC))) {
ZEPHIR_INIT_NVAR(delay);
ZVAL_LONG(delay, 0);
}
ZEPHIR_OBS_VAR(ttr);
if (!(zephir_array_isset_string_fetch(&ttr, options, SS("ttr"), 0 TSRMLS_CC))) {
ZEPHIR_INIT_NVAR(ttr);
ZVAL_LONG(ttr, 86400);
}
ZEPHIR_CALL_FUNCTION(&serialized, "serialize", NULL, 75, data);
zephir_check_call_status();
ZEPHIR_INIT_VAR(length);
ZVAL_LONG(length, zephir_fast_strlen_ev(serialized));
ZEPHIR_INIT_VAR(_0);
ZEPHIR_CONCAT_SVSVSVSV(_0, "put ", priority, " ", delay, " ", ttr, " ", length);
ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", &_1, 0, _0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", &_1, 0, serialized);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 382);
zephir_check_call_status();
zephir_array_fetch_long(&status, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 150 TSRMLS_CC);
_2 = !ZEPHIR_IS_STRING(status, "INSERTED");
if (_2) {
_2 = !ZEPHIR_IS_STRING(status, "BURIED");
}
if (_2) {
RETURN_MM_BOOL(0);
}
zephir_array_fetch_long(&_3, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 156 TSRMLS_CC);
RETURN_CTOR(_3);
}
示例10: PHP_METHOD
/**
* @param int timeout
* @param string statement query statement
* @param array vars [optional]
* @return Statement object
* @throws ConnectionException
*/
PHP_METHOD(ADOdb_Connection, cacheQuery) {
zval *vars = NULL;
zval *statement = NULL;
zval *timeout_param = NULL, *statement_param = NULL, *vars_param = NULL, *_0, *queryId, *st = NULL, *_1, *_2, *_3 = NULL, *_4, *_5, _6, _7;
int timeout;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 1, &timeout_param, &statement_param, &vars_param);
timeout = zephir_get_intval(timeout_param);
zephir_get_strval(statement, statement_param);
if (!vars_param) {
ZEPHIR_INIT_VAR(vars);
array_init(vars);
} else {
zephir_get_arrval(vars, vars_param);
}
_0 = zephir_fetch_nproperty_this(this_ptr, SL("cache"), PH_NOISY_CC);
if ((Z_TYPE_P(_0) != IS_NULL)) {
_1 = zephir_fetch_nproperty_this(this_ptr, SL("cache"), PH_NOISY_CC);
ZEPHIR_INIT_VAR(queryId);
zephir_call_method_p2(queryId, _1, "getqueryid", statement, vars);
_2 = zephir_fetch_nproperty_this(this_ptr, SL("cache"), PH_NOISY_CC);
ZEPHIR_INIT_VAR(_3);
ZVAL_LONG(_3, timeout);
ZEPHIR_INIT_VAR(st);
zephir_call_method_p2(st, _2, "read", queryId, _3);
if (!zephir_is_true(st)) {
ZEPHIR_INIT_NVAR(_3);
ZVAL_STRING(_3, "Cache miss!", 1);
zephir_call_method_p1_noret(this_ptr, "debug", _3);
_4 = zephir_fetch_nproperty_this(this_ptr, SL("connection"), PH_NOISY_CC);
ZEPHIR_INIT_NVAR(st);
zephir_call_method_p2(st, _4, "query", statement, vars);
_5 = zephir_fetch_nproperty_this(this_ptr, SL("cache"), PH_NOISY_CC);
ZEPHIR_INIT_NVAR(_3);
ZVAL_LONG(_3, timeout);
zephir_call_method_p3_noret(_5, "write", queryId, st, _3);
}
RETURN_CCTOR(st);
} else {
ZEPHIR_SINIT_VAR(_6);
ZVAL_STRING(&_6, "No cache engine found!", 0);
ZEPHIR_SINIT_VAR(_7);
ZVAL_LONG(&_7, 512);
zephir_call_func_p2_noret("user_error", &_6, &_7);
zephir_call_method_p2(return_value, this_ptr, "query", statement, vars);
RETURN_MM();
}
ZEPHIR_MM_RESTORE();
}
示例11: PHP_METHOD
PHP_METHOD(Yb_Std, uniqueValues) {
HashTable *_1;
HashPosition _0;
zephir_fcall_cache_entry *_5 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *uniqueKey = NULL;
zval *data_param = NULL, *uniqueKey_param = NULL, *k = NULL, *v = NULL, *arr = NULL, *uniqueValue = NULL, **_2, *_3$$4 = NULL, *_4$$4 = NULL, *_6$$5 = NULL, *_7$$5 = NULL;
zval *data = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &data_param, &uniqueKey_param);
zephir_get_arrval(data, data_param);
zephir_get_strval(uniqueKey, uniqueKey_param);
ZEPHIR_INIT_VAR(arr);
array_init(arr);
zephir_is_iterable(data, &_1, &_0, 0, 0, "yb/std.zep", 377);
for (
; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS
; zephir_hash_move_forward_ex(_1, &_0)
) {
ZEPHIR_GET_HMKEY(k, _1, _0);
ZEPHIR_GET_HVALUE(v, _2);
if (unlikely(Z_TYPE_P(v) != IS_ARRAY)) {
ZEPHIR_INIT_NVAR(_3$$4);
object_init_ex(_3$$4, yb_exception_ce);
ZEPHIR_INIT_LNVAR(_4$$4);
ZEPHIR_CONCAT_SV(_4$$4, "Invalid item type, array required at: ", k);
ZEPHIR_CALL_METHOD(NULL, _3$$4, "__construct", &_5, 2, _4$$4);
zephir_check_call_status();
zephir_throw_exception_debug(_3$$4, "yb/std.zep", 368 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
ZEPHIR_OBS_NVAR(uniqueValue);
if (unlikely(!(zephir_array_isset_fetch(&uniqueValue, v, uniqueKey, 0 TSRMLS_CC)))) {
ZEPHIR_INIT_NVAR(_6$$5);
object_init_ex(_6$$5, yb_exception_ce);
ZEPHIR_INIT_LNVAR(_7$$5);
ZEPHIR_CONCAT_SV(_7$$5, "Cannot find value of unique at: ", k);
ZEPHIR_CALL_METHOD(NULL, _6$$5, "__construct", &_5, 2, _7$$5);
zephir_check_call_status();
zephir_throw_exception_debug(_6$$5, "yb/std.zep", 371 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
return;
}
zephir_array_update_zval(&arr, uniqueValue, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE);
}
zephir_array_keys(return_value, arr TSRMLS_CC);
RETURN_MM();
}
示例12: PHP_METHOD
PHP_METHOD(Yb_View_HttpResponse, run) {
zval *httpResponseContent = NULL, *_6 = NULL;
long httpResponseCode = 0;
int ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_1 = NULL;
zval *data_param = NULL, *options_param = NULL, *_0 = NULL, *_2 = NULL, *_3 = NULL, _4, *_5 = NULL;
zval *data = NULL, *options = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &data_param, &options_param);
zephir_get_arrval(data, data_param);
zephir_get_arrval(options, options_param);
ZEPHIR_INIT_VAR(_2);
ZVAL_STRING(_2, "httpResponseCode", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_INIT_VAR(_3);
ZVAL_LONG(_3, 200);
ZEPHIR_CALL_CE_STATIC(&_0, yb_std_ce, "valueat", &_1, 5, options, _2, _3);
zephir_check_temp_parameter(_2);
zephir_check_call_status();
httpResponseCode = zephir_get_intval(_0);
ZEPHIR_SINIT_VAR(_4);
ZVAL_LONG(&_4, httpResponseCode);
ZEPHIR_CALL_FUNCTION(NULL, "http_response_code", NULL, 96, &_4);
zephir_check_call_status();
ZEPHIR_INIT_NVAR(_2);
ZVAL_STRING(_2, "httpResponseContent", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_INIT_NVAR(_3);
ZVAL_STRING(_3, "", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_CE_STATIC(&_5, yb_std_ce, "valueat", &_1, 5, options, _2, _3);
zephir_check_temp_parameter(_2);
zephir_check_temp_parameter(_3);
zephir_check_call_status();
zephir_get_strval(_6, _5);
ZEPHIR_CPY_WRT(httpResponseContent, _6);
zend_print_zval(httpResponseContent, 0);
ZEPHIR_MM_RESTORE();
}
示例13: PHP_METHOD
/**
* Dumps a PHP array to a YAML string.
*
* The dump method, when supplied with an array, will do its best
* to convert the array into friendly YAML.
*
* @param array array PHP array
* @param int inline The level where you switch to inline YAML
* @param int indent The amount of spaces to use for indentation of nested nodes.
* @param int flags A bit field of DUMP_* constants to customize the dumped YAML string
*
* @return string A YAML string representing the original PHP array
*/
PHP_METHOD(Symphir_Component_Yaml_Yaml, dump) {
zephir_nts_static zend_class_entry *_0 = NULL;
int inlineLevel, indent, flags, ZEPHIR_LAST_CALL_STATUS;
zval *phpArray_param = NULL, *inlineLevel_param = NULL, *indent_param = NULL, *flags_param = NULL, yaml, _1, _2, _3;
zval phpArray;
ZEPHIR_INIT_THIS();
ZVAL_UNDEF(&phpArray);
ZVAL_UNDEF(&yaml);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 3, &phpArray_param, &inlineLevel_param, &indent_param, &flags_param);
zephir_get_arrval(&phpArray, phpArray_param);
if (!inlineLevel_param) {
inlineLevel = 2;
} else {
inlineLevel = zephir_get_intval(inlineLevel_param);
}
if (!indent_param) {
indent = 4;
} else {
indent = zephir_get_intval(indent_param);
}
if (!flags_param) {
flags = 0;
} else {
flags = zephir_get_intval(flags_param);
}
ZEPHIR_INIT_VAR(&yaml);
if (!_0) {
_0 = zephir_fetch_class_str_ex(SL("Symphir\\Component\\Yaml\\Dumper"), ZEND_FETCH_CLASS_AUTO);
}
object_init_ex(&yaml, _0);
if (zephir_has_constructor(&yaml TSRMLS_CC)) {
ZVAL_LONG(&_1, indent);
ZEPHIR_CALL_METHOD(NULL, &yaml, "__construct", NULL, 0, &_1);
zephir_check_call_status();
}
ZVAL_LONG(&_1, inlineLevel);
ZVAL_LONG(&_2, 0);
ZVAL_LONG(&_3, flags);
ZEPHIR_RETURN_CALL_METHOD(&yaml, "dump", NULL, 0, &phpArray, &_1, &_2, &_3);
zephir_check_call_status();
RETURN_MM();
}
示例14: PHP_METHOD
/**
* Adds default messages to validators
*/
PHP_METHOD(Phalcon_Validation, setDefaultMessages) {
zval *messages_param = NULL, *defaultMessages = NULL, *_0$$3;
zval *messages = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &messages_param);
if (!messages_param) {
ZEPHIR_INIT_VAR(messages);
array_init(messages);
} else {
zephir_get_arrval(messages, messages_param);
}
ZEPHIR_INIT_VAR(defaultMessages);
zephir_create_array(defaultMessages, 25, 0 TSRMLS_CC);
add_assoc_stringl_ex(defaultMessages, SS("Alnum"), SL("Field :field must contain only letters and numbers"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Alpha"), SL("Field :field must contain only letters"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Between"), SL("Field :field must be within the range of :min to :max"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Confirmation"), SL("Field :field must be the same as :with"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Digit"), SL("Field :field must be numeric"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Email"), SL("Field :field must be an email address"), 1);
add_assoc_stringl_ex(defaultMessages, SS("ExclusionIn"), SL("Field :field must not be a part of list: :domain"), 1);
add_assoc_stringl_ex(defaultMessages, SS("FileEmpty"), SL("Field :field must not be empty"), 1);
add_assoc_stringl_ex(defaultMessages, SS("FileIniSize"), SL("File :field exceeds the maximum file size"), 1);
add_assoc_stringl_ex(defaultMessages, SS("FileMaxResolution"), SL("File :field must not exceed :max resolution"), 1);
add_assoc_stringl_ex(defaultMessages, SS("FileMinResolution"), SL("File :field must be at least :min resolution"), 1);
add_assoc_stringl_ex(defaultMessages, SS("FileSize"), SL("File :field exceeds the size of :max"), 1);
add_assoc_stringl_ex(defaultMessages, SS("FileType"), SL("File :field must be of type: :types"), 1);
add_assoc_stringl_ex(defaultMessages, SS("FileValid"), SL("Field :field is not valid"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Identical"), SL("Field :field does not have the expected value"), 1);
add_assoc_stringl_ex(defaultMessages, SS("InclusionIn"), SL("Field :field must be a part of list: :domain"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Numericality"), SL("Field :field does not have a valid numeric format"), 1);
add_assoc_stringl_ex(defaultMessages, SS("PresenceOf"), SL("Field :field is required"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Regex"), SL("Field :field does not match the required format"), 1);
add_assoc_stringl_ex(defaultMessages, SS("TooLong"), SL("Field :field must not exceed :max characters long"), 1);
add_assoc_stringl_ex(defaultMessages, SS("TooShort"), SL("Field :field must be at least :min characters long"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Uniqueness"), SL("Field :field must be unique"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Url"), SL("Field :field must be a url"), 1);
add_assoc_stringl_ex(defaultMessages, SS("CreditCard"), SL("Field :field is not valid for a credit card number"), 1);
add_assoc_stringl_ex(defaultMessages, SS("Date"), SL("Field :field is not a valid date"), 1);
if (zephir_fast_count_int(messages TSRMLS_CC)) {
ZEPHIR_INIT_VAR(_0$$3);
zephir_fast_array_merge(_0$$3, &(defaultMessages), &(messages) TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("_defaultMessages"), _0$$3 TSRMLS_CC);
RETURN_MM_MEMBER(this_ptr, "_defaultMessages");
}
zephir_update_property_this(this_ptr, SL("_defaultMessages"), defaultMessages TSRMLS_CC);
RETURN_CCTOR(defaultMessages);
}
示例15: PHP_METHOD
/**
* Return the registered resources
*
* @return array
*/
PHP_METHOD(Phalcon_Mvc_Router_Annotations, getResources) {
zval *_1 = NULL;
zval *_0;
ZEPHIR_MM_GROW();
ZEPHIR_OBS_VAR(_0);
zephir_read_property_this(&_0, this_ptr, SL("_handlers"), PH_NOISY_CC);
zephir_get_arrval(_1, _0);
RETURN_CTOR(_1);
}