当前位置: 首页>>代码示例>>C++>>正文


C++ zephir_get_boolval函数代码示例

本文整理汇总了C++中zephir_get_boolval函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_get_boolval函数的具体用法?C++ zephir_get_boolval怎么用?C++ zephir_get_boolval使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了zephir_get_boolval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PHP_METHOD

/**
 * Destroys the active session
 *
 *<code>
 *	var_dump($session->destroy());
 *	var_dump($session->destroy(true));
 *</code>
 */
PHP_METHOD(Phalcon_Session_Adapter, destroy) {

    HashTable *_2$$4;
    HashPosition _1$$4;
    int ZEPHIR_LAST_CALL_STATUS;
    zval *removeData_param = NULL, *_SESSION = NULL, *uniqueId = NULL, *key = NULL, *_0$$4 = NULL, **_3$$4, *_4$$5 = NULL;
    zend_bool removeData;

    ZEPHIR_MM_GROW();
    zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC);
    zephir_fetch_params(1, 0, 1, &removeData_param);

    if (!removeData_param) {
        removeData = 0;
    } else {
        removeData = zephir_get_boolval(removeData_param);
    }


    if (removeData) {
        ZEPHIR_OBS_VAR(uniqueId);
        zephir_read_property_this(&uniqueId, this_ptr, SL("_uniqueId"), PH_NOISY_CC);
        if (!(ZEPHIR_IS_EMPTY(uniqueId))) {
            ZEPHIR_INIT_VAR(_0$$4);
            zephir_is_iterable(_SESSION, &_2$$4, &_1$$4, 1, 0, "phalcon/session/adapter.zep", 262);
            for (
              ; zephir_hash_get_current_data_ex(_2$$4, (void**) &_3$$4, &_1$$4) == SUCCESS
              ; zephir_hash_move_forward_ex(_2$$4, &_1$$4)
            ) {
                ZEPHIR_GET_HMKEY(key, _2$$4, _1$$4);
                ZEPHIR_GET_HVALUE(_0$$4, _3$$4);
                ZEPHIR_INIT_LNVAR(_4$$5);
                ZEPHIR_CONCAT_VS(_4$$5, uniqueId, "#");
                if (zephir_start_with(key, _4$$5, NULL)) {
                    zephir_array_unset(&_SESSION, key, PH_SEPARATE);
                }
            }
            zend_hash_destroy(_2$$4);
            FREE_HASHTABLE(_2$$4);
        } else {
            ZEPHIR_INIT_NVAR(_SESSION);
            array_init(_SESSION);
        }
    }
    if (0) {
        zephir_update_property_this(this_ptr, SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC);
    } else {
        zephir_update_property_this(this_ptr, SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
    }
    ZEPHIR_RETURN_CALL_FUNCTION("session_destroy", NULL, 32);
    zephir_check_call_status();
    RETURN_MM();

}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:62,代码来源:adapter.zep.c

示例2: PHP_METHOD

PHP_METHOD(Test_TryTest, testTry6) {

    int ZEPHIR_LAST_CALL_STATUS;
    zval *a_param = NULL, *e = NULL, *_0 = NULL, *_1 = NULL;
    zend_bool a;

    ZEPHIR_MM_GROW();
    zephir_fetch_params(1, 1, 0, &a_param);

    a = zephir_get_boolval(a_param);



    /* try_start_1: */

        if (a) {
            ZEPHIR_INIT_VAR(_0);
            object_init_ex(_0, zend_exception_get_default(TSRMLS_C));
            ZEPHIR_INIT_VAR(_1);
            ZVAL_STRING(_1, "error!", 0);
            ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, _1);
            zephir_check_temp_parameter(_1);
            zephir_check_call_status_or_jump(try_end_1);
            zephir_throw_exception(_0 TSRMLS_CC);
            goto try_end_1;

        } else {
            ZEPHIR_INIT_LNVAR(_0);
            object_init_ex(_0, spl_ce_RuntimeException);
            ZEPHIR_INIT_NVAR(_1);
            ZVAL_STRING(_1, "error!", 0);
            ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, _1);
            zephir_check_temp_parameter(_1);
            zephir_check_call_status_or_jump(try_end_1);
            zephir_throw_exception(_0 TSRMLS_CC);
            goto try_end_1;

        }

    try_end_1:

    ZEPHIR_CPY_WRT(e, EG(exception));
    if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) {
        zend_clear_exception(TSRMLS_C);
        RETURN_MM_STRING("domain error", 1);
    }
    ZEPHIR_CPY_WRT(e, EG(exception));
    if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) {
        zend_clear_exception(TSRMLS_C);
        RETURN_MM_STRING("error", 1);
    }
    RETURN_MM_BOOL(0);

}
开发者ID:javierfortea,项目名称:zephir,代码行数:54,代码来源:trytest.c

示例3: PHP_METHOD

/**
 * Adds a CSS resource to the collection
 */
PHP_METHOD(Phalcon_Assets_Collection, addCss) {

    int ZEPHIR_LAST_CALL_STATUS;
    zend_bool filter;
    zval *path_param = NULL, *local = NULL, *filter_param = NULL, *attributes = NULL, *collectionLocal = NULL, *collectionAttributes = NULL, *_0;
    zval *path = NULL;

    ZEPHIR_MM_GROW();
    zephir_fetch_params(1, 1, 3, &path_param, &local, &filter_param, &attributes);

    if (unlikely(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) {
        zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC);
        RETURN_MM_NULL();
    }

    if (likely(Z_TYPE_P(path_param) == IS_STRING)) {
        zephir_get_strval(path, path_param);
    } else {
        ZEPHIR_INIT_VAR(path);
        ZVAL_EMPTY_STRING(path);
    }
    if (!local) {
        local = ZEPHIR_GLOBAL(global_null);
    }
    if (!filter_param) {
        filter = 1;
    } else {
        filter = zephir_get_boolval(filter_param);
    }
    if (!attributes) {
        attributes = ZEPHIR_GLOBAL(global_null);
    }


    if (Z_TYPE_P(local) == IS_BOOL) {
        ZEPHIR_CPY_WRT(collectionLocal, local);
    } else {
        ZEPHIR_OBS_NVAR(collectionLocal);
        zephir_read_property_this(&collectionLocal, this_ptr, SL("_local"), PH_NOISY_CC);
    }
    if (Z_TYPE_P(attributes) == IS_ARRAY) {
        ZEPHIR_CPY_WRT(collectionAttributes, attributes);
    } else {
        ZEPHIR_OBS_NVAR(collectionAttributes);
        zephir_read_property_this(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC);
    }
    ZEPHIR_INIT_VAR(_0);
    object_init_ex(_0, phalcon_assets_resource_css_ce);
    ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 92, path, collectionLocal, (filter ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)), collectionAttributes);
    zephir_check_call_status();
    zephir_update_property_array_append(this_ptr, SL("_resources"), _0 TSRMLS_CC);
    RETURN_THIS();

}
开发者ID:brainformatik,项目名称:cphalcon,代码行数:57,代码来源:collection.zep.c

示例4: PHP_METHOD

/**
 * Test\Router constructor
 *
 * @param boolean defaultRoutes
 */
PHP_METHOD(Test_Router, __construct) {

    zephir_fcall_cache_entry *_3 = NULL;
    int ZEPHIR_LAST_CALL_STATUS;
    zval *_1, *_5;
    zval *defaultRoutes_param = NULL, *routes, *_0, *_2 = NULL, *_4;
    zend_bool defaultRoutes;

    ZEPHIR_MM_GROW();
    zephir_fetch_params(1, 0, 1, &defaultRoutes_param);

    if (!defaultRoutes_param) {
        defaultRoutes = 1;
    } else {
        defaultRoutes = zephir_get_boolval(defaultRoutes_param);
    }


    ZEPHIR_INIT_VAR(routes);
    array_init(routes);
    if ((defaultRoutes == 1)) {
        ZEPHIR_INIT_VAR(_0);
        object_init_ex(_0, test_router_route_ce);
        ZEPHIR_INIT_VAR(_1);
        array_init_size(_1, 2);
        add_assoc_long_ex(_1, SS("controller"), 1);
        ZEPHIR_INIT_VAR(_2);
        ZVAL_STRING(_2, "#^/([a-zA-Z0-9\\_\\-]+)[/]{0,1}$#", 0);
        ZEPHIR_CALL_METHOD(NULL, _0, "__construct", &_3, _2, _1);
        zephir_check_temp_parameter(_2);
        zephir_check_call_status();
        zephir_array_append(&routes, _0, PH_SEPARATE);
        ZEPHIR_INIT_VAR(_4);
        object_init_ex(_4, test_router_route_ce);
        ZEPHIR_INIT_VAR(_5);
        array_init_size(_5, 5);
        add_assoc_long_ex(_5, SS("controller"), 1);
        add_assoc_long_ex(_5, SS("action"), 2);
        add_assoc_long_ex(_5, SS("params"), 3);
        ZEPHIR_INIT_NVAR(_2);
        ZVAL_STRING(_2, "#^/([a-zA-Z0-9\\_\\-]+)/([a-zA-Z0-9\\.\\_]+)(/.*)*$#", 0);
        ZEPHIR_CALL_METHOD(NULL, _4, "__construct", &_3, _2, _5);
        zephir_check_temp_parameter(_2);
        zephir_check_call_status();
        zephir_array_append(&routes, _4, PH_SEPARATE);
    }
    ZEPHIR_INIT_NVAR(_2);
    array_init(_2);
    zephir_update_property_this(this_ptr, SL("_params"), _2 TSRMLS_CC);
    zephir_update_property_this(this_ptr, SL("_routes"), routes TSRMLS_CC);
    ZEPHIR_MM_RESTORE();

}
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:58,代码来源:router.c

示例5: PHP_METHOD

/**
 * Tells the event manager if it needs to collect all the responses returned by every
 * registered listener in a single fire
 *
 * @param boolean collect
 */
PHP_METHOD(Phalcon_Events_Manager, collectResponses) {

    zval *collect_param = NULL;
    zend_bool collect;

    zephir_fetch_params(0, 1, 0, &collect_param);

    collect = zephir_get_boolval(collect_param);


    zephir_update_property_this(this_ptr, SL("_collect"), collect ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);

}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:19,代码来源:manager.zep.c

示例6: PHP_METHOD

/**
 * Sets flag to rollback on abort the HTTP connection
 */
PHP_METHOD(Phalcon_Mvc_Model_Transaction, setRollbackOnAbort) {

    zval *rollbackOnAbort_param = NULL;
    zend_bool rollbackOnAbort;

    zephir_fetch_params(0, 1, 0, &rollbackOnAbort_param);

    rollbackOnAbort = zephir_get_boolval(rollbackOnAbort_param);


    zephir_update_property_this(this_ptr, SL("_rollbackOnAbort"), rollbackOnAbort ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);

}
开发者ID:AndrewUshchenko,项目名称:cphalcon,代码行数:16,代码来源:transaction.zep.c

示例7: PHP_METHOD

PHP_METHOD(Test_Oo_OoParams, setStrictEnabled) {

    zval *enabled_param = NULL;
    zend_bool enabled;

    zephir_fetch_params(0, 1, 0, &enabled_param);

    enabled = zephir_get_boolval(enabled_param);


    RETURN_BOOL(enabled);

}
开发者ID:KorsaR-ZN,项目名称:zephir,代码行数:13,代码来源:ooparams.zep.c

示例8: PHP_METHOD

/**
 * Commits the active transaction in the connection
 *
 * @param boolean nesting
 * @return boolean
 */
PHP_METHOD(Pdm_Db_Adapter_AbstractPdo, commit) {

    int ZEPHIR_LAST_CALL_STATUS;
    zval *nesting_param = NULL, *transactionLevel = NULL, *savepointName = NULL, *_0, *_1 = NULL;
    zend_bool nesting;

    ZEPHIR_MM_GROW();
    zephir_fetch_params(1, 0, 1, &nesting_param);

    if (!nesting_param) {
        nesting = 1;
    } else {
        nesting = zephir_get_boolval(nesting_param);
    }


    _0 = zephir_fetch_nproperty_this(this_ptr, SL("transactionLevel"), PH_NOISY_CC);
    ZEPHIR_CPY_WRT(transactionLevel, _0);
    if (!(zephir_is_true(transactionLevel))) {
        ZEPHIR_THROW_EXCEPTION_DEBUG_STR(pdm_db_adapter_exception_ce, "There is no active transaction", "pdm/db/adapter/abstractpdo.zep", 473);
        return;
    }
    if (ZEPHIR_IS_LONG(transactionLevel, 1)) {
        RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel") TSRMLS_CC));
        _0 = zephir_fetch_nproperty_this(this_ptr, SL("pdo"), PH_NOISY_CC);
        ZEPHIR_RETURN_CALL_METHOD(_0, "commit", NULL);
        zephir_check_call_status();
        RETURN_MM();
    } else {
        if (zephir_is_true(transactionLevel)) {
            if (nesting) {
                ZEPHIR_CALL_METHOD(&_1, this_ptr, "isnestedtransactionswithsavepoints",  NULL);
                zephir_check_call_status();
                if (zephir_is_true(_1)) {
                    ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname",  NULL);
                    zephir_check_call_status();
                    RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel") TSRMLS_CC));
                    ZEPHIR_RETURN_CALL_METHOD(this_ptr, "releasesavepoint", NULL, savepointName);
                    zephir_check_call_status();
                    RETURN_MM();
                }
            }
        }
    }
    if (ZEPHIR_GT_LONG(transactionLevel, 0)) {
        RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel") TSRMLS_CC));
    }
    RETURN_MM_BOOL(0);

}
开发者ID:brandonlamb,项目名称:php-datamapper,代码行数:56,代码来源:abstractpdo.zep.c

示例9: PHP_METHOD

/**
 * Sets if the resource must be filtered or not
 */
PHP_METHOD(Phalcon_Assets_Inline, setFilter) {

    zval *filter_param = NULL;
    zend_bool filter;

    zephir_fetch_params(0, 1, 0, &filter_param);

    filter = zephir_get_boolval(filter_param);


    zephir_update_property_this(this_ptr, SL("_filter"), filter ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
    RETURN_THISW();

}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:17,代码来源:inline.zep.c

示例10: PHP_METHOD

/**
 * Set if the resultset is fresh or an old one cached
 */
PHP_METHOD(Phalcon_Mvc_Model_Resultset, setIsFresh) {

    zval *isFresh_param = NULL;
    zend_bool isFresh;

    zephir_fetch_params(0, 1, 0, &isFresh_param);

    isFresh = zephir_get_boolval(isFresh_param);


    zephir_update_property_this(this_ptr, SL("_isFresh"), isFresh ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
    RETURN_THISW();

}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:17,代码来源:resultset.zep.c

示例11: PHP_METHOD

/**
 * Set whether the output must be implicitly flushed to the output or returned as string
 */
PHP_METHOD(Phalcon_Flash, setImplicitFlush) {

    zval *implicitFlush_param = NULL;
    zend_bool implicitFlush;

    zephir_fetch_params(0, 1, 0, &implicitFlush_param);

    implicitFlush = zephir_get_boolval(implicitFlush_param);


    zephir_update_property_this(this_ptr, SL("_implicitFlush"), implicitFlush ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
    RETURN_THISW();

}
开发者ID:AndrewUshchenko,项目名称:cphalcon,代码行数:17,代码来源:flash.zep.c

示例12: PHP_METHOD

/**
 * Sets if files must be completely opened and showed in the output
 * or just the fragment related to the exception
 */
PHP_METHOD(Phalcon_Debug, setShowFileFragment) {

    zval *showFileFragment_param = NULL;
    zend_bool showFileFragment;

    zephir_fetch_params(0, 1, 0, &showFileFragment_param);

    showFileFragment = zephir_get_boolval(showFileFragment_param);


    zephir_update_property_this(this_ptr, SL("_showFileFragment"), showFileFragment ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
    RETURN_THISW();

}
开发者ID:flaver12,项目名称:cphalcon,代码行数:18,代码来源:debug.zep.c

示例13: PHP_METHOD

/**
 * Add servers to memcache pool
 */
PHP_METHOD(Phalcon_Cache_Backend_Memcache, addServers) {

    zend_bool persistent;
    int port, ZEPHIR_LAST_CALL_STATUS;
    zval *host_param = NULL, *port_param = NULL, *persistent_param = NULL, *memcache = NULL, *success = NULL, *_0, *_1;
    zval *host = NULL;

    ZEPHIR_MM_GROW();
    zephir_fetch_params(1, 2, 1, &host_param, &port_param, &persistent_param);

    if (unlikely(Z_TYPE_P(host_param) != IS_STRING && Z_TYPE_P(host_param) != IS_NULL)) {
        zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'host' must be a string") TSRMLS_CC);
        RETURN_MM_NULL();
    }
    if (likely(Z_TYPE_P(host_param) == IS_STRING)) {
        zephir_get_strval(host, host_param);
    } else {
        ZEPHIR_INIT_VAR(host);
        ZVAL_EMPTY_STRING(host);
    }
    port = zephir_get_intval(port_param);
    if (!persistent_param) {
        persistent = 0;
    } else {
        persistent = zephir_get_boolval(persistent_param);
    }


    ZEPHIR_OBS_VAR(memcache);
    zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC);
    if (Z_TYPE_P(memcache) != IS_OBJECT) {
        ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0);
        zephir_check_call_status();
        ZEPHIR_OBS_NVAR(memcache);
        zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC);
    }
    ZEPHIR_INIT_VAR(_0);
    ZVAL_LONG(_0, port);
    ZEPHIR_INIT_VAR(_1);
    if (persistent) {
        ZVAL_BOOL(_1, 1);
    } else {
        ZVAL_BOOL(_1, 0);
    }
    ZEPHIR_CALL_METHOD(&success, memcache, "addserver", NULL, 0, host, _0, _1);
    zephir_check_call_status();
    zephir_update_property_this(this_ptr, SL("_memcache"), memcache TSRMLS_CC);
    RETURN_CCTOR(success);

}
开发者ID:michanismus,项目名称:cphalcon,代码行数:53,代码来源:memcache.zep.c

示例14: PHP_METHOD

/**
 * Decodes a JSON-encoded string into an object or array
 *
 * @param string $json A well-formed JSON string.
 * @param boolean $assoc [Optional] Whether to decode to an associative array. Default false.
 * @param int $depth [Optional] Depth to decode to. Default 512
 * @param int $flags [Optional] Bitwise flags for use in json_decode(). Default is 0
 * @return object|array|null JSON data decoded to object(s) or array(s).
 */
PHP_METHOD(Xpl_Json, decode) {

    int depth, flags;
    zend_bool assoc;
    zval *json_param = NULL, *assoc_param = NULL, *depth_param = NULL, *flags_param = NULL, _0, _1, _2;
    zval *json = NULL;

    ZEPHIR_MM_GROW();
    zephir_fetch_params(1, 1, 3, &json_param, &assoc_param, &depth_param, &flags_param);

    if (unlikely(Z_TYPE_P(json_param) != IS_STRING && Z_TYPE_P(json_param) != IS_NULL)) {
        zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'json' must be a string") TSRMLS_CC);
        RETURN_MM_NULL();
    }
    if (likely(Z_TYPE_P(json_param) == IS_STRING)) {
        zephir_get_strval(json, json_param);
    } else {
        ZEPHIR_INIT_VAR(json);
        ZVAL_EMPTY_STRING(json);
    }
    if (!assoc_param) {
        assoc = 0;
    } else {
        assoc = zephir_get_boolval(assoc_param);
    }
    if (!depth_param) {
        depth = 512;
    } else {
        depth = zephir_get_intval(depth_param);
    }
    if (!flags_param) {
        flags = 0;
    } else {
        flags = zephir_get_intval(flags_param);
    }


    if (ZEPHIR_IS_EMPTY(json)) {
        RETURN_MM_NULL();
    }
    ZEPHIR_SINIT_VAR(_0);
    ZVAL_BOOL(&_0, (assoc ? 1 : 0));
    ZEPHIR_SINIT_VAR(_1);
    ZVAL_LONG(&_1, depth);
    ZEPHIR_SINIT_VAR(_2);
    ZVAL_LONG(&_2, flags);
    zephir_json_decode(return_value, &(return_value), json, zephir_get_intval(&_0)  TSRMLS_CC);
    RETURN_MM();

}
开发者ID:wells5609,项目名称:xpl,代码行数:59,代码来源:json.zep.c

示例15: PHP_METHOD

/**
 * Set if cookies in the bag must be automatically encrypted/decrypted
 */
PHP_METHOD(Phalcon_Http_Response_Cookies, useEncryption) {

    zval *useEncryption_param = NULL;
    zend_bool useEncryption;

    zephir_fetch_params(0, 1, 0, &useEncryption_param);

    useEncryption = zephir_get_boolval(useEncryption_param);


    zephir_update_property_this(this_ptr, SL("_useEncryption"), useEncryption ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
    RETURN_THISW();

}
开发者ID:JulianZhao,项目名称:cphalcon,代码行数:17,代码来源:cookies.zep.c


注:本文中的zephir_get_boolval函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。