Esempio n. 1
0
/**
 * Renders the element widget
 */
PHP_METHOD(Phalcon_Forms_Element_Submit, render) {

	zend_long ZEPHIR_LAST_CALL_STATUS;
	zephir_fcall_cache_entry *_0 = NULL;
	zval *attributes_param = NULL, _1;
	zval attributes;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&attributes);
	ZVAL_UNDEF(&_1);

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

	if (!attributes_param) {
		ZEPHIR_INIT_VAR(&attributes);
		array_init(&attributes);
	} else {
		zephir_get_arrval(&attributes, attributes_param);
	}


	ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, &attributes);
	zephir_check_call_status();
	ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "submitbutton", &_0, 0, &_1);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 2
0
PHP_METHOD(Test_ScallExternal, testCall1) {

	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

	ZEPHIR_RETURN_CALL_CE_STATIC(test_scall_ce, "testmethod1", NULL);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 3
0
PHP_METHOD(Test_InternalClasses, testStaticCall) {

	zend_class_entry *_0;
	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

		_0 = zend_fetch_class(SL("Phalcon\\DI"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
	ZEPHIR_RETURN_CALL_CE_STATIC(_0, "getdefault", NULL, 0);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 4
0
PHP_METHOD(Test_InternalClasses, testStaticCall) {

	int ZEPHIR_LAST_CALL_STATUS;
	zend_class_entry *phalcon_phalcon_di;

	ZEPHIR_MM_GROW();

	phalcon_phalcon_di = zend_fetch_class(SL("\\Phalcon\\Di"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
	ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_phalcon_di, "getdefault", NULL);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 5
0
PHP_METHOD(Test_ScallExternal, testCall2) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *a, *b;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 2, 0, &a, &b);



	ZEPHIR_RETURN_CALL_CE_STATIC(test_scall_ce, "testmethod4", NULL, a, b);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 6
0
/**
 * Renders the element widget returning html
 *
 * @param array attributes
 * @return string
 */
PHP_METHOD(Phalcon_Forms_Element_Email, render) {

	int ZEPHIR_LAST_CALL_STATUS;
	zephir_fcall_cache_entry *_0 = NULL;
	zval *attributes = NULL, *_1 = NULL;

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

	if (!attributes) {
		attributes = ZEPHIR_GLOBAL(global_null);
	}


	ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes);
	zephir_check_call_status();
	ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "emailfield", &_0, 201, _1);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 7
0
/**
 * Renders the element widget returning html
 *
 * @param array attributes
 * @return string
 */
PHP_METHOD(Phalcon_Forms_Element_Select, render) {

	int ZEPHIR_LAST_CALL_STATUS;
	zephir_fcall_cache_entry *_0 = NULL;
	zval *attributes = NULL, *_1 = NULL, *_2;

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

	if (!attributes) {
		attributes = ZEPHIR_GLOBAL(global_null);
	}


	ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes);
	zephir_check_call_status();
	_2 = zephir_fetch_nproperty_this(this_ptr, SL("_optionsValues"), PH_NOISY_CC);
	ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 182, _1, _2);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 8
0
/**
 * Executes a find using the parameters built with the criteria
 */
PHP_METHOD(Phalcon_Mvc_Model_Criteria, execute) {

	zend_class_entry *_1;
	zval *model = NULL, *_0 = NULL;
	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_METHOD(&model, this_ptr, "getmodelname", NULL, 0);
	zephir_check_call_status();
	if (Z_TYPE_P(model) != IS_STRING) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Model name must be string", "phalcon/mvc/model/criteria.zep", 771);
		return;
	}
	ZEPHIR_CALL_METHOD(&_0, this_ptr, "getparams", NULL, 0);
	zephir_check_call_status();
	_1 = zephir_fetch_class(model TSRMLS_CC);
	ZEPHIR_RETURN_CALL_CE_STATIC(_1, "find", NULL, 0, _0);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 9
0
/**
 * Renders the element widget returning html
 *
 * @param array attributes
 */
PHP_METHOD(Phalcon_Forms_Element_Radio, render) {

	zend_long ZEPHIR_LAST_CALL_STATUS;
	zephir_fcall_cache_entry *_0 = NULL;
	zval *attributes = NULL, *_1 = NULL, *_2;

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

	if (!attributes) {
		attributes = ZEPHIR_GLOBAL(global_null);
	}


	ZEPHIR_INIT_VAR(_2);
	ZVAL_BOOL(_2, 1);
	ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes, _2);
	zephir_check_call_status();
	ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "radiofield", &_0, 225, _1);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 10
0
PHP_METHOD(Cake_Core_Configure, read) {

	int ZEPHIR_LAST_CALL_STATUS;
	zephir_fcall_cache_entry *_1 = NULL;
	zval *_var = NULL, *_0;

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

	if (!_var) {
		_var = ZEPHIR_GLOBAL(global_null);
	}


	if (Z_TYPE_P(_var) == IS_NULL) {
		_0 = zephir_fetch_static_property_ce(cake_core_configure_ce, SL("_values") TSRMLS_CC);
		RETURN_CTOR(_0);
	}
	_0 = zephir_fetch_static_property_ce(cake_core_configure_ce, SL("_values") TSRMLS_CC);
	ZEPHIR_RETURN_CALL_CE_STATIC(cake_utility_hash_ce, "get", &_1, 5, _0, _var);
	zephir_check_call_status();
	RETURN_MM();

}
Esempio n. 11
0
PHP_METHOD(Fox_MsgCrypt, encrypt) {

	zephir_fcall_cache_entry *_10 = NULL;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *text = NULL, *random = NULL, *module = NULL, *size = NULL, *iv = NULL, *pkc_encoder = NULL, *encrypted = NULL, *e = NULL, _0$$3 = zval_used_for_init, _1$$3 = zval_used_for_init, *_2$$3 = NULL, *_3$$3, *_4$$3, _5$$3, _6$$3, *_7$$3, *_8$$3 = NULL, *_9$$3, *_11$$3, *_12$$3, *_13$$4, *_14$$4;

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

	ZEPHIR_SEPARATE_PARAM(text);



	/* try_start_1: */

		ZEPHIR_CALL_METHOD(&random, this_ptr, "_getrandomstr", NULL, 1);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_SINIT_VAR(_0$$3);
		ZVAL_STRING(&_0$$3, "N", 0);
		ZEPHIR_SINIT_VAR(_1$$3);
		ZVAL_LONG(&_1$$3, zephir_fast_strlen_ev(text));
		ZEPHIR_CALL_FUNCTION(&_2$$3, "pack", NULL, 2, &_0$$3, &_1$$3);
		zephir_check_call_status_or_jump(try_end_1);
		_3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("appid"), PH_NOISY_CC);
		ZEPHIR_INIT_VAR(_4$$3);
		ZEPHIR_CONCAT_VVVV(_4$$3, random, _2$$3, text, _3$$3);
		ZEPHIR_CPY_WRT(text, _4$$3);
		ZEPHIR_SINIT_NVAR(_0$$3);
		ZVAL_STRING(&_0$$3, "rijndael-128", 0);
		ZEPHIR_SINIT_NVAR(_1$$3);
		ZVAL_STRING(&_1$$3, "cbc", 0);
		ZEPHIR_CALL_FUNCTION(&size, "mcrypt_get_block_size", NULL, 3, &_0$$3, &_1$$3);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_SINIT_NVAR(_0$$3);
		ZVAL_STRING(&_0$$3, "rijndael-128", 0);
		ZEPHIR_SINIT_NVAR(_1$$3);
		ZVAL_STRING(&_1$$3, "", 0);
		ZEPHIR_SINIT_VAR(_5$$3);
		ZVAL_STRING(&_5$$3, "cbc", 0);
		ZEPHIR_SINIT_VAR(_6$$3);
		ZVAL_STRING(&_6$$3, "", 0);
		ZEPHIR_CALL_FUNCTION(&module, "mcrypt_module_open", NULL, 4, &_0$$3, &_1$$3, &_5$$3, &_6$$3);
		zephir_check_call_status_or_jump(try_end_1);
		_7$$3 = zephir_fetch_nproperty_this(this_ptr, SL("appkey"), PH_NOISY_CC);
		ZEPHIR_SINIT_NVAR(_0$$3);
		ZVAL_LONG(&_0$$3, 0);
		ZEPHIR_SINIT_NVAR(_1$$3);
		ZVAL_LONG(&_1$$3, 16);
		ZEPHIR_INIT_VAR(iv);
		zephir_substr(iv, _7$$3, 0 , 16 , 0);
		ZEPHIR_INIT_VAR(pkc_encoder);
		object_init_ex(pkc_encoder, fox_pkcs7encoder_ce);
		if (zephir_has_constructor(pkc_encoder TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, pkc_encoder, "__construct", NULL, 0);
			zephir_check_call_status_or_jump(try_end_1);
		}
		ZEPHIR_CALL_METHOD(&_8$$3, pkc_encoder, "encode", NULL, 5, text);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CPY_WRT(text, _8$$3);
		_9$$3 = zephir_fetch_nproperty_this(this_ptr, SL("appkey"), PH_NOISY_CC);
		ZEPHIR_CALL_FUNCTION(NULL, "mcrypt_generic_init", NULL, 6, module, _9$$3, iv);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CALL_FUNCTION(&encrypted, "mcrypt_generic", NULL, 7, module, text);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CALL_FUNCTION(NULL, "mcrypt_generic_deinit", NULL, 8, module);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CALL_FUNCTION(NULL, "mcrypt_module_close", NULL, 9, module);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CALL_FUNCTION(&_8$$3, "base64_encode", NULL, 11, encrypted);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_INIT_VAR(_11$$3);
		ZVAL_BOOL(_11$$3, 1);
		ZEPHIR_INIT_VAR(_12$$3);
		ZVAL_STRING(_12$$3, "OK", ZEPHIR_TEMP_PARAM_COPY);
		ZEPHIR_RETURN_CALL_CE_STATIC(fox_common_ce, "rtn", &_10, 10, _11$$3, _12$$3, _8$$3);
		zephir_check_temp_parameter(_12$$3);
		zephir_check_call_status_or_jump(try_end_1);
		RETURN_MM();

	try_end_1:

	if (EG(exception)) {
		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);
			ZEPHIR_INIT_VAR(_13$$4);
			ZVAL_BOOL(_13$$4, 0);
			ZEPHIR_INIT_VAR(_14$$4);
			ZVAL_STRING(_14$$4, "EncryptAESError", ZEPHIR_TEMP_PARAM_COPY);
			ZEPHIR_RETURN_CALL_CE_STATIC(fox_common_ce, "rtn", &_10, 10, _13$$4, _14$$4);
			zephir_check_temp_parameter(_14$$4);
			zephir_check_call_status();
			RETURN_MM();
		}
	}
	ZEPHIR_MM_RESTORE();

}
Esempio n. 12
0
PHP_METHOD(Fox_MsgCrypt, decrypt) {

	zephir_fcall_cache_entry *_6 = NULL;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *encrypted, *ciphertext_dec = NULL, *module = NULL, *iv = NULL, *decrypted = NULL, *e = NULL, *pkc_encoder = NULL, *result = NULL, *content = NULL, *len_list = NULL, *xml_len = NULL, *xml_content = NULL, *from_appid = NULL, *_18, *_21, *_22, _0$$3 = zval_used_for_init, _1$$3 = zval_used_for_init, _2$$3, _3$$3, *_4$$3, *_5$$3, *_7$$4, *_8$$4, _9$$5, _10$$5, _11$$5, _12$$5, *_13$$5, _14$$5 = zval_used_for_init, _15$$5, *_16$$7, *_17$$7, *_19$$8, *_20$$8;

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




	/* try_start_1: */

		ZEPHIR_CALL_FUNCTION(&ciphertext_dec, "base64_decode", NULL, 12, encrypted);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_SINIT_VAR(_0$$3);
		ZVAL_STRING(&_0$$3, "rijndael-128", 0);
		ZEPHIR_SINIT_VAR(_1$$3);
		ZVAL_STRING(&_1$$3, "", 0);
		ZEPHIR_SINIT_VAR(_2$$3);
		ZVAL_STRING(&_2$$3, "cbc", 0);
		ZEPHIR_SINIT_VAR(_3$$3);
		ZVAL_STRING(&_3$$3, "", 0);
		ZEPHIR_CALL_FUNCTION(&module, "mcrypt_module_open", NULL, 4, &_0$$3, &_1$$3, &_2$$3, &_3$$3);
		zephir_check_call_status_or_jump(try_end_1);
		_4$$3 = zephir_fetch_nproperty_this(this_ptr, SL("appkey"), PH_NOISY_CC);
		ZEPHIR_SINIT_NVAR(_0$$3);
		ZVAL_LONG(&_0$$3, 0);
		ZEPHIR_SINIT_NVAR(_1$$3);
		ZVAL_LONG(&_1$$3, 16);
		ZEPHIR_INIT_VAR(iv);
		zephir_substr(iv, _4$$3, 0 , 16 , 0);
		_5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("appkey"), PH_NOISY_CC);
		ZEPHIR_CALL_FUNCTION(NULL, "mcrypt_generic_init", NULL, 6, module, _5$$3, iv);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CALL_FUNCTION(&decrypted, "mdecrypt_generic", NULL, 13, module, ciphertext_dec);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CALL_FUNCTION(NULL, "mcrypt_generic_deinit", NULL, 8, module);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_CALL_FUNCTION(NULL, "mcrypt_module_close", NULL, 9, module);
		zephir_check_call_status_or_jump(try_end_1);

	try_end_1:

	if (EG(exception)) {
		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);
			ZEPHIR_INIT_VAR(_7$$4);
			ZVAL_BOOL(_7$$4, 0);
			ZEPHIR_INIT_VAR(_8$$4);
			ZVAL_STRING(_8$$4, "DecryptAESError", ZEPHIR_TEMP_PARAM_COPY);
			ZEPHIR_RETURN_CALL_CE_STATIC(fox_common_ce, "rtn", &_6, 10, _7$$4, _8$$4);
			zephir_check_temp_parameter(_8$$4);
			zephir_check_call_status();
			RETURN_MM();
		}
	}

	/* try_start_2: */

		ZEPHIR_INIT_VAR(pkc_encoder);
		object_init_ex(pkc_encoder, fox_pkcs7encoder_ce);
		if (zephir_has_constructor(pkc_encoder TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, pkc_encoder, "__construct", NULL, 0);
			zephir_check_call_status_or_jump(try_end_1);
		}
		ZEPHIR_CALL_METHOD(&result, pkc_encoder, "decode", NULL, 14, decrypted);
		zephir_check_call_status_or_jump(try_end_1);
		if (zephir_fast_strlen_ev(result) < 16) {
			RETURN_MM_STRING("", 1);
		}
		ZEPHIR_SINIT_VAR(_9$$5);
		ZVAL_LONG(&_9$$5, 16);
		ZEPHIR_SINIT_VAR(_10$$5);
		ZVAL_LONG(&_10$$5, zephir_fast_strlen_ev(result));
		ZEPHIR_INIT_VAR(content);
		zephir_substr(content, result, 16 , zephir_get_intval(&_10$$5), 0);
		ZEPHIR_SINIT_VAR(_11$$5);
		ZVAL_LONG(&_11$$5, 0);
		ZEPHIR_SINIT_VAR(_12$$5);
		ZVAL_LONG(&_12$$5, 4);
		ZEPHIR_INIT_VAR(_13$$5);
		zephir_substr(_13$$5, content, 0 , 4 , 0);
		ZEPHIR_SINIT_VAR(_14$$5);
		ZVAL_STRING(&_14$$5, "N", 0);
		ZEPHIR_CALL_FUNCTION(&len_list, "unpack", NULL, 15, &_14$$5, _13$$5);
		zephir_check_call_status_or_jump(try_end_1);
		ZEPHIR_OBS_VAR(xml_len);
		zephir_array_fetch_long(&xml_len, len_list, 1, PH_NOISY, "fox/MsgCrypt.zep", 86 TSRMLS_CC);
		ZEPHIR_SINIT_NVAR(_14$$5);
		ZVAL_LONG(&_14$$5, 4);
		ZEPHIR_INIT_VAR(xml_content);
		zephir_substr(xml_content, content, 4 , zephir_get_intval(xml_len), 0);
		ZEPHIR_SINIT_VAR(_15$$5);
		ZVAL_LONG(&_15$$5, (zephir_get_numberval(xml_len) + 4));
		ZEPHIR_INIT_VAR(from_appid);
		zephir_substr(from_appid, content, zephir_get_intval(&_15$$5), 0, ZEPHIR_SUBSTR_NO_LENGTH);

	try_end_2:

	if (EG(exception)) {
		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);
			ZEPHIR_INIT_VAR(_16$$7);
			ZVAL_BOOL(_16$$7, 0);
			ZEPHIR_INIT_VAR(_17$$7);
			ZVAL_STRING(_17$$7, "IllegalBuffer", ZEPHIR_TEMP_PARAM_COPY);
			ZEPHIR_RETURN_CALL_CE_STATIC(fox_common_ce, "rtn", &_6, 10, _16$$7, _17$$7);
			zephir_check_temp_parameter(_17$$7);
			zephir_check_call_status();
			RETURN_MM();
		}
	}
	_18 = zephir_fetch_nproperty_this(this_ptr, SL("appid"), PH_NOISY_CC);
	if (!ZEPHIR_IS_EQUAL(from_appid, _18)) {
		ZEPHIR_INIT_VAR(_19$$8);
		ZVAL_BOOL(_19$$8, 0);
		ZEPHIR_INIT_VAR(_20$$8);
		ZVAL_STRING(_20$$8, "ValidateAppidError", ZEPHIR_TEMP_PARAM_COPY);
		ZEPHIR_RETURN_CALL_CE_STATIC(fox_common_ce, "rtn", &_6, 10, _19$$8, _20$$8);
		zephir_check_temp_parameter(_20$$8);
		zephir_check_call_status();
		RETURN_MM();
	}
	ZEPHIR_INIT_VAR(_21);
	ZVAL_BOOL(_21, 1);
	ZEPHIR_INIT_VAR(_22);
	ZVAL_STRING(_22, "OK", ZEPHIR_TEMP_PARAM_COPY);
	ZEPHIR_RETURN_CALL_CE_STATIC(fox_common_ce, "rtn", &_6, 10, _21, _22, xml_content);
	zephir_check_temp_parameter(_22);
	zephir_check_call_status();
	RETURN_MM();

}