本文整理汇总了C++中phalcon_get_global函数的典型用法代码示例。如果您正苦于以下问题:C++ phalcon_get_global函数的具体用法?C++ phalcon_get_global怎么用?C++ phalcon_get_global使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phalcon_get_global函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Checks whether request has been made using SOAP
*
* @return boolean
*/
PHP_METHOD(Phalcon_Request, isSoapRequested){
zval *g0 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
zval *c0 = NULL;
zval *t0 = NULL;
int eval_int;
PHALCON_MM_GROW();
phalcon_get_global(&g0, "_SERVER", sizeof("_SERVER") TSRMLS_CC);
eval_int = phalcon_array_isset_string(g0, "HTTP_SOAPACTION", strlen("HTTP_SOAPACTION")+1);
if (eval_int) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
} else {
eval_int = phalcon_array_isset_string(g0, "CONTENT_TYPE", strlen("CONTENT_TYPE")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_ALLOC_ZVAL_MM(r1);
phalcon_array_fetch_string(&r1, g0, "CONTENT_TYPE", strlen("CONTENT_TYPE"), PHALCON_NOISY TSRMLS_CC);
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, "application/soap+xml", 1);
PHALCON_CALL_FUNC_PARAMS_2(r0, "strpos", r1, c0, 0x00E);
PHALCON_INIT_VAR(t0);
ZVAL_BOOL(t0, 0);
PHALCON_INIT_VAR(r2);
is_not_identical_function(r2, t0, r0 TSRMLS_CC);
PHALCON_RETURN_NCTOR(r2);
}
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
开发者ID:loudertech,项目名称:cphalcon,代码行数:39,代码来源:request.c
示例2: PHP_METHOD
/**
* Gets HTTP header from request data
*
* @param string $header
* @return string
*/
PHP_METHOD(Phalcon_Http_Request, getHeader){
zval *header, *_SERVER, *server_value = NULL, *key;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &header) == FAILURE) {
RETURN_MM_NULL();
}
phalcon_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC);
if (phalcon_array_isset(_SERVER, header)) {
PHALCON_OBS_VAR(server_value);
phalcon_array_fetch(&server_value, _SERVER, header, PH_NOISY_CC);
RETURN_CCTOR(server_value);
} else {
PHALCON_INIT_VAR(key);
PHALCON_CONCAT_SV(key, "HTTP_", header);
if (phalcon_array_isset(_SERVER, key)) {
PHALCON_OBS_NVAR(server_value);
phalcon_array_fetch(&server_value, _SERVER, key, PH_NOISY_CC);
RETURN_CCTOR(server_value);
}
}
PHALCON_MM_RESTORE();
RETURN_EMPTY_STRING();
}
开发者ID:BlueShark,项目名称:cphalcon,代码行数:33,代码来源:request.c
示例3: PHP_METHOD
/**
* Check if a helper has a default value set using Phalcon\Tag::setDefault or value from $_POST
*
* @param string $name
* @return boolean
*/
PHP_METHOD(Phalcon_Tag, hasValue){
zval *name, *display_values, *_POST;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &name);
PHALCON_OBS_VAR(display_values);
phalcon_read_static_property(&display_values, SL("phalcon\\tag"), SL("_displayValues") TSRMLS_CC);
/**
* Check if there is a predefined value for it
*/
if (phalcon_array_isset(display_values, name)) {
RETURN_MM_TRUE;
} else {
/**
* Check if there is a post value for the item
*/
phalcon_get_global(&_POST, SS("_POST") TSRMLS_CC);
if (phalcon_array_isset(_POST, name)) {
RETURN_MM_TRUE;
}
}
RETURN_MM_FALSE;
}
开发者ID:angkatan21,项目名称:cphalcon,代码行数:34,代码来源:tag.c
示例4: PHP_METHOD
/**
* Gets HTTP header from request data
*
* @param string $header
* @return string
*/
PHP_METHOD(Phalcon_Http_Request, getHeader){
zval *header = NULL, *server_value = NULL, *key = NULL;
zval *g0 = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &header) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
phalcon_get_global(&g0, SL("_SERVER")+1 TSRMLS_CC);
eval_int = phalcon_array_isset(g0, header);
if (eval_int) {
PHALCON_INIT_VAR(server_value);
phalcon_array_fetch(&server_value, g0, header, PH_NOISY_CC);
RETURN_CCTOR(server_value);
} else {
PHALCON_INIT_VAR(key);
PHALCON_CONCAT_SV(key, "HTTP_", header);
eval_int = phalcon_array_isset(g0, key);
if (eval_int) {
PHALCON_INIT_VAR(server_value);
phalcon_array_fetch(&server_value, g0, key, PH_NOISY_CC);
RETURN_CCTOR(server_value);
}
}
PHALCON_MM_RESTORE();
RETURN_STRING("", 1);
}
开发者ID:meibk,项目名称:cphalcon,代码行数:40,代码来源:request.c
示例5: PHP_METHOD
/**
* Reads meta-data from $_SESSION
*
* @param string $key
* @return array
*/
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, read){
zval *key, *session = NULL, *_SESSION, *prefix, *prefix_key;
zval *meta_data;
zval *r0 = NULL, *r1 = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &key);
phalcon_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC);
PHALCON_CPY_WRT(session, _SESSION);
PHALCON_OBS_VAR(prefix);
phalcon_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC);
PHALCON_INIT_VAR(prefix_key);
PHALCON_CONCAT_SV(prefix_key, "$PMM$", prefix);
if (phalcon_array_isset(session, prefix_key)) {
PHALCON_OBS_VAR(r0);
phalcon_array_fetch(&r0, session, prefix_key, PH_NOISY_CC);
if (phalcon_array_isset(r0, key)) {
PHALCON_OBS_VAR(r1);
phalcon_array_fetch(&r1, session, prefix_key, PH_NOISY_CC);
PHALCON_OBS_VAR(meta_data);
phalcon_array_fetch(&meta_data, r1, key, PH_NOISY_CC);
RETURN_CCTOR(meta_data);
}
}
RETURN_MM_NULL();
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:39,代码来源:session.c
示例6: PHP_METHOD
/**
* Reads meta-data from $_SESSION
*
* @param string $key
* @return array
*/
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, read){
zval *key, *session, *prefix, *prefix_key;
zval *meta_data;
zval *r0, *r1 = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(0, 1, 0, &key);
session = phalcon_get_global(SL("_SESSION"));
prefix = phalcon_read_property(getThis(), SL("_prefix"), PH_NOISY);
PHALCON_INIT_VAR(prefix_key);
PHALCON_CONCAT_SV(prefix_key, "$PMM$", prefix);
if (phalcon_array_isset_fetch(&r0, session, prefix_key)) {
if (phalcon_array_isset(r0, key)) {
PHALCON_OBS_VAR(r1);
phalcon_array_fetch(&r1, session, prefix_key, PH_NOISY);
PHALCON_OBS_VAR(meta_data);
phalcon_array_fetch(&meta_data, r1, key, PH_NOISY);
RETURN_CCTOR(meta_data);
}
}
RETURN_MM_NULL();
}
开发者ID:Myleft,项目名称:cphalcon7,代码行数:35,代码来源:session.c
示例7: PHP_METHOD
/**
* Returns the prefix for all the generated urls. By default /
*
* @return string
*/
PHP_METHOD(Phalcon_Mvc_Url, getBaseUri){
zval *base_uri = NULL, *slash, *_SERVER, *php_self, *uri = NULL;
PHALCON_MM_GROW();
base_uri = phalcon_read_property(getThis(), SL("_baseUri"), PH_NOISY);
if (Z_TYPE_P(base_uri) == IS_NULL) {
PHALCON_INIT_VAR(slash);
ZVAL_STRING(slash, "/");
_SERVER = phalcon_get_global(SL("_SERVER"));
if (phalcon_array_isset_str_fetch(&php_self, _SERVER, SL("PHP_SELF"))) {
PHALCON_INIT_VAR(uri);
phalcon_get_uri(uri, php_self);
} else {
PHALCON_INIT_NVAR(uri);
}
if (!zend_is_true(uri)) {
PHALCON_CPY_WRT(base_uri, slash);
} else {
PHALCON_INIT_NVAR(base_uri);
PHALCON_CONCAT_VVV(base_uri, slash, uri, slash);
}
phalcon_update_property_this(getThis(), SL("_baseUri"), base_uri);
}
RETURN_CCTOR(base_uri);
}
开发者ID:Myleft,项目名称:cphalcon7,代码行数:36,代码来源:url.c
示例8: PHP_METHOD
/**
* Reads meta-data from $_SESSION
*
* @return array
*/
PHP_METHOD(Phalcon_Model_MetaData_Session, read){
zval *session = NULL, *key = NULL;
zval *g0 = NULL;
zval *r0 = NULL, *r1 = NULL;
zval *t0 = NULL;
zval *a0 = NULL;
int eval_int;
PHALCON_MM_GROW();
phalcon_get_global(&g0, "_SESSION", sizeof("_SESSION") TSRMLS_CC);
PHALCON_CPY_WRT(session, g0);
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, "_suffix", sizeof("_suffix")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CONCAT_SV(r0, "$PMM$", t0);
PHALCON_CPY_WRT(key, r0);
eval_int = phalcon_array_isset(session, key);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r1);
phalcon_array_fetch(&r1, session, key, PHALCON_NOISY TSRMLS_CC);
PHALCON_RETURN_CHECK_CTOR(r1);
}
PHALCON_INIT_VAR(a0);
array_init(a0);
PHALCON_RETURN_CTOR(a0);
}
开发者ID:andresgutierrez,项目名称:cphalcon,代码行数:37,代码来源:session.c
示例9: PHP_METHOD
/**
* Gets a session variable from an application context
*
* @param string $index
* @param mixed $defaultValue
* @return mixed
*/
PHP_METHOD(Phalcon_Session_Adapter, get){
zval *index, *default_value = NULL, *unique_id, *key, *_SESSION;
zval *value;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &index, &default_value) == FAILURE) {
RETURN_MM_NULL();
}
if (!default_value) {
PHALCON_INIT_VAR(default_value);
}
PHALCON_OBS_VAR(unique_id);
phalcon_read_property(&unique_id, this_ptr, SL("_uniqueId"), PH_NOISY_CC);
PHALCON_INIT_VAR(key);
PHALCON_CONCAT_VV(key, unique_id, index);
phalcon_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC);
if (phalcon_array_isset(_SESSION, key)) {
PHALCON_OBS_VAR(value);
phalcon_array_fetch(&value, _SESSION, key, PH_NOISY_CC);
if (PHALCON_IS_NOT_EMPTY(value)) {
RETURN_CCTOR(value);
}
}
RETURN_CCTOR(default_value);
}
开发者ID:BlueShark,项目名称:cphalcon,代码行数:40,代码来源:adapter.c
示例10: PHP_METHOD
/**
* Check whether a session variable is set in an application context
*
* @param string $index
*/
PHP_METHOD(Phalcon_Session, has){
zval *index = NULL, *unique_id = NULL, *key = NULL;
zval *g0 = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(unique_id);
phalcon_read_property(&unique_id, this_ptr, SL("_uniqueId"), PH_NOISY_CC);
PHALCON_INIT_VAR(key);
PHALCON_CONCAT_VV(key, unique_id, index);
phalcon_get_global(&g0, SL("_SESSION")+1 TSRMLS_CC);
eval_int = phalcon_array_isset(g0, key);
if (eval_int) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
开发者ID:meibk,项目名称:cphalcon,代码行数:33,代码来源:session.c
示例11: 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
示例12: phalcon_session_adapter_has_property_internal
static int phalcon_session_adapter_has_property_internal(zval *object, zval *member, int has_set_exists TSRMLS_DC)
{
zval *unique_id, *_SESSION, **tmp;
zval key = zval_used_for_init, *pkey = &key;
unique_id = phalcon_fetch_nproperty_this(object, SL("_uniqueId"), PH_NOISY TSRMLS_CC);
_SESSION = phalcon_get_global(SS("_SESSION") TSRMLS_CC);
if (Z_TYPE_P(_SESSION) != IS_ARRAY) {
return 0;
}
phalcon_concat_vv(&pkey, unique_id, member, 0 TSRMLS_CC);
tmp = phalcon_hash_get(Z_ARRVAL_P(_SESSION), pkey, BP_VAR_NA);
zval_dtor(&key);
if (!tmp) {
return 0;
}
if (0 == has_set_exists) {
return Z_TYPE_PP(tmp) != IS_NULL;
}
if (1 == has_set_exists) {
return zend_is_true(*tmp);
}
return 1;
}
开发者ID:Myleft,项目名称:cphalcon,代码行数:30,代码来源:adapter.c
示例13: PHP_METHOD
/**
* Returns the prefix for all the generated urls. By default /
*
* @return string
*/
PHP_METHOD(Phalcon_Mvc_Url, getBaseUri){
zval *base_uri = NULL, *slash, *one, *minus_one = NULL, *php_self;
zval *dirname, *dir_parts, *slice, *uri = NULL;
zval *g0 = NULL;
zval *c0 = NULL;
int eval_int;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(base_uri);
phalcon_read_property(&base_uri, this_ptr, SL("_baseUri"), PH_NOISY_CC);
if (Z_TYPE_P(base_uri) == IS_NULL) {
PHALCON_INIT_VAR(slash);
ZVAL_STRING(slash, "/", 1);
phalcon_get_global(&g0, SL("_SERVER")+1 TSRMLS_CC);
eval_int = phalcon_array_isset_string(g0, SS("PHP_SELF"));
if (eval_int) {
PHALCON_INIT_VAR(one);
ZVAL_LONG(one, 1);
PHALCON_INIT_VAR(c0);
ZVAL_LONG(c0, -1);
PHALCON_CPY_WRT(minus_one, c0);
PHALCON_INIT_VAR(php_self);
phalcon_array_fetch_string(&php_self, g0, SL("PHP_SELF"), PH_NOISY_CC);
PHALCON_INIT_VAR(dirname);
PHALCON_CALL_FUNC_PARAMS_1(dirname, "dirname", php_self);
PHALCON_INIT_VAR(dir_parts);
phalcon_fast_explode(dir_parts, slash, dirname TSRMLS_CC);
PHALCON_INIT_VAR(slice);
PHALCON_CALL_FUNC_PARAMS_3(slice, "array_slice", dir_parts, one, minus_one);
PHALCON_INIT_VAR(uri);
phalcon_fast_join(uri, slash, slice TSRMLS_CC);
} else {
PHALCON_INIT_NVAR(uri);
ZVAL_STRING(uri, "", 1);
}
if (PHALCON_COMPARE_STRING(uri, "")) {
PHALCON_CPY_WRT(base_uri, slash);
} else {
PHALCON_INIT_NVAR(base_uri);
PHALCON_CONCAT_VVV(base_uri, slash, uri, slash);
}
phalcon_update_property_zval(this_ptr, SL("_baseUri"), base_uri TSRMLS_CC);
}
RETURN_CCTOR(base_uri);
}
开发者ID:kenjiroy,项目名称:cphalcon,代码行数:62,代码来源:url.c
示例14: PHP_METHOD
/**
* Gets external uri where app is executed
*
* @return string
*/
PHP_METHOD(Phalcon_Controller_Front, getBaseUri){
zval *uri = NULL;
zval *t0 = NULL, *t1 = NULL, *t2 = NULL, *t3 = NULL;
zval *g0 = NULL;
zval *c0 = NULL, *c1 = NULL, *c2 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *r4 = NULL, *r5 = NULL, *r6 = NULL;
int eval_int;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, "_baseUri", sizeof("_baseUri")-1, PHALCON_NOISY TSRMLS_CC);
if (!zend_is_true(t0)) {
phalcon_get_global(&g0, "_SERVER", sizeof("_SERVER") TSRMLS_CC);
eval_int = phalcon_array_isset_string(g0, "PHP_SELF", strlen("PHP_SELF")+1);
if (eval_int) {
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, "/", 1);
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_INIT_VAR(c1);
ZVAL_STRING(c1, "/", 1);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_ALLOC_ZVAL_MM(r2);
phalcon_array_fetch_string(&r2, g0, "PHP_SELF", strlen("PHP_SELF"), PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_FUNC_PARAMS_1(r1, "dirname", r2, 0x049);
PHALCON_ALLOC_ZVAL_MM(r3);
phalcon_fast_explode(r3, c1, r1 TSRMLS_CC);
PHALCON_INIT_VAR(c2);
ZVAL_LONG(c2, 1);
PHALCON_INIT_VAR(t2);
ZVAL_LONG(t2, 1);
PHALCON_INIT_VAR(t1);
ZVAL_LONG(t1, -1);
PHALCON_ALLOC_ZVAL_MM(r4);
mul_function(r4, t1, t2 TSRMLS_CC);
PHALCON_CALL_FUNC_PARAMS_3(r0, "array_slice", r3, c2, r4, 0x01F);
PHALCON_ALLOC_ZVAL_MM(r5);
phalcon_fast_join(r5, c0, r0 TSRMLS_CC);
PHALCON_CPY_WRT(uri, r5);
} else {
PHALCON_INIT_VAR(uri);
ZVAL_STRING(uri, "", 1);
}
if (!zend_is_true(uri)) {
phalcon_update_property_string(this_ptr, "_baseUri", strlen("_baseUri"), "/" TSRMLS_CC);
} else {
PHALCON_ALLOC_ZVAL_MM(r6);
PHALCON_CONCAT_SVS(r6, "/", uri, "/");
phalcon_update_property_zval(this_ptr, "_baseUri", strlen("_baseUri"), r6 TSRMLS_CC);
}
}
PHALCON_ALLOC_ZVAL_MM(t3);
phalcon_read_property(&t3, this_ptr, "_baseUri", sizeof("_baseUri")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_RETURN_CHECK_CTOR(t3);
}
开发者ID:andresgutierrez,项目名称:cphalcon,代码行数:62,代码来源:front.c
示例15: PHP_METHOD
/**
* Gets external uri where app is executed
*
* @return string
*/
PHP_METHOD(Phalcon_Controller_Front, getBaseUri){
zval *base_uri = NULL, *slash = NULL, *uri = NULL;
zval *g0 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *r4 = NULL;
zval *c0 = NULL;
zval *t0 = NULL, *t1 = NULL;
int eval_int;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(base_uri);
phalcon_read_property(&base_uri, this_ptr, SL("_baseUri"), PH_NOISY_CC);
if (!zend_is_true(base_uri)) {
PHALCON_INIT_VAR(slash);
ZVAL_STRING(slash, "/", 1);
phalcon_get_global(&g0, SL("_SERVER")+1 TSRMLS_CC);
eval_int = phalcon_array_isset_string(g0, SL("PHP_SELF")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_array_fetch_string(&r0, g0, SL("PHP_SELF"), PH_NOISY_CC);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_CALL_FUNC_PARAMS_1(r1, "dirname", r0);
PHALCON_ALLOC_ZVAL_MM(r2);
phalcon_fast_explode(r2, slash, r1 TSRMLS_CC);
PHALCON_INIT_VAR(c0);
ZVAL_LONG(c0, 1);
PHALCON_INIT_VAR(t1);
ZVAL_LONG(t1, 1);
PHALCON_INIT_VAR(t0);
ZVAL_LONG(t0, -1);
PHALCON_ALLOC_ZVAL_MM(r3);
mul_function(r3, t0, t1 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(r4);
PHALCON_CALL_FUNC_PARAMS_3(r4, "array_slice", r2, c0, r3);
PHALCON_INIT_VAR(uri);
phalcon_fast_join(uri, slash, r4 TSRMLS_CC);
} else {
PHALCON_INIT_VAR(uri);
ZVAL_STRING(uri, "", 1);
}
if (!zend_is_true(uri)) {
PHALCON_CPY_WRT(base_uri, slash);
} else {
PHALCON_INIT_VAR(base_uri);
PHALCON_CONCAT_VVV(base_uri, slash, uri, slash);
}
phalcon_update_property_zval(this_ptr, SL("_baseUri"), base_uri TSRMLS_CC);
}
RETURN_CCTOR(base_uri);
}
开发者ID:codeanu,项目名称:cphalcon,代码行数:59,代码来源:front.c
示例16: PHP_METHOD
/**
* Checks whether $_GET superglobal has certain index
*
* @param string $name
* @return boolean
*/
PHP_METHOD(Phalcon_Http_Request, hasQuery){
zval *name, *_GET;
phalcon_fetch_params(0, 1, 0, &name);
phalcon_get_global(&_GET, SS("_GET") TSRMLS_CC);
if (phalcon_array_isset(_GET, name)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:18,代码来源:request.c
示例17: PHP_METHOD
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, reset)
{
zval prefix_key = zval_used_for_init, *pprefix = &prefix_key, *_SESSION;
zval *prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
phalcon_concat_sv(&pprefix, SL("$PMM$"), prefix, 0 TSRMLS_CC);
_SESSION = phalcon_get_global(SS("_SESSION") TSRMLS_CC);
phalcon_array_unset(&_SESSION, &prefix_key, 0);
zval_dtor(&prefix_key);
PHALCON_CALL_PARENTW(NULL, phalcon_mvc_model_metadata_session_ce, getThis(), "reset");
}
开发者ID:100851766,项目名称:cphalcon,代码行数:12,代码来源:session.c
示例18: PHP_METHOD
/**
* Gets variable from $_POST superglobal applying filters if needed
*
* @param string $name
* @param string|array $filters
* @return mixed
*/
PHP_METHOD(Phalcon_Http_Request, getPost){
zval *name = NULL, *filters = NULL, *value = NULL, *dependency_injector = NULL;
zval *filter = NULL, *sanitized_value = NULL;
zval *g0 = NULL;
zval *c0 = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &name, &filters) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!filters) {
PHALCON_ALLOC_ZVAL_MM(filters);
ZVAL_NULL(filters);
}
phalcon_get_global(&g0, SL("_POST")+1 TSRMLS_CC);
eval_int = phalcon_array_isset(g0, name);
if (eval_int) {
PHALCON_INIT_VAR(value);
phalcon_array_fetch(&value, g0, name, PH_NOISY_CC);
if (zend_is_true(filters)) {
PHALCON_INIT_VAR(dependency_injector);
phalcon_read_property(&dependency_injector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);
if (!zend_is_true(dependency_injector)) {
PHALCON_THROW_EXCEPTION_STR(phalcon_http_request_exception_ce, "A dependency injection object is required to access the 'filter' service");
return;
}
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, "filter", 1);
PHALCON_INIT_VAR(filter);
PHALCON_CALL_METHOD_PARAMS_1(filter, dependency_injector, "getshared", c0, PH_NO_CHECK);
PHALCON_INIT_VAR(sanitized_value);
PHALCON_CALL_METHOD_PARAMS_2(sanitized_value, filter, "sanitize", value, filters, PH_NO_CHECK);
RETURN_CCTOR(sanitized_value);
} else {
RETURN_CCTOR(value);
}
}
PHALCON_MM_RESTORE();
RETURN_NULL();
}
开发者ID:codeanu,项目名称:cphalcon,代码行数:58,代码来源:request.c
示例19: PHP_METHOD
/**
* Every helper calls this function to check whether a component has a predefined
* value using Phalcon\Tag::setDefault or value from $_POST
*
* @param string $name
* @return mixed
*/
PHP_METHOD(Phalcon_Tag, getValue){
zval *name = NULL, *display_values = NULL, *default_value = NULL;
zval *post = NULL, *le_post_name = NULL, *have_magic_quotes = NULL;
zval *post_name = NULL, *striped = NULL;
zval *g0 = NULL;
int eval_int;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &name) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_OBSERVE_VAR(display_values);
phalcon_read_static_property(&display_values, SL("phalcon\\tag"), SL("_displayValues") TSRMLS_CC);
eval_int = phalcon_array_isset(display_values, name);
if (eval_int) {
PHALCON_INIT_VAR(default_value);
phalcon_array_fetch(&default_value, display_values, name, PH_NOISY_CC);
RETURN_CCTOR(default_value);
} else {
phalcon_get_global(&g0, SL("_POST")+1 TSRMLS_CC);
PHALCON_CPY_WRT(post, g0);
eval_int = phalcon_array_isset(post, name);
if (eval_int) {
PHALCON_INIT_VAR(le_post_name);
phalcon_array_fetch(&le_post_name, post, name, PH_NOISY_CC);
PHALCON_INIT_VAR(have_magic_quotes);
PHALCON_CALL_FUNC(have_magic_quotes, "get_magic_quotes_gpc");
if (!zend_is_true(have_magic_quotes)) {
PHALCON_CPY_WRT(post_name, le_post_name);
RETURN_CCTOR(post_name);
} else {
PHALCON_INIT_VAR(striped);
PHALCON_CALL_FUNC_PARAMS_1(striped, "stripslashes", le_post_name);
RETURN_CCTOR(striped);
}
}
}
PHALCON_MM_RESTORE();
}
开发者ID:meibk,项目名称:cphalcon,代码行数:55,代码来源:tag.c
注:本文中的phalcon_get_global函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论