本文整理汇总了C++中phalcon_array_isset_string函数的典型用法代码示例。如果您正苦于以下问题:C++ phalcon_array_isset_string函数的具体用法?C++ phalcon_array_isset_string怎么用?C++ phalcon_array_isset_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phalcon_array_isset_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Phalcon\Cache\Backend\Mongo constructor
*
* @param Phalcon\Cache\FrontendInterface $frontend
* @param array $options
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, __construct){
zval *frontend, *options = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &frontend, &options);
if (!options) {
PHALCON_INIT_VAR(options);
}
if (!phalcon_array_isset_string(options, SS("mongo"))) {
if (!phalcon_array_isset_string(options, SS("server"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'server' is required");
return;
}
}
if (!phalcon_array_isset_string(options, SS("db"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'db' is required");
return;
}
if (!phalcon_array_isset_string(options, SS("collection"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'collection' is required");
return;
}
PHALCON_CALL_PARENT_PARAMS_2_NORETURN(this_ptr, "Phalcon\\Cache\\Backend\\Mongo", "__construct", frontend, options);
PHALCON_MM_RESTORE();
}
开发者ID:11mariom,项目名称:cphalcon,代码行数:38,代码来源:mongo.c
示例2: PHP_METHOD
/**
* Gets most possibly client IPv4 Address
*
* @return string
*/
PHP_METHOD(Phalcon_Request, getClientAddress){
zval *address = NULL;
zval *g0 = NULL;
zval *r0 = NULL, *r1 = NULL;
int eval_int;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(address);
ZVAL_STRING(address, "", 1);
phalcon_get_global(&g0, "_SERVER", sizeof("_SERVER") TSRMLS_CC);
eval_int = phalcon_array_isset_string(g0, "HTTP_X_FORWARDED_FOR", strlen("HTTP_X_FORWARDED_FOR")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_array_fetch_string(&r0, g0, "HTTP_X_FORWARDED_FOR", strlen("HTTP_X_FORWARDED_FOR"), PHALCON_NOISY TSRMLS_CC);
PHALCON_CPY_WRT(address, r0);
} else {
eval_int = phalcon_array_isset_string(g0, "REMOTE_ADDR", strlen("REMOTE_ADDR")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r1);
phalcon_array_fetch_string(&r1, g0, "REMOTE_ADDR", strlen("REMOTE_ADDR"), PHALCON_NOISY TSRMLS_CC);
PHALCON_CPY_WRT(address, r1);
}
}
PHALCON_RETURN_CHECK_CTOR(address);
}
开发者ID:loudertech,项目名称:cphalcon,代码行数:33,代码来源:request.c
示例3: PHP_METHOD
/**
* Checks whether request has been made using SOAP
*
* @return boolean
*/
PHP_METHOD(Phalcon_Http_Request, isSoapRequested) {
zval *server = NULL, *content_type;
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, SS("HTTP_SOAPACTION"));
if (eval_int) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
} else {
eval_int = phalcon_array_isset_string(server, SS("CONTENT_TYPE"));
if (eval_int) {
PHALCON_INIT_VAR(content_type);
phalcon_array_fetch_string(&content_type, server, SL("CONTENT_TYPE"), PH_NOISY_CC);
if (phalcon_memnstr_str(content_type, SL("application/soap+xml") TSRMLS_CC)) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
}
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
开发者ID:Tigerlee1987,项目名称:cphalcon,代码行数:34,代码来源:request.c
示例4: PHP_METHOD
/**
* Phalcon\Mvc\Model\MetaData\Apc constructor
*
* @param array $options
*/
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, __construct){
zval *options = NULL, *prefix, *ttl, *empty_array;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &options) == FAILURE) {
RETURN_MM_NULL();
}
if (!options) {
PHALCON_INIT_VAR(options);
}
if (Z_TYPE_P(options) == IS_ARRAY) {
if (phalcon_array_isset_string(options, SS("prefix"))) {
PHALCON_OBS_VAR(prefix);
phalcon_array_fetch_string(&prefix, options, SL("prefix"), PH_NOISY_CC);
phalcon_update_property_this(this_ptr, SL("_prefix"), prefix TSRMLS_CC);
}
if (phalcon_array_isset_string(options, SS("lifetime"))) {
PHALCON_OBS_VAR(ttl);
phalcon_array_fetch_string(&ttl, options, SL("lifetime"), PH_NOISY_CC);
phalcon_update_property_this(this_ptr, SL("_ttl"), ttl TSRMLS_CC);
}
}
PHALCON_INIT_VAR(empty_array);
array_init(empty_array);
phalcon_update_property_this(this_ptr, SL("_metaData"), empty_array TSRMLS_CC);
PHALCON_MM_RESTORE();
}
开发者ID:101010111100,项目名称:cphalcon,代码行数:38,代码来源:apc.c
示例5: PHP_METHOD
/**
* Phalcon\Mvc\Model\MetaData\Xcache constructor
*
* @param array $options
*/
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, __construct){
zval *options = NULL, *prefix, *ttl, *empty_array;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 0, 1, &options);
if (!options) {
PHALCON_INIT_VAR(options);
}
if (Z_TYPE_P(options) == IS_ARRAY) {
if (phalcon_array_isset_string(options, SS("prefix"))) {
PHALCON_OBS_VAR(prefix);
phalcon_array_fetch_string(&prefix, options, SL("prefix"), PH_NOISY);
phalcon_update_property_this(this_ptr, SL("_prefix"), prefix TSRMLS_CC);
}
if (phalcon_array_isset_string(options, SS("lifetime"))) {
PHALCON_OBS_VAR(ttl);
phalcon_array_fetch_string(&ttl, options, SL("lifetime"), PH_NOISY);
phalcon_update_property_this(this_ptr, SL("_ttl"), ttl TSRMLS_CC);
}
}
PHALCON_INIT_VAR(empty_array);
array_init(empty_array);
phalcon_update_property_this(this_ptr, SL("_metaData"), empty_array TSRMLS_CC);
PHALCON_MM_RESTORE();
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:36,代码来源:xcache.c
示例6: PHP_METHOD
/**
* Gets most possibly client IPv4 Address. This methods search in $_SERVER['HTTP_X_FORWARDED_FOR'] and $_SERVER['REMOTE_ADDR']
*
* @return string
*/
PHP_METHOD(Phalcon_Http_Request, getClientAddress){
zval *address = NULL, *server = NULL;
zval *g0 = NULL;
int eval_int;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(address);
ZVAL_STRING(address, "", 1);
phalcon_get_global(&g0, SL("_SERVER")+1 TSRMLS_CC);
PHALCON_CPY_WRT(server, g0);
eval_int = phalcon_array_isset_string(server, SL("HTTP_X_FORWARDED_FOR")+1);
if (eval_int) {
PHALCON_INIT_VAR(address);
phalcon_array_fetch_string(&address, server, SL("HTTP_X_FORWARDED_FOR"), PH_NOISY_CC);
} else {
eval_int = phalcon_array_isset_string(server, SL("REMOTE_ADDR")+1);
if (eval_int) {
PHALCON_INIT_VAR(address);
phalcon_array_fetch_string(&address, server, SL("REMOTE_ADDR"), PH_NOISY_CC);
}
}
RETURN_CCTOR(address);
}
开发者ID:meibk,项目名称:cphalcon,代码行数:31,代码来源:request.c
示例7: PHP_METHOD
/**
* Restore a Phalcon\Db\Index object from export
*
* @param array $data
* @return Phalcon\Db\IndexInterface
*/
PHP_METHOD(Phalcon_Db_Index, __set_state){
zval *data, *index_name, *columns, *index;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
RETURN_MM_NULL();
}
if (!phalcon_array_isset_string(data, SS("_indexName"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "_indexName parameter is required");
return;
}
if (!phalcon_array_isset_string(data, SS("_columns"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "_columns parameter is required");
return;
}
PHALCON_OBS_VAR(index_name);
phalcon_array_fetch_string(&index_name, data, SL("_indexName"), PH_NOISY_CC);
PHALCON_OBS_VAR(columns);
phalcon_array_fetch_string(&columns, data, SL("_columns"), PH_NOISY_CC);
/**
* Return a Phalcon\Db\Index as part of the returning state
*/
PHALCON_INIT_VAR(index);
object_init_ex(index, phalcon_db_index_ce);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(index, "__construct", index_name, columns);
RETURN_CTOR(index);
}
开发者ID:BlueShark,项目名称:cphalcon,代码行数:41,代码来源:index.c
示例8: PHP_METHOD
/**
* Phalcon\Http\Request\File constructor
*
* @param array $file
*/
PHP_METHOD(Phalcon_Http_Request_File, __construct){
zval *file, *name, *temp_name, *size, *type, *error, *key = NULL;
zval *constant, *extension = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &file, &key);
if (Z_TYPE_P(file) != IS_ARRAY) {
PHALCON_THROW_EXCEPTION_STR(phalcon_http_request_exception_ce, "Phalcon\\Http\\Request\\File requires a valid uploaded file");
return;
}
if (phalcon_array_isset_string(file, SS("name"))) {
PHALCON_OBS_VAR(name);
phalcon_array_fetch_string(&name, file, SL("name"), PH_NOISY);
phalcon_update_property_this(this_ptr, SL("_name"), name TSRMLS_CC);
PHALCON_INIT_VAR(constant);
if (zend_get_constant(SL("PATHINFO_EXTENSION"), constant TSRMLS_CC)) {
PHALCON_CALL_FUNCTION(&extension, "pathinfo", name, constant);
phalcon_update_property_this(this_ptr, SL("_extension"), extension TSRMLS_CC);
}
}
if (phalcon_array_isset_string(file, SS("tmp_name"))) {
PHALCON_OBS_VAR(temp_name);
phalcon_array_fetch_string(&temp_name, file, SL("tmp_name"), PH_NOISY);
phalcon_update_property_this(this_ptr, SL("_tmp"), temp_name TSRMLS_CC);
} else {
PHALCON_INIT_VAR(temp_name);
ZVAL_NULL(temp_name);
}
if (phalcon_array_isset_string(file, SS("size"))) {
PHALCON_OBS_VAR(size);
phalcon_array_fetch_string(&size, file, SL("size"), PH_NOISY);
phalcon_update_property_this(this_ptr, SL("_size"), size TSRMLS_CC);
}
if (phalcon_array_isset_string(file, SS("type"))) {
PHALCON_OBS_VAR(type);
phalcon_array_fetch_string(&type, file, SL("type"), PH_NOISY);
phalcon_update_property_this(this_ptr, SL("_type"), type TSRMLS_CC);
}
if (phalcon_array_isset_string(file, SS("error"))) {
PHALCON_OBS_VAR(error);
phalcon_array_fetch_string(&error, file, SL("error"), PH_NOISY);
phalcon_update_property_this(this_ptr, SL("_error"), error TSRMLS_CC);
}
if (key) {
phalcon_update_property_this(this_ptr, SL("_key"), key TSRMLS_CC);
}
PHALCON_CALL_PARENT(NULL, phalcon_http_request_file_ce, this_ptr, "__construct", temp_name);
PHALCON_MM_RESTORE();
}
开发者ID:CoolCloud,项目名称:cphalcon,代码行数:65,代码来源:file.c
示例9: PHP_METHOD
/**
* Phalcon\Cache\Backend\Mongo constructor
*
* @param Phalcon\Cache\FrontendInterface $frontend
* @param array $options
*/
PHP_METHOD(Phalcon_Cache_Backend_Mongo, __construct){
zval *frontend, *options = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &frontend, &options);
if (!options) {
options = PHALCON_GLOBAL(z_null);
}
if (!phalcon_array_isset_string(options, SS("mongo"))) {
if (!phalcon_array_isset_string(options, SS("server"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'server' is required");
return;
}
}
if (!phalcon_array_isset_string(options, SS("db"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'db' is required");
return;
}
if (!phalcon_array_isset_string(options, SS("collection"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The parameter 'collection' is required");
return;
}
PHALCON_CALL_PARENT(NULL, phalcon_cache_backend_mongo_ce, this_ptr, "__construct", frontend, options);
PHALCON_MM_RESTORE();
}
开发者ID:banketree,项目名称:cphalcon,代码行数:39,代码来源:mongo.c
示例10: PHP_METHOD
/**
* Phalcon_Paginator_Adapter_Model constructor
*
* @param array $config
*/
PHP_METHOD(Phalcon_Paginator_Adapter_Model, __construct){
zval *v0 = NULL;
zval *r0 = NULL, *r1 = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &v0) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
phalcon_update_property_zval(this_ptr, "_config", strlen("_config"), v0 TSRMLS_CC);
eval_int = phalcon_array_isset_string(v0, "limit", strlen("limit")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_array_fetch_string(&r0, v0, "limit", strlen("limit"), PHALCON_NOISY_FETCH TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_limitRows", strlen("_limitRows"), r0 TSRMLS_CC);
}
eval_int = phalcon_array_isset_string(v0, "page", strlen("page")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r1);
phalcon_array_fetch_string(&r1, v0, "page", strlen("page"), PHALCON_NOISY_FETCH TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_page", strlen("_page"), r1 TSRMLS_CC);
}
PHALCON_MM_RESTORE();
RETURN_NULL();
}
开发者ID:xingskycn,项目名称:cphalcon,代码行数:35,代码来源:model.c
示例11: PHP_METHOD
/**
* Restore a Phalcon\Db\Index object from export
*
* @param array $data
* @return Phalcon\Db\Index
*/
PHP_METHOD(Phalcon_Db_Index, __set_state){
zval *data = NULL, *index_name = NULL, *columns = NULL, *index = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
eval_int = phalcon_array_isset_string(data, SL("_indexName")+1);
if (!eval_int) {
PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "_indexName parameter is required");
return;
}
eval_int = phalcon_array_isset_string(data, SL("_columns")+1);
if (!eval_int) {
PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "_columns parameter is required");
return;
}
PHALCON_INIT_VAR(index_name);
phalcon_array_fetch_string(&index_name, data, SL("_indexName"), PH_NOISY_CC);
PHALCON_INIT_VAR(columns);
phalcon_array_fetch_string(&columns, data, SL("_columns"), PH_NOISY_CC);
PHALCON_INIT_VAR(index);
object_init_ex(index, phalcon_db_index_ce);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(index, "__construct", index_name, columns, PH_CHECK);
RETURN_CTOR(index);
}
开发者ID:codeanu,项目名称:cphalcon,代码行数:41,代码来源:index.c
示例12: PHP_METHOD
/**
* Phalcon\Paginator\Adapter\Model constructor
*
* @param array $config
*/
PHP_METHOD(Phalcon_Paginator_Adapter_Model, __construct){
zval *config = NULL, *limit = NULL, *page = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &config) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
phalcon_update_property_zval(this_ptr, SL("_config"), config TSRMLS_CC);
eval_int = phalcon_array_isset_string(config, SL("limit")+1);
if (eval_int) {
PHALCON_INIT_VAR(limit);
phalcon_array_fetch_string(&limit, config, SL("limit"), PH_NOISY_CC);
phalcon_update_property_zval(this_ptr, SL("_limitRows"), limit TSRMLS_CC);
}
eval_int = phalcon_array_isset_string(config, SL("page")+1);
if (eval_int) {
PHALCON_INIT_VAR(page);
phalcon_array_fetch_string(&page, config, SL("page"), PH_NOISY_CC);
phalcon_update_property_zval(this_ptr, SL("_page"), page TSRMLS_CC);
}
PHALCON_MM_RESTORE();
}
开发者ID:croustibat,项目名称:cphalcon,代码行数:34,代码来源:model.c
示例13: PHP_METHOD
/**
* Handles routing information received from command-line arguments
*
* @param array $arguments
*/
PHP_METHOD(Phalcon_CLI_Router, handle){
zval *arguments = NULL, *module_name = NULL, *task_name = NULL, *action_name = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 0, 1, &arguments);
if (!arguments) {
PHALCON_INIT_VAR(arguments);
array_init(arguments);
} else {
PHALCON_SEPARATE_PARAM(arguments);
}
if (Z_TYPE_P(arguments) != IS_ARRAY) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cli_router_exception_ce, "Arguments must be an Array");
return;
}
PHALCON_INIT_VAR(module_name);
PHALCON_INIT_VAR(task_name);
PHALCON_INIT_VAR(action_name);
/**
* Check for a module
*/
if (phalcon_array_isset_string(arguments, SS("module"))) {
PHALCON_OBS_NVAR(module_name);
phalcon_array_fetch_string(&module_name, arguments, SL("module"), PH_NOISY);
phalcon_array_unset_string(&arguments, SS("module"), PH_SEPARATE);
}
/**
* Check for a task
*/
if (phalcon_array_isset_string(arguments, SS("task"))) {
PHALCON_OBS_NVAR(task_name);
phalcon_array_fetch_string(&task_name, arguments, SL("task"), PH_NOISY);
phalcon_array_unset_string(&arguments, SS("task"), PH_SEPARATE);
}
/**
* Check for an action
*/
if (phalcon_array_isset_string(arguments, SS("action"))) {
PHALCON_OBS_NVAR(action_name);
phalcon_array_fetch_string(&action_name, arguments, SL("action"), PH_NOISY);
phalcon_array_unset_string(&arguments, SS("action"), PH_SEPARATE);
}
phalcon_update_property_this(this_ptr, SL("_module"), module_name TSRMLS_CC);
phalcon_update_property_this(this_ptr, SL("_task"), task_name TSRMLS_CC);
phalcon_update_property_this(this_ptr, SL("_action"), action_name TSRMLS_CC);
phalcon_update_property_this(this_ptr, SL("_params"), arguments TSRMLS_CC);
PHALCON_MM_RESTORE();
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:65,代码来源:router.c
示例14: PHP_METHOD
/**
* Gets most possible client IPv4 Address. This method search in $_SERVER['REMOTE_ADDR'] and optionally in $_SERVER['HTTP_X_FORWARDED_FOR']
*
* @param boolean $trustForwardedHeader
* @return string
*/
PHP_METHOD(Phalcon_Http_Request, getClientAddress){
zval *trust_forwarded_header = NULL, *address = NULL, *_SERVER;
zval *comma, *addresses, *first;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &trust_forwarded_header) == FAILURE) {
RETURN_MM_NULL();
}
if (!trust_forwarded_header) {
PHALCON_INIT_VAR(trust_forwarded_header);
ZVAL_BOOL(trust_forwarded_header, 0);
}
PHALCON_INIT_VAR(address);
/**
* Proxies uses this IP
*/
phalcon_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC);
if (phalcon_array_isset_string(_SERVER, SS("HTTP_X_FORWARDED_FOR"))) {
if (zend_is_true(trust_forwarded_header)) {
PHALCON_OBS_NVAR(address);
phalcon_array_fetch_string(&address, _SERVER, SL("HTTP_X_FORWARDED_FOR"), PH_NOISY_CC);
}
}
if (Z_TYPE_P(address) == IS_NULL) {
if (phalcon_array_isset_string(_SERVER, SS("REMOTE_ADDR"))) {
PHALCON_OBS_NVAR(address);
phalcon_array_fetch_string(&address, _SERVER, SL("REMOTE_ADDR"), PH_NOISY_CC);
}
}
if (Z_TYPE_P(address) == IS_STRING) {
if (phalcon_memnstr_str(address, SL(",") TSRMLS_CC)) {
/**
* The client address has multiples parts, only return the first part
*/
PHALCON_INIT_VAR(comma);
ZVAL_STRING(comma, ",", 1);
PHALCON_INIT_VAR(addresses);
phalcon_fast_explode(addresses, comma, address TSRMLS_CC);
PHALCON_OBS_VAR(first);
phalcon_array_fetch_long(&first, addresses, 0, PH_NOISY_CC);
RETURN_CCTOR(first);
}
RETURN_CCTOR(address);
}
RETURN_MM_FALSE;
}
开发者ID:BlueShark,项目名称:cphalcon,代码行数:63,代码来源:request.c
示例15: PHP_METHOD
/**
* Restore a Phalcon\Db\Reference object from export
*
* @param array $data
* @return Phalcon\Db\Reference
*/
PHP_METHOD(Phalcon_Db_Reference, __set_state){
zval *data, *constraint_name, *referenced_schema = NULL;
zval *referenced_table = NULL, *columns = NULL, *referenced_columns = NULL;
zval *definition;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &data);
if (!phalcon_array_isset_string(data, SS("_referenceName"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "_referenceName parameter is required");
return;
} else {
PHALCON_OBS_VAR(constraint_name);
phalcon_array_fetch_string(&constraint_name, data, SL("_referenceName"), PH_NOISY);
}
if (phalcon_array_isset_string(data, SS("_referencedSchema"))) {
PHALCON_OBS_VAR(referenced_schema);
phalcon_array_fetch_string(&referenced_schema, data, SL("_referencedSchema"), PH_NOISY);
} else {
PHALCON_INIT_NVAR(referenced_schema);
}
if (phalcon_array_isset_string(data, SS("_referencedTable"))) {
PHALCON_OBS_VAR(referenced_table);
phalcon_array_fetch_string(&referenced_table, data, SL("_referencedTable"), PH_NOISY);
} else {
PHALCON_INIT_NVAR(referenced_table);
}
if (phalcon_array_isset_string(data, SS("_columns"))) {
PHALCON_OBS_VAR(columns);
phalcon_array_fetch_string(&columns, data, SL("_columns"), PH_NOISY);
} else {
PHALCON_INIT_NVAR(columns);
}
if (phalcon_array_isset_string(data, SS("_referencedColumns"))) {
PHALCON_OBS_VAR(referenced_columns);
phalcon_array_fetch_string(&referenced_columns, data, SL("_referencedColumns"), PH_NOISY);
} else {
PHALCON_INIT_NVAR(referenced_columns);
}
PHALCON_INIT_VAR(definition);
array_init_size(definition, 4);
phalcon_array_update_string(&definition, SL("referencedSchema"), &referenced_schema, PH_COPY | PH_SEPARATE);
phalcon_array_update_string(&definition, SL("referencedTable"), &referenced_table, PH_COPY | PH_SEPARATE);
phalcon_array_update_string(&definition, SL("columns"), &columns, PH_COPY | PH_SEPARATE);
phalcon_array_update_string(&definition, SL("referencedColumns"), &referenced_columns, PH_COPY | PH_SEPARATE);
object_init_ex(return_value, phalcon_db_reference_ce);
phalcon_call_method_p2_noret(return_value, "__construct", constraint_name, definition);
RETURN_MM();
}
开发者ID:11mariom,项目名称:cphalcon,代码行数:62,代码来源:reference.c
示例16: PHP_METHOD
/**
* Phalcon\Translate\Adapter\NativeArray constructor
*
* @param array $data
*/
PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, __construct){
zval *options = NULL, *data = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
eval_int = phalcon_array_isset_string(options, SL("content")+1);
if (eval_int) {
PHALCON_INIT_VAR(data);
phalcon_array_fetch_string(&data, options, SL("content"), PH_NOISY_CC);
if (Z_TYPE_P(data) != IS_ARRAY) {
PHALCON_THROW_EXCEPTION_STR(phalcon_translate_exception_ce, "Translation data must be an array");
return;
}
} else {
PHALCON_THROW_EXCEPTION_STR(phalcon_translate_exception_ce, "Translation content was not provided");
return;
}
phalcon_update_property_zval(this_ptr, SL("_translate"), data TSRMLS_CC);
PHALCON_MM_RESTORE();
}
开发者ID:kenjikobe,项目名称:cphalcon,代码行数:33,代码来源:nativearray.c
示例17: PHP_METHOD
/**
* Phalcon_Cache_Backend constructor
*
* @param mixed $frontendObject
* @param array $backendOptions
*/
PHP_METHOD(Phalcon_Cache_Backend, __construct){
zval *frontend_object = NULL, *backend_options = NULL;
zval *a0 = NULL;
zval *r0 = NULL;
int eval_int;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(a0);
array_init(a0);
zend_update_property(phalcon_cache_backend_ce, this_ptr, SL("_backendOptions"), a0 TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &frontend_object, &backend_options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
eval_int = phalcon_array_isset_string(backend_options, SL("prefix")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_array_fetch_string(&r0, backend_options, SL("prefix"), PHALCON_NOISY TSRMLS_CC);
phalcon_update_property_zval(this_ptr, SL("_prefix"), r0 TSRMLS_CC);
}
phalcon_update_property_zval(this_ptr, SL("_frontendObject"), frontend_object TSRMLS_CC);
phalcon_update_property_zval(this_ptr, SL("_backendOptions"), backend_options TSRMLS_CC);
PHALCON_MM_RESTORE();
}
开发者ID:rcpsec,项目名称:cphalcon,代码行数:35,代码来源:backend.c
示例18: PHP_METHOD
/**
* Phalcon\Translate\Adapter\NativeArray constructor
*
* @param array $options
*/
PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, __construct){
zval *options, *data;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &options);
if (Z_TYPE_P(options) != IS_ARRAY) {
PHALCON_THROW_EXCEPTION_STR(phalcon_translate_exception_ce, "Invalid options");
return;
}
if (!phalcon_array_isset_string(options, SS("content"))) {
PHALCON_THROW_EXCEPTION_STR(phalcon_translate_exception_ce, "Translation content was not provided");
return;
}
PHALCON_OBS_VAR(data);
phalcon_array_fetch_string(&data, options, SL("content"), PH_NOISY);
if (Z_TYPE_P(data) != IS_ARRAY) {
PHALCON_THROW_EXCEPTION_STR(phalcon_translate_exception_ce, "Translation data must be an array");
return;
}
phalcon_update_property_this(this_ptr, SL("_translate"), data TSRMLS_CC);
PHALCON_MM_RESTORE();
}
开发者ID:11mariom,项目名称:cphalcon,代码行数:33,代码来源:nativearray.c
示例19: PHP_METHOD
/**
* Phalcon\Cache\Backend constructor
*
* @param Phalcon\Cache\FrontendInterface $frontend
* @param array $options
*/
PHP_METHOD(Phalcon_Cache_Backend, __construct){
zval *frontend, *options = NULL, *prefix;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &frontend, &options);
if (!options) {
PHALCON_INIT_VAR(options);
}
if (Z_TYPE_P(frontend) != IS_OBJECT) {
PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "Frontend must be an Object");
return;
}
/**
* A common option is the prefix
*/
if (phalcon_array_isset_string(options, SS("prefix"))) {
PHALCON_OBS_VAR(prefix);
phalcon_array_fetch_string(&prefix, options, SL("prefix"), PH_NOISY_CC);
phalcon_update_property_this(this_ptr, SL("_prefix"), prefix TSRMLS_CC);
}
phalcon_update_property_this(this_ptr, SL("_frontend"), frontend TSRMLS_CC);
phalcon_update_property_this(this_ptr, SL("_options"), options TSRMLS_CC);
PHALCON_MM_RESTORE();
}
开发者ID:101010111100,项目名称:cphalcon,代码行数:37,代码来源:backend.c
示例20: PHP_METHOD
/**
* Restore a Phalcon\Http\Response\Headers object
*
* @param array $data
* @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;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &data);
PHALCON_INIT_VAR(headers);
object_init_ex(headers, phalcon_http_response_headers_ce);
if (phalcon_array_isset_string(data, SS("_headers"))) {
PHALCON_OBS_VAR(data_headers);
phalcon_array_fetch_string(&data_headers, data, SL("_headers"), PH_NOISY);
phalcon_is_iterable(data_headers, &ah0, &hp0, 0, 0);
while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
PHALCON_GET_HKEY(key, ah0, hp0);
PHALCON_GET_HVALUE(value);
phalcon_call_method_p2_noret(headers, "set", key, value);
zend_hash_move_forward_ex(ah0, &hp0);
}
}
RETURN_CTOR(headers);
}
开发者ID:11mariom,项目名称:cphalcon,代码行数:40,代码来源:headers.c
注:本文中的phalcon_array_isset_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论