本文整理汇总了C++中zephir_update_property_zval函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_update_property_zval函数的具体用法?C++ zephir_update_property_zval怎么用?C++ zephir_update_property_zval使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zephir_update_property_zval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Sets a prefix for all the URIs to be generated
*
*<code>
* $url->setBaseUri("/invo/");
*
* $url->setBaseUri("/invo/index.php/");
*</code>
*/
PHP_METHOD(Phalcon_Mvc_Url, setBaseUri) {
zval *baseUri_param = NULL, _0;
zval baseUri;
zval *this_ptr = getThis();
ZVAL_UNDEF(&baseUri);
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &baseUri_param);
if (UNEXPECTED(Z_TYPE_P(baseUri_param) != IS_STRING && Z_TYPE_P(baseUri_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'baseUri' must be of the type string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(baseUri_param) == IS_STRING)) {
zephir_get_strval(&baseUri, baseUri_param);
} else {
ZEPHIR_INIT_VAR(&baseUri);
ZVAL_EMPTY_STRING(&baseUri);
}
zephir_update_property_zval(this_ptr, SL("baseUri"), &baseUri);
zephir_read_property(&_0, this_ptr, SL("staticBaseUri"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_0) == IS_NULL) {
zephir_update_property_zval(this_ptr, SL("staticBaseUri"), &baseUri);
}
RETURN_THIS();
}
示例2: PHP_METHOD
PHP_METHOD(Test_Oo_PropertyAccess, __construct) {
zval *test, *test1, *_0, *_1, *_2, *_3, *_4, *_5, *_6, *_7 = NULL, *_8, *_9;
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(test);
object_init(test);
ZEPHIR_INIT_VAR(_0);
array_init_size(_0, 6);
ZEPHIR_INIT_VAR(_1);
ZVAL_LONG(_1, 1);
zephir_array_fast_append(_0, _1);
ZEPHIR_INIT_BNVAR(_1);
ZVAL_LONG(_1, 2);
zephir_array_fast_append(_0, _1);
ZEPHIR_INIT_BNVAR(_1);
ZVAL_LONG(_1, 3);
zephir_array_fast_append(_0, _1);
ZEPHIR_INIT_BNVAR(_1);
ZVAL_LONG(_1, 5);
zephir_array_fast_append(_0, _1);
ZEPHIR_INIT_BNVAR(_1);
ZVAL_DOUBLE(_1, 6.00);
zephir_array_fast_append(_0, _1);
zephir_update_property_zval(test, SL("test"), _0 TSRMLS_CC);
ZEPHIR_OBS_VAR(_2);
zephir_read_property(&_2, test, SL("test"), PH_NOISY_CC);
zephir_array_fetch_long(&_3, _2, 0, PH_NOISY | PH_READONLY TSRMLS_CC);
zephir_update_property_zval(test, SL("test2"), _3 TSRMLS_CC);
ZEPHIR_OBS_VAR(_4);
zephir_read_property(&_4, test, SL("test"), PH_NOISY_CC);
zephir_array_fetch_long(&_5, _4, 1, PH_NOISY | PH_READONLY TSRMLS_CC);
zephir_update_property_zval(test, SL("test3"), _5 TSRMLS_CC);
ZEPHIR_INIT_BNVAR(_1);
array_init_size(_1, 5);
ZEPHIR_OBS_VAR(_6);
zephir_read_property(&_6, test, SL("test"), PH_NOISY_CC);
ZEPHIR_OBS_VAR(_7);
zephir_array_fetch_long(&_7, _6, 1, PH_NOISY TSRMLS_CC);
zephir_array_fast_append(_1, _7);
ZEPHIR_INIT_VAR(_8);
ZVAL_LONG(_8, 1);
zephir_array_fast_append(_1, _8);
ZEPHIR_INIT_BNVAR(_8);
ZVAL_LONG(_8, 2);
zephir_array_fast_append(_1, _8);
ZEPHIR_INIT_BNVAR(_8);
ZVAL_LONG(_8, 3);
zephir_array_fast_append(_1, _8);
zephir_update_property_zval(test, SL("test3"), _1 TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("a"), test TSRMLS_CC);
_9 = zephir_fetch_nproperty_this(this_ptr, SL("a"), PH_NOISY_CC);
ZEPHIR_OBS_NVAR(_7);
zephir_read_property(&_7, _9, SL("test2"), PH_NOISY_CC);
zephir_update_property_this(this_ptr, SL("b"), _7 TSRMLS_CC);
test1 = zephir_fetch_nproperty_this(this_ptr, SL("a"), PH_NOISY_CC);
ZEPHIR_MM_RESTORE();
}
示例3: PHP_METHOD
/**
* Phalcon\Di\Service
*
* @param mixed definition
*/
PHP_METHOD(Phalcon_Di_Service, __construct) {
zend_bool shared;
zval *definition, definition_sub, *shared_param = NULL, __$true, __$false;
zval *this_ptr = getThis();
ZVAL_UNDEF(&definition_sub);
ZVAL_BOOL(&__$true, 1);
ZVAL_BOOL(&__$false, 0);
zephir_fetch_params(0, 1, 1, &definition, &shared_param);
if (!shared_param) {
shared = 0;
} else {
shared = zephir_get_boolval(shared_param);
}
zephir_update_property_zval(this_ptr, SL("_definition"), definition);
if (shared) {
zephir_update_property_zval(this_ptr, SL("_shared"), &__$true);
} else {
zephir_update_property_zval(this_ptr, SL("_shared"), &__$false);
}
}
示例4: PHP_METHOD
/**
* Sets the intermediate model data for has-*-through relations
*
* @param string|array intermediateFields
* @param string intermediateReferencedFields
*/
PHP_METHOD(Phalcon_Mvc_Model_Relation, setIntermediateRelation) {
zval intermediateModel;
zval *intermediateFields, intermediateFields_sub, *intermediateModel_param = NULL, *intermediateReferencedFields, intermediateReferencedFields_sub;
zval *this_ptr = getThis();
ZVAL_UNDEF(&intermediateFields_sub);
ZVAL_UNDEF(&intermediateReferencedFields_sub);
ZVAL_UNDEF(&intermediateModel);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 3, 0, &intermediateFields, &intermediateModel_param, &intermediateReferencedFields);
if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(intermediateModel_param) == IS_STRING)) {
zephir_get_strval(&intermediateModel, intermediateModel_param);
} else {
ZEPHIR_INIT_VAR(&intermediateModel);
ZVAL_EMPTY_STRING(&intermediateModel);
}
zephir_update_property_zval(this_ptr, SL("_intermediateFields"), intermediateFields);
zephir_update_property_zval(this_ptr, SL("_intermediateModel"), &intermediateModel);
zephir_update_property_zval(this_ptr, SL("_intermediateReferencedFields"), intermediateReferencedFields);
ZEPHIR_MM_RESTORE();
}
示例5: PHP_METHOD
PHP_METHOD(Owl_Router_Router, add) {
int ZEPHIR_LAST_CALL_STATUS;
zend_bool _2;
zval *parameters = NULL;
zval *uri_param = NULL, *parameters_param = NULL, *method_param = NULL, *route, _0, *_1, _3, *_4;
zval *uri = NULL, *method = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 2, &uri_param, ¶meters_param, &method_param);
zephir_get_strval(uri, uri_param);
if (!parameters_param) {
ZEPHIR_INIT_VAR(parameters);
array_init(parameters);
} else {
parameters = parameters_param;
}
if (!method_param) {
ZEPHIR_INIT_VAR(method);
ZVAL_STRING(method, "GET", 1);
} else {
zephir_get_strval(method, method_param);
}
ZEPHIR_SINIT_VAR(_0);
ZVAL_STRING(&_0, "{", 0);
ZEPHIR_INIT_VAR(_1);
zephir_fast_strpos(_1, uri, &_0, 0 );
_2 = ZEPHIR_IS_FALSE_IDENTICAL(_1);
if (_2) {
ZEPHIR_SINIT_VAR(_3);
ZVAL_STRING(&_3, ":", 0);
ZEPHIR_INIT_VAR(_4);
zephir_fast_strpos(_4, uri, &_3, 0 );
_2 = ZEPHIR_IS_FALSE_IDENTICAL(_4);
}
ZEPHIR_INIT_VAR(route);
if (_2) {
object_init_ex(route, owl_router_http_staticroute_ce);
ZEPHIR_CALL_METHOD(NULL, route, "__construct", NULL, 27, uri);
zephir_check_call_status();
} else {
object_init_ex(route, owl_router_http_dynamicroute_ce);
ZEPHIR_CALL_METHOD(NULL, route, "__construct", NULL, 28, uri);
zephir_check_call_status();
}
zephir_update_property_zval(route, SL("method"), method TSRMLS_CC);
zephir_update_property_zval(route, SL("parameters"), parameters TSRMLS_CC);
zephir_update_property_array_append(this_ptr, SL("routers"), route TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例6: PHP_METHOD
/**
* Initializes the session bag. This method must not be called directly, the
* class calls it when its internal data is accessed
*/
PHP_METHOD(Phalcon_Session_Bag, initialize) {
zval __$true, __$false, session, dependencyInjector, data, _2, _1$$3;
zend_long ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_0 = NULL;
zval *this_ptr = getThis();
ZVAL_BOOL(&__$true, 1);
ZVAL_BOOL(&__$false, 0);
ZVAL_UNDEF(&session);
ZVAL_UNDEF(&dependencyInjector);
ZVAL_UNDEF(&data);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_1$$3);
ZEPHIR_MM_GROW();
ZEPHIR_OBS_VAR(&session);
zephir_read_property(&session, this_ptr, SL("_session"), PH_NOISY_CC);
if (Z_TYPE_P(&session) != IS_OBJECT) {
ZEPHIR_OBS_VAR(&dependencyInjector);
zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);
if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) {
ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0);
zephir_check_call_status();
if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "A dependency injection object is required to access the 'session' service", "phalcon/session/bag.zep", 212);
return;
}
}
ZEPHIR_INIT_VAR(&_1$$3);
ZVAL_STRING(&_1$$3, "session");
ZEPHIR_CALL_METHOD(&session, &dependencyInjector, "getshared", NULL, 0, &_1$$3);
zephir_check_call_status();
zephir_update_property_zval(this_ptr, SL("_session"), &session);
}
zephir_read_property(&_2, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY);
ZEPHIR_CALL_METHOD(&data, &session, "get", NULL, 0, &_2);
zephir_check_call_status();
if (Z_TYPE_P(&data) != IS_ARRAY) {
ZEPHIR_INIT_NVAR(&data);
array_init(&data);
}
zephir_update_property_zval(this_ptr, SL("_data"), &data);
if (1) {
zephir_update_property_zval(this_ptr, SL("_initialized"), &__$true);
} else {
zephir_update_property_zval(this_ptr, SL("_initialized"), &__$false);
}
ZEPHIR_MM_RESTORE();
}
示例7: PHP_METHOD
/**
* Return the strategy to obtain the meta-data
*/
PHP_METHOD(Phalcon_Mvc_Model_MetaData, getStrategy) {
zval _0, _1$$3;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1$$3);
ZEPHIR_MM_GROW();
ZEPHIR_OBS_VAR(&_0);
zephir_read_property(&_0, this_ptr, SL("_strategy"), PH_NOISY_CC);
if (Z_TYPE_P(&_0) == IS_NULL) {
ZEPHIR_INIT_VAR(&_1$$3);
object_init_ex(&_1$$3, phalcon_mvc_model_metadata_strategy_introspection_ce);
if (zephir_has_constructor(&_1$$3 TSRMLS_CC)) {
ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0);
zephir_check_call_status();
}
zephir_update_property_zval(this_ptr, SL("_strategy"), &_1$$3);
}
RETURN_MM_MEMBER(getThis(), "_strategy");
}
示例8: zephir_unset_property_array
/**
* Unsets an index in an array property
*/
int zephir_unset_property_array(zval *object, char *property, unsigned int property_length, zval *index)
{
zval tmp;
int separated = 0;
if (Z_TYPE_P(object) == IS_OBJECT) {
zephir_read_property(&tmp, object, property, property_length, PH_NOISY_CC);
Z_TRY_DELREF(tmp);
/** Separation only when refcount > 1 */
if (Z_REFCOUNTED(tmp) && Z_REFCOUNT(tmp) > 1) {
if (!Z_ISREF(tmp)) {
zval new_zv;
ZVAL_DUP(&new_zv, &tmp);
ZVAL_COPY_VALUE(&tmp, &new_zv);
Z_TRY_DELREF(new_zv);
separated = 1;
}
}
zephir_array_unset(&tmp, index, PH_SEPARATE);
if (separated) {
zephir_update_property_zval(object, property, property_length, &tmp);
}
}
return SUCCESS;
}
示例9: PHP_METHOD
PHP_METHOD(PhalconPlus_Logger_Formatter_LinePlus, __construct) {
zval *formatString_param = NULL;
zval formatString;
zval *this_ptr = getThis();
ZVAL_UNDEF(&formatString);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &formatString_param);
if (UNEXPECTED(Z_TYPE_P(formatString_param) != IS_STRING && Z_TYPE_P(formatString_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'formatString' must be of the type string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(formatString_param) == IS_STRING)) {
zephir_get_strval(&formatString, formatString_param);
} else {
ZEPHIR_INIT_VAR(&formatString);
ZVAL_EMPTY_STRING(&formatString);
}
if (!(ZEPHIR_IS_EMPTY(&formatString))) {
zephir_update_property_zval(this_ptr, SL("formatString"), &formatString);
}
ZEPHIR_MM_RESTORE();
}
示例10: PHP_METHOD
PHP_METHOD(Test_Oo_DynamicProp, setExistingStringPropertyString) {
zval *value_param = NULL;
zval *value = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &value_param);
if (unlikely(Z_TYPE_P(value_param) != IS_STRING && Z_TYPE_P(value_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'value' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(value_param) == IS_STRING)) {
zephir_get_strval(value, value_param);
} else {
ZEPHIR_INIT_VAR(value);
ZVAL_EMPTY_STRING(value);
}
zephir_update_property_zval(this_ptr, SL("eproperty"), value TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例11: PHP_METHOD
PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableInt) {
int a = 10;
zval *property_param = NULL, *_0;
zval *property = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &property_param);
if (unlikely(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (unlikely(Z_TYPE_P(property_param) == IS_STRING)) {
property = property_param;
} else {
ZEPHIR_INIT_VAR(property);
ZVAL_EMPTY_STRING(property);
}
ZEPHIR_INIT_VAR(_0);
ZVAL_LONG(_0, a);
zephir_update_property_zval(this_ptr, Z_STRVAL_P(property), Z_STRLEN_P(property), _0 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例12: PHP_METHOD
/**
* Test\Router\Route constructor
*
* @param string pattern
* @param array paths
* @param array|string httpMethods
*/
PHP_METHOD(Test_Router_Route, __construct) {
int ZEPHIR_LAST_CALL_STATUS;
zval *pattern, pattern_sub, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null;
ZEPHIR_INIT_THIS();
ZVAL_UNDEF(&pattern_sub);
ZVAL_UNDEF(&paths_sub);
ZVAL_UNDEF(&httpMethods_sub);
ZVAL_NULL(&__$null);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 2, &pattern, &paths, &httpMethods);
if (!paths) {
paths = &paths_sub;
paths = &__$null;
}
if (!httpMethods) {
httpMethods = &httpMethods_sub;
httpMethods = &__$null;
}
ZEPHIR_CALL_METHOD(NULL, this_ptr, "reconfigure", NULL, 0, pattern, paths);
zephir_check_call_status();
zephir_update_property_zval(this_ptr, SL("_methods"), httpMethods);
ZEPHIR_MM_RESTORE();
}
示例13: PHP_METHOD
/**
* @link https://github.com/phalcon/zephir/issues/915
*/
PHP_METHOD(Test_Exception, testRuntimePropertyFetch) {
zval *message_param = NULL;
zval message;
zval *this_ptr = getThis();
ZVAL_UNDEF(&message);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &message_param);
if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) {
zephir_get_strval(&message, message_param);
} else {
ZEPHIR_INIT_VAR(&message);
ZVAL_EMPTY_STRING(&message);
}
zephir_update_property_zval(this_ptr, SL("message"), &message);
ZEPHIR_MM_RESTORE();
}
示例14: PHP_METHOD
PHP_METHOD(PhalconPlus_Base_ProtoOrderBy, setProperty) {
zval *property_param = NULL;
zval property;
zval *this_ptr = getThis();
ZVAL_UNDEF(&property);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &property_param);
if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) {
zephir_get_strval(&property, property_param);
} else {
ZEPHIR_INIT_VAR(&property);
ZVAL_EMPTY_STRING(&property);
}
zephir_update_property_zval(this_ptr, SL("property"), &property);
ZEPHIR_MM_RESTORE();
}
示例15: PHP_METHOD
/**
* Phalcon\Logger\Formatter\Json construct
*
* @param string dateFormat
*/
PHP_METHOD(Phalcon_Logger_Formatter_Json, __construct) {
zval *dateFormat_param = NULL;
zval dateFormat;
zval *this_ptr = getThis();
ZVAL_UNDEF(&dateFormat);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &dateFormat_param);
if (!dateFormat_param) {
ZEPHIR_INIT_VAR(&dateFormat);
ZVAL_STRING(&dateFormat, "");
} else {
zephir_get_strval(&dateFormat, dateFormat_param);
}
if (!(Z_TYPE_P(&dateFormat) == IS_UNDEF) && Z_STRLEN_P(&dateFormat)) {
zephir_update_property_zval(this_ptr, SL("dateFormat"), &dateFormat);
}
ZEPHIR_MM_RESTORE();
}