本文整理汇总了C++中PHALCON_CALL_FUNC_PARAMS_1函数的典型用法代码示例。如果您正苦于以下问题:C++ PHALCON_CALL_FUNC_PARAMS_1函数的具体用法?C++ PHALCON_CALL_FUNC_PARAMS_1怎么用?C++ PHALCON_CALL_FUNC_PARAMS_1使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHALCON_CALL_FUNC_PARAMS_1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Converts strings to camelize style
*
*
*
* @param string $str
* @return string
*/
PHP_METHOD(Phalcon_Text, camelize){
zval *str = NULL;
zval *c0 = NULL, *c1 = NULL, *c2 = NULL, *c3 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &str) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, " ", 1);
PHALCON_INIT_VAR(c1);
ZVAL_STRING(c1, "", 1);
PHALCON_INIT_VAR(c2);
ZVAL_STRING(c2, "_", 1);
PHALCON_INIT_VAR(c3);
ZVAL_STRING(c3, " ", 1);
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CALL_FUNC_PARAMS_1(r0, "strtolower", str);
PHALCON_ALLOC_ZVAL_MM(r1);
phalcon_fast_str_replace(r1, c2, c3, r0 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_CALL_FUNC_PARAMS_1(r2, "ucwords", r1);
PHALCON_ALLOC_ZVAL_MM(r3);
phalcon_fast_str_replace(r3, c0, c1, r2 TSRMLS_CC);
RETURN_DZVAL(r3);
}
示例2: PHP_METHOD
/**
* Generates the SQL for a MySQL LIMIT clause
*
* @param string $sqlQuery
* @param int $number
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Mysql, limit){
zval *sql_query = NULL, *number = NULL, *limit = NULL;
zval *r0 = NULL, *r1 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &sql_query, &number) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CALL_FUNC_PARAMS_1(r0, "is_numeric", number);
if (zend_is_true(r0)) {
PHALCON_INIT_VAR(limit);
PHALCON_CALL_FUNC_PARAMS_1(limit, "intval", number);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_CONCAT_VSV(r1, sql_query, " LIMIT ", limit);
RETURN_CTOR(r1);
} else {
RETURN_CCTOR(sql_query);
}
PHALCON_MM_RESTORE();
}
示例3: PHP_METHOD
/**
* Generates the SQL for LIMIT clause
*
* @param string $sqlQuery
* @param int $number
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect, limit){
zval *sql_query = NULL, *number = NULL, *is_numeric = NULL, *limit = NULL, *sql_limit = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &sql_query, &number) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(is_numeric);
PHALCON_CALL_FUNC_PARAMS_1(is_numeric, "is_numeric", number);
if (Z_TYPE_P(is_numeric) == IS_BOOL && Z_BVAL_P(is_numeric)) {
PHALCON_INIT_VAR(limit);
PHALCON_CALL_FUNC_PARAMS_1(limit, "intval", number);
PHALCON_INIT_VAR(sql_limit);
PHALCON_CONCAT_VSV(sql_limit, sql_query, " LIMIT ", limit);
RETURN_CTOR(sql_limit);
}
RETURN_CCTOR(sql_query);
}
示例4: 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);
}
示例5: PHP_METHOD
/**
* Assigns default values to generated tags by helpers
*
* <code>
* //Assigning "peter" to "name" component
* Phalcon\Tag::setDefault("name", "peter");
*
* //Later in the view
* echo Phalcon\Tag::textField("name"); //Will have the value "peter" by default
* </code>
*
* @param string $id
* @param string $value
*/
PHP_METHOD(Phalcon_Tag, setDefault){
zval *id, *value, *is_scalar;
zval *t0 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &id, &value) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (zend_is_true(value)) {
PHALCON_INIT_VAR(is_scalar);
PHALCON_CALL_FUNC_PARAMS_1(is_scalar, "is_scalar", value);
if (PHALCON_IS_FALSE(is_scalar)) {
PHALCON_THROW_EXCEPTION_STR(phalcon_tag_exception_ce, "Only scalar values can be assigned to UI components");
return;
}
}
PHALCON_OBSERVE_VAR(t0);
phalcon_read_static_property(&t0, SL("phalcon\\tag"), SL("_displayValues") TSRMLS_CC);
if (Z_TYPE_P(t0) != IS_ARRAY) {
convert_to_array(t0);
}
phalcon_array_update_zval(&t0, id, &value, PH_COPY TSRMLS_CC);
phalcon_update_static_property(SL("phalcon\\tag"), SL("_displayValues"), t0 TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例6: PHP_METHOD
/**
* Gets active server address IP
*
* @return string
*/
PHP_METHOD(Phalcon_Http_Request, getServerAddress){
zval *server = NULL, *server_addr = NULL, *localhost = NULL;
zval *g0 = NULL;
int eval_int;
PHALCON_MM_GROW();
phalcon_get_global(&g0, SL("_SERVER")+1 TSRMLS_CC);
PHALCON_CPY_WRT(server, g0);
eval_int = phalcon_array_isset_string(server, SL("SERVER_ADDR")+1);
if (eval_int) {
PHALCON_INIT_VAR(server_addr);
phalcon_array_fetch_string(&server_addr, server, SL("SERVER_ADDR"), PH_NOISY_CC);
RETURN_CCTOR(server_addr);
}
PHALCON_INIT_VAR(localhost);
ZVAL_STRING(localhost, "localhost", 1);
PHALCON_INIT_VAR(server_addr);
PHALCON_CALL_FUNC_PARAMS_1(server_addr, "gethostbyname", localhost);
RETURN_CCTOR(server_addr);
}
示例7: PHP_METHOD
/**
* Adds the limit parameter to the criteria
*
* @param string $orderColumns
* @return Phalcon\Mvc\Model\Criteria
*/
PHP_METHOD(Phalcon_Mvc_Model_Criteria, limit){
zval *limit = NULL;
zval *r0 = NULL;
zval *t0 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &limit) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CALL_FUNC_PARAMS_1(r0, "is_numeric", limit);
if (!zend_is_true(r0)) {
PHALCON_THROW_EXCEPTION_STR(phalcon_mvc_model_exception_ce, "Rows limit parameter must be integer");
return;
}
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, SL("_params"), PH_NOISY_CC);
phalcon_array_update_string(&t0, SL("limit"), &limit, PH_COPY TSRMLS_CC);
phalcon_update_property_zval(this_ptr, SL("_params"), t0 TSRMLS_CC);
RETURN_CCTOR(this_ptr);
}
示例8: PHP_METHOD
/**
* Returns last error code from MySQL
*
* @param string $errorString
* @param resurce $resultQuery
* @return int
*/
PHP_METHOD(Phalcon_Db_Adapter_Mysql, noError){
zval *result_query = NULL, *id_connection = NULL;
zval *t0 = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &result_query) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!result_query) {
PHALCON_INIT_VAR(result_query);
ZVAL_NULL(result_query);
}
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, SL("_idConnection"), PHALCON_NOISY TSRMLS_CC);
PHALCON_CPY_WRT(id_connection, t0);
if (!zend_is_true(id_connection)) {
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CALL_FUNC_PARAMS_1(r0, "mysqli_errno", id_connection);
RETURN_DZVAL(r0);
}
示例9: PHP_METHOD
/**
* Check that the options are valid
*
*/
PHP_METHOD(Phalcon_Model_Validator_Exclusionin, checkOptions) {
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
zval *c0 = NULL, *c1 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, "domain", 1);
PHALCON_CALL_METHOD_PARAMS_1(r0, this_ptr, "issetoption", c0, PHALCON_NO_CHECK);
if (!zend_is_true(r0)) {
PHALCON_THROW_EXCEPTION_STR(phalcon_model_exception_ce, "The option 'domain' is required for this validator");
return;
}
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_INIT_VAR(c1);
ZVAL_STRING(c1, "domain", 1);
PHALCON_CALL_METHOD_PARAMS_1(r2, this_ptr, "getoption", c1, PHALCON_NO_CHECK);
PHALCON_CALL_FUNC_PARAMS_1(r1, "is_array", r2, 0x03D);
if (!zend_is_true(r1)) {
PHALCON_THROW_EXCEPTION_STR(phalcon_model_exception_ce, "Option 'domain' must be an array");
return;
}
PHALCON_MM_RESTORE();
}
示例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 = NULL, *model_exists = NULL, *model = NULL, *exception_message = NULL;
zval *exception = NULL;
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();
}
PHALCON_INIT_VAR(model_exists);
PHALCON_CALL_FUNC_PARAMS_1(model_exists, "class_exists", model_name);
if (zend_is_true(model_exists)) {
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_INIT_VAR(exception);
object_init_ex(exception, phalcon_mvc_model_exception_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(exception, "__construct", exception_message, PH_CHECK);
phalcon_throw_exception(exception TSRMLS_CC);
return;
}
示例11: 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);
}
示例12: PHP_METHOD
/**
* Renders a view using the template engine
*
* @param string $path
* @param array $params
*/
PHP_METHOD(Phalcon_View_Engine_Mustache, render){
zval *path = NULL, *params = NULL;
zval *t0 = NULL, *t1 = NULL;
zval *r0 = NULL, *r1 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &path, ¶ms) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
phalcon_update_property_zval(this_ptr, SL("_params"), params TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, SL("_view"), PHALCON_NOISY TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_ALLOC_ZVAL_MM(t1);
phalcon_read_property(&t1, this_ptr, SL("_mustache"), PHALCON_NOISY TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_CALL_FUNC_PARAMS_1(r1, "file_get_contents", path);
PHALCON_CALL_METHOD_PARAMS_2(r0, t1, "render", r1, this_ptr, PHALCON_NO_CHECK);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(t0, "setcontent", r0, PHALCON_NO_CHECK);
PHALCON_MM_RESTORE();
}
示例13: PHP_METHOD
/**
* Serializing a resultset will dump all related rows into a big array
*
* @return string
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize){
zval *records, *cache, *column_types, *hydrate_mode;
zval *data, *serialized;
PHALCON_MM_GROW();
/**
* Obtain the records as an array
*/
PHALCON_INIT_VAR(records);
PHALCON_CALL_METHOD(records, this_ptr, "toarray");
PHALCON_OBS_VAR(cache);
phalcon_read_property_this(&cache, this_ptr, SL("_cache"), PH_NOISY_CC);
PHALCON_OBS_VAR(column_types);
phalcon_read_property_this(&column_types, this_ptr, SL("_columnTypes"), PH_NOISY_CC);
PHALCON_OBS_VAR(hydrate_mode);
phalcon_read_property_this(&hydrate_mode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC);
PHALCON_INIT_VAR(data);
array_init_size(data, 4);
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_array_update_string(&data, SL("columnTypes"), &column_types, PH_COPY | PH_SEPARATE TSRMLS_CC);
phalcon_array_update_string(&data, SL("hydrateMode"), &hydrate_mode, PH_COPY | PH_SEPARATE TSRMLS_CC);
PHALCON_INIT_VAR(serialized);
PHALCON_CALL_FUNC_PARAMS_1(serialized, "serialize", data);
RETURN_CCTOR(serialized);
}
示例14: PHP_METHOD
/**
* Unserializing a resultset will allow to only works on the rows present in the saved state
*
* @param string $data
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize){
zval *data = NULL, *resultset = NULL, *model = NULL, *rows = NULL, *cache = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
phalcon_update_property_long(this_ptr, SL("_type"), 0 TSRMLS_CC);
PHALCON_INIT_VAR(resultset);
PHALCON_CALL_FUNC_PARAMS_1(resultset, "unserialize", data);
if (Z_TYPE_P(resultset) == IS_ARRAY) {
PHALCON_INIT_VAR(model);
phalcon_array_fetch_string(&model, resultset, SL("model"), PH_NOISY_CC);
phalcon_update_property_zval(this_ptr, SL("_model"), model TSRMLS_CC);
PHALCON_INIT_VAR(rows);
phalcon_array_fetch_string(&rows, resultset, SL("rows"), PH_NOISY_CC);
phalcon_update_property_zval(this_ptr, SL("_rows"), rows TSRMLS_CC);
PHALCON_INIT_VAR(cache);
phalcon_array_fetch_string(&cache, resultset, SL("cache"), PH_NOISY_CC);
phalcon_update_property_zval(this_ptr, SL("_cache"), cache TSRMLS_CC);
} else {
PHALCON_THROW_EXCEPTION_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data");
return;
}
PHALCON_MM_RESTORE();
}
示例15: PHP_METHOD
/**
* Gets HTTP raw request body
*
* @return string
*/
PHP_METHOD(Phalcon_Http_Request, getRawBody){
zval *raw_body, *input, *contents;
PHALCON_MM_GROW();
PHALCON_OBS_VAR(raw_body);
phalcon_read_property(&raw_body, this_ptr, SL("_rawBody"), PH_NOISY_CC);
if (!zend_is_true(raw_body)) {
PHALCON_INIT_VAR(input);
ZVAL_STRING(input, "php://input", 1);
PHALCON_INIT_VAR(contents);
PHALCON_CALL_FUNC_PARAMS_1(contents, "file_get_contents", input);
/**
* We need store the read raw body because it can be read again
*/
phalcon_update_property_zval(this_ptr, SL("_rawBody"), contents TSRMLS_CC);
RETURN_CCTOR(contents);
}
RETURN_CCTOR(raw_body);
}