", "
", "
", &className, ": ", &escapedMessage, "
", "", &_3, " (", &_4, ")", "");
+ zephir_concat_self(&html, &_5);
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("showBackTrace"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&showBackTrace, &_6);
+ if (zephir_is_true(&showBackTrace)) {
+ zephir_memory_observe(&dataVars);
+ zephir_read_property(&dataVars, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
+ ZEPHIR_INIT_VAR(&_7$$3);
+ ZEPHIR_CONCAT_SSSSSS(&_7$$3, "
"));
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_CALL_METHOD(&_8$$3, exception, "gettrace", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&_8$$3, 0, "phalcon/Support/Debug.zep", 355);
+ if (Z_TYPE_P(&_8$$3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_8$$3), _11$$3, _12$$3, _9$$3)
+ {
+ ZEPHIR_INIT_NVAR(&n);
+ if (_12$$3 != NULL) {
+ ZVAL_STR_COPY(&n, _12$$3);
+ } else {
+ ZVAL_LONG(&n, _11$$3);
+ }
+ ZEPHIR_INIT_NVAR(&traceItem);
+ ZVAL_COPY(&traceItem, _9$$3);
+ ZEPHIR_CALL_METHOD(&_13$$5, this_ptr, "showtraceitem", &_14, 0, &n, &traceItem);
+ zephir_check_call_status();
+ zephir_concat_self(&html, &_13$$5);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_8$$3, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_10$$3, &_8$$3, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_10$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&n, &_8$$3, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&traceItem, &_8$$3, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_15$$6, this_ptr, "showtraceitem", &_14, 0, &n, &traceItem);
+ zephir_check_call_status();
+ zephir_concat_self(&html, &_15$$6);
+ ZEPHIR_CALL_METHOD(NULL, &_8$$3, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&traceItem);
+ ZEPHIR_INIT_NVAR(&n);
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_INIT_VAR(&_16$$3);
+ ZEPHIR_CONCAT_SSS(&_16$$3, "
", "
", "Key | Value |
");
+ zephir_concat_self(&html, &_16$$3);
+ zephir_read_property(&_17$$3, this_ptr, ZEND_STRL("blacklist"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_18$$3);
+ array_init(&_18$$3);
+ ZEPHIR_INIT_VAR(&_19$$3);
+ ZVAL_STRING(&_19$$3, "request");
+ ZEPHIR_CALL_METHOD(&blacklist, this_ptr, "getarrval", NULL, 0, &_17$$3, &_19$$3, &_18$$3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_REQUEST, 0, "phalcon/Support/Debug.zep", 379);
+ if (Z_TYPE_P(&_REQUEST) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_REQUEST), _22$$3, _23$$3, _20$$3)
+ {
+ ZEPHIR_INIT_NVAR(&keyRequest);
+ if (_23$$3 != NULL) {
+ ZVAL_STR_COPY(&keyRequest, _23$$3);
+ } else {
+ ZVAL_LONG(&keyRequest, _22$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _20$$3);
+ ZEPHIR_INIT_NVAR(&_24$$7);
+ zephir_fast_strtolower(&_24$$7, &keyRequest);
+ if (1 != zephir_array_isset(&blacklist, &_24$$7)) {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_25$$9);
+ ZEPHIR_CONCAT_SVSVS(&_25$$9, "", &keyRequest, " | ", &value, " |
");
+ zephir_concat_self(&html, &_25$$9);
+ } else {
+ ZEPHIR_CALL_FUNCTION(&_26$$10, "print_r", &_27, 0, &value, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_28$$10);
+ ZEPHIR_CONCAT_SVSVS(&_28$$10, "", &keyRequest, " | ", &_26$$10, " |
");
+ zephir_concat_self(&html, &_28$$10);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_REQUEST, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_21$$3, &_REQUEST, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_21$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&keyRequest, &_REQUEST, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_REQUEST, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_29$$11);
+ zephir_fast_strtolower(&_29$$11, &keyRequest);
+ if (1 != zephir_array_isset(&blacklist, &_29$$11)) {
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_30$$13);
+ ZEPHIR_CONCAT_SVSVS(&_30$$13, "", &keyRequest, " | ", &value, " |
");
+ zephir_concat_self(&html, &_30$$13);
+ } else {
+ ZEPHIR_CALL_FUNCTION(&_31$$14, "print_r", &_27, 0, &value, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_32$$14);
+ ZEPHIR_CONCAT_SVSVS(&_32$$14, "", &keyRequest, " | ", &_31$$14, " |
");
+ zephir_concat_self(&html, &_32$$14);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_REQUEST, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&keyRequest);
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_INIT_VAR(&_33$$3);
+ ZEPHIR_CONCAT_SSS(&_33$$3, "
", "
", "Key | Value |
");
+ zephir_concat_self(&html, &_33$$3);
+ zephir_read_property(&_34$$3, this_ptr, ZEND_STRL("blacklist"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_19$$3);
+ array_init(&_19$$3);
+ ZEPHIR_INIT_VAR(&_35$$3);
+ ZVAL_STRING(&_35$$3, "server");
+ ZEPHIR_CALL_METHOD(&blacklist, this_ptr, "getarrval", NULL, 0, &_34$$3, &_35$$3, &_19$$3);
+ zephir_check_call_status();
+ zephir_is_iterable(&_SERVER, 0, "phalcon/Support/Debug.zep", 397);
+ if (Z_TYPE_P(&_SERVER) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_SERVER), _38$$3, _39$$3, _36$$3)
+ {
+ ZEPHIR_INIT_NVAR(&keyServer);
+ if (_39$$3 != NULL) {
+ ZVAL_STR_COPY(&keyServer, _39$$3);
+ } else {
+ ZVAL_LONG(&keyServer, _38$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _36$$3);
+ ZEPHIR_INIT_NVAR(&_40$$15);
+ zephir_fast_strtolower(&_40$$15, &keyServer);
+ if (1 != zephir_array_isset(&blacklist, &_40$$15)) {
+ ZEPHIR_CALL_METHOD(&_41$$16, this_ptr, "getvardump", &_42, 0, &value);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_43$$16);
+ ZEPHIR_CONCAT_SVSVS(&_43$$16, "", &keyServer, " | ", &_41$$16, " |
");
+ zephir_concat_self(&html, &_43$$16);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_SERVER, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_37$$3, &_SERVER, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_37$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&keyServer, &_SERVER, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_SERVER, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_44$$17);
+ zephir_fast_strtolower(&_44$$17, &keyServer);
+ if (1 != zephir_array_isset(&blacklist, &_44$$17)) {
+ ZEPHIR_CALL_METHOD(&_45$$18, this_ptr, "getvardump", &_42, 0, &value);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_46$$18);
+ ZEPHIR_CONCAT_SVSVS(&_46$$18, "", &keyServer, " | ", &_45$$18, " |
");
+ zephir_concat_self(&html, &_46$$18);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_SERVER, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&keyServer);
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_INIT_VAR(&_47$$3);
+ ZEPHIR_CONCAT_SSS(&_47$$3, "
", "
", "# | Path |
");
+ zephir_concat_self(&html, &_47$$3);
+ ZEPHIR_CALL_FUNCTION(&_48$$3, "get_included_files", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&_48$$3, 0, "phalcon/Support/Debug.zep", 410);
+ if (Z_TYPE_P(&_48$$3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_48$$3), _51$$3, _52$$3, _49$$3)
+ {
+ ZEPHIR_INIT_NVAR(&keyFile);
+ if (_52$$3 != NULL) {
+ ZVAL_STR_COPY(&keyFile, _52$$3);
+ } else {
+ ZVAL_LONG(&keyFile, _51$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _49$$3);
+ ZEPHIR_INIT_NVAR(&_53$$19);
+ ZEPHIR_CONCAT_SVSVS(&_53$$19, "", &keyFile, " | ", &value, " |
");
+ zephir_concat_self(&html, &_53$$19);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_48$$3, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_50$$3, &_48$$3, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_50$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&keyFile, &_48$$3, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_48$$3, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_54$$20);
+ ZEPHIR_CONCAT_SVSVS(&_54$$20, "", &keyFile, " | ", &value, " |
");
+ zephir_concat_self(&html, &_54$$20);
+ ZEPHIR_CALL_METHOD(NULL, &_48$$3, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&keyFile);
+ zephir_concat_self_str(&html, SL("
"));
+ ZEPHIR_CALL_FUNCTION(&_55$$3, "memory_get_usage", NULL, 0, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_56$$3);
+ ZEPHIR_CONCAT_SSSVSS(&_56$$3, "
", "
", "Memory |
---|
Usage | ", &_55$$3, " |
", "
");
+ zephir_concat_self(&html, &_56$$3);
+ if (!(ZEPHIR_IS_EMPTY(&dataVars))) {
+ ZEPHIR_INIT_VAR(&_57$$21);
+ ZEPHIR_CONCAT_SSS(&_57$$21, "
", "
", "Key | Value |
");
+ zephir_concat_self(&html, &_57$$21);
+ zephir_is_iterable(&dataVars, 0, "phalcon/Support/Debug.zep", 435);
+ if (Z_TYPE_P(&dataVars) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dataVars), _60$$21, _61$$21, _58$$21)
+ {
+ ZEPHIR_INIT_NVAR(&keyVar);
+ if (_61$$21 != NULL) {
+ ZVAL_STR_COPY(&keyVar, _61$$21);
+ } else {
+ ZVAL_LONG(&keyVar, _60$$21);
+ }
+ ZEPHIR_INIT_NVAR(&dataVar);
+ ZVAL_COPY(&dataVar, _58$$21);
+ zephir_array_fetch_long(&_63$$22, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 432);
+ ZEPHIR_CALL_METHOD(&_62$$22, this_ptr, "getvardump", &_42, 0, &_63$$22);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_64$$22);
+ ZEPHIR_CONCAT_SVSVS(&_64$$22, "", &keyVar, " | ", &_62$$22, " |
");
+ zephir_concat_self(&html, &_64$$22);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &dataVars, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_59$$21, &dataVars, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_59$$21)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&keyVar, &dataVars, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&dataVar, &dataVars, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_66$$23, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 432);
+ ZEPHIR_CALL_METHOD(&_65$$23, this_ptr, "getvardump", &_42, 0, &_66$$23);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_67$$23);
+ ZEPHIR_CONCAT_SVSVS(&_67$$23, "", &keyVar, " | ", &_65$$23, " |
");
+ zephir_concat_self(&html, &_67$$23);
+ ZEPHIR_CALL_METHOD(NULL, &dataVars, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&dataVar);
+ ZEPHIR_INIT_NVAR(&keyVar);
+ zephir_concat_self_str(&html, SL("
"));
+ }
+ zephir_concat_self_str(&html, SL("
"));
+ }
+ ZEPHIR_CALL_METHOD(&_68, this_ptr, "getjssources", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_69);
+ ZEPHIR_CONCAT_VS(&_69, &_68, "
");
+ zephir_concat_self(&html, &_69);
+ RETURN_CCTOR(&html);
}
-static PHP_METHOD(Phalcon_Http_Response, setContentLength)
+static PHP_METHOD(Phalcon_Support_Debug, setBlacklist)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *contentLength_param = NULL, _0, _1;
- zend_long contentLength, ZEPHIR_LAST_CALL_STATUS;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *blacklist_param = NULL, area, result, subArray, value, _0, _1, *_2, _3, _6, *_7, _8, _4$$3, _5$$4, _9$$5, _10$$6;
+ zval blacklist;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&blacklist);
+ ZVAL_UNDEF(&area);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&subArray);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$6);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(contentLength)
+ Z_PARAM_ARRAY(blacklist)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &contentLength_param);
+ zephir_fetch_params(1, 1, 0, &blacklist_param);
+ zephir_get_arrval(&blacklist, blacklist_param);
ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "Content-Length");
- ZVAL_LONG(&_1, contentLength);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_0, &_1);
+ array_init(&_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "request");
+ ZEPHIR_CALL_METHOD(&area, this_ptr, "getarrval", NULL, 0, &blacklist, &_1, &_0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&subArray);
+ array_init(&subArray);
+ ZEPHIR_INIT_VAR(&result);
+ array_init(&result);
+ zephir_is_iterable(&area, 0, "phalcon/Support/Debug.zep", 467);
+ if (Z_TYPE_P(&area) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _2)
+ {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _2);
+ ZEPHIR_INIT_NVAR(&_4$$3);
+ zephir_fast_strtolower(&_4$$3, &value);
+ ZEPHIR_CPY_WRT(&value, &_4$$3);
+ ZEPHIR_INIT_NVAR(&_4$$3);
+ ZVAL_LONG(&_4$$3, 1);
+ zephir_array_update_zval(&subArray, &value, &_4$$3, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &area, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, &area, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&value, &area, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_5$$4);
+ zephir_fast_strtolower(&_5$$4, &value);
+ ZEPHIR_CPY_WRT(&value, &_5$$4);
+ ZEPHIR_INIT_NVAR(&_5$$4);
+ ZVAL_LONG(&_5$$4, 1);
+ zephir_array_update_zval(&subArray, &value, &_5$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &area, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ zephir_array_update_string(&result, SL("request"), &subArray, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_1);
+ array_init(&_1);
+ ZEPHIR_INIT_VAR(&_6);
+ ZVAL_STRING(&_6, "server");
+ ZEPHIR_CALL_METHOD(&area, this_ptr, "getarrval", NULL, 0, &blacklist, &_6, &_1);
zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&subArray);
+ array_init(&subArray);
+ zephir_is_iterable(&area, 0, "phalcon/Support/Debug.zep", 476);
+ if (Z_TYPE_P(&area) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _7)
+ {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _7);
+ ZEPHIR_INIT_NVAR(&_9$$5);
+ zephir_fast_strtolower(&_9$$5, &value);
+ ZEPHIR_CPY_WRT(&value, &_9$$5);
+ ZEPHIR_INIT_NVAR(&_9$$5);
+ ZVAL_LONG(&_9$$5, 1);
+ zephir_array_update_zval(&subArray, &value, &_9$$5, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &area, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_8, &area, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_8)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&value, &area, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_10$$6);
+ zephir_fast_strtolower(&_10$$6, &value);
+ ZEPHIR_CPY_WRT(&value, &_10$$6);
+ ZEPHIR_INIT_NVAR(&_10$$6);
+ ZVAL_LONG(&_10$$6, 1);
+ zephir_array_update_zval(&subArray, &value, &_10$$6, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &area, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ zephir_array_update_string(&result, SL("server"), &subArray, PH_COPY | PH_SEPARATE);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("blacklist"), &result);
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Http_Response, setContentType)
+static PHP_METHOD(Phalcon_Support_Debug, setShowBackTrace)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *contentType_param = NULL, *charset = NULL, charset_sub, __$null, _0$$3, _1;
- zval contentType;
+ zval *showBackTrace_param = NULL, __$true, __$false;
+ zend_bool showBackTrace;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&contentType);
- ZVAL_UNDEF(&charset_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(contentType)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(charset)
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(showBackTrace)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &contentType_param, &charset);
- zephir_get_strval(&contentType, contentType_param);
- if (!charset) {
- charset = &charset_sub;
- charset = &__$null;
- }
- if (Z_TYPE_P(charset) != IS_NULL) {
- ZEPHIR_INIT_VAR(&_0$$3);
- ZEPHIR_CONCAT_SV(&_0$$3, "; charset=", charset);
- zephir_concat_self(&contentType, &_0$$3);
+ zephir_fetch_params_without_memory_grow(1, 0, &showBackTrace_param);
+ if (showBackTrace) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("showBackTrace"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("showBackTrace"), &__$false);
}
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "Content-Type");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &contentType);
- zephir_check_call_status();
- RETURN_THIS();
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Http_Response, setCookies)
+static PHP_METHOD(Phalcon_Support_Debug, setShowFileFragment)
{
- zval *cookies, cookies_sub;
+ zval *showFileFragment_param = NULL, __$true, __$false;
+ zend_bool showFileFragment;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&cookies_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(cookies, phalcon_http_response_cookiesinterface_ce)
+ Z_PARAM_BOOL(showFileFragment)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &cookies);
- zephir_update_property_zval(this_ptr, ZEND_STRL("cookies"), cookies);
+ zephir_fetch_params_without_memory_grow(1, 0, &showFileFragment_param);
+ if (showFileFragment) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("showFileFragment"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("showFileFragment"), &__$false);
+ }
RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Http_Response, setDI)
+static PHP_METHOD(Phalcon_Support_Debug, setShowFiles)
{
- zval *container, container_sub;
+ zval *showFiles_param = NULL, __$true, __$false;
+ zend_bool showFiles;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&container_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
+ Z_PARAM_BOOL(showFiles)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &container);
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
+ zephir_fetch_params_without_memory_grow(1, 0, &showFiles_param);
+ if (showFiles) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("showFiles"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("showFiles"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Http_Response, setEtag)
+static PHP_METHOD(Phalcon_Support_Debug, setUri)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *etag_param = NULL, _0;
- zval etag;
+ zval *uri_param = NULL;
+ zval uri;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&etag);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&uri);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(etag)
+ Z_PARAM_STR(uri)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &etag_param);
- zephir_get_strval(&etag, etag_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "Etag");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_0, &etag);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 0, &uri_param);
+ if (UNEXPECTED(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) {
+ zephir_get_strval(&uri, uri_param);
+ } else {
+ ZEPHIR_INIT_VAR(&uri);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("uri"), &uri);
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Http_Response, setExpires)
+static PHP_METHOD(Phalcon_Support_Debug, escapeString)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *datetime, datetime_sub, date, _0, _1, _2, _3;
- zval *this_ptr = getThis();
+ zval *value_param = NULL, _0, _1, _2, _3, _4;
+ zval value;
- ZVAL_UNDEF(&datetime_sub);
- ZVAL_UNDEF(&date);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(datetime, php_date_get_date_ce())
+ Z_PARAM_STR(value)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &datetime);
- ZEPHIR_INIT_VAR(&date);
- if (zephir_clone(&date, datetime) == FAILURE) {
- RETURN_MM();
- }
+ zephir_fetch_params(1, 1, 0, &value_param);
+ zephir_get_strval(&value, value_param);
ZEPHIR_INIT_VAR(&_0);
- object_init_ex(&_0, php_date_get_timezone_ce());
ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "UTC");
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &date, "settimezone", NULL, 0, &_0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "D, d M Y H:i:s");
- ZEPHIR_CALL_METHOD(&_2, &date, "format", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_VS(&_3, &_2, " GMT");
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "Expires");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &_3);
+ ZVAL_STRING(&_1, "\n");
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "\\n");
+ zephir_fast_str_replace(&_0, &_1, &_2, &value);
+ ZVAL_LONG(&_3, 2);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "utf-8");
+ ZEPHIR_RETURN_CALL_FUNCTION("htmlentities", NULL, 0, &_0, &_3, &_4);
zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response, setEventsManager)
-{
- zval *eventsManager, eventsManager_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&eventsManager_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
- zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response, setFileToSend)
+static PHP_METHOD(Phalcon_Support_Debug, getArrayDump)
{
+ zend_string *_4;
+ zend_ulong _3;
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL, *_8 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filePath_param = NULL, *attachmentName = NULL, attachmentName_sub, *attachment = NULL, attachment_sub, __$true, __$null, basePath, basePathEncoding, _0$$6, _1$$5, _2$$7, _3$$7, _4$$7, _5$$8, _6$$8, _7$$8;
- zval filePath;
+ zval *argument_param = NULL, *n = NULL, n_sub, numberArguments, dump, varDump, k, v, *_1, _2, _6$$8, _7$$8, _9$$9, _10$$5, _11$$15, _12$$15, _13$$16, _14$$12;
+ zval argument;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&filePath);
- ZVAL_UNDEF(&attachmentName_sub);
- ZVAL_UNDEF(&attachment_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&basePath);
- ZVAL_UNDEF(&basePathEncoding);
- ZVAL_UNDEF(&_0$$6);
- ZVAL_UNDEF(&_1$$5);
- ZVAL_UNDEF(&_2$$7);
- ZVAL_UNDEF(&_3$$7);
- ZVAL_UNDEF(&_4$$7);
- ZVAL_UNDEF(&_5$$8);
+ ZVAL_UNDEF(&argument);
+ ZVAL_UNDEF(&n_sub);
+ ZVAL_UNDEF(&numberArguments);
+ ZVAL_UNDEF(&dump);
+ ZVAL_UNDEF(&varDump);
+ ZVAL_UNDEF(&k);
+ ZVAL_UNDEF(&v);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_6$$8);
ZVAL_UNDEF(&_7$$8);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(filePath)
+ ZVAL_UNDEF(&_9$$9);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$15);
+ ZVAL_UNDEF(&_12$$15);
+ ZVAL_UNDEF(&_13$$16);
+ ZVAL_UNDEF(&_14$$12);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(argument)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(attachmentName)
- Z_PARAM_ZVAL(attachment)
+ Z_PARAM_ZVAL(n)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &filePath_param, &attachmentName, &attachment);
- zephir_get_strval(&filePath, filePath_param);
- if (!attachmentName) {
- attachmentName = &attachmentName_sub;
- attachmentName = &__$null;
+ zephir_fetch_params(1, 1, 1, &argument_param, &n);
+ ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param);
+ if (!n) {
+ n = &n_sub;
+ ZEPHIR_INIT_VAR(n);
+ ZVAL_LONG(n, 0);
}
- if (!attachment) {
- attachment = &attachment_sub;
- attachment = &__$true;
+ ZEPHIR_INIT_VAR(&numberArguments);
+ ZVAL_LONG(&numberArguments, zephir_fast_count_int(&argument));
+ _0 = ZEPHIR_GE_LONG(n, 3);
+ if (!(_0)) {
+ _0 = ZEPHIR_IS_LONG(&numberArguments, 0);
}
- ZEPHIR_INIT_VAR(&basePathEncoding);
- ZVAL_STRING(&basePathEncoding, "ASCII");
- if (Z_TYPE_P(attachmentName) != IS_STRING) {
- ZEPHIR_CALL_METHOD(&basePath, this_ptr, "getbasename", NULL, 357, &filePath);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&basePath, attachmentName);
+ if (_0) {
+ RETURN_MM_NULL();
}
- if (zephir_is_true(attachment)) {
- if ((zephir_function_exists_ex(ZEND_STRL("mb_detect_encoding")) == SUCCESS)) {
- ZEPHIR_CALL_FUNCTION(&_0$$6, "mb_detect_order", NULL, 358);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&basePathEncoding, "mb_detect_encoding", NULL, 323, &basePath, &_0$$6, &__$true);
- zephir_check_call_status();
- }
- ZEPHIR_INIT_VAR(&_1$$5);
- ZVAL_STRING(&_1$$5, "Content-Description: File Transfer");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1$$5);
- ZVAL_STRING(&_1$$5, "Content-Type: application/octet-stream");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1$$5);
- ZVAL_STRING(&_1$$5, "Content-Transfer-Encoding: binary");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5);
- zephir_check_call_status();
- if (!ZEPHIR_IS_STRING(&basePathEncoding, "ASCII")) {
- ZEPHIR_CALL_FUNCTION(&_2$$7, "rawurlencode", NULL, 327, &basePath);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&basePath, &_2$$7);
- ZEPHIR_INIT_VAR(&_3$$7);
- zephir_fast_strtolower(&_3$$7, &basePathEncoding);
- ZEPHIR_INIT_VAR(&_4$$7);
- ZEPHIR_CONCAT_SVSVSV(&_4$$7, "Content-Disposition: attachment; filename=", &basePath, "; filename*=", &_3$$7, "''", &basePath);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_4$$7);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_5$$8);
- ZVAL_STRING(&_5$$8, "\15\17\\\"");
- ZEPHIR_CALL_FUNCTION(&_6$$8, "addcslashes", NULL, 215, &basePath, &_5$$8);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&basePath, &_6$$8);
- ZEPHIR_INIT_VAR(&_7$$8);
- ZEPHIR_CONCAT_SVS(&_7$$8, "Content-Disposition: attachment; filename=\"", &basePath, "\"");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_7$$8);
- zephir_check_call_status();
- }
+ if (ZEPHIR_GE_LONG(&numberArguments, 10)) {
+ RETURN_CCTOR(&numberArguments);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("file"), &filePath);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response, setHeader)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *value, value_sub, _0;
- zval name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &name_param, &value);
- zephir_get_strval(&name, name_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &name, value);
- zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response, setHeaders)
-{
- zend_string *_3;
- zend_ulong _2;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *headers, headers_sub, data, name, value, *_0, _1, _4$$3, _5$$4;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&headers_sub);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$4);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_http_response_headersinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &headers);
- ZEPHIR_CALL_METHOD(&data, headers, "toarray", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&data, 0, "phalcon/Http/Response.zep", 628);
- if (Z_TYPE_P(&data) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0)
+ ZEPHIR_INIT_VAR(&dump);
+ array_init(&dump);
+ zephir_is_iterable(&argument, 0, "phalcon/Support/Debug.zep", 587);
+ if (Z_TYPE_P(&argument) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&argument), _3, _4, _1)
{
- ZEPHIR_INIT_NVAR(&name);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&name, _3);
+ ZEPHIR_INIT_NVAR(&k);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&k, _4);
} else {
- ZVAL_LONG(&name, _2);
+ ZVAL_LONG(&k, _3);
}
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_4$$3, "set", NULL, 0, &name, &value);
- zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&v);
+ ZVAL_COPY(&v, _1);
+ if (ZEPHIR_IS_STRING(&v, "")) {
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZVAL_STRING(&varDump, "(empty string)");
+ } else if (zephir_is_scalar(&v)) {
+ ZEPHIR_CALL_METHOD(&varDump, this_ptr, "escapestring", &_5, 0, &v);
+ zephir_check_call_status();
+ } else if (Z_TYPE_P(&v) == IS_ARRAY) {
+ ZVAL_LONG(&_7$$8, (zephir_get_numberval(n) + 1));
+ ZEPHIR_CALL_METHOD(&_6$$8, this_ptr, "getarraydump", &_8, 0, &v, &_7$$8);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZEPHIR_CONCAT_SVS(&varDump, "Array(", &_6$$8, ")");
+ } else if (Z_TYPE_P(&v) == IS_OBJECT) {
+ ZEPHIR_INIT_NVAR(&_9$$9);
+ zephir_get_class(&_9$$9, &v, 0);
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZEPHIR_CONCAT_SVS(&varDump, "Object(", &_9$$9, ")");
+ } else if (Z_TYPE_P(&v) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZVAL_STRING(&varDump, "null");
+ } else {
+ ZEPHIR_CPY_WRT(&varDump, &v);
+ }
+ ZEPHIR_INIT_NVAR(&_10$$5);
+ ZEPHIR_CONCAT_SVSV(&_10$$5, "[", &k, "] => ", &varDump);
+ zephir_array_append(&dump, &_10$$5, PH_SEPARATE, "phalcon/Support/Debug.zep", 584);
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &data, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &argument, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_1, &data, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_2, &argument, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_1)) {
+ if (!zend_is_true(&_2)) {
break;
}
- ZEPHIR_CALL_METHOD(&name, &data, "key", NULL, 0);
+ ZEPHIR_CALL_METHOD(&k, &argument, "key", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &data, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&v, &argument, "current", NULL, 0);
zephir_check_call_status();
- zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_5$$4, "set", NULL, 0, &name, &value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
+ if (ZEPHIR_IS_STRING(&v, "")) {
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZVAL_STRING(&varDump, "(empty string)");
+ } else if (zephir_is_scalar(&v)) {
+ ZEPHIR_CALL_METHOD(&varDump, this_ptr, "escapestring", &_5, 0, &v);
+ zephir_check_call_status();
+ } else if (Z_TYPE_P(&v) == IS_ARRAY) {
+ ZVAL_LONG(&_12$$15, (zephir_get_numberval(n) + 1));
+ ZEPHIR_CALL_METHOD(&_11$$15, this_ptr, "getarraydump", &_8, 0, &v, &_12$$15);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZEPHIR_CONCAT_SVS(&varDump, "Array(", &_11$$15, ")");
+ } else if (Z_TYPE_P(&v) == IS_OBJECT) {
+ ZEPHIR_INIT_NVAR(&_13$$16);
+ zephir_get_class(&_13$$16, &v, 0);
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZEPHIR_CONCAT_SVS(&varDump, "Object(", &_13$$16, ")");
+ } else if (Z_TYPE_P(&v) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&varDump);
+ ZVAL_STRING(&varDump, "null");
+ } else {
+ ZEPHIR_CPY_WRT(&varDump, &v);
+ }
+ ZEPHIR_INIT_NVAR(&_14$$12);
+ ZEPHIR_CONCAT_SVSV(&_14$$12, "[", &k, "] => ", &varDump);
+ zephir_array_append(&dump, &_14$$12, PH_SEPARATE, "phalcon/Support/Debug.zep", 584);
+ ZEPHIR_CALL_METHOD(NULL, &argument, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&name);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response, setJsonContent)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long jsonOptions, depth, ZEPHIR_LAST_CALL_STATUS;
- zval *content, content_sub, *jsonOptions_param = NULL, *depth_param = NULL, _0, _1, _2, _3, _4;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&content_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_ZVAL(content)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(jsonOptions)
- Z_PARAM_LONG(depth)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &content, &jsonOptions_param, &depth_param);
- if (!jsonOptions_param) {
- jsonOptions = 0;
- } else {
- }
- if (!depth_param) {
- depth = 512;
- } else {
- }
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "application/json");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontenttype", NULL, 0, &_0);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("encode"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_3, jsonOptions);
- ZVAL_LONG(&_4, depth);
- ZEPHIR_CALL_METHOD(&_2, &_1, "__invoke", NULL, 0, content, &_3, &_4);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontent", NULL, 0, &_2);
- zephir_check_call_status();
- RETURN_THIS();
+ ZEPHIR_INIT_NVAR(&v);
+ ZEPHIR_INIT_NVAR(&k);
+ zephir_fast_join_str(return_value, SL(", "), &dump);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response, setLastModified)
+static PHP_METHOD(Phalcon_Support_Debug, getVarDump)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *datetime, datetime_sub, date, _0, _1, _2, _3;
+ zval *variable, variable_sub, className, dumpedObject, _0$$8, _1$$10;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&datetime_sub);
- ZVAL_UNDEF(&date);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&dumpedObject);
+ ZVAL_UNDEF(&_0$$8);
+ ZVAL_UNDEF(&_1$$10);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(datetime, php_date_get_date_ce())
+ Z_PARAM_ZVAL(variable)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &datetime);
- ZEPHIR_INIT_VAR(&date);
- if (zephir_clone(&date, datetime) == FAILURE) {
+ zephir_fetch_params(1, 1, 0, &variable);
+ if (ZEPHIR_IS_TRUE_IDENTICAL(variable)) {
+ RETURN_MM_STRING("true");
+ }
+ if (ZEPHIR_IS_FALSE_IDENTICAL(variable)) {
+ RETURN_MM_STRING("false");
+ }
+ if (Z_TYPE_P(variable) == IS_STRING) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escapestring", NULL, 0, variable);
+ zephir_check_call_status();
RETURN_MM();
}
- ZEPHIR_INIT_VAR(&_0);
- object_init_ex(&_0, php_date_get_timezone_ce());
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "UTC");
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &date, "settimezone", NULL, 0, &_0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "D, d M Y H:i:s");
- ZEPHIR_CALL_METHOD(&_2, &date, "format", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_VS(&_3, &_2, " GMT");
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "Last-Modified");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &_3);
- zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response, setNotModified)
-{
- zval _0, _1;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZVAL_LONG(&_0, 304);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "Not modified");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_THIS();
+ if (zephir_is_scalar(variable)) {
+ RETVAL_ZVAL(variable, 1, 0);
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(variable) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&className);
+ zephir_get_class(&className, variable, 0);
+ if ((zephir_method_exists_ex(variable, ZEND_STRL("dump")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(&dumpedObject, variable, "dump", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "getarraydump", NULL, 0, &dumpedObject);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVSVS(return_value, "Object(", &className, ": ", &_0$$8, ")");
+ RETURN_MM();
+ } else {
+ ZEPHIR_CONCAT_SVS(return_value, "Object(", &className, ")");
+ RETURN_MM();
+ }
+ }
+ if (Z_TYPE_P(variable) == IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(&_1$$10, this_ptr, "getarraydump", NULL, 0, variable);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_SVS(return_value, "Array(", &_1$$10, ")");
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(variable) == IS_NULL) {
+ RETURN_MM_STRING("null");
+ }
+ zephir_gettype(return_value, variable);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response, setStatusCode)
+static PHP_METHOD(Phalcon_Support_Debug, showTraceItem)
{
- zend_bool _6$$3, _11$$5;
- zend_string *_5;
- zend_ulong _4;
+ zend_bool _45$$25;
+ zval _1, _31$$17;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_9 = NULL;
- zval message, _17, _20;
- zval *code_param = NULL, *message_param = NULL, currentHeadersRaw, key, statusCodes, defaultMessage, _0, _1, *_2, _3, _15, _16, _18, _19, _21, _7$$3, _8$$3, _10$$4, _12$$5, _13$$5, _14$$6;
- zend_long code, ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_24 = NULL, *_52 = NULL;
+ zval trace;
+ zval *n_param = NULL, *trace_param = NULL, className, prepareInternalClass, preparedFunctionName, html, classReflection, prepareUriClass, functionName, functionReflection, traceArgs, arguments, argument, filez, line, showFiles, lines, numberLines, showFileFragment, firstLine, lastLine, linePosition, currentLine, classNameWithLink, functionNameWithLink, parts, _0, _20, _2$$3, _3$$3, _4$$3, _5$$3, _15$$3, _16$$3, _6$$4, _7$$4, _8$$4, _9$$4, _10$$4, _11$$5, _12$$6, _13$$6, _14$$6, _17$$10, _18$$11, _19$$11, *_21$$14, _22$$14, _28$$14, _29$$14, _23$$15, _25$$15, _26$$16, _27$$16, _30$$17, _32$$17, _33$$17, _34$$18, _35$$19, _36$$24, _37$$27, _38$$27, _39$$27, _40$$27, _41$$27, _42$$28, _43$$28, _44$$28, _46$$30, _47$$30, _48$$30, _49$$30, _50$$30, _51$$30;
+ zend_long n, ZEPHIR_LAST_CALL_STATUS, i = 0, beforeLine$$19, afterLine$$19;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¤tHeadersRaw);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&statusCodes);
- ZVAL_UNDEF(&defaultMessage);
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&prepareInternalClass);
+ ZVAL_UNDEF(&preparedFunctionName);
+ ZVAL_UNDEF(&html);
+ ZVAL_UNDEF(&classReflection);
+ ZVAL_UNDEF(&prepareUriClass);
+ ZVAL_UNDEF(&functionName);
+ ZVAL_UNDEF(&functionReflection);
+ ZVAL_UNDEF(&traceArgs);
+ ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&argument);
+ ZVAL_UNDEF(&filez);
+ ZVAL_UNDEF(&line);
+ ZVAL_UNDEF(&showFiles);
+ ZVAL_UNDEF(&lines);
+ ZVAL_UNDEF(&numberLines);
+ ZVAL_UNDEF(&showFileFragment);
+ ZVAL_UNDEF(&firstLine);
+ ZVAL_UNDEF(&lastLine);
+ ZVAL_UNDEF(&linePosition);
+ ZVAL_UNDEF(¤tLine);
+ ZVAL_UNDEF(&classNameWithLink);
+ ZVAL_UNDEF(&functionNameWithLink);
+ ZVAL_UNDEF(&parts);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_15);
- ZVAL_UNDEF(&_16);
- ZVAL_UNDEF(&_18);
- ZVAL_UNDEF(&_19);
- ZVAL_UNDEF(&_21);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_20);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_15$$3);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
ZVAL_UNDEF(&_10$$4);
- ZVAL_UNDEF(&_12$$5);
- ZVAL_UNDEF(&_13$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&_13$$6);
ZVAL_UNDEF(&_14$$6);
- ZVAL_UNDEF(&message);
- ZVAL_UNDEF(&_17);
- ZVAL_UNDEF(&_20);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_LONG(code)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(message)
+ ZVAL_UNDEF(&_17$$10);
+ ZVAL_UNDEF(&_18$$11);
+ ZVAL_UNDEF(&_19$$11);
+ ZVAL_UNDEF(&_22$$14);
+ ZVAL_UNDEF(&_28$$14);
+ ZVAL_UNDEF(&_29$$14);
+ ZVAL_UNDEF(&_23$$15);
+ ZVAL_UNDEF(&_25$$15);
+ ZVAL_UNDEF(&_26$$16);
+ ZVAL_UNDEF(&_27$$16);
+ ZVAL_UNDEF(&_30$$17);
+ ZVAL_UNDEF(&_32$$17);
+ ZVAL_UNDEF(&_33$$17);
+ ZVAL_UNDEF(&_34$$18);
+ ZVAL_UNDEF(&_35$$19);
+ ZVAL_UNDEF(&_36$$24);
+ ZVAL_UNDEF(&_37$$27);
+ ZVAL_UNDEF(&_38$$27);
+ ZVAL_UNDEF(&_39$$27);
+ ZVAL_UNDEF(&_40$$27);
+ ZVAL_UNDEF(&_41$$27);
+ ZVAL_UNDEF(&_42$$28);
+ ZVAL_UNDEF(&_43$$28);
+ ZVAL_UNDEF(&_44$$28);
+ ZVAL_UNDEF(&_46$$30);
+ ZVAL_UNDEF(&_47$$30);
+ ZVAL_UNDEF(&_48$$30);
+ ZVAL_UNDEF(&_49$$30);
+ ZVAL_UNDEF(&_50$$30);
+ ZVAL_UNDEF(&_51$$30);
+ ZVAL_UNDEF(&trace);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_31$$17);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(n)
+ Z_PARAM_ARRAY(trace)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &code_param, &message_param);
- if (!message_param) {
- ZEPHIR_INIT_VAR(&message);
- } else {
- zephir_get_strval(&message, message_param);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(¤tHeadersRaw, &_0, "toarray", NULL, 0);
- zephir_check_call_status();
+ zephir_fetch_params(1, 2, 0, &n_param, &trace_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&trace, trace_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_LONG(&_0, n);
ZEPHIR_INIT_VAR(&_1);
- zephir_is_iterable(¤tHeadersRaw, 0, "phalcon/Http/Response.zep", 717);
- if (Z_TYPE_P(¤tHeadersRaw) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¤tHeadersRaw), _4, _5, _2)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_5 != NULL) {
- ZVAL_STR_COPY(&key, _5);
+ ZEPHIR_CONCAT_SVS(&_1, "
#", &_0, " | ");
+ ZEPHIR_CPY_WRT(&html, &_1);
+ zephir_memory_observe(&className);
+ if (zephir_array_isset_string_fetch(&className, &trace, SL("class"), 0)) {
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZVAL_STRING(&_3$$3, "/^Phalcon/");
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZEPHIR_INIT_VAR(&_5$$3);
+ ZVAL_STRING(&_5$$3, "/^Phalcon/");
+ zephir_preg_match(&_4$$3, &_5$$3, &className, &_2$$3, 0, 0 , 0 );
+ if (zephir_is_true(&_4$$3)) {
+ ZEPHIR_INIT_VAR(&parts);
+ zephir_fast_explode_str(&parts, SL("\\"), &className, LONG_MAX);
+ zephir_array_fetch_long(&_6$$4, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 700);
+ zephir_array_fetch_long(&_7$$4, &parts, 1, PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 700);
+ ZEPHIR_INIT_VAR(&prepareUriClass);
+ ZEPHIR_CONCAT_VSV(&prepareUriClass, &_6$$4, "_", &_7$$4);
+ zephir_read_property(&_8$$4, this_ptr, ZEND_STRL("version"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_10$$4, 0);
+ ZEPHIR_CALL_METHOD(&_9$$4, &_8$$4, "getpart", NULL, 0, &_10$$4);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&classNameWithLink);
+ ZEPHIR_CONCAT_SVSVSVS(&classNameWithLink, "", &className, "");
+ } else {
+ ZEPHIR_INIT_VAR(&classReflection);
+ object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass")));
+ ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 154, &className);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_11$$5, &classReflection, "isinternal", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_11$$5)) {
+ ZEPHIR_INIT_VAR(&_12$$6);
+ zephir_fast_strtolower(&_12$$6, &className);
+ ZEPHIR_INIT_VAR(&_13$$6);
+ ZVAL_STRING(&_13$$6, "_");
+ ZEPHIR_INIT_VAR(&_14$$6);
+ ZVAL_STRING(&_14$$6, "-");
+ ZEPHIR_INIT_VAR(&prepareInternalClass);
+ zephir_fast_str_replace(&prepareInternalClass, &_13$$6, &_14$$6, &_12$$6);
+ ZEPHIR_INIT_NVAR(&classNameWithLink);
+ ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, "");
} else {
- ZVAL_LONG(&key, _4);
- }
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_COPY(&_1, _2);
- _6$$3 = Z_TYPE_P(&key) == IS_STRING;
- if (_6$$3) {
- ZEPHIR_INIT_NVAR(&_7$$3);
- ZVAL_STRING(&_7$$3, "HTTP/");
- ZEPHIR_CALL_FUNCTION(&_8$$3, "strstr", &_9, 355, &key, &_7$$3);
- zephir_check_call_status();
- _6$$3 = zephir_is_true(&_8$$3);
- }
- if (_6$$3) {
- zephir_read_property(&_10$$4, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_10$$4, "remove", NULL, 0, &key);
- zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&classNameWithLink, &className);
}
- } ZEND_HASH_FOREACH_END();
+ }
+ ZEPHIR_INIT_VAR(&_15$$3);
+ ZEPHIR_CONCAT_SVS(&_15$$3, "", &classNameWithLink, "");
+ zephir_concat_self(&html, &_15$$3);
+ zephir_array_fetch_string(&_16$$3, &trace, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Support/Debug.zep", 739);
+ zephir_concat_self(&html, &_16$$3);
+ }
+ zephir_memory_observe(&functionName);
+ zephir_array_fetch_string(&functionName, &trace, SL("function"), PH_NOISY, "phalcon/Support/Debug.zep", 745);
+ if (zephir_array_isset_string(&trace, SL("class"))) {
+ ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName);
} else {
- ZEPHIR_CALL_METHOD(NULL, ¤tHeadersRaw, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_3, ¤tHeadersRaw, "valid", NULL, 0);
+ if ((zephir_function_exists(&functionName) == SUCCESS)) {
+ ZEPHIR_INIT_VAR(&functionReflection);
+ object_init_ex(&functionReflection, zephir_get_internal_ce(SL("reflectionfunction")));
+ ZEPHIR_CALL_METHOD(NULL, &functionReflection, "__construct", NULL, 151, &functionName);
zephir_check_call_status();
- if (!zend_is_true(&_3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, ¤tHeadersRaw, "key", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_17$$10, &functionReflection, "isinternal", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, ¤tHeadersRaw, "current", NULL, 0);
+ if (zephir_is_true(&_17$$10)) {
+ ZEPHIR_INIT_VAR(&_18$$11);
+ ZVAL_STRING(&_18$$11, "_");
+ ZEPHIR_INIT_VAR(&_19$$11);
+ ZVAL_STRING(&_19$$11, "-");
+ ZEPHIR_INIT_VAR(&preparedFunctionName);
+ zephir_fast_str_replace(&preparedFunctionName, &_18$$11, &_19$$11, &functionName);
+ ZEPHIR_INIT_NVAR(&functionNameWithLink);
+ ZEPHIR_CONCAT_SVSVS(&functionNameWithLink, "", &functionName, "");
+ } else {
+ ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName);
+ }
+ } else {
+ ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName);
+ }
+ }
+ ZEPHIR_INIT_VAR(&_20);
+ ZEPHIR_CONCAT_SVS(&_20, "", &functionNameWithLink, "");
+ zephir_concat_self(&html, &_20);
+ zephir_memory_observe(&traceArgs);
+ if (zephir_array_isset_string_fetch(&traceArgs, &trace, SL("args"), 0)) {
+ ZEPHIR_INIT_VAR(&arguments);
+ array_init(&arguments);
+ zephir_is_iterable(&traceArgs, 0, "phalcon/Support/Debug.zep", 800);
+ if (Z_TYPE_P(&traceArgs) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&traceArgs), _21$$14)
+ {
+ ZEPHIR_INIT_NVAR(&argument);
+ ZVAL_COPY(&argument, _21$$14);
+ ZEPHIR_CALL_METHOD(&_23$$15, this_ptr, "getvardump", &_24, 0, &argument);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_25$$15);
+ ZEPHIR_CONCAT_SVS(&_25$$15, "", &_23$$15, "");
+ zephir_array_append(&arguments, &_25$$15, PH_SEPARATE, "phalcon/Support/Debug.zep", 794);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &traceArgs, "rewind", NULL, 0);
zephir_check_call_status();
- _11$$5 = Z_TYPE_P(&key) == IS_STRING;
- if (_11$$5) {
- ZEPHIR_INIT_NVAR(&_12$$5);
- ZVAL_STRING(&_12$$5, "HTTP/");
- ZEPHIR_CALL_FUNCTION(&_13$$5, "strstr", &_9, 355, &key, &_12$$5);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_22$$14, &traceArgs, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_22$$14)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&argument, &traceArgs, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_26$$16, this_ptr, "getvardump", &_24, 0, &argument);
zephir_check_call_status();
- _11$$5 = zephir_is_true(&_13$$5);
+ ZEPHIR_INIT_NVAR(&_27$$16);
+ ZEPHIR_CONCAT_SVS(&_27$$16, "", &_26$$16, "");
+ zephir_array_append(&arguments, &_27$$16, PH_SEPARATE, "phalcon/Support/Debug.zep", 794);
+ ZEPHIR_CALL_METHOD(NULL, &traceArgs, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&argument);
+ ZEPHIR_INIT_VAR(&_28$$14);
+ zephir_fast_join_str(&_28$$14, SL(", "), &arguments);
+ ZEPHIR_INIT_VAR(&_29$$14);
+ ZEPHIR_CONCAT_SVS(&_29$$14, "(", &_28$$14, ")");
+ zephir_concat_self(&html, &_29$$14);
+ }
+ zephir_memory_observe(&filez);
+ if (zephir_array_isset_string_fetch(&filez, &trace, SL("file"), 0)) {
+ zephir_memory_observe(&_30$$17);
+ zephir_array_fetch_string(&_30$$17, &trace, SL("line"), PH_NOISY, "phalcon/Support/Debug.zep", 808);
+ zephir_cast_to_string(&_31$$17, &_30$$17);
+ ZEPHIR_CPY_WRT(&line, &_31$$17);
+ ZEPHIR_INIT_VAR(&_32$$17);
+ ZEPHIR_CONCAT_SVSVS(&_32$$17, "
", &filez, " (", &line, ") ");
+ zephir_concat_self(&html, &_32$$17);
+ zephir_read_property(&_33$$17, this_ptr, ZEND_STRL("showFiles"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&showFiles, &_33$$17);
+ if (zephir_is_true(&showFiles)) {
+ ZEPHIR_CALL_FUNCTION(&lines, "file", NULL, 0, &filez);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&numberLines);
+ ZVAL_LONG(&numberLines, zephir_fast_count_int(&lines));
+ zephir_read_property(&_34$$18, this_ptr, ZEND_STRL("showFileFragment"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&showFileFragment, &_34$$18);
+ if (zephir_is_true(&showFileFragment)) {
+ beforeLine$$19 = (zephir_get_numberval(&line) - 7);
+ if (beforeLine$$19 < 1) {
+ ZEPHIR_INIT_VAR(&firstLine);
+ ZVAL_LONG(&firstLine, 1);
+ } else {
+ ZEPHIR_INIT_NVAR(&firstLine);
+ ZVAL_LONG(&firstLine, beforeLine$$19);
+ }
+ afterLine$$19 = (zephir_get_numberval(&line) + 5);
+ if (ZEPHIR_LT_LONG(&numberLines, afterLine$$19)) {
+ ZEPHIR_CPY_WRT(&lastLine, &numberLines);
+ } else {
+ ZEPHIR_INIT_NVAR(&lastLine);
+ ZVAL_LONG(&lastLine, afterLine$$19);
+ }
+ ZEPHIR_INIT_VAR(&_35$$19);
+ ZEPHIR_CONCAT_SVSVSVS(&_35$$19, "");
+ zephir_concat_self(&html, &_35$$19);
+ } else {
+ ZEPHIR_INIT_NVAR(&firstLine);
+ ZVAL_LONG(&firstLine, 1);
+ ZEPHIR_CPY_WRT(&lastLine, &numberLines);
+ ZEPHIR_INIT_VAR(&_36$$24);
+ ZEPHIR_CONCAT_SVSVS(&_36$$24, "");
+ zephir_concat_self(&html, &_36$$24);
+ }
+ i = zephir_get_numberval(&firstLine);
+ while (1) {
+ if (!(ZEPHIR_GE_LONG(&lastLine, i))) {
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&linePosition);
+ ZVAL_LONG(&linePosition, (i - 1));
+ ZEPHIR_OBS_NVAR(¤tLine);
+ zephir_array_fetch(¤tLine, &lines, &linePosition, PH_NOISY, "phalcon/Support/Debug.zep", 881);
+ if (zephir_is_true(&showFileFragment)) {
+ if (ZEPHIR_IS_LONG(&firstLine, i)) {
+ ZEPHIR_INIT_NVAR(&_37$$27);
+ ZEPHIR_INIT_NVAR(&_38$$27);
+ zephir_fast_trim(&_38$$27, ¤tLine, NULL , ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&_39$$27);
+ ZVAL_STRING(&_39$$27, "#\\*\\/#");
+ ZEPHIR_INIT_NVAR(&_40$$27);
+ ZEPHIR_INIT_NVAR(&_41$$27);
+ ZVAL_STRING(&_41$$27, "#\\*\\/#");
+ zephir_preg_match(&_40$$27, &_41$$27, &_38$$27, &_37$$27, 0, 0 , 0 );
+ if (zephir_is_true(&_40$$27)) {
+ ZEPHIR_INIT_NVAR(&_42$$28);
+ ZEPHIR_INIT_NVAR(&_43$$28);
+ ZVAL_STRING(&_43$$28, "* /");
+ ZEPHIR_INIT_NVAR(&_44$$28);
+ ZVAL_STRING(&_44$$28, " ");
+ zephir_fast_str_replace(&_42$$28, &_43$$28, &_44$$28, ¤tLine);
+ ZEPHIR_CPY_WRT(¤tLine, &_42$$28);
+ }
+ }
}
- if (_11$$5) {
- zephir_read_property(&_14$$6, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_14$$6, "remove", NULL, 0, &key);
+ _45$$25 = ZEPHIR_IS_STRING(¤tLine, "\n");
+ if (!(_45$$25)) {
+ _45$$25 = ZEPHIR_IS_STRING(¤tLine, "\r\n");
+ }
+ if (_45$$25) {
+ zephir_concat_self_str(&html, SL(" \n"));
+ } else {
+ ZEPHIR_INIT_NVAR(&_46$$30);
+ ZEPHIR_INIT_NVAR(&_47$$30);
+ ZVAL_STRING(&_47$$30, "\t");
+ ZEPHIR_INIT_NVAR(&_48$$30);
+ ZVAL_STRING(&_48$$30, " ");
+ zephir_fast_str_replace(&_46$$30, &_47$$30, &_48$$30, ¤tLine);
+ ZVAL_LONG(&_49$$30, 2);
+ ZEPHIR_INIT_NVAR(&_50$$30);
+ ZVAL_STRING(&_50$$30, "UTF-8");
+ ZEPHIR_CALL_FUNCTION(&_51$$30, "htmlentities", &_52, 0, &_46$$30, &_49$$30, &_50$$30);
zephir_check_call_status();
+ zephir_concat_self(&html, &_51$$30);
}
- ZEPHIR_CALL_METHOD(NULL, ¤tHeadersRaw, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&_1);
- ZEPHIR_INIT_NVAR(&key);
- if (ZEPHIR_IS_NULL(&message)) {
- ZEPHIR_INIT_VAR(&statusCodes);
- zephir_create_array(&statusCodes, 89, 0);
- add_index_stringl(&statusCodes, 100, SL("Continue"));
- add_index_stringl(&statusCodes, 101, SL("Switching Protocols"));
- add_index_stringl(&statusCodes, 102, SL("Processing"));
- add_index_stringl(&statusCodes, 103, SL("Early Hints"));
- add_index_stringl(&statusCodes, 200, SL("OK"));
- add_index_stringl(&statusCodes, 201, SL("Created"));
- add_index_stringl(&statusCodes, 202, SL("Accepted"));
- add_index_stringl(&statusCodes, 203, SL("Non-Authoritative Information"));
- add_index_stringl(&statusCodes, 204, SL("No Content"));
- add_index_stringl(&statusCodes, 205, SL("Reset Content"));
- add_index_stringl(&statusCodes, 206, SL("Partial Content"));
- add_index_stringl(&statusCodes, 207, SL("Multi-status"));
- add_index_stringl(&statusCodes, 208, SL("Already Reported"));
- add_index_stringl(&statusCodes, 226, SL("IM Used"));
- add_index_stringl(&statusCodes, 300, SL("Multiple Choices"));
- add_index_stringl(&statusCodes, 301, SL("Moved Permanently"));
- add_index_stringl(&statusCodes, 302, SL("Found"));
- add_index_stringl(&statusCodes, 303, SL("See Other"));
- add_index_stringl(&statusCodes, 304, SL("Not Modified"));
- add_index_stringl(&statusCodes, 305, SL("Use Proxy"));
- add_index_stringl(&statusCodes, 306, SL("Switch Proxy"));
- add_index_stringl(&statusCodes, 307, SL("Temporary Redirect"));
- add_index_stringl(&statusCodes, 308, SL("Permanent Redirect"));
- add_index_stringl(&statusCodes, 400, SL("Bad Request"));
- add_index_stringl(&statusCodes, 401, SL("Unauthorized"));
- add_index_stringl(&statusCodes, 402, SL("Payment Required"));
- add_index_stringl(&statusCodes, 403, SL("Forbidden"));
- add_index_stringl(&statusCodes, 404, SL("Not Found"));
- add_index_stringl(&statusCodes, 405, SL("Method Not Allowed"));
- add_index_stringl(&statusCodes, 406, SL("Not Acceptable"));
- add_index_stringl(&statusCodes, 407, SL("Proxy Authentication Required"));
- add_index_stringl(&statusCodes, 408, SL("Request Time-out"));
- add_index_stringl(&statusCodes, 409, SL("Conflict"));
- add_index_stringl(&statusCodes, 410, SL("Gone"));
- add_index_stringl(&statusCodes, 411, SL("Length Required"));
- add_index_stringl(&statusCodes, 412, SL("Precondition Failed"));
- add_index_stringl(&statusCodes, 413, SL("Request Entity Too Large"));
- add_index_stringl(&statusCodes, 414, SL("Request-URI Too Large"));
- add_index_stringl(&statusCodes, 415, SL("Unsupported Media Type"));
- add_index_stringl(&statusCodes, 416, SL("Requested range not satisfiable"));
- add_index_stringl(&statusCodes, 417, SL("Expectation Failed"));
- add_index_stringl(&statusCodes, 418, SL("I'm a teapot"));
- add_index_stringl(&statusCodes, 421, SL("Misdirected Request"));
- add_index_stringl(&statusCodes, 422, SL("Unprocessable Entity"));
- add_index_stringl(&statusCodes, 423, SL("Locked"));
- add_index_stringl(&statusCodes, 424, SL("Failed Dependency"));
- add_index_stringl(&statusCodes, 425, SL("Unordered Collection"));
- add_index_stringl(&statusCodes, 426, SL("Upgrade Required"));
- add_index_stringl(&statusCodes, 428, SL("Precondition Required"));
- add_index_stringl(&statusCodes, 429, SL("Too Many Requests"));
- add_index_stringl(&statusCodes, 431, SL("Request Header Fields Too Large"));
- add_index_stringl(&statusCodes, 451, SL("Unavailable For Legal Reasons"));
- add_index_stringl(&statusCodes, 500, SL("Internal Server Error"));
- add_index_stringl(&statusCodes, 501, SL("Not Implemented"));
- add_index_stringl(&statusCodes, 502, SL("Bad Gateway"));
- add_index_stringl(&statusCodes, 503, SL("Service Unavailable"));
- add_index_stringl(&statusCodes, 504, SL("Gateway Time-out"));
- add_index_stringl(&statusCodes, 505, SL("HTTP Version not supported"));
- add_index_stringl(&statusCodes, 506, SL("Variant Also Negotiates"));
- add_index_stringl(&statusCodes, 507, SL("Insufficient Storage"));
- add_index_stringl(&statusCodes, 508, SL("Loop Detected"));
- add_index_stringl(&statusCodes, 510, SL("Not Extended"));
- add_index_stringl(&statusCodes, 511, SL("Network Authentication Required"));
- add_index_stringl(&statusCodes, 218, SL("This is fine"));
- add_index_stringl(&statusCodes, 419, SL("Page Expired"));
- add_index_stringl(&statusCodes, 420, SL("Method Failure"));
- add_index_stringl(&statusCodes, 440, SL("Login Time-out"));
- add_index_stringl(&statusCodes, 444, SL("No Response"));
- add_index_stringl(&statusCodes, 449, SL("Retry With"));
- add_index_stringl(&statusCodes, 450, SL("Blocked by Windows Parental Controls (Microsoft)"));
- add_index_stringl(&statusCodes, 494, SL("Request header too large"));
- add_index_stringl(&statusCodes, 495, SL("SSL Certificate Error"));
- add_index_stringl(&statusCodes, 496, SL("SSL Certificate Required"));
- add_index_stringl(&statusCodes, 497, SL("HTTP Request Sent to HTTPS Port"));
- add_index_stringl(&statusCodes, 498, SL("Invalid Token (Esri)"));
- add_index_stringl(&statusCodes, 499, SL("Client Closed Request"));
- add_index_stringl(&statusCodes, 509, SL("Bandwidth Limit Exceeded"));
- add_index_stringl(&statusCodes, 520, SL("Unknown Error"));
- add_index_stringl(&statusCodes, 521, SL("Web Server Is Down"));
- add_index_stringl(&statusCodes, 522, SL("Connection Timed Out"));
- add_index_stringl(&statusCodes, 523, SL("Origin Is Unreachable"));
- add_index_stringl(&statusCodes, 524, SL("A Timeout Occurred"));
- add_index_stringl(&statusCodes, 525, SL("SSL Handshake Failed"));
- add_index_stringl(&statusCodes, 526, SL("Invalid SSL Certificate"));
- add_index_stringl(&statusCodes, 527, SL("Railgun Error"));
- add_index_stringl(&statusCodes, 530, SL("Origin DNS Error"));
- add_index_stringl(&statusCodes, 598, SL("Network read timeout error"));
- add_index_stringl(&statusCodes, 599, SL("Network Connect Timeout Error"));
- if (UNEXPECTED(!(zephir_array_isset_long(&statusCodes, code)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "Non-standard statuscode given without a message", "phalcon/Http/Response.zep", 824);
- return;
+ i++;
+ }
+ zephir_concat_self_str(&html, SL(" "));
}
- zephir_memory_observe(&defaultMessage);
- zephir_array_fetch_long(&defaultMessage, &statusCodes, code, PH_NOISY, "phalcon/Http/Response.zep", 827);
- zephir_get_strval(&message, &defaultMessage);
}
- zephir_read_property(&_15, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_16);
- ZVAL_LONG(&_16, code);
- ZEPHIR_INIT_VAR(&_17);
- ZEPHIR_CONCAT_SVSV(&_17, "HTTP/1.1 ", &_16, " ", &message);
- ZEPHIR_CALL_METHOD(NULL, &_15, "setraw", NULL, 0, &_17);
- zephir_check_call_status();
- zephir_read_property(&_18, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_19);
- ZVAL_LONG(&_19, code);
- ZEPHIR_INIT_VAR(&_20);
- ZEPHIR_CONCAT_VSV(&_20, &_19, " ", &message);
- ZEPHIR_INIT_VAR(&_21);
- ZVAL_STRING(&_21, "Status");
- ZEPHIR_CALL_METHOD(NULL, &_18, "set", NULL, 0, &_21, &_20);
- zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response, setRawHeader)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *header_param = NULL, _0;
- zval header;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&header);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(header)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &header_param);
- zephir_get_strval(&header, header_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "setraw", NULL, 0, &header);
- zephir_check_call_status();
- RETURN_THIS();
+ zephir_concat_self_str(&html, SL(" |
"));
+ RETURN_CCTOR(&html);
}
-static PHP_METHOD(Phalcon_Http_Response, getBasename)
+static PHP_METHOD(Phalcon_Support_Debug, getArrVal)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *uri_param = NULL, *suffix = NULL, suffix_sub, __$null, filename, matches, _0, _1, _2, _3, _4, _5, _6$$3, _7$$3, _8$$3, _9$$3;
- zval uri;
+ zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value;
+ zval collection;
- ZVAL_UNDEF(&uri);
- ZVAL_UNDEF(&suffix_sub);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&filename);
- ZVAL_UNDEF(&matches);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_8$$3);
- ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&value);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(uri)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(index)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(suffix)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &uri_param, &suffix);
- if (UNEXPECTED(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) {
- zephir_get_strval(&uri, uri_param);
- } else {
- ZEPHIR_INIT_VAR(&uri);
- }
- if (!suffix) {
- suffix = &suffix_sub;
- suffix = &__$null;
- }
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "/");
- zephir_fast_trim(&_0, &uri, &_1, ZEPHIR_TRIM_RIGHT);
- zephir_get_strval(&uri, &_0);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "/");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "@");
- ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 351, &_2, &_3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_5);
- ZEPHIR_CONCAT_SVS(&_5, "@[^", &_4, "]+$@");
- ZEPHIR_INIT_NVAR(&_2);
- zephir_preg_match(&_2, &_5, &uri, &matches, 0, 0 , 0 );
- if (zephir_is_true(&_2)) {
- zephir_memory_observe(&filename);
- zephir_array_fetch_long(&filename, &matches, 0, PH_NOISY, "phalcon/Http/Response.zep", 867);
- } else {
- ZEPHIR_INIT_NVAR(&filename);
- ZVAL_STRING(&filename, "");
+ zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- if (zephir_is_true(suffix)) {
- ZEPHIR_INIT_VAR(&_6$$3);
- ZVAL_STRING(&_6$$3, "@");
- ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 351, suffix, &_6$$3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_8$$3);
- ZEPHIR_CONCAT_SVS(&_8$$3, "@", &_7$$3, "$@");
- ZEPHIR_INIT_NVAR(&_6$$3);
- ZVAL_STRING(&_6$$3, "");
- ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 41, &_8$$3, &_6$$3, &filename);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&filename, &_9$$3);
+ zephir_memory_observe(&value);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
}
- RETURN_CCTOR(&filename);
+ RETURN_CCTOR(&value);
}
-zend_object *zephir_init_properties_Phalcon_Http_Response(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Support_Debug(zend_class_entry *class_type)
{
- zval _0, _1$$3;
+ zval _3$$4;
+ zval _0, _2, _1$$3, _4$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_3$$4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
@@ -141444,11 +137584,23 @@ zend_object *zephir_init_properties_Phalcon_Http_Response(zend_class_entry *clas
{
zval local_this_ptr, *this_ptr = &local_this_ptr;
ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("statusCodes"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_0) == IS_NULL) {
ZEPHIR_INIT_VAR(&_1$$3);
array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("statusCodes"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("data"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("blacklist"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_2) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ zephir_create_array(&_3$$4, 2, 0);
+ ZEPHIR_INIT_VAR(&_4$$4);
+ array_init(&_4$$4);
+ zephir_array_update_string(&_3$$4, SL("request"), &_4$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_4$$4);
+ array_init(&_4$$4);
+ zephir_array_update_string(&_3$$4, SL("server"), &_4$$4, PH_COPY | PH_SEPARATE);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("blacklist"), &_3$$4);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -141465,34 +137617,13 @@ zend_object *zephir_init_properties_Phalcon_Http_Response(zend_class_entry *clas
-ZEPHIR_INIT_CLASS(Phalcon_Http_ResponseInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Exception)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http, ResponseInterface, phalcon, http_responseinterface, phalcon_http_responseinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support, Exception, phalcon, support_exception, zend_ce_exception, NULL, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, appendContent);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, getContent);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, getStatusCode);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, getHeaders);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, hasHeader);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, isSent);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, redirect);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, resetHeaders);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setContent);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setContentLength);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setContentType);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setExpires);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setFileToSend);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setHeader);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setJsonContent);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setNotModified);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setRawHeader);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setStatusCode);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, send);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, sendCookies);
-ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, sendHeaders);
@@ -141503,47 +137634,181 @@ ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, sendHeaders);
-ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_CookieInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_HelperFactory)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Cookie, CookieInterface, phalcon, http_cookie_cookieinterface, phalcon_http_cookie_cookieinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support, HelperFactory, phalcon, support_helperfactory, phalcon_factory_abstractfactory_ce, phalcon_support_helperfactory_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, delete);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getDomain);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getExpiration);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getHttpOnly);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getName);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getOptions);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getPath);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getSecure);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getValue);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, isUsingEncryption);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, send);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setDomain);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setExpiration);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setHttpOnly);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setOptions);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setPath);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setSecure);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setValue);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, useEncryption);
+static PHP_METHOD(Phalcon_Support_HelperFactory, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *services_param = NULL;
+ zval services;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&services);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &services_param);
+ if (!services_param) {
+ ZEPHIR_INIT_VAR(&services);
+ array_init(&services);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
+static PHP_METHOD(Phalcon_Support_HelperFactory, __call)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval arguments, _0;
+ zval *name_param = NULL, *arguments_param = NULL, helper, _1;
+ zval name;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&helper);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_ARRAY(arguments)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &name_param, &arguments_param);
+ zephir_get_strval(&name, name_param);
+ zephir_get_arrval(&arguments, arguments_param);
+ ZEPHIR_CALL_METHOD(&helper, this_ptr, "newinstance", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 2, 0);
+ zephir_array_fast_append(&_0, &helper);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "__invoke");
+ zephir_array_fast_append(&_0, &_1);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0, &arguments);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Support_HelperFactory, newInstance)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, _0, _3, _4, _1$$3, _2$$3;
+ zval name;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
+ if (1 != zephir_array_isset(&_0, &name)) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getservice", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&_1$$3, &_2$$3);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("services"), &name, &_1$$3);
+ }
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_4, &_3, &name, PH_NOISY | PH_READONLY, "phalcon/Support/HelperFactory.zep", 118);
+ RETURN_CTOR(&_4);
+}
+static PHP_METHOD(Phalcon_Support_HelperFactory, getExceptionClass)
+{
+ RETURN_STRING("Phalcon\\Support\\Exception");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_Exception)
+static PHP_METHOD(Phalcon_Support_HelperFactory, getServices)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Cookie, Exception, phalcon, http_cookie_exception, zend_ce_exception, NULL, 0);
- return SUCCESS;
+ zephir_create_array(return_value, 59, 0);
+ add_assoc_stringl_ex(return_value, SL("blacklist"), SL("Phalcon\\Support\\Helper\\Arr\\Blacklist"));
+ add_assoc_stringl_ex(return_value, SL("chunk"), SL("Phalcon\\Support\\Helper\\Arr\\Chunk"));
+ add_assoc_stringl_ex(return_value, SL("filter"), SL("Phalcon\\Support\\Helper\\Arr\\Filter"));
+ add_assoc_stringl_ex(return_value, SL("first"), SL("Phalcon\\Support\\Helper\\Arr\\First"));
+ add_assoc_stringl_ex(return_value, SL("firstKey"), SL("Phalcon\\Support\\Helper\\Arr\\FirstKey"));
+ add_assoc_stringl_ex(return_value, SL("flatten"), SL("Phalcon\\Support\\Helper\\Arr\\Flatten"));
+ add_assoc_stringl_ex(return_value, SL("get"), SL("Phalcon\\Support\\Helper\\Arr\\Get"));
+ add_assoc_stringl_ex(return_value, SL("group"), SL("Phalcon\\Support\\Helper\\Arr\\Group"));
+ add_assoc_stringl_ex(return_value, SL("has"), SL("Phalcon\\Support\\Helper\\Arr\\Has"));
+ add_assoc_stringl_ex(return_value, SL("isUnique"), SL("Phalcon\\Support\\Helper\\Arr\\IsUnique"));
+ add_assoc_stringl_ex(return_value, SL("last"), SL("Phalcon\\Support\\Helper\\Arr\\Last"));
+ add_assoc_stringl_ex(return_value, SL("lastKey"), SL("Phalcon\\Support\\Helper\\Arr\\LastKey"));
+ add_assoc_stringl_ex(return_value, SL("order"), SL("Phalcon\\Support\\Helper\\Arr\\Order"));
+ add_assoc_stringl_ex(return_value, SL("pluck"), SL("Phalcon\\Support\\Helper\\Arr\\Pluck"));
+ add_assoc_stringl_ex(return_value, SL("set"), SL("Phalcon\\Support\\Helper\\Arr\\Set"));
+ add_assoc_stringl_ex(return_value, SL("sliceLeft"), SL("Phalcon\\Support\\Helper\\Arr\\SliceLeft"));
+ add_assoc_stringl_ex(return_value, SL("sliceRight"), SL("Phalcon\\Support\\Helper\\Arr\\SliceRight"));
+ add_assoc_stringl_ex(return_value, SL("split"), SL("Phalcon\\Support\\Helper\\Arr\\Split"));
+ add_assoc_stringl_ex(return_value, SL("toObject"), SL("Phalcon\\Support\\Helper\\Arr\\ToObject"));
+ add_assoc_stringl_ex(return_value, SL("validateAll"), SL("Phalcon\\Support\\Helper\\Arr\\ValidateAll"));
+ add_assoc_stringl_ex(return_value, SL("validateAny"), SL("Phalcon\\Support\\Helper\\Arr\\ValidateAny"));
+ add_assoc_stringl_ex(return_value, SL("whitelist"), SL("Phalcon\\Support\\Helper\\Arr\\Whitelist"));
+ add_assoc_stringl_ex(return_value, SL("basename"), SL("Phalcon\\Support\\Helper\\File\\Basename"));
+ add_assoc_stringl_ex(return_value, SL("decode"), SL("Phalcon\\Support\\Helper\\Json\\Decode"));
+ add_assoc_stringl_ex(return_value, SL("encode"), SL("Phalcon\\Support\\Helper\\Json\\Encode"));
+ add_assoc_stringl_ex(return_value, SL("isBetween"), SL("Phalcon\\Support\\Helper\\Number\\IsBetween"));
+ add_assoc_stringl_ex(return_value, SL("camelize"), SL("Phalcon\\Support\\Helper\\Str\\Camelize"));
+ add_assoc_stringl_ex(return_value, SL("concat"), SL("Phalcon\\Support\\Helper\\Str\\Concat"));
+ add_assoc_stringl_ex(return_value, SL("countVowels"), SL("Phalcon\\Support\\Helper\\Str\\CountVowels"));
+ add_assoc_stringl_ex(return_value, SL("decapitalize"), SL("Phalcon\\Support\\Helper\\Str\\Decapitalize"));
+ add_assoc_stringl_ex(return_value, SL("decrement"), SL("Phalcon\\Support\\Helper\\Str\\Decrement"));
+ add_assoc_stringl_ex(return_value, SL("dirFromFile"), SL("Phalcon\\Support\\Helper\\Str\\DirFromFile"));
+ add_assoc_stringl_ex(return_value, SL("dirSeparator"), SL("Phalcon\\Support\\Helper\\Str\\DirSeparator"));
+ add_assoc_stringl_ex(return_value, SL("dynamic"), SL("Phalcon\\Support\\Helper\\Str\\Dynamic"));
+ add_assoc_stringl_ex(return_value, SL("endsWith"), SL("Phalcon\\Support\\Helper\\Str\\EndsWith"));
+ add_assoc_stringl_ex(return_value, SL("firstBetween"), SL("Phalcon\\Support\\Helper\\Str\\FirstBetween"));
+ add_assoc_stringl_ex(return_value, SL("friendly"), SL("Phalcon\\Support\\Helper\\Str\\Friendly"));
+ add_assoc_stringl_ex(return_value, SL("humanize"), SL("Phalcon\\Support\\Helper\\Str\\Humanize"));
+ add_assoc_stringl_ex(return_value, SL("includes"), SL("Phalcon\\Support\\Helper\\Str\\Includes"));
+ add_assoc_stringl_ex(return_value, SL("increment"), SL("Phalcon\\Support\\Helper\\Str\\Increment"));
+ add_assoc_stringl_ex(return_value, SL("interpolate"), SL("Phalcon\\Support\\Helper\\Str\\Interpolate"));
+ add_assoc_stringl_ex(return_value, SL("isAnagram"), SL("Phalcon\\Support\\Helper\\Str\\IsAnagram"));
+ add_assoc_stringl_ex(return_value, SL("isLower"), SL("Phalcon\\Support\\Helper\\Str\\IsLower"));
+ add_assoc_stringl_ex(return_value, SL("isPalindrome"), SL("Phalcon\\Support\\Helper\\Str\\IsPalindrome"));
+ add_assoc_stringl_ex(return_value, SL("isUpper"), SL("Phalcon\\Support\\Helper\\Str\\IsUpper"));
+ add_assoc_stringl_ex(return_value, SL("kebabCase"), SL("Phalcon\\Support\\Helper\\Str\\KebabCase"));
+ add_assoc_stringl_ex(return_value, SL("len"), SL("Phalcon\\Support\\Helper\\Str\\Len"));
+ add_assoc_stringl_ex(return_value, SL("lower"), SL("Phalcon\\Support\\Helper\\Str\\Lower"));
+ add_assoc_stringl_ex(return_value, SL("pascalCase"), SL("Phalcon\\Support\\Helper\\Str\\PascalCase"));
+ add_assoc_stringl_ex(return_value, SL("prefix"), SL("Phalcon\\Support\\Helper\\Str\\Prefix"));
+ add_assoc_stringl_ex(return_value, SL("random"), SL("Phalcon\\Support\\Helper\\Str\\Random"));
+ add_assoc_stringl_ex(return_value, SL("reduceSlashes"), SL("Phalcon\\Support\\Helper\\Str\\ReduceSlashes"));
+ add_assoc_stringl_ex(return_value, SL("snakeCase"), SL("Phalcon\\Support\\Helper\\Str\\SnakeCase"));
+ add_assoc_stringl_ex(return_value, SL("startsWith"), SL("Phalcon\\Support\\Helper\\Str\\StartsWith"));
+ add_assoc_stringl_ex(return_value, SL("suffix"), SL("Phalcon\\Support\\Helper\\Str\\Suffix"));
+ add_assoc_stringl_ex(return_value, SL("ucwords"), SL("Phalcon\\Support\\Helper\\Str\\Ucwords"));
+ add_assoc_stringl_ex(return_value, SL("uncamelize"), SL("Phalcon\\Support\\Helper\\Str\\Uncamelize"));
+ add_assoc_stringl_ex(return_value, SL("underscore"), SL("Phalcon\\Support\\Helper\\Str\\Underscore"));
+ add_assoc_stringl_ex(return_value, SL("upper"), SL("Phalcon\\Support\\Helper\\Str\\Upper"));
+ return;
}
@@ -141556,787 +137821,727 @@ ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestMethodInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Registry)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, RequestMethodInterface, phalcon, http_message_requestmethodinterface, NULL);
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_CONNECT"), "CONNECT");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_DELETE"), "DELETE");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_GET"), "GET");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_HEAD"), "HEAD");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_OPTIONS"), "OPTIONS");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PATCH"), "PATCH");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_POST"), "POST");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PURGE"), "PURGE");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PUT"), "PUT");
-
- zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_TRACE"), "TRACE");
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support, Registry, phalcon, support_registry, phalcon_support_collection_ce, phalcon_support_registry_method_entry, ZEND_ACC_FINAL_CLASS);
return SUCCESS;
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseStatusCodeInterface)
+static PHP_METHOD(Phalcon_Support_Registry, __construct)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, ResponseStatusCodeInterface, phalcon, http_message_responsestatuscodeinterface, NULL);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONTINUE"), 100);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SWITCHING_PROTOCOLS"), 101);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROCESSING"), 102);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EARLY_HINTS"), 103);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_OK"), 200);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CREATED"), 201);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ACCEPTED"), 202);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NON_AUTHORITATIVE_INFORMATION"), 203);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_CONTENT"), 204);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESET_CONTENT"), 205);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PARTIAL_CONTENT"), 206);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTI_STATUS"), 207);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ALREADY_REPORTED"), 208);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_USED"), 226);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTIPLE_CHOICES"), 300);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MOVED_PERMANENTLY"), 301);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FOUND"), 302);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SEE_OTHER"), 303);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_MODIFIED"), 304);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_USE_PROXY"), 305);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESERVED"), 306);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TEMPORARY_REDIRECT"), 307);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PERMANENT_REDIRECT"), 308);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_REQUEST"), 400);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAUTHORIZED"), 401);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYMENT_REQUIRED"), 402);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FORBIDDEN"), 403);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_FOUND"), 404);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_NOT_ALLOWED"), 405);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_ACCEPTABLE"), 406);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROXY_AUTHENTICATION_REQUIRED"), 407);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_TIMEOUT"), 408);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONFLICT"), 409);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GONE"), 410);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LENGTH_REQUIRED"), 411);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_FAILED"), 412);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYLOAD_TOO_LARGE"), 413);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_URI_TOO_LONG"), 414);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNSUPPORTED_MEDIA_TYPE"), 415);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RANGE_NOT_SATISFIABLE"), 416);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EXPECTATION_FAILED"), 417);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_A_TEAPOT"), 418);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MISDIRECTED_REQUEST"), 421);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNPROCESSABLE_ENTITY"), 422);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOCKED"), 423);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FAILED_DEPENDENCY"), 424);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_EARLY"), 425);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UPGRADE_REQUIRED"), 426);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_REQUIRED"), 428);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_MANY_REQUESTS"), 429);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE"), 431);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAVAILABLE_FOR_LEGAL_REASONS"), 451);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INTERNAL_SERVER_ERROR"), 500);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_IMPLEMENTED"), 501);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_GATEWAY"), 502);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SERVICE_UNAVAILABLE"), 503);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GATEWAY_TIMEOUT"), 504);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VERSION_NOT_SUPPORTED"), 505);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VARIANT_ALSO_NEGOTIATES"), 506);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INSUFFICIENT_STORAGE"), 507);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOOP_DETECTED"), 508);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_EXTENDED"), 510);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_AUTHENTICATION_REQUIRED"), 511);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_THIS_IS_FINE"), 218);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAGE_EXPIRED"), 419);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_FAILURE"), 420);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOGIN_TIMEOUT"), 440);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_RESPONSE"), 444);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RETRY_WITH"), 449);
-
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS"), 450);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *data_param = NULL;
+ zval data;
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_TOO_LARGE"), 494);
+ ZVAL_UNDEF(&data);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(data)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &data_param);
+ if (!data_param) {
+ ZEPHIR_INIT_VAR(&data);
+ array_init(&data);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&data, data_param);
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "__construct", NULL, 0, &data);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_ERROR"), 495);
+static PHP_METHOD(Phalcon_Support_Registry, __get)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element_param = NULL;
+ zval element;
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_REQUIRED"), 496);
+ ZVAL_UNDEF(&element);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &element_param);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
+ } else {
+ ZEPHIR_INIT_VAR(&element);
+ }
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "get", NULL, 0, &element);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_HTTP_REQUEST_SENT_TO_HTTPS_PORT"), 497);
+static PHP_METHOD(Phalcon_Support_Registry, __isset)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element_param = NULL;
+ zval element;
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_TOKEN_ESRI"), 498);
+ ZVAL_UNDEF(&element);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &element_param);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
+ } else {
+ ZEPHIR_INIT_VAR(&element);
+ }
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "has", NULL, 0, &element);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CLIENT_CLOSED_REQUEST"), 499);
+static PHP_METHOD(Phalcon_Support_Registry, __set)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element_param = NULL, *value, value_sub;
+ zval element;
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BANDWIDTH_LIMIT_EXCEEDED"), 509);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&value_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(element)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &element_param, &value);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
+ } else {
+ ZEPHIR_INIT_VAR(&element);
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "set", NULL, 0, &element, value);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNKNOWN_ERROR"), 520);
+static PHP_METHOD(Phalcon_Support_Registry, __unset)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element_param = NULL;
+ zval element;
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_WEB_SERVER_IS_DOWN"), 521);
+ ZVAL_UNDEF(&element);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &element_param);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
+ } else {
+ ZEPHIR_INIT_VAR(&element);
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "remove", NULL, 0, &element);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONNECTION_TIMEOUT"), 522);
+static PHP_METHOD(Phalcon_Support_Registry, clear)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_IS_UNREACHABLE"), 523);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "clear", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TIMEOUT_OCCURRED"), 524);
+static PHP_METHOD(Phalcon_Support_Registry, count)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_HANDSHAKE_FAILED"), 525);
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "count", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_SSL_CERTIFICATE"), 526);
+static PHP_METHOD(Phalcon_Support_Registry, get)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element_param = NULL, *defaultValue = NULL, defaultValue_sub, *cast_param = NULL, __$null;
+ zval element, cast;
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RAILGUN_ERROR"), 527);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&cast);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(element)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_STR_OR_NULL(cast)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 2, &element_param, &defaultValue, &cast_param);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
+ } else {
+ ZEPHIR_INIT_VAR(&element);
+ }
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!cast_param) {
+ ZEPHIR_INIT_VAR(&cast);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(cast_param) != IS_STRING && Z_TYPE_P(cast_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cast' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(cast_param) == IS_STRING)) {
+ zephir_get_strval(&cast, cast_param);
+ } else {
+ ZEPHIR_INIT_VAR(&cast);
+ }
+ }
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "get", NULL, 0, &element, defaultValue, &cast);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_DNS_ERROR"), 530);
+static PHP_METHOD(Phalcon_Support_Registry, getIterator)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_READ_TIMEOUT_ERROR"), 598);
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "getiterator", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_CONNECT_TIMEOUT_ERROR"), 599);
+static PHP_METHOD(Phalcon_Support_Registry, has)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element_param = NULL;
+ zval element;
- return SUCCESS;
+ ZVAL_UNDEF(&element);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &element_param);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
+ } else {
+ ZEPHIR_INIT_VAR(&element);
+ }
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "has", NULL, 0, &element);
+ zephir_check_call_status();
+ RETURN_MM();
}
+static PHP_METHOD(Phalcon_Support_Registry, init)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *data_param = NULL;
+ zval data;
+ ZVAL_UNDEF(&data);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(data)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &data_param);
+ if (!data_param) {
+ ZEPHIR_INIT_VAR(&data);
+ array_init(&data);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&data, data_param);
+ }
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "init", NULL, 0, &data);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
+static PHP_METHOD(Phalcon_Support_Registry, jsonSerialize)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-#ifdef HAVE_CONFIG_H
-#endif
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "jsonserialize", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Support_Registry, offsetExists)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element, element_sub;
+ ZVAL_UNDEF(&element_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &element);
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "has", NULL, 0, element);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Support_Registry, offsetGet)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval element_sub;
+ zval *element;
+ ZVAL_UNDEF(&element_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &element);
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "get", NULL, 0, element);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Cookies)
+static PHP_METHOD(Phalcon_Support_Registry, offsetSet)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Response, Cookies, phalcon, http_response_cookies, phalcon_di_abstractinjectionaware_ce, phalcon_http_response_cookies_method_entry, 0);
-
- zend_declare_property_null(phalcon_http_response_cookies_ce, SL("cookies"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("isSent"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("registered"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_http_response_cookies_ce, SL("signKey"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("useEncryption"), 1, ZEND_ACC_PROTECTED);
- phalcon_http_response_cookies_ce->create_object = zephir_init_properties_Phalcon_Http_Response_Cookies;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *offset, offset_sub, *value, value_sub;
- zend_class_implements(phalcon_http_response_cookies_ce, 1, phalcon_http_response_cookiesinterface_ce);
- return SUCCESS;
+ ZVAL_UNDEF(&offset_sub);
+ ZVAL_UNDEF(&value_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL(offset)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &offset, &value);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "set", NULL, 0, offset, value);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, __construct)
+static PHP_METHOD(Phalcon_Support_Registry, offsetUnset)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval signKey;
- zval *useEncryption_param = NULL, *signKey_param = NULL, __$true, __$false;
- zend_bool useEncryption;
- zval *this_ptr = getThis();
+ zval *element, element_sub;
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&signKey);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 2)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(useEncryption)
- Z_PARAM_STR_OR_NULL(signKey)
+ ZVAL_UNDEF(&element_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(element)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 2, &useEncryption_param, &signKey_param);
- if (!useEncryption_param) {
- useEncryption = 1;
- } else {
- }
- if (!signKey_param) {
- ZEPHIR_INIT_VAR(&signKey);
- } else {
- zephir_get_strval(&signKey, signKey_param);
- }
- if (useEncryption) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$false);
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsignkey", NULL, 0, &signKey);
+ zephir_fetch_params(1, 1, 0, &element);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "remove", NULL, 0, element);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, delete)
+static PHP_METHOD(Phalcon_Support_Registry, remove)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, cookie, _0;
- zval name;
- zval *this_ptr = getThis();
+ zval *element_param = NULL;
+ zval element;
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&cookie);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&element);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ Z_PARAM_STR(element)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &element_param);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
} else {
- ZEPHIR_INIT_VAR(&name);
- }
- zephir_memory_observe(&cookie);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&cookie, &_0, &name, 0))) {
- RETURN_MM_BOOL(0);
+ ZEPHIR_INIT_VAR(&element);
}
- ZEPHIR_CALL_METHOD(NULL, &cookie, "delete", NULL, 0);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "remove", NULL, 0, &element);
zephir_check_call_status();
- RETURN_MM_BOOL(1);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, get)
+static PHP_METHOD(Phalcon_Support_Registry, serialize)
{
- zval _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, container, encryption, cookie, _0, _1, _2, _4, _5, _6$$5;
- zval name;
- zval *this_ptr = getThis();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&encryption);
- ZVAL_UNDEF(&cookie);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "serialize", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Support_Registry, set)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *element_param = NULL, *value, value_sub;
+ zval element;
+
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&value_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(element)
+ Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ zephir_fetch_params(1, 2, 0, &element_param, &value);
+ if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
+ zephir_get_strval(&element, element_param);
} else {
- ZEPHIR_INIT_VAR(&name);
- }
- zephir_memory_observe(&cookie);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset_fetch(&cookie, &_0, &name, 0)) {
- RETURN_CCTOR(&cookie);
+ ZEPHIR_INIT_VAR(&element);
}
- zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_3);
- zephir_create_array(&_3, 1, 0);
- zephir_array_fast_append(&_3, &name);
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "Phalcon\\Http\\Cookie");
- ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &_4, &_3);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "set", NULL, 0, &element, value);
zephir_check_call_status();
- ZEPHIR_CPY_WRT(&cookie, &_2);
- zephir_read_property(&_5, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_5);
- if (Z_TYPE_P(&container) == IS_OBJECT) {
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setdi", NULL, 0, &container);
- zephir_check_call_status();
- zephir_memory_observe(&encryption);
- zephir_read_property(&encryption, this_ptr, ZEND_STRL("useEncryption"), PH_NOISY_CC);
- if (zephir_is_true(&encryption)) {
- ZEPHIR_CALL_METHOD(NULL, &cookie, "useencryption", NULL, 0, &encryption);
- zephir_check_call_status();
- zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_6$$5);
- zephir_check_call_status();
- }
- }
- RETURN_CCTOR(&cookie);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, getCookies)
+static PHP_METHOD(Phalcon_Support_Registry, toArray)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- RETURN_MEMBER(getThis(), "cookies");
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "toarray", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, has)
+static PHP_METHOD(Phalcon_Support_Registry, toJson)
{
- zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, _COOKIE, _0;
- zval name;
- zval *this_ptr = getThis();
+ zval *options_param = NULL, _0;
+ zend_long options, ZEPHIR_LAST_CALL_STATUS;
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_COOKIE);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(options)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_get_global(&_COOKIE, SL("_COOKIE"));
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 0, 1, &options_param);
+ if (!options_param) {
+ options = 79;
} else {
- ZEPHIR_INIT_VAR(&name);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
- _1 = zephir_array_isset(&_0, &name);
- if (!(_1)) {
- _1 = zephir_array_isset(&_COOKIE, &name);
- }
- RETURN_MM_BOOL(_1);
+ }
+ ZVAL_LONG(&_0, options);
+ ZEPHIR_RETURN_CALL_PARENT(phalcon_support_registry_ce, getThis(), "tojson", NULL, 0, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, isSent)
+static PHP_METHOD(Phalcon_Support_Registry, unserialize)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *data_param = NULL;
+ zval data;
- RETURN_MEMBER(getThis(), "isSent");
+ ZVAL_UNDEF(&data);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(data)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &data_param);
+ zephir_get_strval(&data, data_param);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_support_registry_ce, getThis(), "unserialize", NULL, 0, &data);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, isUsingEncryption)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Version)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support, Version, phalcon, support_version, phalcon_support_version_method_entry, 0);
- RETURN_MEMBER(getThis(), "useEncryption");
+ zephir_declare_class_constant_long(phalcon_support_version_ce, SL("VERSION_MAJOR"), 0);
+
+ zephir_declare_class_constant_long(phalcon_support_version_ce, SL("VERSION_MEDIUM"), 1);
+
+ zephir_declare_class_constant_long(phalcon_support_version_ce, SL("VERSION_MINOR"), 2);
+
+ zephir_declare_class_constant_long(phalcon_support_version_ce, SL("VERSION_SPECIAL"), 3);
+
+ zephir_declare_class_constant_long(phalcon_support_version_ce, SL("VERSION_SPECIAL_NUMBER"), 4);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, reset)
+static PHP_METHOD(Phalcon_Support_Version, getVersion)
{
zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_create_array(return_value, 5, 0);
ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("cookies"), &_0);
- RETURN_THIS();
+ ZVAL_LONG(&_0, 5);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 8);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 0);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 4);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 0);
+ zephir_array_fast_append(return_value, &_0);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, send)
+static PHP_METHOD(Phalcon_Support_Version, getSpecial)
{
- zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval __$true, __$false, cookie, _0, _2, _3, *_4, _5;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
+ zval *special_param = NULL, suffix;
+ zend_long special;
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&cookie);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&suffix);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(special)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 359);
- zephir_check_call_status();
- _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0);
- if (!(_1)) {
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "issent", NULL, 0);
- zephir_check_call_status();
- _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2);
- }
- if (_1) {
- RETURN_MM_BOOL(0);
- }
- zephir_read_property(&_3, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
- zephir_is_iterable(&_3, 0, "phalcon/Http/Response/Cookies.zep", 225);
- if (Z_TYPE_P(&_3) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4)
- {
- ZEPHIR_INIT_NVAR(&cookie);
- ZVAL_COPY(&cookie, _4);
- ZEPHIR_CALL_METHOD(NULL, &cookie, "send", NULL, 0);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_3, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_5, &_3, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_5)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&cookie, &_3, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &cookie, "send", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 0, &special_param);
+ do {
+ if (special == 1) {
+ ZEPHIR_INIT_VAR(&suffix);
+ ZVAL_STRING(&suffix, "alpha");
+ break;
}
- }
- ZEPHIR_INIT_NVAR(&cookie);
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$false);
- }
- RETURN_MM_BOOL(1);
+ if (special == 2) {
+ ZEPHIR_INIT_NVAR(&suffix);
+ ZVAL_STRING(&suffix, "beta");
+ break;
+ }
+ if (special == 3) {
+ ZEPHIR_INIT_NVAR(&suffix);
+ ZVAL_STRING(&suffix, "RC");
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&suffix);
+ ZVAL_STRING(&suffix, "");
+ break;
+ } while(0);
+
+ RETURN_CCTOR(&suffix);
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, set)
+static PHP_METHOD(Phalcon_Support_Version, get)
{
+ zval result;
+ zval version, major, medium, minor, special, specialNumber, suffix, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval options, _3$$3;
- zend_bool secure, httpOnly;
- zend_long expire, ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *value = NULL, value_sub, *expire_param = NULL, *path_param = NULL, *secure_param = NULL, *domain_param = NULL, *httpOnly_param = NULL, *options_param = NULL, __$true, __$false, __$null, cookie, encryption, container, response, _0, _10, _1$$3, _2$$3, _4$$3, _5$$3, _6$$4, _7$$5, _8$$5, _9$$5, _11$$6, _12$$6;
- zval name, path, domain;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&domain);
- ZVAL_UNDEF(&value_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&cookie);
- ZVAL_UNDEF(&encryption);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&response);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&major);
+ ZVAL_UNDEF(&medium);
+ ZVAL_UNDEF(&minor);
+ ZVAL_UNDEF(&special);
+ ZVAL_UNDEF(&specialNumber);
+ ZVAL_UNDEF(&suffix);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_7$$5);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_9$$5);
- ZVAL_UNDEF(&_11$$6);
- ZVAL_UNDEF(&_12$$6);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_3$$3);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 8)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(expire)
- Z_PARAM_STR(path)
- Z_PARAM_BOOL_OR_NULL(secure, is_null_true)
- Z_PARAM_STR_OR_NULL(domain)
- Z_PARAM_BOOL_OR_NULL(httpOnly, is_null_true)
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&result);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 7, &name_param, &value, &expire_param, &path_param, &secure_param, &domain_param, &httpOnly_param, &options_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!value) {
- value = &value_sub;
- value = &__$null;
- }
- if (!expire_param) {
- expire = 0;
- } else {
- }
- if (!path_param) {
- ZEPHIR_INIT_VAR(&path);
- ZVAL_STRING(&path, "/");
- } else {
- zephir_get_strval(&path, path_param);
- }
- if (!secure_param) {
- secure = 0;
- } else {
- }
- if (!domain_param) {
- ZEPHIR_INIT_VAR(&domain);
- } else {
- if (UNEXPECTED(Z_TYPE_P(domain_param) != IS_STRING && Z_TYPE_P(domain_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) {
- zephir_get_strval(&domain, domain_param);
- } else {
- ZEPHIR_INIT_VAR(&domain);
- }
- }
- if (!httpOnly_param) {
- httpOnly = 0;
- } else {
- }
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- zephir_get_arrval(&options, options_param);
- }
- zephir_memory_observe(&encryption);
- zephir_read_property(&encryption, this_ptr, ZEND_STRL("useEncryption"), PH_NOISY_CC);
- zephir_memory_observe(&cookie);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&cookie, &_0, &name, 0))) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_3$$3);
- zephir_create_array(&_3$$3, 8, 0);
- zephir_array_fast_append(&_3$$3, &name);
- zephir_array_fast_append(&_3$$3, value);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_LONG(&_4$$3, expire);
- zephir_array_fast_append(&_3$$3, &_4$$3);
- zephir_array_fast_append(&_3$$3, &path);
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_BOOL(&_4$$3, secure);
- zephir_array_fast_append(&_3$$3, &_4$$3);
- zephir_array_fast_append(&_3$$3, &domain);
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_BOOL(&_4$$3, httpOnly);
- zephir_array_fast_append(&_3$$3, &_4$$3);
- zephir_array_fast_append(&_3$$3, &options);
- ZEPHIR_INIT_NVAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "Phalcon\\Http\\Cookie");
- ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "get", NULL, 0, &_4$$3, &_3$$3);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&cookie, &_2$$3);
- zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setdi", NULL, 0, &_5$$3);
- zephir_check_call_status();
- if (zephir_is_true(&encryption)) {
- ZEPHIR_CALL_METHOD(NULL, &cookie, "useencryption", NULL, 0, &encryption);
- zephir_check_call_status();
- zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_6$$4);
- zephir_check_call_status();
- }
- zephir_update_property_array(this_ptr, SL("cookies"), &name, &cookie);
- } else {
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setvalue", NULL, 0, value);
- zephir_check_call_status();
- ZVAL_LONG(&_7$$5, expire);
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setexpiration", NULL, 0, &_7$$5);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setpath", NULL, 0, &path);
- zephir_check_call_status();
- if (secure) {
- ZVAL_BOOL(&_7$$5, 1);
- } else {
- ZVAL_BOOL(&_7$$5, 0);
- }
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setsecure", NULL, 0, &_7$$5);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setdomain", NULL, 0, &domain);
- zephir_check_call_status();
- if (httpOnly) {
- ZVAL_BOOL(&_8$$5, 1);
- } else {
- ZVAL_BOOL(&_8$$5, 0);
- }
- ZEPHIR_CALL_METHOD(NULL, &cookie, "sethttponly", NULL, 0, &_8$$5);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setoptions", NULL, 0, &options);
- zephir_check_call_status();
- zephir_read_property(&_9$$5, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_9$$5);
- zephir_check_call_status();
- }
- zephir_read_property(&_10, this_ptr, ZEND_STRL("registered"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_10)) {
- zephir_read_property(&_11$$6, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_11$$6);
- if (Z_TYPE_P(&container) == IS_NULL) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_cookie_exception_ce, "A dependency injection container is required to access the 'response' service", "phalcon/Http/Response/Cookies.zep", 311);
- return;
- }
- ZEPHIR_INIT_VAR(&_12$$6);
- ZVAL_STRING(&_12$$6, "response");
- ZEPHIR_CALL_METHOD(&response, &container, "getshared", NULL, 0, &_12$$6);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &response, "setcookies", NULL, 0, this_ptr);
- zephir_check_call_status();
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("registered"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("registered"), &__$false);
+
+ ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
+ zephir_check_call_status();
+ zephir_memory_observe(&major);
+ zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/Support/Version.zep", 122);
+ zephir_memory_observe(&medium);
+ zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/Support/Version.zep", 123);
+ zephir_memory_observe(&minor);
+ zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/Support/Version.zep", 124);
+ zephir_memory_observe(&special);
+ zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/Support/Version.zep", 125);
+ zephir_memory_observe(&specialNumber);
+ zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 126);
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_CONCAT_VSVSV(&_0, &major, ".", &medium, ".", &minor);
+ zephir_get_strval(&result, &_0);
+ ZEPHIR_CALL_METHOD(&suffix, this_ptr, "getspecial", NULL, 0, &special);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_STRING(&suffix, "")) {
+ zephir_concat_self(&result, &suffix);
+ if (!ZEPHIR_IS_LONG(&specialNumber, 0)) {
+ zephir_concat_self(&result, &specialNumber);
}
}
- RETURN_THIS();
+ RETURN_CTOR(&result);
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, setSignKey)
+static PHP_METHOD(Phalcon_Support_Version, getId)
{
+ zval version, major, medium, minor, special, specialNumber, _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *signKey_param = NULL;
- zval signKey;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&signKey);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(signKey)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&major);
+ ZVAL_UNDEF(&medium);
+ ZVAL_UNDEF(&minor);
+ ZVAL_UNDEF(&special);
+ ZVAL_UNDEF(&specialNumber);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &signKey_param);
- if (!signKey_param) {
- ZEPHIR_INIT_VAR(&signKey);
- } else {
- zephir_get_strval(&signKey, signKey_param);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("signKey"), &signKey);
- RETURN_THIS();
+
+ ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
+ zephir_check_call_status();
+ zephir_memory_observe(&major);
+ zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/Support/Version.zep", 160);
+ zephir_memory_observe(&medium);
+ zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/Support/Version.zep", 161);
+ zephir_memory_observe(&minor);
+ zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/Support/Version.zep", 162);
+ zephir_memory_observe(&special);
+ zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/Support/Version.zep", 163);
+ zephir_memory_observe(&specialNumber);
+ zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 164);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "%02s");
+ ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 117, &_0, &medium);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "%02s");
+ ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 117, &_0, &minor);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VVVVV(return_value, &major, &_1, &_2, &special, &specialNumber);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response_Cookies, useEncryption)
+static PHP_METHOD(Phalcon_Support_Version, getPart)
{
- zval *useEncryption_param = NULL, __$true, __$false;
- zend_bool useEncryption;
+ zval _1$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *part_param = NULL, version, _0$$3, _2$$4;
+ zend_long part, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_1$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_BOOL(useEncryption)
+ Z_PARAM_LONG(part)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &useEncryption_param);
- if (useEncryption) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$false);
- }
- RETURN_THISW();
-}
-
-zend_object *zephir_init_properties_Phalcon_Http_Response_Cookies(zend_class_entry *class_type)
-{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("cookies"), &_1$$3);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &part_param);
+ ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
+ zephir_check_call_status();
+ do {
+ if (part == 0 || part == 1 || part == 2 || part == 4) {
+ zephir_memory_observe(&_0$$3);
+ zephir_array_fetch_long(&_0$$3, &version, part, PH_NOISY, "phalcon/Support/Version.zep", 192);
+ zephir_cast_to_string(&_1$$3, &_0$$3);
+ RETURN_CTOR(&_1$$3);
}
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
- }
+ if (part == 3) {
+ zephir_array_fetch_long(&_2$$4, &version, 3, PH_NOISY | PH_READONLY, "phalcon/Support/Version.zep", 195);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getspecial", NULL, 0, &_2$$4);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ } while(0);
+
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
}
@@ -142349,338 +138554,1233 @@ zend_object *zephir_init_properties_Phalcon_Http_Response_Cookies(zend_class_ent
-ZEPHIR_INIT_CLASS(Phalcon_Http_Response_CookiesInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Debug_Dump)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Response, CookiesInterface, phalcon, http_response_cookiesinterface, phalcon_http_response_cookiesinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Debug, Dump, phalcon, support_debug_dump, phalcon_support_debug_dump_method_entry, 0);
+
+ zend_declare_property_bool(phalcon_support_debug_dump_ce, SL("detailed"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_support_debug_dump_ce, SL("methods"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_support_debug_dump_ce, SL("styles"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_support_debug_dump_ce, SL("encode"), ZEND_ACC_PRIVATE);
+ phalcon_support_debug_dump_ce->create_object = zephir_init_properties_Phalcon_Support_Debug_Dump;
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, delete);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, isUsingEncryption);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, reset);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, send);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, set);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, useEncryption);
-
-
+static PHP_METHOD(Phalcon_Support_Debug_Dump, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool detailed;
+ zval *styles_param = NULL, *detailed_param = NULL, __$true, __$false, _0;
+ zval styles;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ ZVAL_UNDEF(&styles);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(styles)
+ Z_PARAM_BOOL(detailed)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 2, &styles_param, &detailed_param);
+ if (!styles_param) {
+ ZEPHIR_INIT_VAR(&styles);
+ array_init(&styles);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&styles, styles_param);
+ }
+ if (!detailed_param) {
+ detailed = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_support_helper_json_encode_ce);
+ if (zephir_has_constructor(&_0)) {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("encode"), &_0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstyles", NULL, 0, &styles);
+ zephir_check_call_status();
+ if (detailed) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$false);
+ }
+ ZEPHIR_MM_RESTORE();
+}
+static PHP_METHOD(Phalcon_Support_Debug_Dump, all)
+{
+ zval _1;
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 2, 0);
+ zephir_array_fast_append(&_0, this_ptr);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "variables");
+ zephir_array_fast_append(&_0, &_1);
+ ZEPHIR_INIT_NVAR(&_1);
+ zephir_get_args(&_1);
+ ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Exception)
+static PHP_METHOD(Phalcon_Support_Debug_Dump, getDetailed)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Response, Exception, phalcon, http_response_exception, zend_ce_exception, NULL, 0);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "detailed");
}
+static PHP_METHOD(Phalcon_Support_Debug_Dump, setDetailed)
+{
+ zval *detailed_param = NULL, __$true, __$false;
+ zend_bool detailed;
+ zval *this_ptr = getThis();
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(detailed)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &detailed_param);
+ if (detailed) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("detailed"), &__$false);
+ }
+}
+static PHP_METHOD(Phalcon_Support_Debug_Dump, one)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval name;
+ zval *variable, variable_sub, *name_param = NULL;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
+ ZVAL_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&name);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(variable)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &variable, &name_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ zephir_get_strval(&name, name_param);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "variable", NULL, 0, variable, &name);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Headers)
+static PHP_METHOD(Phalcon_Support_Debug_Dump, setStyles)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Response, Headers, phalcon, http_response_headers, phalcon_http_response_headers_method_entry, 0);
-
- zend_declare_property_null(phalcon_http_response_headers_ce, SL("headers"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_http_response_headers_ce, SL("isSent"), 0, ZEND_ACC_PROTECTED);
- phalcon_http_response_headers_ce->create_object = zephir_init_properties_Phalcon_Http_Response_Headers;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *styles_param = NULL, defaultStyles, _0;
+ zval styles;
+ zval *this_ptr = getThis();
- zend_class_implements(phalcon_http_response_headers_ce, 1, phalcon_http_response_headersinterface_ce);
- return SUCCESS;
+ ZVAL_UNDEF(&styles);
+ ZVAL_UNDEF(&defaultStyles);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(styles)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &styles_param);
+ if (!styles_param) {
+ ZEPHIR_INIT_VAR(&styles);
+ array_init(&styles);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&styles, styles_param);
+ }
+ ZEPHIR_INIT_VAR(&defaultStyles);
+ zephir_create_array(&defaultStyles, 11, 0);
+ add_assoc_stringl_ex(&defaultStyles, SL("pre"), SL("background-color:#f3f3f3; font-size:11px; padding:10px; border:1px solid #ccc; text-align:left; color:#333"));
+ add_assoc_stringl_ex(&defaultStyles, SL("arr"), SL("color:red"));
+ add_assoc_stringl_ex(&defaultStyles, SL("bool"), SL("color:green"));
+ add_assoc_stringl_ex(&defaultStyles, SL("float"), SL("color:fuchsia"));
+ add_assoc_stringl_ex(&defaultStyles, SL("int"), SL("color:blue"));
+ add_assoc_stringl_ex(&defaultStyles, SL("null"), SL("color:black"));
+ add_assoc_stringl_ex(&defaultStyles, SL("num"), SL("color:navy"));
+ add_assoc_stringl_ex(&defaultStyles, SL("obj"), SL("color:purple"));
+ add_assoc_stringl_ex(&defaultStyles, SL("other"), SL("color:maroon"));
+ add_assoc_stringl_ex(&defaultStyles, SL("res"), SL("color:lime"));
+ add_assoc_stringl_ex(&defaultStyles, SL("str"), SL("color:teal"));
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_array_merge(&_0, &defaultStyles, &styles);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("styles"), &_0);
+ RETURN_MM_MEMBER(getThis(), "styles");
}
-static PHP_METHOD(Phalcon_Http_Response_Headers, get)
+static PHP_METHOD(Phalcon_Support_Debug_Dump, toJson)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, headers, headerValue, _0;
- zval name;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *variable, variable_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&headers);
- ZVAL_UNDEF(&headerValue);
+ ZVAL_UNDEF(&variable_sub);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ Z_PARAM_ZVAL(variable)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&headers, &_0);
- zephir_memory_observe(&headerValue);
- if (!(zephir_array_isset_fetch(&headerValue, &headers, &name, 0))) {
- RETURN_MM_BOOL(0);
- }
- RETURN_CCTOR(&headerValue);
+ zephir_fetch_params(1, 1, 0, &variable);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("encode"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, ((128 | 64) | 256));
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "__invoke", NULL, 0, variable, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response_Headers, has)
+static PHP_METHOD(Phalcon_Support_Debug_Dump, variable)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, _0;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval name;
+ zval *variable, variable_sub, *name_param = NULL, _1, _2;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(variable)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_key_exists(&_0, &name));
+ zephir_fetch_params(1, 1, 1, &variable, &name_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ zephir_get_strval(&name, name_param);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 2, 0);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "pre");
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "getstyle", NULL, 0, &_2);
+ zephir_check_call_status();
+ zephir_array_update_string(&_0, SL(":style"), &_1, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "output", NULL, 0, variable, &name);
+ zephir_check_call_status();
+ zephir_array_update_string(&_0, SL(":output"), &_1, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "
:output
");
+ ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 5, &_2, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Response_Headers, isSent)
+static PHP_METHOD(Phalcon_Support_Debug_Dump, variables)
{
+ zend_string *_4;
+ zend_ulong _3;
+ zval output;
+ zval key, value, _0, *_1, _2, _5$$3, _6$$3, _8$$4, _9$$4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_7 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "isSent");
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&output);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ ZEPHIR_INIT_VAR(&output);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_get_args(&_0);
+ zephir_is_iterable(&_0, 0, "phalcon/Support/Debug/Dump.zep", 198);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _3, _4, _1)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&key, _4);
+ } else {
+ ZVAL_LONG(&key, _3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _1);
+ ZEPHIR_INIT_NVAR(&_6$$3);
+ ZEPHIR_CONCAT_SV(&_6$$3, "var ", &key);
+ ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "one", &_7, 0, &value, &_6$$3);
+ zephir_check_call_status();
+ zephir_concat_self(&output, &_5$$3);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, &_0, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_9$$4);
+ ZEPHIR_CONCAT_SV(&_9$$4, "var ", &key);
+ ZEPHIR_CALL_METHOD(&_8$$4, this_ptr, "one", &_7, 0, &value, &_9$$4);
+ zephir_check_call_status();
+ zephir_concat_self(&output, &_8$$4);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ RETURN_CTOR(&output);
}
-static PHP_METHOD(Phalcon_Http_Response_Headers, remove)
+static PHP_METHOD(Phalcon_Support_Debug_Dump, getStyle)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *header_param = NULL, headers, _0;
- zval header;
+ zval *type_param = NULL, style, _0;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&header);
- ZVAL_UNDEF(&headers);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&style);
ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(header)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &header_param);
- zephir_get_strval(&header, header_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&headers, &_0);
- zephir_array_unset(&headers, &header, PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &headers);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response_Headers, reset)
-{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_0);
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &type_param);
+ if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
+ } else {
+ ZEPHIR_INIT_VAR(&type);
+ }
+ zephir_memory_observe(&style);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("styles"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&style, &_0, &type, 0))) {
+ RETURN_MM_STRING("color:gray");
+ }
+ RETURN_CCTOR(&style);
}
-static PHP_METHOD(Phalcon_Http_Response_Headers, send)
+static PHP_METHOD(Phalcon_Support_Debug_Dump, output)
{
- zend_string *_7;
- zend_ulong _6;
- zend_bool _1, _10$$6, _16$$11;
+ zend_class_entry *_74$$16, *_91$$17;
+ zend_bool _15$$5, _16$$5, _17$$5, _27$$7, _28$$7, _29$$7, _42$$9;
+ zend_string *_7$$4, *_50$$12;
+ zend_ulong _6$$4, _49$$12;
+ zval _166, _1$$4, _11$$5, _23$$7, _34$$9, _105$$9, _38$$10, _53$$13, _61$$14, _79$$16, _95$$17, _116$$21, _122$$22, _129$$24, _135$$25, _144$$26, _148$$27, _151$$28, _154$$29, _159$$30, _163$$31;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_9 = NULL;
- zval __$true, __$false, header, value, _0, _2, _3, *_4, _5, _8$$5, _11$$6, _12$$6, _13$$6, _14$$8, _15$$10, _17$$11, _18$$11, _19$$11, _20$$13;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_10 = NULL, *_19 = NULL, *_71 = NULL, *_72 = NULL, *_75 = NULL, *_77 = NULL, *_85 = NULL, *_88 = NULL, *_89 = NULL, *_93 = NULL, *_101 = NULL;
+ zend_long tab, ZEPHIR_LAST_CALL_STATUS;
+ zval name, _0$$3;
+ zval *variable, variable_sub, *name_param = NULL, *tab_param = NULL, key, value, output, space, type, attr, _147, _167, _168, _2$$4, _3$$4, *_4$$4, _5$$4, _32$$4, _33$$4, _8$$5, _9$$5, _12$$5, _13$$5, _14$$5, _18$$5, _20$$5, _21$$7, _22$$7, _24$$7, _25$$7, _26$$7, _30$$7, _31$$7, _35$$9, _36$$9, _37$$9, _41$$9, _103$$9, _104$$9, _106$$9, _107$$9, _142$$9, _143$$9, _39$$10, _40$$10, _43$$11, _44$$11, _45$$11, _46$$12, *_47$$12, _48$$12, _51$$13, _52$$13, _54$$13, _55$$13, _56$$13, _57$$13, _58$$13, _59$$14, _60$$14, _62$$14, _63$$14, _64$$14, _65$$14, _66$$14, reflect$$15, props$$15, property$$15, _67$$15, *_68$$15, _69$$15, _70$$16, _73$$16, _76$$16, _78$$16, _80$$16, _81$$16, _82$$16, _83$$16, _84$$16, _86$$16, _87$$17, _90$$17, _92$$17, _94$$17, _96$$17, _97$$17, _98$$17, _99$$17, _100$$17, _102$$17, _108$$18, _109$$18, _110$$18, *_111$$19, _112$$19, _139$$19, _140$$19, _141$$19, _113$$20, _114$$21, _115$$21, _117$$21, _118$$21, _119$$21, _120$$22, _121$$22, _123$$22, _124$$22, _125$$22, _126$$23, _127$$24, _128$$24, _130$$24, _131$$24, _132$$24, _133$$25, _134$$25, _136$$25, _137$$25, _138$$25, _145$$26, _146$$26, _149$$27, _150$$27, _152$$28, _153$$28, _155$$29, _156$$29, _157$$29, _158$$29, _160$$30, _161$$30, _162$$30, _164$$31, _165$$31;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&header);
+ ZVAL_UNDEF(&variable_sub);
+ ZVAL_UNDEF(&key);
ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&output);
+ ZVAL_UNDEF(&space);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&attr);
+ ZVAL_UNDEF(&_147);
+ ZVAL_UNDEF(&_167);
+ ZVAL_UNDEF(&_168);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_32$$4);
+ ZVAL_UNDEF(&_33$$4);
ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_11$$6);
- ZVAL_UNDEF(&_12$$6);
- ZVAL_UNDEF(&_13$$6);
- ZVAL_UNDEF(&_14$$8);
- ZVAL_UNDEF(&_15$$10);
- ZVAL_UNDEF(&_17$$11);
- ZVAL_UNDEF(&_18$$11);
- ZVAL_UNDEF(&_19$$11);
- ZVAL_UNDEF(&_20$$13);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_13$$5);
+ ZVAL_UNDEF(&_14$$5);
+ ZVAL_UNDEF(&_18$$5);
+ ZVAL_UNDEF(&_20$$5);
+ ZVAL_UNDEF(&_21$$7);
+ ZVAL_UNDEF(&_22$$7);
+ ZVAL_UNDEF(&_24$$7);
+ ZVAL_UNDEF(&_25$$7);
+ ZVAL_UNDEF(&_26$$7);
+ ZVAL_UNDEF(&_30$$7);
+ ZVAL_UNDEF(&_31$$7);
+ ZVAL_UNDEF(&_35$$9);
+ ZVAL_UNDEF(&_36$$9);
+ ZVAL_UNDEF(&_37$$9);
+ ZVAL_UNDEF(&_41$$9);
+ ZVAL_UNDEF(&_103$$9);
+ ZVAL_UNDEF(&_104$$9);
+ ZVAL_UNDEF(&_106$$9);
+ ZVAL_UNDEF(&_107$$9);
+ ZVAL_UNDEF(&_142$$9);
+ ZVAL_UNDEF(&_143$$9);
+ ZVAL_UNDEF(&_39$$10);
+ ZVAL_UNDEF(&_40$$10);
+ ZVAL_UNDEF(&_43$$11);
+ ZVAL_UNDEF(&_44$$11);
+ ZVAL_UNDEF(&_45$$11);
+ ZVAL_UNDEF(&_46$$12);
+ ZVAL_UNDEF(&_48$$12);
+ ZVAL_UNDEF(&_51$$13);
+ ZVAL_UNDEF(&_52$$13);
+ ZVAL_UNDEF(&_54$$13);
+ ZVAL_UNDEF(&_55$$13);
+ ZVAL_UNDEF(&_56$$13);
+ ZVAL_UNDEF(&_57$$13);
+ ZVAL_UNDEF(&_58$$13);
+ ZVAL_UNDEF(&_59$$14);
+ ZVAL_UNDEF(&_60$$14);
+ ZVAL_UNDEF(&_62$$14);
+ ZVAL_UNDEF(&_63$$14);
+ ZVAL_UNDEF(&_64$$14);
+ ZVAL_UNDEF(&_65$$14);
+ ZVAL_UNDEF(&_66$$14);
+ ZVAL_UNDEF(&reflect$$15);
+ ZVAL_UNDEF(&props$$15);
+ ZVAL_UNDEF(&property$$15);
+ ZVAL_UNDEF(&_67$$15);
+ ZVAL_UNDEF(&_69$$15);
+ ZVAL_UNDEF(&_70$$16);
+ ZVAL_UNDEF(&_73$$16);
+ ZVAL_UNDEF(&_76$$16);
+ ZVAL_UNDEF(&_78$$16);
+ ZVAL_UNDEF(&_80$$16);
+ ZVAL_UNDEF(&_81$$16);
+ ZVAL_UNDEF(&_82$$16);
+ ZVAL_UNDEF(&_83$$16);
+ ZVAL_UNDEF(&_84$$16);
+ ZVAL_UNDEF(&_86$$16);
+ ZVAL_UNDEF(&_87$$17);
+ ZVAL_UNDEF(&_90$$17);
+ ZVAL_UNDEF(&_92$$17);
+ ZVAL_UNDEF(&_94$$17);
+ ZVAL_UNDEF(&_96$$17);
+ ZVAL_UNDEF(&_97$$17);
+ ZVAL_UNDEF(&_98$$17);
+ ZVAL_UNDEF(&_99$$17);
+ ZVAL_UNDEF(&_100$$17);
+ ZVAL_UNDEF(&_102$$17);
+ ZVAL_UNDEF(&_108$$18);
+ ZVAL_UNDEF(&_109$$18);
+ ZVAL_UNDEF(&_110$$18);
+ ZVAL_UNDEF(&_112$$19);
+ ZVAL_UNDEF(&_139$$19);
+ ZVAL_UNDEF(&_140$$19);
+ ZVAL_UNDEF(&_141$$19);
+ ZVAL_UNDEF(&_113$$20);
+ ZVAL_UNDEF(&_114$$21);
+ ZVAL_UNDEF(&_115$$21);
+ ZVAL_UNDEF(&_117$$21);
+ ZVAL_UNDEF(&_118$$21);
+ ZVAL_UNDEF(&_119$$21);
+ ZVAL_UNDEF(&_120$$22);
+ ZVAL_UNDEF(&_121$$22);
+ ZVAL_UNDEF(&_123$$22);
+ ZVAL_UNDEF(&_124$$22);
+ ZVAL_UNDEF(&_125$$22);
+ ZVAL_UNDEF(&_126$$23);
+ ZVAL_UNDEF(&_127$$24);
+ ZVAL_UNDEF(&_128$$24);
+ ZVAL_UNDEF(&_130$$24);
+ ZVAL_UNDEF(&_131$$24);
+ ZVAL_UNDEF(&_132$$24);
+ ZVAL_UNDEF(&_133$$25);
+ ZVAL_UNDEF(&_134$$25);
+ ZVAL_UNDEF(&_136$$25);
+ ZVAL_UNDEF(&_137$$25);
+ ZVAL_UNDEF(&_138$$25);
+ ZVAL_UNDEF(&_145$$26);
+ ZVAL_UNDEF(&_146$$26);
+ ZVAL_UNDEF(&_149$$27);
+ ZVAL_UNDEF(&_150$$27);
+ ZVAL_UNDEF(&_152$$28);
+ ZVAL_UNDEF(&_153$$28);
+ ZVAL_UNDEF(&_155$$29);
+ ZVAL_UNDEF(&_156$$29);
+ ZVAL_UNDEF(&_157$$29);
+ ZVAL_UNDEF(&_158$$29);
+ ZVAL_UNDEF(&_160$$30);
+ ZVAL_UNDEF(&_161$$30);
+ ZVAL_UNDEF(&_162$$30);
+ ZVAL_UNDEF(&_164$$31);
+ ZVAL_UNDEF(&_165$$31);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_166);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_23$$7);
+ ZVAL_UNDEF(&_34$$9);
+ ZVAL_UNDEF(&_105$$9);
+ ZVAL_UNDEF(&_38$$10);
+ ZVAL_UNDEF(&_53$$13);
+ ZVAL_UNDEF(&_61$$14);
+ ZVAL_UNDEF(&_79$$16);
+ ZVAL_UNDEF(&_95$$17);
+ ZVAL_UNDEF(&_116$$21);
+ ZVAL_UNDEF(&_122$$22);
+ ZVAL_UNDEF(&_129$$24);
+ ZVAL_UNDEF(&_135$$25);
+ ZVAL_UNDEF(&_144$$26);
+ ZVAL_UNDEF(&_148$$27);
+ ZVAL_UNDEF(&_151$$28);
+ ZVAL_UNDEF(&_154$$29);
+ ZVAL_UNDEF(&_159$$30);
+ ZVAL_UNDEF(&_163$$31);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(variable)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_LONG(tab)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 359);
- zephir_check_call_status();
- _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0);
- if (!(_1)) {
- zephir_read_property(&_2, this_ptr, ZEND_STRL("isSent"), PH_NOISY_CC | PH_READONLY);
- _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2);
+ zephir_fetch_params(1, 1, 2, &variable, &name_param, &tab_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ zephir_get_strval(&name, name_param);
}
- if (_1) {
- RETURN_MM_BOOL(0);
+ if (!tab_param) {
+ tab = 1;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&space);
+ ZVAL_STRING(&space, " ");
+ ZEPHIR_INIT_VAR(&output);
+ ZVAL_STRING(&output, "");
+ if (!(ZEPHIR_IS_EMPTY(&name))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_CONCAT_VS(&_0$$3, &name, " ");
+ ZEPHIR_CPY_WRT(&output, &_0$$3);
}
- zephir_read_property(&_3, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
- zephir_is_iterable(&_3, 0, "phalcon/Http/Response/Headers.zep", 107);
- if (Z_TYPE_P(&_3) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_3), _6, _7, _4)
- {
- ZEPHIR_INIT_NVAR(&header);
- if (_7 != NULL) {
- ZVAL_STR_COPY(&header, _7);
- } else {
- ZVAL_LONG(&header, _6);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _4);
- if (Z_TYPE_P(&value) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_8$$5);
- ZEPHIR_CONCAT_VSV(&_8$$5, &header, ": ", &value);
- ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_8$$5, &__$true);
+ if (Z_TYPE_P(variable) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_create_array(&_1$$4, 2, 0);
+ ZEPHIR_INIT_VAR(&_3$$4);
+ ZVAL_STRING(&_3$$4, "arr");
+ ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getstyle", NULL, 0, &_3$$4);
+ zephir_check_call_status();
+ zephir_array_update_string(&_1$$4, SL(":style"), &_2$$4, PH_COPY | PH_SEPARATE);
+ add_assoc_long_ex(&_1$$4, SL(":count"), zephir_fast_count_int(variable));
+ ZEPHIR_INIT_NVAR(&_3$$4);
+ ZVAL_STRING(&_3$$4, "
Array (
:count) (\n");
+ ZEPHIR_CALL_FUNCTION(&_2$$4, "strtr", NULL, 5, &_3$$4, &_1$$4);
+ zephir_check_call_status();
+ zephir_concat_self(&output, &_2$$4);
+ zephir_is_iterable(variable, 0, "phalcon/Support/Debug/Dump.zep", 248);
+ if (Z_TYPE_P(variable) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(variable), _6$$4, _7$$4, _4$$4)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_7$$4 != NULL) {
+ ZVAL_STR_COPY(&key, _7$$4);
+ } else {
+ ZVAL_LONG(&key, _6$$4);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _4$$4);
+ ZVAL_LONG(&_8$$5, tab);
+ ZEPHIR_CALL_FUNCTION(&_9$$5, "str_repeat", &_10, 1, &space, &_8$$5);
zephir_check_call_status();
- } else {
- _10$$6 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99);
- if (!(_10$$6)) {
- ZVAL_LONG(&_11$$6, 0);
- ZVAL_LONG(&_12$$6, 5);
- ZEPHIR_INIT_NVAR(&_13$$6);
- zephir_substr(&_13$$6, &header, 0 , 5 , 0);
- _10$$6 = ZEPHIR_IS_STRING(&_13$$6, "HTTP/");
+ ZEPHIR_INIT_NVAR(&_11$$5);
+ zephir_create_array(&_11$$5, 2, 0);
+ ZEPHIR_INIT_NVAR(&_13$$5);
+ ZVAL_STRING(&_13$$5, "arr");
+ ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getstyle", NULL, 0, &_13$$5);
+ zephir_check_call_status();
+ zephir_array_update_string(&_11$$5, SL(":style"), &_12$$5, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_11$$5, SL(":key"), &key, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_13$$5);
+ ZVAL_STRING(&_13$$5, "[
:key] => ");
+ ZEPHIR_CALL_FUNCTION(&_12$$5, "strtr", NULL, 5, &_13$$5, &_11$$5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_14$$5);
+ ZEPHIR_CONCAT_VV(&_14$$5, &_9$$5, &_12$$5);
+ zephir_concat_self(&output, &_14$$5);
+ _15$$5 = tab == 1;
+ if (_15$$5) {
+ _15$$5 = !ZEPHIR_IS_STRING(&name, "");
}
- if (_10$$6) {
- ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &header, &__$true);
+ _16$$5 = _15$$5;
+ if (_16$$5) {
+ _16$$5 = !(Z_TYPE_P(&key) == IS_LONG);
+ }
+ _17$$5 = _16$$5;
+ if (_17$$5) {
+ _17$$5 = ZEPHIR_IS_EQUAL(&name, &key);
+ }
+ if (_17$$5) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_13$$5);
+ ZVAL_STRING(&_13$$5, "");
+ ZVAL_LONG(&_8$$5, (tab + 1));
+ ZEPHIR_CALL_METHOD(&_18$$5, this_ptr, "output", &_19, 0, &value, &_13$$5, &_8$$5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_20$$5);
+ ZEPHIR_CONCAT_VS(&_20$$5, &_18$$5, "\n");
+ zephir_concat_self(&output, &_20$$5);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, variable, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5$$4, variable, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5$$4)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, variable, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, variable, "current", NULL, 0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_21$$7, tab);
+ ZEPHIR_CALL_FUNCTION(&_22$$7, "str_repeat", &_10, 1, &space, &_21$$7);
zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_14$$8);
- ZEPHIR_CONCAT_VS(&_14$$8, &header, ": ");
- ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_14$$8, &__$true);
+ ZEPHIR_INIT_NVAR(&_23$$7);
+ zephir_create_array(&_23$$7, 2, 0);
+ ZEPHIR_INIT_NVAR(&_25$$7);
+ ZVAL_STRING(&_25$$7, "arr");
+ ZEPHIR_CALL_METHOD(&_24$$7, this_ptr, "getstyle", NULL, 0, &_25$$7);
zephir_check_call_status();
- }
+ zephir_array_update_string(&_23$$7, SL(":style"), &_24$$7, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_23$$7, SL(":key"), &key, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_25$$7);
+ ZVAL_STRING(&_25$$7, "[
:key] => ");
+ ZEPHIR_CALL_FUNCTION(&_24$$7, "strtr", NULL, 5, &_25$$7, &_23$$7);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_26$$7);
+ ZEPHIR_CONCAT_VV(&_26$$7, &_22$$7, &_24$$7);
+ zephir_concat_self(&output, &_26$$7);
+ _27$$7 = tab == 1;
+ if (_27$$7) {
+ _27$$7 = !ZEPHIR_IS_STRING(&name, "");
+ }
+ _28$$7 = _27$$7;
+ if (_28$$7) {
+ _28$$7 = !(Z_TYPE_P(&key) == IS_LONG);
+ }
+ _29$$7 = _28$$7;
+ if (_29$$7) {
+ _29$$7 = ZEPHIR_IS_EQUAL(&name, &key);
+ }
+ if (_29$$7) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_25$$7);
+ ZVAL_STRING(&_25$$7, "");
+ ZVAL_LONG(&_21$$7, (tab + 1));
+ ZEPHIR_CALL_METHOD(&_30$$7, this_ptr, "output", &_19, 0, &value, &_25$$7, &_21$$7);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_31$$7);
+ ZEPHIR_CONCAT_VS(&_31$$7, &_30$$7, "\n");
+ zephir_concat_self(&output, &_31$$7);
+ ZEPHIR_CALL_METHOD(NULL, variable, "next", NULL, 0);
+ zephir_check_call_status();
}
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_3, "rewind", NULL, 0);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ ZVAL_LONG(&_32$$4, (tab - 1));
+ ZEPHIR_CALL_FUNCTION(&_33$$4, "str_repeat", &_10, 1, &space, &_32$$4);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_5, &_3, "valid", NULL, 0);
+ ZEPHIR_CONCAT_VVS(return_value, &output, &_33$$4, ")");
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(variable) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_34$$9);
+ zephir_create_array(&_34$$9, 2, 0);
+ ZEPHIR_INIT_VAR(&_36$$9);
+ ZVAL_STRING(&_36$$9, "obj");
+ ZEPHIR_CALL_METHOD(&_35$$9, this_ptr, "getstyle", NULL, 0, &_36$$9);
+ zephir_check_call_status();
+ zephir_array_update_string(&_34$$9, SL(":style"), &_35$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_36$$9);
+ zephir_get_class(&_36$$9, variable, 0);
+ zephir_array_update_string(&_34$$9, SL(":class"), &_36$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_36$$9);
+ ZVAL_STRING(&_36$$9, "
Object :class");
+ ZEPHIR_CALL_FUNCTION(&_35$$9, "strtr", NULL, 5, &_36$$9, &_34$$9);
+ zephir_check_call_status();
+ zephir_concat_self(&output, &_35$$9);
+ ZEPHIR_CALL_FUNCTION(&_37$$9, "get_parent_class", NULL, 0, variable);
+ zephir_check_call_status();
+ if (zephir_is_true(&_37$$9)) {
+ ZEPHIR_INIT_VAR(&_38$$10);
+ zephir_create_array(&_38$$10, 2, 0);
+ ZEPHIR_INIT_VAR(&_40$$10);
+ ZVAL_STRING(&_40$$10, "obj");
+ ZEPHIR_CALL_METHOD(&_39$$10, this_ptr, "getstyle", NULL, 0, &_40$$10);
zephir_check_call_status();
- if (!zend_is_true(&_5)) {
- break;
+ zephir_array_update_string(&_38$$10, SL(":style"), &_39$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_FUNCTION(&_39$$10, "get_parent_class", NULL, 0, variable);
+ zephir_check_call_status();
+ zephir_array_update_string(&_38$$10, SL(":parent"), &_39$$10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_40$$10);
+ ZVAL_STRING(&_40$$10, "
extends :parent");
+ ZEPHIR_CALL_FUNCTION(&_39$$10, "strtr", NULL, 5, &_40$$10, &_38$$10);
+ zephir_check_call_status();
+ zephir_concat_self(&output, &_39$$10);
+ }
+ zephir_concat_self_str(&output, SL(" (\n"));
+ zephir_read_property(&_41$$9, this_ptr, ZEND_STRL("detailed"), PH_NOISY_CC | PH_READONLY);
+ _42$$9 = !zephir_is_true(&_41$$9);
+ if (!(_42$$9)) {
+ _42$$9 = zephir_is_instance_of(variable, SL("stdClass"));
+ }
+ if (zephir_instance_of_ev(variable, phalcon_di_di_ce)) {
+ ZVAL_LONG(&_43$$11, tab);
+ ZEPHIR_CALL_FUNCTION(&_44$$11, "str_repeat", &_10, 1, &space, &_43$$11);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_45$$11);
+ ZEPHIR_CONCAT_VS(&_45$$11, &_44$$11, "[skipped]\n");
+ zephir_concat_self(&output, &_45$$11);
+ } else if (_42$$9) {
+ ZEPHIR_CALL_FUNCTION(&_46$$12, "get_object_vars", NULL, 426, variable);
+ zephir_check_call_status();
+ zephir_is_iterable(&_46$$12, 0, "phalcon/Support/Debug/Dump.zep", 280);
+ if (Z_TYPE_P(&_46$$12) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_46$$12), _49$$12, _50$$12, _47$$12)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_50$$12 != NULL) {
+ ZVAL_STR_COPY(&key, _50$$12);
+ } else {
+ ZVAL_LONG(&key, _49$$12);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _47$$12);
+ ZVAL_LONG(&_51$$13, tab);
+ ZEPHIR_CALL_FUNCTION(&_52$$13, "str_repeat", &_10, 1, &space, &_51$$13);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_53$$13);
+ zephir_create_array(&_53$$13, 3, 0);
+ ZEPHIR_INIT_NVAR(&_55$$13);
+ ZVAL_STRING(&_55$$13, "obj");
+ ZEPHIR_CALL_METHOD(&_54$$13, this_ptr, "getstyle", NULL, 0, &_55$$13);
+ zephir_check_call_status();
+ zephir_array_update_string(&_53$$13, SL(":style"), &_54$$13, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_53$$13, SL(":key"), &key, PH_COPY | PH_SEPARATE);
+ add_assoc_stringl_ex(&_53$$13, SL(":type"), SL("public"));
+ ZEPHIR_INIT_NVAR(&_55$$13);
+ ZVAL_STRING(&_55$$13, "->
:key (
:type) = ");
+ ZEPHIR_CALL_FUNCTION(&_54$$13, "strtr", NULL, 5, &_55$$13, &_53$$13);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_56$$13);
+ ZEPHIR_CONCAT_VV(&_56$$13, &_52$$13, &_54$$13);
+ zephir_concat_self(&output, &_56$$13);
+ ZEPHIR_INIT_NVAR(&_55$$13);
+ ZVAL_STRING(&_55$$13, "");
+ ZVAL_LONG(&_51$$13, (tab + 1));
+ ZEPHIR_CALL_METHOD(&_57$$13, this_ptr, "output", &_19, 0, &value, &_55$$13, &_51$$13);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_58$$13);
+ ZEPHIR_CONCAT_VS(&_58$$13, &_57$$13, "\n");
+ zephir_concat_self(&output, &_58$$13);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_46$$12, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_48$$12, &_46$$12, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_48$$12)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, &_46$$12, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_46$$12, "current", NULL, 0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_59$$14, tab);
+ ZEPHIR_CALL_FUNCTION(&_60$$14, "str_repeat", &_10, 1, &space, &_59$$14);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_61$$14);
+ zephir_create_array(&_61$$14, 3, 0);
+ ZEPHIR_INIT_NVAR(&_63$$14);
+ ZVAL_STRING(&_63$$14, "obj");
+ ZEPHIR_CALL_METHOD(&_62$$14, this_ptr, "getstyle", NULL, 0, &_63$$14);
+ zephir_check_call_status();
+ zephir_array_update_string(&_61$$14, SL(":style"), &_62$$14, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_61$$14, SL(":key"), &key, PH_COPY | PH_SEPARATE);
+ add_assoc_stringl_ex(&_61$$14, SL(":type"), SL("public"));
+ ZEPHIR_INIT_NVAR(&_63$$14);
+ ZVAL_STRING(&_63$$14, "->
:key (
:type) = ");
+ ZEPHIR_CALL_FUNCTION(&_62$$14, "strtr", NULL, 5, &_63$$14, &_61$$14);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_64$$14);
+ ZEPHIR_CONCAT_VV(&_64$$14, &_60$$14, &_62$$14);
+ zephir_concat_self(&output, &_64$$14);
+ ZEPHIR_INIT_NVAR(&_63$$14);
+ ZVAL_STRING(&_63$$14, "");
+ ZVAL_LONG(&_59$$14, (tab + 1));
+ ZEPHIR_CALL_METHOD(&_65$$14, this_ptr, "output", &_19, 0, &value, &_63$$14, &_59$$14);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_66$$14);
+ ZEPHIR_CONCAT_VS(&_66$$14, &_65$$14, "\n");
+ zephir_concat_self(&output, &_66$$14);
+ ZEPHIR_CALL_METHOD(NULL, &_46$$12, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_CALL_METHOD(&header, &_3, "key", NULL, 0);
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ } else {
+ ZEPHIR_INIT_VAR(&reflect$$15);
+ object_init_ex(&reflect$$15, zephir_get_internal_ce(SL("reflectionclass")));
+ ZEPHIR_CALL_METHOD(NULL, &reflect$$15, "__construct", NULL, 154, variable);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &_3, "current", NULL, 0);
+ ZVAL_LONG(&_67$$15, ((1 | 2) | 4));
+ ZEPHIR_CALL_METHOD(&props$$15, &reflect$$15, "getproperties", NULL, 165, &_67$$15);
zephir_check_call_status();
- if (Z_TYPE_P(&value) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_15$$10);
- ZEPHIR_CONCAT_VSV(&_15$$10, &header, ": ", &value);
- ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_15$$10, &__$true);
+ zephir_is_iterable(&props$$15, 0, "phalcon/Support/Debug/Dump.zep", 306);
+ if (Z_TYPE_P(&props$$15) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&props$$15), _68$$15)
+ {
+ ZEPHIR_INIT_NVAR(&property$$15);
+ ZVAL_COPY(&property$$15, _68$$15);
+ ZVAL_BOOL(&_70$$16, 1);
+ ZEPHIR_CALL_METHOD(NULL, &property$$15, "setaccessible", &_71, 0, &_70$$16);
zephir_check_call_status();
- } else {
- _16$$11 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99);
- if (!(_16$$11)) {
- ZVAL_LONG(&_17$$11, 0);
- ZVAL_LONG(&_18$$11, 5);
- ZEPHIR_INIT_NVAR(&_19$$11);
- zephir_substr(&_19$$11, &header, 0 , 5 , 0);
- _16$$11 = ZEPHIR_IS_STRING(&_19$$11, "HTTP/");
+ ZEPHIR_CALL_METHOD(&key, &property$$15, "getname", &_72, 0);
+ zephir_check_call_status();
+ _74$$16 = zephir_fetch_class_str_ex(SL("Reflection"), ZEND_FETCH_CLASS_AUTO);
+ ZEPHIR_CALL_METHOD(&_76$$16, &property$$15, "getmodifiers", &_77, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_CE_STATIC(&_73$$16, _74$$16, "getmodifiernames", &_75, 0, &_76$$16);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&type);
+ zephir_fast_join_str(&type, SL(" "), &_73$$16);
+ ZVAL_LONG(&_70$$16, tab);
+ ZEPHIR_CALL_FUNCTION(&_78$$16, "str_repeat", &_10, 1, &space, &_70$$16);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_79$$16);
+ zephir_create_array(&_79$$16, 3, 0);
+ ZEPHIR_INIT_NVAR(&_81$$16);
+ ZVAL_STRING(&_81$$16, "obj");
+ ZEPHIR_CALL_METHOD(&_80$$16, this_ptr, "getstyle", NULL, 0, &_81$$16);
+ zephir_check_call_status();
+ zephir_array_update_string(&_79$$16, SL(":style"), &_80$$16, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_79$$16, SL(":key"), &key, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_79$$16, SL(":type"), &type, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_81$$16);
+ ZVAL_STRING(&_81$$16, "->
:key (
:type) = ");
+ ZEPHIR_CALL_FUNCTION(&_80$$16, "strtr", NULL, 5, &_81$$16, &_79$$16);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_82$$16);
+ ZEPHIR_CONCAT_VV(&_82$$16, &_78$$16, &_80$$16);
+ zephir_concat_self(&output, &_82$$16);
+ ZEPHIR_CALL_METHOD(&_84$$16, &property$$15, "getvalue", &_85, 0, variable);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_81$$16);
+ ZVAL_STRING(&_81$$16, "");
+ ZVAL_LONG(&_70$$16, (tab + 1));
+ ZEPHIR_CALL_METHOD(&_83$$16, this_ptr, "output", &_19, 0, &_84$$16, &_81$$16, &_70$$16);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_86$$16);
+ ZEPHIR_CONCAT_VS(&_86$$16, &_83$$16, "\n");
+ zephir_concat_self(&output, &_86$$16);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &props$$15, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_69$$15, &props$$15, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_69$$15)) {
+ break;
}
- if (_16$$11) {
- ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &header, &__$true);
+ ZEPHIR_CALL_METHOD(&property$$15, &props$$15, "current", NULL, 0);
+ zephir_check_call_status();
+ ZVAL_BOOL(&_87$$17, 1);
+ ZEPHIR_CALL_METHOD(NULL, &property$$15, "setaccessible", &_88, 0, &_87$$17);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&key, &property$$15, "getname", &_89, 0);
+ zephir_check_call_status();
+ _91$$17 = zephir_fetch_class_str_ex(SL("Reflection"), ZEND_FETCH_CLASS_AUTO);
+ ZEPHIR_CALL_METHOD(&_92$$17, &property$$15, "getmodifiers", &_93, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_CE_STATIC(&_90$$17, _91$$17, "getmodifiernames", &_75, 0, &_92$$17);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&type);
+ zephir_fast_join_str(&type, SL(" "), &_90$$17);
+ ZVAL_LONG(&_87$$17, tab);
+ ZEPHIR_CALL_FUNCTION(&_94$$17, "str_repeat", &_10, 1, &space, &_87$$17);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_95$$17);
+ zephir_create_array(&_95$$17, 3, 0);
+ ZEPHIR_INIT_NVAR(&_97$$17);
+ ZVAL_STRING(&_97$$17, "obj");
+ ZEPHIR_CALL_METHOD(&_96$$17, this_ptr, "getstyle", NULL, 0, &_97$$17);
+ zephir_check_call_status();
+ zephir_array_update_string(&_95$$17, SL(":style"), &_96$$17, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_95$$17, SL(":key"), &key, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_95$$17, SL(":type"), &type, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_97$$17);
+ ZVAL_STRING(&_97$$17, "->
:key (
:type) = ");
+ ZEPHIR_CALL_FUNCTION(&_96$$17, "strtr", NULL, 5, &_97$$17, &_95$$17);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_98$$17);
+ ZEPHIR_CONCAT_VV(&_98$$17, &_94$$17, &_96$$17);
+ zephir_concat_self(&output, &_98$$17);
+ ZEPHIR_CALL_METHOD(&_100$$17, &property$$15, "getvalue", &_101, 0, variable);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_97$$17);
+ ZVAL_STRING(&_97$$17, "");
+ ZVAL_LONG(&_87$$17, (tab + 1));
+ ZEPHIR_CALL_METHOD(&_99$$17, this_ptr, "output", &_19, 0, &_100$$17, &_97$$17, &_87$$17);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_102$$17);
+ ZEPHIR_CONCAT_VS(&_102$$17, &_99$$17, "\n");
+ zephir_concat_self(&output, &_102$$17);
+ ZEPHIR_CALL_METHOD(NULL, &props$$15, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&property$$15);
+ }
+ ZEPHIR_CALL_FUNCTION(&attr, "get_class_methods", NULL, 0, variable);
+ zephir_check_call_status();
+ ZVAL_LONG(&_103$$9, tab);
+ ZEPHIR_CALL_FUNCTION(&_104$$9, "str_repeat", &_10, 1, &space, &_103$$9);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_105$$9);
+ zephir_create_array(&_105$$9, 3, 0);
+ ZEPHIR_INIT_NVAR(&_36$$9);
+ ZVAL_STRING(&_36$$9, "obj");
+ ZEPHIR_CALL_METHOD(&_106$$9, this_ptr, "getstyle", NULL, 0, &_36$$9);
+ zephir_check_call_status();
+ zephir_array_update_string(&_105$$9, SL(":style"), &_106$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_36$$9);
+ zephir_get_class(&_36$$9, variable, 0);
+ zephir_array_update_string(&_105$$9, SL(":class"), &_36$$9, PH_COPY | PH_SEPARATE);
+ add_assoc_long_ex(&_105$$9, SL(":count"), zephir_fast_count_int(&attr));
+ ZEPHIR_INIT_NVAR(&_36$$9);
+ ZVAL_STRING(&_36$$9, ":class
methods: (
:count) (\n");
+ ZEPHIR_CALL_FUNCTION(&_106$$9, "strtr", NULL, 5, &_36$$9, &_105$$9);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_107$$9);
+ ZEPHIR_CONCAT_VV(&_107$$9, &_104$$9, &_106$$9);
+ zephir_concat_self(&output, &_107$$9);
+ ZEPHIR_INIT_NVAR(&_36$$9);
+ zephir_get_class(&_36$$9, variable, 0);
+ zephir_read_property(&_103$$9, this_ptr, ZEND_STRL("methods"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_fast_in_array(&_36$$9, &_103$$9)) {
+ ZVAL_LONG(&_108$$18, tab);
+ ZEPHIR_CALL_FUNCTION(&_109$$18, "str_repeat", &_10, 1, &space, &_108$$18);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_110$$18);
+ ZEPHIR_CONCAT_VS(&_110$$18, &_109$$18, "[already listed]\n");
+ zephir_concat_self(&output, &_110$$18);
+ } else {
+ zephir_is_iterable(&attr, 0, "phalcon/Support/Debug/Dump.zep", 324);
+ if (Z_TYPE_P(&attr) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attr), _111$$19)
+ {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _111$$19);
+ ZEPHIR_INIT_NVAR(&_113$$20);
+ zephir_get_class(&_113$$20, variable, 0);
+ zephir_update_property_array_append(this_ptr, SL("methods"), &_113$$20);
+ if (ZEPHIR_IS_STRING(&value, "__construct")) {
+ ZVAL_LONG(&_114$$21, (tab + 1));
+ ZEPHIR_CALL_FUNCTION(&_115$$21, "str_repeat", &_10, 1, &space, &_114$$21);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_116$$21);
+ zephir_create_array(&_116$$21, 2, 0);
+ ZEPHIR_INIT_NVAR(&_118$$21);
+ ZVAL_STRING(&_118$$21, "obj");
+ ZEPHIR_CALL_METHOD(&_117$$21, this_ptr, "getstyle", NULL, 0, &_118$$21);
+ zephir_check_call_status();
+ zephir_array_update_string(&_116$$21, SL(":style"), &_117$$21, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_116$$21, SL(":method"), &value, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_118$$21);
+ ZVAL_STRING(&_118$$21, "->
:method(); [
constructor]\n");
+ ZEPHIR_CALL_FUNCTION(&_117$$21, "strtr", NULL, 5, &_118$$21, &_116$$21);
zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_119$$21);
+ ZEPHIR_CONCAT_VV(&_119$$21, &_115$$21, &_117$$21);
+ zephir_concat_self(&output, &_119$$21);
} else {
- ZEPHIR_INIT_NVAR(&_20$$13);
- ZEPHIR_CONCAT_VS(&_20$$13, &header, ": ");
- ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_20$$13, &__$true);
+ ZVAL_LONG(&_120$$22, (tab + 1));
+ ZEPHIR_CALL_FUNCTION(&_121$$22, "str_repeat", &_10, 1, &space, &_120$$22);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_122$$22);
+ zephir_create_array(&_122$$22, 2, 0);
+ ZEPHIR_INIT_NVAR(&_124$$22);
+ ZVAL_STRING(&_124$$22, "obj");
+ ZEPHIR_CALL_METHOD(&_123$$22, this_ptr, "getstyle", NULL, 0, &_124$$22);
+ zephir_check_call_status();
+ zephir_array_update_string(&_122$$22, SL(":style"), &_123$$22, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_122$$22, SL(":method"), &value, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_124$$22);
+ ZVAL_STRING(&_124$$22, "->
:method();\n");
+ ZEPHIR_CALL_FUNCTION(&_123$$22, "strtr", NULL, 5, &_124$$22, &_122$$22);
zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_125$$22);
+ ZEPHIR_CONCAT_VV(&_125$$22, &_121$$22, &_123$$22);
+ zephir_concat_self(&output, &_125$$22);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &attr, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_112$$19, &attr, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_112$$19)) {
+ break;
}
+ ZEPHIR_CALL_METHOD(&value, &attr, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_126$$23);
+ zephir_get_class(&_126$$23, variable, 0);
+ zephir_update_property_array_append(this_ptr, SL("methods"), &_126$$23);
+ if (ZEPHIR_IS_STRING(&value, "__construct")) {
+ ZVAL_LONG(&_127$$24, (tab + 1));
+ ZEPHIR_CALL_FUNCTION(&_128$$24, "str_repeat", &_10, 1, &space, &_127$$24);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_129$$24);
+ zephir_create_array(&_129$$24, 2, 0);
+ ZEPHIR_INIT_NVAR(&_131$$24);
+ ZVAL_STRING(&_131$$24, "obj");
+ ZEPHIR_CALL_METHOD(&_130$$24, this_ptr, "getstyle", NULL, 0, &_131$$24);
+ zephir_check_call_status();
+ zephir_array_update_string(&_129$$24, SL(":style"), &_130$$24, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_129$$24, SL(":method"), &value, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_131$$24);
+ ZVAL_STRING(&_131$$24, "->
:method(); [
constructor]\n");
+ ZEPHIR_CALL_FUNCTION(&_130$$24, "strtr", NULL, 5, &_131$$24, &_129$$24);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_132$$24);
+ ZEPHIR_CONCAT_VV(&_132$$24, &_128$$24, &_130$$24);
+ zephir_concat_self(&output, &_132$$24);
+ } else {
+ ZVAL_LONG(&_133$$25, (tab + 1));
+ ZEPHIR_CALL_FUNCTION(&_134$$25, "str_repeat", &_10, 1, &space, &_133$$25);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_135$$25);
+ zephir_create_array(&_135$$25, 2, 0);
+ ZEPHIR_INIT_NVAR(&_137$$25);
+ ZVAL_STRING(&_137$$25, "obj");
+ ZEPHIR_CALL_METHOD(&_136$$25, this_ptr, "getstyle", NULL, 0, &_137$$25);
+ zephir_check_call_status();
+ zephir_array_update_string(&_135$$25, SL(":style"), &_136$$25, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_135$$25, SL(":method"), &value, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_137$$25);
+ ZVAL_STRING(&_137$$25, "->
:method();\n");
+ ZEPHIR_CALL_FUNCTION(&_136$$25, "strtr", NULL, 5, &_137$$25, &_135$$25);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_138$$25);
+ ZEPHIR_CONCAT_VV(&_138$$25, &_134$$25, &_136$$25);
+ zephir_concat_self(&output, &_138$$25);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &attr, "next", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_LONG(&_139$$19, tab);
+ ZEPHIR_CALL_FUNCTION(&_140$$19, "str_repeat", &_10, 1, &space, &_139$$19);
zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_141$$19);
+ ZEPHIR_CONCAT_VS(&_141$$19, &_140$$19, ")\n");
+ zephir_concat_self(&output, &_141$$19);
}
+ ZVAL_LONG(&_142$$9, (tab - 1));
+ ZEPHIR_CALL_FUNCTION(&_143$$9, "str_repeat", &_10, 1, &space, &_142$$9);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VVS(return_value, &output, &_143$$9, ")");
+ RETURN_MM();
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&header);
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$false);
+ if (Z_TYPE_P(variable) == IS_LONG) {
+ ZEPHIR_INIT_VAR(&_144$$26);
+ zephir_create_array(&_144$$26, 2, 0);
+ ZEPHIR_INIT_VAR(&_146$$26);
+ ZVAL_STRING(&_146$$26, "int");
+ ZEPHIR_CALL_METHOD(&_145$$26, this_ptr, "getstyle", NULL, 0, &_146$$26);
+ zephir_check_call_status();
+ zephir_array_update_string(&_144$$26, SL(":style"), &_145$$26, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_144$$26, SL(":var"), variable, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_146$$26);
+ ZVAL_STRING(&_146$$26, "
Integer (
:var)");
+ ZEPHIR_CALL_FUNCTION(&_145$$26, "strtr", NULL, 5, &_146$$26, &_144$$26);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &output, &_145$$26);
+ RETURN_MM();
}
- RETURN_MM_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Http_Response_Headers, set)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *value_param = NULL;
- zval name, value;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&value);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_STR(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &name_param, &value_param);
- zephir_get_strval(&name, name_param);
- zephir_get_strval(&value, value_param);
- zephir_update_property_array(this_ptr, SL("headers"), &name, &value);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response_Headers, setRaw)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *header_param = NULL, __$null;
- zval header;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&header);
- ZVAL_NULL(&__$null);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(header)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &header_param);
- zephir_get_strval(&header, header_param);
- zephir_update_property_array(this_ptr, SL("headers"), &header, &__$null);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Http_Response_Headers, toArray)
-{
-
- RETURN_MEMBER(getThis(), "headers");
+ ZEPHIR_CALL_FUNCTION(&_147, "is_float", NULL, 214, variable);
+ zephir_check_call_status();
+ if (zephir_is_true(&_147)) {
+ ZEPHIR_INIT_VAR(&_148$$27);
+ zephir_create_array(&_148$$27, 2, 0);
+ ZEPHIR_INIT_VAR(&_150$$27);
+ ZVAL_STRING(&_150$$27, "float");
+ ZEPHIR_CALL_METHOD(&_149$$27, this_ptr, "getstyle", NULL, 0, &_150$$27);
+ zephir_check_call_status();
+ zephir_array_update_string(&_148$$27, SL(":style"), &_149$$27, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_148$$27, SL(":var"), variable, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_150$$27);
+ ZVAL_STRING(&_150$$27, "
Float (
:var)");
+ ZEPHIR_CALL_FUNCTION(&_149$$27, "strtr", NULL, 5, &_150$$27, &_148$$27);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &output, &_149$$27);
+ RETURN_MM();
+ }
+ if (zephir_is_numeric(variable)) {
+ ZEPHIR_INIT_VAR(&_151$$28);
+ zephir_create_array(&_151$$28, 3, 0);
+ ZEPHIR_INIT_VAR(&_153$$28);
+ ZVAL_STRING(&_153$$28, "num");
+ ZEPHIR_CALL_METHOD(&_152$$28, this_ptr, "getstyle", NULL, 0, &_153$$28);
+ zephir_check_call_status();
+ zephir_array_update_string(&_151$$28, SL(":style"), &_152$$28, PH_COPY | PH_SEPARATE);
+ add_assoc_long_ex(&_151$$28, SL(":length"), zephir_fast_strlen_ev(variable));
+ zephir_array_update_string(&_151$$28, SL(":var"), variable, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_153$$28);
+ ZVAL_STRING(&_153$$28, "
Numeric string (
:length) \"
:var\"");
+ ZEPHIR_CALL_FUNCTION(&_152$$28, "strtr", NULL, 5, &_153$$28, &_151$$28);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &output, &_152$$28);
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(variable) == IS_STRING) {
+ ZEPHIR_INIT_VAR(&_154$$29);
+ zephir_create_array(&_154$$29, 3, 0);
+ ZEPHIR_INIT_VAR(&_156$$29);
+ ZVAL_STRING(&_156$$29, "str");
+ ZEPHIR_CALL_METHOD(&_155$$29, this_ptr, "getstyle", NULL, 0, &_156$$29);
+ zephir_check_call_status();
+ zephir_array_update_string(&_154$$29, SL(":style"), &_155$$29, PH_COPY | PH_SEPARATE);
+ add_assoc_long_ex(&_154$$29, SL(":length"), zephir_fast_strlen_ev(variable));
+ ZVAL_LONG(&_157$$29, 4);
+ ZEPHIR_INIT_NVAR(&_156$$29);
+ ZVAL_STRING(&_156$$29, "utf-8");
+ ZEPHIR_CALL_FUNCTION(&_155$$29, "htmlentities", NULL, 0, variable, &_157$$29, &_156$$29);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_158$$29, "nl2br", NULL, 0, &_155$$29);
+ zephir_check_call_status();
+ zephir_array_update_string(&_154$$29, SL(":var"), &_158$$29, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_156$$29);
+ ZVAL_STRING(&_156$$29, "
String (
:length) \"
:var\"");
+ ZEPHIR_CALL_FUNCTION(&_158$$29, "strtr", NULL, 5, &_156$$29, &_154$$29);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &output, &_158$$29);
+ RETURN_MM();
+ }
+ if ((Z_TYPE_P(variable) == IS_TRUE || Z_TYPE_P(variable) == IS_FALSE)) {
+ ZEPHIR_INIT_VAR(&_159$$30);
+ zephir_create_array(&_159$$30, 2, 0);
+ ZEPHIR_INIT_VAR(&_161$$30);
+ ZVAL_STRING(&_161$$30, "bool");
+ ZEPHIR_CALL_METHOD(&_160$$30, this_ptr, "getstyle", NULL, 0, &_161$$30);
+ zephir_check_call_status();
+ zephir_array_update_string(&_159$$30, SL(":style"), &_160$$30, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_162$$30);
+ if (zephir_is_true(variable)) {
+ ZEPHIR_INIT_NVAR(&_162$$30);
+ ZVAL_STRING(&_162$$30, "TRUE");
+ } else {
+ ZEPHIR_INIT_NVAR(&_162$$30);
+ ZVAL_STRING(&_162$$30, "FALSE");
+ }
+ zephir_array_update_string(&_159$$30, SL(":var"), &_162$$30, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_161$$30);
+ ZVAL_STRING(&_161$$30, "
Boolean (
:var)");
+ ZEPHIR_CALL_FUNCTION(&_160$$30, "strtr", NULL, 5, &_161$$30, &_159$$30);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &output, &_160$$30);
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(variable) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_163$$31);
+ zephir_create_array(&_163$$31, 1, 0);
+ ZEPHIR_INIT_VAR(&_165$$31);
+ ZVAL_STRING(&_165$$31, "null");
+ ZEPHIR_CALL_METHOD(&_164$$31, this_ptr, "getstyle", NULL, 0, &_165$$31);
+ zephir_check_call_status();
+ zephir_array_update_string(&_163$$31, SL(":style"), &_164$$31, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_165$$31);
+ ZVAL_STRING(&_165$$31, "
NULL");
+ ZEPHIR_CALL_FUNCTION(&_164$$31, "strtr", NULL, 5, &_165$$31, &_163$$31);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &output, &_164$$31);
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_166);
+ zephir_create_array(&_166, 2, 0);
+ ZEPHIR_INIT_VAR(&_168);
+ ZVAL_STRING(&_168, "other");
+ ZEPHIR_CALL_METHOD(&_167, this_ptr, "getstyle", NULL, 0, &_168);
+ zephir_check_call_status();
+ zephir_array_update_string(&_166, SL(":style"), &_167, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_166, SL(":var"), variable, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_168);
+ ZVAL_STRING(&_168, "(
:var)");
+ ZEPHIR_CALL_FUNCTION(&_167, "strtr", NULL, 5, &_168, &_166);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &output, &_167);
+ RETURN_MM();
}
-zend_object *zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Support_Debug_Dump(zend_class_entry *class_type)
{
- zval _0, _1$$3;
+ zval _0, _2, _1$$3, _3$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
@@ -142689,11 +139789,17 @@ zend_object *zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_ent
{
zval local_this_ptr, *this_ptr = &local_this_ptr;
ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("styles"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_0) == IS_NULL) {
ZEPHIR_INIT_VAR(&_1$$3);
array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("headers"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("styles"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("methods"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_2) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ array_init(&_3$$4);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("methods"), &_3$$4);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -142710,19 +139816,13 @@ zend_object *zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_ent
-ZEPHIR_INIT_CLASS(Phalcon_Http_Response_HeadersInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Debug_Exception)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Response, HeadersInterface, phalcon, http_response_headersinterface, phalcon_http_response_headersinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Debug, Exception, phalcon, support_debug_exception, zend_ce_exception, NULL, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, reset);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, send);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, set);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, setRaw);
@@ -142733,9 +139833,9 @@ ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, setRaw);
-ZEPHIR_INIT_CLASS(Phalcon_Http_Request_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Request, Exception, phalcon, http_request_exception, zend_ce_exception, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper, Exception, phalcon, support_helper_exception, zend_ce_exception, NULL, 0);
return SUCCESS;
}
@@ -142750,253 +139850,406 @@ ZEPHIR_INIT_CLASS(Phalcon_Http_Request_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Http_Request_File)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Json_Decode)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Request, File, phalcon, http_request_file, phalcon_http_request_file_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Json, Decode, phalcon, support_helper_json_decode, phalcon_support_helper_json_decode_method_entry, 0);
- zend_declare_property_null(phalcon_http_request_file_ce, SL("error"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_http_request_file_ce, SL("extension"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_http_request_file_ce, SL("key"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_http_request_file_ce, SL("name"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_http_request_file_ce, SL("realType"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_http_request_file_ce, SL("size"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_http_request_file_ce, SL("tmp"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_http_request_file_ce, SL("type"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_http_request_file_ce, 1, phalcon_http_request_fileinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Http_Request_File, __construct)
+static PHP_METHOD(Phalcon_Support_Helper_Json_Decode, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *file_param = NULL, *key = NULL, key_sub, __$null, name, _4, _5, _6, _7, _8, _0$$3, _1$$3, _2$$4, _3$$4;
- zval file;
- zval *this_ptr = getThis();
+ zend_long depth, options, ZEPHIR_LAST_CALL_STATUS;
+ zend_bool associative;
+ zval *data_param = NULL, *associative_param = NULL, *depth_param = NULL, *options_param = NULL, __$null, decoded, error, message, _0, _1, _2, _3$$3, _4$$3;
+ zval data;
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&key_sub);
+ ZVAL_UNDEF(&data);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$4);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(file)
+ ZVAL_UNDEF(&decoded);
+ ZVAL_UNDEF(&error);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(data)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(key)
+ Z_PARAM_BOOL(associative)
+ Z_PARAM_LONG(depth)
+ Z_PARAM_LONG(options)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &file_param, &key);
- ZEPHIR_OBS_COPY_OR_DUP(&file, file_param);
- if (!key) {
- key = &key_sub;
- key = &__$null;
- }
- zephir_memory_observe(&name);
- if (zephir_array_isset_string_fetch(&name, &file, SL("name"), 0)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- ZEPHIR_INIT_VAR(&_0$$3);
- ZVAL_STRING(&_0$$3, "PATHINFO_EXTENSION");
- ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 118, &_0$$3);
- zephir_check_call_status();
- if (zephir_is_true(&_1$$3)) {
- ZVAL_LONG(&_2$$4, 4);
- ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 89, &name, &_2$$4);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("extension"), &_3$$4);
+ zephir_fetch_params(1, 1, 3, &data_param, &associative_param, &depth_param, &options_param);
+ zephir_get_strval(&data, data_param);
+ if (!associative_param) {
+ associative = 0;
+ } else {
}
- }
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, "tmp_name");
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "getarrval", NULL, 353, &file, &_5);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("tmp"), &_4);
- ZEPHIR_INIT_NVAR(&_5);
- ZVAL_STRING(&_5, "size");
- ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 353, &file, &_5);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &_6);
- ZEPHIR_INIT_NVAR(&_5);
- ZVAL_STRING(&_5, "type");
- ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 353, &file, &_5);
+ if (!depth_param) {
+ depth = 512;
+ } else {
+ }
+ if (!options_param) {
+ options = 79;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&decoded);
+ zephir_json_encode(&decoded, &__$null, 0 );
+ ZVAL_BOOL(&_0, (associative ? 1 : 0));
+ ZVAL_LONG(&_1, depth);
+ ZVAL_LONG(&_2, options);
+ ZEPHIR_INIT_NVAR(&decoded);
+ zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) );
+ ZEPHIR_CALL_FUNCTION(&error, "json_last_error", NULL, 0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_7);
- ZEPHIR_INIT_NVAR(&_5);
- ZVAL_STRING(&_5, "error");
- ZEPHIR_CALL_METHOD(&_8, this_ptr, "getarrval", NULL, 353, &file, &_5);
+ ZEPHIR_CALL_FUNCTION(&message, "json_last_error_msg", NULL, 0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("error"), &_8);
- if (zephir_is_true(key)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("key"), key);
+ if (!ZEPHIR_IS_LONG_IDENTICAL(&error, 0)) {
+ ZEPHIR_INIT_VAR(&_3$$3);
+ zephir_json_encode(&_3$$3, &__$null, 0 );
+ ZEPHIR_INIT_VAR(&_4$$3);
+ object_init_ex(&_4$$3, spl_ce_InvalidArgumentException);
+ ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 200, &message, &error);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_4$$3, "phalcon/Support/Helper/Json/Decode.zep", 64);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_MM_RESTORE();
+ RETURN_CCTOR(&decoded);
}
-static PHP_METHOD(Phalcon_Http_Request_File, getError)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Json_Encode)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Json, Encode, phalcon, support_helper_json_encode, phalcon_support_helper_json_encode_method_entry, 0);
- RETURN_MEMBER(getThis(), "error");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Http_Request_File, getExtension)
+static PHP_METHOD(Phalcon_Support_Helper_Json_Encode, __invoke)
{
+ zval _4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long options, depth, ZEPHIR_LAST_CALL_STATUS;
+ zval *data, data_sub, *options_param = NULL, *depth_param = NULL, __$null, encoded, error, message, _0, _1, _2$$3, _3$$3;
- RETURN_MEMBER(getThis(), "extension");
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&encoded);
+ ZVAL_UNDEF(&error);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4);
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(data)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(options)
+ Z_PARAM_LONG(depth)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 2, &data, &options_param, &depth_param);
+ if (!options_param) {
+ options = 79;
+ } else {
+ }
+ if (!depth_param) {
+ depth = 512;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&encoded);
+ zephir_json_encode(&encoded, &__$null, 0 );
+ ZVAL_LONG(&_0, options);
+ ZVAL_LONG(&_1, depth);
+ ZEPHIR_INIT_NVAR(&encoded);
+ zephir_json_encode(&encoded, data, zephir_get_intval(&_0) );
+ ZEPHIR_CALL_FUNCTION(&error, "json_last_error", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&message, "json_last_error_msg", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_LONG_IDENTICAL(&error, 0)) {
+ ZEPHIR_INIT_VAR(&_2$$3);
+ zephir_json_encode(&_2$$3, &__$null, 0 );
+ ZEPHIR_INIT_VAR(&_3$$3);
+ object_init_ex(&_3$$3, spl_ce_InvalidArgumentException);
+ ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 200, &message, &error);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_3$$3, "phalcon/Support/Helper/Json/Encode.zep", 64);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_cast_to_string(&_4, &encoded);
+ RETURN_CTOR(&_4);
}
-static PHP_METHOD(Phalcon_Http_Request_File, getKey)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_AbstractArr)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, AbstractArr, phalcon, support_helper_arr_abstractarr, phalcon_support_helper_arr_abstractarr_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- RETURN_MEMBER(getThis(), "key");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Http_Request_File, getName)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_AbstractArr, toFilter)
{
+ zend_bool _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null;
+ zval collection;
- RETURN_MEMBER(getThis(), "name");
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(method)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+ _0 = !zephir_is_true(method);
+ if (!(_0)) {
+ _0 = !(zephir_is_callable(method));
+ }
+ if (_0) {
+ RETURN_CTOR(&collection);
+ }
+ ZEPHIR_RETURN_CALL_FUNCTION("array_filter", NULL, 17, &collection, method);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Request_File, getRealType)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Blacklist)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, Blacklist, phalcon, support_helper_arr_blacklist, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_blacklist_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Blacklist, __invoke)
{
- zval finfo, mime, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *blackList_param = NULL, blackListed, _0, _1;
+ zval collection, blackList;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&finfo);
- ZVAL_UNDEF(&mime);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&blackList);
+ ZVAL_UNDEF(&blackListed);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ARRAY(blackList)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZVAL_LONG(&_0, 16);
- ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 308, &_0);
+ zephir_fetch_params(1, 2, 0, &collection_param, &blackList_param);
+ zephir_get_arrval(&collection, collection_param);
+ zephir_get_arrval(&blackList, blackList_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_NVAR(&_0);
+ zephir_create_closure_ex(&_0, NULL, phalcon_12__closure_ce, SL("__invoke"));
+ ZEPHIR_CALL_METHOD(&blackListed, this_ptr, "tofilter", NULL, 0, &blackList, &_0);
zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&finfo)) {
- RETURN_MM_STRING("");
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 309, &finfo, &_0);
+ ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 100, &blackListed);
zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 310, &finfo);
+ ZEPHIR_RETURN_CALL_FUNCTION("array_diff_key", NULL, 99, &collection, &_1);
zephir_check_call_status();
- RETURN_CCTOR(&mime);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Request_File, getSize)
-{
- RETURN_MEMBER(getThis(), "size");
-}
-static PHP_METHOD(Phalcon_Http_Request_File, getTempName)
-{
- RETURN_MEMBER(getThis(), "tmp");
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Http_Request_File, getType)
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Chunk)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Chunk, phalcon, support_helper_arr_chunk, phalcon_support_helper_arr_chunk_method_entry, 0);
- RETURN_MEMBER(getThis(), "type");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Http_Request_File, isUploadedFile)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Chunk, __invoke)
{
- zend_bool _0;
- zval tmp, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
+ zend_bool preserveKeys;
+ zend_long size, ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *size_param = NULL, *preserveKeys_param = NULL, _0, _1;
+ zval collection;
- ZVAL_UNDEF(&tmp);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_LONG(size)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(preserveKeys)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_METHOD(&tmp, this_ptr, "gettempname", NULL, 0);
+ zephir_fetch_params(1, 2, 1, &collection_param, &size_param, &preserveKeys_param);
+ zephir_get_arrval(&collection, collection_param);
+ if (!preserveKeys_param) {
+ preserveKeys = 0;
+ } else {
+ }
+ ZVAL_LONG(&_0, size);
+ ZVAL_BOOL(&_1, (preserveKeys ? 1 : 0));
+ ZEPHIR_RETURN_CALL_FUNCTION("array_chunk", NULL, 0, &collection, &_0, &_1);
zephir_check_call_status();
- _0 = Z_TYPE_P(&tmp) == IS_STRING;
- if (_0) {
- ZEPHIR_CALL_FUNCTION(&_1, "is_uploaded_file", NULL, 20, &tmp);
- zephir_check_call_status();
- _0 = zephir_is_true(&_1);
- }
- RETURN_MM_BOOL(_0);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Request_File, moveTo)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Filter)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, Filter, phalcon, support_helper_arr_filter, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_filter_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Filter, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *destination_param = NULL, _0;
- zval destination;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null;
+ zval collection;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&destination);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(destination)
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(method)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &destination_param);
- if (UNEXPECTED(Z_TYPE_P(destination_param) != IS_STRING && Z_TYPE_P(destination_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'destination' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(destination_param) == IS_STRING)) {
- zephir_get_strval(&destination, destination_param);
- } else {
- ZEPHIR_INIT_VAR(&destination);
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 354, &_0, &destination);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "tofilter", NULL, 0, &collection, method);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Http_Request_File, getArrVal)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_First)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, First, phalcon, support_helper_arr_first, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_first_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_First, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null, filtered;
zval collection;
+ zval *this_ptr = getThis();
ZVAL_UNDEF(&collection);
- ZVAL_UNDEF(&index_sub);
- ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&method_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&filtered);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_ARRAY(collection)
- Z_PARAM_ZVAL(index)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_ZVAL_OR_NULL(method)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue);
- ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- zephir_memory_observe(&value);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
}
- RETURN_CCTOR(&value);
+ ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&filtered);
+ ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 477, &filtered);
+ ZEPHIR_UNREF(&filtered);
+ zephir_check_call_status();
+ RETURN_MM();
}
@@ -143009,20 +140262,46 @@ static PHP_METHOD(Phalcon_Http_Request_File, getArrVal)
-ZEPHIR_INIT_CLASS(Phalcon_Http_Request_FileInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_FirstKey)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Request, FileInterface, phalcon, http_request_fileinterface, phalcon_http_request_fileinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, FirstKey, phalcon, support_helper_arr_firstkey, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_firstkey_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getError);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getName);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getRealType);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getSize);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getTempName);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getType);
-ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, moveTo);
+static PHP_METHOD(Phalcon_Support_Helper_Arr_FirstKey, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null, filtered;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&filtered);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(method)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+ ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("array_key_first", NULL, 0, &filtered);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
@@ -143033,73 +140312,271 @@ ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, moveTo);
-ZEPHIR_INIT_CLASS(Phalcon_Acl_Component)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Flatten)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Acl, Component, phalcon, acl_component, phalcon_acl_component_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Flatten, phalcon, support_helper_arr_flatten, phalcon_support_helper_arr_flatten_method_entry, 0);
- zend_declare_property_null(phalcon_acl_component_ce, SL("description"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_acl_component_ce, SL("name"), ZEND_ACC_PRIVATE);
- zend_class_implements(phalcon_acl_component_ce, 1, phalcon_acl_componentinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Acl_Component, __construct)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Flatten, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *description_param = NULL;
- zval name, description;
+ zephir_fcall_cache_entry *_3 = NULL, *_5 = NULL, *_7 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool deep;
+ zval *collection_param = NULL, *deep_param = NULL, data, item, *_0, _1, _2$$3, _4$$3, _6$$3, _8$$4, _9$$4, _10$$4;
+ zval collection;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&description);
- bool is_null_true = 1;
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_10$$4);
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
+ Z_PARAM_ARRAY(collection)
Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(description)
+ Z_PARAM_BOOL(deep)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &description_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 1, 1, &collection_param, &deep_param);
+ zephir_get_arrval(&collection, collection_param);
+ if (!deep_param) {
+ deep = 0;
} else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!description_param) {
- ZEPHIR_INIT_VAR(&description);
+ }
+ ZEPHIR_INIT_VAR(&data);
+ array_init(&data);
+ zephir_is_iterable(&collection, 0, "phalcon/Support/Helper/Arr/Flatten.zep", 37);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
+ {
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _0);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "processnotarray", &_3, 0, &data, &item);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&data, &_2$$3);
+ if (deep) {
+ ZVAL_BOOL(&_4$$3, 1);
+ } else {
+ ZVAL_BOOL(&_4$$3, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "processarraydeep", &_5, 0, &data, &item, &_4$$3);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&data, &_2$$3);
+ if (deep) {
+ ZVAL_BOOL(&_6$$3, 1);
+ } else {
+ ZVAL_BOOL(&_6$$3, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "processarray", &_7, 0, &data, &item, &_6$$3);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&data, &_2$$3);
+ } ZEND_HASH_FOREACH_END();
} else {
- zephir_get_strval(&description, description_param);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &collection, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&item, &collection, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8$$4, this_ptr, "processnotarray", &_3, 0, &data, &item);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&data, &_8$$4);
+ if (deep) {
+ ZVAL_BOOL(&_9$$4, 1);
+ } else {
+ ZVAL_BOOL(&_9$$4, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_8$$4, this_ptr, "processarraydeep", &_5, 0, &data, &item, &_9$$4);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&data, &_8$$4);
+ if (deep) {
+ ZVAL_BOOL(&_10$$4, 1);
+ } else {
+ ZVAL_BOOL(&_10$$4, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_8$$4, this_ptr, "processarray", &_7, 0, &data, &item, &_10$$4);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&data, &_8$$4);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- if (UNEXPECTED(ZEPHIR_IS_STRING_IDENTICAL(&name, "*"))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Component name cannot be '*'", "phalcon/Acl/Component.zep", 38);
- return;
+ ZEPHIR_INIT_NVAR(&item);
+ RETURN_CCTOR(&data);
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Flatten, processNotArray)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *data_param = NULL, *item, item_sub;
+ zval data;
+
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&item_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(data)
+ Z_PARAM_ZVAL(item)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &data_param, &item);
+ zephir_get_arrval(&data, data_param);
+ if (Z_TYPE_P(item) != IS_ARRAY) {
+ zephir_array_append(&data, item, PH_SEPARATE, "phalcon/Support/Helper/Arr/Flatten.zep", 49);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- zephir_update_property_zval(this_ptr, ZEND_STRL("description"), &description);
- ZEPHIR_MM_RESTORE();
+ RETURN_CTOR(&data);
}
-static PHP_METHOD(Phalcon_Acl_Component, __toString)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Flatten, processArray)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool deep, _0;
+ zval *data_param = NULL, *item, item_sub, *deep_param = NULL, _1$$3, _2$$3;
+ zval data;
- RETURN_MEMBER(getThis(), "name");
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(data)
+ Z_PARAM_ZVAL(item)
+ Z_PARAM_BOOL(deep)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &data_param, &item, &deep_param);
+ zephir_get_arrval(&data, data_param);
+ _0 = Z_TYPE_P(item) == IS_ARRAY;
+ if (_0) {
+ _0 = !deep;
+ }
+ if (_0) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZEPHIR_CALL_FUNCTION(&_2$$3, "array_values", NULL, 14, item);
+ zephir_check_call_status();
+ zephir_fast_array_merge(&_1$$3, &data, &_2$$3);
+ ZEPHIR_CPY_WRT(&data, &_1$$3);
+ }
+ RETURN_CTOR(&data);
}
-static PHP_METHOD(Phalcon_Acl_Component, getDescription)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Flatten, processArrayDeep)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool deep, _0;
+ zval *data_param = NULL, *item, item_sub, *deep_param = NULL, _1$$3, _2$$3, _3$$3;
+ zval data;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "description");
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(data)
+ Z_PARAM_ZVAL(item)
+ Z_PARAM_BOOL(deep)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &data_param, &item, &deep_param);
+ zephir_get_arrval(&data, data_param);
+ _0 = Z_TYPE_P(item) == IS_ARRAY;
+ if (_0) {
+ _0 = deep;
+ }
+ if (_0) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_BOOL(&_3$$3, 1);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "__invoke", NULL, 0, item, &_3$$3);
+ zephir_check_call_status();
+ zephir_fast_array_merge(&_1$$3, &data, &_2$$3);
+ ZEPHIR_CPY_WRT(&data, &_1$$3);
+ }
+ RETURN_CTOR(&data);
}
-static PHP_METHOD(Phalcon_Acl_Component, getName)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Get)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Get, phalcon, support_helper_arr_get, phalcon_support_helper_arr_get_method_entry, 0);
- RETURN_MEMBER(getThis(), "name");
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Get, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval cast;
+ zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, *cast_param = NULL, __$null, value;
+ zval collection;
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&cast);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(index)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_STR_OR_NULL(cast)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 2, &collection_param, &index, &defaultValue, &cast_param);
+ zephir_get_arrval(&collection, collection_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!cast_param) {
+ ZEPHIR_INIT_VAR(&cast);
+ } else {
+ zephir_get_strval(&cast, cast_param);
+ }
+ ZEPHIR_CPY_WRT(&value, defaultValue);
+ if (1 == zephir_array_isset(&collection, index)) {
+ ZEPHIR_OBS_NVAR(&value);
+ zephir_array_fetch(&value, &collection, index, PH_NOISY, "phalcon/Support/Helper/Arr/Get.zep", 38);
+ }
+ if (!(ZEPHIR_IS_EMPTY(&cast))) {
+ ZEPHIR_MAKE_REF(&value);
+ ZEPHIR_CALL_FUNCTION(NULL, "settype", NULL, 11, &value, &cast);
+ ZEPHIR_UNREF(&value);
+ zephir_check_call_status();
+ }
+ RETURN_CCTOR(&value);
}
@@ -143112,14 +140589,220 @@ static PHP_METHOD(Phalcon_Acl_Component, getName)
-ZEPHIR_INIT_CLASS(Phalcon_Acl_ComponentAwareInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Group)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, ComponentAwareInterface, phalcon, acl_componentawareinterface, phalcon_acl_componentawareinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Group, phalcon, support_helper_arr_group, phalcon_support_helper_arr_group_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentAwareInterface, getComponentName);
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Group, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL, *_5 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method, method_sub, element, filtered, *_0, _1, _2$$3, _6$$4;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(method)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ ZEPHIR_INIT_VAR(&filtered);
+ array_init(&filtered);
+ zephir_is_iterable(&collection, 0, "phalcon/Support/Helper/Arr/Group.zep", 36);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
+ {
+ ZEPHIR_INIT_NVAR(&element);
+ ZVAL_COPY(&element, _0);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "processcallable", &_3, 0, &filtered, method, &element);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filtered, &_2$$3);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "processobject", &_4, 0, &filtered, method, &element);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filtered, &_2$$3);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "processother", &_5, 0, &filtered, method, &element);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filtered, &_2$$3);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &collection, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &collection, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&element, &collection, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "processcallable", &_3, 0, &filtered, method, &element);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filtered, &_6$$4);
+ ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "processobject", &_4, 0, &filtered, method, &element);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filtered, &_6$$4);
+ ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "processother", &_5, 0, &filtered, method, &element);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filtered, &_6$$4);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&element);
+ RETURN_CCTOR(&filtered);
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Group, isCallable)
+{
+ zend_bool _0, _1;
+ zval *method, method_sub;
+
+ ZVAL_UNDEF(&method_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(method)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &method);
+ _0 = zephir_is_callable(method);
+ if (!(_0)) {
+ _1 = Z_TYPE_P(method) == IS_STRING;
+ if (_1) {
+ _1 = 1 == (zephir_function_exists(method) == SUCCESS);
+ }
+ _0 = _1;
+ }
+ RETURN_BOOL(_0);
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Group, processCallable)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *filtered_param = NULL, *method, method_sub, *element, element_sub, key, output, _0;
+ zval filtered;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_UNDEF(&element_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&output);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(filtered)
+ Z_PARAM_ZVAL(method)
+ Z_PARAM_ZVAL(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &filtered_param, &method, &element);
+ zephir_get_arrval(&filtered, filtered_param);
+ ZEPHIR_CPY_WRT(&output, &filtered);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "iscallable", NULL, 0, method);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
+ ZEPHIR_CALL_FUNCTION(&key, "call_user_func", NULL, 188, method, element);
+ zephir_check_call_status();
+ zephir_array_update_multi(&output, element, SL("za"), 2, &key);
+ }
+ RETURN_CCTOR(&output);
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Group, processObject)
+{
+ zend_bool _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *filtered_param = NULL, *method, method_sub, *element, element_sub, output, _0, key$$3;
+ zval filtered;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_UNDEF(&element_sub);
+ ZVAL_UNDEF(&output);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&key$$3);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(filtered)
+ Z_PARAM_ZVAL(method)
+ Z_PARAM_ZVAL(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &filtered_param, &method, &element);
+ zephir_get_arrval(&filtered, filtered_param);
+ ZEPHIR_CPY_WRT(&output, &filtered);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "iscallable", NULL, 0, method);
+ zephir_check_call_status();
+ _1 = !ZEPHIR_IS_TRUE_IDENTICAL(&_0);
+ if (_1) {
+ _1 = Z_TYPE_P(element) == IS_OBJECT;
+ }
+ if (_1) {
+ zephir_memory_observe(&key$$3);
+ zephir_read_property_zval(&key$$3, element, method, PH_NOISY_CC);
+ zephir_array_update_multi(&output, element, SL("za"), 2, &key$$3);
+ }
+ RETURN_CCTOR(&output);
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Group, processOther)
+{
+ zend_bool _1, _2;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *filtered_param = NULL, *method, method_sub, *element, element_sub, output, _0, key$$3;
+ zval filtered;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_UNDEF(&element_sub);
+ ZVAL_UNDEF(&output);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&key$$3);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(filtered)
+ Z_PARAM_ZVAL(method)
+ Z_PARAM_ZVAL(element)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &filtered_param, &method, &element);
+ zephir_get_arrval(&filtered, filtered_param);
+ ZEPHIR_CPY_WRT(&output, &filtered);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "iscallable", NULL, 0, method);
+ zephir_check_call_status();
+ _1 = !ZEPHIR_IS_TRUE_IDENTICAL(&_0);
+ if (_1) {
+ _1 = Z_TYPE_P(element) != IS_OBJECT;
+ }
+ _2 = _1;
+ if (_2) {
+ _2 = 1 == zephir_array_isset(element, method);
+ }
+ if (_2) {
+ zephir_memory_observe(&key$$3);
+ zephir_array_fetch(&key$$3, element, method, PH_NOISY, "phalcon/Support/Helper/Arr/Group.zep", 116);
+ zephir_array_update_multi(&output, element, SL("za"), 2, &key$$3);
+ }
+ RETURN_CCTOR(&output);
+}
+
@@ -143130,35 +140813,30 @@ ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentAwareInterface, getComponentName);
-ZEPHIR_INIT_CLASS(Phalcon_Acl_ComponentInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Has)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, ComponentInterface, phalcon, acl_componentinterface, phalcon_acl_componentinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Has, phalcon, support_helper_arr_has, phalcon_support_helper_arr_has_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentInterface, getDescription);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentInterface, getName);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_ComponentInterface, __toString);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Acl_Enum)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Has, __invoke)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Acl, Enum, phalcon, acl_enum, NULL, 0);
-
- zephir_declare_class_constant_long(phalcon_acl_enum_ce, SL("ALLOW"), 1);
-
- zephir_declare_class_constant_long(phalcon_acl_enum_ce, SL("DENY"), 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *collection_param = NULL, *index, index_sub;
+ zval collection;
- return SUCCESS;
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(index)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &collection_param, &index);
+ zephir_get_arrval(&collection, collection_param);
+ RETURN_MM_BOOL(zephir_array_key_exists(&collection, index));
}
@@ -143171,13 +140849,34 @@ ZEPHIR_INIT_CLASS(Phalcon_Acl_Enum)
-ZEPHIR_INIT_CLASS(Phalcon_Acl_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_IsUnique)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Acl, Exception, phalcon, acl_exception, zend_ce_exception, NULL, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, IsUnique, phalcon, support_helper_arr_isunique, phalcon_support_helper_arr_isunique_method_entry, 0);
return SUCCESS;
}
+static PHP_METHOD(Phalcon_Support_Helper_Arr_IsUnique, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, _0;
+ zval collection;
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(collection)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &collection_param);
+ zephir_get_arrval(&collection, collection_param);
+ ZEPHIR_CALL_FUNCTION(&_0, "array_unique", NULL, 180, &collection);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_fast_count_int(&collection) == zephir_fast_count_int(&_0));
+}
+
@@ -143188,73 +140887,46 @@ ZEPHIR_INIT_CLASS(Phalcon_Acl_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Acl_Role)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Last)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Acl, Role, phalcon, acl_role, phalcon_acl_role_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, Last, phalcon, support_helper_arr_last, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_last_method_entry, 0);
- zend_declare_property_null(phalcon_acl_role_ce, SL("description"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_acl_role_ce, SL("name"), ZEND_ACC_PRIVATE);
- zend_class_implements(phalcon_acl_role_ce, 1, phalcon_acl_roleinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Acl_Role, __construct)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Last, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *description_param = NULL;
- zval name, description;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null, filtered;
+ zval collection;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&description);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&filtered);
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
+ Z_PARAM_ARRAY(collection)
Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(description)
+ Z_PARAM_ZVAL_OR_NULL(method)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &description_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!description_param) {
- ZEPHIR_INIT_VAR(&description);
- } else {
- zephir_get_strval(&description, description_param);
- }
- if (UNEXPECTED(ZEPHIR_IS_STRING_IDENTICAL(&name, "*"))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role name cannot be '*'", "phalcon/Acl/Role.zep", 38);
- return;
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- zephir_update_property_zval(this_ptr, ZEND_STRL("description"), &description);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Acl_Role, __toString)
-{
-
- RETURN_MEMBER(getThis(), "name");
-}
-
-static PHP_METHOD(Phalcon_Acl_Role, getDescription)
-{
-
- RETURN_MEMBER(getThis(), "description");
-}
-
-static PHP_METHOD(Phalcon_Acl_Role, getName)
-{
-
- RETURN_MEMBER(getThis(), "name");
+ ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&filtered);
+ ZEPHIR_RETURN_CALL_FUNCTION("end", NULL, 320, &filtered);
+ ZEPHIR_UNREF(&filtered);
+ zephir_check_call_status();
+ RETURN_MM();
}
@@ -143267,34 +140939,46 @@ static PHP_METHOD(Phalcon_Acl_Role, getName)
-ZEPHIR_INIT_CLASS(Phalcon_Acl_RoleAwareInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_LastKey)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, RoleAwareInterface, phalcon, acl_roleawareinterface, phalcon_acl_roleawareinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, LastKey, phalcon, support_helper_arr_lastkey, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_lastkey_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleAwareInterface, getRoleName);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Acl_RoleInterface)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_LastKey, __invoke)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl, RoleInterface, phalcon, acl_roleinterface, phalcon_acl_roleinterface_method_entry);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method = NULL, method_sub, __$null, filtered;
+ zval collection;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&filtered);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(method)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+ ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("array_key_last", NULL, 40, &filtered);
+ zephir_check_call_status();
+ RETURN_MM();
}
-ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleInterface, getName);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleInterface, getDescription);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleInterface, __toString);
@@ -143305,97 +140989,163 @@ ZEPHIR_DOC_METHOD(Phalcon_Acl_RoleInterface, __toString);
-ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_AbstractAdapter)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Acl\\Adapter, AbstractAdapter, phalcon, acl_adapter_abstractadapter, phalcon_events_abstracteventsaware_ce, phalcon_acl_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_bool(phalcon_acl_adapter_abstractadapter_ce, SL("accessGranted"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_abstractadapter_ce, SL("activeAccess"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_abstractadapter_ce, SL("activeComponent"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_abstractadapter_ce, SL("activeRole"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_acl_adapter_abstractadapter_ce, SL("defaultAccess"), 0, ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_acl_adapter_abstractadapter_ce, 1, phalcon_acl_adapter_adapterinterface_ce);
- zend_class_implements(phalcon_acl_adapter_abstractadapter_ce, 1, phalcon_events_eventsawareinterface_ce);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getActiveAccess)
-{
-
- RETURN_MEMBER(getThis(), "activeAccess");
-}
-
-static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getActiveComponent)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Order)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Order, phalcon, support_helper_arr_order, phalcon_support_helper_arr_order_method_entry, 0);
- RETURN_MEMBER(getThis(), "activeComponent");
-}
+ zephir_declare_class_constant_long(phalcon_support_helper_arr_order_ce, SL("ORDER_ASC"), 1);
-static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getActiveRole)
-{
+ zephir_declare_class_constant_long(phalcon_support_helper_arr_order_ce, SL("ORDER_DESC"), 2);
- RETURN_MEMBER(getThis(), "activeRole");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getDefaultAction)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Order, __invoke)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL;
+ zend_long order, flags, ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *attribute, attribute_sub, *order_param = NULL, *flags_param = NULL, item, sorted, *_0, _1, _2$$3, _5$$4, _6$$5, _7$$6;
+ zval collection;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "defaultAccess");
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&attribute_sub);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&sorted);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(attribute)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(order)
+ Z_PARAM_LONG(flags)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 2, &collection_param, &attribute, &order_param, &flags_param);
+ zephir_get_arrval(&collection, collection_param);
+ if (!order_param) {
+ order = 1;
+ } else {
+ }
+ if (!flags_param) {
+ flags = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&sorted);
+ array_init(&sorted);
+ zephir_is_iterable(&collection, 0, "phalcon/Support/Helper/Arr/Order.zep", 45);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
+ {
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _0);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "checkobject", &_3, 0, &sorted, attribute, &item);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&sorted, &_2$$3);
+ ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "checknonobject", &_4, 0, &sorted, attribute, &item);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&sorted, &_2$$3);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &collection, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &collection, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&item, &collection, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "checkobject", &_3, 0, &sorted, attribute, &item);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&sorted, &_5$$4);
+ ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "checknonobject", &_4, 0, &sorted, attribute, &item);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&sorted, &_5$$4);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&item);
+ if (1 == order) {
+ ZVAL_LONG(&_6$$5, flags);
+ ZEPHIR_MAKE_REF(&sorted);
+ ZEPHIR_CALL_FUNCTION(NULL, "ksort", NULL, 0, &sorted, &_6$$5);
+ ZEPHIR_UNREF(&sorted);
+ zephir_check_call_status();
+ } else {
+ ZVAL_LONG(&_7$$6, flags);
+ ZEPHIR_MAKE_REF(&sorted);
+ ZEPHIR_CALL_FUNCTION(NULL, "krsort", NULL, 0, &sorted, &_7$$6);
+ ZEPHIR_UNREF(&sorted);
+ zephir_check_call_status();
+ }
+ ZEPHIR_RETURN_CALL_FUNCTION("array_values", NULL, 14, &sorted);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, setDefaultAction)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Order, checkObject)
{
- zval *defaultAccess_param = NULL, _0;
- zend_long defaultAccess;
- zval *this_ptr = getThis();
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sorted_param = NULL, *attribute, attribute_sub, *item, item_sub, key;
+ zval sorted;
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(defaultAccess)
+ ZVAL_UNDEF(&sorted);
+ ZVAL_UNDEF(&attribute_sub);
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&key);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(sorted)
+ Z_PARAM_ZVAL(attribute)
+ Z_PARAM_ZVAL(item)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &defaultAccess_param);
- ZVAL_UNDEF(&_0);
- ZVAL_LONG(&_0, defaultAccess);
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultAccess"), &_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &sorted_param, &attribute, &item);
+ zephir_get_arrval(&sorted, sorted_param);
+ if (Z_TYPE_P(item) == IS_OBJECT) {
+ zephir_memory_observe(&key);
+ zephir_read_property_zval(&key, item, attribute, PH_NOISY_CC);
+ zephir_array_update_zval(&sorted, &key, item, PH_COPY | PH_SEPARATE);
+ }
+ RETURN_CTOR(&sorted);
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_AdapterInterface)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Order, checkNonObject)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Acl\\Adapter, AdapterInterface, phalcon, acl_adapter_adapterinterface, phalcon_acl_adapter_adapterinterface_method_entry);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *sorted_param = NULL, *attribute, attribute_sub, *item, item_sub, key;
+ zval sorted;
- return SUCCESS;
+ ZVAL_UNDEF(&sorted);
+ ZVAL_UNDEF(&attribute_sub);
+ ZVAL_UNDEF(&item_sub);
+ ZVAL_UNDEF(&key);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(sorted)
+ Z_PARAM_ZVAL(attribute)
+ Z_PARAM_ZVAL(item)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &sorted_param, &attribute, &item);
+ zephir_get_arrval(&sorted, sorted_param);
+ if (Z_TYPE_P(item) != IS_OBJECT) {
+ zephir_memory_observe(&key);
+ zephir_array_fetch(&key, item, attribute, PH_NOISY, "phalcon/Support/Helper/Arr/Order.zep", 85);
+ zephir_array_update_zval(&sorted, &key, item, PH_COPY | PH_SEPARATE);
+ }
+ RETURN_CTOR(&sorted);
}
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, addInherit);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, addRole);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, addComponent);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, addComponentAccess);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, allow);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, deny);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, dropComponentAccess);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getActiveAccess);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getActiveRole);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getActiveComponent);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getComponents);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getDefaultAction);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getInheritedRoles);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getNoArgumentsDefaultAction);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, getRoles);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, isAllowed);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, isComponent);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, isRole);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, setDefaultAction);
-ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, setNoArgumentsDefaultAction);
@@ -143406,1843 +141156,1073 @@ ZEPHIR_DOC_METHOD(Phalcon_Acl_Adapter_AdapterInterface, setNoArgumentsDefaultAct
-ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_Memory)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Pluck)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Acl\\Adapter, Memory, phalcon, acl_adapter_memory, phalcon_acl_adapter_abstractadapter_ce, phalcon_acl_adapter_memory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Pluck, phalcon, support_helper_arr_pluck, phalcon_support_helper_arr_pluck_method_entry, 0);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("access"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("accessList"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("activeFunction"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_acl_adapter_memory_ce, SL("activeFunctionCustomArgumentsCount"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("activeKey"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("components"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("componentsNames"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("func"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_acl_adapter_memory_ce, SL("noArgumentsDefaultAction"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("roles"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_acl_adapter_memory_ce, SL("roleInherits"), ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, __construct)
-{
- zval _0, _1;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval __$true;
- zval *this_ptr = getThis();
-
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 1, 0);
- zephir_array_update_string(&_0, SL("*"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("componentsNames"), &_0);
- ZEPHIR_INIT_VAR(&_1);
- zephir_create_array(&_1, 1, 0);
- zephir_array_update_string(&_1, SL("*!*"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("accessList"), &_1);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addComponent)
-{
- zend_bool _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *componentValue, componentValue_sub, *accessList, accessList_sub, __$true, componentName, componentObject, _1;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&componentValue_sub);
- ZVAL_UNDEF(&accessList_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&componentName);
- ZVAL_UNDEF(&componentObject);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(componentValue)
- Z_PARAM_ZVAL(accessList)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &componentValue, &accessList);
- _0 = Z_TYPE_P(componentValue) == IS_OBJECT;
- if (_0) {
- _0 = zephir_instance_of_ev(componentValue, phalcon_acl_componentinterface_ce);
- }
- if (_0) {
- ZEPHIR_CPY_WRT(&componentObject, componentValue);
- } else {
- ZEPHIR_INIT_NVAR(&componentObject);
- object_init_ex(&componentObject, phalcon_acl_component_ce);
- ZEPHIR_CALL_METHOD(NULL, &componentObject, "__construct", NULL, 143, componentValue);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(&componentName, &componentObject, "getname", NULL, 144);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset(&_1, &componentName))) {
- zephir_update_property_array(this_ptr, SL("components"), &componentName, &componentObject);
- zephir_update_property_array(this_ptr, SL("componentsNames"), &componentName, &__$true);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addcomponentaccess", NULL, 0, &componentName, accessList);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addComponentAccess)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Pluck, __invoke)
{
- zend_bool exists = 0, _2;
+ zend_bool _2$$3, _3$$3, _6$$6, _7$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *componentName_param = NULL, *accessList, accessList_sub, accessName, _0, _1, *_3$$4, _4$$4, _5$$5, _6$$5, _7$$6, _8$$7, _9$$7, _10$$8, _11$$9, _12$$9, _13$$10;
- zval componentName, accessKey;
- zval *this_ptr = getThis();
+ zval element;
+ zval *collection_param = NULL, *element_param = NULL, item, *_0, _1, _4$$4, _5$$5, _8$$7, _9$$8;
+ zval collection, filtered;
- ZVAL_UNDEF(&componentName);
- ZVAL_UNDEF(&accessKey);
- ZVAL_UNDEF(&accessList_sub);
- ZVAL_UNDEF(&accessName);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&item);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_4$$4);
ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$6);
ZVAL_UNDEF(&_8$$7);
- ZVAL_UNDEF(&_9$$7);
- ZVAL_UNDEF(&_10$$8);
- ZVAL_UNDEF(&_11$$9);
- ZVAL_UNDEF(&_12$$9);
- ZVAL_UNDEF(&_13$$10);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(componentName)
- Z_PARAM_ZVAL(accessList)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &componentName_param, &accessList);
- zephir_get_strval(&componentName, componentName_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "Component");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 145, &_0, &componentName, &_1);
- zephir_check_call_status();
- _2 = Z_TYPE_P(accessList) != IS_ARRAY;
- if (_2) {
- _2 = Z_TYPE_P(accessList) != IS_STRING;
- }
- if (UNEXPECTED(_2)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Invalid value for the accessList", "phalcon/Acl/Adapter/Memory.zep", 241);
- return;
- }
- exists = 1;
- if (Z_TYPE_P(accessList) == IS_ARRAY) {
- zephir_is_iterable(accessList, 0, "phalcon/Acl/Adapter/Memory.zep", 254);
- if (Z_TYPE_P(accessList) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(accessList), _3$$4)
- {
- ZEPHIR_INIT_NVAR(&accessName);
- ZVAL_COPY(&accessName, _3$$4);
- ZEPHIR_INIT_NVAR(&_5$$5);
- ZEPHIR_CONCAT_VSV(&_5$$5, &componentName, "!", &accessName);
- zephir_get_strval(&accessKey, &_5$$5);
- zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset(&_6$$5, &accessKey))) {
- ZEPHIR_INIT_NVAR(&_7$$6);
- ZVAL_BOOL(&_7$$6, exists);
- zephir_update_property_array(this_ptr, SL("accessList"), &accessKey, &_7$$6);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, accessList, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_4$$4, accessList, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_4$$4)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&accessName, accessList, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_8$$7);
- ZEPHIR_CONCAT_VSV(&_8$$7, &componentName, "!", &accessName);
- zephir_get_strval(&accessKey, &_8$$7);
- zephir_read_property(&_9$$7, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset(&_9$$7, &accessKey))) {
- ZEPHIR_INIT_NVAR(&_10$$8);
- ZVAL_BOOL(&_10$$8, exists);
- zephir_update_property_array(this_ptr, SL("accessList"), &accessKey, &_10$$8);
- }
- ZEPHIR_CALL_METHOD(NULL, accessList, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&accessName);
- } else {
- ZEPHIR_INIT_VAR(&_11$$9);
- ZEPHIR_CONCAT_VSV(&_11$$9, &componentName, "!", accessList);
- zephir_get_strval(&accessKey, &_11$$9);
- zephir_read_property(&_12$$9, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset(&_12$$9, &accessKey))) {
- ZEPHIR_INIT_VAR(&_13$$10);
- ZVAL_BOOL(&_13$$10, exists);
- zephir_update_property_array(this_ptr, SL("accessList"), &accessKey, &_13$$10);
- }
- }
- RETURN_MM_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit)
-{
- zend_bool _7$$6, _28$$21;
- zval checkRoleToInherits, usedRoleToInherits;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_13 = NULL, *_19 = NULL, *_20 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *roleName_param = NULL, *roleToInherits, roleToInherits_sub, __$true, roleInheritName, roleToInherit, checkRoleToInherit, roleToInheritList, usedRoleToInherit, _0, _1, _2, _3, *_5, _6, _4$$3, _8$$6, _9$$6, _10$$6, _14$$6, _11$$10, _12$$10, _15$$12, _16$$12, *_17$$12, _18$$12, _21$$17, _22$$17, _23$$15, _24$$18, _25$$18, *_26$$18, _27$$18, _29$$21, _30$$21, _31$$21, _34$$21, _32$$25, _33$$25, _35$$27, _36$$27, *_37$$27, _38$$27, _39$$32, _40$$32, _41$$30, _42$$33, _43$$33, *_44$$33, _45$$33;
- zval roleName;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&roleName);
- ZVAL_UNDEF(&roleToInherits_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&roleInheritName);
- ZVAL_UNDEF(&roleToInherit);
- ZVAL_UNDEF(&checkRoleToInherit);
- ZVAL_UNDEF(&roleToInheritList);
- ZVAL_UNDEF(&usedRoleToInherit);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_8$$6);
- ZVAL_UNDEF(&_9$$6);
- ZVAL_UNDEF(&_10$$6);
- ZVAL_UNDEF(&_14$$6);
- ZVAL_UNDEF(&_11$$10);
- ZVAL_UNDEF(&_12$$10);
- ZVAL_UNDEF(&_15$$12);
- ZVAL_UNDEF(&_16$$12);
- ZVAL_UNDEF(&_18$$12);
- ZVAL_UNDEF(&_21$$17);
- ZVAL_UNDEF(&_22$$17);
- ZVAL_UNDEF(&_23$$15);
- ZVAL_UNDEF(&_24$$18);
- ZVAL_UNDEF(&_25$$18);
- ZVAL_UNDEF(&_27$$18);
- ZVAL_UNDEF(&_29$$21);
- ZVAL_UNDEF(&_30$$21);
- ZVAL_UNDEF(&_31$$21);
- ZVAL_UNDEF(&_34$$21);
- ZVAL_UNDEF(&_32$$25);
- ZVAL_UNDEF(&_33$$25);
- ZVAL_UNDEF(&_35$$27);
- ZVAL_UNDEF(&_36$$27);
- ZVAL_UNDEF(&_38$$27);
- ZVAL_UNDEF(&_39$$32);
- ZVAL_UNDEF(&_40$$32);
- ZVAL_UNDEF(&_41$$30);
- ZVAL_UNDEF(&_42$$33);
- ZVAL_UNDEF(&_43$$33);
- ZVAL_UNDEF(&_45$$33);
- ZVAL_UNDEF(&checkRoleToInherits);
- ZVAL_UNDEF(&usedRoleToInherits);
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_UNDEF(&element);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(roleName)
- Z_PARAM_ZVAL(roleToInherits)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_STR(element)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &roleName_param, &roleToInherits);
- zephir_get_strval(&roleName, roleName_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "Role");
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "role list");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 145, &_0, &roleName, &_1, &_2);
- zephir_check_call_status();
- zephir_read_property(&_3, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset(&_3, &roleName))) {
- ZEPHIR_INIT_VAR(&_4$$3);
- array_init(&_4$$3);
- zephir_update_property_array(this_ptr, SL("roleInherits"), &roleName, &_4$$3);
- }
- if (Z_TYPE_P(roleToInherits) != IS_ARRAY) {
- ZEPHIR_INIT_VAR(&roleToInheritList);
- zephir_create_array(&roleToInheritList, 1, 0);
- zephir_array_fast_append(&roleToInheritList, roleToInherits);
- } else {
- ZEPHIR_CPY_WRT(&roleToInheritList, roleToInherits);
- }
- zephir_is_iterable(&roleToInheritList, 0, "phalcon/Acl/Adapter/Memory.zep", 367);
- if (Z_TYPE_P(&roleToInheritList) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&roleToInheritList), _5)
+ zephir_fetch_params(1, 2, 0, &collection_param, &element_param);
+ zephir_get_arrval(&collection, collection_param);
+ zephir_get_strval(&element, element_param);
+ ZEPHIR_INIT_VAR(&filtered);
+ array_init(&filtered);
+ zephir_is_iterable(&collection, 0, "phalcon/Support/Helper/Arr/Pluck.zep", 39);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _0)
{
- ZEPHIR_INIT_NVAR(&roleToInherit);
- ZVAL_COPY(&roleToInherit, _5);
- _7$$6 = Z_TYPE_P(&roleToInherit) == IS_OBJECT;
- if (_7$$6) {
- _7$$6 = zephir_instance_of_ev(&roleToInherit, phalcon_acl_roleinterface_ce);
- }
- if (_7$$6) {
- ZEPHIR_CALL_METHOD(&roleInheritName, &roleToInherit, "getname", NULL, 0);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&roleInheritName, &roleToInherit);
- }
- zephir_read_property(&_8$$6, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_9$$6, &_8$$6, &roleName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 307);
- if (zephir_fast_in_array(&roleInheritName, &_9$$6)) {
- continue;
- }
- zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset(&_10$$6, &roleInheritName)))) {
- ZEPHIR_INIT_NVAR(&_11$$10);
- object_init_ex(&_11$$10, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_12$$10);
- ZEPHIR_CONCAT_SVS(&_12$$10, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list");
- ZEPHIR_CALL_METHOD(NULL, &_11$$10, "__construct", &_13, 33, &_12$$10);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_11$$10, "phalcon/Acl/Adapter/Memory.zep", 318);
- ZEPHIR_MM_RESTORE();
- return;
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _0);
+ _2$$3 = Z_TYPE_P(&item) == IS_OBJECT;
+ if (_2$$3) {
+ _2$$3 = zephir_isset_property_zval(&item, &element);
}
- if (ZEPHIR_IS_EQUAL(&roleName, &roleInheritName)) {
- RETURN_MM_BOOL(0);
+ _3$$3 = Z_TYPE_P(&item) == IS_ARRAY;
+ if (_3$$3) {
+ _3$$3 = zephir_array_isset(&item, &element);
}
- zephir_read_property(&_14$$6, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_14$$6, &roleInheritName)) {
- ZEPHIR_INIT_NVAR(&checkRoleToInherits);
- array_init(&checkRoleToInherits);
- zephir_read_property(&_15$$12, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_16$$12, &_15$$12, &roleInheritName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 331);
- zephir_is_iterable(&_16$$12, 0, "phalcon/Acl/Adapter/Memory.zep", 335);
- if (Z_TYPE_P(&_16$$12) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_16$$12), _17$$12)
- {
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZVAL_COPY(&usedRoleToInherit, _17$$12);
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_16$$12, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_18$$12, &_16$$12, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_18$$12)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_16$$12, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_16$$12, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZEPHIR_INIT_NVAR(&usedRoleToInherits);
- array_init(&usedRoleToInherits);
- while (1) {
- if (!(!(ZEPHIR_IS_EMPTY(&checkRoleToInherits)))) {
- break;
- }
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 22, &checkRoleToInherits);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) {
- continue;
- }
- zephir_array_update_zval(&usedRoleToInherits, &checkRoleToInherit, &__$true, PH_COPY | PH_SEPARATE);
- if (UNEXPECTED(ZEPHIR_IS_EQUAL(&roleName, &checkRoleToInherit))) {
- ZEPHIR_INIT_NVAR(&_21$$17);
- object_init_ex(&_21$$17, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_22$$17);
- ZEPHIR_CONCAT_SVS(&_22$$17, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop");
- ZEPHIR_CALL_METHOD(NULL, &_21$$17, "__construct", &_13, 33, &_22$$17);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_21$$17, "phalcon/Acl/Adapter/Memory.zep", 350);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_read_property(&_23$$15, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_23$$15, &checkRoleToInherit)) {
- zephir_read_property(&_24$$18, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_25$$18, &_24$$18, &checkRoleToInherit, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 357);
- zephir_is_iterable(&_25$$18, 0, "phalcon/Acl/Adapter/Memory.zep", 360);
- if (Z_TYPE_P(&_25$$18) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_25$$18), _26$$18)
- {
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZVAL_COPY(&usedRoleToInherit, _26$$18);
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_25$$18, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_27$$18, &_25$$18, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_27$$18)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_25$$18, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_25$$18, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- }
- }
+ if (_2$$3) {
+ ZEPHIR_OBS_NVAR(&_4$$4);
+ zephir_read_property_zval(&_4$$4, &item, &element, PH_NOISY_CC);
+ zephir_array_append(&filtered, &_4$$4, PH_SEPARATE, "phalcon/Support/Helper/Arr/Pluck.zep", 33);
+ } else if (_3$$3) {
+ zephir_array_fetch(&_5$$5, &item, &element, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Arr/Pluck.zep", 35);
+ zephir_array_append(&filtered, &_5$$5, PH_SEPARATE, "phalcon/Support/Helper/Arr/Pluck.zep", 35);
}
- zephir_update_property_array_multi(this_ptr, SL("roleInherits"), &roleInheritName, SL("za"), 2, &roleName);
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &roleToInheritList, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_6, &roleToInheritList, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_1, &collection, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_6)) {
+ if (!zend_is_true(&_1)) {
break;
}
- ZEPHIR_CALL_METHOD(&roleToInherit, &roleToInheritList, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&item, &collection, "current", NULL, 0);
zephir_check_call_status();
- _28$$21 = Z_TYPE_P(&roleToInherit) == IS_OBJECT;
- if (_28$$21) {
- _28$$21 = zephir_instance_of_ev(&roleToInherit, phalcon_acl_roleinterface_ce);
- }
- if (_28$$21) {
- ZEPHIR_CALL_METHOD(&roleInheritName, &roleToInherit, "getname", NULL, 0);
- zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&roleInheritName, &roleToInherit);
- }
- zephir_read_property(&_29$$21, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_30$$21, &_29$$21, &roleName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 307);
- if (zephir_fast_in_array(&roleInheritName, &_30$$21)) {
- continue;
- }
- zephir_read_property(&_31$$21, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset(&_31$$21, &roleInheritName)))) {
- ZEPHIR_INIT_NVAR(&_32$$25);
- object_init_ex(&_32$$25, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_33$$25);
- ZEPHIR_CONCAT_SVS(&_33$$25, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list");
- ZEPHIR_CALL_METHOD(NULL, &_32$$25, "__construct", &_13, 33, &_33$$25);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_32$$25, "phalcon/Acl/Adapter/Memory.zep", 318);
- ZEPHIR_MM_RESTORE();
- return;
+ _6$$6 = Z_TYPE_P(&item) == IS_OBJECT;
+ if (_6$$6) {
+ _6$$6 = zephir_isset_property_zval(&item, &element);
}
- if (ZEPHIR_IS_EQUAL(&roleName, &roleInheritName)) {
- RETURN_MM_BOOL(0);
+ _7$$6 = Z_TYPE_P(&item) == IS_ARRAY;
+ if (_7$$6) {
+ _7$$6 = zephir_array_isset(&item, &element);
}
- zephir_read_property(&_34$$21, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_34$$21, &roleInheritName)) {
- ZEPHIR_INIT_NVAR(&checkRoleToInherits);
- array_init(&checkRoleToInherits);
- zephir_read_property(&_35$$27, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_36$$27, &_35$$27, &roleInheritName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 331);
- zephir_is_iterable(&_36$$27, 0, "phalcon/Acl/Adapter/Memory.zep", 335);
- if (Z_TYPE_P(&_36$$27) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_36$$27), _37$$27)
- {
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZVAL_COPY(&usedRoleToInherit, _37$$27);
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_36$$27, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_38$$27, &_36$$27, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_38$$27)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_36$$27, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_36$$27, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZEPHIR_INIT_NVAR(&usedRoleToInherits);
- array_init(&usedRoleToInherits);
- while (1) {
- if (!(!(ZEPHIR_IS_EMPTY(&checkRoleToInherits)))) {
- break;
- }
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 22, &checkRoleToInherits);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) {
- continue;
- }
- zephir_array_update_zval(&usedRoleToInherits, &checkRoleToInherit, &__$true, PH_COPY | PH_SEPARATE);
- if (UNEXPECTED(ZEPHIR_IS_EQUAL(&roleName, &checkRoleToInherit))) {
- ZEPHIR_INIT_NVAR(&_39$$32);
- object_init_ex(&_39$$32, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_40$$32);
- ZEPHIR_CONCAT_SVS(&_40$$32, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop");
- ZEPHIR_CALL_METHOD(NULL, &_39$$32, "__construct", &_13, 33, &_40$$32);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_39$$32, "phalcon/Acl/Adapter/Memory.zep", 350);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_read_property(&_41$$30, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_41$$30, &checkRoleToInherit)) {
- zephir_read_property(&_42$$33, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_43$$33, &_42$$33, &checkRoleToInherit, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 357);
- zephir_is_iterable(&_43$$33, 0, "phalcon/Acl/Adapter/Memory.zep", 360);
- if (Z_TYPE_P(&_43$$33) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_43$$33), _44$$33)
- {
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZVAL_COPY(&usedRoleToInherit, _44$$33);
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_43$$33, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_45$$33, &_43$$33, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_45$$33)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_43$$33, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_43$$33, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- }
- }
+ if (_6$$6) {
+ ZEPHIR_OBS_NVAR(&_8$$7);
+ zephir_read_property_zval(&_8$$7, &item, &element, PH_NOISY_CC);
+ zephir_array_append(&filtered, &_8$$7, PH_SEPARATE, "phalcon/Support/Helper/Arr/Pluck.zep", 33);
+ } else if (_7$$6) {
+ zephir_array_fetch(&_9$$8, &item, &element, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Arr/Pluck.zep", 35);
+ zephir_array_append(&filtered, &_9$$8, PH_SEPARATE, "phalcon/Support/Helper/Arr/Pluck.zep", 35);
}
- zephir_update_property_array_multi(this_ptr, SL("roleInherits"), &roleInheritName, SL("za"), 2, &roleName);
- ZEPHIR_CALL_METHOD(NULL, &roleToInheritList, "next", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&roleToInherit);
- RETURN_MM_BOOL(1);
+ ZEPHIR_INIT_NVAR(&item);
+ RETURN_CTOR(&filtered);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Set)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Set, phalcon, support_helper_arr_set, phalcon_support_helper_arr_set_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Set, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *value, value_sub, *index = NULL, index_sub, __$null, source;
+ zval collection;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&source);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(index)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 1, &collection_param, &value, &index);
+ zephir_get_arrval(&collection, collection_param);
+ if (!index) {
+ index = &index_sub;
+ index = &__$null;
+ }
+ ZEPHIR_CALL_METHOD(&source, this_ptr, "checknull", NULL, 0, &collection, value, index);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checknotnull", NULL, 0, &source, value, index);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addRole)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Set, checkNull)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *role, role_sub, *accessInherits = NULL, accessInherits_sub, __$null, roleName, roleObject, _1;
- zval *this_ptr = getThis();
+ zval *collection_param = NULL, *value, value_sub, *index, index_sub;
+ zval collection;
- ZVAL_UNDEF(&role_sub);
- ZVAL_UNDEF(&accessInherits_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&roleName);
- ZVAL_UNDEF(&roleObject);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&index_sub);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_ZVAL(index)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &collection_param, &value, &index);
+ zephir_get_arrval(&collection, collection_param);
+ if (Z_TYPE_P(index) == IS_NULL) {
+ zephir_array_append(&collection, value, PH_SEPARATE, "phalcon/Support/Helper/Arr/Set.zep", 47);
+ }
+ RETURN_CTOR(&collection);
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Set, checkNotNull)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *collection_param = NULL, *value, value_sub, *index, index_sub;
+ zval collection;
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&index_sub);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_ZVAL(index)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 3, 0, &collection_param, &value, &index);
+ zephir_get_arrval(&collection, collection_param);
+ if (Z_TYPE_P(index) != IS_NULL) {
+ zephir_array_update_zval(&collection, index, value, PH_COPY | PH_SEPARATE);
+ }
+ RETURN_CTOR(&collection);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_SliceLeft)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, SliceLeft, phalcon, support_helper_arr_sliceleft, phalcon_support_helper_arr_sliceleft_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_SliceLeft, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long elements, ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *elements_param = NULL, _0, _1;
+ zval collection;
+
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ZVAL(role)
+ Z_PARAM_ARRAY(collection)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(accessInherits)
+ Z_PARAM_LONG(elements)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &role, &accessInherits);
- if (!accessInherits) {
- accessInherits = &accessInherits_sub;
- accessInherits = &__$null;
- }
- _0 = Z_TYPE_P(role) == IS_OBJECT;
- if (_0) {
- _0 = zephir_instance_of_ev(role, phalcon_acl_roleinterface_ce);
- }
- if (_0) {
- ZEPHIR_CPY_WRT(&roleObject, role);
- } else if (Z_TYPE_P(role) == IS_STRING) {
- ZEPHIR_INIT_NVAR(&roleObject);
- object_init_ex(&roleObject, phalcon_acl_role_ce);
- ZEPHIR_CALL_METHOD(NULL, &roleObject, "__construct", NULL, 147, role);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 1, &collection_param, &elements_param);
+ zephir_get_arrval(&collection, collection_param);
+ if (!elements_param) {
+ elements = 1;
} else {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role must be either a string or implement RoleInterface", "phalcon/Acl/Adapter/Memory.zep", 394);
- return;
- }
- ZEPHIR_CALL_METHOD(&roleName, &roleObject, "getname", NULL, 148);
+ }
+ ZVAL_LONG(&_0, 0);
+ ZVAL_LONG(&_1, elements);
+ ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 501, &collection, &_0, &_1);
zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_1, &roleName)) {
- RETURN_MM_BOOL(0);
- }
- zephir_update_property_array(this_ptr, SL("roles"), &roleName, &roleObject);
- if (Z_TYPE_P(accessInherits) != IS_NULL) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addinherit", NULL, 0, &roleName, accessInherits);
- zephir_check_call_status();
- RETURN_MM();
- }
- RETURN_MM_BOOL(1);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_SliceRight)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, SliceRight, phalcon, support_helper_arr_sliceright, phalcon_support_helper_arr_sliceright_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_SliceRight, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *roleName_param = NULL, *componentName_param = NULL, *access, access_sub, *func = NULL, func_sub, __$null, role, rolesArray, _0, *_2, _3, _1$$3, _4$$4, _6$$5;
- zval roleName, componentName;
- zval *this_ptr = getThis();
+ zend_long elements, ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *elements_param = NULL, _0;
+ zval collection;
- ZVAL_UNDEF(&roleName);
- ZVAL_UNDEF(&componentName);
- ZVAL_UNDEF(&access_sub);
- ZVAL_UNDEF(&func_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&role);
- ZVAL_UNDEF(&rolesArray);
+ ZVAL_UNDEF(&collection);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_6$$5);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 4)
- Z_PARAM_STR(roleName)
- Z_PARAM_STR(componentName)
- Z_PARAM_ZVAL(access)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(collection)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(func)
+ Z_PARAM_LONG(elements)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 1, &roleName_param, &componentName_param, &access, &func);
- zephir_get_strval(&roleName, roleName_param);
- zephir_get_strval(&componentName, componentName_param);
- if (!func) {
- func = &func_sub;
- func = &__$null;
- }
- ZEPHIR_INIT_VAR(&rolesArray);
- zephir_create_array(&rolesArray, 1, 0);
- zephir_array_fast_append(&rolesArray, &roleName);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "*");
- if (ZEPHIR_IS_IDENTICAL(&_0, &roleName)) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_NVAR(&rolesArray);
- zephir_array_keys(&rolesArray, &_1$$3);
- }
- zephir_is_iterable(&rolesArray, 0, "phalcon/Acl/Adapter/Memory.zep", 447);
- if (Z_TYPE_P(&rolesArray) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&rolesArray), _2)
- {
- ZEPHIR_INIT_NVAR(&role);
- ZVAL_COPY(&role, _2);
- ZVAL_LONG(&_4$$4, 1);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 149, &role, &componentName, access, &_4$$4, func);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
+ zephir_fetch_params(1, 1, 1, &collection_param, &elements_param);
+ zephir_get_arrval(&collection, collection_param);
+ if (!elements_param) {
+ elements = 1;
} else {
- ZEPHIR_CALL_METHOD(NULL, &rolesArray, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_3, &rolesArray, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&role, &rolesArray, "current", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_6$$5, 1);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 149, &role, &componentName, access, &_6$$5, func);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &rolesArray, "next", NULL, 0);
- zephir_check_call_status();
}
- }
- ZEPHIR_INIT_NVAR(&role);
- ZEPHIR_MM_RESTORE();
+ ZVAL_LONG(&_0, elements);
+ ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 501, &collection, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Split)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, Split, phalcon, support_helper_arr_split, phalcon_support_helper_arr_split_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Split, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *roleName_param = NULL, *componentName_param = NULL, *access, access_sub, *func = NULL, func_sub, __$null, role, rolesArray, _0, *_2, _3, _1$$3, _4$$4, _6$$5;
- zval roleName, componentName;
- zval *this_ptr = getThis();
+ zval *collection_param = NULL, _0, _1;
+ zval collection;
- ZVAL_UNDEF(&roleName);
- ZVAL_UNDEF(&componentName);
- ZVAL_UNDEF(&access_sub);
- ZVAL_UNDEF(&func_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&role);
- ZVAL_UNDEF(&rolesArray);
+ ZVAL_UNDEF(&collection);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_6$$5);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 4)
- Z_PARAM_STR(roleName)
- Z_PARAM_STR(componentName)
- Z_PARAM_ZVAL(access)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(func)
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(collection)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 1, &roleName_param, &componentName_param, &access, &func);
- zephir_get_strval(&roleName, roleName_param);
- zephir_get_strval(&componentName, componentName_param);
- if (!func) {
- func = &func_sub;
- func = &__$null;
- }
- ZEPHIR_INIT_VAR(&rolesArray);
- zephir_create_array(&rolesArray, 1, 0);
- zephir_array_fast_append(&rolesArray, &roleName);
+ zephir_fetch_params(1, 1, 0, &collection_param);
+ zephir_get_arrval(&collection, collection_param);
+ zephir_create_array(return_value, 2, 0);
ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "*");
- if (ZEPHIR_IS_IDENTICAL(&_0, &roleName)) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_NVAR(&rolesArray);
- zephir_array_keys(&rolesArray, &_1$$3);
- }
- zephir_is_iterable(&rolesArray, 0, "phalcon/Acl/Adapter/Memory.zep", 484);
- if (Z_TYPE_P(&rolesArray) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&rolesArray), _2)
- {
- ZEPHIR_INIT_NVAR(&role);
- ZVAL_COPY(&role, _2);
- ZVAL_LONG(&_4$$4, 0);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 149, &role, &componentName, access, &_4$$4, func);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &rolesArray, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_3, &rolesArray, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&role, &rolesArray, "current", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_6$$5, 0);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 149, &role, &componentName, access, &_6$$5, func);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &rolesArray, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&role);
- ZEPHIR_MM_RESTORE();
+ zephir_array_keys(&_0, &collection);
+ zephir_array_fast_append(return_value, &_0);
+ ZEPHIR_CALL_FUNCTION(&_1, "array_values", NULL, 14, &collection);
+ zephir_check_call_status();
+ zephir_array_fast_append(return_value, &_1);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, dropComponentAccess)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_ToObject)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Arr, ToObject, phalcon, support_helper_arr_toobject, phalcon_support_helper_arr_toobject_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_ToObject, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *collection_param = NULL;
+ zval collection;
+
+ ZVAL_UNDEF(&collection);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(collection)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &collection_param);
+ zephir_get_arrval(&collection, collection_param);
+ zephir_convert_to_object(&collection);
+ RETURN_CTOR(&collection);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_ValidateAll)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, ValidateAll, phalcon, support_helper_arr_validateall, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_validateall_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Arr_ValidateAll, __invoke)
{
- zval localAccess;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *componentName_param = NULL, *accessList, accessList_sub, accessName, _0$$3, *_1$$5, _2$$5, _3$$6, _4$$6, _5$$7, _6$$8, _7$$8, _8$$9;
- zval componentName, accessKey;
+ zval *collection_param = NULL, *method, method_sub, _0;
+ zval collection;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&componentName);
- ZVAL_UNDEF(&accessKey);
- ZVAL_UNDEF(&accessList_sub);
- ZVAL_UNDEF(&accessName);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$7);
- ZVAL_UNDEF(&_6$$8);
- ZVAL_UNDEF(&_7$$8);
- ZVAL_UNDEF(&_8$$9);
- ZVAL_UNDEF(&localAccess);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(componentName)
- Z_PARAM_ZVAL(accessList)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(method)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &componentName_param, &accessList);
- zephir_get_strval(&componentName, componentName_param);
- ZEPHIR_INIT_VAR(&localAccess);
- array_init(&localAccess);
- if (Z_TYPE_P(accessList) == IS_STRING) {
- ZEPHIR_INIT_VAR(&_0$$3);
- zephir_create_array(&_0$$3, 1, 0);
- zephir_array_fast_append(&_0$$3, accessList);
- ZEPHIR_CPY_WRT(&localAccess, &_0$$3);
- } else {
- ZEPHIR_CPY_WRT(&localAccess, accessList);
- }
- if (Z_TYPE_P(accessList) == IS_ARRAY) {
- zephir_is_iterable(&localAccess, 0, "phalcon/Acl/Adapter/Memory.zep", 509);
- if (Z_TYPE_P(&localAccess) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&localAccess), _1$$5)
- {
- ZEPHIR_INIT_NVAR(&accessName);
- ZVAL_COPY(&accessName, _1$$5);
- ZEPHIR_INIT_NVAR(&_3$$6);
- ZEPHIR_CONCAT_VSV(&_3$$6, &componentName, "!", &accessName);
- zephir_get_strval(&accessKey, &_3$$6);
- zephir_read_property(&_4$$6, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_4$$6, &accessKey)) {
- zephir_unset_property_array(this_ptr, ZEND_STRL("accessList"), &accessKey);
- zephir_read_property(&_5$$7, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- zephir_array_unset(&_5$$7, &accessKey, PH_SEPARATE);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &localAccess, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2$$5, &localAccess, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2$$5)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&accessName, &localAccess, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_6$$8);
- ZEPHIR_CONCAT_VSV(&_6$$8, &componentName, "!", &accessName);
- zephir_get_strval(&accessKey, &_6$$8);
- zephir_read_property(&_7$$8, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_7$$8, &accessKey)) {
- zephir_unset_property_array(this_ptr, ZEND_STRL("accessList"), &accessKey);
- zephir_read_property(&_8$$9, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- zephir_array_unset(&_8$$9, &accessKey, PH_SEPARATE);
- }
- ZEPHIR_CALL_METHOD(NULL, &localAccess, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&accessName);
- }
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 2, 0, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "tofilter", NULL, 0, &collection, method);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_fast_count_int(&_0) == zephir_fast_count_int(&collection));
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getActiveFunction)
-{
- RETURN_MEMBER(getThis(), "activeFunction");
-}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getActiveFunctionCustomArgumentsCount)
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_ValidateAny)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, ValidateAny, phalcon, support_helper_arr_validateany, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_validateany_method_entry, 0);
- RETURN_MEMBER(getThis(), "activeFunctionCustomArgumentsCount");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getActiveKey)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_ValidateAny, __invoke)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *method, method_sub, _0;
+ zval collection;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "activeKey");
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(method)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &collection_param, &method);
+ zephir_get_arrval(&collection, collection_param);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "tofilter", NULL, 0, &collection, method);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_fast_count_int(&_0) > 0);
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getComponents)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Arr_Whitelist)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Arr, Whitelist, phalcon, support_helper_arr_whitelist, phalcon_support_helper_arr_abstractarr_ce, phalcon_support_helper_arr_whitelist_method_entry, 0);
- RETURN_MEMBER(getThis(), "components");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getInheritedRoles)
+static PHP_METHOD(Phalcon_Support_Helper_Arr_Whitelist, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *roleName_param = NULL, result, _0, _1;
- zval roleName;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *collection_param = NULL, *whiteList_param = NULL, filtered, _0, _1;
+ zval collection, whiteList;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&roleName);
- ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&whiteList);
+ ZVAL_UNDEF(&filtered);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(roleName)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ARRAY(whiteList)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &roleName_param);
- if (!roleName_param) {
- ZEPHIR_INIT_VAR(&roleName);
- ZVAL_STRING(&roleName, "");
- } else {
- zephir_get_strval(&roleName, roleName_param);
- }
+ zephir_fetch_params(1, 2, 0, &collection_param, &whiteList_param);
+ zephir_get_arrval(&collection, collection_param);
+ zephir_get_arrval(&whiteList, whiteList_param);
ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "");
- if (ZEPHIR_IS_IDENTICAL(&_0, &roleName)) {
- RETURN_MM_MEMBER(getThis(), "roleInherits");
- }
- zephir_memory_observe(&result);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&result, &_1, &roleName, 0))) {
- array_init(return_value);
- RETURN_MM();
- }
- RETURN_CCTOR(&result);
+ ZEPHIR_INIT_NVAR(&_0);
+ zephir_create_closure_ex(&_0, NULL, phalcon_13__closure_ce, SL("__invoke"));
+ ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &whiteList, &_0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 100, &filtered);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_FUNCTION("array_intersect_key", NULL, 2, &collection, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getNoArgumentsDefaultAction)
-{
- RETURN_MEMBER(getThis(), "noArgumentsDefaultAction");
-}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, getRoles)
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_File_Basename)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\File, Basename, phalcon, support_helper_file_basename, phalcon_support_helper_file_basename_method_entry, 0);
- RETURN_MEMBER(getThis(), "roles");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed)
+static PHP_METHOD(Phalcon_Support_Helper_File_Basename, __invoke)
{
- zend_bool hasComponent, hasRole, _10, _13$$16, _18$$18, _21$$18, _22$$18, _24$$18, _25$$18, _27$$18, _37$$24, _39$$24, _40$$24, _42$$24, _43$$24, _45$$24, _57$$31, _59$$30, _61$$32;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_17 = NULL, *_20 = NULL, *_34 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval parameters;
- zval access, _2$$6, _5$$10;
- zval *roleName = NULL, roleName_sub, *componentName = NULL, componentName_sub, *access_param = NULL, *parameters_param = NULL, __$null, accessKey, accessList, className, componentObject, haveAccess, funcAccess, funcList, numberOfRequiredParameters, parameterNumber, parameterToCheck, parametersForFunction, reflectionClass, reflectionFunction, reflectionParameter, reflectionParameters, reflectionType, roleObject, userParametersSizeShouldBe, _6, _7, _8, _0$$5, _1$$6, _3$$9, _4$$10, _9$$12, _11$$14, _12$$14, _14$$16, *_15$$15, _16$$15, _63$$15, _64$$15, _19$$18, _23$$18, _26$$18, _28$$18, _29$$18, _30$$21, _31$$21, _32$$21, _33$$21, _35$$21, _36$$22, _38$$24, _41$$24, _44$$24, _46$$24, _47$$24, _48$$27, _49$$27, _50$$27, _51$$27, _52$$27, _53$$28, _54$$29, _55$$29, _56$$31, _58$$31, _60$$30, _62$$32;
- zval *this_ptr = getThis();
+ zval *uri_param = NULL, *suffix_param = NULL, fileName, matches, _0, _1, _2, _3, _4, _5, _6$$3, _7$$3, _8$$3, _9$$3;
+ zval uri, suffix;
- ZVAL_UNDEF(&roleName_sub);
- ZVAL_UNDEF(&componentName_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&accessKey);
- ZVAL_UNDEF(&accessList);
- ZVAL_UNDEF(&className);
- ZVAL_UNDEF(&componentObject);
- ZVAL_UNDEF(&haveAccess);
- ZVAL_UNDEF(&funcAccess);
- ZVAL_UNDEF(&funcList);
- ZVAL_UNDEF(&numberOfRequiredParameters);
- ZVAL_UNDEF(¶meterNumber);
- ZVAL_UNDEF(¶meterToCheck);
- ZVAL_UNDEF(¶metersForFunction);
- ZVAL_UNDEF(&reflectionClass);
- ZVAL_UNDEF(&reflectionFunction);
- ZVAL_UNDEF(&reflectionParameter);
- ZVAL_UNDEF(&reflectionParameters);
- ZVAL_UNDEF(&reflectionType);
- ZVAL_UNDEF(&roleObject);
- ZVAL_UNDEF(&userParametersSizeShouldBe);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_0$$5);
- ZVAL_UNDEF(&_1$$6);
- ZVAL_UNDEF(&_3$$9);
- ZVAL_UNDEF(&_4$$10);
- ZVAL_UNDEF(&_9$$12);
- ZVAL_UNDEF(&_11$$14);
- ZVAL_UNDEF(&_12$$14);
- ZVAL_UNDEF(&_14$$16);
- ZVAL_UNDEF(&_16$$15);
- ZVAL_UNDEF(&_63$$15);
- ZVAL_UNDEF(&_64$$15);
- ZVAL_UNDEF(&_19$$18);
- ZVAL_UNDEF(&_23$$18);
- ZVAL_UNDEF(&_26$$18);
- ZVAL_UNDEF(&_28$$18);
- ZVAL_UNDEF(&_29$$18);
- ZVAL_UNDEF(&_30$$21);
- ZVAL_UNDEF(&_31$$21);
- ZVAL_UNDEF(&_32$$21);
- ZVAL_UNDEF(&_33$$21);
- ZVAL_UNDEF(&_35$$21);
- ZVAL_UNDEF(&_36$$22);
- ZVAL_UNDEF(&_38$$24);
- ZVAL_UNDEF(&_41$$24);
- ZVAL_UNDEF(&_44$$24);
- ZVAL_UNDEF(&_46$$24);
- ZVAL_UNDEF(&_47$$24);
- ZVAL_UNDEF(&_48$$27);
- ZVAL_UNDEF(&_49$$27);
- ZVAL_UNDEF(&_50$$27);
- ZVAL_UNDEF(&_51$$27);
- ZVAL_UNDEF(&_52$$27);
- ZVAL_UNDEF(&_53$$28);
- ZVAL_UNDEF(&_54$$29);
- ZVAL_UNDEF(&_55$$29);
- ZVAL_UNDEF(&_56$$31);
- ZVAL_UNDEF(&_58$$31);
- ZVAL_UNDEF(&_60$$30);
- ZVAL_UNDEF(&_62$$32);
- ZVAL_UNDEF(&access);
- ZVAL_UNDEF(&_2$$6);
- ZVAL_UNDEF(&_5$$10);
- ZVAL_UNDEF(¶meters);
+ ZVAL_UNDEF(&uri);
+ ZVAL_UNDEF(&suffix);
+ ZVAL_UNDEF(&fileName);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 4)
- Z_PARAM_ZVAL(roleName)
- Z_PARAM_ZVAL(componentName)
- Z_PARAM_STR(access)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(uri)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_OR_NULL(parameters)
+ Z_PARAM_STR_OR_NULL(suffix)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 1, &roleName, &componentName, &access_param, ¶meters_param);
- ZEPHIR_SEPARATE_PARAM(roleName);
- ZEPHIR_SEPARATE_PARAM(componentName);
- zephir_get_strval(&access, access_param);
- if (!parameters_param) {
- ZEPHIR_INIT_VAR(¶meters);
- } else {
- zephir_get_arrval(¶meters, parameters_param);
- }
- ZEPHIR_INIT_VAR(&componentObject);
- ZVAL_NULL(&componentObject);
- ZEPHIR_INIT_VAR(&haveAccess);
- ZVAL_NULL(&haveAccess);
- ZEPHIR_INIT_VAR(&funcAccess);
- ZVAL_NULL(&funcAccess);
- ZEPHIR_INIT_VAR(&roleObject);
- ZVAL_NULL(&roleObject);
- hasComponent = 0;
- hasRole = 0;
- if (Z_TYPE_P(roleName) == IS_OBJECT) {
- if (zephir_instance_of_ev(roleName, phalcon_acl_roleawareinterface_ce)) {
- ZEPHIR_CPY_WRT(&roleObject, roleName);
- ZEPHIR_CALL_METHOD(roleName, &roleObject, "getrolename", NULL, 0);
- zephir_check_call_status();
- } else if (zephir_instance_of_ev(roleName, phalcon_acl_roleinterface_ce)) {
- ZEPHIR_CALL_METHOD(&_0$$5, roleName, "getname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(roleName, &_0$$5);
- } else {
- ZEPHIR_INIT_VAR(&_1$$6);
- object_init_ex(&_1$$6, phalcon_acl_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$6);
- ZEPHIR_CONCAT_SS(&_2$$6, "Object passed as roleName must implement ", "Phalcon\\Acl\\RoleAwareInterface or Phalcon\\Acl\\RoleInterface");
- ZEPHIR_CALL_METHOD(NULL, &_1$$6, "__construct", NULL, 33, &_2$$6);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$6, "phalcon/Acl/Adapter/Memory.zep", 614);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- if (Z_TYPE_P(componentName) == IS_OBJECT) {
- if (zephir_instance_of_ev(componentName, phalcon_acl_componentawareinterface_ce)) {
- ZEPHIR_CPY_WRT(&componentObject, componentName);
- ZEPHIR_CALL_METHOD(componentName, &componentObject, "getcomponentname", NULL, 0);
- zephir_check_call_status();
- } else if (zephir_instance_of_ev(componentName, phalcon_acl_componentinterface_ce)) {
- ZEPHIR_CALL_METHOD(&_3$$9, componentName, "getname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(componentName, &_3$$9);
- } else {
- ZEPHIR_INIT_VAR(&_4$$10);
- object_init_ex(&_4$$10, phalcon_acl_exception_ce);
- ZEPHIR_INIT_VAR(&_5$$10);
- ZEPHIR_CONCAT_SS(&_5$$10, "Object passed as componentName must implement ", "Phalcon\\Acl\\ComponentAwareInterface or Phalcon\\Acl\\ComponentInterface");
- ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", NULL, 33, &_5$$10);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_4$$10, "phalcon/Acl/Adapter/Memory.zep", 628);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeRole"), roleName);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeComponent"), componentName);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeAccess"), &access);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeKey"), &__$null);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeKey"), &__$null);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeFunction"), &__$null);
- zephir_memory_observe(&accessList);
- zephir_read_property(&accessList, this_ptr, ZEND_STRL("access"), PH_NOISY_CC);
- zephir_memory_observe(&funcList);
- zephir_read_property(&funcList, this_ptr, ZEND_STRL("func"), PH_NOISY_CC);
- ZVAL_UNDEF(&_6);
- ZVAL_LONG(&_6, 0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeFunctionCustomArgumentsCount"), &_6);
- ZEPHIR_INIT_VAR(&_8);
- ZVAL_STRING(&_8, "acl:beforeCheckAccess");
- ZEPHIR_CALL_METHOD(&_7, this_ptr, "firemanagerevent", NULL, 0, &_8, this_ptr);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_7)) {
- RETURN_MM_BOOL(0);
- }
- zephir_read_property(&_6, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset(&_6, roleName))) {
- zephir_read_property(&_9$$12, this_ptr, ZEND_STRL("defaultAccess"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL((ZEPHIR_IS_LONG(&_9$$12, 1)));
- }
- ZEPHIR_CALL_METHOD(&accessKey, this_ptr, "canaccess", NULL, 150, roleName, componentName, &access);
- zephir_check_call_status();
- _10 = Z_TYPE_P(&accessKey) != IS_NULL;
- if (_10) {
- _10 = zephir_array_isset(&accessList, &accessKey);
- }
- if (_10) {
- ZEPHIR_OBS_NVAR(&haveAccess);
- zephir_array_fetch(&haveAccess, &accessList, &accessKey, PH_NOISY, "phalcon/Acl/Adapter/Memory.zep", 660);
- ZEPHIR_OBS_NVAR(&funcAccess);
- zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("accessGranted"), &haveAccess);
- ZEPHIR_INIT_NVAR(&_8);
- ZVAL_STRING(&_8, "acl:afterCheckAccess");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", NULL, 0, &_8, this_ptr);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeKey"), &accessKey);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeFunction"), &funcAccess);
- if (Z_TYPE_P(&haveAccess) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_11$$14);
- ZEPHIR_CONCAT_VSVSV(&_11$$14, roleName, "!", componentName, "!", &access);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeKey"), &_11$$14);
- zephir_read_property(&_12$$14, this_ptr, ZEND_STRL("defaultAccess"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(ZEPHIR_IS_LONG(&_12$$14, 1));
- }
- if (zephir_is_callable(&funcAccess)) {
- ZEPHIR_INIT_VAR(&reflectionFunction);
- object_init_ex(&reflectionFunction, zephir_get_internal_ce(SL("reflectionfunction")));
- ZEPHIR_CALL_METHOD(NULL, &reflectionFunction, "__construct", NULL, 151, &funcAccess);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&reflectionParameters, &reflectionFunction, "getparameters", NULL, 152);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(¶meterNumber);
- ZVAL_LONG(¶meterNumber, zephir_fast_count_int(&reflectionParameters));
- if (ZEPHIR_IS_LONG_IDENTICAL(¶meterNumber, 0)) {
- _13$$16 = ZEPHIR_IS_LONG(&haveAccess, 1);
- if (_13$$16) {
- ZEPHIR_INIT_VAR(&_14$$16);
- ZEPHIR_CALL_USER_FUNC(&_14$$16, &funcAccess);
- zephir_check_call_status();
- _13$$16 = zephir_is_true(&_14$$16);
- }
- RETURN_MM_BOOL(_13$$16);
- }
- ZEPHIR_INIT_VAR(¶metersForFunction);
- array_init(¶metersForFunction);
- ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, &reflectionFunction, "getnumberofrequiredparameters", NULL, 153);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&userParametersSizeShouldBe, ¶meterNumber);
- zephir_is_iterable(&reflectionParameters, 0, "phalcon/Acl/Adapter/Memory.zep", 767);
- if (Z_TYPE_P(&reflectionParameters) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&reflectionParameters), _15$$15)
- {
- ZEPHIR_INIT_NVAR(&reflectionParameter);
- ZVAL_COPY(&reflectionParameter, _15$$15);
- ZEPHIR_CALL_METHOD(&reflectionType, &reflectionParameter, "gettype", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(¶meterToCheck, &reflectionParameter, "getname", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&reflectionType) != IS_NULL) {
- ZEPHIR_CALL_METHOD(&className, &reflectionType, "getname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&reflectionClass);
- object_init_ex(&reflectionClass, zephir_get_internal_ce(SL("reflectionclass")));
- ZEPHIR_CALL_METHOD(NULL, &reflectionClass, "__construct", &_17, 154, &className);
- zephir_check_call_status();
- _18$$18 = Z_TYPE_P(&roleObject) != IS_NULL;
- if (_18$$18) {
- ZEPHIR_CALL_METHOD(&_19$$18, &reflectionClass, "isinstance", &_20, 155, &roleObject);
- zephir_check_call_status();
- _18$$18 = zephir_is_true(&_19$$18);
- }
- _21$$18 = _18$$18;
- if (_21$$18) {
- _21$$18 = !hasRole;
- }
- if (_21$$18) {
- hasRole = 1;
- zephir_array_append(¶metersForFunction, &roleObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 720);
- SEPARATE_ZVAL(&userParametersSizeShouldBe);
- zephir_decrement(&userParametersSizeShouldBe);
- continue;
- }
- _22$$18 = Z_TYPE_P(&componentObject) != IS_NULL;
- if (_22$$18) {
- ZEPHIR_CALL_METHOD(&_23$$18, &reflectionClass, "isinstance", &_20, 155, &componentObject);
- zephir_check_call_status();
- _22$$18 = zephir_is_true(&_23$$18);
- }
- _24$$18 = _22$$18;
- if (_24$$18) {
- _24$$18 = !hasComponent;
- }
- if (_24$$18) {
- hasComponent = 1;
- zephir_array_append(¶metersForFunction, &componentObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 732);
- SEPARATE_ZVAL(&userParametersSizeShouldBe);
- zephir_decrement(&userParametersSizeShouldBe);
- continue;
- }
- _25$$18 = zephir_array_isset(¶meters, ¶meterToCheck);
- if (_25$$18) {
- zephir_array_fetch(&_26$$18, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 743);
- _25$$18 = Z_TYPE_P(&_26$$18) == IS_OBJECT;
- }
- _27$$18 = _25$$18;
- if (_27$$18) {
- zephir_array_fetch(&_29$$18, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 744);
- ZEPHIR_CALL_METHOD(&_28$$18, &reflectionClass, "isinstance", &_20, 155, &_29$$18);
- zephir_check_call_status();
- _27$$18 = !zephir_is_true(&_28$$18);
- }
- if (UNEXPECTED(_27$$18)) {
- ZEPHIR_INIT_NVAR(&_30$$21);
- object_init_ex(&_30$$21, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_31$$21);
- zephir_array_fetch(&_32$$21, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 751);
- zephir_get_class(&_31$$21, &_32$$21, 0);
- ZEPHIR_CALL_METHOD(&_33$$21, &reflectionClass, "getname", &_34, 156);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_35$$21);
- ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_35$$21, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_31$$21, " , Class in defined function: ", &_33$$21, ".");
- ZEPHIR_CALL_METHOD(NULL, &_30$$21, "__construct", NULL, 33, &_35$$21);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_30$$21, "phalcon/Acl/Adapter/Memory.zep", 754);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- if (zephir_array_isset(¶meters, ¶meterToCheck)) {
- zephir_array_fetch(&_36$$22, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 763);
- zephir_array_append(¶metersForFunction, &_36$$22, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 763);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &reflectionParameters, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_16$$15, &reflectionParameters, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_16$$15)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&reflectionParameter, &reflectionParameters, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&reflectionType, &reflectionParameter, "gettype", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(¶meterToCheck, &reflectionParameter, "getname", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&reflectionType) != IS_NULL) {
- ZEPHIR_CALL_METHOD(&className, &reflectionType, "getname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&reflectionClass);
- object_init_ex(&reflectionClass, zephir_get_internal_ce(SL("reflectionclass")));
- ZEPHIR_CALL_METHOD(NULL, &reflectionClass, "__construct", &_17, 154, &className);
- zephir_check_call_status();
- _37$$24 = Z_TYPE_P(&roleObject) != IS_NULL;
- if (_37$$24) {
- ZEPHIR_CALL_METHOD(&_38$$24, &reflectionClass, "isinstance", &_20, 155, &roleObject);
- zephir_check_call_status();
- _37$$24 = zephir_is_true(&_38$$24);
- }
- _39$$24 = _37$$24;
- if (_39$$24) {
- _39$$24 = !hasRole;
- }
- if (_39$$24) {
- hasRole = 1;
- zephir_array_append(¶metersForFunction, &roleObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 720);
- SEPARATE_ZVAL(&userParametersSizeShouldBe);
- zephir_decrement(&userParametersSizeShouldBe);
- continue;
- }
- _40$$24 = Z_TYPE_P(&componentObject) != IS_NULL;
- if (_40$$24) {
- ZEPHIR_CALL_METHOD(&_41$$24, &reflectionClass, "isinstance", &_20, 155, &componentObject);
- zephir_check_call_status();
- _40$$24 = zephir_is_true(&_41$$24);
- }
- _42$$24 = _40$$24;
- if (_42$$24) {
- _42$$24 = !hasComponent;
- }
- if (_42$$24) {
- hasComponent = 1;
- zephir_array_append(¶metersForFunction, &componentObject, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 732);
- SEPARATE_ZVAL(&userParametersSizeShouldBe);
- zephir_decrement(&userParametersSizeShouldBe);
- continue;
- }
- _43$$24 = zephir_array_isset(¶meters, ¶meterToCheck);
- if (_43$$24) {
- zephir_array_fetch(&_44$$24, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 743);
- _43$$24 = Z_TYPE_P(&_44$$24) == IS_OBJECT;
- }
- _45$$24 = _43$$24;
- if (_45$$24) {
- zephir_array_fetch(&_47$$24, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 744);
- ZEPHIR_CALL_METHOD(&_46$$24, &reflectionClass, "isinstance", &_20, 155, &_47$$24);
- zephir_check_call_status();
- _45$$24 = !zephir_is_true(&_46$$24);
- }
- if (UNEXPECTED(_45$$24)) {
- ZEPHIR_INIT_NVAR(&_48$$27);
- object_init_ex(&_48$$27, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_49$$27);
- zephir_array_fetch(&_50$$27, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 751);
- zephir_get_class(&_49$$27, &_50$$27, 0);
- ZEPHIR_CALL_METHOD(&_51$$27, &reflectionClass, "getname", &_34, 156);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_52$$27);
- ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_52$$27, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_49$$27, " , Class in defined function: ", &_51$$27, ".");
- ZEPHIR_CALL_METHOD(NULL, &_48$$27, "__construct", NULL, 33, &_52$$27);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_48$$27, "phalcon/Acl/Adapter/Memory.zep", 754);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- if (zephir_array_isset(¶meters, ¶meterToCheck)) {
- zephir_array_fetch(&_53$$28, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 763);
- zephir_array_append(¶metersForFunction, &_53$$28, PH_SEPARATE, "phalcon/Acl/Adapter/Memory.zep", 763);
- }
- ZEPHIR_CALL_METHOD(NULL, &reflectionParameters, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&reflectionParameter);
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeFunctionCustomArgumentsCount"), &userParametersSizeShouldBe);
- if (UNEXPECTED(ZEPHIR_LT_LONG(&userParametersSizeShouldBe, zephir_fast_count_int(¶meters)))) {
- ZEPHIR_INIT_VAR(&_54$$29);
- ZEPHIR_CONCAT_SSVSVSVS(&_54$$29, "Number of parameters in array is higher than ", "the number of parameters in defined function when checking if '", roleName, "' can '", &access, "' '", componentName, "'. Extra parameters will be ignored.");
- ZVAL_LONG(&_55$$29, 512);
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_54$$29, &_55$$29);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 1, &uri_param, &suffix_param);
+ zephir_get_strval(&uri, uri_param);
+ if (!suffix_param) {
+ ZEPHIR_INIT_VAR(&suffix);
+ } else {
+ zephir_get_strval(&suffix, suffix_param);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "/");
+ zephir_fast_trim(&_0, &uri, &_1, ZEPHIR_TRIM_RIGHT);
+ zephir_get_strval(&uri, &_0);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "/");
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "@");
+ ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 351, &_2, &_3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_5);
+ ZEPHIR_CONCAT_SVS(&_5, "@[^", &_4, "]+$@");
+ ZEPHIR_INIT_NVAR(&_2);
+ zephir_preg_match(&_2, &_5, &uri, &matches, 0, 0 , 0 );
+ if (zephir_is_true(&_2)) {
+ zephir_memory_observe(&fileName);
+ zephir_array_fetch_long(&fileName, &matches, 0, PH_NOISY, "phalcon/Support/Helper/File/Basename.zep", 39);
+ } else {
+ ZEPHIR_INIT_NVAR(&fileName);
+ ZVAL_STRING(&fileName, "");
+ }
+ if (1 != ZEPHIR_IS_EMPTY(&suffix)) {
+ ZEPHIR_INIT_VAR(&_6$$3);
+ ZVAL_STRING(&_6$$3, "@");
+ ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 351, &suffix, &_6$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_8$$3);
+ ZEPHIR_CONCAT_SVS(&_8$$3, "@", &_7$$3, "$@");
+ ZEPHIR_INIT_NVAR(&_6$$3);
+ ZVAL_STRING(&_6$$3, "");
+ ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 41, &_8$$3, &_6$$3, &fileName);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&fileName, &_9$$3);
+ }
+ RETURN_CCTOR(&fileName);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_AbstractStr)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, AbstractStr, phalcon, support_helper_str_abstractstr, phalcon_support_helper_str_abstractstr_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_AbstractStr, toEndsWith)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool ignoreCase;
+ zval *haystack_param = NULL, *needle_param = NULL, *ignoreCase_param = NULL, child, parent, _0;
+ zval haystack, needle;
+
+ ZVAL_UNDEF(&haystack);
+ ZVAL_UNDEF(&needle);
+ ZVAL_UNDEF(&child);
+ ZVAL_UNDEF(&parent);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(haystack)
+ Z_PARAM_STR(needle)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(ignoreCase)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 1, &haystack_param, &needle_param, &ignoreCase_param);
+ zephir_get_strval(&haystack, haystack_param);
+ zephir_get_strval(&needle, needle_param);
+ if (!ignoreCase_param) {
+ ignoreCase = 1;
+ } else {
}
- if (zephir_fast_count_int(¶metersForFunction) == 0) {
- if (UNEXPECTED(ZEPHIR_GT_LONG(&numberOfRequiredParameters, 0))) {
- ZEPHIR_INIT_VAR(&_56$$31);
- ZEPHIR_CONCAT_SVSVSVS(&_56$$31, "You did not provide any parameters when '", roleName, "' can '", &access, "' '", componentName, "'. We will use default action when no arguments.");
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_56$$31);
- zephir_check_call_status();
- _57$$31 = ZEPHIR_IS_LONG(&haveAccess, 1);
- if (_57$$31) {
- zephir_read_property(&_58$$31, this_ptr, ZEND_STRL("noArgumentsDefaultAction"), PH_NOISY_CC | PH_READONLY);
- _57$$31 = ZEPHIR_IS_LONG(&_58$$31, 1);
- }
- RETURN_MM_BOOL(_57$$31);
- }
- _59$$30 = ZEPHIR_IS_LONG(&haveAccess, 1);
- if (_59$$30) {
- ZEPHIR_INIT_VAR(&_60$$30);
- ZEPHIR_CALL_USER_FUNC(&_60$$30, &funcAccess);
- zephir_check_call_status();
- _59$$30 = zephir_is_true(&_60$$30);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "");
+ if (ZEPHIR_IS_IDENTICAL(&_0, &haystack)) {
+ RETURN_MM_BOOL(0);
+ }
+ if (EXPECTED(ignoreCase)) {
+ ZEPHIR_CALL_FUNCTION(&child, "mb_strtolower", NULL, 10, &needle);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&parent, "mb_strtolower", NULL, 10, &haystack);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&child, &needle);
+ ZEPHIR_CPY_WRT(&parent, &haystack);
+ }
+ RETURN_MM_BOOL(zephir_end_with(&parent, &child, NULL));
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_AbstractStr, toInterpolate)
+{
+ zend_string *_3;
+ zend_ulong _2;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval context;
+ zval *input_param = NULL, *context_param = NULL, *left_param = NULL, *right_param = NULL, key, replace, value, *_0, _1, _4$$4, _5$$5;
+ zval input, left, right;
+
+ ZVAL_UNDEF(&input);
+ ZVAL_UNDEF(&left);
+ ZVAL_UNDEF(&right);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&replace);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&context);
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(input)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(context)
+ Z_PARAM_STR(left)
+ Z_PARAM_STR(right)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 3, &input_param, &context_param, &left_param, &right_param);
+ zephir_get_strval(&input, input_param);
+ if (!context_param) {
+ ZEPHIR_INIT_VAR(&context);
+ array_init(&context);
+ } else {
+ zephir_get_arrval(&context, context_param);
+ }
+ if (!left_param) {
+ ZEPHIR_INIT_VAR(&left);
+ ZVAL_STRING(&left, "%");
+ } else {
+ zephir_get_strval(&left, left_param);
+ }
+ if (!right_param) {
+ ZEPHIR_INIT_VAR(&right);
+ ZVAL_STRING(&right, "%");
+ } else {
+ zephir_get_strval(&right, right_param);
+ }
+ if (ZEPHIR_IS_EMPTY(&context)) {
+ RETURN_CTOR(&input);
+ }
+ ZEPHIR_INIT_VAR(&replace);
+ array_init(&replace);
+ zephir_is_iterable(&context, 0, "phalcon/Support/Helper/Str/AbstractStr.zep", 82);
+ if (Z_TYPE_P(&context) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&context), _2, _3, _0)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_3 != NULL) {
+ ZVAL_STR_COPY(&key, _3);
+ } else {
+ ZVAL_LONG(&key, _2);
}
- RETURN_MM_BOOL(_59$$30);
- }
- if (ZEPHIR_LE_LONG(&numberOfRequiredParameters, zephir_fast_count_int(¶metersForFunction))) {
- _61$$32 = ZEPHIR_IS_LONG(&haveAccess, 1);
- if (_61$$32) {
- ZEPHIR_INIT_VAR(&_62$$32);
- ZEPHIR_CALL_USER_FUNC_ARRAY(&_62$$32, &funcAccess, ¶metersForFunction);
- zephir_check_call_status();
- _61$$32 = zephir_is_true(&_62$$32);
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0);
+ ZEPHIR_INIT_NVAR(&_4$$4);
+ ZEPHIR_CONCAT_VVV(&_4$$4, &left, &key, &right);
+ zephir_array_update_zval(&replace, &_4$$4, &value, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &context, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &context, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
}
- RETURN_MM_BOOL(_61$$32);
+ ZEPHIR_CALL_METHOD(&key, &context, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &context, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_5$$5);
+ ZEPHIR_CONCAT_VVV(&_5$$5, &left, &key, &right);
+ zephir_array_update_zval(&replace, &_5$$5, &value, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &context, "next", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_INIT_VAR(&_63$$15);
- object_init_ex(&_63$$15, phalcon_acl_exception_ce);
- ZEPHIR_INIT_VAR(&_64$$15);
- ZEPHIR_CONCAT_SSVSVSVS(&_64$$15, "You did not provide all necessary parameters for the ", "defined function when checking if '", roleName, "' can '", &access, "' for '", componentName, "'.");
- ZEPHIR_CALL_METHOD(NULL, &_63$$15, "__construct", NULL, 33, &_64$$15);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_63$$15, "phalcon/Acl/Adapter/Memory.zep", 808);
- ZEPHIR_MM_RESTORE();
- return;
}
- RETURN_MM_BOOL(ZEPHIR_IS_LONG(&haveAccess, 1));
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 5, &input, &replace);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isRole)
+static PHP_METHOD(Phalcon_Support_Helper_Str_AbstractStr, toLower)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *roleName_param = NULL, _0;
- zval roleName;
- zval *this_ptr = getThis();
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *encoding_param = NULL, _0;
+ zval text, encoding;
- ZVAL_UNDEF(&roleName);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(roleName)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(encoding)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &roleName_param);
- zephir_get_strval(&roleName, roleName_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &roleName));
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ zephir_get_strval(&text, text_param);
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ zephir_get_strval(&encoding, encoding_param);
+ }
+ ZVAL_LONG(&_0, 1);
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_case", NULL, 12, &text, &_0, &encoding);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isComponent)
+static PHP_METHOD(Phalcon_Support_Helper_Str_AbstractStr, toStartsWith)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *componentName_param = NULL, _0;
- zval componentName;
- zval *this_ptr = getThis();
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool ignoreCase;
+ zval *haystack_param = NULL, *needle_param = NULL, *ignoreCase_param = NULL, child, parent, _0;
+ zval haystack, needle;
- ZVAL_UNDEF(&componentName);
+ ZVAL_UNDEF(&haystack);
+ ZVAL_UNDEF(&needle);
+ ZVAL_UNDEF(&child);
+ ZVAL_UNDEF(&parent);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(componentName)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(haystack)
+ Z_PARAM_STR(needle)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(ignoreCase)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &componentName_param);
- zephir_get_strval(&componentName, componentName_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &componentName));
+ zephir_fetch_params(1, 2, 1, &haystack_param, &needle_param, &ignoreCase_param);
+ zephir_get_strval(&haystack, haystack_param);
+ zephir_get_strval(&needle, needle_param);
+ if (!ignoreCase_param) {
+ ignoreCase = 1;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "");
+ if (ZEPHIR_IS_IDENTICAL(&_0, &haystack)) {
+ RETURN_MM_BOOL(0);
+ }
+ if (EXPECTED(ignoreCase)) {
+ ZEPHIR_CALL_FUNCTION(&child, "mb_strtolower", NULL, 10, &needle);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&parent, "mb_strtolower", NULL, 10, &haystack);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&child, &needle);
+ ZEPHIR_CPY_WRT(&parent, &haystack);
+ }
+ RETURN_MM_BOOL(zephir_start_with(&parent, &child, NULL));
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, setNoArgumentsDefaultAction)
+static PHP_METHOD(Phalcon_Support_Helper_Str_AbstractStr, toUpper)
{
- zval *defaultAccess_param = NULL, _0;
- zend_long defaultAccess;
- zval *this_ptr = getThis();
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *encoding_param = NULL, _0;
+ zval text, encoding;
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(defaultAccess)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(encoding)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &defaultAccess_param);
- ZVAL_UNDEF(&_0);
- ZVAL_LONG(&_0, defaultAccess);
- zephir_update_property_zval(this_ptr, ZEND_STRL("noArgumentsDefaultAction"), &_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ zephir_get_strval(&text, text_param);
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ zephir_get_strval(&encoding, encoding_param);
+ }
+ ZVAL_LONG(&_0, 0);
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_case", NULL, 12, &text, &_0, &encoding);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Camelize)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, Camelize, phalcon, support_helper_str_camelize, phalcon_support_helper_str_pascalcase_ce, phalcon_support_helper_str_camelize_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Camelize, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_8 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *roleName_param = NULL, *componentName_param = NULL, *access, access_sub, *action, action_sub, *func = NULL, func_sub, __$null, accessList, accessName, accessKey, _0, _1, _2, _3, *_4$$3, _5$$3, *_11$$3, _12$$3, _6$$5, _7$$5, _9$$7, _10$$7, _13$$14, _14$$14;
- zval roleName, componentName;
- zval *this_ptr = getThis();
+ zend_bool lowerFirst;
+ zval *text_param = NULL, *delimiters_param = NULL, *lowerFirst_param = NULL, result, _0$$3;
+ zval text, delimiters;
- ZVAL_UNDEF(&roleName);
- ZVAL_UNDEF(&componentName);
- ZVAL_UNDEF(&access_sub);
- ZVAL_UNDEF(&action_sub);
- ZVAL_UNDEF(&func_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&accessList);
- ZVAL_UNDEF(&accessName);
- ZVAL_UNDEF(&accessKey);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_12$$3);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$5);
- ZVAL_UNDEF(&_9$$7);
- ZVAL_UNDEF(&_10$$7);
- ZVAL_UNDEF(&_13$$14);
- ZVAL_UNDEF(&_14$$14);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&delimiters);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0$$3);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(4, 5)
- Z_PARAM_STR(roleName)
- Z_PARAM_STR(componentName)
- Z_PARAM_ZVAL(access)
- Z_PARAM_ZVAL(action)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(func)
+ Z_PARAM_STR_OR_NULL(delimiters)
+ Z_PARAM_BOOL(lowerFirst)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 4, 1, &roleName_param, &componentName_param, &access, &action, &func);
- zephir_get_strval(&roleName, roleName_param);
- zephir_get_strval(&componentName, componentName_param);
- if (!func) {
- func = &func_sub;
- func = &__$null;
+ zephir_fetch_params(1, 1, 2, &text_param, &delimiters_param, &lowerFirst_param);
+ zephir_get_strval(&text, text_param);
+ if (!delimiters_param) {
+ ZEPHIR_INIT_VAR(&delimiters);
+ } else {
+ zephir_get_strval(&delimiters, delimiters_param);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "Role");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 145, &_0, &roleName, &_1);
- zephir_check_call_status();
- zephir_read_property(&_2, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "Component");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 145, &_2, &componentName, &_1);
- zephir_check_call_status();
- zephir_read_property(&_3, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&accessList, &_3);
- if (Z_TYPE_P(access) == IS_ARRAY) {
- zephir_is_iterable(access, 0, "phalcon/Acl/Adapter/Memory.zep", 864);
- if (Z_TYPE_P(access) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(access), _4$$3)
- {
- ZEPHIR_INIT_NVAR(&accessName);
- ZVAL_COPY(&accessName, _4$$3);
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VSV(&accessKey, &componentName, "!", &accessName);
- if (UNEXPECTED(!(zephir_array_isset(&accessList, &accessKey)))) {
- ZEPHIR_INIT_NVAR(&_6$$5);
- object_init_ex(&_6$$5, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_7$$5);
- ZEPHIR_CONCAT_SVSVS(&_7$$5, "Access '", &accessName, "' does not exist in component '", &componentName, "'");
- ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", &_8, 33, &_7$$5);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_6$$5, "phalcon/Acl/Adapter/Memory.zep", 860);
- ZEPHIR_MM_RESTORE();
- return;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, access, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_5$$3, access, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_5$$3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&accessName, access, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VSV(&accessKey, &componentName, "!", &accessName);
- if (UNEXPECTED(!(zephir_array_isset(&accessList, &accessKey)))) {
- ZEPHIR_INIT_NVAR(&_9$$7);
- object_init_ex(&_9$$7, phalcon_acl_exception_ce);
- ZEPHIR_INIT_NVAR(&_10$$7);
- ZEPHIR_CONCAT_SVSVS(&_10$$7, "Access '", &accessName, "' does not exist in component '", &componentName, "'");
- ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 33, &_10$$7);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_9$$7, "phalcon/Acl/Adapter/Memory.zep", 860);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_CALL_METHOD(NULL, access, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&accessName);
- zephir_is_iterable(access, 0, "phalcon/Acl/Adapter/Memory.zep", 872);
- if (Z_TYPE_P(access) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(access), _11$$3)
- {
- ZEPHIR_INIT_NVAR(&accessName);
- ZVAL_COPY(&accessName, _11$$3);
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VSVSV(&accessKey, &roleName, "!", &componentName, "!", &accessName);
- zephir_update_property_array(this_ptr, SL("access"), &accessKey, action);
- if (Z_TYPE_P(func) != IS_NULL) {
- zephir_update_property_array(this_ptr, SL("func"), &accessKey, func);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, access, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_12$$3, access, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_12$$3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&accessName, access, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VSVSV(&accessKey, &roleName, "!", &componentName, "!", &accessName);
- zephir_update_property_array(this_ptr, SL("access"), &accessKey, action);
- if (Z_TYPE_P(func) != IS_NULL) {
- zephir_update_property_array(this_ptr, SL("func"), &accessKey, func);
- }
- ZEPHIR_CALL_METHOD(NULL, access, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&accessName);
+ if (!lowerFirst_param) {
+ lowerFirst = 0;
} else {
- if (!ZEPHIR_IS_STRING(access, "*")) {
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VSV(&accessKey, &componentName, "!", access);
- if (UNEXPECTED(!(zephir_array_isset(&accessList, &accessKey)))) {
- ZEPHIR_INIT_VAR(&_13$$14);
- object_init_ex(&_13$$14, phalcon_acl_exception_ce);
- ZEPHIR_INIT_VAR(&_14$$14);
- ZEPHIR_CONCAT_SVSVS(&_14$$14, "Access '", access, "' does not exist in component '", &componentName, "'");
- ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 33, &_14$$14);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_13$$14, "phalcon/Acl/Adapter/Memory.zep", 880);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VSVSV(&accessKey, &roleName, "!", &componentName, "!", access);
- zephir_update_property_array(this_ptr, SL("access"), &accessKey, action);
- if (Z_TYPE_P(func) != IS_NULL) {
- zephir_update_property_array(this_ptr, SL("func"), &accessKey, func);
}
+ ZEPHIR_CALL_PARENT(&result, phalcon_support_helper_str_camelize_ce, getThis(), "__invoke", NULL, 0, &text, &delimiters);
+ zephir_check_call_status();
+ if (lowerFirst == 1) {
+ ZEPHIR_CALL_FUNCTION(&_0$$3, "lcfirst", NULL, 76, &result);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&result, &_0$$3);
}
- ZEPHIR_MM_RESTORE();
+ RETURN_CCTOR(&result);
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Concat)
{
- zval usedRoleToInherits, checkRoleToInherits;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, Concat, phalcon, support_helper_str_concat, phalcon_support_helper_str_abstractstr_ce, phalcon_support_helper_str_concat_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Concat, __invoke)
+{
+ zval argument, arguments, delimiter, data, first, last, prefix, suffix, _0, _1, *_2, _3, _6, _4$$6, _5$$7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *roleName_param = NULL, *componentName_param = NULL, *access_param = NULL, __$true, accessList, checkRoleToInherit, usedRoleToInherit, _0, _1$$6, _2$$6, *_3$$6, _4$$6, _7$$9, _8$$9, _9$$9, _10$$9, _11$$14, _12$$14, *_13$$14, _14$$14;
- zval roleName, componentName, access, accessKey;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&roleName);
- ZVAL_UNDEF(&componentName);
- ZVAL_UNDEF(&access);
- ZVAL_UNDEF(&accessKey);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&accessList);
- ZVAL_UNDEF(&checkRoleToInherit);
- ZVAL_UNDEF(&usedRoleToInherit);
+ ZVAL_UNDEF(&argument);
+ ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&delimiter);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&first);
+ ZVAL_UNDEF(&last);
+ ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&suffix);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$6);
- ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_6);
ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_7$$9);
- ZVAL_UNDEF(&_8$$9);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$9);
- ZVAL_UNDEF(&_11$$14);
- ZVAL_UNDEF(&_12$$14);
- ZVAL_UNDEF(&_14$$14);
- ZVAL_UNDEF(&usedRoleToInherits);
- ZVAL_UNDEF(&checkRoleToInherits);
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_STR(roleName)
- Z_PARAM_STR(componentName)
- Z_PARAM_STR(access)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_5$$7);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 0, &roleName_param, &componentName_param, &access_param);
- zephir_get_strval(&roleName, roleName_param);
- zephir_get_strval(&componentName, componentName_param);
- zephir_get_strval(&access, access_param);
- zephir_memory_observe(&accessList);
- zephir_read_property(&accessList, this_ptr, ZEND_STRL("access"), PH_NOISY_CC);
- ZEPHIR_INIT_VAR(&accessKey);
- ZEPHIR_CONCAT_VSVSV(&accessKey, &roleName, "!", &componentName, "!", &access);
- if (zephir_array_isset(&accessList, &accessKey)) {
- RETURN_CTOR(&accessKey);
+
+ ZEPHIR_INIT_VAR(&arguments);
+ zephir_get_args(&arguments);
+ if (UNEXPECTED(zephir_fast_count_int(&arguments) < 3)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_support_helper_exception_ce, "concat needs at least three parameters", "phalcon/Support/Helper/Str/Concat.zep", 37);
+ return;
}
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VSVS(&accessKey, &roleName, "!", &componentName, "!*");
- if (zephir_array_isset(&accessList, &accessKey)) {
- RETURN_CTOR(&accessKey);
+ ZEPHIR_MAKE_REF(&arguments);
+ ZEPHIR_CALL_FUNCTION(&delimiter, "reset", NULL, 477, &arguments);
+ ZEPHIR_UNREF(&arguments);
+ zephir_check_call_status();
+ ZVAL_LONG(&_0, 1);
+ ZEPHIR_CALL_FUNCTION(&_1, "array_slice", NULL, 501, &arguments, &_0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&arguments, &_1);
+ ZEPHIR_MAKE_REF(&arguments);
+ ZEPHIR_CALL_FUNCTION(&first, "reset", NULL, 477, &arguments);
+ ZEPHIR_UNREF(&arguments);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&arguments);
+ ZEPHIR_CALL_FUNCTION(&last, "end", NULL, 320, &arguments);
+ ZEPHIR_UNREF(&arguments);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&prefix);
+ ZVAL_STRING(&prefix, "");
+ ZEPHIR_INIT_VAR(&suffix);
+ ZVAL_STRING(&suffix, "");
+ ZEPHIR_INIT_VAR(&data);
+ array_init(&data);
+ if (zephir_start_with(&first, &delimiter, NULL)) {
+ ZEPHIR_CPY_WRT(&prefix, &delimiter);
}
- ZEPHIR_INIT_NVAR(&accessKey);
- ZEPHIR_CONCAT_VS(&accessKey, &roleName, "!*!*");
- if (zephir_array_isset(&accessList, &accessKey)) {
- RETURN_CTOR(&accessKey);
+ if (zephir_end_with(&last, &delimiter, NULL)) {
+ ZEPHIR_CPY_WRT(&suffix, &delimiter);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_0, &roleName)) {
- ZEPHIR_INIT_VAR(&checkRoleToInherits);
- array_init(&checkRoleToInherits);
- zephir_read_property(&_1$$6, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_2$$6, &_1$$6, &roleName, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 941);
- zephir_is_iterable(&_2$$6, 0, "phalcon/Acl/Adapter/Memory.zep", 945);
- if (Z_TYPE_P(&_2$$6) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_2$$6), _3$$6)
- {
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZVAL_COPY(&usedRoleToInherit, _3$$6);
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_2$$6, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_4$$6, &_2$$6, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_4$$6)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_2$$6, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_2$$6, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZEPHIR_INIT_VAR(&usedRoleToInherits);
- array_init(&usedRoleToInherits);
+ zephir_is_iterable(&arguments, 0, "phalcon/Support/Helper/Str/Concat.zep", 61);
+ if (Z_TYPE_P(&arguments) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arguments), _2)
+ {
+ ZEPHIR_INIT_NVAR(&argument);
+ ZVAL_COPY(&argument, _2);
+ ZEPHIR_INIT_NVAR(&_4$$6);
+ zephir_fast_trim(&_4$$6, &argument, &delimiter, ZEPHIR_TRIM_BOTH);
+ zephir_array_append(&data, &_4$$6, PH_SEPARATE, "phalcon/Support/Helper/Str/Concat.zep", 58);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &arguments, "rewind", NULL, 0);
+ zephir_check_call_status();
while (1) {
- if (!(!(ZEPHIR_IS_EMPTY(&checkRoleToInherits)))) {
+ ZEPHIR_CALL_METHOD(&_3, &arguments, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
break;
}
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_6, 22, &checkRoleToInherits);
- ZEPHIR_UNREF(&checkRoleToInherits);
+ ZEPHIR_CALL_METHOD(&argument, &arguments, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_5$$7);
+ zephir_fast_trim(&_5$$7, &argument, &delimiter, ZEPHIR_TRIM_BOTH);
+ zephir_array_append(&data, &_5$$7, PH_SEPARATE, "phalcon/Support/Helper/Str/Concat.zep", 58);
+ ZEPHIR_CALL_METHOD(NULL, &arguments, "next", NULL, 0);
zephir_check_call_status();
- if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) {
- continue;
- }
- zephir_array_update_zval(&usedRoleToInherits, &checkRoleToInherit, &__$true, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_7$$9);
- ZEPHIR_CONCAT_VSVSV(&_7$$9, &checkRoleToInherit, "!", &componentName, "!", &access);
- zephir_get_strval(&accessKey, &_7$$9);
- if (zephir_array_isset(&accessList, &accessKey)) {
- RETURN_CTOR(&accessKey);
- }
- ZEPHIR_INIT_NVAR(&_8$$9);
- ZEPHIR_CONCAT_VSVS(&_8$$9, &checkRoleToInherit, "!", &componentName, "!*");
- zephir_get_strval(&accessKey, &_8$$9);
- if (zephir_array_isset(&accessList, &accessKey)) {
- RETURN_CTOR(&accessKey);
- }
- ZEPHIR_INIT_NVAR(&_9$$9);
- ZEPHIR_CONCAT_VS(&_9$$9, &checkRoleToInherit, "!*!*");
- zephir_get_strval(&accessKey, &_9$$9);
- if (zephir_array_isset(&accessList, &accessKey)) {
- RETURN_CTOR(&accessKey);
- }
- zephir_read_property(&_10$$9, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_10$$9, &checkRoleToInherit)) {
- zephir_read_property(&_11$$14, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_12$$14, &_11$$14, &checkRoleToInherit, PH_NOISY | PH_READONLY, "phalcon/Acl/Adapter/Memory.zep", 988);
- zephir_is_iterable(&_12$$14, 0, "phalcon/Acl/Adapter/Memory.zep", 991);
- if (Z_TYPE_P(&_12$$14) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_12$$14), _13$$14)
- {
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- ZVAL_COPY(&usedRoleToInherit, _13$$14);
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_12$$14, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_14$$14, &_12$$14, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_14$$14)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_12$$14, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MAKE_REF(&checkRoleToInherits);
- ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 146, &checkRoleToInherits, &usedRoleToInherit);
- ZEPHIR_UNREF(&checkRoleToInherits);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_12$$14, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&usedRoleToInherit);
- }
}
}
- RETURN_MM_BOOL(0);
+ ZEPHIR_INIT_NVAR(&argument);
+ ZEPHIR_INIT_VAR(&_6);
+ zephir_fast_join(&_6, &delimiter, &data);
+ ZEPHIR_CONCAT_VVV(return_value, &prefix, &_6, &suffix);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Acl_Adapter_Memory, checkExists)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_CountVowels)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, CountVowels, phalcon, support_helper_str_countvowels, phalcon_support_helper_str_countvowels_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_CountVowels, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval element, elementName, suffix, _1$$3;
- zval *collection_param = NULL, *element_param = NULL, *elementName_param = NULL, *suffix_param = NULL, _0$$3;
- zval collection;
+ zval *text_param = NULL, matches, _0, _1, _2, _3;
+ zval text;
- ZVAL_UNDEF(&collection);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&elementName);
- ZVAL_UNDEF(&suffix);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(3, 4)
- Z_PARAM_ARRAY(collection)
- Z_PARAM_STR(element)
- Z_PARAM_STR(elementName)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(suffix)
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(text)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 1, &collection_param, &element_param, &elementName_param, &suffix_param);
- zephir_get_arrval(&collection, collection_param);
- zephir_get_strval(&element, element_param);
- zephir_get_strval(&elementName, elementName_param);
- if (!suffix_param) {
- ZEPHIR_INIT_VAR(&suffix);
- ZVAL_STRING(&suffix, "ACL");
- } else {
- zephir_get_strval(&suffix, suffix_param);
- }
- if (1 != zephir_array_isset(&collection, &element)) {
- ZEPHIR_INIT_VAR(&_0$$3);
- object_init_ex(&_0$$3, phalcon_acl_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$3);
- ZEPHIR_CONCAT_VSVSV(&_1$$3, &elementName, " '", &element, "' does not exist in the ", &suffix);
- ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 33, &_1$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$3, "phalcon/Acl/Adapter/Memory.zep", 1016);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &text_param);
+ zephir_get_strval(&text, text_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "/[aeiouy]/i");
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "/[aeiouy]/i");
+ zephir_preg_match(&_1, &_2, &text, &matches, 1, 0 , 0 );
+ zephir_array_fetch_long(&_3, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/CountVowels.zep", 30);
+ RETURN_MM_LONG(zephir_fast_count_int(&_3));
}
@@ -145255,111 +142235,204 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, checkExists)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_AdapterFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Decapitalize)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, AdapterFactory, phalcon, storage_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_storage_adapterfactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, Decapitalize, phalcon, support_helper_str_decapitalize, phalcon_support_helper_str_abstractstr_ce, phalcon_support_helper_str_decapitalize_method_entry, 0);
- zend_declare_property_null(phalcon_storage_adapterfactory_ce, SL("serializerFactory"), ZEND_ACC_PRIVATE);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_AdapterFactory, __construct)
+static PHP_METHOD(Phalcon_Support_Helper_Str_Decapitalize, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval services;
- zval *factory, factory_sub, *services_param = NULL;
+ zend_bool upperRest;
+ zval *text_param = NULL, *upperRest_param = NULL, *encoding_param = NULL, substr, suffix, _0, _1, _2, _3;
+ zval text, encoding;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&services);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZVAL_UNDEF(&substr);
+ ZVAL_UNDEF(&suffix);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ Z_PARAM_BOOL(upperRest)
+ Z_PARAM_STR(encoding)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ zephir_fetch_params(1, 1, 2, &text_param, &upperRest_param, &encoding_param);
+ zephir_get_strval(&text, text_param);
+ if (!upperRest_param) {
+ upperRest = 0;
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ }
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
+ } else {
+ zephir_get_strval(&encoding, encoding_param);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("serializerFactory"), factory);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ ZVAL_LONG(&_0, 1);
+ ZEPHIR_CALL_FUNCTION(&substr, "mb_substr", NULL, 228, &text, &_0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ if (upperRest) {
+ ZEPHIR_CALL_METHOD(&suffix, this_ptr, "toupper", NULL, 0, &substr, &encoding);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&suffix, &substr);
+ }
+ ZVAL_LONG(&_0, 0);
+ ZVAL_LONG(&_2, 1);
+ ZEPHIR_CALL_FUNCTION(&_3, "mb_substr", NULL, 228, &text, &_0, &_2);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "tolower", NULL, 0, &_3, &encoding);
+ zephir_check_call_status();
+ ZEPHIR_CONCAT_VV(return_value, &_1, &suffix);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_AdapterFactory, newInstance)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Decrement)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Decrement, phalcon, support_helper_str_decrement, phalcon_support_helper_str_decrement_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Decrement, __invoke)
{
+ zend_long number = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options, _0;
- zval *name_param = NULL, *options_param = NULL, definition, _1;
- zval name;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, *separator_param = NULL, parts, _0, _3, _4, _1$$3, _2$$4;
+ zval text, separator;
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&parts);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR(separator)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &options_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 1, 1, &text_param, &separator_param);
+ zephir_get_strval(&text, text_param);
+ if (!separator_param) {
+ ZEPHIR_INIT_VAR(&separator);
+ ZVAL_STRING(&separator, "_");
} else {
- ZEPHIR_INIT_VAR(&name);
+ zephir_get_strval(&separator, separator_param);
}
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ number = 0;
+ ZEPHIR_INIT_VAR(&parts);
+ zephir_fast_explode(&parts, &separator, &text, LONG_MAX);
+ ZEPHIR_INIT_VAR(&_0);
+ if (Z_TYPE_P(&parts) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_0);
+ array_init(&_0);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_CPY_WRT(&_0, &parts);
}
- ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 2, 0);
- zephir_memory_observe(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("serializerFactory"), PH_NOISY_CC);
- zephir_array_fast_append(&_0, &_1);
- zephir_array_fast_append(&_0, &options);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &_0);
- zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&parts, &_0);
+ if (1 == zephir_array_isset_long(&parts, 1)) {
+ zephir_memory_observe(&_1$$3);
+ zephir_array_fetch_long(&_1$$3, &parts, 1, PH_NOISY, "phalcon/Support/Helper/Str/Decrement.zep", 36);
+ number = zephir_get_intval(&_1$$3);
+ number--;
+ if (number <= 0) {
+ zephir_array_fetch_long(&_2$$4, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Decrement.zep", 39);
+ RETURN_CTOR(&_2$$4);
+ }
+ }
+ zephir_array_fetch_long(&_3, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Decrement.zep", 43);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_LONG(&_4, number);
+ ZEPHIR_CONCAT_VVV(return_value, &_3, &separator, &_4);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_AdapterFactory, getExceptionClass)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_DirFromFile)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, DirFromFile, phalcon, support_helper_str_dirfromfile, phalcon_support_helper_str_dirfromfile_method_entry, 0);
- RETURN_STRING("Phalcon\\Storage\\Exception");
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_AdapterFactory, getServices)
+static PHP_METHOD(Phalcon_Support_Helper_Str_DirFromFile, __invoke)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, name, start, _0, _1, _4, _5, _2$$3, _3$$3;
+ zval file;
- zephir_create_array(return_value, 6, 0);
- add_assoc_stringl_ex(return_value, SL("apcu"), SL("Phalcon\\Storage\\Adapter\\Apcu"));
- add_assoc_stringl_ex(return_value, SL("libmemcached"), SL("Phalcon\\Storage\\Adapter\\Libmemcached"));
- add_assoc_stringl_ex(return_value, SL("memory"), SL("Phalcon\\Storage\\Adapter\\Memory"));
- add_assoc_stringl_ex(return_value, SL("redis"), SL("Phalcon\\Storage\\Adapter\\Redis"));
- add_assoc_stringl_ex(return_value, SL("stream"), SL("Phalcon\\Storage\\Adapter\\Stream"));
- add_assoc_stringl_ex(return_value, SL("weak"), SL("Phalcon\\Storage\\Adapter\\Weak"));
- return;
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&start);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(file)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &file_param);
+ zephir_get_strval(&file, file_param);
+ ZVAL_LONG(&_0, 8);
+ ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 89, &file, &_0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_0, 0);
+ ZVAL_LONG(&_1, -2);
+ ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 228, &name, &_0, &_1);
+ zephir_check_call_status();
+ if (!zephir_is_true(&start)) {
+ ZVAL_LONG(&_2$$3, 0);
+ ZVAL_LONG(&_3$$3, 1);
+ ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 228, &name, &_2$$3, &_3$$3);
+ zephir_check_call_status();
+ }
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_LONG(&_0, 2);
+ ZEPHIR_CALL_FUNCTION(&_5, "mb_str_split", NULL, 0, &start, &_0);
+ zephir_check_call_status();
+ zephir_fast_join_str(&_4, SL("/"), &_5);
+ ZEPHIR_CONCAT_VS(return_value, &_4, "/");
+ RETURN_MM();
}
@@ -145372,13 +142445,37 @@ static PHP_METHOD(Phalcon_Storage_AdapterFactory, getServices)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_DirSeparator)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, Exception, phalcon, storage_exception, zend_ce_exception, NULL, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, DirSeparator, phalcon, support_helper_str_dirseparator, phalcon_support_helper_str_dirseparator_method_entry, 0);
return SUCCESS;
}
+static PHP_METHOD(Phalcon_Support_Helper_Str_DirSeparator, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *directory_param = NULL, _0, _1;
+ zval directory;
+
+ ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(directory)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &directory_param);
+ zephir_get_strval(&directory, directory_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "/");
+ zephir_fast_trim(&_0, &directory, &_1, ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_CONCAT_VS(return_value, &_0, "/");
+ RETURN_MM();
+}
+
@@ -145389,97 +142486,183 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_SerializerFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Dynamic)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage, SerializerFactory, phalcon, storage_serializerfactory, phalcon_factory_abstractfactory_ce, phalcon_storage_serializerfactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Dynamic, phalcon, support_helper_str_dynamic, phalcon_support_helper_str_dynamic_method_entry, 0);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_SerializerFactory, __construct)
+static PHP_METHOD(Phalcon_Support_Helper_Str_Dynamic, __invoke)
{
+ zend_bool _8$$6, _17$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_11 = NULL, *_16 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *services_param = NULL;
- zval services;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, *leftDelimiter_param = NULL, *rightDelimiter_param = NULL, *separator_param = NULL, ldS, rdS, matches, match, words, word, sub, _0, _1, _4, _5, _2$$3, *_6$$5, _7$$5, _9$$6, _10$$6, _12$$6, _13$$6, _14$$6, _15$$6, _18$$8, _19$$8, _20$$8, _21$$8, _22$$8, _23$$8;
+ zval text, leftDelimiter, rightDelimiter, separator, pattern, _3$$3;
- ZVAL_UNDEF(&services);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&leftDelimiter);
+ ZVAL_UNDEF(&rightDelimiter);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&pattern);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&ldS);
+ ZVAL_UNDEF(&rdS);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&match);
+ ZVAL_UNDEF(&words);
+ ZVAL_UNDEF(&word);
+ ZVAL_UNDEF(&sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$6);
+ ZVAL_UNDEF(&_15$$6);
+ ZVAL_UNDEF(&_18$$8);
+ ZVAL_UNDEF(&_19$$8);
+ ZVAL_UNDEF(&_20$$8);
+ ZVAL_UNDEF(&_21$$8);
+ ZVAL_UNDEF(&_22$$8);
+ ZVAL_UNDEF(&_23$$8);
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ Z_PARAM_STR(leftDelimiter)
+ Z_PARAM_STR(rightDelimiter)
+ Z_PARAM_STR(separator)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ zephir_fetch_params(1, 1, 3, &text_param, &leftDelimiter_param, &rightDelimiter_param, &separator_param);
+ zephir_get_strval(&text, text_param);
+ if (!leftDelimiter_param) {
+ ZEPHIR_INIT_VAR(&leftDelimiter);
+ ZVAL_STRING(&leftDelimiter, "{");
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ zephir_get_strval(&leftDelimiter, leftDelimiter_param);
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Storage_SerializerFactory, newInstance)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, definition;
- zval name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
+ if (!rightDelimiter_param) {
+ ZEPHIR_INIT_VAR(&rightDelimiter);
+ ZVAL_STRING(&rightDelimiter, "}");
+ } else {
+ zephir_get_strval(&rightDelimiter, rightDelimiter_param);
}
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ if (!separator_param) {
+ ZEPHIR_INIT_VAR(&separator);
+ ZVAL_STRING(&separator, "|");
} else {
- ZEPHIR_INIT_VAR(&name);
+ zephir_get_strval(&separator, separator_param);
}
- ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
+ ZEPHIR_CALL_FUNCTION(&_0, "substr_count", NULL, 0, &text, &leftDelimiter);
zephir_check_call_status();
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(return_value, &definition);
+ ZEPHIR_CALL_FUNCTION(&_1, "substr_count", NULL, 0, &text, &rightDelimiter);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Storage_SerializerFactory, getExceptionClass)
-{
-
- RETURN_STRING("Phalcon\\Storage\\Exception");
-}
-
-static PHP_METHOD(Phalcon_Storage_SerializerFactory, getServices)
-{
-
- zephir_create_array(return_value, 14, 0);
- add_assoc_stringl_ex(return_value, SL("base64"), SL("Phalcon\\Storage\\Serializer\\Base64"));
- add_assoc_stringl_ex(return_value, SL("igbinary"), SL("Phalcon\\Storage\\Serializer\\Igbinary"));
- add_assoc_stringl_ex(return_value, SL("json"), SL("Phalcon\\Storage\\Serializer\\Json"));
- add_assoc_stringl_ex(return_value, SL("memcached_igbinary"), SL("Phalcon\\Storage\\Serializer\\MemcachedIgbinary"));
- add_assoc_stringl_ex(return_value, SL("memcached_json"), SL("Phalcon\\Storage\\Serializer\\MemcachedJson"));
- add_assoc_stringl_ex(return_value, SL("memcached_php"), SL("Phalcon\\Storage\\Serializer\\MemcachedPhp"));
- add_assoc_stringl_ex(return_value, SL("msgpack"), SL("Phalcon\\Storage\\Serializer\\Msgpack"));
- add_assoc_stringl_ex(return_value, SL("none"), SL("Phalcon\\Storage\\Serializer\\None"));
- add_assoc_stringl_ex(return_value, SL("php"), SL("Phalcon\\Storage\\Serializer\\Php"));
- add_assoc_stringl_ex(return_value, SL("redis_igbinary"), SL("Phalcon\\Storage\\Serializer\\RedisIgbinary"));
- add_assoc_stringl_ex(return_value, SL("redis_json"), SL("Phalcon\\Storage\\Serializer\\RedisJson"));
- add_assoc_stringl_ex(return_value, SL("redis_msgpack"), SL("Phalcon\\Storage\\Serializer\\RedisMsgpack"));
- add_assoc_stringl_ex(return_value, SL("redis_none"), SL("Phalcon\\Storage\\Serializer\\RedisNone"));
- add_assoc_stringl_ex(return_value, SL("redis_php"), SL("Phalcon\\Storage\\Serializer\\RedisPhp"));
- return;
+ if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_0, &_1))) {
+ ZEPHIR_INIT_VAR(&_2$$3);
+ object_init_ex(&_2$$3, spl_ce_RuntimeException);
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZEPHIR_CONCAT_SVS(&_3$$3, "Syntax error in string '", &text, "'");
+ ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 0, &_3$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_2$$3, "phalcon/Support/Helper/Str/Dynamic.zep", 43);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_FUNCTION(&ldS, "preg_quote", NULL, 351, &leftDelimiter);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&rdS, "preg_quote", NULL, 351, &rightDelimiter);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_SVSVVSVS(&_4, "/", &ldS, "([^", &ldS, &rdS, "]+)", &rdS, "/");
+ zephir_get_strval(&pattern, &_4);
+ ZEPHIR_INIT_VAR(&matches);
+ array_init(&matches);
+ ZEPHIR_INIT_VAR(&_5);
+ zephir_preg_match(&_5, &pattern, &text, &matches, 1, 2 , 0 );
+ if (!(zephir_is_true(&_5))) {
+ RETURN_CTOR(&text);
+ }
+ if (Z_TYPE_P(&matches) == IS_ARRAY) {
+ zephir_is_iterable(&matches, 0, "phalcon/Support/Helper/Str/Dynamic.zep", 66);
+ if (Z_TYPE_P(&matches) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&matches), _6$$5)
+ {
+ ZEPHIR_INIT_NVAR(&match);
+ ZVAL_COPY(&match, _6$$5);
+ _8$$6 = !(zephir_array_isset_long(&match, 0));
+ if (!(_8$$6)) {
+ _8$$6 = !(zephir_array_isset_long(&match, 1));
+ }
+ if (_8$$6) {
+ continue;
+ }
+ zephir_array_fetch_long(&_9$$6, &match, 1, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 61);
+ ZEPHIR_INIT_NVAR(&words);
+ zephir_fast_explode(&words, &separator, &_9$$6, LONG_MAX);
+ ZEPHIR_OBS_NVAR(&word);
+ ZEPHIR_CALL_FUNCTION(&_10$$6, "array_rand", &_11, 202, &words);
+ zephir_check_call_status();
+ zephir_array_fetch(&word, &words, &_10$$6, PH_NOISY, "phalcon/Support/Helper/Str/Dynamic.zep", 62);
+ zephir_array_fetch_long(&_12$$6, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 63);
+ ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 351, &_12$$6, &separator);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_13$$6);
+ ZEPHIR_CONCAT_SVS(&_13$$6, "/", &sub, "/");
+ ZVAL_LONG(&_14$$6, 1);
+ ZEPHIR_CALL_FUNCTION(&_15$$6, "preg_replace", &_16, 41, &_13$$6, &word, &text, &_14$$6);
+ zephir_check_call_status();
+ zephir_get_strval(&text, &_15$$6);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &matches, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_7$$5, &matches, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_7$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&match, &matches, "current", NULL, 0);
+ zephir_check_call_status();
+ _17$$8 = !(zephir_array_isset_long(&match, 0));
+ if (!(_17$$8)) {
+ _17$$8 = !(zephir_array_isset_long(&match, 1));
+ }
+ if (_17$$8) {
+ continue;
+ }
+ zephir_array_fetch_long(&_18$$8, &match, 1, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 61);
+ ZEPHIR_INIT_NVAR(&words);
+ zephir_fast_explode(&words, &separator, &_18$$8, LONG_MAX);
+ ZEPHIR_OBS_NVAR(&word);
+ ZEPHIR_CALL_FUNCTION(&_19$$8, "array_rand", &_11, 202, &words);
+ zephir_check_call_status();
+ zephir_array_fetch(&word, &words, &_19$$8, PH_NOISY, "phalcon/Support/Helper/Str/Dynamic.zep", 62);
+ zephir_array_fetch_long(&_20$$8, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 63);
+ ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 351, &_20$$8, &separator);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_21$$8);
+ ZEPHIR_CONCAT_SVS(&_21$$8, "/", &sub, "/");
+ ZVAL_LONG(&_22$$8, 1);
+ ZEPHIR_CALL_FUNCTION(&_23$$8, "preg_replace", &_16, 41, &_21$$8, &word, &text, &_22$$8);
+ zephir_check_call_status();
+ zephir_get_strval(&text, &_23$$8);
+ ZEPHIR_CALL_METHOD(NULL, &matches, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&match);
+ }
+ RETURN_CTOR(&text);
}
@@ -145492,560 +142675,673 @@ static PHP_METHOD(Phalcon_Storage_SerializerFactory, getServices)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_AbstractAdapter)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_EndsWith)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Storage\\Adapter, AbstractAdapter, phalcon, storage_adapter_abstractadapter, phalcon_storage_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_null(phalcon_storage_adapter_abstractadapter_ce, SL("adapter"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_storage_adapter_abstractadapter_ce, SL("defaultSerializer"), "php", ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_storage_adapter_abstractadapter_ce, SL("lifetime"), 3600, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapter_abstractadapter_ce, SL("options"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_storage_adapter_abstractadapter_ce, SL("prefix"), "ph-memo-", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapter_abstractadapter_ce, SL("serializer"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapter_abstractadapter_ce, SL("serializerFactory"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_abstractadapter_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_AbstractAdapter;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, EndsWith, phalcon, support_helper_str_endswith, phalcon_support_helper_str_abstractstr_ce, phalcon_support_helper_str_endswith_method_entry, 0);
- zend_class_implements(phalcon_storage_adapter_abstractadapter_ce, 1, phalcon_storage_adapter_adapterinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, __construct)
+static PHP_METHOD(Phalcon_Support_Helper_Str_EndsWith, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _1, _2, _3, _4, _5, _6, _7$$3;
+ zend_bool ignoreCase;
+ zval *haystack_param = NULL, *needle_param = NULL, *ignoreCase_param = NULL, _0;
+ zval haystack, needle;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&haystack);
+ ZVAL_UNDEF(&needle);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(haystack)
+ Z_PARAM_STR(needle)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_BOOL(ignoreCase)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 2, 1, &haystack_param, &needle_param, &ignoreCase_param);
+ zephir_get_strval(&haystack, haystack_param);
+ zephir_get_strval(&needle, needle_param);
+ if (!ignoreCase_param) {
+ ignoreCase = 1;
} else {
- zephir_get_arrval(&options, options_param);
+ }
+ if (ignoreCase) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("serializerFactory"), factory);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "defaultSerializer");
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "php");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_3, "mb_strtolower", NULL, 10, &_0);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_3);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "lifetime");
- ZVAL_LONG(&_5, 3600);
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "getarrval", NULL, 0, &options, &_1, &_5);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("lifetime"), &_4);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "serializer");
- ZVAL_NULL(&_5);
- ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 0, &options, &_1, &_5);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "toendswith", NULL, 0, &haystack, &needle, &_0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("serializer"), &_6);
- if (zephir_array_isset_string(&options, SL("prefix"))) {
- zephir_array_fetch_string(&_7$$3, &options, SL("prefix"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/AbstractAdapter.zep", 99);
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_7$$3);
- }
- zephir_array_unset_string(&options, SL("defaultSerializer"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("lifetime"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("serializer"), PH_SEPARATE);
- zephir_array_unset_string(&options, SL("prefix"), PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, clear)
-{
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, decrement)
-{
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, delete)
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_FirstBetween)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, FirstBetween, phalcon, support_helper_str_firstbetween, phalcon_support_helper_str_firstbetween_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, get)
+static PHP_METHOD(Phalcon_Support_Helper_Str_FirstBetween, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, _0;
- zval key;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, *start_param = NULL, *end_param = NULL, __$true, result, _0, _1;
+ zval text, start, end, _2;
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&start);
+ ZVAL_UNDEF(&end);
+ ZVAL_UNDEF(&_2);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR(text)
+ Z_PARAM_STR(start)
+ Z_PARAM_STR(end)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &defaultValue);
- zephir_get_strval(&key, key_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
+ zephir_fetch_params(1, 3, 0, &text_param, &start_param, &end_param);
+ zephir_get_strval(&text, text_param);
+ zephir_get_strval(&start, start_param);
+ zephir_get_strval(&end, end_param);
+ ZEPHIR_CALL_FUNCTION(&result, "mb_strstr", NULL, 0, &text, &start);
zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ ZEPHIR_INIT_VAR(&_0);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&result)) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "");
+ } else {
+ ZEPHIR_CPY_WRT(&_0, &result);
}
- ZEPHIR_CALL_METHOD(&content, this_ptr, "doget", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue);
+ ZEPHIR_CPY_WRT(&result, &_0);
+ ZEPHIR_CALL_FUNCTION(&_1, "mb_strstr", NULL, 0, &result, &end, &__$true);
zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&result, &_1);
+ ZEPHIR_INIT_NVAR(&_0);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&result)) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "");
+ } else {
+ ZEPHIR_CPY_WRT(&_0, &result);
+ }
+ ZEPHIR_CPY_WRT(&result, &_0);
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_CONCAT_VV(&_2, &start, &end);
+ zephir_fast_trim(return_value, &result, &_2, ZEPHIR_TRIM_BOTH);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getAdapter)
-{
- RETURN_MEMBER(getThis(), "adapter");
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getDefaultSerializer)
-{
- RETURN_MEMBER(getThis(), "defaultSerializer");
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getKeys)
-{
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefix)
-{
- RETURN_MEMBER(getThis(), "prefix");
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, has)
-{
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, increment)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Friendly)
{
-}
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, Friendly, phalcon, support_helper_str_friendly, phalcon_support_helper_str_abstractstr_ce, phalcon_support_helper_str_friendly_method_entry, 0);
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, set)
-{
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer)
+static PHP_METHOD(Phalcon_Support_Helper_Str_Friendly, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *serializer_param = NULL, _0;
- zval serializer;
+ zend_bool lowercase;
+ zval *text_param = NULL, *separator_param = NULL, *lowercase_param = NULL, *replace = NULL, replace_sub, __$null, friendly, matrix, _1, _2, _3, _4, _5, _7, _0$$3, _6$$5;
+ zval text, separator;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&serializer);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(serializer)
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&replace_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&friendly);
+ ZVAL_UNDEF(&matrix);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_6$$5);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(separator)
+ Z_PARAM_BOOL(lowercase)
+ Z_PARAM_ZVAL_OR_NULL(replace)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &serializer_param);
- zephir_get_strval(&serializer, serializer_param);
- ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, &serializer);
+ zephir_fetch_params(1, 1, 3, &text_param, &separator_param, &lowercase_param, &replace);
+ if (UNEXPECTED(Z_TYPE_P(text_param) != IS_STRING && Z_TYPE_P(text_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(text_param) == IS_STRING)) {
+ zephir_get_strval(&text, text_param);
+ } else {
+ ZEPHIR_INIT_VAR(&text);
+ }
+ if (!separator_param) {
+ ZEPHIR_INIT_VAR(&separator);
+ ZVAL_STRING(&separator, "-");
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(separator_param) != IS_STRING && Z_TYPE_P(separator_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'separator' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(separator_param) == IS_STRING)) {
+ zephir_get_strval(&separator, separator_param);
+ } else {
+ ZEPHIR_INIT_VAR(&separator);
+ }
+ }
+ if (!lowercase_param) {
+ lowercase = 1;
+ } else {
+ }
+ if (!replace) {
+ replace = &replace_sub;
+ ZEPHIR_CPY_WRT(replace, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(replace);
+ }
+ if (zephir_is_true(replace)) {
+ ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "checkreplace", NULL, 0, replace);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(replace, &_0$$3);
+ } else {
+ ZEPHIR_INIT_NVAR(replace);
+ array_init(replace);
+ }
+ ZEPHIR_CALL_METHOD(&matrix, this_ptr, "getmatrix", NULL, 0, replace);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_0);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_INIT_VAR(&_2);
+ zephir_array_keys(&_2, &matrix);
+ ZEPHIR_CALL_FUNCTION(&_3, "array_values", NULL, 14, &matrix);
+ zephir_check_call_status();
+ zephir_fast_str_replace(&_1, &_2, &_3, &text);
+ zephir_get_strval(&text, &_1);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "/[^a-zA-Z0-9\\/_|+ -]/");
+ ZEPHIR_INIT_VAR(&_5);
+ ZVAL_STRING(&_5, "");
+ ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 41, &_4, &_5, &text);
+ zephir_check_call_status();
+ if (lowercase) {
+ ZEPHIR_INIT_VAR(&_6$$5);
+ zephir_fast_strtolower(&_6$$5, &friendly);
+ ZEPHIR_CPY_WRT(&friendly, &_6$$5);
+ }
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_STRING(&_4, "/[\\/_|+ -]+/");
+ ZEPHIR_CALL_FUNCTION(&_7, "preg_replace", NULL, 41, &_4, &separator, &friendly);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&friendly, &_7);
+ zephir_fast_trim(return_value, &friendly, &separator, ZEPHIR_TRIM_BOTH);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, doGet)
+static PHP_METHOD(Phalcon_Support_Helper_Str_Friendly, checkReplace)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0;
- zval key;
- zval *this_ptr = getThis();
+ zval *replace = NULL, replace_sub, _1$$4;
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&replace_sub);
+ ZVAL_UNDEF(&_1$$4);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_ZVAL(replace)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &key);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 0, &replace);
+ ZEPHIR_SEPARATE_PARAM(replace);
+ _0 = Z_TYPE_P(replace) != IS_ARRAY;
+ if (_0) {
+ _0 = Z_TYPE_P(replace) != IS_STRING;
+ }
+ if (_0) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_support_helper_exception_ce, "Parameter replace must be an array or a string", "phalcon/Support/Helper/Str/Friendly.zep", 74);
+ return;
+ }
+ if (Z_TYPE_P(replace) == IS_STRING) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_create_array(&_1$$4, 1, 0);
+ zephir_array_fast_append(&_1$$4, replace);
+ ZEPHIR_CPY_WRT(replace, &_1$$4);
+ }
+ RETVAL_ZVAL(replace, 1, 0);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys)
+static PHP_METHOD(Phalcon_Support_Helper_Str_Friendly, getMatrix)
{
- zval results;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval prefix;
- zval *keys = NULL, keys_sub, *prefix_param = NULL, key, pattern, _0, _1, *_2, _3;
- zval *this_ptr = getThis();
+ zval *replace_param = NULL, item, *_0, _1, _2$$3, _3$$4;
+ zval replace, matrix;
- ZVAL_UNDEF(&keys_sub);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&replace);
+ ZVAL_UNDEF(&matrix);
+ ZVAL_UNDEF(&item);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&results);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(keys)
- Z_PARAM_STR(prefix)
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(replace)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &keys, &prefix_param);
- ZEPHIR_SEPARATE_PARAM(keys);
- if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
- } else {
- ZEPHIR_INIT_VAR(&prefix);
- }
- ZEPHIR_INIT_VAR(&results);
- array_init(&results);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&pattern);
- ZEPHIR_CONCAT_VV(&pattern, &_0, &prefix);
- ZEPHIR_INIT_VAR(&_1);
- if (!(zephir_is_true(keys))) {
- ZEPHIR_INIT_NVAR(&_1);
- array_init(&_1);
- } else {
- ZEPHIR_CPY_WRT(&_1, keys);
- }
- ZEPHIR_CPY_WRT(keys, &_1);
- zephir_is_iterable(keys, 0, "phalcon/Storage/Adapter/AbstractAdapter.zep", 267);
- if (Z_TYPE_P(keys) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _2)
+ zephir_fetch_params(1, 1, 0, &replace_param);
+ zephir_get_arrval(&replace, replace_param);
+ ZEPHIR_INIT_VAR(&matrix);
+ zephir_create_array(&matrix, 79, 0);
+ add_assoc_stringl_ex(&matrix, SL("Š"), SL("S"));
+ add_assoc_stringl_ex(&matrix, SL("š"), SL("s"));
+ add_assoc_stringl_ex(&matrix, SL("Đ"), SL("Dj"));
+ add_assoc_stringl_ex(&matrix, SL("Ð"), SL("Dj"));
+ add_assoc_stringl_ex(&matrix, SL("đ"), SL("dj"));
+ add_assoc_stringl_ex(&matrix, SL("Ž"), SL("Z"));
+ add_assoc_stringl_ex(&matrix, SL("ž"), SL("z"));
+ add_assoc_stringl_ex(&matrix, SL("Č"), SL("C"));
+ add_assoc_stringl_ex(&matrix, SL("č"), SL("c"));
+ add_assoc_stringl_ex(&matrix, SL("Ć"), SL("C"));
+ add_assoc_stringl_ex(&matrix, SL("ć"), SL("c"));
+ add_assoc_stringl_ex(&matrix, SL("À"), SL("A"));
+ add_assoc_stringl_ex(&matrix, SL("Á"), SL("A"));
+ add_assoc_stringl_ex(&matrix, SL("Â"), SL("A"));
+ add_assoc_stringl_ex(&matrix, SL("Ã"), SL("A"));
+ add_assoc_stringl_ex(&matrix, SL("Ä"), SL("A"));
+ add_assoc_stringl_ex(&matrix, SL("Å"), SL("A"));
+ add_assoc_stringl_ex(&matrix, SL("Æ"), SL("A"));
+ add_assoc_stringl_ex(&matrix, SL("Ç"), SL("C"));
+ add_assoc_stringl_ex(&matrix, SL("È"), SL("E"));
+ add_assoc_stringl_ex(&matrix, SL("É"), SL("E"));
+ add_assoc_stringl_ex(&matrix, SL("Ê"), SL("E"));
+ add_assoc_stringl_ex(&matrix, SL("Ë"), SL("E"));
+ add_assoc_stringl_ex(&matrix, SL("Ì"), SL("I"));
+ add_assoc_stringl_ex(&matrix, SL("Í"), SL("I"));
+ add_assoc_stringl_ex(&matrix, SL("Î"), SL("I"));
+ add_assoc_stringl_ex(&matrix, SL("Ï"), SL("I"));
+ add_assoc_stringl_ex(&matrix, SL("Ñ"), SL("N"));
+ add_assoc_stringl_ex(&matrix, SL("Ò"), SL("O"));
+ add_assoc_stringl_ex(&matrix, SL("Ó"), SL("O"));
+ add_assoc_stringl_ex(&matrix, SL("Ô"), SL("O"));
+ add_assoc_stringl_ex(&matrix, SL("Õ"), SL("O"));
+ add_assoc_stringl_ex(&matrix, SL("Ö"), SL("O"));
+ add_assoc_stringl_ex(&matrix, SL("Ø"), SL("O"));
+ add_assoc_stringl_ex(&matrix, SL("Ù"), SL("U"));
+ add_assoc_stringl_ex(&matrix, SL("Ú"), SL("U"));
+ add_assoc_stringl_ex(&matrix, SL("Û"), SL("U"));
+ add_assoc_stringl_ex(&matrix, SL("Ü"), SL("U"));
+ add_assoc_stringl_ex(&matrix, SL("Ý"), SL("Y"));
+ add_assoc_stringl_ex(&matrix, SL("Þ"), SL("B"));
+ add_assoc_stringl_ex(&matrix, SL("ß"), SL("Ss"));
+ add_assoc_stringl_ex(&matrix, SL("à"), SL("a"));
+ add_assoc_stringl_ex(&matrix, SL("á"), SL("a"));
+ add_assoc_stringl_ex(&matrix, SL("â"), SL("a"));
+ add_assoc_stringl_ex(&matrix, SL("ã"), SL("a"));
+ add_assoc_stringl_ex(&matrix, SL("ä"), SL("a"));
+ add_assoc_stringl_ex(&matrix, SL("å"), SL("a"));
+ add_assoc_stringl_ex(&matrix, SL("æ"), SL("a"));
+ add_assoc_stringl_ex(&matrix, SL("ç"), SL("c"));
+ add_assoc_stringl_ex(&matrix, SL("è"), SL("e"));
+ add_assoc_stringl_ex(&matrix, SL("é"), SL("e"));
+ add_assoc_stringl_ex(&matrix, SL("ê"), SL("e"));
+ add_assoc_stringl_ex(&matrix, SL("ë"), SL("e"));
+ add_assoc_stringl_ex(&matrix, SL("ì"), SL("i"));
+ add_assoc_stringl_ex(&matrix, SL("í"), SL("i"));
+ add_assoc_stringl_ex(&matrix, SL("î"), SL("i"));
+ add_assoc_stringl_ex(&matrix, SL("ï"), SL("i"));
+ add_assoc_stringl_ex(&matrix, SL("ð"), SL("o"));
+ add_assoc_stringl_ex(&matrix, SL("ñ"), SL("n"));
+ add_assoc_stringl_ex(&matrix, SL("ò"), SL("o"));
+ add_assoc_stringl_ex(&matrix, SL("ó"), SL("o"));
+ add_assoc_stringl_ex(&matrix, SL("ô"), SL("o"));
+ add_assoc_stringl_ex(&matrix, SL("õ"), SL("o"));
+ add_assoc_stringl_ex(&matrix, SL("ö"), SL("o"));
+ add_assoc_stringl_ex(&matrix, SL("ø"), SL("o"));
+ add_assoc_stringl_ex(&matrix, SL("ù"), SL("u"));
+ add_assoc_stringl_ex(&matrix, SL("ú"), SL("u"));
+ add_assoc_stringl_ex(&matrix, SL("û"), SL("u"));
+ add_assoc_stringl_ex(&matrix, SL("ý"), SL("y"));
+ add_assoc_stringl_ex(&matrix, SL("þ"), SL("b"));
+ add_assoc_stringl_ex(&matrix, SL("ÿ"), SL("y"));
+ add_assoc_stringl_ex(&matrix, SL("Ŕ"), SL("R"));
+ add_assoc_stringl_ex(&matrix, SL("ŕ"), SL("r"));
+ add_assoc_stringl_ex(&matrix, SL("ē"), SL("e"));
+ add_assoc_stringl_ex(&matrix, SL("'"), SL(""));
+ add_assoc_stringl_ex(&matrix, SL("&"), SL(" and "));
+ add_assoc_stringl_ex(&matrix, SL("\r\n"), SL(" "));
+ add_assoc_stringl_ex(&matrix, SL("\n"), SL(" "));
+ zephir_is_iterable(&replace, 0, "phalcon/Support/Helper/Str/Friendly.zep", 122);
+ if (Z_TYPE_P(&replace) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&replace), _0)
{
- ZEPHIR_INIT_NVAR(&key);
- ZVAL_COPY(&key, _2);
- if (zephir_start_with(&key, &pattern, NULL)) {
- zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 263);
- }
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _0);
+ ZEPHIR_INIT_NVAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, " ");
+ zephir_array_update_zval(&matrix, &item, &_2$$3, PH_COPY | PH_SEPARATE);
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &replace, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_3, keys, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_1, &replace, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_3)) {
+ if (!zend_is_true(&_1)) {
break;
}
- ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&item, &replace, "current", NULL, 0);
zephir_check_call_status();
- if (zephir_start_with(&key, &pattern, NULL)) {
- zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 263);
- }
- ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0);
+ ZEPHIR_INIT_NVAR(&_3$$4);
+ ZVAL_STRING(&_3$$4, " ");
+ zephir_array_update_zval(&matrix, &item, &_3$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &replace, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&key);
- RETURN_CTOR(&results);
+ ZEPHIR_INIT_NVAR(&item);
+ RETURN_CTOR(&matrix);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefixedKey)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Humanize)
{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key = NULL, key_sub, _1;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Humanize, phalcon, support_helper_str_humanize, phalcon_support_helper_str_humanize_method_entry, 0);
- ZVAL_UNDEF(&key_sub);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(key)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key);
- ZEPHIR_SEPARATE_PARAM(key);
- zephir_cast_to_string(&_0, key);
- ZEPHIR_CPY_WRT(key, &_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CONCAT_VV(return_value, &_1, key);
- RETURN_MM();
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData)
+static PHP_METHOD(Phalcon_Support_Helper_Str_Humanize, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *content = NULL, content_sub, _0, _1$$3, _2$$3;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, result, _0, _1, _2;
+ zval text;
- ZVAL_UNDEF(&content_sub);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(content)
+ Z_PARAM_STR(text)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &content);
- ZEPHIR_SEPARATE_PARAM(content);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) != IS_NULL) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "setdata", NULL, 0, content);
- zephir_check_call_status();
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(content, &_2$$3, "serialize", NULL, 0);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 0, &text_param);
+ zephir_get_strval(&text, text_param);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_trim(&_0, &text, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "#[_-]+#");
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, " ");
+ ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 41, &_1, &_2, &_0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ if (Z_TYPE_P(&result) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "");
+ } else {
+ ZEPHIR_CPY_WRT(&_1, &result);
}
- RETVAL_ZVAL(content, 1, 0);
- RETURN_MM();
+ RETURN_CCTOR(&_1);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getTtl)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Includes)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Includes, phalcon, support_helper_str_includes, phalcon_support_helper_str_includes_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Includes, __invoke)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *ttl, ttl_sub, dateTime, _1$$4, _2$$4;
+ zval *haystack_param = NULL, *needle_param = NULL, _0;
+ zval haystack, needle;
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_UNDEF(&dateTime);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(ttl)
+ ZVAL_UNDEF(&haystack);
+ ZVAL_UNDEF(&needle);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(haystack)
+ Z_PARAM_STR(needle)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &ttl);
- if (Z_TYPE_P(ttl) == IS_NULL) {
- RETURN_MM_MEMBER(getThis(), "lifetime");
- }
- _0 = Z_TYPE_P(ttl) == IS_OBJECT;
- if (_0) {
- _0 = zephir_is_instance_of(ttl, SL("DateInterval"));
- }
- if (_0) {
- ZEPHIR_INIT_VAR(&dateTime);
- object_init_ex(&dateTime, php_date_get_date_ce());
- ZEPHIR_INIT_VAR(&_1$$4);
- ZVAL_STRING(&_1$$4, "@0");
- ZEPHIR_CALL_METHOD(NULL, &dateTime, "__construct", NULL, 0, &_1$$4);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2$$4, &dateTime, "add", NULL, 0, ttl);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_2$$4, "gettimestamp", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
- }
- RETURN_MM_LONG(zephir_get_intval(ttl));
+ zephir_fetch_params(1, 2, 0, &haystack_param, &needle_param);
+ zephir_get_strval(&haystack, haystack_param);
+ zephir_get_strval(&needle, needle_param);
+ ZEPHIR_CALL_FUNCTION(&_0, "mb_strpos", NULL, 86, &haystack, &needle);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_0));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getUnserializedData)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Increment)
{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Increment, phalcon, support_helper_str_increment, phalcon_support_helper_str_increment_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Increment, __invoke)
+{
+ zend_long number = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *content = NULL, content_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1$$3, _2$$3, _3$$3, _4$$3;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, *separator_param = NULL, parts, _1, _2, _0$$3;
+ zval text, separator;
- ZVAL_UNDEF(&content_sub);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- bool is_null_true = 1;
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&separator);
+ ZVAL_UNDEF(&parts);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_0$$3);
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ZVAL(content)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_STR(separator)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &content, &defaultValue);
- ZEPHIR_SEPARATE_PARAM(content);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) != IS_NULL) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "unserialize", NULL, 0, content);
- zephir_check_call_status();
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "issuccess", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(content, &_4$$3, "getdata", NULL, 0);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 1, &text_param, &separator_param);
+ zephir_get_strval(&text, text_param);
+ if (!separator_param) {
+ ZEPHIR_INIT_VAR(&separator);
+ ZVAL_STRING(&separator, "_");
+ } else {
+ zephir_get_strval(&separator, separator_param);
}
- RETVAL_ZVAL(content, 1, 0);
+ ZEPHIR_INIT_VAR(&parts);
+ zephir_fast_explode(&parts, &separator, &text, LONG_MAX);
+ number = 1;
+ if (1 == zephir_array_isset_long(&parts, 1)) {
+ zephir_memory_observe(&_0$$3);
+ zephir_array_fetch_long(&_0$$3, &parts, 1, PH_NOISY, "phalcon/Support/Helper/Str/Increment.zep", 35);
+ number = (zephir_get_intval(&_0$$3) + 1);
+ }
+ zephir_array_fetch_long(&_1, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Increment.zep", 38);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_LONG(&_2, number);
+ ZEPHIR_CONCAT_VVV(return_value, &_1, &separator, &_2);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, initSerializer)
-{
- zend_bool _1;
- zval className, _0, _2, _3$$3, _4$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&className);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_memory_observe(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC);
- _1 = 1 != ZEPHIR_IS_EMPTY(&_0);
- if (_1) {
- zephir_memory_observe(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC);
- _1 = Z_TYPE_P(&_2) != IS_OBJECT;
- }
- if (_1) {
- zephir_memory_observe(&className);
- zephir_read_property(&className, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC);
- zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("serializerFactory"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_4$$3, &_3$$3, "newinstance", NULL, 0, &className);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("serializer"), &_4$$3);
- }
- ZEPHIR_MM_RESTORE();
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Interpolate)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Interpolate, phalcon, support_helper_str_interpolate, phalcon_support_helper_str_interpolate_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getArrVal)
+static PHP_METHOD(Phalcon_Support_Helper_Str_Interpolate, __invoke)
{
+ zend_string *_3$$3;
+ zend_ulong _2$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval cast;
- zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, *cast_param = NULL, __$null, value;
- zval collection;
+ zval context, replace;
+ zval *message_param = NULL, *context_param = NULL, *leftToken_param = NULL, *rightToken_param = NULL, key, value, *_0$$3, _1$$3, _4$$4, _5$$5;
+ zval message, leftToken, rightToken;
- ZVAL_UNDEF(&collection);
- ZVAL_UNDEF(&index_sub);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&leftToken);
+ ZVAL_UNDEF(&rightToken);
+ ZVAL_UNDEF(&key);
ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&cast);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 4)
- Z_PARAM_ARRAY(collection)
- Z_PARAM_ZVAL(index)
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&context);
+ ZVAL_UNDEF(&replace);
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR(message)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- Z_PARAM_STR_OR_NULL(cast)
+ Z_PARAM_ARRAY(context)
+ Z_PARAM_STR(leftToken)
+ Z_PARAM_STR(rightToken)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 2, &collection_param, &index, &defaultValue, &cast_param);
- ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- if (!cast_param) {
- ZEPHIR_INIT_VAR(&cast);
+ zephir_fetch_params(1, 1, 3, &message_param, &context_param, &leftToken_param, &rightToken_param);
+ zephir_get_strval(&message, message_param);
+ if (!context_param) {
+ ZEPHIR_INIT_VAR(&context);
+ array_init(&context);
} else {
- if (UNEXPECTED(Z_TYPE_P(cast_param) != IS_STRING && Z_TYPE_P(cast_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cast' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_get_arrval(&context, context_param);
}
- if (EXPECTED(Z_TYPE_P(cast_param) == IS_STRING)) {
- zephir_get_strval(&cast, cast_param);
+ if (!leftToken_param) {
+ ZEPHIR_INIT_VAR(&leftToken);
+ ZVAL_STRING(&leftToken, "%");
} else {
- ZEPHIR_INIT_VAR(&cast);
- }
- }
- zephir_memory_observe(&value);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ zephir_get_strval(&leftToken, leftToken_param);
}
- if (UNEXPECTED(zephir_is_true(&cast))) {
- ZEPHIR_MAKE_REF(&value);
- ZEPHIR_CALL_FUNCTION(NULL, "settype", NULL, 11, &value, &cast);
- ZEPHIR_UNREF(&value);
- zephir_check_call_status();
+ if (!rightToken_param) {
+ ZEPHIR_INIT_VAR(&rightToken);
+ ZVAL_STRING(&rightToken, "%");
+ } else {
+ zephir_get_strval(&rightToken, rightToken_param);
}
- RETURN_CCTOR(&value);
-}
-
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_AbstractAdapter(zend_class_entry *class_type)
-{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
+ if (!(ZEPHIR_IS_EMPTY(&context))) {
+ ZEPHIR_INIT_VAR(&replace);
+ array_init(&replace);
+ zephir_is_iterable(&context, 0, "phalcon/Support/Helper/Str/Interpolate.zep", 41);
+ if (Z_TYPE_P(&context) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&context), _2$$3, _3$$3, _0$$3)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_3$$3 != NULL) {
+ ZVAL_STR_COPY(&key, _3$$3);
+ } else {
+ ZVAL_LONG(&key, _2$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0$$3);
+ ZEPHIR_INIT_NVAR(&_4$$4);
+ ZEPHIR_CONCAT_VVV(&_4$$4, &leftToken, &key, &rightToken);
+ zephir_array_update_zval(&replace, &_4$$4, &value, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &context, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, &context, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, &context, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &context, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_5$$5);
+ ZEPHIR_CONCAT_VVV(&_5$$5, &leftToken, &key, &rightToken);
+ zephir_array_update_zval(&replace, &_5$$5, &value, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &context, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 5, &message, &replace);
+ zephir_check_call_status();
+ RETURN_MM();
}
+ RETURN_CTOR(&message);
}
@@ -146058,24 +143354,43 @@ zend_object *zephir_init_properties_Phalcon_Storage_Adapter_AbstractAdapter(zend
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_AdapterInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_IsAnagram)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Storage\\Adapter, AdapterInterface, phalcon, storage_adapter_adapterinterface, phalcon_storage_adapter_adapterinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, IsAnagram, phalcon, support_helper_str_isanagram, phalcon_support_helper_str_isanagram_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, clear);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, decrement);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, delete);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, getAdapter);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, getKeys);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, getPrefix);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, increment);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, set);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, setForever);
+static PHP_METHOD(Phalcon_Support_Helper_Str_IsAnagram, __invoke)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *first_param = NULL, *second_param = NULL, _0, _1, _2;
+ zval first, second;
+
+ ZVAL_UNDEF(&first);
+ ZVAL_UNDEF(&second);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(first)
+ Z_PARAM_STR(second)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &first_param, &second_param);
+ zephir_get_strval(&first, first_param);
+ zephir_get_strval(&second, second_param);
+ ZVAL_LONG(&_0, 1);
+ ZEPHIR_CALL_FUNCTION(&_1, "count_chars", NULL, 0, &first, &_0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_0, 1);
+ ZEPHIR_CALL_FUNCTION(&_2, "count_chars", NULL, 0, &second, &_0);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&_1, &_2));
+}
+
@@ -146086,599 +143401,865 @@ ZEPHIR_DOC_METHOD(Phalcon_Storage_Adapter_AdapterInterface, setForever);
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Apcu)
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_IsLower)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Apcu, phalcon, storage_adapter_apcu, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_apcu_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, IsLower, phalcon, support_helper_str_islower, phalcon_support_helper_str_abstractstr_ce, phalcon_support_helper_str_islower_method_entry, 0);
- zend_declare_property_string(phalcon_storage_adapter_apcu_ce, SL("prefix"), "ph-apcu-", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, __construct)
+static PHP_METHOD(Phalcon_Support_Helper_Str_IsLower, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL;
+ zval *text_param = NULL, *encoding_param = NULL, _0;
+ zval text, encoding;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR(encoding)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ zephir_get_strval(&text, text_param);
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_get_strval(&encoding, encoding_param);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_apcu_ce, getThis(), "__construct", NULL, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "tolower", NULL, 0, &text, &encoding);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&text, &_0));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_IsPalindrome)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, IsPalindrome, phalcon, support_helper_str_ispalindrome, phalcon_support_helper_str_ispalindrome_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_IsPalindrome, __invoke)
{
- zend_object_iterator *_1;
- zend_bool result = 0;
- zval item, pattern, apc, _0, _2$$4, _3$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, _0;
+ zval text;
- ZVAL_UNDEF(&item);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&apc);
+ ZVAL_UNDEF(&text);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$4);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(text)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&apc);
- ZVAL_NULL(&apc);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&pattern);
- ZEPHIR_CONCAT_SVS(&pattern, "/^", &_0, "/");
- ZEPHIR_CALL_METHOD(&apc, this_ptr, "phpapcuiterator", NULL, 0, &pattern);
+ zephir_fetch_params(1, 1, 0, &text_param);
+ zephir_get_strval(&text, text_param);
+ ZEPHIR_CALL_FUNCTION(&_0, "strrev", NULL, 0, &text);
zephir_check_call_status();
- result = 1;
- if (Z_TYPE_P(&apc) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
- }
- _1 = zephir_get_iterator(&apc);
- _1->funcs->rewind(_1);
- for (;_1->funcs->valid(_1) == SUCCESS && !EG(exception); _1->funcs->move_forward(_1)) {
- {
- ZEPHIR_ITERATOR_COPY(&item, _1);
- }
- zephir_array_fetch_string(&_3$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 63);
- ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "phpapcudelete", &_4, 0, &_3$$4);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_2$$4)) {
- result = 0;
- }
- }
- zend_iterator_dtor(_1);
- RETURN_MM_BOOL(result);
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&_0, &text));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, decrement)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_IsUpper)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, IsUpper, phalcon, support_helper_str_isupper, phalcon_support_helper_str_abstractstr_ce, phalcon_support_helper_str_isupper_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_IsUpper, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value_param = NULL, _0, _1;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *encoding_param = NULL, _0;
+ zval text, encoding;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ Z_PARAM_STR(encoding)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ zephir_get_strval(&text, text_param);
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_strval(&encoding, encoding_param);
}
- if (!value_param) {
- value = 1;
- } else {
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcudec", NULL, 0, &_0, &_1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "toupper", NULL, 0, &text, &encoding);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_MM_BOOL(ZEPHIR_IS_IDENTICAL(&text, &_0));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_KebabCase)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, KebabCase, phalcon, support_helper_str_kebabcase, phalcon_support_helper_str_pascalcase_ce, phalcon_support_helper_str_kebabcase_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_KebabCase, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1;
- zval key;
+ zval *text_param = NULL, *delimiters_param = NULL, output;
+ zval text, delimiters;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&delimiters);
+ ZVAL_UNDEF(&output);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(delimiters)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 1, &text_param, &delimiters_param);
+ zephir_get_strval(&text, text_param);
+ if (!delimiters_param) {
+ ZEPHIR_INIT_VAR(&delimiters);
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_strval(&delimiters, delimiters_param);
}
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpapcudelete", NULL, 0, &_1);
+ ZEPHIR_CALL_METHOD(&output, this_ptr, "processarray", NULL, 0, &text, &delimiters);
zephir_check_call_status();
- RETURN_MM_BOOL(zephir_get_boolval(&_0));
+ zephir_fast_join_str(return_value, SL("-"), &output);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Len)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Len, phalcon, support_helper_str_len, phalcon_support_helper_str_len_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Len, __invoke)
{
- zend_object_iterator *_1;
- zval results;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, item, pattern, apc, _0, _2$$4;
- zval prefix;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, *encoding_param = NULL;
+ zval text, encoding;
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&item);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&apc);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&results);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ Z_PARAM_STR(encoding)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &prefix_param);
- if (!prefix_param) {
- ZEPHIR_INIT_VAR(&prefix);
- ZVAL_STRING(&prefix, "");
- } else {
- if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ zephir_get_strval(&text, text_param);
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
} else {
- ZEPHIR_INIT_VAR(&prefix);
- }
+ zephir_get_strval(&encoding, encoding_param);
}
- ZEPHIR_INIT_VAR(&apc);
- ZVAL_NULL(&apc);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&pattern);
- ZEPHIR_CONCAT_SVVS(&pattern, "/^", &_0, &prefix, "/");
- ZEPHIR_CALL_METHOD(&apc, this_ptr, "phpapcuiterator", NULL, 0, &pattern);
+ ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 234, &text, &encoding);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&results);
- array_init(&results);
- if (Z_TYPE_P(&apc) != IS_OBJECT) {
- RETURN_CTOR(&results);
- }
- _1 = zephir_get_iterator(&apc);
- _1->funcs->rewind(_1);
- for (;_1->funcs->valid(_1) == SUCCESS && !EG(exception); _1->funcs->move_forward(_1)) {
- {
- ZEPHIR_ITERATOR_COPY(&item, _1);
- }
- zephir_array_fetch_string(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 117);
- zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Storage/Adapter/Apcu.zep", 117);
- }
- zend_iterator_dtor(_1);
- RETURN_CTOR(&results);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, has)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Lower)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Helper\\Str, Lower, phalcon, support_helper_str_lower, phalcon_support_helper_str_abstractstr_ce, phalcon_support_helper_str_lower_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Lower, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, result, _0, _1;
- zval key;
+ zval *text_param = NULL, *encoding_param = NULL;
+ zval text, encoding;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&encoding);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(encoding)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 1, &text_param, &encoding_param);
+ zephir_get_strval(&text, text_param);
+ if (!encoding_param) {
+ ZEPHIR_INIT_VAR(&encoding);
+ ZVAL_STRING(&encoding, "UTF-8");
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_strval(&encoding, encoding_param);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcuexists", NULL, 0, &_0);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "tolower", NULL, 0, &text, &encoding);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) {
- ZEPHIR_CPY_WRT(&_1, &result);
- } else {
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_BOOL(&_1, 0);
- }
- RETURN_CCTOR(&_1);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, increment)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_PascalCase)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, PascalCase, phalcon, support_helper_str_pascalcase, phalcon_support_helper_str_pascalcase_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_PascalCase, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value_param = NULL, _0, _1;
- zval key;
+ zephir_fcall_cache_entry *_4 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *delimiters_param = NULL, exploded, output, element, *_0, _1, _2$$3, _3$$3, _5$$3, _6$$4, _7$$4, _8$$4;
+ zval text, delimiters;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&delimiters);
+ ZVAL_UNDEF(&exploded);
+ ZVAL_UNDEF(&output);
+ ZVAL_UNDEF(&element);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ Z_PARAM_STR_OR_NULL(delimiters)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 1, &text_param, &delimiters_param);
+ zephir_get_strval(&text, text_param);
+ if (!delimiters_param) {
+ ZEPHIR_INIT_VAR(&delimiters);
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_strval(&delimiters, delimiters_param);
}
- if (!value_param) {
- value = 1;
+ ZEPHIR_CALL_METHOD(&exploded, this_ptr, "processarray", NULL, 0, &text, &delimiters);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&output);
+ ZVAL_STRING(&output, "");
+ zephir_is_iterable(&exploded, 0, "phalcon/Support/Helper/Str/PascalCase.zep", 37);
+ if (Z_TYPE_P(&exploded) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&exploded), _0)
+ {
+ ZEPHIR_INIT_NVAR(&element);
+ ZVAL_COPY(&element, _0);
+ ZEPHIR_INIT_NVAR(&_2$$3);
+ ZEPHIR_CALL_FUNCTION(&_3$$3, "mb_strtolower", &_4, 10, &element);
+ zephir_check_call_status();
+ zephir_ucfirst(&_2$$3, &_3$$3);
+ ZEPHIR_INIT_NVAR(&_5$$3);
+ ZEPHIR_CONCAT_VV(&_5$$3, &output, &_2$$3);
+ ZEPHIR_CPY_WRT(&output, &_5$$3);
+ } ZEND_HASH_FOREACH_END();
} else {
+ ZEPHIR_CALL_METHOD(NULL, &exploded, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &exploded, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&element, &exploded, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_6$$4);
+ ZEPHIR_CALL_FUNCTION(&_7$$4, "mb_strtolower", &_4, 10, &element);
+ zephir_check_call_status();
+ zephir_ucfirst(&_6$$4, &_7$$4);
+ ZEPHIR_INIT_NVAR(&_8$$4);
+ ZEPHIR_CONCAT_VV(&_8$$4, &output, &_6$$4);
+ ZEPHIR_CPY_WRT(&output, &_8$$4);
+ ZEPHIR_CALL_METHOD(NULL, &exploded, "next", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcuinc", NULL, 0, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ }
+ ZEPHIR_INIT_NVAR(&element);
+ RETURN_CCTOR(&output);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, set)
+static PHP_METHOD(Phalcon_Support_Helper_Str_PascalCase, processArray)
{
- zend_bool _0;
+ zval _6$$4, _8$$4;
+ zend_bool _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, result, _1, _2, _3, _4;
- zval key;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, *delimiters_param = NULL, result, _0, _1, _3, _4, _11, _12, _13, _5$$4, _7$$4;
+ zval text, delimiters, _10, _9$$4;
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&delimiters);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_9$$4);
ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_8$$4);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(text)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(ttl)
+ Z_PARAM_STR_OR_NULL(delimiters)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 1, &text_param, &delimiters_param);
+ zephir_get_strval(&text, text_param);
+ if (!delimiters_param) {
+ ZEPHIR_INIT_VAR(&delimiters);
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_strval(&delimiters, delimiters_param);
}
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
+ if (ZEPHIR_IS_NULL(&delimiters)) {
+ ZEPHIR_INIT_NVAR(&delimiters);
+ ZVAL_STRING(&delimiters, "-_");
}
- _0 = Z_TYPE_P(ttl) == IS_LONG;
- if (_0) {
- _0 = ZEPHIR_LT_LONG(ttl, 1);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "\\-");
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_fast_strpos(&_1, &delimiters, &_0, 0 );
+ _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_1);
+ if (!(_2)) {
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "-");
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_fast_strpos(&_4, &delimiters, &_3, 0 );
+ _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_4);
}
- if (_0) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "delete", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM();
+ if (_2) {
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZEPHIR_INIT_VAR(&_6$$4);
+ zephir_create_array(&_6$$4, 2, 0);
+ ZEPHIR_INIT_VAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "\\-");
+ zephir_array_fast_append(&_6$$4, &_7$$4);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "-");
+ zephir_array_fast_append(&_6$$4, &_7$$4);
+ ZEPHIR_INIT_VAR(&_8$$4);
+ zephir_create_array(&_8$$4, 2, 0);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "");
+ zephir_array_fast_append(&_8$$4, &_7$$4);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "");
+ zephir_array_fast_append(&_8$$4, &_7$$4);
+ zephir_fast_str_replace(&_5$$4, &_6$$4, &_8$$4, &delimiters);
+ zephir_get_strval(&delimiters, &_5$$4);
+ ZEPHIR_INIT_VAR(&_9$$4);
+ ZEPHIR_CONCAT_SV(&_9$$4, "-", &delimiters);
+ ZEPHIR_CPY_WRT(&delimiters, &_9$$4);
}
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcustore", NULL, 0, &_1, &_2, &_3);
+ ZEPHIR_INIT_VAR(&_10);
+ ZEPHIR_CONCAT_SVS(&_10, "/[", &delimiters, "]+/");
+ ZVAL_LONG(&_11, -1);
+ ZVAL_LONG(&_12, (2 | 1));
+ ZEPHIR_CALL_FUNCTION(&result, "preg_split", NULL, 70, &_10, &text, &_11, &_12);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) {
- ZEPHIR_CPY_WRT(&_4, &result);
+ ZEPHIR_INIT_VAR(&_13);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&result)) {
+ ZEPHIR_INIT_NVAR(&_13);
+ array_init(&_13);
} else {
- ZEPHIR_INIT_NVAR(&_4);
- ZVAL_BOOL(&_4, 0);
+ ZEPHIR_CPY_WRT(&_13, &result);
}
- RETURN_CCTOR(&_4);
+ RETURN_CCTOR(&_13);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, setForever)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Prefix)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Prefix, phalcon, support_helper_str_prefix, phalcon_support_helper_str_prefix_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Prefix, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, result, _0, _1, _2;
- zval key;
- zval *this_ptr = getThis();
+ zval prefix, _0;
+ zval *text, text_sub, *prefix_param = NULL;
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&text_sub);
+ ZVAL_UNDEF(&prefix);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ Z_PARAM_ZVAL(text)
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 2, 0, &text, &prefix_param);
+ zephir_get_strval(&prefix, prefix_param);
+ zephir_cast_to_string(&_0, text);
+ ZEPHIR_CONCAT_VV(return_value, &prefix, &_0);
+ RETURN_MM();
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_Random)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, Random, phalcon, support_helper_str_random, phalcon_support_helper_str_random_method_entry, 0);
+
+ zephir_declare_class_constant_long(phalcon_support_helper_str_random_ce, SL("RANDOM_ALNUM"), 0);
+
+ zephir_declare_class_constant_long(phalcon_support_helper_str_random_ce, SL("RANDOM_ALPHA"), 1);
+
+ zephir_declare_class_constant_long(phalcon_support_helper_str_random_ce, SL("RANDOM_DISTINCT"), 5);
+
+ zephir_declare_class_constant_long(phalcon_support_helper_str_random_ce, SL("RANDOM_HEXDEC"), 2);
+
+ zephir_declare_class_constant_long(phalcon_support_helper_str_random_ce, SL("RANDOM_NOZERO"), 4);
+
+ zephir_declare_class_constant_long(phalcon_support_helper_str_random_ce, SL("RANDOM_NUMERIC"), 3);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Support_Helper_Str_Random, __invoke)
+{
+ zend_bool _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_20 = NULL;
+ zval *type_param = NULL, *length_param = NULL, end, pools, text, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16$$3, _17$$3, _18$$3, _19$$3;
+ zend_long type, length, ZEPHIR_LAST_CALL_STATUS;
+
+ ZVAL_UNDEF(&end);
+ ZVAL_UNDEF(&pools);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_17$$3);
+ ZVAL_UNDEF(&_18$$3);
+ ZVAL_UNDEF(&_19$$3);
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(type)
+ Z_PARAM_LONG(length)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 2, &type_param, &length_param);
+ if (!type_param) {
+ type = 0;
+ } else {
+ }
+ if (!length_param) {
+ length = 8;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&text);
+ ZVAL_STRING(&text, "");
+ ZEPHIR_INIT_VAR(&_0);
+ _1 = type < 0;
+ if (!(_1)) {
+ _1 = type > 5;
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ if (_1) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 0);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, type);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
+ type = zephir_get_numberval(&_0);
+ ZEPHIR_INIT_VAR(&pools);
+ zephir_create_array(&pools, 6, 0);
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "a");
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "z");
+ ZEPHIR_CALL_FUNCTION(&_5, "range", NULL, 314, &_3, &_4);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "A");
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_STRING(&_4, "Z");
+ ZEPHIR_CALL_FUNCTION(&_6, "range", NULL, 314, &_3, &_4);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcustore", NULL, 0, &_0, &_1);
+ zephir_fast_array_merge(&_2, &_5, &_6);
+ zephir_array_update_long(&pools, 1, &_2, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_LONG(&_7, 0);
+ ZVAL_LONG(&_8, 9);
+ ZEPHIR_CALL_FUNCTION(&_9, "range", NULL, 314, &_7, &_8);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- if ((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE)) {
- ZEPHIR_CPY_WRT(&_2, &result);
- } else {
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_BOOL(&_2, 0);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "a");
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_STRING(&_4, "f");
+ ZEPHIR_CALL_FUNCTION(&_10, "range", NULL, 314, &_3, &_4);
+ zephir_check_call_status();
+ zephir_fast_array_merge(&_2, &_9, &_10);
+ zephir_array_update_long(&pools, 2, &_2, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZVAL_LONG(&_7, 0);
+ ZVAL_LONG(&_8, 9);
+ ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 314, &_7, &_8);
+ zephir_check_call_status();
+ zephir_array_update_long(&pools, 3, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZVAL_LONG(&_7, 1);
+ ZVAL_LONG(&_8, 9);
+ ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 314, &_7, &_8);
+ zephir_check_call_status();
+ zephir_array_update_long(&pools, 4, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "2345679ACDEFHJKLMNPRSTUVWXYZ");
+ ZEPHIR_CALL_FUNCTION(&_11, "str_split", NULL, 88, &_2);
+ zephir_check_call_status();
+ zephir_array_update_long(&pools, 5, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ ZVAL_LONG(&_7, 0);
+ ZVAL_LONG(&_8, 9);
+ ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 314, &_7, &_8);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "a");
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "z");
+ ZEPHIR_CALL_FUNCTION(&_12, "range", NULL, 314, &_2, &_3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "A");
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "Z");
+ ZEPHIR_CALL_FUNCTION(&_13, "range", NULL, 314, &_2, &_3);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_14, "array_merge", NULL, 330, &_11, &_12, &_13);
+ zephir_check_call_status();
+ zephir_array_update_long(&pools, 0, &_14, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
+ zephir_array_fetch_long(&_15, &pools, type, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Random.zep", 66);
+ ZEPHIR_INIT_VAR(&end);
+ ZVAL_LONG(&end, (zephir_fast_count_int(&_15) - 1));
+ while (1) {
+ if (!(zephir_fast_strlen_ev(&text) < length)) {
+ break;
+ }
+ zephir_array_fetch_long(&_16$$3, &pools, type, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Random.zep", 69);
+ ZVAL_LONG(&_18$$3, 0);
+ ZEPHIR_CALL_FUNCTION(&_19$$3, "mt_rand", &_20, 0, &_18$$3, &end);
+ zephir_check_call_status();
+ zephir_array_fetch(&_17$$3, &_16$$3, &_19$$3, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Random.zep", 69);
+ zephir_concat_self(&text, &_17$$3);
}
- RETURN_CCTOR(&_2);
+ RETURN_CCTOR(&text);
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Helper_Str_ReduceSlashes)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Support\\Helper\\Str, ReduceSlashes, phalcon, support_helper_str_reduceslashes, phalcon_support_helper_str_reduceslashes_method_entry, 0);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, doGet)
+static PHP_METHOD(Phalcon_Support_Helper_Str_ReduceSlashes, __invoke)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0;
- zval key;
- zval *this_ptr = getThis();
+ zval *text_param = NULL, result, _0, _1;
+ zval text;
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(text)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcufetch", NULL, 0, &_0);
+ zephir_fetch_params(1, 1, 0, &text_param);
+ zephir_get_strval(&text, text_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "#(?= start;
if (_0) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "delete", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, &_1, "set", NULL, 0, &key, &_2, &_3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) {
- ZEPHIR_CPY_WRT(&_4, &result);
- } else {
- ZEPHIR_INIT_NVAR(&_4);
- ZVAL_BOOL(&_4, 0);
+ _0 = value <= end;
}
- RETURN_CCTOR(&_4);
+ RETURN_BOOL(_0);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setForever)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Collection_CollectionInterface)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, result, _0, _1, _2, _3;
- zval key;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Support\\Collection, CollectionInterface, phalcon, support_collection_collectioninterface, phalcon_support_collection_collectioninterface_method_entry);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZVAL_LONG(&_2, 0);
- ZEPHIR_CALL_METHOD(&result, &_0, "set", NULL, 0, &key, &_1, &_2);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) {
- ZEPHIR_CPY_WRT(&_3, &result);
- } else {
- ZEPHIR_INIT_NVAR(&_3);
- ZVAL_BOOL(&_3, 0);
- }
- RETURN_CCTOR(&_3);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setOptions)
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, __get);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, __isset);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, __set);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, __unset);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, clear);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, get);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, getKeys);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, getValues);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, has);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, init);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, remove);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, set);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, toArray);
+ZEPHIR_DOC_METHOD(Phalcon_Support_Collection_CollectionInterface, toJson);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Collection_Exception)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval client;
- zval *connection, connection_sub, *client_param = NULL, _0;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Collection, Exception, phalcon, support_collection_exception, zend_ce_exception, NULL, 0);
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&client);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("memcached")))
- Z_PARAM_ARRAY(client)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &connection, &client_param);
- zephir_get_arrval(&client, client_param);
- ZEPHIR_CALL_METHOD(&_0, connection, "setoptions", NULL, 0, &client);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot set Memcached client options", "phalcon/Storage/Adapter/Libmemcached.zep", 253);
- return;
- }
- RETURN_THIS();
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSasl)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Support_Collection_ReadOnlyCollection)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval saslUser, saslPass;
- zval *connection, connection_sub, *saslUser_param = NULL, *saslPass_param = NULL;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Support\\Collection, ReadOnlyCollection, phalcon, support_collection_readonlycollection, phalcon_support_collection_ce, phalcon_support_collection_readonlycollection_method_entry, 0);
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&saslUser);
- ZVAL_UNDEF(&saslPass);
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("memcached")))
- Z_PARAM_STR(saslUser)
- Z_PARAM_STR(saslPass)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 0, &connection, &saslUser_param, &saslPass_param);
- zephir_get_strval(&saslUser, saslUser_param);
- zephir_get_strval(&saslPass, saslPass_param);
- if (1 != ZEPHIR_IS_EMPTY(&saslUser)) {
- ZEPHIR_CALL_METHOD(NULL, connection, "setsaslauthdata", NULL, 0, &saslUser, &saslPass);
- zephir_check_call_status();
- }
- RETURN_THIS();
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSerializer)
+static PHP_METHOD(Phalcon_Support_Collection_ReadOnlyCollection, remove)
{
- zval map;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, serializer, _0, _1$$3, _2$$3, _3$$3;
- zval *this_ptr = getThis();
+ zval *element_param = NULL;
+ zval element;
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&serializer);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&map);
+ ZVAL_UNDEF(&element);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("memcached")))
+ Z_PARAM_STR(element)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- ZEPHIR_INIT_VAR(&map);
- zephir_create_array(&map, 3, 0);
- add_assoc_long_ex(&map, SL("memcached_igbinary"), 2);
- add_assoc_long_ex(&map, SL("memcached_json"), 3);
- add_assoc_long_ex(&map, SL("memcached_php"), 1);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&serializer);
- zephir_fast_strtolower(&serializer, &_0);
- if (zephir_array_isset(&map, &serializer)) {
- ZEPHIR_INIT_VAR(&_1$$3);
- ZEPHIR_INIT_NVAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "");
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_1$$3);
- zephir_array_fetch(&_2$$3, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Libmemcached.zep", 299);
- ZVAL_LONG(&_3$$3, -1003);
- ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_3$$3, &_2$$3);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &element_param);
+ zephir_get_strval(&element, element_param);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_support_collection_exception_ce, "The object is read only", "phalcon/Support/Collection/ReadOnlyCollection.zep", 25);
+ return;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setServers)
+static PHP_METHOD(Phalcon_Support_Collection_ReadOnlyCollection, set)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval servers;
- zval *connection, connection_sub, *servers_param = NULL, _0;
- zval *this_ptr = getThis();
+ zval *element_param = NULL, *value, value_sub;
+ zval element;
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&servers);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&value_sub);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("memcached")))
- Z_PARAM_ARRAY(servers)
+ Z_PARAM_STR(element)
+ Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &connection, &servers_param);
- zephir_get_arrval(&servers, servers_param);
- ZEPHIR_CALL_METHOD(&_0, connection, "addservers", NULL, 0, &servers);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot connect to the Memcached server(s)", "phalcon/Storage/Adapter/Libmemcached.zep", 317);
- return;
- }
- RETURN_THIS();
+ zephir_fetch_params(1, 2, 0, &element_param, &value);
+ zephir_get_strval(&element, element_param);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_support_collection_exception_ce, "The object is read only", "phalcon/Support/Collection/ReadOnlyCollection.zep", 33);
+ return;
}
@@ -147295,390 +144619,279 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setServers)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Memory)
+ZEPHIR_INIT_CLASS(Phalcon_Messages_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Memory, phalcon, storage_adapter_memory, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_memory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Messages, Exception, phalcon, messages_exception, zend_ce_exception, NULL, 0);
- zend_declare_property_null(phalcon_storage_adapter_memory_ce, SL("data"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_memory_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Memory;
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Messages_Message)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Messages, Message, phalcon, messages_message, phalcon_messages_message_method_entry, 0);
+
+ zend_declare_property_null(phalcon_messages_message_ce, SL("code"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_messages_message_ce, SL("field"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_messages_message_ce, SL("message"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_messages_message_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_messages_message_ce, SL("metaData"), ZEND_ACC_PROTECTED);
+ phalcon_messages_message_ce->create_object = zephir_init_properties_Phalcon_Messages_Message;
+
+ zend_class_implements(phalcon_messages_message_ce, 1, phalcon_messages_messageinterface_ce);
+ zend_class_implements(phalcon_messages_message_ce, 1, php_json_serializable_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Messages_Message, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval metaData;
+ zend_long code;
+ zval *message_param = NULL, *field = NULL, field_sub, *type_param = NULL, *code_param = NULL, *metaData_param = NULL, _0;
+ zval message, type;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&field_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&metaData);
+ ZEND_PARSE_PARAMETERS_START(1, 5)
+ Z_PARAM_STR(message)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(field)
+ Z_PARAM_STR(type)
+ Z_PARAM_LONG(code)
+ Z_PARAM_ARRAY(metaData)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 4, &message_param, &field, &type_param, &code_param, &metaData_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"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) {
+ zephir_get_strval(&message, message_param);
+ } else {
+ ZEPHIR_INIT_VAR(&message);
+ }
+ if (!field) {
+ field = &field_sub;
+ ZEPHIR_INIT_VAR(field);
+ ZVAL_STRING(field, "");
+ }
+ if (!type_param) {
+ ZEPHIR_INIT_VAR(&type);
+ ZVAL_STRING(&type, "");
+ } else {
+ zephir_get_strval(&type, type_param);
+ }
+ if (!code_param) {
+ code = 0;
+ } else {
+ }
+ if (!metaData_param) {
+ ZEPHIR_INIT_VAR(&metaData);
+ array_init(&metaData);
+ } else {
+ zephir_get_arrval(&metaData, metaData_param);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("message"), &message);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("field"), field);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ ZVAL_UNDEF(&_0);
+ ZVAL_LONG(&_0, code);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("code"), &_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("metaData"), &metaData);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Messages_Message, __toString)
+{
+
+ RETURN_MEMBER(getThis(), "message");
+}
+
+static PHP_METHOD(Phalcon_Messages_Message, getCode)
+{
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "code");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, __construct)
+static PHP_METHOD(Phalcon_Messages_Message, getField)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_memory_ce, getThis(), "__construct", NULL, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MEMBER(getThis(), "field");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, clear)
+static PHP_METHOD(Phalcon_Messages_Message, getMessage)
{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0);
- RETURN_MM_BOOL(1);
+ RETURN_MEMBER(getThis(), "message");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement)
+static PHP_METHOD(Phalcon_Messages_Message, getType)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3;
- zval key;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(¤t);
- ZVAL_UNDEF(&newValue);
- ZVAL_UNDEF(&prefixedKey);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!value_param) {
- value = 1;
- } else {
- }
- ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&result);
- ZVAL_BOOL(&result, zephir_array_key_exists(&_0, &prefixedKey));
- if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&result))) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(¤t, &_1$$3, &prefixedKey, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 72);
- ZEPHIR_INIT_VAR(&newValue);
- ZVAL_LONG(&newValue, (zephir_get_intval(¤t) - value));
- ZEPHIR_CPY_WRT(&result, &newValue);
- zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &newValue);
- }
- RETURN_CCTOR(&result);
+ RETURN_MEMBER(getThis(), "type");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete)
+static PHP_METHOD(Phalcon_Messages_Message, getMetaData)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, exists, prefixedKey, _0, _1;
- zval key;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&exists);
- ZVAL_UNDEF(&prefixedKey);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&exists);
- ZVAL_BOOL(&exists, zephir_array_key_exists(&_0, &prefixedKey));
- zephir_unset_property_array(this_ptr, ZEND_STRL("data"), &prefixedKey);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_unset(&_1, &prefixedKey, PH_SEPARATE);
- RETURN_CCTOR(&exists);
+ RETURN_MEMBER(getThis(), "metaData");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getKeys)
+static PHP_METHOD(Phalcon_Messages_Message, jsonSerialize)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, _0, _1;
- zval prefix;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &prefix_param);
- if (!prefix_param) {
- ZEPHIR_INIT_VAR(&prefix);
- ZVAL_STRING(&prefix, "");
- } else {
- zephir_get_strval(&prefix, prefix_param);
- }
- ZEPHIR_INIT_VAR(&_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_keys(&_0, &_1);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_0, &prefix);
- zephir_check_call_status();
+
+ zephir_create_array(return_value, 5, 0);
+ zephir_memory_observe(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("field"), PH_NOISY_CC);
+ zephir_array_update_string(return_value, SL("field"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("message"), PH_NOISY_CC);
+ zephir_array_update_string(return_value, SL("message"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("type"), PH_NOISY_CC);
+ zephir_array_update_string(return_value, SL("type"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("code"), PH_NOISY_CC);
+ zephir_array_update_string(return_value, SL("code"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC);
+ zephir_array_update_string(return_value, SL("metaData"), &_0, PH_COPY | PH_SEPARATE);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, has)
+static PHP_METHOD(Phalcon_Messages_Message, setCode)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, prefixedKey, _0;
- zval key;
+ zval *code_param = NULL, _0;
+ zend_long code;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&prefixedKey);
ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_LONG(code)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_key_exists(&_0, &prefixedKey));
+ zephir_fetch_params_without_memory_grow(1, 0, &code_param);
+ ZVAL_UNDEF(&_0);
+ ZVAL_LONG(&_0, code);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("code"), &_0);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment)
+static PHP_METHOD(Phalcon_Messages_Message, setField)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3;
- zval key;
+ zval *field, field_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(¤t);
- ZVAL_UNDEF(&newValue);
- ZVAL_UNDEF(&prefixedKey);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZVAL_UNDEF(&field_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(field)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!value_param) {
- value = 1;
- } else {
- }
- ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&result);
- ZVAL_BOOL(&result, zephir_array_key_exists(&_0, &prefixedKey));
- if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&result))) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(¤t, &_1$$3, &prefixedKey, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 145);
- ZEPHIR_INIT_VAR(&newValue);
- ZVAL_LONG(&newValue, (zephir_get_intval(¤t) + value));
- ZEPHIR_CPY_WRT(&result, &newValue);
- zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &newValue);
- }
- RETURN_CCTOR(&result);
+ zephir_fetch_params_without_memory_grow(1, 0, &field);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("field"), field);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, set)
+static PHP_METHOD(Phalcon_Messages_Message, setMessage)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, content, prefixedKey;
- zval key;
+ zval *message_param = NULL;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&content);
- ZVAL_UNDEF(&prefixedKey);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(ttl)
+ ZVAL_UNDEF(&message);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
+ 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"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) {
+ zephir_get_strval(&message, message_param);
} else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
- }
- _0 = Z_TYPE_P(ttl) == IS_LONG;
- if (_0) {
- _0 = ZEPHIR_LT_LONG(ttl, 1);
- }
- if (_0) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "delete", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_VAR(&message);
}
- ZEPHIR_CALL_METHOD(&content, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &content);
- RETURN_MM_BOOL(1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("message"), &message);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, setForever)
+static PHP_METHOD(Phalcon_Messages_Message, setMetaData)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub;
- zval key;
+ zval *metaData_param = NULL;
+ zval metaData;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZVAL_UNDEF(&metaData);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(metaData)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, value);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 1, 0, &metaData_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&metaData, metaData_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("metaData"), &metaData);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Memory, doGet)
+static PHP_METHOD(Phalcon_Messages_Message, setType)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1, _2;
- zval key;
+ zval *type_param = NULL;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&type);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getprefixedkey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_array_fetch(&_1, &_0, &_2, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 206);
- RETURN_CTOR(&_1);
+ zephir_fetch_params(1, 1, 0, &type_param);
+ if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
+ zephir_get_strval(&type, type_param);
+ } else {
+ ZEPHIR_INIT_VAR(&type);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type);
+ RETURN_THIS();
}
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Messages_Message(zend_class_entry *class_type)
{
- zval _0, _2, _1$$3, _3$$4;
+ zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
@@ -147687,17 +144900,11 @@ zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_en
{
zval local_this_ptr, *this_ptr = &local_this_ptr;
ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_0) == IS_NULL) {
ZEPHIR_INIT_VAR(&_1$$3);
array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
- }
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_2) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_3$$4);
- array_init(&_3$$4);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("data"), &_3$$4);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("metaData"), &_1$$3);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -147714,748 +144921,453 @@ zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_en
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Redis)
+ZEPHIR_INIT_CLASS(Phalcon_Messages_MessageInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Redis, phalcon, storage_adapter_redis, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_redis_method_entry, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Messages, MessageInterface, phalcon, messages_messageinterface, phalcon_messages_messageinterface_method_entry);
- zend_declare_property_string(phalcon_storage_adapter_redis_ce, SL("prefix"), "ph-reds-", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
- zval *this_ptr = getThis();
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, __toString);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, getCode);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, getField);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, getMessage);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, getMetaData);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, getType);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, setCode);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, setField);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, setMessage);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, setMetaData);
+ZEPHIR_DOC_METHOD(Phalcon_Messages_MessageInterface, setType);
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_11);
- ZVAL_UNDEF(&_12);
- ZVAL_UNDEF(&_13);
- ZVAL_UNDEF(&_14);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "host");
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "127.0.0.1");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("host"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "port");
- ZVAL_LONG(&_4, 6379);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "int");
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getarrval", NULL, 0, &options, &_1, &_4, &_2);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("port"), &_3, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "index");
- ZVAL_LONG(&_4, 0);
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "getarrval", NULL, 0, &options, &_1, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("index"), &_5, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "timeout");
- ZVAL_LONG(&_4, 0);
- ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 0, &options, &_1, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("timeout"), &_6, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "persistent");
- ZVAL_BOOL(&_4, 0);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "bool");
- ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 0, &options, &_1, &_4, &_2);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("persistent"), &_7, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "persistentId");
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "");
- ZEPHIR_INIT_VAR(&_9);
- ZVAL_STRING(&_9, "string");
- ZEPHIR_CALL_METHOD(&_8, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2, &_9);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("persistentId"), &_8, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "auth");
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "");
- ZEPHIR_CALL_METHOD(&_10, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("auth"), &_10, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "socket");
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "");
- ZEPHIR_CALL_METHOD(&_11, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("socket"), &_11, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "connectTimeout");
- ZVAL_LONG(&_4, 0);
- ZEPHIR_CALL_METHOD(&_12, this_ptr, "getarrval", NULL, 0, &options, &_1, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("connectTimeout"), &_12, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "retryInterval");
- ZVAL_LONG(&_4, 0);
- ZEPHIR_CALL_METHOD(&_13, this_ptr, "getarrval", NULL, 0, &options, &_1, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("retryInterval"), &_13, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "readTimeout");
- ZVAL_LONG(&_4, 0);
- ZEPHIR_CALL_METHOD(&_14, this_ptr, "getarrval", NULL, 0, &options, &_1, &_4);
- zephir_check_call_status();
- zephir_array_update_string(&options, SL("readTimeout"), &_14, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_redis_ce, getThis(), "__construct", NULL, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, clear)
-{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+#ifdef HAVE_CONFIG_H
+#endif
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_0, "flushdb", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Messages_Messages)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Messages, Messages, phalcon, messages_messages, phalcon_messages_messages_method_entry, 0);
+
+ zend_declare_property_long(phalcon_messages_messages_ce, SL("position"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_messages_messages_ce, SL("messages"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_messages_messages_ce, 1, zend_ce_arrayaccess);
+ zend_class_implements(phalcon_messages_messages_ce, 1, zend_ce_countable);
+ zend_class_implements(phalcon_messages_messages_ce, 1, zend_ce_iterator);
+ zend_class_implements(phalcon_messages_messages_ce, 1, php_json_serializable_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, decrement)
+static PHP_METHOD(Phalcon_Messages_Messages, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value_param = NULL, _0, _1;
- zval key;
+ zval *messages_param = NULL;
+ zval messages;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ ZVAL_UNDEF(&messages);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ Z_PARAM_ARRAY(messages)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 0, 1, &messages_param);
+ if (!messages_param) {
+ ZEPHIR_INIT_VAR(&messages);
+ array_init(&messages);
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_arrval(&messages, messages_param);
}
- if (!value_param) {
- value = 1;
- } else {
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "decrby", NULL, 0, &key, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &messages);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, delete)
+static PHP_METHOD(Phalcon_Messages_Messages, appendMessage)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1;
- zval key;
+ zval *message, message_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&message_sub);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_OBJECT_OF_CLASS(message, phalcon_messages_messageinterface_ce)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, &_0, "del", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM_BOOL(zephir_get_boolval(&_1));
+ zephir_fetch_params_without_memory_grow(1, 0, &message);
+ zephir_update_property_array_append(this_ptr, SL("messages"), message);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter)
+static PHP_METHOD(Phalcon_Messages_Messages, appendMessages)
{
- zval connection, _0, _1$$3, _2$$3, _3$$3, _4$$3;
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_2 = NULL, *_3 = NULL, *_4 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *messages, messages_sub, currentMessages, finalMessages, message, _1$$7;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&messages_sub);
+ ZVAL_UNDEF(¤tMessages);
+ ZVAL_UNDEF(&finalMessages);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_1$$7);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(messages)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&connection);
- object_init_ex(&connection, zephir_get_internal_ce(SL("redis")));
- ZEPHIR_CALL_METHOD(NULL, &connection, "__construct", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkconnect", NULL, 113, &connection);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "checkauth", NULL, 114, &connection);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_2$$3, "checkindex", NULL, 115, &connection);
- zephir_check_call_status();
- zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_4$$3, 2);
- ZEPHIR_CALL_METHOD(NULL, &connection, "setoption", NULL, 0, &_4$$3, &_3$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 116, &connection);
+ zephir_fetch_params(1, 1, 0, &messages);
+ _0 = Z_TYPE_P(messages) != IS_ARRAY;
+ if (_0) {
+ _0 = Z_TYPE_P(messages) != IS_OBJECT;
+ }
+ if (_0) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_messages_exception_ce, "The messages must be iterable", "phalcon/Messages/Messages.zep", 69);
+ return;
+ }
+ zephir_memory_observe(¤tMessages);
+ zephir_read_property(¤tMessages, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC);
+ if (Z_TYPE_P(messages) == IS_ARRAY) {
+ if (Z_TYPE_P(¤tMessages) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&finalMessages);
+ zephir_fast_array_merge(&finalMessages, ¤tMessages, messages);
+ } else {
+ ZEPHIR_CPY_WRT(&finalMessages, messages);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &finalMessages);
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, messages, "rewind", NULL, 0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$7, messages, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&_1$$7))) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&message, messages, "current", &_2, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_3, 0, &message);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, messages, "next", &_4, 0);
+ zephir_check_call_status();
+ }
}
- RETURN_MM_MEMBER(getThis(), "adapter");
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getKeys)
+static PHP_METHOD(Phalcon_Messages_Messages, count)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, _0, _1, _2;
- zval prefix;
+ zval _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &prefix_param);
- if (!prefix_param) {
- ZEPHIR_INIT_VAR(&prefix);
- ZVAL_STRING(&prefix, "");
- } else {
- if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
- } else {
- ZEPHIR_INIT_VAR(&prefix);
- }
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "*");
- ZEPHIR_CALL_METHOD(&_1, &_0, "keys", NULL, 0, &_2);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_1, &prefix);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ RETURN_LONG(zephir_fast_count_int(&_0));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, has)
+static PHP_METHOD(Phalcon_Messages_Messages, current)
{
+ zval _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_2);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, &_0, "exists", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM_BOOL(zephir_get_boolval(&_1));
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ zephir_memory_observe(&_2);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("position"), PH_NOISY_CC);
+ zephir_array_fetch(&_1, &_0, &_2, PH_NOISY | PH_READONLY, "phalcon/Messages/Messages.zep", 117);
+ RETURN_CTOR(&_1);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, increment)
+static PHP_METHOD(Phalcon_Messages_Messages, filter)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value_param = NULL, _0, _1;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *fieldName_param = NULL, filtered, messages, message, _0, *_1$$3, _2$$3, _3$$5, _4$$8;
+ zval fieldName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&fieldName);
+ ZVAL_UNDEF(&filtered);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&message);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$8);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(fieldName)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &fieldName_param);
+ if (UNEXPECTED(Z_TYPE_P(fieldName_param) != IS_STRING && Z_TYPE_P(fieldName_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'fieldName' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ if (EXPECTED(Z_TYPE_P(fieldName_param) == IS_STRING)) {
+ zephir_get_strval(&fieldName, fieldName_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&fieldName);
}
- if (!value_param) {
- value = 1;
- } else {
+ ZEPHIR_INIT_VAR(&filtered);
+ array_init(&filtered);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&messages, &_0);
+ if (Z_TYPE_P(&messages) == IS_ARRAY) {
+ zephir_is_iterable(&messages, 0, "phalcon/Messages/Messages.zep", 145);
+ if (Z_TYPE_P(&messages) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&messages), _1$$3)
+ {
+ ZEPHIR_INIT_NVAR(&message);
+ ZVAL_COPY(&message, _1$$3);
+ if ((zephir_method_exists_ex(&message, ZEND_STRL("getfield")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(&_3$$5, &message, "getfield", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&fieldName, &_3$$5)) {
+ zephir_array_append(&filtered, &message, PH_SEPARATE, "phalcon/Messages/Messages.zep", 141);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2$$3, &messages, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&message, &messages, "current", NULL, 0);
+ zephir_check_call_status();
+ if ((zephir_method_exists_ex(&message, ZEND_STRL("getfield")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(&_4$$8, &message, "getfield", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&fieldName, &_4$$8)) {
+ zephir_array_append(&filtered, &message, PH_SEPARATE, "phalcon/Messages/Messages.zep", 141);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &messages, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_1, value);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "incrby", NULL, 0, &key, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&message);
+ }
+ RETURN_CCTOR(&filtered);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, set)
+static PHP_METHOD(Phalcon_Messages_Messages, jsonSerialize)
{
- zend_bool _0;
+ zend_bool _3$$3, _5$$6;
+ zval records;
+ zval message, _0, *_1, _2, _4$$4, _6$$7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, result, _1, _2, _3, _4;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(ttl)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&records);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+
+ ZEPHIR_INIT_VAR(&records);
+ array_init(&records);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ zephir_is_iterable(&_0, 0, "phalcon/Messages/Messages.zep", 174);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1)
+ {
+ ZEPHIR_INIT_NVAR(&message);
+ ZVAL_COPY(&message, _1);
+ _3$$3 = Z_TYPE_P(&message) == IS_OBJECT;
+ if (_3$$3) {
+ _3$$3 = (zephir_method_exists_ex(&message, ZEND_STRL("jsonserialize")) == SUCCESS);
+ }
+ if (_3$$3) {
+ ZEPHIR_CALL_METHOD(&_4$$4, &message, "jsonserialize", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&records, &_4$$4, PH_SEPARATE, "phalcon/Messages/Messages.zep", 168);
+ } else {
+ zephir_array_append(&records, &message, PH_SEPARATE, "phalcon/Messages/Messages.zep", 170);
+ }
+ } ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
- }
- _0 = Z_TYPE_P(ttl) == IS_LONG;
- if (_0) {
- _0 = ZEPHIR_LT_LONG(ttl, 1);
- }
- if (_0) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "delete", NULL, 0, &key);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, &_1, "set", NULL, 0, &key, &_2, &_3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) {
- ZEPHIR_CPY_WRT(&_4, &result);
- } else {
- ZEPHIR_INIT_NVAR(&_4);
- ZVAL_BOOL(&_4, 0);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&message, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ _5$$6 = Z_TYPE_P(&message) == IS_OBJECT;
+ if (_5$$6) {
+ _5$$6 = (zephir_method_exists_ex(&message, ZEND_STRL("jsonserialize")) == SUCCESS);
+ }
+ if (_5$$6) {
+ ZEPHIR_CALL_METHOD(&_6$$7, &message, "jsonserialize", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&records, &_6$$7, PH_SEPARATE, "phalcon/Messages/Messages.zep", 168);
+ } else {
+ zephir_array_append(&records, &message, PH_SEPARATE, "phalcon/Messages/Messages.zep", 170);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- RETURN_CCTOR(&_4);
+ ZEPHIR_INIT_NVAR(&message);
+ RETURN_CTOR(&records);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, setForever)
+static PHP_METHOD(Phalcon_Messages_Messages, key)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, result, _0, _1, _2;
- zval key;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, &_0, "set", NULL, 0, &key, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) {
- ZEPHIR_CPY_WRT(&_2, &result);
- } else {
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_BOOL(&_2, 0);
- }
- RETURN_CCTOR(&_2);
+ RETURN_MEMBER(getThis(), "position");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkAuth)
+static PHP_METHOD(Phalcon_Messages_Messages, next)
{
- zend_bool error = 0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, auth, _0, _3, _4, _2$$3;
zval *this_ptr = getThis();
+ RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("position")));
+}
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&auth);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_2$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("redis")))
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- zephir_memory_observe(&auth);
- zephir_array_fetch_string(&auth, &_0, SL("auth"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 243);
-
- /* try_start_1: */
-
- _1$$3 = 1 != ZEPHIR_IS_EMPTY(&auth);
- if (_1$$3) {
- ZEPHIR_CALL_METHOD(&_2$$3, connection, "auth", NULL, 0, &auth);
- zephir_check_call_status_or_jump(try_end_1);
- _1$$3 = !ZEPHIR_IS_TRUE_IDENTICAL(&_2$$3);
- }
- error = _1$$3;
-
- try_end_1:
+static PHP_METHOD(Phalcon_Messages_Messages, offsetExists)
+{
+ zval index_sub, _0;
+ zval *index;
+ zval *this_ptr = getThis();
- if (EG(exception)) {
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_OBJ(&_3, EG(exception));
- Z_ADDREF_P(&_3);
- ZEPHIR_INIT_VAR(&_4);
- if (zephir_is_instance_of(&_3, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&_4, &_3);
- error = 1;
- }
- }
- if (error) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Failed to authenticate with the Redis server", "phalcon/Storage/Adapter/Redis.zep", 254);
- return;
- }
- RETURN_THIS();
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(index)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &index);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ RETURN_BOOL(zephir_array_isset(&_0, index));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkConnect)
+static PHP_METHOD(Phalcon_Messages_Messages, offsetGet)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, host, method, options, parameter, persistentId, port, retryInterval, readTimeout, result, timeout, _0, _1, _2$$4, _3$$4, _4$$5, _5$$5, _6$$5;
+ zval index_sub, message, returnValue, _0;
+ zval *index;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&host);
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(¶meter);
- ZVAL_UNDEF(&persistentId);
- ZVAL_UNDEF(&port);
- ZVAL_UNDEF(&retryInterval);
- ZVAL_UNDEF(&readTimeout);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&timeout);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&returnValue);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$5);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("redis")))
+ Z_PARAM_ZVAL(index)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&options, &_0);
- zephir_memory_observe(&host);
- zephir_array_fetch_string(&host, &options, SL("host"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 272);
- zephir_memory_observe(&port);
- zephir_array_fetch_string(&port, &options, SL("port"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 273);
- zephir_memory_observe(&timeout);
- zephir_array_fetch_string(&timeout, &options, SL("timeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 274);
- zephir_memory_observe(&retryInterval);
- zephir_array_fetch_string(&retryInterval, &options, SL("retryInterval"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 275);
- zephir_memory_observe(&readTimeout);
- zephir_array_fetch_string(&readTimeout, &options, SL("readTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 276);
- zephir_array_fetch_string(&_1, &options, SL("persistent"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 278);
- ZEPHIR_INIT_VAR(&method);
- ZEPHIR_INIT_VAR(¶meter);
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_1)) {
- ZVAL_STRING(&method, "connect");
- ZVAL_NULL(¶meter);
- } else {
- ZVAL_STRING(&method, "pconnect");
- zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- zephir_memory_observe(&persistentId);
- zephir_array_fetch_string(&persistentId, &_2$$4, SL("persistentId"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 283);
- if (!(ZEPHIR_IS_EMPTY(&persistentId))) {
- ZEPHIR_CPY_WRT(¶meter, &persistentId);
- } else {
- zephir_array_fetch_string(&_3$$4, &options, SL("index"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 284);
- ZEPHIR_CONCAT_SV(¶meter, "persistentId", &_3$$4);
- }
- }
- ZEPHIR_CALL_METHOD_ZVAL(&result, connection, &method, NULL, 0, &host, &port, &timeout, ¶meter, &retryInterval, &readTimeout);
- zephir_check_call_status();
- if (!(zephir_is_true(&result))) {
- ZEPHIR_INIT_VAR(&_4$$5);
- object_init_ex(&_4$$5, phalcon_storage_exception_ce);
- ZEPHIR_INIT_VAR(&_5$$5);
- ZVAL_STRING(&_5$$5, "Could not connect to the Redisd server [%s:%s]");
- ZEPHIR_CALL_FUNCTION(&_6$$5, "sprintf", NULL, 117, &_5$$5, &host, &port);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 33, &_6$$5);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_4$$5, "phalcon/Storage/Adapter/Redis.zep", 303);
- ZEPHIR_MM_RESTORE();
- return;
+ zephir_fetch_params(1, 1, 0, &index);
+ ZEPHIR_INIT_VAR(&returnValue);
+ ZVAL_NULL(&returnValue);
+ zephir_memory_observe(&message);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&message, &_0, index, 0)) {
+ ZEPHIR_CPY_WRT(&returnValue, &message);
}
- RETURN_THIS();
+ RETURN_CCTOR(&returnValue);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkIndex)
+static PHP_METHOD(Phalcon_Messages_Messages, offsetSet)
{
- zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, index, _0, _2;
+ zval offset_sub, value_sub, _0;
+ zval *offset, *value;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&offset_sub);
+ ZVAL_UNDEF(&value_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("redis")))
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL(offset)
+ Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- zephir_memory_observe(&index);
- zephir_array_fetch_string(&index, &_0, SL("index"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 319);
- _1 = ZEPHIR_GT_LONG(&index, 0);
- if (_1) {
- ZEPHIR_CALL_METHOD(&_2, connection, "select", NULL, 0, &index);
- zephir_check_call_status();
- _1 = !ZEPHIR_IS_TRUE_IDENTICAL(&_2);
- }
- if (_1) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Redis server selected database failed", "phalcon/Storage/Adapter/Redis.zep", 324);
+ zephir_fetch_params(1, 2, 0, &offset, &value);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_gettype(&_0, value);
+ if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "object")) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_messages_exception_ce, "The message must be an object", "phalcon/Messages/Messages.zep", 241);
return;
}
- RETURN_THIS();
+ zephir_update_property_array(this_ptr, SL("messages"), offset, value);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer)
+static PHP_METHOD(Phalcon_Messages_Messages, offsetUnset)
{
- zval map;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, serializer, _0, _1, _4, _7, _10, _2$$3, _3$$3, _5$$4, _6$$4, _8$$5, _9$$5, _11$$6, _12$$6, _13$$6;
+ zval index_sub, _0, _1$$3, _2$$3;
+ zval *index;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&serializer);
+ ZVAL_UNDEF(&index_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_9$$5);
- ZVAL_UNDEF(&_11$$6);
- ZVAL_UNDEF(&_12$$6);
- ZVAL_UNDEF(&_13$$6);
- ZVAL_UNDEF(&map);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, zephir_get_internal_ce(SL("redis")))
+ Z_PARAM_ZVAL(index)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- ZEPHIR_INIT_VAR(&map);
- zephir_create_array(&map, 2, 0);
- add_assoc_long_ex(&map, SL("redis_none"), 0);
- add_assoc_long_ex(&map, SL("redis_php"), 1);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "\\Redis::SERIALIZER_IGBINARY");
- ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 118, &_0);
- zephir_check_call_status();
- if (zephir_is_true(&_1)) {
- ZEPHIR_INIT_VAR(&_2$$3);
- ZVAL_STRING(&_2$$3, "\\Redis::SERIALIZER_IGBINARY");
- ZEPHIR_CALL_FUNCTION(&_3$$3, "constant", NULL, 119, &_2$$3);
- zephir_check_call_status();
- zephir_array_update_string(&map, SL("redis_igbinary"), &_3$$3, PH_COPY | PH_SEPARATE);
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "\\Redis::SERIALIZER_MSGPACK");
- ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 118, &_0);
- zephir_check_call_status();
- if (zephir_is_true(&_4)) {
- ZEPHIR_INIT_VAR(&_5$$4);
- ZVAL_STRING(&_5$$4, "\\Redis::SERIALIZER_MSGPACK");
- ZEPHIR_CALL_FUNCTION(&_6$$4, "constant", NULL, 119, &_5$$4);
- zephir_check_call_status();
- zephir_array_update_string(&map, SL("redis_msgpack"), &_6$$4, PH_COPY | PH_SEPARATE);
- }
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "\\Redis::SERIALIZER_JSON");
- ZEPHIR_CALL_FUNCTION(&_7, "defined", NULL, 118, &_0);
- zephir_check_call_status();
- if (zephir_is_true(&_7)) {
- ZEPHIR_INIT_VAR(&_8$$5);
- ZVAL_STRING(&_8$$5, "\\Redis::SERIALIZER_JSON");
- ZEPHIR_CALL_FUNCTION(&_9$$5, "constant", NULL, 119, &_8$$5);
- zephir_check_call_status();
- zephir_array_update_string(&map, SL("redis_json"), &_9$$5, PH_COPY | PH_SEPARATE);
- }
- zephir_read_property(&_10, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&serializer);
- zephir_fast_strtolower(&serializer, &_10);
- if (1 == zephir_array_isset(&map, &serializer)) {
- ZEPHIR_INIT_VAR(&_11$$6);
- ZEPHIR_INIT_NVAR(&_11$$6);
- ZVAL_STRING(&_11$$6, "");
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_11$$6);
- zephir_array_fetch(&_12$$6, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 366);
- ZVAL_LONG(&_13$$6, 1);
- ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_13$$6, &_12$$6);
+ zephir_fetch_params(1, 1, 0, &index);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_0, index)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_2$$3, 1);
+ ZEPHIR_MAKE_REF(&_1$$3);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_splice", NULL, 415, &_1$$3, index, &_2$$3);
+ ZEPHIR_UNREF(&_1$$3);
zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
- zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
+static PHP_METHOD(Phalcon_Messages_Messages, rewind)
+{
+ zval _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_0);
+ ZVAL_LONG(&_0, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("position"), &_0);
+}
+
+static PHP_METHOD(Phalcon_Messages_Messages, valid)
+{
+ zval _0, _1;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("position"), PH_NOISY_CC | PH_READONLY);
+ RETURN_BOOL(zephir_array_isset(&_0, &_1));
+}
+
@@ -148466,1583 +145378,1714 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Stream)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Stream, phalcon, storage_adapter_stream, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_stream_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms, Exception, phalcon, forms_exception, zend_ce_exception, NULL, 0);
- zend_declare_property_string(phalcon_storage_adapter_stream_ce, SL("prefix"), "ph-strm", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_storage_adapter_stream_ce, SL("storageDir"), "", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, __construct)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Form)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms, Form, phalcon, forms_form, phalcon_di_injectable_ce, phalcon_forms_form_method_entry, 0);
+
+ zend_declare_property_null(phalcon_forms_form_ce, SL("attributes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("data"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("filteredData"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("elements"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("elementsIndexed"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("entity"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("messages"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_forms_form_ce, SL("position"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("options"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("tagFactory"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("validation"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_form_ce, SL("whitelist"), ZEND_ACC_PROTECTED);
+ phalcon_forms_form_ce->create_object = zephir_init_properties_Phalcon_Forms_Form;
+
+ zend_class_implements(phalcon_forms_form_ce, 1, zend_ce_countable);
+ zend_class_implements(phalcon_forms_form_ce, 1, zend_ce_iterator);
+ zend_class_implements(phalcon_forms_form_ce, 1, phalcon_html_attributes_attributesinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Forms_Form, __construct)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, storageDir, _0, _1, _2;
+ zval userOptions;
+ zval *entity = NULL, entity_sub, *userOptions_param = NULL, __$null, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&storageDir);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&entity_sub);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
+ ZVAL_UNDEF(&userOptions);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_ZVAL_OR_NULL(entity)
+ Z_PARAM_ARRAY(userOptions)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 0, 2, &entity, &userOptions_param);
+ if (!entity) {
+ entity = &entity_sub;
+ entity = &__$null;
+ }
+ if (!userOptions_param) {
+ ZEPHIR_INIT_VAR(&userOptions);
+ array_init(&userOptions);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_get_arrval(&userOptions, userOptions_param);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "storageDir");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- ZEPHIR_CALL_METHOD(&storageDir, this_ptr, "getarrval", NULL, 0, &options, &_0, &_1);
- zephir_check_call_status();
- if (ZEPHIR_IS_EMPTY(&storageDir)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "The 'storageDir' must be specified in the options", "phalcon/Storage/Adapter/Stream.zep", 60);
+ _0 = Z_TYPE_P(entity) != IS_NULL;
+ if (_0) {
+ _0 = Z_TYPE_P(entity) != IS_OBJECT;
+ }
+ if (UNEXPECTED(_0)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_forms_exception_ce, "The base entity is not valid", "phalcon/Forms/Form.zep", 98);
return;
}
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getdirseparator", NULL, 120, &storageDir);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("storageDir"), &_2);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_stream_ce, getThis(), "__construct", NULL, 0, factory, &options);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initserializer", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear)
-{
- zend_bool result = 0, _4$$3, _9$$5;
- zval directory, iterator, file, _0, *_1, _2, _3$$3, _5$$3, _6$$3, _8$$5, _10$$5, _11$$5;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_7 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&directory);
- ZVAL_UNDEF(&iterator);
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_10$$5);
- ZVAL_UNDEF(&_11$$5);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- result = 1;
- zephir_read_property(&_0, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdirseparator", NULL, 120, &_0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 121, &directory);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("entity"), entity);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &userOptions);
+ ZEPHIR_INIT_VAR(&_1);
+ object_init_ex(&_1, phalcon_html_attributes_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 23);
zephir_check_call_status();
- zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 91);
- if (Z_TYPE_P(&iterator) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _1)
- {
- ZEPHIR_INIT_NVAR(&file);
- ZVAL_COPY(&file, _1);
- ZEPHIR_CALL_METHOD(&_3$$3, &file, "isfile", NULL, 0);
- zephir_check_call_status();
- _4$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3);
- if (_4$$3) {
- ZEPHIR_CALL_METHOD(&_6$$3, &file, "getpathname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "phpunlink", &_7, 0, &_6$$3);
- zephir_check_call_status();
- _4$$3 = !ZEPHIR_IS_TRUE_IDENTICAL(&_5$$3);
- }
- if (UNEXPECTED(_4$$3)) {
- result = 0;
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &iterator, "rewind", NULL, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1);
+ if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("initialize")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0, entity, &userOptions);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &iterator, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&file, &iterator, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_8$$5, &file, "isfile", NULL, 0);
- zephir_check_call_status();
- _9$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_8$$5);
- if (_9$$5) {
- ZEPHIR_CALL_METHOD(&_11$$5, &file, "getpathname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_10$$5, this_ptr, "phpunlink", &_7, 0, &_11$$5);
- zephir_check_call_status();
- _9$$5 = !ZEPHIR_IS_TRUE_IDENTICAL(&_10$$5);
- }
- if (UNEXPECTED(_9$$5)) {
- result = 0;
- }
- ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&file);
- RETURN_MM_BOOL(result);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement)
+static PHP_METHOD(Phalcon_Forms_Form, add)
{
+ zend_string *_9$$5;
+ zend_ulong _8$$5;
+ zval elements;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS, _1;
- zval *key_param = NULL, *value_param = NULL, data, result, _0;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool type, _0, _3;
+ zval position;
+ zval *element, element_sub, *position_param = NULL, *type_param = NULL, name, key, value, _1, _4, _2$$3, _5$$5, *_6$$5, _7$$5;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&element_sub);
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&position);
+ ZVAL_UNDEF(&elements);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_OBJECT_OF_CLASS(element, phalcon_forms_element_elementinterface_ce)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ Z_PARAM_STR_OR_NULL(position)
+ Z_PARAM_BOOL_OR_NULL(type, is_null_true)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ zephir_fetch_params(1, 1, 2, &element, &position_param, &type_param);
+ if (!position_param) {
+ ZEPHIR_INIT_VAR(&position);
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_strval(&position, position_param);
}
- if (!value_param) {
- value = 1;
+ if (!type_param) {
+ type = 0;
} else {
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key);
+ ZEPHIR_CALL_METHOD(&name, element, "getname", NULL, 0);
zephir_check_call_status();
- _1 = (zephir_get_intval(&data) - value);
- ZEPHIR_INIT_NVAR(&data);
- ZVAL_LONG(&data, _1);
- ZEPHIR_CALL_METHOD(&result, this_ptr, "set", NULL, 0, &key, &data);
+ ZEPHIR_CALL_METHOD(NULL, element, "setform", NULL, 0, this_ptr);
zephir_check_call_status();
- if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&result))) {
- ZEPHIR_CPY_WRT(&result, &data);
+ _0 = (zephir_method_exists_ex(element, ZEND_STRL("settagfactory")) == SUCCESS);
+ if (_0) {
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("tagFactory"), PH_NOISY_CC | PH_READONLY);
+ _0 = Z_TYPE_P(&_1) != IS_NULL;
}
- RETURN_CCTOR(&result);
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, delete)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, filepath, _0;
- zval key;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&filepath);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
+ if (_0) {
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("tagFactory"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, element, "settagfactory", NULL, 0, &_2$$3);
+ zephir_check_call_status();
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
+ _3 = ZEPHIR_IS_NULL(&position);
+ if (!(_3)) {
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ _3 = ZEPHIR_IS_EMPTY(&_4);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(0);
+ if (_3) {
+ zephir_update_property_array(this_ptr, SL("elements"), &name, element);
+ } else {
+ ZEPHIR_INIT_VAR(&elements);
+ array_init(&elements);
+ zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ zephir_is_iterable(&_5$$5, 0, "phalcon/Forms/Form.zep", 176);
+ if (Z_TYPE_P(&_5$$5) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_5$$5), _8$$5, _9$$5, _6$$5)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_9$$5 != NULL) {
+ ZVAL_STR_COPY(&key, _9$$5);
+ } else {
+ ZVAL_LONG(&key, _8$$5);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _6$$5);
+ if (ZEPHIR_IS_EQUAL(&key, &position)) {
+ if (type) {
+ zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_5$$5, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_7$$5, &_5$$5, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_7$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, &_5$$5, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_5$$5, "current", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EQUAL(&key, &position)) {
+ if (type) {
+ zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_5$$5, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("elements"), &elements);
}
- ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 122, &key);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 123, &filepath);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, get)
+static PHP_METHOD(Phalcon_Forms_Form, bind)
{
- zend_bool _0;
+ zend_bool _7$$5, _16$$15;
+ zend_string *_5;
+ zend_ulong _4;
+ zval method;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_8 = NULL, *_14 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, filepath, payload, _1, _2;
- zval key;
+ zval *data_param = NULL, *entity = NULL, entity_sub, *whitelist_param = NULL, __$null, filter, key, value, element, filters, container, filteredValue, _0, *_2, _3, _1$$4, _6$$5, _9$$9, _10$$9, _11$$11, _12$$11, _13$$11, _15$$15, _17$$19, _18$$19, _19$$21, _20$$21, _21$$21;
+ zval data, whitelist, assignData, filteredData;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&whitelist);
+ ZVAL_UNDEF(&assignData);
+ ZVAL_UNDEF(&filteredData);
+ ZVAL_UNDEF(&entity_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&content);
- ZVAL_UNDEF(&filepath);
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&filter);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&filters);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&filteredValue);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_9$$9);
+ ZVAL_UNDEF(&_10$$9);
+ ZVAL_UNDEF(&_11$$11);
+ ZVAL_UNDEF(&_12$$11);
+ ZVAL_UNDEF(&_13$$11);
+ ZVAL_UNDEF(&_15$$15);
+ ZVAL_UNDEF(&_17$$19);
+ ZVAL_UNDEF(&_18$$19);
+ ZVAL_UNDEF(&_19$$21);
+ ZVAL_UNDEF(&_20$$21);
+ ZVAL_UNDEF(&_21$$21);
+ ZVAL_UNDEF(&method);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ARRAY(data)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_ZVAL_OR_NULL(entity)
+ Z_PARAM_ARRAY(whitelist)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &defaultValue);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 2, &data_param, &entity, &whitelist_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&data, data_param);
+ if (!entity) {
+ entity = &entity_sub;
+ ZEPHIR_CPY_WRT(entity, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(entity);
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ if (!whitelist_param) {
+ ZEPHIR_INIT_VAR(&whitelist);
+ array_init(&whitelist);
} else {
- ZEPHIR_INIT_VAR(&key);
+ zephir_get_arrval(&whitelist, whitelist_param);
}
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&_0))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_forms_exception_ce, "There are no elements in the form", "phalcon/Forms/Form.zep", 195);
+ return;
}
- ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 122, &key);
- zephir_check_call_status();
- if (1 != (zephir_file_exists(&filepath) == SUCCESS)) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ if (ZEPHIR_IS_EMPTY(&whitelist)) {
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("whitelist"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&whitelist, &_1$$4);
}
- ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 124, &filepath);
- zephir_check_call_status();
- _0 = ZEPHIR_IS_EMPTY(&payload);
- if (!(_0)) {
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 125, &payload);
+ ZEPHIR_INIT_VAR(&filter);
+ ZVAL_NULL(&filter);
+ ZEPHIR_INIT_VAR(&assignData);
+ array_init(&assignData);
+ ZEPHIR_INIT_VAR(&filteredData);
+ array_init(&filteredData);
+ zephir_is_iterable(&data, 0, "phalcon/Forms/Form.zep", 269);
+ if (Z_TYPE_P(&data) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _4, _5, _2)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_5 != NULL) {
+ ZVAL_STR_COPY(&key, _5);
+ } else {
+ ZVAL_LONG(&key, _4);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _2);
+ ZEPHIR_OBS_NVAR(&element);
+ zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&element, &_6$$5, &key, 0))) {
+ continue;
+ }
+ _7$$5 = !(ZEPHIR_IS_EMPTY(&whitelist));
+ if (_7$$5) {
+ _7$$5 = !(zephir_fast_in_array(&key, &whitelist));
+ }
+ if (_7$$5) {
+ continue;
+ }
+ ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&filters)) {
+ if (Z_TYPE_P(&filter) != IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(&container, this_ptr, "getdi", &_8, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_10$$9);
+ ZVAL_STRING(&_10$$9, "filter");
+ ZEPHIR_CALL_METHOD(&_9$$9, &container, "getshared", NULL, 0, &_10$$9);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filter, &_9$$9);
+ }
+ ZEPHIR_CALL_METHOD(&filteredValue, &filter, "sanitize", NULL, 0, &value, &filters);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&filteredValue, &value);
+ }
+ zephir_array_update_zval(&assignData, &key, &value, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&filteredData, &key, &filteredValue, PH_COPY | PH_SEPARATE);
+ if (Z_TYPE_P(entity) != IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_11$$11);
+ zephir_camelize(&_11$$11, &key, NULL );
+ ZEPHIR_INIT_NVAR(&_12$$11);
+ ZEPHIR_CONCAT_SV(&_12$$11, "set", &_11$$11);
+ zephir_get_strval(&method, &_12$$11);
+ if ((zephir_method_exists(entity, &method) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD_ZVAL(NULL, entity, &method, NULL, 0, &filteredValue);
+ zephir_check_call_status();
+ continue;
+ }
+ if (!(ZEPHIR_GLOBAL(form).strict_entity_property_check)) {
+ zephir_update_property_zval_zval(entity, &key, &filteredValue);
+ continue;
+ }
+ ZEPHIR_CALL_FUNCTION(&_13$$11, "property_exists", &_14, 290, entity, &key);
+ zephir_check_call_status();
+ if (zephir_is_true(&_13$$11)) {
+ zephir_update_property_zval_zval(entity, &key, &filteredValue);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &data, "rewind", NULL, 0);
zephir_check_call_status();
- _0 = zephir_is_true(&_1);
- }
- if (_0) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, &data, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, &data, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &data, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&element);
+ zephir_read_property(&_15$$15, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&element, &_15$$15, &key, 0))) {
+ continue;
+ }
+ _16$$15 = !(ZEPHIR_IS_EMPTY(&whitelist));
+ if (_16$$15) {
+ _16$$15 = !(zephir_fast_in_array(&key, &whitelist));
+ }
+ if (_16$$15) {
+ continue;
+ }
+ ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&filters)) {
+ if (Z_TYPE_P(&filter) != IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(&container, this_ptr, "getdi", &_8, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_18$$19);
+ ZVAL_STRING(&_18$$19, "filter");
+ ZEPHIR_CALL_METHOD(&_17$$19, &container, "getshared", NULL, 0, &_18$$19);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filter, &_17$$19);
+ }
+ ZEPHIR_CALL_METHOD(&filteredValue, &filter, "sanitize", NULL, 0, &value, &filters);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_CPY_WRT(&filteredValue, &value);
+ }
+ zephir_array_update_zval(&assignData, &key, &value, PH_COPY | PH_SEPARATE);
+ zephir_array_update_zval(&filteredData, &key, &filteredValue, PH_COPY | PH_SEPARATE);
+ if (Z_TYPE_P(entity) != IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_19$$21);
+ zephir_camelize(&_19$$21, &key, NULL );
+ ZEPHIR_INIT_NVAR(&_20$$21);
+ ZEPHIR_CONCAT_SV(&_20$$21, "set", &_19$$21);
+ zephir_get_strval(&method, &_20$$21);
+ if ((zephir_method_exists(entity, &method) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD_ZVAL(NULL, entity, &method, NULL, 0, &filteredValue);
+ zephir_check_call_status();
+ continue;
+ }
+ if (!(ZEPHIR_GLOBAL(form).strict_entity_property_check)) {
+ zephir_update_property_zval_zval(entity, &key, &filteredValue);
+ continue;
+ }
+ ZEPHIR_CALL_FUNCTION(&_21$$21, "property_exists", &_14, 290, entity, &key);
+ zephir_check_call_status();
+ if (zephir_is_true(&_21$$21)) {
+ zephir_update_property_zval_zval(entity, &key, &filteredValue);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "content");
- ZEPHIR_CALL_METHOD(&content, this_ptr, "getarrval", NULL, 0, &payload, &_2);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &assignData);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filteredData"), &filteredData);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys)
+static PHP_METHOD(Phalcon_Forms_Form, clear)
{
- zval files;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, directory, file, iterator, _0, *_1, _2, _3$$4, _4$$5, _5$$5, _6$$5, _7$$6, _8$$7, _9$$7, _10$$7;
- zval prefix;
+ zval *fields = NULL, fields_sub, __$null, elements, element, data, field, _0, *_1$$3, _2$$3, _3$$4, _4$$4, _5$$5, _6$$5, _7$$7, *_8$$6, _9$$6, _10$$10, _11$$10, _12$$13, _13$$13;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&directory);
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&iterator);
+ ZVAL_UNDEF(&fields_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&elements);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&field);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_2$$3);
ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_4$$4);
ZVAL_UNDEF(&_5$$5);
ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&_8$$7);
- ZVAL_UNDEF(&_9$$7);
- ZVAL_UNDEF(&_10$$7);
- ZVAL_UNDEF(&files);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10$$10);
+ ZVAL_UNDEF(&_11$$10);
+ ZVAL_UNDEF(&_12$$13);
+ ZVAL_UNDEF(&_13$$13);
+ bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ Z_PARAM_ZVAL_OR_NULL(fields)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &prefix_param);
- if (!prefix_param) {
- ZEPHIR_INIT_VAR(&prefix);
- ZVAL_STRING(&prefix, "");
- } else {
- if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
- zephir_get_strval(&prefix, prefix_param);
+ zephir_fetch_params(1, 0, 1, &fields);
+ if (!fields) {
+ fields = &fields_sub;
+ ZEPHIR_CPY_WRT(fields, &__$null);
} else {
- ZEPHIR_INIT_VAR(&prefix);
- }
- }
- ZEPHIR_INIT_VAR(&files);
- array_init(&files);
- ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 126);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfileexists", NULL, 0, &directory);
- zephir_check_call_status();
- if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- array_init(return_value);
- RETURN_MM();
+ ZEPHIR_SEPARATE_PARAM(fields);
}
- ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 121, &directory);
- zephir_check_call_status();
- zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 197);
- if (Z_TYPE_P(&iterator) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _1)
- {
- ZEPHIR_INIT_NVAR(&file);
- ZVAL_COPY(&file, _1);
- ZEPHIR_CALL_METHOD(&_3$$4, &file, "isfile", NULL, 0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&data, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&elements, &_0);
+ if (Z_TYPE_P(fields) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&data);
+ array_init(&data);
+ zephir_is_iterable(&elements, 0, "phalcon/Forms/Form.zep", 298);
+ if (Z_TYPE_P(&elements) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&elements), _1$$3)
+ {
+ ZEPHIR_INIT_NVAR(&element);
+ ZVAL_COPY(&element, _1$$3);
+ ZEPHIR_CALL_METHOD(&_3$$4, &element, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4$$4, &element, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_update_zval(&data, &_4$$4, &_3$$4, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &elements, "rewind", NULL, 0);
zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_3$$4)) {
- zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_5$$5, &file, "getfilename", NULL, 0);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2$$3, &elements, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&element, &elements, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$5, &element, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_6$$5, &element, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_update_zval(&data, &_6$$5, &_5$$5, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &elements, "next", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_6$$5);
- ZEPHIR_CONCAT_VV(&_6$$5, &_4$$5, &_5$$5);
- zephir_array_append(&files, &_6$$5, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 193);
}
- } ZEND_HASH_FOREACH_END();
+ }
+ ZEPHIR_INIT_NVAR(&element);
} else {
- ZEPHIR_CALL_METHOD(NULL, &iterator, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &iterator, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&file, &iterator, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_7$$6, &file, "isfile", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$6)) {
- zephir_read_property(&_8$$7, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_9$$7, &file, "getfilename", NULL, 0);
+ if (Z_TYPE_P(fields) != IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_7$$7);
+ zephir_create_array(&_7$$7, 1, 0);
+ zephir_array_fast_append(&_7$$7, fields);
+ ZEPHIR_CPY_WRT(fields, &_7$$7);
+ }
+ zephir_is_iterable(fields, 0, "phalcon/Forms/Form.zep", 312);
+ if (Z_TYPE_P(fields) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(fields), _8$$6)
+ {
+ ZEPHIR_INIT_NVAR(&field);
+ ZVAL_COPY(&field, _8$$6);
+ if (zephir_array_isset(&data, &field)) {
+ zephir_array_unset(&data, &field, PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&element);
+ if (zephir_array_isset_fetch(&element, &elements, &field, 0)) {
+ ZEPHIR_CALL_METHOD(&_10$$10, &element, "getdefault", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_10$$7);
- ZEPHIR_CONCAT_VV(&_10$$7, &_8$$7, &_9$$7);
- zephir_array_append(&files, &_10$$7, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 193);
+ ZEPHIR_CALL_METHOD(&_11$$10, &element, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_update_zval(&data, &_11$$10, &_10$$10, PH_COPY | PH_SEPARATE);
}
- ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, fields, "rewind", NULL, 0);
zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_9$$6, fields, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_9$$6)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&field, fields, "current", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_array_isset(&data, &field)) {
+ zephir_array_unset(&data, &field, PH_SEPARATE);
+ }
+ ZEPHIR_OBS_NVAR(&element);
+ if (zephir_array_isset_fetch(&element, &elements, &field, 0)) {
+ ZEPHIR_CALL_METHOD(&_12$$13, &element, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_13$$13, &element, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_update_zval(&data, &_13$$13, &_12$$13, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(NULL, fields, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
+ ZEPHIR_INIT_NVAR(&field);
}
- ZEPHIR_INIT_NVAR(&file);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &files, &prefix);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Forms_Form, count)
+{
+ zval _0;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ RETURN_LONG(zephir_fast_count_int(&_0));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, has)
+static PHP_METHOD(Phalcon_Forms_Form, current)
{
+ zval element, _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, payload, filepath, _0, _1;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&filepath);
+ ZVAL_UNDEF(&element);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 122, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfileexists", NULL, 0, &filepath);
- zephir_check_call_status();
- if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 124, &filepath);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&payload))) {
+
+ zephir_memory_observe(&element);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elementsIndexed"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("position"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&element, &_0, &_1, 0))) {
RETURN_MM_BOOL(0);
}
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 125, &payload);
- zephir_check_call_status();
- RETURN_MM_BOOL(!zephir_is_true(&_1));
+ RETURN_CCTOR(&element);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment)
+static PHP_METHOD(Phalcon_Forms_Form, get)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value, ZEPHIR_LAST_CALL_STATUS, _1;
- zval *key_param = NULL, *value_param = NULL, data, result, _0;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, element, _0, _1$$3;
+ zval name, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&element);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZVAL_UNDEF(&_1$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!value_param) {
- value = 1;
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- RETURN_MM_BOOL(0);
+ ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key);
- zephir_check_call_status();
- _1 = (zephir_get_intval(&data) + value);
- ZEPHIR_INIT_NVAR(&data);
- ZVAL_LONG(&data, _1);
- ZEPHIR_CALL_METHOD(&result, this_ptr, "set", NULL, 0, &key, &data);
- zephir_check_call_status();
- if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&result))) {
- ZEPHIR_CPY_WRT(&result, &data);
+ zephir_memory_observe(&element);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_forms_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 351);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- RETURN_CCTOR(&result);
+ RETURN_CCTOR(&element);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, set)
+static PHP_METHOD(Phalcon_Forms_Form, getAction)
{
- zend_bool _0;
- zval payload;
+ zval _3;
+ zval _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, _1, _2;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&payload);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(ttl)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
- }
- _0 = Z_TYPE_P(ttl) == IS_LONG;
- if (_0) {
- _0 = ZEPHIR_LT_LONG(ttl, 1);
- }
- if (_0) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "delete", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_INIT_VAR(&payload);
- zephir_create_array(&payload, 3, 0);
- ZEPHIR_INIT_VAR(&_1);
- zephir_time(&_1);
- zephir_array_update_string(&payload, SL("created"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getttl", NULL, 0, ttl);
- zephir_check_call_status();
- zephir_array_update_string(&payload, SL("ttl"), &_2, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getserializeddata", NULL, 0, value);
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getattributes", NULL, 0);
zephir_check_call_status();
- zephir_array_update_string(&payload, SL("content"), &_2, PH_COPY | PH_SEPARATE);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 127, &payload, &key);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "action");
+ ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &_2);
zephir_check_call_status();
- RETURN_MM();
+ zephir_cast_to_string(&_3, &_1);
+ RETURN_CTOR(&_3);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, setForever)
+static PHP_METHOD(Phalcon_Forms_Form, getAttributes)
{
- zval payload;
+ zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, _0, _1;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&payload);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_1$$3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_html_attributes_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 23);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1$$3);
}
- ZEPHIR_INIT_VAR(&payload);
- zephir_create_array(&payload, 3, 0);
- ZEPHIR_INIT_VAR(&_0);
- zephir_time(&_0);
- zephir_array_update_string(&payload, SL("created"), &_0, PH_COPY | PH_SEPARATE);
- add_assoc_stringl_ex(&payload, SL("ttl"), SL("forever"));
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value);
- zephir_check_call_status();
- zephir_array_update_string(&payload, SL("content"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 127, &payload, &key);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_MM_MEMBER(getThis(), "attributes");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDir)
+static PHP_METHOD(Phalcon_Forms_Form, getElements)
+{
+
+ RETURN_MEMBER(getThis(), "elements");
+}
+
+static PHP_METHOD(Phalcon_Forms_Form, getEntity)
+{
+
+ RETURN_MEMBER(getThis(), "entity");
+}
+
+static PHP_METHOD(Phalcon_Forms_Form, getFilteredValue)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, dirFromFile, dirPrefix, _0, _1, _2, _3, _4;
- zval key;
+ zval *name_param = NULL, filteredData, value, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&dirFromFile);
- ZVAL_UNDEF(&dirPrefix);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&filteredData);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &key_param);
- if (!key_param) {
- ZEPHIR_INIT_VAR(&key);
- ZVAL_STRING(&key, "");
- } else {
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- ZEPHIR_INIT_VAR(&key);
+ ZEPHIR_INIT_VAR(&name);
}
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("filteredData"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&filteredData, &_0);
+ if (Z_TYPE_P(&filteredData) == IS_ARRAY) {
+ zephir_memory_observe(&value);
+ if (zephir_array_isset_fetch(&value, &filteredData, &name, 0)) {
+ RETURN_CCTOR(&value);
+ }
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_CONCAT_VV(&_2, &_0, &_1);
- ZEPHIR_CALL_METHOD(&dirPrefix, this_ptr, "getdirseparator", NULL, 120, &_2);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "getkeywithoutprefix", NULL, 128, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&dirFromFile, this_ptr, "getdirfromfile", NULL, 129, &_3);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4);
- ZEPHIR_CONCAT_VV(&_4, &dirPrefix, &dirFromFile);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getdirseparator", NULL, 120, &_4);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getvalue", NULL, 0, &name);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getFilepath)
+static PHP_METHOD(Phalcon_Forms_Form, getLabel)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _0, _1;
- zval key;
+ zval *name_param = NULL, element, label, _0, _1$$3;
+ zval name, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&label);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_1$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdir", NULL, 126, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getkeywithoutprefix", NULL, 128, &key);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ zephir_memory_observe(&element);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_forms_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 426);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&label, &element, "getlabel", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CONCAT_VV(return_value, &_0, &_1);
- RETURN_MM();
+ if (!(zephir_is_true(&label))) {
+ RETURN_CTOR(&name);
+ }
+ RETURN_CCTOR(&label);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeyWithoutPrefix)
+static PHP_METHOD(Phalcon_Forms_Form, getMessages)
{
+ zend_bool _1;
+ zval messages, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, _0, _1$$3, _2$$3;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&messages);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- if (zephir_start_with(&key, &_0, NULL)) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_2$$3, zephir_fast_strlen_ev(&_1$$3));
- zephir_substr(return_value, &key, zephir_get_intval(&_2$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&messages, &_0);
+ _1 = Z_TYPE_P(&messages) == IS_OBJECT;
+ if (_1) {
+ _1 = zephir_instance_of_ev(&messages, phalcon_messages_messages_ce);
+ }
+ if (!(_1)) {
+ object_init_ex(return_value, phalcon_messages_messages_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8);
+ zephir_check_call_status();
RETURN_MM();
}
- RETURN_CTOR(&key);
+ RETURN_CCTOR(&messages);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getIterator)
+static PHP_METHOD(Phalcon_Forms_Form, getMessagesFor)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *dir_param = NULL, _0, _1;
- zval dir;
+ zval *name_param = NULL, _0, _1;
+ zval name;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&dir);
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(dir)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &dir_param);
- if (UNEXPECTED(Z_TYPE_P(dir_param) != IS_STRING && Z_TYPE_P(dir_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'dir' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(dir_param) == IS_STRING)) {
- zephir_get_strval(&dir, dir_param);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- ZEPHIR_INIT_VAR(&dir);
+ ZEPHIR_INIT_VAR(&name);
}
- object_init_ex(return_value, spl_ce_RecursiveIteratorIterator);
- ZEPHIR_INIT_VAR(&_0);
- object_init_ex(&_0, spl_ce_RecursiveDirectoryIterator);
- ZVAL_LONG(&_1, 4096);
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 130, &dir, &_1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &name);
zephir_check_call_status();
- ZVAL_LONG(&_1, 2);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 131, &_0, &_1);
+ if (!(zephir_is_true(&_0))) {
+ object_init_ex(return_value, phalcon_messages_messages_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ ZEPHIR_CALL_METHOD(&_1, this_ptr, "get", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&_1, "getmessages", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getPayload)
+static PHP_METHOD(Phalcon_Forms_Form, getTagFactory)
+{
+
+ RETURN_MEMBER(getThis(), "tagFactory");
+}
+
+static PHP_METHOD(Phalcon_Forms_Form, getUserOption)
{
- zend_bool _10;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filepath_param = NULL, __$false, payload, pointer, version, _0, _1, _2, _3, _4, _9, _5$$6, _6$$6, _7$$7, _8$$7;
- zval filepath;
+ zval *option_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0;
+ zval option;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&filepath);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&pointer);
- ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&option);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_8$$7);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filepath)
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(option)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filepath_param);
- zephir_get_strval(&filepath, filepath_param);
- ZEPHIR_INIT_VAR(&payload);
- ZVAL_BOOL(&payload, 0);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "r");
- ZEPHIR_CALL_METHOD(&pointer, this_ptr, "phpfopen", NULL, 0, &filepath, &_0);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&pointer))) {
- array_init(return_value);
- RETURN_MM();
- }
- ZVAL_LONG(&_1, 1);
- ZEPHIR_CALL_FUNCTION(&_2, "flock", NULL, 132, &pointer, &_1);
- zephir_check_call_status();
- if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_2))) {
- ZEPHIR_CALL_METHOD(&payload, this_ptr, "phpfilegetcontents", NULL, 0, &filepath);
- zephir_check_call_status();
- }
- zephir_fclose(&pointer);
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&payload))) {
- array_init(return_value);
- RETURN_MM();
- }
- ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 133);
- zephir_check_call_status();
- ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "8.0");
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, ">=");
- ZEPHIR_CALL_FUNCTION(&_4, "version_compare", NULL, 134, &version, &_0, &_3);
- zephir_check_call_status();
- if (zephir_is_true(&_4)) {
- ZEPHIR_INIT_VAR(&_5$$6);
- ZEPHIR_INIT_NVAR(&_5$$6);
- zephir_create_closure_ex(&_5$$6, NULL, phalcon_1__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_6$$6, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 135, &_5$$6, &_6$$6);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_7$$7);
- ZEPHIR_INIT_NVAR(&_7$$7);
- zephir_create_closure_ex(&_7$$7, NULL, phalcon_2__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_8$$7, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 135, &_7$$7, &_8$$7);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_FUNCTION(&_9, "unserialize", NULL, 16, &payload);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&payload, &_9);
- ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 136);
- zephir_check_call_status();
- _10 = ZEPHIR_GLOBAL(warning).enable;
- if (!(_10)) {
- _10 = Z_TYPE_P(&payload) != IS_ARRAY;
+ zephir_fetch_params(1, 1, 1, &option_param, &defaultValue);
+ zephir_get_strval(&option, option_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- if (UNEXPECTED(_10)) {
- array_init(return_value);
+ zephir_memory_observe(&value);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&value, &_0, &option, 0))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
RETURN_MM();
}
- RETURN_CCTOR(&payload);
+ RETURN_CCTOR(&value);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, isExpired)
+static PHP_METHOD(Phalcon_Forms_Form, getUserOptions)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *payload_param = NULL, created, ttl, _0, _1, _2, _3, _4;
- zval payload;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&payload);
- ZVAL_UNDEF(&created);
- ZVAL_UNDEF(&ttl);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(payload)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &payload_param);
- ZEPHIR_OBS_COPY_OR_DUP(&payload, payload_param);
- ZEPHIR_INIT_VAR(&_0);
- zephir_time(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "created");
- ZEPHIR_CALL_METHOD(&created, this_ptr, "getarrval", NULL, 0, &payload, &_1, &_0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "ttl");
- ZVAL_LONG(&_2, 3600);
- ZEPHIR_CALL_METHOD(&ttl, this_ptr, "getarrval", NULL, 0, &payload, &_1, &_2);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "forever");
- if (ZEPHIR_IS_IDENTICAL(&_3, &ttl)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_INIT_VAR(&_4);
- zephir_add_function(&_4, &created, &ttl);
- ZEPHIR_INIT_NVAR(&_1);
- zephir_time(&_1);
- RETURN_MM_BOOL(ZEPHIR_LT(&_4, &_1));
+ RETURN_MEMBER(getThis(), "options");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, storePayload)
+static PHP_METHOD(Phalcon_Forms_Form, getValue)
{
+ zval forbidden;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval key;
- zval payload, *payload_param = NULL, *key_param = NULL, __$true, directory, _0, _2, _3, _4, _1$$3;
+ zval *name_param = NULL, __$true, entity, value, data, internalEntity, element, _0, _3, _4, _1$$4, _2$$4;
+ zval name, method;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&payload);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&method);
ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&entity);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&internalEntity);
+ ZVAL_UNDEF(&element);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&key);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(payload)
- Z_PARAM_STR(key)
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&forbidden);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &payload_param, &key_param);
- zephir_get_arrval(&payload, payload_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_FUNCTION(&_0, "serialize", NULL, 15, &payload);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&payload, &_0);
- ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 126, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&_0, "is_dir", NULL, 137, &directory);
- zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- ZVAL_LONG(&_1$$3, 0777);
- ZEPHIR_CALL_FUNCTION(NULL, "mkdir", NULL, 138, &directory, &_1$$3, &__$true);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("entity"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&entity, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&data, &_0);
+ if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("getcustomvalue")) == SUCCESS)) {
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getcustomvalue", NULL, 0, &name, &entity, &data);
zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(&entity) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_camelize(&_1$$4, &name, NULL );
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZEPHIR_CONCAT_SV(&_2$$4, "get", &_1$$4);
+ zephir_get_strval(&method, &_2$$4);
+ if ((zephir_method_exists(&entity, &method) == SUCCESS)) {
+ ZEPHIR_RETURN_CALL_METHOD_ZVAL(&entity, &method, NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ zephir_memory_observe(&value);
+ if (zephir_fetch_property_zval(&value, &entity, &name, PH_SILENT_CC)) {
+ RETURN_CCTOR(&value);
+ }
+ }
+ if (Z_TYPE_P(&data) == IS_ARRAY) {
+ ZEPHIR_OBS_NVAR(&value);
+ if (zephir_array_isset_fetch(&value, &data, &name, 0)) {
+ RETURN_CCTOR(&value);
+ }
+ }
+ ZEPHIR_INIT_VAR(&forbidden);
+ zephir_create_array(&forbidden, 14, 0);
+ zephir_array_update_string(&forbidden, SL("attributes"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("validation"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("action"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("useroption"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("useroptions"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("entity"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("elements"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("messages"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("messagesfor"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("label"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("value"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("di"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("tagFactory"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&forbidden, SL("eventsmanager"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&internalEntity);
+ zephir_fast_strtolower(&internalEntity, &name);
+ if (zephir_array_isset(&forbidden, &internalEntity)) {
+ RETURN_MM_NULL();
}
ZEPHIR_INIT_VAR(&_3);
- ZEPHIR_CONCAT_VV(&_3, &directory, &key);
- ZVAL_LONG(&_4, 2);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileputcontents", NULL, 0, &_3, &payload, &_4);
- zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_2));
+ zephir_camelize(&_3, &name, NULL );
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_SV(&_4, "get", &_3);
+ zephir_get_strval(&method, &_4);
+ if ((zephir_method_exists(this_ptr, &method) == SUCCESS)) {
+ ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, &method, NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ zephir_memory_observe(&element);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&element, &_0, &name, 0)) {
+ ZEPHIR_RETURN_CALL_METHOD(&element, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETURN_MM_NULL();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileExists)
+static PHP_METHOD(Phalcon_Forms_Form, getValidation)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *filename_param = NULL;
- zval filename;
- ZVAL_UNDEF(&filename);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filename)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filename_param);
- zephir_get_strval(&filename, filename_param);
- RETURN_MM_BOOL((zephir_file_exists(&filename) == SUCCESS));
+ RETURN_MEMBER(getThis(), "validation");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileGetContents)
+static PHP_METHOD(Phalcon_Forms_Form, getWhitelist)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *filename_param = NULL;
- zval filename;
- ZVAL_UNDEF(&filename);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filename)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filename_param);
- zephir_get_strval(&filename, filename_param);
- zephir_file_get_contents(return_value, &filename);
- RETURN_MM();
+ RETURN_MEMBER(getThis(), "whitelist");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFilePutContents)
+static PHP_METHOD(Phalcon_Forms_Form, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long flags, ZEPHIR_LAST_CALL_STATUS;
- zval *filename_param = NULL, *data, data_sub, *flags_param = NULL, *context = NULL, context_sub, __$null, _0;
- zval filename;
+ zval *name_param = NULL, _0;
+ zval name;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filename);
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&context_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 4)
- Z_PARAM_STR(filename)
- Z_PARAM_ZVAL(data)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(flags)
- Z_PARAM_ZVAL_OR_NULL(context)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 2, &filename_param, &data, &flags_param, &context);
- zephir_get_strval(&filename, filename_param);
- if (!flags_param) {
- flags = 0;
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- }
- if (!context) {
- context = &context_sub;
- context = &__$null;
+ ZEPHIR_INIT_VAR(&name);
}
- ZVAL_LONG(&_0, flags);
- ZEPHIR_RETURN_CALL_FUNCTION("file_put_contents", NULL, 139, &filename, data, &_0, context);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_isset(&_0, &name));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFopen)
+static PHP_METHOD(Phalcon_Forms_Form, hasMessagesFor)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filename_param = NULL, *mode_param = NULL;
- zval filename, mode;
+ zval *name_param = NULL, _0, _1;
+ zval name;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filename);
- ZVAL_UNDEF(&mode);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(filename)
- Z_PARAM_STR(mode)
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &filename_param, &mode_param);
- zephir_get_strval(&filename, filename_param);
- zephir_get_strval(&mode, mode_param);
- ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 140, &filename, &mode);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmessagesfor", NULL, 0, &name);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_CALL_METHOD(&_1, &_0, "count", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_1, 0));
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpUnlink)
+static PHP_METHOD(Phalcon_Forms_Form, isValid)
{
+ zend_object_iterator *_18$$20;
+ zend_bool validationStatus = 0, _3, _7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_13 = NULL, *_14 = NULL, *_21 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filename_param = NULL;
- zval filename;
+ zval whitelist;
+ zval *data = NULL, data_sub, *entity = NULL, entity_sub, *whitelist_param = NULL, __$null, messages, element, validators, name, filters, validator, validation, elementMessage, _0, _4, _8, *_9, _10, _17, _1$$4, _2$$5, _5$$6, _6$$7, *_11$$10, _12$$10, *_15$$15, _16$$15, _19$$21, _20$$21;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filename);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filename)
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&entity_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&validators);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&filters);
+ ZVAL_UNDEF(&validator);
+ ZVAL_UNDEF(&validation);
+ ZVAL_UNDEF(&elementMessage);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_12$$10);
+ ZVAL_UNDEF(&_16$$15);
+ ZVAL_UNDEF(&_19$$21);
+ ZVAL_UNDEF(&_20$$21);
+ ZVAL_UNDEF(&whitelist);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 3)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(data)
+ Z_PARAM_ZVAL_OR_NULL(entity)
+ Z_PARAM_ARRAY(whitelist)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filename_param);
- zephir_get_strval(&filename, filename_param);
- ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 123, &filename);
+ zephir_fetch_params(1, 0, 3, &data, &entity, &whitelist_param);
+ if (!data) {
+ data = &data_sub;
+ ZEPHIR_CPY_WRT(data, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(data);
+ }
+ if (!entity) {
+ entity = &entity_sub;
+ ZEPHIR_CPY_WRT(entity, &__$null);
+ } else {
+ ZEPHIR_SEPARATE_PARAM(entity);
+ }
+ if (!whitelist_param) {
+ ZEPHIR_INIT_VAR(&whitelist);
+ array_init(&whitelist);
+ } else {
+ zephir_get_arrval(&whitelist, whitelist_param);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_EMPTY(&_0)) {
+ RETURN_MM_BOOL(1);
+ }
+ if (ZEPHIR_IS_EMPTY(&whitelist)) {
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("whitelist"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&whitelist, &_1$$4);
+ }
+ if (Z_TYPE_P(data) != IS_ARRAY) {
+ zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(data, &_2$$5);
+ }
+ _3 = Z_TYPE_P(entity) != IS_OBJECT;
+ if (_3) {
+ zephir_memory_observe(&_4);
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("entity"), PH_NOISY_CC);
+ _3 = Z_TYPE_P(&_4) == IS_OBJECT;
+ }
+ if (_3) {
+ zephir_read_property(&_5$$6, this_ptr, ZEND_STRL("entity"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(entity, &_5$$6);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "bind", NULL, 0, data, entity, &whitelist);
zephir_check_call_status();
- RETURN_MM();
+ if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("beforevalidation")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "beforevalidation", NULL, 0, data, entity);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$7)) {
+ RETURN_MM_BOOL(0);
+ }
+ }
+ validationStatus = 1;
+ ZEPHIR_CALL_METHOD(&validation, this_ptr, "getvalidation", NULL, 0);
+ zephir_check_call_status();
+ _7 = Z_TYPE_P(&validation) != IS_OBJECT;
+ if (!(_7)) {
+ _7 = !((zephir_instance_of_ev(&validation, phalcon_filter_validation_validationinterface_ce)));
+ }
+ if (_7) {
+ ZEPHIR_INIT_NVAR(&validation);
+ object_init_ex(&validation, phalcon_filter_validation_ce);
+ ZEPHIR_CALL_METHOD(NULL, &validation, "__construct", NULL, 315);
+ zephir_check_call_status();
+ }
+ zephir_read_property(&_8, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ zephir_is_iterable(&_8, 0, "phalcon/Forms/Form.zep", 722);
+ if (Z_TYPE_P(&_8) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_8), _9)
+ {
+ ZEPHIR_INIT_NVAR(&element);
+ ZVAL_COPY(&element, _9);
+ ZEPHIR_CALL_METHOD(&validators, &element, "getvalidators", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&validators) == 0) {
+ continue;
+ }
+ ZEPHIR_CALL_METHOD(&name, &element, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&validators, 0, "phalcon/Forms/Form.zep", 709);
+ if (Z_TYPE_P(&validators) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _11$$10)
+ {
+ ZEPHIR_INIT_NVAR(&validator);
+ ZVAL_COPY(&validator, _11$$10);
+ ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_12$$10, &validators, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_12$$10)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&validator);
+ ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 317, &name, &filters);
+ zephir_check_call_status();
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_8, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_10, &_8, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_10)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&element, &_8, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&validators, &element, "getvalidators", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_fast_count_int(&validators) == 0) {
+ continue;
+ }
+ ZEPHIR_CALL_METHOD(&name, &element, "getname", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&validators, 0, "phalcon/Forms/Form.zep", 709);
+ if (Z_TYPE_P(&validators) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _15$$15)
+ {
+ ZEPHIR_INIT_NVAR(&validator);
+ ZVAL_COPY(&validator, _15$$15);
+ ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_16$$15, &validators, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_16$$15)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&validator);
+ ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 317, &name, &filters);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_8, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&element);
+ ZEPHIR_CALL_METHOD(&messages, &validation, "validate", NULL, 318, data, entity);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_17, &messages, "count", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_17)) {
+ _18$$20 = zephir_get_iterator(&messages);
+ _18$$20->funcs->rewind(_18$$20);
+ for (;_18$$20->funcs->valid(_18$$20) == SUCCESS && !EG(exception); _18$$20->funcs->move_forward(_18$$20)) {
+ {
+ ZEPHIR_ITERATOR_COPY(&elementMessage, _18$$20);
+ }
+ ZEPHIR_CALL_METHOD(&_20$$21, &elementMessage, "getfield", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_19$$21, this_ptr, "get", &_21, 0, &_20$$21);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_19$$21, "appendmessage", NULL, 0, &elementMessage);
+ zephir_check_call_status();
+ }
+ zend_iterator_dtor(_18$$20);
+ ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0);
+ zephir_check_call_status();
+ validationStatus = 0;
+ }
+ if (!(validationStatus)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &messages);
+ }
+ if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("aftervalidation")) == SUCCESS)) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "aftervalidation", NULL, 0, &messages);
+ zephir_check_call_status();
+ }
+ RETURN_MM_BOOL(validationStatus);
+}
+
+static PHP_METHOD(Phalcon_Forms_Form, key)
+{
+
+ RETURN_MEMBER(getThis(), "position");
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile)
+static PHP_METHOD(Phalcon_Forms_Form, label)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *file_param = NULL, name, start, _0, _1, _7, _8, _9, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4;
- zval file;
+ zval attributes;
+ zval *name_param = NULL, *attributes_param = NULL, element, _0, _1$$3;
+ zval name, _2$$3;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&file);
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&start);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$4);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(file)
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&attributes);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &file_param);
- if (UNEXPECTED(Z_TYPE_P(file_param) != IS_STRING && Z_TYPE_P(file_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'file' must be of the type string"));
+ zephir_fetch_params(1, 1, 1, &name_param, &attributes_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(file_param) == IS_STRING)) {
- zephir_get_strval(&file, file_param);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- ZEPHIR_INIT_VAR(&file);
+ ZEPHIR_INIT_VAR(&name);
}
- ZVAL_LONG(&_0, 8);
- ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 89, &file, &_0);
- zephir_check_call_status();
- ZVAL_LONG(&_0, 0);
- ZVAL_LONG(&_1, -2);
- ZEPHIR_INIT_VAR(&start);
- zephir_substr(&start, &name, 0 , -2 , 0);
- if (!(ZEPHIR_IS_EMPTY(&start))) {
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_INIT_VAR(&_3$$3);
- ZVAL_STRING(&_3$$3, ".");
- ZEPHIR_INIT_VAR(&_4$$3);
- ZVAL_STRING(&_4$$3, "-");
- zephir_fast_str_replace(&_2$$3, &_3$$3, &_4$$3, &start);
- ZEPHIR_CPY_WRT(&start, &_2$$3);
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
}
- if (!(zephir_is_true(&start))) {
- ZVAL_LONG(&_5$$4, 0);
- ZVAL_LONG(&_6$$4, 1);
- ZEPHIR_INIT_NVAR(&start);
- zephir_substr(&start, &name, 0 , 1 , 0);
+ zephir_memory_observe(&element);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_forms_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 772);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_INIT_VAR(&_7);
- ZVAL_LONG(&_8, 2);
- ZEPHIR_CALL_FUNCTION(&_9, "str_split", NULL, 88, &start, &_8);
+ ZEPHIR_RETURN_CALL_METHOD(&element, "label", NULL, 0, &attributes);
zephir_check_call_status();
- zephir_fast_join_str(&_7, SL("/"), &_9);
- ZEPHIR_CONCAT_VS(return_value, &_7, "/");
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirSeparator)
+static PHP_METHOD(Phalcon_Forms_Form, next)
+{
+ zval *this_ptr = getThis();
+ RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("position")));
+}
+
+static PHP_METHOD(Phalcon_Forms_Form, render)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *directory_param = NULL, _0, _1;
- zval directory;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval attributes;
+ zval *name_param = NULL, *attributes_param = NULL, element, _0, _1$$3;
+ zval name, _2$$3;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&element);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(directory)
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&attributes);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &directory_param);
- if (UNEXPECTED(Z_TYPE_P(directory_param) != IS_STRING && Z_TYPE_P(directory_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'directory' must be of the type string"));
+ zephir_fetch_params(1, 1, 1, &name_param, &attributes_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(directory_param) == IS_STRING)) {
- zephir_get_strval(&directory, directory_param);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- ZEPHIR_INIT_VAR(&directory);
+ ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "/");
- zephir_fast_trim(&_0, &directory, &_1, ZEPHIR_TRIM_RIGHT);
- ZEPHIR_CONCAT_VS(return_value, &_0, "/");
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
+ }
+ zephir_memory_observe(&element);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_forms_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 796);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_RETURN_CALL_METHOD(&element, "render", NULL, 0, &attributes);
+ zephir_check_call_status();
RETURN_MM();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Adapter_Weak)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Adapter, Weak, phalcon, storage_adapter_weak, phalcon_storage_adapter_abstractadapter_ce, phalcon_storage_adapter_weak_method_entry, 0);
-
- zend_declare_property_null(phalcon_storage_adapter_weak_ce, SL("fetching"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapter_weak_ce, SL("weakList"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_storage_adapter_weak_ce, SL("options"), ZEND_ACC_PROTECTED);
- phalcon_storage_adapter_weak_ce->create_object = zephir_init_properties_Phalcon_Storage_Adapter_Weak;
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, __construct)
+static PHP_METHOD(Phalcon_Forms_Form, remove)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0;
+ zval *name_param = NULL, __$null, _0, _1$$3;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZVAL_UNDEF(&_1$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "none");
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_0);
- ZEPHIR_INIT_NVAR(&_0);
- ZVAL_STRING(&_0, "");
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_MM_RESTORE();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset(&_0, &name)) {
+ zephir_unset_property_array(this_ptr, ZEND_STRL("elements"), &name);
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_unset(&_1$$3, &name, PH_SEPARATE);
+ RETURN_MM_BOOL(1);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("elementsIndexed"), &__$null);
+ RETURN_MM_BOOL(0);
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, clear)
+static PHP_METHOD(Phalcon_Forms_Form, rewind)
{
- zval _0;
+ zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("weakList"), &_0);
- RETURN_MM_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, decrement)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value;
- zval *key_param = NULL, *value_param = NULL;
- zval key;
-
- ZVAL_UNDEF(&key);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!value_param) {
- value = 1;
- } else {
- }
- RETURN_MM_BOOL(0);
+ ZVAL_UNDEF(&_0);
+ ZVAL_LONG(&_0, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("position"), &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_1, "array_values", NULL, 14, &_0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("elementsIndexed"), &_1);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, delete)
+static PHP_METHOD(Phalcon_Forms_Form, setAction)
{
- zend_bool exists = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, _0, _1, _2;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *action_param = NULL, _0, _1;
+ zval action;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&action);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(action)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &action_param);
+ if (UNEXPECTED(Z_TYPE_P(action_param) != IS_STRING && Z_TYPE_P(action_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'action' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
+ if (EXPECTED(Z_TYPE_P(action_param) == IS_STRING)) {
+ zephir_get_strval(&action, action_param);
} else {
- ZEPHIR_INIT_VAR(&key);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("fetching"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_IDENTICAL(&key, &_0)) {
- RETURN_MM_BOOL(0);
+ ZEPHIR_INIT_VAR(&action);
}
- zephir_read_property(&_1, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
- exists = zephir_array_isset(&_1, &key);
- zephir_unset_property_array(this_ptr, ZEND_STRL("weakList"), &key);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
- zephir_array_unset(&_2, &key, PH_SEPARATE);
- RETURN_MM_BOOL(exists);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getattributes", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "action");
+ ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &_1, &action);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, getKeys)
+static PHP_METHOD(Phalcon_Forms_Form, setAttributes)
{
- zval results;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *prefix_param = NULL, keys, key, _0, _1, *_2$$3, _3$$3;
- zval prefix;
+ zval *attributes, attributes_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&keys);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&results);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(prefix)
+ ZVAL_UNDEF(&attributes_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(attributes, phalcon_html_attributes_ce)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &prefix_param);
- if (!prefix_param) {
- ZEPHIR_INIT_VAR(&prefix);
- ZVAL_STRING(&prefix, "");
- } else {
- zephir_get_strval(&prefix, prefix_param);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&keys);
- zephir_array_keys(&keys, &_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_1, &prefix))) {
- ZEPHIR_INIT_VAR(&results);
- array_init(&results);
- zephir_is_iterable(&keys, 0, "phalcon/Storage/Adapter/Weak.zep", 116);
- if (Z_TYPE_P(&keys) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&keys), _2$$3)
- {
- ZEPHIR_INIT_NVAR(&key);
- ZVAL_COPY(&key, _2$$3);
- if (zephir_start_with(&key, &prefix, NULL)) {
- zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/Weak.zep", 113);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &keys, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_3$$3, &keys, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_3$$3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &keys, "current", NULL, 0);
- zephir_check_call_status();
- if (zephir_start_with(&key, &prefix, NULL)) {
- zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/Weak.zep", 113);
- }
- ZEPHIR_CALL_METHOD(NULL, &keys, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&key);
- RETURN_CTOR(&results);
- }
- RETURN_CCTOR(&keys);
+ zephir_fetch_params_without_memory_grow(1, 0, &attributes);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), attributes);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, increment)
+static PHP_METHOD(Phalcon_Forms_Form, setEntity)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long value;
- zval *key_param = NULL, *value_param = NULL;
- zval key;
+ zval *entity, entity_sub;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(value)
+ ZVAL_UNDEF(&entity_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(entity)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &value_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!value_param) {
- value = 1;
- } else {
- }
- RETURN_MM_BOOL(0);
+ zephir_fetch_params_without_memory_grow(1, 0, &entity);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("entity"), entity);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, get)
+static PHP_METHOD(Phalcon_Forms_Form, setTagFactory)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, wr, _0, _1;
- zval key;
+ zval *tagFactory, tagFactory_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&wr);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ ZVAL_UNDEF(&tagFactory_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(tagFactory, phalcon_html_tagfactory_ce)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &key_param, &defaultValue);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("fetching"), &key);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
- if (0 == zephir_array_isset(&_0, &key)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("fetching"), &__$null);
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
- zephir_memory_observe(&wr);
- zephir_array_fetch(&wr, &_1, &key, PH_NOISY, "phalcon/Storage/Adapter/Weak.zep", 156);
- ZEPHIR_CALL_METHOD(&value, &wr, "get", NULL, 0);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("fetching"), &__$null);
- if (Z_TYPE_P(&value) == IS_NULL) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "delete", NULL, 0, &key);
- zephir_check_call_status();
- }
- RETURN_CCTOR(&value);
+ zephir_fetch_params_without_memory_grow(1, 0, &tagFactory);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("tagFactory"), tagFactory);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, has)
+static PHP_METHOD(Phalcon_Forms_Form, setValidation)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, _0;
- zval key;
+ zval *validation, validation_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&validation_sub);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_filter_validation_validationinterface_ce)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &key));
+ zephir_fetch_params_without_memory_grow(1, 0, &validation);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("validation"), validation);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, set)
+static PHP_METHOD(Phalcon_Forms_Form, setWhitelist)
{
- zend_class_entry *_2$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, _0, _1$$4;
- zval key;
+ zval *whitelist_param = NULL;
+ zval whitelist;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&ttl_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(ttl)
+ ZVAL_UNDEF(&whitelist);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(whitelist)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl);
- if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
- zephir_get_strval(&key, key_param);
- } else {
- ZEPHIR_INIT_VAR(&key);
- }
- if (!ttl) {
- ttl = &ttl_sub;
- ttl = &__$null;
- }
- if (Z_TYPE_P(value) != IS_OBJECT) {
- RETURN_MM_BOOL(0);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
- if (0 == zephir_array_isset(&_0, &key)) {
- _2$$4 = zephir_fetch_class_str_ex(SL("WeakReference"), ZEND_FETCH_CLASS_AUTO);
- ZEPHIR_CALL_CE_STATIC(&_1$$4, _2$$4, "create", NULL, 0, value);
- zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("weakList"), &key, &_1$$4);
- }
- RETURN_MM_BOOL(1);
+ zephir_fetch_params(1, 1, 0, &whitelist_param);
+ zephir_get_arrval(&whitelist, whitelist_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("whitelist"), &whitelist);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, setForever)
+static PHP_METHOD(Phalcon_Forms_Form, setUserOption)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub;
- zval key;
+ zval *option_param = NULL, *value, value_sub;
+ zval option;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&option);
ZVAL_UNDEF(&value_sub);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(option)
Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- zephir_get_strval(&key, key_param);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, value);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 2, 0, &option_param, &value);
+ zephir_get_strval(&option, option_param);
+ zephir_update_property_array(this_ptr, SL("options"), &option, value);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Adapter_Weak, setDefaultSerializer)
+static PHP_METHOD(Phalcon_Forms_Form, setUserOptions)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *serializer_param = NULL;
- zval serializer;
+ zval *options_param = NULL;
+ zval options;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&serializer);
+ ZVAL_UNDEF(&options);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(serializer)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &serializer_param);
- zephir_get_strval(&serializer, serializer_param);
+ zephir_fetch_params(1, 1, 0, &options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ RETURN_THIS();
}
-zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Weak(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Forms_Form, valid)
{
- zval _0, _2, _1$$3, _3$$4;
+ zval _0, _1;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("elementsIndexed"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("position"), PH_NOISY_CC | PH_READONLY);
+ RETURN_BOOL(zephir_array_isset(&_0, &_1));
+}
+
+zend_object *zephir_init_properties_Phalcon_Forms_Form(zend_class_entry *class_type)
+{
+ zval _0, _2, _4, _6, _8, _10, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_10);
ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_9$$7);
+ ZVAL_UNDEF(&_11$$8);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
@@ -150051,17 +147094,41 @@ zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Weak(zend_class_entr
{
zval local_this_ptr, *this_ptr = &local_this_ptr;
ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("whitelist"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_0) == IS_NULL) {
ZEPHIR_INIT_VAR(&_1$$3);
array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("whitelist"), &_1$$3);
}
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("weakList"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_2) == IS_NULL) {
ZEPHIR_INIT_VAR(&_3$$4);
array_init(&_3$$4);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("weakList"), &_3$$4);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_3$$4);
+ }
+ zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("elementsIndexed"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_4) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_5$$5);
+ array_init(&_5$$5);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("elementsIndexed"), &_5$$5);
+ }
+ zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_6) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_7$$6);
+ array_init(&_7$$6);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("elements"), &_7$$6);
+ }
+ zephir_read_property_ex(&_8, this_ptr, ZEND_STRL("filteredData"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_8) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_9$$7);
+ array_init(&_9$$7);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("filteredData"), &_9$$7);
+ }
+ zephir_read_property_ex(&_10, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_10) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_11$$8);
+ array_init(&_11$$8);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("data"), &_11$$8);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -150078,442 +147145,150 @@ zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Weak(zend_class_entr
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Manager)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Storage\\Serializer, AbstractSerializer, phalcon, storage_serializer_abstractserializer, phalcon_storage_serializer_abstractserializer_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Forms, Manager, phalcon, forms_manager, phalcon_forms_manager_method_entry, 0);
+
+ zend_declare_property_null(phalcon_forms_manager_ce, SL("forms"), ZEND_ACC_PROTECTED);
+ phalcon_forms_manager_ce->create_object = zephir_init_properties_Phalcon_Forms_Manager;
- zend_declare_property_null(phalcon_storage_serializer_abstractserializer_ce, SL("data"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_storage_serializer_abstractserializer_ce, SL("isSuccess"), 1, ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_storage_serializer_abstractserializer_ce, 1, phalcon_storage_serializer_serializerinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __construct)
+static PHP_METHOD(Phalcon_Forms_Manager, create)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data = NULL, data_sub, __$null;
+ zval *name_param = NULL, *entity = NULL, entity_sub, __$null, form;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&entity_sub);
ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&form);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(data)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &data);
- if (!data) {
- data = &data_sub;
- data = &__$null;
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdata", NULL, 0, data);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __serialize)
-{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_memory_observe(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
- if (Z_TYPE_P(&_0) == IS_ARRAY) {
- RETURN_MM_MEMBER(getThis(), "data");
- }
- array_init(return_value);
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __unserialize)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *data_param = NULL;
- zval data;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&data);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(data)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &data_param);
- zephir_get_arrval(&data, data_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData)
-{
-
- RETURN_MEMBER(getThis(), "data");
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSuccess)
-{
-
- RETURN_MEMBER(getThis(), "isSuccess");
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData)
-{
- zval *data, data_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&data_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &data);
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable)
-{
- zend_bool _0, _1;
- zval *data, data_sub;
-
- ZVAL_UNDEF(&data_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &data);
- _0 = Z_TYPE_P(data) == IS_NULL;
- if (!(_0)) {
- _0 = 1 == (Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE);
- }
- _1 = _0;
- if (!(_1)) {
- _1 = 1 == zephir_is_numeric(data);
- }
- RETURN_BOOL(!(_1));
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Base64)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Base64, phalcon, storage_serializer_base64, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_base64_method_entry, 0);
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_Base64, serialize)
-{
- zval _0, _1;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_memory_observe(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
- if (Z_TYPE_P(&_0) != IS_STRING) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the serializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 27);
- return;
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 231, &_1);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval data_sub, __$true, __$false, result, _0, _1;
- zval *data;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&data_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &data);
- ZEPHIR_INIT_VAR(&_0);
- zephir_gettype(&_0, data);
- if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "string")) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 47);
- return;
- }
- ZVAL_BOOL(&_1, 1);
- ZEPHIR_CALL_METHOD(&result, this_ptr, "phpbase64decode", NULL, 0, data, &_1);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&result))) {
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
- }
- ZEPHIR_INIT_NVAR(&result);
- ZVAL_STRING(&result, "");
- } else {
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
- }
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_Base64, phpBase64Decode)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool strict;
- zval *input_param = NULL, *strict_param = NULL, _0;
- zval input;
-
- ZVAL_UNDEF(&input);
- ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(input)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(strict)
+ Z_PARAM_ZVAL_OR_NULL(entity)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &input_param, &strict_param);
- zephir_get_strval(&input, input_param);
- if (!strict_param) {
- strict = 0;
- } else {
- }
- ZVAL_BOOL(&_0, (strict ? 1 : 0));
- ZEPHIR_RETURN_CALL_FUNCTION("base64_decode", NULL, 230, &input, &_0);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Igbinary, phalcon, storage_serializer_igbinary, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_igbinary_method_entry, 0);
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval __$true, __$false, result, _0, _1, _2;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, &_1);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- RETURN_MM_MEMBER(getThis(), "data");
+ zephir_fetch_params(1, 1, 1, &name_param, &entity);
+ zephir_get_strval(&name, name_param);
+ if (!entity) {
+ entity = &entity_sub;
+ entity = &__$null;
}
- zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&result, this_ptr, "doserialize", NULL, 0, &_2);
+ ZEPHIR_INIT_VAR(&form);
+ object_init_ex(&form, phalcon_forms_form_ce);
+ ZEPHIR_CALL_METHOD(NULL, &form, "__construct", NULL, 319, entity);
zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&result) == IS_NULL)) {
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
- }
- ZEPHIR_INIT_NVAR(&result);
- ZVAL_STRING(&result, "");
- } else {
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
- }
- }
- RETURN_CCTOR(&result);
+ zephir_update_property_array(this_ptr, SL("forms"), &name, &form);
+ RETURN_CCTOR(&form);
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize)
+static PHP_METHOD(Phalcon_Forms_Manager, get)
{
- zend_bool _8$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval data_sub, __$false, __$true, result, version, _0, _1$$4, _2$$4, _3$$4, _4$$5, _5$$5, _6$$6, _7$$6;
- zval *data;
+ zval *name_param = NULL, form, _0, _1$$3;
+ zval name, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&form);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_1$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &data);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
- } else {
- ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 133);
- zephir_check_call_status();
- ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
- ZEPHIR_INIT_VAR(&_1$$4);
- ZVAL_STRING(&_1$$4, "8.0");
- ZEPHIR_INIT_VAR(&_2$$4);
- ZVAL_STRING(&_2$$4, ">=");
- ZEPHIR_CALL_FUNCTION(&_3$$4, "version_compare", NULL, 134, &version, &_1$$4, &_2$$4);
- zephir_check_call_status();
- if (zephir_is_true(&_3$$4)) {
- ZEPHIR_INIT_VAR(&_4$$5);
- ZEPHIR_INIT_NVAR(&_4$$5);
- zephir_create_closure_ex(&_4$$5, NULL, phalcon_3__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_5$$5, 2);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 135, &_4$$5, &_5$$5);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_6$$6);
- ZEPHIR_INIT_NVAR(&_6$$6);
- zephir_create_closure_ex(&_6$$6, NULL, phalcon_4__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_7$$6, 2);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 135, &_6$$6, &_7$$6);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(&result, this_ptr, "dounserialize", NULL, 0, data);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 136);
- zephir_check_call_status();
- _8$$4 = ZEPHIR_GLOBAL(warning).enable;
- if (!(_8$$4)) {
- _8$$4 = ZEPHIR_IS_FALSE_IDENTICAL(&result);
- }
- if (UNEXPECTED(_8$$4)) {
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
- }
- ZEPHIR_INIT_NVAR(&result);
- ZVAL_STRING(&result, "");
- } else {
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
- }
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+ zephir_memory_observe(&form);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("forms"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&form, &_0, &name, 0)))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ object_init_ex(&_1$$3, phalcon_forms_exception_ce);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZEPHIR_CONCAT_SVS(&_2$$3, "There is no form with name='", &name, "'");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Manager.zep", 46);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_MM_RESTORE();
+ RETURN_CCTOR(&form);
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, phpIgbinarySerialize)
+static PHP_METHOD(Phalcon_Forms_Manager, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub;
+ zval *name_param = NULL, _0;
+ zval name;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &value);
- ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 141, value);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("forms"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_isset(&_0, &name));
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doSerialize)
+static PHP_METHOD(Phalcon_Forms_Manager, set)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub;
+ zval *name_param = NULL, *form, form_sub;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&form_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OBJECT_OF_CLASS(form, phalcon_forms_form_ce)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &value);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpigbinaryserialize", NULL, 0, value);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 2, 0, &name_param, &form);
+ zephir_get_strval(&name, name_param);
+ zephir_update_property_array(this_ptr, SL("forms"), &name, form);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doUnserialize)
+zend_object *zephir_init_properties_Phalcon_Forms_Manager(zend_class_entry *class_type)
{
+ zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &value);
- ZEPHIR_RETURN_CALL_FUNCTION("igbinary_unserialize", NULL, 142, value);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ {
+ zval local_this_ptr, *this_ptr = &local_this_ptr;
+ ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("forms"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("forms"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
}
@@ -150526,441 +147301,872 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doUnserialize)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Json)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_AbstractElement)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Json, phalcon, storage_serializer_json, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_json_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Forms\\Element, AbstractElement, phalcon, forms_element_abstractelement, phalcon_forms_element_abstractelement_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- zend_declare_property_null(phalcon_storage_serializer_json_ce, SL("decode"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_storage_serializer_json_ce, SL("encode"), ZEND_ACC_PRIVATE);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("attributes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("filters"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("form"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("label"), ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_forms_element_abstractelement_ce, SL("method"), "inputText", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("messages"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("name"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("options"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("tagFactory"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("validators"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("value"), ZEND_ACC_PROTECTED);
+ phalcon_forms_element_abstractelement_ce->create_object = zephir_init_properties_Phalcon_Forms_Element_AbstractElement;
+
+ zend_class_implements(phalcon_forms_element_abstractelement_ce, 1, phalcon_forms_element_elementinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Json, __construct)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data = NULL, data_sub, __$null, _0, _1;
+ zval attributes;
+ zval *name_param = NULL, *attributes_param = NULL, _0, _1;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&attributes);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(data)
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &data);
- if (!data) {
- data = &data_sub;
- data = &__$null;
+ zephir_fetch_params(1, 1, 1, &name_param, &attributes_param);
+ zephir_get_strval(&name, name_param);
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
+ } else {
+ zephir_get_arrval(&attributes, attributes_param);
}
ZEPHIR_INIT_VAR(&_0);
- object_init_ex(&_0, phalcon_support_helper_json_encode_ce);
- if (zephir_has_constructor(&_0)) {
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0);
- zephir_check_call_status();
+ zephir_fast_trim(&_0, &name, NULL , ZEPHIR_TRIM_BOTH);
+ zephir_get_strval(&name, &_0);
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&name))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Form element name is required", "phalcon/Forms/Element/AbstractElement.zep", 97);
+ return;
}
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("encode"), &_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
ZEPHIR_INIT_VAR(&_1);
- object_init_ex(&_1, phalcon_support_helper_json_decode_ce);
- if (zephir_has_constructor(&_1)) {
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 0);
- zephir_check_call_status();
- }
-
- zephir_update_property_zval(this_ptr, ZEND_STRL("decode"), &_1);
- ZEPHIR_CALL_PARENT(NULL, phalcon_storage_serializer_json_ce, getThis(), "__construct", NULL, 0, data);
+ object_init_ex(&_1, phalcon_messages_messages_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 8);
zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &_1);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Json, serialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, __toString)
{
- zval _4$$3;
- zend_bool _1;
- zval _0, _2, _5, _6, _7, _8, _3$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_memory_observe(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
- _1 = Z_TYPE_P(&_0) == IS_OBJECT;
- if (_1) {
- zephir_memory_observe(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC);
- _1 = !(zephir_is_instance_of(&_2, SL("JsonSerializable")));
- }
- if (_1) {
- ZEPHIR_INIT_VAR(&_3$$3);
- object_init_ex(&_3$$3, spl_ce_InvalidArgumentException);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZEPHIR_CONCAT_SS(&_4$$3, "Data for the JSON serializer cannot be of type 'object' ", "without implementing 'JsonSerializable'");
- ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 200, &_4$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 54);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_read_property(&_6, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "isserializable", NULL, 0, &_6);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_5)) {
- RETURN_MM_MEMBER(getThis(), "data");
- }
- zephir_read_property(&_7, this_ptr, ZEND_STRL("encode"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_8, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_7, "__invoke", NULL, 0, &_8);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "render", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Json, unserialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, addFilter)
{
+ zval _1$$5, _2$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval data_sub, _0, _1$$4, _2$$4;
- zval *data;
+ zval *filter_param = NULL, filters, _0;
+ zval filter;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&filter);
+ ZVAL_UNDEF(&filters);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_2$$6);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_STR(filter)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &data);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+ zephir_fetch_params(1, 1, 0, &filter_param);
+ zephir_get_strval(&filter, filter_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("filters"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&filters, &_0);
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ zephir_update_property_array_append(this_ptr, SL("filters"), &filter);
} else {
- zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("decode"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2$$4, &_1$$4, "__invoke", NULL, 0, data);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_2$$4);
+ if (Z_TYPE_P(&filters) == IS_STRING) {
+ ZEPHIR_INIT_VAR(&_1$$5);
+ zephir_create_array(&_1$$5, 2, 0);
+ zephir_array_fast_append(&_1$$5, &filters);
+ zephir_array_fast_append(&_1$$5, &filter);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filters"), &_1$$5);
+ } else {
+ ZEPHIR_INIT_VAR(&_2$$6);
+ zephir_create_array(&_2$$6, 1, 0);
+ zephir_array_fast_append(&_2$$6, &filter);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filters"), &_2$$6);
+ }
}
- ZEPHIR_MM_RESTORE();
+ RETURN_THIS();
}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, addValidator)
+{
+ zval *validator, validator_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&validator_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(validator, phalcon_filter_validation_validatorinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &validator);
+ zephir_update_property_array_append(this_ptr, SL("validators"), validator);
+ RETURN_THISW();
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, addValidators)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_3 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool merge;
+ zval *validators_param = NULL, *merge_param = NULL, validator, *_1, _2, _0$$3;
+ zval validators;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&validators);
+ ZVAL_UNDEF(&validator);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_0$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(validators)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(merge)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &validators_param, &merge_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&validators, validators_param);
+ if (!merge_param) {
+ merge = 1;
+ } else {
+ }
+ if (UNEXPECTED(!merge)) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ array_init(&_0$$3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("validators"), &_0$$3);
+ }
+ zephir_is_iterable(&validators, 0, "phalcon/Forms/Element/AbstractElement.zep", 163);
+ if (Z_TYPE_P(&validators) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _1)
+ {
+ ZEPHIR_INIT_NVAR(&validator);
+ ZVAL_COPY(&validator, _1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addvalidator", &_3, 0, &validator);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &validators, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addvalidator", &_3, 0, &validator);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&validator);
+ RETURN_THIS();
+}
-#ifdef HAVE_CONFIG_H
-#endif
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, appendMessage)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *message, message_sub, _0;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&message_sub);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(message, phalcon_messages_messageinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &message);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "appendmessage", NULL, 0, message);
+ zephir_check_call_status();
+ RETURN_THIS();
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, clear)
+{
+ zval form, _0, name;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&form);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&name);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&form, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_0);
+ if (Z_TYPE_P(&form) == IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(NULL, &form, "clear", NULL, 0, &name);
+ zephir_check_call_status();
+ }
+ RETURN_THIS();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedIgbinary)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getAttribute)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedIgbinary, phalcon, storage_serializer_memcachedigbinary, phalcon_storage_serializer_none_ce, NULL, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *attribute_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, attributes, value, _0;
+ zval attribute;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&attribute);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_0);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(attribute)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &attribute_param, &defaultValue);
+ zephir_get_strval(&attribute, attribute_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&attributes, &_0);
+ zephir_memory_observe(&value);
+ if (!(zephir_array_isset_fetch(&value, &attributes, &attribute, 0))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&value);
}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getAttributes)
+{
+ zval attributes, _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&attributes, &_0);
+ RETURN_CCTOR(&attributes);
+}
-#ifdef HAVE_CONFIG_H
-#endif
-
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getDefault)
+{
+ RETURN_MEMBER(getThis(), "value");
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getFilters)
+{
+ RETURN_MEMBER(getThis(), "filters");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedJson)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getForm)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedJson, phalcon, storage_serializer_memcachedjson, phalcon_storage_serializer_none_ce, NULL, 0);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "form");
}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getLabel)
+{
+ RETURN_MEMBER(getThis(), "label");
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getMessages)
+{
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_MEMBER(getThis(), "messages");
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getName)
+{
+ RETURN_MEMBER(getThis(), "name");
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getTagFactory)
+{
+ RETURN_MEMBER(getThis(), "tagFactory");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedPhp)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getUserOption)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedPhp, phalcon, storage_serializer_memcachedphp, phalcon_storage_serializer_none_ce, NULL, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *option_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0;
+ zval option;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&option);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_0);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(option)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &option_param, &defaultValue);
+ zephir_get_strval(&option, option_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ zephir_memory_observe(&value);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&value, &_0, &option, 0))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&value);
}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getUserOptions)
+{
+ RETURN_MEMBER(getThis(), "options");
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getValidators)
+{
-#ifdef HAVE_CONFIG_H
-#endif
-
+ RETURN_MEMBER(getThis(), "validators");
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getValue)
+{
+ zval name, _0, form, value, _1$$4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&form);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1$$4);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&form, &_0);
+ ZEPHIR_INIT_VAR(&value);
+ ZVAL_NULL(&value);
+ if (Z_TYPE_P(&form) == IS_OBJECT) {
+ ZEPHIR_RETURN_CALL_METHOD(&form, "getvalue", NULL, 0, &name);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(&value) == IS_NULL) {
+ zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("value"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&value, &_1$$4);
+ }
+ RETURN_CCTOR(&value);
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, hasMessages)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Msgpack, phalcon, storage_serializer_msgpack, phalcon_storage_serializer_igbinary_ce, phalcon_storage_serializer_msgpack_method_entry, 0);
+ zval _0;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ RETURN_BOOL(zephir_fast_count_int(&_0) > 0);
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doSerialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, label)
{
+ zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub, _0;
+ zval *attributes_param = NULL, code, internalAttributes, labelName, name, tagFactory, _0$$3;
+ zval attributes;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&code);
+ ZVAL_UNDEF(&internalAttributes);
+ ZVAL_UNDEF(&labelName);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&tagFactory);
+ ZVAL_UNDEF(&_0$$3);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &value);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 0, &_0);
+ 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(&tagFactory, this_ptr, "getlocaltagfactory", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
+ zephir_memory_observe(&internalAttributes);
+ zephir_read_property(&internalAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
+ zephir_memory_observe(&name);
+ if (!(zephir_array_isset_string_fetch(&name, &internalAttributes, SL("id"), 0))) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_0$$3);
+ }
+ if (!(zephir_array_isset_string(&attributes, SL("for")))) {
+ zephir_array_update_string(&attributes, SL("for"), &name, PH_COPY | PH_SEPARATE);
+ }
+ zephir_memory_observe(&labelName);
+ zephir_read_property(&labelName, this_ptr, ZEND_STRL("label"), PH_NOISY_CC);
+ _1 = zephir_is_true(&labelName);
+ if (!(_1)) {
+ _1 = zephir_is_numeric(&labelName);
+ }
+ if (!(_1)) {
+ ZEPHIR_CPY_WRT(&labelName, &name);
+ }
+ ZEPHIR_CALL_METHOD(&code, &tagFactory, "label", NULL, 0, &labelName, &attributes);
+ zephir_check_call_status();
+ RETURN_CCTOR(&code);
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doUnserialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, render)
{
+ zval _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub;
+ zval *attributes_param = NULL, helper, merged, method, name, result, tagFactory, value, _0;
+ zval attributes;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&helper);
+ ZVAL_UNDEF(&merged);
+ ZVAL_UNDEF(&method);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&tagFactory);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &value);
- ZEPHIR_RETURN_CALL_FUNCTION("msgpack_unpack", NULL, 0, value);
+ 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_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_0);
+ ZEPHIR_CALL_METHOD(&value, this_ptr, "getvalue", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("method"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&method, &_0);
+ ZEPHIR_CALL_METHOD(&tagFactory, this_ptr, "getlocaltagfactory", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&helper, &tagFactory, "newinstance", NULL, 0, &method);
+ zephir_check_call_status();
+ if (zephir_array_isset_string(&attributes, SL("value"))) {
+ ZEPHIR_OBS_NVAR(&value);
+ zephir_array_fetch_string(&value, &attributes, SL("value"), PH_NOISY, "phalcon/Forms/Element/AbstractElement.zep", 391);
+ zephir_array_unset_string(&attributes, SL("value"), PH_SEPARATE);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&merged);
+ zephir_fast_array_merge(&merged, &_0, &attributes);
+ ZEPHIR_CALL_METHOD(&result, &helper, "__invoke", NULL, 0, &name, &value, &merged);
+ zephir_check_call_status();
+ zephir_cast_to_string(&_1, &result);
+ RETURN_CTOR(&_1);
}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setAttribute)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *attribute_param = NULL, *value, value_sub;
+ zval attribute;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&attribute);
+ ZVAL_UNDEF(&value_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(attribute)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &attribute_param, &value);
+ zephir_get_strval(&attribute, attribute_param);
+ zephir_update_property_array(this_ptr, SL("attributes"), &attribute, value);
+ RETURN_THIS();
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setAttributes)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *attributes_param = NULL;
+ zval attributes;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
+ ZVAL_UNDEF(&attributes);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(attributes)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &attributes_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
+ RETURN_THIS();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setDefault)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, None, phalcon, storage_serializer_none, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_none_method_entry, 0);
+ zval *value, value_sub;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&value_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &value);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("value"), value);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_None, serialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setFilters)
{
+ zend_bool _0;
+ zval *filters, filters_sub;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "data");
+ ZVAL_UNDEF(&filters_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(filters)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &filters);
+ _0 = Z_TYPE_P(filters) != IS_STRING;
+ if (_0) {
+ _0 = Z_TYPE_P(filters) != IS_ARRAY;
+ }
+ if (UNEXPECTED(_0)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_forms_exception_ce, "The filter needs to be an array or string", "phalcon/Forms/Element/AbstractElement.zep", 440);
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filters"), filters);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setForm)
{
- zval data_sub;
- zval *data;
+ zval *form, form_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&form_sub);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_OBJECT_OF_CLASS(form, phalcon_forms_form_ce)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &data);
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
+ zephir_fetch_params_without_memory_grow(1, 0, &form);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("form"), form);
+ RETURN_THISW();
}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setLabel)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *label_param = NULL;
+ zval label;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&label);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(label)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &label_param);
+ zephir_get_strval(&label, label_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("label"), &label);
+ RETURN_THIS();
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setMessages)
+{
+ zval *messages, messages_sub;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ ZVAL_UNDEF(&messages_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(messages, phalcon_messages_messages_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &messages);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), messages);
+ RETURN_THISW();
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setName)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *name_param = NULL;
+ zval name;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&name);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ RETURN_THIS();
+}
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setTagFactory)
+{
+ zval *tagFactory, tagFactory_sub;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&tagFactory_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(tagFactory, phalcon_html_tagfactory_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &tagFactory);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("tagFactory"), tagFactory);
+ RETURN_THISW();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Php)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setUserOption)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Php, phalcon, storage_serializer_php, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_php_method_entry, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *option_param = NULL, *value, value_sub;
+ zval option;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&option);
+ ZVAL_UNDEF(&value_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(option)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &option_param, &value);
+ zephir_get_strval(&option, option_param);
+ zephir_update_property_array(this_ptr, SL("options"), &option, value);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setUserOptions)
{
- zval _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *options_param = NULL;
+ zval options;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&options);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, &_1);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- RETURN_MM_MEMBER(getThis(), "data");
- }
- zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 15, &_2);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 1, 0, &options_param);
+ zephir_get_arrval(&options, options_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize)
+static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getLocalTagFactory)
{
- zend_bool _8;
+ zval container, escaper, tagFactory, _0, _1$$3, _2$$4, _3$$5, _4$$5, _5$$6, _6$$7, _7$$7, _8$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval data_sub, __$false, __$true, result, version, _0, _1, _2, _3, _4$$4, _5$$4, _6$$5, _7$$5;
- zval *data;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&version);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&escaper);
+ ZVAL_UNDEF(&tagFactory);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$5);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(data)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_8$$8);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &data);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data);
- RETURN_MM_NULL();
- }
- ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 133);
- zephir_check_call_status();
- ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "8.0");
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, ">=");
- ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 134, &version, &_1, &_2);
- zephir_check_call_status();
- if (zephir_is_true(&_3)) {
- ZEPHIR_INIT_VAR(&_4$$4);
- ZEPHIR_INIT_NVAR(&_4$$4);
- zephir_create_closure_ex(&_4$$4, NULL, phalcon_11__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_5$$4, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 135, &_4$$4, &_5$$4);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_VAR(&_6$$5);
- ZEPHIR_INIT_NVAR(&_6$$5);
- zephir_create_closure_ex(&_6$$5, NULL, phalcon_12__closure_ce, SL("__invoke"));
- ZVAL_LONG(&_7$$5, 8);
- ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 135, &_6$$5, &_7$$5);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(&result, this_ptr, "phpunserialize", NULL, 0, data);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 136);
- zephir_check_call_status();
- _8 = ZEPHIR_GLOBAL(warning).enable;
- if (!(_8)) {
- _8 = ZEPHIR_IS_FALSE_IDENTICAL(&result);
- }
- if (UNEXPECTED(_8)) {
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
+
+ ZEPHIR_INIT_VAR(&tagFactory);
+ ZVAL_NULL(&tagFactory);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("tagFactory"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(ZEPHIR_IS_EMPTY(&_0))) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_1$$3) != IS_NULL) {
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&tagFactory, &_2$$4, "gettagfactory", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_INIT_NVAR(&result);
- ZVAL_STRING(&result, "");
- } else {
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false);
+ if (Z_TYPE_P(&tagFactory) == IS_NULL) {
+ ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4$$5);
+ ZVAL_STRING(&_4$$5, "tag");
+ ZEPHIR_CALL_METHOD(&_3$$5, &container, "has", NULL, 0, &_4$$5);
+ zephir_check_call_status();
+ if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_3$$5))) {
+ ZEPHIR_INIT_VAR(&_5$$6);
+ ZVAL_STRING(&_5$$6, "tag");
+ ZEPHIR_CALL_METHOD(&tagFactory, &container, "getshared", NULL, 0, &_5$$6);
+ zephir_check_call_status();
+ }
+ }
+ if (Z_TYPE_P(&tagFactory) == IS_NULL) {
+ ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_7$$7);
+ ZVAL_STRING(&_7$$7, "escaper");
+ ZEPHIR_CALL_METHOD(&_6$$7, &container, "has", NULL, 0, &_7$$7);
+ zephir_check_call_status();
+ if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_6$$7))) {
+ ZEPHIR_INIT_VAR(&_8$$8);
+ ZVAL_STRING(&_8$$8, "escaper");
+ ZEPHIR_CALL_METHOD(&escaper, &container, "getshared", NULL, 0, &_8$$8);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&escaper);
+ object_init_ex(&escaper, phalcon_html_escaper_ce);
+ if (zephir_has_constructor(&escaper)) {
+ ZEPHIR_CALL_METHOD(NULL, &escaper, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+
+ }
+ ZEPHIR_INIT_NVAR(&tagFactory);
+ object_init_ex(&tagFactory, phalcon_html_tagfactory_ce);
+ ZEPHIR_CALL_METHOD(NULL, &tagFactory, "__construct", NULL, 9, &escaper);
+ zephir_check_call_status();
}
+ zephir_update_property_zval(this_ptr, ZEND_STRL("tagFactory"), &tagFactory);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_MEMBER(getThis(), "tagFactory");
}
-static PHP_METHOD(Phalcon_Storage_Serializer_Php, phpUnserialize)
+zend_object *zephir_init_properties_Phalcon_Forms_Element_AbstractElement(zend_class_entry *class_type)
{
+ zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *data_param = NULL, *options_param = NULL;
- zval data;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_7$$6);
+
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(data)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &data_param, &options_param);
- zephir_get_strval(&data, data_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- zephir_get_arrval(&options, options_param);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ {
+ zval local_this_ptr, *this_ptr = &local_this_ptr;
+ ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("validators"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("validators"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_2) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ array_init(&_3$$4);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_3$$4);
+ }
+ zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("filters"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_4) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_5$$5);
+ array_init(&_5$$5);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("filters"), &_5$$5);
+ }
+ zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_6) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_7$$6);
+ array_init(&_7$$6);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("attributes"), &_7$$6);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
}
- ZEPHIR_RETURN_CALL_FUNCTION("unserialize", NULL, 16, &data, &options);
- zephir_check_call_status();
- RETURN_MM();
}
@@ -150973,10 +148179,11 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Php, phpUnserialize)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisIgbinary)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Check)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisIgbinary, phalcon, storage_serializer_redisigbinary, phalcon_storage_serializer_none_ce, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Check, phalcon, forms_element_check, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ zend_declare_property_string(phalcon_forms_element_check_ce, SL("method"), "inputCheckbox", ZEND_ACC_PROTECTED);
return SUCCESS;
}
@@ -150990,10 +148197,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisIgbinary)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisJson)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Date)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisJson, phalcon, storage_serializer_redisjson, phalcon_storage_serializer_none_ce, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Date, phalcon, forms_element_date, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ zend_declare_property_string(phalcon_forms_element_date_ce, SL("method"), "inputDate", ZEND_ACC_PROTECTED);
return SUCCESS;
}
@@ -151007,13 +148215,43 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisJson)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisMsgpack)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_ElementInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisMsgpack, phalcon, storage_serializer_redismsgpack, phalcon_storage_serializer_none_ce, NULL, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Forms\\Element, ElementInterface, phalcon, forms_element_elementinterface, phalcon_forms_element_elementinterface_method_entry);
return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, addFilter);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, addValidator);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, addValidators);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, appendMessage);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, clear);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getAttribute);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getAttributes);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getDefault);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getFilters);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getForm);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getLabel);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getMessages);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getUserOption);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getUserOptions);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getValidators);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getValue);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, hasMessages);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, label);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, render);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setAttribute);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setAttributes);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setDefault);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setFilters);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setForm);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setLabel);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setMessages);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setName);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setUserOption);
+ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setUserOptions);
@@ -151024,10 +148262,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisMsgpack)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisNone)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Email)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisNone, phalcon, storage_serializer_redisnone, phalcon_storage_serializer_none_ce, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Email, phalcon, forms_element_email, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ zend_declare_property_string(phalcon_forms_element_email_ce, SL("method"), "inputEmail", ZEND_ACC_PROTECTED);
return SUCCESS;
}
@@ -151041,10 +148280,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisNone)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisPhp)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_File)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisPhp, phalcon, storage_serializer_redisphp, phalcon_storage_serializer_none_ce, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, File, phalcon, forms_element_file, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ zend_declare_property_string(phalcon_forms_element_file_ce, SL("method"), "inputFile", ZEND_ACC_PROTECTED);
return SUCCESS;
}
@@ -151058,16 +148298,14 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisPhp)
-ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_SerializerInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Hidden)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Storage\\Serializer, SerializerInterface, phalcon, storage_serializer_serializerinterface, phalcon_storage_serializer_serializerinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Hidden, phalcon, forms_element_hidden, phalcon_forms_element_abstractelement_ce, NULL, 0);
- zend_class_implements(phalcon_storage_serializer_serializerinterface_ce, 1, zend_ce_serializable);
+ zend_declare_property_string(phalcon_forms_element_hidden_ce, SL("method"), "inputHidden", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Serializer_SerializerInterface, getData);
-ZEPHIR_DOC_METHOD(Phalcon_Storage_Serializer_SerializerInterface, setData);
@@ -151078,34 +148316,14 @@ ZEPHIR_DOC_METHOD(Phalcon_Storage_Serializer_SerializerInterface, setData);
-ZEPHIR_INIT_CLASS(Phalcon_Di_AbstractInjectionAware)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Numeric)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Di, AbstractInjectionAware, phalcon, di_abstractinjectionaware, zend_standard_class_def, phalcon_di_abstractinjectionaware_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Numeric, phalcon, forms_element_numeric, phalcon_forms_element_abstractelement_ce, NULL, 0);
- zend_declare_property_null(phalcon_di_abstractinjectionaware_ce, SL("container"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_di_abstractinjectionaware_ce, 1, phalcon_di_injectionawareinterface_ce);
+ zend_declare_property_string(phalcon_forms_element_numeric_ce, SL("method"), "inputNumeric", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Di_AbstractInjectionAware, getDI)
-{
-
- RETURN_MEMBER(getThis(), "container");
-}
-
-static PHP_METHOD(Phalcon_Di_AbstractInjectionAware, setDI)
-{
- zval *container, container_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&container_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &container);
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
-}
-
@@ -151116,1002 +148334,242 @@ static PHP_METHOD(Phalcon_Di_AbstractInjectionAware, setDI)
-ZEPHIR_INIT_CLASS(Phalcon_Di_Di)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Password)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Di, Di, phalcon, di_di, phalcon_di_di_method_entry, 0);
-
- zend_declare_property_null(phalcon_di_di_ce, SL("services"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_di_di_ce, SL("sharedInstances"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_di_di_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_di_di_ce, SL("defaultDi"), ZEND_ACC_PROTECTED|ZEND_ACC_STATIC);
- phalcon_di_di_ce->create_object = zephir_init_properties_Phalcon_Di_Di;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Password, phalcon, forms_element_password, phalcon_forms_element_abstractelement_ce, NULL, 0);
- zend_class_implements(phalcon_di_di_ce, 1, phalcon_di_diinterface_ce);
+ zend_declare_property_string(phalcon_forms_element_password_ce, SL("method"), "inputPassword", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Di_Di, __construct)
-{
- zval _0;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- zephir_read_static_property_ce(&_0, phalcon_di_di_ce, SL("defaultDi"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_is_true(&_0))) {
- zephir_update_static_property_ce(phalcon_di_di_ce, ZEND_STRL("defaultDi"), this_ptr);
- }
-}
-
-static PHP_METHOD(Phalcon_Di_Di, __call)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval arguments;
- zval *method_param = NULL, *arguments_param = NULL, instance, possibleService, definition, _6, _0$$3, _1$$3, _2$$3, _3$$6, _4$$6, _5$$6;
- zval method, _7;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&instance);
- ZVAL_UNDEF(&possibleService);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&arguments);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(method)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(arguments)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &method_param, &arguments_param);
- if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) {
- zephir_get_strval(&method, method_param);
- } else {
- ZEPHIR_INIT_VAR(&method);
- }
- if (!arguments_param) {
- ZEPHIR_INIT_VAR(&arguments);
- array_init(&arguments);
- } else {
- zephir_get_arrval(&arguments, arguments_param);
- }
- if (zephir_start_with_str(&method, SL("get"))) {
- ZVAL_LONG(&_0$$3, 3);
- ZEPHIR_INIT_VAR(&_1$$3);
- zephir_substr(&_1$$3, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
- ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", NULL, 77, &_1$$3);
- zephir_check_call_status();
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_2$$3, &possibleService)) {
- ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, &possibleService, &arguments);
- zephir_check_call_status();
- RETURN_CCTOR(&instance);
- }
- }
- if (zephir_start_with_str(&method, SL("set"))) {
- zephir_memory_observe(&definition);
- if (zephir_array_isset_long_fetch(&definition, &arguments, 0, 0)) {
- ZVAL_LONG(&_3$$6, 3);
- ZEPHIR_INIT_VAR(&_4$$6);
- zephir_substr(&_4$$6, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
- ZEPHIR_CALL_FUNCTION(&_5$$6, "lcfirst", NULL, 77, &_4$$6);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, &_5$$6, &definition);
- zephir_check_call_status();
- RETURN_MM_NULL();
- }
- }
- ZEPHIR_INIT_VAR(&_6);
- object_init_ex(&_6, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_7);
- ZEPHIR_CONCAT_SVS(&_7, "Call to undefined method or service '", &method, "'");
- ZEPHIR_CALL_METHOD(NULL, &_6, "__construct", NULL, 33, &_7);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_6, "phalcon/Di/Di.zep", 147);
- ZEPHIR_MM_RESTORE();
- return;
-}
-static PHP_METHOD(Phalcon_Di_Di, attempt)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool shared;
- zval *name_param = NULL, *definition, definition_sub, *shared_param = NULL, _0, _1, _2, _3, _4;
- zval name;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(definition)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(shared)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &name_param, &definition, &shared_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!shared_param) {
- shared = 0;
- } else {
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_0, &name)) {
- RETURN_MM_BOOL(0);
- }
- ZEPHIR_INIT_VAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- if (shared) {
- ZVAL_BOOL(&_2, 1);
- } else {
- ZVAL_BOOL(&_2, 0);
- }
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, definition, &_2);
- zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("services"), &name, &_1);
- zephir_read_property(&_3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_4, &_3, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 163);
- RETURN_CTOR(&_4);
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Di_Di, get)
-{
- zval _7$$5, _18$$18;
- zend_bool _1$$3, _15$$11;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *parameters = NULL, parameters_sub, __$null, service, isShared, instance, _0, _5, _16, _2$$3, _3$$4, _4$$4, _6$$5, _8$$5, _9$$7, _10$$7, _11$$9, _13$$12, _17$$18, _19$$18;
- zval name, _12$$9, _14$$12;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_12$$9);
- ZVAL_UNDEF(&_14$$12);
- ZVAL_UNDEF(¶meters_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&service);
- ZVAL_UNDEF(&isShared);
- ZVAL_UNDEF(&instance);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_16);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_8$$5);
- ZVAL_UNDEF(&_9$$7);
- ZVAL_UNDEF(&_10$$7);
- ZVAL_UNDEF(&_11$$9);
- ZVAL_UNDEF(&_13$$12);
- ZVAL_UNDEF(&_17$$18);
- ZVAL_UNDEF(&_19$$18);
- ZVAL_UNDEF(&_7$$5);
- ZVAL_UNDEF(&_18$$18);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(parameters)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, ¶meters);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!parameters) {
- parameters = ¶meters_sub;
- parameters = &__$null;
- }
- ZEPHIR_INIT_VAR(&instance);
- ZVAL_NULL(&instance);
- zephir_memory_observe(&service);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset_fetch(&service, &_0, &name, 0)) {
- ZEPHIR_CALL_METHOD(&isShared, &service, "isshared", NULL, 0);
- zephir_check_call_status();
- _1$$3 = zephir_is_true(&isShared);
- if (_1$$3) {
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("sharedInstances"), PH_NOISY_CC | PH_READONLY);
- _1$$3 = zephir_array_isset(&_2$$3, &name);
- }
- if (_1$$3) {
- zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("sharedInstances"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_4$$4, &_3$$4, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 181);
- RETURN_CTOR(&_4$$4);
- }
- }
- zephir_read_property(&_5, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_5) != IS_NULL) {
- zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_7$$5);
- zephir_create_array(&_7$$5, 2, 0);
- zephir_array_update_string(&_7$$5, SL("name"), &name, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_7$$5, SL("parameters"), parameters, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_8$$5);
- ZVAL_STRING(&_8$$5, "di:beforeServiceResolve");
- ZEPHIR_CALL_METHOD(&instance, &_6$$5, "fire", NULL, 0, &_8$$5, this_ptr, &_7$$5);
- zephir_check_call_status();
- }
- if (Z_TYPE_P(&instance) == IS_NULL) {
- if (Z_TYPE_P(&service) != IS_NULL) {
- /* try_start_1: */
- ZEPHIR_CALL_METHOD(&instance, &service, "resolve", NULL, 0, parameters, this_ptr);
- zephir_check_call_status_or_jump(try_end_1);
- try_end_1:
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Radio)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Radio, phalcon, forms_element_radio, phalcon_forms_element_abstractelement_ce, NULL, 0);
- if (EG(exception)) {
- ZEPHIR_INIT_VAR(&_9$$7);
- ZVAL_OBJ(&_9$$7, EG(exception));
- Z_ADDREF_P(&_9$$7);
- ZEPHIR_INIT_VAR(&_10$$7);
- if (zephir_instance_of_ev(&_9$$7, phalcon_di_exception_serviceresolutionexception_ce)) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&_10$$7, &_9$$7);
- ZEPHIR_INIT_VAR(&_11$$9);
- object_init_ex(&_11$$9, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_12$$9);
- ZEPHIR_CONCAT_SVS(&_12$$9, "Service '", &name, "' cannot be resolved");
- ZEPHIR_CALL_METHOD(NULL, &_11$$9, "__construct", NULL, 33, &_12$$9);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_11$$9, "phalcon/Di/Di.zep", 208);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- if (zephir_is_true(&isShared)) {
- zephir_update_property_array(this_ptr, SL("sharedInstances"), &name, &instance);
- }
- } else {
- if (UNEXPECTED(!(zephir_class_exists(&name, 1)))) {
- ZEPHIR_INIT_VAR(&_13$$12);
- object_init_ex(&_13$$12, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_14$$12);
- ZEPHIR_CONCAT_SVS(&_14$$12, "Service '", &name, "' was not found in the dependency injection container");
- ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", NULL, 33, &_14$$12);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_13$$12, "phalcon/Di/Di.zep", 223);
- ZEPHIR_MM_RESTORE();
- return;
- }
- _15$$11 = Z_TYPE_P(parameters) == IS_ARRAY;
- if (_15$$11) {
- _15$$11 = ((zephir_fast_count_int(parameters)) ? 1 : 0);
- }
- if (_15$$11) {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &name, parameters);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &name);
- zephir_check_call_status();
- }
- }
- }
- if (Z_TYPE_P(&instance) == IS_OBJECT) {
- if (zephir_instance_of_ev(&instance, phalcon_di_injectionawareinterface_ce)) {
- ZEPHIR_CALL_METHOD(NULL, &instance, "setdi", NULL, 0, this_ptr);
- zephir_check_call_status();
- }
- if (zephir_instance_of_ev(&instance, phalcon_di_initializationawareinterface_ce)) {
- ZEPHIR_CALL_METHOD(NULL, &instance, "initialize", NULL, 0);
- zephir_check_call_status();
- }
- }
- zephir_read_property(&_16, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_16) != IS_NULL) {
- zephir_read_property(&_17$$18, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_18$$18);
- zephir_create_array(&_18$$18, 3, 0);
- zephir_array_update_string(&_18$$18, SL("name"), &name, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_18$$18, SL("parameters"), parameters, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_18$$18, SL("instance"), &instance, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_19$$18);
- ZVAL_STRING(&_19$$18, "di:afterServiceResolve");
- ZEPHIR_CALL_METHOD(NULL, &_17$$18, "fire", NULL, 0, &_19$$18, this_ptr, &_18$$18);
- zephir_check_call_status();
- }
- RETURN_CCTOR(&instance);
+ zend_declare_property_string(phalcon_forms_element_radio_ce, SL("method"), "inputRadio", ZEND_ACC_PROTECTED);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Di_Di, getDefault)
-{
- zval _0;
- ZVAL_UNDEF(&_0);
- zephir_read_static_property_ce(&_0, phalcon_di_di_ce, SL("defaultDi"), PH_NOISY_CC | PH_READONLY);
- RETURN_CTORW(&_0);
-}
-static PHP_METHOD(Phalcon_Di_Di, getInternalEventsManager)
-{
- RETURN_MEMBER(getThis(), "eventsManager");
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Di_Di, getRaw)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, service, _0, _1$$3;
- zval name, _2$$3;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&service);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- zephir_memory_observe(&service);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&service, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Service '", &name, "' was not found in the dependency injection container");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 293);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_RETURN_CALL_METHOD(&service, "getdefinition", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
-}
-static PHP_METHOD(Phalcon_Di_Di, getService)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, service, _0, _1$$3;
- zval name, _2$$3;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&service);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- zephir_memory_observe(&service);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&service, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Service '", &name, "' was not found in the dependency injection container");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 309);
- ZEPHIR_MM_RESTORE();
- return;
- }
- RETURN_CCTOR(&service);
-}
-static PHP_METHOD(Phalcon_Di_Di, getServices)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Select)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Select, phalcon, forms_element_select, phalcon_forms_element_abstractelement_ce, phalcon_forms_element_select_method_entry, 0);
- RETURN_MEMBER(getThis(), "services");
+ zend_declare_property_null(phalcon_forms_element_select_ce, SL("optionsValues"), ZEND_ACC_PROTECTED);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Di_Di, getShared)
+static PHP_METHOD(Phalcon_Forms_Element_Select, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *parameters = NULL, parameters_sub, __$null, instance, _0;
+ zval attributes;
+ zval *name_param = NULL, *options = NULL, options_sub, *attributes_param = NULL, __$null;
zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(¶meters_sub);
+ ZVAL_UNDEF(&options_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&instance);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&attributes);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(parameters)
+ Z_PARAM_ZVAL_OR_NULL(options)
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, ¶meters);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 2, &name_param, &options, &attributes_param);
+ zephir_get_strval(&name, name_param);
+ if (!options) {
+ options = &options_sub;
+ options = &__$null;
}
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
} else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!parameters) {
- parameters = ¶meters_sub;
- parameters = &__$null;
- }
- zephir_memory_observe(&instance);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("sharedInstances"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&instance, &_0, &name, 0))) {
- ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, &name, parameters);
- zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("sharedInstances"), &name, &instance);
+ zephir_get_arrval(&attributes, attributes_param);
}
- RETURN_CCTOR(&instance);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("optionsValues"), options);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_forms_element_select_ce, getThis(), "__construct", NULL, 0, &name, &attributes);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Di_Di, loadFromConfig)
+static PHP_METHOD(Phalcon_Forms_Element_Select, addOption)
{
- zend_bool _4$$3, _8$$4;
- zend_string *_3;
- zend_ulong _2;
+ zend_string *_3$$3;
+ zend_ulong _2$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_7 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config, config_sub, services, name, service, *_0, _1, _5$$3, _6$$3, _9$$4, _10$$4;
+ zval *option, option_sub, key, value, *_0$$3, _1$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config_sub);
- ZVAL_UNDEF(&services);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&service);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&_10$$4);
+ ZVAL_UNDEF(&option_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(config, phalcon_config_configinterface_ce)
+ Z_PARAM_ZVAL(option)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &config);
- ZEPHIR_CALL_METHOD(&services, config, "toarray", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&services, 0, "phalcon/Di/Di.zep", 359);
- if (Z_TYPE_P(&services) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&services), _2, _3, _0)
- {
- ZEPHIR_INIT_NVAR(&name);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&name, _3);
- } else {
- ZVAL_LONG(&name, _2);
- }
- ZEPHIR_INIT_NVAR(&service);
- ZVAL_COPY(&service, _0);
- _4$$3 = zephir_array_isset_string(&service, SL("shared"));
- if (_4$$3) {
- ZEPHIR_OBS_NVAR(&_5$$3);
- zephir_array_fetch_string(&_5$$3, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 357);
- _4$$3 = zephir_is_true(&_5$$3);
- }
- ZVAL_BOOL(&_6$$3, _4$$3);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", &_7, 0, &name, &service, &_6$$3);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &services, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &services, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&name, &services, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&service, &services, "current", NULL, 0);
+ zephir_fetch_params(1, 1, 0, &option);
+ if (Z_TYPE_P(option) == IS_ARRAY) {
+ zephir_is_iterable(option, 0, "phalcon/Forms/Element/Select.zep", 51);
+ if (Z_TYPE_P(option) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(option), _2$$3, _3$$3, _0$$3)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_3$$3 != NULL) {
+ ZVAL_STR_COPY(&key, _3$$3);
+ } else {
+ ZVAL_LONG(&key, _2$$3);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0$$3);
+ zephir_update_property_array(this_ptr, SL("optionsValues"), &key, &value);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, option, "rewind", NULL, 0);
zephir_check_call_status();
- _8$$4 = zephir_array_isset_string(&service, SL("shared"));
- if (_8$$4) {
- ZEPHIR_OBS_NVAR(&_9$$4);
- zephir_array_fetch_string(&_9$$4, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 357);
- _8$$4 = zephir_is_true(&_9$$4);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, option, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1$$3)) {
+ break;
}
- ZVAL_BOOL(&_10$$4, _8$$4);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", &_7, 0, &name, &service, &_10$$4);
+ ZEPHIR_CALL_METHOD(&key, option, "key", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &services, "next", NULL, 0);
- zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, option, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("optionsValues"), &key, &value);
+ ZEPHIR_CALL_METHOD(NULL, option, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- }
- ZEPHIR_INIT_NVAR(&service);
- ZEPHIR_INIT_NVAR(&name);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, loadFromPhp)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filePath_param = NULL, services;
- zval filePath;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&filePath);
- ZVAL_UNDEF(&services);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filePath)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filePath_param);
- if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) {
- zephir_get_strval(&filePath, filePath_param);
- } else {
- ZEPHIR_INIT_VAR(&filePath);
- }
- ZEPHIR_INIT_VAR(&services);
- object_init_ex(&services, phalcon_config_adapter_php_ce);
- ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 79, &filePath);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, loadFromYaml)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval callbacks;
- zval *filePath_param = NULL, *callbacks_param = NULL, services;
- zval filePath;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&filePath);
- ZVAL_UNDEF(&services);
- ZVAL_UNDEF(&callbacks);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(filePath)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_OR_NULL(callbacks)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &filePath_param, &callbacks_param);
- if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) {
- zephir_get_strval(&filePath, filePath_param);
- } else {
- ZEPHIR_INIT_VAR(&filePath);
- }
- if (!callbacks_param) {
- ZEPHIR_INIT_VAR(&callbacks);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&callbacks, callbacks_param);
- }
- ZEPHIR_INIT_VAR(&services);
- object_init_ex(&services, phalcon_config_adapter_yaml_ce);
- ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 80, &filePath, &callbacks);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, has)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, _0;
- zval name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &name));
-}
-
-static PHP_METHOD(Phalcon_Di_Di, offsetGet)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval name_sub;
- zval *name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getshared", NULL, 0, name);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, offsetExists)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval name_sub;
- zval *name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, name);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, offsetSet)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval offset_sub, value_sub;
- zval *offset, *value;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&offset_sub);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(offset)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &offset, &value);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setshared", NULL, 0, offset, value);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, offsetUnset)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval name_sub;
- zval *name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "remove", NULL, 0, name);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, register)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *provider, provider_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&provider_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(provider, phalcon_di_serviceproviderinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &provider);
- ZEPHIR_CALL_METHOD(NULL, provider, "register", NULL, 0, this_ptr);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Di_Di, remove)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, services, _0, sharedInstances;
- zval name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&services);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&sharedInstances);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
} else {
- ZEPHIR_INIT_VAR(&name);
+ zephir_update_property_array_append(this_ptr, SL("optionsValues"), option);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&services, &_0);
- zephir_array_unset(&services, &name, PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("services"), &services);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("sharedInstances"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&sharedInstances, &_0);
- zephir_array_unset(&sharedInstances, &name, PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("sharedInstances"), &sharedInstances);
- ZEPHIR_MM_RESTORE();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Di_Di, reset)
+static PHP_METHOD(Phalcon_Forms_Element_Select, getOptions)
{
- zval __$null;
- ZVAL_NULL(&__$null);
- zephir_update_static_property_ce(phalcon_di_di_ce, ZEND_STRL("defaultDi"), &__$null);
+ RETURN_MEMBER(getThis(), "optionsValues");
}
-static PHP_METHOD(Phalcon_Di_Di, set)
+static PHP_METHOD(Phalcon_Forms_Element_Select, render)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool shared;
- zval *name_param = NULL, *definition, definition_sub, *shared_param = NULL, _0, _1, _2, _3;
- zval name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(definition)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(shared)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &name_param, &definition, &shared_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!shared_param) {
- shared = 0;
- } else {
- }
- ZEPHIR_INIT_VAR(&_0);
- object_init_ex(&_0, phalcon_di_service_ce);
- if (shared) {
- ZVAL_BOOL(&_1, 1);
- } else {
- ZVAL_BOOL(&_1, 0);
- }
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 78, definition, &_1);
- zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("services"), &name, &_0);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_3, &_2, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 550);
- RETURN_CTOR(&_3);
-}
-
-static PHP_METHOD(Phalcon_Di_Di, setDefault)
-{
- zval *container, container_sub;
-
- ZVAL_UNDEF(&container_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &container);
- zephir_update_static_property_ce(phalcon_di_di_ce, ZEND_STRL("defaultDi"), container);
-}
-
-static PHP_METHOD(Phalcon_Di_Di, setInternalEventsManager)
-{
- zval *eventsManager, eventsManager_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&eventsManager_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
- zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
-}
-
-static PHP_METHOD(Phalcon_Di_Di, setService)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *rawDefinition, rawDefinition_sub;
- zval name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&rawDefinition_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OBJECT_OF_CLASS(rawDefinition, phalcon_di_serviceinterface_ce)
+ zval *attributes_param = NULL, _0, _1;
+ zval attributes;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &name_param, &rawDefinition);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 0, 1, &attributes_param);
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
} else {
- ZEPHIR_INIT_VAR(&name);
+ zephir_get_arrval(&attributes, attributes_param);
}
- zephir_update_property_array(this_ptr, SL("services"), &name, rawDefinition);
- RETVAL_ZVAL(rawDefinition, 1, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "prepareattributes", NULL, 0, &attributes);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("optionsValues"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", NULL, 0, &_0, &_1);
+ zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Di_Di, setShared)
+static PHP_METHOD(Phalcon_Forms_Element_Select, setOptions)
+{
+ zval *options, options_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&options_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(options)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &options);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("optionsValues"), options);
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Forms_Element_Select, prepareAttributes)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *definition, definition_sub, _0;
- zval name;
+ zval *attributes_param = NULL, value, name, mergedAttributes, defaultAttributes, _0;
+ zval attributes;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition_sub);
+ ZVAL_UNDEF(&mergedAttributes);
+ ZVAL_UNDEF(&defaultAttributes);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_ZVAL(definition)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(attributes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &name_param, &definition);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 0, 1, &attributes_param);
+ if (!attributes_param) {
+ ZEPHIR_INIT_VAR(&attributes);
+ array_init(&attributes);
} else {
- ZEPHIR_INIT_VAR(&name);
+ zephir_get_arrval(&attributes, attributes_param);
}
- ZVAL_BOOL(&_0, 1);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &name, definition, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_0);
+ zephir_array_update_long(&attributes, 0, &name, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ zephir_memory_observe(&defaultAttributes);
+ zephir_read_property(&defaultAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
+ ZEPHIR_INIT_VAR(&mergedAttributes);
+ zephir_fast_array_merge(&mergedAttributes, &defaultAttributes, &attributes);
+ ZEPHIR_CALL_METHOD(&value, this_ptr, "getvalue", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
-}
-
-zend_object *zephir_init_properties_Phalcon_Di_Di(zend_class_entry *class_type)
-{
- zval _0, _2, _1$$3, _3$$4;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("sharedInstances"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("sharedInstances"), &_1$$3);
- }
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_2) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_3$$4);
- array_init(&_3$$4);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("services"), &_3$$4);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ if (Z_TYPE_P(&value) != IS_NULL) {
+ zephir_array_update_string(&mergedAttributes, SL("value"), &value, PH_COPY | PH_SEPARATE);
}
+ RETURN_CCTOR(&mergedAttributes);
}
@@ -152124,28 +148582,14 @@ zend_object *zephir_init_properties_Phalcon_Di_Di(zend_class_entry *class_type)
-ZEPHIR_INIT_CLASS(Phalcon_Di_DiInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Submit)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Di, DiInterface, phalcon, di_diinterface, phalcon_di_diinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Submit, phalcon, forms_element_submit, phalcon_forms_element_abstractelement_ce, NULL, 0);
- zend_class_implements(phalcon_di_diinterface_ce, 1, zend_ce_arrayaccess);
+ zend_declare_property_string(phalcon_forms_element_submit_ce, SL("method"), "inputSubmit", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, attempt);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, getDefault);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, getRaw);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, getService);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, getServices);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, getShared);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, remove);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, reset);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, set);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, setDefault);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, setService);
-ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, setShared);
@@ -152156,9 +148600,9 @@ ZEPHIR_DOC_METHOD(Phalcon_Di_DiInterface, setShared);
-ZEPHIR_INIT_CLASS(Phalcon_Di_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Text)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Di, Exception, phalcon, di_exception, zend_ce_exception, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Text, phalcon, forms_element_text, phalcon_forms_element_abstractelement_ce, NULL, 0);
return SUCCESS;
}
@@ -152173,227 +148617,14 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Di_FactoryDefault)
+ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_TextArea)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Di, FactoryDefault, phalcon, di_factorydefault, phalcon_di_di_ce, phalcon_di_factorydefault_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, TextArea, phalcon, forms_element_textarea, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ zend_declare_property_string(phalcon_forms_element_textarea_ce, SL("method"), "inputTextarea", ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct)
-{
- zval _0, _4, _5, _6, _8;
- zval filter, _1, _2, _3, _7;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&filter);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_8);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_PARENT(NULL, phalcon_di_factorydefault_ce, getThis(), "__construct", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&filter);
- object_init_ex(&filter, phalcon_filter_filterfactory_ce);
- if (zephir_has_constructor(&filter)) {
- ZEPHIR_CALL_METHOD(NULL, &filter, "__construct", NULL, 0);
- zephir_check_call_status();
- }
-
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 20, 0);
- ZEPHIR_INIT_VAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Annotations\\Adapter\\Memory");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("annotations"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_VAR(&_4);
- zephir_create_array(&_4, 2, 0);
- add_assoc_stringl_ex(&_4, SL("className"), SL("Phalcon\\Assets\\Manager"));
- ZEPHIR_INIT_VAR(&_5);
- zephir_create_array(&_5, 1, 0);
- ZEPHIR_INIT_VAR(&_6);
- zephir_create_array(&_6, 2, 0);
- add_assoc_stringl_ex(&_6, SL("type"), SL("service"));
- add_assoc_stringl_ex(&_6, SL("name"), SL("tag"));
- zephir_array_fast_append(&_5, &_6);
- zephir_array_update_string(&_4, SL("arguments"), &_5, PH_COPY | PH_SEPARATE);
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_4, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("assets"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Encryption\\Crypt");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("crypt"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Http\\Response\\Cookies");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("cookies"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Dispatcher");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("dispatcher"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Html\\Escaper");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("escaper"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Events\\Manager");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("eventsManager"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Flash\\Direct");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("flash"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Flash\\Session");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("flashSession"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_CALL_METHOD(&_7, &filter, "newinstance", NULL, 94);
- zephir_check_call_status();
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_7, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("filter"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Support\\HelperFactory");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("helper"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Model\\Manager");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("modelsManager"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Model\\MetaData\\Memory");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("modelsMetadata"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Http\\Request");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("request"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Http\\Response");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("response"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Router");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("router"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Encryption\\Security");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("security"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_5);
- zephir_create_array(&_5, 2, 0);
- add_assoc_stringl_ex(&_5, SL("className"), SL("Phalcon\\Html\\TagFactory"));
- ZEPHIR_INIT_NVAR(&_6);
- zephir_create_array(&_6, 1, 0);
- ZEPHIR_INIT_VAR(&_8);
- zephir_create_array(&_8, 2, 0);
- add_assoc_stringl_ex(&_8, SL("type"), SL("service"));
- add_assoc_stringl_ex(&_8, SL("name"), SL("escaper"));
- zephir_array_fast_append(&_6, &_8);
- zephir_array_update_string(&_5, SL("arguments"), &_6, PH_COPY | PH_SEPARATE);
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_5, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("tag"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Model\\Transaction\\Manager");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("transactionManager"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Url");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("url"), &_1, PH_COPY | PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("services"), &_0);
- ZEPHIR_MM_RESTORE();
-}
-
@@ -152404,510 +148635,604 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct)
-ZEPHIR_INIT_CLASS(Phalcon_Di_InitializationAwareInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Cache_AbstractCache)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Di, InitializationAwareInterface, phalcon, di_initializationawareinterface, phalcon_di_initializationawareinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, AbstractCache, phalcon, cache_abstractcache, phalcon_cache_abstractcache_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zend_declare_property_null(phalcon_cache_abstractcache_ce, SL("adapter"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_cache_abstractcache_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_abstractcache_ce, 1, phalcon_cache_cacheinterface_ce);
+ zend_class_implements(phalcon_cache_abstractcache_ce, 1, phalcon_events_eventsawareinterface_ce);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Di_InitializationAwareInterface, initialize);
-
-
+static PHP_METHOD(Phalcon_Cache_AbstractCache, __construct)
+{
+ zval *adapter, adapter_sub;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ ZVAL_UNDEF(&adapter_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_cache_adapter_adapterinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &adapter);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), adapter);
+}
+static PHP_METHOD(Phalcon_Cache_AbstractCache, getAdapter)
+{
+ RETURN_MEMBER(getThis(), "adapter");
+}
+static PHP_METHOD(Phalcon_Cache_AbstractCache, setEventsManager)
+{
+ zval *eventsManager, eventsManager_sub;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&eventsManager_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+}
-ZEPHIR_INIT_CLASS(Phalcon_Di_Injectable)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, getEventsManager)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Di, Injectable, phalcon, di_injectable, zend_standard_class_def, phalcon_di_injectable_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- zend_declare_property_null(phalcon_di_injectable_ce, SL("container"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_di_injectable_ce, 1, phalcon_di_injectionawareinterface_ce);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "eventsManager");
}
-static PHP_METHOD(Phalcon_Di_Injectable, __get)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, checkKey)
{
- zval _2$$4;
+ zend_class_entry *_6$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *propertyName_param = NULL, container, service, _0, _1$$4, _3$$4, _4$$4;
- zval propertyName, _5;
+ zval *key_param = NULL, exception, _0, _1, _2, _3, _4$$3, _5$$3, _7$$3;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&propertyName);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&service);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&exception);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_7$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(propertyName)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &propertyName_param);
- if (UNEXPECTED(Z_TYPE_P(propertyName_param) != IS_STRING && Z_TYPE_P(propertyName_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'propertyName' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(propertyName_param) == IS_STRING)) {
- zephir_get_strval(&propertyName, propertyName_param);
- } else {
- ZEPHIR_INIT_VAR(&propertyName);
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&container, &_0);
- if (ZEPHIR_IS_STRING_IDENTICAL(&propertyName, "di")) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("di"), &container);
- RETURN_CCTOR(&container);
- }
- if (ZEPHIR_IS_STRING_IDENTICAL(&propertyName, "persistent")) {
- ZEPHIR_INIT_VAR(&_2$$4);
- zephir_create_array(&_2$$4, 2, 0);
- ZEPHIR_INIT_VAR(&_3$$4);
- zephir_get_class(&_3$$4, this_ptr, 0);
- zephir_array_fast_append(&_2$$4, &_3$$4);
- zephir_array_fast_append(&_2$$4, &container);
- ZEPHIR_INIT_NVAR(&_3$$4);
- ZVAL_STRING(&_3$$4, "sessionBag");
- ZEPHIR_CALL_METHOD(&_1$$4, &container, "get", NULL, 0, &_3$$4, &_2$$4);
+ zephir_fetch_params(1, 1, 0, &key_param);
+ zephir_get_strval(&key, key_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "/[^A-Za-z0-9-_.]/");
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "/[^A-Za-z0-9-_.]/");
+ zephir_preg_match(&_2, &_3, &key, &_0, 0, 0 , 0 );
+ if (zephir_is_true(&_2)) {
+ ZEPHIR_CALL_METHOD(&exception, this_ptr, "getexceptionclass", NULL, 0);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("persistent"), &_1$$4);
- zephir_memory_observe(&_4$$4);
- zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("persistent"), PH_NOISY_CC);
- RETURN_CCTOR(&_4$$4);
- }
- ZEPHIR_CALL_METHOD(&_0, &container, "has", NULL, 0, &propertyName);
- zephir_check_call_status();
- if (zephir_is_true(&_0)) {
- ZEPHIR_CALL_METHOD(&service, &container, "getshared", NULL, 0, &propertyName);
+ ZEPHIR_INIT_VAR(&_4$$3);
+ zephir_fetch_safe_class(&_5$$3, &exception);
+ _6$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_5$$3), Z_STRLEN_P(&_5$$3), ZEND_FETCH_CLASS_AUTO);
+ if(!_6$$3) {
+ RETURN_MM_NULL();
+ }
+ object_init_ex(&_4$$3, _6$$3);
+ ZEPHIR_INIT_VAR(&_7$$3);
+ ZVAL_STRING(&_7$$3, "The key contains invalid characters");
+ ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 0, &_7$$3);
zephir_check_call_status();
- zephir_update_property_zval_zval(this_ptr, &propertyName, &service);
- RETURN_CCTOR(&service);
+ zephir_throw_exception_debug(&_4$$3, "phalcon/Cache/AbstractCache.zep", 90);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_INIT_VAR(&_5);
- ZEPHIR_CONCAT_SV(&_5, "Access to undefined property ", &propertyName);
- ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 7, &_5);
- zephir_check_call_status();
- RETURN_MM_NULL();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Di_Injectable, __isset)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, checkKeys)
{
+ zend_class_entry *_3$$3;
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, _0;
- zval name;
+ zval *keys, keys_sub, exception, _1$$3, _2$$3, _4$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&keys_sub);
+ ZVAL_UNDEF(&exception);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ Z_PARAM_ZVAL(keys)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 0, &keys);
+ _0 = Z_TYPE_P(keys) == IS_ARRAY;
+ if (!(_0)) {
+ _0 = zephir_zval_is_traversable(keys);
}
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
+ if (!(_0)) {
+ ZEPHIR_CALL_METHOD(&exception, this_ptr, "getexceptionclass", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1$$3);
+ zephir_fetch_safe_class(&_2$$3, &exception);
+ _3$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_2$$3), Z_STRLEN_P(&_2$$3), ZEND_FETCH_CLASS_AUTO);
+ if(!_3$$3) {
+ RETURN_MM_NULL();
+ }
+ object_init_ex(&_1$$3, _3$$3);
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZVAL_STRING(&_4$$3, "The keys need to be an array or instance of Traversable");
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0, &_4$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_1$$3, "phalcon/Cache/AbstractCache.zep", 109);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, &name);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Di_Injectable, getDI)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doClear)
{
- zval container, _0;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&container);
ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_0);
- if (Z_TYPE_P(&container) == IS_NULL) {
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "A dependency injection container is required to access internal services", "phalcon/Di/Injectable.zep", 126);
- return;
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdi", NULL, 0, &container);
- zephir_check_call_status();
- }
- RETURN_CCTOR(&container);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "clear", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Di_Injectable, setDI)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doDelete)
{
- zval *container, container_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, result, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&container_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &container);
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &key_param);
+ zephir_get_strval(&key, key_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "cache:beforeDelete");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&result, &_1, "delete", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "cache:afterDelete");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ RETURN_CCTOR(&result);
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Di_InjectionAwareInterface)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doDeleteMultiple)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Di, InjectionAwareInterface, phalcon, di_injectionawareinterface, phalcon_di_injectionawareinterface_method_entry);
+ zend_bool result = 0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *keys, keys_sub, key, _0, *_1, _2, _3$$3, _4$$3, _5$$5, _6$$5;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&keys_sub);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$5);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(keys)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &keys);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "cache:beforeDeleteMultiple");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, keys);
+ zephir_check_call_status();
+ result = 1;
+ zephir_is_iterable(keys, 0, "phalcon/Cache/AbstractCache.zep", 167);
+ if (Z_TYPE_P(keys) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _1)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ ZVAL_COPY(&key, _1);
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_4$$3, &_3$$3, "delete", NULL, 0, &key);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_4$$3)) {
+ result = 0;
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, keys, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_6$$5, &_5$$5, "delete", NULL, 0, &key);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_6$$5)) {
+ result = 0;
+ }
+ ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&key);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "cache:afterDeleteMultiple");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, keys);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(result);
}
-ZEPHIR_DOC_METHOD(Phalcon_Di_InjectionAwareInterface, setDI);
-ZEPHIR_DOC_METHOD(Phalcon_Di_InjectionAwareInterface, getDI);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Di_Service)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doGet)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Di, Service, phalcon, di_service, phalcon_di_service_method_entry, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, result, _0, _1;
+ zval key;
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_di_service_ce, SL("definition"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_di_service_ce, SL("resolved"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_di_service_ce, SL("shared"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_di_service_ce, SL("sharedInstance"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_di_service_ce, 1, phalcon_di_serviceinterface_ce);
- return SUCCESS;
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &key_param, &defaultValue);
+ zephir_get_strval(&key, key_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "cache:beforeGet");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&result, &_1, "get", NULL, 0, &key, defaultValue);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "cache:afterGet");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ RETURN_CCTOR(&result);
}
-static PHP_METHOD(Phalcon_Di_Service, __construct)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doGetMultiple)
{
- zend_bool shared;
- zval *definition, definition_sub, *shared_param = NULL, __$true, __$false;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null, element, results, _0, *_1, _2, _3$$3, _5$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&definition_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&keys_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&results);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_5$$4);
+ bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ZVAL(definition)
+ Z_PARAM_ZVAL(keys)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(shared)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 1, &definition, &shared_param);
- if (!shared_param) {
- shared = 0;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &keys, &defaultValue);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "cache:beforeGetMultiple");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, keys);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&results);
+ array_init(&results);
+ zephir_is_iterable(keys, 0, "phalcon/Cache/AbstractCache.zep", 215);
+ if (Z_TYPE_P(keys) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _1)
+ {
+ ZEPHIR_INIT_NVAR(&element);
+ ZVAL_COPY(&element, _1);
+ ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "get", &_4, 0, &element, defaultValue);
+ zephir_check_call_status();
+ zephir_array_update_zval(&results, &element, &_3$$3, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
} else {
+ ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, keys, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&element, keys, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "get", &_6, 0, &element, defaultValue);
+ zephir_check_call_status();
+ zephir_array_update_zval(&results, &element, &_5$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0);
+ zephir_check_call_status();
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("definition"), definition);
- if (shared) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("shared"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("shared"), &__$false);
}
+ ZEPHIR_INIT_NVAR(&element);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "cache:afterGetMultiple");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, keys);
+ zephir_check_call_status();
+ RETURN_CCTOR(&results);
}
-static PHP_METHOD(Phalcon_Di_Service, getDefinition)
-{
-
- RETURN_MEMBER(getThis(), "definition");
-}
-
-static PHP_METHOD(Phalcon_Di_Service, getParameter)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doHas)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *position_param = NULL, arguments, parameter, _0, _1;
- zend_long position;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, result, _0, _1;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&arguments);
- ZVAL_UNDEF(¶meter);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(position)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &position_param);
- zephir_memory_observe(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("definition"), PH_NOISY_CC);
- if (UNEXPECTED(Z_TYPE_P(&_0) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to obtain its parameters", "phalcon/Di/Service.zep", 80);
- return;
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("definition"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset_string_fetch(&arguments, &_1, SL("arguments"), 1)) {
- if (zephir_array_isset_long_fetch(¶meter, &arguments, position, 1)) {
- RETURN_CTOR(¶meter);
- }
- }
- RETURN_MM_NULL();
-}
-
-static PHP_METHOD(Phalcon_Di_Service, isResolved)
-{
-
- RETURN_MEMBER(getThis(), "resolved");
+ zephir_fetch_params(1, 1, 0, &key_param);
+ zephir_get_strval(&key, key_param);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "cache:beforeHas");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&result, &_1, "has", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "cache:afterHas");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ RETURN_CCTOR(&result);
}
-static PHP_METHOD(Phalcon_Di_Service, isShared)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doSet)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, result, _0, _1;
+ zval key;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "shared");
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(key)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(ttl)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl);
+ zephir_get_strval(&key, key_param);
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "cache:beforeSet");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&result, &_1, "set", NULL, 0, &key, value, ttl);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "cache:afterSet");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_0, &key);
+ zephir_check_call_status();
+ RETURN_CCTOR(&result);
}
-static PHP_METHOD(Phalcon_Di_Service, resolve)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, doSetMultiple)
{
- zend_class_entry *_6$$12;
- zend_bool found = 0, _1, _4$$5;
+ zend_string *_5;
+ zend_ulong _4;
+ zend_bool result = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_7 = NULL, *_9 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *parameters = NULL, parameters_sub, *container = NULL, container_sub, __$true, __$false, __$null, definition, instance, builder, _0, _2, _3, _5$$12, _7$$19;
+ zval *values, values_sub, *ttl = NULL, ttl_sub, __$null, key, value, _0, _1, *_2, _3, _10, _6$$3, _8$$5;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶meters_sub);
- ZVAL_UNDEF(&container_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&values_sub);
+ ZVAL_UNDEF(&ttl_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&instance);
- ZVAL_UNDEF(&builder);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5$$12);
- ZVAL_UNDEF(&_7$$19);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_8$$5);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 2)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(values)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(parameters)
- Z_PARAM_OBJECT_OF_CLASS_OR_NULL(container, phalcon_di_diinterface_ce)
+ Z_PARAM_ZVAL_OR_NULL(ttl)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 2, ¶meters, &container);
- if (!parameters) {
- parameters = ¶meters_sub;
- parameters = &__$null;
- }
- if (!container) {
- container = &container_sub;
- container = &__$null;
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("shared"), PH_NOISY_CC | PH_READONLY);
- _1 = zephir_is_true(&_0);
- if (_1) {
- zephir_read_property(&_2, this_ptr, ZEND_STRL("sharedInstance"), PH_NOISY_CC | PH_READONLY);
- _1 = Z_TYPE_P(&_2) != IS_NULL;
- }
- if (_1) {
- RETURN_MM_MEMBER(getThis(), "sharedInstance");
+ zephir_fetch_params(1, 1, 1, &values, &ttl);
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
}
- found = 1;
- ZEPHIR_INIT_VAR(&instance);
- ZVAL_NULL(&instance);
- zephir_read_property(&_3, this_ptr, ZEND_STRL("definition"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&definition, &_3);
- if (Z_TYPE_P(&definition) == IS_STRING) {
- if (zephir_class_exists(&definition, 1)) {
- _4$$5 = Z_TYPE_P(parameters) == IS_ARRAY;
- if (_4$$5) {
- _4$$5 = ((zephir_fast_count_int(parameters)) ? 1 : 0);
- }
- if (_4$$5) {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &definition, parameters);
- zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, values);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_array_keys(&_0, values);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "cache:beforeSetMultiple");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_1, &_0);
+ zephir_check_call_status();
+ result = 1;
+ zephir_is_iterable(values, 0, "phalcon/Cache/AbstractCache.zep", 296);
+ if (Z_TYPE_P(values) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(values), _4, _5, _2)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_5 != NULL) {
+ ZVAL_STR_COPY(&key, _5);
} else {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &definition);
- zephir_check_call_status();
+ ZVAL_LONG(&key, _4);
}
- } else {
- found = 0;
- }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _2);
+ ZEPHIR_CALL_METHOD(&_6$$3, this_ptr, "set", &_7, 0, &key, &value, ttl);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_6$$3)) {
+ result = 0;
+ }
+ } ZEND_HASH_FOREACH_END();
} else {
- if (Z_TYPE_P(&definition) == IS_OBJECT) {
- if (zephir_is_instance_of(&definition, SL("Closure"))) {
- if (Z_TYPE_P(container) != IS_NULL) {
- _6$$12 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO);
- ZEPHIR_CALL_CE_STATIC(&_5$$12, _6$$12, "bind", NULL, 0, &definition, container);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&definition, &_5$$12);
- }
- if (Z_TYPE_P(parameters) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_CALL_USER_FUNC_ARRAY(&instance, &definition, parameters);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_CALL_USER_FUNC(&instance, &definition);
- zephir_check_call_status();
- }
- } else {
- ZEPHIR_CPY_WRT(&instance, &definition);
+ ZEPHIR_CALL_METHOD(NULL, values, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, values, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
}
- } else {
- if (Z_TYPE_P(&definition) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&builder);
- object_init_ex(&builder, phalcon_di_service_builder_ce);
- if (zephir_has_constructor(&builder)) {
- ZEPHIR_CALL_METHOD(NULL, &builder, "__construct", NULL, 0);
- zephir_check_call_status();
- }
-
- ZEPHIR_CALL_METHOD(&instance, &builder, "build", NULL, 222, container, &definition, parameters);
+ ZEPHIR_CALL_METHOD(&key, values, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, values, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "set", &_9, 0, &key, &value, ttl);
zephir_check_call_status();
- } else {
- found = 0;
- }
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_8$$5)) {
+ result = 0;
+ }
+ ZEPHIR_CALL_METHOD(NULL, values, "next", NULL, 0);
+ zephir_check_call_status();
}
}
- if (UNEXPECTED(found == 0)) {
- ZEPHIR_INIT_VAR(&_7$$19);
- object_init_ex(&_7$$19, phalcon_di_exception_serviceresolutionexception_ce);
- ZEPHIR_CALL_METHOD(NULL, &_7$$19, "__construct", NULL, 33);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_7$$19, "phalcon/Di/Service.zep", 195);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_read_property(&_3, this_ptr, ZEND_STRL("shared"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_3)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("sharedInstance"), &instance);
- }
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("resolved"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("resolved"), &__$false);
- }
- RETURN_CCTOR(&instance);
-}
-
-static PHP_METHOD(Phalcon_Di_Service, setDefinition)
-{
- zval *definition, definition_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&definition_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(definition)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &definition);
- zephir_update_property_zval(this_ptr, ZEND_STRL("definition"), definition);
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&key);
+ ZEPHIR_INIT_NVAR(&_1);
+ zephir_array_keys(&_1, values);
+ ZEPHIR_INIT_VAR(&_10);
+ ZVAL_STRING(&_10, "cache:afterSetMultiple");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "fire", NULL, 0, &_10, &_1);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(result);
}
-static PHP_METHOD(Phalcon_Di_Service, setParameter)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, fire)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval parameter;
- zval *position_param = NULL, *parameter_param = NULL, arguments, _0, _1, _3, _2$$5;
- zend_long position;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *eventName_param = NULL, *keys, keys_sub, _0, _1, _2;
+ zval eventName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&arguments);
+ ZVAL_UNDEF(&eventName);
+ ZVAL_UNDEF(&keys_sub);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(¶meter);
+ ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_LONG(position)
- Z_PARAM_ARRAY(parameter)
+ Z_PARAM_STR(eventName)
+ Z_PARAM_ZVAL(keys)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &position_param, ¶meter_param);
- ZEPHIR_OBS_COPY_OR_DUP(¶meter, parameter_param);
- zephir_memory_observe(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("definition"), PH_NOISY_CC);
- if (UNEXPECTED(Z_TYPE_P(&_0) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to update its parameters", "phalcon/Di/Service.zep", 228);
- return;
- }
- zephir_memory_observe(&arguments);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("definition"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset_string_fetch(&arguments, &_1, SL("arguments"), 0)) {
- zephir_array_update_long(&arguments, position, ¶meter, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
- } else {
- ZEPHIR_INIT_VAR(&_2$$5);
- zephir_create_array(&_2$$5, 1, 0);
- zephir_array_update_long(&_2$$5, position, ¶meter, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY);
- ZEPHIR_CPY_WRT(&arguments, &_2$$5);
- }
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "arguments");
- zephir_update_property_array(this_ptr, SL("definition"), &_3, &arguments);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Di_Service, setShared)
-{
- zval *shared_param = NULL, __$true, __$false;
- zend_bool shared;
- zval *this_ptr = getThis();
-
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_BOOL(shared)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &shared_param);
- if (shared) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("shared"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("shared"), &__$false);
+ zephir_fetch_params(1, 2, 0, &eventName_param, &keys);
+ zephir_get_strval(&eventName, eventName_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ RETURN_MM_NULL();
}
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_BOOL(&_2, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "fire", NULL, 0, &eventName, this_ptr, keys, &_2);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Di_Service, setSharedInstance)
+static PHP_METHOD(Phalcon_Cache_AbstractCache, getExceptionClass)
{
- zval *sharedInstance, sharedInstance_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&sharedInstance_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(sharedInstance)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &sharedInstance);
- zephir_update_property_zval(this_ptr, ZEND_STRL("sharedInstance"), sharedInstance);
}
@@ -152920,39 +149245,113 @@ static PHP_METHOD(Phalcon_Di_Service, setSharedInstance)
-ZEPHIR_INIT_CLASS(Phalcon_Di_ServiceInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Cache_AdapterFactory)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Di, ServiceInterface, phalcon, di_serviceinterface, phalcon_di_serviceinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache, AdapterFactory, phalcon, cache_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_cache_adapterfactory_method_entry, 0);
+ zend_declare_property_null(phalcon_cache_adapterfactory_ce, SL("serializerFactory"), ZEND_ACC_PRIVATE);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, getDefinition);
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, getParameter);
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, isResolved);
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, isShared);
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, resolve);
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, setDefinition);
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, setParameter);
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceInterface, setShared);
-
-
+static PHP_METHOD(Phalcon_Cache_AdapterFactory, __construct)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval services;
+ zval *factory, factory_sub, *services_param = NULL;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
+ ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&services);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_serializerfactory_ce)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &factory, &services_param);
+ if (!services_param) {
+ ZEPHIR_INIT_VAR(&services);
+ array_init(&services);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("serializerFactory"), factory);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
+}
+static PHP_METHOD(Phalcon_Cache_AdapterFactory, newInstance)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval options, _0;
+ zval *name_param = NULL, *options_param = NULL, definition, _1;
+ zval name;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &name_param, &options_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ }
+ ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 2, 0);
+ zephir_memory_observe(&_1);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("serializerFactory"), PH_NOISY_CC);
+ zephir_array_fast_append(&_0, &_1);
+ zephir_array_fast_append(&_0, &options);
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &_0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Cache_AdapterFactory, getExceptionClass)
+{
+ RETURN_STRING("Phalcon\\Cache\\Exception\\Exception");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Di_ServiceProviderInterface)
+static PHP_METHOD(Phalcon_Cache_AdapterFactory, getServices)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Di, ServiceProviderInterface, phalcon, di_serviceproviderinterface, phalcon_di_serviceproviderinterface_method_entry);
- return SUCCESS;
+ zephir_create_array(return_value, 6, 0);
+ add_assoc_stringl_ex(return_value, SL("apcu"), SL("Phalcon\\Cache\\Adapter\\Apcu"));
+ add_assoc_stringl_ex(return_value, SL("libmemcached"), SL("Phalcon\\Cache\\Adapter\\Libmemcached"));
+ add_assoc_stringl_ex(return_value, SL("memory"), SL("Phalcon\\Cache\\Adapter\\Memory"));
+ add_assoc_stringl_ex(return_value, SL("redis"), SL("Phalcon\\Cache\\Adapter\\Redis"));
+ add_assoc_stringl_ex(return_value, SL("stream"), SL("Phalcon\\Cache\\Adapter\\Stream"));
+ add_assoc_stringl_ex(return_value, SL("weak"), SL("Phalcon\\Cache\\Adapter\\Weak"));
+ return;
}
-ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceProviderInterface, register);
@@ -152963,767 +149362,209 @@ ZEPHIR_DOC_METHOD(Phalcon_Di_ServiceProviderInterface, register);
-ZEPHIR_INIT_CLASS(Phalcon_Di_Service_Builder)
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Cache)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Di\\Service, Builder, phalcon, di_service_builder, phalcon_di_service_builder_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache, Cache, phalcon, cache_cache, phalcon_cache_abstractcache_ce, phalcon_cache_cache_method_entry, 0);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Di_Service_Builder, build)
+static PHP_METHOD(Phalcon_Cache_Cache, clear)
{
- zval _11$$17, _12$$17, _22$$23, _23$$23;
- zend_string *_4$$10, *_30$$25;
- zend_ulong _3$$10, _29$$25;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_7 = NULL, *_38 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval definition;
- zval *container, container_sub, *definition_param = NULL, *parameters = NULL, parameters_sub, __$null, className, arguments, paramCalls, methodPosition, method, methodName, methodCall, instance, propertyPosition, property, propertyName, propertyValue, _0$$8, *_1$$10, _2$$10, _5$$14, _6$$14, _8$$15, _9$$15, _10$$17, _13$$18, _14$$18, _15$$13, _16$$20, _17$$20, _18$$21, _19$$21, _20$$19, _26$$19, _21$$23, _24$$24, _25$$24, *_27$$25, _28$$25, _31$$29, _32$$29, _33$$30, _34$$30, _35$$31, _36$$31, _37$$28, _39$$33, _40$$33, _41$$34, _42$$34, _43$$35, _44$$35, _45$$32;
zval *this_ptr = getThis();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZVAL_UNDEF(&container_sub);
- ZVAL_UNDEF(¶meters_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&className);
- ZVAL_UNDEF(&arguments);
- ZVAL_UNDEF(¶mCalls);
- ZVAL_UNDEF(&methodPosition);
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&methodName);
- ZVAL_UNDEF(&methodCall);
- ZVAL_UNDEF(&instance);
- ZVAL_UNDEF(&propertyPosition);
- ZVAL_UNDEF(&property);
- ZVAL_UNDEF(&propertyName);
- ZVAL_UNDEF(&propertyValue);
- ZVAL_UNDEF(&_0$$8);
- ZVAL_UNDEF(&_2$$10);
- ZVAL_UNDEF(&_5$$14);
- ZVAL_UNDEF(&_6$$14);
- ZVAL_UNDEF(&_8$$15);
- ZVAL_UNDEF(&_9$$15);
- ZVAL_UNDEF(&_10$$17);
- ZVAL_UNDEF(&_13$$18);
- ZVAL_UNDEF(&_14$$18);
- ZVAL_UNDEF(&_15$$13);
- ZVAL_UNDEF(&_16$$20);
- ZVAL_UNDEF(&_17$$20);
- ZVAL_UNDEF(&_18$$21);
- ZVAL_UNDEF(&_19$$21);
- ZVAL_UNDEF(&_20$$19);
- ZVAL_UNDEF(&_26$$19);
- ZVAL_UNDEF(&_21$$23);
- ZVAL_UNDEF(&_24$$24);
- ZVAL_UNDEF(&_25$$24);
- ZVAL_UNDEF(&_28$$25);
- ZVAL_UNDEF(&_31$$29);
- ZVAL_UNDEF(&_32$$29);
- ZVAL_UNDEF(&_33$$30);
- ZVAL_UNDEF(&_34$$30);
- ZVAL_UNDEF(&_35$$31);
- ZVAL_UNDEF(&_36$$31);
- ZVAL_UNDEF(&_37$$28);
- ZVAL_UNDEF(&_39$$33);
- ZVAL_UNDEF(&_40$$33);
- ZVAL_UNDEF(&_41$$34);
- ZVAL_UNDEF(&_42$$34);
- ZVAL_UNDEF(&_43$$35);
- ZVAL_UNDEF(&_44$$35);
- ZVAL_UNDEF(&_45$$32);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&_11$$17);
- ZVAL_UNDEF(&_12$$17);
- ZVAL_UNDEF(&_22$$23);
- ZVAL_UNDEF(&_23$$23);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- Z_PARAM_ARRAY(definition)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(parameters)
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doclear", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Cache_Cache, delete)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL;
+ zval key;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&key);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &container, &definition_param, ¶meters);
- ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param);
- if (!parameters) {
- parameters = ¶meters_sub;
- parameters = &__$null;
- }
- zephir_memory_observe(&className);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&className, &definition, SL("className"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Invalid service definition. Missing 'className' parameter", "phalcon/Di/Service/Builder.zep", 41);
- return;
- }
- if (Z_TYPE_P(parameters) == IS_ARRAY) {
- if (zephir_fast_count_int(parameters)) {
- ZEPHIR_INIT_VAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &className, parameters);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &className);
- zephir_check_call_status();
- }
- } else {
- zephir_memory_observe(&arguments);
- if (zephir_array_isset_string_fetch(&arguments, &definition, SL("arguments"), 0)) {
- ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "buildparameters", NULL, 223, container, &arguments);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &className, &_0$$8);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&instance);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &className);
- zephir_check_call_status();
- }
- }
- zephir_memory_observe(¶mCalls);
- if (zephir_array_isset_string_fetch(¶mCalls, &definition, SL("calls"), 0)) {
- if (UNEXPECTED(Z_TYPE_P(&instance) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The definition has setter injection parameters but the constructor didn't return an instance", "phalcon/Di/Service/Builder.zep", 78);
- return;
- }
- if (UNEXPECTED(Z_TYPE_P(¶mCalls) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Setter injection parameters must be an array", "phalcon/Di/Service/Builder.zep", 84);
- return;
- }
- zephir_is_iterable(¶mCalls, 0, "phalcon/Di/Service/Builder.zep", 143);
- if (Z_TYPE_P(¶mCalls) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶mCalls), _3$$10, _4$$10, _1$$10)
- {
- ZEPHIR_INIT_NVAR(&methodPosition);
- if (_4$$10 != NULL) {
- ZVAL_STR_COPY(&methodPosition, _4$$10);
- } else {
- ZVAL_LONG(&methodPosition, _3$$10);
- }
- ZEPHIR_INIT_NVAR(&method);
- ZVAL_COPY(&method, _1$$10);
- if (UNEXPECTED(Z_TYPE_P(&method) != IS_ARRAY)) {
- ZEPHIR_INIT_NVAR(&_5$$14);
- object_init_ex(&_5$$14, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_6$$14);
- ZEPHIR_CONCAT_SV(&_6$$14, "Method call must be an array on position ", &methodPosition);
- ZEPHIR_CALL_METHOD(NULL, &_5$$14, "__construct", &_7, 33, &_6$$14);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_5$$14, "phalcon/Di/Service/Builder.zep", 97);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_NVAR(&methodName);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&methodName, &method, SL("method"), 0)))) {
- ZEPHIR_INIT_NVAR(&_8$$15);
- object_init_ex(&_8$$15, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_9$$15);
- ZEPHIR_CONCAT_SV(&_9$$15, "The method name is required on position ", &methodPosition);
- ZEPHIR_CALL_METHOD(NULL, &_8$$15, "__construct", &_7, 33, &_9$$15);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_8$$15, "phalcon/Di/Service/Builder.zep", 106);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_INIT_NVAR(&methodCall);
- zephir_create_array(&methodCall, 2, 0);
- zephir_array_fast_append(&methodCall, &instance);
- zephir_array_fast_append(&methodCall, &methodName);
- ZEPHIR_OBS_NVAR(&arguments);
- if (zephir_array_isset_string_fetch(&arguments, &method, SL("arguments"), 0)) {
- if (UNEXPECTED(Z_TYPE_P(&arguments) != IS_ARRAY)) {
- ZEPHIR_INIT_NVAR(&_10$$17);
- object_init_ex(&_10$$17, phalcon_di_exception_ce);
- zephir_cast_to_string(&_11$$17, &methodPosition);
- ZEPHIR_INIT_NVAR(&_12$$17);
- ZEPHIR_CONCAT_SV(&_12$$17, "Call arguments must be an array on position ", &_11$$17);
- ZEPHIR_CALL_METHOD(NULL, &_10$$17, "__construct", &_7, 33, &_12$$17);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_10$$17, "phalcon/Di/Service/Builder.zep", 119);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (zephir_fast_count_int(&arguments)) {
- ZEPHIR_INIT_NVAR(&_13$$18);
- ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "buildparameters", NULL, 223, container, &arguments);
- zephir_check_call_status();
- ZEPHIR_CALL_USER_FUNC_ARRAY(&_13$$18, &methodCall, &_14$$18);
- zephir_check_call_status();
- continue;
- }
- }
- ZEPHIR_INIT_NVAR(&_15$$13);
- ZEPHIR_CALL_USER_FUNC(&_15$$13, &methodCall);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, ¶mCalls, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2$$10, ¶mCalls, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2$$10)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&methodPosition, ¶mCalls, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&method, ¶mCalls, "current", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&method) != IS_ARRAY)) {
- ZEPHIR_INIT_NVAR(&_16$$20);
- object_init_ex(&_16$$20, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_17$$20);
- ZEPHIR_CONCAT_SV(&_17$$20, "Method call must be an array on position ", &methodPosition);
- ZEPHIR_CALL_METHOD(NULL, &_16$$20, "__construct", &_7, 33, &_17$$20);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_16$$20, "phalcon/Di/Service/Builder.zep", 97);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_NVAR(&methodName);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&methodName, &method, SL("method"), 0)))) {
- ZEPHIR_INIT_NVAR(&_18$$21);
- object_init_ex(&_18$$21, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_19$$21);
- ZEPHIR_CONCAT_SV(&_19$$21, "The method name is required on position ", &methodPosition);
- ZEPHIR_CALL_METHOD(NULL, &_18$$21, "__construct", &_7, 33, &_19$$21);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_18$$21, "phalcon/Di/Service/Builder.zep", 106);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_INIT_NVAR(&_20$$19);
- zephir_create_array(&_20$$19, 2, 0);
- zephir_array_fast_append(&_20$$19, &instance);
- zephir_array_fast_append(&_20$$19, &methodName);
- ZEPHIR_CPY_WRT(&methodCall, &_20$$19);
- ZEPHIR_OBS_NVAR(&arguments);
- if (zephir_array_isset_string_fetch(&arguments, &method, SL("arguments"), 0)) {
- if (UNEXPECTED(Z_TYPE_P(&arguments) != IS_ARRAY)) {
- ZEPHIR_INIT_NVAR(&_21$$23);
- object_init_ex(&_21$$23, phalcon_di_exception_ce);
- zephir_cast_to_string(&_22$$23, &methodPosition);
- ZEPHIR_INIT_NVAR(&_23$$23);
- ZEPHIR_CONCAT_SV(&_23$$23, "Call arguments must be an array on position ", &_22$$23);
- ZEPHIR_CALL_METHOD(NULL, &_21$$23, "__construct", &_7, 33, &_23$$23);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_21$$23, "phalcon/Di/Service/Builder.zep", 119);
- ZEPHIR_MM_RESTORE();
- return;
- }
- if (zephir_fast_count_int(&arguments)) {
- ZEPHIR_INIT_NVAR(&_24$$24);
- ZEPHIR_CALL_METHOD(&_25$$24, this_ptr, "buildparameters", NULL, 223, container, &arguments);
- zephir_check_call_status();
- ZEPHIR_CALL_USER_FUNC_ARRAY(&_24$$24, &methodCall, &_25$$24);
- zephir_check_call_status();
- continue;
- }
- }
- ZEPHIR_INIT_NVAR(&_26$$19);
- ZEPHIR_CALL_USER_FUNC(&_26$$19, &methodCall);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, ¶mCalls, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&method);
- ZEPHIR_INIT_NVAR(&methodPosition);
- }
- ZEPHIR_OBS_NVAR(¶mCalls);
- if (zephir_array_isset_string_fetch(¶mCalls, &definition, SL("properties"), 0)) {
- if (UNEXPECTED(Z_TYPE_P(&instance) != IS_OBJECT)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The definition has properties injection parameters but the constructor didn't return an instance", "phalcon/Di/Service/Builder.zep", 152);
- return;
- }
- if (UNEXPECTED(Z_TYPE_P(¶mCalls) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Setter injection parameters must be an array", "phalcon/Di/Service/Builder.zep", 158);
- return;
- }
- zephir_is_iterable(¶mCalls, 0, "phalcon/Di/Service/Builder.zep", 201);
- if (Z_TYPE_P(¶mCalls) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶mCalls), _29$$25, _30$$25, _27$$25)
- {
- ZEPHIR_INIT_NVAR(&propertyPosition);
- if (_30$$25 != NULL) {
- ZVAL_STR_COPY(&propertyPosition, _30$$25);
- } else {
- ZVAL_LONG(&propertyPosition, _29$$25);
- }
- ZEPHIR_INIT_NVAR(&property);
- ZVAL_COPY(&property, _27$$25);
- if (UNEXPECTED(Z_TYPE_P(&property) != IS_ARRAY)) {
- ZEPHIR_INIT_NVAR(&_31$$29);
- object_init_ex(&_31$$29, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_32$$29);
- ZEPHIR_CONCAT_SV(&_32$$29, "Property must be an array on position ", &propertyPosition);
- ZEPHIR_CALL_METHOD(NULL, &_31$$29, "__construct", &_7, 33, &_32$$29);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_31$$29, "phalcon/Di/Service/Builder.zep", 171);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_NVAR(&propertyName);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&propertyName, &property, SL("name"), 0)))) {
- ZEPHIR_INIT_NVAR(&_33$$30);
- object_init_ex(&_33$$30, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_34$$30);
- ZEPHIR_CONCAT_SV(&_34$$30, "The property name is required on position ", &propertyPosition);
- ZEPHIR_CALL_METHOD(NULL, &_33$$30, "__construct", &_7, 33, &_34$$30);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_33$$30, "phalcon/Di/Service/Builder.zep", 180);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_NVAR(&propertyValue);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&propertyValue, &property, SL("value"), 0)))) {
- ZEPHIR_INIT_NVAR(&_35$$31);
- object_init_ex(&_35$$31, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_36$$31);
- ZEPHIR_CONCAT_SV(&_36$$31, "The property value is required on position ", &propertyPosition);
- ZEPHIR_CALL_METHOD(NULL, &_35$$31, "__construct", &_7, 33, &_36$$31);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_35$$31, "phalcon/Di/Service/Builder.zep", 189);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_CALL_METHOD(&_37$$28, this_ptr, "buildparameter", &_38, 224, container, &propertyPosition, &propertyValue);
- zephir_check_call_status();
- zephir_update_property_zval_zval(&instance, &propertyName, &_37$$28);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, ¶mCalls, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_28$$25, ¶mCalls, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_28$$25)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&propertyPosition, ¶mCalls, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&property, ¶mCalls, "current", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&property) != IS_ARRAY)) {
- ZEPHIR_INIT_NVAR(&_39$$33);
- object_init_ex(&_39$$33, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_40$$33);
- ZEPHIR_CONCAT_SV(&_40$$33, "Property must be an array on position ", &propertyPosition);
- ZEPHIR_CALL_METHOD(NULL, &_39$$33, "__construct", &_7, 33, &_40$$33);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_39$$33, "phalcon/Di/Service/Builder.zep", 171);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_NVAR(&propertyName);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&propertyName, &property, SL("name"), 0)))) {
- ZEPHIR_INIT_NVAR(&_41$$34);
- object_init_ex(&_41$$34, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_42$$34);
- ZEPHIR_CONCAT_SV(&_42$$34, "The property name is required on position ", &propertyPosition);
- ZEPHIR_CALL_METHOD(NULL, &_41$$34, "__construct", &_7, 33, &_42$$34);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_41$$34, "phalcon/Di/Service/Builder.zep", 180);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_NVAR(&propertyValue);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&propertyValue, &property, SL("value"), 0)))) {
- ZEPHIR_INIT_NVAR(&_43$$35);
- object_init_ex(&_43$$35, phalcon_di_exception_ce);
- ZEPHIR_INIT_NVAR(&_44$$35);
- ZEPHIR_CONCAT_SV(&_44$$35, "The property value is required on position ", &propertyPosition);
- ZEPHIR_CALL_METHOD(NULL, &_43$$35, "__construct", &_7, 33, &_44$$35);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_43$$35, "phalcon/Di/Service/Builder.zep", 189);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_CALL_METHOD(&_45$$32, this_ptr, "buildparameter", &_38, 224, container, &propertyPosition, &propertyValue);
- zephir_check_call_status();
- zephir_update_property_zval_zval(&instance, &propertyName, &_45$$32);
- ZEPHIR_CALL_METHOD(NULL, ¶mCalls, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&property);
- ZEPHIR_INIT_NVAR(&propertyPosition);
- }
- RETURN_CCTOR(&instance);
+ zephir_fetch_params(1, 1, 0, &key_param);
+ zephir_get_strval(&key, key_param);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dodelete", NULL, 0, &key);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter)
+static PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple)
{
- zval _2$$3, _5$$5, _8$$7, _11$$9, _14$$11;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval argument;
- zend_long position, ZEPHIR_LAST_CALL_STATUS;
- zval *container, container_sub, *position_param = NULL, *argument_param = NULL, type, name, value, instanceArguments, _0$$3, _1$$3, _3$$5, _4$$5, _6$$7, _7$$7, _9$$9, _10$$9, _12$$11, _13$$11;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *keys, keys_sub;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&container_sub);
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&instanceArguments);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$9);
- ZVAL_UNDEF(&_12$$11);
- ZVAL_UNDEF(&_13$$11);
- ZVAL_UNDEF(&argument);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_8$$7);
- ZVAL_UNDEF(&_11$$9);
- ZVAL_UNDEF(&_14$$11);
- ZEND_PARSE_PARAMETERS_START(3, 3)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- Z_PARAM_LONG(position)
- Z_PARAM_ARRAY(argument)
+ ZVAL_UNDEF(&keys_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(keys)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 0, &container, &position_param, &argument_param);
- ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param);
- zephir_memory_observe(&type);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&type, &argument, SL("type"), 0)))) {
- ZEPHIR_INIT_VAR(&_0$$3);
- object_init_ex(&_0$$3, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_LONG(&_1$$3, position);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Argument at position ", &_1$$3, " must have a type");
- ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$3, "phalcon/Di/Service/Builder.zep", 221);
- ZEPHIR_MM_RESTORE();
- return;
- }
- do {
- if (ZEPHIR_IS_STRING(&type, "service")) {
- zephir_memory_observe(&name);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&name, &argument, SL("name"), 0)))) {
- ZEPHIR_INIT_VAR(&_3$$5);
- object_init_ex(&_3$$5, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_4$$5);
- ZVAL_LONG(&_4$$5, position);
- ZEPHIR_INIT_VAR(&_5$$5);
- ZEPHIR_CONCAT_SV(&_5$$5, "Service 'name' is required in parameter on position ", &_4$$5);
- ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 33, &_5$$5);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_3$$5, "phalcon/Di/Service/Builder.zep", 233);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_RETURN_CALL_METHOD(container, "get", NULL, 0, &name);
- zephir_check_call_status();
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&type, "parameter")) {
- zephir_memory_observe(&value);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&value, &argument, SL("value"), 0)))) {
- ZEPHIR_INIT_VAR(&_6$$7);
- object_init_ex(&_6$$7, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_7$$7);
- ZVAL_LONG(&_7$$7, position);
- ZEPHIR_INIT_VAR(&_8$$7);
- ZEPHIR_CONCAT_SV(&_8$$7, "Service 'value' is required in parameter on position ", &_7$$7);
- ZEPHIR_CALL_METHOD(NULL, &_6$$7, "__construct", NULL, 33, &_8$$7);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_6$$7, "phalcon/Di/Service/Builder.zep", 245);
- ZEPHIR_MM_RESTORE();
- return;
- }
- RETURN_CCTOR(&value);
- }
- if (ZEPHIR_IS_STRING(&type, "instance")) {
- ZEPHIR_OBS_NVAR(&name);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&name, &argument, SL("className"), 0)))) {
- ZEPHIR_INIT_VAR(&_9$$9);
- object_init_ex(&_9$$9, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_10$$9);
- ZVAL_LONG(&_10$$9, position);
- ZEPHIR_INIT_VAR(&_11$$9);
- ZEPHIR_CONCAT_SV(&_11$$9, "Service 'className' is required in parameter on position ", &_10$$9);
- ZEPHIR_CALL_METHOD(NULL, &_9$$9, "__construct", NULL, 33, &_11$$9);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_9$$9, "phalcon/Di/Service/Builder.zep", 257);
- ZEPHIR_MM_RESTORE();
- return;
- }
- zephir_memory_observe(&instanceArguments);
- if (zephir_array_isset_string_fetch(&instanceArguments, &argument, SL("arguments"), 0)) {
- ZEPHIR_RETURN_CALL_METHOD(container, "get", NULL, 0, &name, &instanceArguments);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_RETURN_CALL_METHOD(container, "get", NULL, 0, &name);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_INIT_VAR(&_12$$11);
- object_init_ex(&_12$$11, phalcon_di_exception_ce);
- ZEPHIR_INIT_VAR(&_13$$11);
- ZVAL_LONG(&_13$$11, position);
- ZEPHIR_INIT_VAR(&_14$$11);
- ZEPHIR_CONCAT_SV(&_14$$11, "Unknown service type in parameter on position ", &_13$$11);
- ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", NULL, 33, &_14$$11);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_12$$11, "phalcon/Di/Service/Builder.zep", 279);
- ZEPHIR_MM_RESTORE();
- return;
- } while(0);
-
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &keys);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dodeletemultiple", NULL, 0, keys);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameters)
+static PHP_METHOD(Phalcon_Cache_Cache, get)
{
- zend_string *_3;
- zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval arguments, buildArguments;
- zval *container, container_sub, *arguments_param = NULL, position, argument, *_0, _1, _4$$3, _6$$4;
+ zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&container_sub);
- ZVAL_UNDEF(&position);
- ZVAL_UNDEF(&argument);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&arguments);
- ZVAL_UNDEF(&buildArguments);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- Z_PARAM_ARRAY(arguments)
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(key)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &container, &arguments_param);
- ZEPHIR_OBS_COPY_OR_DUP(&arguments, arguments_param);
- ZEPHIR_INIT_VAR(&buildArguments);
- array_init(&buildArguments);
- zephir_is_iterable(&arguments, 0, "phalcon/Di/Service/Builder.zep", 301);
- if (Z_TYPE_P(&arguments) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&arguments), _2, _3, _0)
- {
- ZEPHIR_INIT_NVAR(&position);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&position, _3);
- } else {
- ZVAL_LONG(&position, _2);
- }
- ZEPHIR_INIT_NVAR(&argument);
- ZVAL_COPY(&argument, _0);
- ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "buildparameter", &_5, 224, container, &position, &argument);
- zephir_check_call_status();
- zephir_array_append(&buildArguments, &_4$$3, PH_SEPARATE, "phalcon/Di/Service/Builder.zep", 298);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &arguments, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &arguments, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&position, &arguments, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&argument, &arguments, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "buildparameter", &_5, 224, container, &position, &argument);
- zephir_check_call_status();
- zephir_array_append(&buildArguments, &_6$$4, PH_SEPARATE, "phalcon/Di/Service/Builder.zep", 298);
- ZEPHIR_CALL_METHOD(NULL, &arguments, "next", NULL, 0);
- zephir_check_call_status();
- }
+ zephir_fetch_params(1, 1, 1, &key_param, &defaultValue);
+ zephir_get_strval(&key, key_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- ZEPHIR_INIT_NVAR(&argument);
- ZEPHIR_INIT_NVAR(&position);
- RETURN_CTOR(&buildArguments);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doget", NULL, 0, &key, defaultValue);
+ zephir_check_call_status();
+ RETURN_MM();
}
+static PHP_METHOD(Phalcon_Cache_Cache, getMultiple)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&keys_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(keys)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &keys, &defaultValue);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetmultiple", NULL, 0, keys, defaultValue);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Di_FactoryDefault_Cli)
+static PHP_METHOD(Phalcon_Cache_Cache, has)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Di\\FactoryDefault, Cli, phalcon, di_factorydefault_cli, phalcon_di_factorydefault_ce, phalcon_di_factorydefault_cli_method_entry, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL;
+ zval key;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&key);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(key)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &key_param);
+ zephir_get_strval(&key, key_param);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dohas", NULL, 0, &key);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct)
+static PHP_METHOD(Phalcon_Cache_Cache, set)
{
- zval _0, _5, _6, _7;
- zval filter, _1, _2, _3, _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null;
+ zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&filter);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_NULL(&__$null);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(key)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(ttl)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_PARENT(NULL, phalcon_di_factorydefault_cli_ce, getThis(), "__construct", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&filter);
- object_init_ex(&filter, phalcon_filter_filterfactory_ce);
- if (zephir_has_constructor(&filter)) {
- ZEPHIR_CALL_METHOD(NULL, &filter, "__construct", NULL, 0);
- zephir_check_call_status();
+ zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl);
+ zephir_get_strval(&key, key_param);
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
}
-
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 12, 0);
- ZEPHIR_INIT_VAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Annotations\\Adapter\\Memory");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("annotations"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Cli\\Dispatcher");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("dispatcher"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Html\\Escaper");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("escaper"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Events\\Manager");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("eventsManager"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_CALL_METHOD(&_4, &filter, "newinstance", NULL, 94);
- zephir_check_call_status();
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_4, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("filter"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Support\\HelperFactory");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("helper"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Model\\Manager");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("modelsManager"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Model\\MetaData\\Memory");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("modelsMetadata"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Cli\\Router");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("router"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Encryption\\Security");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("security"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_VAR(&_5);
- zephir_create_array(&_5, 2, 0);
- add_assoc_stringl_ex(&_5, SL("className"), SL("Phalcon\\Html\\TagFactory"));
- ZEPHIR_INIT_VAR(&_6);
- zephir_create_array(&_6, 1, 0);
- ZEPHIR_INIT_VAR(&_7);
- zephir_create_array(&_7, 2, 0);
- add_assoc_stringl_ex(&_7, SL("type"), SL("service"));
- add_assoc_stringl_ex(&_7, SL("name"), SL("escaper"));
- zephir_array_fast_append(&_6, &_7);
- zephir_array_update_string(&_5, SL("arguments"), &_6, PH_COPY | PH_SEPARATE);
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_5, &_3);
- zephir_check_call_status();
- zephir_array_update_string(&_0, SL("tag"), &_1, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- object_init_ex(&_1, phalcon_di_service_ce);
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_STRING(&_2, "Phalcon\\Mvc\\Model\\Transaction\\Manager");
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 78, &_2, &_3);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doset", NULL, 0, &key, value, ttl);
zephir_check_call_status();
- zephir_array_update_string(&_0, SL("transactionManager"), &_1, PH_COPY | PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("services"), &_0);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
+static PHP_METHOD(Phalcon_Cache_Cache, setMultiple)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *values, values_sub, *ttl = NULL, ttl_sub, __$null;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&values_sub);
+ ZVAL_UNDEF(&ttl_sub);
+ ZVAL_NULL(&__$null);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(values)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(ttl)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &values, &ttl);
+ if (!ttl) {
+ ttl = &ttl_sub;
+ ttl = &__$null;
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dosetmultiple", NULL, 0, values, ttl);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Di_Exception_ServiceResolutionException)
+static PHP_METHOD(Phalcon_Cache_Cache, getExceptionClass)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Di\\Exception, ServiceResolutionException, phalcon, di_exception_serviceresolutionexception, phalcon_di_exception_ce, NULL, 0);
- return SUCCESS;
+ RETURN_STRING("Phalcon\\Cache\\Exception\\InvalidArgumentException");
}
@@ -153736,1588 +149577,996 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_Exception_ServiceResolutionException)
-ZEPHIR_INIT_CLASS(Phalcon_Dispatcher_AbstractDispatcher)
+ZEPHIR_INIT_CLASS(Phalcon_Cache_CacheFactory)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Dispatcher, AbstractDispatcher, phalcon, dispatcher_abstractdispatcher, phalcon_di_abstractinjectionaware_ce, phalcon_dispatcher_abstractdispatcher_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("activeHandler"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("activeMethodMap"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("actionName"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("actionSuffix"), "Action", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("camelCaseMap"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("defaultAction"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("defaultNamespace"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("defaultHandler"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("handlerHashes"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("handlerName"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("handlerSuffix"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("finished"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("forwarded"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("isControllerInitialize"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("lastHandler"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("modelBinder"), ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("modelBinding"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("moduleName"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("namespaceName"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("params"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("previousActionName"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("previousHandlerName"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("previousNamespaceName"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("returnedValue"), ZEND_ACC_PROTECTED);
- phalcon_dispatcher_abstractdispatcher_ce->create_object = zephir_init_properties_Phalcon_Dispatcher_AbstractDispatcher;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache, CacheFactory, phalcon, cache_cachefactory, phalcon_factory_abstractconfigfactory_ce, phalcon_cache_cachefactory_method_entry, 0);
- zend_class_implements(phalcon_dispatcher_abstractdispatcher_ce, 1, phalcon_dispatcher_dispatcherinterface_ce);
- zend_class_implements(phalcon_dispatcher_abstractdispatcher_ce, 1, phalcon_events_eventsawareinterface_ce);
+ zend_declare_property_null(phalcon_cache_cachefactory_ce, SL("adapterFactory"), ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, callActionMethod)
+static PHP_METHOD(Phalcon_Cache_CacheFactory, __construct)
+{
+ zval *factory, factory_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&factory_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_cache_adapterfactory_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &factory);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("adapterFactory"), factory);
+}
+
+static PHP_METHOD(Phalcon_Cache_CacheFactory, load)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval params, _0;
- zval actionMethod;
- zval *handler, handler_sub, *actionMethod_param = NULL, *params_param = NULL;
+ zval *config = NULL, config_sub, name, options, _0, _1;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&handler_sub);
- ZVAL_UNDEF(&actionMethod);
- ZVAL_UNDEF(¶ms);
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&options);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_ZVAL(handler)
- Z_PARAM_STR(actionMethod)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(params)
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(config)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &handler, &actionMethod_param, ¶ms_param);
- zephir_get_strval(&actionMethod, actionMethod_param);
- if (!params_param) {
- ZEPHIR_INIT_VAR(¶ms);
- array_init(¶ms);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param);
+ zephir_fetch_params(1, 1, 0, &config);
+ ZEPHIR_SEPARATE_PARAM(config);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfig", NULL, 0, config);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "adapter");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfigelement", NULL, 0, config, &_1);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_0);
+ zephir_memory_observe(&name);
+ zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Cache/CacheFactory.zep", 73);
+ zephir_memory_observe(&options);
+ if (!(zephir_array_isset_string_fetch(&options, config, SL("options"), 0))) {
+ ZEPHIR_INIT_NVAR(&options);
+ array_init(&options);
}
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 2, 0);
- zephir_array_fast_append(&_0, handler);
- zephir_array_fast_append(&_0, &actionMethod);
- ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0, ¶ms);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, dispatch)
+static PHP_METHOD(Phalcon_Cache_CacheFactory, newInstance)
{
- zval _44$$10;
- zend_bool hasService = 0, hasEventsManager = 0, isNewHandler = 0, _5$$5, _16$$13, _21$$15, _29$$18, _34$$20, _42$$23, _52$$25, _56$$31, _62$$33, _66$$36, _72$$38, _78$$43, _83$$46, _88$$48, _105$$59, _110$$62, _115$$64, _118$$67, _123$$69, _130$$73;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_11 = NULL, *_12 = NULL, *_15 = NULL, *_20 = NULL, *_23 = NULL, *_25 = NULL, *_28 = NULL, *_30 = NULL, *_33 = NULL, *_35 = NULL, *_41 = NULL, *_43 = NULL, *_47 = NULL, *_51 = NULL, *_55 = NULL, *_58 = NULL, *_61 = NULL, *_64 = NULL, *_68 = NULL, *_71 = NULL, *_74 = NULL, *_77 = NULL, *_82 = NULL, *_87 = NULL, *_94 = NULL, *_100 = NULL, *_104 = NULL, *_109 = NULL, *_114 = NULL, *_122 = NULL, *_126 = NULL, *_129 = NULL;
- zval __$true, __$false, value, handler, container, namespaceName, handlerName, actionName, eventsManager, handlerClass, status, actionMethod, modelBinder, bindCacheKey, handlerHash, e, _0, _1$$3, _2$$3, _3$$5, _4$$5, _6$$5, _7$$4, _8$$7, _9$$11, _10$$11, _13$$13, _14$$13, _17$$13, _18$$12, _19$$15, _22$$15, _24$$10, _36$$10, _37$$10, _38$$10, _102$$10, _26$$18, _27$$18, _31$$20, _32$$20, _39$$23, _40$$23, _45$$26, _46$$26, _48$$26, _49$$25, _50$$25, _53$$31, _54$$31, _57$$31, _59$$30, _60$$33, _63$$33, _65$$36, _67$$36, _69$$35, _70$$38, _73$$38, _75$$41, _76$$43, _79$$43, _80$$46, _81$$46, _84$$46, _85$$45, _86$$48, _89$$48, _90$$50, _91$$50, _92$$51, _93$$51, _95$$51, _96$$54, _97$$54, _98$$57, _99$$57, _101$$57, _103$$59, _106$$59, _107$$62, _108$$62, _111$$62, _112$$61, _113$$64, _116$$64, _117$$67, _119$$67, _120$$66, _121$$69, _124$$69, _125$$72, _127$$71, _128$$73, _131$$73, _132$$76, _133$$75, _134$$77;
- zend_long ZEPHIR_LAST_CALL_STATUS, numberDispatches = 0;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval options;
+ zval *name_param = NULL, *options_param = NULL, adapter, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&handler);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&namespaceName);
- ZVAL_UNDEF(&handlerName);
- ZVAL_UNDEF(&actionName);
- ZVAL_UNDEF(&eventsManager);
- ZVAL_UNDEF(&handlerClass);
- ZVAL_UNDEF(&status);
- ZVAL_UNDEF(&actionMethod);
- ZVAL_UNDEF(&modelBinder);
- ZVAL_UNDEF(&bindCacheKey);
- ZVAL_UNDEF(&handlerHash);
- ZVAL_UNDEF(&e);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&adapter);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$7);
- ZVAL_UNDEF(&_9$$11);
- ZVAL_UNDEF(&_10$$11);
- ZVAL_UNDEF(&_13$$13);
- ZVAL_UNDEF(&_14$$13);
- ZVAL_UNDEF(&_17$$13);
- ZVAL_UNDEF(&_18$$12);
- ZVAL_UNDEF(&_19$$15);
- ZVAL_UNDEF(&_22$$15);
- ZVAL_UNDEF(&_24$$10);
- ZVAL_UNDEF(&_36$$10);
- ZVAL_UNDEF(&_37$$10);
- ZVAL_UNDEF(&_38$$10);
- ZVAL_UNDEF(&_102$$10);
- ZVAL_UNDEF(&_26$$18);
- ZVAL_UNDEF(&_27$$18);
- ZVAL_UNDEF(&_31$$20);
- ZVAL_UNDEF(&_32$$20);
- ZVAL_UNDEF(&_39$$23);
- ZVAL_UNDEF(&_40$$23);
- ZVAL_UNDEF(&_45$$26);
- ZVAL_UNDEF(&_46$$26);
- ZVAL_UNDEF(&_48$$26);
- ZVAL_UNDEF(&_49$$25);
- ZVAL_UNDEF(&_50$$25);
- ZVAL_UNDEF(&_53$$31);
- ZVAL_UNDEF(&_54$$31);
- ZVAL_UNDEF(&_57$$31);
- ZVAL_UNDEF(&_59$$30);
- ZVAL_UNDEF(&_60$$33);
- ZVAL_UNDEF(&_63$$33);
- ZVAL_UNDEF(&_65$$36);
- ZVAL_UNDEF(&_67$$36);
- ZVAL_UNDEF(&_69$$35);
- ZVAL_UNDEF(&_70$$38);
- ZVAL_UNDEF(&_73$$38);
- ZVAL_UNDEF(&_75$$41);
- ZVAL_UNDEF(&_76$$43);
- ZVAL_UNDEF(&_79$$43);
- ZVAL_UNDEF(&_80$$46);
- ZVAL_UNDEF(&_81$$46);
- ZVAL_UNDEF(&_84$$46);
- ZVAL_UNDEF(&_85$$45);
- ZVAL_UNDEF(&_86$$48);
- ZVAL_UNDEF(&_89$$48);
- ZVAL_UNDEF(&_90$$50);
- ZVAL_UNDEF(&_91$$50);
- ZVAL_UNDEF(&_92$$51);
- ZVAL_UNDEF(&_93$$51);
- ZVAL_UNDEF(&_95$$51);
- ZVAL_UNDEF(&_96$$54);
- ZVAL_UNDEF(&_97$$54);
- ZVAL_UNDEF(&_98$$57);
- ZVAL_UNDEF(&_99$$57);
- ZVAL_UNDEF(&_101$$57);
- ZVAL_UNDEF(&_103$$59);
- ZVAL_UNDEF(&_106$$59);
- ZVAL_UNDEF(&_107$$62);
- ZVAL_UNDEF(&_108$$62);
- ZVAL_UNDEF(&_111$$62);
- ZVAL_UNDEF(&_112$$61);
- ZVAL_UNDEF(&_113$$64);
- ZVAL_UNDEF(&_116$$64);
- ZVAL_UNDEF(&_117$$67);
- ZVAL_UNDEF(&_119$$67);
- ZVAL_UNDEF(&_120$$66);
- ZVAL_UNDEF(&_121$$69);
- ZVAL_UNDEF(&_124$$69);
- ZVAL_UNDEF(&_125$$72);
- ZVAL_UNDEF(&_127$$71);
- ZVAL_UNDEF(&_128$$73);
- ZVAL_UNDEF(&_131$$73);
- ZVAL_UNDEF(&_132$$76);
- ZVAL_UNDEF(&_133$$75);
- ZVAL_UNDEF(&_134$$77);
- ZVAL_UNDEF(&_44$$10);
+ ZVAL_UNDEF(&options);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_0);
- if (Z_TYPE_P(&container) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "A dependency injection container is required to access related dispatching services");
- ZVAL_LONG(&_2$$3, 0);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwdispatchexception", NULL, 0, &_1$$3, &_2$$3);
- zephir_check_call_status();
- RETURN_MM_BOOL(0);
+ zephir_fetch_params(1, 1, 1, &name_param, &options_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&eventsManager, &_0);
- hasEventsManager = Z_TYPE_P(&eventsManager) == IS_OBJECT;
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$true);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$false);
- }
- if (hasEventsManager) {
-
- /* try_start_1: */
-
- ZEPHIR_INIT_VAR(&_4$$5);
- ZVAL_STRING(&_4$$5, "dispatch:beforeDispatchLoop");
- ZEPHIR_CALL_METHOD(&_3$$5, &eventsManager, "fire", NULL, 0, &_4$$5, this_ptr);
- zephir_check_call_status_or_jump(try_end_1);
- _5$$5 = ZEPHIR_IS_FALSE_IDENTICAL(&_3$$5);
- if (_5$$5) {
- zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _5$$5 = !ZEPHIR_IS_FALSE_IDENTICAL(&_6$$5);
- }
- if (_5$$5) {
- RETURN_MM_BOOL(0);
- }
-
- try_end_1:
-
- if (EG(exception)) {
- ZEPHIR_INIT_VAR(&_7$$4);
- ZVAL_OBJ(&_7$$4, EG(exception));
- Z_ADDREF_P(&_7$$4);
- if (zephir_is_instance_of(&_7$$4, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_7$$4);
- ZEPHIR_CALL_METHOD(&status, this_ptr, "handleexception", NULL, 0, &e);
- zephir_check_call_status();
- zephir_read_property(&_8$$7, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- if (!ZEPHIR_IS_FALSE_IDENTICAL(&_8$$7)) {
- if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) {
- RETURN_MM_BOOL(0);
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 229);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
+ ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_INIT_VAR(&value);
- ZVAL_NULL(&value);
- ZEPHIR_INIT_VAR(&handler);
- ZVAL_NULL(&handler);
- numberDispatches = 0;
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$true);
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
} else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$false);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
}
- while (1) {
- zephir_read_property(&_0, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- if (!(!(zephir_is_true(&_0)))) {
- break;
- }
- numberDispatches++;
- if (UNEXPECTED(numberDispatches == 256)) {
- ZEPHIR_INIT_NVAR(&_9$$11);
- ZVAL_STRING(&_9$$11, "Dispatcher has detected a cyclic routing causing stability problems");
- ZVAL_LONG(&_10$$11, 1);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwdispatchexception", &_11, 0, &_9$$11, &_10$$11);
- zephir_check_call_status();
- break;
- }
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$false);
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "resolveemptyproperties", &_12, 0);
- zephir_check_call_status();
- if (hasEventsManager) {
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("adapterFactory"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&adapter, &_0, "newinstance", NULL, 0, &name, &options);
+ zephir_check_call_status();
+ object_init_ex(return_value, phalcon_cache_cache_ce);
+ ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 189, &adapter);
+ zephir_check_call_status();
+ RETURN_MM();
+}
- /* try_start_2: */
+static PHP_METHOD(Phalcon_Cache_CacheFactory, getExceptionClass)
+{
- ZEPHIR_INIT_NVAR(&_14$$13);
- ZVAL_STRING(&_14$$13, "dispatch:beforeDispatch");
- ZEPHIR_CALL_METHOD(&_13$$13, &eventsManager, "fire", &_15, 0, &_14$$13, this_ptr);
- zephir_check_call_status_or_jump(try_end_2);
- _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_13$$13);
- if (!(_16$$13)) {
- zephir_read_property(&_17$$13, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_17$$13);
- }
- if (_16$$13) {
- continue;
- }
+ RETURN_STRING("Phalcon\\Cache\\Exception\\Exception");
+}
- try_end_2:
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_18$$12);
- ZVAL_OBJ(&_18$$12, EG(exception));
- Z_ADDREF_P(&_18$$12);
- if (zephir_is_instance_of(&_18$$12, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_18$$12);
- ZEPHIR_CALL_METHOD(&_19$$15, this_ptr, "handleexception", &_20, 0, &e);
- zephir_check_call_status();
- _21$$15 = ZEPHIR_IS_FALSE_IDENTICAL(&_19$$15);
- if (!(_21$$15)) {
- zephir_read_property(&_22$$15, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _21$$15 = ZEPHIR_IS_FALSE_IDENTICAL(&_22$$15);
- }
- if (_21$$15) {
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 269);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- ZEPHIR_CALL_METHOD(&handlerClass, this_ptr, "gethandlerclass", &_23, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_24$$10, &container, "has", &_25, 0, &handlerClass);
- zephir_check_call_status();
- hasService = zephir_get_boolval(&_24$$10);
- if (!(hasService)) {
- hasService = zephir_class_exists(&handlerClass, 1);
- }
- if (!(hasService)) {
- ZEPHIR_INIT_NVAR(&_26$$18);
- ZEPHIR_CONCAT_VS(&_26$$18, &handlerClass, " handler class cannot be loaded");
- ZVAL_LONG(&_27$$18, 2);
- ZEPHIR_CALL_METHOD(&status, this_ptr, "throwdispatchexception", &_28, 0, &_26$$18, &_27$$18);
- zephir_check_call_status();
- _29$$18 = ZEPHIR_IS_FALSE_IDENTICAL(&status);
- if (_29$$18) {
- zephir_read_property(&_27$$18, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _29$$18 = ZEPHIR_IS_FALSE_IDENTICAL(&_27$$18);
- }
- if (_29$$18) {
- continue;
- }
- break;
- }
- ZEPHIR_CALL_METHOD(&handler, &container, "getshared", &_30, 0, &handlerClass);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&handler) != IS_OBJECT)) {
- ZEPHIR_INIT_NVAR(&_31$$20);
- ZVAL_STRING(&_31$$20, "Invalid handler returned from the services container");
- ZVAL_LONG(&_32$$20, 3);
- ZEPHIR_CALL_METHOD(&status, this_ptr, "throwdispatchexception", &_33, 0, &_31$$20, &_32$$20);
- zephir_check_call_status();
- _34$$20 = ZEPHIR_IS_FALSE_IDENTICAL(&status);
- if (_34$$20) {
- zephir_read_property(&_32$$20, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _34$$20 = ZEPHIR_IS_FALSE_IDENTICAL(&_32$$20);
- }
- if (_34$$20) {
- continue;
- }
- break;
- }
- ZEPHIR_CALL_FUNCTION(&handlerHash, "spl_object_hash", &_35, 81, &handler);
- zephir_check_call_status();
- zephir_read_property(&_36$$10, this_ptr, ZEND_STRL("handlerHashes"), PH_NOISY_CC | PH_READONLY);
- isNewHandler = !((zephir_array_isset(&_36$$10, &handlerHash)));
- if (isNewHandler) {
- zephir_update_property_array(this_ptr, SL("handlerHashes"), &handlerHash, &__$true);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("activeHandler"), &handler);
- zephir_read_property(&_37$$10, this_ptr, ZEND_STRL("namespaceName"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&namespaceName, &_37$$10);
- zephir_read_property(&_37$$10, this_ptr, ZEND_STRL("handlerName"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&handlerName, &_37$$10);
- zephir_read_property(&_37$$10, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&actionName, &_37$$10);
- ZEPHIR_OBS_NVAR(&_38$$10);
- zephir_read_property(&_38$$10, this_ptr, ZEND_STRL("params"), PH_NOISY_CC);
- if (UNEXPECTED(Z_TYPE_P(&_38$$10) != IS_ARRAY)) {
- ZEPHIR_INIT_NVAR(&_39$$23);
- ZVAL_STRING(&_39$$23, "Action parameters must be an Array");
- ZVAL_LONG(&_40$$23, 4);
- ZEPHIR_CALL_METHOD(&status, this_ptr, "throwdispatchexception", &_41, 0, &_39$$23, &_40$$23);
- zephir_check_call_status();
- _42$$23 = ZEPHIR_IS_FALSE_IDENTICAL(&status);
- if (_42$$23) {
- zephir_read_property(&_40$$23, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _42$$23 = ZEPHIR_IS_FALSE_IDENTICAL(&_40$$23);
- }
- if (_42$$23) {
- continue;
- }
- break;
- }
- ZEPHIR_CALL_METHOD(&actionMethod, this_ptr, "getactivemethod", &_43, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_44$$10);
- zephir_create_array(&_44$$10, 2, 0);
- zephir_array_fast_append(&_44$$10, &handler);
- zephir_array_fast_append(&_44$$10, &actionMethod);
- if (UNEXPECTED(!(zephir_is_callable(&_44$$10)))) {
- if (hasEventsManager) {
- ZEPHIR_INIT_NVAR(&_46$$26);
- ZVAL_STRING(&_46$$26, "dispatch:beforeNotFoundAction");
- ZEPHIR_CALL_METHOD(&_45$$26, &eventsManager, "fire", &_47, 0, &_46$$26, this_ptr);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_45$$26)) {
- continue;
- }
- zephir_read_property(&_48$$26, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_48$$26)) {
- continue;
- }
- }
- ZEPHIR_INIT_NVAR(&_49$$25);
- ZEPHIR_CONCAT_SVSVS(&_49$$25, "Action '", &actionName, "' was not found on handler '", &handlerName, "'");
- ZVAL_LONG(&_50$$25, 5);
- ZEPHIR_CALL_METHOD(&status, this_ptr, "throwdispatchexception", &_51, 0, &_49$$25, &_50$$25);
- zephir_check_call_status();
- _52$$25 = ZEPHIR_IS_FALSE_IDENTICAL(&status);
- if (_52$$25) {
- zephir_read_property(&_50$$25, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _52$$25 = ZEPHIR_IS_FALSE_IDENTICAL(&_50$$25);
- }
- if (_52$$25) {
- continue;
- }
- break;
- }
- if (hasEventsManager) {
- /* try_start_3: */
- ZEPHIR_INIT_NVAR(&_54$$31);
- ZVAL_STRING(&_54$$31, "dispatch:beforeExecuteRoute");
- ZEPHIR_CALL_METHOD(&_53$$31, &eventsManager, "fire", &_55, 0, &_54$$31, this_ptr);
- zephir_check_call_status_or_jump(try_end_3);
- _56$$31 = ZEPHIR_IS_FALSE_IDENTICAL(&_53$$31);
- if (!(_56$$31)) {
- zephir_read_property(&_57$$31, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _56$$31 = ZEPHIR_IS_FALSE_IDENTICAL(&_57$$31);
- }
- if (_56$$31) {
- ZEPHIR_CALL_METHOD(NULL, &container, "remove", &_58, 0, &handlerClass);
- zephir_check_call_status_or_jump(try_end_3);
- continue;
- }
+#ifdef HAVE_CONFIG_H
+#endif
- try_end_3:
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_59$$30);
- ZVAL_OBJ(&_59$$30, EG(exception));
- Z_ADDREF_P(&_59$$30);
- if (zephir_is_instance_of(&_59$$30, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_59$$30);
- ZEPHIR_CALL_METHOD(&_60$$33, this_ptr, "handleexception", &_61, 0, &e);
- zephir_check_call_status();
- _62$$33 = ZEPHIR_IS_FALSE_IDENTICAL(&_60$$33);
- if (!(_62$$33)) {
- zephir_read_property(&_63$$33, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _62$$33 = ZEPHIR_IS_FALSE_IDENTICAL(&_63$$33);
- }
- if (_62$$33) {
- ZEPHIR_CALL_METHOD(NULL, &container, "remove", &_64, 0, &handlerClass);
- zephir_check_call_status();
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 408);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- if ((zephir_method_exists_ex(&handler, ZEND_STRL("beforeexecuteroute")) == SUCCESS)) {
- /* try_start_4: */
- ZEPHIR_CALL_METHOD(&_65$$36, &handler, "beforeexecuteroute", NULL, 0, this_ptr);
- zephir_check_call_status_or_jump(try_end_4);
- _66$$36 = ZEPHIR_IS_FALSE_IDENTICAL(&_65$$36);
- if (!(_66$$36)) {
- zephir_read_property(&_67$$36, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _66$$36 = ZEPHIR_IS_FALSE_IDENTICAL(&_67$$36);
- }
- if (_66$$36) {
- ZEPHIR_CALL_METHOD(NULL, &container, "remove", &_68, 0, &handlerClass);
- zephir_check_call_status_or_jump(try_end_4);
- continue;
- }
- try_end_4:
+ZEPHIR_INIT_CLASS(Phalcon_Cache_CacheInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Cache, CacheInterface, phalcon, cache_cacheinterface, phalcon_cache_cacheinterface_method_entry);
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_69$$35);
- ZVAL_OBJ(&_69$$35, EG(exception));
- Z_ADDREF_P(&_69$$35);
- if (zephir_is_instance_of(&_69$$35, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_69$$35);
- ZEPHIR_CALL_METHOD(&_70$$38, this_ptr, "handleexception", &_71, 0, &e);
- zephir_check_call_status();
- _72$$38 = ZEPHIR_IS_FALSE_IDENTICAL(&_70$$38);
- if (!(_72$$38)) {
- zephir_read_property(&_73$$38, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _72$$38 = ZEPHIR_IS_FALSE_IDENTICAL(&_73$$38);
- }
- if (_72$$38) {
- ZEPHIR_CALL_METHOD(NULL, &container, "remove", &_74, 0, &handlerClass);
- zephir_check_call_status();
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 427);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- if (isNewHandler) {
- if ((zephir_method_exists_ex(&handler, ZEND_STRL("initialize")) == SUCCESS)) {
+ return SUCCESS;
+}
- /* try_start_5: */
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, clear);
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, delete);
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, deleteMultiple);
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, get);
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, getMultiple);
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, has);
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, set);
+ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, setMultiple);
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isControllerInitialize"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isControllerInitialize"), &__$false);
- }
- ZEPHIR_CALL_METHOD(NULL, &handler, "initialize", NULL, 0);
- zephir_check_call_status_or_jump(try_end_5);
- try_end_5:
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_75$$41);
- ZVAL_OBJ(&_75$$41, EG(exception));
- Z_ADDREF_P(&_75$$41);
- if (zephir_is_instance_of(&_75$$41, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_75$$41);
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isControllerInitialize"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isControllerInitialize"), &__$false);
- }
- ZEPHIR_CALL_METHOD(&_76$$43, this_ptr, "handleexception", &_77, 0, &e);
- zephir_check_call_status();
- _78$$43 = ZEPHIR_IS_FALSE_IDENTICAL(&_76$$43);
- if (!(_78$$43)) {
- zephir_read_property(&_79$$43, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _78$$43 = ZEPHIR_IS_FALSE_IDENTICAL(&_79$$43);
- }
- if (_78$$43) {
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 469);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isControllerInitialize"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("isControllerInitialize"), &__$false);
- }
- if (zephir_is_true(&eventsManager)) {
+#ifdef HAVE_CONFIG_H
+#endif
- /* try_start_6: */
- ZEPHIR_INIT_NVAR(&_81$$46);
- ZVAL_STRING(&_81$$46, "dispatch:afterInitialize");
- ZEPHIR_CALL_METHOD(&_80$$46, &eventsManager, "fire", &_82, 0, &_81$$46, this_ptr);
- zephir_check_call_status_or_jump(try_end_6);
- _83$$46 = ZEPHIR_IS_FALSE_IDENTICAL(&_80$$46);
- if (!(_83$$46)) {
- zephir_read_property(&_84$$46, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _83$$46 = ZEPHIR_IS_FALSE_IDENTICAL(&_84$$46);
- }
- if (_83$$46) {
- continue;
- }
- try_end_6:
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_85$$45);
- ZVAL_OBJ(&_85$$45, EG(exception));
- Z_ADDREF_P(&_85$$45);
- if (zephir_is_instance_of(&_85$$45, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_85$$45);
- ZEPHIR_CALL_METHOD(&_86$$48, this_ptr, "handleexception", &_87, 0, &e);
- zephir_check_call_status();
- _88$$48 = ZEPHIR_IS_FALSE_IDENTICAL(&_86$$48);
- if (!(_88$$48)) {
- zephir_read_property(&_89$$48, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _88$$48 = ZEPHIR_IS_FALSE_IDENTICAL(&_89$$48);
- }
- if (_88$$48) {
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 488);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- }
- zephir_read_property(&_37$$10, this_ptr, ZEND_STRL("modelBinding"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_37$$10)) {
- zephir_read_property(&_90$$50, this_ptr, ZEND_STRL("modelBinder"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&modelBinder, &_90$$50);
- ZEPHIR_INIT_NVAR(&bindCacheKey);
- ZEPHIR_CONCAT_SVSV(&bindCacheKey, "_PHMB_", &handlerClass, "_", &actionMethod);
- zephir_read_property(&_90$$50, this_ptr, ZEND_STRL("params"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_91$$50, &modelBinder, "bindtohandler", NULL, 0, &handler, &_90$$50, &bindCacheKey, &actionMethod);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("params"), &_91$$50);
- }
- if (hasEventsManager) {
- ZEPHIR_INIT_NVAR(&_93$$51);
- ZVAL_STRING(&_93$$51, "dispatch:afterBinding");
- ZEPHIR_CALL_METHOD(&_92$$51, &eventsManager, "fire", &_94, 0, &_93$$51, this_ptr);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_92$$51)) {
- continue;
- }
- zephir_read_property(&_95$$51, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_95$$51)) {
- continue;
- }
- }
- if ((zephir_method_exists_ex(&handler, ZEND_STRL("afterbinding")) == SUCCESS)) {
- ZEPHIR_CALL_METHOD(&_96$$54, &handler, "afterbinding", NULL, 0, this_ptr);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_96$$54)) {
- continue;
- }
- zephir_read_property(&_97$$54, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_97$$54)) {
- continue;
- }
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("lastHandler"), &handler);
- /* try_start_7: */
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, Exception, phalcon, cache_exception_exception, zend_ce_exception, NULL, 0);
- zephir_read_property(&_99$$57, this_ptr, ZEND_STRL("params"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_98$$57, this_ptr, "callactionmethod", &_100, 0, &handler, &actionMethod, &_99$$57);
- zephir_check_call_status_or_jump(try_end_7);
- zephir_update_property_zval(this_ptr, ZEND_STRL("returnedValue"), &_98$$57);
- zephir_read_property(&_101$$57, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_101$$57)) {
- continue;
- }
+ return SUCCESS;
+}
- try_end_7:
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_102$$10);
- ZVAL_OBJ(&_102$$10, EG(exception));
- Z_ADDREF_P(&_102$$10);
- if (zephir_is_instance_of(&_102$$10, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_102$$10);
- ZEPHIR_CALL_METHOD(&_103$$59, this_ptr, "handleexception", &_104, 0, &e);
- zephir_check_call_status();
- _105$$59 = ZEPHIR_IS_FALSE_IDENTICAL(&_103$$59);
- if (!(_105$$59)) {
- zephir_read_property(&_106$$59, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _105$$59 = ZEPHIR_IS_FALSE_IDENTICAL(&_106$$59);
- }
- if (_105$$59) {
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 560);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- if (hasEventsManager) {
- /* try_start_8: */
- ZEPHIR_INIT_NVAR(&_108$$62);
- ZVAL_STRING(&_108$$62, "dispatch:afterExecuteRoute");
- ZEPHIR_CALL_METHOD(&_107$$62, &eventsManager, "fire", &_109, 0, &_108$$62, this_ptr, &value);
- zephir_check_call_status_or_jump(try_end_8);
- _110$$62 = ZEPHIR_IS_FALSE_IDENTICAL(&_107$$62);
- if (!(_110$$62)) {
- zephir_read_property(&_111$$62, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _110$$62 = ZEPHIR_IS_FALSE_IDENTICAL(&_111$$62);
- }
- if (_110$$62) {
- continue;
- }
+#ifdef HAVE_CONFIG_H
+#endif
- try_end_8:
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_112$$61);
- ZVAL_OBJ(&_112$$61, EG(exception));
- Z_ADDREF_P(&_112$$61);
- if (zephir_is_instance_of(&_112$$61, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_112$$61);
- ZEPHIR_CALL_METHOD(&_113$$64, this_ptr, "handleexception", &_114, 0, &e);
- zephir_check_call_status();
- _115$$64 = ZEPHIR_IS_FALSE_IDENTICAL(&_113$$64);
- if (!(_115$$64)) {
- zephir_read_property(&_116$$64, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _115$$64 = ZEPHIR_IS_FALSE_IDENTICAL(&_116$$64);
- }
- if (_115$$64) {
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 576);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- if ((zephir_method_exists_ex(&handler, ZEND_STRL("afterexecuteroute")) == SUCCESS)) {
- /* try_start_9: */
- ZEPHIR_CALL_METHOD(&_117$$67, &handler, "afterexecuteroute", NULL, 0, this_ptr, &value);
- zephir_check_call_status_or_jump(try_end_9);
- _118$$67 = ZEPHIR_IS_FALSE_IDENTICAL(&_117$$67);
- if (!(_118$$67)) {
- zephir_read_property(&_119$$67, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _118$$67 = ZEPHIR_IS_FALSE_IDENTICAL(&_119$$67);
- }
- if (_118$$67) {
- continue;
- }
- try_end_9:
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_InvalidArgumentException)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, InvalidArgumentException, phalcon, cache_exception_invalidargumentexception, zend_ce_exception, NULL, 0);
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_120$$66);
- ZVAL_OBJ(&_120$$66, EG(exception));
- Z_ADDREF_P(&_120$$66);
- if (zephir_is_instance_of(&_120$$66, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_120$$66);
- ZEPHIR_CALL_METHOD(&_121$$69, this_ptr, "handleexception", &_122, 0, &e);
- zephir_check_call_status();
- _123$$69 = ZEPHIR_IS_FALSE_IDENTICAL(&_121$$69);
- if (!(_123$$69)) {
- zephir_read_property(&_124$$69, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _123$$69 = ZEPHIR_IS_FALSE_IDENTICAL(&_124$$69);
- }
- if (_123$$69) {
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 593);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- if (hasEventsManager) {
+ return SUCCESS;
+}
- /* try_start_10: */
- ZEPHIR_INIT_NVAR(&_125$$72);
- ZVAL_STRING(&_125$$72, "dispatch:afterDispatch");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_126, 0, &_125$$72, this_ptr, &value);
- zephir_check_call_status_or_jump(try_end_10);
- try_end_10:
- if (EG(exception)) {
- ZEPHIR_INIT_NVAR(&_127$$71);
- ZVAL_OBJ(&_127$$71, EG(exception));
- Z_ADDREF_P(&_127$$71);
- if (zephir_is_instance_of(&_127$$71, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_127$$71);
- ZEPHIR_CALL_METHOD(&_128$$73, this_ptr, "handleexception", &_129, 0, &e);
- zephir_check_call_status();
- _130$$73 = ZEPHIR_IS_FALSE_IDENTICAL(&_128$$73);
- if (!(_130$$73)) {
- zephir_read_property(&_131$$73, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY);
- _130$$73 = ZEPHIR_IS_FALSE_IDENTICAL(&_131$$73);
- }
- if (_130$$73) {
- continue;
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 610);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- }
- if (hasEventsManager) {
+#ifdef HAVE_CONFIG_H
+#endif
- /* try_start_11: */
- ZEPHIR_INIT_VAR(&_132$$76);
- ZVAL_STRING(&_132$$76, "dispatch:afterDispatchLoop");
- ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_132$$76, this_ptr);
- zephir_check_call_status_or_jump(try_end_11);
- try_end_11:
- if (EG(exception)) {
- ZEPHIR_INIT_VAR(&_133$$75);
- ZVAL_OBJ(&_133$$75, EG(exception));
- Z_ADDREF_P(&_133$$75);
- if (zephir_is_instance_of(&_133$$75, SL("Exception"))) {
- zend_clear_exception();
- ZEPHIR_CPY_WRT(&e, &_133$$75);
- ZEPHIR_CALL_METHOD(&_134$$77, this_ptr, "handleexception", NULL, 0, &e);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_134$$77)) {
- RETURN_MM_BOOL(0);
- }
- zephir_throw_exception_debug(&e, "phalcon/Dispatcher/AbstractDispatcher.zep", 627);
- ZEPHIR_MM_RESTORE();
- return;
- }
- }
- }
- RETURN_CCTOR(&handler);
-}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, forward)
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_AdapterInterface)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *forward_param = NULL, __$true, __$false, namespaceName, controllerName, params, actionName, taskName, _0, _1, _2, _3;
- zval forward;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Cache\\Adapter, AdapterInterface, phalcon, cache_adapter_adapterinterface, NULL);
- ZVAL_UNDEF(&forward);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&namespaceName);
- ZVAL_UNDEF(&controllerName);
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&actionName);
- ZVAL_UNDEF(&taskName);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(forward)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &forward_param);
- zephir_get_arrval(&forward, forward_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("isControllerInitialize"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_dispatcher_exception_ce, "Forwarding inside a controller's initialize() method is forbidden", "phalcon/Dispatcher/AbstractDispatcher.zep", 661);
- return;
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("namespaceName"), PH_NOISY_CC | PH_READONLY);
- zephir_update_property_zval(this_ptr, ZEND_STRL("previousNamespaceName"), &_1);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("handlerName"), PH_NOISY_CC | PH_READONLY);
- zephir_update_property_zval(this_ptr, ZEND_STRL("previousHandlerName"), &_2);
- zephir_read_property(&_3, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC | PH_READONLY);
- zephir_update_property_zval(this_ptr, ZEND_STRL("previousActionName"), &_3);
- if (zephir_array_isset_string_fetch(&namespaceName, &forward, SL("namespace"), 1)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("namespaceName"), &namespaceName);
- }
- zephir_memory_observe(&taskName);
- if (zephir_array_isset_string_fetch(&controllerName, &forward, SL("controller"), 1)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("handlerName"), &controllerName);
- } else if (zephir_array_isset_string_fetch(&taskName, &forward, SL("task"), 0)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("handlerName"), &taskName);
- }
- if (zephir_array_isset_string_fetch(&actionName, &forward, SL("action"), 1)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("actionName"), &actionName);
- }
- if (zephir_array_isset_string_fetch(¶ms, &forward, SL("params"), 1)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("params"), ¶ms);
- }
- if (0) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$false);
- }
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("forwarded"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("forwarded"), &__$false);
- }
- ZEPHIR_MM_RESTORE();
+ zend_class_implements(phalcon_cache_adapter_adapterinterface_ce, 1, phalcon_storage_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getActionName)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Apcu)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Apcu, phalcon, cache_adapter_apcu, phalcon_storage_adapter_apcu_ce, NULL, 0);
- RETURN_MEMBER(getThis(), "actionName");
+ zend_declare_property_string(phalcon_cache_adapter_apcu_ce, SL("eventType"), "cache", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_adapter_apcu_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getActionSuffix)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Libmemcached)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Libmemcached, phalcon, cache_adapter_libmemcached, phalcon_storage_adapter_libmemcached_ce, NULL, 0);
- RETURN_MEMBER(getThis(), "actionSuffix");
+ zend_declare_property_string(phalcon_cache_adapter_libmemcached_ce, SL("eventType"), "cache", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_adapter_libmemcached_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getActiveMethod)
-{
- zval activeMethodName, _0, _1, _5, _2$$3, _3$$3, _4$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&activeMethodName);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_memory_observe(&activeMethodName);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("activeMethodMap"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&activeMethodName, &_0, &_1, 0))) {
- zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "tocamelcase", NULL, 0, &_3$$3);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(&activeMethodName, "lcfirst", NULL, 77, &_2$$3);
- zephir_check_call_status();
- zephir_memory_observe(&_4$$3);
- zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC);
- zephir_update_property_array(this_ptr, SL("activeMethodMap"), &_4$$3, &activeMethodName);
- }
- zephir_read_property(&_5, this_ptr, ZEND_STRL("actionSuffix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CONCAT_VV(return_value, &activeMethodName, &_5);
- RETURN_MM();
-}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getBoundModels)
-{
- zval _0, _1;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
+#ifdef HAVE_CONFIG_H
+#endif
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("modelBinder"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- array_init(return_value);
- RETURN_MM();
- }
- zephir_read_property(&_1, this_ptr, ZEND_STRL("modelBinder"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_1, "getboundmodels", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
-}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getDefaultNamespace)
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Memory)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Memory, phalcon, cache_adapter_memory, phalcon_storage_adapter_memory_ce, NULL, 0);
- RETURN_MEMBER(getThis(), "defaultNamespace");
+ zend_declare_property_string(phalcon_cache_adapter_memory_ce, SL("eventType"), "cache", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_adapter_memory_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getEventsManager)
-{
- RETURN_MEMBER(getThis(), "eventsManager");
-}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getHandlerSuffix)
-{
- RETURN_MEMBER(getThis(), "handlerSuffix");
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getModelBinder)
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Redis)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Redis, phalcon, cache_adapter_redis, phalcon_storage_adapter_redis_ce, NULL, 0);
- RETURN_MEMBER(getThis(), "modelBinder");
+ zend_declare_property_string(phalcon_cache_adapter_redis_ce, SL("eventType"), "cache", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_adapter_redis_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getModuleName)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Stream)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Stream, phalcon, cache_adapter_stream, phalcon_storage_adapter_stream_ce, NULL, 0);
- RETURN_MEMBER(getThis(), "moduleName");
+ zend_declare_property_string(phalcon_cache_adapter_stream_ce, SL("eventType"), "cache", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_adapter_stream_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getNamespaceName)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_Weak)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Adapter, Weak, phalcon, cache_adapter_weak, phalcon_storage_adapter_weak_ce, NULL, 0);
- RETURN_MEMBER(getThis(), "namespaceName");
+ zend_declare_property_string(phalcon_cache_adapter_weak_ce, SL("eventType"), "cache", ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_cache_adapter_weak_ce, 1, phalcon_cache_adapter_adapterinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getParam)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Flash_AbstractFlash)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *param, param_sub, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, __$null;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, AbstractFlash, phalcon, flash_abstractflash, phalcon_di_abstractinjectionaware_ce, phalcon_flash_abstractflash_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- ZVAL_UNDEF(¶m_sub);
- ZVAL_UNDEF(&filters_sub);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_ZVAL(param)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(filters)
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, ¶m, &filters, &defaultValue);
- if (!filters) {
- filters = &filters_sub;
- filters = &__$null;
- }
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getparameter", NULL, 0, param, filters, defaultValue);
- zephir_check_call_status();
- RETURN_MM();
+ zend_declare_property_bool(phalcon_flash_abstractflash_ce, SL("autoescape"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_flash_abstractflash_ce, SL("automaticHtml"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_flash_abstractflash_ce, SL("cssClasses"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_flash_abstractflash_ce, SL("cssIconClasses"), ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_flash_abstractflash_ce, SL("customTemplate"), "", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_flash_abstractflash_ce, SL("escaperService"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_flash_abstractflash_ce, SL("implicitFlush"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_flash_abstractflash_ce, SL("interpolator"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_flash_abstractflash_ce, SL("messages"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_flash_abstractflash_ce, SL("sessionService"), ZEND_ACC_PROTECTED);
+ phalcon_flash_abstractflash_ce->create_object = zephir_init_properties_Phalcon_Flash_AbstractFlash;
+
+ zend_class_implements(phalcon_flash_abstractflash_ce, 1, phalcon_flash_flashinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getParameter)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, __construct)
{
+ zval _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *param, param_sub, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, __$null, params, filter, paramValue, _0, _3, _4, _5, _1$$5, _2$$5;
+ zval *escaper = NULL, escaper_sub, *session = NULL, session_sub, __$null, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶m_sub);
- ZVAL_UNDEF(&filters_sub);
- ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&escaper_sub);
+ ZVAL_UNDEF(&session_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&filter);
- ZVAL_UNDEF(¶mValue);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_1$$5);
- ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_1);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_ZVAL(param)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(filters)
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(escaper, phalcon_html_escaper_escaperinterface_ce)
+ Z_PARAM_OBJECT_OF_CLASS_OR_NULL(session, phalcon_session_managerinterface_ce)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, ¶m, &filters, &defaultValue);
- if (!filters) {
- filters = &filters_sub;
- filters = &__$null;
- }
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("params"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(¶ms, &_0);
- zephir_memory_observe(¶mValue);
- if (!(zephir_array_isset_fetch(¶mValue, ¶ms, param, 0))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ zephir_fetch_params(1, 0, 2, &escaper, &session);
+ if (!escaper) {
+ escaper = &escaper_sub;
+ escaper = &__$null;
}
- if (Z_TYPE_P(filters) == IS_NULL) {
- RETURN_CCTOR(¶mValue);
+ if (!session) {
+ session = &session_sub;
+ session = &__$null;
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$5);
- ZVAL_STRING(&_1$$5, "A dependency injection container is required to access the 'filter' service");
- ZVAL_LONG(&_2$$5, 0);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwdispatchexception", NULL, 0, &_1$$5, &_2$$5);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("escaperService"), escaper);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sessionService"), session);
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_support_helper_str_interpolate_ce);
+ if (zephir_has_constructor(&_0)) {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0);
zephir_check_call_status();
}
- zephir_read_property(&_3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, "filter");
- ZEPHIR_CALL_METHOD(&_4, &_3, "getshared", NULL, 0, &_5);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&filter, &_4);
- ZEPHIR_RETURN_CALL_METHOD(&filter, "sanitize", NULL, 0, ¶mValue, filters);
- zephir_check_call_status();
- RETURN_MM();
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("interpolator"), &_0);
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_create_array(&_1, 4, 0);
+ add_assoc_stringl_ex(&_1, SL("error"), SL("errorMessage"));
+ add_assoc_stringl_ex(&_1, SL("notice"), SL("noticeMessage"));
+ add_assoc_stringl_ex(&_1, SL("success"), SL("successMessage"));
+ add_assoc_stringl_ex(&_1, SL("warning"), SL("warningMessage"));
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cssClasses"), &_1);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getParams)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, clear)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getparameters", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getParameters)
-{
-
- RETURN_MEMBER(getThis(), "params");
+ ZEPHIR_INIT_VAR(&_0);
+ array_init(&_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &_0);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, hasParam)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, error)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *param, param_sub;
+ zval *message_param = NULL, _0;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶m_sub);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(param)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, ¶m);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "hasparameter", NULL, 0, param);
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "error");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, hasParameter)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getAutoescape)
{
- zval *param, param_sub, _0;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(¶m_sub);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(param)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, ¶m);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("params"), PH_NOISY_CC | PH_READONLY);
- RETURN_BOOL(zephir_array_isset(&_0, param));
+ RETURN_MEMBER(getThis(), "autoescape");
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, isFinished)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getAutomaticHtml)
{
- RETURN_MEMBER(getThis(), "finished");
+ RETURN_MEMBER(getThis(), "automaticHtml");
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setActionName)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getCssClasses)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *actionName_param = NULL;
- zval actionName;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&actionName);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(actionName)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &actionName_param);
- zephir_get_strval(&actionName, actionName_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("actionName"), &actionName);
- ZEPHIR_MM_RESTORE();
+ RETURN_MEMBER(getThis(), "cssClasses");
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setDefaultAction)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getCssIconClasses)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *actionName_param = NULL;
- zval actionName;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&actionName);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(actionName)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &actionName_param);
- zephir_get_strval(&actionName, actionName_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultAction"), &actionName);
- ZEPHIR_MM_RESTORE();
+ RETURN_MEMBER(getThis(), "cssIconClasses");
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setDefaultNamespace)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getCustomTemplate)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *defaultNamespace_param = NULL;
- zval defaultNamespace;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&defaultNamespace);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(defaultNamespace)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &defaultNamespace_param);
- zephir_get_strval(&defaultNamespace, defaultNamespace_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultNamespace"), &defaultNamespace);
- ZEPHIR_MM_RESTORE();
+ RETURN_MEMBER(getThis(), "customTemplate");
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getHandlerClass)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getEscaperService)
{
- zval handlerSuffix, handlerName, namespaceName, camelizedClass, handlerClass, _0;
+ zend_bool _2;
+ zval _0, _1, _3, _4, _5, _6$$4, _7$$4, _8$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&handlerSuffix);
- ZVAL_UNDEF(&handlerName);
- ZVAL_UNDEF(&namespaceName);
- ZVAL_UNDEF(&camelizedClass);
- ZVAL_UNDEF(&handlerClass);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "resolveemptyproperties", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("handlerSuffix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&handlerSuffix, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("handlerName"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&handlerName, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("namespaceName"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&namespaceName, &_0);
- if (!(zephir_memnstr_str(&handlerName, SL("\\"), "phalcon/Dispatcher/AbstractDispatcher.zep", 938))) {
- ZEPHIR_CALL_METHOD(&camelizedClass, this_ptr, "tocamelcase", NULL, 0, &handlerName);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("escaperService"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) != IS_NULL) {
+ RETURN_MM_MEMBER(getThis(), "escaperService");
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ _2 = Z_TYPE_P(&_1) != IS_NULL;
+ if (_2) {
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_5);
+ ZVAL_STRING(&_5, "escaper");
+ ZEPHIR_CALL_METHOD(&_4, &_3, "has", NULL, 0, &_5);
zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&camelizedClass, &handlerName);
+ _2 = ZEPHIR_IS_TRUE_IDENTICAL(&_4);
}
- ZEPHIR_INIT_VAR(&handlerClass);
- if (zephir_is_true(&namespaceName)) {
- if (!(zephir_end_with_str(&namespaceName, SL("\\")))) {
- zephir_concat_self_str(&namespaceName, SL("\\"));
- }
- ZEPHIR_CONCAT_VVV(&handlerClass, &namespaceName, &camelizedClass, &handlerSuffix);
- } else {
- ZEPHIR_CONCAT_VV(&handlerClass, &camelizedClass, &handlerSuffix);
+ if (_2) {
+ zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "escaper");
+ ZEPHIR_CALL_METHOD(&_7$$4, &_6$$4, "getshared", NULL, 0, &_8$$4);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("escaperService"), &_7$$4);
+ RETURN_MM_MEMBER(getThis(), "escaperService");
}
- RETURN_CCTOR(&handlerClass);
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_flash_exception_ce, "A dependency injection container is required to access the 'escaper' service", "phalcon/Flash/AbstractFlash.zep", 194);
+ return;
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setParam)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, notice)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *param, param_sub, *value, value_sub;
+ zval *message_param = NULL, _0;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶m_sub);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(param)
- Z_PARAM_ZVAL(value)
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, ¶m, &value);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setparameter", NULL, 0, param, value);
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "notice");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setParameter)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setAutoescape)
{
- zval *param, param_sub, *value, value_sub;
+ zval *autoescape_param = NULL, __$true, __$false;
+ zend_bool autoescape;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶m_sub);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(param)
- Z_PARAM_ZVAL(value)
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(autoescape)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(2, 0, ¶m, &value);
- zephir_update_property_array(this_ptr, SL("params"), param, value);
+ zephir_fetch_params_without_memory_grow(1, 0, &autoescape_param);
+ if (autoescape) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoescape"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("autoescape"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setParams)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setAutomaticHtml)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *params_param = NULL;
- zval params;
+ zval *automaticHtml_param = NULL, __$true, __$false;
+ zend_bool automaticHtml;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶ms);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(params)
+ Z_PARAM_BOOL(automaticHtml)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, ¶ms_param);
- zephir_get_arrval(¶ms, params_param);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setparameters", NULL, 0, ¶ms);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params_without_memory_grow(1, 0, &automaticHtml_param);
+ if (automaticHtml) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("automaticHtml"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("automaticHtml"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setParameters)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setCssClasses)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *params_param = NULL;
- zval params;
+ zval *cssClasses_param = NULL;
+ zval cssClasses;
zval *this_ptr = getThis();
- ZVAL_UNDEF(¶ms);
+ ZVAL_UNDEF(&cssClasses);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(params)
+ Z_PARAM_ARRAY(cssClasses)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, ¶ms_param);
- zephir_get_arrval(¶ms, params_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("params"), ¶ms);
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &cssClasses_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&cssClasses, cssClasses_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cssClasses"), &cssClasses);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setReturnedValue)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setCssIconClasses)
{
- zval *value, value_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *cssIconClasses_param = NULL;
+ zval cssIconClasses;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&cssIconClasses);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
+ Z_PARAM_ARRAY(cssIconClasses)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &value);
- zephir_update_property_zval(this_ptr, ZEND_STRL("returnedValue"), value);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &cssIconClasses_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&cssIconClasses, cssIconClasses_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cssIconClasses"), &cssIconClasses);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setActionSuffix)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setCustomTemplate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *actionSuffix_param = NULL;
- zval actionSuffix;
+ zval *customTemplate_param = NULL;
+ zval customTemplate;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&actionSuffix);
+ ZVAL_UNDEF(&customTemplate);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(actionSuffix)
+ Z_PARAM_STR(customTemplate)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &actionSuffix_param);
- zephir_get_strval(&actionSuffix, actionSuffix_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("actionSuffix"), &actionSuffix);
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &customTemplate_param);
+ if (UNEXPECTED(Z_TYPE_P(customTemplate_param) != IS_STRING && Z_TYPE_P(customTemplate_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'customTemplate' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(customTemplate_param) == IS_STRING)) {
+ zephir_get_strval(&customTemplate, customTemplate_param);
+ } else {
+ ZEPHIR_INIT_VAR(&customTemplate);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("customTemplate"), &customTemplate);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setEventsManager)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setEscaperService)
{
- zval *eventsManager, eventsManager_sub;
+ zval *escaperService, escaperService_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&eventsManager_sub);
+ ZVAL_UNDEF(&escaperService_sub);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
+ Z_PARAM_OBJECT_OF_CLASS(escaperService, phalcon_html_escaper_escaperinterface_ce)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
- zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+ zephir_fetch_params_without_memory_grow(1, 0, &escaperService);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("escaperService"), escaperService);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setHandlerSuffix)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, setImplicitFlush)
+{
+ zval *implicitFlush_param = NULL, __$true, __$false;
+ zend_bool implicitFlush;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(implicitFlush)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &implicitFlush_param);
+ if (implicitFlush) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("implicitFlush"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("implicitFlush"), &__$false);
+ }
+ RETURN_THISW();
+}
+
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, success)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *handlerSuffix_param = NULL;
- zval handlerSuffix;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *message_param = NULL, _0;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&handlerSuffix);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(handlerSuffix)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &handlerSuffix_param);
- zephir_get_strval(&handlerSuffix, handlerSuffix_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("handlerSuffix"), &handlerSuffix);
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "success");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setModelBinder)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, outputMessage)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL, *_5 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *modelBinder, modelBinder_sub, *cache = NULL, cache_sub, __$true, __$false, __$null, container, _0$$3, _1$$3;
+ zval *type_param = NULL, *message = NULL, message_sub, content, html, item, prepared, *_2, _3, _1$$4, _6$$5, _7$$8;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&modelBinder_sub);
- ZVAL_UNDEF(&cache_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(modelBinder, phalcon_mvc_model_binderinterface_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(cache)
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message_sub);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&html);
+ ZVAL_UNDEF(&item);
+ ZVAL_UNDEF(&prepared);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$8);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_ZVAL(message)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &modelBinder, &cache);
- if (!cache) {
- cache = &cache_sub;
- ZEPHIR_CPY_WRT(cache, &__$null);
- } else {
- ZEPHIR_SEPARATE_PARAM(cache);
+ zephir_fetch_params(1, 2, 0, &type_param, &message);
+ zephir_get_strval(&type, type_param);
+ ZEPHIR_SEPARATE_PARAM(message);
+ ZEPHIR_INIT_VAR(&content);
+ ZVAL_STRING(&content, "");
+ _0 = Z_TYPE_P(message) != IS_ARRAY;
+ if (_0) {
+ _0 = Z_TYPE_P(message) != IS_STRING;
}
- if (Z_TYPE_P(cache) == IS_STRING) {
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&container, &_0$$3);
- ZEPHIR_CALL_METHOD(&_1$$3, &container, "get", NULL, 0, cache);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(cache, &_1$$3);
+ if (_0) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_flash_exception_ce, "The message must be an array or a string", "phalcon/Flash/AbstractFlash.zep", 334);
+ return;
}
- if (Z_TYPE_P(cache) != IS_NULL) {
- ZEPHIR_CALL_METHOD(NULL, modelBinder, "setcache", NULL, 0, cache);
- zephir_check_call_status();
+ if (Z_TYPE_P(message) != IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_create_array(&_1$$4, 1, 0);
+ zephir_array_fast_append(&_1$$4, message);
+ ZEPHIR_CPY_WRT(message, &_1$$4);
}
- if (1) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("modelBinding"), &__$true);
+ zephir_is_iterable(message, 0, "phalcon/Flash/AbstractFlash.zep", 360);
+ if (Z_TYPE_P(message) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(message), _2)
+ {
+ ZEPHIR_INIT_NVAR(&item);
+ ZVAL_COPY(&item, _2);
+ ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 82, &item);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 83, &type, &prepared);
+ zephir_check_call_status();
+ zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("implicitFlush"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_6$$5)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&content, &html);
+ zephir_update_property_array_append(this_ptr, SL("messages"), &html);
+ }
+ } ZEND_HASH_FOREACH_END();
} else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("modelBinding"), &__$false);
+ ZEPHIR_CALL_METHOD(NULL, message, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, message, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&item, message, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 82, &item);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 83, &type, &prepared);
+ zephir_check_call_status();
+ zephir_read_property(&_7$$8, this_ptr, ZEND_STRL("implicitFlush"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$8)) {
+ zend_print_zval(&html, 0);
+ } else {
+ zephir_concat_self(&content, &html);
+ zephir_update_property_array_append(this_ptr, SL("messages"), &html);
+ }
+ ZEPHIR_CALL_METHOD(NULL, message, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("modelBinder"), modelBinder);
- RETURN_THIS();
+ ZEPHIR_INIT_NVAR(&item);
+ RETURN_CCTOR(&content);
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setModuleName)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, warning)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *moduleName_param = NULL;
- zval moduleName;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *message_param = NULL, _0;
+ zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&moduleName);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(moduleName)
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &moduleName_param);
- if (!moduleName_param) {
- ZEPHIR_INIT_VAR(&moduleName);
- } else {
- zephir_get_strval(&moduleName, moduleName_param);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("moduleName"), &moduleName);
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "warning");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, setNamespaceName)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, getTemplate)
{
+ zval _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *namespaceName_param = NULL;
- zval namespaceName;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *cssClassses_param = NULL, *cssIconClasses_param = NULL, _0, _1, _2, _3;
+ zval cssClassses, cssIconClasses, divString, iconString, template;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&namespaceName);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(namespaceName)
+ ZVAL_UNDEF(&cssClassses);
+ ZVAL_UNDEF(&cssIconClasses);
+ ZVAL_UNDEF(&divString);
+ ZVAL_UNDEF(&iconString);
+ ZVAL_UNDEF(&template);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(cssClassses)
+ Z_PARAM_STR(cssIconClasses)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &namespaceName_param);
- zephir_get_strval(&namespaceName, namespaceName_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("namespaceName"), &namespaceName);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getReturnedValue)
-{
-
- RETURN_MEMBER(getThis(), "returnedValue");
+ zephir_fetch_params(1, 2, 0, &cssClassses_param, &cssIconClasses_param);
+ zephir_get_strval(&cssClassses, cssClassses_param);
+ zephir_get_strval(&cssIconClasses, cssIconClasses_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_GET_CONSTANT(&_0, "PHP_EOL");
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SV(&_1, "
%iconString%%message%
", &_0);
+ zephir_get_strval(&template, &_1);
+ ZEPHIR_INIT_VAR(&divString);
+ ZEPHIR_INIT_VAR(&iconString);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("customTemplate"), PH_NOISY_CC | PH_READONLY);
+ if (!(ZEPHIR_IS_EMPTY(&_2))) {
+ RETURN_MM_MEMBER(getThis(), "customTemplate");
+ }
+ if (!(ZEPHIR_IS_EMPTY(&cssClassses))) {
+ ZEPHIR_INIT_NVAR(&divString);
+ ZVAL_STRING(&divString, " class=\"%cssClass%\"");
+ if (!(ZEPHIR_IS_EMPTY(&cssIconClasses))) {
+ ZEPHIR_INIT_NVAR(&iconString);
+ ZVAL_STRING(&iconString, "
");
+ }
+ }
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("interpolator"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_create_array(&_4, 2, 0);
+ zephir_array_update_string(&_4, SL("divString"), &divString, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_4, SL("iconString"), &iconString, PH_COPY | PH_SEPARATE);
+ ZEPHIR_RETURN_CALL_METHOD(&_3, "__invoke", NULL, 0, &template, &_4);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, wasForwarded)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, prepareEscapedMessage)
{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *message_param = NULL, escaper, _0;
+ zval message;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "forwarded");
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&escaper);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("autoescape"), PH_NOISY_CC | PH_READONLY);
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
+ RETURN_CTOR(&message);
+ }
+ ZEPHIR_CALL_METHOD(&escaper, this_ptr, "getescaperservice", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(&escaper, "escapehtml", NULL, 0, &message);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, resolveEmptyProperties)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, prepareHtmlMessage)
{
- zval _0, _2, _4, _1$$3, _3$$4, _5$$5;
+ zval _5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *type_param = NULL, *message_param = NULL, cssClasses, cssIconClasses, _0, _1, _2, _3, _4;
+ zval type, message;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&cssClasses);
+ ZVAL_UNDEF(&cssIconClasses);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$5);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("namespaceName"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_is_true(&_0))) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("defaultNamespace"), PH_NOISY_CC | PH_READONLY);
- zephir_update_property_zval(this_ptr, ZEND_STRL("namespaceName"), &_1$$3);
- }
- zephir_read_property(&_2, this_ptr, ZEND_STRL("handlerName"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_is_true(&_2))) {
- zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("defaultHandler"), PH_NOISY_CC | PH_READONLY);
- zephir_update_property_zval(this_ptr, ZEND_STRL("handlerName"), &_3$$4);
- }
- zephir_read_property(&_4, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_is_true(&_4))) {
- zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("defaultAction"), PH_NOISY_CC | PH_READONLY);
- zephir_update_property_zval(this_ptr, ZEND_STRL("actionName"), &_5$$5);
+ ZVAL_UNDEF(&_5);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_STR(message)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &type_param, &message_param);
+ zephir_get_strval(&type, type_param);
+ zephir_get_strval(&message, message_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("automaticHtml"), PH_NOISY_CC | PH_READONLY);
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
+ RETURN_CTOR(&message);
}
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("cssClasses"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&cssClasses, this_ptr, "checkclasses", NULL, 84, &_1, &type);
+ zephir_check_call_status();
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("cssIconClasses"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&cssIconClasses, this_ptr, "checkclasses", NULL, 84, &_2, &type);
+ zephir_check_call_status();
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("interpolator"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_4, this_ptr, "gettemplate", NULL, 85, &cssClasses, &cssIconClasses);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_5);
+ zephir_create_array(&_5, 3, 0);
+ zephir_array_update_string(&_5, SL("cssClass"), &cssClasses, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_5, SL("cssIconClass"), &cssIconClasses, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_5, SL("message"), &message, PH_COPY | PH_SEPARATE);
+ ZEPHIR_RETURN_CALL_METHOD(&_3, "__invoke", NULL, 0, &_4, &_5);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, toCamelCase)
+static PHP_METHOD(Phalcon_Flash_AbstractFlash, checkClasses)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *input_param = NULL, camelCaseInput, _0, _1$$3, _2$$3, _3$$3;
- zval input;
- zval *this_ptr = getThis();
+ zval type;
+ zval *collection_param = NULL, *type_param = NULL, content, _0$$5, _1$$4;
+ zval collection;
- ZVAL_UNDEF(&input);
- ZVAL_UNDEF(&camelCaseInput);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(input)
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&type);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_STR(type)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &input_param);
- zephir_get_strval(&input, input_param);
- zephir_memory_observe(&camelCaseInput);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("camelCaseMap"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&camelCaseInput, &_0, &input, 0))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "/[_-]+/");
- ZEPHIR_CALL_FUNCTION(&_2$$3, "preg_split", NULL, 71, &_1$$3, &input);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1$$3);
- ZVAL_STRING(&_1$$3, "ucfirst");
- ZEPHIR_CALL_FUNCTION(&_3$$3, "array_map", NULL, 70, &_1$$3, &_2$$3);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&camelCaseInput);
- zephir_fast_join_str(&camelCaseInput, SL(""), &_3$$3);
- zephir_update_property_array(this_ptr, SL("camelCaseMap"), &input, &camelCaseInput);
+ zephir_fetch_params(1, 2, 0, &collection_param, &type_param);
+ zephir_get_arrval(&collection, collection_param);
+ zephir_get_strval(&type, type_param);
+ ZEPHIR_INIT_VAR(&content);
+ ZVAL_STRING(&content, "");
+ if (zephir_array_isset(&collection, &type)) {
+ ZEPHIR_OBS_NVAR(&content);
+ zephir_array_fetch(&content, &collection, &type, PH_NOISY, "phalcon/Flash/AbstractFlash.zep", 484);
}
- RETURN_CCTOR(&camelCaseInput);
+ if (1 != ZEPHIR_IS_EMPTY(&content)) {
+ if (Z_TYPE_P(&content) != IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_0$$5);
+ zephir_create_array(&_0$$5, 1, 0);
+ zephir_array_fast_append(&_0$$5, &content);
+ ZEPHIR_CPY_WRT(&content, &_0$$5);
+ }
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_fast_join_str(&_1$$4, SL(" "), &content);
+ ZEPHIR_CPY_WRT(&content, &_1$$4);
+ }
+ RETURN_CCTOR(&content);
}
-zend_object *zephir_init_properties_Phalcon_Dispatcher_AbstractDispatcher(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Flash_AbstractFlash(zend_class_entry *class_type)
{
- zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6;
+ zval _0, _2, _4, _1$$3, _3$$4, _5$$5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_6);
ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_3$$4);
ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_7$$6);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
@@ -155326,29 +150575,23 @@ zend_object *zephir_init_properties_Phalcon_Dispatcher_AbstractDispatcher(zend_c
{
zval local_this_ptr, *this_ptr = &local_this_ptr;
ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("params"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_0) == IS_NULL) {
ZEPHIR_INIT_VAR(&_1$$3);
array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("params"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("messages"), &_1$$3);
}
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("handlerHashes"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("cssIconClasses"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_2) == IS_NULL) {
ZEPHIR_INIT_VAR(&_3$$4);
array_init(&_3$$4);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("handlerHashes"), &_3$$4);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("cssIconClasses"), &_3$$4);
}
- zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("camelCaseMap"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("cssClasses"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_4) == IS_NULL) {
ZEPHIR_INIT_VAR(&_5$$5);
array_init(&_5$$5);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("camelCaseMap"), &_5$$5);
- }
- zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("activeMethodMap"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_6) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_7$$6);
- array_init(&_7$$6);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("activeMethodMap"), &_7$$6);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("cssClasses"), &_5$$5);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -155365,34 +150608,91 @@ zend_object *zephir_init_properties_Phalcon_Dispatcher_AbstractDispatcher(zend_c
-ZEPHIR_INIT_CLASS(Phalcon_Dispatcher_DispatcherInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Flash_Direct)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Dispatcher, DispatcherInterface, phalcon, dispatcher_dispatcherinterface, phalcon_dispatcher_dispatcherinterface_method_entry);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, Direct, phalcon, flash_direct, phalcon_flash_abstractflash_ce, phalcon_flash_direct_method_entry, 0);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, dispatch);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, forward);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getActionName);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getActionSuffix);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getHandlerSuffix);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getParam);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getParameter);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getParams);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getParameters);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, getReturnedValue);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, hasParam);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, isFinished);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setActionName);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setActionSuffix);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setDefaultAction);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setDefaultNamespace);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setHandlerSuffix);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setModuleName);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setNamespaceName);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setParam);
-ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setParams);
+static PHP_METHOD(Phalcon_Flash_Direct, message)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *type_param = NULL, *message, message_sub;
+ zval type;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message_sub);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_ZVAL(message)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &type_param, &message);
+ zephir_get_strval(&type, type_param);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputmessage", NULL, 0, &type, message);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+
+static PHP_METHOD(Phalcon_Flash_Direct, output)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *remove_param = NULL, message, _0, *_1, _2;
+ zend_bool remove;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(remove)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &remove_param);
+ if (!remove_param) {
+ remove = 1;
+ } else {
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
+ zephir_is_iterable(&_0, 0, "phalcon/Flash/Direct.zep", 45);
+ if (Z_TYPE_P(&_0) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1)
+ {
+ ZEPHIR_INIT_NVAR(&message);
+ ZVAL_COPY(&message, _1);
+ zend_print_zval(&message, 0);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&message, &_0, "current", NULL, 0);
+ zephir_check_call_status();
+ zend_print_zval(&message, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&message);
+ if (remove) {
+ ZEPHIR_CALL_PARENT(NULL, phalcon_flash_direct_ce, getThis(), "clear", NULL, 0);
+ zephir_check_call_status();
+ }
+ ZEPHIR_MM_RESTORE();
+}
+
@@ -155403,25 +150703,35 @@ ZEPHIR_DOC_METHOD(Phalcon_Dispatcher_DispatcherInterface, setParams);
-ZEPHIR_INIT_CLASS(Phalcon_Dispatcher_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Flash_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Dispatcher, Exception, phalcon, dispatcher_exception, zend_ce_exception, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, Exception, phalcon, flash_exception, zend_ce_exception, NULL, 0);
- zephir_declare_class_constant_long(phalcon_dispatcher_exception_ce, SL("EXCEPTION_ACTION_NOT_FOUND"), 5);
+ return SUCCESS;
+}
- zephir_declare_class_constant_long(phalcon_dispatcher_exception_ce, SL("EXCEPTION_CYCLIC_ROUTING"), 1);
- zephir_declare_class_constant_long(phalcon_dispatcher_exception_ce, SL("EXCEPTION_HANDLER_NOT_FOUND"), 2);
- zephir_declare_class_constant_long(phalcon_dispatcher_exception_ce, SL("EXCEPTION_INVALID_HANDLER"), 3);
- zephir_declare_class_constant_long(phalcon_dispatcher_exception_ce, SL("EXCEPTION_INVALID_PARAMS"), 4);
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
- zephir_declare_class_constant_long(phalcon_dispatcher_exception_ce, SL("EXCEPTION_NO_DI"), 0);
+
+ZEPHIR_INIT_CLASS(Phalcon_Flash_FlashInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Flash, FlashInterface, phalcon, flash_flashinterface, phalcon_flash_flashinterface_method_entry);
return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Flash_FlashInterface, error);
+ZEPHIR_DOC_METHOD(Phalcon_Flash_FlashInterface, message);
+ZEPHIR_DOC_METHOD(Phalcon_Flash_FlashInterface, notice);
+ZEPHIR_DOC_METHOD(Phalcon_Flash_FlashInterface, success);
+ZEPHIR_DOC_METHOD(Phalcon_Flash_FlashInterface, warning);
@@ -155432,412 +150742,350 @@ ZEPHIR_INIT_CLASS(Phalcon_Dispatcher_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Config_Config)
+ZEPHIR_INIT_CLASS(Phalcon_Flash_Session)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config, Config, phalcon, config_config, phalcon_support_collection_ce, phalcon_config_config_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Flash, Session, phalcon, flash_session, phalcon_flash_abstractflash_ce, phalcon_flash_session_method_entry, 0);
- zend_declare_property_string(phalcon_config_config_ce, SL("pathDelimiter"), ".", ZEND_ACC_PROTECTED);
- zephir_declare_class_constant_string(phalcon_config_config_ce, SL("DEFAULT_PATH_DELIMITER"), ".");
+ zephir_declare_class_constant_string(phalcon_flash_session_ce, SL("SESSION_KEY"), "_flashMessages");
- zend_class_implements(phalcon_config_config_ce, 1, phalcon_config_configinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Config_Config, getPathDelimiter)
-{
-
- RETURN_MEMBER(getThis(), "pathDelimiter");
-}
-
-static PHP_METHOD(Phalcon_Config_Config, merge)
+static PHP_METHOD(Phalcon_Flash_Session, clear)
{
- zend_bool _0;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *toMerge, toMerge_sub, result, source, _1$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&toMerge_sub);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&source);
- ZVAL_UNDEF(&_1$$4);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(toMerge)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &toMerge);
- ZEPHIR_CALL_METHOD(&source, this_ptr, "toarray", NULL, 0);
+
+ ZVAL_BOOL(&_0, 1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "getsessionmessages", NULL, 0, &_0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "clear", NULL, 0);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", NULL, 0);
zephir_check_call_status();
- if (Z_TYPE_P(toMerge) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 21, &source, toMerge);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &result);
- zephir_check_call_status();
- RETURN_THIS();
- }
- _0 = Z_TYPE_P(toMerge) == IS_OBJECT;
- if (_0) {
- _0 = zephir_instance_of_ev(toMerge, phalcon_config_configinterface_ce);
- }
- if (_0) {
- ZEPHIR_CALL_METHOD(&_1$$4, toMerge, "toarray", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 21, &source, &_1$$4);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &result);
- zephir_check_call_status();
- RETURN_THIS();
- }
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Invalid data type for merge.", "phalcon/Config/Config.zep", 103);
- return;
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Config_Config, path)
+static PHP_METHOD(Phalcon_Flash_Session, getMessages)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_2 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *path_param = NULL, *defaultValue = NULL, defaultValue_sub, *delimiter_param = NULL, __$null, config, key, keys, pathDelimiter, _0, _1$$4, _3$$5, _4$$5;
- zval path, delimiter;
+ zend_bool remove;
+ zval *type = NULL, type_sub, *remove_param = NULL, __$null, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&delimiter);
- ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&type_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&config);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&keys);
- ZVAL_UNDEF(&pathDelimiter);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$5);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(path)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- Z_PARAM_STR_OR_NULL(delimiter)
+ Z_PARAM_ZVAL_OR_NULL(type)
+ Z_PARAM_BOOL(remove)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &path_param, &defaultValue, &delimiter_param);
- zephir_get_strval(&path, path_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
+ zephir_fetch_params(1, 0, 2, &type, &remove_param);
+ if (!type) {
+ type = &type_sub;
+ type = &__$null;
}
- if (!delimiter_param) {
- ZEPHIR_INIT_VAR(&delimiter);
+ if (!remove_param) {
+ remove = 1;
} else {
- zephir_get_strval(&delimiter, delimiter_param);
- }
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &path);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, &path);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_CPY_WRT(&pathDelimiter, &delimiter);
- if (1 == ZEPHIR_IS_EMPTY(&pathDelimiter)) {
- zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("pathDelimiter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&pathDelimiter, &_1$$4);
- }
- ZEPHIR_INIT_VAR(&config);
- if (zephir_clone(&config, this_ptr) == FAILURE) {
- RETURN_MM();
- }
- ZEPHIR_INIT_VAR(&keys);
- zephir_fast_explode(&keys, &pathDelimiter, &path, LONG_MAX);
- while (1) {
- if (!(1 != ZEPHIR_IS_EMPTY(&keys))) {
- break;
- }
- ZEPHIR_MAKE_REF(&keys);
- ZEPHIR_CALL_FUNCTION(&key, "array_shift", &_2, 22, &keys);
- ZEPHIR_UNREF(&keys);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_3$$5, &config, "has", NULL, 0, &key);
- zephir_check_call_status();
- if (!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$5)) {
- break;
- }
- if (1 == ZEPHIR_IS_EMPTY(&keys)) {
- ZEPHIR_RETURN_CALL_METHOD(&config, "get", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_CALL_METHOD(&_4$$5, &config, "get", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&config, &_4$$5);
- if (1 == ZEPHIR_IS_EMPTY(&config)) {
- break;
}
+ if (remove) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
}
- RETVAL_ZVAL(defaultValue, 1, 0);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsessionmessages", NULL, 0, &_0, type);
+ zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Config_Config, setPathDelimiter)
+static PHP_METHOD(Phalcon_Flash_Session, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *delimiter_param = NULL;
- zval delimiter;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *type_param = NULL, messages, _0;
+ zval type;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&delimiter);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&_0);
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(delimiter)
+ Z_PARAM_STR_OR_NULL(type)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &delimiter_param);
- if (!delimiter_param) {
- ZEPHIR_INIT_VAR(&delimiter);
+ zephir_fetch_params(1, 0, 1, &type_param);
+ if (!type_param) {
+ ZEPHIR_INIT_VAR(&type);
} else {
- zephir_get_strval(&delimiter, delimiter_param);
+ zephir_get_strval(&type, type_param);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("pathDelimiter"), &delimiter);
- RETURN_THIS();
+ ZVAL_BOOL(&_0, 0);
+ ZEPHIR_CALL_METHOD(&messages, this_ptr, "getsessionmessages", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (!(!(ZEPHIR_IS_EMPTY(&type)))) {
+ RETURN_MM_BOOL((1 != ZEPHIR_IS_EMPTY(&messages)));
+ }
+ RETURN_MM_BOOL(zephir_array_isset(&messages, &type));
}
-static PHP_METHOD(Phalcon_Config_Config, toArray)
+static PHP_METHOD(Phalcon_Flash_Session, message)
{
- zend_bool _4$$3, _6$$5;
- zend_string *_3;
- zend_ulong _2;
- zval results;
- zval data, key, value, *_0, _1, _5$$4, _7$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *type_param = NULL, *message, message_sub, messages, _0, _1$$3;
+ zval type;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&results);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&message_sub);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(type)
+ Z_PARAM_ZVAL(message)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &type_param, &message);
+ zephir_get_strval(&type, type_param);
+ ZVAL_BOOL(&_0, 0);
+ ZEPHIR_CALL_METHOD(&messages, this_ptr, "getsessionmessages", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (1 != zephir_array_isset(&messages, &type)) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_array_update_zval(&messages, &type, &_1$$3, PH_COPY | PH_SEPARATE);
+ }
+ zephir_array_update_multi(&messages, message, SL("za"), 2, &type);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsessionmessages", NULL, 0, &messages);
+ zephir_check_call_status();
+ RETURN_MM_NULL();
+}
- ZEPHIR_INIT_VAR(&results);
- array_init(&results);
- ZEPHIR_CALL_PARENT(&data, phalcon_config_config_ce, getThis(), "toarray", NULL, 0);
+static PHP_METHOD(Phalcon_Flash_Session, output)
+{
+ zend_string *_4;
+ zend_ulong _3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *remove_param = NULL, message, messages, type, _0, *_1, _2;
+ zend_bool remove;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&type);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(remove)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &remove_param);
+ if (!remove_param) {
+ remove = 1;
+ } else {
+ }
+ if (remove) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
+ }
+ ZEPHIR_CALL_METHOD(&messages, this_ptr, "getsessionmessages", NULL, 0, &_0);
zephir_check_call_status();
- zephir_is_iterable(&data, 0, "phalcon/Config/Config.zep", 203);
- if (Z_TYPE_P(&data) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0)
+ zephir_is_iterable(&messages, 0, "phalcon/Flash/Session.zep", 117);
+ if (Z_TYPE_P(&messages) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&messages), _3, _4, _1)
{
- ZEPHIR_INIT_NVAR(&key);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&key, _3);
+ ZEPHIR_INIT_NVAR(&type);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&type, _4);
} else {
- ZVAL_LONG(&key, _2);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- _4$$3 = Z_TYPE_P(&value) == IS_OBJECT;
- if (_4$$3) {
- _4$$3 = 1 == (zephir_method_exists_ex(&value, ZEND_STRL("toarray")) == SUCCESS);
- }
- if (_4$$3) {
- ZEPHIR_CALL_METHOD(&_5$$4, &value, "toarray", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&value, &_5$$4);
+ ZVAL_LONG(&type, _3);
}
- zephir_array_update_zval(&results, &key, &value, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&message);
+ ZVAL_COPY(&message, _1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "outputmessage", &_5, 0, &type, &message);
+ zephir_check_call_status();
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &data, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_1, &data, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_2, &messages, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_1)) {
+ if (!zend_is_true(&_2)) {
break;
}
- ZEPHIR_CALL_METHOD(&key, &data, "key", NULL, 0);
+ ZEPHIR_CALL_METHOD(&type, &messages, "key", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &data, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&message, &messages, "current", NULL, 0);
zephir_check_call_status();
- _6$$5 = Z_TYPE_P(&value) == IS_OBJECT;
- if (_6$$5) {
- _6$$5 = 1 == (zephir_method_exists_ex(&value, ZEND_STRL("toarray")) == SUCCESS);
- }
- if (_6$$5) {
- ZEPHIR_CALL_METHOD(&_7$$6, &value, "toarray", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&value, &_7$$6);
- }
- zephir_array_update_zval(&results, &key, &value, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "outputmessage", &_5, 0, &type, &message);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &messages, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- RETURN_CTOR(&results);
+ ZEPHIR_INIT_NVAR(&message);
+ ZEPHIR_INIT_NVAR(&type);
+ ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Config_Config, internalMerge)
+static PHP_METHOD(Phalcon_Flash_Session, getSessionMessages)
{
- zend_bool _4$$3, _5$$3, _10$$5, _11$$5;
- zend_string *_3;
- zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_9 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *source_param = NULL, *target_param = NULL, key, value, *_0, _1, _6$$3, _7$$4, _8$$4, _12$$5, _13$$6, _14$$6;
- zval source, target;
+ zval type;
+ zval *remove_param = NULL, *type_param = NULL, session, messages, returnMessages, _0, _1$$6, _2$$7;
+ zend_bool remove;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&source);
- ZVAL_UNDEF(&target);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_UNDEF(&_12$$5);
- ZVAL_UNDEF(&_13$$6);
- ZVAL_UNDEF(&_14$$6);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(source)
- Z_PARAM_ARRAY(target)
+ ZVAL_UNDEF(&session);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&returnMessages);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$6);
+ ZVAL_UNDEF(&_2$$7);
+ ZVAL_UNDEF(&type);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_BOOL(remove)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(type)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &source_param, &target_param);
- zephir_get_arrval(&source, source_param);
- zephir_get_arrval(&target, target_param);
- zephir_is_iterable(&target, 0, "phalcon/Config/Config.zep", 232);
- if (Z_TYPE_P(&target) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&target), _2, _3, _0)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&key, _3);
- } else {
- ZVAL_LONG(&key, _2);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- _4$$3 = Z_TYPE_P(&value) == IS_ARRAY;
- if (_4$$3) {
- _4$$3 = 1 == zephir_array_isset(&source, &key);
- }
- _5$$3 = _4$$3;
- if (_5$$3) {
- ZEPHIR_OBS_NVAR(&_6$$3);
- zephir_array_fetch(&_6$$3, &source, &key, PH_NOISY, "phalcon/Config/Config.zep", 222);
- _5$$3 = Z_TYPE_P(&_6$$3) == IS_ARRAY;
- }
- if (_5$$3) {
- zephir_array_fetch(&_8$$4, &source, &key, PH_NOISY | PH_READONLY, "phalcon/Config/Config.zep", 224);
- ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "internalmerge", &_9, 21, &_8$$4, &value);
- zephir_check_call_status();
- zephir_array_update_zval(&source, &key, &_7$$4, PH_COPY | PH_SEPARATE);
- continue;
- }
- zephir_array_update_zval(&source, &key, &value, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
+ zephir_fetch_params(1, 1, 1, &remove_param, &type_param);
+ if (!type_param) {
+ ZEPHIR_INIT_VAR(&type);
} else {
- ZEPHIR_CALL_METHOD(NULL, &target, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &target, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
+ zephir_get_strval(&type, type_param);
+ }
+ ZEPHIR_CALL_METHOD(&session, this_ptr, "getsessionservice", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "_flashMessages");
+ ZEPHIR_CALL_METHOD(&messages, &session, "get", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&messages) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&messages);
+ array_init(&messages);
+ }
+ if (1 != ZEPHIR_IS_EMPTY(&type)) {
+ zephir_memory_observe(&returnMessages);
+ if (zephir_array_isset_fetch(&returnMessages, &messages, &type, 0)) {
+ if (remove) {
+ zephir_array_unset(&messages, &type, PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_1$$6);
+ ZVAL_STRING(&_1$$6, "_flashMessages");
+ ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_1$$6, &messages);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(&key, &target, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &target, "current", NULL, 0);
- zephir_check_call_status();
- _10$$5 = Z_TYPE_P(&value) == IS_ARRAY;
- if (_10$$5) {
- _10$$5 = 1 == zephir_array_isset(&source, &key);
- }
- _11$$5 = _10$$5;
- if (_11$$5) {
- ZEPHIR_OBS_NVAR(&_12$$5);
- zephir_array_fetch(&_12$$5, &source, &key, PH_NOISY, "phalcon/Config/Config.zep", 222);
- _11$$5 = Z_TYPE_P(&_12$$5) == IS_ARRAY;
- }
- if (_11$$5) {
- zephir_array_fetch(&_14$$6, &source, &key, PH_NOISY | PH_READONLY, "phalcon/Config/Config.zep", 224);
- ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "internalmerge", &_9, 21, &_14$$6, &value);
- zephir_check_call_status();
- zephir_array_update_zval(&source, &key, &_13$$6, PH_COPY | PH_SEPARATE);
- continue;
- }
- zephir_array_update_zval(&source, &key, &value, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &target, "next", NULL, 0);
- zephir_check_call_status();
+ RETURN_CCTOR(&returnMessages);
}
+ array_init(return_value);
+ RETURN_MM();
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- RETURN_CTOR(&source);
+ if (remove) {
+ ZEPHIR_INIT_VAR(&_2$$7);
+ ZVAL_STRING(&_2$$7, "_flashMessages");
+ ZEPHIR_CALL_METHOD(NULL, &session, "remove", NULL, 0, &_2$$7);
+ zephir_check_call_status();
+ }
+ RETURN_CCTOR(&messages);
}
-static PHP_METHOD(Phalcon_Config_Config, setData)
+static PHP_METHOD(Phalcon_Flash_Session, setSessionMessages)
{
- zval _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *element = NULL, element_sub, *value, value_sub, data, key, _0, _2$$3, _3$$3;
+ zval *messages_param = NULL, session, _0;
+ zval messages;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&element_sub);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&session);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(element)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(messages)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &element, &value);
- ZEPHIR_SEPARATE_PARAM(element);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&data, &_0);
- zephir_cast_to_string(&_1, element);
- ZEPHIR_CPY_WRT(element, &_1);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("insensitive"), PH_NOISY_CC | PH_READONLY);
- if (zephir_is_true(&_0)) {
- ZEPHIR_CALL_FUNCTION(&key, "mb_strtolower", NULL, 10, element);
+ zephir_fetch_params(1, 1, 0, &messages_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&messages, messages_param);
+ ZEPHIR_CALL_METHOD(&session, this_ptr, "getsessionservice", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "_flashMessages");
+ ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_0, &messages);
+ zephir_check_call_status();
+ RETURN_CTOR(&messages);
+}
+
+static PHP_METHOD(Phalcon_Flash_Session, getSessionService)
+{
+ zend_bool _2;
+ zval _0, _1, _3, _4, _5, _6$$4, _7$$4, _8$$4;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("sessionService"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) != IS_NULL) {
+ RETURN_MM_MEMBER(getThis(), "sessionService");
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ _2 = Z_TYPE_P(&_1) != IS_NULL;
+ if (_2) {
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_5);
+ ZVAL_STRING(&_5, "session");
+ ZEPHIR_CALL_METHOD(&_4, &_3, "has", NULL, 0, &_5);
zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&key, element);
+ _2 = ZEPHIR_IS_TRUE_IDENTICAL(&_4);
}
- zephir_update_property_array(this_ptr, SL("lowerKeys"), &key, element);
- if (Z_TYPE_P(value) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_2$$3);
- object_init_ex(&_2$$3, phalcon_config_config_ce);
- zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("insensitive"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 23, value, &_3$$3);
+ if (_2) {
+ zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "session");
+ ZEPHIR_CALL_METHOD(&_7$$4, &_6$$4, "getshared", NULL, 0, &_8$$4);
zephir_check_call_status();
- zephir_array_update_zval(&data, element, &_2$$3, PH_COPY | PH_SEPARATE);
- } else {
- zephir_array_update_zval(&data, element, value, PH_COPY | PH_SEPARATE);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sessionService"), &_7$$4);
+ RETURN_MM_MEMBER(getThis(), "sessionService");
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_flash_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/Flash/Session.zep", 205);
+ return;
}
@@ -155850,1270 +151098,1082 @@ static PHP_METHOD(Phalcon_Config_Config, setData)
-ZEPHIR_INIT_CLASS(Phalcon_Config_ConfigFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config, ConfigFactory, phalcon, config_configfactory, phalcon_factory_abstractfactory_ce, phalcon_config_configfactory_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http, Cookie, phalcon, http_cookie, phalcon_di_abstractinjectionaware_ce, phalcon_http_cookie_method_entry, 0);
+
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("domain"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("expire"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("filter"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("httpOnly"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("name"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("options"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("path"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_cookie_ce, SL("read"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_cookie_ce, SL("restored"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_cookie_ce, SL("secure"), 1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("signKey"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_cookie_ce, SL("useEncryption"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_cookie_ce, SL("value"), ZEND_ACC_PROTECTED);
+ phalcon_http_cookie_ce->create_object = zephir_init_properties_Phalcon_Http_Cookie;
+ zend_class_implements(phalcon_http_cookie_ce, 1, phalcon_http_cookie_cookieinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Config_ConfigFactory, __construct)
+static PHP_METHOD(Phalcon_Http_Cookie, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *services_param = NULL;
- zval services;
+ zval options;
+ zend_bool secure, httpOnly;
+ zend_long expire, ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, *value = NULL, value_sub, *expire_param = NULL, *path_param = NULL, *secure_param = NULL, *domain_param = NULL, *httpOnly_param = NULL, *options_param = NULL, __$true, __$false, __$null, _0;
+ zval name, path, domain;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&services);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&options);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 8)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ Z_PARAM_ZVAL_OR_NULL(value)
+ Z_PARAM_LONG(expire)
+ Z_PARAM_STR(path)
+ Z_PARAM_BOOL_OR_NULL(secure, is_null_true)
+ Z_PARAM_STR_OR_NULL(domain)
+ Z_PARAM_BOOL_OR_NULL(httpOnly, is_null_true)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ zephir_fetch_params(1, 1, 7, &name_param, &value, &expire_param, &path_param, &secure_param, &domain_param, &httpOnly_param, &options_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- zephir_get_arrval(&services, services_param);
+ ZEPHIR_INIT_VAR(&name);
+ }
+ if (!value) {
+ value = &value_sub;
+ value = &__$null;
+ }
+ if (!expire_param) {
+ expire = 0;
+ } else {
+ }
+ if (!path_param) {
+ ZEPHIR_INIT_VAR(&path);
+ ZVAL_STRING(&path, "/");
+ } else {
+ zephir_get_strval(&path, path_param);
+ }
+ if (!secure_param) {
+ secure = 0;
+ } else {
+ }
+ if (!domain_param) {
+ ZEPHIR_INIT_VAR(&domain);
+ } else {
+ zephir_get_strval(&domain, domain_param);
+ }
+ if (!httpOnly_param) {
+ httpOnly = 0;
+ } else {
+ }
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ zephir_get_arrval(&options, options_param);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ ZVAL_UNDEF(&_0);
+ ZVAL_LONG(&_0, expire);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("expire"), &_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &path);
+ if (secure) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("secure"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("secure"), &__$false);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("domain"), &domain);
+ if (httpOnly) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("httpOnly"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("httpOnly"), &__$false);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ if (Z_TYPE_P(value) != IS_NULL) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvalue", NULL, 0, value);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
- zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Config_ConfigFactory, load)
+static PHP_METHOD(Phalcon_Http_Cookie, __toString)
{
+ zval _1;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config, config_sub, adapter, configArray, filePath, param, _0, _1, _2, _3$$3, _4$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config_sub);
- ZVAL_UNDEF(&adapter);
- ZVAL_UNDEF(&configArray);
- ZVAL_UNDEF(&filePath);
- ZVAL_UNDEF(¶m);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(config)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &config);
- ZEPHIR_CALL_METHOD(&configArray, this_ptr, "parseconfig", NULL, 0, config);
- zephir_check_call_status();
- zephir_array_fetch_string(&_0, &configArray, SL("adapter"), PH_NOISY | PH_READONLY, "phalcon/Config/ConfigFactory.zep", 60);
- ZEPHIR_INIT_VAR(&adapter);
- zephir_fast_strtolower(&adapter, &_0);
- zephir_memory_observe(&filePath);
- zephir_array_fetch_string(&filePath, &configArray, SL("filePath"), PH_NOISY, "phalcon/Config/ConfigFactory.zep", 61);
- ZVAL_LONG(&_1, 4);
- ZEPHIR_CALL_FUNCTION(&_2, "pathinfo", NULL, 89, &filePath, &_1);
- zephir_check_call_status();
- if (1 == ZEPHIR_IS_EMPTY(&_2)) {
- ZEPHIR_CALL_FUNCTION(&_3$$3, "lcfirst", NULL, 77, &adapter);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4$$3);
- ZEPHIR_CONCAT_SV(&_4$$3, ".", &_3$$3);
- zephir_concat_self(&filePath, &_4$$3);
- }
- do {
- if (ZEPHIR_IS_STRING(&adapter, "ini")) {
- ZEPHIR_INIT_VAR(¶m);
- ZVAL_LONG(¶m, 1);
- if (zephir_array_isset_string(&configArray, SL("mode"))) {
- ZEPHIR_OBS_NVAR(¶m);
- zephir_array_fetch_string(¶m, &configArray, SL("mode"), PH_NOISY, "phalcon/Config/ConfigFactory.zep", 71);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &adapter, &filePath, ¶m);
- zephir_check_call_status();
- RETURN_MM();
- }
- if (ZEPHIR_IS_STRING(&adapter, "yaml")) {
- ZEPHIR_INIT_NVAR(¶m);
- ZVAL_NULL(¶m);
- if (zephir_array_isset_string(&configArray, SL("callbacks"))) {
- ZEPHIR_OBS_NVAR(¶m);
- zephir_array_fetch_string(¶m, &configArray, SL("callbacks"), PH_NOISY, "phalcon/Config/ConfigFactory.zep", 78);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &adapter, &filePath, ¶m);
- zephir_check_call_status();
- RETURN_MM();
- }
- } while(0);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &adapter, &filePath);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getvalue", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
+ zephir_cast_to_string(&_1, &_0);
+ RETURN_CTOR(&_1);
}
-static PHP_METHOD(Phalcon_Config_ConfigFactory, newInstance)
+static PHP_METHOD(Phalcon_Http_Cookie, delete)
{
- zval arguments;
+ zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$null, container, domain, httpOnly, name, options, path, secure, session, _0, _2, _3, _7, _8, _9, _10, _11, _12, _4$$3, _5$$3, _6$$4;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *fileName_param = NULL, *params = NULL, params_sub, __$null, definition;
- zval name, fileName;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&fileName);
- ZVAL_UNDEF(¶ms_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&arguments);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(name)
- Z_PARAM_STR(fileName)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(params)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&httpOnly);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&secure);
+ ZVAL_UNDEF(&session);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &name_param, &fileName_param, ¶ms);
- zephir_get_strval(&name, name_param);
- zephir_get_strval(&fileName, fileName_param);
- if (!params) {
- params = ¶ms_sub;
- params = &__$null;
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("domain"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&domain, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&path, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("secure"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&secure, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("httpOnly"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&httpOnly, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_0);
+ _1 = Z_TYPE_P(&container) == IS_OBJECT;
+ if (_1) {
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "session");
+ ZEPHIR_CALL_METHOD(&_2, &container, "has", NULL, 0, &_3);
+ zephir_check_call_status();
+ _1 = zephir_is_true(&_2);
}
- ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&arguments);
- zephir_create_array(&arguments, 1, 0);
- zephir_array_fast_append(&arguments, &fileName);
- do {
- if (ZEPHIR_IS_STRING(&name, "grouped") || ZEPHIR_IS_STRING(&name, "ini") || ZEPHIR_IS_STRING(&name, "yaml")) {
- if (Z_TYPE_P(params) != IS_NULL) {
- zephir_array_append(&arguments, params, PH_SEPARATE, "phalcon/Config/ConfigFactory.zep", 112);
- }
- break;
+ if (_1) {
+ ZEPHIR_INIT_VAR(&_5$$3);
+ ZVAL_STRING(&_5$$3, "session");
+ ZEPHIR_CALL_METHOD(&_4$$3, &container, "getshared", NULL, 0, &_5$$3);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&session, &_4$$3);
+ ZEPHIR_CALL_METHOD(&_4$$3, &session, "exists", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_4$$3)) {
+ ZEPHIR_INIT_VAR(&_6$$4);
+ ZEPHIR_CONCAT_SV(&_6$$4, "_PHCOOKIE_", &name);
+ ZEPHIR_CALL_METHOD(NULL, &session, "remove", NULL, 0, &_6$$4);
+ zephir_check_call_status();
}
- } while(0);
-
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &arguments);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("value"), &__$null);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&options, &_0);
+ ZEPHIR_INIT_NVAR(&_3);
+ zephir_time(&_3);
+ ZEPHIR_INIT_VAR(&_8);
+ ZVAL_STRING(&_8, "expires");
+ ZVAL_LONG(&_0, (zephir_get_numberval(&_3) - 691200));
+ ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 331, &options, &_8, &_0);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Config_ConfigFactory, getExceptionClass)
-{
-
- RETURN_STRING("Phalcon\\Config\\Exception");
-}
-
-static PHP_METHOD(Phalcon_Config_ConfigFactory, getServices)
-{
-
- zephir_create_array(return_value, 5, 0);
- add_assoc_stringl_ex(return_value, SL("grouped"), SL("Phalcon\\Config\\Adapter\\Grouped"));
- add_assoc_stringl_ex(return_value, SL("ini"), SL("Phalcon\\Config\\Adapter\\Ini"));
- add_assoc_stringl_ex(return_value, SL("json"), SL("Phalcon\\Config\\Adapter\\Json"));
- add_assoc_stringl_ex(return_value, SL("php"), SL("Phalcon\\Config\\Adapter\\Php"));
- add_assoc_stringl_ex(return_value, SL("yaml"), SL("Phalcon\\Config\\Adapter\\Yaml"));
- return;
+ zephir_array_update_string(&options, SL("expires"), &_7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_8);
+ ZVAL_STRING(&_8, "domain");
+ ZEPHIR_CALL_METHOD(&_9, this_ptr, "getarrval", NULL, 331, &options, &_8, &domain);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("domain"), &_9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_8);
+ ZVAL_STRING(&_8, "path");
+ ZEPHIR_CALL_METHOD(&_10, this_ptr, "getarrval", NULL, 331, &options, &_8, &path);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("path"), &_10, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_8);
+ ZVAL_STRING(&_8, "secure");
+ ZEPHIR_CALL_METHOD(&_11, this_ptr, "getarrval", NULL, 331, &options, &_8, &secure);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("secure"), &_11, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_8);
+ ZVAL_STRING(&_8, "httponly");
+ ZEPHIR_CALL_METHOD(&_12, this_ptr, "getarrval", NULL, 331, &options, &_8, &httpOnly);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("httponly"), &_12, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_8);
+ ZVAL_STRING(&_8, "");
+ ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 332, &name, &_8, &options);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Config_ConfigFactory, parseConfig)
+static PHP_METHOD(Phalcon_Http_Cookie, getDomain)
{
- zend_bool _2;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config = NULL, config_sub, extension, oldConfig, _0$$3, _1$$3, _3$$5;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config_sub);
- ZVAL_UNDEF(&extension);
- ZVAL_UNDEF(&oldConfig);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$5);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(config)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &config);
- ZEPHIR_SEPARATE_PARAM(config);
- if (Z_TYPE_P(config) == IS_STRING) {
- ZEPHIR_CPY_WRT(&oldConfig, config);
- ZVAL_LONG(&_0$$3, 4);
- ZEPHIR_CALL_FUNCTION(&extension, "pathinfo", NULL, 89, config, &_0$$3);
- zephir_check_call_status();
- if (1 == ZEPHIR_IS_EMPTY(&extension)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "You need to provide the extension in the file path", "phalcon/Config/ConfigFactory.zep", 161);
- return;
- }
- ZEPHIR_INIT_VAR(&_1$$3);
- zephir_create_array(&_1$$3, 2, 0);
- zephir_array_update_string(&_1$$3, SL("adapter"), &extension, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_1$$3, SL("filePath"), &oldConfig, PH_COPY | PH_SEPARATE);
- ZEPHIR_CPY_WRT(config, &_1$$3);
- }
- _2 = Z_TYPE_P(config) == IS_OBJECT;
- if (_2) {
- _2 = zephir_instance_of_ev(config, phalcon_config_configinterface_ce);
- }
- if (_2) {
- ZEPHIR_CALL_METHOD(&_3$$5, config, "toarray", NULL, 0);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CPY_WRT(config, &_3$$5);
}
- if (Z_TYPE_P(config) != IS_ARRAY) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Config must be array or Phalcon\\Config\\Config object", "phalcon/Config/ConfigFactory.zep", 177);
- return;
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkconfigarray", NULL, 199, config);
- zephir_check_call_status();
- RETVAL_ZVAL(config, 1, 0);
- RETURN_MM();
+ RETURN_MM_MEMBER(getThis(), "domain");
}
-static PHP_METHOD(Phalcon_Config_ConfigFactory, checkConfigArray)
+static PHP_METHOD(Phalcon_Http_Cookie, getExpiration)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *config_param = NULL;
- zval config;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&config);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(config)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &config_param);
- zephir_get_arrval(&config, config_param);
- if (1 != zephir_array_isset_string(&config, SL("filePath"))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "You must provide 'filePath' option in factory config parameter.", "phalcon/Config/ConfigFactory.zep", 195);
- return;
- }
- if (1 != zephir_array_isset_string(&config, SL("adapter"))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "You must provide 'adapter' option in factory config parameter.", "phalcon/Config/ConfigFactory.zep", 201);
- return;
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_MEMBER(getThis(), "expire");
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Config_ConfigInterface)
+static PHP_METHOD(Phalcon_Http_Cookie, getHttpOnly)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Config, ConfigInterface, phalcon, config_configinterface, phalcon_config_configinterface_method_entry);
-
- zend_class_implements(phalcon_config_configinterface_ce, 1, phalcon_support_collection_collectioninterface_ce);
- return SUCCESS;
-}
-
-ZEPHIR_DOC_METHOD(Phalcon_Config_ConfigInterface, getPathDelimiter);
-ZEPHIR_DOC_METHOD(Phalcon_Config_ConfigInterface, merge);
-ZEPHIR_DOC_METHOD(Phalcon_Config_ConfigInterface, path);
-ZEPHIR_DOC_METHOD(Phalcon_Config_ConfigInterface, setPathDelimiter);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
+ }
+ RETURN_MM_MEMBER(getThis(), "httpOnly");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Config_Exception)
+static PHP_METHOD(Phalcon_Http_Cookie, getName)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config, Exception, phalcon, config_exception, zend_ce_exception, NULL, 0);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "name");
}
+static PHP_METHOD(Phalcon_Http_Cookie, getOptions)
+{
+ RETURN_MEMBER(getThis(), "options");
+}
+static PHP_METHOD(Phalcon_Http_Cookie, getPath)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
+ }
+ RETURN_MM_MEMBER(getThis(), "path");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Grouped)
+static PHP_METHOD(Phalcon_Http_Cookie, getSecure)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Grouped, phalcon, config_adapter_grouped, phalcon_config_config_ce, phalcon_config_adapter_grouped_method_entry, 0);
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
+ }
+ RETURN_MM_MEMBER(getThis(), "secure");
}
-static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct)
+static PHP_METHOD(Phalcon_Http_Cookie, getValue)
{
- zend_bool _3$$3, _20$$11;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL, *_9 = NULL, *_15 = NULL, *_17 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval defaultAdapter, _14$$9, _28$$17;
- zval *arrayConfig_param = NULL, *defaultAdapter_param = NULL, configArray, configInstance, configName, _0, *_1, _2, _11$$3, _12$$3, _5$$5, _10$$5, _6$$6, _8$$6, _13$$9, _16$$8, _18$$10, _19$$10, _25$$11, _26$$11, _21$$13, _24$$13, _22$$14, _23$$14, _27$$17, _29$$16, _30$$18, _31$$18;
- zval arrayConfig;
+ zval *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, _COOKIE, __$null, container, value, crypt, decryptedValue, filter, signKey, name, _0, _1, _2$$4, _3$$6, _4$$6, _5$$6, _6$$12, _7$$14, _8$$13, _9$$13;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&arrayConfig);
- ZVAL_UNDEF(&configArray);
- ZVAL_UNDEF(&configInstance);
- ZVAL_UNDEF(&configName);
+ ZVAL_UNDEF(&filters_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&_COOKIE);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&crypt);
+ ZVAL_UNDEF(&decryptedValue);
+ ZVAL_UNDEF(&filter);
+ ZVAL_UNDEF(&signKey);
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_11$$3);
- ZVAL_UNDEF(&_12$$3);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_10$$5);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&_8$$6);
- ZVAL_UNDEF(&_13$$9);
- ZVAL_UNDEF(&_16$$8);
- ZVAL_UNDEF(&_18$$10);
- ZVAL_UNDEF(&_19$$10);
- ZVAL_UNDEF(&_25$$11);
- ZVAL_UNDEF(&_26$$11);
- ZVAL_UNDEF(&_21$$13);
- ZVAL_UNDEF(&_24$$13);
- ZVAL_UNDEF(&_22$$14);
- ZVAL_UNDEF(&_23$$14);
- ZVAL_UNDEF(&_27$$17);
- ZVAL_UNDEF(&_29$$16);
- ZVAL_UNDEF(&_30$$18);
- ZVAL_UNDEF(&_31$$18);
- ZVAL_UNDEF(&defaultAdapter);
- ZVAL_UNDEF(&_14$$9);
- ZVAL_UNDEF(&_28$$17);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(arrayConfig)
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$12);
+ ZVAL_UNDEF(&_7$$14);
+ ZVAL_UNDEF(&_8$$13);
+ ZVAL_UNDEF(&_9$$13);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_STR(defaultAdapter)
+ Z_PARAM_ZVAL_OR_NULL(filters)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &arrayConfig_param, &defaultAdapter_param);
- ZEPHIR_OBS_COPY_OR_DUP(&arrayConfig, arrayConfig_param);
- if (!defaultAdapter_param) {
- ZEPHIR_INIT_VAR(&defaultAdapter);
- ZVAL_STRING(&defaultAdapter, "php");
- } else {
- if (UNEXPECTED(Z_TYPE_P(defaultAdapter_param) != IS_STRING && Z_TYPE_P(defaultAdapter_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultAdapter' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_get_global(&_COOKIE, SL("_COOKIE"));
+ zephir_fetch_params(1, 0, 2, &filters, &defaultValue);
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
}
- if (EXPECTED(Z_TYPE_P(defaultAdapter_param) == IS_STRING)) {
- zephir_get_strval(&defaultAdapter, defaultAdapter_param);
- } else {
- ZEPHIR_INIT_VAR(&defaultAdapter);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
}
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_grouped_ce, getThis(), "__construct", NULL, 0, &_0);
- zephir_check_call_status();
- zephir_is_iterable(&arrayConfig, 0, "phalcon/Config/Adapter/Grouped.zep", 121);
- if (Z_TYPE_P(&arrayConfig) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arrayConfig), _1)
- {
- ZEPHIR_INIT_NVAR(&configName);
- ZVAL_COPY(&configName, _1);
- ZEPHIR_CPY_WRT(&configInstance, &configName);
- _3$$3 = Z_TYPE_P(&configName) == IS_OBJECT;
- if (_3$$3) {
- _3$$3 = zephir_instance_of_ev(&configName, phalcon_config_configinterface_ce);
+ ZEPHIR_INIT_VAR(&container);
+ ZVAL_NULL(&container);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_1);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("read"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_1)) {
+ zephir_memory_observe(&value);
+ if (!(zephir_array_isset_fetch(&value, &_COOKIE, &name, 0))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("useEncryption"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_2$$4)) {
+ zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_3$$6);
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection container is required to access the 'filter' and 'crypt' services", "phalcon/Http/Cookie.zep", 265);
+ return;
}
- if (_3$$3) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_4, 0, &configInstance);
- zephir_check_call_status();
- continue;
- } else if (Z_TYPE_P(&configName) == IS_STRING) {
- ZEPHIR_INIT_NVAR(&_5$$5);
- ZVAL_STRING(&_5$$5, "");
- if (ZEPHIR_IS_IDENTICAL(&_5$$5, &defaultAdapter)) {
- ZEPHIR_INIT_NVAR(&_6$$6);
- object_init_ex(&_6$$6, phalcon_config_configfactory_ce);
- ZEPHIR_CALL_METHOD(NULL, &_6$$6, "__construct", &_7, 192);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_8$$6, &_6$$6, "load", &_9, 193, &configName);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_4, 0, &_8$$6);
- zephir_check_call_status();
- continue;
- }
- ZEPHIR_INIT_NVAR(&_10$$5);
- zephir_create_array(&_10$$5, 2, 0);
- zephir_array_update_string(&_10$$5, SL("filePath"), &configName, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_10$$5, SL("adapter"), &defaultAdapter, PH_COPY | PH_SEPARATE);
- ZEPHIR_CPY_WRT(&configInstance, &_10$$5);
- } else if (!(zephir_array_isset_string(&configInstance, SL("adapter")))) {
- zephir_array_update_string(&configInstance, SL("adapter"), &defaultAdapter, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_5$$6);
+ ZVAL_STRING(&_5$$6, "crypt");
+ ZEPHIR_CALL_METHOD(&_4$$6, &container, "getshared", NULL, 0, &_5$$6);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&crypt, &_4$$6);
+ if (UNEXPECTED(Z_TYPE_P(&crypt) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency which implements CryptInterface is required to use encryption", "phalcon/Http/Cookie.zep", 273);
+ return;
}
- zephir_array_fetch_string(&_11$$3, &configInstance, SL("adapter"), PH_NOISY | PH_READONLY, "phalcon/Config/Adapter/Grouped.zep", 105);
- ZEPHIR_INIT_NVAR(&_12$$3);
- ZVAL_STRING(&_12$$3, "array");
- if (ZEPHIR_IS_IDENTICAL(&_12$$3, &_11$$3)) {
- if (!(zephir_array_isset_string(&configInstance, SL("config")))) {
- ZEPHIR_INIT_NVAR(&_13$$9);
- object_init_ex(&_13$$9, phalcon_config_exception_ce);
- ZEPHIR_INIT_NVAR(&_14$$9);
- ZEPHIR_CONCAT_SS(&_14$$9, "To use 'array' adapter you have to specify ", "the 'config' as an array.");
- ZEPHIR_CALL_METHOD(NULL, &_13$$9, "__construct", &_15, 33, &_14$$9);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_13$$9, "phalcon/Config/Adapter/Grouped.zep", 110);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_OBS_NVAR(&configArray);
- zephir_array_fetch_string(&configArray, &configInstance, SL("config"), PH_NOISY, "phalcon/Config/Adapter/Grouped.zep", 113);
- ZEPHIR_INIT_NVAR(&configInstance);
- object_init_ex(&configInstance, phalcon_config_config_ce);
- zephir_read_property(&_16$$8, this_ptr, ZEND_STRL("insensitive"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 23, &configArray, &_16$$8);
+ zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&signKey, &_3$$6);
+ if (Z_TYPE_P(&signKey) == IS_STRING) {
+ ZEPHIR_CALL_METHOD(&decryptedValue, &crypt, "decryptbase64", NULL, 0, &value, &signKey);
zephir_check_call_status();
} else {
- ZEPHIR_INIT_NVAR(&_18$$10);
- object_init_ex(&_18$$10, phalcon_config_configfactory_ce);
- ZEPHIR_CALL_METHOD(NULL, &_18$$10, "__construct", &_7, 192);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_19$$10, &_18$$10, "load", &_9, 193, &configInstance);
+ ZEPHIR_CALL_METHOD(&decryptedValue, &crypt, "decryptbase64", NULL, 0, &value);
zephir_check_call_status();
- ZEPHIR_CPY_WRT(&configInstance, &_19$$10);
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_4, 0, &configInstance);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &arrayConfig, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &arrayConfig, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
}
- ZEPHIR_CALL_METHOD(&configName, &arrayConfig, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&configInstance, &configName);
- _20$$11 = Z_TYPE_P(&configName) == IS_OBJECT;
- if (_20$$11) {
- _20$$11 = zephir_instance_of_ev(&configName, phalcon_config_configinterface_ce);
- }
- if (_20$$11) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_4, 0, &configInstance);
- zephir_check_call_status();
- continue;
- } else if (Z_TYPE_P(&configName) == IS_STRING) {
- ZEPHIR_INIT_NVAR(&_21$$13);
- ZVAL_STRING(&_21$$13, "");
- if (ZEPHIR_IS_IDENTICAL(&_21$$13, &defaultAdapter)) {
- ZEPHIR_INIT_NVAR(&_22$$14);
- object_init_ex(&_22$$14, phalcon_config_configfactory_ce);
- ZEPHIR_CALL_METHOD(NULL, &_22$$14, "__construct", &_7, 192);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_23$$14, &_22$$14, "load", &_9, 193, &configName);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_4, 0, &_23$$14);
- zephir_check_call_status();
- continue;
- }
- ZEPHIR_INIT_NVAR(&_24$$13);
- zephir_create_array(&_24$$13, 2, 0);
- zephir_array_update_string(&_24$$13, SL("filePath"), &configName, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&_24$$13, SL("adapter"), &defaultAdapter, PH_COPY | PH_SEPARATE);
- ZEPHIR_CPY_WRT(&configInstance, &_24$$13);
- } else if (!(zephir_array_isset_string(&configInstance, SL("adapter")))) {
- zephir_array_update_string(&configInstance, SL("adapter"), &defaultAdapter, PH_COPY | PH_SEPARATE);
- }
- zephir_array_fetch_string(&_25$$11, &configInstance, SL("adapter"), PH_NOISY | PH_READONLY, "phalcon/Config/Adapter/Grouped.zep", 105);
- ZEPHIR_INIT_NVAR(&_26$$11);
- ZVAL_STRING(&_26$$11, "array");
- if (ZEPHIR_IS_IDENTICAL(&_26$$11, &_25$$11)) {
- if (!(zephir_array_isset_string(&configInstance, SL("config")))) {
- ZEPHIR_INIT_NVAR(&_27$$17);
- object_init_ex(&_27$$17, phalcon_config_exception_ce);
- ZEPHIR_INIT_NVAR(&_28$$17);
- ZEPHIR_CONCAT_SS(&_28$$17, "To use 'array' adapter you have to specify ", "the 'config' as an array.");
- ZEPHIR_CALL_METHOD(NULL, &_27$$17, "__construct", &_15, 33, &_28$$17);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_27$$17, "phalcon/Config/Adapter/Grouped.zep", 110);
- ZEPHIR_MM_RESTORE();
+ } else {
+ ZEPHIR_CPY_WRT(&decryptedValue, &value);
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("value"), &decryptedValue);
+ if (Z_TYPE_P(filters) != IS_NULL) {
+ zephir_read_property(&_6$$12, this_ptr, ZEND_STRL("filter"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&filter, &_6$$12);
+ if (Z_TYPE_P(&filter) != IS_OBJECT) {
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ zephir_read_property(&_7$$14, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_7$$14);
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection container is required to access the 'filter' service", "phalcon/Http/Cookie.zep", 314);
return;
}
- ZEPHIR_OBS_NVAR(&configArray);
- zephir_array_fetch_string(&configArray, &configInstance, SL("config"), PH_NOISY, "phalcon/Config/Adapter/Grouped.zep", 113);
- ZEPHIR_INIT_NVAR(&configInstance);
- object_init_ex(&configInstance, phalcon_config_config_ce);
- zephir_read_property(&_29$$16, this_ptr, ZEND_STRL("insensitive"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 23, &configArray, &_29$$16);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_30$$18);
- object_init_ex(&_30$$18, phalcon_config_configfactory_ce);
- ZEPHIR_CALL_METHOD(NULL, &_30$$18, "__construct", &_7, 192);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_31$$18, &_30$$18, "load", &_9, 193, &configInstance);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&configInstance, &_31$$18);
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_4, 0, &configInstance);
+ ZEPHIR_INIT_VAR(&_9$$13);
+ ZVAL_STRING(&_9$$13, "filter");
+ ZEPHIR_CALL_METHOD(&_8$$13, &container, "getshared", NULL, 0, &_9$$13);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &arrayConfig, "next", NULL, 0);
+ ZEPHIR_CPY_WRT(&filter, &_8$$13);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filter"), &filter);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(&filter, "sanitize", NULL, 0, &decryptedValue, filters);
zephir_check_call_status();
+ RETURN_MM();
}
+ RETURN_CCTOR(&decryptedValue);
}
- ZEPHIR_INIT_NVAR(&configName);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_MEMBER(getThis(), "value");
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Ini)
+static PHP_METHOD(Phalcon_Http_Cookie, isUsingEncryption)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Ini, phalcon, config_adapter_ini, phalcon_config_config_ce, phalcon_config_adapter_ini_method_entry, 0);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "useEncryption");
}
-static PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct)
+static PHP_METHOD(Phalcon_Http_Cookie, restore)
{
- zend_string *_8, *_12$$5, *_25$$10;
- zend_ulong _7, _11$$5, _24$$10;
- zval config;
+ zend_bool _2$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_15 = NULL, *_21 = NULL;
- zend_long mode, ZEPHIR_LAST_CALL_STATUS;
- zval *filePath_param = NULL, *mode_param = NULL, directives, iniConfig, lastValue, path, section, sections, _0, _1, *_5, _6, _2$$3, _3$$3, _4$$3, *_9$$5, _10$$5, _13$$6, _16$$7, _18$$8, _19$$8, _20$$4, *_22$$10, _23$$10, _26$$11, _28$$12, _30$$13, _31$$13, _32$$9;
- zval filePath, _14$$6, _17$$7, _27$$11, _29$$12;
+ zval __$true, __$false, container, definition, domain, expire, httpOnly, options, path, secure, session, _0, _1$$3, _3$$3, _4$$3, _5$$4, _6$$4, _7$$5, _8$$5;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&filePath);
- ZVAL_UNDEF(&_14$$6);
- ZVAL_UNDEF(&_17$$7);
- ZVAL_UNDEF(&_27$$11);
- ZVAL_UNDEF(&_29$$12);
- ZVAL_UNDEF(&directives);
- ZVAL_UNDEF(&iniConfig);
- ZVAL_UNDEF(&lastValue);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&expire);
+ ZVAL_UNDEF(&httpOnly);
+ ZVAL_UNDEF(&options);
ZVAL_UNDEF(&path);
- ZVAL_UNDEF(§ion);
- ZVAL_UNDEF(§ions);
+ ZVAL_UNDEF(&secure);
+ ZVAL_UNDEF(&session);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_3$$3);
ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_10$$5);
- ZVAL_UNDEF(&_13$$6);
- ZVAL_UNDEF(&_16$$7);
- ZVAL_UNDEF(&_18$$8);
- ZVAL_UNDEF(&_19$$8);
- ZVAL_UNDEF(&_20$$4);
- ZVAL_UNDEF(&_23$$10);
- ZVAL_UNDEF(&_26$$11);
- ZVAL_UNDEF(&_28$$12);
- ZVAL_UNDEF(&_30$$13);
- ZVAL_UNDEF(&_31$$13);
- ZVAL_UNDEF(&_32$$9);
- ZVAL_UNDEF(&config);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(filePath)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(mode)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &filePath_param, &mode_param);
- zephir_get_strval(&filePath, filePath_param);
- if (!mode_param) {
- mode = 1;
- } else {
- }
- ZVAL_BOOL(&_0, 1);
- ZVAL_LONG(&_1, mode);
- ZEPHIR_CALL_METHOD(&iniConfig, this_ptr, "phpparseinifile", NULL, 0, &filePath, &_0, &_1);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&iniConfig))) {
- ZEPHIR_INIT_VAR(&_2$$3);
- object_init_ex(&_2$$3, phalcon_config_exception_ce);
- ZEPHIR_INIT_VAR(&_3$$3);
- zephir_basename(&_3$$3, &filePath);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZEPHIR_CONCAT_SVS(&_4$$3, "Configuration file ", &_3$$3, " cannot be loaded");
- ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 33, &_4$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_2$$3, "phalcon/Config/Adapter/Ini.zep", 79);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_INIT_VAR(&config);
- array_init(&config);
- zephir_is_iterable(&iniConfig, 0, "phalcon/Config/Adapter/Ini.zep", 108);
- if (Z_TYPE_P(&iniConfig) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&iniConfig), _7, _8, _5)
- {
- ZEPHIR_INIT_NVAR(§ion);
- if (_8 != NULL) {
- ZVAL_STR_COPY(§ion, _8);
- } else {
- ZVAL_LONG(§ion, _7);
- }
- ZEPHIR_INIT_NVAR(&directives);
- ZVAL_COPY(&directives, _5);
- if (Z_TYPE_P(&directives) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(§ions);
- array_init(§ions);
- zephir_is_iterable(&directives, 0, "phalcon/Config/Adapter/Ini.zep", 95);
- if (Z_TYPE_P(&directives) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&directives), _11$$5, _12$$5, _9$$5)
- {
- ZEPHIR_INIT_NVAR(&path);
- if (_12$$5 != NULL) {
- ZVAL_STR_COPY(&path, _12$$5);
- } else {
- ZVAL_LONG(&path, _11$$5);
- }
- ZEPHIR_INIT_NVAR(&lastValue);
- ZVAL_COPY(&lastValue, _9$$5);
- zephir_cast_to_string(&_14$$6, &path);
- ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "parseinistring", &_15, 0, &_14$$6, &lastValue);
- zephir_check_call_status();
- zephir_array_append(§ions, &_13$$6, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 92);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &directives, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_10$$5, &directives, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_10$$5)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&path, &directives, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&lastValue, &directives, "current", NULL, 0);
- zephir_check_call_status();
- zephir_cast_to_string(&_17$$7, &path);
- ZEPHIR_CALL_METHOD(&_16$$7, this_ptr, "parseinistring", &_15, 0, &_17$$7, &lastValue);
- zephir_check_call_status();
- zephir_array_append(§ions, &_16$$7, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 92);
- ZEPHIR_CALL_METHOD(NULL, &directives, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&lastValue);
- ZEPHIR_INIT_NVAR(&path);
- if (zephir_fast_count_int(§ions)) {
- ZEPHIR_INIT_NVAR(&_18$$8);
- ZEPHIR_INIT_NVAR(&_19$$8);
- ZVAL_STRING(&_19$$8, "array_replace_recursive");
- ZEPHIR_CALL_USER_FUNC_ARRAY(&_18$$8, &_19$$8, §ions);
- zephir_check_call_status();
- zephir_array_update_zval(&config, §ion, &_18$$8, PH_COPY | PH_SEPARATE);
- }
- continue;
- }
- ZEPHIR_CALL_METHOD(&_20$$4, this_ptr, "cast", &_21, 0, &directives);
- zephir_check_call_status();
- zephir_array_update_zval(&config, §ion, &_20$$4, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &iniConfig, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_6, &iniConfig, "valid", NULL, 0);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_1$$3);
+ _2$$3 = Z_TYPE_P(&container) == IS_OBJECT;
+ if (_2$$3) {
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZVAL_STRING(&_4$$3, "session");
+ ZEPHIR_CALL_METHOD(&_3$$3, &container, "has", NULL, 0, &_4$$3);
zephir_check_call_status();
- if (!zend_is_true(&_6)) {
- break;
- }
- ZEPHIR_CALL_METHOD(§ion, &iniConfig, "key", NULL, 0);
+ _2$$3 = zephir_is_true(&_3$$3);
+ }
+ if (_2$$3) {
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZVAL_STRING(&_5$$4, "session");
+ ZEPHIR_CALL_METHOD(&session, &container, "getshared", NULL, 0, &_5$$4);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&directives, &iniConfig, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_6$$4, &session, "exists", NULL, 0);
zephir_check_call_status();
- if (Z_TYPE_P(&directives) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(§ions);
- array_init(§ions);
- zephir_is_iterable(&directives, 0, "phalcon/Config/Adapter/Ini.zep", 95);
- if (Z_TYPE_P(&directives) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&directives), _24$$10, _25$$10, _22$$10)
- {
- ZEPHIR_INIT_NVAR(&path);
- if (_25$$10 != NULL) {
- ZVAL_STR_COPY(&path, _25$$10);
- } else {
- ZVAL_LONG(&path, _24$$10);
- }
- ZEPHIR_INIT_NVAR(&lastValue);
- ZVAL_COPY(&lastValue, _22$$10);
- zephir_cast_to_string(&_27$$11, &path);
- ZEPHIR_CALL_METHOD(&_26$$11, this_ptr, "parseinistring", &_15, 0, &_27$$11, &lastValue);
- zephir_check_call_status();
- zephir_array_append(§ions, &_26$$11, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 92);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &directives, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_23$$10, &directives, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_23$$10)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&path, &directives, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&lastValue, &directives, "current", NULL, 0);
- zephir_check_call_status();
- zephir_cast_to_string(&_29$$12, &path);
- ZEPHIR_CALL_METHOD(&_28$$12, this_ptr, "parseinistring", &_15, 0, &_29$$12, &lastValue);
- zephir_check_call_status();
- zephir_array_append(§ions, &_28$$12, PH_SEPARATE, "phalcon/Config/Adapter/Ini.zep", 92);
- ZEPHIR_CALL_METHOD(NULL, &directives, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&lastValue);
- ZEPHIR_INIT_NVAR(&path);
- if (zephir_fast_count_int(§ions)) {
- ZEPHIR_INIT_NVAR(&_30$$13);
- ZEPHIR_INIT_NVAR(&_31$$13);
- ZVAL_STRING(&_31$$13, "array_replace_recursive");
- ZEPHIR_CALL_USER_FUNC_ARRAY(&_30$$13, &_31$$13, §ions);
- zephir_check_call_status();
- zephir_array_update_zval(&config, §ion, &_30$$13, PH_COPY | PH_SEPARATE);
- }
- continue;
- }
- ZEPHIR_CALL_METHOD(&_32$$9, this_ptr, "cast", &_21, 0, &directives);
+ if (zephir_is_true(&_6$$4)) {
+ zephir_read_property(&_7$$5, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_8$$5);
+ ZEPHIR_CONCAT_SV(&_8$$5, "_PHCOOKIE_", &_7$$5);
+ ZEPHIR_CALL_METHOD(&definition, &session, "get", NULL, 0, &_8$$5);
zephir_check_call_status();
- zephir_array_update_zval(&config, §ion, &_32$$9, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &iniConfig, "next", NULL, 0);
- zephir_check_call_status();
+ if (zephir_array_isset_string_fetch(&expire, &definition, SL("expire"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("expire"), &expire);
+ }
+ if (zephir_array_isset_string_fetch(&domain, &definition, SL("domain"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("domain"), &domain);
+ }
+ if (zephir_array_isset_string_fetch(&path, &definition, SL("path"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &path);
+ }
+ if (zephir_array_isset_string_fetch(&secure, &definition, SL("secure"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("secure"), &secure);
+ }
+ if (zephir_array_isset_string_fetch(&httpOnly, &definition, SL("httpOnly"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("httpOnly"), &httpOnly);
+ }
+ if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 1)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ }
+ }
+ }
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("restored"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("restored"), &__$false);
}
}
- ZEPHIR_INIT_NVAR(&directives);
- ZEPHIR_INIT_NVAR(§ion);
- ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_ini_ce, getThis(), "__construct", NULL, 0, &config);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Ini, cast)
+static PHP_METHOD(Phalcon_Http_Cookie, send)
{
- zend_bool _3;
- zval _0;
- zval castMap;
+ zval _11$$14, _12$$15;
+ zend_bool _1, _7;
+ zval container, crypt, definition, encryptValue, expire, domain, httpOnly, name, options, path, secure, session, signKey, value, _0, _2, _3, _13, _14, _15, _16, _17, _4$$9, _5$$9, _6$$10, _8$$11, _9$$11, _10$$11;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *ini = NULL, ini_sub, __$true, __$false, lowerIni, _1, _2$$5, _4$$6, _5$$6, _6$$6, _7$$6;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&ini_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&lowerIni);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&castMap);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&crypt);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&encryptValue);
+ ZVAL_UNDEF(&expire);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&httpOnly);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&secure);
+ ZVAL_UNDEF(&session);
+ ZVAL_UNDEF(&signKey);
+ ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(ini)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_4$$9);
+ ZVAL_UNDEF(&_5$$9);
+ ZVAL_UNDEF(&_6$$10);
+ ZVAL_UNDEF(&_8$$11);
+ ZVAL_UNDEF(&_9$$11);
+ ZVAL_UNDEF(&_10$$11);
+ ZVAL_UNDEF(&_11$$14);
+ ZVAL_UNDEF(&_12$$15);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &ini);
- ZEPHIR_SEPARATE_PARAM(ini);
- if (Z_TYPE_P(ini) == IS_ARRAY) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "castarray", NULL, 0, ini);
- zephir_check_call_status();
- RETURN_MM();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&name, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("value"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&value, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("expire"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&expire, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("domain"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&domain, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&path, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("secure"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&secure, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("httpOnly"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&httpOnly, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&options, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_0);
+ ZEPHIR_INIT_VAR(&definition);
+ array_init(&definition);
+ if (!ZEPHIR_IS_LONG(&expire, 0)) {
+ zephir_array_update_string(&definition, SL("expire"), &expire, PH_COPY | PH_SEPARATE);
}
- zephir_cast_to_string(&_0, ini);
- ZEPHIR_CPY_WRT(ini, &_0);
- ZEPHIR_INIT_VAR(&lowerIni);
- zephir_fast_strtolower(&lowerIni, ini);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "null");
- if (ZEPHIR_IS_IDENTICAL(&_1, &lowerIni)) {
- RETURN_MM_NULL();
+ if (!(ZEPHIR_IS_EMPTY(&path))) {
+ zephir_array_update_string(&definition, SL("path"), &path, PH_COPY | PH_SEPARATE);
}
- ZEPHIR_INIT_VAR(&castMap);
- zephir_create_array(&castMap, 6, 0);
- zephir_array_update_string(&castMap, SL("on"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&castMap, SL("true"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&castMap, SL("yes"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&castMap, SL("off"), &__$false, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&castMap, SL("no"), &__$false, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&castMap, SL("false"), &__$false, PH_COPY | PH_SEPARATE);
- if (1 == zephir_array_isset(&castMap, &lowerIni)) {
- zephir_array_fetch(&_2$$5, &castMap, &lowerIni, PH_NOISY | PH_READONLY, "phalcon/Config/Adapter/Ini.zep", 147);
- RETURN_CTOR(&_2$$5);
+ if (!(ZEPHIR_IS_EMPTY(&domain))) {
+ zephir_array_update_string(&definition, SL("domain"), &domain, PH_COPY | PH_SEPARATE);
}
- _3 = Z_TYPE_P(ini) == IS_STRING;
- if (_3) {
- _3 = zephir_is_numeric(ini);
+ if (!(ZEPHIR_IS_EMPTY(&secure))) {
+ zephir_array_update_string(&definition, SL("secure"), &secure, PH_COPY | PH_SEPARATE);
}
- if (_3) {
- ZEPHIR_INIT_VAR(&_4$$6);
- ZEPHIR_INIT_VAR(&_5$$6);
- ZVAL_STRING(&_5$$6, "/[.]+/");
- ZEPHIR_INIT_VAR(&_6$$6);
- ZEPHIR_INIT_VAR(&_7$$6);
- ZVAL_STRING(&_7$$6, "/[.]+/");
- zephir_preg_match(&_6$$6, &_7$$6, ini, &_4$$6, 0, 0 , 0 );
- if (zephir_is_true(&_6$$6)) {
- RETURN_MM_DOUBLE(zephir_get_doubleval(ini));
+ if (!(ZEPHIR_IS_EMPTY(&httpOnly))) {
+ zephir_array_update_string(&definition, SL("httpOnly"), &httpOnly, PH_COPY | PH_SEPARATE);
+ }
+ if (!(ZEPHIR_IS_EMPTY(&options))) {
+ zephir_array_update_string(&definition, SL("options"), &options, PH_COPY | PH_SEPARATE);
+ }
+ _1 = ((zephir_fast_count_int(&definition)) ? 1 : 0);
+ if (_1) {
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "session");
+ ZEPHIR_CALL_METHOD(&_2, &container, "has", NULL, 0, &_3);
+ zephir_check_call_status();
+ _1 = zephir_is_true(&_2);
+ }
+ if (_1) {
+ ZEPHIR_INIT_VAR(&_5$$9);
+ ZVAL_STRING(&_5$$9, "session");
+ ZEPHIR_CALL_METHOD(&_4$$9, &container, "getshared", NULL, 0, &_5$$9);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&session, &_4$$9);
+ ZEPHIR_CALL_METHOD(&_4$$9, &session, "exists", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_4$$9)) {
+ ZEPHIR_INIT_VAR(&_6$$10);
+ ZEPHIR_CONCAT_SV(&_6$$10, "_PHCOOKIE_", &name);
+ ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_6$$10, &definition);
+ zephir_check_call_status();
}
- RETURN_MM_LONG(zephir_get_intval(ini));
}
- RETVAL_ZVAL(ini, 1, 0);
- RETURN_MM();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("useEncryption"), PH_NOISY_CC | PH_READONLY);
+ _7 = zephir_is_true(&_0);
+ if (_7) {
+ _7 = !(ZEPHIR_IS_EMPTY(&value));
+ }
+ if (_7) {
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection container is required to access the 'filter' service", "phalcon/Http/Cookie.zep", 462);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_9$$11);
+ ZVAL_STRING(&_9$$11, "crypt");
+ ZEPHIR_CALL_METHOD(&_8$$11, &container, "getshared", NULL, 0, &_9$$11);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&crypt, &_8$$11);
+ if (UNEXPECTED(Z_TYPE_P(&crypt) != IS_OBJECT)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency which implements CryptInterface is required to use encryption", "phalcon/Http/Cookie.zep", 470);
+ return;
+ }
+ zephir_read_property(&_10$$11, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&signKey, &_10$$11);
+ if (Z_TYPE_P(&signKey) == IS_STRING) {
+ zephir_cast_to_string(&_11$$14, &value);
+ ZEPHIR_CALL_METHOD(&encryptValue, &crypt, "encryptbase64", NULL, 0, &_11$$14, &signKey);
+ zephir_check_call_status();
+ } else {
+ zephir_cast_to_string(&_12$$15, &value);
+ ZEPHIR_CALL_METHOD(&encryptValue, &crypt, "encryptbase64", NULL, 0, &_12$$15);
+ zephir_check_call_status();
+ }
+ } else {
+ ZEPHIR_CPY_WRT(&encryptValue, &value);
+ }
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "expires");
+ ZEPHIR_CALL_METHOD(&_13, this_ptr, "getarrval", NULL, 331, &options, &_3, &expire);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("expires"), &_13, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "domain");
+ ZEPHIR_CALL_METHOD(&_14, this_ptr, "getarrval", NULL, 331, &options, &_3, &domain);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("domain"), &_14, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "path");
+ ZEPHIR_CALL_METHOD(&_15, this_ptr, "getarrval", NULL, 331, &options, &_3, &path);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("path"), &_15, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "secure");
+ ZEPHIR_CALL_METHOD(&_16, this_ptr, "getarrval", NULL, 331, &options, &_3, &secure);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("secure"), &_16, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_3);
+ ZVAL_STRING(&_3, "httponly");
+ ZEPHIR_CALL_METHOD(&_17, this_ptr, "getarrval", NULL, 331, &options, &_3, &httpOnly);
+ zephir_check_call_status();
+ zephir_array_update_string(&options, SL("httponly"), &_17, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 332, &name, &encryptValue, &options);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Ini, castArray)
+static PHP_METHOD(Phalcon_Http_Cookie, setDomain)
{
- zend_string *_3;
- zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *ini_param = NULL, key, value, *_0, _1, _4$$3, _6$$4;
- zval ini;
+ zval *domain_param = NULL, _0;
+ zval domain;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&ini);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(ini)
+ Z_PARAM_STR(domain)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &ini_param);
- zephir_get_arrval(&ini, ini_param);
- zephir_is_iterable(&ini, 1, "phalcon/Config/Adapter/Ini.zep", 175);
- if (Z_TYPE_P(&ini) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&ini), _2, _3, _0)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&key, _3);
- } else {
- ZVAL_LONG(&key, _2);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "cast", &_5, 0, &value);
- zephir_check_call_status();
- zephir_array_update_zval(&ini, &key, &_4$$3, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
+ zephir_fetch_params(1, 1, 0, &domain_param);
+ if (UNEXPECTED(Z_TYPE_P(domain_param) != IS_STRING && Z_TYPE_P(domain_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) {
+ zephir_get_strval(&domain, domain_param);
} else {
- ZEPHIR_CALL_METHOD(NULL, &ini, "rewind", NULL, 0);
+ ZEPHIR_INIT_VAR(&domain);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &ini, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &ini, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &ini, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "cast", &_5, 0, &value);
- zephir_check_call_status();
- zephir_array_update_zval(&ini, &key, &_6$$4, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &ini, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- RETURN_CTOR(&ini);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("domain"), &domain);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Ini, parseIniString)
+static PHP_METHOD(Phalcon_Http_Cookie, setExpiration)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *path_param = NULL, *value, value_sub, castValue, key, position, result, _0, _1, _2, _3;
- zval path;
+ zval *expire_param = NULL, _0, _1;
+ zend_long expire, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&castValue);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&position);
- ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(path)
- Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(expire)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &path_param, &value);
- zephir_get_strval(&path, path_param);
- ZEPHIR_CALL_METHOD(&castValue, this_ptr, "cast", NULL, 0, value);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, ".");
- ZEPHIR_INIT_VAR(&position);
- zephir_fast_strpos(&position, &path, &_0, 0 );
- if (ZEPHIR_IS_FALSE_IDENTICAL(&position)) {
- zephir_create_array(return_value, 1, 0);
- zephir_array_update_zval(return_value, &path, &castValue, PH_COPY);
- RETURN_MM();
+ zephir_fetch_params(1, 1, 0, &expire_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
}
- ZVAL_LONG(&_1, 0);
- ZEPHIR_INIT_VAR(&key);
- zephir_substr(&key, &path, 0 , zephir_get_intval(&position), 0);
- ZVAL_LONG(&_2, (zephir_get_numberval(&position) + 1));
- ZEPHIR_INIT_VAR(&_3);
- zephir_substr(&_3, &path, zephir_get_intval(&_2), 0, ZEPHIR_SUBSTR_NO_LENGTH);
- zephir_get_strval(&path, &_3);
- ZEPHIR_CALL_METHOD(&result, this_ptr, "parseinistring", NULL, 194, &path, &castValue);
- zephir_check_call_status();
- zephir_create_array(return_value, 1, 0);
- zephir_array_update_zval(return_value, &key, &result, PH_COPY);
- RETURN_MM();
+ ZVAL_UNDEF(&_1);
+ ZVAL_LONG(&_1, expire);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("expire"), &_1);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Ini, phpParseIniFile)
+static PHP_METHOD(Phalcon_Http_Cookie, setHttpOnly)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long scannerMode, ZEPHIR_LAST_CALL_STATUS;
- zend_bool processSections;
- zval *filename_param = NULL, *processSections_param = NULL, *scannerMode_param = NULL, _0, _1;
- zval filename;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *httpOnly_param = NULL, __$true, __$false, _0;
+ zend_bool httpOnly;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filename);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(filename)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(processSections)
- Z_PARAM_LONG(scannerMode)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(httpOnly)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &filename_param, &processSections_param, &scannerMode_param);
- zephir_get_strval(&filename, filename_param);
- if (!processSections_param) {
- processSections = 0;
- } else {
- }
- if (!scannerMode_param) {
- scannerMode = 1;
+ zephir_fetch_params(1, 1, 0, &httpOnly_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
+ }
+ if (httpOnly) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("httpOnly"), &__$true);
} else {
- }
- ZVAL_BOOL(&_0, (processSections ? 1 : 0));
- ZVAL_LONG(&_1, scannerMode);
- ZEPHIR_RETURN_CALL_FUNCTION("parse_ini_file", NULL, 195, &filename, &_0, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("httpOnly"), &__$false);
+ }
+ RETURN_THIS();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Json)
+static PHP_METHOD(Phalcon_Http_Cookie, setOptions)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Json, phalcon, config_adapter_json, phalcon_config_config_ce, phalcon_config_adapter_json_method_entry, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *options_param = NULL;
+ zval options;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&options);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ARRAY(options)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &options_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Json, __construct)
+static PHP_METHOD(Phalcon_Http_Cookie, setPath)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filePath_param = NULL, _0, _1, _2, _3;
- zval filePath;
+ zval *path_param = NULL, _0;
+ zval path;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filePath);
+ ZVAL_UNDEF(&path);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filePath)
+ Z_PARAM_STR(path)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filePath_param);
- if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &path_param);
+ if (UNEXPECTED(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 of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) {
- zephir_get_strval(&filePath, filePath_param);
+ if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) {
+ zephir_get_strval(&path, path_param);
} else {
- ZEPHIR_INIT_VAR(&filePath);
+ ZEPHIR_INIT_VAR(&path);
}
- ZEPHIR_INIT_VAR(&_0);
- object_init_ex(&_0, phalcon_support_helper_json_decode_ce);
- if (zephir_has_constructor(&_0)) {
- ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
zephir_check_call_status();
}
-
- ZEPHIR_INIT_VAR(&_2);
- zephir_file_get_contents(&_2, &filePath);
- ZVAL_BOOL(&_3, 1);
- ZEPHIR_CALL_METHOD(&_1, &_0, "__invoke", NULL, 196, &_2, &_3);
- zephir_check_call_status();
- ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_json_ce, getThis(), "__construct", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Php)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Php, phalcon, config_adapter_php, phalcon_config_config_ce, phalcon_config_adapter_php_method_entry, 0);
-
- return SUCCESS;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &path);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Php, __construct)
+static PHP_METHOD(Phalcon_Http_Cookie, setSecure)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filePath_param = NULL, _0;
- zval filePath;
+ zval *secure_param = NULL, __$true, __$false, _0;
+ zend_bool secure;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filePath);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filePath)
+ Z_PARAM_BOOL(secure)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filePath_param);
- if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 0, &secure_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("restored"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_is_true(&_0))) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0);
+ zephir_check_call_status();
}
- if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) {
- zephir_get_strval(&filePath, filePath_param);
+ if (secure) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("secure"), &__$true);
} else {
- ZEPHIR_INIT_VAR(&filePath);
- }
- ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(&_0);
- if (zephir_require_zval_ret(&_0, &filePath) == FAILURE) {
- RETURN_MM_NULL();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("secure"), &__$false);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_php_ce, getThis(), "__construct", NULL, 0, &_0);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_THIS();
}
+static PHP_METHOD(Phalcon_Http_Cookie, setSignKey)
+{
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *signKey_param = NULL;
+ zval signKey;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&signKey);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(signKey)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &signKey_param);
+ if (!signKey_param) {
+ ZEPHIR_INIT_VAR(&signKey);
+ } else {
+ zephir_get_strval(&signKey, signKey_param);
+ }
+ if (!ZEPHIR_IS_NULL(&signKey)) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertsignkeyislongenough", NULL, 0, &signKey);
+ zephir_check_call_status();
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("signKey"), &signKey);
+ RETURN_THIS();
+}
+static PHP_METHOD(Phalcon_Http_Cookie, setValue)
+{
+ zval *value, value_sub, __$true, __$false;
+ zval *this_ptr = getThis();
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &value);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("value"), value);
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("read"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("read"), &__$false);
+ }
+ RETURN_THISW();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Yaml)
+static PHP_METHOD(Phalcon_Http_Cookie, useEncryption)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Config\\Adapter, Yaml, phalcon, config_adapter_yaml, phalcon_config_config_ce, phalcon_config_adapter_yaml_method_entry, 0);
+ zval *useEncryption_param = NULL, __$true, __$false;
+ zend_bool useEncryption;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(useEncryption)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &useEncryption_param);
+ if (useEncryption) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$false);
+ }
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Yaml, __construct)
+static PHP_METHOD(Phalcon_Http_Cookie, assertSignKeyIsLongEnough)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS, ndocs;
- zval callbacks;
- zval *filePath_param = NULL, *callbacks_param = NULL, yamlConfig, _0, _1, _2$$5, _3$$5, _4$$6, _5$$6, _6$$6;
- zval filePath;
- zval *this_ptr = getThis();
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *signKey_param = NULL, length, _0$$3, _1$$3, _2$$3;
+ zval signKey;
- ZVAL_UNDEF(&filePath);
- ZVAL_UNDEF(&yamlConfig);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&callbacks);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(filePath)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_OR_NULL(callbacks)
+ ZVAL_UNDEF(&signKey);
+ ZVAL_UNDEF(&length);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(signKey)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &filePath_param, &callbacks_param);
- if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &signKey_param);
+ if (UNEXPECTED(Z_TYPE_P(signKey_param) != IS_STRING && Z_TYPE_P(signKey_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'signKey' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) {
- zephir_get_strval(&filePath, filePath_param);
- } else {
- ZEPHIR_INIT_VAR(&filePath);
- }
- if (!callbacks_param) {
- ZEPHIR_INIT_VAR(&callbacks);
+ if (EXPECTED(Z_TYPE_P(signKey_param) == IS_STRING)) {
+ zephir_get_strval(&signKey, signKey_param);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&callbacks, callbacks_param);
+ ZEPHIR_INIT_VAR(&signKey);
}
- ndocs = 0;
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "yaml");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpextensionloaded", NULL, 0, &_1);
+ ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 234, &signKey);
zephir_check_call_status();
- if (UNEXPECTED(!zephir_is_true(&_0))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Yaml extension is not loaded", "phalcon/Config/Adapter/Yaml.zep", 64);
- return;
- }
- if (ZEPHIR_IS_EMPTY(&callbacks)) {
- ZEPHIR_CALL_METHOD(&yamlConfig, this_ptr, "phpyamlparsefile", NULL, 0, &filePath);
- zephir_check_call_status();
- } else {
- ZVAL_LONG(&_2$$5, 0);
- ZVAL_LONG(&_3$$5, ndocs);
- ZEPHIR_CALL_METHOD(&yamlConfig, this_ptr, "phpyamlparsefile", NULL, 0, &filePath, &_2$$5, &_3$$5, &callbacks);
+ if (UNEXPECTED(ZEPHIR_LT_LONG(&length, 32))) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ object_init_ex(&_0$$3, phalcon_http_cookie_exception_ce);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "The cookie's key should be at least 32 characters long. Current length is %d.");
+ ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 117, &_1$$3, &length);
zephir_check_call_status();
- }
- if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&yamlConfig))) {
- ZEPHIR_INIT_VAR(&_4$$6);
- object_init_ex(&_4$$6, phalcon_config_exception_ce);
- ZEPHIR_INIT_VAR(&_5$$6);
- zephir_basename(&_5$$6, &filePath);
- ZEPHIR_INIT_VAR(&_6$$6);
- ZEPHIR_CONCAT_SVS(&_6$$6, "Configuration file ", &_5$$6, " can't be loaded");
- ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", NULL, 33, &_6$$6);
+ ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 33, &_2$$3);
zephir_check_call_status();
- zephir_throw_exception_debug(&_4$$6, "phalcon/Config/Adapter/Yaml.zep", 76);
+ zephir_throw_exception_debug(&_0$$3, "phalcon/Http/Cookie.zep", 649);
ZEPHIR_MM_RESTORE();
return;
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_yaml_ce, getThis(), "__construct", NULL, 0, &yamlConfig);
- zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Config_Adapter_Yaml, phpYamlParseFile)
+static PHP_METHOD(Phalcon_Http_Cookie, getArrVal)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filename, filename_sub, *pos = NULL, pos_sub, *ndocs = NULL, ndocs_sub, *callbacks = NULL, callbacks_sub, __$null;
+ zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value;
+ zval collection;
- ZVAL_UNDEF(&filename_sub);
- ZVAL_UNDEF(&pos_sub);
- ZVAL_UNDEF(&ndocs_sub);
- ZVAL_UNDEF(&callbacks_sub);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 4)
- Z_PARAM_ZVAL(filename)
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(index)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL(pos)
- Z_PARAM_ZVAL_OR_NULL(ndocs)
- Z_PARAM_ZVAL(callbacks)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 3, &filename, &pos, &ndocs, &callbacks);
- if (!pos) {
- pos = &pos_sub;
- ZEPHIR_INIT_VAR(pos);
- ZVAL_LONG(pos, 0);
- }
- if (!ndocs) {
- ndocs = &ndocs_sub;
- ndocs = &__$null;
+ zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- if (!callbacks) {
- callbacks = &callbacks_sub;
- ZEPHIR_INIT_VAR(callbacks);
- array_init(callbacks);
+ zephir_memory_observe(&value);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
}
- ZEPHIR_MAKE_REF(ndocs);
- ZEPHIR_RETURN_CALL_FUNCTION("yaml_parse_file", NULL, 197, filename, pos, ndocs, callbacks);
- ZEPHIR_UNREF(ndocs);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_CCTOR(&value);
}
-static PHP_METHOD(Phalcon_Config_Adapter_Yaml, phpExtensionLoaded)
+zend_object *zephir_init_properties_Phalcon_Http_Cookie(zend_class_entry *class_type)
{
+ zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL;
- zval name;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+
- ZVAL_UNDEF(&name);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
- ZEPHIR_RETURN_CALL_FUNCTION("extension_loaded", NULL, 198, &name);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ {
+ zval local_this_ptr, *this_ptr = &local_this_ptr;
+ ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
}
@@ -157126,1107 +152186,1212 @@ static PHP_METHOD(Phalcon_Config_Adapter_Yaml, phpExtensionLoaded)
-ZEPHIR_INIT_CLASS(Phalcon_Factory_AbstractConfigFactory)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Request)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Factory, AbstractConfigFactory, phalcon, factory_abstractconfigfactory, phalcon_factory_abstractconfigfactory_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http, Request, phalcon, http_request, phalcon_di_abstractinjectionaware_ce, phalcon_http_request_method_entry, 0);
+
+ zend_declare_property_null(phalcon_http_request_ce, SL("filterService"), ZEND_ACC_PRIVATE);
+ zend_declare_property_bool(phalcon_http_request_ce, SL("httpMethodParameterOverride"), 0, ZEND_ACC_PRIVATE);
+ zend_declare_property_null(phalcon_http_request_ce, SL("queryFilters"), ZEND_ACC_PRIVATE);
+ zend_declare_property_null(phalcon_http_request_ce, SL("patchCache"), ZEND_ACC_PRIVATE);
+ zend_declare_property_null(phalcon_http_request_ce, SL("putCache"), ZEND_ACC_PRIVATE);
+ zend_declare_property_string(phalcon_http_request_ce, SL("rawBody"), "", ZEND_ACC_PRIVATE);
+ zend_declare_property_bool(phalcon_http_request_ce, SL("strictHostCheck"), 0, ZEND_ACC_PRIVATE);
+ phalcon_http_request_ce->create_object = zephir_init_properties_Phalcon_Http_Request;
+ zend_class_implements(phalcon_http_request_ce, 1, phalcon_http_requestinterface_ce);
+ zend_class_implements(phalcon_http_request_ce, 1, phalcon_http_message_requestmethodinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Factory_AbstractConfigFactory, checkConfig)
+static PHP_METHOD(Phalcon_Http_Request, get)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config = NULL, config_sub, _1$$3, _2$$4, _3$$4;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, _REQUEST, __$null, _0, _1;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config_sub);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$4);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(config)
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&filters_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&_REQUEST);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 5)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(filters)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &config);
- ZEPHIR_SEPARATE_PARAM(config);
- _0 = Z_TYPE_P(config) == IS_OBJECT;
- if (_0) {
- _0 = zephir_instance_of_ev(config, phalcon_config_configinterface_ce);
+ zephir_get_global(&_REQUEST, SL("_REQUEST"));
+ zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (_0) {
- ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(config, &_1$$3);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
}
- if (UNEXPECTED(Z_TYPE_P(config) != IS_ARRAY)) {
- ZEPHIR_INIT_VAR(&_3$$4);
- ZVAL_STRING(&_3$$4, "Config must be array or Phalcon\\Config\\Config object");
- ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getexception", NULL, 0, &_3$$4);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_2$$4, "phalcon/Factory/AbstractConfigFactory.zep", 29);
- ZEPHIR_MM_RESTORE();
- return;
}
- RETVAL_ZVAL(config, 1, 0);
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
+ }
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
+ }
+ if (noRecursive) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_REQUEST, &name, filters, defaultValue, &_0, &_1);
+ zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Factory_AbstractConfigFactory, checkConfigElement)
+static PHP_METHOD(Phalcon_Http_Request, getAcceptableContent)
{
+ zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval element, _1$$3;
- zval *config_param = NULL, *element_param = NULL, _0$$3;
- zval config;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(config)
- Z_PARAM_STR(element)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &config_param, &element_param);
- zephir_get_arrval(&config, config_param);
- zephir_get_strval(&element, element_param);
- if (UNEXPECTED(!(zephir_array_isset(&config, &element)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- ZEPHIR_CONCAT_SVS(&_1$$3, "You must provide '", &element, "' option in factory config parameter.");
- ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getexception", NULL, 0, &_1$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_0$$3, "phalcon/Factory/AbstractConfigFactory.zep", 43);
- ZEPHIR_MM_RESTORE();
- return;
- }
- RETURN_CTOR(&config);
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "HTTP_ACCEPT");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "accept");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Factory_AbstractConfigFactory, getException)
+static PHP_METHOD(Phalcon_Http_Request, getBasicAuth)
{
- zend_class_entry *_1;
+ zend_bool _2;
+ zval _0, _1, _3, _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *message_param = NULL, exception, _0;
- zval message;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&message);
- ZVAL_UNDEF(&exception);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(message)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &message_param);
- zephir_get_strval(&message, message_param);
- ZEPHIR_CALL_METHOD(&exception, this_ptr, "getexceptionclass", NULL, 0);
+
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "PHP_AUTH_USER");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1);
zephir_check_call_status();
- zephir_fetch_safe_class(&_0, &exception);
- _1 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0), Z_STRLEN_P(&_0), ZEND_FETCH_CLASS_AUTO);
- if(!_1) {
+ _2 = !zephir_is_true(&_0);
+ if (!(_2)) {
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "PHP_AUTH_PW");
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 335, &_1);
+ zephir_check_call_status();
+ _2 = !zephir_is_true(&_3);
+ }
+ if (_2) {
RETURN_MM_NULL();
}
- object_init_ex(return_value, _1);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &message);
+ zephir_create_array(return_value, 2, 0);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "PHP_AUTH_USER");
+ ZEPHIR_CALL_METHOD(&_4, this_ptr, "getserver", NULL, 0, &_1);
zephir_check_call_status();
+ zephir_array_update_string(return_value, SL("username"), &_4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "PHP_AUTH_PW");
+ ZEPHIR_CALL_METHOD(&_4, this_ptr, "getserver", NULL, 0, &_1);
+ zephir_check_call_status();
+ zephir_array_update_string(return_value, SL("password"), &_4, PH_COPY | PH_SEPARATE);
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Factory_AbstractConfigFactory, getExceptionClass)
+static PHP_METHOD(Phalcon_Http_Request, getBestAccept)
{
+ zval _0, _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- RETURN_STRING("Exception");
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getacceptablecontent", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "accept");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
+static PHP_METHOD(Phalcon_Http_Request, getBestCharset)
+{
+ zval _0, _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getclientcharsets", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "charset");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
+}
-ZEPHIR_INIT_CLASS(Phalcon_Factory_AbstractFactory)
+static PHP_METHOD(Phalcon_Http_Request, getBestLanguage)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Factory, AbstractFactory, phalcon, factory_abstractfactory, phalcon_factory_abstractconfigfactory_ce, phalcon_factory_abstractfactory_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zval _0, _1;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_factory_abstractfactory_ce, SL("mapper"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_factory_abstractfactory_ce, SL("services"), ZEND_ACC_PROTECTED);
- phalcon_factory_abstractfactory_ce->create_object = zephir_init_properties_Phalcon_Factory_AbstractFactory;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- return SUCCESS;
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getlanguages", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "language");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Factory_AbstractFactory, getServices)
+static PHP_METHOD(Phalcon_Http_Request, getHttpMethodParameterOverride)
{
+
+ RETURN_MEMBER(getThis(), "httpMethodParameterOverride");
}
-static PHP_METHOD(Phalcon_Factory_AbstractFactory, getService)
+static PHP_METHOD(Phalcon_Http_Request, getPreferredIsoLocaleVariant)
{
+ zval language, _0, _1, _2, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, _0, _3, _4, _1$$3;
- zval name, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&language);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+
+ ZEPHIR_CALL_METHOD(&language, this_ptr, "getbestlanguage", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_explode_str(&_0, SL("-"), &language, LONG_MAX);
+ ZEPHIR_CPY_WRT(&language, &_0);
+ zephir_array_fetch_long(&_1, &language, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 196);
+ ZEPHIR_CPY_WRT(&language, &_1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "*");
+ if (ZEPHIR_IS_IDENTICAL(&_3, &language)) {
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "");
} else {
- ZEPHIR_INIT_VAR(&name);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("mapper"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset(&_0, &name)))) {
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Service ", &name, " is not registered");
- ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "getexception", NULL, 0, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Factory/AbstractFactory.zep", 40);
- ZEPHIR_MM_RESTORE();
- return;
+ ZEPHIR_CPY_WRT(&_2, &language);
}
- zephir_read_property(&_3, this_ptr, ZEND_STRL("mapper"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_4, &_3, &name, PH_NOISY | PH_READONLY, "phalcon/Factory/AbstractFactory.zep", 43);
- RETURN_CTOR(&_4);
+ ZEPHIR_CPY_WRT(&language, &_2);
+ RETURN_CCTOR(&language);
}
-static PHP_METHOD(Phalcon_Factory_AbstractFactory, init)
+static PHP_METHOD(Phalcon_Http_Request, getClientAddress)
{
- zend_string *_4;
- zend_ulong _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *services_param = NULL, adapters, name, service, _0, *_1, _2, _5$$3, _6$$4;
- zval services;
+ zval *trustForwardedHeader_param = NULL, address, server, _0$$7, _1$$7;
+ zend_bool trustForwardedHeader;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&services);
- ZVAL_UNDEF(&adapters);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&service);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&address);
+ ZVAL_UNDEF(&server);
+ ZVAL_UNDEF(&_0$$7);
+ ZVAL_UNDEF(&_1$$7);
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ Z_PARAM_BOOL(trustForwardedHeader)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ zephir_fetch_params(1, 0, 1, &trustForwardedHeader_param);
+ if (!trustForwardedHeader_param) {
+ trustForwardedHeader = 0;
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
- }
- ZEPHIR_CALL_METHOD(&adapters, this_ptr, "getservices", NULL, 0);
+ }
+ ZEPHIR_INIT_VAR(&address);
+ ZVAL_NULL(&address);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- zephir_fast_array_merge(&_0, &adapters, &services);
- ZEPHIR_CPY_WRT(&adapters, &_0);
- zephir_is_iterable(&adapters, 0, "phalcon/Factory/AbstractFactory.zep", 60);
- if (Z_TYPE_P(&adapters) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&adapters), _3, _4, _1)
- {
- ZEPHIR_INIT_NVAR(&name);
- if (_4 != NULL) {
- ZVAL_STR_COPY(&name, _4);
- } else {
- ZVAL_LONG(&name, _3);
- }
- ZEPHIR_INIT_NVAR(&service);
- ZVAL_COPY(&service, _1);
- zephir_update_property_array(this_ptr, SL("mapper"), &name, &service);
- zephir_unset_property_array(this_ptr, ZEND_STRL("services"), &name);
- zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- zephir_array_unset(&_5$$3, &name, PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &adapters, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&name, &adapters, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&service, &adapters, "current", NULL, 0);
- zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("mapper"), &name, &service);
- zephir_unset_property_array(this_ptr, ZEND_STRL("services"), &name);
- zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- zephir_array_unset(&_6$$4, &name, PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0);
- zephir_check_call_status();
+ if (trustForwardedHeader) {
+ ZEPHIR_OBS_NVAR(&address);
+ zephir_array_isset_string_fetch(&address, &server, SL("HTTP_X_FORWARDED_FOR"), 0);
+ if (Z_TYPE_P(&address) == IS_NULL) {
+ ZEPHIR_OBS_NVAR(&address);
+ zephir_array_isset_string_fetch(&address, &server, SL("HTTP_CLIENT_IP"), 0);
}
}
- ZEPHIR_INIT_NVAR(&service);
- ZEPHIR_INIT_NVAR(&name);
- ZEPHIR_MM_RESTORE();
+ if (Z_TYPE_P(&address) == IS_NULL) {
+ ZEPHIR_OBS_NVAR(&address);
+ zephir_array_isset_string_fetch(&address, &server, SL("REMOTE_ADDR"), 0);
+ }
+ if (Z_TYPE_P(&address) != IS_STRING) {
+ RETURN_MM_BOOL(0);
+ }
+ if (zephir_memnstr_str(&address, SL(","), "phalcon/Http/Request.zep", 232)) {
+ ZEPHIR_INIT_VAR(&_0$$7);
+ zephir_fast_explode_str(&_0$$7, SL(","), &address, LONG_MAX);
+ zephir_array_fetch_long(&_1$$7, &_0$$7, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 237);
+ RETURN_CTOR(&_1$$7);
+ }
+ RETURN_CCTOR(&address);
}
-zend_object *zephir_init_properties_Phalcon_Factory_AbstractFactory(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Http_Request, getClientCharsets)
{
- zval _0, _2, _1$$3, _3$$4;
+ zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("services"), &_1$$3);
- }
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("mapper"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_2) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_3$$4);
- array_init(&_3$$4);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("mapper"), &_3$$4);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
- }
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
-ZEPHIR_INIT_CLASS(Phalcon_Factory_Exception)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Factory, Exception, phalcon, factory_exception, zend_ce_exception, NULL, 0);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- return SUCCESS;
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "HTTP_ACCEPT_CHARSET");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "charset");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
+static PHP_METHOD(Phalcon_Http_Request, getContentType)
+{
+ zval contentType, server;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&contentType);
+ ZVAL_UNDEF(&server);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ if (!(zephir_array_isset_string_fetch(&contentType, &server, SL("CONTENT_TYPE"), 1))) {
+ RETURN_MM_NULL();
+ }
+ RETURN_CTOR(&contentType);
+}
-#ifdef HAVE_CONFIG_H
-#endif
-
-
+static PHP_METHOD(Phalcon_Http_Request, getDigestAuth)
+{
+ zval auth;
+ zval digest, matches, match, server, _0$$3, _1$$3, _2$$3, *_3$$5, _4$$5, _5$$6, _6$$6, _7$$7, _8$$7;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&digest);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&match);
+ ZVAL_UNDEF(&server);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_7$$7);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&auth);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ ZEPHIR_INIT_VAR(&auth);
+ array_init(&auth);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ zephir_memory_observe(&digest);
+ if (zephir_array_isset_string_fetch(&digest, &server, SL("PHP_AUTH_DIGEST"), 0)) {
+ ZEPHIR_INIT_VAR(&matches);
+ array_init(&matches);
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "#(\\w+)=(['\"]?)([^'\" ,]+)\\2#");
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "#(\\w+)=(['\"]?)([^'\" ,]+)\\2#");
+ zephir_preg_match(&_1$$3, &_2$$3, &digest, &matches, 1, 2 , 0 );
+ if (!(zephir_is_true(&_1$$3))) {
+ RETURN_CTOR(&auth);
+ }
+ if (Z_TYPE_P(&matches) == IS_ARRAY) {
+ zephir_is_iterable(&matches, 0, "phalcon/Http/Request.zep", 291);
+ if (Z_TYPE_P(&matches) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&matches), _3$$5)
+ {
+ ZEPHIR_INIT_NVAR(&match);
+ ZVAL_COPY(&match, _3$$5);
+ zephir_array_fetch_long(&_5$$6, &match, 3, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 289);
+ ZEPHIR_OBS_NVAR(&_6$$6);
+ zephir_array_fetch_long(&_6$$6, &match, 1, PH_NOISY, "phalcon/Http/Request.zep", 289);
+ zephir_array_update_zval(&auth, &_6$$6, &_5$$6, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &matches, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_4$$5, &matches, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_4$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&match, &matches, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_7$$7, &match, 3, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 289);
+ ZEPHIR_OBS_NVAR(&_8$$7);
+ zephir_array_fetch_long(&_8$$7, &match, 1, PH_NOISY, "phalcon/Http/Request.zep", 289);
+ zephir_array_update_zval(&auth, &_8$$7, &_7$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &matches, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&match);
+ }
+ }
+ RETURN_CTOR(&auth);
+}
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Exception)
+static PHP_METHOD(Phalcon_Http_Request, getFilteredQuery)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms, Exception, phalcon, forms_exception, zend_ce_exception, NULL, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, _0, _1, _2, _3;
+ zval name;
+ zval *this_ptr = getThis();
- return SUCCESS;
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 4)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 4, &name_param, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ zephir_get_strval(&name, name_param);
+ }
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "GET");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "getQuery");
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ if (noRecursive) {
+ ZVAL_BOOL(&_3, 1);
+ } else {
+ ZVAL_BOOL(&_3, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfiltereddata", NULL, 0, &_0, &_1, &name, defaultValue, &_2, &_3);
+ zephir_check_call_status();
+ RETURN_MM();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Form)
+static PHP_METHOD(Phalcon_Http_Request, getFilteredPatch)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms, Form, phalcon, forms_form, phalcon_di_injectable_ce, phalcon_forms_form_method_entry, 0);
-
- zend_declare_property_null(phalcon_forms_form_ce, SL("attributes"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("data"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("filteredData"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("elements"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("elementsIndexed"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("entity"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("messages"), ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_forms_form_ce, SL("position"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("options"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("tagFactory"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("validation"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_form_ce, SL("whitelist"), ZEND_ACC_PROTECTED);
- phalcon_forms_form_ce->create_object = zephir_init_properties_Phalcon_Forms_Form;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, _0, _1, _2, _3;
+ zval name;
+ zval *this_ptr = getThis();
- zend_class_implements(phalcon_forms_form_ce, 1, zend_ce_countable);
- zend_class_implements(phalcon_forms_form_ce, 1, zend_ce_iterator);
- zend_class_implements(phalcon_forms_form_ce, 1, phalcon_html_attributes_attributesinterface_ce);
- return SUCCESS;
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 4)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 4, &name_param, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ zephir_get_strval(&name, name_param);
+ }
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "PATCH");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "getPatch");
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ if (noRecursive) {
+ ZVAL_BOOL(&_3, 1);
+ } else {
+ ZVAL_BOOL(&_3, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfiltereddata", NULL, 0, &_0, &_1, &name, defaultValue, &_2, &_3);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, __construct)
+static PHP_METHOD(Phalcon_Http_Request, getFilteredPost)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval userOptions;
- zval *entity = NULL, entity_sub, *userOptions_param = NULL, __$null, _1;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, _0, _1, _2, _3;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&entity_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&defaultValue_sub);
ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&userOptions);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 2)
+ ZEND_PARSE_PARAMETERS_START(0, 4)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(entity)
- Z_PARAM_ARRAY(userOptions)
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 2, &entity, &userOptions_param);
- if (!entity) {
- entity = &entity_sub;
- entity = &__$null;
- }
- if (!userOptions_param) {
- ZEPHIR_INIT_VAR(&userOptions);
- array_init(&userOptions);
+ zephir_fetch_params(1, 0, 4, &name_param, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
} else {
- zephir_get_arrval(&userOptions, userOptions_param);
- }
- _0 = Z_TYPE_P(entity) != IS_NULL;
- if (_0) {
- _0 = Z_TYPE_P(entity) != IS_OBJECT;
+ zephir_get_strval(&name, name_param);
}
- if (UNEXPECTED(_0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_forms_exception_ce, "The base entity is not valid", "phalcon/Forms/Form.zep", 98);
- return;
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("entity"), entity);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &userOptions);
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "POST");
ZEPHIR_INIT_VAR(&_1);
- object_init_ex(&_1, phalcon_html_attributes_ce);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 23);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1);
- if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("initialize")) == SUCCESS)) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0, entity, &userOptions);
- zephir_check_call_status();
+ ZVAL_STRING(&_1, "getPost");
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
}
- ZEPHIR_MM_RESTORE();
+ if (noRecursive) {
+ ZVAL_BOOL(&_3, 1);
+ } else {
+ ZVAL_BOOL(&_3, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfiltereddata", NULL, 0, &_0, &_1, &name, defaultValue, &_2, &_3);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, add)
+static PHP_METHOD(Phalcon_Http_Request, getFilteredPut)
{
- zend_string *_9$$5;
- zend_ulong _8$$5;
- zval elements;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool type, _0, _3;
- zval position;
- zval *element, element_sub, *position_param = NULL, *type_param = NULL, name, key, value, _1, _4, _2$$3, _5$$5, *_6$$5, _7$$5;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, _0, _1, _2, _3;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&element_sub);
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_7$$5);
- ZVAL_UNDEF(&position);
- ZVAL_UNDEF(&elements);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_OBJECT_OF_CLASS(element, phalcon_forms_element_elementinterface_ce)
+ ZEND_PARSE_PARAMETERS_START(0, 4)
Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(position)
- Z_PARAM_BOOL_OR_NULL(type, is_null_true)
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &element, &position_param, &type_param);
- if (!position_param) {
- ZEPHIR_INIT_VAR(&position);
+ zephir_fetch_params(1, 0, 4, &name_param, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
} else {
- zephir_get_strval(&position, position_param);
+ zephir_get_strval(&name, name_param);
}
- if (!type_param) {
- type = 0;
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
} else {
}
- ZEPHIR_CALL_METHOD(&name, element, "getname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, element, "setform", NULL, 0, this_ptr);
- zephir_check_call_status();
- _0 = (zephir_method_exists_ex(element, ZEND_STRL("settagfactory")) == SUCCESS);
- if (_0) {
- zephir_read_property(&_1, this_ptr, ZEND_STRL("tagFactory"), PH_NOISY_CC | PH_READONLY);
- _0 = Z_TYPE_P(&_1) != IS_NULL;
- }
- if (_0) {
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("tagFactory"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, element, "settagfactory", NULL, 0, &_2$$3);
- zephir_check_call_status();
- }
- _3 = ZEPHIR_IS_NULL(&position);
- if (!(_3)) {
- zephir_read_property(&_4, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- _3 = ZEPHIR_IS_EMPTY(&_4);
- }
- if (_3) {
- zephir_update_property_array(this_ptr, SL("elements"), &name, element);
+ if (!noRecursive_param) {
+ noRecursive = 0;
} else {
- ZEPHIR_INIT_VAR(&elements);
- array_init(&elements);
- zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- zephir_is_iterable(&_5$$5, 0, "phalcon/Forms/Form.zep", 176);
- if (Z_TYPE_P(&_5$$5) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_5$$5), _8$$5, _9$$5, _6$$5)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_9$$5 != NULL) {
- ZVAL_STR_COPY(&key, _9$$5);
- } else {
- ZVAL_LONG(&key, _8$$5);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _6$$5);
- if (ZEPHIR_IS_EQUAL(&key, &position)) {
- if (type) {
- zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
- zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
- } else {
- zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
- }
- } else {
- zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_5$$5, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_7$$5, &_5$$5, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_7$$5)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &_5$$5, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &_5$$5, "current", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_EQUAL(&key, &position)) {
- if (type) {
- zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
- zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
- } else {
- zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE);
- }
- } else {
- zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE);
- }
- ZEPHIR_CALL_METHOD(NULL, &_5$$5, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- zephir_update_property_zval(this_ptr, ZEND_STRL("elements"), &elements);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "PUT");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "getPut");
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
}
- RETURN_THIS();
+ if (noRecursive) {
+ ZVAL_BOOL(&_3, 1);
+ } else {
+ ZVAL_BOOL(&_3, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfiltereddata", NULL, 0, &_0, &_1, &name, defaultValue, &_2, &_3);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, bind)
+static PHP_METHOD(Phalcon_Http_Request, getHeader)
{
- zend_bool _7$$5, _16$$15;
- zend_string *_5;
- zend_ulong _4;
- zval method;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_8 = NULL, *_14 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data_param = NULL, *entity = NULL, entity_sub, *whitelist_param = NULL, __$null, filter, key, value, element, filters, container, filteredValue, _0, *_2, _3, _1$$4, _6$$5, _9$$9, _10$$9, _11$$11, _12$$11, _13$$11, _15$$15, _17$$19, _18$$19, _19$$21, _20$$21, _21$$21;
- zval data, whitelist, assignData, filteredData;
+ zval *header_param = NULL, value, name, server, _0, _1, _2, _3;
+ zval header;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&whitelist);
- ZVAL_UNDEF(&assignData);
- ZVAL_UNDEF(&filteredData);
- ZVAL_UNDEF(&entity_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&filter);
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&header);
ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&filters);
- ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&filteredValue);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&server);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_9$$9);
- ZVAL_UNDEF(&_10$$9);
- ZVAL_UNDEF(&_11$$11);
- ZVAL_UNDEF(&_12$$11);
- ZVAL_UNDEF(&_13$$11);
- ZVAL_UNDEF(&_15$$15);
- ZVAL_UNDEF(&_17$$19);
- ZVAL_UNDEF(&_18$$19);
- ZVAL_UNDEF(&_19$$21);
- ZVAL_UNDEF(&_20$$21);
- ZVAL_UNDEF(&_21$$21);
- ZVAL_UNDEF(&method);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_ARRAY(data)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(entity)
- Z_PARAM_ARRAY(whitelist)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(header)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &data_param, &entity, &whitelist_param);
- ZEPHIR_OBS_COPY_OR_DUP(&data, data_param);
- if (!entity) {
- entity = &entity_sub;
- ZEPHIR_CPY_WRT(entity, &__$null);
- } else {
- ZEPHIR_SEPARATE_PARAM(entity);
+ zephir_fetch_params(1, 1, 0, &header_param);
+ if (UNEXPECTED(Z_TYPE_P(header_param) != IS_STRING && Z_TYPE_P(header_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'header' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (!whitelist_param) {
- ZEPHIR_INIT_VAR(&whitelist);
- array_init(&whitelist);
+ if (EXPECTED(Z_TYPE_P(header_param) == IS_STRING)) {
+ zephir_get_strval(&header, header_param);
} else {
- zephir_get_arrval(&whitelist, whitelist_param);
+ ZEPHIR_INIT_VAR(&header);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&_0))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_forms_exception_ce, "There are no elements in the form", "phalcon/Forms/Form.zep", 195);
- return;
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "-");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "_");
+ ZEPHIR_CALL_FUNCTION(&_2, "strtr", NULL, 5, &header, &_0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&name);
+ zephir_fast_strtoupper(&name, &_2);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ zephir_memory_observe(&value);
+ if (zephir_array_isset_fetch(&value, &server, &name, 0)) {
+ RETURN_CCTOR(&value);
}
- if (ZEPHIR_IS_EMPTY(&whitelist)) {
- zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("whitelist"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&whitelist, &_1$$4);
+ ZEPHIR_OBS_NVAR(&value);
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_SV(&_3, "HTTP_", &name);
+ if (zephir_array_isset_fetch(&value, &server, &_3, 0)) {
+ RETURN_CCTOR(&value);
}
- ZEPHIR_INIT_VAR(&filter);
- ZVAL_NULL(&filter);
- ZEPHIR_INIT_VAR(&assignData);
- array_init(&assignData);
- ZEPHIR_INIT_VAR(&filteredData);
- array_init(&filteredData);
- zephir_is_iterable(&data, 0, "phalcon/Forms/Form.zep", 269);
- if (Z_TYPE_P(&data) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _4, _5, _2)
+ RETURN_MM_STRING("");
+}
+
+static PHP_METHOD(Phalcon_Http_Request, getHeaders)
+{
+ zend_string *_3;
+ zend_ulong _2;
+ zval headers, contentHeaders;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_10 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval __$true, name, value, authHeaders, server, *_0, _1, _39, _4$$4, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4, _11$$4, _12$$4, _13$$4, _14$$3, _15$$5, _16$$5, _17$$5, _18$$5, _19$$5, _20$$5, _21$$5, _22$$7, _23$$7, _24$$7, _25$$7, _26$$7, _27$$7, _28$$7, _29$$7, _30$$7, _31$$6, _32$$8, _33$$8, _34$$8, _35$$8, _36$$8, _37$$8, _38$$8;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&authHeaders);
+ ZVAL_UNDEF(&server);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_39);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_11$$4);
+ ZVAL_UNDEF(&_12$$4);
+ ZVAL_UNDEF(&_13$$4);
+ ZVAL_UNDEF(&_14$$3);
+ ZVAL_UNDEF(&_15$$5);
+ ZVAL_UNDEF(&_16$$5);
+ ZVAL_UNDEF(&_17$$5);
+ ZVAL_UNDEF(&_18$$5);
+ ZVAL_UNDEF(&_19$$5);
+ ZVAL_UNDEF(&_20$$5);
+ ZVAL_UNDEF(&_21$$5);
+ ZVAL_UNDEF(&_22$$7);
+ ZVAL_UNDEF(&_23$$7);
+ ZVAL_UNDEF(&_24$$7);
+ ZVAL_UNDEF(&_25$$7);
+ ZVAL_UNDEF(&_26$$7);
+ ZVAL_UNDEF(&_27$$7);
+ ZVAL_UNDEF(&_28$$7);
+ ZVAL_UNDEF(&_29$$7);
+ ZVAL_UNDEF(&_30$$7);
+ ZVAL_UNDEF(&_31$$6);
+ ZVAL_UNDEF(&_32$$8);
+ ZVAL_UNDEF(&_33$$8);
+ ZVAL_UNDEF(&_34$$8);
+ ZVAL_UNDEF(&_35$$8);
+ ZVAL_UNDEF(&_36$$8);
+ ZVAL_UNDEF(&_37$$8);
+ ZVAL_UNDEF(&_38$$8);
+ ZVAL_UNDEF(&headers);
+ ZVAL_UNDEF(&contentHeaders);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ ZEPHIR_INIT_VAR(&headers);
+ array_init(&headers);
+ ZEPHIR_INIT_VAR(&contentHeaders);
+ zephir_create_array(&contentHeaders, 3, 0);
+ zephir_array_update_string(&contentHeaders, SL("CONTENT_TYPE"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&contentHeaders, SL("CONTENT_LENGTH"), &__$true, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&contentHeaders, SL("CONTENT_MD5"), &__$true, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ zephir_is_iterable(&server, 0, "phalcon/Http/Request.zep", 461);
+ if (Z_TYPE_P(&server) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&server), _2, _3, _0)
{
- ZEPHIR_INIT_NVAR(&key);
- if (_5 != NULL) {
- ZVAL_STR_COPY(&key, _5);
+ ZEPHIR_INIT_NVAR(&name);
+ if (_3 != NULL) {
+ ZVAL_STR_COPY(&name, _3);
} else {
- ZVAL_LONG(&key, _4);
+ ZVAL_LONG(&name, _2);
}
ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _2);
- ZEPHIR_OBS_NVAR(&element);
- zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&element, &_6$$5, &key, 0))) {
- continue;
- }
- _7$$5 = !(ZEPHIR_IS_EMPTY(&whitelist));
- if (_7$$5) {
- _7$$5 = !(zephir_fast_in_array(&key, &whitelist));
- }
- if (_7$$5) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&filters)) {
- if (Z_TYPE_P(&filter) != IS_OBJECT) {
- ZEPHIR_CALL_METHOD(&container, this_ptr, "getdi", &_8, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_10$$9);
- ZVAL_STRING(&_10$$9, "filter");
- ZEPHIR_CALL_METHOD(&_9$$9, &container, "getshared", NULL, 0, &_10$$9);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&filter, &_9$$9);
- }
- ZEPHIR_CALL_METHOD(&filteredValue, &filter, "sanitize", NULL, 0, &value, &filters);
+ ZVAL_COPY(&value, _0);
+ if (zephir_start_with_str(&name, SL("HTTP_"))) {
+ ZEPHIR_INIT_NVAR(&_4$$4);
+ ZEPHIR_INIT_NVAR(&_5$$4);
+ ZVAL_LONG(&_6$$4, 5);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ zephir_substr(&_7$$4, &name, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ ZEPHIR_INIT_NVAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "_");
+ ZEPHIR_INIT_NVAR(&_9$$4);
+ ZVAL_STRING(&_9$$4, " ");
+ zephir_fast_str_replace(&_5$$4, &_8$$4, &_9$$4, &_7$$4);
+ zephir_fast_strtolower(&_4$$4, &_5$$4);
+ ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 288, &_4$$4);
zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&filteredValue, &value);
+ ZEPHIR_INIT_NVAR(&_11$$4);
+ ZEPHIR_INIT_NVAR(&_12$$4);
+ ZVAL_STRING(&_12$$4, " ");
+ ZEPHIR_INIT_NVAR(&_13$$4);
+ ZVAL_STRING(&_13$$4, "-");
+ zephir_fast_str_replace(&_11$$4, &_12$$4, &_13$$4, &name);
+ ZEPHIR_CPY_WRT(&name, &_11$$4);
+ zephir_array_update_zval(&headers, &name, &value, PH_COPY | PH_SEPARATE);
+ continue;
}
- zephir_array_update_zval(&assignData, &key, &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_zval(&filteredData, &key, &filteredValue, PH_COPY | PH_SEPARATE);
- if (Z_TYPE_P(entity) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_11$$11);
- zephir_camelize(&_11$$11, &key, NULL );
- ZEPHIR_INIT_NVAR(&_12$$11);
- ZEPHIR_CONCAT_SV(&_12$$11, "set", &_11$$11);
- zephir_get_strval(&method, &_12$$11);
- if ((zephir_method_exists(entity, &method) == SUCCESS)) {
- ZEPHIR_CALL_METHOD_ZVAL(NULL, entity, &method, NULL, 0, &filteredValue);
- zephir_check_call_status();
- continue;
- }
- if (!(ZEPHIR_GLOBAL(form).strict_entity_property_check)) {
- zephir_update_property_zval_zval(entity, &key, &filteredValue);
- continue;
- }
- ZEPHIR_CALL_FUNCTION(&_13$$11, "property_exists", &_14, 290, entity, &key);
+ ZEPHIR_INIT_NVAR(&_14$$3);
+ zephir_fast_strtoupper(&_14$$3, &name);
+ ZEPHIR_CPY_WRT(&name, &_14$$3);
+ if (zephir_array_isset(&contentHeaders, &name)) {
+ ZEPHIR_INIT_NVAR(&_15$$5);
+ ZEPHIR_INIT_NVAR(&_16$$5);
+ ZEPHIR_INIT_NVAR(&_17$$5);
+ ZVAL_STRING(&_17$$5, "_");
+ ZEPHIR_INIT_NVAR(&_18$$5);
+ ZVAL_STRING(&_18$$5, " ");
+ zephir_fast_str_replace(&_16$$5, &_17$$5, &_18$$5, &name);
+ zephir_fast_strtolower(&_15$$5, &_16$$5);
+ ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 288, &_15$$5);
zephir_check_call_status();
- if (zephir_is_true(&_13$$11)) {
- zephir_update_property_zval_zval(entity, &key, &filteredValue);
- }
+ ZEPHIR_INIT_NVAR(&_19$$5);
+ ZEPHIR_INIT_NVAR(&_20$$5);
+ ZVAL_STRING(&_20$$5, " ");
+ ZEPHIR_INIT_NVAR(&_21$$5);
+ ZVAL_STRING(&_21$$5, "-");
+ zephir_fast_str_replace(&_19$$5, &_20$$5, &_21$$5, &name);
+ ZEPHIR_CPY_WRT(&name, &_19$$5);
+ zephir_array_update_zval(&headers, &name, &value, PH_COPY | PH_SEPARATE);
}
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &data, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &server, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_3, &data, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_1, &server, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_3)) {
+ if (!zend_is_true(&_1)) {
break;
}
- ZEPHIR_CALL_METHOD(&key, &data, "key", NULL, 0);
+ ZEPHIR_CALL_METHOD(&name, &server, "key", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &data, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&value, &server, "current", NULL, 0);
zephir_check_call_status();
- ZEPHIR_OBS_NVAR(&element);
- zephir_read_property(&_15$$15, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&element, &_15$$15, &key, 0))) {
- continue;
- }
- _16$$15 = !(ZEPHIR_IS_EMPTY(&whitelist));
- if (_16$$15) {
- _16$$15 = !(zephir_fast_in_array(&key, &whitelist));
- }
- if (_16$$15) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&filters)) {
- if (Z_TYPE_P(&filter) != IS_OBJECT) {
- ZEPHIR_CALL_METHOD(&container, this_ptr, "getdi", &_8, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_18$$19);
- ZVAL_STRING(&_18$$19, "filter");
- ZEPHIR_CALL_METHOD(&_17$$19, &container, "getshared", NULL, 0, &_18$$19);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(&filter, &_17$$19);
- }
- ZEPHIR_CALL_METHOD(&filteredValue, &filter, "sanitize", NULL, 0, &value, &filters);
+ if (zephir_start_with_str(&name, SL("HTTP_"))) {
+ ZEPHIR_INIT_NVAR(&_22$$7);
+ ZEPHIR_INIT_NVAR(&_23$$7);
+ ZVAL_LONG(&_24$$7, 5);
+ ZEPHIR_INIT_NVAR(&_25$$7);
+ zephir_substr(&_25$$7, &name, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ ZEPHIR_INIT_NVAR(&_26$$7);
+ ZVAL_STRING(&_26$$7, "_");
+ ZEPHIR_INIT_NVAR(&_27$$7);
+ ZVAL_STRING(&_27$$7, " ");
+ zephir_fast_str_replace(&_23$$7, &_26$$7, &_27$$7, &_25$$7);
+ zephir_fast_strtolower(&_22$$7, &_23$$7);
+ ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 288, &_22$$7);
zephir_check_call_status();
- } else {
- ZEPHIR_CPY_WRT(&filteredValue, &value);
+ ZEPHIR_INIT_NVAR(&_28$$7);
+ ZEPHIR_INIT_NVAR(&_29$$7);
+ ZVAL_STRING(&_29$$7, " ");
+ ZEPHIR_INIT_NVAR(&_30$$7);
+ ZVAL_STRING(&_30$$7, "-");
+ zephir_fast_str_replace(&_28$$7, &_29$$7, &_30$$7, &name);
+ ZEPHIR_CPY_WRT(&name, &_28$$7);
+ zephir_array_update_zval(&headers, &name, &value, PH_COPY | PH_SEPARATE);
+ continue;
}
- zephir_array_update_zval(&assignData, &key, &value, PH_COPY | PH_SEPARATE);
- zephir_array_update_zval(&filteredData, &key, &filteredValue, PH_COPY | PH_SEPARATE);
- if (Z_TYPE_P(entity) != IS_NULL) {
- ZEPHIR_INIT_NVAR(&_19$$21);
- zephir_camelize(&_19$$21, &key, NULL );
- ZEPHIR_INIT_NVAR(&_20$$21);
- ZEPHIR_CONCAT_SV(&_20$$21, "set", &_19$$21);
- zephir_get_strval(&method, &_20$$21);
- if ((zephir_method_exists(entity, &method) == SUCCESS)) {
- ZEPHIR_CALL_METHOD_ZVAL(NULL, entity, &method, NULL, 0, &filteredValue);
- zephir_check_call_status();
- continue;
- }
- if (!(ZEPHIR_GLOBAL(form).strict_entity_property_check)) {
- zephir_update_property_zval_zval(entity, &key, &filteredValue);
- continue;
- }
- ZEPHIR_CALL_FUNCTION(&_21$$21, "property_exists", &_14, 290, entity, &key);
+ ZEPHIR_INIT_NVAR(&_31$$6);
+ zephir_fast_strtoupper(&_31$$6, &name);
+ ZEPHIR_CPY_WRT(&name, &_31$$6);
+ if (zephir_array_isset(&contentHeaders, &name)) {
+ ZEPHIR_INIT_NVAR(&_32$$8);
+ ZEPHIR_INIT_NVAR(&_33$$8);
+ ZEPHIR_INIT_NVAR(&_34$$8);
+ ZVAL_STRING(&_34$$8, "_");
+ ZEPHIR_INIT_NVAR(&_35$$8);
+ ZVAL_STRING(&_35$$8, " ");
+ zephir_fast_str_replace(&_33$$8, &_34$$8, &_35$$8, &name);
+ zephir_fast_strtolower(&_32$$8, &_33$$8);
+ ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 288, &_32$$8);
zephir_check_call_status();
- if (zephir_is_true(&_21$$21)) {
- zephir_update_property_zval_zval(entity, &key, &filteredValue);
- }
+ ZEPHIR_INIT_NVAR(&_36$$8);
+ ZEPHIR_INIT_NVAR(&_37$$8);
+ ZVAL_STRING(&_37$$8, " ");
+ ZEPHIR_INIT_NVAR(&_38$$8);
+ ZVAL_STRING(&_38$$8, "-");
+ zephir_fast_str_replace(&_36$$8, &_37$$8, &_38$$8, &name);
+ ZEPHIR_CPY_WRT(&name, &_36$$8);
+ zephir_array_update_zval(&headers, &name, &value, PH_COPY | PH_SEPARATE);
}
- ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &server, "next", NULL, 0);
zephir_check_call_status();
}
}
ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &assignData);
- zephir_update_property_zval(this_ptr, ZEND_STRL("filteredData"), &filteredData);
- RETURN_THIS();
+ ZEPHIR_INIT_NVAR(&name);
+ ZEPHIR_CALL_METHOD(&authHeaders, this_ptr, "resolveauthorizationheaders", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_39);
+ zephir_fast_array_merge(&_39, &headers, &authHeaders);
+ ZEPHIR_CPY_WRT(&headers, &_39);
+ RETURN_CTOR(&headers);
}
-static PHP_METHOD(Phalcon_Forms_Form, clear)
+static PHP_METHOD(Phalcon_Http_Request, getHttpHost)
{
+ zval _14;
+ zend_bool _3;
+ zval host, strict, cleanHost, _0, _1$$3, _2$$4, _4$$5, _8$$5, _9$$5, _10$$5, _11$$5, _5$$6, _6$$6, _7$$6, _12$$7, _13$$7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *fields = NULL, fields_sub, __$null, elements, element, data, field, _0, *_1$$3, _2$$3, _3$$4, _4$$4, _5$$5, _6$$5, _7$$7, *_8$$6, _9$$6, _10$$10, _11$$10, _12$$13, _13$$13;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&fields_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&elements);
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&field);
+ ZVAL_UNDEF(&host);
+ ZVAL_UNDEF(&strict);
+ ZVAL_UNDEF(&cleanHost);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$4);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$5);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_9$$6);
- ZVAL_UNDEF(&_10$$10);
- ZVAL_UNDEF(&_11$$10);
- ZVAL_UNDEF(&_12$$13);
- ZVAL_UNDEF(&_13$$13);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(fields)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &fields);
- if (!fields) {
- fields = &fields_sub;
- ZEPHIR_CPY_WRT(fields, &__$null);
- } else {
- ZEPHIR_SEPARATE_PARAM(fields);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&data, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&elements, &_0);
- if (Z_TYPE_P(fields) == IS_NULL) {
- ZEPHIR_INIT_NVAR(&data);
- array_init(&data);
- zephir_is_iterable(&elements, 0, "phalcon/Forms/Form.zep", 298);
- if (Z_TYPE_P(&elements) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&elements), _1$$3)
- {
- ZEPHIR_INIT_NVAR(&element);
- ZVAL_COPY(&element, _1$$3);
- ZEPHIR_CALL_METHOD(&_3$$4, &element, "getdefault", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_4$$4, &element, "getname", NULL, 0);
- zephir_check_call_status();
- zephir_array_update_zval(&data, &_4$$4, &_3$$4, PH_COPY | PH_SEPARATE);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &elements, "rewind", NULL, 0);
+
+ zephir_memory_observe(&strict);
+ zephir_read_property(&strict, this_ptr, ZEND_STRL("strictHostCheck"), PH_NOISY_CC);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "HTTP_HOST");
+ ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&host))) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "SERVER_NAME");
+ ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_1$$3);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&host))) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZVAL_STRING(&_2$$4, "SERVER_ADDR");
+ ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_2$$4);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2$$3, &elements, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_2$$3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&element, &elements, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_5$$5, &element, "getdefault", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_6$$5, &element, "getname", NULL, 0);
- zephir_check_call_status();
- zephir_array_update_zval(&data, &_6$$5, &_5$$5, PH_COPY | PH_SEPARATE);
- ZEPHIR_CALL_METHOD(NULL, &elements, "next", NULL, 0);
- zephir_check_call_status();
- }
}
- ZEPHIR_INIT_NVAR(&element);
- } else {
- if (Z_TYPE_P(fields) != IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_7$$7);
- zephir_create_array(&_7$$7, 1, 0);
- zephir_array_fast_append(&_7$$7, fields);
- ZEPHIR_CPY_WRT(fields, &_7$$7);
+ }
+ _3 = zephir_is_true(&host);
+ if (_3) {
+ _3 = zephir_is_true(&strict);
+ }
+ if (_3) {
+ ZEPHIR_INIT_VAR(&_4$$5);
+ zephir_fast_trim(&_4$$5, &host, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_VAR(&cleanHost);
+ zephir_fast_strtolower(&cleanHost, &_4$$5);
+ if (zephir_memnstr_str(&cleanHost, SL(":"), "phalcon/Http/Request.zep", 535)) {
+ ZEPHIR_INIT_VAR(&_5$$6);
+ ZVAL_STRING(&_5$$6, "/:[[:digit:]]+$/");
+ ZEPHIR_INIT_VAR(&_6$$6);
+ ZVAL_STRING(&_6$$6, "");
+ ZEPHIR_CALL_FUNCTION(&_7$$6, "preg_replace", NULL, 41, &_5$$6, &_6$$6, &cleanHost);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&cleanHost, &_7$$6);
}
- zephir_is_iterable(fields, 0, "phalcon/Forms/Form.zep", 312);
- if (Z_TYPE_P(fields) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(fields), _8$$6)
- {
- ZEPHIR_INIT_NVAR(&field);
- ZVAL_COPY(&field, _8$$6);
- if (zephir_array_isset(&data, &field)) {
- zephir_array_unset(&data, &field, PH_SEPARATE);
- }
- ZEPHIR_OBS_NVAR(&element);
- if (zephir_array_isset_fetch(&element, &elements, &field, 0)) {
- ZEPHIR_CALL_METHOD(&_10$$10, &element, "getdefault", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_11$$10, &element, "getname", NULL, 0);
- zephir_check_call_status();
- zephir_array_update_zval(&data, &_11$$10, &_10$$10, PH_COPY | PH_SEPARATE);
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, fields, "rewind", NULL, 0);
+ ZEPHIR_INIT_VAR(&_8$$5);
+ ZVAL_STRING(&_8$$5, "/[a-z0-9-]+\\.?/");
+ ZEPHIR_INIT_VAR(&_9$$5);
+ ZVAL_STRING(&_9$$5, "");
+ ZEPHIR_CALL_FUNCTION(&_10$$5, "preg_replace", NULL, 41, &_8$$5, &_9$$5, &cleanHost);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_11$$5);
+ ZVAL_STRING(&_11$$5, "");
+ if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_11$$5, &_10$$5))) {
+ ZEPHIR_INIT_VAR(&_12$$7);
+ object_init_ex(&_12$$7, spl_ce_UnexpectedValueException);
+ ZEPHIR_INIT_VAR(&_13$$7);
+ ZEPHIR_CONCAT_SV(&_13$$7, "Invalid host ", &host);
+ ZEPHIR_CALL_METHOD(NULL, &_12$$7, "__construct", NULL, 338, &_13$$7);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_9$$6, fields, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_9$$6)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&field, fields, "current", NULL, 0);
- zephir_check_call_status();
- if (zephir_array_isset(&data, &field)) {
- zephir_array_unset(&data, &field, PH_SEPARATE);
- }
- ZEPHIR_OBS_NVAR(&element);
- if (zephir_array_isset_fetch(&element, &elements, &field, 0)) {
- ZEPHIR_CALL_METHOD(&_12$$13, &element, "getdefault", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_13$$13, &element, "getname", NULL, 0);
- zephir_check_call_status();
- zephir_array_update_zval(&data, &_13$$13, &_12$$13, PH_COPY | PH_SEPARATE);
- }
- ZEPHIR_CALL_METHOD(NULL, fields, "next", NULL, 0);
- zephir_check_call_status();
- }
+ zephir_throw_exception_debug(&_12$$7, "phalcon/Http/Request.zep", 545);
+ ZEPHIR_MM_RESTORE();
+ return;
}
- ZEPHIR_INIT_NVAR(&field);
+ } else {
+ ZEPHIR_CPY_WRT(&cleanHost, &host);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, count)
-{
- zval _0;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- RETURN_LONG(zephir_fast_count_int(&_0));
+ zephir_cast_to_string(&_14, &cleanHost);
+ RETURN_CTOR(&_14);
}
-static PHP_METHOD(Phalcon_Forms_Form, current)
+static PHP_METHOD(Phalcon_Http_Request, getHTTPReferer)
{
- zval element, _0, _1;
+ zval httpReferer, server;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&httpReferer);
+ ZVAL_UNDEF(&server);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_memory_observe(&element);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elementsIndexed"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("position"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&element, &_0, &_1, 0))) {
- RETURN_MM_BOOL(0);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ if (!(zephir_array_isset_string_fetch(&httpReferer, &server, SL("HTTP_REFERER"), 1))) {
+ RETURN_MM_STRING("");
}
- RETURN_CCTOR(&element);
+ RETURN_CTOR(&httpReferer);
}
-static PHP_METHOD(Phalcon_Forms_Form, get)
+static PHP_METHOD(Phalcon_Http_Request, getJsonRawBody)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, element, _0, _1$$3;
- zval name, _2$$3;
+ zval *associative_param = NULL, rawBody, _0, _1;
+ zend_bool associative;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&rawBody);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(associative)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ zephir_fetch_params(1, 0, 1, &associative_param);
+ if (!associative_param) {
+ associative = 0;
} else {
- ZEPHIR_INIT_VAR(&name);
+ }
+ ZEPHIR_CALL_METHOD(&rawBody, this_ptr, "getrawbody", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&rawBody) != IS_STRING) {
+ RETURN_MM_BOOL(0);
}
- zephir_memory_observe(&element);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_forms_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
+ if (ZEPHIR_IS_STRING(&rawBody, "")) {
+ ZEPHIR_INIT_NVAR(&rawBody);
+ ZVAL_STRING(&rawBody, "{}");
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_support_helper_json_decode_ce);
+ if (zephir_has_constructor(&_0)) {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0);
zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 351);
- ZEPHIR_MM_RESTORE();
- return;
}
- RETURN_CCTOR(&element);
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, getAction)
-{
- zval _3;
- zval _0, _1, _2;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getattributes", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "action");
- ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &_2);
+ if (associative) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(&_0, "__invoke", NULL, 196, &rawBody, &_1);
zephir_check_call_status();
- zephir_cast_to_string(&_3, &_1);
- RETURN_CTOR(&_3);
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, getAttributes)
+static PHP_METHOD(Phalcon_Http_Request, getLanguages)
{
- zval _0, _1$$3;
+ zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_1);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_html_attributes_ce);
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 23);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1$$3);
- }
- RETURN_MM_MEMBER(getThis(), "attributes");
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, getElements)
-{
-
- RETURN_MEMBER(getThis(), "elements");
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, getEntity)
-{
-
- RETURN_MEMBER(getThis(), "entity");
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "HTTP_ACCEPT_LANGUAGE");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "language");
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, getFilteredValue)
+static PHP_METHOD(Phalcon_Http_Request, getMethod)
{
+ zval returnMethod;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval _REQUEST, overridedMethod, spoofedMethod, requestMethod, server, _0, _3, _1$$5, _2$$5;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, filteredData, value, _0;
- zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&filteredData);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_REQUEST);
+ ZVAL_UNDEF(&overridedMethod);
+ ZVAL_UNDEF(&spoofedMethod);
+ ZVAL_UNDEF(&requestMethod);
+ ZVAL_UNDEF(&server);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&returnMethod);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
+ zephir_get_global(&_REQUEST, SL("_REQUEST"));
+
+ ZEPHIR_INIT_VAR(&returnMethod);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ zephir_memory_observe(&requestMethod);
+ if (EXPECTED(zephir_array_isset_string_fetch(&requestMethod, &server, SL("REQUEST_METHOD"), 0))) {
+ ZEPHIR_INIT_NVAR(&returnMethod);
+ zephir_fast_strtoupper(&returnMethod, &requestMethod);
} else {
- ZEPHIR_INIT_VAR(&name);
+ RETURN_MM_STRING("GET");
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("filteredData"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&filteredData, &_0);
- if (Z_TYPE_P(&filteredData) == IS_ARRAY) {
- zephir_memory_observe(&value);
- if (zephir_array_isset_fetch(&value, &filteredData, &name, 0)) {
- RETURN_CCTOR(&value);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "POST");
+ if (ZEPHIR_IS_IDENTICAL(&_0, &returnMethod)) {
+ ZEPHIR_INIT_VAR(&_1$$5);
+ ZVAL_STRING(&_1$$5, "X-HTTP-METHOD-OVERRIDE");
+ ZEPHIR_CALL_METHOD(&overridedMethod, this_ptr, "getheader", NULL, 339, &_1$$5);
+ zephir_check_call_status();
+ zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("httpMethodParameterOverride"), PH_NOISY_CC | PH_READONLY);
+ if (!(ZEPHIR_IS_EMPTY(&overridedMethod))) {
+ ZEPHIR_INIT_NVAR(&returnMethod);
+ zephir_fast_strtoupper(&returnMethod, &overridedMethod);
+ } else if (zephir_is_true(&_2$$5)) {
+ zephir_memory_observe(&spoofedMethod);
+ if (zephir_array_isset_string_fetch(&spoofedMethod, &_REQUEST, SL("_method"), 0)) {
+ ZEPHIR_INIT_NVAR(&returnMethod);
+ zephir_fast_strtoupper(&returnMethod, &spoofedMethod);
+ }
}
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getvalue", NULL, 0, &name);
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "isvalidhttpmethod", NULL, 0, &returnMethod);
zephir_check_call_status();
- RETURN_MM();
+ if (!(zephir_is_true(&_3))) {
+ RETURN_MM_STRING("GET");
+ }
+ RETURN_CTOR(&returnMethod);
}
-static PHP_METHOD(Phalcon_Forms_Form, getLabel)
+static PHP_METHOD(Phalcon_Http_Request, getPatch)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, element, label, _0, _1$$3;
- zval name, _2$$3;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, _0, _1, _2;
+ zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&label);
+ ZVAL_UNDEF(&filters_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 5)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(filters)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
@@ -158236,72 +153401,130 @@ static PHP_METHOD(Phalcon_Forms_Form, getLabel)
} else {
ZEPHIR_INIT_VAR(&name);
}
- zephir_memory_observe(&element);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_forms_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 426);
- ZEPHIR_MM_RESTORE();
- return;
}
- ZEPHIR_CALL_METHOD(&label, &element, "getlabel", NULL, 0);
- zephir_check_call_status();
- if (!(zephir_is_true(&label))) {
- RETURN_CTOR(&name);
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
}
- RETURN_CCTOR(&label);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "patchCache");
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ if (noRecursive) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getpatchput", NULL, 340, &_0, &name, filters, defaultValue, &_1, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, getMessages)
+static PHP_METHOD(Phalcon_Http_Request, getPort)
{
- zend_bool _1;
- zval messages, _0;
+ zval host, pos, _0, _6, _7, _1$$3, _2$$3, _3$$4, _4$$5, _5$$5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&messages);
+ ZVAL_UNDEF(&host);
+ ZVAL_UNDEF(&pos);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&messages, &_0);
- _1 = Z_TYPE_P(&messages) == IS_OBJECT;
- if (_1) {
- _1 = zephir_instance_of_ev(&messages, phalcon_messages_messages_ce);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "HTTP_HOST");
+ ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&host))) {
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "SERVER_PORT");
+ ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "getserver", NULL, 0, &_2$$3);
+ zephir_check_call_status();
+ RETURN_MM_LONG(zephir_get_intval(&_1$$3));
}
- if (!(_1)) {
- object_init_ex(return_value, phalcon_messages_messages_ce);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8);
+ if (zephir_memnstr_str(&host, SL(":"), "phalcon/Http/Request.zep", 686)) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ ZVAL_STRING(&_3$$4, ":");
+ ZEPHIR_CALL_FUNCTION(&pos, "strrpos", NULL, 242, &host, &_3$$4);
zephir_check_call_status();
- RETURN_MM();
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&pos)) {
+ ZVAL_LONG(&_4$$5, (zephir_get_numberval(&pos) + 1));
+ ZEPHIR_INIT_VAR(&_5$$5);
+ zephir_substr(&_5$$5, &host, zephir_get_intval(&_4$$5), 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ RETURN_MM_LONG(zephir_get_intval(&_5$$5));
+ }
}
- RETURN_CCTOR(&messages);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZEPHIR_CALL_METHOD(&_6, this_ptr, "getscheme", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_7);
+ ZVAL_STRING(&_7, "https");
+ if (ZEPHIR_IS_IDENTICAL(&_7, &_6)) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 443);
+ } else {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 80);
+ }
+ RETURN_CCTOR(&_0);
}
-static PHP_METHOD(Phalcon_Forms_Form, getMessagesFor)
+static PHP_METHOD(Phalcon_Http_Request, getPost)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, _0, _1;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, _POST, __$null, _0, _1;
zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&filters_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&_POST);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 5)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(filters)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_global(&_POST, SL("_POST"));
+ zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
@@ -158311,97 +153534,144 @@ static PHP_METHOD(Phalcon_Forms_Form, getMessagesFor)
} else {
ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &name);
- zephir_check_call_status();
- if (!(zephir_is_true(&_0))) {
- object_init_ex(return_value, phalcon_messages_messages_ce);
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8);
- zephir_check_call_status();
- RETURN_MM();
}
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "get", NULL, 0, &name);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_1, "getmessages", NULL, 0);
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
+ }
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
+ }
+ if (noRecursive) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_POST, &name, filters, defaultValue, &_0, &_1);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, getTagFactory)
-{
-
- RETURN_MEMBER(getThis(), "tagFactory");
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, getUserOption)
+static PHP_METHOD(Phalcon_Http_Request, getPut)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *option_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0;
- zval option;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, _0, _1, _2;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&option);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&filters_sub);
ZVAL_UNDEF(&defaultValue_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(option)
+ ZEND_PARSE_PARAMETERS_START(0, 5)
Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(filters)
Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &option_param, &defaultValue);
- zephir_get_strval(&option, option_param);
+ zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ }
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
+ }
if (!defaultValue) {
defaultValue = &defaultValue_sub;
defaultValue = &__$null;
}
- zephir_memory_observe(&value);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&value, &_0, &option, 0))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "putCache");
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
}
- RETURN_CCTOR(&value);
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, getUserOptions)
-{
-
- RETURN_MEMBER(getThis(), "options");
+ if (noRecursive) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getpatchput", NULL, 340, &_0, &name, filters, defaultValue, &_1, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, getValue)
+static PHP_METHOD(Phalcon_Http_Request, getQuery)
{
- zval forbidden;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, __$true, entity, value, data, internalEntity, element, _0, _3, _4, _1$$4, _2$$4;
- zval name, method;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, _GET, __$null, _0, _1;
+ zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&method);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&entity);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&internalEntity);
- ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&filters_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_UNDEF(&_GET);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&forbidden);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ ZVAL_UNDEF(&_1);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 5)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(filters)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_global(&_GET, SL("_GET"));
+ zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
@@ -158411,129 +153681,102 @@ static PHP_METHOD(Phalcon_Forms_Form, getValue)
} else {
ZEPHIR_INIT_VAR(&name);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("entity"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&entity, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&data, &_0);
- if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("getcustomvalue")) == SUCCESS)) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getcustomvalue", NULL, 0, &name, &entity, &data);
- zephir_check_call_status();
- RETURN_MM();
- }
- if (Z_TYPE_P(&entity) == IS_OBJECT) {
- ZEPHIR_INIT_VAR(&_1$$4);
- zephir_camelize(&_1$$4, &name, NULL );
- ZEPHIR_INIT_VAR(&_2$$4);
- ZEPHIR_CONCAT_SV(&_2$$4, "get", &_1$$4);
- zephir_get_strval(&method, &_2$$4);
- if ((zephir_method_exists(&entity, &method) == SUCCESS)) {
- ZEPHIR_RETURN_CALL_METHOD_ZVAL(&entity, &method, NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
- }
- zephir_memory_observe(&value);
- if (zephir_fetch_property_zval(&value, &entity, &name, PH_SILENT_CC)) {
- RETURN_CCTOR(&value);
- }
}
- if (Z_TYPE_P(&data) == IS_ARRAY) {
- ZEPHIR_OBS_NVAR(&value);
- if (zephir_array_isset_fetch(&value, &data, &name, 0)) {
- RETURN_CCTOR(&value);
- }
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
}
- ZEPHIR_INIT_VAR(&forbidden);
- zephir_create_array(&forbidden, 14, 0);
- zephir_array_update_string(&forbidden, SL("attributes"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("validation"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("action"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("useroption"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("useroptions"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("entity"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("elements"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("messages"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("messagesfor"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("label"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("value"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("di"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("tagFactory"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&forbidden, SL("eventsmanager"), &__$true, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_VAR(&internalEntity);
- zephir_fast_strtolower(&internalEntity, &name);
- if (zephir_array_isset(&forbidden, &internalEntity)) {
- RETURN_MM_NULL();
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- ZEPHIR_INIT_VAR(&_3);
- zephir_camelize(&_3, &name, NULL );
- ZEPHIR_INIT_VAR(&_4);
- ZEPHIR_CONCAT_SV(&_4, "get", &_3);
- zephir_get_strval(&method, &_4);
- if ((zephir_method_exists(this_ptr, &method) == SUCCESS)) {
- ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, &method, NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_0, 1);
+ } else {
+ ZVAL_BOOL(&_0, 0);
}
- zephir_memory_observe(&element);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset_fetch(&element, &_0, &name, 0)) {
- ZEPHIR_RETURN_CALL_METHOD(&element, "getdefault", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
+ if (noRecursive) {
+ ZVAL_BOOL(&_1, 1);
+ } else {
+ ZVAL_BOOL(&_1, 0);
}
- RETURN_MM_NULL();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_GET, &name, filters, defaultValue, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Form, getValidation)
+static PHP_METHOD(Phalcon_Http_Request, getRawBody)
{
+ zval rawBody, contents, _0, _1$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "validation");
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, getWhitelist)
-{
+ ZVAL_UNDEF(&rawBody);
+ ZVAL_UNDEF(&contents);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- RETURN_MEMBER(getThis(), "whitelist");
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("rawBody"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&rawBody, &_0);
+ if (ZEPHIR_IS_EMPTY(&rawBody)) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "php://input");
+ ZEPHIR_INIT_VAR(&contents);
+ zephir_file_get_contents(&contents, &_1$$3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("rawBody"), &contents);
+ RETURN_CCTOR(&contents);
+ }
+ RETURN_CCTOR(&rawBody);
}
-static PHP_METHOD(Phalcon_Forms_Form, has)
+static PHP_METHOD(Phalcon_Http_Request, getScheme)
{
+ zend_bool _1;
+ zval https, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, _0;
- zval name;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&https);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "HTTPS");
+ ZEPHIR_CALL_METHOD(&https, this_ptr, "getserver", NULL, 0, &_0);
+ zephir_check_call_status();
+ _1 = zephir_is_true(&https);
+ if (_1) {
+ _1 = !ZEPHIR_IS_STRING(&https, "off");
}
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
+ if (_1) {
+ RETURN_MM_STRING("https");
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &name));
+ RETURN_MM_STRING("http");
}
-static PHP_METHOD(Phalcon_Forms_Form, hasMessagesFor)
+static PHP_METHOD(Phalcon_Http_Request, getServer)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, _0, _1;
+ zval *name_param = NULL, serverValue, server;
zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&serverValue);
+ ZVAL_UNDEF(&server);
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
@@ -158549,398 +153792,547 @@ static PHP_METHOD(Phalcon_Forms_Form, hasMessagesFor)
} else {
ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmessagesfor", NULL, 0, &name);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_1, &_0, "count", NULL, 0);
+ if (!(zephir_array_isset_fetch(&serverValue, &server, &name, 1))) {
+ RETURN_MM_NULL();
+ }
+ RETURN_CTOR(&serverValue);
+}
+
+static PHP_METHOD(Phalcon_Http_Request, getServerAddress)
+{
+ zval serverAddr, _0, _1$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&serverAddr);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "SERVER_ADDR");
+ ZEPHIR_CALL_METHOD(&serverAddr, this_ptr, "getserver", NULL, 0, &_0);
zephir_check_call_status();
- RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_1, 0));
+ if (Z_TYPE_P(&serverAddr) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "localhost");
+ ZEPHIR_RETURN_CALL_FUNCTION("gethostbyname", NULL, 341, &_1$$3);
+ zephir_check_call_status();
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&serverAddr);
}
-static PHP_METHOD(Phalcon_Forms_Form, isValid)
+static PHP_METHOD(Phalcon_Http_Request, getServerName)
{
- zend_object_iterator *_18$$20;
- zend_bool validationStatus = 0, _3, _7;
+ zval serverName, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_13 = NULL, *_14 = NULL, *_21 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval whitelist;
- zval *data = NULL, data_sub, *entity = NULL, entity_sub, *whitelist_param = NULL, __$null, messages, element, validators, name, filters, validator, validation, elementMessage, _0, _4, _8, *_9, _10, _17, _1$$4, _2$$5, _5$$6, _6$$7, *_11$$10, _12$$10, *_15$$15, _16$$15, _19$$21, _20$$21;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&entity_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&messages);
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&validators);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&filters);
- ZVAL_UNDEF(&validator);
- ZVAL_UNDEF(&validation);
- ZVAL_UNDEF(&elementMessage);
+ ZVAL_UNDEF(&serverName);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_17);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$5);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_12$$10);
- ZVAL_UNDEF(&_16$$15);
- ZVAL_UNDEF(&_19$$21);
- ZVAL_UNDEF(&_20$$21);
- ZVAL_UNDEF(&whitelist);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 3)
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "SERVER_NAME");
+ ZEPHIR_CALL_METHOD(&serverName, this_ptr, "getserver", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&serverName) == IS_NULL) {
+ RETURN_MM_STRING("localhost");
+ }
+ RETURN_CCTOR(&serverName);
+}
+
+static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles)
+{
+ zend_string *_3$$3;
+ zend_ulong _2$$3;
+ zval files;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_10 = NULL, *_18 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *onlySuccessful_param = NULL, *namedKeys_param = NULL, _FILES, superFiles, prefix, input, smoothInput, file, dataFile, *_0$$3, _1$$3, _4$$4, _5$$5, _6$$5, _7$$5, _8$$5, _9$$5, *_11$$5, _12$$5, _14$$6, _15$$7, _16$$8, _17$$8, _19$$8, _20$$9, _21$$9, _23$$10, _24$$11, _25$$11, _26$$12, _27$$12, _28$$12, _29$$13, _30$$13, _32$$14, _33$$16, _34$$17, _35$$18, _36$$19, _37$$19, _38$$19, _39$$19, _40$$19, *_41$$19, _42$$19, _44$$20, _45$$21, _46$$21, _47$$22, _48$$22, _49$$22, _50$$23, _51$$23, _53$$24, _54$$25, _55$$25, _56$$26, _57$$26, _58$$26, _59$$27, _60$$27, _62$$28, _63$$30, _64$$31;
+ zend_bool onlySuccessful, namedKeys, _13$$6, _22$$10, _31$$14, _43$$20, _52$$24, _61$$28;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_FILES);
+ ZVAL_UNDEF(&superFiles);
+ ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&input);
+ ZVAL_UNDEF(&smoothInput);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&dataFile);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_14$$6);
+ ZVAL_UNDEF(&_15$$7);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_19$$8);
+ ZVAL_UNDEF(&_20$$9);
+ ZVAL_UNDEF(&_21$$9);
+ ZVAL_UNDEF(&_23$$10);
+ ZVAL_UNDEF(&_24$$11);
+ ZVAL_UNDEF(&_25$$11);
+ ZVAL_UNDEF(&_26$$12);
+ ZVAL_UNDEF(&_27$$12);
+ ZVAL_UNDEF(&_28$$12);
+ ZVAL_UNDEF(&_29$$13);
+ ZVAL_UNDEF(&_30$$13);
+ ZVAL_UNDEF(&_32$$14);
+ ZVAL_UNDEF(&_33$$16);
+ ZVAL_UNDEF(&_34$$17);
+ ZVAL_UNDEF(&_35$$18);
+ ZVAL_UNDEF(&_36$$19);
+ ZVAL_UNDEF(&_37$$19);
+ ZVAL_UNDEF(&_38$$19);
+ ZVAL_UNDEF(&_39$$19);
+ ZVAL_UNDEF(&_40$$19);
+ ZVAL_UNDEF(&_42$$19);
+ ZVAL_UNDEF(&_44$$20);
+ ZVAL_UNDEF(&_45$$21);
+ ZVAL_UNDEF(&_46$$21);
+ ZVAL_UNDEF(&_47$$22);
+ ZVAL_UNDEF(&_48$$22);
+ ZVAL_UNDEF(&_49$$22);
+ ZVAL_UNDEF(&_50$$23);
+ ZVAL_UNDEF(&_51$$23);
+ ZVAL_UNDEF(&_53$$24);
+ ZVAL_UNDEF(&_54$$25);
+ ZVAL_UNDEF(&_55$$25);
+ ZVAL_UNDEF(&_56$$26);
+ ZVAL_UNDEF(&_57$$26);
+ ZVAL_UNDEF(&_58$$26);
+ ZVAL_UNDEF(&_59$$27);
+ ZVAL_UNDEF(&_60$$27);
+ ZVAL_UNDEF(&_62$$28);
+ ZVAL_UNDEF(&_63$$30);
+ ZVAL_UNDEF(&_64$$31);
+ ZVAL_UNDEF(&files);
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(data)
- Z_PARAM_ZVAL_OR_NULL(entity)
- Z_PARAM_ARRAY(whitelist)
+ Z_PARAM_BOOL(onlySuccessful)
+ Z_PARAM_BOOL(namedKeys)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 3, &data, &entity, &whitelist_param);
- if (!data) {
- data = &data_sub;
- ZEPHIR_CPY_WRT(data, &__$null);
- } else {
- ZEPHIR_SEPARATE_PARAM(data);
- }
- if (!entity) {
- entity = &entity_sub;
- ZEPHIR_CPY_WRT(entity, &__$null);
+ zephir_get_global(&_FILES, SL("_FILES"));
+ zephir_fetch_params(1, 0, 2, &onlySuccessful_param, &namedKeys_param);
+ if (!onlySuccessful_param) {
+ onlySuccessful = 0;
} else {
- ZEPHIR_SEPARATE_PARAM(entity);
- }
- if (!whitelist_param) {
- ZEPHIR_INIT_VAR(&whitelist);
- array_init(&whitelist);
+ }
+ if (!namedKeys_param) {
+ namedKeys = 0;
} else {
- zephir_get_arrval(&whitelist, whitelist_param);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (ZEPHIR_IS_EMPTY(&_0)) {
- RETURN_MM_BOOL(1);
- }
- if (ZEPHIR_IS_EMPTY(&whitelist)) {
- zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("whitelist"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&whitelist, &_1$$4);
- }
- if (Z_TYPE_P(data) != IS_ARRAY) {
- zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(data, &_2$$5);
- }
- _3 = Z_TYPE_P(entity) != IS_OBJECT;
- if (_3) {
- zephir_memory_observe(&_4);
- zephir_read_property(&_4, this_ptr, ZEND_STRL("entity"), PH_NOISY_CC);
- _3 = Z_TYPE_P(&_4) == IS_OBJECT;
- }
- if (_3) {
- zephir_read_property(&_5$$6, this_ptr, ZEND_STRL("entity"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(entity, &_5$$6);
- }
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "bind", NULL, 0, data, entity, &whitelist);
- zephir_check_call_status();
- if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("beforevalidation")) == SUCCESS)) {
- ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "beforevalidation", NULL, 0, data, entity);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$7)) {
- RETURN_MM_BOOL(0);
}
- }
- validationStatus = 1;
- ZEPHIR_CALL_METHOD(&validation, this_ptr, "getvalidation", NULL, 0);
- zephir_check_call_status();
- _7 = Z_TYPE_P(&validation) != IS_OBJECT;
- if (!(_7)) {
- _7 = !((zephir_instance_of_ev(&validation, phalcon_filter_validation_validationinterface_ce)));
- }
- if (_7) {
- ZEPHIR_INIT_NVAR(&validation);
- object_init_ex(&validation, phalcon_filter_validation_ce);
- ZEPHIR_CALL_METHOD(NULL, &validation, "__construct", NULL, 315);
- zephir_check_call_status();
- }
- zephir_read_property(&_8, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- zephir_is_iterable(&_8, 0, "phalcon/Forms/Form.zep", 722);
- if (Z_TYPE_P(&_8) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_8), _9)
- {
- ZEPHIR_INIT_NVAR(&element);
- ZVAL_COPY(&element, _9);
- ZEPHIR_CALL_METHOD(&validators, &element, "getvalidators", NULL, 0);
- zephir_check_call_status();
- if (zephir_fast_count_int(&validators) == 0) {
- continue;
- }
- ZEPHIR_CALL_METHOD(&name, &element, "getname", NULL, 0);
- zephir_check_call_status();
- zephir_is_iterable(&validators, 0, "phalcon/Forms/Form.zep", 709);
- if (Z_TYPE_P(&validators) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _11$$10)
- {
- ZEPHIR_INIT_NVAR(&validator);
- ZVAL_COPY(&validator, _11$$10);
- ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_12$$10, &validators, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_12$$10)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0);
+ ZEPHIR_INIT_VAR(&files);
+ array_init(&files);
+ ZEPHIR_CPY_WRT(&superFiles, &_FILES);
+ if (zephir_fast_count_int(&superFiles) > 0) {
+ zephir_is_iterable(&superFiles, 0, "phalcon/Http/Request.zep", 930);
+ if (Z_TYPE_P(&superFiles) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&superFiles), _2$$3, _3$$3, _0$$3)
+ {
+ ZEPHIR_INIT_NVAR(&prefix);
+ if (_3$$3 != NULL) {
+ ZVAL_STR_COPY(&prefix, _3$$3);
+ } else {
+ ZVAL_LONG(&prefix, _2$$3);
+ }
+ ZEPHIR_INIT_NVAR(&input);
+ ZVAL_COPY(&input, _0$$3);
+ ZEPHIR_OBS_NVAR(&_4$$4);
+ zephir_array_fetch_string(&_4$$4, &input, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 887);
+ if (Z_TYPE_P(&_4$$4) == IS_ARRAY) {
+ zephir_array_fetch_string(&_5$$5, &input, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 889);
+ zephir_array_fetch_string(&_6$$5, &input, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 890);
+ zephir_array_fetch_string(&_7$$5, &input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 891);
+ zephir_array_fetch_string(&_8$$5, &input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 892);
+ zephir_array_fetch_string(&_9$$5, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 893);
+ ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 342, &_5$$5, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &prefix);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
+ zephir_is_iterable(&smoothInput, 0, "phalcon/Http/Request.zep", 920);
+ if (Z_TYPE_P(&smoothInput) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&smoothInput), _11$$5)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _11$$5);
+ _13$$6 = onlySuccessful == 0;
+ if (!(_13$$6)) {
+ zephir_array_fetch_string(&_14$$6, &file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 898);
+ _13$$6 = ZEPHIR_IS_LONG(&_14$$6, 0);
+ }
+ if (_13$$6) {
+ ZEPHIR_INIT_NVAR(&dataFile);
+ zephir_create_array(&dataFile, 5, 0);
+ ZEPHIR_OBS_NVAR(&_15$$7);
+ zephir_array_fetch_string(&_15$$7, &file, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 900);
+ zephir_array_update_string(&dataFile, SL("name"), &_15$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$7);
+ zephir_array_fetch_string(&_15$$7, &file, SL("type"), PH_NOISY, "phalcon/Http/Request.zep", 901);
+ zephir_array_update_string(&dataFile, SL("type"), &_15$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$7);
+ zephir_array_fetch_string(&_15$$7, &file, SL("tmp_name"), PH_NOISY, "phalcon/Http/Request.zep", 902);
+ zephir_array_update_string(&dataFile, SL("tmp_name"), &_15$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$7);
+ zephir_array_fetch_string(&_15$$7, &file, SL("size"), PH_NOISY, "phalcon/Http/Request.zep", 903);
+ zephir_array_update_string(&dataFile, SL("size"), &_15$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$7);
+ zephir_array_fetch_string(&_15$$7, &file, SL("error"), PH_NOISY, "phalcon/Http/Request.zep", 905);
+ zephir_array_update_string(&dataFile, SL("error"), &_15$$7, PH_COPY | PH_SEPARATE);
+ if (namedKeys == 1) {
+ ZEPHIR_INIT_NVAR(&_16$$8);
+ object_init_ex(&_16$$8, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_17$$8, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 911);
+ ZEPHIR_CALL_METHOD(NULL, &_16$$8, "__construct", &_18, 343, &dataFile, &_17$$8);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&_19$$8);
+ zephir_array_fetch_string(&_19$$8, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 908);
+ zephir_array_update_zval(&files, &_19$$8, &_16$$8, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_20$$9);
+ object_init_ex(&_20$$9, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_21$$9, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 916);
+ ZEPHIR_CALL_METHOD(NULL, &_20$$9, "__construct", &_18, 343, &dataFile, &_21$$9);
+ zephir_check_call_status();
+ zephir_array_append(&files, &_20$$9, PH_SEPARATE, "phalcon/Http/Request.zep", 916);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &smoothInput, "rewind", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0);
- zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_12$$5, &smoothInput, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_12$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &smoothInput, "current", NULL, 0);
+ zephir_check_call_status();
+ _22$$10 = onlySuccessful == 0;
+ if (!(_22$$10)) {
+ zephir_array_fetch_string(&_23$$10, &file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 898);
+ _22$$10 = ZEPHIR_IS_LONG(&_23$$10, 0);
+ }
+ if (_22$$10) {
+ ZEPHIR_INIT_NVAR(&_24$$11);
+ zephir_create_array(&_24$$11, 5, 0);
+ ZEPHIR_OBS_NVAR(&_25$$11);
+ zephir_array_fetch_string(&_25$$11, &file, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 900);
+ zephir_array_update_string(&_24$$11, SL("name"), &_25$$11, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_25$$11);
+ zephir_array_fetch_string(&_25$$11, &file, SL("type"), PH_NOISY, "phalcon/Http/Request.zep", 901);
+ zephir_array_update_string(&_24$$11, SL("type"), &_25$$11, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_25$$11);
+ zephir_array_fetch_string(&_25$$11, &file, SL("tmp_name"), PH_NOISY, "phalcon/Http/Request.zep", 902);
+ zephir_array_update_string(&_24$$11, SL("tmp_name"), &_25$$11, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_25$$11);
+ zephir_array_fetch_string(&_25$$11, &file, SL("size"), PH_NOISY, "phalcon/Http/Request.zep", 903);
+ zephir_array_update_string(&_24$$11, SL("size"), &_25$$11, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_25$$11);
+ zephir_array_fetch_string(&_25$$11, &file, SL("error"), PH_NOISY, "phalcon/Http/Request.zep", 905);
+ zephir_array_update_string(&_24$$11, SL("error"), &_25$$11, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CPY_WRT(&dataFile, &_24$$11);
+ if (namedKeys == 1) {
+ ZEPHIR_INIT_NVAR(&_26$$12);
+ object_init_ex(&_26$$12, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_27$$12, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 911);
+ ZEPHIR_CALL_METHOD(NULL, &_26$$12, "__construct", &_18, 343, &dataFile, &_27$$12);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&_28$$12);
+ zephir_array_fetch_string(&_28$$12, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 908);
+ zephir_array_update_zval(&files, &_28$$12, &_26$$12, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_29$$13);
+ object_init_ex(&_29$$13, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_30$$13, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 916);
+ ZEPHIR_CALL_METHOD(NULL, &_29$$13, "__construct", &_18, 343, &dataFile, &_30$$13);
+ zephir_check_call_status();
+ zephir_array_append(&files, &_29$$13, PH_SEPARATE, "phalcon/Http/Request.zep", 916);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &smoothInput, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&file);
+ } else {
+ _31$$14 = onlySuccessful == 0;
+ if (!(_31$$14)) {
+ zephir_array_fetch_string(&_32$$14, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 921);
+ _31$$14 = ZEPHIR_IS_LONG(&_32$$14, 0);
+ }
+ if (_31$$14) {
+ if (namedKeys == 1) {
+ ZEPHIR_INIT_NVAR(&_33$$16);
+ object_init_ex(&_33$$16, phalcon_http_request_file_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_33$$16, "__construct", &_18, 343, &input, &prefix);
+ zephir_check_call_status();
+ zephir_array_update_zval(&files, &prefix, &_33$$16, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_34$$17);
+ object_init_ex(&_34$$17, phalcon_http_request_file_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_34$$17, "__construct", &_18, 343, &input, &prefix);
+ zephir_check_call_status();
+ zephir_array_append(&files, &_34$$17, PH_SEPARATE, "phalcon/Http/Request.zep", 925);
+ }
+ }
}
- }
- ZEPHIR_INIT_NVAR(&validator);
- ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&filters) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 317, &name, &filters);
- zephir_check_call_status();
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_8, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_10, &_8, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_10)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&element, &_8, "current", NULL, 0);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &superFiles, "rewind", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&validators, &element, "getvalidators", NULL, 0);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1$$3, &superFiles, "valid", NULL, 0);
zephir_check_call_status();
- if (zephir_fast_count_int(&validators) == 0) {
- continue;
+ if (!zend_is_true(&_1$$3)) {
+ break;
}
- ZEPHIR_CALL_METHOD(&name, &element, "getname", NULL, 0);
+ ZEPHIR_CALL_METHOD(&prefix, &superFiles, "key", NULL, 0);
zephir_check_call_status();
- zephir_is_iterable(&validators, 0, "phalcon/Forms/Form.zep", 709);
- if (Z_TYPE_P(&validators) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _15$$15)
- {
- ZEPHIR_INIT_NVAR(&validator);
- ZVAL_COPY(&validator, _15$$15);
- ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_16$$15, &validators, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_16$$15)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&input, &superFiles, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&_35$$18);
+ zephir_array_fetch_string(&_35$$18, &input, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 887);
+ if (Z_TYPE_P(&_35$$18) == IS_ARRAY) {
+ zephir_array_fetch_string(&_36$$19, &input, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 889);
+ zephir_array_fetch_string(&_37$$19, &input, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 890);
+ zephir_array_fetch_string(&_38$$19, &input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 891);
+ zephir_array_fetch_string(&_39$$19, &input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 892);
+ zephir_array_fetch_string(&_40$$19, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 893);
+ ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 342, &_36$$19, &_37$$19, &_38$$19, &_39$$19, &_40$$19, &prefix);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 316, &name, &validator);
+ zephir_is_iterable(&smoothInput, 0, "phalcon/Http/Request.zep", 920);
+ if (Z_TYPE_P(&smoothInput) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&smoothInput), _41$$19)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _41$$19);
+ _43$$20 = onlySuccessful == 0;
+ if (!(_43$$20)) {
+ zephir_array_fetch_string(&_44$$20, &file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 898);
+ _43$$20 = ZEPHIR_IS_LONG(&_44$$20, 0);
+ }
+ if (_43$$20) {
+ ZEPHIR_INIT_NVAR(&_45$$21);
+ zephir_create_array(&_45$$21, 5, 0);
+ ZEPHIR_OBS_NVAR(&_46$$21);
+ zephir_array_fetch_string(&_46$$21, &file, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 900);
+ zephir_array_update_string(&_45$$21, SL("name"), &_46$$21, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_46$$21);
+ zephir_array_fetch_string(&_46$$21, &file, SL("type"), PH_NOISY, "phalcon/Http/Request.zep", 901);
+ zephir_array_update_string(&_45$$21, SL("type"), &_46$$21, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_46$$21);
+ zephir_array_fetch_string(&_46$$21, &file, SL("tmp_name"), PH_NOISY, "phalcon/Http/Request.zep", 902);
+ zephir_array_update_string(&_45$$21, SL("tmp_name"), &_46$$21, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_46$$21);
+ zephir_array_fetch_string(&_46$$21, &file, SL("size"), PH_NOISY, "phalcon/Http/Request.zep", 903);
+ zephir_array_update_string(&_45$$21, SL("size"), &_46$$21, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_46$$21);
+ zephir_array_fetch_string(&_46$$21, &file, SL("error"), PH_NOISY, "phalcon/Http/Request.zep", 905);
+ zephir_array_update_string(&_45$$21, SL("error"), &_46$$21, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CPY_WRT(&dataFile, &_45$$21);
+ if (namedKeys == 1) {
+ ZEPHIR_INIT_NVAR(&_47$$22);
+ object_init_ex(&_47$$22, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_48$$22, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 911);
+ ZEPHIR_CALL_METHOD(NULL, &_47$$22, "__construct", &_18, 343, &dataFile, &_48$$22);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&_49$$22);
+ zephir_array_fetch_string(&_49$$22, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 908);
+ zephir_array_update_zval(&files, &_49$$22, &_47$$22, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_50$$23);
+ object_init_ex(&_50$$23, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_51$$23, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 916);
+ ZEPHIR_CALL_METHOD(NULL, &_50$$23, "__construct", &_18, 343, &dataFile, &_51$$23);
+ zephir_check_call_status();
+ zephir_array_append(&files, &_50$$23, PH_SEPARATE, "phalcon/Http/Request.zep", 916);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &smoothInput, "rewind", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0);
- zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_42$$19, &smoothInput, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_42$$19)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &smoothInput, "current", NULL, 0);
+ zephir_check_call_status();
+ _52$$24 = onlySuccessful == 0;
+ if (!(_52$$24)) {
+ zephir_array_fetch_string(&_53$$24, &file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 898);
+ _52$$24 = ZEPHIR_IS_LONG(&_53$$24, 0);
+ }
+ if (_52$$24) {
+ ZEPHIR_INIT_NVAR(&_54$$25);
+ zephir_create_array(&_54$$25, 5, 0);
+ ZEPHIR_OBS_NVAR(&_55$$25);
+ zephir_array_fetch_string(&_55$$25, &file, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 900);
+ zephir_array_update_string(&_54$$25, SL("name"), &_55$$25, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_55$$25);
+ zephir_array_fetch_string(&_55$$25, &file, SL("type"), PH_NOISY, "phalcon/Http/Request.zep", 901);
+ zephir_array_update_string(&_54$$25, SL("type"), &_55$$25, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_55$$25);
+ zephir_array_fetch_string(&_55$$25, &file, SL("tmp_name"), PH_NOISY, "phalcon/Http/Request.zep", 902);
+ zephir_array_update_string(&_54$$25, SL("tmp_name"), &_55$$25, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_55$$25);
+ zephir_array_fetch_string(&_55$$25, &file, SL("size"), PH_NOISY, "phalcon/Http/Request.zep", 903);
+ zephir_array_update_string(&_54$$25, SL("size"), &_55$$25, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_55$$25);
+ zephir_array_fetch_string(&_55$$25, &file, SL("error"), PH_NOISY, "phalcon/Http/Request.zep", 905);
+ zephir_array_update_string(&_54$$25, SL("error"), &_55$$25, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CPY_WRT(&dataFile, &_54$$25);
+ if (namedKeys == 1) {
+ ZEPHIR_INIT_NVAR(&_56$$26);
+ object_init_ex(&_56$$26, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_57$$26, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 911);
+ ZEPHIR_CALL_METHOD(NULL, &_56$$26, "__construct", &_18, 343, &dataFile, &_57$$26);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&_58$$26);
+ zephir_array_fetch_string(&_58$$26, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 908);
+ zephir_array_update_zval(&files, &_58$$26, &_56$$26, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_59$$27);
+ object_init_ex(&_59$$27, phalcon_http_request_file_ce);
+ zephir_array_fetch_string(&_60$$27, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 916);
+ ZEPHIR_CALL_METHOD(NULL, &_59$$27, "__construct", &_18, 343, &dataFile, &_60$$27);
+ zephir_check_call_status();
+ zephir_array_append(&files, &_59$$27, PH_SEPARATE, "phalcon/Http/Request.zep", 916);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &smoothInput, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&file);
+ } else {
+ _61$$28 = onlySuccessful == 0;
+ if (!(_61$$28)) {
+ zephir_array_fetch_string(&_62$$28, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 921);
+ _61$$28 = ZEPHIR_IS_LONG(&_62$$28, 0);
+ }
+ if (_61$$28) {
+ if (namedKeys == 1) {
+ ZEPHIR_INIT_NVAR(&_63$$30);
+ object_init_ex(&_63$$30, phalcon_http_request_file_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_63$$30, "__construct", &_18, 343, &input, &prefix);
+ zephir_check_call_status();
+ zephir_array_update_zval(&files, &prefix, &_63$$30, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_NVAR(&_64$$31);
+ object_init_ex(&_64$$31, phalcon_http_request_file_ce);
+ ZEPHIR_CALL_METHOD(NULL, &_64$$31, "__construct", &_18, 343, &input, &prefix);
+ zephir_check_call_status();
+ zephir_array_append(&files, &_64$$31, PH_SEPARATE, "phalcon/Http/Request.zep", 925);
+ }
+ }
}
- }
- ZEPHIR_INIT_NVAR(&validator);
- ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &superFiles, "next", NULL, 0);
zephir_check_call_status();
- if (Z_TYPE_P(&filters) == IS_ARRAY) {
- ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 317, &name, &filters);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(NULL, &_8, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&element);
- ZEPHIR_CALL_METHOD(&messages, &validation, "validate", NULL, 318, data, entity);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_17, &messages, "count", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_true(&_17)) {
- _18$$20 = zephir_get_iterator(&messages);
- _18$$20->funcs->rewind(_18$$20);
- for (;_18$$20->funcs->valid(_18$$20) == SUCCESS && !EG(exception); _18$$20->funcs->move_forward(_18$$20)) {
- {
- ZEPHIR_ITERATOR_COPY(&elementMessage, _18$$20);
}
- ZEPHIR_CALL_METHOD(&_20$$21, &elementMessage, "getfield", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_19$$21, this_ptr, "get", &_21, 0, &_20$$21);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &_19$$21, "appendmessage", NULL, 0, &elementMessage);
- zephir_check_call_status();
}
- zend_iterator_dtor(_18$$20);
- ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0);
- zephir_check_call_status();
- validationStatus = 0;
- }
- if (!(validationStatus)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &messages);
- }
- if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("aftervalidation")) == SUCCESS)) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "aftervalidation", NULL, 0, &messages);
- zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&input);
+ ZEPHIR_INIT_NVAR(&prefix);
}
- RETURN_MM_BOOL(validationStatus);
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, key)
-{
-
- RETURN_MEMBER(getThis(), "position");
+ RETURN_CTOR(&files);
}
-static PHP_METHOD(Phalcon_Forms_Form, label)
+static PHP_METHOD(Phalcon_Http_Request, getURI)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval attributes;
- zval *name_param = NULL, *attributes_param = NULL, element, _0, _1$$3;
- zval name, _2$$3;
+ zval *onlyPath_param = NULL, requestURI, _0, _1$$4, _2$$4, _3$$4;
+ zend_bool onlyPath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&requestURI);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&attributes);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(attributes)
+ Z_PARAM_BOOL(onlyPath)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &attributes_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!attributes_param) {
- ZEPHIR_INIT_VAR(&attributes);
- array_init(&attributes);
+ zephir_fetch_params(1, 0, 1, &onlyPath_param);
+ if (!onlyPath_param) {
+ onlyPath = 0;
} else {
- zephir_get_arrval(&attributes, attributes_param);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "REQUEST_URI");
+ ZEPHIR_CALL_METHOD(&requestURI, this_ptr, "getserver", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&requestURI) == IS_NULL) {
+ RETURN_MM_STRING("");
}
- zephir_memory_observe(&element);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_forms_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 772);
- ZEPHIR_MM_RESTORE();
- return;
+ if (onlyPath) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ ZEPHIR_INIT_VAR(&_2$$4);
+ ZVAL_STRING(&_2$$4, "?");
+ zephir_fast_explode(&_1$$4, &_2$$4, &requestURI, LONG_MAX);
+ zephir_array_fetch_long(&_3$$4, &_1$$4, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 959);
+ ZEPHIR_CPY_WRT(&requestURI, &_3$$4);
}
- ZEPHIR_RETURN_CALL_METHOD(&element, "label", NULL, 0, &attributes);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, next)
-{
- zval *this_ptr = getThis();
- RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("position")));
+ RETURN_CCTOR(&requestURI);
}
-static PHP_METHOD(Phalcon_Forms_Form, render)
+static PHP_METHOD(Phalcon_Http_Request, getUserAgent)
{
+ zval userAgent, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval attributes;
- zval *name_param = NULL, *attributes_param = NULL, element, _0, _1$$3;
- zval name, _2$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&userAgent);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&attributes);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(attributes)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &attributes_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!attributes_param) {
- ZEPHIR_INIT_VAR(&attributes);
- array_init(&attributes);
- } else {
- zephir_get_arrval(&attributes, attributes_param);
- }
- zephir_memory_observe(&element);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&element, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_forms_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 796);
- ZEPHIR_MM_RESTORE();
- return;
- }
- ZEPHIR_RETURN_CALL_METHOD(&element, "render", NULL, 0, &attributes);
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "HTTP_USER_AGENT");
+ ZEPHIR_CALL_METHOD(&userAgent, this_ptr, "getserver", NULL, 0, &_0);
zephir_check_call_status();
- RETURN_MM();
+ if (Z_TYPE_P(&userAgent) == IS_NULL) {
+ RETURN_MM_STRING("");
+ }
+ RETURN_CCTOR(&userAgent);
}
-static PHP_METHOD(Phalcon_Forms_Form, remove)
+static PHP_METHOD(Phalcon_Http_Request, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, __$null, _0, _1$$3;
+ zval *name_param = NULL, _REQUEST;
zval name;
- zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_REQUEST);
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_get_global(&_REQUEST, SL("_REQUEST"));
zephir_fetch_params(1, 1, 0, &name_param);
if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
@@ -158951,18 +154343,10 @@ static PHP_METHOD(Phalcon_Forms_Form, remove)
} else {
ZEPHIR_INIT_VAR(&name);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (zephir_array_isset(&_0, &name)) {
- zephir_unset_property_array(this_ptr, ZEND_STRL("elements"), &name);
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- zephir_array_unset(&_1$$3, &name, PH_SEPARATE);
- RETURN_MM_BOOL(1);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("elementsIndexed"), &__$null);
- RETURN_MM_BOOL(0);
+ RETURN_MM_BOOL(zephir_array_isset(&_REQUEST, &name));
}
-static PHP_METHOD(Phalcon_Forms_Form, rewind)
+static PHP_METHOD(Phalcon_Http_Request, hasFiles)
{
zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
@@ -158974,1084 +154358,929 @@ static PHP_METHOD(Phalcon_Forms_Form, rewind)
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZVAL_UNDEF(&_0);
- ZVAL_LONG(&_0, 0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("position"), &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_FUNCTION(&_1, "array_values", NULL, 14, &_0);
+ ZVAL_BOOL(&_1, 1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "numfiles", NULL, 0, &_1);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("elementsIndexed"), &_1);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_0, 0));
}
-static PHP_METHOD(Phalcon_Forms_Form, setAction)
+static PHP_METHOD(Phalcon_Http_Request, hasHeader)
{
+ zend_bool _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *action_param = NULL, _0, _1;
- zval action;
+ zval *header_param = NULL, name, _0, _1, _2, _3, _5, _6;
+ zval header;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&action);
+ ZVAL_UNDEF(&header);
+ ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(action)
+ Z_PARAM_STR(header)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &action_param);
- if (UNEXPECTED(Z_TYPE_P(action_param) != IS_STRING && Z_TYPE_P(action_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'action' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &header_param);
+ if (UNEXPECTED(Z_TYPE_P(header_param) != IS_STRING && Z_TYPE_P(header_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'header' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(action_param) == IS_STRING)) {
- zephir_get_strval(&action, action_param);
+ if (EXPECTED(Z_TYPE_P(header_param) == IS_STRING)) {
+ zephir_get_strval(&header, header_param);
} else {
- ZEPHIR_INIT_VAR(&action);
+ ZEPHIR_INIT_VAR(&header);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getattributes", NULL, 0);
- zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "-");
ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "action");
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &_1, &action);
+ ZVAL_STRING(&_1, "_");
+ ZEPHIR_CALL_FUNCTION(&_2, "strtr", NULL, 5, &header, &_0, &_1);
zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, setAttributes)
-{
- zval *attributes, attributes_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&attributes_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(attributes, phalcon_html_attributes_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &attributes);
- zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), attributes);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, setEntity)
-{
- zval *entity, entity_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&entity_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(entity)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &entity);
- zephir_update_property_zval(this_ptr, ZEND_STRL("entity"), entity);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, setTagFactory)
-{
- zval *tagFactory, tagFactory_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&tagFactory_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(tagFactory, phalcon_html_tagfactory_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &tagFactory);
- zephir_update_property_zval(this_ptr, ZEND_STRL("tagFactory"), tagFactory);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, setValidation)
-{
- zval *validation, validation_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&validation_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(validation, phalcon_filter_validation_validationinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &validation);
- zephir_update_property_zval(this_ptr, ZEND_STRL("validation"), validation);
- RETURN_THISW();
+ ZEPHIR_INIT_VAR(&name);
+ zephir_fast_strtoupper(&name, &_2);
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 335, &name);
+ zephir_check_call_status();
+ _4 = zephir_is_true(&_3);
+ if (!(_4)) {
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_CONCAT_SV(&_6, "HTTP_", &name);
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "hasserver", NULL, 335, &_6);
+ zephir_check_call_status();
+ _4 = zephir_is_true(&_5);
+ }
+ RETURN_MM_BOOL(_4);
}
-static PHP_METHOD(Phalcon_Forms_Form, setWhitelist)
+static PHP_METHOD(Phalcon_Http_Request, hasPatch)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *whitelist_param = NULL;
- zval whitelist;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, patch;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&whitelist);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&patch);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(whitelist)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &whitelist_param);
- zephir_get_arrval(&whitelist, whitelist_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("whitelist"), &whitelist);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, setUserOption)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *option_param = NULL, *value, value_sub;
- zval option;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&option);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(option)
- Z_PARAM_ZVAL(value)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &option_param, &value);
- zephir_get_strval(&option, option_param);
- zephir_update_property_array(this_ptr, SL("options"), &option, value);
- RETURN_THIS();
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ ZEPHIR_CALL_METHOD(&patch, this_ptr, "getpatch", NULL, 0);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_array_isset(&patch, &name));
}
-static PHP_METHOD(Phalcon_Forms_Form, setUserOptions)
+static PHP_METHOD(Phalcon_Http_Request, hasPost)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *options_param = NULL;
- zval options;
- zval *this_ptr = getThis();
+ zval *name_param = NULL, _POST;
+ zval name;
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_POST);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Forms_Form, valid)
-{
- zval _0, _1;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("elementsIndexed"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("position"), PH_NOISY_CC | PH_READONLY);
- RETURN_BOOL(zephir_array_isset(&_0, &_1));
-}
-
-zend_object *zephir_init_properties_Phalcon_Forms_Form(zend_class_entry *class_type)
-{
- zval _0, _2, _4, _6, _8, _10, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_7$$6);
- ZVAL_UNDEF(&_9$$7);
- ZVAL_UNDEF(&_11$$8);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("whitelist"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("whitelist"), &_1$$3);
- }
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_2) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_3$$4);
- array_init(&_3$$4);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_3$$4);
- }
- zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("elementsIndexed"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_4) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_5$$5);
- array_init(&_5$$5);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("elementsIndexed"), &_5$$5);
- }
- zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_6) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_7$$6);
- array_init(&_7$$6);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("elements"), &_7$$6);
- }
- zephir_read_property_ex(&_8, this_ptr, ZEND_STRL("filteredData"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_8) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_9$$7);
- array_init(&_9$$7);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("filteredData"), &_9$$7);
- }
- zephir_read_property_ex(&_10, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_10) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_11$$8);
- array_init(&_11$$8);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("data"), &_11$$8);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ zephir_get_global(&_POST, SL("_POST"));
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
}
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ RETURN_MM_BOOL(zephir_array_isset(&_POST, &name));
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Manager)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Forms, Manager, phalcon, forms_manager, phalcon_forms_manager_method_entry, 0);
-
- zend_declare_property_null(phalcon_forms_manager_ce, SL("forms"), ZEND_ACC_PROTECTED);
- phalcon_forms_manager_ce->create_object = zephir_init_properties_Phalcon_Forms_Manager;
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Forms_Manager, create)
+static PHP_METHOD(Phalcon_Http_Request, hasPut)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *entity = NULL, entity_sub, __$null, form;
+ zval *name_param = NULL, put;
zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&entity_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&form);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
+ ZVAL_UNDEF(&put);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(entity)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &entity);
- zephir_get_strval(&name, name_param);
- if (!entity) {
- entity = &entity_sub;
- entity = &__$null;
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
}
- ZEPHIR_INIT_VAR(&form);
- object_init_ex(&form, phalcon_forms_form_ce);
- ZEPHIR_CALL_METHOD(NULL, &form, "__construct", NULL, 319, entity);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ ZEPHIR_CALL_METHOD(&put, this_ptr, "getput", NULL, 0);
zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("forms"), &name, &form);
- RETURN_CCTOR(&form);
+ RETURN_MM_BOOL(zephir_array_isset(&put, &name));
}
-static PHP_METHOD(Phalcon_Forms_Manager, get)
+static PHP_METHOD(Phalcon_Http_Request, hasQuery)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, form, _0, _1$$3;
- zval name, _2$$3;
- zval *this_ptr = getThis();
+ zval *name_param = NULL, _GET;
+ zval name;
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&form);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_GET);
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_get_global(&_GET, SL("_GET"));
zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
- zephir_memory_observe(&form);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("forms"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&form, &_0, &name, 0)))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_forms_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "There is no form with name='", &name, "'");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Manager.zep", 46);
- ZEPHIR_MM_RESTORE();
- return;
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
}
- RETURN_CCTOR(&form);
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ RETURN_MM_BOOL(zephir_array_isset(&_GET, &name));
}
-static PHP_METHOD(Phalcon_Forms_Manager, has)
+static PHP_METHOD(Phalcon_Http_Request, hasServer)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, _0;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, server;
zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&server);
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("forms"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &name));
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(zephir_array_isset(&server, &name));
}
-static PHP_METHOD(Phalcon_Forms_Manager, set)
+static PHP_METHOD(Phalcon_Http_Request, isAjax)
{
+ zend_bool _2;
+ zval _0, _1, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL, *form, form_sub;
- zval name;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&form_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OBJECT_OF_CLASS(form, phalcon_forms_form_ce)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &name_param, &form);
- zephir_get_strval(&name, name_param);
- zephir_update_property_array(this_ptr, SL("forms"), &name, form);
- RETURN_THIS();
-}
-
-zend_object *zephir_init_properties_Phalcon_Forms_Manager(zend_class_entry *class_type)
-{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("forms"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("forms"), &_1$$3);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "HTTP_X_REQUESTED_WITH");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1);
+ zephir_check_call_status();
+ _2 = zephir_is_true(&_0);
+ if (_2) {
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "HTTP_X_REQUESTED_WITH");
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "getserver", NULL, 0, &_1);
+ zephir_check_call_status();
+ _2 = ZEPHIR_IS_STRING_IDENTICAL(&_3, "XMLHttpRequest");
}
+ RETURN_MM_BOOL(_2);
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_AbstractElement)
+static PHP_METHOD(Phalcon_Http_Request, isConnect)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Forms\\Element, AbstractElement, phalcon, forms_element_abstractelement, phalcon_forms_element_abstractelement_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("attributes"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("filters"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("form"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("label"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_forms_element_abstractelement_ce, SL("method"), "inputText", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("messages"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("name"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("options"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("tagFactory"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("validators"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_forms_element_abstractelement_ce, SL("value"), ZEND_ACC_PROTECTED);
- phalcon_forms_element_abstractelement_ce->create_object = zephir_init_properties_Phalcon_Forms_Element_AbstractElement;
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zend_class_implements(phalcon_forms_element_abstractelement_ce, 1, phalcon_forms_element_elementinterface_ce);
- return SUCCESS;
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "CONNECT"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, __construct)
+static PHP_METHOD(Phalcon_Http_Request, isDelete)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval attributes;
- zval *name_param = NULL, *attributes_param = NULL, _0, _1;
- zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&attributes);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(attributes)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &attributes_param);
- zephir_get_strval(&name, name_param);
- if (!attributes_param) {
- ZEPHIR_INIT_VAR(&attributes);
- array_init(&attributes);
- } else {
- zephir_get_arrval(&attributes, attributes_param);
- }
- ZEPHIR_INIT_VAR(&_0);
- zephir_fast_trim(&_0, &name, NULL , ZEPHIR_TRIM_BOTH);
- zephir_get_strval(&name, &_0);
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&name))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Form element name is required", "phalcon/Forms/Element/AbstractElement.zep", 97);
- return;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
- ZEPHIR_INIT_VAR(&_1);
- object_init_ex(&_1, phalcon_messages_messages_ce);
- ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 8);
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &_1);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "DELETE"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, __toString)
+static PHP_METHOD(Phalcon_Http_Request, isGet)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "render", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "GET"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, addFilter)
+static PHP_METHOD(Phalcon_Http_Request, isHead)
{
- zval _1$$5, _2$$6;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *filter_param = NULL, filters, _0;
- zval filter;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&filter);
- ZVAL_UNDEF(&filters);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$5);
- ZVAL_UNDEF(&_2$$6);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filter)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filter_param);
- zephir_get_strval(&filter, filter_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("filters"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&filters, &_0);
- if (Z_TYPE_P(&filters) == IS_ARRAY) {
- zephir_update_property_array_append(this_ptr, SL("filters"), &filter);
- } else {
- if (Z_TYPE_P(&filters) == IS_STRING) {
- ZEPHIR_INIT_VAR(&_1$$5);
- zephir_create_array(&_1$$5, 2, 0);
- zephir_array_fast_append(&_1$$5, &filters);
- zephir_array_fast_append(&_1$$5, &filter);
- zephir_update_property_zval(this_ptr, ZEND_STRL("filters"), &_1$$5);
- } else {
- ZEPHIR_INIT_VAR(&_2$$6);
- zephir_create_array(&_2$$6, 1, 0);
- zephir_array_fast_append(&_2$$6, &filter);
- zephir_update_property_zval(this_ptr, ZEND_STRL("filters"), &_2$$6);
- }
- }
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, addValidator)
-{
- zval *validator, validator_sub;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&validator_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(validator, phalcon_filter_validation_validatorinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &validator);
- zephir_update_property_array_append(this_ptr, SL("validators"), validator);
- RETURN_THISW();
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "HEAD"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, addValidators)
+static PHP_METHOD(Phalcon_Http_Request, isMethod)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_3 = NULL;
+ zephir_fcall_cache_entry *_8 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool merge;
- zval *validators_param = NULL, *merge_param = NULL, validator, *_1, _2, _0$$3;
- zval validators;
+ zend_bool strict, _0$$3;
+ zval *methods, methods_sub, *strict_param = NULL, httpMethod, method, _1$$3, _2$$4, _3$$4, *_4$$5, _5$$5, _6$$6, _7$$6, _9$$8, _10$$8;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&validators);
- ZVAL_UNDEF(&validator);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&methods_sub);
+ ZVAL_UNDEF(&httpMethod);
+ ZVAL_UNDEF(&method);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_UNDEF(&_10$$8);
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(validators)
+ Z_PARAM_ZVAL(methods)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(merge)
+ Z_PARAM_BOOL(strict)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &validators_param, &merge_param);
- ZEPHIR_OBS_COPY_OR_DUP(&validators, validators_param);
- if (!merge_param) {
- merge = 1;
+ zephir_fetch_params(1, 1, 1, &methods, &strict_param);
+ if (!strict_param) {
+ strict = 0;
} else {
}
- if (UNEXPECTED(!merge)) {
- ZEPHIR_INIT_VAR(&_0$$3);
- array_init(&_0$$3);
- zephir_update_property_zval(this_ptr, ZEND_STRL("validators"), &_0$$3);
- }
- zephir_is_iterable(&validators, 0, "phalcon/Forms/Element/AbstractElement.zep", 163);
- if (Z_TYPE_P(&validators) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _1)
- {
- ZEPHIR_INIT_NVAR(&validator);
- ZVAL_COPY(&validator, _1);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "addvalidator", &_3, 0, &validator);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_2, &validators, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&httpMethod, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ if (Z_TYPE_P(methods) == IS_STRING) {
+ _0$$3 = strict;
+ if (_0$$3) {
+ ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "isvalidhttpmethod", NULL, 0, methods);
zephir_check_call_status();
- if (!zend_is_true(&_2)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0);
+ _0$$3 = !zephir_is_true(&_1$$3);
+ }
+ if (UNEXPECTED(_0$$3)) {
+ ZEPHIR_INIT_VAR(&_2$$4);
+ object_init_ex(&_2$$4, phalcon_http_request_exception_ce);
+ ZEPHIR_INIT_VAR(&_3$$4);
+ ZEPHIR_CONCAT_SV(&_3$$4, "Invalid HTTP method: ", methods);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 33, &_3$$4);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "addvalidator", &_3, 0, &validator);
+ zephir_throw_exception_debug(&_2$$4, "phalcon/Http/Request.zep", 1117);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(methods, &httpMethod));
+ }
+ if (Z_TYPE_P(methods) == IS_ARRAY) {
+ zephir_is_iterable(methods, 0, "phalcon/Http/Request.zep", 1130);
+ if (Z_TYPE_P(methods) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(methods), _4$$5)
+ {
+ ZEPHIR_INIT_NVAR(&method);
+ ZVAL_COPY(&method, _4$$5);
+ if (strict) {
+ ZVAL_BOOL(&_7$$6, 1);
+ } else {
+ ZVAL_BOOL(&_7$$6, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "ismethod", &_8, 345, &method, &_7$$6);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0);
+ if (zephir_is_true(&_6$$6)) {
+ RETURN_MM_BOOL(1);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, methods, "rewind", NULL, 0);
zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5$$5, methods, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&method, methods, "current", NULL, 0);
+ zephir_check_call_status();
+ if (strict) {
+ ZVAL_BOOL(&_10$$8, 1);
+ } else {
+ ZVAL_BOOL(&_10$$8, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_9$$8, this_ptr, "ismethod", &_8, 345, &method, &_10$$8);
+ zephir_check_call_status();
+ if (zephir_is_true(&_9$$8)) {
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_CALL_METHOD(NULL, methods, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
+ ZEPHIR_INIT_NVAR(&method);
+ RETURN_MM_BOOL(0);
}
- ZEPHIR_INIT_NVAR(&validator);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, appendMessage)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *message, message_sub, _0;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&message_sub);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(message, phalcon_messages_messageinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &message);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "appendmessage", NULL, 0, message);
- zephir_check_call_status();
- RETURN_THIS();
+ if (UNEXPECTED(strict)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_request_exception_ce, "Invalid HTTP method: non-string", "phalcon/Http/Request.zep", 1134);
+ return;
+ }
+ RETURN_MM_BOOL(0);
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, clear)
+static PHP_METHOD(Phalcon_Http_Request, isOptions)
{
- zval form, _0, name;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&form);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&name);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&form, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&name, &_0);
- if (Z_TYPE_P(&form) == IS_OBJECT) {
- ZEPHIR_CALL_METHOD(NULL, &form, "clear", NULL, 0, &name);
- zephir_check_call_status();
- }
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "OPTIONS"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getAttribute)
+static PHP_METHOD(Phalcon_Http_Request, isPatch)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *attribute_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, attributes, value, _0;
- zval attribute;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&attribute);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&attributes);
- ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(attribute)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &attribute_param, &defaultValue);
- zephir_get_strval(&attribute, attribute_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&attributes, &_0);
- zephir_memory_observe(&value);
- if (!(zephir_array_isset_fetch(&value, &attributes, &attribute, 0))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- RETURN_CCTOR(&value);
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PATCH"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getAttributes)
+static PHP_METHOD(Phalcon_Http_Request, isPost)
{
- zval attributes, _0;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&attributes);
ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&attributes, &_0);
- RETURN_CCTOR(&attributes);
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getDefault)
-{
-
- RETURN_MEMBER(getThis(), "value");
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getFilters)
-{
-
- RETURN_MEMBER(getThis(), "filters");
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getForm)
-{
-
- RETURN_MEMBER(getThis(), "form");
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getLabel)
-{
-
- RETURN_MEMBER(getThis(), "label");
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getMessages)
-{
-
- RETURN_MEMBER(getThis(), "messages");
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getName)
-{
-
- RETURN_MEMBER(getThis(), "name");
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getTagFactory)
-{
-
- RETURN_MEMBER(getThis(), "tagFactory");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "POST"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getUserOption)
+static PHP_METHOD(Phalcon_Http_Request, isPut)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *option_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0;
- zval option;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&option);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(option)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &option_param, &defaultValue);
- zephir_get_strval(&option, option_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- zephir_memory_observe(&value);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&value, &_0, &option, 0))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- RETURN_CCTOR(&value);
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getUserOptions)
-{
-
- RETURN_MEMBER(getThis(), "options");
-}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getValidators)
-{
-
- RETURN_MEMBER(getThis(), "validators");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PUT"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getValue)
+static PHP_METHOD(Phalcon_Http_Request, isPurge)
{
- zval name, _0, form, value, _1$$4;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&form);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1$$4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&name, &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&form, &_0);
- ZEPHIR_INIT_VAR(&value);
- ZVAL_NULL(&value);
- if (Z_TYPE_P(&form) == IS_OBJECT) {
- ZEPHIR_RETURN_CALL_METHOD(&form, "getvalue", NULL, 0, &name);
- zephir_check_call_status();
- RETURN_MM();
- }
- if (Z_TYPE_P(&value) == IS_NULL) {
- zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("value"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&value, &_1$$4);
- }
- RETURN_CCTOR(&value);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PURGE"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, hasMessages)
+static PHP_METHOD(Phalcon_Http_Request, isSecure)
{
zval _0;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY);
- RETURN_BOOL(zephir_fast_count_int(&_0) > 0);
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, label)
-{
- zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *attributes_param = NULL, code, internalAttributes, labelName, name, tagFactory, _0$$3;
- zval attributes;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&attributes);
- ZVAL_UNDEF(&code);
- ZVAL_UNDEF(&internalAttributes);
- ZVAL_UNDEF(&labelName);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&tagFactory);
- ZVAL_UNDEF(&_0$$3);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(attributes)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- 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(&tagFactory, this_ptr, "getlocaltagfactory", NULL, 0);
- zephir_check_call_status();
- zephir_memory_observe(&internalAttributes);
- zephir_read_property(&internalAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
- zephir_memory_observe(&name);
- if (!(zephir_array_isset_string_fetch(&name, &internalAttributes, SL("id"), 0))) {
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&name, &_0$$3);
- }
- if (!(zephir_array_isset_string(&attributes, SL("for")))) {
- zephir_array_update_string(&attributes, SL("for"), &name, PH_COPY | PH_SEPARATE);
- }
- zephir_memory_observe(&labelName);
- zephir_read_property(&labelName, this_ptr, ZEND_STRL("label"), PH_NOISY_CC);
- _1 = zephir_is_true(&labelName);
- if (!(_1)) {
- _1 = zephir_is_numeric(&labelName);
- }
- if (!(_1)) {
- ZEPHIR_CPY_WRT(&labelName, &name);
- }
- ZEPHIR_CALL_METHOD(&code, &tagFactory, "label", NULL, 0, &labelName, &attributes);
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getscheme", NULL, 0);
zephir_check_call_status();
- RETURN_CCTOR(&code);
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "https"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, render)
+static PHP_METHOD(Phalcon_Http_Request, isStrictHostCheck)
{
- zval _1;
+
+ RETURN_MEMBER(getThis(), "strictHostCheck");
+}
+
+static PHP_METHOD(Phalcon_Http_Request, isSoap)
+{
+ zval contentType, _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *attributes_param = NULL, helper, merged, method, name, result, tagFactory, value, _0;
- zval attributes;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&attributes);
- ZVAL_UNDEF(&helper);
- ZVAL_UNDEF(&merged);
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&result);
- ZVAL_UNDEF(&tagFactory);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&contentType);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(attributes)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- 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_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&name, &_0);
- ZEPHIR_CALL_METHOD(&value, this_ptr, "getvalue", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("method"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&method, &_0);
- ZEPHIR_CALL_METHOD(&tagFactory, this_ptr, "getlocaltagfactory", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&helper, &tagFactory, "newinstance", NULL, 0, &method);
+
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "HTTP_SOAPACTION");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1);
zephir_check_call_status();
- if (zephir_array_isset_string(&attributes, SL("value"))) {
- ZEPHIR_OBS_NVAR(&value);
- zephir_array_fetch_string(&value, &attributes, SL("value"), PH_NOISY, "phalcon/Forms/Element/AbstractElement.zep", 391);
- zephir_array_unset_string(&attributes, SL("value"), PH_SEPARATE);
+ if (zephir_is_true(&_0)) {
+ RETURN_MM_BOOL(1);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&merged);
- zephir_fast_array_merge(&merged, &_0, &attributes);
- ZEPHIR_CALL_METHOD(&result, &helper, "__invoke", NULL, 0, &name, &value, &merged);
+ ZEPHIR_CALL_METHOD(&contentType, this_ptr, "getcontenttype", NULL, 0);
zephir_check_call_status();
- zephir_cast_to_string(&_1, &result);
- RETURN_CTOR(&_1);
+ if (ZEPHIR_IS_EMPTY(&contentType)) {
+ RETURN_MM_BOOL(0);
+ }
+ RETURN_MM_BOOL(zephir_memnstr_str(&contentType, SL("application/soap+xml"), "phalcon/Http/Request.zep", 1219));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setAttribute)
+static PHP_METHOD(Phalcon_Http_Request, isTrace)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *attribute_param = NULL, *value, value_sub;
- zval attribute;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&attribute);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(attribute)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &attribute_param, &value);
- zephir_get_strval(&attribute, attribute_param);
- zephir_update_property_array(this_ptr, SL("attributes"), &attribute, value);
- RETURN_THIS();
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 344);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "TRACE"));
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setAttributes)
+static PHP_METHOD(Phalcon_Http_Request, isValidHttpMethod)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *attributes_param = NULL;
- zval attributes;
- zval *this_ptr = getThis();
+ zval *method_param = NULL, _0;
+ zval method;
- ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&method);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR(method)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &attributes_param);
- ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &attributes);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setDefault)
-{
- zval *value, value_sub;
- zval *this_ptr = getThis();
+ zephir_fetch_params(1, 1, 0, &method_param);
+ zephir_get_strval(&method, method_param);
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_strtoupper(&_0, &method);
+ do {
+ if (ZEPHIR_IS_STRING(&_0, "CONNECT") || ZEPHIR_IS_STRING(&_0, "DELETE") || ZEPHIR_IS_STRING(&_0, "GET") || ZEPHIR_IS_STRING(&_0, "HEAD") || ZEPHIR_IS_STRING(&_0, "OPTIONS") || ZEPHIR_IS_STRING(&_0, "PATCH") || ZEPHIR_IS_STRING(&_0, "POST") || ZEPHIR_IS_STRING(&_0, "PURGE") || ZEPHIR_IS_STRING(&_0, "PUT") || ZEPHIR_IS_STRING(&_0, "TRACE")) {
+ RETURN_MM_BOOL(1);
+ }
+ } while(0);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &value);
- zephir_update_property_zval(this_ptr, ZEND_STRL("value"), value);
- RETURN_THISW();
+ RETURN_MM_BOOL(0);
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setFilters)
+static PHP_METHOD(Phalcon_Http_Request, numFiles)
{
- zend_bool _0;
- zval *filters, filters_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, numberFiles;
+ zval *onlySuccessful_param = NULL, _FILES, files, file, error, *_0, _1, _3$$8, _4$$8, _7$$13, _8$$13;
+ zend_bool onlySuccessful, _2$$6, _6$$11;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&filters_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(filters)
+ ZVAL_UNDEF(&_FILES);
+ ZVAL_UNDEF(&files);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&error);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3$$8);
+ ZVAL_UNDEF(&_4$$8);
+ ZVAL_UNDEF(&_7$$13);
+ ZVAL_UNDEF(&_8$$13);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(onlySuccessful)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &filters);
- _0 = Z_TYPE_P(filters) != IS_STRING;
- if (_0) {
- _0 = Z_TYPE_P(filters) != IS_ARRAY;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_get_global(&_FILES, SL("_FILES"));
+ zephir_fetch_params(1, 0, 1, &onlySuccessful_param);
+ if (!onlySuccessful_param) {
+ onlySuccessful = 0;
+ } else {
+ }
+ numberFiles = 0;
+ ZEPHIR_CPY_WRT(&files, &_FILES);
+ if (Z_TYPE_P(&files) != IS_ARRAY) {
+ RETURN_MM_LONG(0);
}
- if (UNEXPECTED(_0)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_forms_exception_ce, "The filter needs to be an array or string", "phalcon/Forms/Element/AbstractElement.zep", 440);
- return;
+ zephir_is_iterable(&files, 0, "phalcon/Http/Request.zep", 1284);
+ if (Z_TYPE_P(&files) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&files), _0)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _0);
+ ZEPHIR_OBS_NVAR(&error);
+ if (zephir_array_isset_string_fetch(&error, &file, SL("error"), 0)) {
+ if (Z_TYPE_P(&error) != IS_ARRAY) {
+ _2$$6 = !zephir_is_true(&error);
+ if (!(_2$$6)) {
+ _2$$6 = !onlySuccessful;
+ }
+ if (_2$$6) {
+ numberFiles++;
+ }
+ }
+ if (Z_TYPE_P(&error) == IS_ARRAY) {
+ if (onlySuccessful) {
+ ZVAL_BOOL(&_4$$8, 1);
+ } else {
+ ZVAL_BOOL(&_4$$8, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "hasfilehelper", &_5, 346, &error, &_4$$8);
+ zephir_check_call_status();
+ numberFiles += zephir_get_numberval(&_3$$8);
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &files, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &files, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &files, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&error);
+ if (zephir_array_isset_string_fetch(&error, &file, SL("error"), 0)) {
+ if (Z_TYPE_P(&error) != IS_ARRAY) {
+ _6$$11 = !zephir_is_true(&error);
+ if (!(_6$$11)) {
+ _6$$11 = !onlySuccessful;
+ }
+ if (_6$$11) {
+ numberFiles++;
+ }
+ }
+ if (Z_TYPE_P(&error) == IS_ARRAY) {
+ if (onlySuccessful) {
+ ZVAL_BOOL(&_8$$13, 1);
+ } else {
+ ZVAL_BOOL(&_8$$13, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "hasfilehelper", &_5, 346, &error, &_8$$13);
+ zephir_check_call_status();
+ numberFiles += zephir_get_numberval(&_7$$13);
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &files, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("filters"), filters);
- RETURN_THISW();
+ ZEPHIR_INIT_NVAR(&file);
+ RETURN_MM_LONG(numberFiles);
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setForm)
+static PHP_METHOD(Phalcon_Http_Request, setHttpMethodParameterOverride)
{
- zval *form, form_sub;
+ zval *override_param = NULL, __$true, __$false;
+ zend_bool override;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&form_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(form, phalcon_forms_form_ce)
+ Z_PARAM_BOOL(override)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &form);
- zephir_update_property_zval(this_ptr, ZEND_STRL("form"), form);
+ zephir_fetch_params_without_memory_grow(1, 0, &override_param);
+ if (override) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("httpMethodParameterOverride"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("httpMethodParameterOverride"), &__$false);
+ }
RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setLabel)
+static PHP_METHOD(Phalcon_Http_Request, setParameterFilters)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *label_param = NULL;
- zval label;
+ zephir_fcall_cache_entry *_5 = NULL, *_9 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval filters, scope;
+ zval *name_param = NULL, *filters_param = NULL, *scope_param = NULL, filterService, sanitizer, localScope, scopeMethod, *_2, _3, *_13, _14, _0$$3, _4$$4, _6$$5, _7$$5, _8$$6, _10$$7, _11$$7, _12$$8, _15$$10, _16$$11;
+ zval name, _1$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&label);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(label)
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&filterService);
+ ZVAL_UNDEF(&sanitizer);
+ ZVAL_UNDEF(&localScope);
+ ZVAL_UNDEF(&scopeMethod);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_10$$7);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_12$$8);
+ ZVAL_UNDEF(&_15$$10);
+ ZVAL_UNDEF(&_16$$11);
+ ZVAL_UNDEF(&filters);
+ ZVAL_UNDEF(&scope);
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(filters)
+ Z_PARAM_ARRAY(scope)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &label_param);
- zephir_get_strval(&label, label_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("label"), &label);
+ zephir_fetch_params(1, 1, 2, &name_param, &filters_param, &scope_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ if (!filters_param) {
+ ZEPHIR_INIT_VAR(&filters);
+ array_init(&filters);
+ } else {
+ zephir_get_arrval(&filters, filters_param);
+ }
+ if (!scope_param) {
+ ZEPHIR_INIT_VAR(&scope);
+ array_init(&scope);
+ } else {
+ zephir_get_arrval(&scope, scope_param);
+ }
+ if (UNEXPECTED(zephir_fast_count_int(&filters) < 1)) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ object_init_ex(&_0$$3, phalcon_http_request_exception_ce);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZEPHIR_CONCAT_SVS(&_1$$3, "Filters have not been defined for '", &name, "'");
+ ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 33, &_1$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_0$$3, "phalcon/Http/Request.zep", 1315);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 347);
+ zephir_check_call_status();
+ zephir_is_iterable(&filters, 0, "phalcon/Http/Request.zep", 1328);
+ if (Z_TYPE_P(&filters) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _2)
+ {
+ ZEPHIR_INIT_NVAR(&sanitizer);
+ ZVAL_COPY(&sanitizer, _2);
+ ZEPHIR_CALL_METHOD(&_4$$4, &filterService, "has", &_5, 0, &sanitizer);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_4$$4))) {
+ ZEPHIR_INIT_NVAR(&_6$$5);
+ object_init_ex(&_6$$5, phalcon_http_request_exception_ce);
+ ZEPHIR_INIT_NVAR(&_7$$5);
+ ZEPHIR_CONCAT_SVS(&_7$$5, "Sanitizer '", &sanitizer, "' does not exist in the filter locator");
+ ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 33, &_7$$5);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_6$$5, "phalcon/Http/Request.zep", 1324);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &filters, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, &filters, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&sanitizer, &filters, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8$$6, &filterService, "has", &_9, 0, &sanitizer);
+ zephir_check_call_status();
+ if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_8$$6))) {
+ ZEPHIR_INIT_NVAR(&_10$$7);
+ object_init_ex(&_10$$7, phalcon_http_request_exception_ce);
+ ZEPHIR_INIT_NVAR(&_11$$7);
+ ZEPHIR_CONCAT_SVS(&_11$$7, "Sanitizer '", &sanitizer, "' does not exist in the filter locator");
+ ZEPHIR_CALL_METHOD(NULL, &_10$$7, "__construct", NULL, 33, &_11$$7);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_10$$7, "phalcon/Http/Request.zep", 1324);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_CALL_METHOD(NULL, &filters, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&sanitizer);
+ if (zephir_fast_count_int(&scope) < 1) {
+ ZEPHIR_INIT_VAR(&localScope);
+ zephir_create_array(&localScope, 4, 0);
+ ZEPHIR_INIT_VAR(&_12$$8);
+ ZVAL_STRING(&_12$$8, "GET");
+ zephir_array_fast_append(&localScope, &_12$$8);
+ ZEPHIR_INIT_NVAR(&_12$$8);
+ ZVAL_STRING(&_12$$8, "PATCH");
+ zephir_array_fast_append(&localScope, &_12$$8);
+ ZEPHIR_INIT_NVAR(&_12$$8);
+ ZVAL_STRING(&_12$$8, "POST");
+ zephir_array_fast_append(&localScope, &_12$$8);
+ ZEPHIR_INIT_NVAR(&_12$$8);
+ ZVAL_STRING(&_12$$8, "PUT");
+ zephir_array_fast_append(&localScope, &_12$$8);
+ } else {
+ ZEPHIR_CPY_WRT(&localScope, &scope);
+ }
+ zephir_is_iterable(&localScope, 0, "phalcon/Http/Request.zep", 1343);
+ if (Z_TYPE_P(&localScope) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&localScope), _13)
+ {
+ ZEPHIR_INIT_NVAR(&scopeMethod);
+ ZVAL_COPY(&scopeMethod, _13);
+ ZEPHIR_INIT_NVAR(&_15$$10);
+ zephir_fast_strtoupper(&_15$$10, &scopeMethod);
+ zephir_update_property_array_multi(this_ptr, SL("queryFilters"), &filters, SL("zz"), 2, &_15$$10, &name);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &localScope, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_14, &localScope, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_14)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&scopeMethod, &localScope, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_16$$11);
+ zephir_fast_strtoupper(&_16$$11, &scopeMethod);
+ zephir_update_property_array_multi(this_ptr, SL("queryFilters"), &filters, SL("zz"), 2, &_16$$11, &name);
+ ZEPHIR_CALL_METHOD(NULL, &localScope, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&scopeMethod);
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setMessages)
+static PHP_METHOD(Phalcon_Http_Request, setStrictHostCheck)
{
- zval *messages, messages_sub;
+ zval *flag_param = NULL, __$true, __$false;
+ zend_bool flag;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&messages_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(messages, phalcon_messages_messages_ce)
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(flag)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &messages);
- zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), messages);
+ zephir_fetch_params_without_memory_grow(0, 1, &flag_param);
+ if (!flag_param) {
+ flag = 1;
+ } else {
+ }
+ if (flag) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("strictHostCheck"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("strictHostCheck"), &__$false);
+ }
RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setName)
+static PHP_METHOD(Phalcon_Http_Request, getBestQuality)
{
+ double quality = 0, acceptQuality = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, i = 0;
zval name;
- zval *this_ptr = getThis();
+ zval *qualityParts_param = NULL, *name_param = NULL, selectedName, accept, *_0, _1, _2$$4, _3$$5, _4$$8, _5$$9;
+ zval qualityParts;
+ ZVAL_UNDEF(&qualityParts);
+ ZVAL_UNDEF(&selectedName);
+ ZVAL_UNDEF(&accept);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$8);
+ ZVAL_UNDEF(&_5$$9);
ZVAL_UNDEF(&name);
- ZEND_PARSE_PARAMETERS_START(1, 1)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ARRAY(qualityParts)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_fetch_params(1, 2, 0, &qualityParts_param, &name_param);
+ zephir_get_arrval(&qualityParts, qualityParts_param);
if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
RETURN_MM_NULL();
@@ -160061,626 +155290,2049 @@ static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setName)
} else {
ZEPHIR_INIT_VAR(&name);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- RETURN_THIS();
+ i = 0;
+ quality = (0.0);
+ ZEPHIR_INIT_VAR(&selectedName);
+ ZVAL_STRING(&selectedName, "");
+ zephir_is_iterable(&qualityParts, 0, "phalcon/Http/Request.zep", 1386);
+ if (Z_TYPE_P(&qualityParts) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&qualityParts), _0)
+ {
+ ZEPHIR_INIT_NVAR(&accept);
+ ZVAL_COPY(&accept, _0);
+ if (i == 0) {
+ ZEPHIR_OBS_NVAR(&_2$$4);
+ zephir_array_fetch_string(&_2$$4, &accept, SL("quality"), PH_NOISY, "phalcon/Http/Request.zep", 1372);
+ quality = (zephir_get_doubleval(&_2$$4));
+ ZEPHIR_OBS_NVAR(&selectedName);
+ zephir_array_fetch(&selectedName, &accept, &name, PH_NOISY, "phalcon/Http/Request.zep", 1373);
+ } else {
+ ZEPHIR_OBS_NVAR(&_3$$5);
+ zephir_array_fetch_string(&_3$$5, &accept, SL("quality"), PH_NOISY, "phalcon/Http/Request.zep", 1375);
+ acceptQuality = (zephir_get_doubleval(&_3$$5));
+ if (acceptQuality > quality) {
+ quality = acceptQuality;
+ ZEPHIR_OBS_NVAR(&selectedName);
+ zephir_array_fetch(&selectedName, &accept, &name, PH_NOISY, "phalcon/Http/Request.zep", 1379);
+ }
+ }
+ i++;
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &qualityParts, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &qualityParts, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&accept, &qualityParts, "current", NULL, 0);
+ zephir_check_call_status();
+ if (i == 0) {
+ ZEPHIR_OBS_NVAR(&_4$$8);
+ zephir_array_fetch_string(&_4$$8, &accept, SL("quality"), PH_NOISY, "phalcon/Http/Request.zep", 1372);
+ quality = (zephir_get_doubleval(&_4$$8));
+ ZEPHIR_OBS_NVAR(&selectedName);
+ zephir_array_fetch(&selectedName, &accept, &name, PH_NOISY, "phalcon/Http/Request.zep", 1373);
+ } else {
+ ZEPHIR_OBS_NVAR(&_5$$9);
+ zephir_array_fetch_string(&_5$$9, &accept, SL("quality"), PH_NOISY, "phalcon/Http/Request.zep", 1375);
+ acceptQuality = (zephir_get_doubleval(&_5$$9));
+ if (acceptQuality > quality) {
+ quality = acceptQuality;
+ ZEPHIR_OBS_NVAR(&selectedName);
+ zephir_array_fetch(&selectedName, &accept, &name, PH_NOISY, "phalcon/Http/Request.zep", 1379);
+ }
+ }
+ i++;
+ ZEPHIR_CALL_METHOD(NULL, &qualityParts, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&accept);
+ RETURN_CCTOR(&selectedName);
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setTagFactory)
+static PHP_METHOD(Phalcon_Http_Request, getHelper)
{
- zval *tagFactory, tagFactory_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool notAllowEmpty, noRecursive, _0, _1;
+ zval name;
+ zval *source_param = NULL, *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, value, filterService, _2$$6, _3$$6;
+ zval source;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&tagFactory_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(tagFactory, phalcon_html_tagfactory_ce)
+ ZVAL_UNDEF(&source);
+ ZVAL_UNDEF(&filters_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&filterService);
+ ZVAL_UNDEF(&_2$$6);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&name);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 6)
+ Z_PARAM_ARRAY(source)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(filters)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &tagFactory);
- zephir_update_property_zval(this_ptr, ZEND_STRL("tagFactory"), tagFactory);
- RETURN_THISW();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 5, &source_param, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ zephir_get_arrval(&source, source_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ }
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
+ }
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ if (ZEPHIR_IS_NULL(&name)) {
+ RETURN_CTOR(&source);
+ }
+ zephir_memory_observe(&value);
+ if (!(zephir_array_isset_fetch(&value, &source, &name, 0))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ _0 = !(zephir_is_numeric(&value));
+ if (_0) {
+ _0 = ZEPHIR_IS_EMPTY(&value);
+ }
+ _1 = _0;
+ if (_1) {
+ _1 = notAllowEmpty;
+ }
+ if (_1) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ if (Z_TYPE_P(filters) != IS_NULL) {
+ ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 347);
+ zephir_check_call_status();
+ if (noRecursive) {
+ ZVAL_BOOL(&_3$$6, 1);
+ } else {
+ ZVAL_BOOL(&_3$$6, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_2$$6, &filterService, "sanitize", NULL, 0, &value, filters, &_3$$6);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&value, &_2$$6);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&value)) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ }
+ RETURN_CCTOR(&value);
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setUserOption)
+static PHP_METHOD(Phalcon_Http_Request, hasFileHelper)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *option_param = NULL, *value, value_sub;
- zval option;
+ zephir_fcall_cache_entry *_5 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, numberFiles;
+ zend_bool onlySuccessful, _2$$5, _6$$9;
+ zval *data, data_sub, *onlySuccessful_param = NULL, value, *_0, _1, _3$$7, _4$$7, _7$$11, _8$$11;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&option);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3$$7);
+ ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_7$$11);
+ ZVAL_UNDEF(&_8$$11);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(option)
- Z_PARAM_ZVAL(value)
+ Z_PARAM_ZVAL(data)
+ Z_PARAM_BOOL(onlySuccessful)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &option_param, &value);
- zephir_get_strval(&option, option_param);
- zephir_update_property_array(this_ptr, SL("options"), &option, value);
- RETURN_THIS();
+ zephir_fetch_params(1, 2, 0, &data, &onlySuccessful_param);
+ numberFiles = 0;
+ if (Z_TYPE_P(data) != IS_ARRAY) {
+ RETURN_MM_LONG(1);
+ }
+ zephir_is_iterable(data, 0, "phalcon/Http/Request.zep", 1455);
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(data), _0)
+ {
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0);
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ _2$$5 = !zephir_is_true(&value);
+ if (!(_2$$5)) {
+ _2$$5 = !onlySuccessful;
+ }
+ if (_2$$5) {
+ numberFiles++;
+ }
+ }
+ if (Z_TYPE_P(&value) == IS_ARRAY) {
+ if (onlySuccessful) {
+ ZVAL_BOOL(&_4$$7, 1);
+ } else {
+ ZVAL_BOOL(&_4$$7, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "hasfilehelper", &_5, 346, &value, &_4$$7);
+ zephir_check_call_status();
+ numberFiles += zephir_get_numberval(&_3$$7);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, data, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, data, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&value, data, "current", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&value) != IS_ARRAY) {
+ _6$$9 = !zephir_is_true(&value);
+ if (!(_6$$9)) {
+ _6$$9 = !onlySuccessful;
+ }
+ if (_6$$9) {
+ numberFiles++;
+ }
+ }
+ if (Z_TYPE_P(&value) == IS_ARRAY) {
+ if (onlySuccessful) {
+ ZVAL_BOOL(&_8$$11, 1);
+ } else {
+ ZVAL_BOOL(&_8$$11, 0);
+ }
+ ZEPHIR_CALL_METHOD(&_7$$11, this_ptr, "hasfilehelper", &_5, 346, &value, &_8$$11);
+ zephir_check_call_status();
+ numberFiles += zephir_get_numberval(&_7$$11);
+ }
+ ZEPHIR_CALL_METHOD(NULL, data, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ RETURN_MM_LONG(numberFiles);
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, setUserOptions)
+static PHP_METHOD(Phalcon_Http_Request, getQualityHeader)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *options_param = NULL;
- zval options;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *serverIndex_param = NULL, *name_param = NULL, headerPart, headerParts, headerSplit, part, parts, returnedParts, serverValue, split, _0, _1, _2, _3, *_4, _5, _6$$3, _7$$3, _8$$3, _9$$3, *_10$$3, _11$$3, _12$$4, _13$$4, _14$$5, _15$$6, _16$$6, _17$$7, _18$$7, _19$$8, _20$$9, _21$$9, _22$$10, _23$$11, _24$$11, _25$$12, _26$$12, _27$$13, _28$$14, _29$$14, _30$$14, _31$$14, *_32$$14, _33$$14, _34$$15, _35$$15, _36$$16, _37$$17, _38$$17, _39$$18, _40$$18, _41$$19, _42$$20, _43$$20, _44$$21, _45$$22, _46$$22, _47$$23, _48$$23, _49$$24;
+ zval serverIndex, name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
+ ZVAL_UNDEF(&serverIndex);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&headerPart);
+ ZVAL_UNDEF(&headerParts);
+ ZVAL_UNDEF(&headerSplit);
+ ZVAL_UNDEF(&part);
+ ZVAL_UNDEF(&parts);
+ ZVAL_UNDEF(&returnedParts);
+ ZVAL_UNDEF(&serverValue);
+ ZVAL_UNDEF(&split);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_12$$4);
+ ZVAL_UNDEF(&_13$$4);
+ ZVAL_UNDEF(&_14$$5);
+ ZVAL_UNDEF(&_15$$6);
+ ZVAL_UNDEF(&_16$$6);
+ ZVAL_UNDEF(&_17$$7);
+ ZVAL_UNDEF(&_18$$7);
+ ZVAL_UNDEF(&_19$$8);
+ ZVAL_UNDEF(&_20$$9);
+ ZVAL_UNDEF(&_21$$9);
+ ZVAL_UNDEF(&_22$$10);
+ ZVAL_UNDEF(&_23$$11);
+ ZVAL_UNDEF(&_24$$11);
+ ZVAL_UNDEF(&_25$$12);
+ ZVAL_UNDEF(&_26$$12);
+ ZVAL_UNDEF(&_27$$13);
+ ZVAL_UNDEF(&_28$$14);
+ ZVAL_UNDEF(&_29$$14);
+ ZVAL_UNDEF(&_30$$14);
+ ZVAL_UNDEF(&_31$$14);
+ ZVAL_UNDEF(&_33$$14);
+ ZVAL_UNDEF(&_34$$15);
+ ZVAL_UNDEF(&_35$$15);
+ ZVAL_UNDEF(&_36$$16);
+ ZVAL_UNDEF(&_37$$17);
+ ZVAL_UNDEF(&_38$$17);
+ ZVAL_UNDEF(&_39$$18);
+ ZVAL_UNDEF(&_40$$18);
+ ZVAL_UNDEF(&_41$$19);
+ ZVAL_UNDEF(&_42$$20);
+ ZVAL_UNDEF(&_43$$20);
+ ZVAL_UNDEF(&_44$$21);
+ ZVAL_UNDEF(&_45$$22);
+ ZVAL_UNDEF(&_46$$22);
+ ZVAL_UNDEF(&_47$$23);
+ ZVAL_UNDEF(&_48$$23);
+ ZVAL_UNDEF(&_49$$24);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(serverIndex)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &options_param);
- zephir_get_arrval(&options, options_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- RETURN_THIS();
+ zephir_fetch_params(1, 2, 0, &serverIndex_param, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(serverIndex_param) != IS_STRING && Z_TYPE_P(serverIndex_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serverIndex' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(serverIndex_param) == IS_STRING)) {
+ zephir_get_strval(&serverIndex, serverIndex_param);
+ } else {
+ ZEPHIR_INIT_VAR(&serverIndex);
+ }
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ ZEPHIR_INIT_VAR(&returnedParts);
+ array_init(&returnedParts);
+ ZEPHIR_CALL_METHOD(&serverValue, this_ptr, "getserver", NULL, 0, &serverIndex);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ if (Z_TYPE_P(&serverValue) == IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "");
+ } else {
+ ZEPHIR_CPY_WRT(&_0, &serverValue);
+ }
+ ZEPHIR_CPY_WRT(&serverValue, &_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "/,\\s*/");
+ ZVAL_LONG(&_2, -1);
+ ZVAL_LONG(&_3, 1);
+ ZEPHIR_CALL_FUNCTION(&parts, "preg_split", NULL, 70, &_1, &serverValue, &_2, &_3);
+ zephir_check_call_status();
+ zephir_is_iterable(&parts, 0, "phalcon/Http/Request.zep", 1499);
+ if (Z_TYPE_P(&parts) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&parts), _4)
+ {
+ ZEPHIR_INIT_NVAR(&part);
+ ZVAL_COPY(&part, _4);
+ ZEPHIR_INIT_NVAR(&headerParts);
+ array_init(&headerParts);
+ ZEPHIR_INIT_NVAR(&_6$$3);
+ zephir_fast_trim(&_6$$3, &part, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_7$$3);
+ ZVAL_STRING(&_7$$3, "/\\s*;\\s*/");
+ ZVAL_LONG(&_8$$3, -1);
+ ZVAL_LONG(&_9$$3, 1);
+ ZEPHIR_CALL_FUNCTION(&headerSplit, "preg_split", NULL, 70, &_7$$3, &_6$$3, &_8$$3, &_9$$3);
+ zephir_check_call_status();
+ zephir_is_iterable(&headerSplit, 0, "phalcon/Http/Request.zep", 1496);
+ if (Z_TYPE_P(&headerSplit) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&headerSplit), _10$$3)
+ {
+ ZEPHIR_INIT_NVAR(&headerPart);
+ ZVAL_COPY(&headerPart, _10$$3);
+ ZEPHIR_INIT_NVAR(&_12$$4);
+ ZVAL_STRING(&_12$$4, "=");
+ ZEPHIR_INIT_NVAR(&_13$$4);
+ zephir_fast_strpos(&_13$$4, &headerPart, &_12$$4, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_13$$4)) {
+ ZEPHIR_INIT_NVAR(&split);
+ zephir_fast_explode_str(&split, SL("="), &headerPart, 2 );
+ zephir_array_fetch_long(&_14$$5, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1485);
+ if (ZEPHIR_IS_STRING_IDENTICAL(&_14$$5, "q")) {
+ ZEPHIR_OBS_NVAR(&_15$$6);
+ zephir_array_fetch_long(&_15$$6, &split, 1, PH_NOISY, "phalcon/Http/Request.zep", 1486);
+ ZEPHIR_INIT_NVAR(&_16$$6);
+ ZVAL_DOUBLE(&_16$$6, zephir_get_doubleval(&_15$$6));
+ zephir_array_update_string(&headerParts, SL("quality"), &_16$$6, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_fetch_long(&_17$$7, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1488);
+ ZEPHIR_OBS_NVAR(&_18$$7);
+ zephir_array_fetch_long(&_18$$7, &split, 0, PH_NOISY, "phalcon/Http/Request.zep", 1488);
+ zephir_array_update_zval(&headerParts, &_18$$7, &_17$$7, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_update_zval(&headerParts, &name, &headerPart, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_19$$8);
+ ZVAL_DOUBLE(&_19$$8, 1.0);
+ zephir_array_update_string(&headerParts, SL("quality"), &_19$$8, PH_COPY | PH_SEPARATE);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &headerSplit, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_11$$3, &headerSplit, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_11$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&headerPart, &headerSplit, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_20$$9);
+ ZVAL_STRING(&_20$$9, "=");
+ ZEPHIR_INIT_NVAR(&_21$$9);
+ zephir_fast_strpos(&_21$$9, &headerPart, &_20$$9, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_21$$9)) {
+ ZEPHIR_INIT_NVAR(&split);
+ zephir_fast_explode_str(&split, SL("="), &headerPart, 2 );
+ zephir_array_fetch_long(&_22$$10, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1485);
+ if (ZEPHIR_IS_STRING_IDENTICAL(&_22$$10, "q")) {
+ ZEPHIR_OBS_NVAR(&_23$$11);
+ zephir_array_fetch_long(&_23$$11, &split, 1, PH_NOISY, "phalcon/Http/Request.zep", 1486);
+ ZEPHIR_INIT_NVAR(&_24$$11);
+ ZVAL_DOUBLE(&_24$$11, zephir_get_doubleval(&_23$$11));
+ zephir_array_update_string(&headerParts, SL("quality"), &_24$$11, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_fetch_long(&_25$$12, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1488);
+ ZEPHIR_OBS_NVAR(&_26$$12);
+ zephir_array_fetch_long(&_26$$12, &split, 0, PH_NOISY, "phalcon/Http/Request.zep", 1488);
+ zephir_array_update_zval(&headerParts, &_26$$12, &_25$$12, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_update_zval(&headerParts, &name, &headerPart, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_27$$13);
+ ZVAL_DOUBLE(&_27$$13, 1.0);
+ zephir_array_update_string(&headerParts, SL("quality"), &_27$$13, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &headerSplit, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&headerPart);
+ zephir_array_append(&returnedParts, &headerParts, PH_SEPARATE, "phalcon/Http/Request.zep", 1496);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &parts, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &parts, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&part, &parts, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&headerParts);
+ array_init(&headerParts);
+ ZEPHIR_INIT_NVAR(&_28$$14);
+ zephir_fast_trim(&_28$$14, &part, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_29$$14);
+ ZVAL_STRING(&_29$$14, "/\\s*;\\s*/");
+ ZVAL_LONG(&_30$$14, -1);
+ ZVAL_LONG(&_31$$14, 1);
+ ZEPHIR_CALL_FUNCTION(&headerSplit, "preg_split", NULL, 70, &_29$$14, &_28$$14, &_30$$14, &_31$$14);
+ zephir_check_call_status();
+ zephir_is_iterable(&headerSplit, 0, "phalcon/Http/Request.zep", 1496);
+ if (Z_TYPE_P(&headerSplit) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&headerSplit), _32$$14)
+ {
+ ZEPHIR_INIT_NVAR(&headerPart);
+ ZVAL_COPY(&headerPart, _32$$14);
+ ZEPHIR_INIT_NVAR(&_34$$15);
+ ZVAL_STRING(&_34$$15, "=");
+ ZEPHIR_INIT_NVAR(&_35$$15);
+ zephir_fast_strpos(&_35$$15, &headerPart, &_34$$15, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_35$$15)) {
+ ZEPHIR_INIT_NVAR(&split);
+ zephir_fast_explode_str(&split, SL("="), &headerPart, 2 );
+ zephir_array_fetch_long(&_36$$16, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1485);
+ if (ZEPHIR_IS_STRING_IDENTICAL(&_36$$16, "q")) {
+ ZEPHIR_OBS_NVAR(&_37$$17);
+ zephir_array_fetch_long(&_37$$17, &split, 1, PH_NOISY, "phalcon/Http/Request.zep", 1486);
+ ZEPHIR_INIT_NVAR(&_38$$17);
+ ZVAL_DOUBLE(&_38$$17, zephir_get_doubleval(&_37$$17));
+ zephir_array_update_string(&headerParts, SL("quality"), &_38$$17, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_fetch_long(&_39$$18, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1488);
+ ZEPHIR_OBS_NVAR(&_40$$18);
+ zephir_array_fetch_long(&_40$$18, &split, 0, PH_NOISY, "phalcon/Http/Request.zep", 1488);
+ zephir_array_update_zval(&headerParts, &_40$$18, &_39$$18, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_update_zval(&headerParts, &name, &headerPart, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_41$$19);
+ ZVAL_DOUBLE(&_41$$19, 1.0);
+ zephir_array_update_string(&headerParts, SL("quality"), &_41$$19, PH_COPY | PH_SEPARATE);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &headerSplit, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_33$$14, &headerSplit, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_33$$14)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&headerPart, &headerSplit, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_42$$20);
+ ZVAL_STRING(&_42$$20, "=");
+ ZEPHIR_INIT_NVAR(&_43$$20);
+ zephir_fast_strpos(&_43$$20, &headerPart, &_42$$20, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_43$$20)) {
+ ZEPHIR_INIT_NVAR(&split);
+ zephir_fast_explode_str(&split, SL("="), &headerPart, 2 );
+ zephir_array_fetch_long(&_44$$21, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1485);
+ if (ZEPHIR_IS_STRING_IDENTICAL(&_44$$21, "q")) {
+ ZEPHIR_OBS_NVAR(&_45$$22);
+ zephir_array_fetch_long(&_45$$22, &split, 1, PH_NOISY, "phalcon/Http/Request.zep", 1486);
+ ZEPHIR_INIT_NVAR(&_46$$22);
+ ZVAL_DOUBLE(&_46$$22, zephir_get_doubleval(&_45$$22));
+ zephir_array_update_string(&headerParts, SL("quality"), &_46$$22, PH_COPY | PH_SEPARATE);
+ } else {
+ zephir_array_fetch_long(&_47$$23, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1488);
+ ZEPHIR_OBS_NVAR(&_48$$23);
+ zephir_array_fetch_long(&_48$$23, &split, 0, PH_NOISY, "phalcon/Http/Request.zep", 1488);
+ zephir_array_update_zval(&headerParts, &_48$$23, &_47$$23, PH_COPY | PH_SEPARATE);
+ }
+ } else {
+ zephir_array_update_zval(&headerParts, &name, &headerPart, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_49$$24);
+ ZVAL_DOUBLE(&_49$$24, 1.0);
+ zephir_array_update_string(&headerParts, SL("quality"), &_49$$24, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &headerSplit, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&headerPart);
+ zephir_array_append(&returnedParts, &headerParts, PH_SEPARATE, "phalcon/Http/Request.zep", 1496);
+ ZEPHIR_CALL_METHOD(NULL, &parts, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&part);
+ RETURN_CCTOR(&returnedParts);
}
-static PHP_METHOD(Phalcon_Forms_Element_AbstractElement, getLocalTagFactory)
+static PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders)
{
- zval container, escaper, tagFactory, _0, _1$$3, _2$$4, _3$$5, _4$$5, _5$$6, _6$$7, _7$$7, _8$$8;
+ zend_bool _4, _9, _35, _22$$11;
+ zval headers, _5$$5, _36$$19;
+ zval resolved, eventsManager, hasEventsManager, container, exploded, digest, authHeader, server, _0, _8, _10, _1$$3, _2$$4, _3$$4, _6$$5, _7$$6, _11$$7, _12$$7, _13$$7, _14$$8, _15$$8, _16$$8, _17$$9, _18$$10, _19$$11, _20$$11, _21$$11, _23$$11, _24$$11, _25$$12, _26$$12, _27$$12, _28$$13, _29$$13, _30$$17, _31$$17, _32$$17, _33$$17, _34$$17, _37$$19, _38$$20;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&resolved);
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&hasEventsManager);
ZVAL_UNDEF(&container);
- ZVAL_UNDEF(&escaper);
- ZVAL_UNDEF(&tagFactory);
+ ZVAL_UNDEF(&exploded);
+ ZVAL_UNDEF(&digest);
+ ZVAL_UNDEF(&authHeader);
+ ZVAL_UNDEF(&server);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_10);
ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$5);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$7);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_8$$8);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_12$$7);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$9);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_19$$11);
+ ZVAL_UNDEF(&_20$$11);
+ ZVAL_UNDEF(&_21$$11);
+ ZVAL_UNDEF(&_23$$11);
+ ZVAL_UNDEF(&_24$$11);
+ ZVAL_UNDEF(&_25$$12);
+ ZVAL_UNDEF(&_26$$12);
+ ZVAL_UNDEF(&_27$$12);
+ ZVAL_UNDEF(&_28$$13);
+ ZVAL_UNDEF(&_29$$13);
+ ZVAL_UNDEF(&_30$$17);
+ ZVAL_UNDEF(&_31$$17);
+ ZVAL_UNDEF(&_32$$17);
+ ZVAL_UNDEF(&_33$$17);
+ ZVAL_UNDEF(&_34$$17);
+ ZVAL_UNDEF(&_37$$19);
+ ZVAL_UNDEF(&_38$$20);
+ ZVAL_UNDEF(&headers);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_36$$19);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_INIT_VAR(&tagFactory);
- ZVAL_NULL(&tagFactory);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("tagFactory"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(ZEPHIR_IS_EMPTY(&_0))) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_1$$3) != IS_NULL) {
- zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("form"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&tagFactory, &_2$$4, "gettagfactory", NULL, 0);
+ ZEPHIR_INIT_VAR(&authHeader);
+ ZVAL_NULL(&authHeader);
+ ZEPHIR_INIT_VAR(&headers);
+ array_init(&headers);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&container, &_0);
+ ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&container) != IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "eventsManager");
+ ZEPHIR_CALL_METHOD(&hasEventsManager, &container, "has", NULL, 0, &_1$$3);
+ zephir_check_call_status();
+ if (zephir_is_true(&hasEventsManager)) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ ZVAL_STRING(&_3$$4, "eventsManager");
+ ZEPHIR_CALL_METHOD(&_2$$4, &container, "getshared", NULL, 0, &_3$$4);
zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&eventsManager, &_2$$4);
}
- if (Z_TYPE_P(&tagFactory) == IS_NULL) {
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", NULL, 0);
+ }
+ _4 = zephir_is_true(&hasEventsManager);
+ if (_4) {
+ _4 = Z_TYPE_P(&eventsManager) == IS_OBJECT;
+ }
+ if (_4) {
+ ZEPHIR_INIT_VAR(&_5$$5);
+ zephir_create_array(&_5$$5, 1, 0);
+ zephir_array_update_string(&_5$$5, SL("server"), &server, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_6$$5);
+ ZVAL_STRING(&_6$$5, "request:beforeAuthorizationResolve");
+ ZEPHIR_CALL_METHOD(&resolved, &eventsManager, "fire", NULL, 0, &_6$$5, this_ptr, &_5$$5);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&resolved) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_7$$6);
+ zephir_fast_array_merge(&_7$$6, &headers, &resolved);
+ ZEPHIR_CPY_WRT(&headers, &_7$$6);
+ }
+ }
+ ZEPHIR_INIT_VAR(&_8);
+ ZVAL_STRING(&_8, "PHP_AUTH_USER");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_8);
+ zephir_check_call_status();
+ _9 = zephir_is_true(&_0);
+ if (_9) {
+ ZEPHIR_INIT_NVAR(&_8);
+ ZVAL_STRING(&_8, "PHP_AUTH_PW");
+ ZEPHIR_CALL_METHOD(&_10, this_ptr, "hasserver", NULL, 335, &_8);
+ zephir_check_call_status();
+ _9 = zephir_is_true(&_10);
+ }
+ if (_9) {
+ ZEPHIR_INIT_VAR(&_12$$7);
+ ZVAL_STRING(&_12$$7, "PHP_AUTH_USER");
+ ZEPHIR_CALL_METHOD(&_11$$7, this_ptr, "getserver", NULL, 0, &_12$$7);
+ zephir_check_call_status();
+ zephir_array_update_string(&headers, SL("Php-Auth-User"), &_11$$7, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_12$$7);
+ ZVAL_STRING(&_12$$7, "PHP_AUTH_PW");
+ ZEPHIR_CALL_METHOD(&_13$$7, this_ptr, "getserver", NULL, 0, &_12$$7);
+ zephir_check_call_status();
+ zephir_array_update_string(&headers, SL("Php-Auth-Pw"), &_13$$7, PH_COPY | PH_SEPARATE);
+ } else {
+ ZEPHIR_INIT_VAR(&_15$$8);
+ ZVAL_STRING(&_15$$8, "HTTP_AUTHORIZATION");
+ ZEPHIR_CALL_METHOD(&_14$$8, this_ptr, "hasserver", NULL, 335, &_15$$8);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_15$$8);
+ ZVAL_STRING(&_15$$8, "REDIRECT_HTTP_AUTHORIZATION");
+ ZEPHIR_CALL_METHOD(&_16$$8, this_ptr, "hasserver", NULL, 335, &_15$$8);
+ zephir_check_call_status();
+ if (zephir_is_true(&_14$$8)) {
+ ZEPHIR_INIT_VAR(&_17$$9);
+ ZVAL_STRING(&_17$$9, "HTTP_AUTHORIZATION");
+ ZEPHIR_CALL_METHOD(&authHeader, this_ptr, "getserver", NULL, 0, &_17$$9);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_4$$5);
- ZVAL_STRING(&_4$$5, "tag");
- ZEPHIR_CALL_METHOD(&_3$$5, &container, "has", NULL, 0, &_4$$5);
+ } else if (zephir_is_true(&_16$$8)) {
+ ZEPHIR_INIT_VAR(&_18$$10);
+ ZVAL_STRING(&_18$$10, "REDIRECT_HTTP_AUTHORIZATION");
+ ZEPHIR_CALL_METHOD(&authHeader, this_ptr, "getserver", NULL, 0, &_18$$10);
zephir_check_call_status();
- if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_3$$5))) {
- ZEPHIR_INIT_VAR(&_5$$6);
- ZVAL_STRING(&_5$$6, "tag");
- ZEPHIR_CALL_METHOD(&tagFactory, &container, "getshared", NULL, 0, &_5$$6);
- zephir_check_call_status();
- }
}
- if (Z_TYPE_P(&tagFactory) == IS_NULL) {
- ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", NULL, 0);
+ if (zephir_is_true(&authHeader)) {
+ ZEPHIR_INIT_VAR(&_19$$11);
+ ZVAL_STRING(&_19$$11, "basic ");
+ ZEPHIR_CALL_FUNCTION(&_20$$11, "stripos", NULL, 348, &authHeader, &_19$$11);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_7$$7);
- ZVAL_STRING(&_7$$7, "escaper");
- ZEPHIR_CALL_METHOD(&_6$$7, &container, "has", NULL, 0, &_7$$7);
+ ZEPHIR_INIT_NVAR(&_19$$11);
+ ZVAL_STRING(&_19$$11, "digest ");
+ ZEPHIR_CALL_FUNCTION(&_21$$11, "stripos", NULL, 348, &authHeader, &_19$$11);
zephir_check_call_status();
- if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_6$$7))) {
- ZEPHIR_INIT_VAR(&_8$$8);
- ZVAL_STRING(&_8$$8, "escaper");
- ZEPHIR_CALL_METHOD(&escaper, &container, "getshared", NULL, 0, &_8$$8);
+ _22$$11 = ZEPHIR_IS_LONG_IDENTICAL(&_21$$11, 0);
+ if (_22$$11) {
+ ZEPHIR_INIT_NVAR(&_19$$11);
+ ZVAL_STRING(&_19$$11, "PHP_AUTH_DIGEST");
+ ZEPHIR_CALL_METHOD(&_23$$11, this_ptr, "hasserver", NULL, 335, &_19$$11);
zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&escaper);
- object_init_ex(&escaper, phalcon_html_escaper_ce);
- if (zephir_has_constructor(&escaper)) {
- ZEPHIR_CALL_METHOD(NULL, &escaper, "__construct", NULL, 0);
- zephir_check_call_status();
- }
-
+ _22$$11 = !zephir_is_true(&_23$$11);
}
- ZEPHIR_INIT_NVAR(&tagFactory);
- object_init_ex(&tagFactory, phalcon_html_tagfactory_ce);
- ZEPHIR_CALL_METHOD(NULL, &tagFactory, "__construct", NULL, 9, &escaper);
+ ZEPHIR_INIT_NVAR(&_19$$11);
+ ZVAL_STRING(&_19$$11, "bearer ");
+ ZEPHIR_CALL_FUNCTION(&_24$$11, "stripos", NULL, 348, &authHeader, &_19$$11);
zephir_check_call_status();
+ if (ZEPHIR_IS_LONG_IDENTICAL(&_20$$11, 0)) {
+ ZVAL_LONG(&_25$$12, 6);
+ ZEPHIR_INIT_VAR(&_26$$12);
+ zephir_substr(&_26$$12, &authHeader, 6 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ ZEPHIR_CALL_FUNCTION(&_27$$12, "base64_decode", NULL, 230, &_26$$12);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&exploded);
+ zephir_fast_explode_str(&exploded, SL(":"), &_27$$12, 2 );
+ if (zephir_fast_count_int(&exploded) == 2) {
+ zephir_array_fetch_long(&_28$$13, &exploded, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1558);
+ zephir_array_update_string(&headers, SL("Php-Auth-User"), &_28$$13, PH_COPY | PH_SEPARATE);
+ zephir_array_fetch_long(&_29$$13, &exploded, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1559);
+ zephir_array_update_string(&headers, SL("Php-Auth-Pw"), &_29$$13, PH_COPY | PH_SEPARATE);
+ }
+ } else if (_22$$11) {
+ zephir_array_update_string(&headers, SL("Php-Auth-Digest"), &authHeader, PH_COPY | PH_SEPARATE);
+ } else if (ZEPHIR_IS_LONG_IDENTICAL(&_24$$11, 0)) {
+ zephir_array_update_string(&headers, SL("Authorization"), &authHeader, PH_COPY | PH_SEPARATE);
+ }
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("tagFactory"), &tagFactory);
}
- RETURN_MM_MEMBER(getThis(), "tagFactory");
-}
-
-zend_object *zephir_init_properties_Phalcon_Forms_Element_AbstractElement(zend_class_entry *class_type)
-{
- zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_7$$6);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("validators"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("validators"), &_1$$3);
- }
- zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_2) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_3$$4);
- array_init(&_3$$4);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_3$$4);
- }
- zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("filters"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_4) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_5$$5);
- array_init(&_5$$5);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("filters"), &_5$$5);
+ if (!(zephir_array_isset_string(&headers, SL("Authorization")))) {
+ zephir_memory_observe(&digest);
+ if (zephir_array_isset_string(&headers, SL("Php-Auth-User"))) {
+ zephir_array_fetch_string(&_30$$17, &headers, SL("Php-Auth-User"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1571);
+ zephir_array_fetch_string(&_31$$17, &headers, SL("Php-Auth-Pw"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1571);
+ ZEPHIR_INIT_VAR(&_32$$17);
+ ZEPHIR_CONCAT_VSV(&_32$$17, &_30$$17, ":", &_31$$17);
+ ZEPHIR_CALL_FUNCTION(&_33$$17, "base64_encode", NULL, 231, &_32$$17);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_34$$17);
+ ZEPHIR_CONCAT_SV(&_34$$17, "Basic ", &_33$$17);
+ zephir_array_update_string(&headers, SL("Authorization"), &_34$$17, PH_COPY | PH_SEPARATE);
+ } else if (zephir_array_isset_string_fetch(&digest, &headers, SL("Php-Auth-Digest"), 0)) {
+ zephir_array_update_string(&headers, SL("Authorization"), &digest, PH_COPY | PH_SEPARATE);
}
- zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_6) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_7$$6);
- array_init(&_7$$6);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("attributes"), &_7$$6);
+ }
+ _35 = zephir_is_true(&hasEventsManager);
+ if (_35) {
+ _35 = Z_TYPE_P(&eventsManager) == IS_OBJECT;
+ }
+ if (_35) {
+ ZEPHIR_INIT_VAR(&_36$$19);
+ zephir_create_array(&_36$$19, 2, 0);
+ zephir_array_update_string(&_36$$19, SL("headers"), &headers, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_36$$19, SL("server"), &server, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_37$$19);
+ ZVAL_STRING(&_37$$19, "request:afterAuthorizationResolve");
+ ZEPHIR_CALL_METHOD(&resolved, &eventsManager, "fire", NULL, 0, &_37$$19, this_ptr, &_36$$19);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&resolved) == IS_ARRAY) {
+ ZEPHIR_INIT_VAR(&_38$$20);
+ zephir_fast_array_merge(&_38$$20, &headers, &resolved);
+ ZEPHIR_CPY_WRT(&headers, &_38$$20);
}
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
}
+ RETURN_CTOR(&headers);
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Check)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Check, phalcon, forms_element_check, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_check_ce, SL("method"), "inputCheckbox", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Date)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Date, phalcon, forms_element_date, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_date_ce, SL("method"), "inputDate", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_ElementInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Forms\\Element, ElementInterface, phalcon, forms_element_elementinterface, phalcon_forms_element_elementinterface_method_entry);
-
- return SUCCESS;
-}
-
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, addFilter);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, addValidator);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, addValidators);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, appendMessage);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, clear);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getAttribute);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getAttributes);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getDefault);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getFilters);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getForm);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getLabel);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getMessages);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getName);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getUserOption);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getUserOptions);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getValidators);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, getValue);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, hasMessages);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, label);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, render);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setAttribute);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setAttributes);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setDefault);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setFilters);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setForm);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setLabel);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setMessages);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setName);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setUserOption);
-ZEPHIR_DOC_METHOD(Phalcon_Forms_Element_ElementInterface, setUserOptions);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Email)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Email, phalcon, forms_element_email, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_email_ce, SL("method"), "inputEmail", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_File)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, File, phalcon, forms_element_file, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_file_ce, SL("method"), "inputFile", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Hidden)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Hidden, phalcon, forms_element_hidden, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_hidden_ce, SL("method"), "inputHidden", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Numeric)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Numeric, phalcon, forms_element_numeric, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_numeric_ce, SL("method"), "inputNumeric", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Password)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Password, phalcon, forms_element_password, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_password_ce, SL("method"), "inputPassword", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Radio)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Radio, phalcon, forms_element_radio, phalcon_forms_element_abstractelement_ce, NULL, 0);
-
- zend_declare_property_string(phalcon_forms_element_radio_ce, SL("method"), "inputRadio", ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Select)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Select, phalcon, forms_element_select, phalcon_forms_element_abstractelement_ce, phalcon_forms_element_select_method_entry, 0);
-
- zend_declare_property_null(phalcon_forms_element_select_ce, SL("optionsValues"), ZEND_ACC_PROTECTED);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_Select, __construct)
+static PHP_METHOD(Phalcon_Http_Request, smoothFiles)
{
+ zend_string *_3;
+ zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_11 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval attributes;
- zval *name_param = NULL, *options = NULL, options_sub, *attributes_param = NULL, __$null;
- zval name;
+ zval prefix;
+ zval *names_param = NULL, *types_param = NULL, *tmp_names_param = NULL, *sizes_param = NULL, *errors_param = NULL, *prefix_param = NULL, idx, name, file, files, parentFiles, p, *_0, _1, _5$$4, _6$$5, _7$$5, _8$$5, _9$$5, _10$$5, *_12$$5, _13$$5, _15$$9, _16$$10, _17$$10, _18$$10, _19$$10, _20$$10, *_21$$10, _22$$10;
+ zval names, types, tmp_names, sizes, errors, _4$$4, _14$$9;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&names);
+ ZVAL_UNDEF(&types);
+ ZVAL_UNDEF(&tmp_names);
+ ZVAL_UNDEF(&sizes);
+ ZVAL_UNDEF(&errors);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_14$$9);
+ ZVAL_UNDEF(&idx);
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&options_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&attributes);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(options)
- Z_PARAM_ARRAY(attributes)
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&files);
+ ZVAL_UNDEF(&parentFiles);
+ ZVAL_UNDEF(&p);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_13$$5);
+ ZVAL_UNDEF(&_15$$9);
+ ZVAL_UNDEF(&_16$$10);
+ ZVAL_UNDEF(&_17$$10);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_19$$10);
+ ZVAL_UNDEF(&_20$$10);
+ ZVAL_UNDEF(&_22$$10);
+ ZVAL_UNDEF(&prefix);
+ ZEND_PARSE_PARAMETERS_START(6, 6)
+ Z_PARAM_ARRAY(names)
+ Z_PARAM_ARRAY(types)
+ Z_PARAM_ARRAY(tmp_names)
+ Z_PARAM_ARRAY(sizes)
+ Z_PARAM_ARRAY(errors)
+ Z_PARAM_STR(prefix)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &name_param, &options, &attributes_param);
- zephir_get_strval(&name, name_param);
- if (!options) {
- options = &options_sub;
- options = &__$null;
- }
- if (!attributes_param) {
- ZEPHIR_INIT_VAR(&attributes);
- array_init(&attributes);
+ zephir_fetch_params(1, 6, 0, &names_param, &types_param, &tmp_names_param, &sizes_param, &errors_param, &prefix_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&names, names_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&types, types_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&tmp_names, tmp_names_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&sizes, sizes_param);
+ ZEPHIR_OBS_COPY_OR_DUP(&errors, errors_param);
+ zephir_get_strval(&prefix, prefix_param);
+ ZEPHIR_INIT_VAR(&files);
+ array_init(&files);
+ zephir_is_iterable(&names, 0, "phalcon/Http/Request.zep", 1635);
+ if (Z_TYPE_P(&names) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&names), _2, _3, _0)
+ {
+ ZEPHIR_INIT_NVAR(&idx);
+ if (_3 != NULL) {
+ ZVAL_STR_COPY(&idx, _3);
+ } else {
+ ZVAL_LONG(&idx, _2);
+ }
+ ZEPHIR_INIT_NVAR(&name);
+ ZVAL_COPY(&name, _0);
+ ZEPHIR_INIT_NVAR(&p);
+ ZEPHIR_CONCAT_VSV(&p, &prefix, ".", &idx);
+ if (Z_TYPE_P(&name) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&_4$$4);
+ zephir_create_array(&_4$$4, 6, 0);
+ zephir_array_update_string(&_4$$4, SL("name"), &name, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_5$$4);
+ zephir_array_fetch(&_5$$4, &types, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1611);
+ zephir_array_update_string(&_4$$4, SL("type"), &_5$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_5$$4);
+ zephir_array_fetch(&_5$$4, &tmp_names, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1612);
+ zephir_array_update_string(&_4$$4, SL("tmp_name"), &_5$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_5$$4);
+ zephir_array_fetch(&_5$$4, &sizes, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1613);
+ zephir_array_update_string(&_4$$4, SL("size"), &_5$$4, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_5$$4);
+ zephir_array_fetch(&_5$$4, &errors, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1614);
+ zephir_array_update_string(&_4$$4, SL("error"), &_5$$4, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_4$$4, SL("key"), &p, PH_COPY | PH_SEPARATE);
+ zephir_array_append(&files, &_4$$4, PH_SEPARATE, "phalcon/Http/Request.zep", 1616);
+ }
+ if (Z_TYPE_P(&name) == IS_ARRAY) {
+ zephir_array_fetch(&_6$$5, &names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1621);
+ zephir_array_fetch(&_7$$5, &types, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1622);
+ zephir_array_fetch(&_8$$5, &tmp_names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1623);
+ zephir_array_fetch(&_9$$5, &sizes, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1624);
+ zephir_array_fetch(&_10$$5, &errors, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1625);
+ ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 342, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &_10$$5, &p);
+ zephir_check_call_status();
+ zephir_is_iterable(&parentFiles, 0, "phalcon/Http/Request.zep", 1632);
+ if (Z_TYPE_P(&parentFiles) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&parentFiles), _12$$5)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _12$$5);
+ zephir_array_append(&files, &file, PH_SEPARATE, "phalcon/Http/Request.zep", 1630);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &parentFiles, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_13$$5, &parentFiles, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_13$$5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &parentFiles, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&files, &file, PH_SEPARATE, "phalcon/Http/Request.zep", 1630);
+ ZEPHIR_CALL_METHOD(NULL, &parentFiles, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&file);
+ }
+ } ZEND_HASH_FOREACH_END();
} else {
- zephir_get_arrval(&attributes, attributes_param);
+ ZEPHIR_CALL_METHOD(NULL, &names, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &names, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&idx, &names, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&name, &names, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&p);
+ ZEPHIR_CONCAT_VSV(&p, &prefix, ".", &idx);
+ if (Z_TYPE_P(&name) == IS_STRING) {
+ ZEPHIR_INIT_NVAR(&_14$$9);
+ zephir_create_array(&_14$$9, 6, 0);
+ zephir_array_update_string(&_14$$9, SL("name"), &name, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$9);
+ zephir_array_fetch(&_15$$9, &types, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1611);
+ zephir_array_update_string(&_14$$9, SL("type"), &_15$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$9);
+ zephir_array_fetch(&_15$$9, &tmp_names, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1612);
+ zephir_array_update_string(&_14$$9, SL("tmp_name"), &_15$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$9);
+ zephir_array_fetch(&_15$$9, &sizes, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1613);
+ zephir_array_update_string(&_14$$9, SL("size"), &_15$$9, PH_COPY | PH_SEPARATE);
+ ZEPHIR_OBS_NVAR(&_15$$9);
+ zephir_array_fetch(&_15$$9, &errors, &idx, PH_NOISY, "phalcon/Http/Request.zep", 1614);
+ zephir_array_update_string(&_14$$9, SL("error"), &_15$$9, PH_COPY | PH_SEPARATE);
+ zephir_array_update_string(&_14$$9, SL("key"), &p, PH_COPY | PH_SEPARATE);
+ zephir_array_append(&files, &_14$$9, PH_SEPARATE, "phalcon/Http/Request.zep", 1616);
+ }
+ if (Z_TYPE_P(&name) == IS_ARRAY) {
+ zephir_array_fetch(&_16$$10, &names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1621);
+ zephir_array_fetch(&_17$$10, &types, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1622);
+ zephir_array_fetch(&_18$$10, &tmp_names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1623);
+ zephir_array_fetch(&_19$$10, &sizes, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1624);
+ zephir_array_fetch(&_20$$10, &errors, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1625);
+ ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 342, &_16$$10, &_17$$10, &_18$$10, &_19$$10, &_20$$10, &p);
+ zephir_check_call_status();
+ zephir_is_iterable(&parentFiles, 0, "phalcon/Http/Request.zep", 1632);
+ if (Z_TYPE_P(&parentFiles) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&parentFiles), _21$$10)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _21$$10);
+ zephir_array_append(&files, &file, PH_SEPARATE, "phalcon/Http/Request.zep", 1630);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &parentFiles, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_22$$10, &parentFiles, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_22$$10)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &parentFiles, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_array_append(&files, &file, PH_SEPARATE, "phalcon/Http/Request.zep", 1630);
+ ZEPHIR_CALL_METHOD(NULL, &parentFiles, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&file);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &names, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("optionsValues"), options);
- ZEPHIR_CALL_PARENT(NULL, phalcon_forms_element_select_ce, getThis(), "__construct", NULL, 0, &name, &attributes);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_NVAR(&name);
+ ZEPHIR_INIT_NVAR(&idx);
+ RETURN_CCTOR(&files);
}
-static PHP_METHOD(Phalcon_Forms_Element_Select, addOption)
+static PHP_METHOD(Phalcon_Http_Request, getFilterService)
{
- zend_string *_3$$3;
- zend_ulong _2$$3;
+ zval container, filterService, _0, _1$$3, _2$$3, _3$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *option, option_sub, key, value, *_0$$3, _1$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&option_sub);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&filterService);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(option)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &option);
- if (Z_TYPE_P(option) == IS_ARRAY) {
- zephir_is_iterable(option, 0, "phalcon/Forms/Element/Select.zep", 51);
- if (Z_TYPE_P(option) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(option), _2$$3, _3$$3, _0$$3)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_3$$3 != NULL) {
- ZVAL_STR_COPY(&key, _3$$3);
- } else {
- ZVAL_LONG(&key, _2$$3);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0$$3);
- zephir_update_property_array(this_ptr, SL("optionsValues"), &key, &value);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, option, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1$$3, option, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1$$3)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, option, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, option, "current", NULL, 0);
- zephir_check_call_status();
- zephir_update_property_array(this_ptr, SL("optionsValues"), &key, &value);
- ZEPHIR_CALL_METHOD(NULL, option, "next", NULL, 0);
- zephir_check_call_status();
- }
- }
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- } else {
- zephir_update_property_array_append(this_ptr, SL("optionsValues"), option);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("filterService"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&filterService, &_0);
+ if (Z_TYPE_P(&filterService) != IS_OBJECT) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_1$$3);
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_request_exception_ce, "A dependency injection container is required to access the 'filter' service", "phalcon/Http/Request.zep", 1653);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZVAL_STRING(&_3$$3, "filter");
+ ZEPHIR_CALL_METHOD(&_2$$3, &container, "getshared", NULL, 0, &_3$$3);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filterService, &_2$$3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("filterService"), &filterService);
}
- RETURN_THIS();
+ RETURN_MM_MEMBER(getThis(), "filterService");
}
-static PHP_METHOD(Phalcon_Forms_Element_Select, getOptions)
+static PHP_METHOD(Phalcon_Http_Request, getServerArray)
{
+ zval _SERVER;
- RETURN_MEMBER(getThis(), "optionsValues");
+ ZVAL_UNDEF(&_SERVER);
+ zephir_get_global(&_SERVER, SL("_SERVER"));
+
+ if (zephir_is_true(&_SERVER)) {
+ RETVAL_ZVAL(&_SERVER, 1, 0);
+ return;
+ }
+ array_init(return_value);
+ return;
}
-static PHP_METHOD(Phalcon_Forms_Element_Select, render)
+static PHP_METHOD(Phalcon_Http_Request, getFilteredData)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *attributes_param = NULL, _0, _1;
- zval attributes;
+ zend_bool notAllowEmpty, noRecursive;
+ zval *methodKey_param = NULL, *method_param = NULL, *name_param = NULL, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, filters, _0, _1, _2, _3;
+ zval methodKey, method, name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&attributes);
+ ZVAL_UNDEF(&methodKey);
+ ZVAL_UNDEF(&method);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&filters);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 6)
+ Z_PARAM_STR(methodKey)
+ Z_PARAM_STR(method)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &attributes_param);
- if (!attributes_param) {
- ZEPHIR_INIT_VAR(&attributes);
- array_init(&attributes);
+ zephir_fetch_params(1, 2, 4, &methodKey_param, &method_param, &name_param, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ zephir_get_strval(&methodKey, methodKey_param);
+ zephir_get_strval(&method, method_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
} else {
- zephir_get_arrval(&attributes, attributes_param);
+ zephir_get_strval(&name, name_param);
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "prepareattributes", NULL, 0, &attributes);
- zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("optionsValues"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", NULL, 0, &_0, &_1);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ zephir_memory_observe(&filters);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("queryFilters"), PH_NOISY_CC | PH_READONLY);
+ zephir_array_fetch(&_1, &_0, &methodKey, PH_READONLY, "phalcon/Http/Request.zep", 1685);
+ if (!(zephir_array_isset_fetch(&filters, &_1, &name, 0))) {
+ ZEPHIR_INIT_NVAR(&filters);
+ array_init(&filters);
+ }
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ if (noRecursive) {
+ ZVAL_BOOL(&_3, 1);
+ } else {
+ ZVAL_BOOL(&_3, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, &method, NULL, 0, &name, &filters, defaultValue, &_2, &_3);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Forms_Element_Select, setOptions)
-{
- zval *options, options_sub;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&options_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(options)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &options);
- zephir_update_property_zval(this_ptr, ZEND_STRL("optionsValues"), options);
- RETURN_THISW();
-}
-
-static PHP_METHOD(Phalcon_Forms_Element_Select, prepareAttributes)
+static PHP_METHOD(Phalcon_Http_Request, getPatchPut)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *attributes_param = NULL, value, name, mergedAttributes, defaultAttributes, _0;
- zval attributes;
+ zend_bool notAllowEmpty, noRecursive, _0$$3, _3$$3;
+ zval *collection_param = NULL, *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, cached, contentType, _10, _11, _1$$3, _2$$3, _4$$3, _5$$4, _6$$4, _8$$4, _7$$5, _9$$8;
+ zval collection, name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&attributes);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&collection);
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&mergedAttributes);
- ZVAL_UNDEF(&defaultAttributes);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&filters_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&cached);
+ ZVAL_UNDEF(&contentType);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_9$$8);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 6)
+ Z_PARAM_STR(collection)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(attributes)
+ Z_PARAM_STR_OR_NULL(name)
+ Z_PARAM_ZVAL_OR_NULL(filters)
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(notAllowEmpty)
+ Z_PARAM_BOOL(noRecursive)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &attributes_param);
- if (!attributes_param) {
- ZEPHIR_INIT_VAR(&attributes);
- array_init(&attributes);
+ zephir_fetch_params(1, 1, 5, &collection_param, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param);
+ zephir_get_strval(&collection, collection_param);
+ if (!name_param) {
+ ZEPHIR_INIT_VAR(&name);
} else {
- zephir_get_arrval(&attributes, attributes_param);
+ zephir_get_strval(&name, name_param);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&name, &_0);
- zephir_array_update_long(&attributes, 0, &name, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
- zephir_memory_observe(&defaultAttributes);
- zephir_read_property(&defaultAttributes, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC);
- ZEPHIR_INIT_VAR(&mergedAttributes);
- zephir_fast_array_merge(&mergedAttributes, &defaultAttributes, &attributes);
- ZEPHIR_CALL_METHOD(&value, this_ptr, "getvalue", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&value) != IS_NULL) {
- zephir_array_update_string(&mergedAttributes, SL("value"), &value, PH_COPY | PH_SEPARATE);
+ if (!filters) {
+ filters = &filters_sub;
+ filters = &__$null;
}
- RETURN_CCTOR(&mergedAttributes);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ if (!notAllowEmpty_param) {
+ notAllowEmpty = 0;
+ } else {
+ }
+ if (!noRecursive_param) {
+ noRecursive = 0;
+ } else {
+ }
+ zephir_memory_observe(&cached);
+ zephir_read_property_zval(&cached, this_ptr, &collection, PH_NOISY_CC);
+ if (Z_TYPE_P(&cached) == IS_NULL) {
+ ZEPHIR_CALL_METHOD(&contentType, this_ptr, "getcontenttype", NULL, 0);
+ zephir_check_call_status();
+ _0$$3 = Z_TYPE_P(&contentType) == IS_STRING;
+ if (_0$$3) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "json");
+ ZEPHIR_CALL_FUNCTION(&_2$$3, "stripos", NULL, 348, &contentType, &_1$$3);
+ zephir_check_call_status();
+ _3$$3 = !ZEPHIR_IS_FALSE(&_2$$3);
+ if (!(_3$$3)) {
+ ZEPHIR_INIT_NVAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "multipart/form-data");
+ ZEPHIR_CALL_FUNCTION(&_4$$3, "stripos", NULL, 348, &contentType, &_1$$3);
+ zephir_check_call_status();
+ _3$$3 = !ZEPHIR_IS_FALSE_IDENTICAL(&_4$$3);
+ }
+ _0$$3 = _3$$3;
+ }
+ if (_0$$3) {
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZVAL_STRING(&_5$$4, "json");
+ ZEPHIR_CALL_FUNCTION(&_6$$4, "stripos", NULL, 348, &contentType, &_5$$4);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_FALSE(&_6$$4)) {
+ ZVAL_BOOL(&_7$$5, 1);
+ ZEPHIR_CALL_METHOD(&cached, this_ptr, "getjsonrawbody", NULL, 0, &_7$$5);
+ zephir_check_call_status();
+ }
+ ZEPHIR_INIT_NVAR(&_5$$4);
+ ZVAL_STRING(&_5$$4, "multipart/form-data");
+ ZEPHIR_CALL_FUNCTION(&_8$$4, "stripos", NULL, 348, &contentType, &_5$$4);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_8$$4)) {
+ ZEPHIR_CALL_METHOD(&cached, this_ptr, "getformdata", NULL, 349);
+ zephir_check_call_status();
+ }
+ if (Z_TYPE_P(&cached) != IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&cached);
+ array_init(&cached);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(&cached);
+ array_init(&cached);
+ ZEPHIR_CALL_METHOD(&_9$$8, this_ptr, "getrawbody", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&cached);
+ ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 350, &_9$$8, &cached);
+ ZEPHIR_UNREF(&cached);
+ zephir_check_call_status();
+ }
+ zephir_update_property_zval_zval(this_ptr, &collection, &cached);
+ }
+ if (notAllowEmpty) {
+ ZVAL_BOOL(&_10, 1);
+ } else {
+ ZVAL_BOOL(&_10, 0);
+ }
+ if (noRecursive) {
+ ZVAL_BOOL(&_11, 1);
+ } else {
+ ZVAL_BOOL(&_11, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &cached, &name, filters, defaultValue, &_10, &_11);
+ zephir_check_call_status();
+ RETURN_MM();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Submit)
+static PHP_METHOD(Phalcon_Http_Request, getFormData)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Submit, phalcon, forms_element_submit, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ zval dataset, headers$$3, headers$$25;
+ zval boundary, matches, _0, _1, _2, _3, bodyParts, _4, _5, _6, _7, bodyPart, *_8, _9, splited$$3, _10$$3, _11$$3, headerParts$$3, headerPart$$3, _12$$3, _13$$3, *_14$$3, _15$$3, _67$$3, _68$$3, _69$$3, _16$$5, _17$$5, exploded$$5, headerName$$5, headerValue$$5, _18$$5, _19$$5, _20$$5, _21$$5, _22$$5, explodedHeader$$7, part$$7, *_23$$7, _24$$7, _25$$8, _26$$8, _27$$8, explodedPart$$9, namePart$$9, valuePart$$9, _29$$9, _30$$9, _31$$9, _32$$9, _33$$9, _34$$11, _35$$11, _36$$11, explodedPart$$12, namePart$$12, valuePart$$12, _37$$12, _38$$12, _39$$12, _40$$12, _41$$12, _42$$15, _43$$15, exploded$$15, headerName$$15, headerValue$$15, _44$$15, _45$$15, _46$$15, _47$$15, _48$$15, explodedHeader$$17, part$$17, *_49$$17, _50$$17, _51$$18, _52$$18, _53$$18, explodedPart$$19, namePart$$19, valuePart$$19, _54$$19, _55$$19, _56$$19, _57$$19, _58$$19, _59$$21, _60$$21, _61$$21, explodedPart$$22, namePart$$22, valuePart$$22, _62$$22, _63$$22, _64$$22, _65$$22, _66$$22, splited$$25, _70$$25, _71$$25, headerParts$$25, headerPart$$25, _72$$25, _73$$25, *_74$$25, _75$$25, _126$$25, _127$$25, _128$$25, _76$$27, _77$$27, exploded$$27, headerName$$27, headerValue$$27, _78$$27, _79$$27, _80$$27, _81$$27, _82$$27, explodedHeader$$29, part$$29, *_83$$29, _84$$29, _85$$30, _86$$30, _87$$30, explodedPart$$31, namePart$$31, valuePart$$31, _88$$31, _89$$31, _90$$31, _91$$31, _92$$31, _93$$33, _94$$33, _95$$33, explodedPart$$34, namePart$$34, valuePart$$34, _96$$34, _97$$34, _98$$34, _99$$34, _100$$34, _101$$37, _102$$37, exploded$$37, headerName$$37, headerValue$$37, _103$$37, _104$$37, _105$$37, _106$$37, _107$$37, explodedHeader$$39, part$$39, *_108$$39, _109$$39, _110$$40, _111$$40, _112$$40, explodedPart$$41, namePart$$41, valuePart$$41, _113$$41, _114$$41, _115$$41, _116$$41, _117$$41, _118$$43, _119$$43, _120$$43, explodedPart$$44, namePart$$44, valuePart$$44, _121$$44, _122$$44, _123$$44, _124$$44, _125$$44;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_28 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- zend_declare_property_string(phalcon_forms_element_submit_ce, SL("method"), "inputSubmit", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ ZVAL_UNDEF(&boundary);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&bodyParts);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&bodyPart);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&splited$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&headerParts$$3);
+ ZVAL_UNDEF(&headerPart$$3);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_15$$3);
+ ZVAL_UNDEF(&_67$$3);
+ ZVAL_UNDEF(&_68$$3);
+ ZVAL_UNDEF(&_69$$3);
+ ZVAL_UNDEF(&_16$$5);
+ ZVAL_UNDEF(&_17$$5);
+ ZVAL_UNDEF(&exploded$$5);
+ ZVAL_UNDEF(&headerName$$5);
+ ZVAL_UNDEF(&headerValue$$5);
+ ZVAL_UNDEF(&_18$$5);
+ ZVAL_UNDEF(&_19$$5);
+ ZVAL_UNDEF(&_20$$5);
+ ZVAL_UNDEF(&_21$$5);
+ ZVAL_UNDEF(&_22$$5);
+ ZVAL_UNDEF(&explodedHeader$$7);
+ ZVAL_UNDEF(&part$$7);
+ ZVAL_UNDEF(&_24$$7);
+ ZVAL_UNDEF(&_25$$8);
+ ZVAL_UNDEF(&_26$$8);
+ ZVAL_UNDEF(&_27$$8);
+ ZVAL_UNDEF(&explodedPart$$9);
+ ZVAL_UNDEF(&namePart$$9);
+ ZVAL_UNDEF(&valuePart$$9);
+ ZVAL_UNDEF(&_29$$9);
+ ZVAL_UNDEF(&_30$$9);
+ ZVAL_UNDEF(&_31$$9);
+ ZVAL_UNDEF(&_32$$9);
+ ZVAL_UNDEF(&_33$$9);
+ ZVAL_UNDEF(&_34$$11);
+ ZVAL_UNDEF(&_35$$11);
+ ZVAL_UNDEF(&_36$$11);
+ ZVAL_UNDEF(&explodedPart$$12);
+ ZVAL_UNDEF(&namePart$$12);
+ ZVAL_UNDEF(&valuePart$$12);
+ ZVAL_UNDEF(&_37$$12);
+ ZVAL_UNDEF(&_38$$12);
+ ZVAL_UNDEF(&_39$$12);
+ ZVAL_UNDEF(&_40$$12);
+ ZVAL_UNDEF(&_41$$12);
+ ZVAL_UNDEF(&_42$$15);
+ ZVAL_UNDEF(&_43$$15);
+ ZVAL_UNDEF(&exploded$$15);
+ ZVAL_UNDEF(&headerName$$15);
+ ZVAL_UNDEF(&headerValue$$15);
+ ZVAL_UNDEF(&_44$$15);
+ ZVAL_UNDEF(&_45$$15);
+ ZVAL_UNDEF(&_46$$15);
+ ZVAL_UNDEF(&_47$$15);
+ ZVAL_UNDEF(&_48$$15);
+ ZVAL_UNDEF(&explodedHeader$$17);
+ ZVAL_UNDEF(&part$$17);
+ ZVAL_UNDEF(&_50$$17);
+ ZVAL_UNDEF(&_51$$18);
+ ZVAL_UNDEF(&_52$$18);
+ ZVAL_UNDEF(&_53$$18);
+ ZVAL_UNDEF(&explodedPart$$19);
+ ZVAL_UNDEF(&namePart$$19);
+ ZVAL_UNDEF(&valuePart$$19);
+ ZVAL_UNDEF(&_54$$19);
+ ZVAL_UNDEF(&_55$$19);
+ ZVAL_UNDEF(&_56$$19);
+ ZVAL_UNDEF(&_57$$19);
+ ZVAL_UNDEF(&_58$$19);
+ ZVAL_UNDEF(&_59$$21);
+ ZVAL_UNDEF(&_60$$21);
+ ZVAL_UNDEF(&_61$$21);
+ ZVAL_UNDEF(&explodedPart$$22);
+ ZVAL_UNDEF(&namePart$$22);
+ ZVAL_UNDEF(&valuePart$$22);
+ ZVAL_UNDEF(&_62$$22);
+ ZVAL_UNDEF(&_63$$22);
+ ZVAL_UNDEF(&_64$$22);
+ ZVAL_UNDEF(&_65$$22);
+ ZVAL_UNDEF(&_66$$22);
+ ZVAL_UNDEF(&splited$$25);
+ ZVAL_UNDEF(&_70$$25);
+ ZVAL_UNDEF(&_71$$25);
+ ZVAL_UNDEF(&headerParts$$25);
+ ZVAL_UNDEF(&headerPart$$25);
+ ZVAL_UNDEF(&_72$$25);
+ ZVAL_UNDEF(&_73$$25);
+ ZVAL_UNDEF(&_75$$25);
+ ZVAL_UNDEF(&_126$$25);
+ ZVAL_UNDEF(&_127$$25);
+ ZVAL_UNDEF(&_128$$25);
+ ZVAL_UNDEF(&_76$$27);
+ ZVAL_UNDEF(&_77$$27);
+ ZVAL_UNDEF(&exploded$$27);
+ ZVAL_UNDEF(&headerName$$27);
+ ZVAL_UNDEF(&headerValue$$27);
+ ZVAL_UNDEF(&_78$$27);
+ ZVAL_UNDEF(&_79$$27);
+ ZVAL_UNDEF(&_80$$27);
+ ZVAL_UNDEF(&_81$$27);
+ ZVAL_UNDEF(&_82$$27);
+ ZVAL_UNDEF(&explodedHeader$$29);
+ ZVAL_UNDEF(&part$$29);
+ ZVAL_UNDEF(&_84$$29);
+ ZVAL_UNDEF(&_85$$30);
+ ZVAL_UNDEF(&_86$$30);
+ ZVAL_UNDEF(&_87$$30);
+ ZVAL_UNDEF(&explodedPart$$31);
+ ZVAL_UNDEF(&namePart$$31);
+ ZVAL_UNDEF(&valuePart$$31);
+ ZVAL_UNDEF(&_88$$31);
+ ZVAL_UNDEF(&_89$$31);
+ ZVAL_UNDEF(&_90$$31);
+ ZVAL_UNDEF(&_91$$31);
+ ZVAL_UNDEF(&_92$$31);
+ ZVAL_UNDEF(&_93$$33);
+ ZVAL_UNDEF(&_94$$33);
+ ZVAL_UNDEF(&_95$$33);
+ ZVAL_UNDEF(&explodedPart$$34);
+ ZVAL_UNDEF(&namePart$$34);
+ ZVAL_UNDEF(&valuePart$$34);
+ ZVAL_UNDEF(&_96$$34);
+ ZVAL_UNDEF(&_97$$34);
+ ZVAL_UNDEF(&_98$$34);
+ ZVAL_UNDEF(&_99$$34);
+ ZVAL_UNDEF(&_100$$34);
+ ZVAL_UNDEF(&_101$$37);
+ ZVAL_UNDEF(&_102$$37);
+ ZVAL_UNDEF(&exploded$$37);
+ ZVAL_UNDEF(&headerName$$37);
+ ZVAL_UNDEF(&headerValue$$37);
+ ZVAL_UNDEF(&_103$$37);
+ ZVAL_UNDEF(&_104$$37);
+ ZVAL_UNDEF(&_105$$37);
+ ZVAL_UNDEF(&_106$$37);
+ ZVAL_UNDEF(&_107$$37);
+ ZVAL_UNDEF(&explodedHeader$$39);
+ ZVAL_UNDEF(&part$$39);
+ ZVAL_UNDEF(&_109$$39);
+ ZVAL_UNDEF(&_110$$40);
+ ZVAL_UNDEF(&_111$$40);
+ ZVAL_UNDEF(&_112$$40);
+ ZVAL_UNDEF(&explodedPart$$41);
+ ZVAL_UNDEF(&namePart$$41);
+ ZVAL_UNDEF(&valuePart$$41);
+ ZVAL_UNDEF(&_113$$41);
+ ZVAL_UNDEF(&_114$$41);
+ ZVAL_UNDEF(&_115$$41);
+ ZVAL_UNDEF(&_116$$41);
+ ZVAL_UNDEF(&_117$$41);
+ ZVAL_UNDEF(&_118$$43);
+ ZVAL_UNDEF(&_119$$43);
+ ZVAL_UNDEF(&_120$$43);
+ ZVAL_UNDEF(&explodedPart$$44);
+ ZVAL_UNDEF(&namePart$$44);
+ ZVAL_UNDEF(&valuePart$$44);
+ ZVAL_UNDEF(&_121$$44);
+ ZVAL_UNDEF(&_122$$44);
+ ZVAL_UNDEF(&_123$$44);
+ ZVAL_UNDEF(&_124$$44);
+ ZVAL_UNDEF(&_125$$44);
+ ZVAL_UNDEF(&dataset);
+ ZVAL_UNDEF(&headers$$3);
+ ZVAL_UNDEF(&headers$$25);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getcontenttype", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "/boundary=(.*)$/is");
+ ZEPHIR_INIT_VAR(&_2);
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "/boundary=(.*)$/is");
+ zephir_preg_match(&_2, &_3, &_0, &matches, 0, 0 , 0 );
+ zephir_memory_observe(&boundary);
+ zephir_array_fetch_long(&boundary, &matches, 1, PH_NOISY, "phalcon/Http/Request.zep", 1771);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "/");
+ ZEPHIR_CALL_FUNCTION(&_5, "preg_quote", NULL, 351, &boundary, &_4);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_CONCAT_SVS(&_6, "/\\R?-+", &_5, "/s");
+ ZEPHIR_CALL_METHOD(&_7, this_ptr, "getrawbody", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&bodyParts, "preg_split", NULL, 70, &_6, &_7);
+ zephir_check_call_status();
+ ZEPHIR_MAKE_REF(&bodyParts);
+ ZEPHIR_CALL_FUNCTION(NULL, "array_pop", NULL, 352, &bodyParts);
+ ZEPHIR_UNREF(&bodyParts);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&dataset);
+ array_init(&dataset);
+ zephir_is_iterable(&bodyParts, 0, "phalcon/Http/Request.zep", 1832);
+ if (Z_TYPE_P(&bodyParts) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&bodyParts), _8)
+ {
+ ZEPHIR_INIT_NVAR(&bodyPart);
+ ZVAL_COPY(&bodyPart, _8);
+ if (ZEPHIR_IS_EMPTY(&bodyPart)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_10$$3);
+ ZVAL_STRING(&_10$$3, "/\\R\\R/");
+ ZVAL_LONG(&_11$$3, 2);
+ ZEPHIR_CALL_FUNCTION(&splited$$3, "preg_split", NULL, 70, &_10$$3, &bodyPart, &_11$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&headers$$3);
+ array_init(&headers$$3);
+ zephir_array_fetch_long(&_12$$3, &splited$$3, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1793);
+ ZEPHIR_INIT_NVAR(&_10$$3);
+ ZVAL_STRING(&_10$$3, "/\\R/s");
+ ZVAL_LONG(&_11$$3, -1);
+ ZVAL_LONG(&_13$$3, 1);
+ ZEPHIR_CALL_FUNCTION(&headerParts$$3, "preg_split", NULL, 70, &_10$$3, &_12$$3, &_11$$3, &_13$$3);
+ zephir_check_call_status();
+ zephir_is_iterable(&headerParts$$3, 0, "phalcon/Http/Request.zep", 1829);
+ if (Z_TYPE_P(&headerParts$$3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&headerParts$$3), _14$$3)
+ {
+ ZEPHIR_INIT_NVAR(&headerPart$$3);
+ ZVAL_COPY(&headerPart$$3, _14$$3);
+ ZEPHIR_INIT_NVAR(&_16$$5);
+ ZVAL_STRING(&_16$$5, ":");
+ ZEPHIR_INIT_NVAR(&_17$$5);
+ zephir_fast_strpos(&_17$$5, &headerPart$$3, &_16$$5, 0 );
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_17$$5)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&exploded$$5);
+ zephir_fast_explode_str(&exploded$$5, SL(":"), &headerPart$$3, 2 );
+ ZEPHIR_INIT_NVAR(&_18$$5);
+ zephir_array_fetch_long(&_19$$5, &exploded$$5, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1803);
+ zephir_fast_trim(&_18$$5, &_19$$5, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&headerName$$5);
+ zephir_fast_strtolower(&headerName$$5, &_18$$5);
+ zephir_array_fetch_long(&_20$$5, &exploded$$5, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1804);
+ ZEPHIR_INIT_NVAR(&headerValue$$5);
+ zephir_fast_trim(&headerValue$$5, &_20$$5, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_21$$5);
+ ZVAL_STRING(&_21$$5, ";");
+ ZEPHIR_INIT_NVAR(&_22$$5);
+ zephir_fast_strpos(&_22$$5, &headerValue$$5, &_21$$5, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_22$$5)) {
+ ZEPHIR_INIT_NVAR(&explodedHeader$$7);
+ zephir_fast_explode_str(&explodedHeader$$7, SL(";"), &headerValue$$5, LONG_MAX);
+ zephir_is_iterable(&explodedHeader$$7, 0, "phalcon/Http/Request.zep", 1824);
+ if (Z_TYPE_P(&explodedHeader$$7) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&explodedHeader$$7), _23$$7)
+ {
+ ZEPHIR_INIT_NVAR(&part$$7);
+ ZVAL_COPY(&part$$7, _23$$7);
+ ZEPHIR_INIT_NVAR(&_25$$8);
+ zephir_fast_trim(&_25$$8, &part$$7, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_26$$8);
+ ZVAL_STRING(&_26$$8, "/\"/");
+ ZEPHIR_INIT_NVAR(&_27$$8);
+ ZVAL_STRING(&_27$$8, "");
+ ZEPHIR_CALL_FUNCTION(&part$$7, "preg_replace", &_28, 41, &_26$$8, &_27$$8, &_25$$8);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_26$$8);
+ ZVAL_STRING(&_26$$8, "=");
+ ZEPHIR_INIT_NVAR(&_27$$8);
+ zephir_fast_strpos(&_27$$8, &part$$7, &_26$$8, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_27$$8)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$9);
+ zephir_fast_explode_str(&explodedPart$$9, SL("="), &part$$7, 2 );
+ ZEPHIR_INIT_NVAR(&_29$$9);
+ zephir_array_fetch_long(&_30$$9, &explodedPart$$9, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_29$$9, &_30$$9, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$9);
+ zephir_fast_strtolower(&namePart$$9, &_29$$9);
+ ZEPHIR_INIT_NVAR(&_31$$9);
+ zephir_array_fetch_long(&_32$$9, &explodedPart$$9, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_31$$9, &_32$$9, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_33$$9);
+ ZVAL_STRING(&_33$$9, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$9);
+ zephir_fast_trim(&valuePart$$9, &_31$$9, &_33$$9, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$3, &valuePart$$9, SL("zz"), 2, &headerName$$5, &namePart$$9);
+ } else {
+ zephir_array_update_multi(&headers$$3, &part$$7, SL("za"), 2, &headerName$$5);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$7, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_24$$7, &explodedHeader$$7, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_24$$7)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&part$$7, &explodedHeader$$7, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_34$$11);
+ zephir_fast_trim(&_34$$11, &part$$7, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_35$$11);
+ ZVAL_STRING(&_35$$11, "/\"/");
+ ZEPHIR_INIT_NVAR(&_36$$11);
+ ZVAL_STRING(&_36$$11, "");
+ ZEPHIR_CALL_FUNCTION(&part$$7, "preg_replace", &_28, 41, &_35$$11, &_36$$11, &_34$$11);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_35$$11);
+ ZVAL_STRING(&_35$$11, "=");
+ ZEPHIR_INIT_NVAR(&_36$$11);
+ zephir_fast_strpos(&_36$$11, &part$$7, &_35$$11, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_36$$11)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$12);
+ zephir_fast_explode_str(&explodedPart$$12, SL("="), &part$$7, 2 );
+ ZEPHIR_INIT_NVAR(&_37$$12);
+ zephir_array_fetch_long(&_38$$12, &explodedPart$$12, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_37$$12, &_38$$12, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$12);
+ zephir_fast_strtolower(&namePart$$12, &_37$$12);
+ ZEPHIR_INIT_NVAR(&_39$$12);
+ zephir_array_fetch_long(&_40$$12, &explodedPart$$12, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_39$$12, &_40$$12, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_41$$12);
+ ZVAL_STRING(&_41$$12, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$12);
+ zephir_fast_trim(&valuePart$$12, &_39$$12, &_41$$12, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$3, &valuePart$$12, SL("zz"), 2, &headerName$$5, &namePart$$12);
+ } else {
+ zephir_array_update_multi(&headers$$3, &part$$7, SL("za"), 2, &headerName$$5);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$7, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&part$$7);
+ } else {
+ zephir_array_update_zval(&headers$$3, &headerName$$5, &headerValue$$5, PH_COPY | PH_SEPARATE);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &headerParts$$3, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_15$$3, &headerParts$$3, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_15$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&headerPart$$3, &headerParts$$3, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_42$$15);
+ ZVAL_STRING(&_42$$15, ":");
+ ZEPHIR_INIT_NVAR(&_43$$15);
+ zephir_fast_strpos(&_43$$15, &headerPart$$3, &_42$$15, 0 );
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_43$$15)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&exploded$$15);
+ zephir_fast_explode_str(&exploded$$15, SL(":"), &headerPart$$3, 2 );
+ ZEPHIR_INIT_NVAR(&_44$$15);
+ zephir_array_fetch_long(&_45$$15, &exploded$$15, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1803);
+ zephir_fast_trim(&_44$$15, &_45$$15, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&headerName$$15);
+ zephir_fast_strtolower(&headerName$$15, &_44$$15);
+ zephir_array_fetch_long(&_46$$15, &exploded$$15, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1804);
+ ZEPHIR_INIT_NVAR(&headerValue$$15);
+ zephir_fast_trim(&headerValue$$15, &_46$$15, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_47$$15);
+ ZVAL_STRING(&_47$$15, ";");
+ ZEPHIR_INIT_NVAR(&_48$$15);
+ zephir_fast_strpos(&_48$$15, &headerValue$$15, &_47$$15, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_48$$15)) {
+ ZEPHIR_INIT_NVAR(&explodedHeader$$17);
+ zephir_fast_explode_str(&explodedHeader$$17, SL(";"), &headerValue$$15, LONG_MAX);
+ zephir_is_iterable(&explodedHeader$$17, 0, "phalcon/Http/Request.zep", 1824);
+ if (Z_TYPE_P(&explodedHeader$$17) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&explodedHeader$$17), _49$$17)
+ {
+ ZEPHIR_INIT_NVAR(&part$$17);
+ ZVAL_COPY(&part$$17, _49$$17);
+ ZEPHIR_INIT_NVAR(&_51$$18);
+ zephir_fast_trim(&_51$$18, &part$$17, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_52$$18);
+ ZVAL_STRING(&_52$$18, "/\"/");
+ ZEPHIR_INIT_NVAR(&_53$$18);
+ ZVAL_STRING(&_53$$18, "");
+ ZEPHIR_CALL_FUNCTION(&part$$17, "preg_replace", &_28, 41, &_52$$18, &_53$$18, &_51$$18);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_52$$18);
+ ZVAL_STRING(&_52$$18, "=");
+ ZEPHIR_INIT_NVAR(&_53$$18);
+ zephir_fast_strpos(&_53$$18, &part$$17, &_52$$18, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_53$$18)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$19);
+ zephir_fast_explode_str(&explodedPart$$19, SL("="), &part$$17, 2 );
+ ZEPHIR_INIT_NVAR(&_54$$19);
+ zephir_array_fetch_long(&_55$$19, &explodedPart$$19, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_54$$19, &_55$$19, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$19);
+ zephir_fast_strtolower(&namePart$$19, &_54$$19);
+ ZEPHIR_INIT_NVAR(&_56$$19);
+ zephir_array_fetch_long(&_57$$19, &explodedPart$$19, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_56$$19, &_57$$19, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_58$$19);
+ ZVAL_STRING(&_58$$19, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$19);
+ zephir_fast_trim(&valuePart$$19, &_56$$19, &_58$$19, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$3, &valuePart$$19, SL("zz"), 2, &headerName$$15, &namePart$$19);
+ } else {
+ zephir_array_update_multi(&headers$$3, &part$$17, SL("za"), 2, &headerName$$15);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$17, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_50$$17, &explodedHeader$$17, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_50$$17)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&part$$17, &explodedHeader$$17, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_59$$21);
+ zephir_fast_trim(&_59$$21, &part$$17, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_60$$21);
+ ZVAL_STRING(&_60$$21, "/\"/");
+ ZEPHIR_INIT_NVAR(&_61$$21);
+ ZVAL_STRING(&_61$$21, "");
+ ZEPHIR_CALL_FUNCTION(&part$$17, "preg_replace", &_28, 41, &_60$$21, &_61$$21, &_59$$21);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_60$$21);
+ ZVAL_STRING(&_60$$21, "=");
+ ZEPHIR_INIT_NVAR(&_61$$21);
+ zephir_fast_strpos(&_61$$21, &part$$17, &_60$$21, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_61$$21)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$22);
+ zephir_fast_explode_str(&explodedPart$$22, SL("="), &part$$17, 2 );
+ ZEPHIR_INIT_NVAR(&_62$$22);
+ zephir_array_fetch_long(&_63$$22, &explodedPart$$22, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_62$$22, &_63$$22, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$22);
+ zephir_fast_strtolower(&namePart$$22, &_62$$22);
+ ZEPHIR_INIT_NVAR(&_64$$22);
+ zephir_array_fetch_long(&_65$$22, &explodedPart$$22, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_64$$22, &_65$$22, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_66$$22);
+ ZVAL_STRING(&_66$$22, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$22);
+ zephir_fast_trim(&valuePart$$22, &_64$$22, &_66$$22, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$3, &valuePart$$22, SL("zz"), 2, &headerName$$15, &namePart$$22);
+ } else {
+ zephir_array_update_multi(&headers$$3, &part$$17, SL("za"), 2, &headerName$$15);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$17, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&part$$17);
+ } else {
+ zephir_array_update_zval(&headers$$3, &headerName$$15, &headerValue$$15, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &headerParts$$3, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&headerPart$$3);
+ zephir_array_fetch_long(&_67$$3, &splited$$3, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1829);
+ zephir_array_fetch_string(&_68$$3, &headers$$3, SL("content-disposition"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1829);
+ ZEPHIR_OBS_NVAR(&_69$$3);
+ zephir_array_fetch_string(&_69$$3, &_68$$3, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 1829);
+ zephir_array_update_zval(&dataset, &_69$$3, &_67$$3, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &bodyParts, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_9, &bodyParts, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_9)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&bodyPart, &bodyParts, "current", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_EMPTY(&bodyPart)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_70$$25);
+ ZVAL_STRING(&_70$$25, "/\\R\\R/");
+ ZVAL_LONG(&_71$$25, 2);
+ ZEPHIR_CALL_FUNCTION(&splited$$25, "preg_split", NULL, 70, &_70$$25, &bodyPart, &_71$$25);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&headers$$25);
+ array_init(&headers$$25);
+ zephir_array_fetch_long(&_72$$25, &splited$$25, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1793);
+ ZEPHIR_INIT_NVAR(&_70$$25);
+ ZVAL_STRING(&_70$$25, "/\\R/s");
+ ZVAL_LONG(&_71$$25, -1);
+ ZVAL_LONG(&_73$$25, 1);
+ ZEPHIR_CALL_FUNCTION(&headerParts$$25, "preg_split", NULL, 70, &_70$$25, &_72$$25, &_71$$25, &_73$$25);
+ zephir_check_call_status();
+ zephir_is_iterable(&headerParts$$25, 0, "phalcon/Http/Request.zep", 1829);
+ if (Z_TYPE_P(&headerParts$$25) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&headerParts$$25), _74$$25)
+ {
+ ZEPHIR_INIT_NVAR(&headerPart$$25);
+ ZVAL_COPY(&headerPart$$25, _74$$25);
+ ZEPHIR_INIT_NVAR(&_76$$27);
+ ZVAL_STRING(&_76$$27, ":");
+ ZEPHIR_INIT_NVAR(&_77$$27);
+ zephir_fast_strpos(&_77$$27, &headerPart$$25, &_76$$27, 0 );
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_77$$27)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&exploded$$27);
+ zephir_fast_explode_str(&exploded$$27, SL(":"), &headerPart$$25, 2 );
+ ZEPHIR_INIT_NVAR(&_78$$27);
+ zephir_array_fetch_long(&_79$$27, &exploded$$27, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1803);
+ zephir_fast_trim(&_78$$27, &_79$$27, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&headerName$$27);
+ zephir_fast_strtolower(&headerName$$27, &_78$$27);
+ zephir_array_fetch_long(&_80$$27, &exploded$$27, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1804);
+ ZEPHIR_INIT_NVAR(&headerValue$$27);
+ zephir_fast_trim(&headerValue$$27, &_80$$27, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_81$$27);
+ ZVAL_STRING(&_81$$27, ";");
+ ZEPHIR_INIT_NVAR(&_82$$27);
+ zephir_fast_strpos(&_82$$27, &headerValue$$27, &_81$$27, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_82$$27)) {
+ ZEPHIR_INIT_NVAR(&explodedHeader$$29);
+ zephir_fast_explode_str(&explodedHeader$$29, SL(";"), &headerValue$$27, LONG_MAX);
+ zephir_is_iterable(&explodedHeader$$29, 0, "phalcon/Http/Request.zep", 1824);
+ if (Z_TYPE_P(&explodedHeader$$29) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&explodedHeader$$29), _83$$29)
+ {
+ ZEPHIR_INIT_NVAR(&part$$29);
+ ZVAL_COPY(&part$$29, _83$$29);
+ ZEPHIR_INIT_NVAR(&_85$$30);
+ zephir_fast_trim(&_85$$30, &part$$29, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_86$$30);
+ ZVAL_STRING(&_86$$30, "/\"/");
+ ZEPHIR_INIT_NVAR(&_87$$30);
+ ZVAL_STRING(&_87$$30, "");
+ ZEPHIR_CALL_FUNCTION(&part$$29, "preg_replace", &_28, 41, &_86$$30, &_87$$30, &_85$$30);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_86$$30);
+ ZVAL_STRING(&_86$$30, "=");
+ ZEPHIR_INIT_NVAR(&_87$$30);
+ zephir_fast_strpos(&_87$$30, &part$$29, &_86$$30, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_87$$30)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$31);
+ zephir_fast_explode_str(&explodedPart$$31, SL("="), &part$$29, 2 );
+ ZEPHIR_INIT_NVAR(&_88$$31);
+ zephir_array_fetch_long(&_89$$31, &explodedPart$$31, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_88$$31, &_89$$31, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$31);
+ zephir_fast_strtolower(&namePart$$31, &_88$$31);
+ ZEPHIR_INIT_NVAR(&_90$$31);
+ zephir_array_fetch_long(&_91$$31, &explodedPart$$31, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_90$$31, &_91$$31, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_92$$31);
+ ZVAL_STRING(&_92$$31, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$31);
+ zephir_fast_trim(&valuePart$$31, &_90$$31, &_92$$31, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$25, &valuePart$$31, SL("zz"), 2, &headerName$$27, &namePart$$31);
+ } else {
+ zephir_array_update_multi(&headers$$25, &part$$29, SL("za"), 2, &headerName$$27);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$29, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_84$$29, &explodedHeader$$29, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_84$$29)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&part$$29, &explodedHeader$$29, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_93$$33);
+ zephir_fast_trim(&_93$$33, &part$$29, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_94$$33);
+ ZVAL_STRING(&_94$$33, "/\"/");
+ ZEPHIR_INIT_NVAR(&_95$$33);
+ ZVAL_STRING(&_95$$33, "");
+ ZEPHIR_CALL_FUNCTION(&part$$29, "preg_replace", &_28, 41, &_94$$33, &_95$$33, &_93$$33);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_94$$33);
+ ZVAL_STRING(&_94$$33, "=");
+ ZEPHIR_INIT_NVAR(&_95$$33);
+ zephir_fast_strpos(&_95$$33, &part$$29, &_94$$33, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_95$$33)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$34);
+ zephir_fast_explode_str(&explodedPart$$34, SL("="), &part$$29, 2 );
+ ZEPHIR_INIT_NVAR(&_96$$34);
+ zephir_array_fetch_long(&_97$$34, &explodedPart$$34, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_96$$34, &_97$$34, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$34);
+ zephir_fast_strtolower(&namePart$$34, &_96$$34);
+ ZEPHIR_INIT_NVAR(&_98$$34);
+ zephir_array_fetch_long(&_99$$34, &explodedPart$$34, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_98$$34, &_99$$34, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_100$$34);
+ ZVAL_STRING(&_100$$34, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$34);
+ zephir_fast_trim(&valuePart$$34, &_98$$34, &_100$$34, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$25, &valuePart$$34, SL("zz"), 2, &headerName$$27, &namePart$$34);
+ } else {
+ zephir_array_update_multi(&headers$$25, &part$$29, SL("za"), 2, &headerName$$27);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$29, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&part$$29);
+ } else {
+ zephir_array_update_zval(&headers$$25, &headerName$$27, &headerValue$$27, PH_COPY | PH_SEPARATE);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &headerParts$$25, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_75$$25, &headerParts$$25, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_75$$25)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&headerPart$$25, &headerParts$$25, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_101$$37);
+ ZVAL_STRING(&_101$$37, ":");
+ ZEPHIR_INIT_NVAR(&_102$$37);
+ zephir_fast_strpos(&_102$$37, &headerPart$$25, &_101$$37, 0 );
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_102$$37)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&exploded$$37);
+ zephir_fast_explode_str(&exploded$$37, SL(":"), &headerPart$$25, 2 );
+ ZEPHIR_INIT_NVAR(&_103$$37);
+ zephir_array_fetch_long(&_104$$37, &exploded$$37, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1803);
+ zephir_fast_trim(&_103$$37, &_104$$37, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&headerName$$37);
+ zephir_fast_strtolower(&headerName$$37, &_103$$37);
+ zephir_array_fetch_long(&_105$$37, &exploded$$37, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1804);
+ ZEPHIR_INIT_NVAR(&headerValue$$37);
+ zephir_fast_trim(&headerValue$$37, &_105$$37, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_106$$37);
+ ZVAL_STRING(&_106$$37, ";");
+ ZEPHIR_INIT_NVAR(&_107$$37);
+ zephir_fast_strpos(&_107$$37, &headerValue$$37, &_106$$37, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_107$$37)) {
+ ZEPHIR_INIT_NVAR(&explodedHeader$$39);
+ zephir_fast_explode_str(&explodedHeader$$39, SL(";"), &headerValue$$37, LONG_MAX);
+ zephir_is_iterable(&explodedHeader$$39, 0, "phalcon/Http/Request.zep", 1824);
+ if (Z_TYPE_P(&explodedHeader$$39) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&explodedHeader$$39), _108$$39)
+ {
+ ZEPHIR_INIT_NVAR(&part$$39);
+ ZVAL_COPY(&part$$39, _108$$39);
+ ZEPHIR_INIT_NVAR(&_110$$40);
+ zephir_fast_trim(&_110$$40, &part$$39, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_111$$40);
+ ZVAL_STRING(&_111$$40, "/\"/");
+ ZEPHIR_INIT_NVAR(&_112$$40);
+ ZVAL_STRING(&_112$$40, "");
+ ZEPHIR_CALL_FUNCTION(&part$$39, "preg_replace", &_28, 41, &_111$$40, &_112$$40, &_110$$40);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_111$$40);
+ ZVAL_STRING(&_111$$40, "=");
+ ZEPHIR_INIT_NVAR(&_112$$40);
+ zephir_fast_strpos(&_112$$40, &part$$39, &_111$$40, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_112$$40)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$41);
+ zephir_fast_explode_str(&explodedPart$$41, SL("="), &part$$39, 2 );
+ ZEPHIR_INIT_NVAR(&_113$$41);
+ zephir_array_fetch_long(&_114$$41, &explodedPart$$41, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_113$$41, &_114$$41, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$41);
+ zephir_fast_strtolower(&namePart$$41, &_113$$41);
+ ZEPHIR_INIT_NVAR(&_115$$41);
+ zephir_array_fetch_long(&_116$$41, &explodedPart$$41, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_115$$41, &_116$$41, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_117$$41);
+ ZVAL_STRING(&_117$$41, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$41);
+ zephir_fast_trim(&valuePart$$41, &_115$$41, &_117$$41, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$25, &valuePart$$41, SL("zz"), 2, &headerName$$37, &namePart$$41);
+ } else {
+ zephir_array_update_multi(&headers$$25, &part$$39, SL("za"), 2, &headerName$$37);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$39, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_109$$39, &explodedHeader$$39, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_109$$39)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&part$$39, &explodedHeader$$39, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_118$$43);
+ zephir_fast_trim(&_118$$43, &part$$39, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_119$$43);
+ ZVAL_STRING(&_119$$43, "/\"/");
+ ZEPHIR_INIT_NVAR(&_120$$43);
+ ZVAL_STRING(&_120$$43, "");
+ ZEPHIR_CALL_FUNCTION(&part$$39, "preg_replace", &_28, 41, &_119$$43, &_120$$43, &_118$$43);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_119$$43);
+ ZVAL_STRING(&_119$$43, "=");
+ ZEPHIR_INIT_NVAR(&_120$$43);
+ zephir_fast_strpos(&_120$$43, &part$$39, &_119$$43, 0 );
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_120$$43)) {
+ ZEPHIR_INIT_NVAR(&explodedPart$$44);
+ zephir_fast_explode_str(&explodedPart$$44, SL("="), &part$$39, 2 );
+ ZEPHIR_INIT_NVAR(&_121$$44);
+ zephir_array_fetch_long(&_122$$44, &explodedPart$$44, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1816);
+ zephir_fast_trim(&_121$$44, &_122$$44, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&namePart$$44);
+ zephir_fast_strtolower(&namePart$$44, &_121$$44);
+ ZEPHIR_INIT_NVAR(&_123$$44);
+ zephir_array_fetch_long(&_124$$44, &explodedPart$$44, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1817);
+ zephir_fast_trim(&_123$$44, &_124$$44, NULL , ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_NVAR(&_125$$44);
+ ZVAL_STRING(&_125$$44, "\"");
+ ZEPHIR_INIT_NVAR(&valuePart$$44);
+ zephir_fast_trim(&valuePart$$44, &_123$$44, &_125$$44, ZEPHIR_TRIM_BOTH);
+ zephir_array_update_multi(&headers$$25, &valuePart$$44, SL("zz"), 2, &headerName$$37, &namePart$$44);
+ } else {
+ zephir_array_update_multi(&headers$$25, &part$$39, SL("za"), 2, &headerName$$37);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &explodedHeader$$39, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&part$$39);
+ } else {
+ zephir_array_update_zval(&headers$$25, &headerName$$37, &headerValue$$37, PH_COPY | PH_SEPARATE);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &headerParts$$25, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&headerPart$$25);
+ zephir_array_fetch_long(&_126$$25, &splited$$25, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1829);
+ zephir_array_fetch_string(&_127$$25, &headers$$25, SL("content-disposition"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1829);
+ ZEPHIR_OBS_NVAR(&_128$$25);
+ zephir_array_fetch_string(&_128$$25, &_127$$25, SL("name"), PH_NOISY, "phalcon/Http/Request.zep", 1829);
+ zephir_array_update_zval(&dataset, &_128$$25, &_126$$25, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, &bodyParts, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&bodyPart);
+ RETURN_CTOR(&dataset);
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Text)
+zend_object *zephir_init_properties_Phalcon_Http_Request(zend_class_entry *class_type)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, Text, phalcon, forms_element_text, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ zval _0, _1$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+
- return SUCCESS;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ {
+ zval local_this_ptr, *this_ptr = &local_this_ptr;
+ ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("queryFilters"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("queryFilters"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
}
@@ -160693,14 +157345,63 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Text)
-ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_TextArea)
+ZEPHIR_INIT_CLASS(Phalcon_Http_RequestInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Forms\\Element, TextArea, phalcon, forms_element_textarea, phalcon_forms_element_abstractelement_ce, NULL, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http, RequestInterface, phalcon, http_requestinterface, phalcon_http_requestinterface_method_entry);
- zend_declare_property_string(phalcon_forms_element_textarea_ce, SL("method"), "inputTextarea", ZEND_ACC_PROTECTED);
return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, get);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getAcceptableContent);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getBasicAuth);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getBestAccept);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getBestCharset);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getBestLanguage);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getClientAddress);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getClientCharsets);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getContentType);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getDigestAuth);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getHeader);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getHeaders);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getHttpHost);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getHTTPReferer);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getJsonRawBody);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getLanguages);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getMethod);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getPort);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getURI);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getPost);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getPut);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getQuery);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getRawBody);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getScheme);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getServer);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getServerAddress);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getServerName);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getUploadedFiles);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, getUserAgent);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, has);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, hasFiles);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, hasHeader);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, hasQuery);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, hasPost);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, hasPut);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, hasServer);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isAjax);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isConnect);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isDelete);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isGet);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isHead);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isMethod);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isOptions);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isPost);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isPurge);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isPut);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isSecure);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isSoap);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, isTrace);
+ZEPHIR_DOC_METHOD(Phalcon_Http_RequestInterface, numFiles);
@@ -160711,1528 +157412,1494 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_TextArea)
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Response)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, Exception, phalcon, translate_exception, zend_ce_exception, NULL, 0);
-
- return SUCCESS;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Http, Response, phalcon, http_response, phalcon_http_response_method_entry, 0);
-ZEPHIR_INIT_CLASS(Phalcon_Translate_InterpolatorFactory)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, InterpolatorFactory, phalcon, translate_interpolatorfactory, phalcon_factory_abstractfactory_ce, phalcon_translate_interpolatorfactory_method_entry, 0);
+ zend_declare_property_null(phalcon_http_response_ce, SL("container"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_ce, SL("content"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_ce, SL("cookies"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_ce, SL("file"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_ce, SL("headers"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_response_ce, SL("sent"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_ce, SL("statusCodes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_ce, SL("encode"), ZEND_ACC_PRIVATE);
+ phalcon_http_response_ce->create_object = zephir_init_properties_Phalcon_Http_Response;
+ zend_class_implements(phalcon_http_response_ce, 1, phalcon_http_responseinterface_ce);
+ zend_class_implements(phalcon_http_response_ce, 1, phalcon_di_injectionawareinterface_ce);
+ zend_class_implements(phalcon_http_response_ce, 1, phalcon_events_eventsawareinterface_ce);
+ zend_class_implements(phalcon_http_response_ce, 1, phalcon_http_message_responsestatuscodeinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, __construct)
+static PHP_METHOD(Phalcon_Http_Response, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *services_param = NULL;
- zval services;
+ zval *content_param = NULL, *code = NULL, code_sub, *status = NULL, status_sub, __$null, _0, _1;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&services);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&code_sub);
+ ZVAL_UNDEF(&status_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 3)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
+ Z_PARAM_STR_OR_NULL(content)
+ Z_PARAM_ZVAL_OR_NULL(code)
+ Z_PARAM_ZVAL_OR_NULL(status)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+ zephir_fetch_params(1, 0, 3, &content_param, &code, &status);
+ if (!content_param) {
+ ZEPHIR_INIT_VAR(&content);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ if (UNEXPECTED(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) {
+ zephir_get_strval(&content, content_param);
+ } else {
+ ZEPHIR_INIT_VAR(&content);
+ }
+ }
+ if (!code) {
+ code = &code_sub;
+ code = &__$null;
+ }
+ if (!status) {
+ status = &status_sub;
+ status = &__$null;
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, phalcon_http_response_headers_ce);
+ if (zephir_has_constructor(&_0)) {
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_0);
+ ZEPHIR_INIT_VAR(&_1);
+ object_init_ex(&_1, phalcon_support_helper_json_encode_ce);
+ if (zephir_has_constructor(&_1)) {
+ ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 0);
+ zephir_check_call_status();
+ }
+
+ zephir_update_property_zval(this_ptr, ZEND_STRL("encode"), &_1);
+ if (!ZEPHIR_IS_NULL(&content)) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontent", NULL, 0, &content);
+ zephir_check_call_status();
+ }
+ if (Z_TYPE_P(code) != IS_NULL) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, code, status);
+ zephir_check_call_status();
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
- zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, newInstance)
+static PHP_METHOD(Phalcon_Http_Response, appendContent)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, definition;
- zval name;
+ zval *content, content_sub, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&content_sub);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
+ Z_PARAM_ZVAL(content)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
- zephir_check_call_status();
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(return_value, &definition);
+ zephir_fetch_params(1, 1, 0, &content);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "getcontent", NULL, 0);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_VV(&_1, &_0, content);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("content"), &_1);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, getExceptionClass)
+static PHP_METHOD(Phalcon_Http_Response, getContent)
{
+ zval _1;
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
- RETURN_STRING("Phalcon\\Translate\\Exception");
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ zephir_memory_observe(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("content"), PH_NOISY_CC);
+ zephir_cast_to_string(&_1, &_0);
+ RETURN_CTOR(&_1);
}
-static PHP_METHOD(Phalcon_Translate_InterpolatorFactory, getServices)
+static PHP_METHOD(Phalcon_Http_Response, getCookies)
{
- zephir_create_array(return_value, 2, 0);
- add_assoc_stringl_ex(return_value, SL("associativeArray"), SL("Phalcon\\Translate\\Interpolator\\AssociativeArray"));
- add_assoc_stringl_ex(return_value, SL("indexedArray"), SL("Phalcon\\Translate\\Interpolator\\IndexedArray"));
- return;
+ RETURN_MEMBER(getThis(), "cookies");
}
+static PHP_METHOD(Phalcon_Http_Response, getDI)
+{
+ zval container, _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_0);
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection container is required to access the 'url' service", "phalcon/Http/Response.zep", 153);
+ return;
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container);
+ }
+ RETURN_CCTOR(&container);
+}
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
+static PHP_METHOD(Phalcon_Http_Response, getEventsManager)
+{
+ RETURN_MEMBER(getThis(), "eventsManager");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Translate_TranslateFactory)
+static PHP_METHOD(Phalcon_Http_Response, getHeaders)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate, TranslateFactory, phalcon, translate_translatefactory, phalcon_factory_abstractfactory_ce, phalcon_translate_translatefactory_method_entry, 0);
- zend_declare_property_null(phalcon_translate_translatefactory_ce, SL("interpolator"), ZEND_ACC_PRIVATE);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "headers");
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, __construct)
+static PHP_METHOD(Phalcon_Http_Response, getReasonPhrase)
{
+ zval statusReasonPhrase, _0, _1, _2, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval services;
- zval *interpolator, interpolator_sub, *services_param = NULL;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_UNDEF(&services);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(services)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&statusReasonPhrase);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &interpolator, &services_param);
- if (!services_param) {
- ZEPHIR_INIT_VAR(&services);
- array_init(&services);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "Status");
+ ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &_2);
+ zephir_check_call_status();
+ ZVAL_LONG(&_3, 4);
+ ZEPHIR_INIT_VAR(&statusReasonPhrase);
+ zephir_substr(&statusReasonPhrase, &_1, 4 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ ZEPHIR_INIT_NVAR(&_2);
+ if (zephir_is_true(&statusReasonPhrase)) {
+ ZEPHIR_CPY_WRT(&_2, &statusReasonPhrase);
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_NULL(&_2);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("interpolator"), interpolator);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_CCTOR(&_2);
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, load)
+static PHP_METHOD(Phalcon_Http_Response, getStatusCode)
{
+ zval statusCode, _0, _1, _2, _3, _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *config = NULL, config_sub, name, options, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&config_sub);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&statusCode);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(config)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &config);
- ZEPHIR_SEPARATE_PARAM(config);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfig", NULL, 0, config);
- zephir_check_call_status();
- ZEPHIR_CPY_WRT(config, &_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "adapter");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfigelement", NULL, 0, config, &_1);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_STRING(&_2, "Status");
+ ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &_2);
zephir_check_call_status();
- ZEPHIR_CPY_WRT(config, &_0);
- zephir_memory_observe(&name);
- zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Translate/TranslateFactory.zep", 72);
- zephir_memory_observe(&options);
- if (!(zephir_array_isset_string_fetch(&options, config, SL("options"), 0))) {
- ZEPHIR_INIT_NVAR(&options);
- array_init(&options);
+ ZVAL_LONG(&_3, 0);
+ ZVAL_LONG(&_4, 3);
+ ZEPHIR_INIT_VAR(&statusCode);
+ zephir_substr(&statusCode, &_1, 0 , 3 , 0);
+ ZEPHIR_INIT_NVAR(&_2);
+ if (zephir_is_true(&statusCode)) {
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_LONG(&_2, zephir_get_intval(&statusCode));
+ } else {
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_NULL(&_2);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_CCTOR(&_2);
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, newInstance)
+static PHP_METHOD(Phalcon_Http_Response, hasHeader)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options, _0;
- zval *name_param = NULL, *options_param = NULL, definition, _1;
+ zval *name_param = NULL, headers;
zval name;
zval *this_ptr = getThis();
ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&definition);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 2)
+ ZVAL_UNDEF(&headers);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &options_param);
- if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
- zephir_get_strval(&name, name_param);
- } else {
- ZEPHIR_INIT_VAR(&name);
- }
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+ ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 2, 0);
- zephir_memory_observe(&_1);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("interpolator"), PH_NOISY_CC);
- zephir_array_fast_append(&_0, &_1);
- zephir_array_fast_append(&_0, &options);
- ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &_0);
+ ZEPHIR_RETURN_CALL_METHOD(&headers, "has", NULL, 0, &name);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, getExceptionClass)
-{
-
- RETURN_STRING("Phalcon\\Translate\\Exception");
-}
-
-static PHP_METHOD(Phalcon_Translate_TranslateFactory, getServices)
-{
-
- zephir_create_array(return_value, 3, 0);
- add_assoc_stringl_ex(return_value, SL("csv"), SL("Phalcon\\Translate\\Adapter\\Csv"));
- add_assoc_stringl_ex(return_value, SL("gettext"), SL("Phalcon\\Translate\\Adapter\\Gettext"));
- add_assoc_stringl_ex(return_value, SL("array"), SL("Phalcon\\Translate\\Adapter\\NativeArray"));
- return;
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Interpolator_AssociativeArray)
+static PHP_METHOD(Phalcon_Http_Response, isSent)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Translate\\Interpolator, AssociativeArray, phalcon, translate_interpolator_associativearray, phalcon_translate_interpolator_associativearray_method_entry, 0);
- zend_class_implements(phalcon_translate_interpolator_associativearray_ce, 1, phalcon_translate_interpolator_interpolatorinterface_ce);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "sent");
}
-static PHP_METHOD(Phalcon_Translate_Interpolator_AssociativeArray, replacePlaceholders)
+static PHP_METHOD(Phalcon_Http_Response, redirect)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translation_param = NULL, *placeholders_param = NULL, interpolate;
- zval translation;
+ zend_long statusCode, ZEPHIR_LAST_CALL_STATUS;
+ zend_bool externalRedirect, _11, _0$$5;
+ zval *location = NULL, location_sub, *externalRedirect_param = NULL, *statusCode_param = NULL, __$null, header, url, container, matched, view, _8, _9, _12, _1$$5, _2$$5, _3$$6, _4$$6, _5$$6, _6$$10, _7$$10, _10$$11;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&interpolate);
- ZVAL_UNDEF(&placeholders);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translation)
+ ZVAL_UNDEF(&location_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&header);
+ ZVAL_UNDEF(&url);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&matched);
+ ZVAL_UNDEF(&view);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_3$$6);
+ ZVAL_UNDEF(&_4$$6);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$10);
+ ZVAL_UNDEF(&_7$$10);
+ ZVAL_UNDEF(&_10$$11);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 3)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ZVAL_OR_NULL(location)
+ Z_PARAM_BOOL(externalRedirect)
+ Z_PARAM_LONG(statusCode)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translation_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translation_param) != IS_STRING && Z_TYPE_P(translation_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translation' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(translation_param) == IS_STRING)) {
- zephir_get_strval(&translation, translation_param);
+ zephir_fetch_params(1, 0, 3, &location, &externalRedirect_param, &statusCode_param);
+ if (!location) {
+ location = &location_sub;
+ ZEPHIR_CPY_WRT(location, &__$null);
} else {
- ZEPHIR_INIT_VAR(&translation);
+ ZEPHIR_SEPARATE_PARAM(location);
}
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+ if (!externalRedirect_param) {
+ externalRedirect = 0;
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
- }
- ZEPHIR_INIT_VAR(&interpolate);
- object_init_ex(&interpolate, phalcon_support_helper_str_interpolate_ce);
- if (zephir_has_constructor(&interpolate)) {
- ZEPHIR_CALL_METHOD(NULL, &interpolate, "__construct", NULL, 0);
- zephir_check_call_status();
- }
-
- ZEPHIR_RETURN_CALL_METHOD(&interpolate, "__invoke", NULL, 0, &translation, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Interpolator_IndexedArray)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Translate\\Interpolator, IndexedArray, phalcon, translate_interpolator_indexedarray, phalcon_translate_interpolator_indexedarray_method_entry, 0);
-
- zend_class_implements(phalcon_translate_interpolator_indexedarray_ce, 1, phalcon_translate_interpolator_interpolatorinterface_ce);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Translate_Interpolator_IndexedArray, replacePlaceholders)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translation_param = NULL, *placeholders_param = NULL, _0$$3;
- zval translation;
-
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&placeholders);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translation)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translation_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translation_param) != IS_STRING && Z_TYPE_P(translation_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translation' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(translation_param) == IS_STRING)) {
- zephir_get_strval(&translation, translation_param);
+ }
+ if (!statusCode_param) {
+ statusCode = 302;
} else {
- ZEPHIR_INIT_VAR(&translation);
+ }
+ if (!(zephir_is_true(location))) {
+ ZEPHIR_INIT_NVAR(location);
+ ZVAL_STRING(location, "");
}
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+ if (externalRedirect) {
+ ZEPHIR_CPY_WRT(&header, location);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ _0$$5 = Z_TYPE_P(location) == IS_STRING;
+ if (_0$$5) {
+ ZEPHIR_INIT_VAR(&_1$$5);
+ ZVAL_STRING(&_1$$5, "://");
+ ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 355, location, &_1$$5);
+ zephir_check_call_status();
+ _0$$5 = zephir_is_true(&_2$$5);
+ }
+ if (_0$$5) {
+ ZEPHIR_INIT_VAR(&_3$$6);
+ ZEPHIR_INIT_VAR(&_4$$6);
+ ZVAL_STRING(&_4$$6, "/^[^:\\/?#]++:/");
+ ZEPHIR_INIT_VAR(&_5$$6);
+ ZVAL_STRING(&_5$$6, "/^[^:\\/?#]++:/");
+ ZEPHIR_INIT_VAR(&matched);
+ zephir_preg_match(&matched, &_5$$6, location, &_3$$6, 0, 0 , 0 );
+ if (zephir_is_true(&matched)) {
+ ZEPHIR_CPY_WRT(&header, location);
+ } else {
+ ZEPHIR_INIT_NVAR(&header);
+ ZVAL_NULL(&header);
+ }
+ } else {
+ ZEPHIR_INIT_NVAR(&header);
+ ZVAL_NULL(&header);
+ }
}
- if (1 != ZEPHIR_IS_EMPTY(&placeholders)) {
- ZEPHIR_MAKE_REF(&placeholders);
- ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 270, &placeholders, &translation);
- ZEPHIR_UNREF(&placeholders);
+ ZEPHIR_CALL_METHOD(&container, this_ptr, "getdi", NULL, 0);
+ zephir_check_call_status();
+ if (!(zephir_is_true(&header))) {
+ ZEPHIR_INIT_VAR(&_7$$10);
+ ZVAL_STRING(&_7$$10, "url");
+ ZEPHIR_CALL_METHOD(&_6$$10, &container, "getshared", NULL, 0, &_7$$10);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0$$3);
- ZVAL_STRING(&_0$$3, "sprintf");
- ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0$$3, &placeholders);
+ ZEPHIR_CPY_WRT(&url, &_6$$10);
+ ZEPHIR_CALL_METHOD(&header, &url, "get", NULL, 0, location);
zephir_check_call_status();
- RETURN_MM();
- }
- RETURN_CTOR(&translation);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Interpolator_InterpolatorInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Translate\\Interpolator, InterpolatorInterface, phalcon, translate_interpolator_interpolatorinterface, phalcon_translate_interpolator_interpolatorinterface_method_entry);
-
- return SUCCESS;
-}
-
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Interpolator_InterpolatorInterface, replacePlaceholders);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_AbstractAdapter)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Translate\\Adapter, AbstractAdapter, phalcon, translate_adapter_abstractadapter, phalcon_translate_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_string(phalcon_translate_adapter_abstractadapter_ce, SL("defaultInterpolator"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_translate_adapter_abstractadapter_ce, SL("interpolatorFactory"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_translate_adapter_abstractadapter_ce, 1, phalcon_translate_adapter_adapterinterface_ce);
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval options;
- zval *interpolator, interpolator_sub, *options_param = NULL, value;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &interpolator, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- zephir_get_arrval(&options, options_param);
- }
- zephir_memory_observe(&value);
- if (!(zephir_array_isset_string_fetch(&value, &options, SL("defaultInterpolator"), 0))) {
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_STRING(&value, "associativeArray");
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultInterpolator"), &value);
- zephir_update_property_zval(this_ptr, ZEND_STRL("interpolatorFactory"), interpolator);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, _)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translateKey_param = NULL, *placeholders_param = NULL;
- zval translateKey;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&placeholders);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translateKey_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translateKey_param) != IS_STRING && Z_TYPE_P(translateKey_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translateKey' must be of the type string"));
- RETURN_MM_NULL();
+ ZEPHIR_INIT_VAR(&_9);
+ ZVAL_STRING(&_9, "view");
+ ZEPHIR_CALL_METHOD(&_8, &container, "has", NULL, 0, &_9);
+ zephir_check_call_status();
+ if (zephir_is_true(&_8)) {
+ ZEPHIR_INIT_VAR(&_10$$11);
+ ZVAL_STRING(&_10$$11, "view");
+ ZEPHIR_CALL_METHOD(&view, &container, "getshared", NULL, 0, &_10$$11);
+ zephir_check_call_status();
+ if (zephir_instance_of_ev(&view, phalcon_mvc_viewinterface_ce)) {
+ ZEPHIR_CALL_METHOD(NULL, &view, "disable", NULL, 0);
+ zephir_check_call_status();
+ }
}
- if (EXPECTED(Z_TYPE_P(translateKey_param) == IS_STRING)) {
- zephir_get_strval(&translateKey, translateKey_param);
- } else {
- ZEPHIR_INIT_VAR(&translateKey);
+ _11 = statusCode < 300;
+ if (!(_11)) {
+ _11 = statusCode > 308;
}
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
- } else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ if (_11) {
+ statusCode = 302;
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, &translateKey, &placeholders);
+ ZVAL_LONG(&_12, statusCode);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, &_12);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&_9);
+ ZVAL_STRING(&_9, "Location");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_9, &header);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetExists)
+static PHP_METHOD(Phalcon_Http_Response, removeHeader)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *translateKey, translateKey_sub;
+ zval *name_param = NULL, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey_sub);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(translateKey)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &translateKey);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, translateKey);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &name);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetGet)
+static PHP_METHOD(Phalcon_Http_Response, resetHeaders)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval translateKey_sub;
- zval *translateKey;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(translateKey)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &translateKey);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, translateKey);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetSet)
-{
- zval *offset, offset_sub, *value, value_sub;
-
- ZVAL_UNDEF(&offset_sub);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(offset)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(2, 0, &offset, &value);
- ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_translate_exception_ce, "Translate is an immutable ArrayAccess object", "phalcon/Translate/Adapter/AbstractAdapter.zep", 103);
- return;
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetUnset)
-{
- zval *offset, offset_sub;
- ZVAL_UNDEF(&offset_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(offset)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &offset);
- ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_translate_exception_ce, "Translate is an immutable ArrayAccess object", "phalcon/Translate/Adapter/AbstractAdapter.zep", 115);
- return;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "reset", NULL, 0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, t)
+static PHP_METHOD(Phalcon_Http_Response, send)
{
+ zend_bool _3$$5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, __$false, content, file, _0, _1, _2$$5;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translateKey_param = NULL, *placeholders_param = NULL;
- zval translateKey;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&placeholders);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&content);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2$$5);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translateKey_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translateKey_param) != IS_STRING && Z_TYPE_P(translateKey_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translateKey' must be of the type string"));
- RETURN_MM_NULL();
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("sent"), PH_NOISY_CC | PH_READONLY);
+ if (UNEXPECTED(zephir_is_true(&_0))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "Response was already sent", "phalcon/Http/Response.zep", 343);
+ return;
}
- if (EXPECTED(Z_TYPE_P(translateKey_param) == IS_STRING)) {
- zephir_get_strval(&translateKey, translateKey_param);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "sendheaders", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "sendcookies", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("content"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&content, &_1);
+ if (Z_TYPE_P(&content) != IS_NULL) {
+ zend_print_zval(&content, 0);
} else {
- ZEPHIR_INIT_VAR(&translateKey);
+ zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&file, &_2$$5);
+ _3$$5 = Z_TYPE_P(&file) == IS_STRING;
+ if (_3$$5) {
+ _3$$5 = ((zephir_fast_strlen_ev(&file)) ? 1 : 0);
+ }
+ if (_3$$5) {
+ ZEPHIR_CALL_FUNCTION(NULL, "readfile", NULL, 356, &file);
+ zephir_check_call_status();
+ }
}
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sent"), &__$true);
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("sent"), &__$false);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "query", NULL, 0, &translateKey, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, replacePlaceholders)
+static PHP_METHOD(Phalcon_Http_Response, sendCookies)
{
+ zval cookies, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translation_param = NULL, *placeholders_param = NULL, interpolator, _0, _1;
- zval translation;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&interpolator);
+ ZVAL_UNDEF(&cookies);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&placeholders);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translation)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translation_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translation_param) != IS_STRING && Z_TYPE_P(translation_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translation' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(translation_param) == IS_STRING)) {
- zephir_get_strval(&translation, translation_param);
- } else {
- ZEPHIR_INIT_VAR(&translation);
- }
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
- } else {
- zephir_get_arrval(&placeholders, placeholders_param);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("interpolatorFactory"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("defaultInterpolator"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&interpolator, &_0, "newinstance", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&interpolator, "replaceplaceholders", NULL, 0, &translation, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_AdapterInterface)
-{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Translate\\Adapter, AdapterInterface, phalcon, translate_adapter_adapterinterface, phalcon_translate_adapter_adapterinterface_method_entry);
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&cookies, &_0);
+ if (Z_TYPE_P(&cookies) == IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(NULL, &cookies, "send", NULL, 0);
+ zephir_check_call_status();
+ }
+ RETURN_THIS();
}
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Adapter_AdapterInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Adapter_AdapterInterface, query);
-ZEPHIR_DOC_METHOD(Phalcon_Translate_Adapter_AdapterInterface, t);
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_Csv)
+static PHP_METHOD(Phalcon_Http_Response, sendHeaders)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate\\Adapter, Csv, phalcon, translate_adapter_csv, phalcon_translate_adapter_abstractadapter_ce, phalcon_translate_adapter_csv_method_entry, 0);
+ zend_bool _3;
+ zval eventsManager, headers, result, _0, _1$$3, _2$$3, _4$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *this_ptr = getThis();
- zend_declare_property_null(phalcon_translate_adapter_csv_ce, SL("translate"), ZEND_ACC_PROTECTED);
- phalcon_translate_adapter_csv_ce->create_object = zephir_init_properties_Phalcon_Translate_Adapter_Csv;
+ ZVAL_UNDEF(&eventsManager);
+ ZVAL_UNDEF(&headers);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$5);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zend_class_implements(phalcon_translate_adapter_csv_ce, 1, zend_ce_arrayaccess);
- return SUCCESS;
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&headers, &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&eventsManager, &_0);
+ if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "response:beforeSendHeaders");
+ ZEPHIR_CALL_METHOD(&_1$$3, &eventsManager, "fire", NULL, 0, &_2$$3, this_ptr);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$3)) {
+ RETURN_MM_BOOL(0);
+ }
+ }
+ ZEPHIR_CALL_METHOD(&result, &headers, "send", NULL, 0);
+ zephir_check_call_status();
+ _3 = ZEPHIR_IS_TRUE_IDENTICAL(&result);
+ if (_3) {
+ _3 = Z_TYPE_P(&eventsManager) == IS_OBJECT;
+ }
+ if (_3) {
+ ZEPHIR_INIT_VAR(&_4$$5);
+ ZVAL_STRING(&_4$$5, "response:afterSendHeaders");
+ ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_4$$5, this_ptr);
+ zephir_check_call_status();
+ }
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, __construct)
+static PHP_METHOD(Phalcon_Http_Response, setCache)
{
+ zval _1, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *interpolator, interpolator_sub, *options_param = NULL, delimiter, enclosure, _0, _1;
+ zval *minutes_param = NULL, date, _0, _2, _4;
+ zend_long minutes, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_UNDEF(&delimiter);
- ZVAL_UNDEF(&enclosure);
+ ZVAL_UNDEF(&date);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_ARRAY(options)
+ ZVAL_UNDEF(&_3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(minutes)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
- zephir_get_arrval(&options, options_param);
- ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_csv_ce, getThis(), "__construct", NULL, 0, interpolator, &options);
- zephir_check_call_status();
- if (UNEXPECTED(!(zephir_array_isset_string(&options, SL("content"))))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Parameter 'content' is required", "phalcon/Translate/Adapter/Csv.zep", 48);
- return;
- }
- if (zephir_array_isset_string(&options, SL("delimiter"))) {
- zephir_memory_observe(&delimiter);
- zephir_array_fetch_string(&delimiter, &options, SL("delimiter"), PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 52);
- } else {
- ZEPHIR_INIT_NVAR(&delimiter);
- ZVAL_STRING(&delimiter, ";");
- }
- if (zephir_array_isset_string(&options, SL("enclosure"))) {
- zephir_memory_observe(&enclosure);
- zephir_array_fetch_string(&enclosure, &options, SL("enclosure"), PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 58);
- } else {
- ZEPHIR_INIT_NVAR(&enclosure);
- ZVAL_STRING(&enclosure, "\"");
+ zephir_fetch_params(1, 1, 0, &minutes_param);
+ if (UNEXPECTED(Z_TYPE_P(minutes_param) != IS_LONG)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'minutes' must be of the type int"));
+ RETURN_MM_NULL();
}
- zephir_array_fetch_string(&_0, &options, SL("content"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Csv.zep", 63);
- ZVAL_LONG(&_1, 0);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, &_0, &_1, &delimiter, &enclosure);
+ minutes = Z_LVAL_P(minutes_param);
+ ZEPHIR_INIT_VAR(&date);
+ object_init_ex(&date, php_date_get_date_ce());
+ ZEPHIR_CALL_METHOD(NULL, &date, "__construct", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_LONG(&_0, minutes);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_SVS(&_1, "+", &_0, " minutes");
+ ZEPHIR_CALL_METHOD(NULL, &date, "modify", NULL, 0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setexpires", NULL, 0, &date);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_LONG(&_2, ((minutes * 60)));
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_SV(&_3, "max-age=", &_2);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "Cache-Control");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_4, &_3);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, exists)
+static PHP_METHOD(Phalcon_Http_Response, setContent)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *index_param = NULL;
- zval index;
+ zval *content_param = NULL;
+ zval content;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&content);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
+ Z_PARAM_STR(content)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &index_param);
- if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
- } else {
- ZEPHIR_INIT_VAR(&index);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, &index);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 1, 0, &content_param);
+ zephir_get_strval(&content, content_param);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("content"), &content);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, has)
+static PHP_METHOD(Phalcon_Http_Response, setContentLength)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *index_param = NULL, _0;
- zval index;
+ zval *contentLength_param = NULL, _0, _1;
+ zend_long contentLength, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&index);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
+ Z_PARAM_LONG(contentLength)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &index_param);
- if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
- } else {
- ZEPHIR_INIT_VAR(&index);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &index));
+ zephir_fetch_params(1, 1, 0, &contentLength_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "Content-Length");
+ ZVAL_LONG(&_1, contentLength);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, query)
+static PHP_METHOD(Phalcon_Http_Response, setContentType)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translateKey_param = NULL, *placeholders_param = NULL, translation, _0;
- zval translateKey;
+ zval *contentType_param = NULL, *charset = NULL, charset_sub, __$null, _0$$3, _1;
+ zval contentType;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&contentType);
+ ZVAL_UNDEF(&charset_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1);
+ bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
+ Z_PARAM_STR(contentType)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ZVAL_OR_NULL(charset)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translateKey_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translateKey_param) != IS_STRING && Z_TYPE_P(translateKey_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translateKey' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(translateKey_param) == IS_STRING)) {
- zephir_get_strval(&translateKey, translateKey_param);
- } else {
- ZEPHIR_INIT_VAR(&translateKey);
- }
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
- } else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ zephir_fetch_params(1, 1, 1, &contentType_param, &charset);
+ zephir_get_strval(&contentType, contentType_param);
+ if (!charset) {
+ charset = &charset_sub;
+ charset = &__$null;
}
- zephir_memory_observe(&translation);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&translation, &_0, &translateKey, 0))) {
- ZEPHIR_CPY_WRT(&translation, &translateKey);
+ if (Z_TYPE_P(charset) != IS_NULL) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZEPHIR_CONCAT_SV(&_0$$3, "; charset=", charset);
+ zephir_concat_self(&contentType, &_0$$3);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "Content-Type");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &contentType);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, load)
+static PHP_METHOD(Phalcon_Http_Response, setCookies)
{
- zend_bool _8$$4;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL;
- zend_long length, ZEPHIR_LAST_CALL_STATUS;
- zval *file_param = NULL, *length_param = NULL, *delimiter_param = NULL, *enclosure_param = NULL, data, fileHandler, _0, _1$$3, _3$$4, _5$$4, _6$$4, _7$$4, _9$$4, _10$$4;
- zval file, delimiter, enclosure, _2$$3;
+ zval *cookies, cookies_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&delimiter);
- ZVAL_UNDEF(&enclosure);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&fileHandler);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_5$$4);
- ZVAL_UNDEF(&_6$$4);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&_10$$4);
- ZEND_PARSE_PARAMETERS_START(4, 4)
- Z_PARAM_STR(file)
- Z_PARAM_LONG(length)
- Z_PARAM_STR(delimiter)
- Z_PARAM_STR(enclosure)
+ ZVAL_UNDEF(&cookies_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(cookies, phalcon_http_response_cookiesinterface_ce)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 4, 0, &file_param, &length_param, &delimiter_param, &enclosure_param);
- zephir_get_strval(&file, file_param);
- zephir_get_strval(&delimiter, delimiter_param);
- zephir_get_strval(&enclosure, enclosure_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "rb");
- ZEPHIR_CALL_METHOD(&fileHandler, this_ptr, "phpfopen", NULL, 0, &file, &_0);
- zephir_check_call_status();
- if (UNEXPECTED(Z_TYPE_P(&fileHandler) != IS_RESOURCE)) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_translate_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SVS(&_2$$3, "Error opening translation file '", &file, "'");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/Csv.zep", 129);
- ZEPHIR_MM_RESTORE();
- return;
- }
- while (1) {
- ZVAL_LONG(&_3$$4, length);
- ZEPHIR_CALL_FUNCTION(&data, "fgetcsv", &_4, 0, &fileHandler, &_3$$4, &delimiter, &enclosure);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) {
- break;
- }
- zephir_array_fetch_long(&_5$$4, &data, 0, PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Csv.zep", 139);
- ZVAL_LONG(&_3$$4, 0);
- ZVAL_LONG(&_6$$4, 1);
- ZEPHIR_INIT_NVAR(&_7$$4);
- zephir_substr(&_7$$4, &_5$$4, 0 , 1 , 0);
- _8$$4 = ZEPHIR_IS_STRING_IDENTICAL(&_7$$4, "#");
- if (!(_8$$4)) {
- _8$$4 = !(zephir_array_isset_long(&data, 1));
- }
- if (_8$$4) {
- continue;
- }
- zephir_array_fetch_long(&_9$$4, &data, 1, PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Csv.zep", 143);
- ZEPHIR_OBS_NVAR(&_10$$4);
- zephir_array_fetch_long(&_10$$4, &data, 0, PH_NOISY, "phalcon/Translate/Adapter/Csv.zep", 143);
- zephir_update_property_array(this_ptr, SL("translate"), &_10$$4, &_9$$4);
- }
- zephir_fclose(&fileHandler);
- ZEPHIR_MM_RESTORE();
+ zephir_fetch_params_without_memory_grow(1, 0, &cookies);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cookies"), cookies);
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, toArray)
+static PHP_METHOD(Phalcon_Http_Response, setDI)
{
+ zval *container, container_sub;
+ zval *this_ptr = getThis();
- RETURN_MEMBER(getThis(), "translate");
+ ZVAL_UNDEF(&container_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &container);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Csv, phpFopen)
+static PHP_METHOD(Phalcon_Http_Response, setEtag)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filename_param = NULL, *mode_param = NULL;
- zval filename, mode;
+ zval *etag_param = NULL, _0;
+ zval etag;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filename);
- ZVAL_UNDEF(&mode);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(filename)
- Z_PARAM_STR(mode)
+ ZVAL_UNDEF(&etag);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(etag)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &filename_param, &mode_param);
- zephir_get_strval(&filename, filename_param);
- zephir_get_strval(&mode, mode_param);
- ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 140, &filename, &mode);
+ zephir_fetch_params(1, 1, 0, &etag_param);
+ zephir_get_strval(&etag, etag_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "Etag");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_0, &etag);
zephir_check_call_status();
- RETURN_MM();
-}
-
-zend_object *zephir_init_properties_Phalcon_Translate_Adapter_Csv(zend_class_entry *class_type)
-{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("translate"), &_1$$3);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
- }
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_Gettext)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate\\Adapter, Gettext, phalcon, translate_adapter_gettext, phalcon_translate_adapter_abstractadapter_ce, phalcon_translate_adapter_gettext_method_entry, 0);
-
- zend_declare_property_null(phalcon_translate_adapter_gettext_ce, SL("category"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_translate_adapter_gettext_ce, SL("defaultDomain"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_translate_adapter_gettext_ce, SL("directory"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_translate_adapter_gettext_ce, SL("locale"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_translate_adapter_gettext_ce, 1, zend_ce_arrayaccess);
- return SUCCESS;
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, __construct)
+static PHP_METHOD(Phalcon_Http_Response, setExpires)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *interpolator, interpolator_sub, *options_param = NULL, _0, _1;
+ zval *datetime, datetime_sub, date, _0, _1, _2, _3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&interpolator_sub);
+ ZVAL_UNDEF(&datetime_sub);
+ ZVAL_UNDEF(&date);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_ARRAY(options)
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(datetime, php_date_get_date_ce())
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
+ zephir_fetch_params(1, 1, 0, &datetime);
+ ZEPHIR_INIT_VAR(&date);
+ if (zephir_clone(&date, datetime) == FAILURE) {
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, php_date_get_timezone_ce());
ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "gettext");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfunctionexists", NULL, 0, &_1);
+ ZVAL_STRING(&_1, "UTC");
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &_1);
zephir_check_call_status();
- if (UNEXPECTED(!zephir_is_true(&_0))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "This class requires the gettext extension for PHP", "phalcon/Translate/Adapter/Gettext.zep", 80);
- return;
- }
- ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_gettext_ce, getThis(), "__construct", NULL, 0, interpolator, &options);
+ ZEPHIR_CALL_METHOD(NULL, &date, "settimezone", NULL, 0, &_0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "prepareoptions", NULL, 0, &options);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "D, d M Y H:i:s");
+ ZEPHIR_CALL_METHOD(&_2, &date, "format", NULL, 0, &_1);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_VS(&_3, &_2, " GMT");
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "Expires");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &_3);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, exists)
+static PHP_METHOD(Phalcon_Http_Response, setEventsManager)
+{
+ zval *eventsManager, eventsManager_sub;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&eventsManager_sub);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(eventsManager, phalcon_events_managerinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
+ zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("eventsManager"), eventsManager);
+}
+
+static PHP_METHOD(Phalcon_Http_Response, setFileToSend)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *index_param = NULL;
- zval index;
+ zval *filePath_param = NULL, *attachmentName = NULL, attachmentName_sub, *attachment = NULL, attachment_sub, __$true, __$null, basePath, basePathEncoding, _0$$6, _1$$5, _2$$7, _3$$7, _4$$7, _5$$8, _6$$8, _7$$8;
+ zval filePath;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&index);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
+ ZVAL_UNDEF(&filePath);
+ ZVAL_UNDEF(&attachmentName_sub);
+ ZVAL_UNDEF(&attachment_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&basePath);
+ ZVAL_UNDEF(&basePathEncoding);
+ ZVAL_UNDEF(&_0$$6);
+ ZVAL_UNDEF(&_1$$5);
+ ZVAL_UNDEF(&_2$$7);
+ ZVAL_UNDEF(&_3$$7);
+ ZVAL_UNDEF(&_4$$7);
+ ZVAL_UNDEF(&_5$$8);
+ ZVAL_UNDEF(&_6$$8);
+ ZVAL_UNDEF(&_7$$8);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(filePath)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(attachmentName)
+ Z_PARAM_ZVAL(attachment)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &index_param);
- if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 2, &filePath_param, &attachmentName, &attachment);
+ zephir_get_strval(&filePath, filePath_param);
+ if (!attachmentName) {
+ attachmentName = &attachmentName_sub;
+ attachmentName = &__$null;
}
- if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
+ if (!attachment) {
+ attachment = &attachment_sub;
+ attachment = &__$true;
+ }
+ ZEPHIR_INIT_VAR(&basePathEncoding);
+ ZVAL_STRING(&basePathEncoding, "ASCII");
+ if (Z_TYPE_P(attachmentName) != IS_STRING) {
+ ZEPHIR_CALL_METHOD(&basePath, this_ptr, "getbasename", NULL, 357, &filePath);
+ zephir_check_call_status();
} else {
- ZEPHIR_INIT_VAR(&index);
+ ZEPHIR_CPY_WRT(&basePath, attachmentName);
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, &index);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getCategory)
-{
-
- RETURN_MEMBER(getThis(), "category");
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getDefaultDomain)
-{
-
- RETURN_MEMBER(getThis(), "defaultDomain");
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getDirectory)
-{
-
- RETURN_MEMBER(getThis(), "directory");
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getLocale)
-{
-
- RETURN_MEMBER(getThis(), "locale");
+ if (zephir_is_true(attachment)) {
+ if ((zephir_function_exists_ex(ZEND_STRL("mb_detect_encoding")) == SUCCESS)) {
+ ZEPHIR_CALL_FUNCTION(&_0$$6, "mb_detect_order", NULL, 358);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&basePathEncoding, "mb_detect_encoding", NULL, 323, &basePath, &_0$$6, &__$true);
+ zephir_check_call_status();
+ }
+ ZEPHIR_INIT_VAR(&_1$$5);
+ ZVAL_STRING(&_1$$5, "Content-Description: File Transfer");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1$$5);
+ ZVAL_STRING(&_1$$5, "Content-Type: application/octet-stream");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1$$5);
+ ZVAL_STRING(&_1$$5, "Content-Transfer-Encoding: binary");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_STRING(&basePathEncoding, "ASCII")) {
+ ZEPHIR_CALL_FUNCTION(&_2$$7, "rawurlencode", NULL, 327, &basePath);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&basePath, &_2$$7);
+ ZEPHIR_INIT_VAR(&_3$$7);
+ zephir_fast_strtolower(&_3$$7, &basePathEncoding);
+ ZEPHIR_INIT_VAR(&_4$$7);
+ ZEPHIR_CONCAT_SVSVSV(&_4$$7, "Content-Disposition: attachment; filename=", &basePath, "; filename*=", &_3$$7, "''", &basePath);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_4$$7);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_VAR(&_5$$8);
+ ZVAL_STRING(&_5$$8, "\15\17\\\"");
+ ZEPHIR_CALL_FUNCTION(&_6$$8, "addcslashes", NULL, 215, &basePath, &_5$$8);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&basePath, &_6$$8);
+ ZEPHIR_INIT_VAR(&_7$$8);
+ ZEPHIR_CONCAT_SVS(&_7$$8, "Content-Disposition: attachment; filename=\"", &basePath, "\"");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_7$$8);
+ zephir_check_call_status();
+ }
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("file"), &filePath);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, has)
+static PHP_METHOD(Phalcon_Http_Response, setHeader)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *index_param = NULL, result;
- zval index;
+ zval *name_param = NULL, *value, value_sub, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&index);
- ZVAL_UNDEF(&result);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &index_param);
- if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
- } else {
- ZEPHIR_INIT_VAR(&index);
- }
- ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, &index);
+ zephir_fetch_params(1, 2, 0, &name_param, &value);
+ zephir_get_strval(&name, name_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &name, value);
zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_IDENTICAL(&result, &index));
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, nquery)
+static PHP_METHOD(Phalcon_Http_Response, setHeaders)
{
+ zend_string *_3;
+ zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval placeholders;
- zend_long count, ZEPHIR_LAST_CALL_STATUS;
- zval *msgid1_param = NULL, *msgid2_param = NULL, *count_param = NULL, *placeholders_param = NULL, *domain_param = NULL, translation, _0$$3, _1$$4;
- zval msgid1, msgid2, domain;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *headers, headers_sub, data, name, value, *_0, _1, _4$$3, _5$$4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&msgid1);
- ZVAL_UNDEF(&msgid2);
- ZVAL_UNDEF(&domain);
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&placeholders);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 5)
- Z_PARAM_STR(msgid1)
- Z_PARAM_STR(msgid2)
- Z_PARAM_LONG(count)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
- Z_PARAM_STR_OR_NULL(domain)
+ ZVAL_UNDEF(&headers_sub);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_http_response_headersinterface_ce)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 2, &msgid1_param, &msgid2_param, &count_param, &placeholders_param, &domain_param);
- if (UNEXPECTED(Z_TYPE_P(msgid1_param) != IS_STRING && Z_TYPE_P(msgid1_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'msgid1' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(msgid1_param) == IS_STRING)) {
- zephir_get_strval(&msgid1, msgid1_param);
- } else {
- ZEPHIR_INIT_VAR(&msgid1);
- }
- if (UNEXPECTED(Z_TYPE_P(msgid2_param) != IS_STRING && Z_TYPE_P(msgid2_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'msgid2' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(msgid2_param) == IS_STRING)) {
- zephir_get_strval(&msgid2, msgid2_param);
- } else {
- ZEPHIR_INIT_VAR(&msgid2);
- }
- if (UNEXPECTED(Z_TYPE_P(count_param) != IS_LONG)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'count' must be of the type int"));
- RETURN_MM_NULL();
- }
- count = Z_LVAL_P(count_param);
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
- } else {
- zephir_get_arrval(&placeholders, placeholders_param);
- }
- if (!domain_param) {
- ZEPHIR_INIT_VAR(&domain);
- } else {
- if (UNEXPECTED(Z_TYPE_P(domain_param) != IS_STRING && Z_TYPE_P(domain_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) {
- zephir_get_strval(&domain, domain_param);
- } else {
- ZEPHIR_INIT_VAR(&domain);
- }
- }
- if (!(!(ZEPHIR_IS_EMPTY(&domain)))) {
- ZVAL_LONG(&_0$$3, count);
- ZEPHIR_CALL_FUNCTION(&translation, "ngettext", NULL, 0, &msgid1, &msgid2, &_0$$3);
- zephir_check_call_status();
+ zephir_fetch_params(1, 1, 0, &headers);
+ ZEPHIR_CALL_METHOD(&data, headers, "toarray", NULL, 0);
+ zephir_check_call_status();
+ zephir_is_iterable(&data, 0, "phalcon/Http/Response.zep", 628);
+ if (Z_TYPE_P(&data) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_3 != NULL) {
+ ZVAL_STR_COPY(&name, _3);
+ } else {
+ ZVAL_LONG(&name, _2);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _0);
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_4$$3, "set", NULL, 0, &name, &value);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
} else {
- ZVAL_LONG(&_1$$4, count);
- ZEPHIR_CALL_FUNCTION(&translation, "dngettext", NULL, 0, &domain, &msgid1, &msgid2, &_1$$4);
+ ZEPHIR_CALL_METHOD(NULL, &data, "rewind", NULL, 0);
zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_1, &data, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &data, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &data, "current", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_5$$4, "set", NULL, 0, &name, &value);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, query)
+static PHP_METHOD(Phalcon_Http_Response, setJsonContent)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translateKey_param = NULL, *placeholders_param = NULL, _0;
- zval translateKey;
+ zend_long jsonOptions, depth, ZEPHIR_LAST_CALL_STATUS;
+ zval *content, content_sub, *jsonOptions_param = NULL, *depth_param = NULL, _0, _1, _2, _3, _4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
+ ZVAL_UNDEF(&content_sub);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&placeholders);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_ZVAL(content)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_LONG(jsonOptions)
+ Z_PARAM_LONG(depth)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translateKey_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translateKey_param) != IS_STRING && Z_TYPE_P(translateKey_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translateKey' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(translateKey_param) == IS_STRING)) {
- zephir_get_strval(&translateKey, translateKey_param);
+ zephir_fetch_params(1, 1, 2, &content, &jsonOptions_param, &depth_param);
+ if (!jsonOptions_param) {
+ jsonOptions = 0;
} else {
- ZEPHIR_INIT_VAR(&translateKey);
- }
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
+ }
+ if (!depth_param) {
+ depth = 512;
} else {
- zephir_get_arrval(&placeholders, placeholders_param);
- }
- ZEPHIR_CALL_FUNCTION(&_0, "gettext", NULL, 0, &translateKey);
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "application/json");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontenttype", NULL, 0, &_0);
zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &_0, &placeholders);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("encode"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_3, jsonOptions);
+ ZVAL_LONG(&_4, depth);
+ ZEPHIR_CALL_METHOD(&_2, &_1, "__invoke", NULL, 0, content, &_3, &_4);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontent", NULL, 0, &_2);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, resetDomain)
+static PHP_METHOD(Phalcon_Http_Response, setLastModified)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *datetime, datetime_sub, date, _0, _1, _2, _3;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&datetime_sub);
+ ZVAL_UNDEF(&date);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(datetime, php_date_get_date_ce())
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdefaultdomain", NULL, 0);
+ zephir_fetch_params(1, 1, 0, &datetime);
+ ZEPHIR_INIT_VAR(&date);
+ if (zephir_clone(&date, datetime) == FAILURE) {
+ RETURN_MM();
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, php_date_get_timezone_ce());
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "UTC");
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &_1);
zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("textdomain", NULL, 0, &_0);
+ ZEPHIR_CALL_METHOD(NULL, &date, "settimezone", NULL, 0, &_0);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "D, d M Y H:i:s");
+ ZEPHIR_CALL_METHOD(&_2, &date, "format", NULL, 0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_3);
+ ZEPHIR_CONCAT_VS(&_3, &_2, " GMT");
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "Last-Modified");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &_3);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDefaultDomain)
+static PHP_METHOD(Phalcon_Http_Response, setNotModified)
{
+ zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *domain_param = NULL;
- zval domain;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&domain);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(domain)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &domain_param);
- if (UNEXPECTED(Z_TYPE_P(domain_param) != IS_STRING && Z_TYPE_P(domain_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) {
- zephir_get_strval(&domain, domain_param);
- } else {
- ZEPHIR_INIT_VAR(&domain);
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("defaultDomain"), &domain);
- ZEPHIR_MM_RESTORE();
+
+ ZVAL_LONG(&_0, 304);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "Not modified");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, &_0, &_1);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory)
+static PHP_METHOD(Phalcon_Http_Response, setStatusCode)
{
- zend_string *_3$$4;
- zend_ulong _2$$4;
+ zend_bool _6$$3, _11$$5;
+ zend_string *_5;
+ zend_ulong _4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *directory, directory_sub, key, value, *_0$$4, _1$$4, _5$$7;
+ zephir_fcall_cache_entry *_9 = NULL;
+ zval message, _17, _20;
+ zval *code_param = NULL, *message_param = NULL, currentHeadersRaw, key, statusCodes, defaultMessage, _0, _1, *_2, _3, _15, _16, _18, _19, _21, _7$$3, _8$$3, _10$$4, _12$$5, _13$$5, _14$$6;
+ zend_long code, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&directory_sub);
+ ZVAL_UNDEF(¤tHeadersRaw);
ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_5$$7);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(directory)
+ ZVAL_UNDEF(&statusCodes);
+ ZVAL_UNDEF(&defaultMessage);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_18);
+ ZVAL_UNDEF(&_19);
+ ZVAL_UNDEF(&_21);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_10$$4);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_13$$5);
+ ZVAL_UNDEF(&_14$$6);
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_20);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_LONG(code)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(message)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &directory);
- if (ZEPHIR_IS_EMPTY(directory)) {
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 1, 1, &code_param, &message_param);
+ if (!message_param) {
+ ZEPHIR_INIT_VAR(&message);
+ } else {
+ zephir_get_strval(&message, message_param);
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("directory"), directory);
- if (Z_TYPE_P(directory) == IS_ARRAY) {
- zephir_is_iterable(directory, 0, "phalcon/Translate/Adapter/Gettext.zep", 249);
- if (Z_TYPE_P(directory) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(directory), _2$$4, _3$$4, _0$$4)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_3$$4 != NULL) {
- ZVAL_STR_COPY(&key, _3$$4);
- } else {
- ZVAL_LONG(&key, _2$$4);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0$$4);
- ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_4, 0, &key, &value);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(¤tHeadersRaw, &_0, "toarray", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ zephir_is_iterable(¤tHeadersRaw, 0, "phalcon/Http/Response.zep", 717);
+ if (Z_TYPE_P(¤tHeadersRaw) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¤tHeadersRaw), _4, _5, _2)
+ {
+ ZEPHIR_INIT_NVAR(&key);
+ if (_5 != NULL) {
+ ZVAL_STR_COPY(&key, _5);
+ } else {
+ ZVAL_LONG(&key, _4);
+ }
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_COPY(&_1, _2);
+ _6$$3 = Z_TYPE_P(&key) == IS_STRING;
+ if (_6$$3) {
+ ZEPHIR_INIT_NVAR(&_7$$3);
+ ZVAL_STRING(&_7$$3, "HTTP/");
+ ZEPHIR_CALL_FUNCTION(&_8$$3, "strstr", &_9, 355, &key, &_7$$3);
zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, directory, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1$$4, directory, "valid", NULL, 0);
+ _6$$3 = zephir_is_true(&_8$$3);
+ }
+ if (_6$$3) {
+ zephir_read_property(&_10$$4, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_10$$4, "remove", NULL, 0, &key);
zephir_check_call_status();
- if (!zend_is_true(&_1$$4)) {
- break;
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, ¤tHeadersRaw, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, ¤tHeadersRaw, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&key, ¤tHeadersRaw, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, ¤tHeadersRaw, "current", NULL, 0);
+ zephir_check_call_status();
+ _11$$5 = Z_TYPE_P(&key) == IS_STRING;
+ if (_11$$5) {
+ ZEPHIR_INIT_NVAR(&_12$$5);
+ ZVAL_STRING(&_12$$5, "HTTP/");
+ ZEPHIR_CALL_FUNCTION(&_13$$5, "strstr", &_9, 355, &key, &_12$$5);
+ zephir_check_call_status();
+ _11$$5 = zephir_is_true(&_13$$5);
}
- ZEPHIR_CALL_METHOD(&key, directory, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, directory, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_4, 0, &key, &value);
+ if (_11$$5) {
+ zephir_read_property(&_14$$6, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_14$$6, "remove", NULL, 0, &key);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, directory, "next", NULL, 0);
- zephir_check_call_status();
- }
+ }
+ ZEPHIR_CALL_METHOD(NULL, ¤tHeadersRaw, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&_1);
+ ZEPHIR_INIT_NVAR(&key);
+ if (ZEPHIR_IS_NULL(&message)) {
+ ZEPHIR_INIT_VAR(&statusCodes);
+ zephir_create_array(&statusCodes, 89, 0);
+ add_index_stringl(&statusCodes, 100, SL("Continue"));
+ add_index_stringl(&statusCodes, 101, SL("Switching Protocols"));
+ add_index_stringl(&statusCodes, 102, SL("Processing"));
+ add_index_stringl(&statusCodes, 103, SL("Early Hints"));
+ add_index_stringl(&statusCodes, 200, SL("OK"));
+ add_index_stringl(&statusCodes, 201, SL("Created"));
+ add_index_stringl(&statusCodes, 202, SL("Accepted"));
+ add_index_stringl(&statusCodes, 203, SL("Non-Authoritative Information"));
+ add_index_stringl(&statusCodes, 204, SL("No Content"));
+ add_index_stringl(&statusCodes, 205, SL("Reset Content"));
+ add_index_stringl(&statusCodes, 206, SL("Partial Content"));
+ add_index_stringl(&statusCodes, 207, SL("Multi-status"));
+ add_index_stringl(&statusCodes, 208, SL("Already Reported"));
+ add_index_stringl(&statusCodes, 226, SL("IM Used"));
+ add_index_stringl(&statusCodes, 300, SL("Multiple Choices"));
+ add_index_stringl(&statusCodes, 301, SL("Moved Permanently"));
+ add_index_stringl(&statusCodes, 302, SL("Found"));
+ add_index_stringl(&statusCodes, 303, SL("See Other"));
+ add_index_stringl(&statusCodes, 304, SL("Not Modified"));
+ add_index_stringl(&statusCodes, 305, SL("Use Proxy"));
+ add_index_stringl(&statusCodes, 306, SL("Switch Proxy"));
+ add_index_stringl(&statusCodes, 307, SL("Temporary Redirect"));
+ add_index_stringl(&statusCodes, 308, SL("Permanent Redirect"));
+ add_index_stringl(&statusCodes, 400, SL("Bad Request"));
+ add_index_stringl(&statusCodes, 401, SL("Unauthorized"));
+ add_index_stringl(&statusCodes, 402, SL("Payment Required"));
+ add_index_stringl(&statusCodes, 403, SL("Forbidden"));
+ add_index_stringl(&statusCodes, 404, SL("Not Found"));
+ add_index_stringl(&statusCodes, 405, SL("Method Not Allowed"));
+ add_index_stringl(&statusCodes, 406, SL("Not Acceptable"));
+ add_index_stringl(&statusCodes, 407, SL("Proxy Authentication Required"));
+ add_index_stringl(&statusCodes, 408, SL("Request Time-out"));
+ add_index_stringl(&statusCodes, 409, SL("Conflict"));
+ add_index_stringl(&statusCodes, 410, SL("Gone"));
+ add_index_stringl(&statusCodes, 411, SL("Length Required"));
+ add_index_stringl(&statusCodes, 412, SL("Precondition Failed"));
+ add_index_stringl(&statusCodes, 413, SL("Request Entity Too Large"));
+ add_index_stringl(&statusCodes, 414, SL("Request-URI Too Large"));
+ add_index_stringl(&statusCodes, 415, SL("Unsupported Media Type"));
+ add_index_stringl(&statusCodes, 416, SL("Requested range not satisfiable"));
+ add_index_stringl(&statusCodes, 417, SL("Expectation Failed"));
+ add_index_stringl(&statusCodes, 418, SL("I'm a teapot"));
+ add_index_stringl(&statusCodes, 421, SL("Misdirected Request"));
+ add_index_stringl(&statusCodes, 422, SL("Unprocessable Entity"));
+ add_index_stringl(&statusCodes, 423, SL("Locked"));
+ add_index_stringl(&statusCodes, 424, SL("Failed Dependency"));
+ add_index_stringl(&statusCodes, 425, SL("Unordered Collection"));
+ add_index_stringl(&statusCodes, 426, SL("Upgrade Required"));
+ add_index_stringl(&statusCodes, 428, SL("Precondition Required"));
+ add_index_stringl(&statusCodes, 429, SL("Too Many Requests"));
+ add_index_stringl(&statusCodes, 431, SL("Request Header Fields Too Large"));
+ add_index_stringl(&statusCodes, 451, SL("Unavailable For Legal Reasons"));
+ add_index_stringl(&statusCodes, 500, SL("Internal Server Error"));
+ add_index_stringl(&statusCodes, 501, SL("Not Implemented"));
+ add_index_stringl(&statusCodes, 502, SL("Bad Gateway"));
+ add_index_stringl(&statusCodes, 503, SL("Service Unavailable"));
+ add_index_stringl(&statusCodes, 504, SL("Gateway Time-out"));
+ add_index_stringl(&statusCodes, 505, SL("HTTP Version not supported"));
+ add_index_stringl(&statusCodes, 506, SL("Variant Also Negotiates"));
+ add_index_stringl(&statusCodes, 507, SL("Insufficient Storage"));
+ add_index_stringl(&statusCodes, 508, SL("Loop Detected"));
+ add_index_stringl(&statusCodes, 510, SL("Not Extended"));
+ add_index_stringl(&statusCodes, 511, SL("Network Authentication Required"));
+ add_index_stringl(&statusCodes, 218, SL("This is fine"));
+ add_index_stringl(&statusCodes, 419, SL("Page Expired"));
+ add_index_stringl(&statusCodes, 420, SL("Method Failure"));
+ add_index_stringl(&statusCodes, 440, SL("Login Time-out"));
+ add_index_stringl(&statusCodes, 444, SL("No Response"));
+ add_index_stringl(&statusCodes, 449, SL("Retry With"));
+ add_index_stringl(&statusCodes, 450, SL("Blocked by Windows Parental Controls (Microsoft)"));
+ add_index_stringl(&statusCodes, 494, SL("Request header too large"));
+ add_index_stringl(&statusCodes, 495, SL("SSL Certificate Error"));
+ add_index_stringl(&statusCodes, 496, SL("SSL Certificate Required"));
+ add_index_stringl(&statusCodes, 497, SL("HTTP Request Sent to HTTPS Port"));
+ add_index_stringl(&statusCodes, 498, SL("Invalid Token (Esri)"));
+ add_index_stringl(&statusCodes, 499, SL("Client Closed Request"));
+ add_index_stringl(&statusCodes, 509, SL("Bandwidth Limit Exceeded"));
+ add_index_stringl(&statusCodes, 520, SL("Unknown Error"));
+ add_index_stringl(&statusCodes, 521, SL("Web Server Is Down"));
+ add_index_stringl(&statusCodes, 522, SL("Connection Timed Out"));
+ add_index_stringl(&statusCodes, 523, SL("Origin Is Unreachable"));
+ add_index_stringl(&statusCodes, 524, SL("A Timeout Occurred"));
+ add_index_stringl(&statusCodes, 525, SL("SSL Handshake Failed"));
+ add_index_stringl(&statusCodes, 526, SL("Invalid SSL Certificate"));
+ add_index_stringl(&statusCodes, 527, SL("Railgun Error"));
+ add_index_stringl(&statusCodes, 530, SL("Origin DNS Error"));
+ add_index_stringl(&statusCodes, 598, SL("Network read timeout error"));
+ add_index_stringl(&statusCodes, 599, SL("Network Connect Timeout Error"));
+ if (UNEXPECTED(!(zephir_array_isset_long(&statusCodes, code)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "Non-standard statuscode given without a message", "phalcon/Http/Response.zep", 824);
+ return;
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- } else {
- ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "getdefaultdomain", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_4, 0, &_5$$7, directory);
- zephir_check_call_status();
+ zephir_memory_observe(&defaultMessage);
+ zephir_array_fetch_long(&defaultMessage, &statusCodes, code, PH_NOISY, "phalcon/Http/Response.zep", 827);
+ zephir_get_strval(&message, &defaultMessage);
}
- ZEPHIR_MM_RESTORE();
+ zephir_read_property(&_15, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_16);
+ ZVAL_LONG(&_16, code);
+ ZEPHIR_INIT_VAR(&_17);
+ ZEPHIR_CONCAT_SVSV(&_17, "HTTP/1.1 ", &_16, " ", &message);
+ ZEPHIR_CALL_METHOD(NULL, &_15, "setraw", NULL, 0, &_17);
+ zephir_check_call_status();
+ zephir_read_property(&_18, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_19);
+ ZVAL_LONG(&_19, code);
+ ZEPHIR_INIT_VAR(&_20);
+ ZEPHIR_CONCAT_VSV(&_20, &_19, " ", &message);
+ ZEPHIR_INIT_VAR(&_21);
+ ZVAL_STRING(&_21, "Status");
+ ZEPHIR_CALL_METHOD(NULL, &_18, "set", NULL, 0, &_21, &_20);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDomain)
+static PHP_METHOD(Phalcon_Http_Response, setRawHeader)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *domain_param = NULL;
- zval domain;
+ zval *header_param = NULL, _0;
+ zval header;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&domain);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(domain)
+ ZVAL_UNDEF(&header);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(header)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &domain_param);
- if (!domain_param) {
- ZEPHIR_INIT_VAR(&domain);
- } else {
- zephir_get_strval(&domain, domain_param);
- }
- ZEPHIR_RETURN_CALL_FUNCTION("textdomain", NULL, 0, &domain);
+ zephir_fetch_params(1, 1, 0, &header_param);
+ zephir_get_strval(&header, header_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "setraw", NULL, 0, &header);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setLocale)
+static PHP_METHOD(Phalcon_Http_Response, getBasename)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval localeArray;
- zval *category_param = NULL, *localeArray_param = NULL, _0, _1, _2, _3, _4, _5, _6, _7, _8;
- zend_long category, ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *uri_param = NULL, *suffix = NULL, suffix_sub, __$null, filename, matches, _0, _1, _2, _3, _4, _5, _6$$3, _7$$3, _8$$3, _9$$3;
+ zval uri;
+ ZVAL_UNDEF(&uri);
+ ZVAL_UNDEF(&suffix_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&filename);
+ ZVAL_UNDEF(&matches);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&localeArray);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
+ bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_LONG(category)
+ Z_PARAM_STR(uri)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(localeArray)
+ Z_PARAM_ZVAL_OR_NULL(suffix)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &category_param, &localeArray_param);
- if (UNEXPECTED(Z_TYPE_P(category_param) != IS_LONG)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'category' must be of the type int"));
+ zephir_fetch_params(1, 1, 1, &uri_param, &suffix);
+ if (UNEXPECTED(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be of the type string"));
RETURN_MM_NULL();
}
- category = Z_LVAL_P(category_param);
- if (!localeArray_param) {
- ZEPHIR_INIT_VAR(&localeArray);
- array_init(&localeArray);
+ if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) {
+ zephir_get_strval(&uri, uri_param);
} else {
- zephir_get_arrval(&localeArray, localeArray_param);
+ ZEPHIR_INIT_VAR(&uri);
}
- ZVAL_LONG(&_0, category);
- ZEPHIR_CALL_FUNCTION(&_1, "setlocale", NULL, 0, &_0, &localeArray);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("locale"), &_1);
- ZVAL_UNDEF(&_0);
- ZVAL_LONG(&_0, category);
- zephir_update_property_zval(this_ptr, ZEND_STRL("category"), &_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("locale"), PH_NOISY_CC | PH_READONLY);
+ if (!suffix) {
+ suffix = &suffix_sub;
+ suffix = &__$null;
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "/");
+ zephir_fast_trim(&_0, &uri, &_1, ZEPHIR_TRIM_RIGHT);
+ zephir_get_strval(&uri, &_0);
ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_CONCAT_SV(&_2, "LC_ALL=", &_0);
- ZEPHIR_CALL_FUNCTION(NULL, "putenv", NULL, 0, &_2);
- zephir_check_call_status();
- zephir_read_property(&_3, this_ptr, ZEND_STRL("locale"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_4);
- ZEPHIR_CONCAT_SV(&_4, "LANG=", &_3);
- ZEPHIR_CALL_FUNCTION(NULL, "putenv", NULL, 0, &_4);
- zephir_check_call_status();
- zephir_read_property(&_5, this_ptr, ZEND_STRL("locale"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_6);
- ZEPHIR_CONCAT_SV(&_6, "LANGUAGE=", &_5);
- ZEPHIR_CALL_FUNCTION(NULL, "putenv", NULL, 0, &_6);
- zephir_check_call_status();
- zephir_read_property(&_7, this_ptr, ZEND_STRL("locale"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_8, 6);
- ZEPHIR_CALL_FUNCTION(NULL, "setlocale", NULL, 0, &_8, &_7);
+ ZVAL_STRING(&_2, "/");
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "@");
+ ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 351, &_2, &_3);
zephir_check_call_status();
- RETURN_MM_MEMBER(getThis(), "locale");
-}
-
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, getOptionsDefault)
-{
-
- zephir_create_array(return_value, 2, 0);
- add_assoc_long_ex(return_value, SL("category"), 6);
- add_assoc_stringl_ex(return_value, SL("defaultDomain"), SL("messages"));
- return;
+ ZEPHIR_INIT_VAR(&_5);
+ ZEPHIR_CONCAT_SVS(&_5, "@[^", &_4, "]+$@");
+ ZEPHIR_INIT_NVAR(&_2);
+ zephir_preg_match(&_2, &_5, &uri, &matches, 0, 0 , 0 );
+ if (zephir_is_true(&_2)) {
+ zephir_memory_observe(&filename);
+ zephir_array_fetch_long(&filename, &matches, 0, PH_NOISY, "phalcon/Http/Response.zep", 867);
+ } else {
+ ZEPHIR_INIT_NVAR(&filename);
+ ZVAL_STRING(&filename, "");
+ }
+ if (zephir_is_true(suffix)) {
+ ZEPHIR_INIT_VAR(&_6$$3);
+ ZVAL_STRING(&_6$$3, "@");
+ ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 351, suffix, &_6$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_8$$3);
+ ZEPHIR_CONCAT_SVS(&_8$$3, "@", &_7$$3, "$@");
+ ZEPHIR_INIT_NVAR(&_6$$3);
+ ZVAL_STRING(&_6$$3, "");
+ ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 41, &_8$$3, &_6$$3, &filename);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&filename, &_9$$3);
+ }
+ RETURN_CCTOR(&filename);
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, prepareOptions)
+zend_object *zephir_init_properties_Phalcon_Http_Response(zend_class_entry *class_type)
{
+ zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *options_param = NULL, _0, _1, _2, _3, _4, _5, _6;
- zval options;
- zval *this_ptr = getThis();
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- if (UNEXPECTED(!(zephir_array_isset_string(&options, SL("locale"))))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Parameter 'locale' is required", "phalcon/Translate/Adapter/Gettext.zep", 321);
- return;
- }
- if (UNEXPECTED(!(zephir_array_isset_string(&options, SL("directory"))))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Parameter 'directory' is required", "phalcon/Translate/Adapter/Gettext.zep", 325);
- return;
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ {
+ zval local_this_ptr, *this_ptr = &local_this_ptr;
+ ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("statusCodes"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("statusCodes"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getoptionsdefault", NULL, 0);
- zephir_check_call_status();
- zephir_fast_array_merge(&_0, &_1, &options);
- ZEPHIR_CPY_WRT(&options, &_0);
- zephir_array_fetch_string(&_2, &options, SL("category"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Gettext.zep", 333);
- zephir_array_fetch_string(&_3, &options, SL("locale"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Gettext.zep", 333);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setlocale", NULL, 0, &_2, &_3);
- zephir_check_call_status();
- zephir_array_fetch_string(&_4, &options, SL("defaultDomain"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Gettext.zep", 334);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdefaultdomain", NULL, 0, &_4);
- zephir_check_call_status();
- zephir_array_fetch_string(&_5, &options, SL("directory"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Gettext.zep", 335);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdirectory", NULL, 0, &_5);
- zephir_check_call_status();
- zephir_array_fetch_string(&_6, &options, SL("defaultDomain"), PH_NOISY | PH_READONLY, "phalcon/Translate/Adapter/Gettext.zep", 336);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdomain", NULL, 0, &_6);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, phpFunctionExists)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_ResponseInterface)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name_param = NULL;
- zval name;
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http, ResponseInterface, phalcon, http_responseinterface, phalcon_http_responseinterface_method_entry);
- ZVAL_UNDEF(&name);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name_param);
- zephir_get_strval(&name, name_param);
- RETURN_MM_BOOL((zephir_function_exists(&name) == SUCCESS));
+ return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, appendContent);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, getContent);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, getStatusCode);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, getHeaders);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, hasHeader);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, isSent);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, redirect);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, resetHeaders);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setContent);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setContentLength);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setContentType);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setExpires);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setFileToSend);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setHeader);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setJsonContent);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setNotModified);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setRawHeader);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, setStatusCode);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, send);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, sendCookies);
+ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, sendHeaders);
@@ -162243,450 +158910,526 @@ static PHP_METHOD(Phalcon_Translate_Adapter_Gettext, phpFunctionExists)
-ZEPHIR_INIT_CLASS(Phalcon_Translate_Adapter_NativeArray)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestMethodInterface)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Translate\\Adapter, NativeArray, phalcon, translate_adapter_nativearray, phalcon_translate_adapter_abstractadapter_ce, phalcon_translate_adapter_nativearray_method_entry, 0);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, RequestMethodInterface, phalcon, http_message_requestmethodinterface, NULL);
- zend_declare_property_null(phalcon_translate_adapter_nativearray_ce, SL("translate"), ZEND_ACC_PRIVATE);
- zend_declare_property_bool(phalcon_translate_adapter_nativearray_ce, SL("triggerError"), 0, ZEND_ACC_PRIVATE);
- phalcon_translate_adapter_nativearray_ce->create_object = zephir_init_properties_Phalcon_Translate_Adapter_NativeArray;
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_CONNECT"), "CONNECT");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_DELETE"), "DELETE");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_GET"), "GET");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_HEAD"), "HEAD");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_OPTIONS"), "OPTIONS");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PATCH"), "PATCH");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_POST"), "POST");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PURGE"), "PURGE");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PUT"), "PUT");
+
+ zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_TRACE"), "TRACE");
- zend_class_implements(phalcon_translate_adapter_nativearray_ce, 1, zend_ce_arrayaccess);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *interpolator, interpolator_sub, *options_param = NULL, __$true, __$false, data, error;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&interpolator_sub);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_BOOL(&__$false, 0);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&error);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(interpolator, phalcon_translate_interpolatorfactory_ce)
- Z_PARAM_ARRAY(options)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &interpolator, &options_param);
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- ZEPHIR_CALL_PARENT(NULL, phalcon_translate_adapter_nativearray_ce, getThis(), "__construct", NULL, 0, interpolator, &options);
- zephir_check_call_status();
- zephir_memory_observe(&data);
- if (UNEXPECTED(!(zephir_array_isset_string_fetch(&data, &options, SL("content"), 0)))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Translation content was not provided", "phalcon/Translate/Adapter/NativeArray.zep", 58);
- return;
- }
- zephir_memory_observe(&error);
- if (zephir_array_isset_string_fetch(&error, &options, SL("triggerError"), 0)) {
- if (zephir_get_boolval(&error)) {
- zephir_update_property_zval(this_ptr, ZEND_STRL("triggerError"), &__$true);
- } else {
- zephir_update_property_zval(this_ptr, ZEND_STRL("triggerError"), &__$false);
- }
- }
- if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Translation data must be an array", "phalcon/Translate/Adapter/NativeArray.zep", 66);
- return;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("translate"), &data);
- ZEPHIR_MM_RESTORE();
-}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, exists)
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseStatusCodeInterface)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *index_param = NULL;
- zval index;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, ResponseStatusCodeInterface, phalcon, http_message_responsestatuscodeinterface, NULL);
- ZVAL_UNDEF(&index);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &index_param);
- if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
- } else {
- ZEPHIR_INIT_VAR(&index);
- }
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, &index);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONTINUE"), 100);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SWITCHING_PROTOCOLS"), 101);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROCESSING"), 102);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EARLY_HINTS"), 103);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_OK"), 200);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CREATED"), 201);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ACCEPTED"), 202);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NON_AUTHORITATIVE_INFORMATION"), 203);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_CONTENT"), 204);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESET_CONTENT"), 205);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PARTIAL_CONTENT"), 206);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTI_STATUS"), 207);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ALREADY_REPORTED"), 208);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_USED"), 226);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTIPLE_CHOICES"), 300);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MOVED_PERMANENTLY"), 301);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FOUND"), 302);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SEE_OTHER"), 303);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_MODIFIED"), 304);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_USE_PROXY"), 305);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESERVED"), 306);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TEMPORARY_REDIRECT"), 307);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PERMANENT_REDIRECT"), 308);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_REQUEST"), 400);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAUTHORIZED"), 401);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYMENT_REQUIRED"), 402);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FORBIDDEN"), 403);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_FOUND"), 404);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_NOT_ALLOWED"), 405);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_ACCEPTABLE"), 406);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROXY_AUTHENTICATION_REQUIRED"), 407);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_TIMEOUT"), 408);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONFLICT"), 409);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GONE"), 410);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LENGTH_REQUIRED"), 411);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_FAILED"), 412);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYLOAD_TOO_LARGE"), 413);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_URI_TOO_LONG"), 414);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNSUPPORTED_MEDIA_TYPE"), 415);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RANGE_NOT_SATISFIABLE"), 416);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EXPECTATION_FAILED"), 417);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_A_TEAPOT"), 418);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MISDIRECTED_REQUEST"), 421);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNPROCESSABLE_ENTITY"), 422);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOCKED"), 423);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FAILED_DEPENDENCY"), 424);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_EARLY"), 425);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UPGRADE_REQUIRED"), 426);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_REQUIRED"), 428);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_MANY_REQUESTS"), 429);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE"), 431);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAVAILABLE_FOR_LEGAL_REASONS"), 451);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INTERNAL_SERVER_ERROR"), 500);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_IMPLEMENTED"), 501);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_GATEWAY"), 502);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SERVICE_UNAVAILABLE"), 503);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GATEWAY_TIMEOUT"), 504);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VERSION_NOT_SUPPORTED"), 505);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VARIANT_ALSO_NEGOTIATES"), 506);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INSUFFICIENT_STORAGE"), 507);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOOP_DETECTED"), 508);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_EXTENDED"), 510);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_AUTHENTICATION_REQUIRED"), 511);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_THIS_IS_FINE"), 218);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAGE_EXPIRED"), 419);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_FAILURE"), 420);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOGIN_TIMEOUT"), 440);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_RESPONSE"), 444);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RETRY_WITH"), 449);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS"), 450);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_TOO_LARGE"), 494);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_ERROR"), 495);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_REQUIRED"), 496);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_HTTP_REQUEST_SENT_TO_HTTPS_PORT"), 497);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_TOKEN_ESRI"), 498);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CLIENT_CLOSED_REQUEST"), 499);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BANDWIDTH_LIMIT_EXCEEDED"), 509);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNKNOWN_ERROR"), 520);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_WEB_SERVER_IS_DOWN"), 521);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONNECTION_TIMEOUT"), 522);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_IS_UNREACHABLE"), 523);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TIMEOUT_OCCURRED"), 524);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_HANDSHAKE_FAILED"), 525);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_SSL_CERTIFICATE"), 526);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RAILGUN_ERROR"), 527);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_DNS_ERROR"), 530);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_READ_TIMEOUT_ERROR"), 598);
+
+ zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_CONNECT_TIMEOUT_ERROR"), 599);
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, has)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_Request_Exception)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *index_param = NULL, _0;
- zval index;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Request, Exception, phalcon, http_request_exception, zend_ce_exception, NULL, 0);
- ZVAL_UNDEF(&index);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &index_param);
- if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
- } else {
- ZEPHIR_INIT_VAR(&index);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- RETURN_MM_BOOL(zephir_array_isset(&_0, &index));
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, notFound)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_Request_File)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *index_param = NULL, _0, _1$$3;
- zval index, _2$$3;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Request, File, phalcon, http_request_file, phalcon_http_request_file_method_entry, 0);
- ZVAL_UNDEF(&index);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(index)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &index_param);
- if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) {
- zephir_get_strval(&index, index_param);
- } else {
- ZEPHIR_INIT_VAR(&index);
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("triggerError"), PH_NOISY_CC | PH_READONLY);
- if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_translate_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SV(&_2$$3, "Cannot find translation key: ", &index);
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/NativeArray.zep", 108);
- ZEPHIR_MM_RESTORE();
- return;
- }
- RETURN_CTOR(&index);
+ zend_declare_property_null(phalcon_http_request_file_ce, SL("error"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_request_file_ce, SL("extension"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_request_file_ce, SL("key"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_request_file_ce, SL("name"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_request_file_ce, SL("realType"), ZEND_ACC_PROTECTED);
+ zend_declare_property_long(phalcon_http_request_file_ce, SL("size"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_request_file_ce, SL("tmp"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_request_file_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_http_request_file_ce, 1, phalcon_http_request_fileinterface_ce);
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, query)
+static PHP_METHOD(Phalcon_Http_Request_File, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval placeholders;
- zval *translateKey_param = NULL, *placeholders_param = NULL, translation, _0;
- zval translateKey;
+ zval *file_param = NULL, *key = NULL, key_sub, __$null, name, _4, _5, _6, _7, _8, _0$$3, _1$$3, _2$$4, _3$$4;
+ zval file;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&translateKey);
- ZVAL_UNDEF(&translation);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&placeholders);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&key_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(translateKey)
+ Z_PARAM_ARRAY(file)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(placeholders)
+ Z_PARAM_ZVAL_OR_NULL(key)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &translateKey_param, &placeholders_param);
- if (UNEXPECTED(Z_TYPE_P(translateKey_param) != IS_STRING && Z_TYPE_P(translateKey_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'translateKey' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(translateKey_param) == IS_STRING)) {
- zephir_get_strval(&translateKey, translateKey_param);
- } else {
- ZEPHIR_INIT_VAR(&translateKey);
- }
- if (!placeholders_param) {
- ZEPHIR_INIT_VAR(&placeholders);
- array_init(&placeholders);
- } else {
- zephir_get_arrval(&placeholders, placeholders_param);
+ zephir_fetch_params(1, 1, 1, &file_param, &key);
+ ZEPHIR_OBS_COPY_OR_DUP(&file, file_param);
+ if (!key) {
+ key = &key_sub;
+ key = &__$null;
}
- zephir_memory_observe(&translation);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- if (!(zephir_array_isset_fetch(&translation, &_0, &translateKey, 0))) {
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "notfound", NULL, 0, &translateKey);
+ zephir_memory_observe(&name);
+ if (zephir_array_isset_string_fetch(&name, &file, SL("name"), 0)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
+ ZEPHIR_INIT_VAR(&_0$$3);
+ ZVAL_STRING(&_0$$3, "PATHINFO_EXTENSION");
+ ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 118, &_0$$3);
zephir_check_call_status();
- RETURN_MM();
+ if (zephir_is_true(&_1$$3)) {
+ ZVAL_LONG(&_2$$4, 4);
+ ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 89, &name, &_2$$4);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("extension"), &_3$$4);
+ }
}
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "replaceplaceholders", NULL, 0, &translation, &placeholders);
+ ZEPHIR_INIT_VAR(&_5);
+ ZVAL_STRING(&_5, "tmp_name");
+ ZEPHIR_CALL_METHOD(&_4, this_ptr, "getarrval", NULL, 353, &file, &_5);
zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("tmp"), &_4);
+ ZEPHIR_INIT_NVAR(&_5);
+ ZVAL_STRING(&_5, "size");
+ ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 353, &file, &_5);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &_6);
+ ZEPHIR_INIT_NVAR(&_5);
+ ZVAL_STRING(&_5, "type");
+ ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 353, &file, &_5);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_7);
+ ZEPHIR_INIT_NVAR(&_5);
+ ZVAL_STRING(&_5, "error");
+ ZEPHIR_CALL_METHOD(&_8, this_ptr, "getarrval", NULL, 353, &file, &_5);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("error"), &_8);
+ if (zephir_is_true(key)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("key"), key);
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, toArray)
+static PHP_METHOD(Phalcon_Http_Request_File, getError)
{
- RETURN_MEMBER(getThis(), "translate");
+ RETURN_MEMBER(getThis(), "error");
}
-zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(zend_class_entry *class_type)
+static PHP_METHOD(Phalcon_Http_Request_File, getExtension)
{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("translate"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("translate"), &_1$$3);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
- }
+ RETURN_MEMBER(getThis(), "extension");
}
+static PHP_METHOD(Phalcon_Http_Request_File, getKey)
+{
+ RETURN_MEMBER(getThis(), "key");
+}
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Bag)
+static PHP_METHOD(Phalcon_Http_Request_File, getName)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session, Bag, phalcon, session_bag, phalcon_support_collection_ce, phalcon_session_bag_method_entry, 0);
- zend_declare_property_null(phalcon_session_bag_ce, SL("container"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_session_bag_ce, SL("name"), ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_session_bag_ce, SL("session"), ZEND_ACC_PRIVATE);
- zend_class_implements(phalcon_session_bag_ce, 1, phalcon_session_baginterface_ce);
- zend_class_implements(phalcon_session_bag_ce, 1, phalcon_di_injectionawareinterface_ce);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "name");
}
-static PHP_METHOD(Phalcon_Session_Bag, __construct)
+static PHP_METHOD(Phalcon_Http_Request_File, getRealType)
{
+ zval finfo, mime, _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval name;
- zval *session, session_sub, *name_param = NULL, data, _0, _1;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&session_sub);
- ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&finfo);
+ ZVAL_UNDEF(&mime);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&name);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(session, phalcon_session_managerinterface_ce)
- Z_PARAM_STR(name)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &session, &name_param);
- zephir_get_strval(&name, name_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("session"), session);
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- ZEPHIR_CALL_METHOD(&_0, session, "getdi", NULL, 0);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&data, session, "get", NULL, 0, &_1);
+
+ ZVAL_LONG(&_0, 16);
+ ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 308, &_0);
zephir_check_call_status();
- if (Z_TYPE_P(&data) != IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&data);
- array_init(&data);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&finfo)) {
+ RETURN_MM_STRING("");
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &data);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 309, &finfo, &_0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 310, &finfo);
+ zephir_check_call_status();
+ RETURN_CCTOR(&mime);
}
-static PHP_METHOD(Phalcon_Session_Bag, clear)
+static PHP_METHOD(Phalcon_Http_Request_File, getSize)
{
- zval _0, _1;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ RETURN_MEMBER(getThis(), "size");
+}
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "clear", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+static PHP_METHOD(Phalcon_Http_Request_File, getTempName)
+{
+
+ RETURN_MEMBER(getThis(), "tmp");
}
-static PHP_METHOD(Phalcon_Session_Bag, getDI)
+static PHP_METHOD(Phalcon_Http_Request_File, getType)
{
- RETURN_MEMBER(getThis(), "container");
+ RETURN_MEMBER(getThis(), "type");
}
-static PHP_METHOD(Phalcon_Session_Bag, init)
+static PHP_METHOD(Phalcon_Http_Request_File, isUploadedFile)
{
+ zend_bool _0;
+ zval tmp, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *data_param = NULL, _0, _1;
- zval data;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&tmp);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(data)
- ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &data_param);
- if (!data_param) {
- ZEPHIR_INIT_VAR(&data);
- array_init(&data);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&data, data_param);
- }
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "init", NULL, 0, &data);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &_1, &data);
+
+ ZEPHIR_CALL_METHOD(&tmp, this_ptr, "gettempname", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ _0 = Z_TYPE_P(&tmp) == IS_STRING;
+ if (_0) {
+ ZEPHIR_CALL_FUNCTION(&_1, "is_uploaded_file", NULL, 20, &tmp);
+ zephir_check_call_status();
+ _0 = zephir_is_true(&_1);
+ }
+ RETURN_MM_BOOL(_0);
}
-static PHP_METHOD(Phalcon_Session_Bag, remove)
+static PHP_METHOD(Phalcon_Http_Request_File, moveTo)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *element_param = NULL, _0, _1, _2;
- zval element;
+ zval *destination_param = NULL, _0;
+ zval destination;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&element);
+ ZVAL_UNDEF(&destination);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(element)
+ Z_PARAM_STR(destination)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &element_param);
- if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
+ zephir_fetch_params(1, 1, 0, &destination_param);
+ if (UNEXPECTED(Z_TYPE_P(destination_param) != IS_STRING && Z_TYPE_P(destination_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'destination' must be of the type string"));
RETURN_MM_NULL();
}
- if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
- zephir_get_strval(&element, element_param);
+ if (EXPECTED(Z_TYPE_P(destination_param) == IS_STRING)) {
+ zephir_get_strval(&destination, destination_param);
} else {
- ZEPHIR_INIT_VAR(&element);
+ ZEPHIR_INIT_VAR(&destination);
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "remove", NULL, 0, &element);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &_1, &_2);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 354, &_0, &destination);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Bag, set)
+static PHP_METHOD(Phalcon_Http_Request_File, getArrVal)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *element_param = NULL, *value, value_sub, _0, _1, _2;
- zval element;
- zval *this_ptr = getThis();
+ zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value;
+ zval collection;
- ZVAL_UNDEF(&element);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(element)
- Z_PARAM_ZVAL(value)
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(index)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &element_param, &value);
- if (UNEXPECTED(Z_TYPE_P(element_param) != IS_STRING && Z_TYPE_P(element_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'element' must be of the type string"));
- RETURN_MM_NULL();
+ zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
}
- if (EXPECTED(Z_TYPE_P(element_param) == IS_STRING)) {
- zephir_get_strval(&element, element_param);
- } else {
- ZEPHIR_INIT_VAR(&element);
+ zephir_memory_observe(&value);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
}
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_bag_ce, getThis(), "set", NULL, 0, &element, value);
- zephir_check_call_status();
- zephir_read_property(&_0, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &_1, &_2);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_CCTOR(&value);
}
-static PHP_METHOD(Phalcon_Session_Bag, setDI)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_Request_FileInterface)
{
- zval *container, container_sub;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Request, FileInterface, phalcon, http_request_fileinterface, phalcon_http_request_fileinterface_method_entry);
- ZVAL_UNDEF(&container_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &container);
- zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container);
+ return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getError);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getRealType);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getSize);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getTempName);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getType);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, moveTo);
@@ -162697,23 +159440,32 @@ static PHP_METHOD(Phalcon_Session_Bag, setDI)
-ZEPHIR_INIT_CLASS(Phalcon_Session_BagInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_CookieInterface)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Session, BagInterface, phalcon, session_baginterface, phalcon_session_baginterface_method_entry);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Cookie, CookieInterface, phalcon, http_cookie_cookieinterface, phalcon_http_cookie_cookieinterface_method_entry);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __get);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __isset);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __set);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __unset);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, init);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, set);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, remove);
-ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, clear);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, delete);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getDomain);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getExpiration);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getHttpOnly);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getName);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getOptions);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getPath);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getSecure);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getValue);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, isUsingEncryption);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, send);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setDomain);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setExpiration);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setHttpOnly);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setOptions);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setPath);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setSecure);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setValue);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, useEncryption);
@@ -162724,9 +159476,9 @@ ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, clear);
-ZEPHIR_INIT_CLASS(Phalcon_Session_Exception)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session, Exception, phalcon, session_exception, zend_ce_exception, NULL, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Cookie, Exception, phalcon, http_cookie_exception, zend_ce_exception, NULL, 0);
return SUCCESS;
}
@@ -162741,451 +159493,653 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Exception)
-ZEPHIR_INIT_CLASS(Phalcon_Session_Manager)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Cookies)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session, Manager, phalcon, session_manager, phalcon_di_abstractinjectionaware_ce, phalcon_session_manager_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Response, Cookies, phalcon, http_response_cookies, phalcon_di_abstractinjectionaware_ce, phalcon_http_response_cookies_method_entry, 0);
- zend_declare_property_null(phalcon_session_manager_ce, SL("adapter"), ZEND_ACC_PRIVATE);
- zend_declare_property_string(phalcon_session_manager_ce, SL("name"), "", ZEND_ACC_PRIVATE);
- zend_declare_property_null(phalcon_session_manager_ce, SL("options"), ZEND_ACC_PRIVATE);
- zend_declare_property_string(phalcon_session_manager_ce, SL("uniqueId"), "", ZEND_ACC_PRIVATE);
- phalcon_session_manager_ce->create_object = zephir_init_properties_Phalcon_Session_Manager;
+ zend_declare_property_null(phalcon_http_response_cookies_ce, SL("cookies"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("isSent"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("registered"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_http_response_cookies_ce, SL("signKey"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("useEncryption"), 1, ZEND_ACC_PROTECTED);
+ phalcon_http_response_cookies_ce->create_object = zephir_init_properties_Phalcon_Http_Response_Cookies;
- zend_class_implements(phalcon_session_manager_ce, 1, phalcon_session_managerinterface_ce);
+ zend_class_implements(phalcon_http_response_cookies_ce, 1, phalcon_http_response_cookiesinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Session_Manager, __construct)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *options_param = NULL;
- zval options;
+ zval signKey;
+ zval *useEncryption_param = NULL, *signKey_param = NULL, __$true, __$false;
+ zend_bool useEncryption;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&signKey);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_BOOL(useEncryption)
+ Z_PARAM_STR_OR_NULL(signKey)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 0, 2, &useEncryption_param, &signKey_param);
+ if (!useEncryption_param) {
+ useEncryption = 1;
} else {
- zephir_get_arrval(&options, options_param);
+ }
+ if (!signKey_param) {
+ ZEPHIR_INIT_VAR(&signKey);
+ } else {
+ zephir_get_strval(&signKey, signKey_param);
}
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setoptions", NULL, 0, &options);
+ if (useEncryption) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$false);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsignkey", NULL, 0, &signKey);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Session_Manager, __get)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL;
- zval key;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&key);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, __isset)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, delete)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL;
- zval key;
+ zval *name_param = NULL, cookie, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&cookie);
+ ZVAL_UNDEF(&_0);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, __set)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub;
- zval key;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, &key, value);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ zephir_memory_observe(&cookie);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&cookie, &_0, &name, 0))) {
+ RETURN_MM_BOOL(0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "delete", NULL, 0);
zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Session_Manager, __unset)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, get)
{
+ zval _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL;
- zval key;
+ zval *name_param = NULL, container, encryption, cookie, _0, _1, _2, _4, _5, _6$$5;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&encryption);
+ ZVAL_UNDEF(&cookie);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "remove", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, destroy)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval _SESSION, _0;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_SESSION);
- ZVAL_UNDEF(&_0);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_get_global(&_SESSION, SL("_SESSION"));
-
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ zephir_memory_observe(&cookie);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_array_isset_fetch(&cookie, &_0, &name, 0)) {
+ RETURN_CCTOR(&cookie);
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_3);
+ zephir_create_array(&_3, 1, 0);
+ zephir_array_fast_append(&_3, &name);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_STRING(&_4, "Phalcon\\Http\\Cookie");
+ ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &_4, &_3);
zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZEPHIR_CALL_FUNCTION(NULL, "session_destroy", NULL, 0);
+ ZEPHIR_CPY_WRT(&cookie, &_2);
+ zephir_read_property(&_5, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_5);
+ if (Z_TYPE_P(&container) == IS_OBJECT) {
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setdi", NULL, 0, &container);
zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_SESSION);
- array_init(&_SESSION);
+ zephir_memory_observe(&encryption);
+ zephir_read_property(&encryption, this_ptr, ZEND_STRL("useEncryption"), PH_NOISY_CC);
+ if (zephir_is_true(&encryption)) {
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "useencryption", NULL, 0, &encryption);
+ zephir_check_call_status();
+ zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_6$$5);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_MM_RESTORE();
+ RETURN_CCTOR(&cookie);
}
-static PHP_METHOD(Phalcon_Session_Manager, exists)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, getCookies)
{
- zval _0;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
-
- ZVAL_UNDEF(&_0);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_CALL_FUNCTION(&_0, "session_status", NULL, 0);
- zephir_check_call_status();
- RETURN_MM_BOOL(ZEPHIR_IS_LONG_IDENTICAL(&_0, 2));
+ RETURN_MEMBER(getThis(), "cookies");
}
-static PHP_METHOD(Phalcon_Session_Manager, get)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, has)
{
+ zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zend_bool remove;
- zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, *remove_param = NULL, _SESSION, __$null, value, uniqueKey, _0;
- zval key;
+ zval *name_param = NULL, _COOKIE, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&uniqueKey);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_COOKIE);
ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(key)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- Z_PARAM_BOOL(remove)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_get_global(&_SESSION, SL("_SESSION"));
- zephir_fetch_params(1, 1, 2, &key_param, &defaultValue, &remove_param);
- zephir_get_strval(&key, key_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
+ zephir_get_global(&_COOKIE, SL("_COOKIE"));
+ zephir_fetch_params(1, 1, 0, &name_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
}
- if (!remove_param) {
- remove = 0;
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- }
- ZEPHIR_INIT_VAR(&value);
- ZVAL_NULL(&value);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
- RETURN_CCTOR(&value);
+ ZEPHIR_INIT_VAR(&name);
}
- ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, this_ptr, "getarrval", NULL, 0, &_SESSION, &uniqueKey, defaultValue);
- zephir_check_call_status();
- if (remove) {
- zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
+ _1 = zephir_array_isset(&_0, &name);
+ if (!(_1)) {
+ _1 = zephir_array_isset(&_COOKIE, &name);
}
- RETURN_CCTOR(&value);
+ RETURN_MM_BOOL(_1);
}
-static PHP_METHOD(Phalcon_Session_Manager, getAdapter)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, isSent)
{
- RETURN_MEMBER(getThis(), "adapter");
+ RETURN_MEMBER(getThis(), "isSent");
}
-static PHP_METHOD(Phalcon_Session_Manager, getId)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, isUsingEncryption)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- ZEPHIR_RETURN_CALL_FUNCTION("session_id", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_MEMBER(getThis(), "useEncryption");
}
-static PHP_METHOD(Phalcon_Session_Manager, getName)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, reset)
{
- zval _0, _1, _2$$3;
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2$$3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- if (ZEPHIR_IS_IDENTICAL(&_1, &_0)) {
- ZEPHIR_CALL_FUNCTION(&_2$$3, "session_name", NULL, 0);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &_2$$3);
- }
- RETURN_MM_MEMBER(getThis(), "name");
+ ZEPHIR_INIT_VAR(&_0);
+ array_init(&_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("cookies"), &_0);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Manager, has)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, send)
{
+ zend_bool _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval __$true, __$false, cookie, _0, _2, _3, *_4, _5;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _SESSION, uniqueKey, _0;
- zval key;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_UNDEF(&uniqueKey);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&cookie);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_get_global(&_SESSION, SL("_SESSION"));
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
+
+ ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 359);
zephir_check_call_status();
- if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) {
+ _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0);
+ if (!(_1)) {
+ ZEPHIR_CALL_METHOD(&_2, this_ptr, "issent", NULL, 0);
+ zephir_check_call_status();
+ _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2);
+ }
+ if (_1) {
RETURN_MM_BOOL(0);
}
- ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key);
- zephir_check_call_status();
- RETURN_MM_BOOL(zephir_array_isset(&_SESSION, &uniqueKey));
-}
-
-static PHP_METHOD(Phalcon_Session_Manager, getOptions)
-{
-
- RETURN_MEMBER(getThis(), "options");
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
+ zephir_is_iterable(&_3, 0, "phalcon/Http/Response/Cookies.zep", 225);
+ if (Z_TYPE_P(&_3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4)
+ {
+ ZEPHIR_INIT_NVAR(&cookie);
+ ZVAL_COPY(&cookie, _4);
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "send", NULL, 0);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_3, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_3, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&cookie, &_3, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "send", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&cookie);
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$false);
+ }
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Session_Manager, regenerateId)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, set)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *deleteOldSession_param = NULL, _0, _1$$3;
- zend_bool deleteOldSession;
+ zval options, _3$$3;
+ zend_bool secure, httpOnly;
+ zend_long expire, ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, *value = NULL, value_sub, *expire_param = NULL, *path_param = NULL, *secure_param = NULL, *domain_param = NULL, *httpOnly_param = NULL, *options_param = NULL, __$true, __$false, __$null, cookie, encryption, container, response, _0, _10, _1$$3, _2$$3, _4$$3, _5$$3, _6$$4, _7$$5, _8$$5, _9$$5, _11$$6, _12$$6;
+ zval name, path, domain;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&path);
+ ZVAL_UNDEF(&domain);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&cookie);
+ ZVAL_UNDEF(&encryption);
+ ZVAL_UNDEF(&container);
+ ZVAL_UNDEF(&response);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_10);
ZVAL_UNDEF(&_1$$3);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&_3$$3);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 8)
+ Z_PARAM_STR(name)
Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(deleteOldSession)
+ Z_PARAM_ZVAL_OR_NULL(value)
+ Z_PARAM_LONG(expire)
+ Z_PARAM_STR(path)
+ Z_PARAM_BOOL_OR_NULL(secure, is_null_true)
+ Z_PARAM_STR_OR_NULL(domain)
+ Z_PARAM_BOOL_OR_NULL(httpOnly, is_null_true)
+ Z_PARAM_ARRAY(options)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &deleteOldSession_param);
- if (!deleteOldSession_param) {
- deleteOldSession = 1;
+ zephir_fetch_params(1, 1, 7, &name_param, &value, &expire_param, &path_param, &secure_param, &domain_param, &httpOnly_param, &options_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
+ } else {
+ ZEPHIR_INIT_VAR(&name);
+ }
+ if (!value) {
+ value = &value_sub;
+ value = &__$null;
+ }
+ if (!expire_param) {
+ expire = 0;
} else {
}
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZVAL_BOOL(&_1$$3, (deleteOldSession ? 1 : 0));
- ZEPHIR_CALL_FUNCTION(NULL, "session_regenerate_id", NULL, 0, &_1$$3);
+ if (!path_param) {
+ ZEPHIR_INIT_VAR(&path);
+ ZVAL_STRING(&path, "/");
+ } else {
+ zephir_get_strval(&path, path_param);
+ }
+ if (!secure_param) {
+ secure = 0;
+ } else {
+ }
+ if (!domain_param) {
+ ZEPHIR_INIT_VAR(&domain);
+ } else {
+ if (UNEXPECTED(Z_TYPE_P(domain_param) != IS_STRING && Z_TYPE_P(domain_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) {
+ zephir_get_strval(&domain, domain_param);
+ } else {
+ ZEPHIR_INIT_VAR(&domain);
+ }
+ }
+ if (!httpOnly_param) {
+ httpOnly = 0;
+ } else {
+ }
+ if (!options_param) {
+ ZEPHIR_INIT_VAR(&options);
+ array_init(&options);
+ } else {
+ zephir_get_arrval(&options, options_param);
+ }
+ zephir_memory_observe(&encryption);
+ zephir_read_property(&encryption, this_ptr, ZEND_STRL("useEncryption"), PH_NOISY_CC);
+ zephir_memory_observe(&cookie);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset_fetch(&cookie, &_0, &name, 0))) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_3$$3);
+ zephir_create_array(&_3$$3, 8, 0);
+ zephir_array_fast_append(&_3$$3, &name);
+ zephir_array_fast_append(&_3$$3, value);
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZVAL_LONG(&_4$$3, expire);
+ zephir_array_fast_append(&_3$$3, &_4$$3);
+ zephir_array_fast_append(&_3$$3, &path);
+ ZEPHIR_INIT_NVAR(&_4$$3);
+ ZVAL_BOOL(&_4$$3, secure);
+ zephir_array_fast_append(&_3$$3, &_4$$3);
+ zephir_array_fast_append(&_3$$3, &domain);
+ ZEPHIR_INIT_NVAR(&_4$$3);
+ ZVAL_BOOL(&_4$$3, httpOnly);
+ zephir_array_fast_append(&_3$$3, &_4$$3);
+ zephir_array_fast_append(&_3$$3, &options);
+ ZEPHIR_INIT_NVAR(&_4$$3);
+ ZVAL_STRING(&_4$$3, "Phalcon\\Http\\Cookie");
+ ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "get", NULL, 0, &_4$$3, &_3$$3);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&cookie, &_2$$3);
+ zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setdi", NULL, 0, &_5$$3);
+ zephir_check_call_status();
+ if (zephir_is_true(&encryption)) {
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "useencryption", NULL, 0, &encryption);
+ zephir_check_call_status();
+ zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_6$$4);
+ zephir_check_call_status();
+ }
+ zephir_update_property_array(this_ptr, SL("cookies"), &name, &cookie);
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setvalue", NULL, 0, value);
+ zephir_check_call_status();
+ ZVAL_LONG(&_7$$5, expire);
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setexpiration", NULL, 0, &_7$$5);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setpath", NULL, 0, &path);
+ zephir_check_call_status();
+ if (secure) {
+ ZVAL_BOOL(&_7$$5, 1);
+ } else {
+ ZVAL_BOOL(&_7$$5, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setsecure", NULL, 0, &_7$$5);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setdomain", NULL, 0, &domain);
+ zephir_check_call_status();
+ if (httpOnly) {
+ ZVAL_BOOL(&_8$$5, 1);
+ } else {
+ ZVAL_BOOL(&_8$$5, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "sethttponly", NULL, 0, &_8$$5);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setoptions", NULL, 0, &options);
+ zephir_check_call_status();
+ zephir_read_property(&_9$$5, this_ptr, ZEND_STRL("signKey"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_9$$5);
zephir_check_call_status();
}
+ zephir_read_property(&_10, this_ptr, ZEND_STRL("registered"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_10)) {
+ zephir_read_property(&_11$$6, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&container, &_11$$6);
+ if (Z_TYPE_P(&container) == IS_NULL) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_cookie_exception_ce, "A dependency injection container is required to access the 'response' service", "phalcon/Http/Response/Cookies.zep", 311);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_12$$6);
+ ZVAL_STRING(&_12$$6, "response");
+ ZEPHIR_CALL_METHOD(&response, &container, "getshared", NULL, 0, &_12$$6);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &response, "setcookies", NULL, 0, this_ptr);
+ zephir_check_call_status();
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("registered"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("registered"), &__$false);
+ }
+ }
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Manager, remove)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, setSignKey)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, _SESSION, uniqueKey, _0;
- zval key;
+ zval *signKey_param = NULL;
+ zval signKey;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_UNDEF(&uniqueKey);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ ZVAL_UNDEF(&signKey);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(signKey)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_get_global(&_SESSION, SL("_SESSION"));
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE);
+ zephir_fetch_params(1, 0, 1, &signKey_param);
+ if (!signKey_param) {
+ ZEPHIR_INIT_VAR(&signKey);
+ } else {
+ zephir_get_strval(&signKey, signKey_param);
}
- ZEPHIR_MM_RESTORE();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("signKey"), &signKey);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Manager, set)
+static PHP_METHOD(Phalcon_Http_Response_Cookies, useEncryption)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, _SESSION, uniqueKey, _0;
- zval key;
+ zval *useEncryption_param = NULL, __$true, __$false;
+ zend_bool useEncryption;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&_SESSION);
- ZVAL_UNDEF(&uniqueKey);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_BOOL(useEncryption)
ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_get_global(&_SESSION, SL("_SESSION"));
- zephir_fetch_params(1, 2, 0, &key_param, &value);
- zephir_get_strval(&key, key_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key);
- zephir_check_call_status();
- zephir_array_update_zval(&_SESSION, &uniqueKey, value, PH_COPY | PH_SEPARATE);
+ zephir_fetch_params_without_memory_grow(1, 0, &useEncryption_param);
+ if (useEncryption) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$false);
}
- ZEPHIR_MM_RESTORE();
+ RETURN_THISW();
}
-static PHP_METHOD(Phalcon_Session_Manager, setAdapter)
+zend_object *zephir_init_properties_Phalcon_Http_Response_Cookies(zend_class_entry *class_type)
{
- zval *adapter, adapter_sub;
- zval *this_ptr = getThis();
+ zval _0, _1$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1$$3);
+
- ZVAL_UNDEF(&adapter_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(adapter, php_session_iface_entry)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &adapter);
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), adapter);
- RETURN_THISW();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ {
+ zval local_this_ptr, *this_ptr = &local_this_ptr;
+ ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("cookies"), &_1$$3);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
+ }
}
-static PHP_METHOD(Phalcon_Session_Manager, setId)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_Response_CookiesInterface)
+{
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Response, CookiesInterface, phalcon, http_response_cookiesinterface, phalcon_http_response_cookiesinterface_method_entry);
+
+ return SUCCESS;
+}
+
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, delete);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, get);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, has);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, isUsingEncryption);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, reset);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, send);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, set);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_CookiesInterface, useEncryption);
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Response, Exception, phalcon, http_response_exception, zend_ce_exception, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Headers)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Response, Headers, phalcon, http_response_headers, phalcon_http_response_headers_method_entry, 0);
+
+ zend_declare_property_null(phalcon_http_response_headers_ce, SL("headers"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_http_response_headers_ce, SL("isSent"), 0, ZEND_ACC_PROTECTED);
+ phalcon_http_response_headers_ce->create_object = zephir_init_properties_Phalcon_Http_Response_Headers;
+
+ zend_class_implements(phalcon_http_response_headers_ce, 1, phalcon_http_response_headersinterface_ce);
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Http_Response_Headers, get)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *sessionId_param = NULL, _0, _1$$3;
- zval sessionId, _2$$3;
+ zval *name_param = NULL, headers, headerValue, _0;
+ zval name;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&sessionId);
- ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&headers);
+ ZVAL_UNDEF(&headerValue);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(sessionId)
+ Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &sessionId_param);
- zephir_get_strval(&sessionId, sessionId_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- ZEPHIR_INIT_VAR(&_1$$3);
- object_init_ex(&_1$$3, phalcon_session_exception_ce);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_CONCAT_SS(&_2$$3, "The session has already been started. ", "To change the id, use regenerateId()");
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 33, &_2$$3);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_1$$3, "phalcon/Session/Manager.zep", 271);
- ZEPHIR_MM_RESTORE();
- return;
+ zephir_fetch_params(1, 1, 0, &name_param);
+ zephir_get_strval(&name, name_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&headers, &_0);
+ zephir_memory_observe(&headerValue);
+ if (!(zephir_array_isset_fetch(&headerValue, &headers, &name, 0))) {
+ RETURN_MM_BOOL(0);
}
- ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 0, &sessionId);
- zephir_check_call_status();
- RETURN_THIS();
+ RETURN_CCTOR(&headerValue);
}
-static PHP_METHOD(Phalcon_Session_Manager, setName)
+static PHP_METHOD(Phalcon_Http_Response_Headers, has)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
zval *name_param = NULL, _0;
zval name;
zval *this_ptr = getThis();
@@ -163199,212 +160153,236 @@ static PHP_METHOD(Phalcon_Session_Manager, setName)
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
zephir_fetch_params(1, 1, 0, &name_param);
zephir_get_strval(&name, name_param);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
- zephir_check_call_status();
- if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "Cannot set session name after a session has started", "phalcon/Session/Manager.zep", 294);
- return;
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name);
- ZEPHIR_CALL_FUNCTION(NULL, "session_name", NULL, 0, &name);
- zephir_check_call_status();
- RETURN_THIS();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ RETURN_MM_BOOL(zephir_array_key_exists(&_0, &name));
}
-static PHP_METHOD(Phalcon_Session_Manager, setOptions)
+static PHP_METHOD(Phalcon_Http_Response_Headers, isSent)
+{
+
+ RETURN_MEMBER(getThis(), "isSent");
+}
+
+static PHP_METHOD(Phalcon_Http_Response_Headers, remove)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *options_param = NULL, _0, _1, _2;
- zval options;
+ zval *header_param = NULL, headers, _0;
+ zval header;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&header);
+ ZVAL_UNDEF(&headers);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(options)
+ Z_PARAM_STR(header)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &options_param);
- zephir_get_arrval(&options, options_param);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "uniqueId");
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("uniqueId"), &_0);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
+ zephir_fetch_params(1, 1, 0, &header_param);
+ zephir_get_strval(&header, header_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&headers, &_0);
+ zephir_array_unset(&headers, &header, PH_SEPARATE);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &headers);
+ RETURN_THIS();
+}
+
+static PHP_METHOD(Phalcon_Http_Response_Headers, reset)
+{
+ zval _0;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *this_ptr = getThis();
+
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ ZEPHIR_INIT_VAR(&_0);
+ array_init(&_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_0);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Session_Manager, start)
+static PHP_METHOD(Phalcon_Http_Response_Headers, send)
{
+ zend_string *_7;
+ zend_ulong _6;
+ zend_bool _1, _10$$6, _16$$11;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval _COOKIE, name, value, _0, _1, _2, _7, _3$$6, _4$$6, _5$$6, _6$$6;
+ zephir_fcall_cache_entry *_9 = NULL;
+ zval __$true, __$false, header, value, _0, _2, _3, *_4, _5, _8$$5, _11$$6, _12$$6, _13$$6, _14$$8, _15$$10, _17$$11, _18$$11, _19$$11, _20$$13;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_COOKIE);
- ZVAL_UNDEF(&name);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&header);
ZVAL_UNDEF(&value);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_3$$6);
- ZVAL_UNDEF(&_4$$6);
- ZVAL_UNDEF(&_5$$6);
- ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$8);
+ ZVAL_UNDEF(&_15$$10);
+ ZVAL_UNDEF(&_17$$11);
+ ZVAL_UNDEF(&_18$$11);
+ ZVAL_UNDEF(&_19$$11);
+ ZVAL_UNDEF(&_20$$13);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_get_global(&_COOKIE, SL("_COOKIE"));
- ZEPHIR_CALL_METHOD(&name, this_ptr, "getname", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0);
+ ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 359);
zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
- RETURN_MM_BOOL(1);
+ _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0);
+ if (!(_1)) {
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("isSent"), PH_NOISY_CC | PH_READONLY);
+ _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2);
}
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "phpheaderssent", NULL, 0);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) {
+ if (_1) {
RETURN_MM_BOOL(0);
}
- zephir_memory_observe(&_2);
- zephir_read_property(&_2, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC);
- if (UNEXPECTED(!(zephir_is_instance_of(&_2, SL("SessionHandlerInterface"))))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session adapter is not valid", "phalcon/Session/Manager.zep", 338);
- return;
- }
- zephir_memory_observe(&value);
- if (zephir_array_isset_fetch(&value, &_COOKIE, &name, 0)) {
- ZEPHIR_INIT_VAR(&_3$$6);
- ZEPHIR_INIT_VAR(&_4$$6);
- ZVAL_STRING(&_4$$6, "/^[a-z0-9]+$/iD");
- ZEPHIR_INIT_VAR(&_5$$6);
- ZEPHIR_INIT_VAR(&_6$$6);
- ZVAL_STRING(&_6$$6, "/^[a-z0-9]+$/iD");
- zephir_preg_match(&_5$$6, &_6$$6, &value, &_3$$6, 0, 0 , 0 );
- if (!(zephir_is_true(&_5$$6))) {
- zephir_array_unset(&_COOKIE, &name, PH_SEPARATE);
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
+ zephir_is_iterable(&_3, 0, "phalcon/Http/Response/Headers.zep", 107);
+ if (Z_TYPE_P(&_3) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_3), _6, _7, _4)
+ {
+ ZEPHIR_INIT_NVAR(&header);
+ if (_7 != NULL) {
+ ZVAL_STR_COPY(&header, _7);
+ } else {
+ ZVAL_LONG(&header, _6);
+ }
+ ZEPHIR_INIT_NVAR(&value);
+ ZVAL_COPY(&value, _4);
+ if (Z_TYPE_P(&value) != IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_8$$5);
+ ZEPHIR_CONCAT_VSV(&_8$$5, &header, ": ", &value);
+ ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_8$$5, &__$true);
+ zephir_check_call_status();
+ } else {
+ _10$$6 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99);
+ if (!(_10$$6)) {
+ ZVAL_LONG(&_11$$6, 0);
+ ZVAL_LONG(&_12$$6, 5);
+ ZEPHIR_INIT_NVAR(&_13$$6);
+ zephir_substr(&_13$$6, &header, 0 , 5 , 0);
+ _10$$6 = ZEPHIR_IS_STRING(&_13$$6, "HTTP/");
+ }
+ if (_10$$6) {
+ ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &header, &__$true);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&_14$$8);
+ ZEPHIR_CONCAT_VS(&_14$$8, &header, ": ");
+ ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_14$$8, &__$true);
+ zephir_check_call_status();
+ }
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &_3, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &_3, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&header, &_3, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&value, &_3, "current", NULL, 0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&value) != IS_NULL) {
+ ZEPHIR_INIT_NVAR(&_15$$10);
+ ZEPHIR_CONCAT_VSV(&_15$$10, &header, ": ", &value);
+ ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_15$$10, &__$true);
+ zephir_check_call_status();
+ } else {
+ _16$$11 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99);
+ if (!(_16$$11)) {
+ ZVAL_LONG(&_17$$11, 0);
+ ZVAL_LONG(&_18$$11, 5);
+ ZEPHIR_INIT_NVAR(&_19$$11);
+ zephir_substr(&_19$$11, &header, 0 , 5 , 0);
+ _16$$11 = ZEPHIR_IS_STRING(&_19$$11, "HTTP/");
+ }
+ if (_16$$11) {
+ ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &header, &__$true);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_INIT_NVAR(&_20$$13);
+ ZEPHIR_CONCAT_VS(&_20$$13, &header, ": ");
+ ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 360, &_20$$13, &__$true);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
+ zephir_check_call_status();
}
}
- zephir_read_property(&_7, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 0, &_7);
- zephir_check_call_status();
- ZEPHIR_RETURN_CALL_FUNCTION("session_start", NULL, 0);
- zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&value);
+ ZEPHIR_INIT_NVAR(&header);
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isSent"), &__$false);
+ }
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_Session_Manager, status)
+static PHP_METHOD(Phalcon_Http_Response_Headers, set)
{
- zval status;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
-
- ZVAL_UNDEF(&status);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_FUNCTION(&status, "session_status", NULL, 0);
- zephir_check_call_status();
- do {
- if (ZEPHIR_IS_LONG(&status, 0)) {
- RETURN_MM_LONG(0);
- }
- if (ZEPHIR_IS_LONG(&status, 2)) {
- RETURN_MM_LONG(2);
- }
- } while(0);
-
- RETURN_MM_LONG(1);
-}
+ zval *name_param = NULL, *value_param = NULL;
+ zval name, value;
+ zval *this_ptr = getThis();
-static PHP_METHOD(Phalcon_Session_Manager, phpHeadersSent)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&value);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_STR(value)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_RETURN_CALL_FUNCTION("headers_sent", NULL, 359);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 2, 0, &name_param, &value_param);
+ zephir_get_strval(&name, name_param);
+ zephir_get_strval(&value, value_param);
+ zephir_update_property_array(this_ptr, SL("headers"), &name, &value);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Manager, getUniqueKey)
+static PHP_METHOD(Phalcon_Http_Response_Headers, setRaw)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, prefix, _0, _1;
- zval key;
+ zval *header_param = NULL, __$null;
+ zval header;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&prefix);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&header);
+ ZVAL_NULL(&__$null);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
+ Z_PARAM_STR(header)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- zephir_memory_observe(&_0);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC);
- if (1 != ZEPHIR_IS_EMPTY(&_0)) {
- zephir_read_property(&_1, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&prefix);
- ZEPHIR_CONCAT_VS(&prefix, &_1, "#");
- } else {
- ZEPHIR_INIT_NVAR(&prefix);
- ZVAL_STRING(&prefix, "");
- }
- ZEPHIR_CONCAT_VV(return_value, &prefix, &key);
- RETURN_MM();
+ zephir_fetch_params(1, 1, 0, &header_param);
+ zephir_get_strval(&header, header_param);
+ zephir_update_property_array(this_ptr, SL("headers"), &header, &__$null);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Manager, getArrVal)
+static PHP_METHOD(Phalcon_Http_Response_Headers, toArray)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value;
- zval collection;
- ZVAL_UNDEF(&collection);
- ZVAL_UNDEF(&index_sub);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_ARRAY(collection)
- Z_PARAM_ZVAL(index)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue);
- ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- zephir_memory_observe(&value);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- RETURN_CCTOR(&value);
+ RETURN_MEMBER(getThis(), "headers");
}
-zend_object *zephir_init_properties_Phalcon_Session_Manager(zend_class_entry *class_type)
+zend_object *zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type)
{
zval _0, _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
@@ -163418,11 +160396,11 @@ zend_object *zephir_init_properties_Phalcon_Session_Manager(zend_class_entry *cl
{
zval local_this_ptr, *this_ptr = &local_this_ptr;
ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY);
if (Z_TYPE_P(&_0) == IS_NULL) {
ZEPHIR_INIT_VAR(&_1$$3);
array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("headers"), &_1$$3);
}
ZEPHIR_MM_RESTORE();
return Z_OBJ_P(this_ptr);
@@ -163439,40 +160417,19 @@ zend_object *zephir_init_properties_Phalcon_Session_Manager(zend_class_entry *cl
-ZEPHIR_INIT_CLASS(Phalcon_Session_ManagerInterface)
+ZEPHIR_INIT_CLASS(Phalcon_Http_Response_HeadersInterface)
{
- ZEPHIR_REGISTER_INTERFACE(Phalcon\\Session, ManagerInterface, phalcon, session_managerinterface, phalcon_session_managerinterface_method_entry);
-
- zephir_declare_class_constant_long(phalcon_session_managerinterface_ce, SL("SESSION_ACTIVE"), 2);
-
- zephir_declare_class_constant_long(phalcon_session_managerinterface_ce, SL("SESSION_DISABLED"), 0);
-
- zephir_declare_class_constant_long(phalcon_session_managerinterface_ce, SL("SESSION_NONE"), 1);
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Response, HeadersInterface, phalcon, http_response_headersinterface, phalcon_http_response_headersinterface_method_entry);
return SUCCESS;
}
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, __get);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, __isset);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, __set);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, __unset);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, exists);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, destroy);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, get);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, getId);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, getAdapter);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, getName);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, getOptions);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, has);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, remove);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, set);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, setAdapter);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, setId);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, setName);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, setOptions);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, status);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, start);
-ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, regenerateId);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, get);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, has);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, reset);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, send);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, set);
+ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, setRaw);
@@ -163483,996 +160440,1835 @@ ZEPHIR_DOC_METHOD(Phalcon_Session_ManagerInterface, regenerateId);
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_AbstractAdapter)
+ZEPHIR_INIT_CLASS(Phalcon_Autoload_Exception)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Session\\Adapter, AbstractAdapter, phalcon, session_adapter_abstractadapter, phalcon_session_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Autoload, Exception, phalcon, autoload_exception, zend_ce_exception, NULL, 0);
- zend_declare_property_null(phalcon_session_adapter_abstractadapter_ce, SL("adapter"), ZEND_ACC_PROTECTED);
- zend_class_implements(phalcon_session_adapter_abstractadapter_ce, 1, php_session_iface_entry);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, close)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Autoload_Loader)
{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Autoload, Loader, phalcon, autoload_loader, phalcon_events_abstracteventsaware_ce, phalcon_autoload_loader_method_entry, 0);
- RETURN_BOOL(1);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("checkedPath"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("classes"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("debug"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("directories"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("extensions"), ZEND_ACC_PROTECTED);
+ zend_declare_property_string(phalcon_autoload_loader_ce, SL("fileCheckingCallback"), "is_file", ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("files"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("foundPath"), ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_autoload_loader_ce, SL("isDebug"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_bool(phalcon_autoload_loader_ce, SL("isRegistered"), 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_autoload_loader_ce, SL("namespaces"), ZEND_ACC_PROTECTED);
+ phalcon_autoload_loader_ce->create_object = zephir_init_properties_Phalcon_Autoload_Loader;
+
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, destroy)
+static PHP_METHOD(Phalcon_Autoload_Loader, __construct)
{
- zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *sessionId, sessionId_sub, _1, _2, _3$$3;
+ zval *isDebug_param = NULL, __$true, __$false, _0, _1, _2;
+ zend_bool isDebug;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&sessionId_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(sessionId)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(isDebug)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &sessionId);
- _0 = !(ZEPHIR_IS_EMPTY(sessionId));
- if (_0) {
- zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_2, &_1, "has", NULL, 0, sessionId);
- zephir_check_call_status();
- _0 = zephir_is_true(&_2);
- }
- if (_0) {
- zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_3$$3, "delete", NULL, 0, sessionId);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 0, 1, &isDebug_param);
+ if (!isDebug_param) {
+ isDebug = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "sha256");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "php");
+ ZEPHIR_CALL_FUNCTION(&_2, "hash", NULL, 71, &_0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "php");
+ zephir_update_property_array(this_ptr, SL("extensions"), &_2, &_0);
+ if (isDebug) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isDebug"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isDebug"), &__$false);
}
- RETURN_MM_BOOL(1);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, gc)
+static PHP_METHOD(Phalcon_Autoload_Loader, addClass)
{
- zval *maxlifetime_param = NULL;
- zend_long maxlifetime;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *name_param = NULL, *file_param = NULL;
+ zval name, file;
+ zval *this_ptr = getThis();
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(maxlifetime)
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&file);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(name)
+ Z_PARAM_STR(file)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime_param);
- RETURN_BOOL(1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &name_param, &file_param);
+ zephir_get_strval(&name, name_param);
+ zephir_get_strval(&file, file_param);
+ zephir_update_property_array(this_ptr, SL("classes"), &name, &file);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, read)
+static PHP_METHOD(Phalcon_Autoload_Loader, addDirectory)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *sessionId, sessionId_sub, data, _0, _1;
+ zval *directory_param = NULL, _0, _1;
+ zval directory;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&sessionId_sub);
- ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&directory);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(sessionId)
+ Z_PARAM_STR(directory)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &sessionId);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, sessionId);
+ zephir_fetch_params(1, 1, 0, &directory_param);
+ zephir_get_strval(&directory, directory_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "sha256");
+ ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 71, &_0, &directory);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- if (Z_TYPE_P(&data) == IS_NULL) {
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "");
- } else {
- ZEPHIR_CPY_WRT(&_1, &data);
- }
- RETURN_CCTOR(&_1);
+ zephir_update_property_array(this_ptr, SL("directories"), &_1, &directory);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, open)
+static PHP_METHOD(Phalcon_Autoload_Loader, addExtension)
{
- zval *path, path_sub, *name, name_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *extension_param = NULL, _0, _1;
+ zval extension;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&path_sub);
- ZVAL_UNDEF(&name_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(path)
- Z_PARAM_ZVAL(name)
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(extension)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(2, 0, &path, &name);
- RETURN_BOOL(1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &extension_param);
+ zephir_get_strval(&extension, extension_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "sha256");
+ ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 71, &_0, &extension);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("extensions"), &_1, &extension);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, write)
+static PHP_METHOD(Phalcon_Autoload_Loader, addFile)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, *data, data_sub, _0;
+ zval *file_param = NULL, _0, _1;
+ zval file;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data_sub);
+ ZVAL_UNDEF(&file);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(id)
- Z_PARAM_ZVAL(data)
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(file)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &id, &data);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, id, data);
+ zephir_fetch_params(1, 1, 0, &file_param);
+ zephir_get_strval(&file, file_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "sha256");
+ ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 71, &_0, &file);
zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_array(this_ptr, SL("files"), &_1, &file);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, getArrVal)
+static PHP_METHOD(Phalcon_Autoload_Loader, addNamespace)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value;
- zval collection;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool prepend;
+ zval *name_param = NULL, *directories = NULL, directories_sub, *prepend_param = NULL, dirSeparator, nsName, nsSeparator, source, target, _0, _1, _2, _3, _5, _6, _7, _4$$3;
+ zval name;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&collection);
- ZVAL_UNDEF(&index_sub);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
- bool is_null_true = 1;
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&directories_sub);
+ ZVAL_UNDEF(&dirSeparator);
+ ZVAL_UNDEF(&nsName);
+ ZVAL_UNDEF(&nsSeparator);
+ ZVAL_UNDEF(&source);
+ ZVAL_UNDEF(&target);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_4$$3);
ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_ARRAY(collection)
- Z_PARAM_ZVAL(index)
+ Z_PARAM_STR(name)
+ Z_PARAM_ZVAL(directories)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
+ Z_PARAM_BOOL(prepend)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue);
- ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
+ zephir_fetch_params(1, 2, 1, &name_param, &directories, &prepend_param);
+ zephir_get_strval(&name, name_param);
+ ZEPHIR_SEPARATE_PARAM(directories);
+ if (!prepend_param) {
+ prepend = 0;
+ } else {
+ }
+ ZEPHIR_CPY_WRT(&nsName, &name);
+ ZEPHIR_INIT_VAR(&nsSeparator);
+ ZVAL_STRING(&nsSeparator, "\\");
+ ZEPHIR_INIT_VAR(&dirSeparator);
+ ZVAL_STRING(&dirSeparator, "/");
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_trim(&_0, &nsName, &nsSeparator, ZEPHIR_TRIM_BOTH);
+ ZEPHIR_INIT_VAR(&_1);
+ ZEPHIR_CONCAT_VV(&_1, &_0, &nsSeparator);
+ ZEPHIR_CPY_WRT(&nsName, &_1);
+ ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkdirectories", NULL, 179, directories, &dirSeparator);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(directories, &_2);
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("namespaces"), PH_NOISY_CC | PH_READONLY);
+ if (!(zephir_array_isset(&_3, &nsName))) {
+ ZEPHIR_INIT_VAR(&_4$$3);
+ array_init(&_4$$3);
+ zephir_update_property_array(this_ptr, SL("namespaces"), &nsName, &_4$$3);
}
- zephir_memory_observe(&value);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
+ if (prepend) {
+ ZEPHIR_CPY_WRT(&source, directories);
+ } else {
+ zephir_read_property(&_5, this_ptr, ZEND_STRL("namespaces"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_OBS_NVAR(&source);
+ zephir_array_fetch(&source, &_5, &nsName, PH_NOISY, "phalcon/Autoload/Loader.zep", 169);
}
- RETURN_CCTOR(&value);
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Libmemcached)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session\\Adapter, Libmemcached, phalcon, session_adapter_libmemcached, phalcon_session_adapter_abstractadapter_ce, phalcon_session_adapter_libmemcached_method_entry, 0);
-
- return SUCCESS;
+ if (prepend) {
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("namespaces"), PH_NOISY_CC | PH_READONLY);
+ zephir_memory_observe(&target);
+ zephir_array_fetch(&target, &_6, &nsName, PH_NOISY, "phalcon/Autoload/Loader.zep", 170);
+ } else {
+ ZEPHIR_CPY_WRT(&target, directories);
+ }
+ ZEPHIR_INIT_VAR(&_7);
+ zephir_fast_array_merge(&_7, &source, &target);
+ ZEPHIR_CALL_FUNCTION(&_2, "array_unique", NULL, 180, &_7);
+ zephir_check_call_status();
+ zephir_update_property_array(this_ptr, SL("namespaces"), &nsName, &_2);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, __construct)
+static PHP_METHOD(Phalcon_Autoload_Loader, autoload)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _1, _2, _3;
+ zval *className_param = NULL, _0, _2, _3, _5, _7, _8, _9;
+ zval className, _1, _4, _6, _10;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&className);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_adapterfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(className)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
+ zephir_fetch_params(1, 1, 0, &className_param);
+ zephir_get_strval(&className, className_param);
+ ZEPHIR_INIT_VAR(&_0);
+ array_init(&_0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("debug"), &_0);
ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "prefix");
+ ZEPHIR_CONCAT_SV(&_1, "Loading: ", &className);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 181, &_1);
+ zephir_check_call_status();
ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "sess-memc-");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2);
+ ZVAL_STRING(&_2, "loader:beforeCheckClass");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", NULL, 0, &_2, &className);
zephir_check_call_status();
- zephir_array_update_string(&options, SL("prefix"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "libmemcached");
- ZEPHIR_CALL_METHOD(&_3, factory, "newinstance", NULL, 0, &_1, &options);
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "autoloadcheckclasses", NULL, 182, &className);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &_3);
- ZEPHIR_MM_RESTORE();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_3)) {
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_SV(&_4, "Class: 404: ", &className);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 181, &_4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5, this_ptr, "autoloadchecknamespaces", NULL, 183, &className);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_5)) {
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_CONCAT_SV(&_6, "Namespace: 404: ", &className);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 181, &_6);
+ zephir_check_call_status();
+ zephir_read_property(&_8, this_ptr, ZEND_STRL("directories"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_BOOL(&_9, 1);
+ ZEPHIR_CALL_METHOD(&_7, this_ptr, "autoloadcheckdirectories", NULL, 184, &_8, &className, &_9);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_7)) {
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_INIT_VAR(&_10);
+ ZEPHIR_CONCAT_SV(&_10, "Directories: 404: ", &className);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 181, &_10);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_2);
+ ZVAL_STRING(&_2, "loader:afterCheckClass");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", NULL, 0, &_2, &className);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(0);
}
+static PHP_METHOD(Phalcon_Autoload_Loader, getCheckedPath)
+{
+ RETURN_MEMBER(getThis(), "checkedPath");
+}
+static PHP_METHOD(Phalcon_Autoload_Loader, getClasses)
+{
-#ifdef HAVE_CONFIG_H
-#endif
+ RETURN_MEMBER(getThis(), "classes");
+}
+static PHP_METHOD(Phalcon_Autoload_Loader, getDebug)
+{
+ RETURN_MEMBER(getThis(), "debug");
+}
+static PHP_METHOD(Phalcon_Autoload_Loader, getDirectories)
+{
+ RETURN_MEMBER(getThis(), "directories");
+}
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Noop)
+static PHP_METHOD(Phalcon_Autoload_Loader, getExtensions)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\Session\\Adapter, Noop, phalcon, session_adapter_noop, phalcon_session_adapter_noop_method_entry, 0);
- zend_declare_property_null(phalcon_session_adapter_noop_ce, SL("connection"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_session_adapter_noop_ce, SL("options"), ZEND_ACC_PROTECTED);
- zend_declare_property_string(phalcon_session_adapter_noop_ce, SL("prefix"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_long(phalcon_session_adapter_noop_ce, SL("ttl"), 8600, ZEND_ACC_PROTECTED);
- phalcon_session_adapter_noop_ce->create_object = zephir_init_properties_Phalcon_Session_Adapter_Noop;
+ RETURN_MEMBER(getThis(), "extensions");
+}
- zend_class_implements(phalcon_session_adapter_noop_ce, 1, php_session_iface_entry);
- return SUCCESS;
+static PHP_METHOD(Phalcon_Autoload_Loader, getFiles)
+{
+
+ RETURN_MEMBER(getThis(), "files");
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, __construct)
+static PHP_METHOD(Phalcon_Autoload_Loader, getFoundPath)
+{
+
+ RETURN_MEMBER(getThis(), "foundPath");
+}
+
+static PHP_METHOD(Phalcon_Autoload_Loader, getNamespaces)
+{
+
+ RETURN_MEMBER(getThis(), "namespaces");
+}
+
+static PHP_METHOD(Phalcon_Autoload_Loader, loadFiles)
{
+ zval file, files, _0, *_1, _2, _3$$3, _5$$3, _7$$4, _8$$5, _9$$5, _10$$6;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *options_param = NULL, prefix;
- zval options;
+ zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&prefix);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&files);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$6);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("files"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&files, &_0);
+ zephir_is_iterable(&files, 0, "phalcon/Autoload/Loader.zep", 322);
+ if (Z_TYPE_P(&files) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&files), _1)
+ {
+ ZEPHIR_INIT_NVAR(&file);
+ ZVAL_COPY(&file, _1);
+ ZEPHIR_INIT_NVAR(&_3$$3);
+ ZVAL_STRING(&_3$$3, "loader:beforeCheckPath");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_4, 0, &_3$$3, &file);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "requirefile", &_6, 0, &file);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_5$$3)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("foundPath"), &file);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "loader:pathFound");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_4, 0, &_7$$4, &file);
+ zephir_check_call_status();
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &files, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &files, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&file, &files, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_8$$5);
+ ZVAL_STRING(&_8$$5, "loader:beforeCheckPath");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_4, 0, &_8$$5, &file);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "requirefile", &_6, 0, &file);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_9$$5)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("foundPath"), &file);
+ ZEPHIR_INIT_NVAR(&_10$$6);
+ ZVAL_STRING(&_10$$6, "loader:pathFound");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_4, 0, &_10$$6, &file);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_METHOD(NULL, &files, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&file);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Autoload_Loader, register)
+{
+ zval _1$$3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *prepend_param = NULL, __$true, __$false, _0, _2$$3, _3$$3;
+ zend_bool prepend;
+ zval *this_ptr = getThis();
+
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_1$$3);
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_BOOL(prepend)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 0, 1, &prepend_param);
+ if (!prepend_param) {
+ prepend = 0;
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- zephir_memory_observe(&prefix);
- if (!(zephir_array_isset_string_fetch(&prefix, &options, SL("prefix"), 0))) {
- ZEPHIR_INIT_NVAR(&prefix);
- ZVAL_STRING(&prefix, "");
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("isRegistered"), PH_NOISY_CC | PH_READONLY);
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfiles", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1$$3);
+ zephir_create_array(&_1$$3, 2, 0);
+ zephir_array_fast_append(&_1$$3, this_ptr);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "autoload");
+ zephir_array_fast_append(&_1$$3, &_2$$3);
+ ZVAL_BOOL(&_3$$3, (prepend ? 1 : 0));
+ ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 185, &_1$$3, &__$true, &_3$$3);
+ zephir_check_call_status();
+ if (1) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$false);
+ }
}
- zephir_update_property_zval(this_ptr, ZEND_STRL("prefix"), &prefix);
- zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &options);
- ZEPHIR_MM_RESTORE();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, close)
+static PHP_METHOD(Phalcon_Autoload_Loader, setClasses)
{
+ zend_string *_4;
+ zend_ulong _3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_5 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool merge;
+ zval *classes_param = NULL, *merge_param = NULL, className, name, *_1, _2, _0$$3;
+ zval classes;
+ zval *this_ptr = getThis();
- RETURN_BOOL(1);
+ ZVAL_UNDEF(&classes);
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_0$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(classes)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(merge)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &classes_param, &merge_param);
+ zephir_get_arrval(&classes, classes_param);
+ if (!merge_param) {
+ merge = 0;
+ } else {
+ }
+ if (!merge) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ array_init(&_0$$3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("classes"), &_0$$3);
+ }
+ zephir_is_iterable(&classes, 0, "phalcon/Autoload/Loader.zep", 364);
+ if (Z_TYPE_P(&classes) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&classes), _3, _4, _1)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&name, _4);
+ } else {
+ ZVAL_LONG(&name, _3);
+ }
+ ZEPHIR_INIT_NVAR(&className);
+ ZVAL_COPY(&className, _1);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addclass", &_5, 0, &name, &className);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &classes, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &classes, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &classes, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&className, &classes, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addclass", &_5, 0, &name, &className);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &classes, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&className);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, destroy)
+static PHP_METHOD(Phalcon_Autoload_Loader, setDirectories)
{
- zval *sessionId, sessionId_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool merge;
+ zval *directories_param = NULL, *merge_param = NULL, _0, _1, _2;
+ zval directories;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&sessionId_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(sessionId)
+ ZVAL_UNDEF(&directories);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(directories)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(merge)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &sessionId);
- RETURN_BOOL(1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &directories_param, &merge_param);
+ zephir_get_arrval(&directories, directories_param);
+ if (!merge_param) {
+ merge = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "directories");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "addDirectory");
+ if (merge) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 186, &directories, &_0, &_1, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, gc)
+static PHP_METHOD(Phalcon_Autoload_Loader, setExtensions)
{
- zval *maxlifetime_param = NULL;
- zend_long maxlifetime;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_6 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool merge;
+ zval *extensions_param = NULL, *merge_param = NULL, extension, *_4, _5, _0$$3, _1$$3, _2$$3, _3$$3;
+ zval extensions;
+ zval *this_ptr = getThis();
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(maxlifetime)
+ ZVAL_UNDEF(&extensions);
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(extensions)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(merge)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime_param);
- RETURN_BOOL(1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &extensions_param, &merge_param);
+ zephir_get_arrval(&extensions, extensions_param);
+ if (!merge_param) {
+ merge = 0;
+ } else {
+ }
+ if (!merge) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ array_init(&_0$$3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("extensions"), &_0$$3);
+ ZEPHIR_INIT_VAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "sha256");
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "php");
+ ZEPHIR_CALL_FUNCTION(&_3$$3, "hash", NULL, 71, &_1$$3, &_2$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1$$3);
+ ZVAL_STRING(&_1$$3, "php");
+ zephir_update_property_array(this_ptr, SL("extensions"), &_3$$3, &_1$$3);
+ }
+ zephir_is_iterable(&extensions, 0, "phalcon/Autoload/Loader.zep", 407);
+ if (Z_TYPE_P(&extensions) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&extensions), _4)
+ {
+ ZEPHIR_INIT_NVAR(&extension);
+ ZVAL_COPY(&extension, _4);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addextension", &_6, 0, &extension);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &extensions, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_5, &extensions, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_5)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&extension, &extensions, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addextension", &_6, 0, &extension);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &extensions, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&extension);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, read)
+static PHP_METHOD(Phalcon_Autoload_Loader, setFileCheckingCallback)
{
- zval *sessionId, sessionId_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *method = NULL, method_sub, __$null, _0$$4;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&sessionId_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(sessionId)
+ ZVAL_UNDEF(&method_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&_0$$4);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(method)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &sessionId);
- RETURN_STRING("");
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 1, &method);
+ if (!method) {
+ method = &method_sub;
+ method = &__$null;
+ }
+ if (1 == zephir_is_callable(method)) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("fileCheckingCallback"), method);
+ } else if (Z_TYPE_P(method) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_0$$4);
+ ZEPHIR_INIT_NVAR(&_0$$4);
+ zephir_create_closure_ex(&_0$$4, NULL, phalcon_6__closure_ce, SL("__invoke"));
+ zephir_update_property_zval(this_ptr, ZEND_STRL("fileCheckingCallback"), &_0$$4);
+ } else {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_autoload_exception_ce, "The 'method' parameter must be either a callable or NULL", "phalcon/Autoload/Loader.zep", 441);
+ return;
+ }
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, open)
+static PHP_METHOD(Phalcon_Autoload_Loader, setFiles)
{
- zval *path, path_sub, *name, name_sub;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool merge;
+ zval *files_param = NULL, *merge_param = NULL, _0, _1, _2;
+ zval files;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&path_sub);
- ZVAL_UNDEF(&name_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(path)
- Z_PARAM_ZVAL(name)
+ ZVAL_UNDEF(&files);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(files)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(merge)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(2, 0, &path, &name);
- RETURN_BOOL(1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &files_param, &merge_param);
+ zephir_get_arrval(&files, files_param);
+ if (!merge_param) {
+ merge = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "files");
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "addFile");
+ if (merge) {
+ ZVAL_BOOL(&_2, 1);
+ } else {
+ ZVAL_BOOL(&_2, 0);
+ }
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 186, &files, &_0, &_1, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, write)
+static PHP_METHOD(Phalcon_Autoload_Loader, setNamespaces)
{
- zval *id, id_sub, *data, data_sub;
+ zend_string *_4;
+ zend_ulong _3;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_6 = NULL, *_7 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool merge;
+ zval *namespaces_param = NULL, *merge_param = NULL, dirSeparator, directories, name, *_1, _2, _0$$3, _5$$4, _8$$5;
+ zval namespaces;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(id)
- Z_PARAM_ZVAL(data)
+ ZVAL_UNDEF(&namespaces);
+ ZVAL_UNDEF(&dirSeparator);
+ ZVAL_UNDEF(&directories);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_8$$5);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ARRAY(namespaces)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(merge)
ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(2, 0, &id, &data);
- RETURN_BOOL(1);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 1, &namespaces_param, &merge_param);
+ zephir_get_arrval(&namespaces, namespaces_param);
+ if (!merge_param) {
+ merge = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&dirSeparator);
+ ZVAL_STRING(&dirSeparator, "/");
+ if (!merge) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ array_init(&_0$$3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("namespaces"), &_0$$3);
+ }
+ zephir_is_iterable(&namespaces, 0, "phalcon/Autoload/Loader.zep", 489);
+ if (Z_TYPE_P(&namespaces) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&namespaces), _3, _4, _1)
+ {
+ ZEPHIR_INIT_NVAR(&name);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&name, _4);
+ } else {
+ ZVAL_LONG(&name, _3);
+ }
+ ZEPHIR_INIT_NVAR(&directories);
+ ZVAL_COPY(&directories, _1);
+ ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "checkdirectories", &_6, 179, &directories, &dirSeparator);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&directories, &_5$$4);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addnamespace", &_7, 0, &name, &directories);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &namespaces, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &namespaces, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&name, &namespaces, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&directories, &namespaces, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "checkdirectories", &_6, 179, &directories, &dirSeparator);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&directories, &_8$$5);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "addnamespace", &_7, 0, &name, &directories);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &namespaces, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&directories);
+ ZEPHIR_INIT_NVAR(&name);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Noop, getPrefixedName)
+static PHP_METHOD(Phalcon_Autoload_Loader, unregister)
{
- zval _0;
+ zval _1$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *name = NULL, name_sub, _1;
+ zval __$true, __$false, _0, _2$$3;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name_sub);
- ZVAL_UNDEF(&_1);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_BOOL(&__$false, 0);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(name)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_1$$3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &name);
- ZEPHIR_SEPARATE_PARAM(name);
- zephir_cast_to_string(&_0, name);
- ZEPHIR_CPY_WRT(name, &_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CONCAT_VV(return_value, &_1, name);
- RETURN_MM();
-}
-
-zend_object *zephir_init_properties_Phalcon_Session_Adapter_Noop(zend_class_entry *class_type)
-{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("options"), &_1$$3);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("isRegistered"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ zephir_create_array(&_1$$3, 2, 0);
+ zephir_array_fast_append(&_1$$3, this_ptr);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "autoload");
+ zephir_array_fast_append(&_1$$3, &_2$$3);
+ ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_unregister", NULL, 187, &_1$$3);
+ zephir_check_call_status();
+ if (0) {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$true);
+ } else {
+ zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$false);
}
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
}
+ RETURN_THIS();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Redis)
+static PHP_METHOD(Phalcon_Autoload_Loader, isRegistered)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session\\Adapter, Redis, phalcon, session_adapter_redis, phalcon_session_adapter_abstractadapter_ce, phalcon_session_adapter_redis_method_entry, 0);
- return SUCCESS;
+ RETURN_MEMBER(getThis(), "isRegistered");
}
-static PHP_METHOD(Phalcon_Session_Adapter_Redis, __construct)
+static PHP_METHOD(Phalcon_Autoload_Loader, requireFile)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval options;
- zval *factory, factory_sub, *options_param = NULL, _0, _1, _2, _3;
+ zval *file_param = NULL, _0, _1, _2$$3;
+ zval file, _4, _3$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&factory_sub);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_3$$3);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&options);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_OBJECT_OF_CLASS(factory, phalcon_storage_adapterfactory_ce)
- Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ ZVAL_UNDEF(&_2$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(file)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &factory, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
- } else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "prefix");
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "sess-reds-");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "getarrval", NULL, 0, &options, &_1, &_2);
+ zephir_fetch_params(1, 1, 0, &file_param);
+ zephir_get_strval(&file, file_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("fileCheckingCallback"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_1, "call_user_func", NULL, 188, &_0, &file);
zephir_check_call_status();
- zephir_array_update_string(&options, SL("prefix"), &_0, PH_COPY | PH_SEPARATE);
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "redis");
- ZEPHIR_CALL_METHOD(&_3, factory, "newinstance", NULL, 0, &_1, &options);
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&_1)) {
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "loader:pathFound");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", NULL, 0, &_2$$3, &file);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZEPHIR_CONCAT_SV(&_3$$3, "Require: ", &file);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 181, &_3$$3);
+ zephir_check_call_status();
+ if (zephir_require_once_zval(&file) == FAILURE) {
+ RETURN_MM_NULL();
+ }
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_INIT_VAR(&_4);
+ ZEPHIR_CONCAT_SV(&_4, "Require: 404: ", &file);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 181, &_4);
zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &_3);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM_BOOL(0);
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Stream)
+static PHP_METHOD(Phalcon_Autoload_Loader, addDebug)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session\\Adapter, Stream, phalcon, session_adapter_stream, phalcon_session_adapter_noop_ce, phalcon_session_adapter_stream_method_entry, 0);
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *message_param = NULL, _0;
+ zval message;
+ zval *this_ptr = getThis();
- zend_declare_property_string(phalcon_session_adapter_stream_ce, SL("path"), "", ZEND_ACC_PRIVATE);
- return SUCCESS;
+ ZVAL_UNDEF(&message);
+ ZVAL_UNDEF(&_0);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(message)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 1, 0, &message_param);
+ zephir_get_strval(&message, message_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("isDebug"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) {
+ zephir_update_property_array_append(this_ptr, SL("debug"), &message);
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, __construct)
+static PHP_METHOD(Phalcon_Autoload_Loader, addToCollection)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *options_param = NULL, path, _0, _1, _2, _5, _3$$4, _4$$4;
- zval options;
+ zend_bool merge;
+ zval collectionName, method;
+ zval *collection_param = NULL, *collectionName_param = NULL, *method_param = NULL, *merge_param = NULL, element, *_1, _2, _0$$3;
+ zval collection;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&options);
- ZVAL_UNDEF(&path);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&element);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_3$$4);
- ZVAL_UNDEF(&_4$$4);
- ZEND_PARSE_PARAMETERS_START(0, 1)
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&collectionName);
+ ZVAL_UNDEF(&method);
+ ZEND_PARSE_PARAMETERS_START(3, 4)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_STR(collectionName)
+ Z_PARAM_STR(method)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY(options)
+ Z_PARAM_BOOL(merge)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &options_param);
- if (!options_param) {
- ZEPHIR_INIT_VAR(&options);
- array_init(&options);
+ zephir_fetch_params(1, 3, 1, &collection_param, &collectionName_param, &method_param, &merge_param);
+ zephir_get_arrval(&collection, collection_param);
+ zephir_get_strval(&collectionName, collectionName_param);
+ zephir_get_strval(&method, method_param);
+ if (!merge_param) {
+ merge = 0;
} else {
- ZEPHIR_OBS_COPY_OR_DUP(&options, options_param);
- }
- ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_stream_ce, getThis(), "__construct", NULL, 0, &options);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "session.save_path");
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpiniget", NULL, 0, &_1);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_1);
- ZVAL_STRING(&_1, "savePath");
- ZEPHIR_CALL_METHOD(&path, this_ptr, "getarrval", NULL, 0, &options, &_1, &_0);
- zephir_check_call_status();
- if (UNEXPECTED(1 == ZEPHIR_IS_EMPTY(&path))) {
- ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session save path cannot be empty", "phalcon/Session/Adapter/Stream.zep", 67);
- return;
+ }
+ if (!merge) {
+ ZEPHIR_INIT_VAR(&_0$$3);
+ array_init(&_0$$3);
+ zephir_update_property_zval_zval(this_ptr, &collectionName, &_0$$3);
}
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpiswritable", NULL, 0, &path);
- zephir_check_call_status();
- if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_2))) {
- ZEPHIR_INIT_VAR(&_3$$4);
- object_init_ex(&_3$$4, phalcon_session_exception_ce);
- ZEPHIR_INIT_VAR(&_4$$4);
- ZEPHIR_CONCAT_SVS(&_4$$4, "The session save path [", &path, "] is not writable");
- ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 33, &_4$$4);
+ zephir_is_iterable(&collection, 0, "phalcon/Autoload/Loader.zep", 594);
+ if (Z_TYPE_P(&collection) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _1)
+ {
+ ZEPHIR_INIT_NVAR(&element);
+ ZVAL_COPY(&element, _1);
+ ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &method, NULL, 0, &element);
+ zephir_check_call_status();
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &collection, "rewind", NULL, 0);
zephir_check_call_status();
- zephir_throw_exception_debug(&_3$$4, "phalcon/Session/Adapter/Stream.zep", 71);
- ZEPHIR_MM_RESTORE();
- return;
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &collection, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&element, &collection, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &method, NULL, 0, &element);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "getdirseparator", NULL, 0, &path);
- zephir_check_call_status();
- zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &_5);
- ZEPHIR_MM_RESTORE();
+ ZEPHIR_INIT_NVAR(&element);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, destroy)
+static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckClasses)
{
- zend_bool _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *sessionId, sessionId_sub, file, _0, _1, _3;
+ zval *className_param = NULL, filePath, _0, _1$$3, _2$$3, _3$$3;
+ zval className;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&sessionId_sub);
- ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&filePath);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(sessionId)
+ Z_PARAM_STR(className)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &sessionId);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&file);
- ZEPHIR_CONCAT_VV(&file, &_0, &_1);
- _2 = (zephir_file_exists(&file) == SUCCESS);
- if (_2) {
- ZEPHIR_CALL_FUNCTION(&_3, "is_file", NULL, 0, &file);
+ zephir_fetch_params(1, 1, 0, &className_param);
+ zephir_get_strval(&className, className_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("classes"), PH_NOISY_CC | PH_READONLY);
+ if (1 == zephir_array_isset(&_0, &className)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("classes"), PH_NOISY_CC | PH_READONLY);
+ zephir_memory_observe(&filePath);
+ zephir_array_fetch(&filePath, &_1$$3, &className, PH_NOISY, "phalcon/Autoload/Loader.zep", 610);
+ ZEPHIR_INIT_VAR(&_2$$3);
+ ZVAL_STRING(&_2$$3, "loader:pathFound");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", NULL, 0, &_2$$3, &filePath);
zephir_check_call_status();
- _2 = zephir_is_true(&_3);
- }
- if (_2) {
- ZEPHIR_CALL_FUNCTION(NULL, "unlink", NULL, 123, &file);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "requirefile", NULL, 0, &filePath);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZEPHIR_CONCAT_SV(&_3$$3, "Class: load: ", &filePath);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 181, &_3$$3);
zephir_check_call_status();
+ RETURN_MM_BOOL(1);
}
- RETURN_MM_BOOL(1);
+ RETURN_MM_BOOL(0);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc)
+static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories)
{
- zend_bool _6$$3, _9$$3, _12$$5, _14$$5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL;
- zval *maxlifetime_param = NULL, file, pattern, time, _0, _1, _2, _3, *_4, _5, _7$$3, _10$$3, _13$$5, _15$$5;
- zend_long maxlifetime, ZEPHIR_LAST_CALL_STATUS;
+ zephir_fcall_cache_entry *_8 = NULL, *_10 = NULL, *_12 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_bool isDirectory;
+ zval *directories_param = NULL, className, *className_param = NULL, *isDirectory_param = NULL, dirSeparator, directory, extension, extensions, filePath, fixedDirectory, nsSeparator, _0, _1, *_2, _3, _4$$3, *_5$$3, _6$$3, _7$$4, _9$$4, _11$$6, _13$$7, _14$$7, _15$$9, _16$$10, *_17$$10, _18$$10, _19$$11, _20$$11, _21$$13, _22$$14, _23$$14, _24$$16;
+ zval directories;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&file);
- ZVAL_UNDEF(&pattern);
- ZVAL_UNDEF(&time);
+ ZVAL_UNDEF(&directories);
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&dirSeparator);
+ ZVAL_UNDEF(&directory);
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&extensions);
+ ZVAL_UNDEF(&filePath);
+ ZVAL_UNDEF(&fixedDirectory);
+ ZVAL_UNDEF(&nsSeparator);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_10$$3);
- ZVAL_UNDEF(&_13$$5);
- ZVAL_UNDEF(&_15$$5);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(maxlifetime)
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_15$$9);
+ ZVAL_UNDEF(&_16$$10);
+ ZVAL_UNDEF(&_18$$10);
+ ZVAL_UNDEF(&_19$$11);
+ ZVAL_UNDEF(&_20$$11);
+ ZVAL_UNDEF(&_21$$13);
+ ZVAL_UNDEF(&_22$$14);
+ ZVAL_UNDEF(&_23$$14);
+ ZVAL_UNDEF(&_24$$16);
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(directories)
+ Z_PARAM_STR(className)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(isDirectory)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &maxlifetime_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&pattern);
- ZEPHIR_CONCAT_VVS(&pattern, &_0, &_1, "*");
- ZEPHIR_INIT_VAR(&_2);
- zephir_time(&_2);
- ZEPHIR_INIT_VAR(&time);
- ZVAL_LONG(&time, (zephir_get_numberval(&_2) - maxlifetime));
- ZEPHIR_CALL_FUNCTION(&_3, "glob", NULL, 0, &pattern);
- zephir_check_call_status();
- zephir_is_iterable(&_3, 0, "phalcon/Session/Adapter/Stream.zep", 111);
- if (Z_TYPE_P(&_3) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4)
+ zephir_fetch_params(1, 2, 1, &directories_param, &className_param, &isDirectory_param);
+ zephir_get_arrval(&directories, directories_param);
+ zephir_get_strval(&className, className_param);
+ if (!isDirectory_param) {
+ isDirectory = 0;
+ } else {
+ }
+ ZEPHIR_INIT_VAR(&dirSeparator);
+ ZVAL_STRING(&dirSeparator, "/");
+ ZEPHIR_INIT_VAR(&nsSeparator);
+ ZVAL_STRING(&nsSeparator, "\\");
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_fast_str_replace(&_0, &nsSeparator, &dirSeparator, &className);
+ ZEPHIR_CPY_WRT(&className, &_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&extensions, &_1);
+ zephir_is_iterable(&directories, 0, "phalcon/Autoload/Loader.zep", 669);
+ if (Z_TYPE_P(&directories) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&directories), _2)
{
- ZEPHIR_INIT_NVAR(&file);
- ZVAL_COPY(&file, _4);
- _6$$3 = 1 == (zephir_file_exists(&file) == SUCCESS);
- if (_6$$3) {
- ZEPHIR_CALL_FUNCTION(&_7$$3, "is_file", &_8, 0, &file);
- zephir_check_call_status();
- _6$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_7$$3);
- }
- _9$$3 = _6$$3;
- if (_9$$3) {
- ZEPHIR_INIT_NVAR(&_10$$3);
- zephir_filemtime(&_10$$3, &file);
- _9$$3 = ZEPHIR_LT(&_10$$3, &time);
- }
- if (_9$$3) {
- ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 123, &file);
+ ZEPHIR_INIT_NVAR(&directory);
+ ZVAL_COPY(&directory, _2);
+ ZEPHIR_INIT_NVAR(&_4$$3);
+ zephir_fast_trim(&_4$$3, &directory, &dirSeparator, ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&fixedDirectory);
+ ZEPHIR_CONCAT_VV(&fixedDirectory, &_4$$3, &dirSeparator);
+ zephir_is_iterable(&extensions, 0, "phalcon/Autoload/Loader.zep", 667);
+ if (Z_TYPE_P(&extensions) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&extensions), _5$$3)
+ {
+ ZEPHIR_INIT_NVAR(&extension);
+ ZVAL_COPY(&extension, _5$$3);
+ ZEPHIR_INIT_NVAR(&filePath);
+ ZEPHIR_CONCAT_VVSV(&filePath, &fixedDirectory, &className, ".", &extension);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("checkedPath"), &filePath);
+ ZEPHIR_INIT_NVAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "loader:beforeCheckPath");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_8, 0, &_7$$4, &filePath);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "requirefile", &_10, 0, &filePath);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_9$$4)) {
+ if (isDirectory) {
+ ZEPHIR_INIT_NVAR(&_11$$6);
+ ZEPHIR_CONCAT_SV(&_11$$6, "Directories: ", &filePath);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 181, &_11$$6);
+ zephir_check_call_status();
+ }
+ RETURN_MM_BOOL(1);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &extensions, "rewind", NULL, 0);
zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_6$$3, &extensions, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_6$$3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&extension, &extensions, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&filePath);
+ ZEPHIR_CONCAT_VVSV(&filePath, &fixedDirectory, &className, ".", &extension);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("checkedPath"), &filePath);
+ ZEPHIR_INIT_NVAR(&_13$$7);
+ ZVAL_STRING(&_13$$7, "loader:beforeCheckPath");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_8, 0, &_13$$7, &filePath);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_14$$7, this_ptr, "requirefile", &_10, 0, &filePath);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_14$$7)) {
+ if (isDirectory) {
+ ZEPHIR_INIT_NVAR(&_15$$9);
+ ZEPHIR_CONCAT_SV(&_15$$9, "Directories: ", &filePath);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 181, &_15$$9);
+ zephir_check_call_status();
+ }
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &extensions, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
+ ZEPHIR_INIT_NVAR(&extension);
} ZEND_HASH_FOREACH_END();
} else {
- ZEPHIR_CALL_METHOD(NULL, &_3, "rewind", NULL, 0);
+ ZEPHIR_CALL_METHOD(NULL, &directories, "rewind", NULL, 0);
zephir_check_call_status();
while (1) {
- ZEPHIR_CALL_METHOD(&_5, &_3, "valid", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_3, &directories, "valid", NULL, 0);
zephir_check_call_status();
- if (!zend_is_true(&_5)) {
+ if (!zend_is_true(&_3)) {
break;
}
- ZEPHIR_CALL_METHOD(&file, &_3, "current", NULL, 0);
+ ZEPHIR_CALL_METHOD(&directory, &directories, "current", NULL, 0);
zephir_check_call_status();
- _12$$5 = 1 == (zephir_file_exists(&file) == SUCCESS);
- if (_12$$5) {
- ZEPHIR_CALL_FUNCTION(&_13$$5, "is_file", &_8, 0, &file);
- zephir_check_call_status();
- _12$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_13$$5);
- }
- _14$$5 = _12$$5;
- if (_14$$5) {
- ZEPHIR_INIT_NVAR(&_15$$5);
- zephir_filemtime(&_15$$5, &file);
- _14$$5 = ZEPHIR_LT(&_15$$5, &time);
- }
- if (_14$$5) {
- ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 123, &file);
+ ZEPHIR_INIT_NVAR(&_16$$10);
+ zephir_fast_trim(&_16$$10, &directory, &dirSeparator, ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&fixedDirectory);
+ ZEPHIR_CONCAT_VV(&fixedDirectory, &_16$$10, &dirSeparator);
+ zephir_is_iterable(&extensions, 0, "phalcon/Autoload/Loader.zep", 667);
+ if (Z_TYPE_P(&extensions) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&extensions), _17$$10)
+ {
+ ZEPHIR_INIT_NVAR(&extension);
+ ZVAL_COPY(&extension, _17$$10);
+ ZEPHIR_INIT_NVAR(&filePath);
+ ZEPHIR_CONCAT_VVSV(&filePath, &fixedDirectory, &className, ".", &extension);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("checkedPath"), &filePath);
+ ZEPHIR_INIT_NVAR(&_19$$11);
+ ZVAL_STRING(&_19$$11, "loader:beforeCheckPath");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_8, 0, &_19$$11, &filePath);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_20$$11, this_ptr, "requirefile", &_10, 0, &filePath);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_20$$11)) {
+ if (isDirectory) {
+ ZEPHIR_INIT_NVAR(&_21$$13);
+ ZEPHIR_CONCAT_SV(&_21$$13, "Directories: ", &filePath);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 181, &_21$$13);
+ zephir_check_call_status();
+ }
+ RETURN_MM_BOOL(1);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &extensions, "rewind", NULL, 0);
zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_18$$10, &extensions, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_18$$10)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&extension, &extensions, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&filePath);
+ ZEPHIR_CONCAT_VVSV(&filePath, &fixedDirectory, &className, ".", &extension);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("checkedPath"), &filePath);
+ ZEPHIR_INIT_NVAR(&_22$$14);
+ ZVAL_STRING(&_22$$14, "loader:beforeCheckPath");
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", &_8, 0, &_22$$14, &filePath);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_23$$14, this_ptr, "requirefile", &_10, 0, &filePath);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_23$$14)) {
+ if (isDirectory) {
+ ZEPHIR_INIT_NVAR(&_24$$16);
+ ZEPHIR_CONCAT_SV(&_24$$16, "Directories: ", &filePath);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 181, &_24$$16);
+ zephir_check_call_status();
+ }
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &extensions, "next", NULL, 0);
+ zephir_check_call_status();
+ }
}
- ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0);
+ ZEPHIR_INIT_NVAR(&extension);
+ ZEPHIR_CALL_METHOD(NULL, &directories, "next", NULL, 0);
zephir_check_call_status();
}
}
- ZEPHIR_INIT_NVAR(&file);
- RETURN_MM_BOOL(1);
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, open)
-{
- zval *path, path_sub, *name, name_sub;
-
- ZVAL_UNDEF(&path_sub);
- ZVAL_UNDEF(&name_sub);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(path)
- Z_PARAM_ZVAL(name)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(2, 0, &path, &name);
- RETURN_BOOL(1);
+ ZEPHIR_INIT_NVAR(&directory);
+ RETURN_MM_BOOL(0);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, read)
+static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckNamespaces)
{
+ zend_string *_4;
+ zend_ulong _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_9 = NULL, *_12 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *sessionId, sessionId_sub, data, name, pointer, _0, _1, _2, _3$$3, _4$$3, _5$$3;
+ zval *className_param = NULL, directories, fileName, namespaces, nsSeparator, prefix, _0, *_1, _2, _5$$3, _6$$3, _7$$3, _8$$3, _10$$5, _11$$5, _13$$6, _14$$6, _15$$6, _16$$6, _17$$8, _18$$8;
+ zval className;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&sessionId_sub);
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&pointer);
+ ZVAL_UNDEF(&className);
+ ZVAL_UNDEF(&directories);
+ ZVAL_UNDEF(&fileName);
+ ZVAL_UNDEF(&namespaces);
+ ZVAL_UNDEF(&nsSeparator);
+ ZVAL_UNDEF(&prefix);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$6);
+ ZVAL_UNDEF(&_15$$6);
+ ZVAL_UNDEF(&_16$$6);
+ ZVAL_UNDEF(&_17$$8);
+ ZVAL_UNDEF(&_18$$8);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(sessionId)
+ Z_PARAM_STR(className)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &sessionId);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&name);
- ZEPHIR_CONCAT_VV(&name, &_0, &_1);
- ZEPHIR_INIT_VAR(&data);
- ZVAL_STRING(&data, "");
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileexists", NULL, 0, &name);
- zephir_check_call_status();
- if (ZEPHIR_IS_TRUE_IDENTICAL(&_2)) {
- ZEPHIR_INIT_VAR(&_3$$3);
- ZVAL_STRING(&_3$$3, "r");
- ZEPHIR_CALL_METHOD(&pointer, this_ptr, "phpfopen", NULL, 0, &name, &_3$$3);
- zephir_check_call_status();
- ZVAL_LONG(&_4$$3, 1);
- ZEPHIR_CALL_FUNCTION(&_5$$3, "flock", NULL, 132, &pointer, &_4$$3);
+ zephir_fetch_params(1, 1, 0, &className_param);
+ zephir_get_strval(&className, className_param);
+ ZEPHIR_INIT_VAR(&nsSeparator);
+ ZVAL_STRING(&nsSeparator, "\\");
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("namespaces"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&namespaces, &_0);
+ zephir_is_iterable(&namespaces, 0, "phalcon/Autoload/Loader.zep", 704);
+ if (Z_TYPE_P(&namespaces) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&namespaces), _3, _4, _1)
+ {
+ ZEPHIR_INIT_NVAR(&prefix);
+ if (_4 != NULL) {
+ ZVAL_STR_COPY(&prefix, _4);
+ } else {
+ ZVAL_LONG(&prefix, _3);
+ }
+ ZEPHIR_INIT_NVAR(&directories);
+ ZVAL_COPY(&directories, _1);
+ if (1 != zephir_start_with(&className, &prefix, NULL)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_5$$3);
+ zephir_fast_trim(&_5$$3, &prefix, &nsSeparator, ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&_6$$3);
+ ZEPHIR_CONCAT_VV(&_6$$3, &_5$$3, &nsSeparator);
+ ZEPHIR_CPY_WRT(&prefix, &_6$$3);
+ ZVAL_LONG(&_7$$3, zephir_fast_strlen_ev(&prefix));
+ ZEPHIR_INIT_NVAR(&fileName);
+ zephir_substr(&fileName, &className, zephir_get_intval(&_7$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ ZEPHIR_CALL_METHOD(&_8$$3, this_ptr, "autoloadcheckdirectories", &_9, 184, &directories, &fileName);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_8$$3)) {
+ zephir_read_property(&_10$$5, this_ptr, ZEND_STRL("checkedPath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_11$$5);
+ ZEPHIR_CONCAT_SVSV(&_11$$5, "Namespace: ", &prefix, " - ", &_10$$5);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 181, &_11$$5);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
+ }
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, &namespaces, "rewind", NULL, 0);
zephir_check_call_status();
- if (zephir_is_true(&_5$$3)) {
- ZEPHIR_CALL_METHOD(&data, this_ptr, "phpfilegetcontents", NULL, 0, &name);
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_2, &namespaces, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_2)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&prefix, &namespaces, "key", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&directories, &namespaces, "current", NULL, 0);
+ zephir_check_call_status();
+ if (1 != zephir_start_with(&className, &prefix, NULL)) {
+ continue;
+ }
+ ZEPHIR_INIT_NVAR(&_13$$6);
+ zephir_fast_trim(&_13$$6, &prefix, &nsSeparator, ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&_14$$6);
+ ZEPHIR_CONCAT_VV(&_14$$6, &_13$$6, &nsSeparator);
+ ZEPHIR_CPY_WRT(&prefix, &_14$$6);
+ ZVAL_LONG(&_15$$6, zephir_fast_strlen_ev(&prefix));
+ ZEPHIR_INIT_NVAR(&fileName);
+ zephir_substr(&fileName, &className, zephir_get_intval(&_15$$6), 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ ZEPHIR_CALL_METHOD(&_16$$6, this_ptr, "autoloadcheckdirectories", &_9, 184, &directories, &fileName);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&_16$$6)) {
+ zephir_read_property(&_17$$8, this_ptr, ZEND_STRL("checkedPath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_18$$8);
+ ZEPHIR_CONCAT_SVSV(&_18$$8, "Namespace: ", &prefix, " - ", &_17$$8);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 181, &_18$$8);
+ zephir_check_call_status();
+ RETURN_MM_BOOL(1);
+ }
+ ZEPHIR_CALL_METHOD(NULL, &namespaces, "next", NULL, 0);
zephir_check_call_status();
- }
- zephir_fclose(&pointer);
- if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) {
- RETURN_MM_STRING("");
}
}
- RETURN_CCTOR(&data);
+ ZEPHIR_INIT_NVAR(&directories);
+ ZEPHIR_INIT_NVAR(&prefix);
+ RETURN_MM_BOOL(0);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, write)
+static PHP_METHOD(Phalcon_Autoload_Loader, checkDirectories)
{
+ zend_bool _0;
+ zval results;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_8 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *id, id_sub, *data, data_sub, name, _0, _1, _2, _3;
- zval *this_ptr = getThis();
+ zval dirSeparator;
+ zval *directories = NULL, directories_sub, *dirSeparator_param = NULL, directory, *_2, _3, _1$$4, _4$$5, _5$$5, _6$$5, _7$$5, _9$$6, _10$$6, _11$$6, _12$$6;
- ZVAL_UNDEF(&id_sub);
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&directories_sub);
+ ZVAL_UNDEF(&directory);
ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&dirSeparator);
+ ZVAL_UNDEF(&results);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ZVAL(id)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_ZVAL(directories)
+ Z_PARAM_STR(dirSeparator)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &id, &data);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, id);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&name);
- ZEPHIR_CONCAT_VV(&name, &_0, &_1);
- ZVAL_LONG(&_3, 2);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileputcontents", NULL, 0, &name, data, &_3);
- zephir_check_call_status();
- RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_2));
+ zephir_fetch_params(1, 2, 0, &directories, &dirSeparator_param);
+ ZEPHIR_SEPARATE_PARAM(directories);
+ zephir_get_strval(&dirSeparator, dirSeparator_param);
+ _0 = !(Z_TYPE_P(directories) == IS_STRING);
+ if (_0) {
+ _0 = !(Z_TYPE_P(directories) == IS_ARRAY);
+ }
+ if (_0) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_autoload_exception_ce, "The directories parameter is not a string or array", "phalcon/Autoload/Loader.zep", 727);
+ return;
+ }
+ if (Z_TYPE_P(directories) == IS_STRING) {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ zephir_create_array(&_1$$4, 1, 0);
+ zephir_array_fast_append(&_1$$4, directories);
+ ZEPHIR_CPY_WRT(directories, &_1$$4);
+ }
+ ZEPHIR_INIT_VAR(&results);
+ array_init(&results);
+ zephir_is_iterable(directories, 0, "phalcon/Autoload/Loader.zep", 741);
+ if (Z_TYPE_P(directories) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(directories), _2)
+ {
+ ZEPHIR_INIT_NVAR(&directory);
+ ZVAL_COPY(&directory, _2);
+ ZEPHIR_INIT_NVAR(&_4$$5);
+ zephir_fast_trim(&_4$$5, &directory, &dirSeparator, ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&_5$$5);
+ ZEPHIR_CONCAT_VV(&_5$$5, &_4$$5, &dirSeparator);
+ ZEPHIR_CPY_WRT(&directory, &_5$$5);
+ ZEPHIR_INIT_NVAR(&_6$$5);
+ ZVAL_STRING(&_6$$5, "sha256");
+ ZEPHIR_CALL_FUNCTION(&_7$$5, "hash", &_8, 71, &_6$$5, &directory);
+ zephir_check_call_status();
+ zephir_array_update_zval(&results, &_7$$5, &directory, PH_COPY | PH_SEPARATE);
+ } ZEND_HASH_FOREACH_END();
+ } else {
+ ZEPHIR_CALL_METHOD(NULL, directories, "rewind", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ ZEPHIR_CALL_METHOD(&_3, directories, "valid", NULL, 0);
+ zephir_check_call_status();
+ if (!zend_is_true(&_3)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(&directory, directories, "current", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_9$$6);
+ zephir_fast_trim(&_9$$6, &directory, &dirSeparator, ZEPHIR_TRIM_RIGHT);
+ ZEPHIR_INIT_NVAR(&_10$$6);
+ ZEPHIR_CONCAT_VV(&_10$$6, &_9$$6, &dirSeparator);
+ ZEPHIR_CPY_WRT(&directory, &_10$$6);
+ ZEPHIR_INIT_NVAR(&_11$$6);
+ ZVAL_STRING(&_11$$6, "sha256");
+ ZEPHIR_CALL_FUNCTION(&_12$$6, "hash", &_8, 71, &_11$$6, &directory);
+ zephir_check_call_status();
+ zephir_array_update_zval(&results, &_12$$6, &directory, PH_COPY | PH_SEPARATE);
+ ZEPHIR_CALL_METHOD(NULL, directories, "next", NULL, 0);
+ zephir_check_call_status();
+ }
+ }
+ ZEPHIR_INIT_NVAR(&directory);
+ RETURN_CTOR(&results);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, getArrVal)
+zend_object *zephir_init_properties_Phalcon_Autoload_Loader(zend_class_entry *class_type)
{
+ zval _0, _2, _4, _6, _8, _10, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval cast;
- zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, *cast_param = NULL, __$null, value;
- zval collection;
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_9$$7);
+ ZVAL_UNDEF(&_11$$8);
+
- ZVAL_UNDEF(&collection);
- ZVAL_UNDEF(&index_sub);
- ZVAL_UNDEF(&defaultValue_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&cast);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 4)
- Z_PARAM_ARRAY(collection)
- Z_PARAM_ZVAL(index)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(defaultValue)
- Z_PARAM_STR_OR_NULL(cast)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 2, &collection_param, &index, &defaultValue, &cast_param);
- ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
- if (!defaultValue) {
- defaultValue = &defaultValue_sub;
- defaultValue = &__$null;
- }
- if (!cast_param) {
- ZEPHIR_INIT_VAR(&cast);
- } else {
- if (UNEXPECTED(Z_TYPE_P(cast_param) != IS_STRING && Z_TYPE_P(cast_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cast' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(cast_param) == IS_STRING)) {
- zephir_get_strval(&cast, cast_param);
- } else {
- ZEPHIR_INIT_VAR(&cast);
- }
- }
- zephir_memory_observe(&value);
- if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
- RETVAL_ZVAL(defaultValue, 1, 0);
- RETURN_MM();
- }
- if (UNEXPECTED(zephir_is_true(&cast))) {
- ZEPHIR_MAKE_REF(&value);
- ZEPHIR_CALL_FUNCTION(NULL, "settype", NULL, 11, &value, &cast);
- ZEPHIR_UNREF(&value);
- zephir_check_call_status();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ {
+ zval local_this_ptr, *this_ptr = &local_this_ptr;
+ ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
+ zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("namespaces"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_0) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_1$$3);
+ array_init(&_1$$3);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("namespaces"), &_1$$3);
+ }
+ zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("files"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_2) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ array_init(&_3$$4);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("files"), &_3$$4);
+ }
+ zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("extensions"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_4) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_5$$5);
+ array_init(&_5$$5);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("extensions"), &_5$$5);
+ }
+ zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("directories"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_6) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_7$$6);
+ array_init(&_7$$6);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("directories"), &_7$$6);
+ }
+ zephir_read_property_ex(&_8, this_ptr, ZEND_STRL("debug"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_8) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_9$$7);
+ array_init(&_9$$7);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("debug"), &_9$$7);
+ }
+ zephir_read_property_ex(&_10, this_ptr, ZEND_STRL("classes"), PH_NOISY_CC | PH_READONLY);
+ if (Z_TYPE_P(&_10) == IS_NULL) {
+ ZEPHIR_INIT_VAR(&_11$$8);
+ array_init(&_11$$8);
+ zephir_update_property_zval_ex(this_ptr, ZEND_STRL("classes"), &_11$$8);
+ }
+ ZEPHIR_MM_RESTORE();
+ return Z_OBJ_P(this_ptr);
}
- RETURN_CCTOR(&value);
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, getDirSeparator)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Image_Enum)
+{
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Image, Enum, phalcon, image_enum, NULL, 0);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("AUTO"), 4);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("HEIGHT"), 3);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("INVERSE"), 5);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("NONE"), 1);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("PRECISE"), 6);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("TENSILE"), 7);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("WIDTH"), 2);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("HORIZONTAL"), 11);
+
+ zephir_declare_class_constant_long(phalcon_image_enum_ce, SL("VERTICAL"), 12);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Image_Exception)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Image, Exception, phalcon, image_exception, zend_ce_exception, NULL, 0);
+
+ return SUCCESS;
+}
+
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Image_ImageFactory)
+{
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Image, ImageFactory, phalcon, image_imagefactory, phalcon_factory_abstractfactory_ce, phalcon_image_imagefactory_method_entry, 0);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(Phalcon_Image_ImageFactory, __construct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *directory_param = NULL, _0, _1;
- zval directory;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *services_param = NULL;
+ zval services;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&directory);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(directory)
+ ZVAL_UNDEF(&services);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(services)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &directory_param);
- if (UNEXPECTED(Z_TYPE_P(directory_param) != IS_STRING && Z_TYPE_P(directory_param) != IS_NULL)) {
- zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'directory' must be of the type string"));
- RETURN_MM_NULL();
- }
- if (EXPECTED(Z_TYPE_P(directory_param) == IS_STRING)) {
- zephir_get_strval(&directory, directory_param);
+ zephir_fetch_params(1, 0, 1, &services_param);
+ if (!services_param) {
+ ZEPHIR_INIT_VAR(&services);
+ array_init(&services);
} else {
- ZEPHIR_INIT_VAR(&directory);
+ ZEPHIR_OBS_COPY_OR_DUP(&services, services_param);
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "/");
- zephir_fast_trim(&_0, &directory, &_1, ZEPHIR_TRIM_RIGHT);
- ZEPHIR_CONCAT_VS(return_value, &_0, "/");
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileExists)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *filename_param = NULL;
- zval filename;
-
- ZVAL_UNDEF(&filename);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filename)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filename_param);
- zephir_get_strval(&filename, filename_param);
- RETURN_MM_BOOL((zephir_file_exists(&filename) == SUCCESS));
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &services);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileGetContents)
+static PHP_METHOD(Phalcon_Image_ImageFactory, load)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *filename_param = NULL;
- zval filename;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *config = NULL, config_sub, height, file, name, width, _0, _1, _2;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filename);
+ ZVAL_UNDEF(&config_sub);
+ ZVAL_UNDEF(&height);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&width);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filename)
+ Z_PARAM_ZVAL(config)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filename_param);
- zephir_get_strval(&filename, filename_param);
- zephir_file_get_contents(return_value, &filename);
+ zephir_fetch_params(1, 1, 0, &config);
+ ZEPHIR_SEPARATE_PARAM(config);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfig", NULL, 0, config);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_0);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "adapter");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfigelement", NULL, 0, config, &_1);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_0);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "file");
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkconfigelement", NULL, 0, config, &_1);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(config, &_0);
+ zephir_memory_observe(&name);
+ zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Image/ImageFactory.zep", 44);
+ zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "file");
+ ZEPHIR_CALL_METHOD(&file, this_ptr, "getarrval", NULL, 408, config, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "height");
+ ZVAL_NULL(&_2);
+ ZEPHIR_CALL_METHOD(&height, this_ptr, "getarrval", NULL, 408, config, &_1, &_2);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "width");
+ ZVAL_NULL(&_2);
+ ZEPHIR_CALL_METHOD(&width, this_ptr, "getarrval", NULL, 408, config, &_1, &_2);
+ zephir_check_call_status();
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &file, &width, &height);
+ zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFilePutContents)
+static PHP_METHOD(Phalcon_Image_ImageFactory, newInstance)
{
+ zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long flags, ZEPHIR_LAST_CALL_STATUS;
- zval *filename_param = NULL, *data, data_sub, *flags_param = NULL, *context = NULL, context_sub, __$null, _0;
- zval filename;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
+ zval *name_param = NULL, *file_param = NULL, *width_param = NULL, *height_param = NULL, definition, _1;
+ zval name, file;
+ zval *this_ptr = getThis();
- ZVAL_UNDEF(&filename);
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&context_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&definition);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_0);
bool is_null_true = 1;
ZEND_PARSE_PARAMETERS_START(2, 4)
- Z_PARAM_STR(filename)
- Z_PARAM_ZVAL(data)
+ Z_PARAM_STR(name)
+ Z_PARAM_STR(file)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(flags)
- Z_PARAM_ZVAL_OR_NULL(context)
+ Z_PARAM_LONG_OR_NULL(width, is_null_true)
+ Z_PARAM_LONG_OR_NULL(height, is_null_true)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 2, &filename_param, &data, &flags_param, &context);
- zephir_get_strval(&filename, filename_param);
- if (!flags_param) {
- flags = 0;
+ zephir_fetch_params(1, 2, 2, &name_param, &file_param, &width_param, &height_param);
+ if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
+ zephir_get_strval(&name, name_param);
} else {
- }
- if (!context) {
- context = &context_sub;
- context = &__$null;
+ ZEPHIR_INIT_VAR(&name);
}
- ZVAL_LONG(&_0, flags);
- ZEPHIR_RETURN_CALL_FUNCTION("file_put_contents", NULL, 139, &filename, data, &_0, context);
+ if (UNEXPECTED(Z_TYPE_P(file_param) != IS_STRING && Z_TYPE_P(file_param) != IS_NULL)) {
+ zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'file' must be of the type string"));
+ RETURN_MM_NULL();
+ }
+ if (EXPECTED(Z_TYPE_P(file_param) == IS_STRING)) {
+ zephir_get_strval(&file, file_param);
+ } else {
+ ZEPHIR_INIT_VAR(&file);
+ }
+ if (!width_param) {
+ width = 0;
+ } else {
+ }
+ if (!height_param) {
+ height = 0;
+ } else {
+ }
+ ZEPHIR_CALL_METHOD(&definition, this_ptr, "getservice", NULL, 0, &name);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_0);
+ zephir_create_array(&_0, 3, 0);
+ zephir_array_fast_append(&_0, &file);
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_LONG(&_1, width);
+ zephir_array_fast_append(&_0, &_1);
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_LONG(&_1, height);
+ zephir_array_fast_append(&_0, &_1);
+ ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(return_value, &definition, &_0);
zephir_check_call_status();
RETURN_MM();
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFopen)
+static PHP_METHOD(Phalcon_Image_ImageFactory, getExceptionClass)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filename_param = NULL, *mode_param = NULL;
- zval filename, mode;
- ZVAL_UNDEF(&filename);
- ZVAL_UNDEF(&mode);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(filename)
- Z_PARAM_STR(mode)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &filename_param, &mode_param);
- zephir_get_strval(&filename, filename_param);
- zephir_get_strval(&mode, mode_param);
- ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 140, &filename, &mode);
- zephir_check_call_status();
- RETURN_MM();
+ RETURN_STRING("Phalcon\\Image\\Exception");
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIniGet)
+static PHP_METHOD(Phalcon_Image_ImageFactory, getServices)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *varname_param = NULL;
- zval varname;
- ZVAL_UNDEF(&varname);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(varname)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &varname_param);
- zephir_get_strval(&varname, varname_param);
- ZEPHIR_RETURN_CALL_FUNCTION("ini_get", NULL, 0, &varname);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_create_array(return_value, 2, 0);
+ add_assoc_stringl_ex(return_value, SL("gd"), SL("Phalcon\\Image\\Adapter\\Gd"));
+ add_assoc_stringl_ex(return_value, SL("imagick"), SL("Phalcon\\Image\\Adapter\\Imagick"));
+ return;
}
-static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIsWritable)
+static PHP_METHOD(Phalcon_Image_ImageFactory, getArrVal)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *filename_param = NULL;
- zval filename;
+ zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value;
+ zval collection;
- ZVAL_UNDEF(&filename);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(filename)
+ ZVAL_UNDEF(&collection);
+ ZVAL_UNDEF(&index_sub);
+ ZVAL_UNDEF(&defaultValue_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&value);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_ARRAY(collection)
+ Z_PARAM_ZVAL(index)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_OR_NULL(defaultValue)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &filename_param);
- zephir_get_strval(&filename, filename_param);
- ZEPHIR_RETURN_CALL_FUNCTION("is_writable", NULL, 0, &filename);
- zephir_check_call_status();
- RETURN_MM();
+ zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue);
+ ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param);
+ if (!defaultValue) {
+ defaultValue = &defaultValue_sub;
+ defaultValue = &__$null;
+ }
+ zephir_memory_observe(&value);
+ if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) {
+ RETVAL_ZVAL(defaultValue, 1, 0);
+ RETURN_MM();
+ }
+ RETURN_CCTOR(&value);
}
@@ -164485,764 +162281,997 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIsWritable)
-ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Query_AbstractConditions)
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_AbstractAdapter)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\DataMapper\\Query, AbstractConditions, phalcon, datamapper_query_abstractconditions, phalcon_datamapper_query_abstractquery_ce, phalcon_datamapper_query_abstractconditions_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Image\\Adapter, AbstractAdapter, phalcon, image_adapter_abstractadapter, phalcon_image_adapter_abstractadapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ zend_declare_property_null(phalcon_image_adapter_abstractadapter_ce, SL("file"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_image_adapter_abstractadapter_ce, SL("height"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_image_adapter_abstractadapter_ce, SL("image"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_image_adapter_abstractadapter_ce, SL("mime"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_image_adapter_abstractadapter_ce, SL("realpath"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_image_adapter_abstractadapter_ce, SL("type"), ZEND_ACC_PROTECTED);
+ zend_declare_property_null(phalcon_image_adapter_abstractadapter_ce, SL("width"), ZEND_ACC_PROTECTED);
+ zend_class_implements(phalcon_image_adapter_abstractadapter_ce, 1, phalcon_image_adapter_adapterinterface_ce);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, limit)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, background)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *limit_param = NULL, _0, _1;
- zend_long limit;
+ zend_long opacity, ZEPHIR_LAST_CALL_STATUS;
+ zval *color_param = NULL, *opacity_param = NULL, colors, _1, _2, _3, _9, _10, _11, _12, _13, _14, _4$$3, _5$$3, _6$$4, _7$$4, _8$$4;
+ zval color;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&colors);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(limit)
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(color)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(opacity)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &limit_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "LIMIT");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_LONG(&_1, limit);
- zephir_update_property_array(this_ptr, SL("store"), &_0, &_1);
+ zephir_fetch_params(1, 1, 1, &color_param, &opacity_param);
+ zephir_get_strval(&color, color_param);
+ if (!opacity_param) {
+ opacity = 100;
+ } else {
+ }
+ _0 = zephir_fast_strlen_ev(&color) > 1;
+ if (_0) {
+ ZVAL_LONG(&_1, 0);
+ ZVAL_LONG(&_2, 1);
+ ZEPHIR_INIT_VAR(&_3);
+ zephir_substr(&_3, &color, 0 , 1 , 0);
+ _0 = ZEPHIR_IS_STRING_IDENTICAL(&_3, "#");
+ }
+ if (_0) {
+ ZVAL_LONG(&_4$$3, 1);
+ ZEPHIR_INIT_VAR(&_5$$3);
+ zephir_substr(&_5$$3, &color, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ zephir_get_strval(&color, &_5$$3);
+ }
+ if (zephir_fast_strlen_ev(&color) == 3) {
+ ZEPHIR_INIT_VAR(&_6$$4);
+ ZVAL_STRING(&_6$$4, "/./");
+ ZEPHIR_INIT_VAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "$0$0");
+ ZEPHIR_CALL_FUNCTION(&_8$$4, "preg_replace", NULL, 41, &_6$$4, &_7$$4, &color);
+ zephir_check_call_status();
+ zephir_get_strval(&color, &_8$$4);
+ }
+ ZVAL_LONG(&_9, 2);
+ ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 88, &color, &_9);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_11);
+ ZVAL_STRING(&_11, "hexdec");
+ ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 81, &_11, &_10);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 96);
+ zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 96);
+ zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 96);
+ ZVAL_LONG(&_9, opacity);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processbackground", NULL, 0, &_12, &_13, &_14, &_9);
+ zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, offset)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, blur)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *offset_param = NULL, _0, _1;
- zend_long offset;
+ zval *radius_param = NULL, _0, _1, _2;
+ zend_long radius, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_LONG(offset)
+ Z_PARAM_LONG(radius)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &offset_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "OFFSET");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_LONG(&_1, offset);
- zephir_update_property_array(this_ptr, SL("store"), &_0, &_1);
+ zephir_fetch_params(1, 1, 0, &radius_param);
+ ZVAL_LONG(&_1, radius);
+ ZVAL_LONG(&_2, 1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkhighlow", NULL, 0, &_1, &_2);
+ zephir_check_call_status();
+ radius = zephir_get_numberval(&_0);
+ ZVAL_LONG(&_1, radius);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processblur", NULL, 0, &_1);
+ zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, andWhere)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, crop)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _0;
- zval condition;
+ zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, _0$$3, _1$$4, _2$$4, _3$$4, _4$$4, _5$$5, _6$$6, _7$$6, _8$$6, _9$$6, _10, _12, _14, _15, _16, _17, _11$$7, _13$$8;
+ zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$4);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_8$$6);
+ ZVAL_UNDEF(&_9$$6);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_13$$8);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(condition)
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ Z_PARAM_LONG_OR_NULL(offsetX, is_null_true)
+ Z_PARAM_LONG_OR_NULL(offsetY, is_null_true)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &condition_param, &value, &type_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
+ zephir_fetch_params(1, 2, 2, &width_param, &height_param, &offsetX_param, &offsetY_param);
+ if (!offsetX_param) {
+ offsetX = 0;
+ } else {
+ }
+ if (!offsetY_param) {
+ offsetY = 0;
+ } else {
+ }
+ if (0 == offsetX) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ offsetX = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(&_0$$3) - width)), 2)));
+ } else {
+ ZEPHIR_INIT_VAR(&_1$$4);
+ if (offsetX < 0) {
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_1$$4);
+ ZVAL_LONG(&_1$$4, ((zephir_get_numberval(&_2$$4) - width) + offsetX));
+ } else {
+ ZEPHIR_INIT_NVAR(&_1$$4);
+ ZVAL_LONG(&_1$$4, offsetX);
+ }
+ offsetX = zephir_get_numberval(&_1$$4);
+ ZEPHIR_INIT_VAR(&_3$$4);
+ zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_LT_LONG(&_4$$4, offsetX)) {
+ ZEPHIR_OBS_NVAR(&_3$$4);
+ zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("width"), PH_NOISY_CC);
+ } else {
+ ZEPHIR_INIT_NVAR(&_3$$4);
+ ZVAL_LONG(&_3$$4, offsetX);
+ }
+ offsetX = zephir_get_numberval(&_3$$4);
}
- if (!type_param) {
- type = -1;
+ if (0 == offsetY) {
+ zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ offsetY = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(&_5$$5) - height)), 2)));
} else {
+ ZEPHIR_INIT_VAR(&_6$$6);
+ if (offsetY < 0) {
+ zephir_read_property(&_7$$6, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_6$$6);
+ ZVAL_LONG(&_6$$6, ((zephir_get_numberval(&_7$$6) - height) + offsetY));
+ } else {
+ ZEPHIR_INIT_NVAR(&_6$$6);
+ ZVAL_LONG(&_6$$6, offsetY);
}
- ZVAL_LONG(&_0, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", NULL, 0, &condition, value, &_0);
+ offsetY = zephir_get_numberval(&_6$$6);
+ ZEPHIR_INIT_VAR(&_8$$6);
+ zephir_read_property(&_9$$6, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if (ZEPHIR_LT_LONG(&_9$$6, offsetY)) {
+ ZEPHIR_OBS_NVAR(&_8$$6);
+ zephir_read_property(&_8$$6, this_ptr, ZEND_STRL("height"), PH_NOISY_CC);
+ } else {
+ ZEPHIR_INIT_NVAR(&_8$$6);
+ ZVAL_LONG(&_8$$6, offsetY);
+ }
+ offsetY = zephir_get_numberval(&_8$$6);
+ }
+ zephir_read_property(&_10, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ if (width > ((zephir_get_numberval(&_10) - offsetX))) {
+ zephir_read_property(&_11$$7, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ width = (zephir_get_numberval(&_11$$7) - offsetX);
+ }
+ zephir_read_property(&_12, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if (height > ((zephir_get_numberval(&_12) - offsetY))) {
+ zephir_read_property(&_13$$8, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ height = (zephir_get_numberval(&_13$$8) - offsetY);
+ }
+ ZVAL_LONG(&_14, width);
+ ZVAL_LONG(&_15, height);
+ ZVAL_LONG(&_16, offsetX);
+ ZVAL_LONG(&_17, offsetY);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcrop", NULL, 0, &_14, &_15, &_16, &_17);
zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, appendWhere)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, flip)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _0, _1;
- zval condition;
+ zval *direction_param = NULL, _1;
+ zend_long direction, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(condition)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(direction)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &condition_param, &value, &type_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
+ zephir_fetch_params(1, 1, 0, &direction_param);
+ _0 = direction != 11;
+ if (_0) {
+ _0 = direction != 12;
}
- if (!type_param) {
- type = -1;
- } else {
- }
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "WHERE");
- ZVAL_LONG(&_1, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendcondition", NULL, 0, &_0, &condition, value, &_1);
+ if (_0) {
+ direction = 11;
+ }
+ ZVAL_LONG(&_1, direction);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processflip", NULL, 0, &_1);
zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, orderBy)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getHeight)
+{
+
+ RETURN_MEMBER(getThis(), "height");
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getImage)
+{
+
+ RETURN_MEMBER(getThis(), "image");
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getMime)
+{
+
+ RETURN_MEMBER(getThis(), "mime");
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getRealpath)
+{
+
+ RETURN_MEMBER(getThis(), "realpath");
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getType)
+{
+
+ RETURN_MEMBER(getThis(), "type");
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, getWidth)
+{
+
+ RETURN_MEMBER(getThis(), "width");
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, mask)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *orderBy, orderBy_sub, _0;
+ zval *mask, mask_sub;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&orderBy_sub);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&mask_sub);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(orderBy)
+ Z_PARAM_OBJECT_OF_CLASS(mask, phalcon_image_adapter_adapterinterface_ce)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &orderBy);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "ORDER");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "processvalue", NULL, 0, &_0, orderBy);
+ zephir_fetch_params(1, 1, 0, &mask);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processmask", NULL, 0, mask);
zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, orWhere)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, pixelate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _0, _1, _2;
- zval condition;
+ zval *amount_param = NULL, _0;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(condition)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &condition_param, &value, &type_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ if (amount < 2) {
+ amount = 2;
}
- if (!type_param) {
- type = -1;
- } else {
- }
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "WHERE");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "OR ");
- ZVAL_LONG(&_2, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "addcondition", NULL, 0, &_0, &_1, &condition, value, &_2);
+ ZVAL_LONG(&_0, amount);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processpixelate", NULL, 0, &_0);
zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, where)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, reflection)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _0, _1, _2;
- zval condition;
+ zend_bool fadeIn, _0;
+ zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, _1, _3, _4, _5, _6, _2$$3;
+ zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- bool is_null_true = 1;
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_2$$3);
ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(condition)
+ Z_PARAM_LONG(height)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_BOOL(fadeIn)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &condition_param, &value, &type_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
- }
- if (!type_param) {
- type = -1;
+ zephir_fetch_params(1, 1, 2, &height_param, &opacity_param, &fadeIn_param);
+ if (!opacity_param) {
+ opacity = 100;
} else {
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "WHERE");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "AND ");
- ZVAL_LONG(&_2, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "addcondition", NULL, 0, &_0, &_1, &condition, value, &_2);
- zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, whereEquals)
-{
- zend_string *_3;
- zend_ulong _2;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *columnsValues_param = NULL, key, value, *_0, _1, _5$$5, _6$$6, _7$$7, _8$$10, _9$$11, _10$$12;
- zval columnsValues;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&columnsValues);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_5$$5);
- ZVAL_UNDEF(&_6$$6);
- ZVAL_UNDEF(&_7$$7);
- ZVAL_UNDEF(&_8$$10);
- ZVAL_UNDEF(&_9$$11);
- ZVAL_UNDEF(&_10$$12);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(columnsValues)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &columnsValues_param);
- zephir_get_arrval(&columnsValues, columnsValues_param);
- zephir_is_iterable(&columnsValues, 0, "phalcon/DataMapper/Query/AbstractConditions.zep", 162);
- if (Z_TYPE_P(&columnsValues) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columnsValues), _2, _3, _0)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&key, _3);
- } else {
- ZVAL_LONG(&key, _2);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- if (zephir_is_numeric(&key)) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &value);
- zephir_check_call_status();
- } else if (Z_TYPE_P(&value) == IS_NULL) {
- ZEPHIR_INIT_NVAR(&_5$$5);
- ZEPHIR_CONCAT_VS(&_5$$5, &key, " IS NULL");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &_5$$5);
- zephir_check_call_status();
- } else if (Z_TYPE_P(&value) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_6$$6);
- ZEPHIR_CONCAT_VS(&_6$$6, &key, " IN ");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &_6$$6, &value);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_7$$7);
- ZEPHIR_CONCAT_VS(&_7$$7, &key, " = ");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &_7$$7, &value);
- zephir_check_call_status();
- }
- } ZEND_HASH_FOREACH_END();
+ if (!fadeIn_param) {
+ fadeIn = 0;
} else {
- ZEPHIR_CALL_METHOD(NULL, &columnsValues, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &columnsValues, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &columnsValues, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &columnsValues, "current", NULL, 0);
- zephir_check_call_status();
- if (zephir_is_numeric(&key)) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &value);
- zephir_check_call_status();
- } else if (Z_TYPE_P(&value) == IS_NULL) {
- ZEPHIR_INIT_NVAR(&_8$$10);
- ZEPHIR_CONCAT_VS(&_8$$10, &key, " IS NULL");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &_8$$10);
- zephir_check_call_status();
- } else if (Z_TYPE_P(&value) == IS_ARRAY) {
- ZEPHIR_INIT_NVAR(&_9$$11);
- ZEPHIR_CONCAT_VS(&_9$$11, &key, " IN ");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &_9$$11, &value);
- zephir_check_call_status();
- } else {
- ZEPHIR_INIT_NVAR(&_10$$12);
- ZEPHIR_CONCAT_VS(&_10$$12, &key, " = ");
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "where", &_4, 0, &_10$$12, &value);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(NULL, &columnsValues, "next", NULL, 0);
- zephir_check_call_status();
}
+ _0 = height <= 0;
+ if (!(_0)) {
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ _0 = ZEPHIR_LT_LONG(&_1, height);
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
+ if (_0) {
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ height = zephir_get_numberval(&_2$$3);
+ }
+ ZVAL_LONG(&_4, opacity);
+ ZEPHIR_CALL_METHOD(&_3, this_ptr, "checkhighlow", NULL, 0, &_4);
+ zephir_check_call_status();
+ opacity = zephir_get_numberval(&_3);
+ ZVAL_LONG(&_4, height);
+ ZVAL_LONG(&_5, opacity);
+ if (fadeIn) {
+ ZVAL_BOOL(&_6, 1);
+ } else {
+ ZVAL_BOOL(&_6, 0);
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processreflection", NULL, 0, &_4, &_5, &_6);
+ zephir_check_call_status();
RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, addCondition)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, render)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *store_param = NULL, *andor_param = NULL, *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _0$$3, _1$$3, _2, _3;
- zval store, andor, condition, _4;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *extension_param = NULL, *quality_param = NULL, _0$$3, _1$$3, _2$$3, _4, _5, _6;
+ zval extension, _3$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&store);
- ZVAL_UNDEF(&andor);
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&_3$$3);
ZVAL_UNDEF(&_0$$3);
ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(3, 5)
- Z_PARAM_STR(store)
- Z_PARAM_STR(andor)
- Z_PARAM_STR(condition)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ Z_PARAM_STR_OR_NULL(extension)
+ Z_PARAM_LONG(quality)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 3, 2, &store_param, &andor_param, &condition_param, &value, &type_param);
- zephir_get_strval(&store, store_param);
- zephir_get_strval(&andor, andor_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
+ zephir_fetch_params(1, 0, 2, &extension_param, &quality_param);
+ if (!extension_param) {
+ ZEPHIR_INIT_VAR(&extension);
+ } else {
+ zephir_get_strval(&extension, extension_param);
}
- if (!type_param) {
- type = -1;
+ if (!quality_param) {
+ quality = 100;
} else {
}
- if (!(ZEPHIR_IS_EMPTY(value))) {
- ZVAL_LONG(&_1$$3, type);
- ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "bindinline", NULL, 0, value, &_1$$3);
+ if (Z_TYPE_P(&extension) == IS_NULL) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1$$3, 4);
+ ZEPHIR_CALL_FUNCTION(&_2$$3, "pathinfo", NULL, 89, &_0$$3, &_1$$3);
zephir_check_call_status();
- zephir_concat_self(&condition, &_0$$3);
+ zephir_cast_to_string(&_3$$3, &_2$$3);
+ ZEPHIR_CPY_WRT(&extension, &_3$$3);
}
- zephir_read_property(&_2, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_3, &_2, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 185);
- if (ZEPHIR_IS_EMPTY(&_3)) {
- ZEPHIR_INIT_NVAR(&andor);
+ if (1 == ZEPHIR_IS_EMPTY(&extension)) {
+ ZEPHIR_INIT_NVAR(&extension);
+ ZVAL_STRING(&extension, "png");
}
- ZEPHIR_INIT_VAR(&_4);
- ZEPHIR_CONCAT_VV(&_4, &andor, &condition);
- zephir_update_property_array_multi(this_ptr, SL("store"), &_4, SL("za"), 2, &store);
- ZEPHIR_MM_RESTORE();
+ ZVAL_LONG(&_5, quality);
+ ZVAL_LONG(&_6, 1);
+ ZEPHIR_CALL_METHOD(&_4, this_ptr, "checkhighlow", NULL, 0, &_5, &_6);
+ zephir_check_call_status();
+ quality = zephir_get_numberval(&_4);
+ ZVAL_LONG(&_5, quality);
+ ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processrender", NULL, 0, &extension, &_5);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, buildBy)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize)
{
+ zend_bool _0$$3;
+ double ratio = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *type_param = NULL, _0, _1, _2, _3, _4, _5;
- zval type;
+ zval *width_param = NULL, *height_param = NULL, *master_param = NULL, _20, _21, _22, _23, _24, _25, _26, _27, _1$$10, _2$$10, _3$$10, _4$$11, _5$$11, _6$$11, _7$$12, _8$$12, _9$$13, _10$$13, _11$$14, _12$$14, _13$$14, _14$$15, _15$$15, _16$$16, _17$$16, _18$$17, _19$$17;
+ zend_long width, height, master, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&type);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(type)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &type_param);
- zephir_get_strval(&type, type_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_1, &_0, &type, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 201);
- if (ZEPHIR_IS_EMPTY(&_1)) {
- RETURN_MM_STRING("");
+ ZVAL_UNDEF(&_20);
+ ZVAL_UNDEF(&_21);
+ ZVAL_UNDEF(&_22);
+ ZVAL_UNDEF(&_23);
+ ZVAL_UNDEF(&_24);
+ ZVAL_UNDEF(&_25);
+ ZVAL_UNDEF(&_26);
+ ZVAL_UNDEF(&_27);
+ ZVAL_UNDEF(&_1$$10);
+ ZVAL_UNDEF(&_2$$10);
+ ZVAL_UNDEF(&_3$$10);
+ ZVAL_UNDEF(&_4$$11);
+ ZVAL_UNDEF(&_5$$11);
+ ZVAL_UNDEF(&_6$$11);
+ ZVAL_UNDEF(&_7$$12);
+ ZVAL_UNDEF(&_8$$12);
+ ZVAL_UNDEF(&_9$$13);
+ ZVAL_UNDEF(&_10$$13);
+ ZVAL_UNDEF(&_11$$14);
+ ZVAL_UNDEF(&_12$$14);
+ ZVAL_UNDEF(&_13$$14);
+ ZVAL_UNDEF(&_14$$15);
+ ZVAL_UNDEF(&_15$$15);
+ ZVAL_UNDEF(&_16$$16);
+ ZVAL_UNDEF(&_17$$16);
+ ZVAL_UNDEF(&_18$$17);
+ ZVAL_UNDEF(&_19$$17);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 3)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG_OR_NULL(width, is_null_true)
+ Z_PARAM_LONG_OR_NULL(height, is_null_true)
+ Z_PARAM_LONG(master)
+ ZEND_PARSE_PARAMETERS_END();
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 0, 3, &width_param, &height_param, &master_param);
+ if (!width_param) {
+ width = 0;
+ } else {
+ }
+ if (!height_param) {
+ height = 0;
+ } else {
+ }
+ if (!master_param) {
+ master = 4;
+ } else {
+ }
+ do {
+ if (master == 7 || master == 4 || master == 5 || master == 6) {
+ _0$$3 = 0 == width;
+ if (!(_0$$3)) {
+ _0$$3 = 0 == height;
+ }
+ if (_0$$3) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 329);
+ return;
+ }
+ break;
+ }
+ if (master == 2) {
+ if (0 == width) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 334);
+ return;
+ }
+ break;
+ }
+ if (master == 3) {
+ if (0 == height) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 339);
+ return;
+ }
+ break;
+ }
+ } while(0);
+
+ if (master != 7) {
+ if (master == 4) {
+ ZEPHIR_INIT_VAR(&_1$$10);
+ zephir_read_property(&_2$$10, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_3$$10, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if ((zephir_safe_div_zval_long(&_2$$10, width)) > (int) (zephir_safe_div_zval_long(&_3$$10, height))) {
+ ZEPHIR_INIT_NVAR(&_1$$10);
+ ZVAL_LONG(&_1$$10, 2);
+ } else {
+ ZEPHIR_INIT_NVAR(&_1$$10);
+ ZVAL_LONG(&_1$$10, 3);
+ }
+ master = zephir_get_numberval(&_1$$10);
+ }
+ if (master == 5) {
+ ZEPHIR_INIT_VAR(&_4$$11);
+ zephir_read_property(&_5$$11, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_6$$11, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if ((zephir_safe_div_zval_long(&_5$$11, width)) > (int) (zephir_safe_div_zval_long(&_6$$11, height))) {
+ ZEPHIR_INIT_NVAR(&_4$$11);
+ ZVAL_LONG(&_4$$11, 3);
+ } else {
+ ZEPHIR_INIT_NVAR(&_4$$11);
+ ZVAL_LONG(&_4$$11, 2);
+ }
+ master = zephir_get_numberval(&_4$$11);
+ }
+ do {
+ if (master == 2) {
+ zephir_read_property(&_7$$12, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_8$$12, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_7$$12) * width), &_8$$12));
+ break;
+ }
+ if (master == 3) {
+ zephir_read_property(&_9$$13, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_10$$13, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_9$$13) * height), &_10$$13));
+ break;
+ }
+ if (master == 6) {
+ zephir_read_property(&_11$$14, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_12$$14, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_13$$14);
+ div_function(&_13$$14, &_11$$14, &_12$$14);
+ ratio = zephir_get_numberval(&_13$$14);
+ if ((zephir_safe_div_long_long(width, height)) > ratio) {
+ zephir_read_property(&_14$$15, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_15$$15, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_14$$15) * width), &_15$$15));
+ } else {
+ zephir_read_property(&_16$$16, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_17$$16, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_16$$16) * height), &_17$$16));
+ }
+ break;
+ }
+ if (master == 1) {
+ ZEPHIR_INIT_VAR(&_18$$17);
+ if (0 == width) {
+ ZEPHIR_OBS_NVAR(&_18$$17);
+ zephir_read_property(&_18$$17, this_ptr, ZEND_STRL("width"), PH_NOISY_CC);
+ } else {
+ ZEPHIR_INIT_NVAR(&_18$$17);
+ ZVAL_LONG(&_18$$17, width);
+ }
+ width = zephir_get_numberval(&_18$$17);
+ ZEPHIR_INIT_VAR(&_19$$17);
+ if (0 == height) {
+ ZEPHIR_OBS_NVAR(&_19$$17);
+ zephir_read_property(&_19$$17, this_ptr, ZEND_STRL("height"), PH_NOISY_CC);
+ } else {
+ ZEPHIR_INIT_NVAR(&_19$$17);
+ ZVAL_LONG(&_19$$17, height);
+ }
+ height = zephir_get_numberval(&_19$$17);
+ break;
+ }
+ } while(0);
+
}
- zephir_read_property(&_3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_4, &_3, &type, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 206);
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, ",");
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "indent", NULL, 0, &_4, &_5);
+ ZEPHIR_INIT_VAR(&_20);
+ ZVAL_LONG(&_21, width);
+ zephir_round(&_20, &_21, NULL, NULL);
+ ZVAL_LONG(&_22, 1);
+ ZEPHIR_CALL_FUNCTION(&_23, "max", NULL, 90, &_20, &_22);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVSV(return_value, " ", &type, " BY", &_2);
- RETURN_MM();
+ width = zephir_get_intval(&_23);
+ ZEPHIR_INIT_VAR(&_24);
+ ZVAL_LONG(&_22, height);
+ zephir_round(&_24, &_22, NULL, NULL);
+ ZVAL_LONG(&_25, 1);
+ ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 90, &_24, &_25);
+ zephir_check_call_status();
+ height = zephir_get_intval(&_26);
+ ZVAL_LONG(&_25, width);
+ ZVAL_LONG(&_27, height);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processresize", NULL, 0, &_25, &_27);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, buildCondition)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, rotate)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *type_param = NULL, _0, _1, _2, _3, _4;
- zval type;
+ zval *degrees_param = NULL, _0;
+ zend_long degrees, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&type);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(type)
+ Z_PARAM_LONG(degrees)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &type_param);
- zephir_get_strval(&type, type_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_1, &_0, &type, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 218);
- if (ZEPHIR_IS_EMPTY(&_1)) {
- RETURN_MM_STRING("");
+ zephir_fetch_params(1, 1, 0, °rees_param);
+ if (degrees > 180) {
+ degrees %= 360;
+ if (degrees > 180) {
+ degrees -= 360;
+ }
+ } else {
+ while (1) {
+ if (!(degrees < -180)) {
+ break;
+ }
+ degrees += 360;
+ }
}
- zephir_read_property(&_3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_4, &_3, &type, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 223);
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "indent", NULL, 0, &_4);
+ ZVAL_LONG(&_0, degrees);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processrotate", NULL, 0, &_0);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVV(return_value, " ", &type, &_2);
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, buildLimitEarly)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, save)
{
- zend_bool _3, _6;
- zval _0, _1, _2, _4, _5, _7, _8, _9$$3, _10$$3, _11$$3;
- zval limit;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *quality_param = NULL, _0$$3, _2;
+ zval file, _1$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&limit);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_0$$3);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9$$3);
- ZVAL_UNDEF(&_10$$3);
- ZVAL_UNDEF(&_11$$3);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(file)
+ Z_PARAM_LONG(quality)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&limit);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, &_0, "getdrivername", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "sqlsrv");
- _3 = ZEPHIR_IS_IDENTICAL(&_2, &_1);
- if (_3) {
- zephir_read_property(&_4, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_5, &_4, SL("LIMIT"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 237);
- _3 = ZEPHIR_GT_LONG(&_5, 0);
- }
- _6 = _3;
- if (_6) {
- zephir_read_property(&_7, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_8, &_7, SL("OFFSET"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 239);
- _6 = ZEPHIR_IS_LONG_IDENTICAL(&_8, 0);
+ zephir_fetch_params(1, 0, 2, &file_param, &quality_param);
+ if (!file_param) {
+ ZEPHIR_INIT_VAR(&file);
+ } else {
+ zephir_get_strval(&file, file_param);
}
- if (_6) {
- zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_10$$3, &_9$$3, SL("LIMIT"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 240);
- ZEPHIR_INIT_VAR(&_11$$3);
- ZEPHIR_CONCAT_SV(&_11$$3, " TOP ", &_10$$3);
- zephir_get_strval(&limit, &_11$$3);
+ if (!quality_param) {
+ quality = -1;
+ } else {
+ }
+ if (Z_TYPE_P(&file) == IS_NULL) {
+ zephir_memory_observe(&_0$$3);
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("realpath"), PH_NOISY_CC);
+ zephir_cast_to_string(&_1$$3, &_0$$3);
+ ZEPHIR_CPY_WRT(&file, &_1$$3);
}
- RETURN_CTOR(&limit);
+ ZVAL_LONG(&_2, quality);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processsave", NULL, 0, &file, &_2);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, buildLimit)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, sharpen)
{
- zval method, suffix, _0, _1, _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *amount_param = NULL, _0, _1, _2;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&suffix);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(amount)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&suffix, &_0, "getdrivername", NULL, 0);
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ ZVAL_LONG(&_1, amount);
+ ZVAL_LONG(&_2, 1);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkhighlow", NULL, 0, &_1, &_2);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "sqlsrv");
- if (!ZEPHIR_IS_IDENTICAL(&_1, &suffix)) {
- ZEPHIR_INIT_NVAR(&suffix);
- ZVAL_STRING(&suffix, "common");
- }
- ZEPHIR_INIT_VAR(&_2);
- zephir_ucfirst(&_2, &suffix);
- ZEPHIR_INIT_VAR(&method);
- ZEPHIR_CONCAT_SV(&method, "buildLimit", &_2);
- ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, &method, NULL, 0);
+ amount = zephir_get_numberval(&_0);
+ ZVAL_LONG(&_1, amount);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processsharpen", NULL, 0, &_1);
zephir_check_call_status();
- RETURN_MM();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, buildLimitCommon)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, text)
{
- zval _0, _1, _5, _6, _10, _2$$3, _3$$3, _4$$3, _7$$4, _8$$4, _9$$4, _11$$5, _12$$5;
- zval limit;
+ zend_bool _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long opacity, size, ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *offsetX = NULL, offsetX_sub, *offsetY = NULL, offsetY_sub, *opacity_param = NULL, *color_param = NULL, *size_param = NULL, *fontFile_param = NULL, __$false, colors, _0, _1, _3, _4, _10, _11, _12, _13, _14, _15, _16, _5$$3, _6$$3, _7$$4, _8$$4, _9$$4;
+ zval text, color, fontFile;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&limit);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&fontFile);
+ ZVAL_UNDEF(&offsetX_sub);
+ ZVAL_UNDEF(&offsetY_sub);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&colors);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
ZVAL_UNDEF(&_7$$4);
ZVAL_UNDEF(&_8$$4);
ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&_11$$5);
- ZVAL_UNDEF(&_12$$5);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 7)
+ Z_PARAM_STR(text)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(offsetX)
+ Z_PARAM_ZVAL(offsetY)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_STR(color)
+ Z_PARAM_LONG(size)
+ Z_PARAM_STR_OR_NULL(fontFile)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&limit);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("LIMIT"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 275);
- if (!ZEPHIR_IS_LONG_IDENTICAL(&_1, 0)) {
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_3$$3, &_2$$3, SL("LIMIT"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 276);
- ZEPHIR_INIT_VAR(&_4$$3);
- ZEPHIR_CONCAT_SV(&_4$$3, "LIMIT ", &_3$$3);
- zephir_concat_self(&limit, &_4$$3);
+ zephir_fetch_params(1, 1, 6, &text_param, &offsetX, &offsetY, &opacity_param, &color_param, &size_param, &fontFile_param);
+ zephir_get_strval(&text, text_param);
+ if (!offsetX) {
+ offsetX = &offsetX_sub;
+ offsetX = &__$false;
}
- zephir_read_property(&_5, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_6, &_5, SL("OFFSET"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 279);
- if (!ZEPHIR_IS_LONG_IDENTICAL(&_6, 0)) {
- zephir_read_property(&_7$$4, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_8$$4, &_7$$4, SL("OFFSET"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 280);
- ZEPHIR_INIT_VAR(&_9$$4);
- ZEPHIR_CONCAT_SV(&_9$$4, " OFFSET ", &_8$$4);
- zephir_concat_self(&limit, &_9$$4);
+ if (!offsetY) {
+ offsetY = &offsetY_sub;
+ offsetY = &__$false;
}
- ZEPHIR_INIT_VAR(&_10);
- ZVAL_STRING(&_10, "");
- if (!ZEPHIR_IS_IDENTICAL(&_10, &limit)) {
- ZEPHIR_INIT_VAR(&_11$$5);
- zephir_fast_trim(&_11$$5, &limit, NULL , ZEPHIR_TRIM_LEFT);
- ZEPHIR_INIT_VAR(&_12$$5);
- ZEPHIR_CONCAT_SV(&_12$$5, " ", &_11$$5);
- zephir_get_strval(&limit, &_12$$5);
+ if (!opacity_param) {
+ opacity = 100;
+ } else {
+ }
+ if (!color_param) {
+ ZEPHIR_INIT_VAR(&color);
+ ZVAL_STRING(&color, "000000");
+ } else {
+ zephir_get_strval(&color, color_param);
}
- RETURN_CTOR(&limit);
+ if (!size_param) {
+ size = 12;
+ } else {
+ }
+ if (!fontFile_param) {
+ ZEPHIR_INIT_VAR(&fontFile);
+ } else {
+ zephir_get_strval(&fontFile, fontFile_param);
+ }
+ ZVAL_LONG(&_1, opacity);
+ ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkhighlow", NULL, 0, &_1);
+ zephir_check_call_status();
+ opacity = zephir_get_numberval(&_0);
+ _2 = zephir_fast_strlen_ev(&color) > 1;
+ if (_2) {
+ ZVAL_LONG(&_1, 0);
+ ZVAL_LONG(&_3, 1);
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_substr(&_4, &color, 0 , 1 , 0);
+ _2 = ZEPHIR_IS_STRING_IDENTICAL(&_4, "#");
+ }
+ if (_2) {
+ ZVAL_LONG(&_5$$3, 1);
+ ZEPHIR_INIT_VAR(&_6$$3);
+ zephir_substr(&_6$$3, &color, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);
+ zephir_get_strval(&color, &_6$$3);
+ }
+ if (zephir_fast_strlen_ev(&color) == 3) {
+ ZEPHIR_INIT_VAR(&_7$$4);
+ ZVAL_STRING(&_7$$4, "/./");
+ ZEPHIR_INIT_VAR(&_8$$4);
+ ZVAL_STRING(&_8$$4, "$0$0");
+ ZEPHIR_CALL_FUNCTION(&_9$$4, "preg_replace", NULL, 41, &_7$$4, &_8$$4, &color);
+ zephir_check_call_status();
+ zephir_get_strval(&color, &_9$$4);
+ }
+ ZVAL_LONG(&_10, 2);
+ ZEPHIR_CALL_FUNCTION(&_11, "str_split", NULL, 88, &color, &_10);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_12);
+ ZVAL_STRING(&_12, "hexdec");
+ ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 81, &_12, &_11);
+ zephir_check_call_status();
+ zephir_array_fetch_long(&_13, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 495);
+ zephir_array_fetch_long(&_14, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 496);
+ zephir_array_fetch_long(&_15, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 497);
+ ZVAL_LONG(&_10, opacity);
+ ZVAL_LONG(&_16, size);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processtext", NULL, 0, &text, offsetX, offsetY, &_10, &_13, &_14, &_15, &_16, &fontFile);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, buildLimitSqlsrv)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, watermark)
{
- zend_bool _2;
- zval _0, _1, _3, _4, _5$$3, _6$$3, _7$$3, _8$$3, _9$$3;
- zval limit;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS;
+ zval *watermark, watermark_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, op, x, y, _0, _1, _2, _3, _4;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&limit);
+ ZVAL_UNDEF(&watermark_sub);
+ ZVAL_UNDEF(&op);
+ ZVAL_UNDEF(&x);
+ ZVAL_UNDEF(&y);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5$$3);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_8$$3);
- ZVAL_UNDEF(&_9$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_OBJECT_OF_CLASS(watermark, phalcon_image_adapter_adapterinterface_ce)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(offsetX)
+ Z_PARAM_LONG(offsetY)
+ Z_PARAM_LONG(opacity)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&limit);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("LIMIT"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 299);
- _2 = ZEPHIR_GT_LONG(&_1, 0);
- if (_2) {
- zephir_read_property(&_3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_4, &_3, SL("OFFSET"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 299);
- _2 = ZEPHIR_GT_LONG(&_4, 0);
- }
- if (_2) {
- zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_6$$3, &_5$$3, SL("OFFSET"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 300);
- zephir_read_property(&_7$$3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_8$$3, &_7$$3, SL("LIMIT"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 301);
- ZEPHIR_INIT_VAR(&_9$$3);
- ZEPHIR_CONCAT_SVSSVS(&_9$$3, " OFFSET ", &_6$$3, " ROWS", " FETCH NEXT ", &_8$$3, " ROWS ONLY");
- zephir_get_strval(&limit, &_9$$3);
- }
- RETURN_CTOR(&limit);
+ zephir_fetch_params(1, 1, 3, &watermark, &offsetX_param, &offsetY_param, &opacity_param);
+ if (!offsetX_param) {
+ offsetX = 0;
+ } else {
+ }
+ if (!offsetY_param) {
+ offsetY = 0;
+ } else {
+ }
+ if (!opacity_param) {
+ opacity = 100;
+ } else {
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, watermark, "getwidth", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_2);
+ zephir_sub_function(&_2, &_0, &_1);
+ ZVAL_LONG(&_0, offsetX);
+ ZVAL_LONG(&_3, 0);
+ ZEPHIR_CALL_METHOD(&x, this_ptr, "checkhighlow", NULL, 0, &_0, &_3, &_2);
+ zephir_check_call_status();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_1, watermark, "getheight", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_sub_function(&_4, &_0, &_1);
+ ZVAL_LONG(&_0, offsetX);
+ ZVAL_LONG(&_3, 0);
+ ZEPHIR_CALL_METHOD(&y, this_ptr, "checkhighlow", NULL, 0, &_0, &_3, &_4);
+ zephir_check_call_status();
+ ZVAL_LONG(&_0, opacity);
+ ZEPHIR_CALL_METHOD(&op, this_ptr, "checkhighlow", NULL, 0, &_0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_0, opacity);
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "processwatermark", NULL, 0, watermark, &x, &y, &_0);
+ zephir_check_call_status();
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, appendCondition)
+static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, checkHighLow)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *store_param = NULL, *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, key, _2, _3, _5, _6, _7, _8, _9, _10, _0$$3, _1$$3, _4$$4;
- zval store, condition;
- zval *this_ptr = getThis();
+ zval *value_param = NULL, *min_param = NULL, *max_param = NULL, _0, _1, _2;
+ zend_long value, min, max, ZEPHIR_LAST_CALL_STATUS;
- ZVAL_UNDEF(&store);
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&key);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_4$$4);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(2, 4)
- Z_PARAM_STR(store)
- Z_PARAM_STR(condition)
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_LONG(value)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ Z_PARAM_LONG(min)
+ Z_PARAM_LONG(max)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 2, &store_param, &condition_param, &value, &type_param);
- zephir_get_strval(&store, store_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
- }
- if (!type_param) {
- type = -1;
+ zephir_fetch_params(1, 1, 2, &value_param, &min_param, &max_param);
+ if (!min_param) {
+ min = 0;
} else {
}
- if (!(ZEPHIR_IS_EMPTY(value))) {
- ZVAL_LONG(&_1$$3, type);
- ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "bindinline", NULL, 0, value, &_1$$3);
- zephir_check_call_status();
- zephir_concat_self(&condition, &_0$$3);
- }
- zephir_read_property(&_2, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_3, &_2, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 327);
- if (ZEPHIR_IS_EMPTY(&_3)) {
- ZEPHIR_INIT_VAR(&_4$$4);
- ZVAL_STRING(&_4$$4, "");
- zephir_update_property_array_multi(this_ptr, SL("store"), &_4$$4, SL("za"), 2, &store);
- }
- zephir_read_property(&_5, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_6, &_5, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 331);
- ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 40, &_6);
+ if (!max_param) {
+ max = 100;
+ } else {
+ }
+ ZVAL_LONG(&_0, value);
+ ZVAL_LONG(&_1, min);
+ ZEPHIR_CALL_FUNCTION(&_2, "max", NULL, 90, &_0, &_1);
zephir_check_call_status();
- zephir_read_property(&_7, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_8, &_7, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 333);
- zephir_array_fetch(&_9, &_8, &key, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 333);
- ZEPHIR_INIT_VAR(&_10);
- ZEPHIR_CONCAT_VV(&_10, &_9, &condition);
- zephir_update_property_array_multi(this_ptr, SL("store"), &_10, SL("zz"), 2, &store, &key);
- ZEPHIR_MM_RESTORE();
+ ZVAL_LONG(&_0, max);
+ ZEPHIR_RETURN_CALL_FUNCTION("min", NULL, 91, &_0, &_2);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, processValue)
+
+
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+
+
+
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_AdapterInterface)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *store_param = NULL, *data = NULL, data_sub, _0$$3, _1$$4, _2$$4, _3$$4;
- zval store;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_INTERFACE(Phalcon\\Image\\Adapter, AdapterInterface, phalcon, image_adapter_adapterinterface, phalcon_image_adapter_adapterinterface_method_entry);
- ZVAL_UNDEF(&store);
- ZVAL_UNDEF(&data_sub);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$4);
- ZVAL_UNDEF(&_2$$4);
- ZVAL_UNDEF(&_3$$4);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(store)
- Z_PARAM_ZVAL(data)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &store_param, &data);
- zephir_get_strval(&store, store_param);
- ZEPHIR_SEPARATE_PARAM(data);
- if (Z_TYPE_P(data) == IS_STRING) {
- ZEPHIR_INIT_VAR(&_0$$3);
- zephir_create_array(&_0$$3, 1, 0);
- zephir_array_fast_append(&_0$$3, data);
- ZEPHIR_CPY_WRT(data, &_0$$3);
- }
- if (Z_TYPE_P(data) == IS_ARRAY) {
- ZEPHIR_INIT_VAR(&_1$$4);
- zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch(&_3$$4, &_2$$4, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 350);
- zephir_fast_array_merge(&_1$$4, &_3$$4, data);
- zephir_update_property_array(this_ptr, SL("store"), &store, &_1$$4);
- }
- ZEPHIR_MM_RESTORE();
+ return SUCCESS;
}
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, background);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, blur);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, crop);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, flip);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, mask);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, pixelate);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, reflection);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, render);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, resize);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, rotate);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, save);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, sharpen);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, text);
+ZEPHIR_DOC_METHOD(Phalcon_Image_Adapter_AdapterInterface, watermark);
@@ -165253,254 +163282,520 @@ static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, processValue)
-ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Query_AbstractQuery)
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_Gd)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\DataMapper\\Query, AbstractQuery, phalcon, datamapper_query_abstractquery, phalcon_datamapper_query_abstractquery_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-
- zend_declare_property_null(phalcon_datamapper_query_abstractquery_ce, SL("bind"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_datamapper_query_abstractquery_ce, SL("connection"), ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_datamapper_query_abstractquery_ce, SL("store"), ZEND_ACC_PROTECTED);
- phalcon_datamapper_query_abstractquery_ce->create_object = zephir_init_properties_Phalcon_DataMapper_Query_AbstractQuery;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Image\\Adapter, Gd, phalcon, image_adapter_gd, phalcon_image_adapter_abstractadapter_ce, phalcon_image_adapter_gd_method_entry, 0);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, __construct)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct)
{
+ zend_bool _26$$13;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, *bind, bind_sub, _0, _1;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *width_param = NULL, *height_param = NULL, __$true, imageInfo, _0, _1$$3, _2$$3, _3$$3, _8$$3, _25$$3, _4$$4, _5$$4, _6$$4, _7$$4, _9$$5, _10$$5, _11$$6, _12$$6, _13$$7, _14$$7, _15$$8, _16$$8, _17$$9, _18$$9, _19$$10, _20$$10, _21$$11, _22$$12, _23$$12, _24$$12, _30$$13, _31$$13, _32$$13, _33$$13, _34$$13, _35$$13, _27$$14, _28$$14, _29$$14;
+ zval file;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&bind_sub);
+ ZVAL_UNDEF(&file);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&imageInfo);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_datamapper_pdo_connection_ce)
- Z_PARAM_OBJECT_OF_CLASS(bind, phalcon_datamapper_query_bind_ce)
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_25$$3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_11$$6);
+ ZVAL_UNDEF(&_12$$6);
+ ZVAL_UNDEF(&_13$$7);
+ ZVAL_UNDEF(&_14$$7);
+ ZVAL_UNDEF(&_15$$8);
+ ZVAL_UNDEF(&_16$$8);
+ ZVAL_UNDEF(&_17$$9);
+ ZVAL_UNDEF(&_18$$9);
+ ZVAL_UNDEF(&_19$$10);
+ ZVAL_UNDEF(&_20$$10);
+ ZVAL_UNDEF(&_21$$11);
+ ZVAL_UNDEF(&_22$$12);
+ ZVAL_UNDEF(&_23$$12);
+ ZVAL_UNDEF(&_24$$12);
+ ZVAL_UNDEF(&_30$$13);
+ ZVAL_UNDEF(&_31$$13);
+ ZVAL_UNDEF(&_32$$13);
+ ZVAL_UNDEF(&_33$$13);
+ ZVAL_UNDEF(&_34$$13);
+ ZVAL_UNDEF(&_35$$13);
+ ZVAL_UNDEF(&_27$$14);
+ ZVAL_UNDEF(&_28$$14);
+ ZVAL_UNDEF(&_29$$14);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(file)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG_OR_NULL(width, is_null_true)
+ Z_PARAM_LONG_OR_NULL(height, is_null_true)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &connection, &bind);
- zephir_update_property_zval(this_ptr, ZEND_STRL("bind"), bind);
- zephir_update_property_zval(this_ptr, ZEND_STRL("connection"), connection);
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "UNION");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "reset", NULL, 0);
+ zephir_fetch_params(1, 1, 2, &file_param, &width_param, &height_param);
+ zephir_get_strval(&file, file_param);
+ if (!width_param) {
+ width = 0;
+ } else {
+ }
+ if (!height_param) {
+ height = 0;
+ } else {
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "check", NULL, 361);
zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("file"), &file);
+ ZVAL_UNDEF(&_0);
+ ZVAL_LONG(&_0, 0);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ if (1 == (zephir_file_exists(&_0) == SUCCESS)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_2$$3, "realpath", NULL, 74, &_1$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_2$$3);
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&imageInfo, "getimagesize", NULL, 311, &_3$$3);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(&imageInfo)) {
+ zephir_array_fetch_long(&_4$$4, &imageInfo, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 42);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_4$$4);
+ zephir_array_fetch_long(&_5$$4, &imageInfo, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 43);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_5$$4);
+ zephir_array_fetch_long(&_6$$4, &imageInfo, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 44);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_6$$4);
+ zephir_array_fetch_string(&_7$$4, &imageInfo, SL("mime"), PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 45);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_7$$4);
+ }
+ zephir_memory_observe(&_8$$3);
+ zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("type"), PH_NOISY_CC);
+ do {
+ if (ZEPHIR_IS_LONG(&_8$$3, 1)) {
+ zephir_read_property(&_9$$5, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_10$$5, "imagecreatefromgif", NULL, 362, &_9$$5);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_10$$5);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_8$$3, 2) || ZEPHIR_IS_LONG(&_8$$3, 9)) {
+ zephir_read_property(&_11$$6, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_12$$6, "imagecreatefromjpeg", NULL, 363, &_11$$6);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_12$$6);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_8$$3, 3)) {
+ zephir_read_property(&_13$$7, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_14$$7, "imagecreatefrompng", NULL, 364, &_13$$7);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_14$$7);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_8$$3, 18)) {
+ zephir_read_property(&_15$$8, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_16$$8, "imagecreatefromwebp", NULL, 365, &_15$$8);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_16$$8);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_8$$3, 15)) {
+ zephir_read_property(&_17$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_18$$9, "imagecreatefromwbmp", NULL, 366, &_17$$9);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_18$$9);
+ break;
+ }
+ if (ZEPHIR_IS_LONG(&_8$$3, 16)) {
+ zephir_read_property(&_19$$10, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_20$$10, "imagecreatefromxbm", NULL, 367, &_19$$10);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_20$$10);
+ break;
+ }
+ zephir_read_property(&_21$$11, this_ptr, ZEND_STRL("mime"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_is_true(&_21$$11)) {
+ ZEPHIR_INIT_VAR(&_22$$12);
+ object_init_ex(&_22$$12, phalcon_image_exception_ce);
+ zephir_read_property(&_23$$12, this_ptr, ZEND_STRL("mime"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_24$$12);
+ ZEPHIR_CONCAT_SVS(&_24$$12, "Installed GD does not support ", &_23$$12, " images");
+ ZEPHIR_CALL_METHOD(NULL, &_22$$12, "__construct", NULL, 33, &_24$$12);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_22$$12, "phalcon/Image/Adapter/Gd.zep", 78);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Installed GD does not support such images", "phalcon/Image/Adapter/Gd.zep", 83);
+ return;
+ } while(0);
+
+ zephir_read_property(&_25$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 368, &_25$$3, &__$true);
+ zephir_check_call_status();
+ } else {
+ _26$$13 = 0 == width;
+ if (!(_26$$13)) {
+ _26$$13 = 0 == height;
+ }
+ if (_26$$13) {
+ ZEPHIR_INIT_VAR(&_27$$14);
+ object_init_ex(&_27$$14, phalcon_image_exception_ce);
+ zephir_read_property(&_28$$14, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_29$$14);
+ ZEPHIR_CONCAT_SV(&_29$$14, "Failed to create image from file ", &_28$$14);
+ ZEPHIR_CALL_METHOD(NULL, &_27$$14, "__construct", NULL, 33, &_29$$14);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_27$$14, "phalcon/Image/Adapter/Gd.zep", 91);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ ZVAL_LONG(&_30$$13, width);
+ ZVAL_LONG(&_31$$13, height);
+ ZEPHIR_CALL_FUNCTION(&_32$$13, "imagecreatetruecolor", NULL, 369, &_30$$13, &_31$$13);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_32$$13);
+ zephir_read_property(&_30$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 370, &_30$$13, &__$true);
+ zephir_check_call_status();
+ zephir_read_property(&_31$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 368, &_31$$13, &__$true);
+ zephir_check_call_status();
+ zephir_read_property(&_33$$13, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_33$$13);
+ ZVAL_UNDEF(&_34$$13);
+ ZVAL_LONG(&_34$$13, width);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_34$$13);
+ ZVAL_UNDEF(&_34$$13);
+ ZVAL_LONG(&_34$$13, height);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_34$$13);
+ ZVAL_UNDEF(&_34$$13);
+ ZVAL_LONG(&_34$$13, 3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_34$$13);
+ ZEPHIR_INIT_VAR(&_35$$13);
+ ZEPHIR_INIT_NVAR(&_35$$13);
+ ZVAL_STRING(&_35$$13, "image/png");
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_35$$13);
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, bindInline)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, __destruct)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub, *type_param = NULL, _0, _1;
+ zval __$null, image, _0;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
+ ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&_0);
+ ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
+ zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&image, &_0);
+ if (Z_TYPE_P(&image) != IS_NULL) {
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &image);
+ zephir_check_call_status();
+ }
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &__$null);
+ ZEPHIR_MM_RESTORE();
+}
+
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, getVersion)
+{
+ zval info, matches, version, _0, _1, _2$$5, _3$$5, _4$$5, _5$$5;
+ zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+
+ ZVAL_UNDEF(&info);
+ ZVAL_UNDEF(&matches);
+ ZVAL_UNDEF(&version);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ZVAL(value)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(type)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_2$$5);
+ ZVAL_UNDEF(&_3$$5);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$5);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &value, &type_param);
- if (!type_param) {
- type = -1;
+
+ if (1 != (zephir_function_exists_ex(ZEND_STRL("gd_info")) == SUCCESS)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "GD is either not installed or not enabled, check your configuration", "phalcon/Image/Adapter/Gd.zep", 134);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&version);
+ ZVAL_NULL(&version);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "GD_VERSION");
+ ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 118, &_0);
+ zephir_check_call_status();
+ if (zephir_is_true(&_1)) {
+ ZEPHIR_INIT_NVAR(&version);
+ ZEPHIR_GET_CONSTANT(&version, "GD_VERSION");
} else {
+ ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 372);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&matches);
+ ZVAL_NULL(&matches);
+ zephir_array_fetch_string(&_2$$5, &info, SL("GD Version"), PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 148);
+ ZEPHIR_INIT_VAR(&_3$$5);
+ ZVAL_STRING(&_3$$5, "/\\d+\\.\\d+(?:\\.\\d+)?/");
+ ZEPHIR_INIT_VAR(&_4$$5);
+ ZEPHIR_INIT_VAR(&_5$$5);
+ ZVAL_STRING(&_5$$5, "/\\d+\\.\\d+(?:\\.\\d+)?/");
+ zephir_preg_match(&_4$$5, &_5$$5, &_2$$5, &matches, 0, 0 , 0 );
+ if (zephir_is_true(&_4$$5)) {
+ ZEPHIR_OBS_NVAR(&version);
+ zephir_array_fetch_long(&version, &matches, 0, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 152);
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_1, type);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "bindinline", NULL, 0, value, &_1);
- zephir_check_call_status();
- RETURN_MM();
+ }
+ RETURN_CCTOR(&version);
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, bindValue)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, *type_param = NULL, _0, _1;
- zval key;
+ zval *red_param = NULL, *green_param = NULL, *blue_param = NULL, *opacity_param = NULL, __$true, background, color, copy, image, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
+ zend_long red, green, blue, opacity, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&background);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(©);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(type)
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_LONG(red)
+ Z_PARAM_LONG(green)
+ Z_PARAM_LONG(blue)
+ Z_PARAM_LONG(opacity)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &key_param, &value, &type_param);
- zephir_get_strval(&key, key_param);
- if (!type_param) {
- type = -1;
- } else {
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_1, type);
- ZEPHIR_CALL_METHOD(NULL, &_0, "setvalue", NULL, 0, &key, value, &_1);
+ zephir_fetch_params(1, 4, 0, &red_param, &green_param, &blue_param, &opacity_param);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127)));
+ ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 284, &_1);
zephir_check_call_status();
- RETURN_THIS();
+ zephir_round(&_0, &_2, NULL, NULL);
+ opacity = zephir_get_intval(&_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&image, &_1);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&background, this_ptr, "processcreate", NULL, 0, &_1, &_3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_4, red);
+ ZVAL_LONG(&_5, green);
+ ZVAL_LONG(&_6, blue);
+ ZVAL_LONG(&_7, opacity);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 373, &background, &_4, &_5, &_6, &_7);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 370, &background, &__$true);
+ zephir_check_call_status();
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_5, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_6, 0);
+ ZVAL_LONG(&_7, 0);
+ ZVAL_LONG(&_8, 0);
+ ZVAL_LONG(&_9, 0);
+ ZEPHIR_CALL_FUNCTION(©, "imagecopy", NULL, 374, &background, &image, &_6, &_7, &_8, &_9, &_4, &_5);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(©)) {
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &background);
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, bindValues)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBlur)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *values_param = NULL, _0;
- zval values;
+ zephir_fcall_cache_entry *_2 = NULL;
+ zval *radius_param = NULL, _0$$3, _1$$3;
+ zend_long radius, ZEPHIR_LAST_CALL_STATUS, counter = 0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&values);
- ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(values)
+ Z_PARAM_LONG(radius)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &values_param);
- zephir_get_arrval(&values, values_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "setvalues", NULL, 0, &values);
- zephir_check_call_status();
- RETURN_THIS();
+ zephir_fetch_params(1, 1, 0, &radius_param);
+ counter = 0;
+ while (1) {
+ if (!(counter < radius)) {
+ break;
+ }
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1$$3, 7);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_2, 375, &_0$$3, &_1$$3);
+ zephir_check_call_status();
+ counter++;
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, getBindValues)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processCreate)
{
- zval _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
+ zval *width_param = NULL, *height_param = NULL, __$false, __$true, image, _0, _1;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0);
+ zephir_fetch_params(1, 2, 0, &width_param, &height_param);
+ ZVAL_LONG(&_0, width);
+ ZVAL_LONG(&_1, height);
+ ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 369, &_0, &_1);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, getStatement)
-{
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 370, &image, &__$false);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 368, &image, &__$true);
+ zephir_check_call_status();
+ RETURN_CCTOR(&image);
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, perform)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processCrop)
{
- zval _0, _1, _2;
+ zval rect;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, image, _0, _1, _2, _3, _4;
+ zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&rect);
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ Z_PARAM_LONG(offsetX)
+ Z_PARAM_LONG(offsetY)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(&_1, this_ptr, "getstatement", NULL, 0);
+ zephir_fetch_params(1, 4, 0, &width_param, &height_param, &offsetX_param, &offsetY_param);
+ ZEPHIR_INIT_VAR(&rect);
+ zephir_create_array(&rect, 4, 0);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_LONG(&_0, offsetX);
+ zephir_array_update_string(&rect, SL("x"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, offsetY);
+ zephir_array_update_string(&rect, SL("y"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, width);
+ zephir_array_update_string(&rect, SL("width"), &_0, PH_COPY | PH_SEPARATE);
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, height);
+ zephir_array_update_string(&rect, SL("height"), &_0, PH_COPY | PH_SEPARATE);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&image, "imagecrop", NULL, 376, &_1, &rect);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "getbindvalues", NULL, 0);
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &_2);
zephir_check_call_status();
- ZEPHIR_RETURN_CALL_METHOD(&_0, "perform", NULL, 0, &_1, &_2);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 377, &image);
zephir_check_call_status();
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3);
+ ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 378, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, setFlag)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processFlip)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_bool enable;
- zval *flag_param = NULL, *enable_param = NULL, __$true, flags, _0$$4, _1$$4;
- zval flag;
+ zval *direction_param = NULL, _0$$3, _1$$3, _2$$4, _3$$4;
+ zend_long direction, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&flag);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&flags);
- ZVAL_UNDEF(&_0$$4);
- ZVAL_UNDEF(&_1$$4);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(flag)
- Z_PARAM_OPTIONAL
- Z_PARAM_BOOL(enable)
+ ZVAL_UNDEF(&_0$$3);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(direction)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &flag_param, &enable_param);
- zephir_get_strval(&flag, flag_param);
- if (!enable_param) {
- enable = 1;
- } else {
- }
- if (enable) {
- zephir_update_property_array_multi(this_ptr, SL("store"), &__$true, SL("sz"), 3, SL("FLAGS"), &flag);
+ zephir_fetch_params(1, 1, 0, &direction_param);
+ if (direction == 11) {
+ zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1$$3, 1);
+ ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 379, &_0$$3, &_1$$3);
+ zephir_check_call_status();
} else {
- zephir_read_property(&_0$$4, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_memory_observe(&flags);
- zephir_array_fetch_string(&flags, &_0$$4, SL("FLAGS"), PH_NOISY, "phalcon/DataMapper/Query/AbstractQuery.zep", 144);
- zephir_array_unset(&flags, &flag, PH_SEPARATE);
- ZEPHIR_INIT_VAR(&_1$$4);
- ZVAL_STRING(&_1$$4, "FLAGS");
- zephir_update_property_array(this_ptr, SL("store"), &_1$$4, &flags);
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_3$$4, 2);
+ ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 379, &_2$$4, &_3$$4);
+ zephir_check_call_status();
}
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, quoteIdentifier)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, *type_param = NULL, _0, _1;
- zval name;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&name);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(name)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(type)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &name_param, &type_param);
- zephir_get_strval(&name, name_param);
- if (!type_param) {
- type = 2;
- } else {
- }
- zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_1, type);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "quote", NULL, 0, &name, &_1);
- zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, reset)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask)
{
- zval _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17;
+ zend_bool _9;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_23 = NULL, *_24 = NULL, *_29 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS, alpha = 0, maskHeight = 0, maskWidth = 0, x = 0, y = 0;
+ zval *mask, mask_sub, __$true, blue, color, index, green, maskImage, newImage, red, tempImage, _0, _1, _2, _3, _4, _5, _6, _7, _8, _10$$3, _11$$3, _12$$3, _13$$3, _14$$3, _15$$3, _16$$3, _17$$3, _18$$3, _19$$3, _20$$4, _21$$5, _22$$5, _27$$5, _28$$5, _25$$6, _26$$6;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&mask_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&blue);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&index);
+ ZVAL_UNDEF(&green);
+ ZVAL_UNDEF(&maskImage);
+ ZVAL_UNDEF(&newImage);
+ ZVAL_UNDEF(&red);
+ ZVAL_UNDEF(&tempImage);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
@@ -165510,346 +163805,1073 @@ static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, reset)
ZVAL_UNDEF(&_6);
ZVAL_UNDEF(&_7);
ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_11);
- ZVAL_UNDEF(&_12);
- ZVAL_UNDEF(&_13);
- ZVAL_UNDEF(&_14);
- ZVAL_UNDEF(&_15);
- ZVAL_UNDEF(&_16);
- ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_13$$3);
+ ZVAL_UNDEF(&_14$$3);
+ ZVAL_UNDEF(&_15$$3);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_17$$3);
+ ZVAL_UNDEF(&_18$$3);
+ ZVAL_UNDEF(&_19$$3);
+ ZVAL_UNDEF(&_20$$4);
+ ZVAL_UNDEF(&_21$$5);
+ ZVAL_UNDEF(&_22$$5);
+ ZVAL_UNDEF(&_27$$5);
+ ZVAL_UNDEF(&_28$$5);
+ ZVAL_UNDEF(&_25$$6);
+ ZVAL_UNDEF(&_26$$6);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(mask, phalcon_image_adapter_adapterinterface_ce)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "COLUMNS");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
- ZEPHIR_INIT_VAR(&_2);
- array_init(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "FLAGS");
- zephir_update_property_array(this_ptr, SL("store"), &_3, &_2);
- ZEPHIR_INIT_VAR(&_4);
- array_init(&_4);
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, "FROM");
- zephir_update_property_array(this_ptr, SL("store"), &_5, &_4);
- ZEPHIR_INIT_VAR(&_6);
- array_init(&_6);
- ZEPHIR_INIT_VAR(&_7);
- ZVAL_STRING(&_7, "GROUP");
- zephir_update_property_array(this_ptr, SL("store"), &_7, &_6);
- ZEPHIR_INIT_VAR(&_8);
- array_init(&_8);
- ZEPHIR_INIT_VAR(&_9);
- ZVAL_STRING(&_9, "HAVING");
- zephir_update_property_array(this_ptr, SL("store"), &_9, &_8);
- ZEPHIR_INIT_VAR(&_10);
- ZVAL_STRING(&_10, "LIMIT");
- ZEPHIR_INIT_VAR(&_11);
- ZVAL_LONG(&_11, 0);
- zephir_update_property_array(this_ptr, SL("store"), &_10, &_11);
- ZEPHIR_INIT_VAR(&_12);
- array_init(&_12);
- ZEPHIR_INIT_VAR(&_13);
- ZVAL_STRING(&_13, "ORDER");
- zephir_update_property_array(this_ptr, SL("store"), &_13, &_12);
- ZEPHIR_INIT_VAR(&_14);
- ZVAL_STRING(&_14, "OFFSET");
- ZEPHIR_INIT_VAR(&_15);
- ZVAL_LONG(&_15, 0);
- zephir_update_property_array(this_ptr, SL("store"), &_14, &_15);
- ZEPHIR_INIT_VAR(&_16);
- array_init(&_16);
- ZEPHIR_INIT_VAR(&_17);
- ZVAL_STRING(&_17, "WHERE");
- zephir_update_property_array(this_ptr, SL("store"), &_17, &_16);
+ zephir_fetch_params(1, 1, 0, &mask);
+ ZEPHIR_CALL_METHOD(&_0, mask, "render", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 380, &_0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 377, &maskImage);
+ zephir_check_call_status();
+ maskWidth = zephir_get_intval(&_1);
+ ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 378, &maskImage);
+ zephir_check_call_status();
+ maskHeight = zephir_get_intval(&_2);
+ alpha = 127;
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 368, &maskImage, &__$true);
+ zephir_check_call_status();
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&newImage, this_ptr, "processcreate", NULL, 0, &_3, &_4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 368, &newImage, &__$true);
+ zephir_check_call_status();
+ ZVAL_LONG(&_5, 0);
+ ZVAL_LONG(&_6, 0);
+ ZVAL_LONG(&_7, 0);
+ ZVAL_LONG(&_8, alpha);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 373, &newImage, &_5, &_6, &_7, &_8);
+ zephir_check_call_status();
+ ZVAL_LONG(&_5, 0);
+ ZVAL_LONG(&_6, 0);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 381, &newImage, &_5, &_6, &color);
+ zephir_check_call_status();
+ zephir_read_property(&_5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ _9 = !ZEPHIR_IS_LONG_IDENTICAL(&_5, maskWidth);
+ if (!(_9)) {
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ _9 = !ZEPHIR_IS_LONG_IDENTICAL(&_6, maskHeight);
+ }
+ if (_9) {
+ zephir_read_property(&_10$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&tempImage, "imagecreatetruecolor", NULL, 369, &_10$$3, &_11$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_12$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_13$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_14$$3, 0);
+ ZVAL_LONG(&_15$$3, 0);
+ ZVAL_LONG(&_16$$3, 0);
+ ZVAL_LONG(&_17$$3, 0);
+ ZVAL_LONG(&_18$$3, maskWidth);
+ ZVAL_LONG(&_19$$3, maskHeight);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 382, &tempImage, &maskImage, &_14$$3, &_15$$3, &_16$$3, &_17$$3, &_12$$3, &_13$$3, &_18$$3, &_19$$3);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &maskImage);
+ zephir_check_call_status();
+ ZEPHIR_CPY_WRT(&maskImage, &tempImage);
+ }
+ x = 0;
+ while (1) {
+ zephir_read_property(&_7, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ if (!(ZEPHIR_GT_LONG(&_7, x))) {
+ break;
+ }
+ y = 0;
+ while (1) {
+ zephir_read_property(&_20$$4, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if (!(ZEPHIR_GT_LONG(&_20$$4, y))) {
+ break;
+ }
+ ZVAL_LONG(&_21$$5, x);
+ ZVAL_LONG(&_22$$5, y);
+ ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 383, &maskImage, &_21$$5, &_22$$5);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 384, &maskImage, &index);
+ zephir_check_call_status();
+ if (1 == zephir_array_isset_string(&color, SL("red"))) {
+ zephir_array_fetch_string(&_25$$6, &color, SL("red"), PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 348);
+ ZVAL_DOUBLE(&_26$$6, zephir_safe_div_zval_long(&_25$$6, 2));
+ alpha = (127 - zephir_get_intval(&_26$$6));
+ }
+ zephir_read_property(&_21$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_22$$5, x);
+ ZVAL_LONG(&_27$$5, y);
+ ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 383, &_21$$5, &_22$$5, &_27$$5);
+ zephir_check_call_status();
+ zephir_read_property(&_22$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 384, &_22$$5, &index);
+ zephir_check_call_status();
+ ZEPHIR_OBS_NVAR(&red);
+ zephir_array_fetch_string(&red, &color, SL("red"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 353);
+ ZEPHIR_OBS_NVAR(&green);
+ zephir_array_fetch_string(&green, &color, SL("green"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 354);
+ ZEPHIR_OBS_NVAR(&blue);
+ zephir_array_fetch_string(&blue, &color, SL("blue"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 355);
+ ZVAL_LONG(&_27$$5, alpha);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 373, &newImage, &red, &green, &blue, &_27$$5);
+ zephir_check_call_status();
+ ZVAL_LONG(&_27$$5, x);
+ ZVAL_LONG(&_28$$5, y);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_29, 385, &newImage, &_27$$5, &_28$$5, &color);
+ zephir_check_call_status();
+ y++;
+ }
+ x++;
+ }
+ zephir_read_property(&_8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &_8);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &maskImage);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &newImage);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetColumns)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processPixelate)
{
- zval _0, _1;
+ zend_bool _3$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_8 = NULL, *_10 = NULL;
+ zval *amount_param = NULL, color, x2, y2, _0, _1$$3, _2$$4, _4$$4, _5$$4, _6$$4, _7$$4, _9$$4;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS, x = 0, x1 = 0, y = 0, y1 = 0;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&x2);
+ ZVAL_UNDEF(&y2);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(amount)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "COLUMNS");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ x = 0;
+ while (1) {
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ if (!(ZEPHIR_GT_LONG(&_0, x))) {
+ break;
+ }
+ y = 0;
+ while (1) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ if (!(ZEPHIR_GT_LONG(&_1$$3, y))) {
+ break;
+ }
+ x1 = ((x + (zephir_safe_div_long_long(amount, 2))));
+ y1 = ((y + (zephir_safe_div_long_long(amount, 2))));
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ _3$$4 = ZEPHIR_LE_LONG(&_2$$4, x1);
+ if (!(_3$$4)) {
+ zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ _3$$4 = ZEPHIR_LE_LONG(&_4$$4, y1);
+ }
+ if (_3$$4) {
+ break;
+ }
+ zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_6$$4, x1);
+ ZVAL_LONG(&_7$$4, y1);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorat", &_8, 383, &_5$$4, &_6$$4, &_7$$4);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&x2);
+ ZVAL_LONG(&x2, (x + amount));
+ ZEPHIR_INIT_NVAR(&y2);
+ ZVAL_LONG(&y2, (y + amount));
+ zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_7$$4, x);
+ ZVAL_LONG(&_9$$4, y);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_10, 386, &_6$$4, &_7$$4, &_9$$4, &x2, &y2, &color);
+ zephir_check_call_status();
+ y += amount;
+ }
+ x += amount;
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetFrom)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection)
{
- zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_25 = NULL;
+ zend_bool fadeIn;
+ zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, line, reflection, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _27, _28, _11$$5, _12$$5, _17$$5, _18$$5, _19$$5, _20$$5, _21$$5, _22$$5, _23$$5, _24$$5, _26$$5, _13$$6, _14$$6, _15$$7, _16$$7;
+ zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS, destinationY = 0, destinationOpacity = 0, offset = 0, stepping = 0, sourceY = 0;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&line);
+ ZVAL_UNDEF(&reflection);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_27);
+ ZVAL_UNDEF(&_28);
+ ZVAL_UNDEF(&_11$$5);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_17$$5);
+ ZVAL_UNDEF(&_18$$5);
+ ZVAL_UNDEF(&_19$$5);
+ ZVAL_UNDEF(&_20$$5);
+ ZVAL_UNDEF(&_21$$5);
+ ZVAL_UNDEF(&_22$$5);
+ ZVAL_UNDEF(&_23$$5);
+ ZVAL_UNDEF(&_24$$5);
+ ZVAL_UNDEF(&_26$$5);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$6);
+ ZVAL_UNDEF(&_15$$7);
+ ZVAL_UNDEF(&_16$$7);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_LONG(height)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_BOOL(fadeIn)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
+ zephir_fetch_params(1, 3, 0, &height_param, &opacity_param, &fadeIn_param);
ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "FROM");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
+ ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127)));
+ ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 284, &_1);
+ zephir_check_call_status();
+ zephir_round(&_0, &_2, NULL, NULL);
+ opacity = zephir_get_intval(&_0);
+ if (opacity < 127) {
+ stepping = (long) (zephir_safe_div_long_long(((127 - opacity)), height));
+ } else {
+ stepping = (long) (zephir_safe_div_long_long(127, height));
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_4, (zephir_get_numberval(&_3) + height));
+ ZEPHIR_CALL_METHOD(&reflection, this_ptr, "processcreate", NULL, 0, &_1, &_4);
+ zephir_check_call_status();
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_6, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_7, 0);
+ ZVAL_LONG(&_8, 0);
+ ZVAL_LONG(&_9, 0);
+ ZVAL_LONG(&_10, 0);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 374, &reflection, &_4, &_7, &_8, &_9, &_10, &_5, &_6);
+ zephir_check_call_status();
+ offset = 0;
+ while (1) {
+ if (!(height >= offset)) {
+ break;
+ }
+ zephir_read_property(&_11$$5, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ sourceY = ((zephir_get_numberval(&_11$$5) - offset) - 1);
+ zephir_read_property(&_12$$5, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ destinationY = (zephir_get_numberval(&_12$$5) + offset);
+ if (fadeIn) {
+ ZEPHIR_INIT_NVAR(&_13$$6);
+ ZVAL_LONG(&_14$$6, (opacity + ((stepping * ((height - offset))))));
+ zephir_round(&_13$$6, &_14$$6, NULL, NULL);
+ destinationOpacity = zephir_get_intval(&_13$$6);
+ } else {
+ ZEPHIR_INIT_NVAR(&_15$$7);
+ ZVAL_LONG(&_16$$7, (opacity + ((stepping * offset))));
+ zephir_round(&_15$$7, &_16$$7, NULL, NULL);
+ destinationOpacity = zephir_get_intval(&_15$$7);
+ }
+ zephir_read_property(&_17$$5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_18$$5, 1);
+ ZEPHIR_CALL_METHOD(&line, this_ptr, "processcreate", NULL, 0, &_17$$5, &_18$$5);
+ zephir_check_call_status();
+ zephir_read_property(&_18$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_19$$5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_20$$5, 0);
+ ZVAL_LONG(&_21$$5, 0);
+ ZVAL_LONG(&_22$$5, 0);
+ ZVAL_LONG(&_23$$5, sourceY);
+ ZVAL_LONG(&_24$$5, 1);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 374, &line, &_18$$5, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_19$$5, &_24$$5);
+ zephir_check_call_status();
+ ZVAL_LONG(&_20$$5, 4);
+ ZVAL_LONG(&_21$$5, 0);
+ ZVAL_LONG(&_22$$5, 0);
+ ZVAL_LONG(&_23$$5, 0);
+ ZVAL_LONG(&_24$$5, destinationOpacity);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_25, 375, &line, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_24$$5);
+ zephir_check_call_status();
+ zephir_read_property(&_20$$5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_21$$5, 0);
+ ZVAL_LONG(&_22$$5, destinationY);
+ ZVAL_LONG(&_23$$5, 0);
+ ZVAL_LONG(&_24$$5, 0);
+ ZVAL_LONG(&_26$$5, 1);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 374, &reflection, &line, &_21$$5, &_22$$5, &_23$$5, &_24$$5, &_20$$5, &_26$$5);
+ zephir_check_call_status();
+ offset++;
+ }
+ zephir_read_property(&_7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &_7);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &reflection);
+ ZEPHIR_CALL_FUNCTION(&_27, "imagesx", NULL, 377, &reflection);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_27);
+ ZEPHIR_CALL_FUNCTION(&_28, "imagesy", NULL, 378, &reflection);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_28);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetWhere)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processRender)
{
- zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *extension_param = NULL, *quality_param = NULL, __$null, _0, _1$$3, _2$$4, _3$$4, _4$$5, _5$$6, _6$$7, _7$$8, _8$$9;
+ zval extension, _9$$9;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&_9$$9);
+ ZVAL_NULL(&__$null);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_7$$8);
+ ZVAL_UNDEF(&_8$$9);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(extension)
+ Z_PARAM_LONG(quality)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
+ zephir_fetch_params(1, 2, 0, &extension_param, &quality_param);
+ zephir_get_strval(&extension, extension_param);
ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "WHERE");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
- ZEPHIR_MM_RESTORE();
+ zephir_fast_strtolower(&_0, &extension);
+ zephir_get_strval(&extension, &_0);
+ ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 387);
+ zephir_check_call_status();
+ do {
+ if (ZEPHIR_IS_STRING(&extension, "gif")) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 388, &_1$$3);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "jpg") || ZEPHIR_IS_STRING(&extension, "jpeg")) {
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_3$$4, quality);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 389, &_2$$4, &__$null, &_3$$4);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "png")) {
+ zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 390, &_4$$5);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "wbmp")) {
+ zephir_read_property(&_5$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 391, &_5$$6);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "webp")) {
+ zephir_read_property(&_6$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagewebp", NULL, 392, &_6$$7);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "xbm")) {
+ zephir_read_property(&_7$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 393, &_7$$8, &__$null);
+ zephir_check_call_status();
+ break;
+ }
+ ZEPHIR_INIT_VAR(&_8$$9);
+ object_init_ex(&_8$$9, phalcon_image_exception_ce);
+ ZEPHIR_INIT_VAR(&_9$$9);
+ ZEPHIR_CONCAT_SVS(&_9$$9, "Installed GD does not support '", &extension, "' images");
+ ZEPHIR_CALL_METHOD(NULL, &_8$$9, "__construct", NULL, 33, &_9$$9);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_8$$9, "phalcon/Image/Adapter/Gd.zep", 552);
+ ZEPHIR_MM_RESTORE();
+ return;
+ } while(0);
+
+ ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 394);
+ zephir_check_call_status();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetGroupBy)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processResize)
{
- zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *width_param = NULL, *height_param = NULL, image, _0, _1, _2, _3, _4;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "GROUP");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
+ zephir_fetch_params(1, 2, 0, &width_param, &height_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, width);
+ ZVAL_LONG(&_2, height);
+ ZEPHIR_CALL_FUNCTION(&image, "imagescale", NULL, 395, &_0, &_1, &_2);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &_1);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 377, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3);
+ ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 378, &image);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetHaving)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processRotate)
{
- zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *degrees_param = NULL, __$true, copy, height, image, transparent, width, _0, _1, _2, _3, _4, _5, _6, _7, _8$$3;
+ zend_long degrees, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(©);
+ ZVAL_UNDEF(&height);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&transparent);
+ ZVAL_UNDEF(&width);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(degrees)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "HAVING");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
+ zephir_fetch_params(1, 1, 0, °rees_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, 0);
+ ZVAL_LONG(&_2, 0);
+ ZVAL_LONG(&_3, 0);
+ ZVAL_LONG(&_4, 127);
+ ZEPHIR_CALL_FUNCTION(&transparent, "imagecolorallocatealpha", NULL, 373, &_0, &_1, &_2, &_3, &_4);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_2, (360 - degrees));
+ ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 396, &_1, &_2, &transparent);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 368, &image, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 377, &image);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 378, &image);
+ zephir_check_call_status();
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_3, 0);
+ ZVAL_LONG(&_4, 0);
+ ZVAL_LONG(&_5, 0);
+ ZVAL_LONG(&_6, 0);
+ ZVAL_LONG(&_7, 100);
+ ZEPHIR_CALL_FUNCTION(©, "imagecopymerge", NULL, 397, &_2, &image, &_3, &_4, &_5, &_6, &width, &height, &_7);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_FALSE_IDENTICAL(©)) {
+ zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &_8$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &width);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &height);
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetOrderBy)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave)
{
- zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *quality_param = NULL, __$false, extension, _0, _2, _15, _1$$3, _3$$4, _4$$5, _5$$6, _6$$6, _7$$6, _8$$7, _9$$8, _10$$9, _11$$10, _12$$11, _13$$12, _14$$12;
+ zval file;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&file);
+ ZVAL_BOOL(&__$false, 0);
+ ZVAL_UNDEF(&extension);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_UNDEF(&_5$$6);
+ ZVAL_UNDEF(&_6$$6);
+ ZVAL_UNDEF(&_7$$6);
+ ZVAL_UNDEF(&_8$$7);
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_UNDEF(&_10$$9);
+ ZVAL_UNDEF(&_11$$10);
+ ZVAL_UNDEF(&_12$$11);
+ ZVAL_UNDEF(&_13$$12);
+ ZVAL_UNDEF(&_14$$12);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(file)
+ Z_PARAM_LONG(quality)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &file_param, &quality_param);
+ zephir_get_strval(&file, file_param);
+ ZVAL_LONG(&_0, 4);
+ ZEPHIR_CALL_FUNCTION(&extension, "pathinfo", NULL, 89, &file, &_0);
+ zephir_check_call_status();
+ if (1 == ZEPHIR_IS_EMPTY(&extension)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&extension, "image_type_to_extension", NULL, 398, &_1$$3, &__$false);
+ zephir_check_call_status();
+ }
+ ZEPHIR_INIT_VAR(&_2);
+ zephir_fast_strtolower(&_2, &extension);
+ ZEPHIR_CPY_WRT(&extension, &_2);
+ do {
+ if (ZEPHIR_IS_STRING(&extension, "gif")) {
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_LONG(&_3$$4, 1);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_3$$4);
+ zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 388, &_3$$4, &file);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "jpg") || ZEPHIR_IS_STRING(&extension, "jpeg")) {
+ ZVAL_UNDEF(&_4$$5);
+ ZVAL_LONG(&_4$$5, 2);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_4$$5);
+ if (quality >= 0) {
+ ZVAL_LONG(&_6$$6, quality);
+ ZVAL_LONG(&_7$$6, 1);
+ ZEPHIR_CALL_METHOD(&_5$$6, this_ptr, "checkhighlow", NULL, 0, &_6$$6, &_7$$6);
+ zephir_check_call_status();
+ quality = zephir_get_numberval(&_5$$6);
+ zephir_read_property(&_6$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_7$$6, quality);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 389, &_6$$6, &file, &_7$$6);
+ zephir_check_call_status();
+ } else {
+ zephir_read_property(&_8$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 389, &_8$$7, &file);
+ zephir_check_call_status();
+ }
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "png")) {
+ ZVAL_UNDEF(&_9$$8);
+ ZVAL_LONG(&_9$$8, 3);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_9$$8);
+ zephir_read_property(&_9$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 390, &_9$$8, &file);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "wbmp")) {
+ ZVAL_UNDEF(&_10$$9);
+ ZVAL_LONG(&_10$$9, 15);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_10$$9);
+ zephir_read_property(&_10$$9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 391, &_10$$9, &file);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "webp")) {
+ ZVAL_UNDEF(&_11$$10);
+ ZVAL_LONG(&_11$$10, 18);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_11$$10);
+ zephir_read_property(&_11$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagewebp", NULL, 392, &_11$$10, &file);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "xbm")) {
+ ZVAL_UNDEF(&_12$$11);
+ ZVAL_LONG(&_12$$11, 16);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_12$$11);
+ zephir_read_property(&_12$$11, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 393, &_12$$11, &file);
+ zephir_check_call_status();
+ break;
+ }
+ ZEPHIR_INIT_VAR(&_13$$12);
+ object_init_ex(&_13$$12, phalcon_image_exception_ce);
+ ZEPHIR_INIT_VAR(&_14$$12);
+ ZEPHIR_CONCAT_SVS(&_14$$12, "Installed GD does not support '", &extension, "' images");
+ ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", NULL, 33, &_14$$12);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_13$$12, "phalcon/Image/Adapter/Gd.zep", 679);
+ ZEPHIR_MM_RESTORE();
+ return;
+ } while(0);
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "ORDER");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
- ZEPHIR_MM_RESTORE();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_15, "image_type_to_mime_type", NULL, 399, &_0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_15);
+ RETURN_MM_BOOL(1);
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetLimit)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSharpen)
{
- zval _0, _1, _2, _3;
+ zval matrix, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zval *amount_param = NULL, result, _0, _1, _2, _4, _5, _6, _7, _8$$3, _9$$3, _10$$3, _11$$3;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&matrix);
ZVAL_UNDEF(&_3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(amount)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
+ zephir_fetch_params(1, 1, 0, &amount_param);
ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "LIMIT");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_LONG(&_1, 0);
- zephir_update_property_array(this_ptr, SL("store"), &_0, &_1);
- ZEPHIR_INIT_VAR(&_2);
- ZVAL_STRING(&_2, "OFFSET");
+ ZVAL_LONG(&_1, (-18 + ((amount * 0.08))));
+ ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 284, &_1);
+ zephir_check_call_status();
+ ZVAL_LONG(&_1, 2);
+ zephir_round(&_0, &_2, &_1, NULL);
+ amount = zephir_get_intval(&_0);
+ ZEPHIR_INIT_VAR(&matrix);
+ zephir_create_array(&matrix, 3, 0);
ZEPHIR_INIT_VAR(&_3);
- ZVAL_LONG(&_3, 0);
- zephir_update_property_array(this_ptr, SL("store"), &_2, &_3);
+ zephir_create_array(&_3, 3, 0);
+ ZEPHIR_INIT_VAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ zephir_array_fast_append(&matrix, &_3);
+ ZEPHIR_INIT_NVAR(&_3);
+ zephir_create_array(&_3, 3, 0);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, amount);
+ zephir_array_fast_append(&_3, &_4);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ zephir_array_fast_append(&matrix, &_3);
+ ZEPHIR_INIT_NVAR(&_3);
+ zephir_create_array(&_3, 3, 0);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ ZEPHIR_INIT_NVAR(&_4);
+ ZVAL_LONG(&_4, -1);
+ zephir_array_fast_append(&_3, &_4);
+ zephir_array_fast_append(&matrix, &_3);
+ zephir_read_property(&_5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_6, (amount - 8));
+ ZVAL_LONG(&_7, 0);
+ ZEPHIR_CALL_FUNCTION(&result, "imageconvolution", NULL, 400, &_5, &matrix, &_6, &_7);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_9$$3, "imagesx", NULL, 377, &_8$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_9$$3);
+ zephir_read_property(&_10$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_11$$3, "imagesy", NULL, 378, &_10$$3);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_11$$3);
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, resetFlags)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processText)
{
- zval _0, _1;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long opacity, red, green, blue, size, ZEPHIR_LAST_CALL_STATUS, angle = 0, bottomLeftX = 0, bottomLeftY = 0, topRightX = 0, topRightY = 0, _0, _1;
+ zval *text_param = NULL, *offsetX = NULL, offsetX_sub, *offsetY = NULL, offsetY_sub, *opacity_param = NULL, *red_param = NULL, *green_param = NULL, *blue_param = NULL, *size_param = NULL, *fontFile_param = NULL, color, height, space, width, _2, _3, _4, _5$$3, _6$$3, _11$$3, _12$$3, _19$$3, _20$$3, _21$$3, _7$$5, _8$$5, _9$$5, _10$$5, _13$$6, _14$$6, _15$$6, _16$$7, _17$$7, _18$$7, _22$$8, _23$$8, _30$$8, _31$$8, _32$$8, _33$$8, _24$$9, _25$$9, _26$$9, _27$$10, _28$$10, _29$$10;
+ zval text, fontFile;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&fontFile);
+ ZVAL_UNDEF(&offsetX_sub);
+ ZVAL_UNDEF(&offsetY_sub);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&height);
+ ZVAL_UNDEF(&space);
+ ZVAL_UNDEF(&width);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_12$$3);
+ ZVAL_UNDEF(&_19$$3);
+ ZVAL_UNDEF(&_20$$3);
+ ZVAL_UNDEF(&_21$$3);
+ ZVAL_UNDEF(&_7$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_13$$6);
+ ZVAL_UNDEF(&_14$$6);
+ ZVAL_UNDEF(&_15$$6);
+ ZVAL_UNDEF(&_16$$7);
+ ZVAL_UNDEF(&_17$$7);
+ ZVAL_UNDEF(&_18$$7);
+ ZVAL_UNDEF(&_22$$8);
+ ZVAL_UNDEF(&_23$$8);
+ ZVAL_UNDEF(&_30$$8);
+ ZVAL_UNDEF(&_31$$8);
+ ZVAL_UNDEF(&_32$$8);
+ ZVAL_UNDEF(&_33$$8);
+ ZVAL_UNDEF(&_24$$9);
+ ZVAL_UNDEF(&_25$$9);
+ ZVAL_UNDEF(&_26$$9);
+ ZVAL_UNDEF(&_27$$10);
+ ZVAL_UNDEF(&_28$$10);
+ ZVAL_UNDEF(&_29$$10);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(8, 9)
+ Z_PARAM_STR(text)
+ Z_PARAM_ZVAL(offsetX)
+ Z_PARAM_ZVAL(offsetY)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_LONG(red)
+ Z_PARAM_LONG(green)
+ Z_PARAM_LONG(blue)
+ Z_PARAM_LONG(size)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(fontFile)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&_0);
- array_init(&_0);
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "FLAGS");
- zephir_update_property_array(this_ptr, SL("store"), &_1, &_0);
+ zephir_fetch_params(1, 8, 1, &text_param, &offsetX, &offsetY, &opacity_param, &red_param, &green_param, &blue_param, &size_param, &fontFile_param);
+ zephir_get_strval(&text, text_param);
+ ZEPHIR_SEPARATE_PARAM(offsetX);
+ ZEPHIR_SEPARATE_PARAM(offsetY);
+ if (!fontFile_param) {
+ ZEPHIR_INIT_VAR(&fontFile);
+ } else {
+ zephir_get_strval(&fontFile, fontFile_param);
+ }
+ bottomLeftX = 0;
+ bottomLeftY = 0;
+ topRightX = 0;
+ topRightY = 0;
+ _0 = zephir_get_intval(offsetX);
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, _0);
+ _1 = zephir_get_intval(offsetY);
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, _1);
+ ZEPHIR_INIT_VAR(&_2);
+ ZVAL_DOUBLE(&_3, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127)));
+ ZEPHIR_CALL_FUNCTION(&_4, "abs", NULL, 284, &_3);
+ zephir_check_call_status();
+ zephir_round(&_2, &_4, NULL, NULL);
+ opacity = zephir_get_intval(&_2);
+ ZEPHIR_INIT_VAR(&width);
+ if (1 != ZEPHIR_IS_EMPTY(&fontFile)) {
+ ZVAL_LONG(&_5$$3, size);
+ ZVAL_LONG(&_6$$3, 0);
+ ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 401, &_5$$3, &_6$$3, &fontFile, &text);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&space)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Call to imagettfbbox() failed", "phalcon/Image/Adapter/Gd.zep", 758);
+ return;
+ }
+ if (1 == zephir_array_isset_long(&space, 0)) {
+ zephir_memory_observe(&_7$$5);
+ zephir_array_fetch_long(&_7$$5, &space, 0, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 762);
+ bottomLeftX = zephir_get_intval(&_7$$5);
+ zephir_memory_observe(&_8$$5);
+ zephir_array_fetch_long(&_8$$5, &space, 1, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 763);
+ bottomLeftY = zephir_get_intval(&_8$$5);
+ zephir_memory_observe(&_9$$5);
+ zephir_array_fetch_long(&_9$$5, &space, 4, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 764);
+ topRightX = zephir_get_intval(&_9$$5);
+ zephir_memory_observe(&_10$$5);
+ zephir_array_fetch_long(&_10$$5, &space, 5, PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 765);
+ topRightY = zephir_get_intval(&_10$$5);
+ }
+ ZVAL_LONG(&_5$$3, (topRightX - bottomLeftX));
+ ZEPHIR_CALL_FUNCTION(&_11$$3, "abs", NULL, 284, &_5$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&width, (zephir_get_numberval(&_11$$3) + 10));
+ ZVAL_LONG(&_5$$3, (topRightY - bottomLeftY));
+ ZEPHIR_CALL_FUNCTION(&_12$$3, "abs", NULL, 284, &_5$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&height);
+ ZVAL_LONG(&height, (zephir_get_numberval(&_12$$3) + 10));
+ if (ZEPHIR_LT_LONG(offsetX, 0)) {
+ zephir_read_property(&_13$$6, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_14$$6);
+ zephir_sub_function(&_14$$6, &_13$$6, &width);
+ ZEPHIR_INIT_VAR(&_15$$6);
+ zephir_add_function(&_15$$6, &_14$$6, offsetX);
+ ZEPHIR_CPY_WRT(offsetX, &_15$$6);
+ }
+ if (ZEPHIR_LT_LONG(offsetY, 0)) {
+ zephir_read_property(&_16$$7, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_17$$7);
+ zephir_sub_function(&_17$$7, &_16$$7, &height);
+ ZEPHIR_INIT_VAR(&_18$$7);
+ zephir_add_function(&_18$$7, &_17$$7, offsetY);
+ ZEPHIR_CPY_WRT(offsetY, &_18$$7);
+ }
+ zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_6$$3, red);
+ ZVAL_LONG(&_19$$3, green);
+ ZVAL_LONG(&_20$$3, blue);
+ ZVAL_LONG(&_21$$3, opacity);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 373, &_5$$3, &_6$$3, &_19$$3, &_20$$3, &_21$$3);
+ zephir_check_call_status();
+ angle = 0;
+ zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_19$$3, size);
+ ZVAL_LONG(&_20$$3, angle);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 402, &_6$$3, &_19$$3, &_20$$3, offsetX, offsetY, &color, &fontFile, &text);
+ zephir_check_call_status();
+ } else {
+ ZVAL_LONG(&_22$$8, size);
+ ZEPHIR_CALL_FUNCTION(&_23$$8, "imagefontwidth", NULL, 403, &_22$$8);
+ zephir_check_call_status();
+ ZVAL_LONG(&width, (zephir_get_numberval(&_23$$8) * zephir_fast_strlen_ev(&text)));
+ ZVAL_LONG(&_22$$8, size);
+ ZEPHIR_CALL_FUNCTION(&height, "imagefontheight", NULL, 404, &_22$$8);
+ zephir_check_call_status();
+ if (ZEPHIR_LT_LONG(offsetX, 0)) {
+ zephir_read_property(&_24$$9, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_25$$9);
+ zephir_sub_function(&_25$$9, &_24$$9, &width);
+ ZEPHIR_INIT_VAR(&_26$$9);
+ zephir_add_function(&_26$$9, &_25$$9, offsetX);
+ ZEPHIR_CPY_WRT(offsetX, &_26$$9);
+ }
+ if (ZEPHIR_LT_LONG(offsetY, 0)) {
+ zephir_read_property(&_27$$10, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_28$$10);
+ zephir_sub_function(&_28$$10, &_27$$10, &height);
+ ZEPHIR_INIT_VAR(&_29$$10);
+ zephir_add_function(&_29$$10, &_28$$10, offsetY);
+ ZEPHIR_CPY_WRT(offsetY, &_29$$10);
+ }
+ zephir_read_property(&_22$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_30$$8, red);
+ ZVAL_LONG(&_31$$8, green);
+ ZVAL_LONG(&_32$$8, blue);
+ ZVAL_LONG(&_33$$8, opacity);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 373, &_22$$8, &_30$$8, &_31$$8, &_32$$8, &_33$$8);
+ zephir_check_call_status();
+ zephir_read_property(&_30$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_31$$8, size);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 405, &_30$$8, &_31$$8, offsetX, offsetY, &text, &color);
+ zephir_check_call_status();
+ }
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, buildFlags)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark)
{
- zval _0, _1, _2, _3, _4, _5;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS, height = 0, width = 0;
+ zval *watermark, watermark_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, __$true, color, copy, overlay, _0, _1, _2, _9, _10, _11, _12, _13, _14, _15, _16, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&watermark_sub);
+ ZVAL_BOOL(&__$true, 1);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(©);
+ ZVAL_UNDEF(&overlay);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_12);
+ ZVAL_UNDEF(&_13);
+ ZVAL_UNDEF(&_14);
+ ZVAL_UNDEF(&_15);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_OBJECT_OF_CLASS(watermark, phalcon_image_adapter_adapterinterface_ce)
+ Z_PARAM_LONG(offsetX)
+ Z_PARAM_LONG(offsetY)
+ Z_PARAM_LONG(opacity)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("FLAGS"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractQuery.zep", 255);
- if (ZEPHIR_IS_EMPTY(&_1)) {
- RETURN_MM_STRING("");
+ zephir_fetch_params(1, 4, 0, &watermark, &offsetX_param, &offsetY_param, &opacity_param);
+ ZEPHIR_CALL_METHOD(&_0, watermark, "render", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 380, &_0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 368, &overlay, &__$true);
+ zephir_check_call_status();
+ ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 377, &overlay);
+ zephir_check_call_status();
+ width = zephir_get_intval(&_1);
+ ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 378, &overlay);
+ zephir_check_call_status();
+ height = zephir_get_intval(&_2);
+ if (opacity < 100) {
+ ZEPHIR_INIT_VAR(&_3$$3);
+ ZVAL_DOUBLE(&_4$$3, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127)));
+ ZEPHIR_CALL_FUNCTION(&_5$$3, "abs", NULL, 284, &_4$$3);
+ zephir_check_call_status();
+ zephir_round(&_3$$3, &_5$$3, NULL, NULL);
+ opacity = zephir_get_intval(&_3$$3);
+ ZVAL_LONG(&_4$$3, 127);
+ ZVAL_LONG(&_6$$3, 127);
+ ZVAL_LONG(&_7$$3, 127);
+ ZVAL_LONG(&_8$$3, opacity);
+ ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 373, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_4$$3, 3);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 406, &overlay, &_4$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_4$$3, 0);
+ ZVAL_LONG(&_6$$3, 0);
+ ZVAL_LONG(&_7$$3, width);
+ ZVAL_LONG(&_8$$3, height);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", NULL, 386, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, &color);
+ zephir_check_call_status();
}
- ZEPHIR_INIT_VAR(&_2);
- ZEPHIR_INIT_VAR(&_3);
- zephir_read_property(&_4, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_5, &_4, SL("FLAGS"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractQuery.zep", 259);
- zephir_array_keys(&_3, &_5);
- zephir_fast_join_str(&_2, SL(" "), &_3);
- ZEPHIR_CONCAT_SV(return_value, " ", &_2);
- RETURN_MM();
+ zephir_read_property(&_9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 370, &_9, &__$true);
+ zephir_check_call_status();
+ zephir_read_property(&_10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_11, offsetX);
+ ZVAL_LONG(&_12, offsetY);
+ ZVAL_LONG(&_13, 0);
+ ZVAL_LONG(&_14, 0);
+ ZVAL_LONG(&_15, width);
+ ZVAL_LONG(&_16, height);
+ ZEPHIR_CALL_FUNCTION(©, "imagecopy", NULL, 374, &_10, &overlay, &_11, &_12, &_13, &_14, &_15, &_16);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_TRUE_IDENTICAL(©)) {
+ ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 371, &overlay);
+ zephir_check_call_status();
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, buildReturning)
+static PHP_METHOD(Phalcon_Image_Adapter_Gd, check)
{
- zval _0, _1, _2, _3, _4, _5;
+ zval version, _0, _1, _2, _3$$3, _4$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
+ ZVAL_UNDEF(&version);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("RETURNING"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractQuery.zep", 269);
- if (ZEPHIR_IS_EMPTY(&_1)) {
- RETURN_MM_STRING("");
- }
- zephir_read_property(&_3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_4, &_3, SL("RETURNING"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractQuery.zep", 273);
- ZEPHIR_INIT_VAR(&_5);
- ZVAL_STRING(&_5, ",");
- ZEPHIR_CALL_METHOD(&_2, this_ptr, "indent", NULL, 0, &_4, &_5);
+ ZEPHIR_CALL_METHOD(&version, this_ptr, "getversion", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CONCAT_SV(return_value, " RETURNING", &_2);
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_AbstractQuery, indent)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval glue, _1;
- zval *collection_param = NULL, *glue_param = NULL, _0;
- zval collection;
-
- ZVAL_UNDEF(&collection);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&glue);
- ZVAL_UNDEF(&_1);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(collection)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(glue)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &collection_param, &glue_param);
- zephir_get_arrval(&collection, collection_param);
- if (!glue_param) {
- ZEPHIR_INIT_VAR(&glue);
- ZVAL_STRING(&glue, "");
- } else {
- zephir_get_strval(&glue, glue_param);
- }
- if (ZEPHIR_IS_EMPTY(&collection)) {
- RETURN_MM_STRING("");
- }
ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "2.0.1");
ZEPHIR_INIT_VAR(&_1);
- ZEPHIR_CONCAT_VS(&_1, &glue, " ");
- zephir_fast_join(&_0, &_1, &collection);
- ZEPHIR_CONCAT_SV(return_value, " ", &_0);
- RETURN_MM();
-}
-
-zend_object *zephir_init_properties_Phalcon_DataMapper_Query_AbstractQuery(zend_class_entry *class_type)
-{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("store"), &_1$$3);
- }
+ ZVAL_STRING(&_1, ">=");
+ ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 134, &version, &_0, &_1);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_2)) {
+ ZEPHIR_INIT_VAR(&_3$$3);
+ object_init_ex(&_3$$3, phalcon_image_exception_ce);
+ ZEPHIR_INIT_VAR(&_4$$3);
+ ZEPHIR_CONCAT_SSV(&_4$$3, "Phalcon\\Image\\Adapter\\GD requires GD ", "version '2.0.1' or greater, you have ", &version);
+ ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 33, &_4$$3);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_3$$3, "phalcon/Image/Adapter/Gd.zep", 898);
ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ return;
}
+ ZEPHIR_MM_RESTORE();
}
@@ -165862,1116 +164884,1767 @@ zend_object *zephir_init_properties_Phalcon_DataMapper_Query_AbstractQuery(zend_
-ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Query_Bind)
+ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_Imagick)
{
- ZEPHIR_REGISTER_CLASS(Phalcon\\DataMapper\\Query, Bind, phalcon, datamapper_query_bind, phalcon_datamapper_query_bind_method_entry, 0);
-
- zend_declare_property_long(phalcon_datamapper_query_bind_ce, SL("inlineCount"), 0, ZEND_ACC_PROTECTED);
- zend_declare_property_null(phalcon_datamapper_query_bind_ce, SL("store"), ZEND_ACC_PROTECTED);
- phalcon_datamapper_query_bind_ce->create_object = zephir_init_properties_Phalcon_DataMapper_Query_Bind;
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Image\\Adapter, Imagick, phalcon, image_adapter_imagick, phalcon_image_adapter_abstractadapter_ce, phalcon_image_adapter_imagick_method_entry, 0);
+ zend_declare_property_long(phalcon_image_adapter_imagick_ce, SL("version"), 0, ZEND_ACC_PROTECTED);
return SUCCESS;
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Bind, bindInline)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct)
{
- zend_bool _0;
+ zend_bool _22$$7;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *value, value_sub, *type_param = NULL, key, _3, _4, _5, _1$$3, _2$$4;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *width_param = NULL, *height_param = NULL, image, _0, _1, _32, _33, _34, _35, _36, _37, _38, _39, _40, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _10$$3, _11$$3, _15$$3, _16$$3, _17$$3, _18$$3, _7$$4, _8$$4, _9$$4, _12$$5, _13$$5, _14$$5, _19$$6, _20$$6, _21$$6, _26$$7, _27$$7, _28$$7, _29$$7, _30$$7, _31$$7, _23$$8, _24$$8, _25$$8;
+ zval file;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$4);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ZVAL(value)
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_32);
+ ZVAL_UNDEF(&_33);
+ ZVAL_UNDEF(&_34);
+ ZVAL_UNDEF(&_35);
+ ZVAL_UNDEF(&_36);
+ ZVAL_UNDEF(&_37);
+ ZVAL_UNDEF(&_38);
+ ZVAL_UNDEF(&_39);
+ ZVAL_UNDEF(&_40);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZVAL_UNDEF(&_15$$3);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_17$$3);
+ ZVAL_UNDEF(&_18$$3);
+ ZVAL_UNDEF(&_7$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_13$$5);
+ ZVAL_UNDEF(&_14$$5);
+ ZVAL_UNDEF(&_19$$6);
+ ZVAL_UNDEF(&_20$$6);
+ ZVAL_UNDEF(&_21$$6);
+ ZVAL_UNDEF(&_26$$7);
+ ZVAL_UNDEF(&_27$$7);
+ ZVAL_UNDEF(&_28$$7);
+ ZVAL_UNDEF(&_29$$7);
+ ZVAL_UNDEF(&_30$$7);
+ ZVAL_UNDEF(&_31$$7);
+ ZVAL_UNDEF(&_23$$8);
+ ZVAL_UNDEF(&_24$$8);
+ ZVAL_UNDEF(&_25$$8);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(file)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(type)
+ Z_PARAM_LONG_OR_NULL(width, is_null_true)
+ Z_PARAM_LONG_OR_NULL(height, is_null_true)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &value, &type_param);
- if (!type_param) {
- type = -1;
+ zephir_fetch_params(1, 1, 2, &file_param, &width_param, &height_param);
+ zephir_get_strval(&file, file_param);
+ if (!width_param) {
+ width = 0;
} else {
}
- _0 = Z_TYPE_P(value) == IS_OBJECT;
- if (_0) {
- _0 = zephir_instance_of_ev(value, phalcon_datamapper_query_select_ce);
- }
- if (_0) {
- ZEPHIR_CALL_METHOD(&_1$$3, value, "getstatement", NULL, 0);
+ if (!height_param) {
+ height = 0;
+ } else {
+ }
+ ZEPHIR_CALL_METHOD(NULL, this_ptr, "check", NULL, 407);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("file"), &file);
+ ZEPHIR_INIT_VAR(&_0);
+ object_init_ex(&_0, zephir_get_internal_ce(SL("imagick")));
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_0);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ if (1 == (zephir_file_exists(&_1) == SUCCESS)) {
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_FUNCTION(&_3$$3, "realpath", NULL, 74, &_2$$3);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVS(return_value, "(", &_1$$3, ")");
- RETURN_MM();
- }
- if (Z_TYPE_P(value) == IS_ARRAY) {
- ZVAL_LONG(&_2$$4, type);
- ZEPHIR_RETURN_CALL_METHOD(this_ptr, "inlinearray", NULL, 0, value, &_2$$4);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_3$$3);
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("realpath"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_5$$3, &_4$$3, "readimage", NULL, 0, &_6$$3);
zephir_check_call_status();
- RETURN_MM();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_5$$3)) {
+ ZEPHIR_INIT_VAR(&_7$$4);
+ object_init_ex(&_7$$4, phalcon_image_exception_ce);
+ zephir_read_property(&_8$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_9$$4);
+ ZEPHIR_CONCAT_SVS(&_9$$4, "Imagick::readImage ", &_8$$4, " failed");
+ ZEPHIR_CALL_METHOD(NULL, &_7$$4, "__construct", NULL, 33, &_9$$4);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_7$$4, "phalcon/Image/Adapter/Imagick.zep", 72);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_10$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_11$$3, &_10$$3, "getimagealphachannel", NULL, 0);
+ zephir_check_call_status();
+ if (!zephir_is_true(&_11$$3)) {
+ zephir_read_property(&_12$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_13$$5);
+ ZVAL_STRING(&_13$$5, "Imagick::ALPHACHANNEL_SET");
+ ZEPHIR_CALL_FUNCTION(&_14$$5, "constant", NULL, 119, &_13$$5);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_12$$5, "setimagealphachannel", NULL, 0, &_14$$5);
+ zephir_check_call_status();
+ }
+ zephir_read_property(&_15$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_16$$3, &_15$$3, "getimagetype", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_16$$3);
+ zephir_read_property(&_17$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_18$$3, &_17$$3, "getimagetype", NULL, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_LONG(&_18$$3, 1)) {
+ zephir_read_property(&_19$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&image, &_19$$6, "coalesceimages", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_20$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_20$$6, "clear", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_21$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_21$$6, "destroy", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ }
+ } else {
+ _22$$7 = 0 == width;
+ if (!(_22$$7)) {
+ _22$$7 = 0 == height;
+ }
+ if (_22$$7) {
+ ZEPHIR_INIT_VAR(&_23$$8);
+ object_init_ex(&_23$$8, phalcon_image_exception_ce);
+ zephir_read_property(&_24$$8, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_25$$8);
+ ZEPHIR_CONCAT_SV(&_25$$8, "Failed to create image from file ", &_24$$8);
+ ZEPHIR_CALL_METHOD(NULL, &_23$$8, "__construct", NULL, 33, &_25$$8);
+ zephir_check_call_status();
+ zephir_throw_exception_debug(&_23$$8, "phalcon/Image/Adapter/Imagick.zep", 97);
+ ZEPHIR_MM_RESTORE();
+ return;
+ }
+ zephir_read_property(&_26$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_27$$7);
+ object_init_ex(&_27$$7, zephir_get_internal_ce(SL("imagickpixel")));
+ ZEPHIR_INIT_VAR(&_28$$7);
+ ZVAL_STRING(&_28$$7, "transparent");
+ ZEPHIR_CALL_METHOD(NULL, &_27$$7, "__construct", NULL, 0, &_28$$7);
+ zephir_check_call_status();
+ ZVAL_LONG(&_29$$7, width);
+ ZVAL_LONG(&_30$$7, height);
+ ZEPHIR_CALL_METHOD(NULL, &_26$$7, "newimage", NULL, 0, &_29$$7, &_30$$7, &_27$$7);
+ zephir_check_call_status();
+ zephir_read_property(&_29$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_28$$7);
+ ZVAL_STRING(&_28$$7, "png");
+ ZEPHIR_CALL_METHOD(NULL, &_29$$7, "setformat", NULL, 0, &_28$$7);
+ zephir_check_call_status();
+ zephir_read_property(&_30$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_28$$7);
+ ZVAL_STRING(&_28$$7, "png");
+ ZEPHIR_CALL_METHOD(NULL, &_30$$7, "setimageformat", NULL, 0, &_28$$7);
+ zephir_check_call_status();
+ zephir_read_property(&_31$$7, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_31$$7);
}
- zephir_read_property(&_3, this_ptr, ZEND_STRL("inlineCount"), PH_NOISY_CC | PH_READONLY);
- ZVAL_UNDEF(&_4);
- ZVAL_LONG(&_4, (zephir_get_numberval(&_3) + 1));
- zephir_update_property_zval(this_ptr, ZEND_STRL("inlineCount"), &_4);
- zephir_read_property(&_4, this_ptr, ZEND_STRL("inlineCount"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_VAR(&key);
- ZEPHIR_CONCAT_SVS(&key, "__", &_4, "__");
- ZVAL_LONG(&_5, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvalue", NULL, 0, &key, value, &_5);
+ zephir_read_property(&_32, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_33, &_32, "getimagewidth", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CONCAT_SV(return_value, ":", &key);
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Bind, remove)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *key_param = NULL, store, _0;
- zval key;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&store);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(key)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &key_param);
- zephir_get_strval(&key, key_param);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CPY_WRT(&store, &_0);
- zephir_array_unset(&store, &key, PH_SEPARATE);
- zephir_update_property_zval(this_ptr, ZEND_STRL("store"), &store);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_33);
+ zephir_read_property(&_34, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_35, &_34, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_35);
+ zephir_read_property(&_36, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_37, &_36, "getimagetype", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_37);
+ zephir_read_property(&_38, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_39, &_38, "getimageformat", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_40);
+ ZEPHIR_CONCAT_SV(&_40, "image/", &_39);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_40);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Bind, setValue)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __destruct)
{
- zval _0;
+ zval _0, _1$$3, _2$$3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *key_param = NULL, *value, value_sub, *type_param = NULL, localType;
- zval key;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value_sub);
- ZVAL_UNDEF(&localType);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(2, 3)
- Z_PARAM_STR(key)
- Z_PARAM_ZVAL(value)
- Z_PARAM_OPTIONAL
- Z_PARAM_LONG(type)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 1, &key_param, &value, &type_param);
- zephir_get_strval(&key, key_param);
- if (!type_param) {
- type = -1;
- } else {
- }
- ZEPHIR_INIT_VAR(&localType);
- ZVAL_LONG(&localType, type);
- if (ZEPHIR_IS_LONG_IDENTICAL(&localType, -1)) {
- ZEPHIR_CALL_METHOD(&localType, this_ptr, "gettype", NULL, 0, value);
+
+ zephir_memory_observe(&_0);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC);
+ if (zephir_is_instance_of(&_0, SL("Imagick"))) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "clear", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$3, "destroy", NULL, 0);
zephir_check_call_status();
}
- ZEPHIR_INIT_VAR(&_0);
- zephir_create_array(&_0, 2, 0);
- zephir_array_fast_append(&_0, value);
- zephir_array_fast_append(&_0, &localType);
- zephir_update_property_array(this_ptr, SL("store"), &key, &_0);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Bind, setValues)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, liquidRescale)
{
- zend_string *_3;
- zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *values_param = NULL, *type_param = NULL, key, value, *_0, _1, _4$$3, _6$$4;
- zval values;
+ zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL;
+ zval *width_param = NULL, *height_param = NULL, *deltaX_param = NULL, *rigidity_param = NULL, image, result, _0, _8, _9, _1$$3, _2$$3, _3$$3, _4$$3, _6$$3;
+ zend_long width, height, deltaX, rigidity, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&values);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_8);
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_6$$4);
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_ARRAY(values)
+ ZVAL_UNDEF(&_6$$3);
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(type)
+ Z_PARAM_LONG(deltaX)
+ Z_PARAM_LONG(rigidity)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &values_param, &type_param);
- zephir_get_arrval(&values, values_param);
- if (!type_param) {
- type = -1;
+ zephir_fetch_params(1, 2, 2, &width_param, &height_param, &deltaX_param, &rigidity_param);
+ if (!deltaX_param) {
+ deltaX = 0;
} else {
}
- zephir_is_iterable(&values, 0, "phalcon/DataMapper/Query/Bind.zep", 108);
- if (Z_TYPE_P(&values) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&values), _2, _3, _0)
- {
- ZEPHIR_INIT_NVAR(&key);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&key, _3);
- } else {
- ZVAL_LONG(&key, _2);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- ZVAL_LONG(&_4$$3, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvalue", &_5, 0, &key, &value, &_4$$3);
- zephir_check_call_status();
- } ZEND_HASH_FOREACH_END();
+ if (!rigidity_param) {
+ rigidity = 0;
} else {
- ZEPHIR_CALL_METHOD(NULL, &values, "rewind", NULL, 0);
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&image, &_0);
+ ZVAL_LONG(&_0, 0);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_0);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ ZVAL_LONG(&_1$$3, width);
+ ZVAL_LONG(&_2$$3, height);
+ ZVAL_LONG(&_3$$3, deltaX);
+ ZVAL_LONG(&_4$$3, rigidity);
+ ZEPHIR_CALL_METHOD(&result, &image, "liquidrescaleimage", &_5, 0, &_1$$3, &_2$$3, &_3$$3, &_4$$3);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &values, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&key, &values, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &values, "current", NULL, 0);
- zephir_check_call_status();
- ZVAL_LONG(&_6$$4, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvalue", &_5, 0, &key, &value, &_6$$4);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, &values, "next", NULL, 0);
- zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::liquidRescale failed", "phalcon/Image/Adapter/Imagick.zep", 165);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_6$$3, &image, "nextimage", &_7, 0);
+ zephir_check_call_status();
+ if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$3)) {
+ break;
}
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&key);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Bind, toArray)
-{
-
- RETURN_MEMBER(getThis(), "store");
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Bind, getType)
-{
- zval *value, value_sub;
-
- ZVAL_UNDEF(&value_sub);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ZVAL(value)
- ZEND_PARSE_PARAMETERS_END();
- zephir_fetch_params_without_memory_grow(1, 0, &value);
- if (Z_TYPE_P(value) == IS_NULL) {
- RETURN_LONG(0);
- }
- if (((Z_TYPE_P(value) == IS_TRUE || Z_TYPE_P(value) == IS_FALSE) == 1)) {
- RETURN_LONG(5);
- }
- if (Z_TYPE_P(value) == IS_LONG) {
- RETURN_LONG(1);
- }
- RETURN_LONG(2);
+ ZEPHIR_CALL_METHOD(&_8, &image, "getimagewidth", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_8);
+ ZEPHIR_CALL_METHOD(&_9, &image, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_9);
+ RETURN_THIS();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Bind, inlineArray)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, setResourceLimit)
{
+ zend_bool _0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_5 = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *data_param = NULL, *type_param = NULL, key, value, *_0, _1, _11, _2$$3, _3$$3, _4$$3, _6$$3, _7$$4, _8$$4, _9$$4, _10$$4;
- zval data, keys;
+ zval *type_param = NULL, *limit_param = NULL, _1$$3, _2$$3, _3$$3;
+ zend_long type, limit, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&data);
- ZVAL_UNDEF(&keys);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_11);
+ ZVAL_UNDEF(&_1$$3);
ZVAL_UNDEF(&_2$$3);
ZVAL_UNDEF(&_3$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(&_6$$3);
- ZVAL_UNDEF(&_7$$4);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&_10$$4);
ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_ARRAY(data)
Z_PARAM_LONG(type)
+ Z_PARAM_LONG(limit)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &data_param, &type_param);
- zephir_get_arrval(&data, data_param);
- ZEPHIR_INIT_VAR(&keys);
- array_init(&keys);
- zephir_is_iterable(&data, 0, "phalcon/DataMapper/Query/Bind.zep", 167);
- if (Z_TYPE_P(&data) == IS_ARRAY) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&data), _0)
- {
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("inlineCount"), PH_NOISY_CC | PH_READONLY);
- ZVAL_UNDEF(&_3$$3);
- ZVAL_LONG(&_3$$3, (zephir_get_numberval(&_2$$3) + 1));
- zephir_update_property_zval(this_ptr, ZEND_STRL("inlineCount"), &_3$$3);
- zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("inlineCount"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_NVAR(&key);
- ZEPHIR_CONCAT_SVS(&key, "__", &_3$$3, "__");
- ZVAL_LONG(&_4$$3, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvalue", &_5, 0, &key, &value, &_4$$3);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_6$$3);
- ZEPHIR_CONCAT_SV(&_6$$3, ":", &key);
- zephir_array_append(&keys, &_6$$3, PH_SEPARATE, "phalcon/DataMapper/Query/Bind.zep", 164);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &data, "rewind", NULL, 0);
- zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &data, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&value, &data, "current", NULL, 0);
- zephir_check_call_status();
- zephir_read_property(&_7$$4, this_ptr, ZEND_STRL("inlineCount"), PH_NOISY_CC | PH_READONLY);
- ZVAL_UNDEF(&_8$$4);
- ZVAL_LONG(&_8$$4, (zephir_get_numberval(&_7$$4) + 1));
- zephir_update_property_zval(this_ptr, ZEND_STRL("inlineCount"), &_8$$4);
- zephir_read_property(&_8$$4, this_ptr, ZEND_STRL("inlineCount"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_INIT_NVAR(&key);
- ZEPHIR_CONCAT_SVS(&key, "__", &_8$$4, "__");
- ZVAL_LONG(&_9$$4, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvalue", &_5, 0, &key, &value, &_9$$4);
- zephir_check_call_status();
- ZEPHIR_INIT_NVAR(&_10$$4);
- ZEPHIR_CONCAT_SV(&_10$$4, ":", &key);
- zephir_array_append(&keys, &_10$$4, PH_SEPARATE, "phalcon/DataMapper/Query/Bind.zep", 164);
- ZEPHIR_CALL_METHOD(NULL, &data, "next", NULL, 0);
- zephir_check_call_status();
- }
+ zephir_fetch_params(1, 2, 0, &type_param, &limit_param);
+ _0 = type >= 0;
+ if (_0) {
+ _0 = type <= 6;
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_VAR(&_11);
- zephir_fast_join_str(&_11, SL(", "), &keys);
- ZEPHIR_CONCAT_SVS(return_value, "(", &_11, ")");
- RETURN_MM();
-}
-
-zend_object *zephir_init_properties_Phalcon_DataMapper_Query_Bind(zend_class_entry *class_type)
-{
- zval _0, _1$$3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1$$3);
-
-
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- {
- zval local_this_ptr, *this_ptr = &local_this_ptr;
- ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
- zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- if (Z_TYPE_P(&_0) == IS_NULL) {
- ZEPHIR_INIT_VAR(&_1$$3);
- array_init(&_1$$3);
- zephir_update_property_zval_ex(this_ptr, ZEND_STRL("store"), &_1$$3);
- }
- ZEPHIR_MM_RESTORE();
- return Z_OBJ_P(this_ptr);
+ if (_0) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_2$$3, type);
+ ZVAL_LONG(&_3$$3, limit);
+ ZEPHIR_CALL_METHOD(NULL, &_1$$3, "setresourcelimit", NULL, 0, &_2$$3, &_3$$3);
+ zephir_check_call_status();
+ } else {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Cannot set the Resource Type for this image", "phalcon/Image/Adapter/Imagick.zep", 201);
+ return;
}
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Query_Delete)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\DataMapper\\Query, Delete, phalcon, datamapper_query_delete, phalcon_datamapper_query_abstractconditions_ce, phalcon_datamapper_query_delete_method_entry, 0);
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Delete, __construct)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, *bind, bind_sub, _0, _1, _2, _3;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&bind_sub);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_datamapper_pdo_connection_ce)
- Z_PARAM_OBJECT_OF_CLASS(bind, phalcon_datamapper_query_bind_ce)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &connection, &bind);
- ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_query_delete_ce, getThis(), "__construct", NULL, 0, connection, bind);
- zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "FROM");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- zephir_update_property_array(this_ptr, SL("store"), &_0, &_1);
- ZEPHIR_INIT_VAR(&_2);
- array_init(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "RETURNING");
- zephir_update_property_array(this_ptr, SL("store"), &_3, &_2);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Delete, from)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *table_param = NULL, _0;
- zval table;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&table);
- ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(table)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &table_param);
- zephir_get_strval(&table, table_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "FROM");
- zephir_update_property_array(this_ptr, SL("store"), &_0, &table);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Delete, returning)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *columns_param = NULL, _0, _1, _2, _3;
- zval columns;
+ zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_11 = NULL, *_12 = NULL, *_13 = NULL, *_18 = NULL, *_20 = NULL, *_25 = NULL;
+ zval *red_param = NULL, *green_param = NULL, *blue_param = NULL, *opacity_param = NULL, background, color, pixel1, pixel2, result, _0, _1, _2, _3, _4$$3, _5$$3, _7$$3, _14$$3, _15$$3, _16$$3, _17$$3, _19$$3, _21$$3, _22$$3, _23$$3, _24$$3, _26$$3, _9$$4, _10$$4;
+ zend_long red, green, blue, opacity = 0, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&background);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&pixel1);
+ ZVAL_UNDEF(&pixel2);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(columns)
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_14$$3);
+ ZVAL_UNDEF(&_15$$3);
+ ZVAL_UNDEF(&_16$$3);
+ ZVAL_UNDEF(&_17$$3);
+ ZVAL_UNDEF(&_19$$3);
+ ZVAL_UNDEF(&_21$$3);
+ ZVAL_UNDEF(&_22$$3);
+ ZVAL_UNDEF(&_23$$3);
+ ZVAL_UNDEF(&_24$$3);
+ ZVAL_UNDEF(&_26$$3);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_10$$4);
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_LONG(red)
+ Z_PARAM_LONG(green)
+ Z_PARAM_LONG(blue)
+ Z_PARAM_LONG(opacity)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &columns_param);
- zephir_get_arrval(&columns, columns_param);
+ zephir_fetch_params(1, 4, 0, &red_param, &green_param, &blue_param, &opacity_param);
+ opacity /= 100;
ZEPHIR_INIT_VAR(&_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_2, &_1, SL("RETURNING"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Delete.zep", 63);
- zephir_fast_array_merge(&_0, &_2, &columns);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "RETURNING");
- zephir_update_property_array(this_ptr, SL("store"), &_3, &_0);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Delete, getStatement)
-{
- zval _0, _1, _2, _3, _4, _5;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "buildflags", NULL, 0);
+ ZVAL_STRING(&_0, "rgb(%d, %d, %d)");
+ ZVAL_LONG(&_1, red);
+ ZVAL_LONG(&_2, green);
+ ZVAL_LONG(&_3, blue);
+ ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 117, &_0, &_1, &_2, &_3);
zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_2, &_1, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Delete.zep", 78);
- ZEPHIR_INIT_VAR(&_4);
- ZVAL_STRING(&_4, "WHERE");
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcondition", NULL, 0, &_4);
+ ZEPHIR_INIT_VAR(&pixel1);
+ object_init_ex(&pixel1, zephir_get_internal_ce(SL("imagickpixel")));
+ ZEPHIR_CALL_METHOD(NULL, &pixel1, "__construct", NULL, 0, &color);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&pixel2);
+ object_init_ex(&pixel2, zephir_get_internal_ce(SL("imagickpixel")));
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_STRING(&_0, "transparent");
+ ZEPHIR_CALL_METHOD(NULL, &pixel2, "__construct", NULL, 0, &_0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&background);
+ object_init_ex(&background, zephir_get_internal_ce(SL("imagick")));
+ ZEPHIR_CALL_METHOD(NULL, &background, "__construct", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_2, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &background, "newimage", &_6, 0, &_4$$3, &_5$$3, &pixel1);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_7$$3, &background, "getimagealphachannel", &_8, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_7$$3)) {
+ ZEPHIR_INIT_NVAR(&_9$$4);
+ ZVAL_STRING(&_9$$4, "Imagick::ALPHACHANNEL_SET");
+ ZEPHIR_CALL_FUNCTION(&_10$$4, "constant", &_11, 119, &_9$$4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &background, "setimagealphachannel", &_12, 0, &_10$$4);
+ zephir_check_call_status();
+ }
+ ZEPHIR_CALL_METHOD(NULL, &background, "setimagebackgroundcolor", &_13, 0, &pixel2);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_14$$3);
+ ZVAL_STRING(&_14$$3, "Imagick::EVALUATE_MULTIPLY");
+ ZEPHIR_CALL_FUNCTION(&_15$$3, "constant", &_11, 119, &_14$$3);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_14$$3);
+ ZVAL_STRING(&_14$$3, "Imagick::CHANNEL_ALPHA");
+ ZEPHIR_CALL_FUNCTION(&_16$$3, "constant", &_11, 119, &_14$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_17$$3, opacity);
+ ZEPHIR_CALL_METHOD(NULL, &background, "evaluateimage", &_18, 0, &_15$$3, &_17$$3, &_16$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_17$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_19$$3, &_17$$3, "getcolorspace", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &background, "setcolorspace", &_20, 0, &_19$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_21$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_14$$3);
+ ZVAL_STRING(&_14$$3, "Imagick::COMPOSITE_DISSOLVE");
+ ZEPHIR_CALL_FUNCTION(&_22$$3, "constant", &_11, 119, &_14$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_23$$3, 0);
+ ZVAL_LONG(&_24$$3, 0);
+ ZEPHIR_CALL_METHOD(&result, &background, "compositeimage", &_25, 0, &_21$$3, &_22$$3, &_23$$3, &_24$$3);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 263);
+ return;
+ }
+ zephir_read_property(&_23$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_26$$3, &_23$$3, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_26$$3)) {
+ break;
+ }
+ }
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_2, "clear", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_5, this_ptr, "buildreturning", NULL, 0);
+ zephir_read_property(&_3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_3, "destroy", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVSVVV(return_value, "DELETE", &_0, " FROM ", &_2, &_3, &_5);
- RETURN_MM();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &background);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Delete, reset)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBlur)
{
- zval _0, _1, _2, _3;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *radius_param = NULL, _0, _1, _2$$3, _3$$3, _4$$3, _5$$3;
+ zend_long radius, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(radius)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_query_delete_ce, getThis(), "reset", NULL, 0);
+ zephir_fetch_params(1, 1, 0, &radius_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "setiteratorindex", NULL, 0, &_1);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "FROM");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- zephir_update_property_array(this_ptr, SL("store"), &_0, &_1);
- ZEPHIR_INIT_VAR(&_2);
- array_init(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "RETURNING");
- zephir_update_property_array(this_ptr, SL("store"), &_3, &_2);
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_3$$3, radius);
+ ZVAL_LONG(&_4$$3, 100);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$3, "blurimage", NULL, 0, &_3$$3, &_4$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_5$$3, &_3$$3, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_5$$3)) {
+ break;
+ }
+ }
ZEPHIR_MM_RESTORE();
}
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Query_Insert)
-{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\DataMapper\\Query, Insert, phalcon, datamapper_query_insert, phalcon_datamapper_query_abstractquery_ce, phalcon_datamapper_query_insert_method_entry, 0);
-
- return SUCCESS;
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, __construct)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processCrop)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, *bind, bind_sub, _0, _1, _2, _3;
+ zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL, *_8 = NULL;
+ zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, image, _0, _9, _10, _1$$3, _2$$3, _3$$3, _4$$3, _7$$3;
+ zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
- ZVAL_UNDEF(&bind_sub);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_datamapper_pdo_connection_ce)
- Z_PARAM_OBJECT_OF_CLASS(bind, phalcon_datamapper_query_bind_ce)
+ ZVAL_UNDEF(&_9);
+ ZVAL_UNDEF(&_10);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
+ Z_PARAM_LONG(offsetX)
+ Z_PARAM_LONG(offsetY)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &connection, &bind);
- ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_query_insert_ce, getThis(), "__construct", NULL, 0, connection, bind);
+ zephir_fetch_params(1, 4, 0, &width_param, &height_param, &offsetX_param, &offsetY_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&image, &_0);
+ ZVAL_LONG(&_0, 0);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "FROM");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- zephir_update_property_array(this_ptr, SL("store"), &_0, &_1);
- ZEPHIR_INIT_VAR(&_2);
- array_init(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "RETURNING");
- zephir_update_property_array(this_ptr, SL("store"), &_3, &_2);
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ ZVAL_LONG(&_1$$3, width);
+ ZVAL_LONG(&_2$$3, height);
+ ZVAL_LONG(&_3$$3, offsetX);
+ ZVAL_LONG(&_4$$3, offsetY);
+ ZEPHIR_CALL_METHOD(NULL, &image, "cropimage", &_5, 0, &_1$$3, &_2$$3, &_3$$3, &_4$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_1$$3, width);
+ ZVAL_LONG(&_2$$3, height);
+ ZVAL_LONG(&_3$$3, 0);
+ ZVAL_LONG(&_4$$3, 0);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagepage", &_6, 0, &_1$$3, &_2$$3, &_3$$3, &_4$$3);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_7$$3, &image, "nextimage", &_8, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_7$$3)) {
+ break;
+ }
+ }
+ ZEPHIR_CALL_METHOD(&_9, &image, "getimagewidth", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_9);
+ ZEPHIR_CALL_METHOD(&_10, &image, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_10);
ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, column)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processFlip)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *column_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _1$$3, _2$$3;
- zval column, _0;
+ zval *direction_param = NULL, method, _0, _1, _2$$3, _3$$3, _4$$3;
+ zend_long direction, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&method);
ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2$$3);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(column)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(direction)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &column_param, &value, &type_param);
- zephir_get_strval(&column, column_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
- }
- if (!type_param) {
- type = -1;
+ zephir_fetch_params(1, 1, 0, &direction_param);
+ if (direction == 11) {
+ ZEPHIR_INIT_VAR(&method);
+ ZVAL_STRING(&method, "flipImage");
} else {
+ ZEPHIR_INIT_NVAR(&method);
+ ZVAL_STRING(&method, "flopImage");
+ }
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "setiteratorindex", NULL, 0, &_1);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
}
- ZEPHIR_INIT_VAR(&_0);
- ZEPHIR_CONCAT_SV(&_0, ":", &column);
- zephir_update_property_array_multi(this_ptr, SL("store"), &_0, SL("sz"), 3, SL("COLUMNS"), &column);
- if (Z_TYPE_P(value) != IS_NULL) {
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_2$$3, type);
- ZEPHIR_CALL_METHOD(NULL, &_1$$3, "setvalue", NULL, 0, &column, value, &_2$$3);
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD_ZVAL(NULL, &_2$$3, &method, NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_4$$3, &_3$$3, "nextimage", NULL, 0);
zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_4$$3)) {
+ break;
+ }
}
- RETURN_THIS();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, columns)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processMask)
{
- zend_string *_3;
- zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_4 = NULL;
+ zephir_fcall_cache_entry *_7 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *columns_param = NULL, column, value, *_0, _1;
- zval columns;
+ zval *image, image_sub, mask, result, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3, _8$$3, _9$$3, _10$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&columns);
- ZVAL_UNDEF(&column);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&image_sub);
+ ZVAL_UNDEF(&mask);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(columns)
+ Z_PARAM_OBJECT_OF_CLASS(image, phalcon_image_adapter_adapterinterface_ce)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &columns_param);
- zephir_get_arrval(&columns, columns_param);
- zephir_is_iterable(&columns, 0, "phalcon/DataMapper/Query/Insert.zep", 76);
- if (Z_TYPE_P(&columns) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columns), _2, _3, _0)
- {
- ZEPHIR_INIT_NVAR(&column);
- if (_3 != NULL) {
- ZVAL_STR_COPY(&column, _3);
- } else {
- ZVAL_LONG(&column, _2);
- }
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- if (Z_TYPE_P(&column) == IS_LONG) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "column", &_4, 0, &value);
- zephir_check_call_status();
- } else {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "column", &_4, 0, &column, &value);
- zephir_check_call_status();
- }
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &columns, "rewind", NULL, 0);
+ zephir_fetch_params(1, 1, 0, &image);
+ ZEPHIR_INIT_VAR(&mask);
+ object_init_ex(&mask, zephir_get_internal_ce(SL("imagick")));
+ ZEPHIR_CALL_METHOD(NULL, &mask, "__construct", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_0, image, "render", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &mask, "readimageblob", NULL, 0, &_0);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_2, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_BOOL(&_4$$3, 1);
+ ZEPHIR_CALL_METHOD(NULL, &_3$$3, "setimagematte", NULL, 0, &_4$$3);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_1, &columns, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_1)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&column, &columns, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&value, &columns, "current", NULL, 0);
- zephir_check_call_status();
- if (Z_TYPE_P(&column) == IS_LONG) {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "column", &_4, 0, &value);
- zephir_check_call_status();
- } else {
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "column", &_4, 0, &column, &value);
- zephir_check_call_status();
- }
- ZEPHIR_CALL_METHOD(NULL, &columns, "next", NULL, 0);
- zephir_check_call_status();
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_5$$3);
+ ZVAL_STRING(&_5$$3, "Imagick::COMPOSITE_DSTIN");
+ ZEPHIR_CALL_FUNCTION(&_6$$3, "constant", &_7, 119, &_5$$3);
+ zephir_check_call_status();
+ ZVAL_LONG(&_8$$3, 0);
+ ZVAL_LONG(&_9$$3, 0);
+ ZEPHIR_CALL_METHOD(&result, &_4$$3, "compositeimage", NULL, 0, &mask, &_6$$3, &_8$$3, &_9$$3);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 388);
+ return;
+ }
+ zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_10$$3, &_8$$3, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_10$$3)) {
+ break;
}
}
- ZEPHIR_INIT_NVAR(&value);
- ZEPHIR_INIT_NVAR(&column);
- RETURN_THIS();
+ ZEPHIR_CALL_METHOD(NULL, &mask, "clear", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &mask, "destroy", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, into)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processPixelate)
{
+ double height = 0, width = 0;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *table_param = NULL, _0;
- zval table;
+ zval *amount_param = NULL, _0, _1, _2, _3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3, _9$$3;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&table);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(table)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &table_param);
- zephir_get_strval(&table, table_param);
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "FROM");
- zephir_update_property_array(this_ptr, SL("store"), &_0, &table);
- RETURN_THIS();
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ width = (zephir_safe_div_zval_long(&_0, amount));
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ height = (zephir_safe_div_zval_long(&_1, amount));
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_3, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_2, "setiteratorindex", NULL, 0, &_3);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_DOUBLE(&_5$$3, width);
+ ZVAL_DOUBLE(&_6$$3, height);
+ ZEPHIR_CALL_METHOD(NULL, &_4$$3, "scaleimage", NULL, 0, &_5$$3, &_6$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_7$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_5$$3, "scaleimage", NULL, 0, &_6$$3, &_7$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_9$$3, &_8$$3, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_9$$3)) {
+ break;
+ }
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, getLastInsertId)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *name_param = NULL, _0;
- zval name;
+ zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL, *_11 = NULL, *_13 = NULL, *_14 = NULL, *_20 = NULL, *_23 = NULL, *_26 = NULL, *_33 = NULL, *_36 = NULL, *_38 = NULL, *_41 = NULL, *_46 = NULL, *_53 = NULL;
+ zend_bool fadeIn, _54$$13;
+ zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, fade, image, pixel, pseudo, reflection, result, _0, _4, _16, _17, _28, _29, _30, _56, _57, _58, _59, _60, _1$$3, _2$$4, _3$$4, _6$$5, _8$$5, _9$$5, _10$$5, _12$$5, _15$$5, _18$$7, _19$$7, _21$$7, _22$$7, _24$$7, _25$$7, _27$$7, _31$$10, _32$$10, _34$$10, _35$$10, _37$$10, _39$$10, _40$$10, _42$$10, _43$$10, _44$$10, _45$$10, _47$$10, _48$$13, _49$$13, _50$$13, _51$$13, _52$$13, _55$$13;
+ zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&fade);
+ ZVAL_UNDEF(&image);
+ ZVAL_UNDEF(&pixel);
+ ZVAL_UNDEF(&pseudo);
+ ZVAL_UNDEF(&reflection);
+ ZVAL_UNDEF(&result);
ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR_OR_NULL(name)
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_16);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_28);
+ ZVAL_UNDEF(&_29);
+ ZVAL_UNDEF(&_30);
+ ZVAL_UNDEF(&_56);
+ ZVAL_UNDEF(&_57);
+ ZVAL_UNDEF(&_58);
+ ZVAL_UNDEF(&_59);
+ ZVAL_UNDEF(&_60);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$4);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_6$$5);
+ ZVAL_UNDEF(&_8$$5);
+ ZVAL_UNDEF(&_9$$5);
+ ZVAL_UNDEF(&_10$$5);
+ ZVAL_UNDEF(&_12$$5);
+ ZVAL_UNDEF(&_15$$5);
+ ZVAL_UNDEF(&_18$$7);
+ ZVAL_UNDEF(&_19$$7);
+ ZVAL_UNDEF(&_21$$7);
+ ZVAL_UNDEF(&_22$$7);
+ ZVAL_UNDEF(&_24$$7);
+ ZVAL_UNDEF(&_25$$7);
+ ZVAL_UNDEF(&_27$$7);
+ ZVAL_UNDEF(&_31$$10);
+ ZVAL_UNDEF(&_32$$10);
+ ZVAL_UNDEF(&_34$$10);
+ ZVAL_UNDEF(&_35$$10);
+ ZVAL_UNDEF(&_37$$10);
+ ZVAL_UNDEF(&_39$$10);
+ ZVAL_UNDEF(&_40$$10);
+ ZVAL_UNDEF(&_42$$10);
+ ZVAL_UNDEF(&_43$$10);
+ ZVAL_UNDEF(&_44$$10);
+ ZVAL_UNDEF(&_45$$10);
+ ZVAL_UNDEF(&_47$$10);
+ ZVAL_UNDEF(&_48$$13);
+ ZVAL_UNDEF(&_49$$13);
+ ZVAL_UNDEF(&_50$$13);
+ ZVAL_UNDEF(&_51$$13);
+ ZVAL_UNDEF(&_52$$13);
+ ZVAL_UNDEF(&_55$$13);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_LONG(height)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_BOOL(fadeIn)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &name_param);
- if (!name_param) {
- ZEPHIR_INIT_VAR(&name);
+ zephir_fetch_params(1, 3, 0, &height_param, &opacity_param, &fadeIn_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("version"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&reflection);
+ if (ZEPHIR_GE_LONG(&_0, 30100)) {
+ zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ if (zephir_clone(&reflection, &_1$$3) == FAILURE) {
+ RETURN_MM();
+ }
} else {
- zephir_get_strval(&name, name_param);
+ zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_3$$4, &_2$$4, "clone", NULL, 0);
+ zephir_check_call_status();
+ if (zephir_clone(&reflection, &_3$$4) == FAILURE) {
+ RETURN_MM();
+ }
}
- zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_RETURN_CALL_METHOD(&_0, "lastinsertid", NULL, 0, &name);
+ ZVAL_LONG(&_4, 0);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_4);
zephir_check_call_status();
- RETURN_MM();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, getStatement)
-{
- zval _0, _1, _2, _3, _4;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "buildflags", NULL, 0);
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "flipimage", &_5, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_6$$5, &reflection, "getimagewidth", &_7, 0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_8$$5, height);
+ ZVAL_LONG(&_9$$5, 0);
+ ZVAL_LONG(&_10$$5, 0);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "cropimage", &_11, 0, &_6$$5, &_8$$5, &_9$$5, &_10$$5);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_12$$5, &reflection, "getimagewidth", &_13, 0);
+ zephir_check_call_status();
+ ZVAL_LONG(&_8$$5, height);
+ ZVAL_LONG(&_9$$5, 0);
+ ZVAL_LONG(&_10$$5, 0);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "setimagepage", &_14, 0, &_12$$5, &_8$$5, &_9$$5, &_10$$5);
+ zephir_check_call_status();
+ zephir_read_property(&_8$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_15$$5, &_8$$5, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_15$$5)) {
+ break;
+ }
+ }
+ if (fadeIn) {
+ ZEPHIR_INIT_VAR(&pseudo);
+ ZVAL_STRING(&pseudo, "gradient:black-transparent");
+ } else {
+ ZEPHIR_INIT_NVAR(&pseudo);
+ ZVAL_STRING(&pseudo, "gradient:transparent-black");
+ }
+ ZEPHIR_INIT_VAR(&fade);
+ object_init_ex(&fade, zephir_get_internal_ce(SL("imagick")));
+ ZEPHIR_CALL_METHOD(NULL, &fade, "__construct", NULL, 0);
zephir_check_call_status();
- zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_2, &_1, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Insert.zep", 113);
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 205);
+ ZEPHIR_CALL_METHOD(&_16, &reflection, "getimagewidth", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_4, this_ptr, "buildreturning", NULL, 0);
+ ZEPHIR_CALL_METHOD(&_17, &reflection, "getimageheight", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CONCAT_SVSVVV(return_value, "INSERT", &_0, " INTO ", &_2, &_3, &_4);
- RETURN_MM();
+ ZEPHIR_CALL_METHOD(NULL, &fade, "newpseudoimage", NULL, 0, &_16, &_17, &pseudo);
+ zephir_check_call_status();
+ opacity /= 100;
+ ZVAL_LONG(&_4, 0);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_4);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&_18$$7);
+ ZVAL_STRING(&_18$$7, "Imagick::COMPOSITE_DSTOUT");
+ ZEPHIR_CALL_FUNCTION(&_19$$7, "constant", &_20, 119, &_18$$7);
+ zephir_check_call_status();
+ ZVAL_LONG(&_21$$7, 0);
+ ZVAL_LONG(&_22$$7, 0);
+ ZEPHIR_CALL_METHOD(&result, &reflection, "compositeimage", &_23, 0, &fade, &_19$$7, &_21$$7, &_22$$7);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 495);
+ return;
+ }
+ ZEPHIR_INIT_NVAR(&_18$$7);
+ ZVAL_STRING(&_18$$7, "Imagick::EVALUATE_MULTIPLY");
+ ZEPHIR_CALL_FUNCTION(&_24$$7, "constant", &_20, 119, &_18$$7);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_18$$7);
+ ZVAL_STRING(&_18$$7, "Imagick::CHANNEL_ALPHA");
+ ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_20, 119, &_18$$7);
+ zephir_check_call_status();
+ ZVAL_LONG(&_21$$7, opacity);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "evaluateimage", &_26, 0, &_24$$7, &_21$$7, &_25$$7);
+ zephir_check_call_status();
+ zephir_read_property(&_21$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_27$$7, &_21$$7, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_27$$7)) {
+ break;
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &fade, "destroy", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&image);
+ object_init_ex(&image, zephir_get_internal_ce(SL("imagick")));
+ ZEPHIR_CALL_METHOD(NULL, &image, "__construct", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&pixel);
+ object_init_ex(&pixel, zephir_get_internal_ce(SL("imagickpixel")));
+ ZEPHIR_CALL_METHOD(NULL, &pixel, "__construct", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_28, &_4, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ height = (zephir_get_numberval(&_28) + height);
+ zephir_read_property(&_29, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_30, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_29, "setiteratorindex", NULL, 0, &_30);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_31$$10, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_32$$10, height);
+ ZEPHIR_CALL_METHOD(NULL, &image, "newimage", &_33, 0, &_31$$10, &_32$$10, &pixel);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_34$$10);
+ ZVAL_STRING(&_34$$10, "Imagick::ALPHACHANNEL_SET");
+ ZEPHIR_CALL_FUNCTION(&_35$$10, "constant", &_20, 119, &_34$$10);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagealphachannel", &_36, 0, &_35$$10);
+ zephir_check_call_status();
+ zephir_read_property(&_32$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_37$$10, &_32$$10, "getcolorspace", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setcolorspace", &_38, 0, &_37$$10);
+ zephir_check_call_status();
+ zephir_read_property(&_39$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_40$$10, &_39$$10, "getimagedelay", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagedelay", &_41, 0, &_40$$10);
+ zephir_check_call_status();
+ zephir_read_property(&_42$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_34$$10);
+ ZVAL_STRING(&_34$$10, "Imagick::COMPOSITE_SRC");
+ ZEPHIR_CALL_FUNCTION(&_43$$10, "constant", &_20, 119, &_34$$10);
+ zephir_check_call_status();
+ ZVAL_LONG(&_44$$10, 0);
+ ZVAL_LONG(&_45$$10, 0);
+ ZEPHIR_CALL_METHOD(&result, &image, "compositeimage", &_46, 0, &_42$$10, &_43$$10, &_44$$10, &_45$$10);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 534);
+ return;
+ }
+ zephir_read_property(&_44$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_47$$10, &_44$$10, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_47$$10)) {
+ break;
+ }
+ }
+ ZVAL_LONG(&_30, 0);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_30);
+ zephir_check_call_status();
+ ZVAL_LONG(&_30, 0);
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_30);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ ZEPHIR_INIT_NVAR(&_48$$13);
+ ZVAL_STRING(&_48$$13, "Imagick::COMPOSITE_OVER");
+ ZEPHIR_CALL_FUNCTION(&_49$$13, "constant", &_20, 119, &_48$$13);
+ zephir_check_call_status();
+ zephir_read_property(&_50$$13, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_51$$13, 0);
+ ZEPHIR_CALL_METHOD(&result, &image, "compositeimage", &_46, 0, &reflection, &_49$$13, &_51$$13, &_50$$13);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 554);
+ return;
+ }
+ ZEPHIR_CALL_METHOD(&_52$$13, &image, "nextimage", &_53, 0);
+ zephir_check_call_status();
+ _54$$13 = !ZEPHIR_IS_TRUE_IDENTICAL(&_52$$13);
+ if (!(_54$$13)) {
+ ZEPHIR_CALL_METHOD(&_55$$13, &reflection, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ _54$$13 = !ZEPHIR_IS_TRUE_IDENTICAL(&_55$$13);
+ }
+ if (_54$$13) {
+ break;
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &reflection, "destroy", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_30, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_30, "clear", NULL, 0);
+ zephir_check_call_status();
+ zephir_read_property(&_56, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_56, "destroy", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image);
+ zephir_read_property(&_57, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_58, &_57, "getimagewidth", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_58);
+ zephir_read_property(&_59, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_60, &_59, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_60);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, returning)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRender)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *columns_param = NULL, _0, _1, _2, _3;
- zval columns;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *extension_param = NULL, *quality_param = NULL, image, _0, _1, _2, _3, _4, _5$$4, _6$$4, _7$$4;
+ zval extension;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(columns)
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_7$$4);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(extension)
+ Z_PARAM_LONG(quality)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &columns_param);
- zephir_get_arrval(&columns, columns_param);
- ZEPHIR_INIT_VAR(&_0);
- zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_2, &_1, SL("RETURNING"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Insert.zep", 127);
- zephir_fast_array_merge(&_0, &_2, &columns);
+ zephir_fetch_params(1, 2, 0, &extension_param, &quality_param);
+ zephir_get_strval(&extension, extension_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&image, &_0);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setformat", NULL, 0, &extension);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimageformat", NULL, 0, &extension);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "stripimage", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_1, &image, "getimagetype", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_1);
+ ZEPHIR_CALL_METHOD(&_2, &image, "getimageformat", NULL, 0);
+ zephir_check_call_status();
ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "RETURNING");
- zephir_update_property_array(this_ptr, SL("store"), &_3, &_0);
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, reset)
-{
- zval _0, _1, _2, _3;
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_3);
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ ZEPHIR_CONCAT_SV(&_3, "image/", &_2);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_3);
+ ZEPHIR_INIT_VAR(&_4);
+ zephir_fast_strtolower(&_4, &extension);
+ zephir_get_strval(&extension, &_4);
+ do {
+ if (ZEPHIR_IS_STRING(&extension, "gif")) {
+ ZEPHIR_CALL_METHOD(NULL, &image, "optimizeimagelayers", NULL, 0);
+ zephir_check_call_status();
+ break;
+ }
+ if (ZEPHIR_IS_STRING(&extension, "jpg") || ZEPHIR_IS_STRING(&extension, "jpeg")) {
+ ZEPHIR_INIT_VAR(&_5$$4);
+ ZVAL_STRING(&_5$$4, "Imagick::COMPRESSION_JPEG");
+ ZEPHIR_CALL_FUNCTION(&_6$$4, "constant", NULL, 119, &_5$$4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagecompression", NULL, 0, &_6$$4);
+ zephir_check_call_status();
+ ZVAL_LONG(&_7$$4, quality);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setimagecompressionquality", NULL, 0, &_7$$4);
+ zephir_check_call_status();
+ }
+ } while(0);
- ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_query_insert_ce, getThis(), "reset", NULL, 0);
+ ZEPHIR_RETURN_CALL_METHOD(&image, "getimageblob", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "FROM");
- ZEPHIR_INIT_VAR(&_1);
- ZVAL_STRING(&_1, "");
- zephir_update_property_array(this_ptr, SL("store"), &_0, &_1);
- ZEPHIR_INIT_VAR(&_2);
- array_init(&_2);
- ZEPHIR_INIT_VAR(&_3);
- ZVAL_STRING(&_3, "RETURNING");
- zephir_update_property_array(this_ptr, SL("store"), &_3, &_2);
- ZEPHIR_MM_RESTORE();
+ RETURN_MM();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, set)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processResize)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *column_param = NULL, *value = NULL, value_sub, __$null, _0;
- zval column;
+ zephir_fcall_cache_entry *_3 = NULL, *_5 = NULL;
+ zval *width_param = NULL, *height_param = NULL, image, _0, _6, _7, _1$$3, _2$$3, _4$$3;
+ zend_long width, height, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&column);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
+ ZVAL_UNDEF(&image);
ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 2)
- Z_PARAM_STR(column)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_1$$3);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(width)
+ Z_PARAM_LONG(height)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 1, &column_param, &value);
- zephir_get_strval(&column, column_param);
- if (!value) {
- value = &value_sub;
- ZEPHIR_CPY_WRT(value, &__$null);
- } else {
- ZEPHIR_SEPARATE_PARAM(value);
- }
- if (Z_TYPE_P(value) == IS_NULL) {
- ZEPHIR_INIT_NVAR(value);
- ZVAL_STRING(value, "NULL");
+ zephir_fetch_params(1, 2, 0, &width_param, &height_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CPY_WRT(&image, &_0);
+ ZVAL_LONG(&_0, 0);
+ ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_0);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ ZVAL_LONG(&_1$$3, width);
+ ZVAL_LONG(&_2$$3, height);
+ ZEPHIR_CALL_METHOD(NULL, &image, "scaleimage", &_3, 0, &_1$$3, &_2$$3);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_4$$3, &image, "nextimage", &_5, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_4$$3)) {
+ break;
+ }
}
- zephir_update_property_array_multi(this_ptr, SL("store"), value, SL("sz"), 3, SL("COLUMNS"), &column);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY);
- ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &column);
+ ZEPHIR_CALL_METHOD(&_6, &image, "getimagewidth", NULL, 0);
zephir_check_call_status();
- RETURN_THIS();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_6);
+ ZEPHIR_CALL_METHOD(&_7, &image, "getimageheight", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_7);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Insert, buildColumns)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRotate)
{
- zend_string *_6;
- zend_ulong _5;
- zval columns;
- zval column, _0, _1, _2, *_3, _4, _10, _11, _12, _13, _14, _15, _16, _17, _7$$3, _9$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zephir_fcall_cache_entry *_8 = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *degrees_param = NULL, pixel, _0, _1, _9, _10, _11, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3;
+ zend_long degrees, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&column);
+ ZVAL_UNDEF(&pixel);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_2);
- ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_9);
ZVAL_UNDEF(&_10);
ZVAL_UNDEF(&_11);
- ZVAL_UNDEF(&_12);
- ZVAL_UNDEF(&_13);
- ZVAL_UNDEF(&_14);
- ZVAL_UNDEF(&_15);
- ZVAL_UNDEF(&_16);
- ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_2$$3);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
ZVAL_UNDEF(&_7$$3);
- ZVAL_UNDEF(&_9$$4);
- ZVAL_UNDEF(&columns);
+ ZVAL_UNDEF(&_8$$3);
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(degrees)
+ ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
-
- ZEPHIR_INIT_VAR(&columns);
- array_init(&columns);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_1, &_0, SL("COLUMNS"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Insert.zep", 176);
- ZEPHIR_INIT_VAR(&_2);
- zephir_is_iterable(&_1, 0, "phalcon/DataMapper/Query/Insert.zep", 180);
- if (Z_TYPE_P(&_1) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1), _5, _6, _3)
- {
- ZEPHIR_INIT_NVAR(&column);
- if (_6 != NULL) {
- ZVAL_STR_COPY(&column, _6);
- } else {
- ZVAL_LONG(&column, _5);
- }
- ZEPHIR_INIT_NVAR(&_2);
- ZVAL_COPY(&_2, _3);
- ZEPHIR_CALL_METHOD(&_7$$3, this_ptr, "quoteidentifier", &_8, 0, &column);
- zephir_check_call_status();
- zephir_array_append(&columns, &_7$$3, PH_SEPARATE, "phalcon/DataMapper/Query/Insert.zep", 177);
- } ZEND_HASH_FOREACH_END();
- } else {
- ZEPHIR_CALL_METHOD(NULL, &_1, "rewind", NULL, 0);
+ zephir_fetch_params(1, 1, 0, °rees_param);
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_1, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "setiteratorindex", NULL, 0, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&pixel);
+ object_init_ex(&pixel, zephir_get_internal_ce(SL("imagickpixel")));
+ ZEPHIR_CALL_METHOD(NULL, &pixel, "__construct", NULL, 0);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_3$$3, degrees);
+ ZEPHIR_CALL_METHOD(NULL, &_2$$3, "rotateimage", NULL, 0, &pixel, &_3$$3);
zephir_check_call_status();
- while (1) {
- ZEPHIR_CALL_METHOD(&_4, &_1, "valid", NULL, 0);
- zephir_check_call_status();
- if (!zend_is_true(&_4)) {
- break;
- }
- ZEPHIR_CALL_METHOD(&column, &_1, "key", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_2, &_1, "current", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "quoteidentifier", &_8, 0, &column);
- zephir_check_call_status();
- zephir_array_append(&columns, &_9$$4, PH_SEPARATE, "phalcon/DataMapper/Query/Insert.zep", 177);
- ZEPHIR_CALL_METHOD(NULL, &_1, "next", NULL, 0);
- zephir_check_call_status();
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY);
+ zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_6$$3, 0);
+ ZVAL_LONG(&_7$$3, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_3$$3, "setimagepage", NULL, 0, &_4$$3, &_5$$3, &_6$$3, &_7$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_8$$3, &_6$$3, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_8$$3)) {
+ break;
}
}
- ZEPHIR_INIT_NVAR(&_2);
- ZEPHIR_INIT_NVAR(&column);
- ZEPHIR_INIT_VAR(&_10);
- ZEPHIR_INIT_VAR(&_12);
- ZVAL_STRING(&_12, ",");
- ZEPHIR_CALL_METHOD(&_11, this_ptr, "indent", NULL, 0, &columns, &_12);
- zephir_check_call_status();
- zephir_fast_trim(&_10, &_11, NULL , ZEPHIR_TRIM_LEFT);
- ZEPHIR_INIT_NVAR(&_12);
- zephir_read_property(&_14, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_15, &_14, SL("COLUMNS"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Insert.zep", 183);
- ZEPHIR_CALL_FUNCTION(&_16, "array_values", NULL, 14, &_15);
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_9, &_1, "getimagewidth", NULL, 0);
zephir_check_call_status();
- ZEPHIR_INIT_VAR(&_17);
- ZVAL_STRING(&_17, ",");
- ZEPHIR_CALL_METHOD(&_13, this_ptr, "indent", NULL, 0, &_16, &_17);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_9);
+ zephir_read_property(&_10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_11, &_10, "getimageheight", NULL, 0);
zephir_check_call_status();
- zephir_fast_trim(&_12, &_13, NULL , ZEPHIR_TRIM_LEFT);
- ZEPHIR_CONCAT_SVSVS(return_value, " (", &_10, ") VALUES (", &_12, ")");
- RETURN_MM();
-}
-
-
-
-
-#ifdef HAVE_CONFIG_H
-#endif
-
-
-
-
-
-ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Query_QueryFactory)
-{
- ZEPHIR_REGISTER_CLASS(Phalcon\\DataMapper\\Query, QueryFactory, phalcon, datamapper_query_queryfactory, phalcon_datamapper_query_queryfactory_method_entry, 0);
-
- zend_declare_property_string(phalcon_datamapper_query_queryfactory_ce, SL("selectClass"), "", ZEND_ACC_PROTECTED);
- return SUCCESS;
+ zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_11);
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, __construct)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *selectClass_param = NULL;
- zval selectClass;
+ zend_long quality, ZEPHIR_LAST_CALL_STATUS;
+ zval *file_param = NULL, *quality_param = NULL, extension, fp, _0, _1, _2, _3, _4, _5, _6, _7, _17, _8$$3, _9$$3, _10$$3, _11$$4, _12$$4, _13$$4, _14$$5, _15$$5, _16$$5;
+ zval file;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&selectClass);
- ZEND_PARSE_PARAMETERS_START(0, 1)
- Z_PARAM_OPTIONAL
- Z_PARAM_STR(selectClass)
+ ZVAL_UNDEF(&file);
+ ZVAL_UNDEF(&extension);
+ ZVAL_UNDEF(&fp);
+ ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6);
+ ZVAL_UNDEF(&_7);
+ ZVAL_UNDEF(&_17);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$4);
+ ZVAL_UNDEF(&_12$$4);
+ ZVAL_UNDEF(&_13$$4);
+ ZVAL_UNDEF(&_14$$5);
+ ZVAL_UNDEF(&_15$$5);
+ ZVAL_UNDEF(&_16$$5);
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(file)
+ Z_PARAM_LONG(quality)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 0, 1, &selectClass_param);
- if (!selectClass_param) {
- ZEPHIR_INIT_VAR(&selectClass);
- ZVAL_STRING(&selectClass, "");
- } else {
- zephir_get_strval(&selectClass, selectClass_param);
- }
- if (ZEPHIR_IS_EMPTY(&selectClass)) {
- ZEPHIR_INIT_NVAR(&selectClass);
- ZVAL_STRING(&selectClass, "Phalcon\\DataMapper\\Query\\Select");
- }
- zephir_update_property_zval(this_ptr, ZEND_STRL("selectClass"), &selectClass);
- ZEPHIR_MM_RESTORE();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newBind)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
+ zephir_fetch_params(1, 2, 0, &file_param, &quality_param);
+ zephir_get_strval(&file, file_param);
+ ZVAL_LONG(&_0, 4);
+ ZEPHIR_CALL_FUNCTION(&extension, "pathinfo", NULL, 89, &file, &_0);
+ zephir_check_call_status();
+ zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_0, "setformat", NULL, 0, &extension);
+ zephir_check_call_status();
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "setimageformat", NULL, 0, &extension);
+ zephir_check_call_status();
+ zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_3, &_2, "getimagetype", NULL, 0);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_3);
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_5, &_4, "getimageformat", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_6);
+ ZEPHIR_CONCAT_SV(&_6, "image/", &_5);
+ zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_6);
+ ZEPHIR_INIT_VAR(&_7);
+ zephir_fast_strtolower(&_7, &extension);
+ ZEPHIR_CPY_WRT(&extension, &_7);
+ do {
+ if (ZEPHIR_IS_STRING(&extension, "gif")) {
+ zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_8$$3, "optimizeimagelayers", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_9$$3);
+ ZVAL_STRING(&_9$$3, "w");
+ ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 140, &file, &_9$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_10$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_10$$3, "writeimagesfile", NULL, 0, &fp);
+ zephir_check_call_status();
+ zephir_fclose(&fp);
+ RETURN_MM_NULL();
+ }
+ if (ZEPHIR_IS_STRING(&extension, "jpg") || ZEPHIR_IS_STRING(&extension, "jpeg")) {
+ zephir_read_property(&_11$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_VAR(&_12$$4);
+ ZVAL_STRING(&_12$$4, "Imagick::COMPRESSION_JPEG");
+ ZEPHIR_CALL_FUNCTION(&_13$$4, "constant", NULL, 119, &_12$$4);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &_11$$4, "setimagecompression", NULL, 0, &_13$$4);
+ zephir_check_call_status();
+ }
+ } while(0);
- object_init_ex(return_value, phalcon_datamapper_query_bind_ce);
- if (zephir_has_constructor(return_value)) {
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0);
+ if (quality >= 0) {
+ ZVAL_LONG(&_15$$5, quality);
+ ZVAL_LONG(&_16$$5, 1);
+ ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "checkhighlow", NULL, 0, &_15$$5, &_16$$5);
+ zephir_check_call_status();
+ quality = zephir_get_numberval(&_14$$5);
+ zephir_read_property(&_15$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_16$$5, quality);
+ ZEPHIR_CALL_METHOD(NULL, &_15$$5, "setimagecompressionquality", NULL, 0, &_16$$5);
zephir_check_call_status();
}
-
- RETURN_MM();
+ zephir_read_property(&_17, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(NULL, &_17, "writeimage", NULL, 0, &file);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newDelete)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSharpen)
{
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, _0;
+ zval *amount_param = NULL, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3;
+ zend_long amount, ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
ZVAL_UNDEF(&_0);
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$3);
+ ZVAL_UNDEF(&_4$$3);
+ ZVAL_UNDEF(&_5$$3);
+ ZVAL_UNDEF(&_6$$3);
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_datamapper_pdo_connection_ce)
+ Z_PARAM_LONG(amount)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- object_init_ex(return_value, phalcon_datamapper_query_delete_ce);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 206, connection, &_0);
+ zephir_fetch_params(1, 1, 0, &amount_param);
+ ZEPHIR_INIT_VAR(&_0);
+ if (amount < 5) {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, 5);
+ } else {
+ ZEPHIR_INIT_NVAR(&_0);
+ ZVAL_LONG(&_0, amount);
+ }
+ amount = zephir_get_numberval(&_0);
+ amount = (long) (zephir_safe_div_long_long(((amount * 3.0)), 100));
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_2, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2);
zephir_check_call_status();
- RETURN_MM();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_4$$3, 0);
+ ZVAL_LONG(&_5$$3, amount);
+ ZEPHIR_CALL_METHOD(NULL, &_3$$3, "sharpenimage", NULL, 0, &_4$$3, &_5$$3);
+ zephir_check_call_status();
+ zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_6$$3, &_4$$3, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_6$$3)) {
+ break;
+ }
+ }
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newInsert)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText)
{
+ zend_bool _7$$8, _9$$8, _10$$8, _11$$8, _12$$11, _14$$11, _15$$11, _16$$11;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, _0;
+ zend_long opacity, red, green, blue, size, ZEPHIR_LAST_CALL_STATUS;
+ zval *text_param = NULL, *offsetX = NULL, offsetX_sub, *offsetY = NULL, offsetY_sub, *opacity_param = NULL, *red_param = NULL, *green_param = NULL, *blue_param = NULL, *size_param = NULL, *fontFile_param = NULL, color, draw, gravity, x, y, _0, _1, _2, _3, _4$$4, _5$$5, _6$$7, _8$$8, _13$$11, _17$$12, _18$$14, _19$$14, _20$$14;
+ zval text, fontFile;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
+ ZVAL_UNDEF(&text);
+ ZVAL_UNDEF(&fontFile);
+ ZVAL_UNDEF(&offsetX_sub);
+ ZVAL_UNDEF(&offsetY_sub);
+ ZVAL_UNDEF(&color);
+ ZVAL_UNDEF(&draw);
+ ZVAL_UNDEF(&gravity);
+ ZVAL_UNDEF(&x);
+ ZVAL_UNDEF(&y);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_datamapper_pdo_connection_ce)
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_4$$4);
+ ZVAL_UNDEF(&_5$$5);
+ ZVAL_UNDEF(&_6$$7);
+ ZVAL_UNDEF(&_8$$8);
+ ZVAL_UNDEF(&_13$$11);
+ ZVAL_UNDEF(&_17$$12);
+ ZVAL_UNDEF(&_18$$14);
+ ZVAL_UNDEF(&_19$$14);
+ ZVAL_UNDEF(&_20$$14);
+ bool is_null_true = 1;
+ ZEND_PARSE_PARAMETERS_START(8, 9)
+ Z_PARAM_STR(text)
+ Z_PARAM_ZVAL(offsetX)
+ Z_PARAM_ZVAL(offsetY)
+ Z_PARAM_LONG(opacity)
+ Z_PARAM_LONG(red)
+ Z_PARAM_LONG(green)
+ Z_PARAM_LONG(blue)
+ Z_PARAM_LONG(size)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_NULL(fontFile)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- object_init_ex(return_value, phalcon_datamapper_query_insert_ce);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0);
+ zephir_fetch_params(1, 8, 1, &text_param, &offsetX, &offsetY, &opacity_param, &red_param, &green_param, &blue_param, &size_param, &fontFile_param);
+ zephir_get_strval(&text, text_param);
+ ZEPHIR_SEPARATE_PARAM(offsetX);
+ ZEPHIR_SEPARATE_PARAM(offsetY);
+ if (!fontFile_param) {
+ ZEPHIR_INIT_VAR(&fontFile);
+ } else {
+ zephir_get_strval(&fontFile, fontFile_param);
+ }
+ opacity = (long) (zephir_safe_div_long_long(opacity, 100));
+ ZEPHIR_INIT_VAR(&draw);
+ object_init_ex(&draw, zephir_get_internal_ce(SL("imagickdraw")));
+ ZEPHIR_CALL_METHOD(NULL, &draw, "__construct", NULL, 0);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 207, connection, &_0);
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "rgb(%d, %d, %d)");
+ ZVAL_LONG(&_1, red);
+ ZVAL_LONG(&_2, green);
+ ZVAL_LONG(&_3, blue);
+ ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 117, &_0, &_1, &_2, &_3);
zephir_check_call_status();
- RETURN_MM();
+ ZEPHIR_INIT_NVAR(&_0);
+ object_init_ex(&_0, zephir_get_internal_ce(SL("imagickpixel")));
+ ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &color);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &draw, "setfillcolor", NULL, 0, &_0);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&fontFile) != IS_NULL) {
+ ZEPHIR_CALL_METHOD(NULL, &draw, "setfont", NULL, 0, &fontFile);
+ zephir_check_call_status();
+ }
+ if (size) {
+ ZVAL_LONG(&_4$$4, size);
+ ZEPHIR_CALL_METHOD(NULL, &draw, "setfontsize", NULL, 0, &_4$$4);
+ zephir_check_call_status();
+ }
+ if (opacity) {
+ ZVAL_LONG(&_5$$5, opacity);
+ ZEPHIR_CALL_METHOD(NULL, &draw, "setfillopacity", NULL, 0, &_5$$5);
+ zephir_check_call_status();
+ }
+ ZEPHIR_INIT_VAR(&gravity);
+ ZVAL_NULL(&gravity);
+ if (((Z_TYPE_P(offsetX) == IS_TRUE || Z_TYPE_P(offsetX) == IS_FALSE) == 1)) {
+ if (((Z_TYPE_P(offsetY) == IS_TRUE || Z_TYPE_P(offsetY) == IS_FALSE) == 1)) {
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, 0);
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, 0);
+ ZEPHIR_INIT_VAR(&_6$$7);
+ ZVAL_STRING(&_6$$7, "Imagick::GRAVITY_CENTER");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_6$$7);
+ zephir_check_call_status();
+ } else if (Z_TYPE_P(offsetY) == IS_LONG) {
+ ZEPHIR_INIT_VAR(&y);
+ ZVAL_LONG(&y, zephir_get_intval(offsetY));
+ _7$$8 = ZEPHIR_IS_TRUE_IDENTICAL(offsetX);
+ if (_7$$8) {
+ _7$$8 = ZEPHIR_LT_LONG(&y, 0);
+ }
+ if (_7$$8) {
+ ZEPHIR_INIT_VAR(&_8$$8);
+ ZVAL_STRING(&_8$$8, "Imagick::GRAVITY_SOUTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_8$$8);
+ zephir_check_call_status();
+ } else {
+ }
+ _9$$8 = ZEPHIR_IS_TRUE_IDENTICAL(offsetX);
+ if (_9$$8) {
+ _9$$8 = ZEPHIR_GE_LONG(&y, 0);
+ }
+ if (_9$$8) {
+ ZEPHIR_INIT_NVAR(&_8$$8);
+ ZVAL_STRING(&_8$$8, "Imagick::GRAVITY_NORTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_8$$8);
+ zephir_check_call_status();
+ } else {
+ }
+ _10$$8 = !ZEPHIR_IS_TRUE_IDENTICAL(offsetX);
+ if (_10$$8) {
+ _10$$8 = ZEPHIR_LT_LONG(&y, 0);
+ }
+ if (_10$$8) {
+ ZEPHIR_INIT_NVAR(&_8$$8);
+ ZVAL_STRING(&_8$$8, "Imagick::GRAVITY_SOUTH");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_8$$8);
+ zephir_check_call_status();
+ } else {
+ }
+ _11$$8 = !ZEPHIR_IS_TRUE_IDENTICAL(offsetX);
+ if (_11$$8) {
+ _11$$8 = ZEPHIR_GE_LONG(&y, 0);
+ }
+ if (_11$$8) {
+ ZEPHIR_INIT_NVAR(&_8$$8);
+ ZVAL_STRING(&_8$$8, "Imagick::GRAVITY_NORTH");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_8$$8);
+ zephir_check_call_status();
+ } else {
+ }
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, 0);
+ if (ZEPHIR_LT_LONG(&y, 0)) {
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, (zephir_get_numberval(&y) * -1));
+ } else {
+ }
+ }
+ } else if (Z_TYPE_P(offsetX) == IS_LONG) {
+ ZEPHIR_INIT_VAR(&x);
+ ZVAL_LONG(&x, zephir_get_intval(offsetX));
+ if (zephir_is_true(offsetX)) {
+ if (((Z_TYPE_P(offsetY) == IS_TRUE || Z_TYPE_P(offsetY) == IS_FALSE) == 1)) {
+ _12$$11 = ZEPHIR_IS_TRUE_IDENTICAL(offsetY);
+ if (_12$$11) {
+ _12$$11 = ZEPHIR_LT_LONG(&x, 0);
+ }
+ if (_12$$11) {
+ ZEPHIR_INIT_VAR(&_13$$11);
+ ZVAL_STRING(&_13$$11, "Imagick::GRAVITY_SOUTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_13$$11);
+ zephir_check_call_status();
+ } else {
+ }
+ _14$$11 = ZEPHIR_IS_TRUE_IDENTICAL(offsetY);
+ if (_14$$11) {
+ _14$$11 = ZEPHIR_GE_LONG(&x, 0);
+ }
+ if (_14$$11) {
+ ZEPHIR_INIT_NVAR(&_13$$11);
+ ZVAL_STRING(&_13$$11, "Imagick::GRAVITY_SOUTH");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_13$$11);
+ zephir_check_call_status();
+ } else {
+ }
+ _15$$11 = !ZEPHIR_IS_TRUE_IDENTICAL(offsetY);
+ if (_15$$11) {
+ _15$$11 = ZEPHIR_LT_LONG(&x, 0);
+ }
+ if (_15$$11) {
+ ZEPHIR_INIT_NVAR(&_13$$11);
+ ZVAL_STRING(&_13$$11, "Imagick::GRAVITY_EAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_13$$11);
+ zephir_check_call_status();
+ } else {
+ }
+ _16$$11 = !ZEPHIR_IS_TRUE_IDENTICAL(offsetY);
+ if (_16$$11) {
+ _16$$11 = ZEPHIR_GE_LONG(&x, 0);
+ }
+ if (_16$$11) {
+ ZEPHIR_INIT_NVAR(&_13$$11);
+ ZVAL_STRING(&_13$$11, "Imagick::GRAVITY_WEST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_13$$11);
+ zephir_check_call_status();
+ } else {
+ }
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, 0);
+ if (ZEPHIR_LT_LONG(&x, 0)) {
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, (zephir_get_numberval(&x) * -1));
+ } else {
+ }
+ } else if (Z_TYPE_P(offsetY) == IS_LONG) {
+ ZEPHIR_INIT_NVAR(&y);
+ ZVAL_LONG(&y, zephir_get_intval(offsetY));
+ if (ZEPHIR_LT_LONG(&x, 0)) {
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, (zephir_get_numberval(&x) * -1));
+ } else {
+ ZEPHIR_INIT_NVAR(offsetX);
+ ZVAL_LONG(offsetX, 0);
+ }
+ if (ZEPHIR_LT_LONG(&y, 0)) {
+ ZEPHIR_INIT_NVAR(offsetY);
+ ZVAL_LONG(offsetY, (zephir_get_numberval(&y) * -1));
+ } else {
+ }
+ if (ZEPHIR_LT_LONG(&y, 0)) {
+ ZEPHIR_INIT_VAR(&_17$$12);
+ ZVAL_STRING(&_17$$12, "Imagick::GRAVITY_SOUTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_17$$12);
+ zephir_check_call_status();
+ } else {
+ }
+ if (ZEPHIR_GE_LONG(&y, 0)) {
+ ZEPHIR_INIT_NVAR(&_17$$12);
+ ZVAL_STRING(&_17$$12, "Imagick::GRAVITY_NORTHEAST");
+ ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 119, &_17$$12);
+ zephir_check_call_status();
+ } else {
+ }
+ }
+ }
+ }
+ if (Z_TYPE_P(&gravity) != IS_NULL) {
+ ZEPHIR_CALL_METHOD(NULL, &draw, "setgravity", NULL, 0, &gravity);
+ zephir_check_call_status();
+ }
+ zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_2, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_18$$14, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_19$$14, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_18$$14, "annotateimage", NULL, 0, &draw, offsetX, offsetY, &_19$$14, &text);
+ zephir_check_call_status();
+ zephir_read_property(&_19$$14, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_20$$14, &_19$$14, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_20$$14)) {
+ break;
+ }
+ }
+ ZEPHIR_CALL_METHOD(NULL, &draw, "destroy", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newSelect)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processWatermark)
{
- zend_class_entry *_2;
- zval selectClass;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, _0, _1, _3;
+ zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS;
+ zval *image, image_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, result, watermark, _0, _1, _2, _3, _4, _5, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3, _11$$3;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
+ ZVAL_UNDEF(&image_sub);
+ ZVAL_UNDEF(&result);
+ ZVAL_UNDEF(&watermark);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&selectClass);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_datamapper_pdo_connection_ce)
+ ZVAL_UNDEF(&_4);
+ ZVAL_UNDEF(&_5);
+ ZVAL_UNDEF(&_6$$3);
+ ZVAL_UNDEF(&_7$$3);
+ ZVAL_UNDEF(&_8$$3);
+ ZVAL_UNDEF(&_9$$3);
+ ZVAL_UNDEF(&_10$$3);
+ ZVAL_UNDEF(&_11$$3);
+ ZEND_PARSE_PARAMETERS_START(4, 4)
+ Z_PARAM_OBJECT_OF_CLASS(image, phalcon_image_adapter_adapterinterface_ce)
+ Z_PARAM_LONG(offsetX)
+ Z_PARAM_LONG(offsetY)
+ Z_PARAM_LONG(opacity)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- zephir_read_property(&_0, this_ptr, ZEND_STRL("selectClass"), PH_NOISY_CC | PH_READONLY);
- zephir_get_strval(&selectClass, &_0);
- zephir_fetch_safe_class(&_1, &selectClass);
- _2 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_1), Z_STRLEN_P(&_1), ZEND_FETCH_CLASS_AUTO);
- if(!_2) {
- RETURN_MM_NULL();
- }
- object_init_ex(return_value, _2);
- if (zephir_has_constructor(return_value)) {
- ZEPHIR_CALL_METHOD(&_3, this_ptr, "newbind", NULL, 0);
+ zephir_fetch_params(1, 4, 0, &image, &offsetX_param, &offsetY_param, &opacity_param);
+ opacity = (long) (zephir_safe_div_long_long(opacity, 100));
+ ZEPHIR_INIT_VAR(&watermark);
+ object_init_ex(&watermark, zephir_get_internal_ce(SL("imagick")));
+ ZEPHIR_CALL_METHOD(NULL, &watermark, "__construct", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(&_0, image, "render", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &watermark, "readimageblob", NULL, 0, &_0);
+ zephir_check_call_status();
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "Imagick::EVALUATE_MULTIPLY");
+ ZEPHIR_CALL_FUNCTION(&_2, "constant", NULL, 119, &_1);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_1);
+ ZVAL_STRING(&_1, "Imagick::CHANNEL_ALPHA");
+ ZEPHIR_CALL_FUNCTION(&_3, "constant", NULL, 119, &_1);
+ zephir_check_call_status();
+ ZVAL_LONG(&_4, opacity);
+ ZEPHIR_CALL_METHOD(NULL, &watermark, "evaluateimage", NULL, 0, &_2, &_4, &_3);
+ zephir_check_call_status();
+ zephir_read_property(&_4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZVAL_LONG(&_5, 0);
+ ZEPHIR_CALL_METHOD(NULL, &_4, "setiteratorindex", NULL, 0, &_5);
+ zephir_check_call_status();
+ while (1) {
+ if (!(1)) {
+ break;
+ }
+ zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_INIT_NVAR(&_7$$3);
+ ZVAL_STRING(&_7$$3, "Imagick::COMPOSITE_OVER");
+ ZEPHIR_CALL_FUNCTION(&_8$$3, "constant", NULL, 119, &_7$$3);
zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, connection, &_3);
+ ZVAL_LONG(&_9$$3, offsetX);
+ ZVAL_LONG(&_10$$3, offsetY);
+ ZEPHIR_CALL_METHOD(&result, &_6$$3, "compositeimage", NULL, 0, &watermark, &_8$$3, &_9$$3, &_10$$3);
zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&result)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/Image/Adapter/Imagick.zep", 893);
+ return;
+ }
+ zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY);
+ ZEPHIR_CALL_METHOD(&_11$$3, &_9$$3, "nextimage", NULL, 0);
+ zephir_check_call_status();
+ if (!ZEPHIR_IS_TRUE_IDENTICAL(&_11$$3)) {
+ break;
+ }
}
-
- RETURN_MM();
+ ZEPHIR_CALL_METHOD(NULL, &watermark, "clear", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_CALL_METHOD(NULL, &watermark, "destroy", NULL, 0);
+ zephir_check_call_status();
+ ZEPHIR_MM_RESTORE();
}
-static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newUpdate)
+static PHP_METHOD(Phalcon_Image_Adapter_Imagick, check)
{
+ zval _0, _1, _2, _3$$4, _4$$4;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *connection, connection_sub, _0;
zval *this_ptr = getThis();
- ZVAL_UNDEF(&connection_sub);
ZVAL_UNDEF(&_0);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_OBJECT_OF_CLASS(connection, phalcon_datamapper_pdo_connection_ce)
- ZEND_PARSE_PARAMETERS_END();
+ ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3$$4);
+ ZVAL_UNDEF(&_4$$4);
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &connection);
- object_init_ex(return_value, phalcon_datamapper_query_update_ce);
- ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0);
- zephir_check_call_status();
- ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 208, connection, &_0);
+
+ ZEPHIR_INIT_VAR(&_0);
+ ZVAL_STRING(&_0, "imagick");
+ if (1 != zephir_class_exists(&_0, 1)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick is not installed, or the extension is not loaded", "phalcon/Image/Adapter/Imagick.zep", 916);
+ return;
+ }
+ ZEPHIR_INIT_VAR(&_1);
+ ZVAL_STRING(&_1, "Imagick::IMAGICK_EXTNUM");
+ ZEPHIR_CALL_FUNCTION(&_2, "defined", NULL, 118, &_1);
zephir_check_call_status();
- RETURN_MM();
+ if (zephir_is_true(&_2)) {
+ ZEPHIR_INIT_VAR(&_3$$4);
+ ZVAL_STRING(&_3$$4, "Imagick::IMAGICK_EXTNUM");
+ ZEPHIR_CALL_FUNCTION(&_4$$4, "constant", NULL, 119, &_3$$4);
+ zephir_check_call_status();
+ zephir_update_property_zval(this_ptr, ZEND_STRL("version"), &_4$$4);
+ }
+ ZEPHIR_MM_RESTORE();
}
@@ -166984,738 +166657,788 @@ static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newUpdate)
-ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Query_Select)
+ZEPHIR_INIT_CLASS(Phalcon_Tag_Exception)
{
- ZEPHIR_REGISTER_CLASS_EX(Phalcon\\DataMapper\\Query, Select, phalcon, datamapper_query_select, phalcon_datamapper_query_abstractconditions_ce, phalcon_datamapper_query_select_method_entry, 0);
+ ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Tag, Exception, phalcon, tag_exception, zend_ce_exception, NULL, 0);
- zend_declare_property_string(phalcon_datamapper_query_select_ce, SL("asAlias"), "", ZEND_ACC_PROTECTED);
- zend_declare_property_bool(phalcon_datamapper_query_select_ce, SL("forUpdate"), 0, ZEND_ACC_PROTECTED);
- zephir_declare_class_constant_string(phalcon_datamapper_query_select_ce, SL("JOIN_INNER"), "INNER");
+ return SUCCESS;
+}
- zephir_declare_class_constant_string(phalcon_datamapper_query_select_ce, SL("JOIN_LEFT"), "LEFT");
- zephir_declare_class_constant_string(phalcon_datamapper_query_select_ce, SL("JOIN_NATURAL"), "NATURAL");
- zephir_declare_class_constant_string(phalcon_datamapper_query_select_ce, SL("JOIN_RIGHT"), "RIGHT");
- return SUCCESS;
-}
+#ifdef HAVE_CONFIG_H
+#endif
-static PHP_METHOD(Phalcon_DataMapper_Query_Select, __call)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long ZEPHIR_LAST_CALL_STATUS;
- zval params, proxied, _0$$3, _3$$3;
- zval *method_param = NULL, *params_param = NULL, __$true, _5, _1$$3, _2$$3, _4$$3;
- zval method, _6;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&method);
- ZVAL_UNDEF(&_6);
- ZVAL_BOOL(&__$true, 1);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- ZVAL_UNDEF(&_4$$3);
- ZVAL_UNDEF(¶ms);
- ZVAL_UNDEF(&proxied);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_3$$3);
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STR(method)
- Z_PARAM_ARRAY(params)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 2, 0, &method_param, ¶ms_param);
- zephir_get_strval(&method, method_param);
- zephir_get_arrval(¶ms, params_param);
- ZEPHIR_INIT_VAR(&proxied);
- zephir_create_array(&proxied, 10, 0);
- zephir_array_update_string(&proxied, SL("fetchAffected"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchAll"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchAssoc"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchCol"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchGroup"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchObject"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchObjects"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchOne"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchPairs"), &__$true, PH_COPY | PH_SEPARATE);
- zephir_array_update_string(&proxied, SL("fetchValue"), &__$true, PH_COPY | PH_SEPARATE);
- if (EXPECTED(zephir_array_isset(&proxied, &method))) {
- ZEPHIR_INIT_VAR(&_0$$3);
- zephir_create_array(&_0$$3, 2, 0);
- zephir_memory_observe(&_1$$3);
- zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC);
- zephir_array_fast_append(&_0$$3, &_1$$3);
- zephir_array_fast_append(&_0$$3, &method);
- ZEPHIR_INIT_VAR(&_2$$3);
- ZEPHIR_INIT_VAR(&_3$$3);
- zephir_create_array(&_3$$3, 2, 0);
- ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "getstatement", NULL, 0);
- zephir_check_call_status();
- zephir_array_fast_append(&_3$$3, &_4$$3);
- ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "getbindvalues", NULL, 0);
- zephir_check_call_status();
- zephir_array_fast_append(&_3$$3, &_4$$3);
- zephir_fast_array_merge(&_2$$3, &_3$$3, ¶ms);
- ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0$$3, &_2$$3);
- zephir_check_call_status();
- RETURN_MM();
- }
- ZEPHIR_INIT_VAR(&_5);
- object_init_ex(&_5, spl_ce_BadMethodCallException);
- ZEPHIR_INIT_VAR(&_6);
- ZEPHIR_CONCAT_SVS(&_6, "Unknown method: [", &method, "]");
- ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 76, &_6);
- zephir_check_call_status();
- zephir_throw_exception_debug(&_5, "phalcon/DataMapper/Query/Select.zep", 83);
- ZEPHIR_MM_RESTORE();
- return;
-}
-static PHP_METHOD(Phalcon_DataMapper_Query_Select, andHaving)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _0;
- zval condition;
- zval *this_ptr = getThis();
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(condition)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &condition_param, &value, &type_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
- }
- if (!type_param) {
- type = -1;
- } else {
- }
- ZVAL_LONG(&_0, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "having", NULL, 0, &condition, value, &_0);
- zephir_check_call_status();
- RETURN_THIS();
-}
-static PHP_METHOD(Phalcon_DataMapper_Query_Select, asAlias)
+ZEPHIR_INIT_CLASS(Phalcon_Tag_Select)
{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zval *asAlias_param = NULL;
- zval asAlias;
- zval *this_ptr = getThis();
+ ZEPHIR_REGISTER_CLASS(Phalcon\\Tag, Select, phalcon, tag_select, phalcon_tag_select_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
- ZVAL_UNDEF(&asAlias);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_STR(asAlias)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &asAlias_param);
- zephir_get_strval(&asAlias, asAlias_param);
- zephir_update_property_zval(this_ptr, ZEND_STRL("asAlias"), &asAlias);
- RETURN_THIS();
+ return SUCCESS;
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Select, appendHaving)
+static PHP_METHOD(Phalcon_Tag_Select, selectField)
{
+ zend_bool _1$$19;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, _0, _1;
- zval condition;
- zval *this_ptr = getThis();
+ zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL;
+ zend_long ZEPHIR_LAST_CALL_STATUS;
+ zval *parameters, parameters_sub, *data = NULL, data_sub, __$null, params, name, id, value, useEmpty, code, emptyValue, emptyText, options, using, _2, _3, _0$$5, _4$$22, _5$$22, _6$$23, _8$$23, _9$$23, _10$$25, _12$$25, _13$$25;
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(¶meters_sub);
+ ZVAL_UNDEF(&data_sub);
ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&_0);
- ZVAL_UNDEF(&_1);
+ ZVAL_UNDEF(¶ms);
+ ZVAL_UNDEF(&name);
+ ZVAL_UNDEF(&id);
+ ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&useEmpty);
+ ZVAL_UNDEF(&code);
+ ZVAL_UNDEF(&emptyValue);
+ ZVAL_UNDEF(&emptyText);
+ ZVAL_UNDEF(&options);
+ ZVAL_UNDEF(&using);
+ ZVAL_UNDEF(&_2);
+ ZVAL_UNDEF(&_3);
+ ZVAL_UNDEF(&_0$$5);
+ ZVAL_UNDEF(&_4$$22);
+ ZVAL_UNDEF(&_5$$22);
+ ZVAL_UNDEF(&_6$$23);
+ ZVAL_UNDEF(&_8$$23);
+ ZVAL_UNDEF(&_9$$23);
+ ZVAL_UNDEF(&_10$$25);
+ ZVAL_UNDEF(&_12$$25);
+ ZVAL_UNDEF(&_13$$25);
bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(condition)
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL(parameters)
Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
+ Z_PARAM_ZVAL_OR_NULL(data)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &condition_param, &value, &type_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
+ zephir_fetch_params(1, 1, 1, ¶meters, &data);
+ if (!data) {
+ data = &data_sub;
+ data = &__$null;
}
- if (!type_param) {
- type = -1;
+ if (Z_TYPE_P(parameters) != IS_ARRAY) {
+ ZEPHIR_INIT_VAR(¶ms);
+ zephir_create_array(¶ms, 2, 0);
+ zephir_array_fast_append(¶ms, parameters);
+ zephir_array_fast_append(¶ms, data);
} else {
+ ZEPHIR_CPY_WRT(¶ms, parameters);
+ }
+ zephir_memory_observe(&id);
+ if (!(zephir_array_isset_long_fetch(&id, ¶ms, 0, 0))) {
+ zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag/Select.zep", 50);
+ zephir_array_update_long(¶ms, 0, &_0$$5, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
+ }
+ if (!(zephir_memnstr_str(&id, SL("["), "phalcon/Tag/Select.zep", 56))) {
+ if (!(zephir_array_isset_string(¶ms, SL("id")))) {
+ zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE);
}
- ZEPHIR_INIT_VAR(&_0);
- ZVAL_STRING(&_0, "HAVING");
- ZVAL_LONG(&_1, type);
- ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendcondition", NULL, 0, &_0, &condition, value, &_1);
- zephir_check_call_status();
- RETURN_THIS();
-}
-
-static PHP_METHOD(Phalcon_DataMapper_Query_Select, appendJoin)
-{
- zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
- zend_long type, ZEPHIR_LAST_CALL_STATUS;
- zval *condition_param = NULL, *value = NULL, value_sub, *type_param = NULL, __$null, end, key, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _0$$3, _1$$3, _2$$3;
- zval condition;
- zval *this_ptr = getThis();
-
- ZVAL_UNDEF(&condition);
- ZVAL_UNDEF(&value_sub);
- ZVAL_NULL(&__$null);
- ZVAL_UNDEF(&end);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&_3);
- ZVAL_UNDEF(&_4);
- ZVAL_UNDEF(&_5);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_10);
- ZVAL_UNDEF(&_11);
- ZVAL_UNDEF(&_12);
- ZVAL_UNDEF(&_0$$3);
- ZVAL_UNDEF(&_1$$3);
- ZVAL_UNDEF(&_2$$3);
- bool is_null_true = 1;
- ZEND_PARSE_PARAMETERS_START(1, 3)
- Z_PARAM_STR(condition)
- Z_PARAM_OPTIONAL
- Z_PARAM_ZVAL_OR_NULL(value)
- Z_PARAM_LONG(type)
- ZEND_PARSE_PARAMETERS_END();
- ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
- zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 2, &condition_param, &value, &type_param);
- zephir_get_strval(&condition, condition_param);
- if (!value) {
- value = &value_sub;
- value = &__$null;
}
- if (!type_param) {
- type = -1;
+ zephir_memory_observe(&name);
+ if (!(zephir_array_isset_string_fetch(&name, ¶ms, SL("name"), 0))) {
+ zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE);
} else {
+ if (!(zephir_is_true(&name))) {
+ zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE);
}
- if (!(ZEPHIR_IS_EMPTY(value))) {
- zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY);
- ZVAL_LONG(&_2$$3, type);
- ZEPHIR_CALL_METHOD(&_1$$3, &_0$$3, "bindinline", NULL, 0, value, &_2$$3);
+ }
+ zephir_memory_observe(&value);
+ if (!(zephir_array_isset_string_fetch(&value, ¶ms, SL("value"), 0))) {
+ ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", NULL, 0, &id, ¶ms);
zephir_check_call_status();
- zephir_concat_self(&condition, &_1$$3);
+ } else {
+ zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE);
}
- zephir_read_property(&_3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_4, &_3, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 158);
- ZEPHIR_CALL_FUNCTION(&end, "array_key_last", NULL, 40, &_4);
- zephir_check_call_status();
- zephir_read_property(&_5, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY);
- zephir_array_fetch_string(&_6, &_5, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 159);
- zephir_array_fetch(&_7, &_6, &end, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 159);
- ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 40, &_7);
+ zephir_memory_observe(&useEmpty);
+ if (zephir_array_isset_string_fetch(&useEmpty, ¶ms, SL("useEmpty"), 0)) {
+ zephir_memory_observe(&emptyValue);
+ if (!(zephir_array_isset_string_fetch(&emptyValue, ¶ms, SL("emptyValue"), 0))) {
+ ZEPHIR_INIT_NVAR(&emptyValue);
+ ZVAL_STRING(&emptyValue, "");
+ } else {
+ zephir_array_unset_string(¶ms, SL("emptyValue"), PH_SEPARATE);
+ }
+ zephir_memory_observe(&emptyText);
+ if (!(zephir_array_isset_string_fetch(&emptyText, ¶ms, SL("emptyText"), 0))) {
+ ZEPHIR_INIT_NVAR(&emptyText);
+ ZVAL_STRING(&emptyText, "Choose...");
+ } else {
+ zephir_array_unset_string(¶ms, SL("emptyText"), PH_SEPARATE);
+ }
+ zephir_array_unset_string(¶ms, SL("useEmpty"), PH_SEPARATE);
+ }
+ zephir_memory_observe(&options);
+ if (!(zephir_array_isset_long_fetch(&options, ¶ms, 1, 0))) {
+ ZEPHIR_CPY_WRT(&options, data);
+ }
+ if (Z_TYPE_P(&options) == IS_OBJECT) {
+ zephir_memory_observe(&using);
+ if (UNEXPECTED(!(zephir_array_isset_string_fetch(&using, ¶ms, SL("using"), 0)))) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter is required", "phalcon/Tag/Select.zep", 101);
+ return;
+ }
+ _1$$19 = Z_TYPE_P(&using) != IS_ARRAY;
+ if (_1$$19) {
+ _1$$19 = Z_TYPE_P(&using) != IS_OBJECT;
+ }
+ if (UNEXPECTED(_1$$19)) {
+ ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter should be an array", "phalcon/Tag/Select.zep", 107);
+ return;
+ }
+ }
+ zephir_array_unset_string(¶ms, SL("using"), PH_SEPARATE);
+ ZEPHIR_INIT_VAR(&_3);
+ ZVAL_STRING(&_3, "
"));
+ RETURN_CCTOR(&code);
}
-static PHP_METHOD(Phalcon_DataMapper_Query_Select, columns)
+static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray)
{
zend_string *_3;
zend_ulong _2;
zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
+ zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL;
zend_long ZEPHIR_LAST_CALL_STATUS;
- zval *columns_param = NULL, key, value, *_0, _1, _6, _7, _8, _9, _4$$5, _5$$8;
- zval columns, localColumns;
- zval *this_ptr = getThis();
+ zval closeOption, _12$$8, _13$$8, _22$$16, _23$$16;
+ zval *data_param = NULL, *value, value_sub, *closeOption_param = NULL, strValue, strOptionValue, code, optionValue, optionText, escaped, *_0, _1, _5$$4, _6$$4, _8$$4, _9$$4, _10$$6, _11$$7, _14$$9, _15$$10, _16$$12, _17$$12, _18$$12, _19$$12, _20$$14, _21$$15, _24$$17, _25$$18;
+ zval data;
- ZVAL_UNDEF(&columns);
- ZVAL_UNDEF(&localColumns);
- ZVAL_UNDEF(&key);
- ZVAL_UNDEF(&value);
+ ZVAL_UNDEF(&data);
+ ZVAL_UNDEF(&value_sub);
+ ZVAL_UNDEF(&strValue);
+ ZVAL_UNDEF(&strOptionValue);
+ ZVAL_UNDEF(&code);
+ ZVAL_UNDEF(&optionValue);
+ ZVAL_UNDEF(&optionText);
+ ZVAL_UNDEF(&escaped);
ZVAL_UNDEF(&_1);
- ZVAL_UNDEF(&_6);
- ZVAL_UNDEF(&_7);
- ZVAL_UNDEF(&_8);
- ZVAL_UNDEF(&_9);
- ZVAL_UNDEF(&_4$$5);
- ZVAL_UNDEF(&_5$$8);
- ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_ARRAY(columns)
+ ZVAL_UNDEF(&_5$$4);
+ ZVAL_UNDEF(&_6$$4);
+ ZVAL_UNDEF(&_8$$4);
+ ZVAL_UNDEF(&_9$$4);
+ ZVAL_UNDEF(&_10$$6);
+ ZVAL_UNDEF(&_11$$7);
+ ZVAL_UNDEF(&_14$$9);
+ ZVAL_UNDEF(&_15$$10);
+ ZVAL_UNDEF(&_16$$12);
+ ZVAL_UNDEF(&_17$$12);
+ ZVAL_UNDEF(&_18$$12);
+ ZVAL_UNDEF(&_19$$12);
+ ZVAL_UNDEF(&_20$$14);
+ ZVAL_UNDEF(&_21$$15);
+ ZVAL_UNDEF(&_24$$17);
+ ZVAL_UNDEF(&_25$$18);
+ ZVAL_UNDEF(&closeOption);
+ ZVAL_UNDEF(&_12$$8);
+ ZVAL_UNDEF(&_13$$8);
+ ZVAL_UNDEF(&_22$$16);
+ ZVAL_UNDEF(&_23$$16);
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_ARRAY(data)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_STR(closeOption)
ZEND_PARSE_PARAMETERS_END();
ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0);
zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__);
- zephir_fetch_params(1, 1, 0, &columns_param);
- zephir_get_arrval(&columns, columns_param);
- ZEPHIR_INIT_VAR(&localColumns);
- array_init(&localColumns);
- zephir_is_iterable(&columns, 0, "phalcon/DataMapper/Query/Select.zep", 187);
- if (Z_TYPE_P(&columns) == IS_ARRAY) {
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columns), _2, _3, _0)
+ zephir_fetch_params(1, 3, 0, &data_param, &value, &closeOption_param);
+ zephir_get_arrval(&data, data_param);
+ zephir_get_strval(&closeOption, closeOption_param);
+ ZEPHIR_INIT_VAR(&code);
+ ZVAL_STRING(&code, "");
+ zephir_is_iterable(&data, 0, "phalcon/Tag/Select.zep", 186);
+ if (Z_TYPE_P(&data) == IS_ARRAY) {
+ ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0)
{
- ZEPHIR_INIT_NVAR(&key);
+ ZEPHIR_INIT_NVAR(&optionValue);
if (_3 != NULL) {
- ZVAL_STR_COPY(&key, _3);
+ ZVAL_STR_COPY(&optionValue, _3);
} else {
- ZVAL_LONG(&key, _2);
+ ZVAL_LONG(&optionValue, _2);
}
- ZEPHIR_INIT_NVAR(&value);
- ZVAL_COPY(&value, _0);
- if (Z_TYPE_P(&key) == IS_LONG) {
- zephir_array_append(&localColumns, &value, PH_SEPARATE, "phalcon/DataMapper/Query/Select.zep", 181);
+ ZEPHIR_INIT_NVAR(&optionText);
+ ZVAL_COPY(&optionText, _0);
+ ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 286, &optionValue);
+ zephir_check_call_status();
+ if (Z_TYPE_P(&optionText) == IS_ARRAY) {
+ ZEPHIR_INIT_NVAR(&_5$$4);
+ ZEPHIR_GET_CONSTANT(&_5$$4, "PHP_EOL");
+ ZEPHIR_CALL_SELF(&_6$$4, "optionsfromarray", &_7, 0, &optionText, value, &closeOption);
+ zephir_check_call_status();
+ ZEPHIR_INIT_NVAR(&_8$$4);
+ ZEPHIR_GET_CONSTANT(&_8$$4, "PHP_EOL");
+ ZEPHIR_INIT_NVAR(&_9$$4);
+ ZEPHIR_CONCAT_SVSVVSV(&_9$$4, "\t
", &_8$$4);
+ zephir_concat_self(&code, &_9$$4);
+ continue;
+ }
+ if (Z_TYPE_P(value) == IS_ARRAY) {
+ if (zephir_fast_in_array(&optionValue, value)) {
+ ZEPHIR_INIT_NVAR(&_10$$6);
+ ZEPHIR_CONCAT_SVSVV(&_10$$6, "\t
", &_18$$12);
+ zephir_concat_self(&code, &_19$$12);
+ continue;
+ }
+ if (Z_TYPE_P(value) == IS_ARRAY) {
+ if (zephir_fast_in_array(&optionValue, value)) {
+ ZEPHIR_INIT_NVAR(&_20$$14);
+ ZEPHIR_CONCAT_SVSVV(&_20$$14, "\t