本文整理汇总了C++中phalcon_valid_foreach函数的典型用法代码示例。如果您正苦于以下问题:C++ phalcon_valid_foreach函数的具体用法?C++ phalcon_valid_foreach怎么用?C++ phalcon_valid_foreach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phalcon_valid_foreach函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* List all tables on a database
*
*
*
* @param string $schemaName
* @return array
*/
PHP_METHOD(Phalcon_Db_Adapter_Mysql, listTables){
zval *schema_name = NULL, *sql = NULL, *tables = NULL, *all_tables = NULL, *table = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
zval *t0 = NULL;
zval *a0 = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &schema_name) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!schema_name) {
PHALCON_INIT_VAR(schema_name);
ZVAL_NULL(schema_name);
}
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CALL_STATIC_PARAMS_1(r0, "phalcon_db_dialect_mysql", "listtables", schema_name);
PHALCON_CPY_WRT(sql, r0);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_INIT_VAR(t0);
ZVAL_LONG(t0, 2);
PHALCON_CALL_METHOD_PARAMS_2(r1, this_ptr, "fetchall", sql, t0, PHALCON_NO_CHECK);
PHALCON_CPY_WRT(tables, r1);
PHALCON_INIT_VAR(a0);
array_init(a0);
PHALCON_CPY_WRT(all_tables, a0);
if (phalcon_valid_foreach(tables TSRMLS_CC)) {
ah0 = Z_ARRVAL_P(tables);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_321f_1:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_321f_1;
}
PHALCON_INIT_VAR(table);
ZVAL_ZVAL(table, *hd, 1, 0);
PHALCON_INIT_VAR(r2);
phalcon_array_fetch_long(&r2, table, 0, PHALCON_NOISY TSRMLS_CC);
phalcon_array_append(&all_tables, r2, PHALCON_SEPARATE_PLZ TSRMLS_CC);
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_321f_1;
fee_321f_1:
if(0){}
} else {
return;
}
RETURN_CTOR(all_tables);
}
示例2: PHP_METHOD
/**
* Sends the headers to the client
*
* @return boolean
*/
PHP_METHOD(Phalcon_Http_Response_Headers, send){
zval *headers_was_sent, *t, *headers, *value = NULL, *header = NULL;
zval *http_header = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
char *hash_index;
uint hash_index_len;
ulong hash_num;
int hash_type;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(headers_was_sent);
PHALCON_CALL_FUNC(headers_was_sent, "headers_sent");
if (!zend_is_true(headers_was_sent)) {
PHALCON_INIT_VAR(t);
ZVAL_BOOL(t, 1);
PHALCON_INIT_VAR(headers);
phalcon_read_property(&headers, this_ptr, SL("_headers"), PH_NOISY_CC);
if (!phalcon_valid_foreach(headers TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(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(header, ah0, hp0);
PHALCON_GET_FOREACH_VALUE(value);
if (zend_is_true(value)) {
PHALCON_INIT_NVAR(http_header);
PHALCON_CONCAT_VSV(http_header, header, ": ", value);
PHALCON_CALL_FUNC_PARAMS_2_NORETURN("header", http_header, t);
} else {
PHALCON_CALL_FUNC_PARAMS_2_NORETURN("header", header, t);
}
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
示例3: PHP_METHOD
/**
* Uncamelize strings which are camelized
*
*<code>
* echo Phalcon\Text::camelize('CocoBongo'); //coco_bongo
*</code>
*
* @param string $str
* @return string
*/
PHP_METHOD(Phalcon_Text, uncamelize){
zval *str = NULL, *patterns = NULL, *replacement = NULL, *pattern = NULL, *match_pattern = NULL;
zval *pattern_replace = NULL, *lower_pattern = NULL, *lower_str = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
char *hash_index;
uint hash_index_len;
ulong hash_num;
int hash_type;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &str) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(patterns);
array_init(patterns);
add_assoc_stringl_ex(patterns, SL("/(?<=(?:[A-Z]))([A-Z]+)([A-Z][A-z])/")+1, SL("\\1_\\2"), 1);
add_assoc_stringl_ex(patterns, SL("/(?<=(?:[a-z]))([A-Z])/")+1, SL("_\\1"), 1);
if (!phalcon_valid_foreach(patterns TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(patterns);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_f8ee_0:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_f8ee_0;
}
PHALCON_INIT_VAR(pattern);
PHALCON_GET_FOREACH_KEY(pattern, ah0, hp0);
PHALCON_INIT_VAR(replacement);
ZVAL_ZVAL(replacement, *hd, 1, 0);
PHALCON_INIT_VAR(match_pattern);
PHALCON_CALL_FUNC_PARAMS_2(match_pattern, "preg_match", pattern, str);
if (zend_is_true(match_pattern)) {
PHALCON_INIT_VAR(pattern_replace);
PHALCON_CALL_FUNC_PARAMS_3(pattern_replace, "preg_replace", pattern, replacement, str);
PHALCON_INIT_VAR(lower_pattern);
PHALCON_CALL_FUNC_PARAMS_1(lower_pattern, "strtolower", pattern_replace);
RETURN_CTOR(lower_pattern);
}
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_f8ee_0;
fee_f8ee_0:
PHALCON_INIT_VAR(lower_str);
PHALCON_CALL_FUNC_PARAMS_1(lower_str, "strtolower", str);
RETURN_CTOR(lower_str);
}
示例4: PHP_METHOD
/**
* List all tables on a database
*
* @param string $schemaName
* @return array
*/
PHP_METHOD(Phalcon_Db_Adapter_Pdo, listTables){
zval *schema_name = NULL, *sql = NULL, *tables = NULL, *all_tables = NULL, *table = NULL;
zval *t0 = NULL, *t1 = NULL;
zval *r0 = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &schema_name) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!schema_name) {
PHALCON_ALLOC_ZVAL_MM(schema_name);
ZVAL_NULL(schema_name);
}
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, SL("_dialect"), PH_NOISY_CC);
PHALCON_INIT_VAR(sql);
PHALCON_CALL_METHOD_PARAMS_1(sql, t0, "listtables", schema_name, PH_NO_CHECK);
PHALCON_ALLOC_ZVAL_MM(t1);
phalcon_get_class_constant(t1, phalcon_db_ce, SL("FETCH_NUM") TSRMLS_CC);
PHALCON_INIT_VAR(tables);
PHALCON_CALL_METHOD_PARAMS_2(tables, this_ptr, "fetchall", sql, t1, PH_NO_CHECK);
PHALCON_INIT_VAR(all_tables);
array_init(all_tables);
if (!phalcon_valid_foreach(tables TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(tables);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_7f5d_3:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_7f5d_3;
}
PHALCON_INIT_VAR(table);
ZVAL_ZVAL(table, *hd, 1, 0);
PHALCON_INIT_VAR(r0);
phalcon_array_fetch_long(&r0, table, 0, PH_NOISY_CC);
phalcon_array_append(&all_tables, r0, PH_SEPARATE TSRMLS_CC);
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_7f5d_3;
fee_7f5d_3:
if(0){}
RETURN_CTOR(all_tables);
}
示例5: PHP_METHOD
/**
* Renders a view using the template engine
*
* @param string $path
* @param array $params
* @param bool $mustClean
*/
PHP_METHOD(Phalcon_Mvc_View_Engine_Php, render){
zval *path = NULL, *params = NULL, *must_clean = NULL, *value = NULL, *key = NULL, *contents = NULL;
zval *view = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
char *hash_index;
uint hash_index_len;
ulong hash_num;
int hash_type;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz", &path, ¶ms, &must_clean) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (Z_TYPE_P(must_clean) == IS_BOOL && Z_BVAL_P(must_clean)) {
PHALCON_CALL_FUNC_NORETURN("ob_clean");
}
if (!phalcon_valid_foreach(params TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(params);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_1897_0:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_1897_0;
}
PHALCON_INIT_VAR(key);
PHALCON_GET_FOREACH_KEY(key, ah0, hp0);
PHALCON_INIT_VAR(value);
ZVAL_ZVAL(value, *hd, 1, 0);
if (phalcon_set_symbol(key, value TSRMLS_CC) == FAILURE){
return;
}
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_1897_0;
fee_1897_0:
if (phalcon_require(path TSRMLS_CC) == FAILURE) {
return;
}
if (Z_TYPE_P(must_clean) == IS_BOOL && Z_BVAL_P(must_clean)) {
PHALCON_INIT_VAR(contents);
PHALCON_CALL_FUNC(contents, "ob_get_contents");
PHALCON_INIT_VAR(view);
phalcon_read_property(&view, this_ptr, SL("_view"), PH_NOISY_CC);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(view, "setcontent", contents, PH_NO_CHECK);
}
PHALCON_MM_RESTORE();
}
示例6: PHP_METHOD
PHP_METHOD(Phalcon_Flash, _showMessage){
zval *message = NULL, *classes = NULL, *css_classes = NULL, *msg = NULL;
zval *c0 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
zval *t0 = NULL, *t1 = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &message, &classes) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (Z_TYPE_P(classes) == IS_ARRAY) {
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, " ", 1);
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_fast_join(r0, c0, classes TSRMLS_CC);
PHALCON_CPY_WRT(css_classes, r0);
} else {
PHALCON_CPY_WRT(css_classes, classes);
}
if (Z_TYPE_P(message) == IS_ARRAY) {
if (phalcon_valid_foreach(message TSRMLS_CC)) {
ah0 = Z_ARRVAL_P(message);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_3b3c_0:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_3b3c_0;
}
PHALCON_INIT_VAR(msg);
ZVAL_ZVAL(msg, *hd, 1, 0);
PHALCON_INIT_VAR(r1);
PHALCON_INIT_VAR(t0);
zend_get_constant("PHP_EOL", strlen("PHP_EOL"), t0 TSRMLS_CC);
PHALCON_CONCAT_SVSVSV(r1, "<div class=\"", css_classes, "\">", msg, "</div>", t0);
zend_print_zval(r1, 1);
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_3b3c_0;
fee_3b3c_0:
if(0){}
} else {
return;
}
} else {
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_ALLOC_ZVAL_MM(t1);
zend_get_constant("PHP_EOL", strlen("PHP_EOL"), t1 TSRMLS_CC);
PHALCON_CONCAT_SVSVSV(r2, "<div class=\"", css_classes, "\">", message, "</div>", t1);
zend_print_zval(r2, 1);
}
PHALCON_MM_RESTORE();
}
示例7: PHP_METHOD
/**
* Sets the default descriptor for database connections.
*
*
*
* @param array $options
* @return boolean
*/
PHP_METHOD(Phalcon_Db_Pool, setDefaultDescriptor){
zval *options = NULL, *descriptor = NULL, *value = NULL, *key = NULL;
zval *i0 = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
char *hash_index;
uint hash_index_len;
ulong hash_num;
int hash_type;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (Z_TYPE_P(options) != IS_ARRAY) {
if (Z_TYPE_P(options) != IS_OBJECT) {
PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "The parameter 'options' must be an Array or Object");
return;
}
}
if (Z_TYPE_P(options) == IS_ARRAY) {
PHALCON_ALLOC_ZVAL_MM(i0);
object_init(i0);
PHALCON_CPY_WRT(descriptor, i0);
if (phalcon_valid_foreach(options TSRMLS_CC)) {
ah0 = Z_ARRVAL_P(options);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_162f_0:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_162f_0;
} else {
PHALCON_INIT_VAR(key);
PHALCON_GET_FOREACH_KEY(key, ah0, hp0);
}
PHALCON_INIT_VAR(value);
ZVAL_ZVAL(value, *hd, 1, 0);
phalcon_update_property_zval_zval(descriptor, key, value TSRMLS_CC);
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_162f_0;
fee_162f_0:
if(0){}
} else {
return;
}
} else {
PHALCON_CPY_WRT(descriptor, options);
}
phalcon_update_static_property(SL("Phalcon_Db_Pool"), SL("_defaultDescriptor"), descriptor TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例8: PHP_METHOD
/**
* Commits the internal transaction
*
*/
PHP_METHOD(Phalcon_Logger_Adapter_File, commit){
zval *message = NULL;
zval *t0 = NULL, *t1 = NULL, *t2 = NULL, *t3 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *r4 = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, SL("_transaction"), PH_NOISY_CC);
if (!zend_is_true(t0)) {
PHALCON_THROW_EXCEPTION_STR(phalcon_logger_exception_ce, "There is no active transaction");
return;
}
phalcon_update_property_bool(this_ptr, SL("_transaction"), 0 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(t1);
phalcon_read_property(&t1, this_ptr, SL("_quenue"), PH_NOISY_CC);
if (!phalcon_valid_foreach(t1 TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(t1);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_654f_1:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_654f_1;
}
PHALCON_INIT_VAR(message);
ZVAL_ZVAL(message, *hd, 1, 0);
PHALCON_INIT_VAR(t2);
phalcon_read_property(&t2, this_ptr, SL("_fileHandler"), PH_NOISY_CC);
PHALCON_INIT_VAR(r0);
PHALCON_CALL_METHOD(r0, message, "getmessage", PH_NO_CHECK);
PHALCON_INIT_VAR(r1);
PHALCON_CALL_METHOD(r1, message, "gettype", PH_NO_CHECK);
PHALCON_INIT_VAR(r2);
PHALCON_CALL_METHOD(r2, message, "gettime", PH_NO_CHECK);
PHALCON_INIT_VAR(r3);
PHALCON_CALL_METHOD_PARAMS_3(r3, this_ptr, "_applyformat", r0, r1, r2, PH_NO_CHECK);
PHALCON_INIT_VAR(t3);
zend_get_constant(SL("PHP_EOL"), t3 TSRMLS_CC);
PHALCON_INIT_VAR(r4);
PHALCON_CONCAT_VV(r4, r3, t3);
PHALCON_CALL_FUNC_PARAMS_2_NORETURN("fputs", t2, r4);
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_654f_1;
fee_654f_1:
if(0){}
PHALCON_MM_RESTORE();
}
示例9: PHP_METHOD
/**
* Check if HTTP method match any of the passed methods
*
* @param string|array $methods
* @return boolean
*/
PHP_METHOD(Phalcon_Http_Request, isMethod) {
zval *methods, *http_method, *is_equals = NULL, *method = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &methods) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(http_method);
PHALCON_CALL_METHOD(http_method, this_ptr, "getmethod", PH_NO_CHECK);
if (Z_TYPE_P(methods) == IS_STRING) {
PHALCON_INIT_VAR(is_equals);
is_equal_function(is_equals, methods, http_method TSRMLS_CC);
RETURN_NCTOR(is_equals);
} else {
if (!phalcon_valid_foreach(methods TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(methods);
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_VALUE(method);
PHALCON_INIT_NVAR(is_equals);
is_equal_function(is_equals, method, http_method TSRMLS_CC);
if (PHALCON_IS_TRUE(is_equals)) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
if(0) {}
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
示例10: PHP_METHOD
/**
* Prints the messages in the session flasher
*
* @param string $type
* @param boolean $remove
*/
PHP_METHOD(Phalcon_Flash_Session, output){
zval *remove = NULL, *messages, *message = NULL, *type = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
char *hash_index;
uint hash_index_len;
ulong hash_num;
int hash_type;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &remove) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!remove) {
PHALCON_INIT_NVAR(remove);
ZVAL_BOOL(remove, 1);
}
PHALCON_INIT_VAR(messages);
PHALCON_CALL_METHOD_PARAMS_1(messages, this_ptr, "_getsessionmessages", remove, PH_NO_CHECK);
if (Z_TYPE_P(messages) == IS_ARRAY) {
if (!phalcon_valid_foreach(messages TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(messages);
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(type, ah0, hp0);
PHALCON_GET_FOREACH_VALUE(message);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(this_ptr, "outputmessage", type, message, PH_NO_CHECK);
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
if(0){}
}
PHALCON_MM_RESTORE();
}
示例11: PHP_METHOD
/**
* Sanizites a value with a specified single or set of filters
*
* @param mixed $value
* @param mixed $filters
* @return mixed
*/
PHP_METHOD(Phalcon_Filter, sanitize){
zval *value, *filters, *new_value = NULL, *filter = NULL, *filter_value = NULL;
zval *sanizited_value;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &value, &filters) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (Z_TYPE_P(filters) == IS_ARRAY) {
PHALCON_CPY_WRT(new_value, value);
if (Z_TYPE_P(value) != IS_NULL) {
if (!phalcon_valid_foreach(filters TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(filters);
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_VALUE(filter);
PHALCON_INIT_NVAR(filter_value);
PHALCON_CALL_METHOD_PARAMS_2(filter_value, this_ptr, "_sanitize", new_value, filter, PH_NO_CHECK);
PHALCON_CPY_WRT(new_value, filter_value);
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
if(0){}
}
RETURN_CCTOR(new_value);
}
PHALCON_INIT_VAR(sanizited_value);
PHALCON_CALL_METHOD_PARAMS_2(sanizited_value, this_ptr, "_sanitize", value, filters, PH_NO_CHECK);
RETURN_CCTOR(sanizited_value);
}
示例12: PHP_METHOD
/**
* Gets attached files as Phalcon_Request_File instances
*
* @return array
*/
PHP_METHOD(Phalcon_Request, getUploadedFiles){
zval *super_files = NULL, *files = NULL, *file = NULL;
zval *g0 = NULL;
zval *r0 = NULL;
zval *a0 = NULL, *a1 = NULL;
zval *i0 = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
phalcon_get_global(&g0, "_FILES", sizeof("_FILES") TSRMLS_CC);
PHALCON_CPY_WRT(super_files, g0);
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_fast_count(r0, super_files TSRMLS_CC);
if (zend_is_true(r0)) {
PHALCON_INIT_VAR(a0);
array_init(a0);
PHALCON_CPY_WRT(files, a0);
if (phalcon_valid_foreach(super_files TSRMLS_CC)) {
ah0 = Z_ARRVAL_P(super_files);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_9aea_0:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_9aea_0;
}
PHALCON_INIT_VAR(file);
ZVAL_ZVAL(file, *hd, 1, 0);
PHALCON_INIT_VAR(i0);
object_init_ex(i0, phalcon_request_file_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", file, PHALCON_CHECK);
phalcon_array_append(&files, i0, PHALCON_SEPARATE_PLZ TSRMLS_CC);
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_9aea_0;
fee_9aea_0:
if(0){}
} else {
return;
}
PHALCON_RETURN_CTOR(files);
}
PHALCON_INIT_VAR(a1);
array_init(a1);
PHALCON_RETURN_CTOR(a1);
}
示例13: PHP_METHOD
/**
* Gets a list of columns
*
* @param array $columnList
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnList){
zval *column_list = NULL, *str_list = NULL, *column = NULL, *column_quoted = NULL;
zval *comma = NULL, *joined_list = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &column_list) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(str_list);
array_init(str_list);
if (!phalcon_valid_foreach(column_list TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(column_list);
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_VALUE(column);
PHALCON_INIT_VAR(column_quoted);
PHALCON_CONCAT_SVS(column_quoted, "\"", column, "\"");
phalcon_array_append(&str_list, column_quoted, PH_SEPARATE TSRMLS_CC);
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
PHALCON_INIT_VAR(comma);
ZVAL_STRING(comma, ", ", 1);
PHALCON_INIT_VAR(joined_list);
phalcon_fast_join(joined_list, comma, str_list TSRMLS_CC);
RETURN_CTOR(joined_list);
}
示例14: PHP_METHOD
/**
* Returns a route object by its name
*
* @return Phalcon\Mvc\Router\Route
*/
PHP_METHOD(Phalcon_Mvc_Router, getRouteByName) {
zval *name = NULL, *routes = NULL, *route = NULL, *route_name = NULL, *is_equal = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &name) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(routes);
phalcon_read_property(&routes, this_ptr, SL("_routes"), PH_NOISY_CC);
if (!phalcon_valid_foreach(routes TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(routes);
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_VALUE(route);
PHALCON_INIT_VAR(route_name);
PHALCON_CALL_METHOD(route_name, route, "getname", PH_NO_CHECK);
PHALCON_INIT_VAR(is_equal);
is_equal_function(is_equal, route_name, name TSRMLS_CC);
if (PHALCON_IS_TRUE(is_equal)) {
RETURN_CCTOR(route);
}
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
示例15: PHP_METHOD
/**
* Gets attached files as Phalcon\Http\Request\File instances
*
* @return Phalcon\Http\Request\File[]
*/
PHP_METHOD(Phalcon_Http_Request, getUploadedFiles){
zval *super_files = NULL, *number_files = NULL, *files = NULL, *file = NULL;
zval *request_file = NULL, *empty_files = NULL;
zval *g0 = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
phalcon_get_global(&g0, SL("_FILES")+1 TSRMLS_CC);
PHALCON_CPY_WRT(super_files, g0);
PHALCON_INIT_VAR(number_files);
phalcon_fast_count(number_files, super_files TSRMLS_CC);
if (zend_is_true(number_files)) {
PHALCON_INIT_VAR(files);
array_init(files);
if (!phalcon_valid_foreach(super_files TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(super_files);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
fes_ac06_1:
if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){
goto fee_ac06_1;
}
PHALCON_INIT_VAR(file);
ZVAL_ZVAL(file, *hd, 1, 0);
PHALCON_INIT_VAR(request_file);
object_init_ex(request_file, phalcon_http_request_file_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(request_file, "__construct", file, PH_CHECK);
phalcon_array_append(&files, request_file, PH_SEPARATE TSRMLS_CC);
zend_hash_move_forward_ex(ah0, &hp0);
goto fes_ac06_1;
fee_ac06_1:
RETURN_CTOR(files);
}
PHALCON_INIT_VAR(empty_files);
array_init(empty_files);
RETURN_CTOR(empty_files);
}