本文整理汇总了C++中PHALCON_CALL_METHOD_NORETURN函数的典型用法代码示例。如果您正苦于以下问题:C++ PHALCON_CALL_METHOD_NORETURN函数的具体用法?C++ PHALCON_CALL_METHOD_NORETURN怎么用?C++ PHALCON_CALL_METHOD_NORETURN使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHALCON_CALL_METHOD_NORETURN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Returns a complete resultset as an array, if the resultset has a big number of rows
* it could consume more memory than currently it does.
*
* @return array
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray){
zval *records, *valid = NULL, *current = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(records);
array_init(records);
PHALCON_CALL_METHOD_NORETURN(this_ptr, "rewind");
while (1) {
PHALCON_INIT_NVAR(r0);
PHALCON_CALL_METHOD(r0, this_ptr, "valid");
PHALCON_CPY_WRT(valid, r0);
if (PHALCON_IS_NOT_FALSE(valid)) {
} else {
break;
}
PHALCON_INIT_NVAR(current);
PHALCON_CALL_METHOD(current, this_ptr, "current");
phalcon_array_append(&records, current, PH_SEPARATE TSRMLS_CC);
PHALCON_CALL_METHOD_NORETURN(this_ptr, "next");
}
RETURN_CTOR(records);
}
示例2: PHP_METHOD
/**
* Serializing a resultset will dump all related rows into a big array
*
* @return string
*/
PHP_METHOD(Phalcon_Model_Resultset, serialize){
zval *records = NULL;
zval *a0 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(a0);
array_init(a0);
PHALCON_CPY_WRT(records, a0);
PHALCON_CALL_METHOD_NORETURN(this_ptr, "rewind", PHALCON_NO_CHECK);
ws_fd08_1:
PHALCON_INIT_VAR(r0);
PHALCON_CALL_METHOD(r0, this_ptr, "valid", PHALCON_NO_CHECK);
if (Z_TYPE_P(r0) != IS_BOOL || (Z_TYPE_P(r0) == IS_BOOL && !Z_BVAL_P(r0))) {
goto we_fd08_1;
}
PHALCON_INIT_VAR(r1);
PHALCON_CALL_METHOD(r1, this_ptr, "current", PHALCON_NO_CHECK);
phalcon_array_append(&records, r1, PHALCON_SEPARATE_PLZ TSRMLS_CC);
PHALCON_CALL_METHOD_NORETURN(this_ptr, "next", PHALCON_NO_CHECK);
goto ws_fd08_1;
we_fd08_1:
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_CALL_FUNC_PARAMS_1(r2, "serialize", records, 0x057);
PHALCON_RETURN_DZVAL(r2);
}
示例3: PHP_METHOD
/**
* Appends an array of messages to the group
*
*<code>
* $messages->appendMessages($messagesArray);
*</code>
*
* @param Phalcon\Validation\MessageInterface[] $messages
*/
PHP_METHOD(Phalcon_Validation_Message_Group, appendMessages){
zval *messages, *current_messages, *final_messages = NULL;
zval *message = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &messages) == FAILURE) {
RETURN_MM_NULL();
}
if (Z_TYPE_P(messages) != IS_ARRAY) {
if (Z_TYPE_P(messages) != IS_OBJECT) {
PHALCON_THROW_EXCEPTION_STR(phalcon_validation_exception_ce, "The messages must be array or object");
return;
}
}
PHALCON_OBS_VAR(current_messages);
phalcon_read_property(¤t_messages, this_ptr, SL("_messages"), PH_NOISY_CC);
if (Z_TYPE_P(messages) == IS_ARRAY) {
/**
* An array of messages is simply merged into the current one
*/
if (Z_TYPE_P(current_messages) == IS_ARRAY) {
PHALCON_INIT_VAR(final_messages);
PHALCON_CALL_FUNC_PARAMS_2(final_messages, "array_merge", current_messages, messages);
} else {
PHALCON_CPY_WRT(final_messages, messages);
}
phalcon_update_property_zval(this_ptr, SL("_messages"), final_messages TSRMLS_CC);
} else {
/**
* A group of messages is iterated and appended one-by-one to the current list
*/
PHALCON_CALL_METHOD_NORETURN(messages, "rewind");
while (1) {
PHALCON_INIT_NVAR(r0);
PHALCON_CALL_METHOD(r0, messages, "valid");
if (PHALCON_IS_NOT_FALSE(r0)) {
} else {
break;
}
PHALCON_INIT_NVAR(message);
PHALCON_CALL_METHOD(message, messages, "current");
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(this_ptr, "appendmessage", message);
PHALCON_CALL_METHOD_NORETURN(messages, "next");
}
}
PHALCON_MM_RESTORE();
}
示例4: PHP_METHOD
/**
* Returns the messages generated in the validation
*
* @param boolean $byItemName
* @return array
*/
PHP_METHOD(Phalcon_Forms_Form, getMessages){
zval *by_item_name = NULL, *messages, *group = NULL, *element_messages = NULL;
zval *element = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &by_item_name) == FAILURE) {
RETURN_MM_NULL();
}
if (!by_item_name) {
PHALCON_INIT_VAR(by_item_name);
ZVAL_BOOL(by_item_name, 0);
}
PHALCON_OBS_VAR(messages);
phalcon_read_property(&messages, this_ptr, SL("_messages"), PH_NOISY_CC);
if (zend_is_true(by_item_name)) {
if (Z_TYPE_P(messages) != IS_ARRAY) {
PHALCON_INIT_VAR(group);
object_init_ex(group, phalcon_validation_message_group_ce);
PHALCON_CALL_METHOD_NORETURN(group, "__construct");
RETURN_CTOR(group);
}
RETURN_CCTOR(messages);
}
PHALCON_INIT_NVAR(group);
object_init_ex(group, phalcon_validation_message_group_ce);
PHALCON_CALL_METHOD_NORETURN(group, "__construct");
if (!phalcon_is_iterable(messages, &ah0, &hp0, 0, 0 TSRMLS_CC)) {
return;
}
while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
PHALCON_GET_FOREACH_KEY(element, ah0, hp0);
PHALCON_GET_FOREACH_VALUE(element_messages);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(group, "appendmessages", element_messages);
zend_hash_move_forward_ex(ah0, &hp0);
}
RETURN_CTOR(group);
}
示例5: PHP_METHOD
/**
* Checks whether a model has a hasOne relation with another model
*
* @param string $modelName
* @param string $modelRelation
* @return boolean
*/
PHP_METHOD(Phalcon_Mvc_Model_Manager, existsHasOne){
zval *model_name = NULL, *model_relation = NULL, *initialized = NULL;
zval *model = NULL, *has_one = NULL;
zval *r0 = NULL;
int eval_int;
zend_class_entry *ce0, *ce1;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &model_name, &model_relation) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(initialized);
phalcon_read_property(&initialized, this_ptr, SL("_initialized"), PH_NOISY_CC);
eval_int = phalcon_array_isset(initialized, model_name);
if (!eval_int) {
ce0 = phalcon_fetch_class(model_name TSRMLS_CC);
PHALCON_INIT_VAR(model);
object_init_ex(model, ce0);
PHALCON_CALL_METHOD_NORETURN(model, "__construct", PH_CHECK);
}
eval_int = phalcon_array_isset(initialized, model_relation);
if (!eval_int) {
ce1 = phalcon_fetch_class(model_relation TSRMLS_CC);
PHALCON_INIT_VAR(model);
object_init_ex(model, ce1);
PHALCON_CALL_METHOD_NORETURN(model, "__construct", PH_CHECK);
}
PHALCON_INIT_VAR(has_one);
phalcon_read_property(&has_one, this_ptr, SL("_hasOne"), PH_NOISY_CC);
eval_int = phalcon_array_isset(has_one, model_name);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_array_fetch(&r0, has_one, model_name, PH_NOISY_CC);
eval_int = phalcon_array_isset(r0, model_relation);
if (eval_int) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
示例6: PHP_METHOD
/**
* Isset property
*
* @param string $property
* @return boolean
*/
PHP_METHOD(Phalcon_Session_Bag, __isset){
zval *property, *initalized, *data;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &property) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(initalized);
phalcon_read_property(&initalized, this_ptr, SL("_initalized"), PH_NOISY_CC);
if (PHALCON_IS_FALSE(initalized)) {
PHALCON_CALL_METHOD_NORETURN(this_ptr, "initialize", PH_NO_CHECK);
}
PHALCON_INIT_VAR(data);
phalcon_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC);
eval_int = phalcon_array_isset(data, property);
if (eval_int) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
示例7: PHP_METHOD
/**
* Restores the state of a Phalcon\Annotations\Reflection variable export
*
* @return array $data
*/
PHP_METHOD(Phalcon_Annotations_Reflection, __set_state){
zval *data, *reflection_data, *reflection = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
RETURN_MM_NULL();
}
if (Z_TYPE_P(data) == IS_ARRAY) {
/**
* Check for a '_reflectionData' in the array to build the Reflection
*/
if (phalcon_array_isset_string(data, SS("_reflectionData"))) {
PHALCON_OBS_VAR(reflection_data);
phalcon_array_fetch_string(&reflection_data, data, SL("_reflectionData"), PH_NOISY_CC);
PHALCON_INIT_VAR(reflection);
object_init_ex(reflection, phalcon_annotations_reflection_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(reflection, "__construct", reflection_data);
RETURN_CTOR(reflection);
}
}
PHALCON_INIT_NVAR(reflection);
object_init_ex(reflection, phalcon_annotations_reflection_ce);
PHALCON_CALL_METHOD_NORETURN(reflection, "__construct");
RETURN_CTOR(reflection);
}
示例8: PHP_METHOD
/**
* Sets a value in the session bag
*
*<code>
* $user->set('name', 'Kimbra');
*</code>
*
* @param string $property
* @param string $value
*/
PHP_METHOD(Phalcon_Session_Bag, set){
zval *property, *value, *initalized, *name, *data;
zval *session;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &property, &value) == FAILURE) {
RETURN_MM_NULL();
}
PHALCON_OBS_VAR(initalized);
phalcon_read_property(&initalized, this_ptr, SL("_initalized"), PH_NOISY_CC);
if (PHALCON_IS_FALSE(initalized)) {
PHALCON_CALL_METHOD_NORETURN(this_ptr, "initialize");
}
phalcon_update_property_array(this_ptr, SL("_data"), property, value TSRMLS_CC);
PHALCON_OBS_VAR(name);
phalcon_read_property(&name, this_ptr, SL("_name"), PH_NOISY_CC);
PHALCON_OBS_VAR(data);
phalcon_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC);
PHALCON_OBS_VAR(session);
phalcon_read_property(&session, this_ptr, SL("_session"), PH_NOISY_CC);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(session, "set", name, data);
PHALCON_MM_RESTORE();
}
示例9: PHP_METHOD
/**
* Gets the views part manager
*
* @return Phalcon_View
*/
PHP_METHOD(Phalcon_Controller_Front, getViewComponent){
zval *t0 = NULL, *t1 = NULL, *t2 = NULL, *t3 = NULL;
zval *i0 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, "_view", sizeof("_view")-1, PHALCON_NOISY TSRMLS_CC);
if (!zend_is_true(t0)) {
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, phalcon_view_ce);
PHALCON_CALL_METHOD_NORETURN(i0, "__construct", PHALCON_CHECK);
phalcon_update_property_zval(this_ptr, "_view", strlen("_view"), i0 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(t1);
phalcon_read_property(&t1, this_ptr, "_view", sizeof("_view")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(t2);
phalcon_read_property(&t2, this_ptr, "_viewsDir", sizeof("_viewsDir")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(t1, "setviewsdir", t2, PHALCON_NO_CHECK);
}
PHALCON_ALLOC_ZVAL_MM(t3);
phalcon_read_property(&t3, this_ptr, "_view", sizeof("_view")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_RETURN_CHECK_CTOR(t3);
}
示例10: PHP_METHOD
/**
* Loads a model throwing an exception if it doesn't exist
*
* @return Phalcon\Mvc\Model
*/
PHP_METHOD(Phalcon_Mvc_Model_Manager, load){
zval *model_name, *model, *exception_message;
zend_class_entry *ce0;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &model_name) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (phalcon_class_exists(model_name TSRMLS_CC)) {
ce0 = phalcon_fetch_class(model_name TSRMLS_CC);
PHALCON_INIT_VAR(model);
object_init_ex(model, ce0);
PHALCON_CALL_METHOD_NORETURN(model, "__construct", PH_CHECK);
RETURN_CTOR(model);
}
PHALCON_INIT_VAR(exception_message);
PHALCON_CONCAT_SVS(exception_message, "The model '", model_name, "' could not be loaded");
PHALCON_THROW_EXCEPTION_ZVAL(phalcon_mvc_model_exception_ce, exception_message);
return;
}
示例11: PHP_METHOD
/**
* Starts a cache. The $keyname allows to identify the created fragment
*
* @param int|string $keyName
* @param long $lifetime
* @return mixed
*/
PHP_METHOD(Phalcon_Cache_Backend, start){
zval *key_name, *lifetime = NULL, *existing_cache, *fresh = NULL;
zval *frontend;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &key_name, &lifetime);
if (!lifetime) {
PHALCON_INIT_VAR(lifetime);
}
/**
* Get the cache content verifying if it was expired
*/
PHALCON_INIT_VAR(existing_cache);
PHALCON_CALL_METHOD_PARAMS_2(existing_cache, this_ptr, "get", key_name, lifetime);
if (Z_TYPE_P(existing_cache) == IS_NULL) {
PHALCON_INIT_VAR(fresh);
ZVAL_BOOL(fresh, 1);
PHALCON_OBS_VAR(frontend);
phalcon_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC);
PHALCON_CALL_METHOD_NORETURN(frontend, "start");
} else {
PHALCON_INIT_NVAR(fresh);
ZVAL_BOOL(fresh, 0);
}
phalcon_update_property_this(this_ptr, SL("_fresh"), fresh TSRMLS_CC);
phalcon_update_property_bool(this_ptr, SL("_started"), 1 TSRMLS_CC);
RETURN_CCTOR(existing_cache);
}
示例12: PHP_METHOD
/**
* Restore a Phalcon\Http\Response\Headers object
*
* @return Phalcon\Http\Response\Headers
*/
PHP_METHOD(Phalcon_Http_Response_Headers, __set_state){
zval *data, *headers, *data_headers, *value = NULL, *key = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
char *hash_index;
uint hash_index_len;
ulong hash_num;
int hash_type;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(headers);
object_init_ex(headers, phalcon_http_response_headers_ce);
PHALCON_CALL_METHOD_NORETURN(headers, "__construct", PH_CHECK);
eval_int = phalcon_array_isset_string(data, SS("_headers"));
if (eval_int) {
PHALCON_INIT_VAR(data_headers);
phalcon_array_fetch_string(&data_headers, data, SL("_headers"), PH_NOISY_CC);
if (!phalcon_valid_foreach(data_headers TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(data_headers);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
ph_cycle_start_0:
if (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS) {
goto ph_cycle_end_0;
}
PHALCON_GET_FOREACH_KEY(key, ah0, hp0);
PHALCON_GET_FOREACH_VALUE(value);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(headers, "set", key, value, PH_NO_CHECK);
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
if(0){}
}
RETURN_CTOR(headers);
}
示例13: PHP_METHOD
/**
* Returns the annotations found in a specific property
*
* @param string $className
* @param string $propertyName
* @return Phalcon\Annotations\Collection
*/
PHP_METHOD(Phalcon_Annotations_Adapter, getProperty){
zval *class_name, *property_name, *class_annotations;
zval *properties, *property = NULL, *name = NULL, *collection;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 2, 0, &class_name, &property_name);
/**
* Get the full annotations from the class
*/
PHALCON_INIT_VAR(class_annotations);
PHALCON_CALL_METHOD_PARAMS_1(class_annotations, this_ptr, "get", class_name);
/**
* A valid annotations reflection is an object
*/
if (Z_TYPE_P(class_annotations) == IS_OBJECT) {
PHALCON_INIT_VAR(properties);
PHALCON_CALL_METHOD(properties, class_annotations, "getpropertyannotations");
if (Z_TYPE_P(properties) == IS_ARRAY) {
if (!phalcon_is_iterable(properties, &ah0, &hp0, 0, 0 TSRMLS_CC)) {
return;
}
while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
PHALCON_GET_FOREACH_KEY(name, ah0, hp0);
PHALCON_GET_FOREACH_VALUE(property);
if (PHALCON_IS_EQUAL(name, property_name)) {
RETURN_CCTOR(property);
}
zend_hash_move_forward_ex(ah0, &hp0);
}
}
}
/**
* Returns a collection anyways
*/
PHALCON_INIT_VAR(collection);
object_init_ex(collection, phalcon_annotations_collection_ce);
PHALCON_CALL_METHOD_NORETURN(collection, "__construct");
RETURN_CTOR(collection);
}
示例14: PHP_METHOD
/**
* Serializing a resultset will dump all related rows into a big array
*
* @return string
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize){
zval *type = NULL, *result = NULL, *records = NULL, *row_count = NULL, *model = NULL;
zval *cache = NULL, *data = NULL, *serialized = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(type);
phalcon_read_property(&type, this_ptr, SL("_type"), PH_NOISY_CC);
if (zend_is_true(type)) {
PHALCON_INIT_VAR(result);
phalcon_read_property(&result, this_ptr, SL("_result"), PH_NOISY_CC);
if (PHALCON_IS_NOT_FALSE(result)) {
PHALCON_CALL_METHOD_NORETURN(result, "execute", PH_NO_CHECK);
PHALCON_INIT_VAR(records);
PHALCON_CALL_METHOD(records, result, "fetchall", PH_NO_CHECK);
} else {
PHALCON_INIT_VAR(records);
array_init(records);
}
} else {
PHALCON_INIT_VAR(records);
phalcon_read_property(&records, this_ptr, SL("_rows"), PH_NOISY_CC);
if (Z_TYPE_P(records) == IS_NULL) {
PHALCON_INIT_VAR(result);
phalcon_read_property(&result, this_ptr, SL("_result"), PH_NOISY_CC);
if (PHALCON_IS_NOT_FALSE(result)) {
PHALCON_INIT_VAR(records);
PHALCON_CALL_METHOD(records, result, "fetchall", PH_NO_CHECK);
PHALCON_INIT_VAR(row_count);
phalcon_fast_count(row_count, records TSRMLS_CC);
phalcon_update_property_zval(this_ptr, SL("_rows"), row_count TSRMLS_CC);
}
}
}
PHALCON_INIT_VAR(model);
phalcon_read_property(&model, this_ptr, SL("_model"), PH_NOISY_CC);
PHALCON_INIT_VAR(cache);
phalcon_read_property(&cache, this_ptr, SL("_cache"), PH_NOISY_CC);
PHALCON_INIT_VAR(data);
array_init(data);
phalcon_array_update_string(&data, SL("model"), &model, PH_COPY | PH_SEPARATE TSRMLS_CC);
phalcon_array_update_string(&data, SL("cache"), &cache, PH_COPY | PH_SEPARATE TSRMLS_CC);
phalcon_array_update_string(&data, SL("rows"), &records, PH_COPY | PH_SEPARATE TSRMLS_CC);
PHALCON_INIT_VAR(serialized);
PHALCON_CALL_FUNC_PARAMS_1(serialized, "serialize", data);
RETURN_CCTOR(serialized);
}
示例15: PHP_METHOD
/**
* Resets all the stablished headers
*
* @return Phalcon\Http\ResponseInterface
*/
PHP_METHOD(Phalcon_Http_Response, resetHeaders){
zval *headers;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(headers);
PHALCON_CALL_METHOD(headers, this_ptr, "getheaders");
PHALCON_CALL_METHOD_NORETURN(headers, "reset");
RETURN_THIS();
}