这篇教程C++ zephir_fast_count_int函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zephir_fast_count_int函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_fast_count_int函数的具体用法?C++ zephir_fast_count_int怎么用?C++ zephir_fast_count_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zephir_fast_count_int函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PHP_METHODPHP_METHOD(Test_Vars, testCountOptimizerVarDumpAndExport) { zval *testVar, testVar_sub, _0, _1; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&testVar_sub); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &testVar); ZEPHIR_INIT_VAR(&_0); ZEPHIR_INIT_NVAR(&_0); ZVAL_LONG(&_0, zephir_fast_count_int(testVar TSRMLS_CC)); zephir_var_dump(&_0 TSRMLS_CC); ZEPHIR_INIT_VAR(&_1); ZEPHIR_INIT_NVAR(&_1); ZVAL_LONG(&_1, zephir_fast_count_int(testVar TSRMLS_CC)); zephir_var_export(&_1 TSRMLS_CC); ZEPHIR_MM_RESTORE();}
开发者ID:Mrhjx2,项目名称:zephir,代码行数:30,
示例2: PHP_METHOD/** * Phalcon/Mvc/Model/ValidationFailed constructor * * @param Model model * @param Message[] validationMessages */PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, __construct) { int ZEPHIR_LAST_CALL_STATUS; zval *validationMessages = NULL; zval *model, *validationMessages_param = NULL, *messageStr = NULL, *message = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &validationMessages_param); validationMessages = validationMessages_param; if (zephir_fast_count_int(validationMessages TSRMLS_CC) > 0) { ZEPHIR_OBS_VAR(message); zephir_array_fetch_long(&message, validationMessages, 0, PH_NOISY, "phalcon/mvc/model/validationfailed.zep", 51 TSRMLS_CC); ZEPHIR_CALL_METHOD(&messageStr, message, "getmessage", NULL, 0); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(messageStr); ZVAL_STRING(messageStr, "Validation failed", 1); } zephir_update_property_this(this_ptr, SL("_model"), model TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_messages"), validationMessages TSRMLS_CC); ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_validationfailed_ce, this_ptr, "__construct", NULL, 0, messageStr); zephir_check_call_status(); ZEPHIR_MM_RESTORE();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:34,
示例3: PHP_METHOD/** * Fetch a YAML payload from the Beanstalkd server */PHP_METHOD(Phalcon_Queue_Beanstalk, readYaml) { zval *response = NULL, *status = NULL, *numberOfBytes = NULL, *data = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 382); zephir_check_call_status(); ZEPHIR_OBS_VAR(status); zephir_array_fetch_long(&status, response, 0, PH_NOISY, "phalcon/queue/beanstalk.zep", 329 TSRMLS_CC); if (zephir_fast_count_int(response TSRMLS_CC) > 1) { ZEPHIR_OBS_VAR(numberOfBytes); zephir_array_fetch_long(&numberOfBytes, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 332 TSRMLS_CC); ZEPHIR_CALL_METHOD(&response, this_ptr, "read", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(&data, "yaml_parse", NULL, 385, response); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(numberOfBytes); ZVAL_LONG(numberOfBytes, 0); ZEPHIR_INIT_NVAR(data); array_init(data); } zephir_create_array(return_value, 3, 0 TSRMLS_CC); zephir_array_fast_append(return_value, status); zephir_array_fast_append(return_value, numberOfBytes); zephir_array_fast_append(return_value, data); RETURN_MM();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:34,
示例4: PHP_METHOD/** * Mounts a group of routes in the router * * @param Test/Router/Group route * @return Test/Router */PHP_METHOD(Test_Router, mount) { HashTable *_1, *_4; HashPosition _0, _3; int ZEPHIR_LAST_CALL_STATUS; zval *group, *groupRoutes = NULL, *beforeMatch = NULL, *hostname = NULL, *routes, *route = NULL, **_2, **_5, *_6; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &group); if (Z_TYPE_P(group) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The group of routes is not valid"); return; } ZEPHIR_CALL_METHOD(&groupRoutes, group, "getroutes", NULL); zephir_check_call_status(); if (!(zephir_fast_count_int(groupRoutes TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The group of routes does not contain any routes"); return; } ZEPHIR_CALL_METHOD(&beforeMatch, group, "getbeforematch", NULL); zephir_check_call_status(); if (Z_TYPE_P(beforeMatch) != IS_NULL) { zephir_is_iterable(groupRoutes, &_1, &_0, 0, 0); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HVALUE(route, _2); ZEPHIR_CALL_METHOD(NULL, route, "beforematch", NULL, beforeMatch); zephir_check_call_status(); } } ZEPHIR_CALL_METHOD(&hostname, group, "gethostname", NULL); zephir_check_call_status(); if (Z_TYPE_P(hostname) != IS_NULL) { zephir_is_iterable(groupRoutes, &_4, &_3, 0, 0); for ( ; zephir_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS ; zephir_hash_move_forward_ex(_4, &_3) ) { ZEPHIR_GET_HVALUE(route, _5); ZEPHIR_CALL_METHOD(NULL, route, "sethostname", NULL, hostname); zephir_check_call_status(); } } ZEPHIR_OBS_VAR(routes); zephir_read_property_this(&routes, this_ptr, SL("_routes"), PH_NOISY_CC); if (Z_TYPE_P(routes) == IS_ARRAY) { ZEPHIR_INIT_VAR(_6); zephir_fast_array_merge(_6, &(routes), &(groupRoutes) TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_routes"), _6 TSRMLS_CC); } else { zephir_update_property_this(this_ptr, SL("_routes"), groupRoutes TSRMLS_CC); } RETURN_THIS();}
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:66,
示例5: PHP_METHOD/** * Length filter. If an array/object is passed a count is performed otherwise a strlen/mb_strlen */PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) { zend_bool _0; int ZEPHIR_LAST_CALL_STATUS; zval *item; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &item); _0 = Z_TYPE_P(item) == IS_OBJECT; if (!(_0)) { _0 = Z_TYPE_P(item) == IS_ARRAY; } if (_0) { RETURN_MM_LONG(zephir_fast_count_int(item TSRMLS_CC)); } if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) { ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 380, item); zephir_check_call_status(); RETURN_MM(); } RETURN_MM_LONG(zephir_fast_strlen_ev(item));}
开发者ID:ntesic,项目名称:cphalcon,代码行数:29,
示例6: PHP_METHOD/** * Sets the path for a domain * * @return string */PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory) { int ZEPHIR_LAST_CALL_STATUS; HashTable *_1; HashPosition _0; zval *directory, *key = NULL, *value = NULL, **_2, *_3 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &directory); zephir_update_property_this(this_ptr, SL("_directory"), directory TSRMLS_CC); if (Z_TYPE_P(directory) == IS_ARRAY) { if (zephir_fast_count_int(directory TSRMLS_CC)) { zephir_is_iterable(directory, &_1, &_0, 0, 0, "phalcon/translate/adapter/gettext.zep", 188); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HMKEY(key, _1, _0); ZEPHIR_GET_HVALUE(value, _2); ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", NULL, key, value); zephir_check_call_status(); } } } else { ZEPHIR_CALL_METHOD(&_3, this_ptr, "getdefaultdomain", NULL); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", NULL, _3, directory); zephir_check_call_status(); } ZEPHIR_MM_RESTORE();}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:40,
示例7: PHP_METHOD/** * Length filter. If an array/object is passed a count is performed otherwise a strlen/mb_strlen */PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) { int ZEPHIR_LAST_CALL_STATUS; zend_bool _0; zval *item, *length = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &item); ZEPHIR_INIT_VAR(length); ZVAL_LONG(length, 0); _0 = Z_TYPE_P(item) == IS_OBJECT; if (!(_0)) { _0 = Z_TYPE_P(item) == IS_ARRAY; } if (_0) { ZEPHIR_INIT_NVAR(length); ZVAL_LONG(length, zephir_fast_count_int(item TSRMLS_CC)); } else { if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 366, item); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(length); ZVAL_LONG(length, zephir_fast_strlen_ev(item)); } } RETURN_CCTOR(length);}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:35,
示例8: PHP_METHOD/** * 检查数组是否包含 Associative 键? * * @param array arr * @param bool reusingKeys * @return bool */PHP_METHOD(DotPHP_Utils_ArrayUtil, isAssoc) { int ZEPHIR_LAST_CALL_STATUS; zend_bool reusingKeys; zval *arr_param = NULL, *reusingKeys_param = NULL, *r = NULL, _0, _1, *_2, *_3; zval *arr = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &arr_param, &reusingKeys_param); zephir_get_arrval(arr, arr_param); if (!reusingKeys_param) { reusingKeys = 0; } else { reusingKeys = zephir_get_boolval(reusingKeys_param); } ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, 0); ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, (zephir_fast_count_int(arr TSRMLS_CC) - 1)); ZEPHIR_CALL_FUNCTION(&r, "range", NULL, 24, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(_2); if (reusingKeys) { ZVAL_BOOL(_2, !ZEPHIR_IS_IDENTICAL(arr, r)); } else { ZEPHIR_INIT_VAR(_3); zephir_array_keys(_3, arr TSRMLS_CC); ZVAL_BOOL(_2, !ZEPHIR_IS_IDENTICAL(_3, r)); } RETURN_CCTOR(_2);}
开发者ID:designinlife,项目名称:dotphp,代码行数:42,
示例9: PHP_METHOD/** * Removes transactions from the TransactionManager */PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, _collectTransaction) { HashTable *_1$$3; HashPosition _0$$3; zval *transaction, *transactions = NULL, *newTransactions = NULL, *managedTransaction = NULL, **_2$$3; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &transaction); ZEPHIR_OBS_VAR(transactions); zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); if (zephir_fast_count_int(transactions TSRMLS_CC)) { ZEPHIR_INIT_VAR(newTransactions); array_init(newTransactions); zephir_is_iterable(transactions, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/transaction/manager.zep", 295); for ( ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS ; zend_hash_move_forward_ex(_1$$3, &_0$$3) ) { ZEPHIR_GET_HVALUE(managedTransaction, _2$$3); if (!ZEPHIR_IS_EQUAL(managedTransaction, transaction)) { zephir_array_append(&newTransactions, transaction, PH_SEPARATE, "phalcon/mvc/model/transaction/manager.zep", 289); } else { RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_number") TSRMLS_CC)); } } zephir_update_property_this(getThis(), SL("_transactions"), newTransactions TSRMLS_CC); } ZEPHIR_MM_RESTORE();}
开发者ID:zamronypj,项目名称:cphalcon,代码行数:36,
示例10: 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();}
开发者ID:noikiy,项目名称:owl,代码行数:30,
示例11: PHP_METHOD/** * {@inheritDoc} */PHP_METHOD(Owl_Std_Collection_ArrayCollection, count) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("elements"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:ansborisov,项目名称:owl,代码行数:12,
示例12: PHP_METHOD/** * Checks whether there are messages attached to the element */PHP_METHOD(Phalcon_Forms_Element, hasMessages) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC); RETURN_BOOL(zephir_fast_count_int(_0 TSRMLS_CC) > 0);}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:12,
示例13: PHP_METHOD/** * Defined by Countable interface * * @return int */PHP_METHOD(Yaf_Session, count) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("session"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:swordkee,项目名称:yaftoz,代码行数:14,
示例14: PHP_METHOD/** * Returns the number of annotations in the collection */PHP_METHOD(Phalcon_Annotations_Collection, count) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotations"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:12,
示例15: PHP_METHOD/** * Checks how many elements are in the register */PHP_METHOD(Phalcon_Registry, count) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:12,
示例16: PHP_METHOD/** * Returns the number of messages in the list */PHP_METHOD(Phalcon_Validation_Message_Group, count) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:12,
示例17: PHP_METHOD/** * Checks if the internal meta-data container is empty * *<code> * var_dump( * $metaData->isEmpty() * ); *</code> */PHP_METHOD(Phalcon_Mvc_Model_MetaData, isEmpty) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); RETURN_BOOL(zephir_fast_count_int(_0 TSRMLS_CC) == 0);}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:18,
示例18: PHP_METHODPHP_METHOD(Feathers_Router_MethodsCollection, count) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_methods"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:odiel,项目名称:feathers,代码行数:9,
示例19: PHP_METHODPHP_METHOD(Yb_Db_Entity, isDirty) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("updates"), PH_NOISY_CC); RETURN_BOOL(zephir_fast_count_int(_0 TSRMLS_CC) > 0);}
开发者ID:VergilTang,项目名称:yb,代码行数:9,
示例20: PHP_METHOD/** * Returns the total number of SQL statements processed */PHP_METHOD(Phalcon_Db_Profiler, getNumberTotalStatements) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_allProfiles"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:racztiborzoltan,项目名称:cphalcon,代码行数:12,
示例21: PHP_METHOD/** * Returns the number of elements in the form */PHP_METHOD(Phalcon_Forms_Form, count) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:racztiborzoltan,项目名称:cphalcon,代码行数:12,
示例22: PHP_METHOD/** * Returns the number of arguments that the annotation has */PHP_METHOD(Phalcon_Annotations_Annotation, numberArguments) { zval *_0; _0 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:12,
示例23: PHP_METHOD/** * Mounts a group of routes in the router */PHP_METHOD(Phalcon_Mvc_Router, mount) { HashTable *_1$$4, *_4$$6; HashPosition _0$$4, _3$$6; int ZEPHIR_LAST_CALL_STATUS; zval *group, *groupRoutes = NULL, *beforeMatch = NULL, *hostname = NULL, *routes = NULL, *route = NULL, **_2$$4, **_5$$6, *_6$$8; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &group); ZEPHIR_CALL_METHOD(&groupRoutes, group, "getroutes", NULL, 0); zephir_check_call_status(); if (!(zephir_fast_count_int(groupRoutes TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The group of routes does not contain any routes", "phalcon/mvc/router.zep", 754); return; } ZEPHIR_CALL_METHOD(&beforeMatch, group, "getbeforematch", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(beforeMatch) != IS_NULL) { zephir_is_iterable(groupRoutes, &_1$$4, &_0$$4, 0, 0, "phalcon/mvc/router.zep", 766); for ( ; zephir_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS ; zephir_hash_move_forward_ex(_1$$4, &_0$$4) ) { ZEPHIR_GET_HVALUE(route, _2$$4); ZEPHIR_CALL_METHOD(NULL, route, "beforematch", NULL, 0, beforeMatch); zephir_check_call_status(); } } ZEPHIR_CALL_METHOD(&hostname, group, "gethostname", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(hostname) != IS_NULL) { zephir_is_iterable(groupRoutes, &_4$$6, &_3$$6, 0, 0, "phalcon/mvc/router.zep", 775); for ( ; zephir_hash_get_current_data_ex(_4$$6, (void**) &_5$$6, &_3$$6) == SUCCESS ; zephir_hash_move_forward_ex(_4$$6, &_3$$6) ) { ZEPHIR_GET_HVALUE(route, _5$$6); ZEPHIR_CALL_METHOD(NULL, route, "sethostname", NULL, 0, hostname); zephir_check_call_status(); } } ZEPHIR_OBS_VAR(routes); zephir_read_property_this(&routes, this_ptr, SL("_routes"), PH_NOISY_CC); if (Z_TYPE_P(routes) == IS_ARRAY) { ZEPHIR_INIT_VAR(_6$$8); zephir_fast_array_merge(_6$$8, &(routes), &(groupRoutes) TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_routes"), _6$$8 TSRMLS_CC); } else { zephir_update_property_this(this_ptr, SL("_routes"), groupRoutes TSRMLS_CC); } RETURN_THIS();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:59,
示例24: 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);}
开发者ID:SDpower,项目名称:cphalcon,代码行数:56,
示例25: PHP_METHOD/** * Returns the count of properties set in the config * *<code> * print count($config); *</code> * * or * *<code> * print $config->count(); *</code> */PHP_METHOD(Phalcon_Config, count) { int ZEPHIR_LAST_CALL_STATUS; zval *_0 = NULL; ZEPHIR_MM_GROW(); ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 23, this_ptr); zephir_check_call_status(); RETURN_MM_LONG(zephir_fast_count_int(_0 TSRMLS_CC));}
开发者ID:spuy767,项目名称:cphalcon,代码行数:25,
示例26: PHP_METHOD/** * Checks if the internal meta-data container is empty * *<code> * var_dump( * $metaData->isEmpty() * ); *</code> */PHP_METHOD(Phalcon_Mvc_Model_MetaData, isEmpty) { zval _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); RETURN_BOOL(zephir_fast_count_int(&_0 TSRMLS_CC) == 0);}
开发者ID:dschissler,项目名称:cphalcon,代码行数:21,
示例27: PHP_METHOD/** * Return length of bag * *<code> * echo $user->count(); *</code> */PHP_METHOD(Phalcon_Session_Bag, count) { zval *_0, *_1; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } _1 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); RETURN_MM_LONG(zephir_fast_count_int(_1 TSRMLS_CC));}
开发者ID:ntesic,项目名称:cphalcon,代码行数:23,
注:本文中的zephir_fast_count_int函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zephir_fast_trim函数代码示例 C++ zephir_fast_array_merge函数代码示例 |