Beispiel #1
0
PHP_METHOD(pdo_connect_pool_PDOStatement, current)
{
    zval *pos, *rs, *row = NULL;
    zend_class_entry *ce;
    ce = Z_OBJCE_P(getThis());
    pos = cp_zend_read_property(ce, getThis(), "pos", sizeof ("pos") - 1, 0 TSRMLS_DC);
    rs = cp_zend_read_property(ce, getThis(), "rs", sizeof ("rs") - 1, 0 TSRMLS_DC);

    cp_zend_hash_index_find(Z_ARRVAL_P(rs), Z_LVAL_P(pos), (void**) &row);
    RETVAL_ZVAL(row, 1, 1);
}
Beispiel #2
0
PHP_METHOD(pdo_connect_pool_PDOStatement, valid)
{
    zval *pos, *rs, *row = NULL;
    zend_class_entry *ce;
    ce = Z_OBJCE_P(getThis());
    pos = cp_zend_read_property(ce, getThis(), "pos", sizeof("pos") -1, 0 TSRMLS_DC);
    rs = cp_zend_read_property(ce, getThis(), "rs", sizeof("rs") -1, 0 TSRMLS_DC);
    CP_MAKE_STD_ZVAL(row);

    if (cp_zend_hash_index_find(Z_ARRVAL_P(rs), Z_LVAL_P(pos), (void**) &row) == SUCCESS) {
        RETURN_BOOL(1);
    } else {
        RETURN_BOOL(0);
    }

}
Beispiel #3
0
static void log_process(zval *send_data, smart_str *buffer)
{
    zval *args = NULL, *method = NULL, *first = NULL;
    cp_zend_hash_find(Z_ARRVAL_P(send_data), ZEND_STRS("method"), (void **) &method);
    //    snprintf(buffer + strlen(buffer), CLIENT_LOG_BUFFER, "\nmethod:%s\n", Z_STRVAL_P(method));
    smart_str_appendl(buffer, "\nmethod:", 8);
    smart_str_appendl(buffer, Z_STRVAL_P(method), Z_STRLEN_P(method));
    cp_zend_hash_find(Z_ARRVAL_P(send_data), ZEND_STRS("args"), (void **) &args);
    if (cp_zend_hash_index_find(Z_ARRVAL_P(args), 0, (void**) &first) == SUCCESS)
    {
        if (Z_TYPE_P(first) == IS_STRING)
        {
            smart_str_appendl(buffer, "\nfirst arg:", 11);
            smart_str_appendl(buffer, Z_STRVAL_P(first), Z_STRLEN_P(first));
        }
    }
}